@bloxchain/contracts 1.0.0-alpha.2 → 1.0.0-alpha.21
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 +7 -7
- package/abi/BaseStateMachine.abi.json +798 -753
- package/abi/EngineBlox.abi.json +566 -576
- package/abi/GuardController.abi.json +1546 -2095
- package/abi/GuardControllerDefinitions.abi.json +416 -0
- package/abi/IDefinition.abi.json +57 -47
- package/abi/RuntimeRBAC.abi.json +901 -959
- package/abi/RuntimeRBACDefinitions.abi.json +265 -81
- package/abi/SecureOwnable.abi.json +1522 -2581
- package/abi/SecureOwnableDefinitions.abi.json +174 -164
- package/components/README.md +8 -0
- package/core/access/RuntimeRBAC.sol +253 -270
- package/core/access/interface/IRuntimeRBAC.sol +55 -84
- package/core/access/lib/definitions/RuntimeRBACDefinitions.sol +97 -4
- package/core/base/BaseStateMachine.sol +198 -108
- package/core/base/interface/IBaseStateMachine.sol +153 -153
- package/core/execution/GuardController.sol +156 -131
- package/core/execution/interface/IGuardController.sol +146 -120
- package/core/execution/lib/definitions/GuardControllerDefinitions.sol +207 -45
- package/core/lib/EngineBlox.sol +2636 -2322
- package/{interfaces → core/lib/interfaces}/IDefinition.sol +49 -49
- package/{interfaces → core/lib/interfaces}/IEventForwarder.sol +5 -3
- package/{utils → core/lib/utils}/SharedValidation.sol +69 -22
- package/core/pattern/Account.sol +84 -0
- package/core/security/SecureOwnable.sol +180 -146
- package/core/security/interface/ISecureOwnable.sol +105 -104
- package/core/security/lib/definitions/SecureOwnableDefinitions.sol +818 -786
- package/package.json +5 -5
- package/standards/README.md +12 -0
- package/standards/behavior/ICopyable.sol +34 -0
- package/standards/hooks/IOnActionHook.sol +21 -0
- package/abi/AccountBlox.abi.json +0 -5799
- package/abi/BareBlox.abi.json +0 -1284
- package/abi/RoleBlox.abi.json +0 -4209
- package/abi/SecureBlox.abi.json +0 -3828
- package/abi/SimpleRWA20.abi.json +0 -5288
- package/abi/SimpleRWA20Definitions.abi.json +0 -191
- package/abi/SimpleVault.abi.json +0 -4951
- package/abi/SimpleVaultDefinitions.abi.json +0 -269
- package/core/research/BloxchainWallet.sol +0 -306
- package/core/research/erc20-blox/ERC20Blox.sol +0 -140
- package/core/research/erc20-blox/lib/definitions/ERC20BloxDefinitions.sol +0 -185
- package/interfaces/IOnActionHook.sol +0 -79
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloxchain/contracts",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.21",
|
|
4
4
|
"description": "Library engine for building enterprise grade decentralized permissioned applications",
|
|
5
5
|
"files": [
|
|
6
6
|
"core",
|
|
7
|
-
"utils",
|
|
8
|
-
"interfaces",
|
|
9
7
|
"abi",
|
|
8
|
+
"standards",
|
|
9
|
+
"components",
|
|
10
10
|
"README.md"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@openzeppelin/contracts": "^5.
|
|
44
|
-
"@openzeppelin/contracts-upgradeable": "^5.
|
|
43
|
+
"@openzeppelin/contracts": "^5.6.1",
|
|
44
|
+
"@openzeppelin/contracts-upgradeable": "^5.6.1"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=18.0.0"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Bloxchain Standards
|
|
2
|
+
|
|
3
|
+
Protocol-level **interfaces** that define optional behaviors and extension points for Blox contracts. These live outside `core/` so the engine stays minimal and stable.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
- **behavior/** – Optional behavior interfaces (e.g. cloneable blox). Implementations live in `components/` or `examples/`.
|
|
8
|
+
- **hooks/** – Hook and trigger interfaces used by the system to call into external contracts (e.g. post-action hooks).
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
Contracts in `core/`, `components/`, and `examples/` may depend on these interfaces. New standards should be proposed and reviewed before addition.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
pragma solidity 0.8.35;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @title ICopyable
|
|
6
|
+
* @dev Interface for blox contracts that support generic cloning with custom init data.
|
|
7
|
+
*
|
|
8
|
+
* Bloxes implementing this interface can be cloned by factory patterns (e.g. CopyBlox,
|
|
9
|
+
* FactoryBlox) and initialized in one call with owner/broadcaster/recovery/timelock/
|
|
10
|
+
* eventForwarder plus arbitrary init data, or have clone-specific data set
|
|
11
|
+
*
|
|
12
|
+
* Use cases:
|
|
13
|
+
* - Clone and init in one step: factory calls initializeWithData(..., initData).
|
|
14
|
+
* - Clone with standard init then set clone data: factory calls initializeWithData(...)
|
|
15
|
+
*/
|
|
16
|
+
interface ICopyable {
|
|
17
|
+
/**
|
|
18
|
+
* @dev Full initialization with standard blox params and custom init data.
|
|
19
|
+
* @param initialOwner The initial owner address
|
|
20
|
+
* @param broadcaster The broadcaster address
|
|
21
|
+
* @param recovery The recovery address
|
|
22
|
+
* @param timeLockPeriodSec The timelock period in seconds
|
|
23
|
+
* @param eventForwarder The event forwarder address (optional, use address(0) to skip)
|
|
24
|
+
* @param initData Custom initialization data (e.g. ABI-encoded config) for this clone
|
|
25
|
+
*/
|
|
26
|
+
function initializeWithData(
|
|
27
|
+
address initialOwner,
|
|
28
|
+
address broadcaster,
|
|
29
|
+
address recovery,
|
|
30
|
+
uint256 timeLockPeriodSec,
|
|
31
|
+
address eventForwarder,
|
|
32
|
+
bytes calldata initData
|
|
33
|
+
) external;
|
|
34
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
pragma solidity 0.8.35;
|
|
3
|
+
|
|
4
|
+
import "../../core/lib/EngineBlox.sol";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @title IOnActionHook
|
|
8
|
+
* @dev Minimal interface for external hook contracts attached to state machine actions.
|
|
9
|
+
*
|
|
10
|
+
* @notice This interface is intentionally small to keep overall contract size low.
|
|
11
|
+
* @notice The state machine calls this single hook after any transaction operation that
|
|
12
|
+
* produces a TxRecord, providing a centralized post-action entry point.
|
|
13
|
+
*/
|
|
14
|
+
interface IOnActionHook {
|
|
15
|
+
/**
|
|
16
|
+
* @dev Called after any transaction operation that produces a TxRecord.
|
|
17
|
+
* This includes request, approve, cancel and meta-tx flows.
|
|
18
|
+
* @param txRecord The transaction record produced by the operation
|
|
19
|
+
*/
|
|
20
|
+
function onAction(EngineBlox.TxRecord memory txRecord) external;
|
|
21
|
+
}
|