Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
ddf5b16
Merge pull request #1 from Olorunshogo/submission/assignment-01/Oloru…
Olorunshogo Jan 24, 2026
3b9852f
Merge pull request #2 from Olorunshogo/submission/assignment-02/Oloru…
Olorunshogo Jan 24, 2026
e384335
chore: update Contributing.md
sprtd Jan 29, 2026
8f5fb83
chore: merge pull request #22 from BlockheaderWeb3-Community/fix-stru…
sprtd Jan 29, 2026
8de052f
feat(assignment-6): Assignment 6 submission
Jan 29, 2026
dd0a35a
Merge branch 'as-w2-d3' into submission/assignment-6/Olorunshogo
Olorunshogo Jan 29, 2026
a796cd8
chore: merge PR #26 from Olorunshogo/submission/assignment-6/Olorunshogo
sprtd Jan 29, 2026
04a9473
chore: merge PR #29 from BlockheaderWeb3-Community/as-w2-d3
sprtd Jan 29, 2026
59bbec9
chore: add all assignments
henrypeters Jan 30, 2026
6777c21
Remove remaining target directories
henrypeters Jan 30, 2026
5c794e4
feat: add block-explorer folder
henrypeters Jan 30, 2026
c1bf04a
feat: implement bip32 in address-derivation
henrypeters Jan 31, 2026
3a581d1
chore: merge PR #38 from henrypeters/submission/assignments/henrypeters
sprtd Feb 3, 2026
293dd49
chore: merge PR #46 from BlockheaderWeb3-Community/as-w2-d3
sprtd Feb 3, 2026
c13ad8b
Feat: Implement the todo contract
Mac-5 Feb 16, 2026
5ab0b38
feat: Initialize the Milestone escrow contract
Mac-5 Feb 18, 2026
c5dbade
feat: Initialize the TimeLock contract
Mac-5 Feb 18, 2026
302755d
feat: Initialize the Escrow contract
Mac-5 Feb 18, 2026
51ef79c
Remove fallback function from Escrow contract
Mac-5 Feb 24, 2026
c8be813
chore: merge PR #140 from Mac-5/submission/assignment-02/Mac-5
sprtd Feb 24, 2026
9197110
chore: Update .gitignore to exclude artifacts and non-code files
Mac-5 Feb 24, 2026
7ec99cd
chor: merge pull request #166 from BlockheaderWeb3-Community/as-w3-d3
sprtd Feb 25, 2026
f34db7b
Add MarketPlace NFT marketplace implementation
Mac-5 Feb 25, 2026
a529767
Change payment transfer to use call method
Mac-5 Feb 25, 2026
b5e8f2e
Fix call syntax for transferring sellerAmount
Mac-5 Feb 25, 2026
8a99712
chore: add test in package.json
sprtd Feb 25, 2026
6892733
chore: merge PR #168 from Mac-5/features/tokens
sprtd Feb 25, 2026
e532bef
chore: merge PR #174 from BlockheaderWeb3-Community/tokens
sprtd Feb 25, 2026
1da58f1
chore: set up for testing
sprtd Feb 25, 2026
7d751f3
chore: merge PR #178 from BlockheaderWeb3-Community/intro-to-testing
sprtd Feb 25, 2026
0a3ce5c
test: validate Timelock deployment
sprtd Feb 25, 2026
06c1a7b
test: revert 0 ETH deposit
sprtd Feb 25, 2026
6967b84
defi-assignment
deborahamoni0-prog Feb 25, 2026
87aebc9
Merge branch 'main' of https://github.com/deborahamoni0-prog/deborahc…
deborahamoni0-prog Feb 25, 2026
0beb97a
test: validate reverts
sprtd Feb 25, 2026
5047801
test: revert past unlock time
sprtd Feb 25, 2026
ebcee19
test: validate multiple deposits
sprtd Feb 25, 2026
72c3a67
chore: merge PR #183 from BlockheaderWeb3-Community/intro-to-test-vault
sprtd Feb 25, 2026
1142f8e
Merge branch 'BlockheaderWeb3-Community:main' into main
deborahamoni0-prog Feb 25, 2026
60e0b05
upgradable contracts
aji70 Apr 2, 2026
4c7a4b0
Merge pull request #207 from aji70/main
aji70 Apr 2, 2026
7789757
upgradable contracts
aji70 Apr 2, 2026
3e17115
Merge pull request #208 from aji70/main
aji70 Apr 2, 2026
3c41ae0
feat: add upgradeable staking pool system (UUPS, factory, reentrancy …
luhrhenz Apr 2, 2026
d46e2c7
Merge pull request #209 from luhrhenz/feat/staking-upgradeable
aji70 Apr 2, 2026
bd3487e
Merge branch 'BlockheaderWeb3-Community:main' into main
deborahamoni0-prog Apr 13, 2026
a52c1b6
test: submit class test assignment
deborahamoni0-prog Apr 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

permissions: {}

on:
push:
pull_request:
workflow_dispatch:

env:
FOUNDRY_PROFILE: ci

jobs:
check:
name: Foundry project
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Show Forge version
run: forge --version

- name: Run Forge fmt
run: forge fmt --check

- name: Run Forge build
run: forge build --sizes

- name: Run Forge tests
run: forge test -vvv
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,26 @@
.vscode/

package-lock.json
node_modules
node_modules

# Dependencies
lib/

# Rust build artifacts
/target
**/target
artifacts/
cache/
typechain-types/

# Logs
*.log

# OS files
.DS_Store
Thumbs.db

# IDE
.idea/
*.swp
*.swo
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
38 changes: 38 additions & 0 deletions 13-04-26-test/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

permissions: {}

on:
push:
pull_request:
workflow_dispatch:

env:
FOUNDRY_PROFILE: ci

jobs:
check:
name: Foundry project
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Show Forge version
run: forge --version

- name: Run Forge fmt
run: forge fmt --check

- name: Run Forge build
run: forge build --sizes

- name: Run Forge tests
run: forge test -vvv
14 changes: 14 additions & 0 deletions 13-04-26-test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Compiler files
cache/
out/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/

# Docs
docs/

# Dotenv file
.env
3 changes: 3 additions & 0 deletions 13-04-26-test/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
66 changes: 66 additions & 0 deletions 13-04-26-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## Foundry

**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**

Foundry consists of:

- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.

## Documentation

https://book.getfoundry.sh/

## Usage

### Build

```shell
$ forge build
```

### Test

```shell
$ forge test
```

### Format

```shell
$ forge fmt
```

### Gas Snapshots

```shell
$ forge snapshot
```

### Anvil

```shell
$ anvil
```

### Deploy

```shell
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
```

### Cast

```shell
$ cast <subcommand>
```

### Help

```shell
$ forge --help
$ anvil --help
$ cast --help
```
8 changes: 8 additions & 0 deletions 13-04-26-test/README.md2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## the vulnerability in the smart contract is a reentrancy attack.
## An attacker can exploit this contact by calling another function that calls the withdraw function again before the first call is completed.
## This can result in the attacker draining the contract's balance.

## To fix this vulnerability, we use the Checks-Effects-Interactions pattern.
## This pattern involves separating the state changes (checks and effects) from the external interactions.you do this by updating the balance first before the user withdraws the or receives the money
## By doing this, you can ensure that the state changes are completed before any external interactions are made.

8 changes: 8 additions & 0 deletions 13-04-26-test/foundry.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"lib/forge-std": {
"tag": {
"name": "v1.15.0",
"rev": "0844d7e1fc5e60d77b68e469bff60265f236c398"
}
}
}
6 changes: 6 additions & 0 deletions 13-04-26-test/foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[profile.default]
src = "src"
out = "out"
libs = ["lib"]

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
19 changes: 19 additions & 0 deletions 13-04-26-test/script/Counter.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Script} from "forge-std/Script.sol";
import {Counter} from "../src/Counter.sol";

contract CounterScript is Script {
Counter public counter;

function setUp() public {}

function run() public {
vm.startBroadcast();

counter = new Counter();

vm.stopBroadcast();
}
}
14 changes: 14 additions & 0 deletions 13-04-26-test/src/Counter.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// 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++;
}
}
25 changes: 25 additions & 0 deletions 13-04-26-test/src/attack.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.31;


contract Attack {
address public target;

constructor(address _target) {
target = _target;

}

function attack () public payable {
require(msg.value >= 1 ether, "send at least 1 ether to attack");
(bool success,) = target.call{value: msg.value}("");
require(success, "attack failed");

}
function withdrawFunds () external {
require(msg.sender == address(this), "only the attack contract can withdraw funds");
payable(msg.sender).transfer(address(this).balance);
}
}


31 changes: 31 additions & 0 deletions 13-04-26-test/src/test.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//SPDX Licensense Identifier: MIT
pragma solidity ^0.8.31;

contract Test {
mapping(address => uint256) public balances;

function deposit() public payable {
balances[msg.sender] += msg.value;
}

// function withdraw(uint256 amount) public {
// require(balances[msg.sender] >= amount, "Insufficient balance");

// (bool success, ) = msg.sender.call{value: amount}("");
// require(success, "Transfer failed");

// balances[msg.sender] -= amount;
//}


//fix withdraw functions
function withdraw(uint256 amount) public {
require(balances[msg.sender] >= amount, "Insufficient balance");

balances[msg.sender] -= amount;

(bool success, ) = msg.sender.call{value: amount}("");
require(success, "Transfer failed");

}
}
24 changes: 24 additions & 0 deletions 13-04-26-test/test/Counter.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Test} from "forge-std/Test.sol";
import {Counter} from "../src/Counter.sol";

contract CounterTest is Test {
Counter public counter;

function setUp() public {
counter = new Counter();
counter.setNumber(0);
}

function test_Increment() public {
counter.increment();
assertEq(counter.number(), 1);
}

function testFuzz_SetNumber(uint256 x) public {
counter.setNumber(x);
assertEq(counter.number(), x);
}
}
33 changes: 33 additions & 0 deletions 13-04-26-test/test/attack.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Test} from "forge-std/Test.sol";
import {Attack} from "../src/attack.sol";
contract AttackTest is Test {
Attack public attack;

function setUp() public {
attack = new Attack(address(this));
vm.deal(address(attack), 10 ether);
}

function test_Attack() public {
attack.attack{value: 1 ether}();
vm.startPrank(address(attack));
assertEq(address(this).balance, 0);
assertGt(address(attack).balance, 1 ether);
vm.stopPrank();


}

fuction test_WithdrawFunds() public {
attack.attack{value: 1 ether}();
vm.startPrank(address(attack));
attack.withdrawFunds();
assertEq(address(this).balance, 1 ether);
assertEq(address(attack).balance, 0);
vm.stopPrank();
}

}
Loading
Loading