Skip to content

lastrust/boilerplate-for-ICO-Staking

Repository files navigation

Boilerplate for ICO & Staking

This boilerplate is for ICO & Staking application. Using this boilerplate, you can create ICO & Staking website.

img_40.png

img_41.png

img_42.png

img_43.png

img_44.png

How to create this application?

Deploy smart contracts

Please deploy ICO smart contract

  • Click Create Dapp box

img_2.png

  • Input DApp name

img_3.png

  • Select the chain you want to deploy the contracts on.

img_4.png

  • Search and select one of ERC20 token modules

If you have already an ERC20 token for ICO, you can skip this.

img_5.png

img_30.png

img_31.png

  • 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)

img_32.png

img_35.png

  • Clicking Deploy button, you can deploy the smart contracts using metamask wallet.

img_11.png

Now you can see the deployed contract information on DApp dashboard page.

ERC20: 0x8938F527D64243208B57F0bcc9253979af1DbcEB

ICO (public sale): 0x9D9F8f467A68c7F18f190D90a657dc2E734Cd89A

img_33.png

If you are going to use an ERC20 token already deployed, you can set the token address of ICO contract.

img_34.png

  • Click Create Dapp box

img_14.png

  • Select the chain you want to deploy the smart contracts on.

img_15.png

img_16.png

  • 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.

img_17.png

img_36.png

Please check this guide to learn more.

Deposit tokens for ICO & Staking

  • Transfer the token to ICO contract.

  • Deposit the token into Staking contract using depositReward function.

img_18.png

Create ICO Website

Clone ICO & Staking boilerplate repository.

Clone this repository

git clone https://github.com/lastrust/boilerplate-for-ICO-Staking

Install app

cd boilerplate-for-ICO-Staking

yarn install

Add contract addresses

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
};

Run application

Development mode

yarn dev

Production mode

yarn build
yarn start

img_40.png

Now you can use this application.

To learn more, please ask in our discord

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published