Search code examples
smartcontractsvyper

Vyper Equivalent for solidity's address(this)


How to get the address of current contract in Vyper. In solidity address(this) is used. What is the equivalent in Vyper.

address myContractAddress;
myContractAddress = address(this);

Solution

  • It's just self, as in:

    @public
    def get_address() -> address:
        return self