Anyone know what this error means in Remix - Solidity IDE?

address public constant WALLET = "A_WALLET_ADDRESS";

TypeError: Type literal_string "A_WALLET_ADDRESS" 
is not implicitly convertible to expected type address.

It turns out the address constant did not want a quoted string

The solution was: address public constant WALLET = A_WALLET_ADDRESS;

If anyone can explain why, ill gladly accept the answer :)

I imagine its due to the strict type checking of Solidity variables. Giving "0xValidAddress" fails as its type is "string" whereas 0xValidAddress passes the type check as a valid Ethereum address, therefore is allowed to pass on

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.