solidity/test/libsolidity/semanticTests/array/copying/bytes_inside_mappings.sol
Daniel Kirchner 44da8507b1 Change default EVM version to Shanghai.
Co-authored-by: Rodrigo Q. Saramago <rodrigoqsaramago@gmail.com>
2023-05-08 16:34:23 +02:00

22 lines
676 B
Solidity

contract c {
function set(uint key) public returns (bool) { data[key] = msg.data; return true; }
function copy(uint from, uint to) public returns (bool) { data[to] = data[from]; return true; }
mapping(uint => bytes) data;
}
// ----
// set(uint256): 1, 2 -> true
// gas irOptimized: 110574
// gas legacy: 111312
// gas legacyOptimized: 110744
// set(uint256): 2, 2, 3, 4, 5 -> true
// gas irOptimized: 177525
// gas legacy: 178314
// gas legacyOptimized: 177719
// storageEmpty -> 0
// copy(uint256,uint256): 1, 2 -> true
// storageEmpty -> 0
// copy(uint256,uint256): 99, 1 -> true
// storageEmpty -> 0
// copy(uint256,uint256): 99, 2 -> true
// storageEmpty -> 1