solidity/test/libsolidity/semanticTests/cleanup/cleanup_address_types_v2.sol
2020-03-26 17:47:36 +01:00

19 lines
622 B
Solidity

pragma experimental ABIEncoderV2;
// Checks that address types are properly cleaned before they are compared.
contract C {
function f(address a) public returns (uint256) {
if (a != 0x1234567890123456789012345678901234567890) return 1;
return 0;
}
function g(address payable a) public returns (uint256) {
if (a != 0x1234567890123456789012345678901234567890) return 1;
return 0;
}
}
// ----
// f(address): 0xffff1234567890123456789012345678901234567890 -> FAILURE # We input longer data on purpose.#
// g(address): 0xffff1234567890123456789012345678901234567890 -> FAILURE