mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
This commit is contained in:
committed by
Christian Parpart
parent
7609710d4f
commit
9fb835b710
@@ -2398,11 +2398,11 @@ void TypeChecker::endVisit(Literal const& _literal)
|
||||
_literal.annotation().type = make_shared<AddressType>(StateMutability::Payable);
|
||||
|
||||
string msg;
|
||||
if (_literal.value().length() != 42) // "0x" + 40 hex digits
|
||||
if (_literal.valueWithoutUnderscores().length() != 42) // "0x" + 40 hex digits
|
||||
// looksLikeAddress enforces that it is a hex literal starting with "0x"
|
||||
msg =
|
||||
"This looks like an address but is not exactly 40 hex digits. It is " +
|
||||
to_string(_literal.value().length() - 2) +
|
||||
to_string(_literal.valueWithoutUnderscores().length() - 2) +
|
||||
" hex digits.";
|
||||
else if (!_literal.passesAddressChecksum())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user