@rootzero/contracts 1.14.0 → 1.15.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/Core.sol +6 -3
  3. package/Endpoints.sol +1 -2
  4. package/Events.sol +1 -2
  5. package/README.md +36 -7
  6. package/annotations/Action.sol +17 -0
  7. package/annotations/Label.sol +23 -0
  8. package/annotations/Schema.sol +53 -0
  9. package/codec/Blocks.sol +48 -11
  10. package/codec/Decoders.sol +15 -3
  11. package/codec/Keys.sol +6 -2
  12. package/codec/Schema.sol +7 -2
  13. package/codec/Specs.sol +24 -2
  14. package/codec/Writers.sol +2 -4
  15. package/commands/Base.sol +36 -32
  16. package/commands/Burn.sol +6 -2
  17. package/commands/Deposit.sol +10 -4
  18. package/commands/Payout.sol +6 -2
  19. package/commands/Withdraw.sol +6 -2
  20. package/commands/admin/Annotate.sol +36 -0
  21. package/commands/admin/Appoint.sol +4 -3
  22. package/commands/admin/Base.sol +8 -1
  23. package/commands/admin/Dismiss.sol +4 -3
  24. package/commands/admin/Execute.sol +2 -1
  25. package/core/Access.sol +91 -49
  26. package/core/Calls.sol +27 -22
  27. package/core/Endpoint.sol +34 -46
  28. package/core/Host.sol +63 -21
  29. package/docs/Schema.md +16 -5
  30. package/events/Annotation.sol +24 -0
  31. package/events/Guardian.sol +2 -2
  32. package/events/Introduction.sol +3 -2
  33. package/execution/Execution.sol +28 -7
  34. package/guards/Base.sol +3 -3
  35. package/package.json +1 -1
  36. package/ports/Base.sol +18 -6
  37. package/ports/Settle.sol +6 -2
  38. package/queries/Base.sol +16 -1
  39. package/utils/Accounts.sol +0 -23
  40. package/utils/Cursors.sol +65 -6
  41. package/utils/Layout.sol +0 -2
  42. package/commands/admin/Label.sol +0 -36
  43. package/commands/admin/Schemas.sol +0 -36
  44. package/events/Labeled.sol +0 -21
  45. package/events/Schema.sol +0 -23
@@ -1,36 +0,0 @@
1
- // SPDX-License-Identifier: GPL-3.0-only
2
- pragma solidity ^0.8.33;
3
-
4
- import {AdminBase, Execution, Executions, Lanes, Specs} from "./Base.sol";
5
- using Executions for Execution;
6
-
7
- /// @title PublishSchema
8
- /// @notice Admin command that publishes block schemas for keys.
9
- /// Each SCHEMA block in the input emits one `Schema` event. Only callable by
10
- /// the admin account.
11
- abstract contract PublishSchema is AdminBase {
12
- uint private immutable descriptor;
13
-
14
- constructor() {
15
- (, descriptor) = command("publishSchema", Specs.Empty, Specs.Schema, Specs.Empty, 0, false, true);
16
- }
17
-
18
- /// @notice Publish each SCHEMA block in the admin input.
19
- /// @param input SCHEMA block stream.
20
- /// @return Empty output state.
21
- /// @return Empty transaction stream.
22
- function publishSchema(
23
- bytes32 account,
24
- bytes calldata,
25
- bytes calldata input
26
- ) external onlyAdmin(account) returns (bytes memory, bytes memory) {
27
- Execution memory exec = openInput(input, descriptor, 0);
28
-
29
- while (exec.more()) {
30
- (uint spec, string memory body, bytes32 name) = exec.unpackSchema(Lanes.Input);
31
- emit Schema(host, spec, body, name);
32
- }
33
-
34
- return close(exec, account);
35
- }
36
- }
@@ -1,21 +0,0 @@
1
- // SPDX-License-Identifier: GPL-3.0-only
2
- pragma solidity ^0.8.33;
3
-
4
- import {EventEmitter} from "./Emitter.sol";
5
-
6
- /// @notice Emitted to attach a human-readable namespaced label to an entity.
7
- /// @dev Labels are claims by the emitting contract. Any contract may emit a
8
- /// label for any entity, so off-chain indexers must decide which emitters are
9
- /// trusted for each labeled entity or namespace.
10
- abstract contract LabeledEvent is EventEmitter {
11
- string private constant ABI = "event Labeled(uint indexed entity, bytes32 namespace, string name)";
12
-
13
- /// @param entity Entity being labeled.
14
- /// @param namespace Label namespace.
15
- /// @param name Human-readable name within the namespace.
16
- event Labeled(uint indexed entity, bytes32 namespace, string name);
17
-
18
- constructor() {
19
- emit EventAbi(ABI);
20
- }
21
- }
package/events/Schema.sol DELETED
@@ -1,23 +0,0 @@
1
- // SPDX-License-Identifier: GPL-3.0-only
2
- pragma solidity ^0.8.33;
3
-
4
- import {EventEmitter} from "./Emitter.sol";
5
-
6
- /// @title SchemaEvent
7
- /// @notice Emitted during host deployment to publish a block spec and payload schema.
8
- /// Block keys are opaque `bytes4` tags. Standard protocol blocks use
9
- /// keccak-derived keys by convention, but custom block keys only need to be
10
- /// unique within the publishing host/schema context.
11
- abstract contract SchemaEvent is EventEmitter {
12
- string private constant ABI = "event Schema(uint indexed host, uint spec, string body, bytes32 name)";
13
-
14
- /// @param host Host node ID that publishes this block schema.
15
- /// @param spec Block specification being defined by `host`.
16
- /// @param body Schema DSL string describing the block payload body.
17
- /// @param name Optional block alias used by endpoint descriptors and nested schemas.
18
- event Schema(uint indexed host, uint spec, string body, bytes32 name);
19
-
20
- constructor() {
21
- emit EventAbi(ABI);
22
- }
23
- }