solidity/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_rational_v2.sol

16 lines
313 B
Solidity
Raw Normal View History

// Tests that rational numbers (even negative ones) are encoded properly.
2020-11-23 18:06:44 +00:00
pragma abicoder v2;
contract C {
function f() public pure returns (bytes memory) {
return abi.encode(1, -2);
}
}
// ====
// compileToEwasm: also
// compileViaYul: also
// ----
// f() -> 0x20, 0x40, 0x1, -2