0

If I create an ERC20 token using a smart contract, how do I reference a contracts ethereum balance? Or do I just need to update some value like --> ethStore and then send transfers based on that value?

Thank you in advance!!

1
  • Veuillez fournir des informations complémentaires
    – zmy
    Aug 19, 2021 at 1:44

1 Answer 1

0

Prior to version 0.5.0, the contract balance would be called via: this.balance

This is now forbidden and an explicit conversion to address must be done:

address(this).balance

So just make sure which version of Solidity you are using.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.