how do you reference your own contract address in vyper, for example in solidity you would do something like that:
address(this)
Is there a way to do the same in vyper? Thanks.
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityhow do you reference your own contract address in vyper, for example in solidity you would do something like that:
address(this)
Is there a way to do the same in vyper? Thanks.
The Vyper equivalent to Solidity's address(this)
is self
. You can verify it with this simple contract:
@public
@constant
def foo() -> address:
return self