This commit is contained in:
osiris account 2023-03-15 10:58:07 -07:00
parent fc5bd836fc
commit ef66198fcf
10 changed files with 7 additions and 51 deletions

5
.gitmodules vendored Normal file
View file

@ -0,0 +1,5 @@
[submodule "foundry_exploits/lib/forge-std"]
path = foundry_exploits/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/forge-std"]
branch = v1.4.0

View file

@ -1,4 +1,4 @@
# 🧱⛓☠️ blockchain hacking
# ⛓🍕 blockchain hacking
<br>

@ -0,0 +1 @@
Subproject commit a2edd39db95df7e9dd3f9ef9edc8c55fefddb6df

View file

@ -1,12 +0,0 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "forge-std/Script.sol";
contract CounterScript is Script {
function setUp() public {}
function run() public {
vm.broadcast();
}
}

View file

@ -1,14 +0,0 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
contract Counter {
uint256 public number;
function setNumber(uint256 newNumber) public {
number = newNumber;
}
function increment() public {
number++;
}
}

View file

@ -1,24 +0,0 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "forge-std/Test.sol";
import "../src/Counter.sol";
contract CounterTest is Test {
Counter public counter;
function setUp() public {
counter = new Counter();
counter.setNumber(0);
}
function testIncrement() public {
counter.increment();
assertEq(counter.number(), 1);
}
function testSetNumber(uint256 x) public {
counter.setNumber(x);
assertEq(counter.number(), x);
}
}