Skip to content

Instantly share code, notes, and snippets.

@StErMi
Created May 2, 2022 19:44
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 StErMi/e9884269d5adcacee7dfa8ac655c8108 to your computer and use it in GitHub Desktop.
Save StErMi/e9884269d5adcacee7dfa8ac655c8108 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.13;
contract Require {
event Logme();
constructor() {}
function test1(uint256 r) external {
require(r != 0, "nope");
emit Logme();
}
function test2(uint256 r) external {
require(r > 0, "nope");
emit Logme();
}
}
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.13;
import "forge-std/Test.sol";
import "../src/Require.sol";
contract TestRequire is Test {
Require c;
function setUp() public {
c = new Require();
}
function test1() external {
c.test1(1);
}
function test2() external {
c.test2(1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment