@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.
Files changed (55) hide show
  1. package/README.md +55 -18
  2. package/abi/{ControlBlox.abi.json → AccountBlox.abi.json} +699 -2974
  3. package/abi/BareBlox.abi.json +127 -90
  4. package/abi/BaseStateMachine.abi.json +127 -90
  5. package/abi/EngineBlox.abi.json +11 -31
  6. package/abi/GuardController.abi.json +217 -895
  7. package/abi/GuardControllerDefinitions.abi.json +380 -0
  8. package/abi/IDefinition.abi.json +19 -0
  9. package/abi/RoleBlox.abi.json +818 -2404
  10. package/abi/RuntimeRBAC.abi.json +122 -328
  11. package/abi/RuntimeRBACDefinitions.abi.json +243 -0
  12. package/abi/SecureBlox.abi.json +620 -1952
  13. package/abi/SecureOwnable.abi.json +469 -1801
  14. package/abi/SecureOwnableDefinitions.abi.json +57 -0
  15. package/abi/SimpleRWA20.abi.json +486 -1999
  16. package/abi/SimpleRWA20Definitions.abi.json +19 -0
  17. package/abi/SimpleVault.abi.json +884 -2685
  18. package/abi/SimpleVaultDefinitions.abi.json +19 -0
  19. package/components/README.md +8 -0
  20. package/core/access/RuntimeRBAC.sol +184 -0
  21. package/core/access/interface/IRuntimeRBAC.sol +55 -0
  22. package/{contracts/core → core}/access/lib/definitions/RuntimeRBACDefinitions.sol +121 -1
  23. package/{contracts/core → core}/base/BaseStateMachine.sol +187 -54
  24. package/{contracts/core → core}/base/interface/IBaseStateMachine.sol +7 -0
  25. package/{contracts/core → core}/execution/GuardController.sol +89 -155
  26. package/{contracts/core → core}/execution/interface/IGuardController.sol +52 -12
  27. package/{contracts/core → core}/execution/lib/definitions/GuardControllerDefinitions.sol +91 -2
  28. package/{contracts/core → core}/lib/EngineBlox.sol +167 -64
  29. package/{contracts → core/lib}/interfaces/IDefinition.sol +15 -6
  30. package/{contracts → core/lib}/interfaces/IEventForwarder.sol +1 -1
  31. package/{contracts → core/lib}/utils/SharedValidation.sol +490 -486
  32. package/core/pattern/Account.sol +75 -0
  33. package/core/research/BloxchainWallet.sol +133 -0
  34. package/core/research/FactoryBlox/FactoryBlox.sol +344 -0
  35. package/core/research/FactoryBlox/FactoryBloxDefinitions.sol +144 -0
  36. package/core/research/erc1155-blox/ERC1155Blox.sol +170 -0
  37. package/core/research/erc1155-blox/lib/definitions/ERC1155BloxDefinitions.sol +203 -0
  38. package/core/research/erc20-blox/ERC20Blox.sol +135 -0
  39. package/core/research/erc20-blox/lib/definitions/ERC20BloxDefinitions.sol +185 -0
  40. package/core/research/erc721-blox/ERC721Blox.sol +131 -0
  41. package/core/research/erc721-blox/lib/definitions/ERC721BloxDefinitions.sol +172 -0
  42. package/core/research/lending-blox/.gitkeep +1 -0
  43. package/core/research/p2p-blox/P2PBlox.sol +266 -0
  44. package/core/research/p2p-blox/README.md +85 -0
  45. package/core/research/p2p-blox/lib/definitions/P2PBloxDefinitions.sol +19 -0
  46. package/{contracts/core → core}/security/SecureOwnable.sol +390 -419
  47. package/{contracts/core → core}/security/interface/ISecureOwnable.sol +27 -40
  48. package/{contracts/core → core}/security/lib/definitions/SecureOwnableDefinitions.sol +786 -757
  49. package/package.json +49 -47
  50. package/standards/README.md +12 -0
  51. package/standards/behavior/ICopyable.sol +36 -0
  52. package/standards/hooks/IOnActionHook.sol +21 -0
  53. package/contracts/core/access/RuntimeRBAC.sol +0 -344
  54. package/contracts/core/access/interface/IRuntimeRBAC.sol +0 -108
  55. package/contracts/interfaces/IOnActionHook.sol +0 -79
package/README.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # @bloxchain/contracts
2
2
 
3
- Bloxchain Protocol Smart Contracts - State Abstraction for Blockchain Security
3
+ [![npm version](https://img.shields.io/npm/v/@bloxchain/contracts.svg)](https://www.npmjs.com/package/@bloxchain/contracts)
4
+ [![License: MPL-2.0](https://img.shields.io/badge/License-MPL--2.0-blue.svg)](https://opensource.org/licenses/MPL-2.0)
5
+ [![Solidity](https://img.shields.io/badge/Solidity-0.8.33-blue.svg)](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 Contracts
25
- - `BaseStateMachine` - Foundation state machine contract
26
- - `SecureOwnable` - Multi-role security with time-locked operations
27
- - `RuntimeRBAC` - Dynamic role-based access control
28
- - `GuardController` - Execution workflows and time-locked transactions
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
- ### Template Contracts
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
- ### Example Contracts
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 requires:
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.