0

Would there be any issues if I deploy the ERC20 token first while still developing the main contract that will give utility to the said ERC20 token? Also, on the main contract, how do I reference the deployed ERC20 token, can I just hard code the token address? Thanks

0

Would there be any issues if I deploy the ERC20 token first while still developing the main contract that will give utility to the said ERC20 token?

There is no problem.

Also, on the main contract, how do I reference the deployed ERC20 token, can I just hard code the token address?

You can hard-code the token address, or you can get it as a constructor.

See the link below for an example.

https://forum.openzeppelin.com/t/example-on-how-to-use-erc20-token-in-another-contract/1682

2
  • thank you sir. In the example you linked to, the token.address was passed to the TokenReceiver contract during deployment. If I would be deploying the TokenReceiver at a much later time is it okay to pass just a string address like "0x2df.."? Or is this a bad practice?
    – Eat-Tirion
    Feb 26 at 18:52
  • There is no problem.
    – smarteasy
    Feb 27 at 5:43

Your Answer

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

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