help,Fill in the _rate of ERC20

It has brought trouble to everyone. I am a pure novice. I hope that some brothers can guide me. I plan to sell my tokens at: 0.01$, ETH chain. How much value should be filled here?

1 Like

Hey @lu_dr can you share the code?

1 Like

0.01 / current eth price * 10^18

0.01 / current eth price * 10^18

@FreezyEx

I need to check the code to see how it is written

 uint256 amtOut;
         if(token != address(0)){
             require(tokenWL[token] == true, "Presale: Token not whitelisted");
             // uint tokenDec = IERC20(token).decimals();
             uint256 price = tokenPrices[token];
             amtOut = amount.mul(10**saleTokenDec).div(price);
         }
         else{
             amtOut = amount.mul(10**saleTokenDec).div(rate);
         }
         return amtOut;
     }

@FreezyEx

Please share the whole function. Is it top-secret? It's hard to help otherwise

1 Like