@bloxchain/contracts 1.0.0-alpha → 1.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -18
- package/abi/{ControlBlox.abi.json → AccountBlox.abi.json} +699 -2974
- package/abi/BareBlox.abi.json +127 -90
- package/abi/BaseStateMachine.abi.json +127 -90
- package/abi/EngineBlox.abi.json +11 -31
- package/abi/GuardController.abi.json +217 -895
- package/abi/GuardControllerDefinitions.abi.json +380 -0
- package/abi/IDefinition.abi.json +19 -0
- package/abi/RoleBlox.abi.json +818 -2404
- package/abi/RuntimeRBAC.abi.json +122 -328
- package/abi/RuntimeRBACDefinitions.abi.json +243 -0
- package/abi/SecureBlox.abi.json +620 -1952
- package/abi/SecureOwnable.abi.json +469 -1801
- package/abi/SecureOwnableDefinitions.abi.json +57 -0
- package/abi/SimpleRWA20.abi.json +486 -1999
- package/abi/SimpleRWA20Definitions.abi.json +19 -0
- package/abi/SimpleVault.abi.json +884 -2685
- package/abi/SimpleVaultDefinitions.abi.json +19 -0
- package/components/README.md +8 -0
- package/core/access/RuntimeRBAC.sol +184 -0
- package/core/access/interface/IRuntimeRBAC.sol +55 -0
- package/{contracts/core → core}/access/lib/definitions/RuntimeRBACDefinitions.sol +121 -1
- package/{contracts/core → core}/base/BaseStateMachine.sol +187 -54
- package/{contracts/core → core}/base/interface/IBaseStateMachine.sol +7 -0
- package/{contracts/core → core}/execution/GuardController.sol +89 -155
- package/{contracts/core → core}/execution/interface/IGuardController.sol +52 -12
- package/{contracts/core → core}/execution/lib/definitions/GuardControllerDefinitions.sol +91 -2
- package/{contracts/core → core}/lib/EngineBlox.sol +167 -64
- package/{contracts → core/lib}/interfaces/IDefinition.sol +15 -6
- package/{contracts → core/lib}/interfaces/IEventForwarder.sol +1 -1
- package/{contracts → core/lib}/utils/SharedValidation.sol +490 -486
- package/core/pattern/Account.sol +75 -0
- package/core/research/BloxchainWallet.sol +133 -0
- package/core/research/FactoryBlox/FactoryBlox.sol +344 -0
- package/core/research/FactoryBlox/FactoryBloxDefinitions.sol +144 -0
- package/core/research/erc1155-blox/ERC1155Blox.sol +170 -0
- package/core/research/erc1155-blox/lib/definitions/ERC1155BloxDefinitions.sol +203 -0
- package/core/research/erc20-blox/ERC20Blox.sol +135 -0
- package/core/research/erc20-blox/lib/definitions/ERC20BloxDefinitions.sol +185 -0
- package/core/research/erc721-blox/ERC721Blox.sol +131 -0
- package/core/research/erc721-blox/lib/definitions/ERC721BloxDefinitions.sol +172 -0
- package/core/research/lending-blox/.gitkeep +1 -0
- package/core/research/p2p-blox/P2PBlox.sol +266 -0
- package/core/research/p2p-blox/README.md +85 -0
- package/core/research/p2p-blox/lib/definitions/P2PBloxDefinitions.sol +19 -0
- package/{contracts/core → core}/security/SecureOwnable.sol +390 -419
- package/{contracts/core → core}/security/interface/ISecureOwnable.sol +27 -40
- package/{contracts/core → core}/security/lib/definitions/SecureOwnableDefinitions.sol +786 -757
- package/package.json +49 -47
- package/standards/README.md +12 -0
- package/standards/behavior/ICopyable.sol +36 -0
- package/standards/hooks/IOnActionHook.sol +21 -0
- package/contracts/core/access/RuntimeRBAC.sol +0 -344
- package/contracts/core/access/interface/IRuntimeRBAC.sol +0 -108
- package/contracts/interfaces/IOnActionHook.sol +0 -79
package/README.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# @bloxchain/contracts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@bloxchain/contracts)
|
|
4
|
+
[](https://opensource.org/licenses/MPL-2.0)
|
|
5
|
+
[](https://soliditylang.org/)
|
|
6
|
+
|
|
7
|
+
Bloxchain Protocol smart contracts – state abstraction and core components for building on the Bloxchain Protocol.
|
|
8
|
+
|
|
9
|
+
> **⚠️ EXPERIMENTAL SOFTWARE WARNING**
|
|
10
|
+
> This package contains experimental smart contract code. While the framework is feature-complete and tested, it is not yet audited for production use. Use at your own risk and do not deploy with real assets without proper security review.
|
|
11
|
+
|
|
12
|
+
## Requirements
|
|
13
|
+
|
|
14
|
+
- **Node.js**: >= 18.0.0 (for tooling; Solidity has no runtime dependency)
|
|
15
|
+
- **Solidity**: 0.8.x (0.8.33 recommended)
|
|
16
|
+
- **Compilers**: Foundry, Hardhat, or Truffle
|
|
4
17
|
|
|
5
18
|
## Installation
|
|
6
19
|
|
|
@@ -10,40 +23,64 @@ npm install @bloxchain/contracts
|
|
|
10
23
|
|
|
11
24
|
## Usage
|
|
12
25
|
|
|
13
|
-
Import contracts in your Solidity files
|
|
26
|
+
Import contracts in your Solidity files. All contracts live under `@bloxchain/contracts/core/`:
|
|
14
27
|
|
|
15
28
|
```solidity
|
|
16
29
|
import "@bloxchain/contracts/core/base/BaseStateMachine.sol";
|
|
17
30
|
import "@bloxchain/contracts/core/security/SecureOwnable.sol";
|
|
18
31
|
import "@bloxchain/contracts/core/access/RuntimeRBAC.sol";
|
|
19
32
|
import "@bloxchain/contracts/core/execution/GuardController.sol";
|
|
33
|
+
import "@bloxchain/contracts/core/lib/utils/SharedValidation.sol";
|
|
34
|
+
import "@bloxchain/contracts/core/lib/interfaces/IDefinition.sol";
|
|
20
35
|
```
|
|
21
36
|
|
|
37
|
+
**Foundry**: No remapping needed; the package exposes `core/` at root (lib, base, access, execution, security live inside it).
|
|
38
|
+
**Hardhat / Truffle**: Resolve `@bloxchain/contracts` from `node_modules` as usual.
|
|
39
|
+
|
|
22
40
|
## Contracts
|
|
23
41
|
|
|
24
|
-
### Core
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
42
|
+
### Core contracts
|
|
43
|
+
|
|
44
|
+
| Contract | Description |
|
|
45
|
+
|----------|-------------|
|
|
46
|
+
| `BaseStateMachine` | Foundation state machine for all blox contracts |
|
|
47
|
+
| `SecureOwnable` | Multi-role security with time-locked operations |
|
|
48
|
+
| `RuntimeRBAC` | Dynamic role-based access control |
|
|
49
|
+
| `GuardController` | Execution workflows and time-locked transactions |
|
|
29
50
|
|
|
30
|
-
###
|
|
31
|
-
- `BareBlox` - Minimal base state machine
|
|
32
|
-
- `SecureBlox` - Basic secure ownership
|
|
33
|
-
- `RoleBlox` - Secure ownership + RBAC
|
|
34
|
-
- `ControlBlox` - Complete execution workflows
|
|
35
|
-
- `MachineBlox` - Full-featured with hooks
|
|
51
|
+
### Templates and examples
|
|
36
52
|
|
|
37
|
-
|
|
38
|
-
- `SimpleVault` - Secure asset management
|
|
39
|
-
- `SimpleRWA20` - Tokenized real-world assets
|
|
53
|
+
Templates (e.g. BareBlox, SecureBlox, AccountBlox) and example applications (SimpleVault, SimpleRWA20) live in the main repository under `contracts/examples/`. They are not included in this npm package. See the [main repo](https://github.com/PracticalParticle/Bloxchain-Protocol) for full documentation and examples.
|
|
40
54
|
|
|
41
55
|
## Dependencies
|
|
42
56
|
|
|
43
|
-
This package
|
|
57
|
+
This package declares:
|
|
58
|
+
|
|
44
59
|
- `@openzeppelin/contracts`: ^5.4.0
|
|
45
60
|
- `@openzeppelin/contracts-upgradeable`: ^5.4.0
|
|
46
61
|
|
|
62
|
+
Install them in your project if your tooling does not resolve transitive dependencies.
|
|
63
|
+
|
|
64
|
+
## Versioning and stability
|
|
65
|
+
|
|
66
|
+
This package follows [Semantic Versioning](https://semver.org/). Current versions are **alpha** (`1.0.0-alpha.x`). Pre-1.0 releases may introduce breaking changes; we recommend pinning the exact version until the protocol is audited and stable.
|
|
67
|
+
|
|
68
|
+
## Security
|
|
69
|
+
|
|
70
|
+
- **Vulnerability reporting**: Do not open public GitHub issues for security vulnerabilities. See the [Security Policy](https://github.com/PracticalParticle/Bloxchain-Protocol/blob/main/SECURITY.md) for reporting instructions (e.g. security@particlecs.com).
|
|
71
|
+
- **Audit status**: Not yet audited. Do not use with mainnet assets without an independent security review.
|
|
72
|
+
|
|
73
|
+
## Support and links
|
|
74
|
+
|
|
75
|
+
- **Documentation**: [Bloxchain Protocol README](https://github.com/PracticalParticle/Bloxchain-Protocol#readme)
|
|
76
|
+
- **Issues and feature requests**: [GitHub Issues](https://github.com/PracticalParticle/Bloxchain-Protocol/issues)
|
|
77
|
+
- **Homepage**: [bloxchain.app](https://bloxchain.app/)
|
|
78
|
+
- **Author**: [Particle Crypto Security](https://particlecs.com/)
|
|
79
|
+
|
|
80
|
+
## Repository
|
|
81
|
+
|
|
82
|
+
Part of [Bloxchain Protocol](https://github.com/PracticalParticle/Bloxchain-Protocol). For full documentation, architecture, and examples, see the main repository.
|
|
83
|
+
|
|
47
84
|
## License
|
|
48
85
|
|
|
49
|
-
MPL-2.0
|
|
86
|
+
MPL-2.0 (Mozilla Public License 2.0). See the [LICENSE](https://github.com/PracticalParticle/Bloxchain-Protocol/blob/main/LICENSE) file in the main repository.
|