There are 3 contracts: Manager.sol for managing, Token.sol with erc-20 implementation and ERC721.sol with ERC721 standard implementation
- Each user wishing to participate must purchase 5,000 standard "TKN" erc-20 tokens
- To participate, each user must deposit these tokens into the ManagerContract via the deposit function
- After that, the tokens will be locked for a minute, after which the user can call the createNFT function and pass the image URI as a parameter
- NFT will be minted for the user and image metadata will be added after all 10 tokens are minted
- The owner of the Token contract earns 0.0001 ETH for each "TKN" token and can withdraw "TKN" from the Manager contract after unlocking the tokens.
- ipfs
- hh coverage
- slither
- docgen
- solhint
- Users could create custom NFTS
- Total supply of 10 NFTs
- The metadata is updated only once after the tokens are minted
- 100% coverage of tests
$ cd repository_file
$ npm install
Create .env file inside project folder
- You can get your ethereum or testnet API key here,here or any other service that allow you to connect to the nodes
- You can get your private key from your wallet (Don't share your private key with untrusted parties)
- You can get your etherscan API -key here.
- TOKEN_ADDRESS(address of TKN) be available after deploying contracts
RINKEBY_API = <Rinkeby API key>
MAINNET_API = <Ethereum mainnet API key>
PRIVATE_KEY = <Private key of your wallet u want to deploy contracts from>
ETHERSCAN_KEY = <Etherscan API key in order to verify your contracts>
TOKEN_ADDRESS = <Address of deployed TKN.sol contract>
TKN_FEE = <Constructor parameter fee in TKN tokens in order to create custom NFT>
LOCKED_PERIOD = <Constructor parameter period in seconds indicating how long deposited TKN tokens will be locked>
DEPOSITORS_LIMIT = <Constructor parameter limit of depositors for the contract>
// All tokens are divided into 4 groups, each has its own percentage level of rarity
// For example: first group = 4, second = 3, third = 2 and fourth = 1.
// 4 means 40%, 3 means 30% and so on
// FIRST_GROUP_ELEMENTS + SECOND_GROUP_ELEMENTS + THIRD_GROUP_ELEMENTS + FOURTH_GROUP_ELEMENTS always must be 10
FIRST_GROUP_ELEMENTS = 4
SECOND_GROUP_ELEMENTS = 3
THIRD_GROUP_ELEMENTS = 2
FOURTH_GROUP_ELEMENTS = 1
$ npm run test
$ npm run coverage
$ npm run deployRinkeby
$ npm run deployMainnet
!!!Important!!! insert current token contract address into your environment variables
$ npm run verifyRinkebyTKN
$ npm run verifyRinkebyManager
or for mainnet
$ npm run verifyTKN
$ npm run verifyManager
In order to quick update of Metadata on opensea page just click "Refresh Metadata" button
Created by @LESKOV - feel free to contact me!