Created
May 20, 2020 01:03
-
-
Save PaulRBerg/d39a2479e45e61f1afc15e229a86bb07 to your computer and use it in GitHub Desktop.
Dummy smart contract used for reproducing a Buidler bug
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
// SPDX-License-Identifier: LGPL-3.0-or-later | |
pragma solidity ^0.6.8; | |
contract Counter { | |
uint256 public count = 0; | |
event CountedTo(uint256 number); | |
function countUp() public returns (uint256) { | |
uint256 newCount = count + 1; | |
require(newCount > count, "Uint256 overflow"); | |
count = newCount; | |
emit CountedTo(count); | |
return count; | |
} | |
function countDown() public returns (uint256) { | |
uint256 newCount = count - 1; | |
require(newCount < count, "Uint256 underflow"); | |
count = newCount; | |
emit CountedTo(count); | |
return count; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment