i create instance of IERC20 public token in some contract.
How can i get the same address of token contract from the instance? token.this? token.address?
All contract objects can be casted as an address in Solidity:
const address myAddres = address(myContract);
However usually you do not need to do this, but you can pass the IERC20
object as is between functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With