mirror of
https://github.com/autistic-symposium/blockchains-security-toolkit.git
synced 2025-05-13 12:12:19 -04:00
💾
This commit is contained in:
parent
fc5bd836fc
commit
ef66198fcf
10 changed files with 7 additions and 51 deletions
5
.gitmodules
vendored
Normal file
5
.gitmodules
vendored
Normal 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
|
|
@ -1,4 +1,4 @@
|
||||||
# 🧱⛓☠️ blockchain hacking
|
# ⛓🍕 blockchain hacking
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
1
foundry_exploits/lib/forge-std
Submodule
1
foundry_exploits/lib/forge-std
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit a2edd39db95df7e9dd3f9ef9edc8c55fefddb6df
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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++;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue