@rootzero/contracts 1.18.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,63 @@
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
+
6
63
  ## 1.18.0
7
64
 
8
65
  ### Added
package/Endpoints.sol CHANGED
@@ -5,57 +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, RepayHook, 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 { Repay, RepayPayable, RepayPayableHook } from "./commands/Repay.sol";
21
- import { RelayPayable, RelayBalancePayable, RelayPayableHook } from "./commands/Relay.sol";
22
- import {
23
- InternalSettle,
24
- Settle,
25
- SettlePayable,
26
- SettlePayableHook
27
- } from "./commands/Settle.sol";
28
- 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";
29
24
 
30
25
  // Admin commands
31
- import { AdminBase } from "./commands/admin/Base.sol";
32
- import { AllowAssets, AllowAssetsHook } from "./commands/admin/AllowAssets.sol";
33
- import { Allowance, AllowanceHook } from "./commands/admin/Allowance.sol";
34
- import { Annotate } from "./commands/admin/Annotate.sol";
35
- import { Appoint } from "./commands/admin/Appoint.sol";
36
- import { Authorize } from "./commands/admin/Authorize.sol";
37
- import { DenyAssets, DenyAssetsHook } from "./commands/admin/DenyAssets.sol";
38
- import { Dismiss } from "./commands/admin/Dismiss.sol";
39
- import { ExecutePayable } from "./commands/admin/Execute.sol";
40
- 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";
41
36
 
42
37
  // Port endpoints
43
- import { PortBase } from "./ports/Base.sol";
44
- import { PortAllowAssets } from "./ports/AllowAssets.sol";
45
- import { PortAllowance } from "./ports/Allowance.sol";
46
- import { PortRedeemBalance, RedeemBalanceHook } from "./ports/Redeem.sol";
47
- import { PortCreditAccount } from "./ports/Credit.sol";
48
- import { PortDebitAccount } from "./ports/Debit.sol";
49
- import { PortDenyAssets } from "./ports/DenyAssets.sol";
50
- import { PortPipePayable } from "./ports/Pipe.sol";
51
- import { PortDispatchPayable } from "./ports/Dispatch.sol";
52
- 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";
53
48
 
54
49
  // Guard endpoints
55
- import { GuardBase } from "./guards/Base.sol";
56
- import { Revoke, RevokeAllowance, RevokeAsset } from "./guards/Revoke.sol";
50
+ import {GuardBase} from "./guards/Base.sol";
51
+ import {Revoke, RevokeAllowance, RevokeAsset} from "./guards/Revoke.sol";
57
52
 
58
53
  // Query endpoints
59
- import { QueryBase } from "./queries/Base.sol";
60
- import { AssetStatus, AssetStatusHook } from "./queries/Assets.sol";
61
- 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
  }