Solidity contracts based on ERC20
, ERC721
. Presale
, Vesting
and
Staking
contracts for ERC20 token.
├─ .github
├─ .vscode
├─ contracts # solidity contracts
├─ scripts # deploy scripts
| └─ deploymentParams # parameters for contract deployment
├─ test # test scripts
├─ .env
├─ .gitignore
├─ .npmignore
├─ .prettierignore
├─ .prettierrc
├─ .solhint.json
├─ .solhitignore
├─ hardhat.config.ts
├─ package.json
├─ README.md
├─ tsconfig.json
└─ yarn.lock
- Clone Repo:
- Install node modules:
yarn
To try out deployment or verification, you first need to set configuration.
In this project, copy the .env.example file to a file named .env, and then edit it to fill in the details. Enter your Etherscan API key, your network node URL (eg from Alchemy), and the private key of the account which will send the deployment transaction. With a valid .env file in place, first deploy your contract:
Example:
ETHERSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1
MAINNET_RPC=https://polygon-mainnet.g.alchemy.com/v2/zcNIdlPU5Vn-2U0uQpfi0AZf11F4rrV5
MUMBAI_RPC=https://polygon-mumbai.g.alchemy.com/v2/zcNIdlPU5Vn-2U0uQpfi0AZf11F4rrV5
PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1
- INK contract
yarn deploy-ink:mainnet
yarn deploy-ink:mumbai
- INKNFT contract
yarn deploy-inknft:mainnet
yarn deploy-inknft:mumbai
- Presale contract
-
For ERC20:
yarn deploy-presale-erc20:mainnet yarn deploy-presale-erc20:mumbai
-
For ETH:
yarn deploy-presale-eth:mainnet yarn deploy-presale-eth:mumbai
- Vesting contract
yarn deploy-vesting:mainnet
yarn deploy-vesting:mumbai
- StakingINK contract
yarn deploy-staking-ink:mainnet
yarn deploy-staking-ink:mumbai
Then, copy the deployment address and network name, then paste it in to
replace DEPLOYED_CONTRACT_ADDRESS
and NETWORK
in this command:
yarn verify:NETWORK DEPLOYED_CONTRACT_ADDRESS
NETWORK
can be mainnet
or mumbai
.
EXAMPLE:
yarn verify:mainnet 0xABC123ABC123ABC123ABC123ABC123ABC1
yarn test