solidity/test/libsolidity/semanticTests/abiEncoderV1/decode_slice.sol
2020-05-26 13:30:37 -05:00

13 lines
397 B
Solidity

contract C {
function f(uint256 a, uint256 b) external returns (uint256 c, uint256 d, uint256 e, uint256 f) {
(c, d) = abi.decode(msg.data[4:], (uint256, uint256));
e = abi.decode(msg.data[4 : 4 + 32], (uint256));
f = abi.decode(msg.data[4 + 32 : 4 + 32 + 32], (uint256));
}
}
// ====
// compileViaYul: also
// ----
// f(uint256,uint256): 42, 23 -> 42, 23, 42, 23