@rootzero/contracts 0.2.0 → 0.4.0
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/{contracts/Commands.sol → Commands.sol} +7 -2
- package/{contracts/Core.sol → Core.sol} +7 -1
- package/{contracts/Blocks.sol → Cursors.sol} +8 -1
- package/{contracts/Events.sol → Events.sol} +6 -0
- package/README.md +59 -59
- package/Utils.sol +18 -0
- package/blocks/Cursors.sol +800 -0
- package/blocks/Keys.sol +51 -0
- package/blocks/Mem.sol +188 -0
- package/blocks/Schema.sol +158 -0
- package/blocks/Writers.sol +304 -0
- package/commands/Base.sol +65 -0
- package/commands/Borrow.sol +88 -0
- package/commands/Burn.sol +45 -0
- package/commands/Create.sol +41 -0
- package/commands/Credit.sol +49 -0
- package/commands/Debit.sol +58 -0
- package/commands/Deposit.sol +57 -0
- package/commands/Liquidate.sol +98 -0
- package/commands/Liquidity.sol +179 -0
- package/commands/Mint.sol +53 -0
- package/{contracts/commands → commands}/Pipe.sol +28 -12
- package/commands/Provision.sol +84 -0
- package/commands/Reclaim.sol +54 -0
- package/commands/Redeem.sol +98 -0
- package/commands/Remove.sol +41 -0
- package/commands/Repay.sol +98 -0
- package/commands/Settle.sol +41 -0
- package/commands/Stake.sol +129 -0
- package/commands/Supply.sol +40 -0
- package/commands/Swap.sol +89 -0
- package/commands/Transfer.sol +55 -0
- package/commands/Unstake.sol +57 -0
- package/commands/Withdraw.sol +49 -0
- package/commands/admin/Allocate.sol +40 -0
- package/commands/admin/AllowAssets.sol +42 -0
- package/commands/admin/Authorize.sol +38 -0
- package/commands/admin/DenyAssets.sol +42 -0
- package/commands/admin/Destroy.sol +38 -0
- package/commands/admin/Init.sol +38 -0
- package/commands/admin/Relocate.sol +39 -0
- package/commands/admin/Unauthorize.sol +38 -0
- package/core/Access.sol +79 -0
- package/core/Balances.sol +40 -0
- package/core/Host.sol +44 -0
- package/core/Operation.sol +69 -0
- package/core/Validator.sol +46 -0
- package/docs/GETTING_STARTED.md +286 -0
- package/{contracts/events → events}/Access.sol +7 -0
- package/events/Asset.sol +21 -0
- package/{contracts/events → events}/Balance.sol +10 -0
- package/events/Collateral.sol +24 -0
- package/events/Command.sol +24 -0
- package/events/Debt.sol +25 -0
- package/{contracts/events → events}/Deposit.sol +9 -0
- package/events/Emitter.sol +14 -0
- package/{contracts/events → events}/Governed.sol +7 -0
- package/{contracts/events → events}/HostAnnounced.sol +8 -0
- package/{contracts/events → events}/Listing.sol +9 -0
- package/{contracts/events → events}/Peer.sol +8 -0
- package/{contracts/events → events}/Quote.sol +7 -0
- package/{contracts/events → events}/RootZero.sol +5 -0
- package/{contracts/events → events}/Withdraw.sol +9 -0
- package/interfaces/IHostDiscovery.sol +16 -0
- package/package.json +17 -33
- package/peer/AllowAssets.sol +44 -0
- package/peer/Base.sol +25 -0
- package/peer/DenyAssets.sol +44 -0
- package/peer/Pull.sol +42 -0
- package/peer/Push.sol +42 -0
- package/utils/Accounts.sol +90 -0
- package/utils/Assets.sol +138 -0
- package/utils/ECDSA.sol +58 -0
- package/utils/Ids.sol +129 -0
- package/utils/Layout.sol +66 -0
- package/utils/State.sol +22 -0
- package/utils/Utils.sol +194 -0
- package/utils/Value.sol +32 -0
- package/contracts/Utils.sol +0 -12
- package/contracts/blocks/Blocks.sol +0 -818
- package/contracts/blocks/Keys.sol +0 -24
- package/contracts/blocks/Mem.sol +0 -129
- package/contracts/blocks/Schema.sol +0 -105
- package/contracts/blocks/Writers.sol +0 -209
- package/contracts/combinators/AmountToBalance.sol +0 -25
- package/contracts/combinators/AmountToCustody.sol +0 -36
- package/contracts/combinators/CustodyToBalance.sol +0 -25
- package/contracts/combinators/EachRoute.sol +0 -18
- package/contracts/combinators/MapBalance.sol +0 -25
- package/contracts/combinators/MapCustody.sol +0 -25
- package/contracts/combinators/RouteToBalance.sol +0 -27
- package/contracts/commands/Base.sol +0 -40
- package/contracts/commands/Borrow.sol +0 -89
- package/contracts/commands/Burn.sol +0 -33
- package/contracts/commands/Create.sol +0 -32
- package/contracts/commands/Credit.sol +0 -36
- package/contracts/commands/Debit.sol +0 -46
- package/contracts/commands/Deposit.sol +0 -45
- package/contracts/commands/Liquidate.sol +0 -101
- package/contracts/commands/Liquidity.sol +0 -179
- package/contracts/commands/Mint.sol +0 -42
- package/contracts/commands/Provision.sol +0 -73
- package/contracts/commands/Reclaim.sol +0 -48
- package/contracts/commands/Redeem.sol +0 -101
- package/contracts/commands/Remove.sol +0 -32
- package/contracts/commands/Repay.sol +0 -101
- package/contracts/commands/Settle.sol +0 -32
- package/contracts/commands/Stake.sol +0 -121
- package/contracts/commands/Supply.sol +0 -33
- package/contracts/commands/Swap.sol +0 -88
- package/contracts/commands/Transfer.sol +0 -44
- package/contracts/commands/Unstake.sol +0 -49
- package/contracts/commands/Withdraw.sol +0 -37
- package/contracts/commands/admin/Allocate.sol +0 -32
- package/contracts/commands/admin/AllowAssets.sol +0 -34
- package/contracts/commands/admin/Authorize.sol +0 -30
- package/contracts/commands/admin/DenyAssets.sol +0 -34
- package/contracts/commands/admin/Destroy.sol +0 -27
- package/contracts/commands/admin/Init.sol +0 -26
- package/contracts/commands/admin/Relocate.sol +0 -30
- package/contracts/commands/admin/Unauthorize.sol +0 -30
- package/contracts/core/Access.sol +0 -50
- package/contracts/core/Balances.sol +0 -23
- package/contracts/core/Host.sol +0 -25
- package/contracts/core/Operation.sol +0 -32
- package/contracts/core/Validator.sol +0 -31
- package/contracts/events/Asset.sol +0 -14
- package/contracts/events/Collateral.sol +0 -15
- package/contracts/events/Command.sol +0 -14
- package/contracts/events/Debt.sol +0 -15
- package/contracts/events/Emitter.sol +0 -7
- package/contracts/interfaces/IHostDiscovery.sol +0 -6
- package/contracts/peer/AllowAssets.sol +0 -30
- package/contracts/peer/Base.sol +0 -17
- package/contracts/peer/DenyAssets.sol +0 -30
- package/contracts/peer/Pull.sol +0 -30
- package/contracts/peer/Push.sol +0 -30
- package/contracts/test/TestBlockHelper.sol +0 -261
- package/contracts/test/TestBorrowHost.sol +0 -47
- package/contracts/test/TestBurnHost.sol +0 -28
- package/contracts/test/TestCreateHost.sol +0 -26
- package/contracts/test/TestDiscovery.sol +0 -6
- package/contracts/test/TestECDSA.sol +0 -16
- package/contracts/test/TestHost.sol +0 -199
- package/contracts/test/TestLiquidityHost.sol +0 -145
- package/contracts/test/TestMintHost.sol +0 -40
- package/contracts/test/TestPeerHost.sol +0 -34
- package/contracts/test/TestReclaimHost.sol +0 -48
- package/contracts/test/TestRejectEther.sol +0 -8
- package/contracts/test/TestRemoveHost.sol +0 -26
- package/contracts/test/TestSwapHost.sol +0 -44
- package/contracts/test/TestUtils.sol +0 -169
- package/contracts/test/TestValidator.sol +0 -10
- package/contracts/utils/Accounts.sol +0 -40
- package/contracts/utils/Assets.sol +0 -76
- package/contracts/utils/Channels.sol +0 -11
- package/contracts/utils/ECDSA.sol +0 -36
- package/contracts/utils/Ids.sol +0 -75
- package/contracts/utils/Layout.sol +0 -22
- package/contracts/utils/Utils.sol +0 -126
- package/contracts/utils/Value.sol +0 -20
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
2
|
pragma solidity ^0.8.33;
|
|
3
3
|
|
|
4
|
+
// Aggregator: re-exports all command and peer abstractions.
|
|
5
|
+
// Import this file to inherit from any command or peer base contract without managing individual paths.
|
|
6
|
+
|
|
4
7
|
import { CommandBase, CommandContext } from "./commands/Base.sol";
|
|
5
|
-
import {
|
|
6
|
-
import { Channels } from "./utils/Channels.sol";
|
|
8
|
+
import { State } from "./utils/State.sol";
|
|
7
9
|
import { BorrowAgainstBalanceToBalance, BorrowAgainstCustodyToBalance } from "./commands/Borrow.sol";
|
|
8
10
|
import { Burn } from "./commands/Burn.sol";
|
|
9
11
|
import { Create } from "./commands/Create.sol";
|
|
@@ -39,3 +41,6 @@ import { PeerAllowAssets } from "./peer/AllowAssets.sol";
|
|
|
39
41
|
import { PeerDenyAssets } from "./peer/DenyAssets.sol";
|
|
40
42
|
import { PeerPull } from "./peer/Pull.sol";
|
|
41
43
|
import { PeerPush } from "./peer/Push.sol";
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
2
|
pragma solidity ^0.8.33;
|
|
3
3
|
|
|
4
|
+
// Aggregator: re-exports all core protocol contracts (Access, Balances, Host, Operation, Validator).
|
|
5
|
+
// Import this file to bring the full host base layer into scope.
|
|
6
|
+
|
|
4
7
|
import { AccessControl } from "./core/Access.sol";
|
|
5
8
|
import { Balances } from "./core/Balances.sol";
|
|
6
9
|
import { Host } from "./core/Host.sol";
|
|
7
|
-
import { FailedCall,
|
|
10
|
+
import { FailedCall, OperationBase } from "./core/Operation.sol";
|
|
8
11
|
import { Validator } from "./core/Validator.sol";
|
|
9
12
|
import { HostDiscovery } from "./core/Host.sol";
|
|
10
13
|
import { IHostDiscovery } from "./interfaces/IHostDiscovery.sol";
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
2
|
pragma solidity ^0.8.33;
|
|
3
3
|
|
|
4
|
+
// Aggregator: re-exports all block stream primitives (Cursors, Writers, Mem, Schema, Keys).
|
|
5
|
+
// Import this file to get access to the full block encoding/decoding surface in one import.
|
|
6
|
+
|
|
4
7
|
import { HostAmount, UserAmount, HostAsset, Tx, AssetAmount } from "./blocks/Schema.sol";
|
|
5
8
|
import { Keys } from "./blocks/Keys.sol";
|
|
6
9
|
import { Schemas } from "./blocks/Schema.sol";
|
|
7
|
-
import {
|
|
10
|
+
import { Cursors, Cur } from "./blocks/Cursors.sol";
|
|
8
11
|
import { Mem, MemRef } from "./blocks/Mem.sol";
|
|
9
12
|
import { Writer, Writers } from "./blocks/Writers.sol";
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
2
|
pragma solidity ^0.8.33;
|
|
3
3
|
|
|
4
|
+
// Aggregator: re-exports all event contracts.
|
|
5
|
+
// Import this file to get access to every event emitter in one import.
|
|
6
|
+
|
|
4
7
|
import { AccessEvent } from "./events/Access.sol";
|
|
5
8
|
import { AssetEvent } from "./events/Asset.sol";
|
|
6
9
|
import { BalanceEvent } from "./events/Balance.sol";
|
|
@@ -16,3 +19,6 @@ import { PeerEvent } from "./events/Peer.sol";
|
|
|
16
19
|
import { QuoteEvent } from "./events/Quote.sol";
|
|
17
20
|
import { RootZeroEvent } from "./events/RootZero.sol";
|
|
18
21
|
import { WithdrawalEvent } from "./events/Withdraw.sol";
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
package/README.md
CHANGED
|
@@ -1,30 +1,22 @@
|
|
|
1
1
|
# rootzero
|
|
2
2
|
|
|
3
|
-
`rootzero` is the Solidity library
|
|
3
|
+
`rootzero` is the Solidity library for building hosts and commands for the rootzero protocol.
|
|
4
4
|
|
|
5
|
-
It contains the reusable contracts, utilities, and encoding helpers that
|
|
6
|
-
|
|
7
|
-
## What You Build With It
|
|
8
|
-
|
|
9
|
-
- `Host` contracts that register with RootZero discovery and expose trusted command endpoints
|
|
10
|
-
- `Command` contracts that execute protocol actions such as transfer, deposit, withdraw, settlement, and admin flows
|
|
11
|
-
- Shared request/response block parsing and writing logic
|
|
12
|
-
- Shared id, asset, account, and event encoding used across the protocol
|
|
5
|
+
It contains the reusable contracts, utilities, cursor parsers, and encoding helpers that rootzero applications compose on top of. If you are building a host, a command contract, or protocol tooling that needs to speak the protocol's ID, asset, account, and block formats, this repo is the shared foundation.
|
|
13
6
|
|
|
14
7
|
## Main Entry Points
|
|
15
8
|
|
|
16
|
-
Most consumers should start from the package root
|
|
9
|
+
Most consumers should start from the package root entry points:
|
|
17
10
|
|
|
18
|
-
- `@rootzero/contracts/Core.sol
|
|
19
|
-
- `@rootzero/contracts/Commands.sol
|
|
20
|
-
- `@rootzero/contracts/
|
|
21
|
-
- `@rootzero/contracts/Utils.sol
|
|
22
|
-
- `@rootzero/contracts/Events.sol
|
|
11
|
+
- `@rootzero/contracts/Core.sol` — host, access control, balances, and validator building blocks
|
|
12
|
+
- `@rootzero/contracts/Commands.sol` — command and peer base contracts plus all standard command mixins
|
|
13
|
+
- `@rootzero/contracts/Cursors.sol` — cursor reader (`Cur`), block schemas, key constants, memory refs, and writers
|
|
14
|
+
- `@rootzero/contracts/Utils.sol` — IDs, assets, accounts, state discriminants, layout, and value helpers
|
|
15
|
+
- `@rootzero/contracts/Events.sol` — reusable event emitters and event contracts
|
|
23
16
|
|
|
24
17
|
## Start Here
|
|
25
18
|
|
|
26
|
-
If you are new to
|
|
27
|
-
https://github.com/lastqubit/rootzero-contracts/blob/main/docs/GETTING_STARTED.md
|
|
19
|
+
If you are new to rootzero, read [`docs/GETTING_STARTED.md`](docs/GETTING_STARTED.md) first.
|
|
28
20
|
|
|
29
21
|
It walks through:
|
|
30
22
|
|
|
@@ -35,17 +27,40 @@ It walks through:
|
|
|
35
27
|
- a custom command example
|
|
36
28
|
- simple TypeScript request encoding
|
|
37
29
|
|
|
30
|
+
## Block Wire Format
|
|
31
|
+
|
|
32
|
+
All request and response data is encoded as a binary block stream. Each block is:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
[bytes4 key][bytes4 payloadLen][payload]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`key` is `bytes4(keccak256(schemaString))` — see `Keys` for the full set. `Cursors` parses calldata streams zero-copy via the `Cur` struct; `Writers` builds response streams into pre-allocated memory; `Mem` parses in-memory streams for composed responses.
|
|
39
|
+
|
|
40
|
+
## State Discriminants
|
|
41
|
+
|
|
42
|
+
Every command declares its input and output state shape using constants from the `State` library:
|
|
43
|
+
|
|
44
|
+
| Constant | Meaning |
|
|
45
|
+
|----------------------|-----------------------------------|
|
|
46
|
+
| `State.Empty` | No state (empty stream) |
|
|
47
|
+
| `State.Steps` | STEP blocks (sub-command pipeline)|
|
|
48
|
+
| `State.Balances` | BALANCE blocks |
|
|
49
|
+
| `State.Transactions` | TRANSACTION blocks |
|
|
50
|
+
| `State.Custodies` | CUSTODY blocks |
|
|
51
|
+
| `State.Claims` | Claim records |
|
|
52
|
+
|
|
38
53
|
## Typical Usage
|
|
39
54
|
|
|
40
55
|
### Build a Host
|
|
41
56
|
|
|
42
|
-
Extend `Host` when you want a
|
|
57
|
+
Extend `Host` when you want a rootzero host contract with admin command support and optional discovery registration.
|
|
43
58
|
|
|
44
59
|
```solidity
|
|
45
60
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
46
61
|
pragma solidity ^0.8.33;
|
|
47
62
|
|
|
48
|
-
import {Host} from "@rootzero/contracts/Core.sol";
|
|
63
|
+
import { Host } from "@rootzero/contracts/Core.sol";
|
|
49
64
|
|
|
50
65
|
contract ExampleHost is Host {
|
|
51
66
|
constructor(address rootzero)
|
|
@@ -54,82 +69,67 @@ contract ExampleHost is Host {
|
|
|
54
69
|
}
|
|
55
70
|
```
|
|
56
71
|
|
|
57
|
-
`rootzero` is the trusted
|
|
58
|
-
|
|
59
|
-
`Host` already layers in the standard admin command flows used by RootZero hosts:
|
|
60
|
-
|
|
61
|
-
- `Authorize`
|
|
62
|
-
- `Unauthorize`
|
|
63
|
-
- `Relocate`
|
|
72
|
+
`rootzero` is the trusted runtime address. If it implements `IHostDiscovery`, the host announces itself there during deployment. Use `address(0)` for a self-managed host that does not auto-register.
|
|
64
73
|
|
|
65
74
|
### Build a Command
|
|
66
75
|
|
|
67
|
-
Extend `CommandBase`
|
|
76
|
+
Extend `CommandBase` to define a command mixin that runs inside the protocol's trusted call model. Commands are abstract contracts mixed into a host.
|
|
68
77
|
|
|
69
78
|
```solidity
|
|
70
79
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
71
80
|
pragma solidity ^0.8.33;
|
|
72
81
|
|
|
73
|
-
import {CommandBase, CommandContext} from "@rootzero/contracts/Commands.sol";
|
|
82
|
+
import { CommandBase, CommandContext } from "@rootzero/contracts/Commands.sol";
|
|
83
|
+
import { Cursors, Cur, Schemas } from "@rootzero/contracts/Cursors.sol";
|
|
84
|
+
import { State } from "@rootzero/contracts/Utils.sol";
|
|
85
|
+
|
|
86
|
+
using Cursors for Cur;
|
|
74
87
|
|
|
75
88
|
string constant NAME = "myCommand";
|
|
76
|
-
string constant ROUTE = "route(uint foo, uint bar)";
|
|
77
89
|
|
|
78
90
|
abstract contract ExampleCommand is CommandBase {
|
|
79
91
|
uint internal immutable myCommandId = commandId(NAME);
|
|
80
92
|
|
|
81
93
|
constructor() {
|
|
82
|
-
emit Command(host, NAME,
|
|
94
|
+
emit Command(host, NAME, Schemas.Amount, myCommandId, State.Empty, State.Balances);
|
|
83
95
|
}
|
|
84
96
|
|
|
85
97
|
function myCommand(
|
|
86
98
|
CommandContext calldata c
|
|
87
99
|
) external payable onlyCommand(myCommandId, c.target) returns (bytes memory) {
|
|
88
|
-
|
|
100
|
+
(Cur memory input, , ) = cursor(c.request, 1);
|
|
101
|
+
(bytes32 asset, bytes32 meta, uint amount) = input.unpackAmount();
|
|
102
|
+
input.complete();
|
|
103
|
+
return Cursors.toBalanceBlock(asset, meta, amount);
|
|
89
104
|
}
|
|
90
105
|
}
|
|
91
106
|
```
|
|
92
107
|
|
|
93
|
-
`CommandBase` gives you the common RootZero command context:
|
|
94
|
-
|
|
95
|
-
- trusted caller enforcement
|
|
96
|
-
- admin checks
|
|
97
|
-
- expiry checks
|
|
98
|
-
- command-to-command or command-to-host calls through encoded RootZero node ids
|
|
99
|
-
- shared command events
|
|
100
|
-
|
|
101
108
|
## Repo Layout
|
|
102
109
|
|
|
103
|
-
- `contracts/core
|
|
104
|
-
- `contracts/commands
|
|
105
|
-
- `contracts/peer
|
|
106
|
-
- `contracts/blocks
|
|
107
|
-
- `contracts/utils
|
|
108
|
-
- `contracts/events
|
|
109
|
-
- `contracts/interfaces
|
|
110
|
+
- `contracts/core` — host, access control, balances, operation base, and signature validation
|
|
111
|
+
- `contracts/commands` — standard command building blocks and admin commands
|
|
112
|
+
- `contracts/peer` — peer protocol surfaces for inter-host asset flows and asset allow/deny
|
|
113
|
+
- `contracts/blocks` — block stream schema (`Schema`), cursor parsing (`Cursors`), memory refs (`Mem`), and writers (`Writers`)
|
|
114
|
+
- `contracts/utils` — shared encoding helpers: IDs, assets, accounts, state discriminants, layout, ECDSA
|
|
115
|
+
- `contracts/events` — protocol event contracts and emitters
|
|
116
|
+
- `contracts/interfaces` — discovery interfaces and shared external protocol surfaces
|
|
117
|
+
- `docs` — introductory documentation
|
|
110
118
|
|
|
111
|
-
## Install
|
|
119
|
+
## Install and Compile
|
|
112
120
|
|
|
113
121
|
```bash
|
|
114
122
|
npm install @rootzero/contracts
|
|
115
123
|
npm run compile
|
|
116
124
|
```
|
|
117
125
|
|
|
118
|
-
The stable import surface for consumers is:
|
|
119
|
-
|
|
120
|
-
- `@rootzero/contracts/Core.sol`
|
|
121
|
-
- `@rootzero/contracts/Commands.sol`
|
|
122
|
-
- `@rootzero/contracts/Blocks.sol`
|
|
123
|
-
- `@rootzero/contracts/Utils.sol`
|
|
124
|
-
- `@rootzero/contracts/Events.sol`
|
|
125
|
-
|
|
126
126
|
## When To Use This Repo
|
|
127
127
|
|
|
128
128
|
Use `rootzero` if you want to:
|
|
129
129
|
|
|
130
|
-
- create a new
|
|
131
|
-
- implement a new
|
|
132
|
-
- reuse
|
|
133
|
-
- share protocol-level Solidity code across multiple
|
|
130
|
+
- create a new rootzero host
|
|
131
|
+
- implement a new rootzero command
|
|
132
|
+
- reuse the protocol's block format and wire encoding
|
|
133
|
+
- share protocol-level Solidity code across multiple rootzero applications
|
|
134
134
|
|
|
135
135
|
If you are looking for a full end-user app or deployment repo, this library is the lower-level protocol package rather than the full product surface.
|
package/Utils.sol
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
|
+
pragma solidity ^0.8.33;
|
|
3
|
+
|
|
4
|
+
// Aggregator: re-exports all utility libraries (State, Accounts, Assets, ECDSA, Ids, Layout, Utils, Value).
|
|
5
|
+
// Import this file to access the full utility surface without managing individual paths.
|
|
6
|
+
|
|
7
|
+
import { State } from "./utils/State.sol";
|
|
8
|
+
import { Accounts } from "./utils/Accounts.sol";
|
|
9
|
+
import { Amounts, Assets } from "./utils/Assets.sol";
|
|
10
|
+
import { ECDSA } from "./utils/ECDSA.sol";
|
|
11
|
+
import { Ids, Selectors } from "./utils/Ids.sol";
|
|
12
|
+
import { Layout } from "./utils/Layout.sol";
|
|
13
|
+
import { Schemas } from "./blocks/Schema.sol";
|
|
14
|
+
import { addrOr, applyBps, beforeBps, bytes32ToString, divisible, isFamily, isLocal, isLocalFamily, matchesBase, MAX_BPS, max8, max16, max24, max32, max40, max64, max96, max128, max160, NotDivisible, toLocalBase, toLocalFamily, toUnspecifiedBase, ValueOverflow } from "./utils/Utils.sol";
|
|
15
|
+
import { Values } from "./utils/Value.sol";
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|