2

How to find contract address inside a contract method? I mean the address of the instance of the contract.

1 Answer 1

4

In Solidity, the this object is implicitly defined and refers to the current contract. Just like other contract objects, you can cast it to address (eg, address(this)) to get its address.

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.