This boilerplate is for ICO & Staking application. Using this boilerplate, you can create ICO & Staking website.
Please deploy ICO smart contract
- Click
Create Dapp
box
- Input DApp name
- Select the chain you want to deploy the contracts on.
- Search and select one of ERC20 token modules
If you have already an ERC20 token for ICO, you can skip this.
- Search and select ICO (Public Sale) module
- Input token name and symbol. (If you didn't select ERC20 module, you don't need to add the token name and symbol).
- Input start time and end time in timestamp type. (endTime > startTime >= currentTime)
- Clicking
Deploy
button, you can deploy the smart contracts using metamask wallet.
Now you can see the deployed contract information on DApp dashboard page.
ERC20: 0x8938F527D64243208B57F0bcc9253979af1DbcEB
ICO (public sale): 0x9D9F8f467A68c7F18f190D90a657dc2E734Cd89A
If you are going to use an ERC20 token already deployed, you can set the token address of ICO contract.
- Click
Create Dapp
box
- Select the chain you want to deploy the smart contracts on.
- Search and select Staking module.
- Input params.
_stkToken: ERC20 token address for staking.
_rewardPerBlock: Amount of reward token per block.
_feeWallet: Fee wallet address.
__maxFeePercent: Max fee percent. Here is 1000 means 100%.
_harvestFee: Harvest fee percent. Here is 1000 means 100% Harvest fee can't be more than maxFeePercent.
Please check this guide to learn more.
-
Transfer the token to ICO contract.
-
Deposit the token into Staking contract using depositReward function.
Clone this repository
git clone https://github.com/lastrust/boilerplate-for-ICO-Staking
cd boilerplate-for-ICO-Staking
yarn install
Please update src/lib/web3_constants.ts
file with the smart contract addresses you deployed.
import {BigNumber} from 'ethers';
export const Decimals = BigNumber.from(18);
export const OneToken = BigNumber.from(10).pow(Decimals);
export const ERC20TOKEN_ADDRESS = '';
export const ICO_ADDRESS = '';
export const STAKING_ADDRESS = '';
export const CHAIN_INFO = {
chainId: '', // chainId in hex format. It is 0x5 for goerli.
rpcUrls: [''], // rpc url.
chainName: '',
nativeCurrency: {
name: 'ETH',
symbol: 'ETH',
decimals: 18,
},
blockExplorerUrls: [''], // https://goerli.etherscan.io
};
Development mode
yarn dev
Production mode
yarn build
yarn start
Now you can use this application.
To learn more, please ask in our discord