@rootzero/contracts 1.12.0 → 1.13.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 +31 -5
- package/Core.sol +2 -1
- package/Cursors.sol +2 -2
- package/Endpoints.sol +4 -2
- package/README.md +37 -14
- package/blocks/Cursors.sol +129 -0
- package/blocks/Keys.sol +0 -12
- package/blocks/Writers.sol +17 -9
- package/commands/Allocate.sol +49 -0
- package/commands/Burn.sol +3 -2
- package/commands/Credit.sol +4 -11
- package/commands/Debit.sol +4 -11
- package/commands/Deposit.sol +6 -5
- package/commands/Payout.sol +3 -2
- package/commands/Provision.sol +6 -5
- package/commands/Recover.sol +3 -3
- package/commands/Relay.sol +3 -3
- package/commands/Withdraw.sol +3 -2
- package/commands/admin/AllowAssets.sol +3 -2
- package/commands/admin/Allowance.sol +3 -2
- package/commands/admin/Appoint.sol +3 -2
- package/commands/admin/Authorize.sol +3 -2
- package/commands/admin/DenyAssets.sol +3 -2
- package/commands/admin/Dismiss.sol +3 -2
- package/commands/admin/Execute.sol +3 -2
- package/commands/admin/Label.sol +3 -2
- package/commands/admin/Schemas.sol +3 -2
- package/commands/admin/Unauthorize.sol +3 -2
- package/core/Calls.sol +4 -3
- package/core/Endpoint.sol +25 -23
- package/core/Host.sol +10 -2
- package/core/Payable.sol +19 -19
- package/core/Pipeline.sol +17 -14
- package/core/Settlement.sol +39 -0
- package/docs/Schema.md +8 -8
- package/events/Introduction.sol +4 -3
- package/package.json +1 -1
- package/ports/Credit.sol +1 -1
- package/ports/Debit.sol +1 -1
- package/ports/Settle.sol +3 -5
package/package.json
CHANGED
package/ports/Credit.sol
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
pragma solidity ^0.8.33;
|
|
3
3
|
|
|
4
4
|
import { PortBase } from "./Base.sol";
|
|
5
|
-
import { CreditAccountHook } from "../
|
|
5
|
+
import { CreditAccountHook } from "../core/Settlement.sol";
|
|
6
6
|
import { Cursors, Cur, Keys } from "../Cursors.sol";
|
|
7
7
|
|
|
8
8
|
using Cursors for Cur;
|
package/ports/Debit.sol
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
pragma solidity ^0.8.33;
|
|
3
3
|
|
|
4
4
|
import { PortBase } from "./Base.sol";
|
|
5
|
-
import { DebitAccountHook } from "../
|
|
5
|
+
import { DebitAccountHook } from "../core/Settlement.sol";
|
|
6
6
|
import { Cursors, Cur, Keys } from "../Cursors.sol";
|
|
7
7
|
|
|
8
8
|
using Cursors for Cur;
|
package/ports/Settle.sol
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
pragma solidity ^0.8.33;
|
|
3
3
|
|
|
4
4
|
import { PortBase } from "./Base.sol";
|
|
5
|
-
import {
|
|
6
|
-
import { DebitAccountHook } from "../commands/Debit.sol";
|
|
5
|
+
import { Settlement } from "../core/Settlement.sol";
|
|
7
6
|
import { Cursors, Cur, Keys } from "../Cursors.sol";
|
|
8
7
|
|
|
9
8
|
using Cursors for Cur;
|
|
@@ -11,7 +10,7 @@ using Cursors for Cur;
|
|
|
11
10
|
/// @title PortSettle
|
|
12
11
|
/// @notice Port that consumes peer-supplied TRANSACTION blocks through debit and credit hooks.
|
|
13
12
|
/// Each TRANSACTION block calls `debitAccount` for `from` and `creditAccount` for `to`.
|
|
14
|
-
abstract contract PortSettle is PortBase,
|
|
13
|
+
abstract contract PortSettle is PortBase, Settlement {
|
|
15
14
|
bytes32 private immutable descriptor;
|
|
16
15
|
|
|
17
16
|
constructor() {
|
|
@@ -26,8 +25,7 @@ abstract contract PortSettle is PortBase, DebitAccountHook, CreditAccountHook {
|
|
|
26
25
|
|
|
27
26
|
while (input.i < input.len) {
|
|
28
27
|
(bytes32 from, bytes32 to, bytes32 asset, uint amount) = input.unpackTransaction();
|
|
29
|
-
|
|
30
|
-
if (to != 0) creditAccount(to, asset, amount);
|
|
28
|
+
settle(from, to, asset, amount);
|
|
31
29
|
}
|
|
32
30
|
return "";
|
|
33
31
|
}
|