Skip to content

Commit

Permalink
prevent using up all gas if split about is 1 Wei
Browse files Browse the repository at this point in the history
  • Loading branch information
abbbe committed Jan 30, 2018
1 parent 38af7a6 commit b67fab8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/Splitter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ contract Splitter {
require(party1 != address(0));
require(party2 != address(0));

require(msg.value > 0);
require(msg.value > 1);
uint256 half1 = msg.value / 2;
uint256 half2 = msg.value - half1;
assert(half1 + half2 == msg.value);
Expand Down

0 comments on commit b67fab8

Please sign in to comment.