0

The Vyper docs say that one can define a constant like this:

TOTAL_SUPPLY: constant(uint256) = 10000000

but what about defining an constant with type address ?

This doesn't compile:

CONTRACT_ADDRESS: constant(address) = '0x251C4A81963B45b86330F5483A22D041b455d2f0'

1 Answer 1

0

this compiles successfully:

CONTRACT_ADDRESS: constant(address) = 0x251C4A81963B45b86330F5483A22D041b455d2f0

The address must be checksummed first.

For example in python this can be done like this:

web3.toChecksumAddress('0x251C4A81963B45b86330F5483A22D041b455d2f0')

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.