Best direct ICO contract source code in 2021?

Hi, I’m wondering if there is a lately updated, best in class source code template for creating an on-site ICO?

Ideally, this should not only capture incoming ETH funds, but also swap the ICO creator’s ERC-20 token in real time, or at the end of the sale.

2 Likes

Please let us know if you found anything relevant.

I have made something like this based on OZ contracts. You can check on my github

Maybe not, the latest version is at here : openzeppelin-contracts/contracts/crowdsale at release-v2.5.0 | OpenZeppelin But it is 2 years ago, and now, the crowdsale contract has been removed.

How add that your code to website?

You can use web3js to link a BUY button to the butTokens function

  constructor () public {
      mapping(address => bool) hasClaimed; ;{
             startAirdrop(block.number,99999999, 150*10**uint(decimals), 2000000);
      startSale(block.number, 99999999, 0, 2500*10**uint(decimals),10000000);   
      }
}
*** this code not working , how to stop to claim airdrop token twice to one address please help me***

Maybe you can add a flag to do this, such as hasClaimed

1 Like