A repository of publicly verifiable token Sale contracts

Overview

Token-Sale-Plutus-Contract

A repository of publicly verifiable token sale and royalty contracts. This will be the storage solution since it is easily attainable and usable. A more decentralized solution will come in the future but for now this will be the solution.

The repository will work in a very similar fashion to the Cardano Foundation's token registry. It will allow users to add their contribution to the repository so everyone can use a collection of trusted smart contracts. The goal is to create a micro-ecosystem of contracts that are simple enough to read and quick to compile.

To add a token sale contract to the repository: please fork the repo, add in the contract addition, public verification key, and compiled plutus script into the correct contracts folder following the directions below then use a pull request to add in your contribution into the smart contract repository when finished.

The folder containing the contract to be compiled will be placed in the correct contracts folder. The name of the folder will be the pubkeyhash, allowing a quick search method for a single seller, followed by an under score then the price of the shop in lovelace. Please see the example_token_sale_addition or example_royalty_sale_addition folders for an example additions.

Usage

After forking the repo, clone the repo onto your system. Make a copy of the default folder into the correct contracts folder. Change the name of the copied folder into the pubKeyHash of the wallet that will be receiving payments for tokens sold followed by the price of tokens inside this contract. Additions will not be granted if the naming scheme is not followed. Place a copy of the wallets vkey, the public verification key, and any additional required information into the copied folder.

A user will only need to edit the token-sale/src/TokenSale.hs or token-sale-with-royalty/src/TokenSaleWithRoyalty.hs files. The haskell code requires only few changes, any other changes will result in a failed contract addition. The user will only need to update the pubkeyhash and the price of the tokens. After the changes are made to the TokenSale.hs or TokenSaleWithRoyalty.hs file, the user will need to compile the Haskell into Plutus such that other users can verify the correct output as well as have the correct plutus script file for usage.

Finding the public key hash

The user will be required to get the pubKeyHash using the cardano-cli. This will be used to name the folder inside the contracts folder.

cardano-cli address key-hash --payment-verification-key-file FILE # Filepath of the payment verification key.
# or use this command depending on the use case
cardano-cli address key-hash --payment-verification-key STRING    # Payment verification key (Bech32-encoded)
# For additional help please check out: cardano-cli address key-hash --help

How the contract works

The contract is very simple. To spend the UTxo of the token inside the smart contract. The buyer will attach the correct Datum and will create two UTxOs. One UTxo will go directly to the seller with the predefined lovelace amount and the other UTxo will be the token being sent to the buyer's address. The datum value is known before hand because it follows the standard of hashing the hash of the concatentation of the policy id and token name. Please refer to scripts/transaction.py file,

FINGERPRINT = get_token_identifier(policy_id, token_name)
DATUM_HASH  = get_hash_value('"{}"'.format(FINGERPRINT)).replace('\n', '')

NOTE: Tokens inside these smart contracts can only be removed with a succesful validation i.e. the token must be purchased. If a seller wants to remove their token from a smart contract then they must purchase the token from themselves.

Using the App

The app is designed to be the frontend for interacting with the collection of smart contracts. The user has the choice of working with contracts by hand or by using the app provided in the app folder. The app is based around running a local webserver and displaying the tokens for sale in a convenient way. Please refer to the Application_Guide.md for more information.

You might also like...
Web3 Ethereum DeFi toolkit for smart contracts, Uniswap and PancakeSwap trades, Ethereum JSON-RPC utilities, wallets and automated test suites.
Web3 Ethereum DeFi toolkit for smart contracts, Uniswap and PancakeSwap trades, Ethereum JSON-RPC utilities, wallets and automated test suites.

Web3 Ethereum Defi This project contains common Ethereum smart contracts and utilities, for trading, wallets,automated test suites and backend integra

A Discord token stealer app written in Python 3.

Discord Token Stealer A Discord token stealer app written in Python 3. This version of the grabber only supports Windows. Features No local caching Tr

Discord Token Generator of a project - Some stupids ppl are trying to leak it so i'm leaking faster :)

Original creator: Rolf (dort) HCaptcha Bypasser: h0nde Shark.Solar Discord Token Generator of a project - Some stupids ppl are trying to leak it so i'

A simple Telegram bot, written in Python, that you can use to shill (i.e. send messages) your token, or whatever, to channels.
A simple Telegram bot, written in Python, that you can use to shill (i.e. send messages) your token, or whatever, to channels.

Telegram Shill Bot Ever wanted a Shill Bot but wankers keep scamming for one OR wanted to charge you an arm and a leg? This is a simple bot written in

πŸ–₯️ Windows Batch and powershell Discord Token grabber. Made for Troll (lmao)
πŸ–₯️ Windows Batch and powershell Discord Token grabber. Made for Troll (lmao)

Batched-Grabber Windows Batch and powershell Discord Token grabber. Made for Troll ! Setup. 1. pip(3) install numpy colored 2. python(3) Batched.py 3.

⚑ A really fast and powerful Discord Token Checker

discord-token-checker ⚑ A really fast and powerful Discord Token Checker How To Use? Do pip install -r requirements.txt in your command prompt Make to

All Tools In One is a Script Developed with Python3. It gathers a total of 14 Discord tools (including a RAT, a Raid Tool, a Token Grabber, a Crash Video Maker, etc). It has a pleasant and intuitive interface to facilitate the use of all with help and explanations for each of them.
Simple discord token generator good for memberboosting your server! Uses Hcaptcha bypass

discord-tokens-generator INFO This is a Simple Discord Token Generator which creates unverified discord accounts These accounts are good for member bo

A zero-dependency Python library for getting the Kubernetes token of a AWS EKS cluster
A zero-dependency Python library for getting the Kubernetes token of a AWS EKS cluster

tokeks A zero-dependency Python library for getting the Kubernetes token of a AWS EKS cluster. No AWS CLI, third-party client or library (boto3, botoc

Comments
  • Help with cli commanding for unlocking

    Help with cli commanding for unlocking

    I am using the following command to unlock the smart contract on testnet.

    cardano-cli transaction build --alonzo-era --tx-in 4731b521ac304ad97b5f98796585e9970a241e9270f5297419f7699ead6a61af#1 --tx-in a3d24bad406fbf1839bca53576acdae6dbfdffc8035b1e4eb2dca544b8f56bab#0 --tx-in-script-file token_sale.plutus --tx-in-datum-value 42 --tx-in-redeemer-value '""' --tx-in-collateral 504b6034fff4628bbb947945bec1a876105e27f660d32e1af474abbf5bc0f23f#0 --tx-out $(cat pay
    ment.addr)+12000000 --change-address $(cat payment.addr) --protocol-params-file protocol.json --out-file unlock.raw --testnet-magic $MAGIC
    

    I receive the error, the impossible happened: RedeemerNotNeeded ScriptWitnessIndexTxIn 1

    What is the right way to redeem it.

    opened by rumourscape 4
Owner
Logical Mechanism
SPO & Dev | Donate ADA | addr1qx3l7jd3ww7u37uh3cc2gmv8xmxfpfjnxlw9e2yxmuu0q78dc8pxvuxutwq04jqdxrv2gp00xpshnejqrp5x3zplhdvqzsy6cq
Logical Mechanism
Discord-Token-Formatter - A simple script to convert discord tokens from email token to token only format

Discord-Token-Formatter A simple script to convert discord tokens from email:pas

null 2 Oct 23, 2022
Anime Streams Scrapper for Telegram Publicly Available for everyone to use

AniRocks Project Structure: ╭─ bot β”œβ”€β”€β”€β”€ plugins: directory stored all the plugins β”œβ”€β”€β”€β”€ utils: a directory of Utilities to help bot Client to create

ポキ 11 Oct 28, 2022
Buy early bsc gems with custom gas fee, slippage, amount. Auto approve token after buy. Sell buyed token with custom gas fee, slippage, amount. And more.

Pancakeswap Sniper bot Full version of Pancakeswap sniping bot used to snipe during fair coin launches. With advanced options and a graphical user int

Jesus Crypto 204 Apr 27, 2022
Discord Token Finder - Find half of your target's token with just their ID.

Discord Token Finder - Find half of your target's token with just their ID.

Ttawi 2 Apr 7, 2022
DeKrypt 24 Sep 21, 2022
HackZ-Token-Grabber-V2 - HackZ Token Grabber V2

HackZ-Token-Grabber-V2 was made by Love ❌ code βœ… β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž ??

! β„’NightMare 2 Mar 1, 2022
A discord token nuker With loads of options that will screw an account up real bad, also has inbuilt massreport, GroupChat Spammer and Token/Password/Creditcard grabber and so much more!

Installation | Important | Changelogs | Discord NOTE: Hazard is not finished! You can expect bugs, crashes, and non-working functions. Please make an

Rdimo 470 Aug 9, 2022
OpenZeppelin Contracts written in Cairo for StarkNet, a decentralized ZK Rollup

OpenZeppelin Cairo Contracts A library for secure smart contract development written in Cairo for StarkNet, a decentralized ZK Rollup. ⚠️ WARNING! ⚠️

OpenZeppelin 592 Jan 4, 2023
Scanner and Checker for Binance Scam Contracts

Money Printer by Warranty Voider well this isnt exactly a printer, but it helps you find and check new token startups. In the end its a nice scam cont

null 12 Nov 24, 2022
Microservice to extract structured information on EVM smart contracts.

Contract Serializer Microservice to extract structured information on EVM smart contract. Why? Modern NFT contracts may have different names for getPr

WeBill.io 8 Dec 19, 2022