- NFTContract.sol | NFT generator contract
- Used Plugins
- AccessControl
- ERC721
- ERC721URIStorage
- IERC20
- Functions
- pre_sale | Mints token with some Metadata
- public_sale | Mints token with some Metadata
- getAllOwners | Returns the address of each owner of each sold token.
- Used Plugins
- NFTControl.sol
- Used Plugins
- AccessControl
- ERC20
- ERC20Burnable
- IERC721
- Functions
- mint | Mints reward tokens for staked NFT
- isStakeholder | Returns true if provided address is staker
- stakeOf | Returns stake details for provided address
- stake | Locks provided NFT in contract until locktime end
- claim | Claims staked NFT and reward for staking
- Used Plugins
- RewardToken.sol
- Used Plugins
- ERC20
- Used Plugins
For better code understanding check the contract files and comments.
There are 2 Roles in contract:
- DEFAULT_ADMIN_ROLE This is the role for owner / deployer of the contract.
- MINTER_ROLE
Is required for
pre_sale
function call.
npm install
- Installs all packages required for project
npx hardhat test
- Runs all unit tests from folder test
npx hardhat run scripts/deploy.js
- Deploys the contract to local blockchain
npx hardhat run scripts/deploy.js --network kovan --network kovan
- Deploys the contract to Kovan testnet
npx hardhat run scripts/deploy.js --network kovan --network mainnet
- Deploys the contract to Ethereum mainnet
BEFORE DEPLOYING TO TESTNET OR MAINNET CONFIGURE THE secrets.json
FILE