solidity/test/libsolidity/semanticTests/array/push/array_push.sol
2021-04-08 18:37:24 +02:00

24 lines
441 B
Solidity

contract c {
uint256[] data;
function test()
public
returns (uint256 x, uint256 y, uint256 z, uint256 l)
{
data.push(5);
x = data[0];
data.push(4);
y = data[1];
data.push(3);
l = data.length;
z = data[2];
}
}
// ====
// compileViaYul: also
// ----
// test() -> 5, 4, 3, 3
// gas irOptimized: 110985
// gas legacy: 111938
// gas legacyOptimized: 110528