@rootzero/contracts 1.17.0 → 1.19.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/CHANGELOG.md CHANGED
@@ -3,6 +3,90 @@
3
3
  Until the protocol reaches integration-stable status, minor versions may include
4
4
  breaking API changes. Breaking changes are called out explicitly.
5
5
 
6
+ ## 1.19.0
7
+
8
+ ### Breaking Changes
9
+
10
+ - Renamed port endpoint contracts from the `Port*` prefix convention to the
11
+ `*Port` postfix convention: `PortAllowAssets`, `PortAllowance`,
12
+ `PortCreditAccount`, `PortDebitAccount`, `PortDenyAssets`,
13
+ `PortDispatchPayable`, `PortPipePayable`, `PortPost`, and
14
+ `PortRedeemBalance` are now `AllowAssetsPort`, `AllowancePort`,
15
+ `CreditAccountPort`, `DebitAccountPort`, `DenyAssetsPort`,
16
+ `DispatchPayablePort`, `PipePayablePort`, `PostPort`, and
17
+ `RedeemBalancePort` respectively. Endpoint selectors are unchanged.
18
+ - Removed `Blocks.readUint`; cast `uint(Blocks.read32(abs))` when an unchecked
19
+ absolute word read is required, or use the new cursor-consuming `next32`
20
+ helpers while decoding.
21
+ - `Cursors.advance` and `Cursors.slice` now assume the documented packed-cursor
22
+ invariant `i <= len` instead of pre-validating manually constructed cursor
23
+ words. Invalid raw cursor words may now produce an arithmetic panic rather
24
+ than `Cursors.OutOfBounds`.
25
+
26
+ ### Added
27
+
28
+ - Added `enter` and `expectAbs` to `Decoders` and `Executions` for entering a
29
+ parent payload, decoding its children in place, and proving exact final
30
+ consumption.
31
+ - Added consuming `next1`, `next2`, `next4`, `next8`, `next16`, and `next32`
32
+ helpers to `Decoders` and `Executions` for compact fixed-width schema fields.
33
+ - Added calldata-copy encoding across `Buffers`, `Blocks`, `Writers`, and
34
+ `Executions`. In-place helpers use `copy*`, execution helpers use
35
+ `outputCopy*`, and allocating block factories use the `*Copy` suffix.
36
+ - Added allocating factories for LIST, EVM, CONTEXT, and RECOVER blocks, plus
37
+ memory and calldata factory pairs for dynamic leaf and composite blocks.
38
+
39
+ ### Changed
40
+
41
+ - Block factories now allocate once and delegate to their canonical `write*`
42
+ or `copy*` encoder instead of assembling nested intermediate byte arrays.
43
+ - Relay and dispatch paths preserve calldata slices until their destination
44
+ requires memory, avoiding unnecessary explicit calldata-to-memory casts.
45
+ - `Settlement.settle` now implements its documented behavior by routing the
46
+ liability leg through the virtual `repay` primitive before crediting the
47
+ asset leg.
48
+ - Documented that restricting schema `bytesN` fields to power-of-two widths is
49
+ under consideration; all widths from `bytes1` through `bytes32` remain valid.
50
+
51
+ ### Upgrade Compatibility
52
+
53
+ - Update inherited port contract names and their imports to the new `*Port`
54
+ names. No endpoint selector or wire-format migration is required.
55
+ - Replace `Blocks.readUint(abs)` with `uint(Blocks.read32(abs))`, or migrate
56
+ sequential custom decoders to `enter`, `next*`, and `expectAbs`.
57
+ - Code that constructs packed cursors manually must establish `i <= len`
58
+ before calling navigation helpers. Normal cursor constructors and composition
59
+ helpers already preserve this invariant.
60
+ - `Settlement` subclasses that override `repay` will now have that override
61
+ invoked by `settle`, matching the documented extension point.
62
+
63
+ ## 1.18.0
64
+
65
+ ### Added
66
+
67
+ - Added the non-funded `repay` and funded `repayPayable` commands. Both consume
68
+ `Position` state, settle only its liability side, and return the released
69
+ asset side as `Balance` state.
70
+ - Added the reusable non-funded `RepayHook` settlement primitive and the
71
+ execution-funded `RepayPayableHook`.
72
+ - Added the opt-in `RevokeAsset` guardian endpoint, which accepts `Asset`
73
+ entries and denies each asset through the existing `DenyAssetsHook`.
74
+
75
+ ### Changed
76
+
77
+ - `Settlement.settle` now delegates its liability leg to the virtual `repay`
78
+ primitive. The default behavior remains a nonzero `debitAccount` call, while
79
+ derived settlement implementations can customize repayment in one place.
80
+ - Exported the repayment commands and hooks and the asset-revocation guard from
81
+ their corresponding public barrels.
82
+
83
+ ### Upgrade Compatibility
84
+
85
+ - Hosts inheriting `Settlement` retain the previous default settlement
86
+ behavior. Hosts that already declare an internal
87
+ `repay(bytes32,bytes32,uint)` function may need to mark it as an override or
88
+ rename it when upgrading.
89
+
6
90
  ## 1.17.0
7
91
 
8
92
  ### Breaking Changes
package/Core.sol CHANGED
@@ -16,7 +16,7 @@ import { CommandCalls, FailedCall, NodeCalls, PortCalls, RawNodeCalls } from "./
16
16
  import { EndpointBase, InputEndpointBase } from "./core/Endpoint.sol";
17
17
  import { Pipeline } from "./core/Pipeline.sol";
18
18
  import { Budget, Budgets } from "./execution/Budget.sol";
19
- import { CreditAccountHook, DebitAccountHook, PostHook, SettleHook, Settlement } from "./core/Settlement.sol";
19
+ import { CreditAccountHook, DebitAccountHook, PostHook, RepayHook, SettleHook, Settlement } from "./core/Settlement.sol";
20
20
  import { Portal } from "./core/Portal.sol";
21
21
  import { AssetAmount, AccountAsset, HostAsset, AccountAmount, HostAmount, HostAccountAsset, HostAccountAmount, Position, Tx } from "./core/Types.sol";
22
22
  import { Validator } from "./core/Validator.sol";
package/Endpoints.sol CHANGED
@@ -5,51 +5,52 @@ pragma solidity ^0.8.33;
5
5
  // Import this file to inherit from the full rootzero callable host surface without managing individual paths.
6
6
 
7
7
  // Shared endpoint hooks
8
- import { CreditAccountHook, DebitAccountHook, PostHook, SettleHook } from "./core/Settlement.sol";
8
+ import {CreditAccountHook, DebitAccountHook, PostHook, RepayHook, SettleHook} from "./core/Settlement.sol";
9
9
 
10
10
  // Commands
11
- import { CommandBase } from "./commands/Base.sol";
12
- import { Allocate, AllocateHook } from "./commands/Allocate.sol";
13
- import { Burn, BurnHook } from "./commands/Burn.sol";
14
- import { CreditAccount, InternalCreditAccount } from "./commands/Credit.sol";
15
- import { DebitAccount, InternalDebitAccount } from "./commands/Debit.sol";
16
- import { Deposit, DepositHook, DepositPayable, DepositPayableHook } from "./commands/Deposit.sol";
17
- import { Payout, PayoutHook } from "./commands/Payout.sol";
18
- import { Provision, ProvisionHook, ProvisionPayable, ProvisionPayableHook } from "./commands/Provision.sol";
19
- import { RecoverPayable, RecoverPayableHook } from "./commands/Recover.sol";
20
- import { RelayPayable, RelayBalancePayable, RelayPayableHook } from "./commands/Relay.sol";
21
- import { InternalSettle, Settle, SettlePayable, SettlePayableHook } from "./commands/Settle.sol";
22
- import { Withdraw, WithdrawHook } from "./commands/Withdraw.sol";
11
+ import {CommandBase} from "./commands/Base.sol";
12
+ import {Allocate, AllocateHook} from "./commands/Allocate.sol";
13
+ import {Burn, BurnHook} from "./commands/Burn.sol";
14
+ import {CreditAccount, InternalCreditAccount} from "./commands/Credit.sol";
15
+ import {DebitAccount, InternalDebitAccount} from "./commands/Debit.sol";
16
+ import {Deposit, DepositHook, DepositPayable, DepositPayableHook} from "./commands/Deposit.sol";
17
+ import {Payout, PayoutHook} from "./commands/Payout.sol";
18
+ import {Provision, ProvisionHook, ProvisionPayable, ProvisionPayableHook} from "./commands/Provision.sol";
19
+ import {RecoverPayable, RecoverPayableHook} from "./commands/Recover.sol";
20
+ import {Repay, RepayPayable, RepayPayableHook} from "./commands/Repay.sol";
21
+ import {RelayPayable, RelayBalancePayable, RelayPayableHook} from "./commands/Relay.sol";
22
+ import {Settle, SettlePayable, SettlePayableHook, InternalSettle} from "./commands/Settle.sol";
23
+ import {Withdraw, WithdrawHook} from "./commands/Withdraw.sol";
23
24
 
24
25
  // Admin commands
25
- import { AdminBase } from "./commands/admin/Base.sol";
26
- import { AllowAssets, AllowAssetsHook } from "./commands/admin/AllowAssets.sol";
27
- import { Allowance, AllowanceHook } from "./commands/admin/Allowance.sol";
28
- import { Annotate } from "./commands/admin/Annotate.sol";
29
- import { Appoint } from "./commands/admin/Appoint.sol";
30
- import { Authorize } from "./commands/admin/Authorize.sol";
31
- import { DenyAssets, DenyAssetsHook } from "./commands/admin/DenyAssets.sol";
32
- import { Dismiss } from "./commands/admin/Dismiss.sol";
33
- import { ExecutePayable } from "./commands/admin/Execute.sol";
34
- import { Unauthorize } from "./commands/admin/Unauthorize.sol";
26
+ import {AdminBase} from "./commands/admin/Base.sol";
27
+ import {AllowAssets, AllowAssetsHook} from "./commands/admin/AllowAssets.sol";
28
+ import {Allowance, AllowanceHook} from "./commands/admin/Allowance.sol";
29
+ import {Annotate} from "./commands/admin/Annotate.sol";
30
+ import {Appoint} from "./commands/admin/Appoint.sol";
31
+ import {Authorize} from "./commands/admin/Authorize.sol";
32
+ import {DenyAssets, DenyAssetsHook} from "./commands/admin/DenyAssets.sol";
33
+ import {Dismiss} from "./commands/admin/Dismiss.sol";
34
+ import {ExecutePayable} from "./commands/admin/Execute.sol";
35
+ import {Unauthorize} from "./commands/admin/Unauthorize.sol";
35
36
 
36
37
  // Port endpoints
37
- import { PortBase } from "./ports/Base.sol";
38
- import { PortAllowAssets } from "./ports/AllowAssets.sol";
39
- import { PortAllowance } from "./ports/Allowance.sol";
40
- import { PortRedeemBalance, RedeemBalanceHook } from "./ports/Redeem.sol";
41
- import { PortCreditAccount } from "./ports/Credit.sol";
42
- import { PortDebitAccount } from "./ports/Debit.sol";
43
- import { PortDenyAssets } from "./ports/DenyAssets.sol";
44
- import { PortPipePayable } from "./ports/Pipe.sol";
45
- import { PortDispatchPayable } from "./ports/Dispatch.sol";
46
- import { PortPost } from "./ports/Post.sol";
38
+ import {PortBase} from "./ports/Base.sol";
39
+ import {AllowAssetsPort} from "./ports/AllowAssets.sol";
40
+ import {AllowancePort} from "./ports/Allowance.sol";
41
+ import {RedeemBalancePort, RedeemBalanceHook} from "./ports/Redeem.sol";
42
+ import {CreditAccountPort} from "./ports/Credit.sol";
43
+ import {DebitAccountPort} from "./ports/Debit.sol";
44
+ import {DenyAssetsPort} from "./ports/DenyAssets.sol";
45
+ import {PipePayablePort} from "./ports/Pipe.sol";
46
+ import {DispatchPayablePort} from "./ports/Dispatch.sol";
47
+ import {PostPort} from "./ports/Post.sol";
47
48
 
48
49
  // Guard endpoints
49
- import { GuardBase } from "./guards/Base.sol";
50
- import { Revoke, RevokeAllowance } from "./guards/Revoke.sol";
50
+ import {GuardBase} from "./guards/Base.sol";
51
+ import {Revoke, RevokeAllowance, RevokeAsset} from "./guards/Revoke.sol";
51
52
 
52
53
  // Query endpoints
53
- import { QueryBase } from "./queries/Base.sol";
54
- import { AssetStatus, AssetStatusHook } from "./queries/Assets.sol";
55
- import { GetBalances, GetBalancesHook } from "./queries/Balances.sol";
54
+ import {QueryBase} from "./queries/Base.sol";
55
+ import {AssetStatus, AssetStatusHook} from "./queries/Assets.sol";
56
+ import {GetBalances, GetBalancesHook} from "./queries/Balances.sol";
@@ -13,11 +13,7 @@ abstract contract Label is AnnotationEvent {
13
13
  /// @param entity Entity receiving the label annotation.
14
14
  /// @param namespace Label namespace.
15
15
  /// @param name Human-readable name within the namespace.
16
- function label(
17
- uint entity,
18
- bytes32 namespace,
19
- string memory name
20
- ) internal virtual {
16
+ function label(uint entity, bytes32 namespace, string memory name) internal virtual {
21
17
  emit Annotation(entity, Blocks.label(namespace, name));
22
18
  }
23
19
  }