0

First time here. I would like to create a BEP20 token. I don't have experience with Solidity, that's why I used a tool https://cointool.app/ to generate token code.

The code is here: https://pastebin.com/ASrNehCE

First of all there is a problem on line 91. The return msg.sender is showing the error below:

Return argument type address is not implicitly convertible to expected type (type of first return variable) address payable.

Code:

 abstract contract Context {
      function _msgSender() internal view virtual returns (address payable) {
          return msg.sender;
      }

      function _msgData() internal view virtual returns (bytes memory) {
          this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
          return msg.data;
      }
  }

I would also like to know if this is production ready and safe to use for a real live token. If not, can anybody suggest any improvements?

5
  • The link to the code doesn't work, it is a link to an old version of remix.ethereum.org. With solc v0.8 msg.sender has to be casted to payable, payable(msg.sender), see docs.soliditylang.org/en/v0.8.4/080-breaking-changes.html for other changes.
    – Ismael
    Jun 16 at 3:54
  • Ok. Sorry for that. Where can I host this code so I can share it?
    – William
    Jun 16 at 5:14
  • Just be aware that longer code means less people will want to read it. Try to create a small reproducible example. Having said that you can use a github.com repo to host the code.
    – Ismael
    Jun 16 at 6:05
  • I understand ... but this is the code that I have from CoinTool ... there's no way to create a smaller example since it will all be used.
    – William
    Jun 16 at 8:09
  • I got it up here: pastebin.com/ASrNehCE. Didn't change anything in it. Exactly what CoinTool generates.
    – William
    Jun 16 at 8:10

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.