From b087826bad60fa4f78e2d55c994b37059f12040c Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Thu, 5 Apr 2018 00:41:25 +0200 Subject: [PATCH] Create test overflow solidity file --- tests/testdata/inputs/overflow.sol | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/testdata/inputs/overflow.sol diff --git a/tests/testdata/inputs/overflow.sol b/tests/testdata/inputs/overflow.sol new file mode 100644 index 00000000..f61a8b0e --- /dev/null +++ b/tests/testdata/inputs/overflow.sol @@ -0,0 +1,20 @@ +contract Over { + + mapping(address => uint) balances; + uint public totalSupply; + + function Token(uint _initialSupply) { + balances[msg.sender] = totalSupply = _initialSupply; + } + + function sendeth(address _to, uint _value) public returns (bool) { + require(balances[msg.sender] - _value >= 0); + balances[msg.sender] -= _value; + balances[_to] += _value; + return true; + } + + function balanceOf(address _owner) public constant returns (uint balance) { + return balances[_owner]; + } +}