0

I have this code :

function finish(address _teamFund, address _ecosystemFund, address _bountyFund) public onlyOwner {

      require(!isFinalized);
      uint256 alreadyMinted = token.totalSupply();
      require(alreadyMinted < maxTokens);

      uint256 unsoldTokens = totalTokensForSale - alreadyMinted;
      if (unsoldTokens > 0) {
        tokensForEcosystem = tokensForEcosystem + unsoldTokens;
      }

      token.mint(_teamFund,tokensForTeam);
      token.mint(_ecosystemFund,tokensForEcosystem);
      token.mint(_bountyFund,tokensForBounty);
      finalize();
  }

Remix giving warning

</i>: Could potentially lead to re-entrancy vulnerability. <br/><i>Note:</i> Modifiers are currently not considered by this static analysis.

for these 3 lines :

uint256 unsoldTokens = totalTokensForSale - alreadyMinted;
          if (unsoldTokens > 0) {
            tokensForEcosystem = tokensForEcosystem + unsoldTokens;
          }

I tried with safemath also , but didn't get any success.

uint256 unsoldTokens = totalTokensForSale.sub(alreadyMinted);
    if (unsoldTokens > 0) {
      tokensForEcosystem = tokensForEcosystem.add(unsoldTokens);
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.