Skip to content

Instantly share code, notes, and snippets.

@gretzke
Last active December 18, 2018 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gretzke/f1a1a8b6d662e2da4d137e79271422cf to your computer and use it in GitHub Desktop.
Save gretzke/f1a1a8b6d662e2da4d137e79271422cf to your computer and use it in GitHub Desktop.
array gas estimation
pragma solidity ^0.4.24;
contract Test {
uint256[] x = [1,2,3];
uint256[] y = [1];
uint256[] x1 = [1,2,3];
uint256[] y1 = [1];
function testx() public {
delete x;
}
function testy() public {
delete y;
}
function testx1() public {
x1.length = 0;
}
function testy1() public {
y1.length = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment