Created
May 5, 2019 19:40
-
-
Save fifiteen82726/5e04ecff1e1c4a0c3394bbae578d83d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.17; | |
contract ArrayOverflow{ | |
uint256 public target = 100; | |
uint256[] public array = [9,8]; | |
// _ 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