mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Added a gas test for storage costs
This commit is contained in:
parent
1839d195be
commit
d80a92752a
24
test/libsolidity/gasTests/storage_costs.sol
Normal file
24
test/libsolidity/gasTests/storage_costs.sol
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
contract C {
|
||||||
|
uint x;
|
||||||
|
function setX(uint y) public {
|
||||||
|
x = y;
|
||||||
|
}
|
||||||
|
function resetX() public {
|
||||||
|
x = 0;
|
||||||
|
}
|
||||||
|
function readX() public view returns(uint) {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ====
|
||||||
|
// optimize: true
|
||||||
|
// optimize-yul: true
|
||||||
|
// ----
|
||||||
|
// creation:
|
||||||
|
// codeDepositCost: 27000
|
||||||
|
// executionCost: 81
|
||||||
|
// totalCost: 27081
|
||||||
|
// external:
|
||||||
|
// readX(): 990
|
||||||
|
// resetX(): 5116
|
||||||
|
// setX(uint256): 20212
|
Loading…
Reference in New Issue
Block a user