0

Is there a way to save the deployed contract address into a variable. Something related to a constructor that save the deployed address into the variable?

  • 1
    You mean address(this) in Solidity? – Lauri Peltonen Feb 12 '19 at 7:56
  • Im going to test – UnexpectedCharacter Feb 12 '19 at 7:57
  • 2
    Why save it? You can get it in any function of the contract at any time. Saving address(this) into a state-variable and then using that state-variable every time you need it is going to be a lot more expensive than simply fetching address(this) into a local variable every time you need it. – goodvibration Feb 12 '19 at 9:08

This site is temporarily in read only mode and not accepting new answers.

Browse other questions tagged .