@rootzero/contracts 1.3.0 → 1.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/CHANGELOG.md +13 -0
- package/Events.sol +2 -2
- package/events/Commander.sol +19 -0
- package/events/Labeled.sol +6 -6
- package/events/Route.sol +18 -0
- package/package.json +1 -1
- package/utils/Actions.sol +1 -0
- package/events/Chain.sol +0 -19
- package/events/Transfer.sol +0 -22
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
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.4.0
|
|
7
|
+
|
|
8
|
+
### Breaking Changes
|
|
9
|
+
|
|
10
|
+
- Replaced the `Chain` discovery event with `Commander(uint indexed host, uint chain, bytes32 native, bytes32 admin)`.
|
|
11
|
+
- Removed the `Transfer` flow event; account flows should be represented with `Spent` and `Received`.
|
|
12
|
+
- Renamed the indexed `Labeled` event parameter from `id` to `entity` in the published ABI string.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- Added `Route(uint indexed host, uint chain, uint context)` for generic cross-chain route discovery.
|
|
17
|
+
- Added `Actions.Refund` for unused payable command value returned through settlement hooks.
|
|
18
|
+
|
|
6
19
|
## 1.3.0
|
|
7
20
|
|
|
8
21
|
### Breaking Changes
|
package/Events.sol
CHANGED
|
@@ -8,7 +8,7 @@ import { AdminEvent } from "./events/Admin.sol";
|
|
|
8
8
|
import { AssetStatusEvent } from "./events/Asset.sol";
|
|
9
9
|
import { Actions } from "./utils/Actions.sol";
|
|
10
10
|
import { BalanceEvent } from "./events/Balance.sol";
|
|
11
|
-
import {
|
|
11
|
+
import { CommanderEvent } from "./events/Commander.sol";
|
|
12
12
|
import { CommandEvent } from "./events/Command.sol";
|
|
13
13
|
import { PositionEvent } from "./events/Position.sol";
|
|
14
14
|
import { ReceivedEvent } from "./events/Received.sol";
|
|
@@ -22,8 +22,8 @@ import { NodeEvent } from "./events/Node.sol";
|
|
|
22
22
|
import { PeerEvent } from "./events/Peer.sol";
|
|
23
23
|
import { QueryEvent } from "./events/Query.sol";
|
|
24
24
|
import { RootedEvent } from "./events/Rooted.sol";
|
|
25
|
+
import { RouteEvent } from "./events/Route.sol";
|
|
25
26
|
import { SpentEvent } from "./events/Spent.sol";
|
|
26
|
-
import { TransferEvent } from "./events/Transfer.sol";
|
|
27
27
|
import { UnlockedEvent } from "./events/Unlocked.sol";
|
|
28
28
|
|
|
29
29
|
|
|
@@ -0,0 +1,19 @@
|
|
|
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 when a commander is announced for a chain/domain.
|
|
7
|
+
abstract contract CommanderEvent is EventEmitter {
|
|
8
|
+
string private constant ABI = "event Commander(uint indexed host, uint chain, bytes32 native, bytes32 admin)";
|
|
9
|
+
|
|
10
|
+
/// @param host Commander host node ID for the chain.
|
|
11
|
+
/// @param chain Chain/domain node ID.
|
|
12
|
+
/// @param native Native asset ID for the chain.
|
|
13
|
+
/// @param admin Admin account for the commander host on the chain.
|
|
14
|
+
event Commander(uint indexed host, uint chain, bytes32 native, bytes32 admin);
|
|
15
|
+
|
|
16
|
+
constructor() {
|
|
17
|
+
emit EventAbi(ABI);
|
|
18
|
+
}
|
|
19
|
+
}
|
package/events/Labeled.sol
CHANGED
|
@@ -3,17 +3,17 @@ pragma solidity ^0.8.33;
|
|
|
3
3
|
|
|
4
4
|
import {EventEmitter} from "./Emitter.sol";
|
|
5
5
|
|
|
6
|
-
/// @notice Emitted to attach a human-readable namespaced label to
|
|
6
|
+
/// @notice Emitted to attach a human-readable namespaced label to an entity.
|
|
7
7
|
/// @dev Labels are claims by the emitting contract. Any contract may emit a
|
|
8
|
-
/// label for any
|
|
9
|
-
/// trusted for each labeled
|
|
8
|
+
/// label for any entity, so off-chain indexers must decide which emitters are
|
|
9
|
+
/// trusted for each labeled entity or namespace.
|
|
10
10
|
abstract contract LabeledEvent is EventEmitter {
|
|
11
|
-
string private constant ABI = "event Labeled(uint indexed
|
|
11
|
+
string private constant ABI = "event Labeled(uint indexed entity, bytes32 namespace, string name)";
|
|
12
12
|
|
|
13
|
-
/// @param
|
|
13
|
+
/// @param entity Entity being labeled.
|
|
14
14
|
/// @param namespace Label namespace.
|
|
15
15
|
/// @param name Human-readable name within the namespace.
|
|
16
|
-
event Labeled(uint indexed
|
|
16
|
+
event Labeled(uint indexed entity, bytes32 namespace, string name);
|
|
17
17
|
|
|
18
18
|
constructor() {
|
|
19
19
|
emit EventAbi(ABI);
|
package/events/Route.sol
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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 when a host announces a route to another chain/domain.
|
|
7
|
+
abstract contract RouteEvent is EventEmitter {
|
|
8
|
+
string private constant ABI = "event Route(uint indexed host, uint chain, uint context)";
|
|
9
|
+
|
|
10
|
+
/// @param host Host node ID that owns the route.
|
|
11
|
+
/// @param chain Destination chain/domain node ID.
|
|
12
|
+
/// @param context Route context identifier.
|
|
13
|
+
event Route(uint indexed host, uint chain, uint context);
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
emit EventAbi(ABI);
|
|
17
|
+
}
|
|
18
|
+
}
|
package/package.json
CHANGED
package/utils/Actions.sol
CHANGED
package/events/Chain.sol
DELETED
|
@@ -1,19 +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 when a chain/domain node is announced.
|
|
7
|
-
abstract contract ChainEvent is EventEmitter {
|
|
8
|
-
string private constant ABI = "event Chain(uint indexed chain, bytes32 native, uint commander, bytes32 admin)";
|
|
9
|
-
|
|
10
|
-
/// @param chain Chain node ID.
|
|
11
|
-
/// @param native Native asset ID for the chain.
|
|
12
|
-
/// @param commander Commander host node ID for the chain.
|
|
13
|
-
/// @param admin Admin account for the commander host on the chain.
|
|
14
|
-
event Chain(uint indexed chain, bytes32 native, uint commander, bytes32 admin);
|
|
15
|
-
|
|
16
|
-
constructor() {
|
|
17
|
-
emit EventAbi(ABI);
|
|
18
|
-
}
|
|
19
|
-
}
|
package/events/Transfer.sol
DELETED
|
@@ -1,22 +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 when an asset moves from one account to another.
|
|
7
|
-
abstract contract TransferEvent is EventEmitter {
|
|
8
|
-
string private constant ABI = "event Transfer(bytes32 indexed account, bytes32 to, bytes32 asset, bytes32 meta, uint amount, uint32 action, uint context)";
|
|
9
|
-
|
|
10
|
-
/// @param account Source account identifier.
|
|
11
|
-
/// @param to Destination account identifier.
|
|
12
|
-
/// @param asset Asset identifier.
|
|
13
|
-
/// @param meta Asset metadata slot.
|
|
14
|
-
/// @param amount Amount transferred.
|
|
15
|
-
/// @param action Primary operation hint from `Actions`.
|
|
16
|
-
/// @param context Reserved context value for future use.
|
|
17
|
-
event Transfer(bytes32 indexed account, bytes32 to, bytes32 asset, bytes32 meta, uint amount, uint32 action, uint context);
|
|
18
|
-
|
|
19
|
-
constructor() {
|
|
20
|
-
emit EventAbi(ABI);
|
|
21
|
-
}
|
|
22
|
-
}
|