Skip to content

Instantly share code, notes, and snippets.

@fifiteen82726
Created May 5, 2019 19:40
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 fifiteen82726/2e91fa632301ef3cf55e987d75908f54 to your computer and use it in GitHub Desktop.
Save fifiteen82726/2e91fa632301ef3cf55e987d75908f54 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.17;
contract ArrayOverflow{
uint256 public target = 100;
uint256[] public array = [9,8];
bytes32 hashValue;
// constructor
// _ means local variable
function modifyArray (uint256 _index, uint256 _value){
array[_index] = _value;
}
function popLength() public{
// cause overflow
array.length--;
}
function getLength() constant returns(uint256){
return array.length;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment