Skip to content

Commit 87af420

Browse files
authored
Merge pull request #83 from PracticalParticle/dev
Dev
2 parents 49cf8d3 + 4b4ceb3 commit 87af420

161 files changed

Lines changed: 3853 additions & 2428 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Before contributing, ensure you have:
3030
- **npm** (v8 or higher)
3131
- **Truffle** (v5.15 or higher)
3232
- **Git** (latest version)
33-
- **Solidity** knowledge (0.8.33)
33+
- **Solidity** knowledge (0.8.34)
3434
- **TypeScript** knowledge (for SDK contributions)
3535

3636
### Development Environment

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Bloxchain Protocol: Enterprise-Grade Blockchain Security Framework
22

33
[![License: MPL-2.0](https://img.shields.io/badge/License-MPL--2.0-blue.svg)](https://opensource.org/licenses/MPL-2.0)
4-
[![Solidity](https://img.shields.io/badge/Solidity-0.8.33-blue.svg)](https://soliditylang.org/)
4+
[![Solidity](https://img.shields.io/badge/Solidity-0.8.34-blue.svg)](https://soliditylang.org/)
55
[![TypeScript](https://img.shields.io/badge/TypeScript-SDK-green.svg)](./sdk/typescript/)
66
[![Hardhat](https://img.shields.io/badge/Hardhat-v3-yellow.svg)](https://hardhat.org/)
77
[![Sepolia](https://img.shields.io/badge/Sepolia-Testnet-purple.svg)](https://sepolia.etherscan.io/)
@@ -463,28 +463,29 @@ library SimpleVaultDefinitions {
463463

464464
## 🧪 Comprehensive Fuzz Testing
465465

466-
Bloxchain Protocol includes **comprehensive fuzz testing** with **22 test files** and **152 fuzz test functions** (plus 16 regular test functions, totaling **168+ test functions**) covering all security-critical components and edge cases.
466+
Bloxchain Protocol includes **comprehensive fuzz testing** with **37 test suites** and **309 tests** (all passing) covering all security-critical components and edge cases. See [test/foundry/docs](test/foundry/docs/) for the Attack Vectors Codex and coverage report.
467467

468468
### Test Coverage
469469

470470
| Test Suite | Coverage Area | Test Count |
471471
|------------|---------------|------------|
472-
| **ComprehensiveStateMachineFuzz** | State machine security, reentrancy protection | 11 tests |
472+
| **ComprehensiveStateMachineFuzz** | State machine security, reentrancy protection, EIP-150 OOG, no delegatecall | 23 tests |
473473
| **ComprehensiveSecurityEdgeCasesFuzz** | Bitmap attacks, hook vulnerabilities, payment race conditions | 10 tests |
474-
| **ComprehensiveMetaTransactionFuzz** | Meta-transaction security, signature validation | 11 tests |
474+
| **ComprehensiveMetaTransactionFuzz** | Meta-transaction security, signature validation, nonce, chainId | 14 tests |
475475
| **ComprehensiveInputValidationFuzz** | Input validation, array manipulation, edge cases | 13 tests |
476-
| **ComprehensivePaymentSecurityFuzz** | Payment management, race conditions | 6 tests |
476+
| **ComprehensivePaymentSecurityFuzz** | Payment management, race conditions, fee-on-transfer tokens | 7 tests |
477477
| **ComprehensiveHookSystemFuzz** | Hook execution, interface compliance | 2 tests |
478-
| **ComprehensiveAccessControlFuzz** | Access control, permission validation | 13 tests |
479-
| **ComprehensiveDefinitionSecurityFuzz** | Definition loading, schema validation | 15 tests (6 fuzz + 9 regular) |
478+
| **ComprehensiveAccessControlFuzz** | Access control, permission validation, state after removal | 14 tests |
479+
| **ComprehensiveDefinitionSecurityFuzz** | Definition loading, schema validation | 20 tests |
480480
| **ComprehensiveGasExhaustionFuzz** | Gas limits, batch operations | 17 tests |
481-
| **ComprehensiveWhitelistSchemaFuzz** | Target whitelisting, function schemas | 15 tests (9 fuzz + 6 regular) |
482-
| **ComprehensiveCompositeFuzz** | Composite attack vectors | 5 tests (4 fuzz + 1 regular) |
481+
| **ComprehensiveWhitelistSchemaFuzz** | Target whitelisting, function schemas | 8 tests |
482+
| **ComprehensiveEIP712AndViewFuzz** | EIP-712 domain determinism, view consistency, signer recovery, excess msg.value | 4 tests |
483+
| **ComprehensiveCompositeFuzz** | Composite attack vectors | 5 tests |
483484
| **ComprehensiveInitializationFuzz** | Initialization security, reentrancy | 9 tests |
484485
| **ComprehensiveEventForwardingFuzz** | Event forwarding, external integrations | 2 tests |
485486
| **GuardControllerFuzz** | Guard controller workflows | 4 tests |
486487
| **SecureOwnableFuzz** | Ownership management security | 5 tests |
487-
| **RuntimeRBACFuzz** | Runtime RBAC operations | 2 tests |
488+
| **RuntimeRBACFuzz** | Runtime RBAC operations | 3 tests |
488489
| **StateMachineWorkflowFuzz** | Workflow state transitions | 5 tests |
489490
| **MetaTransactionSecurityFuzz** | Meta-transaction security | 6 tests |
490491
| **ProtectedResourceFuzz** | Protected resource access | 4 tests |
@@ -701,7 +702,7 @@ abstract contract HookManager is BaseStateMachine {
701702
```
702703

703704
**Technical Features**:
704-
- **Solidity Version**: 0.8.33 (fixed version for reproducible builds)
705+
- **Solidity Version**: 0.8.34 (fixed version for reproducible builds)
705706
- **OpenZeppelin**: ^5.4.0 (with upgradeable contracts)
706707
- **Contract Size**: < 24KB (optimized for mainnet deployment)
707708
- **Gas Optimization**: Library-based architecture with modular definitions

abi/AccountBlox.abi.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@
4242
"name": "CannotModifyProtected",
4343
"type": "error"
4444
},
45+
{
46+
"inputs": [
47+
{
48+
"internalType": "bytes4",
49+
"name": "functionSelector",
50+
"type": "bytes4"
51+
}
52+
],
53+
"name": "ContractFunctionMustBeProtected",
54+
"type": "error"
55+
},
4556
{
4657
"inputs": [
4758
{

abi/EngineBlox.abi.json

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,6 @@
5858
"name": "ConflictingMetaTxPermissions",
5959
"type": "error"
6060
},
61-
{
62-
"inputs": [
63-
{
64-
"internalType": "bytes4",
65-
"name": "functionSelector",
66-
"type": "bytes4"
67-
}
68-
],
69-
"name": "ContractFunctionMustBeProtected",
70-
"type": "error"
71-
},
7261
{
7362
"inputs": [
7463
{
@@ -824,29 +813,5 @@
824813
],
825814
"stateMutability": "view",
826815
"type": "function"
827-
},
828-
{
829-
"inputs": [
830-
{
831-
"internalType": "address",
832-
"name": "contractAddress",
833-
"type": "address"
834-
},
835-
{
836-
"internalType": "bytes4",
837-
"name": "selector",
838-
"type": "bytes4"
839-
}
840-
],
841-
"name": "selectorExistsInContract",
842-
"outputs": [
843-
{
844-
"internalType": "bool",
845-
"name": "",
846-
"type": "bool"
847-
}
848-
],
849-
"stateMutability": "view",
850-
"type": "function"
851816
}
852817
]

abi/GuardController.abi.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
{
3535
"inputs": [
3636
{
37-
"internalType": "bytes32",
38-
"name": "resourceId",
39-
"type": "bytes32"
37+
"internalType": "bytes4",
38+
"name": "functionSelector",
39+
"type": "bytes4"
4040
}
4141
],
42-
"name": "CannotModifyProtected",
42+
"name": "ContractFunctionMustBeProtected",
4343
"type": "error"
4444
},
4545
{

abi/GuardControllerDefinitions.abi.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@
6464
"stateMutability": "view",
6565
"type": "function"
6666
},
67+
{
68+
"inputs": [],
69+
"name": "EXECUTE_WITH_PAYMENT_SELECTOR",
70+
"outputs": [
71+
{
72+
"internalType": "bytes4",
73+
"name": "",
74+
"type": "bytes4"
75+
}
76+
],
77+
"stateMutability": "view",
78+
"type": "function"
79+
},
6780
{
6881
"inputs": [],
6982
"name": "EXECUTE_WITH_TIMELOCK_SELECTOR",

abi/RoleBlox.abi.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@
4242
"name": "CannotModifyProtected",
4343
"type": "error"
4444
},
45+
{
46+
"inputs": [
47+
{
48+
"internalType": "bytes4",
49+
"name": "functionSelector",
50+
"type": "bytes4"
51+
}
52+
],
53+
"name": "ContractFunctionMustBeProtected",
54+
"type": "error"
55+
},
4556
{
4657
"inputs": [],
4758
"name": "InvalidInitialization",

abi/RuntimeRBAC.abi.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@
4242
"name": "CannotModifyProtected",
4343
"type": "error"
4444
},
45+
{
46+
"inputs": [
47+
{
48+
"internalType": "bytes4",
49+
"name": "functionSelector",
50+
"type": "bytes4"
51+
}
52+
],
53+
"name": "ContractFunctionMustBeProtected",
54+
"type": "error"
55+
},
4556
{
4657
"inputs": [],
4758
"name": "InvalidInitialization",

abi/SecureBlox.abi.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
{
1919
"inputs": [
2020
{
21-
"internalType": "bytes32",
22-
"name": "resourceId",
23-
"type": "bytes32"
21+
"internalType": "bytes4",
22+
"name": "functionSelector",
23+
"type": "bytes4"
2424
}
2525
],
26-
"name": "CannotModifyProtected",
26+
"name": "ContractFunctionMustBeProtected",
2727
"type": "error"
2828
},
2929
{

abi/SecureOwnable.abi.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
{
1919
"inputs": [
2020
{
21-
"internalType": "bytes32",
22-
"name": "resourceId",
23-
"type": "bytes32"
21+
"internalType": "bytes4",
22+
"name": "functionSelector",
23+
"type": "bytes4"
2424
}
2525
],
26-
"name": "CannotModifyProtected",
26+
"name": "ContractFunctionMustBeProtected",
2727
"type": "error"
2828
},
2929
{

0 commit comments

Comments
 (0)