Rename Home and Replica to Outbox and Inbox (#174)

pull/177/head
Asa Oines 3 years ago committed by GitHub
parent d1de95e81b
commit 4c11db7e93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      solidity/abacus-core/contracts/Common.sol
  2. 14
      solidity/abacus-core/contracts/Inbox.sol
  3. 6
      solidity/abacus-core/contracts/Outbox.sol
  4. 20
      solidity/abacus-core/contracts/ValidatorManager.sol
  5. 109
      solidity/abacus-core/contracts/XAppConnectionManager.sol
  6. 16
      solidity/abacus-core/contracts/governance/GovernanceRouter.sol
  7. 6
      solidity/abacus-core/contracts/test/TestInbox.sol
  8. 6
      solidity/abacus-core/contracts/test/TestOutbox.sol
  9. 2
      solidity/abacus-core/libs/Message.sol
  10. 1
      solidity/abacus-core/package.json
  11. 78
      solidity/abacus-core/test/cross-chain/governanceRouter.test.ts
  12. 16
      solidity/abacus-core/test/cross-chain/recoveryManager.test.ts
  13. 64
      solidity/abacus-core/test/cross-chain/simpleMessage.test.ts
  14. 43
      solidity/abacus-core/test/cross-chain/utils.ts
  15. 117
      solidity/abacus-core/test/inbox.test.ts
  16. 86
      solidity/abacus-core/test/lib/AbacusDeployment.ts
  17. 7
      solidity/abacus-core/test/merkle.test.ts
  18. 46
      solidity/abacus-core/test/outbox.test.ts
  19. 36
      solidity/abacus-core/test/validatorManager.test.ts
  20. 87
      solidity/abacus-core/test/xAppConnectionManager.test.ts
  21. 6
      solidity/abacus-core/typechain/Inbox.d.ts
  22. 6
      solidity/abacus-core/typechain/Outbox.d.ts
  23. 6
      solidity/abacus-core/typechain/TestInbox.d.ts
  24. 6
      solidity/abacus-core/typechain/TestOutbox.d.ts
  25. 14
      solidity/abacus-core/typechain/ValidatorManager.d.ts
  26. 210
      solidity/abacus-core/typechain/XAppConnectionManager.d.ts
  27. 2
      solidity/abacus-core/typechain/factories/GovernanceRouter__factory.ts
  28. 31
      solidity/abacus-core/typechain/factories/Inbox__factory.ts
  29. 28
      solidity/abacus-core/typechain/factories/Outbox__factory.ts
  30. 2
      solidity/abacus-core/typechain/factories/TestCommon__factory.ts
  31. 2
      solidity/abacus-core/typechain/factories/TestGovernanceRouter__factory.ts
  32. 28
      solidity/abacus-core/typechain/factories/TestInbox__factory.ts
  33. 2
      solidity/abacus-core/typechain/factories/TestMessage__factory.ts
  34. 28
      solidity/abacus-core/typechain/factories/TestOutbox__factory.ts
  35. 6
      solidity/abacus-core/typechain/factories/ValidatorManager__factory.ts
  36. 106
      solidity/abacus-core/typechain/factories/XAppConnectionManager__factory.ts
  37. 20
      solidity/abacus-core/typechain/hardhat.d.ts
  38. 16
      solidity/abacus-core/typechain/index.ts
  39. 2
      solidity/abacus-core/update_abis.sh
  40. 30
      solidity/abacus-xapps/contracts/XAppConnectionClient.sol
  41. 10
      solidity/abacus-xapps/contracts/bridge/BridgeRouter.sol
  42. 8
      solidity/abacus-xapps/contracts/ping-pong/PingPongRouter.sol
  43. 6
      solidity/abacus-xapps/contracts/xapp-template/RouterTemplate.sol
  44. 6
      solidity/abacus-xapps/test/EthHelper.test.ts
  45. 18
      solidity/abacus-xapps/test/bridge.test.ts
  46. 6
      solidity/abacus-xapps/typechain/Inbox.d.ts
  47. 6
      solidity/abacus-xapps/typechain/Outbox.d.ts
  48. 210
      solidity/abacus-xapps/typechain/XAppConnectionManager.d.ts
  49. 2
      solidity/abacus-xapps/typechain/factories/BridgeRouter__factory.ts
  50. 2
      solidity/abacus-xapps/typechain/factories/BridgeToken__factory.ts
  51. 2
      solidity/abacus-xapps/typechain/factories/ETHHelper__factory.ts
  52. 31
      solidity/abacus-xapps/typechain/factories/Inbox__factory.ts
  53. 2
      solidity/abacus-xapps/typechain/factories/MockWeth__factory.ts
  54. 28
      solidity/abacus-xapps/typechain/factories/Outbox__factory.ts
  55. 2
      solidity/abacus-xapps/typechain/factories/RouterTemplate__factory.ts
  56. 106
      solidity/abacus-xapps/typechain/factories/XAppConnectionManager__factory.ts
  57. 8
      solidity/abacus-xapps/typechain/hardhat.d.ts
  58. 8
      solidity/abacus-xapps/typechain/index.ts
  59. 2
      typescript/abacus-deploy/scripts/deploy-inbox.ts
  60. 10
      typescript/abacus-deploy/scripts/upgrade-replica.ts
  61. 32
      typescript/abacus-deploy/src/agents.ts
  62. 2
      typescript/abacus-deploy/src/agents/gcp.ts
  63. 2
      typescript/abacus-deploy/src/bridge/BridgeContracts.ts
  64. 4
      typescript/abacus-deploy/src/config/addresses.ts
  65. 4
      typescript/abacus-deploy/src/config/agent.ts
  66. 60
      typescript/abacus-deploy/src/core/CoreContracts.ts
  67. 18
      typescript/abacus-deploy/src/core/CoreDeploy.ts
  68. 76
      typescript/abacus-deploy/src/core/checks.ts
  69. 62
      typescript/abacus-deploy/src/core/implementation.ts
  70. 112
      typescript/abacus-deploy/src/core/index.ts
  71. 14
      typescript/abacus-deploy/src/deploy.ts
  72. 10
      typescript/abacus-deploy/src/provider.ts
  73. 4
      typescript/abacus-deploy/src/utils/proxy.ts
  74. 36
      typescript/abacus-sdk/src/abacus/AbacusContext.ts
  75. 59
      typescript/abacus-sdk/src/abacus/contracts/CoreContracts.ts
  76. 20
      typescript/abacus-sdk/src/abacus/domains/dev.ts
  77. 6
      typescript/abacus-sdk/src/abacus/domains/domain.ts
  78. 2
      typescript/abacus-sdk/src/abacus/domains/index.ts
  79. 16
      typescript/abacus-sdk/src/abacus/domains/mainnet.ts
  80. 12
      typescript/abacus-sdk/src/abacus/domains/mainnetLegacy.ts
  81. 16
      typescript/abacus-sdk/src/abacus/domains/testnet.ts
  82. 12
      typescript/abacus-sdk/src/abacus/domains/testnetLegacy.ts
  83. 6
      typescript/abacus-sdk/src/abacus/events/abacusEvents.ts
  84. 106
      typescript/abacus-sdk/src/abacus/messages/AbacusMessage.ts
  85. 2
      typescript/contract-metrics/helm/optics-monitor/templates/deployment.yaml
  86. 2
      typescript/contract-metrics/helm/optics-monitor/values.yaml
  87. 12
      typescript/contract-metrics/src/metrics.ts
  88. 26
      typescript/contract-metrics/src/monitor/core.ts
  89. 6
      typescript/contract-metrics/src/print.ts
  90. 127
      typescript/typechain/abacus-core/IUpdaterManager.d.ts
  91. 1024
      typescript/typechain/abacus-core/Inbox.d.ts
  92. 246
      typescript/typechain/abacus-core/MerkleLib.d.ts
  93. 570
      typescript/typechain/abacus-core/Outbox.d.ts
  94. 145
      typescript/typechain/abacus-core/QueueManager.d.ts
  95. 6
      typescript/typechain/abacus-core/TestInbox.d.ts
  96. 6
      typescript/typechain/abacus-core/TestOutbox.d.ts
  97. 363
      typescript/typechain/abacus-core/TestQueue.d.ts
  98. 575
      typescript/typechain/abacus-core/TestXAppConnectionManager.d.ts
  99. 276
      typescript/typechain/abacus-core/UpdaterManager.d.ts
  100. 14
      typescript/typechain/abacus-core/ValidatorManager.d.ts
  101. Some files were not shown because too many files have changed in this diff Show More

@ -10,7 +10,7 @@ import {Address} from "@openzeppelin/contracts/utils/Address.sol";
/**
* @title Common
* @author Celo Labs Inc.
* @notice Shared utilities between Home and Replica.
* @notice Shared utilities between Outbox and Inbox.
*/
abstract contract Common is OwnableUpgradeable {
// ============ Immutable Variables ============
@ -35,8 +35,8 @@ abstract contract Common is OwnableUpgradeable {
// ============ Events ============
/**
* @notice Emitted when a root is checkpointed on Home or a signed
* checkpoint is relayed to a Replica.
* @notice Emitted when a root is checkpointed on Outbox or a signed
* checkpoint is relayed to a Inbox.
* @param root Merkle root
* @param index Leaf index
*/
@ -71,7 +71,7 @@ abstract contract Common is OwnableUpgradeable {
/**
* @notice Set a new ValidatorManager contract
* @dev Home(s) will initially be initialized using a trusted ValidatorManager contract;
* @dev Outbox(es) will initially be initialized using a trusted ValidatorManager contract;
* we will progressively decentralize by swapping the trusted contract with a new implementation
* that implements Validator bonding & slashing, and rules for Validator selection & rotation
* @param _validatorManager the new ValidatorManager contract

@ -11,12 +11,12 @@ import {IMessageRecipient} from "../interfaces/IMessageRecipient.sol";
import {TypedMemView} from "@summa-tx/memview-sol/contracts/TypedMemView.sol";
/**
* @title Replica
* @title Inbox
* @author Celo Labs Inc.
* @notice Track root updates on Home,
* @notice Track root updates on Outbox,
* prove and dispatch messages to end recipients.
*/
contract Replica is Version0, Common {
contract Inbox is Version0, Common {
// ============ Libraries ============
using MerkleLib for MerkleLib.Tree;
@ -45,7 +45,7 @@ contract Replica is Version0, Common {
// ============ Public Storage ============
// Domain of home chain
// Domain of outbox chain
uint32 public remoteDomain;
// re-entrancy guard
uint8 private entered;
@ -135,7 +135,7 @@ contract Replica is Version0, Common {
* @dev Reverts if `prove` call returns false
* @param _message Formatted message (refer to Common.sol Message library)
* @param _proof Merkle proof of inclusion for message's leaf
* @param _index Index of leaf in home's merkle tree
* @param _index Index of leaf in outbox's merkle tree
*/
function proveAndProcess(
bytes memory _message,
@ -152,7 +152,7 @@ contract Replica is Version0, Common {
* @notice Given formatted message, attempts to dispatch
* message payload to end recipient.
* @dev Recipient must implement a `handle` method (refer to IMessageRecipient.sol)
* Reverts if formatted message's destination domain is not the Replica's domain,
* Reverts if formatted message's destination domain is not the Inbox's domain,
* if message has not been proven,
* or if not enough gas is provided for the dispatch transaction.
* @param _message Formatted message
@ -231,7 +231,7 @@ contract Replica is Version0, Common {
* This means that witnesses never need to be updated for the new root
* @param _leaf Leaf of message to prove
* @param _proof Merkle proof of inclusion for leaf
* @param _index Index of leaf in home's merkle tree
* @param _index Index of leaf in outbox's merkle tree
* @return Returns true if proof was valid and `prove` call succeeded
**/
function prove(

@ -9,7 +9,7 @@ import {Message} from "../libs/Message.sol";
import {MerkleTreeManager} from "./Merkle.sol";
/**
* @title Home
* @title Outbox
* @author Celo Labs Inc.
* @notice Accepts messages to be dispatched to remote chains,
* constructs a Merkle tree of the messages,
@ -18,7 +18,7 @@ import {MerkleTreeManager} from "./Merkle.sol";
* Accepts submissions of fraudulent signatures
* by the Validator and slashes the Validator in this case.
*/
contract Home is Version0, MerkleTreeManager, Common {
contract Outbox is Version0, MerkleTreeManager, Common {
// ============ Libraries ============
using MerkleLib for MerkleLib.Tree;
@ -151,7 +151,7 @@ contract Home is Version0, MerkleTreeManager, Common {
/**
* @notice Checkpoints the latest root and index.
* Validators are expected to sign this checkpoint so that it can be
* relayed to the Replica contracts.
* relayed to the Inbox contracts.
* @dev emits Checkpoint event
*/
function checkpoint() external notFailed {

@ -3,7 +3,7 @@ pragma solidity >=0.6.11;
// ============ Internal Imports ============
import {IValidatorManager} from "../interfaces/IValidatorManager.sol";
import {Home} from "./Home.sol";
import {Outbox} from "./Outbox.sol";
// ============ External Imports ============
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ECDSA} from "@openzeppelin/contracts/cryptography/ECDSA.sol";
@ -35,7 +35,7 @@ contract ValidatorManager is IValidatorManager, Ownable {
* @param signature Signature on `root` and `index`
*/
event ImproperCheckpoint(
address indexed home,
address indexed outbox,
uint32 indexed domain,
address indexed validator,
bytes32 root,
@ -65,30 +65,30 @@ contract ValidatorManager is IValidatorManager, Ownable {
/**
* @notice Check if an Checkpoint is an Improper Checkpoint;
* if so, set the provided Home contract to FAILED state.
* if so, set the provided Outbox contract to FAILED state.
*
* An Improper Checkpoint is an checkpoint that was not previously checkpointed.
* @param _home Address of the Home contract to set to FAILED.
* @param _outbox Address of the Outbox contract to set to FAILED.
* @param _root Merkle root of the improper checkpoint
* @param _index Index root of the improper checkpoint
* @param _signature Validator signature on `_root` and `_index`
* @return TRUE if checkpoint was an Improper Checkpoint (implying Validator was slashed)
*/
function improperCheckpoint(
address _home,
address _outbox,
bytes32 _root,
uint256 _index,
bytes memory _signature
) external returns (bool) {
uint32 _domain = Home(_home).localDomain();
uint32 _domain = Outbox(_outbox).localDomain();
require(
isValidatorSignature(_domain, _root, _index, _signature),
"!validator sig"
);
require(Home(_home).checkpoints(_root) != _index, "!improper");
Home(_home).fail();
require(Outbox(_outbox).checkpoints(_root) != _index, "!improper");
Outbox(_outbox).fail();
emit ImproperCheckpoint(
_home,
_outbox,
_domain,
validators[_domain],
_root,
@ -102,7 +102,7 @@ contract ValidatorManager is IValidatorManager, Ownable {
/**
* @notice Checks that signature was signed by Validator
* @param _domain Domain of Home contract
* @param _domain Domain of Outbox contract
* @param _root Merkle root
* @param _index Corresponding leaf index
* @param _signature Signature on `_root` and `_index`

@ -2,8 +2,8 @@
pragma solidity >=0.6.11;
// ============ Internal Imports ============
import {Home} from "./Home.sol";
import {Replica} from "./Replica.sol";
import {Outbox} from "./Outbox.sol";
import {Inbox} from "./Inbox.sol";
import {TypeCasts} from "../libs/TypeCasts.sol";
// ============ External Imports ============
import {ECDSA} from "@openzeppelin/contracts/cryptography/ECDSA.sol";
@ -12,40 +12,40 @@ import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title XAppConnectionManager
* @author Celo Labs Inc.
* @notice Manages a registry of local Replica contracts for remote Home
* @notice Manages a registry of local Inbox contracts for remote Outbox
* domains.
*/
contract XAppConnectionManager is Ownable {
// ============ Public Storage ============
// Home contract
Home public home;
// local Replica address => remote Home domain
mapping(address => uint32) public replicaToDomain;
// remote Home domain => local Replica address
mapping(uint32 => address) public domainToReplica;
// Outbox contract
Outbox public outbox;
// local Inbox address => remote Outbox domain
mapping(address => uint32) public inboxToDomain;
// remote Outbox domain => local Inbox address
mapping(uint32 => address) public domainToInbox;
// ============ Events ============
/**
* @notice Emitted when a new Home is set.
* @param home the address of the Home
* @notice Emitted when a new Outbox is set.
* @param outbox the address of the Outbox
*/
event NewHome(address indexed home);
event NewOutbox(address indexed outbox);
/**
* @notice Emitted when a new Replica is enrolled / added
* @param domain the remote domain of the Home contract for the Replica
* @param replica the address of the Replica
* @notice Emitted when a new Inbox is enrolled / added
* @param domain the remote domain of the Outbox contract for the Inbox
* @param inbox the address of the Inbox
*/
event ReplicaEnrolled(uint32 indexed domain, address replica);
event InboxEnrolled(uint32 indexed domain, address inbox);
/**
* @notice Emitted when a new Replica is un-enrolled / removed
* @param domain the remote domain of the Home contract for the Replica
* @param replica the address of the Replica
* @notice Emitted when a new Inbox is un-enrolled / removed
* @param domain the remote domain of the Outbox contract for the Inbox
* @param inbox the address of the Inbox
*/
event ReplicaUnenrolled(uint32 indexed domain, address replica);
event InboxUnenrolled(uint32 indexed domain, address inbox);
// ============ Constructor ============
@ -55,68 +55,65 @@ contract XAppConnectionManager is Ownable {
// ============ External Functions ============
/**
* @notice Set the address of the local Home contract
* @param _home the address of the local Home contract
* @notice Set the address of the local Outbox contract
* @param _outbox the address of the local Outbox contract
*/
function setHome(address _home) external onlyOwner {
home = Home(_home);
emit NewHome(_home);
function setOutbox(address _outbox) external onlyOwner {
outbox = Outbox(_outbox);
emit NewOutbox(_outbox);
}
/**
* @notice Allow Owner to enroll Replica contract
* @param _replica the address of the Replica
* @param _domain the remote domain of the Home contract for the Replica
* @notice Allow Owner to enroll Inbox contract
* @param _inbox the address of the Inbox
* @param _domain the remote domain of the Outbox contract for the Inbox
*/
function enrollReplica(address _replica, uint32 _domain)
external
onlyOwner
{
// un-enroll any existing replica
_unenrollReplica(_replica);
// add replica and domain to two-way mapping
replicaToDomain[_replica] = _domain;
domainToReplica[_domain] = _replica;
emit ReplicaEnrolled(_domain, _replica);
function enrollInbox(address _inbox, uint32 _domain) external onlyOwner {
// un-enroll any existing inbox
_unenrollInbox(_inbox);
// add inbox and domain to two-way mapping
inboxToDomain[_inbox] = _domain;
domainToInbox[_domain] = _inbox;
emit InboxEnrolled(_domain, _inbox);
}
/**
* @notice Allow Owner to un-enroll Replica contract
* @param _replica the address of the Replica
* @notice Allow Owner to un-enroll Inbox contract
* @param _inbox the address of the Inbox
*/
function unenrollReplica(address _replica) external onlyOwner {
_unenrollReplica(_replica);
function unenrollInbox(address _inbox) external onlyOwner {
_unenrollInbox(_inbox);
}
/**
* @notice Query local domain from Home
* @notice Query local domain from Outbox
* @return local domain
*/
function localDomain() external view returns (uint32) {
return home.localDomain();
return outbox.localDomain();
}
// ============ Public Functions ============
/**
* @notice Check whether _replica is enrolled
* @param _replica the replica to check for enrollment
* @return TRUE iff _replica is enrolled
* @notice Check whether _inbox is enrolled
* @param _inbox the inbox to check for enrollment
* @return TRUE iff _inbox is enrolled
*/
function isReplica(address _replica) public view returns (bool) {
return replicaToDomain[_replica] != 0;
function isInbox(address _inbox) public view returns (bool) {
return inboxToDomain[_inbox] != 0;
}
// ============ Internal Functions ============
/**
* @notice Remove the replica from the two-way mappings
* @param _replica replica to un-enroll
* @notice Remove the inbox from the two-way mappings
* @param _inbox inbox to un-enroll
*/
function _unenrollReplica(address _replica) internal {
uint32 _currentDomain = replicaToDomain[_replica];
domainToReplica[_currentDomain] = address(0);
replicaToDomain[_replica] = 0;
emit ReplicaUnenrolled(_currentDomain, _replica);
function _unenrollInbox(address _inbox) internal {
uint32 _currentDomain = inboxToDomain[_inbox];
domainToInbox[_currentDomain] = address(0);
inboxToDomain[_inbox] = 0;
emit InboxUnenrolled(_currentDomain, _inbox);
}
}

@ -3,7 +3,7 @@ pragma solidity >=0.6.11;
pragma experimental ABIEncoderV2;
// ============ Internal Imports ============
import {Home} from "../Home.sol";
import {Outbox} from "../Outbox.sol";
import {Version0} from "../Version0.sol";
import {XAppConnectionManager, TypeCasts} from "../XAppConnectionManager.sol";
import {IMessageRecipient} from "../../interfaces/IMessageRecipient.sol";
@ -37,7 +37,7 @@ contract GovernanceRouter is Version0, Initializable, IMessageRecipient {
address public governor;
// domain of Governor chain -- for accepting incoming messages from Governor
uint32 public governorDomain;
// xAppConnectionManager contract which stores Replica addresses
// xAppConnectionManager contract which stores Inbox addresses
XAppConnectionManager public xAppConnectionManager;
// domain -> remote GovernanceRouter contract address
mapping(uint32 => bytes32) public routers;
@ -110,8 +110,8 @@ contract GovernanceRouter is Version0, Initializable, IMessageRecipient {
// ============ Modifiers ============
modifier onlyReplica() {
require(xAppConnectionManager.isReplica(msg.sender), "!replica");
modifier onlyInbox() {
require(xAppConnectionManager.isInbox(msg.sender), "!inbox");
_;
}
@ -195,7 +195,7 @@ contract GovernanceRouter is Version0, Initializable, IMessageRecipient {
uint32 _origin,
bytes32 _sender,
bytes memory _message
) external override onlyReplica onlyGovernorRouter(_origin, _sender) {
) external override onlyInbox onlyGovernorRouter(_origin, _sender) {
bytes29 _msg = _message.ref(0);
if (_msg.isValidCall()) {
_handleCall(_msg.tryAsCall());
@ -235,7 +235,7 @@ contract GovernanceRouter is Version0, Initializable, IMessageRecipient {
// format call message
bytes memory _msg = GovernanceMessage.formatCalls(_calls);
// dispatch call message using Abacus
Home(xAppConnectionManager.home()).dispatch(
Outbox(xAppConnectionManager.outbox()).dispatch(
_destination,
_router,
_msg
@ -422,11 +422,11 @@ contract GovernanceRouter is Version0, Initializable, IMessageRecipient {
* @param _msg The message
*/
function _sendToAllRemoteRouters(bytes memory _msg) internal {
Home _home = Home(xAppConnectionManager.home());
Outbox _outbox = Outbox(xAppConnectionManager.outbox());
for (uint256 i = 0; i < domains.length; i++) {
if (domains[i] != uint32(0)) {
_home.dispatch(domains[i], routers[domains[i]], _msg);
_outbox.dispatch(domains[i], routers[domains[i]], _msg);
}
}
}

@ -1,9 +1,9 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
import "../Replica.sol";
import "../Inbox.sol";
contract TestReplica is Replica {
contract TestInbox is Inbox {
using TypedMemView for bytes;
using TypedMemView for bytes29;
using Message for bytes29;
@ -12,7 +12,7 @@ contract TestReplica is Replica {
uint32 _localDomain,
uint256,
uint256
) Replica(_localDomain, 850_000, 15_000) {} // solhint-disable-line no-empty-blocks
) Inbox(_localDomain, 850_000, 15_000) {} // solhint-disable-line no-empty-blocks
function setMessageProven(bytes memory _message) external {
bytes29 _m = _message.ref(0);

@ -2,11 +2,11 @@
pragma solidity >=0.6.11;
// ============ Internal Imports ============
import "../Home.sol";
import "../Outbox.sol";
import {IValidatorManager} from "../../interfaces/IValidatorManager.sol";
contract TestHome is Home {
constructor(uint32 _localDomain) Home(_localDomain) {} // solhint-disable-line no-empty-blocks
contract TestOutbox is Outbox {
constructor(uint32 _localDomain) Outbox(_localDomain) {} // solhint-disable-line no-empty-blocks
function destinationAndNonce(uint32 _destination, uint32 _nonce)
external

@ -8,7 +8,7 @@ import {TypeCasts} from "./TypeCasts.sol";
/**
* @title Message Library
* @author Celo Labs Inc.
* @notice Library for formatted messages used by Home and Replica.
* @notice Library for formatted messages used by Outbox and Replica.
**/
library Message {
using TypedMemView for bytes;

@ -28,6 +28,7 @@
},
"scripts": {
"prettier": "prettier --write ./contracts ./libs ./test",
"force-compile": "hardhat compile --force && hardhat typechain",
"compile": "hardhat compile && hardhat typechain && npm run prettier && npm run copy-typechain",
"copy-typechain": "cp -r typechain/* ../../typescript/typechain/abacus-core/",
"build": "npm run compile",

@ -9,12 +9,12 @@ import { AbacusDeployment } from '../lib/AbacusDeployment';
import { GovernanceDeployment } from '../lib/GovernanceDeployment';
import {
MysteryMathV2__factory,
TestReplica,
TestReplica__factory,
TestInbox,
TestInbox__factory,
TestRecipient__factory,
TestGovernanceRouter,
Replica,
Home,
Inbox,
Outbox,
} from '../../typechain';
const helpers = require('../../../../vectors/proof.json');
@ -40,9 +40,9 @@ describe('GovernanceRouter', async () => {
secondGovernor: Address,
governorRouter: TestGovernanceRouter,
nonGovernorRouter: TestGovernanceRouter,
governorHome: Home,
governorReplicaOnNonGovernorChain: TestReplica,
nonGovernorReplicaOnGovernorChain: TestReplica,
governorOutbox: Outbox,
governorInboxOnNonGovernorChain: TestInbox,
nonGovernorInboxOnGovernorChain: TestInbox,
validator: Validator;
async function expectGovernor(
@ -74,16 +74,16 @@ describe('GovernanceRouter', async () => {
governorRouter = governanceDeployment.router(governorDomain);
nonGovernorRouter = governanceDeployment.router(nonGovernorDomain);
governorReplicaOnNonGovernorChain = abacusDeployment.replica(
governorInboxOnNonGovernorChain = abacusDeployment.inbox(
nonGovernorDomain,
governorDomain,
);
nonGovernorReplicaOnGovernorChain = abacusDeployment.replica(
nonGovernorInboxOnGovernorChain = abacusDeployment.inbox(
governorDomain,
nonGovernorDomain,
);
governorHome = abacusDeployment.home(governorDomain);
governorOutbox = abacusDeployment.outbox(governorDomain);
});
// NB: must be first test for message proof
@ -120,17 +120,17 @@ describe('GovernanceRouter', async () => {
await upgradeUtils.expectMysteryMathV2(mysteryMath.proxy);
});
it('Rejects message from unenrolled replica', async () => {
const replicaFactory = new TestReplica__factory(signer);
const unenrolledReplica = await replicaFactory.deploy(
it('Rejects message from unenrolled inbox', async () => {
const inboxFactory = new TestInbox__factory(signer);
const unenrolledInbox = await inboxFactory.deploy(
nonGovernorDomain,
processGas,
reserveGas,
);
// The ValdiatorManager is unused in this test, but needs to be a contract.
await unenrolledReplica.initialize(
await unenrolledInbox.initialize(
thirdDomain,
unenrolledReplica.address,
unenrolledInbox.address,
nullRoot,
0,
);
@ -142,14 +142,14 @@ describe('GovernanceRouter', async () => {
);
const abacusMessage = await formatAbacusMessage(
unenrolledReplica,
unenrolledInbox,
governorRouter,
nonGovernorRouter,
transferGovernorMessage,
);
// Expect replica processing to fail when nonGovernorRouter reverts in handle
let success = await unenrolledReplica.callStatic.testProcess(abacusMessage);
// Expect inbox processing to fail when nonGovernorRouter reverts in handle
let success = await unenrolledInbox.callStatic.testProcess(abacusMessage);
expect(success).to.be.false;
});
@ -161,20 +161,19 @@ describe('GovernanceRouter', async () => {
);
const abacusMessage = await formatAbacusMessage(
governorReplicaOnNonGovernorChain,
governorInboxOnNonGovernorChain,
nonGovernorRouter,
governorRouter,
transferGovernorMessage,
);
// Set message status to MessageStatus.Proven
await nonGovernorReplicaOnGovernorChain.setMessageProven(abacusMessage);
await nonGovernorInboxOnGovernorChain.setMessageProven(abacusMessage);
// Expect replica processing to fail when nonGovernorRouter reverts in handle
let success =
await nonGovernorReplicaOnGovernorChain.callStatic.testProcess(
abacusMessage,
);
// Expect inbox processing to fail when nonGovernorRouter reverts in handle
let success = await nonGovernorInboxOnGovernorChain.callStatic.testProcess(
abacusMessage,
);
expect(success).to.be.false;
});
@ -193,19 +192,19 @@ describe('GovernanceRouter', async () => {
);
const abacusMessage = await formatAbacusMessage(
governorReplicaOnNonGovernorChain,
governorInboxOnNonGovernorChain,
governorRouter,
nonGovernorRouter,
transferGovernorMessage,
);
// Expect successful tx on static call
let success = await governorReplicaOnNonGovernorChain.callStatic.process(
let success = await governorInboxOnNonGovernorChain.callStatic.process(
abacusMessage,
);
expect(success).to.be.true;
await governorReplicaOnNonGovernorChain.process(abacusMessage);
await governorInboxOnNonGovernorChain.process(abacusMessage);
await expectGovernor(
nonGovernorRouter,
thirdDomain,
@ -224,21 +223,21 @@ describe('GovernanceRouter', async () => {
);
const abacusMessage = await formatAbacusMessage(
governorReplicaOnNonGovernorChain,
governorInboxOnNonGovernorChain,
governorRouter,
nonGovernorRouter,
setRouterMessage,
);
// Expect successful tx
let success = await governorReplicaOnNonGovernorChain.callStatic.process(
let success = await governorInboxOnNonGovernorChain.callStatic.process(
abacusMessage,
);
expect(success).to.be.true;
// Expect new router to be registered for domain and for new domain to be
// in domains array
await governorReplicaOnNonGovernorChain.process(abacusMessage);
await governorInboxOnNonGovernorChain.process(abacusMessage);
expect(await nonGovernorRouter.routers(thirdDomain)).to.equal(
abacus.ethersAddressToBytes32(router.address),
);
@ -258,17 +257,16 @@ describe('GovernanceRouter', async () => {
const callMessage = abacus.governance.formatCalls([call, call]);
const abacusMessage = await formatAbacusMessage(
governorReplicaOnNonGovernorChain,
governorInboxOnNonGovernorChain,
governorRouter,
nonGovernorRouter,
callMessage,
);
// Expect successful tx
let success =
await governorReplicaOnNonGovernorChain.callStatic.testProcess(
abacusMessage,
);
let success = await governorInboxOnNonGovernorChain.callStatic.testProcess(
abacusMessage,
);
expect(success).to.be.true;
});
@ -307,14 +305,14 @@ describe('GovernanceRouter', async () => {
);
const abacusMessage = await formatAbacusMessage(
governorReplicaOnNonGovernorChain,
governorInboxOnNonGovernorChain,
governorRouter,
nonGovernorRouter,
transferGovernorMessage,
);
// Process transfer governor message on Replica
await governorReplicaOnNonGovernorChain.process(abacusMessage);
// Process transfer governor message on Inbox
await governorInboxOnNonGovernorChain.process(abacusMessage);
// Governor HAS been transferred on original governor domain
await expectGovernor(
@ -366,7 +364,7 @@ describe('GovernanceRouter', async () => {
const validatorManager = abacusDeployment.validatorManager(governorDomain);
await validatorManager.transferOwnership(governorRouter.address);
// check current Validator address on Home
// check current Validator address on Outbox
let currentValidatorAddr = await validatorManager.validators(
governorDomain,
);

@ -9,7 +9,7 @@ import { Signer } from '../lib/types';
import {
ValidatorManager,
TestGovernanceRouter,
TestHome,
TestOutbox,
} from '../../typechain';
import { AbacusDeployment } from '../lib/AbacusDeployment';
import { GovernanceDeployment } from '../lib/GovernanceDeployment';
@ -20,7 +20,7 @@ async function expectNotInRecovery(
randomSigner: Signer,
governor: Signer,
governanceRouter: TestGovernanceRouter,
home: TestHome,
outbox: TestOutbox,
) {
expect(await governanceRouter.inRecovery()).to.be.false;
@ -41,7 +41,7 @@ async function expectNotInRecovery(
// dispatch call on local governorRouter
await expect(
sendFromSigner(governor, governanceRouter, 'callRemote', [2000, [call]]),
).to.emit(home, 'Dispatch');
).to.emit(outbox, 'Dispatch');
// set xApp Connection Manager
const xAppConnectionManager = await governanceRouter.xAppConnectionManager();
@ -210,7 +210,7 @@ describe('RecoveryManager', async () => {
recoveryManager: Signer,
randomSigner: Signer,
governanceRouter: TestGovernanceRouter,
home: TestHome,
outbox: TestOutbox,
validatorManager: ValidatorManager;
before(async () => {
@ -232,7 +232,7 @@ describe('RecoveryManager', async () => {
}
governanceRouter = governanceDeployment.router(localDomain);
home = abacusDeployment.home(localDomain);
outbox = abacusDeployment.outbox(localDomain);
validatorManager = abacusDeployment.validatorManager(localDomain);
// set governor
@ -256,7 +256,7 @@ describe('RecoveryManager', async () => {
randomSigner,
governor,
governanceRouter,
home,
outbox,
);
});
@ -296,7 +296,7 @@ describe('RecoveryManager', async () => {
randomSigner,
governor,
governanceRouter,
home,
outbox,
);
});
@ -469,7 +469,7 @@ describe('RecoveryManager', async () => {
randomSigner,
governor,
governanceRouter,
home,
outbox,
);
});

@ -4,7 +4,7 @@ import { expect } from 'chai';
import * as utils from './utils';
import { Validator, MessageStatus } from '../lib/core';
import { Signer, BytesArray } from '../lib/types';
import { TestRecipient__factory, TestReplica } from '../../typechain';
import { TestRecipient__factory, TestInbox } from '../../typechain';
import { AbacusDeployment } from '../lib/AbacusDeployment';
import { GovernanceDeployment } from '../lib/GovernanceDeployment';
@ -16,10 +16,10 @@ const remoteDomain = domains[1];
/*
* Deploy the full Abacus suite on two chains
* dispatch messages to Home
* checkpoint on Home
* Sign and relay checkpoints to Replica
* TODO prove and process messages on Replica
* dispatch messages to Outbox
* checkpoint on Outbox
* Sign and relay checkpoints to Inbox
* TODO prove and process messages on Inbox
*/
describe('SimpleCrossChainMessage', async () => {
let abacusDeployment: AbacusDeployment;
@ -39,54 +39,60 @@ describe('SimpleCrossChainMessage', async () => {
);
});
it('All Homes have correct initial state', async () => {
it('All Outboxs have correct initial state', async () => {
const nullRoot = '0x' + '00'.repeat(32);
const governorHome = abacusDeployment.home(localDomain);
const governorOutbox = abacusDeployment.outbox(localDomain);
let [root, index] = await governorHome.latestCheckpoint();
let [root, index] = await governorOutbox.latestCheckpoint();
expect(root).to.equal(nullRoot);
expect(index).to.equal(0);
const nonGovernorHome = abacusDeployment.home(remoteDomain);
const nonGovernorOutbox = abacusDeployment.outbox(remoteDomain);
[root, index] = await nonGovernorHome.latestCheckpoint();
[root, index] = await nonGovernorOutbox.latestCheckpoint();
expect(root).to.equal(nullRoot);
expect(index).to.equal(0);
});
it('Origin Home accepts valid messages', async () => {
it('Origin Outbox accepts valid messages', async () => {
const messages = ['message'].map((message) =>
utils.formatMessage(message, remoteDomain, randomSigner.address),
);
await utils.dispatchMessages(abacusDeployment.home(localDomain), messages);
await utils.dispatchMessages(
abacusDeployment.outbox(localDomain),
messages,
);
});
it('Destination Replica accepts a checkpoint', async () => {
const home = abacusDeployment.home(localDomain);
const replica = abacusDeployment.replica(remoteDomain, localDomain);
await utils.checkpoint(home, replica, validator);
it('Destination Inbox accepts a checkpoint', async () => {
const outbox = abacusDeployment.outbox(localDomain);
const inbox = abacusDeployment.inbox(remoteDomain, localDomain);
await utils.checkpoint(outbox, inbox, validator);
});
it('Origin Home accepts batched messages', async () => {
it('Origin Outbox accepts batched messages', async () => {
const messages = ['message1', 'message2', 'message3'].map((message) =>
utils.formatMessage(message, remoteDomain, randomSigner.address),
);
await utils.dispatchMessages(abacusDeployment.home(localDomain), messages);
await utils.dispatchMessages(
abacusDeployment.outbox(localDomain),
messages,
);
});
it('Destination Replica Accepts a second checkpoint', async () => {
const home = abacusDeployment.home(localDomain);
const replica = abacusDeployment.replica(remoteDomain, localDomain);
await utils.checkpoint(home, replica, validator);
it('Destination Inbox Accepts a second checkpoint', async () => {
const outbox = abacusDeployment.outbox(localDomain);
const inbox = abacusDeployment.inbox(remoteDomain, localDomain);
await utils.checkpoint(outbox, inbox, validator);
});
it('Proves and processes a message on Replica', async () => {
it('Proves and processes a message on Inbox', async () => {
// get governance routers
const governorRouter = governanceDeployment.router(localDomain);
const nonGovernorRouter = governanceDeployment.router(remoteDomain);
const replica = abacusDeployment.replica(remoteDomain, localDomain);
const inbox = abacusDeployment.inbox(remoteDomain, localDomain);
const testRecipientFactory = new TestRecipient__factory(randomSigner);
const TestRecipient = await testRecipientFactory.deploy();
@ -115,20 +121,18 @@ describe('SimpleCrossChainMessage', async () => {
const messageHash = abacus.messageHash(abacusMessage);
// set root
const proofRoot = await replica.testBranchRoot(
const proofRoot = await inbox.testBranchRoot(
messageHash,
path as BytesArray,
index,
);
await replica.setCheckpoint(proofRoot, 1);
await inbox.setCheckpoint(proofRoot, 1);
// prove and process message
await replica.proveAndProcess(abacusMessage, path as BytesArray, index);
await inbox.proveAndProcess(abacusMessage, path as BytesArray, index);
// expect call to have been processed
expect(await TestRecipient.processed()).to.be.true;
expect(await replica.messages(messageHash)).to.equal(
MessageStatus.PROCESSED,
);
expect(await inbox.messages(messageHash)).to.equal(MessageStatus.PROCESSED);
});
});

@ -5,9 +5,9 @@ import * as types from 'ethers';
import { Validator } from '../lib/core';
import { CallData, Address } from '../lib/types';
import {
Replica,
TestReplica,
Home,
Inbox,
TestInbox,
Outbox,
TestGovernanceRouter,
} from '../../typechain';
@ -18,7 +18,7 @@ type MessageDetails = {
};
/*
* Dispatch a message from the specified Home contract.
* Dispatch a message from the specified Outbox contract.
*
* @param messageDetails - Message type containing
* the message string,
@ -26,13 +26,13 @@ type MessageDetails = {
* the recipient address on the destination domain to which the message will be dispatched
*/
export async function dispatchMessage(
home: Home,
outbox: Outbox,
messageDetails: MessageDetails,
) {
const { message, destinationDomain, recipientAddress } = messageDetails;
// Send message with random signer address as msg.sender
await home.dispatch(
await outbox.dispatch(
destinationDomain,
abacus.ethersAddressToBytes32(recipientAddress),
ethers.utils.formatBytes32String(message),
@ -40,33 +40,36 @@ export async function dispatchMessage(
}
/*
* Dispatch a set of messages to the specified Home contract.
* Dispatch a set of messages to the specified Outbox contract.
*
* @param messages - Message[]
*/
export async function dispatchMessages(home: Home, messages: MessageDetails[]) {
export async function dispatchMessages(
outbox: Outbox,
messages: MessageDetails[],
) {
for (let message of messages) {
await dispatchMessage(home, message);
await dispatchMessage(outbox, message);
}
}
/*
* Checkpoints a Home, signs that checkpoint, and checkpoints the Replica
* Checkpoints a Outbox, signs that checkpoint, and checkpoints the Inbox
*
* @param home - The Home contract
* @param replica - The Replica contract
* @param outbox - The Outbox contract
* @param inbox - The Inbox contract
* @param validator - The Validator
*/
export async function checkpoint(
home: Home,
replica: Replica,
outbox: Outbox,
inbox: Inbox,
validator: Validator,
) {
await home.checkpoint();
const [root, index] = await home.latestCheckpoint();
await outbox.checkpoint();
const [root, index] = await outbox.latestCheckpoint();
const { signature } = await validator.signCheckpoint(root, index.toNumber());
await replica.checkpoint(root, index, signature);
const checkpointedIndex = await replica.checkpoints(root);
await inbox.checkpoint(root, index, signature);
const checkpointedIndex = await inbox.checkpoints(root);
expect(checkpointedIndex).to.equal(index);
}
@ -92,7 +95,7 @@ export function formatMessage(
}
export async function formatAbacusMessage(
replica: TestReplica,
inbox: TestInbox,
governorRouter: TestGovernanceRouter,
destinationRouter: TestGovernanceRouter,
message: string,
@ -113,7 +116,7 @@ export async function formatAbacusMessage(
);
// Set message status to MessageStatus.Proven
await replica.setMessageProven(abacusMessage);
await inbox.setMessageProven(abacusMessage);
return abacusMessage;
}

@ -11,14 +11,14 @@ import {
BadRecipient5__factory,
BadRecipient6__factory,
BadRecipientHandle__factory,
TestReplica,
TestReplica__factory,
TestInbox,
TestInbox__factory,
ValidatorManager,
ValidatorManager__factory,
TestRecipient__factory,
} from '../typechain';
const homeDomainHashTestCases = require('../../../vectors/homeDomainHash.json');
const outboxDomainHashTestCases = require('../../../vectors/outboxDomainHash.json');
const merkleTestCases = require('../../../vectors/merkle.json');
const proveAndProcessTestCases = require('../../../vectors/proveAndProcess.json');
@ -28,7 +28,7 @@ const processGas = 850000;
const reserveGas = 15000;
const nullRoot = '0x' + '00'.repeat(32);
describe('Replica', async () => {
describe('Inbox', async () => {
const badRecipientFactories = [
BadRecipient1__factory,
BadRecipient2__factory,
@ -38,7 +38,7 @@ describe('Replica', async () => {
BadRecipient6__factory,
];
let replica: TestReplica,
let inbox: TestInbox,
validatorManager: ValidatorManager,
signer: Signer,
fakeSigner: Signer,
@ -56,19 +56,14 @@ describe('Replica', async () => {
});
beforeEach(async () => {
const replicaFactory = new TestReplica__factory(signer);
replica = await replicaFactory.deploy(localDomain, processGas, reserveGas);
await replica.initialize(
remoteDomain,
validatorManager.address,
nullRoot,
0,
);
const inboxFactory = new TestInbox__factory(signer);
inbox = await inboxFactory.deploy(localDomain, processGas, reserveGas);
await inbox.initialize(remoteDomain, validatorManager.address, nullRoot, 0);
});
it('Cannot be initialized twice', async () => {
await expect(
replica.initialize(remoteDomain, validatorManager.address, nullRoot, 0),
inbox.initialize(remoteDomain, validatorManager.address, nullRoot, 0),
).to.be.revertedWith('Initializable: contract is already initialized');
});
@ -76,8 +71,8 @@ describe('Replica', async () => {
const root = ethers.utils.formatBytes32String('first new root');
const index = 1;
const { signature } = await validator.signCheckpoint(root, index);
await replica.checkpoint(root, index, signature);
const [croot, cindex] = await replica.latestCheckpoint();
await inbox.checkpoint(root, index, signature);
const [croot, cindex] = await inbox.latestCheckpoint();
expect(croot).to.equal(root);
expect(cindex).to.equal(index);
});
@ -86,7 +81,7 @@ describe('Replica', async () => {
const root = ethers.utils.formatBytes32String('first new root');
const index = 1;
const { signature } = await fakeValidator.signCheckpoint(root, index);
await expect(replica.checkpoint(root, index, signature)).to.be.revertedWith(
await expect(inbox.checkpoint(root, index, signature)).to.be.revertedWith(
'!validator sig',
);
});
@ -95,15 +90,15 @@ describe('Replica', async () => {
let root = ethers.utils.formatBytes32String('first new root');
let index = 10;
let { signature } = await validator.signCheckpoint(root, index);
await replica.checkpoint(root, index, signature);
const [croot, cindex] = await replica.latestCheckpoint();
await inbox.checkpoint(root, index, signature);
const [croot, cindex] = await inbox.latestCheckpoint();
expect(croot).to.equal(root);
expect(cindex).to.equal(index);
root = ethers.utils.formatBytes32String('second new root');
index = 9;
({ signature } = await validator.signCheckpoint(root, index));
await expect(replica.checkpoint(root, index, signature)).to.be.revertedWith(
await expect(inbox.checkpoint(root, index, signature)).to.be.revertedWith(
'old checkpoint',
);
});
@ -113,29 +108,29 @@ describe('Replica', async () => {
const testCase = merkleTestCases[0];
let { leaf, index, path } = testCase.proofs[0];
await replica.setCheckpoint(testCase.expectedRoot, 1);
await inbox.setCheckpoint(testCase.expectedRoot, 1);
// Ensure proper static call return value
expect(await replica.callStatic.prove(leaf, path as BytesArray, index)).to
.be.true;
expect(await inbox.callStatic.prove(leaf, path as BytesArray, index)).to.be
.true;
await replica.prove(leaf, path as BytesArray, index);
expect(await replica.messages(leaf)).to.equal(MessageStatus.PENDING);
await inbox.prove(leaf, path as BytesArray, index);
expect(await inbox.messages(leaf)).to.equal(MessageStatus.PENDING);
});
it('Rejects an already-proven message', async () => {
const testCase = merkleTestCases[0];
let { leaf, index, path } = testCase.proofs[0];
await replica.setCheckpoint(testCase.expectedRoot, 1);
await inbox.setCheckpoint(testCase.expectedRoot, 1);
// Prove message, which changes status to MessageStatus.Pending
await replica.prove(leaf, path as BytesArray, index);
expect(await replica.messages(leaf)).to.equal(MessageStatus.PENDING);
await inbox.prove(leaf, path as BytesArray, index);
expect(await inbox.messages(leaf)).to.equal(MessageStatus.PENDING);
// Try to prove message again
await expect(
replica.prove(leaf, path as BytesArray, index),
inbox.prove(leaf, path as BytesArray, index),
).to.be.revertedWith('!MessageStatus.None');
});
@ -145,17 +140,19 @@ describe('Replica', async () => {
let { leaf, index, path } = testCase.proofs[0];
// Switch ordering of proof hashes
const firstHash = path[0];
path[0] = path[1];
path[1] = firstHash;
// NB: We copy 'path' here to avoid mutating the test cases for
// other tests.
const newPath = [...path];
newPath[0] = path[1];
newPath[1] = path[0];
await replica.setCheckpoint(testCase.expectedRoot, 1);
await inbox.setCheckpoint(testCase.expectedRoot, 1);
expect(await replica.callStatic.prove(leaf, path as BytesArray, index)).to
expect(await inbox.callStatic.prove(leaf, newPath as BytesArray, index)).to
.be.false;
await replica.prove(leaf, path as BytesArray, index);
expect(await replica.messages(leaf)).to.equal(MessageStatus.NONE);
await inbox.prove(leaf, newPath as BytesArray, index);
expect(await inbox.messages(leaf)).to.equal(MessageStatus.NONE);
});
it('Processes a proved message', async () => {
@ -175,15 +172,15 @@ describe('Replica', async () => {
);
// Set message status to MessageStatus.Pending
await replica.setMessageProven(abacusMessage);
await inbox.setMessageProven(abacusMessage);
// Ensure proper static call return value
const success = await replica.callStatic.process(abacusMessage);
const success = await inbox.callStatic.process(abacusMessage);
expect(success).to.be.true;
const processTx = replica.process(abacusMessage);
const processTx = inbox.process(abacusMessage);
await expect(processTx)
.to.emit(replica, 'Process')
.to.emit(inbox, 'Process')
.withArgs(abacus.messageHash(abacusMessage), true, '0x');
});
@ -201,7 +198,7 @@ describe('Replica', async () => {
body,
);
await expect(replica.process(abacusMessage)).to.be.revertedWith('!proven');
await expect(inbox.process(abacusMessage)).to.be.revertedWith('!proven');
});
for (let i = 0; i < badRecipientFactories.length; i++) {
@ -223,8 +220,8 @@ describe('Replica', async () => {
);
// Set message status to MessageStatus.Pending
await replica.setMessageProven(abacusMessage);
await replica.process(abacusMessage);
await inbox.setMessageProven(abacusMessage);
await inbox.process(abacusMessage);
});
}
@ -243,7 +240,7 @@ describe('Replica', async () => {
body,
);
await expect(replica.process(abacusMessage)).to.be.revertedWith(
await expect(inbox.process(abacusMessage)).to.be.revertedWith(
'!destination',
);
});
@ -262,8 +259,8 @@ describe('Replica', async () => {
);
// Set message status to MessageStatus.Pending
await replica.setMessageProven(abacusMessage);
await expect(replica.process(abacusMessage)).to.not.be.reverted;
await inbox.setMessageProven(abacusMessage);
await expect(inbox.process(abacusMessage)).to.not.be.reverted;
});
it('Fails to process an undergased transaction', async () => {
@ -281,11 +278,11 @@ describe('Replica', async () => {
);
// Set message status to MessageStatus.Pending
await replica.setMessageProven(abacusMessage);
await inbox.setMessageProven(abacusMessage);
// Required gas is >= 510,000 (we provide 500,000)
await expect(
replica.process(abacusMessage, { gasLimit: 500000 }),
inbox.process(abacusMessage, { gasLimit: 500000 }),
).to.be.revertedWith('!gas');
});
@ -306,10 +303,10 @@ describe('Replica', async () => {
);
// Set message status to MessageStatus.Pending
await replica.setMessageProven(abacusMessage);
await inbox.setMessageProven(abacusMessage);
// Ensure bad handler function causes process to return false
let success = await replica.callStatic.process(abacusMessage);
let success = await inbox.callStatic.process(abacusMessage);
expect(success).to.be.false;
});
@ -335,23 +332,21 @@ describe('Replica', async () => {
const { path, index } = proveAndProcessTestCases[0];
const messageHash = abacus.messageHash(abacusMessage);
// Set replica's current root to match newly computed root that includes
// Set inbox's current root to match newly computed root that includes
// the new leaf (normally root will have already been computed and path
// simply verifies leaf is in tree but because it is cryptographically
// impossible to find the inputs that create a pre-determined root, we
// simply recalculate root with the leaf using branchRoot)
const proofRoot = await replica.testBranchRoot(
const proofRoot = await inbox.testBranchRoot(
messageHash,
path as BytesArray,
index,
);
await replica.setCheckpoint(proofRoot, 1);
await inbox.setCheckpoint(proofRoot, 1);
await replica.proveAndProcess(abacusMessage, path as BytesArray, index);
await inbox.proveAndProcess(abacusMessage, path as BytesArray, index);
expect(await replica.messages(messageHash)).to.equal(
MessageStatus.PROCESSED,
);
expect(await inbox.messages(messageHash)).to.equal(MessageStatus.PROCESSED);
});
it('Has proveAndProcess fail if prove fails', async () => {
@ -373,17 +368,17 @@ describe('Replica', async () => {
);
// Ensure root given in proof and actual root don't match so that
// replica.prove(...) will fail
const proofRoot = await replica.testBranchRoot(
// inbox.prove(...) will fail
const proofRoot = await inbox.testBranchRoot(
leaf,
path as BytesArray,
index,
);
const rootIndex = await replica.checkpoints(proofRoot);
const rootIndex = await inbox.checkpoints(proofRoot);
expect(rootIndex).to.equal(0);
await expect(
replica.proveAndProcess(abacusMessage, path as BytesArray, index),
inbox.proveAndProcess(abacusMessage, path as BytesArray, index),
).to.be.revertedWith('!prove');
});
});

@ -6,26 +6,26 @@ import * as types from './types';
import { Validator } from './core';
import {
TestHome,
TestHome__factory,
TestOutbox,
TestOutbox__factory,
ValidatorManager,
ValidatorManager__factory,
UpgradeBeaconController,
UpgradeBeaconController__factory,
XAppConnectionManager,
XAppConnectionManager__factory,
TestReplica,
TestReplica__factory,
TestInbox,
TestInbox__factory,
} from '../../typechain';
export interface AbacusInstance {
domain: types.Domain;
validator: Validator;
validatorManager: ValidatorManager;
home: TestHome;
outbox: TestOutbox;
connectionManager: XAppConnectionManager;
ubc: UpgradeBeaconController;
replicas: Record<number, TestReplica>;
inboxs: Record<number, TestInbox>;
}
const processGas = 850000;
@ -69,57 +69,53 @@ export class AbacusDeployment {
const ubcFactory = new UpgradeBeaconController__factory(signer);
const ubc = await ubcFactory.deploy();
const homeFactory = new TestHome__factory(signer);
const home = await homeFactory.deploy(local);
await home.initialize(validatorManager.address);
const outboxFactory = new TestOutbox__factory(signer);
const outbox = await outboxFactory.deploy(local);
await outbox.initialize(validatorManager.address);
const connectionManagerFactory = new XAppConnectionManager__factory(signer);
const connectionManager = await connectionManagerFactory.deploy();
await connectionManager.setHome(home.address);
await connectionManager.setOutbox(outbox.address);
const replicaFactory = new TestReplica__factory(signer);
const replicas: Record<number, TestReplica> = {};
const inboxFactory = new TestInbox__factory(signer);
const inboxs: Record<number, TestInbox> = {};
const deploys = remotes.map(async (remoteDomain) => {
const replica = await replicaFactory.deploy(
local,
processGas,
reserveGas,
);
await replica.initialize(
const inbox = await inboxFactory.deploy(local, processGas, reserveGas);
await inbox.initialize(
remoteDomain,
validatorManager.address,
nullRoot,
0,
);
await connectionManager.enrollReplica(replica.address, remoteDomain);
replicas[remoteDomain] = replica;
await connectionManager.enrollInbox(inbox.address, remoteDomain);
inboxs[remoteDomain] = inbox;
});
await Promise.all(deploys);
return {
domain: local,
validator: await Validator.fromSigner(signer, local),
home,
outbox,
connectionManager,
validatorManager,
replicas,
inboxs,
ubc,
};
}
async transferOwnership(domain: types.Domain, address: types.Address) {
await this.home(domain).transferOwnership(address);
await this.outbox(domain).transferOwnership(address);
await this.ubc(domain).transferOwnership(address);
await this.connectionManager(domain).transferOwnership(address);
await this.validatorManager(domain).transferOwnership(address);
for (const remote of this.domains) {
if (remote !== domain) {
await this.replica(domain, remote).transferOwnership(address);
await this.inbox(domain, remote).transferOwnership(address);
}
}
}
home(domain: types.Domain): TestHome {
return this.instances[domain].home;
outbox(domain: types.Domain): TestOutbox {
return this.instances[domain].outbox;
}
ubc(domain: types.Domain): UpgradeBeaconController {
@ -130,8 +126,8 @@ export class AbacusDeployment {
return this.instances[domain].validator;
}
replica(local: types.Domain, remote: types.Domain): TestReplica {
return this.instances[local].replicas[remote];
inbox(local: types.Domain, remote: types.Domain): TestInbox {
return this.instances[local].inboxs[remote];
}
connectionManager(domain: types.Domain): XAppConnectionManager {
@ -149,17 +145,17 @@ export class AbacusDeployment {
}
async processMessagesFromDomain(local: types.Domain) {
const home = this.home(local);
const [checkpointedRoot] = await home.latestCheckpoint();
const outbox = this.outbox(local);
const [checkpointedRoot] = await outbox.latestCheckpoint();
// Find the block number of the last checkpoint submitted on Home.
const checkpointFilter = home.filters.Checkpoint(checkpointedRoot);
const checkpoints = await home.queryFilter(checkpointFilter);
// Find the block number of the last checkpoint submitted on Outbox.
const checkpointFilter = outbox.filters.Checkpoint(checkpointedRoot);
const checkpoints = await outbox.queryFilter(checkpointFilter);
assert(checkpoints.length === 0 || checkpoints.length === 1);
const fromBlock = checkpoints.length === 0 ? 0 : checkpoints[0].blockNumber;
await home.checkpoint();
const [root, index] = await home.latestCheckpoint();
await outbox.checkpoint();
const [root, index] = await outbox.latestCheckpoint();
// If there have been no checkpoints since the last checkpoint, return.
if (
index.eq(0) ||
@ -167,9 +163,9 @@ export class AbacusDeployment {
) {
return;
}
// Update the Home and Replicas to the latest roots.
// Update the Outbox and Inboxs to the latest roots.
// This is technically not necessary given that we are not proving against
// a root in the TestReplica.
// a root in the TestInbox.
const validator = this.validator(local);
const { signature } = await validator.signCheckpoint(
root,
@ -178,20 +174,20 @@ export class AbacusDeployment {
for (const remote of this.domains) {
if (remote !== local) {
const replica = this.replica(remote, local);
await replica.checkpoint(root, index, signature);
const inbox = this.inbox(remote, local);
await inbox.checkpoint(root, index, signature);
}
}
// Find all messages dispatched on the home since the previous checkpoint.
const dispatchFilter = home.filters.Dispatch();
const dispatches = await home.queryFilter(dispatchFilter, fromBlock);
// Find all messages dispatched on the outbox since the previous checkpoint.
const dispatchFilter = outbox.filters.Dispatch();
const dispatches = await outbox.queryFilter(dispatchFilter, fromBlock);
for (const dispatch of dispatches) {
const destination = dispatch.args.destinationAndNonce.shr(32).toNumber();
if (destination !== local) {
const replica = this.replica(destination, local);
await replica.setMessageProven(dispatch.args.message);
await replica.testProcess(dispatch.args.message);
const inbox = this.inbox(destination, local);
await inbox.setMessageProven(dispatch.args.message);
await inbox.testProcess(dispatch.args.message);
}
}
}

@ -11,7 +11,7 @@ describe('Merkle', async () => {
const { testName, leaves, expectedRoot, proofs } = testCase;
describe(testName, async () => {
let merkle: TestMerkle, root: string;
let merkle: TestMerkle;
before(async () => {
const [signer] = await ethers.getSigners();
@ -32,8 +32,7 @@ describe('Merkle', async () => {
});
it('produces the proper root', async () => {
root = await merkle.root();
expect(root).to.equal(expectedRoot);
expect(await merkle.root()).to.equal(expectedRoot);
});
it("can verify the leaves' proofs", async () => {
@ -45,7 +44,7 @@ describe('Merkle', async () => {
path as BytesArray,
index,
);
expect(proofRoot).to.equal(root);
expect(proofRoot).to.equal(expectedRoot);
}
});
});

@ -3,7 +3,7 @@ import { expect } from 'chai';
import { AbacusState, Validator } from './lib/core';
import { Signer } from './lib/types';
import { TestHome, TestHome__factory } from '../typechain';
import { TestOutbox, TestOutbox__factory } from '../typechain';
const destinationNonceTestCases = require('../../../vectors/destinationNonce.json');
@ -11,36 +11,36 @@ const localDomain = 1000;
const destDomain = 2000;
const nullAddress: string = '0x' + '00'.repeat(32);
describe('Home', async () => {
let home: TestHome, signer: Signer, recipient: Signer;
describe('Outbox', async () => {
let outbox: TestOutbox, signer: Signer, recipient: Signer;
before(async () => {
[signer, recipient] = await ethers.getSigners();
});
beforeEach(async () => {
// redeploy the home before each test run
const homeFactory = new TestHome__factory(signer);
home = await homeFactory.deploy(localDomain);
// redeploy the outbox before each test run
const outboxFactory = new TestOutbox__factory(signer);
outbox = await outboxFactory.deploy(localDomain);
// The ValidatorManager is unused in these tests *but* needs to be a
// contract.
await home.initialize(home.address);
await outbox.initialize(outbox.address);
});
it('Cannot be initialized twice', async () => {
await expect(home.initialize(home.address)).to.be.revertedWith(
await expect(outbox.initialize(outbox.address)).to.be.revertedWith(
'Initializable: contract is already initialized',
);
});
it('ValidatorManager can fail', async () => {
await home.testSetValidatorManager(signer.address);
await home.fail();
expect(await home.state()).to.equal(AbacusState.FAILED);
await outbox.testSetValidatorManager(signer.address);
await outbox.fail();
expect(await outbox.state()).to.equal(AbacusState.FAILED);
const message = ethers.utils.formatBytes32String('message');
await expect(
home.dispatch(
outbox.dispatch(
destDomain,
abacus.ethersAddressToBytes32(recipient.address),
message,
@ -49,7 +49,7 @@ describe('Home', async () => {
});
it('Non ValidatorManager cannot fail', async () => {
await expect(home.connect(recipient).fail()).to.be.revertedWith(
await expect(outbox.connect(recipient).fail()).to.be.revertedWith(
'!validatorManager',
);
});
@ -57,7 +57,7 @@ describe('Home', async () => {
it('Does not dispatch too large messages', async () => {
const message = `0x${Buffer.alloc(3000).toString('hex')}`;
await expect(
home.dispatch(
outbox.dispatch(
destDomain,
abacus.ethersAddressToBytes32(recipient.address),
message,
@ -67,7 +67,7 @@ describe('Home', async () => {
it('Dispatches a message', async () => {
const message = ethers.utils.formatBytes32String('message');
const nonce = await home.nonces(localDomain);
const nonce = await outbox.nonces(localDomain);
// Format data that will be emitted from Dispatch event
const destinationAndNonce = abacus.destinationAndNonce(destDomain, nonce);
@ -81,12 +81,12 @@ describe('Home', async () => {
message,
);
const messageHash = abacus.messageHash(abacusMessage);
const leafIndex = await home.tree();
const [checkpointedRoot] = await home.latestCheckpoint();
const leafIndex = await outbox.tree();
const [checkpointedRoot] = await outbox.latestCheckpoint();
// Send message with signer address as msg.sender
await expect(
home
outbox
.connect(signer)
.dispatch(
destDomain,
@ -94,7 +94,7 @@ describe('Home', async () => {
message,
),
)
.to.emit(home, 'Dispatch')
.to.emit(outbox, 'Dispatch')
.withArgs(
messageHash,
leafIndex,
@ -106,13 +106,13 @@ describe('Home', async () => {
it('Checkpoints the latest root', async () => {
const message = ethers.utils.formatBytes32String('message');
await home.dispatch(
await outbox.dispatch(
destDomain,
abacus.ethersAddressToBytes32(recipient.address),
message,
);
await home.checkpoint();
const [root, index] = await home.latestCheckpoint();
await outbox.checkpoint();
const [root, index] = await outbox.latestCheckpoint();
expect(root).to.not.equal(nullAddress);
expect(index).to.equal(1);
});
@ -120,7 +120,7 @@ describe('Home', async () => {
it('Correctly calculates destinationAndNonce', async () => {
for (let testCase of destinationNonceTestCases) {
let { destination, nonce, expectedDestinationAndNonce } = testCase;
const solidityDestinationAndNonce = await home.destinationAndNonce(
const solidityDestinationAndNonce = await outbox.destinationAndNonce(
destination,
nonce,
);

@ -5,13 +5,13 @@ import { AbacusState, Validator } from './lib/core';
import { Signer } from './lib/types';
import {
Home__factory,
Home,
Outbox__factory,
Outbox,
ValidatorManager__factory,
ValidatorManager,
} from '../typechain';
const homeDomainHashCases = require('../../../vectors/homeDomainHash.json');
const outboxDomainHashCases = require('../../../vectors/outboxDomainHash.json');
const localDomain = 1000;
describe('ValidatorManager', async () => {
@ -64,19 +64,21 @@ describe('ValidatorManager', async () => {
it('Calculated domain hash matches Rust-produced domain hash', async () => {
// Compare Rust output in json file to solidity output (json file matches
// hash for local domain of 1000)
for (let testCase of homeDomainHashCases) {
for (let testCase of outboxDomainHashCases) {
const { expectedDomainHash } = testCase;
const domainHash = await validatorManager.domainHash(testCase.homeDomain);
const domainHash = await validatorManager.domainHash(
testCase.outboxDomain,
);
expect(domainHash).to.equal(expectedDomainHash);
}
});
describe('improper checkpoints', async () => {
let home: Home;
let outbox: Outbox;
beforeEach(async () => {
const homeFactory = new Home__factory(signer);
home = await homeFactory.deploy(localDomain);
await home.initialize(validatorManager.address);
const outboxFactory = new Outbox__factory(signer);
outbox = await outboxFactory.deploy(localDomain);
await outbox.initialize(validatorManager.address);
});
it('Accepts improper checkpoint from validator', async () => {
@ -87,7 +89,7 @@ describe('ValidatorManager', async () => {
// Send message with signer address as msg.sender
await expect(
validatorManager.improperCheckpoint(
home.address,
outbox.address,
root,
index,
signature,
@ -95,14 +97,14 @@ describe('ValidatorManager', async () => {
)
.to.emit(validatorManager, 'ImproperCheckpoint')
.withArgs(
home.address,
outbox.address,
localDomain,
validator.address,
root,
index,
signature,
);
expect(await home.state()).to.equal(AbacusState.FAILED);
expect(await outbox.state()).to.equal(AbacusState.FAILED);
});
it('Rejects improper checkpoint from non-validator', async () => {
@ -113,7 +115,7 @@ describe('ValidatorManager', async () => {
// Send message with signer address as msg.sender
await expect(
validatorManager.improperCheckpoint(
home.address,
outbox.address,
root,
index,
signature,
@ -123,13 +125,13 @@ describe('ValidatorManager', async () => {
it('Rejects proper checkpoint from validator', async () => {
const message = `0x${Buffer.alloc(10).toString('hex')}`;
await home.dispatch(
await outbox.dispatch(
localDomain,
abacus.ethersAddressToBytes32(signer.address),
message,
);
await home.checkpoint();
const [root, index] = await home.latestCheckpoint();
await outbox.checkpoint();
const [root, index] = await outbox.latestCheckpoint();
const { signature } = await validator.signCheckpoint(
root,
@ -138,7 +140,7 @@ describe('ValidatorManager', async () => {
// Send message with signer address as msg.sender
await expect(
validatorManager.improperCheckpoint(
home.address,
outbox.address,
root,
index,
signature,

@ -2,11 +2,11 @@ import { ethers, abacus } from 'hardhat';
import { expect } from 'chai';
import {
TestHome__factory,
TestReplica__factory,
TestOutbox__factory,
TestInbox__factory,
XAppConnectionManager,
XAppConnectionManager__factory,
TestReplica,
TestInbox,
} from '../typechain';
import { Validator } from './lib/core';
import { Signer } from './lib/types';
@ -22,7 +22,7 @@ const nullRoot = '0x' + '00'.repeat(32);
describe('XAppConnectionManager', async () => {
let connectionManager: XAppConnectionManager,
enrolledReplica: TestReplica,
enrolledInbox: TestInbox,
signer: Signer,
validator: Validator;
@ -32,26 +32,23 @@ describe('XAppConnectionManager', async () => {
});
beforeEach(async () => {
const homeFactory = new TestHome__factory(signer);
const home = await homeFactory.deploy(localDomain);
const outboxFactory = new TestOutbox__factory(signer);
const outbox = await outboxFactory.deploy(localDomain);
const replicaFactory = new TestReplica__factory(signer);
enrolledReplica = await replicaFactory.deploy(
const inboxFactory = new TestInbox__factory(signer);
enrolledInbox = await inboxFactory.deploy(
localDomain,
processGas,
reserveGas,
);
// The ValidatorManager is unused in these tests *but* needs to be a
// contract.
await enrolledReplica.initialize(remoteDomain, home.address, nullRoot, 0);
await enrolledInbox.initialize(remoteDomain, outbox.address, nullRoot, 0);
const connectionManagerFactory = new XAppConnectionManager__factory(signer);
connectionManager = await connectionManagerFactory.deploy();
await connectionManager.setHome(home.address);
await connectionManager.enrollReplica(
enrolledReplica.address,
remoteDomain,
);
await connectionManager.setOutbox(outbox.address);
await connectionManager.enrollInbox(enrolledInbox.address, remoteDomain);
});
it('Returns the local domain', async () => {
@ -59,65 +56,63 @@ describe('XAppConnectionManager', async () => {
});
it('onlyOwner function rejects call from non-owner', async () => {
const [nonHome, nonOwner] = await ethers.getSigners();
const [nonOutbox, nonOwner] = await ethers.getSigners();
await expect(
connectionManager.connect(nonOwner).setHome(nonHome.address),
connectionManager.connect(nonOwner).setOutbox(nonOutbox.address),
).to.be.revertedWith(ONLY_OWNER_REVERT_MSG);
});
it('isReplica returns true for enrolledReplica and false for non-enrolled Replica', async () => {
const [nonEnrolledReplica] = await ethers.getSigners();
expect(await connectionManager.isReplica(enrolledReplica.address)).to.be
.true;
expect(await connectionManager.isReplica(nonEnrolledReplica.address)).to.be
it('isInbox returns true for enrolledInbox and false for non-enrolled Inbox', async () => {
const [nonEnrolledInbox] = await ethers.getSigners();
expect(await connectionManager.isInbox(enrolledInbox.address)).to.be.true;
expect(await connectionManager.isInbox(nonEnrolledInbox.address)).to.be
.false;
});
it('Allows owner to set the home', async () => {
const homeFactory = new TestHome__factory(signer);
const newHome = await homeFactory.deploy(localDomain);
it('Allows owner to set the outbox', async () => {
const outboxFactory = new TestOutbox__factory(signer);
const newOutbox = await outboxFactory.deploy(localDomain);
await connectionManager.setHome(newHome.address);
expect(await connectionManager.home()).to.equal(newHome.address);
await connectionManager.setOutbox(newOutbox.address);
expect(await connectionManager.outbox()).to.equal(newOutbox.address);
});
it('Owner can enroll a replica', async () => {
it('Owner can enroll a inbox', async () => {
const newRemoteDomain = 3000;
const replicaFactory = new TestReplica__factory(signer);
const newReplica = await replicaFactory.deploy(
const inboxFactory = new TestInbox__factory(signer);
const newInbox = await inboxFactory.deploy(
localDomain,
processGas,
reserveGas,
);
// Assert new replica not considered replica before enrolled
expect(await connectionManager.isReplica(newReplica.address)).to.be.false;
// Assert new inbox not considered inbox before enrolled
expect(await connectionManager.isInbox(newInbox.address)).to.be.false;
await expect(
connectionManager.enrollReplica(newReplica.address, newRemoteDomain),
).to.emit(connectionManager, 'ReplicaEnrolled');
connectionManager.enrollInbox(newInbox.address, newRemoteDomain),
).to.emit(connectionManager, 'InboxEnrolled');
expect(await connectionManager.domainToReplica(newRemoteDomain)).to.equal(
newReplica.address,
expect(await connectionManager.domainToInbox(newRemoteDomain)).to.equal(
newInbox.address,
);
expect(
await connectionManager.replicaToDomain(newReplica.address),
).to.equal(newRemoteDomain);
expect(await connectionManager.isReplica(newReplica.address)).to.be.true;
expect(await connectionManager.inboxToDomain(newInbox.address)).to.equal(
newRemoteDomain,
);
expect(await connectionManager.isInbox(newInbox.address)).to.be.true;
});
it('Owner can unenroll a replica', async () => {
it('Owner can unenroll a inbox', async () => {
await expect(
connectionManager.unenrollReplica(enrolledReplica.address),
).to.emit(connectionManager, 'ReplicaUnenrolled');
connectionManager.unenrollInbox(enrolledInbox.address),
).to.emit(connectionManager, 'InboxUnenrolled');
expect(
await connectionManager.replicaToDomain(enrolledReplica.address),
await connectionManager.inboxToDomain(enrolledInbox.address),
).to.equal(0);
expect(await connectionManager.domainToReplica(localDomain)).to.equal(
expect(await connectionManager.domainToInbox(localDomain)).to.equal(
ethers.constants.AddressZero,
);
expect(await connectionManager.isReplica(enrolledReplica.address)).to.be
.false;
expect(await connectionManager.isInbox(enrolledInbox.address)).to.be.false;
});
});

@ -19,7 +19,7 @@ import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface ReplicaInterface extends ethers.utils.Interface {
interface InboxInterface extends ethers.utils.Interface {
functions: {
"PROCESS_GAS()": FunctionFragment;
"RESERVE_GAS()": FunctionFragment;
@ -250,7 +250,7 @@ interface ReplicaInterface extends ethers.utils.Interface {
getEvent(nameOrSignatureOrTopic: "Process"): EventFragment;
}
export class Replica extends BaseContract {
export class Inbox extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
@ -291,7 +291,7 @@ export class Replica extends BaseContract {
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: ReplicaInterface;
interface: InboxInterface;
functions: {
PROCESS_GAS(overrides?: CallOverrides): Promise<[BigNumber]>;

@ -19,7 +19,7 @@ import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface HomeInterface extends ethers.utils.Interface {
interface OutboxInterface extends ethers.utils.Interface {
functions: {
"MAX_MESSAGE_BODY_BYTES()": FunctionFragment;
"VERSION()": FunctionFragment;
@ -163,7 +163,7 @@ interface HomeInterface extends ethers.utils.Interface {
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
}
export class Home extends BaseContract {
export class Outbox extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
@ -204,7 +204,7 @@ export class Home extends BaseContract {
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: HomeInterface;
interface: OutboxInterface;
functions: {
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<[BigNumber]>;

@ -19,7 +19,7 @@ import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface TestReplicaInterface extends ethers.utils.Interface {
interface TestInboxInterface extends ethers.utils.Interface {
functions: {
"PROCESS_GAS()": FunctionFragment;
"RESERVE_GAS()": FunctionFragment;
@ -323,7 +323,7 @@ interface TestReplicaInterface extends ethers.utils.Interface {
getEvent(nameOrSignatureOrTopic: "Process"): EventFragment;
}
export class TestReplica extends BaseContract {
export class TestInbox extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
@ -364,7 +364,7 @@ export class TestReplica extends BaseContract {
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: TestReplicaInterface;
interface: TestInboxInterface;
functions: {
PROCESS_GAS(overrides?: CallOverrides): Promise<[BigNumber]>;

@ -19,7 +19,7 @@ import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface TestHomeInterface extends ethers.utils.Interface {
interface TestOutboxInterface extends ethers.utils.Interface {
functions: {
"MAX_MESSAGE_BODY_BYTES()": FunctionFragment;
"VERSION()": FunctionFragment;
@ -181,7 +181,7 @@ interface TestHomeInterface extends ethers.utils.Interface {
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
}
export class TestHome extends BaseContract {
export class TestOutbox extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
@ -222,7 +222,7 @@ export class TestHome extends BaseContract {
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: TestHomeInterface;
interface: TestOutboxInterface;
functions: {
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<[BigNumber]>;

@ -146,7 +146,7 @@ export class ValidatorManager extends BaseContract {
): Promise<[string]>;
improperCheckpoint(
_home: string,
_outbox: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
@ -187,7 +187,7 @@ export class ValidatorManager extends BaseContract {
domainHash(_domain: BigNumberish, overrides?: CallOverrides): Promise<string>;
improperCheckpoint(
_home: string,
_outbox: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
@ -228,7 +228,7 @@ export class ValidatorManager extends BaseContract {
): Promise<string>;
improperCheckpoint(
_home: string,
_outbox: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
@ -263,7 +263,7 @@ export class ValidatorManager extends BaseContract {
filters: {
ImproperCheckpoint(
home?: string | null,
outbox?: string | null,
domain?: BigNumberish | null,
validator?: string | null,
root?: null,
@ -272,7 +272,7 @@ export class ValidatorManager extends BaseContract {
): TypedEventFilter<
[string, number, string, string, BigNumber, string],
{
home: string;
outbox: string;
domain: number;
validator: string;
root: string;
@ -305,7 +305,7 @@ export class ValidatorManager extends BaseContract {
): Promise<BigNumber>;
improperCheckpoint(
_home: string,
_outbox: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
@ -350,7 +350,7 @@ export class ValidatorManager extends BaseContract {
): Promise<PopulatedTransaction>;
improperCheckpoint(
_home: string,
_outbox: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,

@ -21,96 +21,96 @@ import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface XAppConnectionManagerInterface extends ethers.utils.Interface {
functions: {
"domainToReplica(uint32)": FunctionFragment;
"enrollReplica(address,uint32)": FunctionFragment;
"home()": FunctionFragment;
"isReplica(address)": FunctionFragment;
"domainToInbox(uint32)": FunctionFragment;
"enrollInbox(address,uint32)": FunctionFragment;
"inboxToDomain(address)": FunctionFragment;
"isInbox(address)": FunctionFragment;
"localDomain()": FunctionFragment;
"outbox()": FunctionFragment;
"owner()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"replicaToDomain(address)": FunctionFragment;
"setHome(address)": FunctionFragment;
"setOutbox(address)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"unenrollReplica(address)": FunctionFragment;
"unenrollInbox(address)": FunctionFragment;
};
encodeFunctionData(
functionFragment: "domainToReplica",
functionFragment: "domainToInbox",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "enrollReplica",
functionFragment: "enrollInbox",
values: [string, BigNumberish]
): string;
encodeFunctionData(functionFragment: "home", values?: undefined): string;
encodeFunctionData(functionFragment: "isReplica", values: [string]): string;
encodeFunctionData(
functionFragment: "inboxToDomain",
values: [string]
): string;
encodeFunctionData(functionFragment: "isInbox", values: [string]): string;
encodeFunctionData(
functionFragment: "localDomain",
values?: undefined
): string;
encodeFunctionData(functionFragment: "outbox", values?: undefined): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "replicaToDomain",
values: [string]
): string;
encodeFunctionData(functionFragment: "setHome", values: [string]): string;
encodeFunctionData(functionFragment: "setOutbox", values: [string]): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(
functionFragment: "unenrollReplica",
functionFragment: "unenrollInbox",
values: [string]
): string;
decodeFunctionResult(
functionFragment: "domainToReplica",
functionFragment: "domainToInbox",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "enrollReplica",
functionFragment: "enrollInbox",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "home", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "isReplica", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "localDomain",
functionFragment: "inboxToDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "isInbox", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
functionFragment: "localDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "outbox", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "replicaToDomain",
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setHome", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "setOutbox", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "unenrollReplica",
functionFragment: "unenrollInbox",
data: BytesLike
): Result;
events: {
"NewHome(address)": EventFragment;
"InboxEnrolled(uint32,address)": EventFragment;
"InboxUnenrolled(uint32,address)": EventFragment;
"NewOutbox(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
"ReplicaEnrolled(uint32,address)": EventFragment;
"ReplicaUnenrolled(uint32,address)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "NewHome"): EventFragment;
getEvent(nameOrSignatureOrTopic: "InboxEnrolled"): EventFragment;
getEvent(nameOrSignatureOrTopic: "InboxUnenrolled"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewOutbox"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ReplicaEnrolled"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ReplicaUnenrolled"): EventFragment;
}
export class XAppConnectionManager extends BaseContract {
@ -157,33 +157,33 @@ export class XAppConnectionManager extends BaseContract {
interface: XAppConnectionManagerInterface;
functions: {
domainToReplica(
domainToInbox(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<[string]>;
enrollReplica(
_replica: string,
enrollInbox(
_inbox: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
home(overrides?: CallOverrides): Promise<[string]>;
inboxToDomain(arg0: string, overrides?: CallOverrides): Promise<[number]>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<[boolean]>;
isInbox(_inbox: string, overrides?: CallOverrides): Promise<[boolean]>;
localDomain(overrides?: CallOverrides): Promise<[number]>;
outbox(overrides?: CallOverrides): Promise<[string]>;
owner(overrides?: CallOverrides): Promise<[string]>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
replicaToDomain(arg0: string, overrides?: CallOverrides): Promise<[number]>;
setHome(
_home: string,
setOutbox(
_outbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
@ -192,39 +192,36 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
unenrollReplica(
_replica: string,
unenrollInbox(
_inbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
};
domainToReplica(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<string>;
domainToInbox(arg0: BigNumberish, overrides?: CallOverrides): Promise<string>;
enrollReplica(
_replica: string,
enrollInbox(
_inbox: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
home(overrides?: CallOverrides): Promise<string>;
inboxToDomain(arg0: string, overrides?: CallOverrides): Promise<number>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<boolean>;
isInbox(_inbox: string, overrides?: CallOverrides): Promise<boolean>;
localDomain(overrides?: CallOverrides): Promise<number>;
outbox(overrides?: CallOverrides): Promise<string>;
owner(overrides?: CallOverrides): Promise<string>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
replicaToDomain(arg0: string, overrides?: CallOverrides): Promise<number>;
setHome(
_home: string,
setOutbox(
_outbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
@ -233,47 +230,59 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
unenrollReplica(
_replica: string,
unenrollInbox(
_inbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
callStatic: {
domainToReplica(
domainToInbox(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<string>;
enrollReplica(
_replica: string,
enrollInbox(
_inbox: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<void>;
home(overrides?: CallOverrides): Promise<string>;
inboxToDomain(arg0: string, overrides?: CallOverrides): Promise<number>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<boolean>;
isInbox(_inbox: string, overrides?: CallOverrides): Promise<boolean>;
localDomain(overrides?: CallOverrides): Promise<number>;
outbox(overrides?: CallOverrides): Promise<string>;
owner(overrides?: CallOverrides): Promise<string>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
replicaToDomain(arg0: string, overrides?: CallOverrides): Promise<number>;
setHome(_home: string, overrides?: CallOverrides): Promise<void>;
setOutbox(_outbox: string, overrides?: CallOverrides): Promise<void>;
transferOwnership(
newOwner: string,
overrides?: CallOverrides
): Promise<void>;
unenrollReplica(_replica: string, overrides?: CallOverrides): Promise<void>;
unenrollInbox(_inbox: string, overrides?: CallOverrides): Promise<void>;
};
filters: {
NewHome(home?: string | null): TypedEventFilter<[string], { home: string }>;
InboxEnrolled(
domain?: BigNumberish | null,
inbox?: null
): TypedEventFilter<[number, string], { domain: number; inbox: string }>;
InboxUnenrolled(
domain?: BigNumberish | null,
inbox?: null
): TypedEventFilter<[number, string], { domain: number; inbox: string }>;
NewOutbox(
outbox?: string | null
): TypedEventFilter<[string], { outbox: string }>;
OwnershipTransferred(
previousOwner?: string | null,
@ -282,49 +291,36 @@ export class XAppConnectionManager extends BaseContract {
[string, string],
{ previousOwner: string; newOwner: string }
>;
ReplicaEnrolled(
domain?: BigNumberish | null,
replica?: null
): TypedEventFilter<[number, string], { domain: number; replica: string }>;
ReplicaUnenrolled(
domain?: BigNumberish | null,
replica?: null
): TypedEventFilter<[number, string], { domain: number; replica: string }>;
};
estimateGas: {
domainToReplica(
domainToInbox(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
enrollReplica(
_replica: string,
enrollInbox(
_inbox: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
home(overrides?: CallOverrides): Promise<BigNumber>;
inboxToDomain(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<BigNumber>;
isInbox(_inbox: string, overrides?: CallOverrides): Promise<BigNumber>;
localDomain(overrides?: CallOverrides): Promise<BigNumber>;
outbox(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
replicaToDomain(
arg0: string,
overrides?: CallOverrides
): Promise<BigNumber>;
setHome(
_home: string,
setOutbox(
_outbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
@ -333,46 +329,46 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
unenrollReplica(
_replica: string,
unenrollInbox(
_inbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
};
populateTransaction: {
domainToReplica(
domainToInbox(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
enrollReplica(
_replica: string,
enrollInbox(
_inbox: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
home(overrides?: CallOverrides): Promise<PopulatedTransaction>;
inboxToDomain(
arg0: string,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
isReplica(
_replica: string,
isInbox(
_inbox: string,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
outbox(overrides?: CallOverrides): Promise<PopulatedTransaction>;
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
replicaToDomain(
arg0: string,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
setHome(
_home: string,
setOutbox(
_outbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
@ -381,8 +377,8 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
unenrollReplica(
_replica: string,
unenrollInbox(
_inbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -33,17 +33,17 @@ declare module "hardhat/types/runtime" {
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.GovernanceRouter__factory>;
getContractFactory(
name: "Home",
name: "Inbox",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.Home__factory>;
): Promise<Contracts.Inbox__factory>;
getContractFactory(
name: "MerkleTreeManager",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.MerkleTreeManager__factory>;
getContractFactory(
name: "Replica",
name: "Outbox",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.Replica__factory>;
): Promise<Contracts.Outbox__factory>;
getContractFactory(
name: "BadRecipient1",
signerOrOptions?: ethers.Signer | FactoryOptions
@ -93,9 +93,9 @@ declare module "hardhat/types/runtime" {
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.TestGovernanceRouter__factory>;
getContractFactory(
name: "TestHome",
name: "TestInbox",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.TestHome__factory>;
): Promise<Contracts.TestInbox__factory>;
getContractFactory(
name: "TestMerkle",
signerOrOptions?: ethers.Signer | FactoryOptions
@ -105,13 +105,13 @@ declare module "hardhat/types/runtime" {
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.TestMessage__factory>;
getContractFactory(
name: "TestRecipient",
name: "TestOutbox",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.TestRecipient__factory>;
): Promise<Contracts.TestOutbox__factory>;
getContractFactory(
name: "TestReplica",
name: "TestRecipient",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.TestReplica__factory>;
): Promise<Contracts.TestRecipient__factory>;
getContractFactory(
name: "UpgradeBeacon",
signerOrOptions?: ethers.Signer | FactoryOptions

@ -6,9 +6,9 @@ export type { Ownable } from "./Ownable";
export type { TypedMemView } from "./TypedMemView";
export type { Common } from "./Common";
export type { GovernanceRouter } from "./GovernanceRouter";
export type { Home } from "./Home";
export type { Inbox } from "./Inbox";
export type { MerkleTreeManager } from "./MerkleTreeManager";
export type { Replica } from "./Replica";
export type { Outbox } from "./Outbox";
export type { BadRecipient1 } from "./BadRecipient1";
export type { BadRecipient2 } from "./BadRecipient2";
export type { BadRecipient3 } from "./BadRecipient3";
@ -21,11 +21,11 @@ export type { MysteryMathV1 } from "./MysteryMathV1";
export type { MysteryMathV2 } from "./MysteryMathV2";
export type { TestCommon } from "./TestCommon";
export type { TestGovernanceRouter } from "./TestGovernanceRouter";
export type { TestHome } from "./TestHome";
export type { TestInbox } from "./TestInbox";
export type { TestMerkle } from "./TestMerkle";
export type { TestMessage } from "./TestMessage";
export type { TestOutbox } from "./TestOutbox";
export type { TestRecipient } from "./TestRecipient";
export type { TestReplica } from "./TestReplica";
export type { UpgradeBeacon } from "./UpgradeBeacon";
export type { UpgradeBeaconController } from "./UpgradeBeaconController";
export type { UpgradeBeaconProxy } from "./UpgradeBeaconProxy";
@ -40,9 +40,9 @@ export { Ownable__factory } from "./factories/Ownable__factory";
export { TypedMemView__factory } from "./factories/TypedMemView__factory";
export { Common__factory } from "./factories/Common__factory";
export { GovernanceRouter__factory } from "./factories/GovernanceRouter__factory";
export { Home__factory } from "./factories/Home__factory";
export { Inbox__factory } from "./factories/Inbox__factory";
export { MerkleTreeManager__factory } from "./factories/MerkleTreeManager__factory";
export { Replica__factory } from "./factories/Replica__factory";
export { Outbox__factory } from "./factories/Outbox__factory";
export { BadRecipient1__factory } from "./factories/BadRecipient1__factory";
export { BadRecipient2__factory } from "./factories/BadRecipient2__factory";
export { BadRecipient3__factory } from "./factories/BadRecipient3__factory";
@ -55,11 +55,11 @@ export { MysteryMathV1__factory } from "./factories/MysteryMathV1__factory";
export { MysteryMathV2__factory } from "./factories/MysteryMathV2__factory";
export { TestCommon__factory } from "./factories/TestCommon__factory";
export { TestGovernanceRouter__factory } from "./factories/TestGovernanceRouter__factory";
export { TestHome__factory } from "./factories/TestHome__factory";
export { TestInbox__factory } from "./factories/TestInbox__factory";
export { TestMerkle__factory } from "./factories/TestMerkle__factory";
export { TestMessage__factory } from "./factories/TestMessage__factory";
export { TestOutbox__factory } from "./factories/TestOutbox__factory";
export { TestRecipient__factory } from "./factories/TestRecipient__factory";
export { TestReplica__factory } from "./factories/TestReplica__factory";
export { UpgradeBeacon__factory } from "./factories/UpgradeBeacon__factory";
export { UpgradeBeaconController__factory } from "./factories/UpgradeBeaconController__factory";
export { UpgradeBeaconProxy__factory } from "./factories/UpgradeBeaconProxy__factory";

@ -4,4 +4,4 @@ copy() {
jq .abi < artifacts/contracts/"$1".sol/"$1".json > ../../rust/chains/abacus-ethereum/abis/"$1".abi.json
}
copy Replica && copy Home && copy XAppConnectionManager
copy Inbox && copy Outbox && copy XAppConnectionManager

@ -2,7 +2,7 @@
pragma solidity >=0.6.11;
// ============ External Imports ============
import {Home} from "@abacus-network/abacus-sol/contracts/Home.sol";
import {Outbox} from "@abacus-network/abacus-sol/contracts/Outbox.sol";
import {XAppConnectionManager} from "@abacus-network/abacus-sol/contracts/XAppConnectionManager.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
@ -15,10 +15,10 @@ abstract contract XAppConnectionClient is OwnableUpgradeable {
// ============ Modifiers ============
/**
* @notice Only accept messages from an Abacus Replica contract
* @notice Only accept messages from an Abacus Inbox contract
*/
modifier onlyReplica() {
require(_isReplica(msg.sender), "!replica");
modifier onlyInbox() {
require(_isInbox(msg.sender), "!inbox");
_;
}
@ -35,7 +35,7 @@ abstract contract XAppConnectionClient is OwnableUpgradeable {
// ============ External functions ============
/**
* @notice Modify the contract the xApp uses to validate Replica contracts
* @notice Modify the contract the xApp uses to validate Inbox contracts
* @param _xAppConnectionManager The address of the xAppConnectionManager contract
*/
function setXAppConnectionManager(address _xAppConnectionManager)
@ -48,23 +48,19 @@ abstract contract XAppConnectionClient is OwnableUpgradeable {
// ============ Internal functions ============
/**
* @notice Get the local Home contract from the xAppConnectionManager
* @return The local Home contract
* @notice Get the local Outbox contract from the xAppConnectionManager
* @return The local Outbox contract
*/
function _home() internal view returns (Home) {
return xAppConnectionManager.home();
function _outbox() internal view returns (Outbox) {
return xAppConnectionManager.outbox();
}
/**
* @notice Determine whether _potentialReplcia is an enrolled Replica from the xAppConnectionManager
* @return True if _potentialReplica is an enrolled Replica
* @notice Determine whether _potentialInbox is an enrolled Inbox from the xAppConnectionManager
* @return True if _potentialInbox is an enrolled Inbox
*/
function _isReplica(address _potentialReplica)
internal
view
returns (bool)
{
return xAppConnectionManager.isReplica(_potentialReplica);
function _isInbox(address _potentialInbox) internal view returns (bool) {
return xAppConnectionManager.isInbox(_potentialInbox);
}
/**

@ -8,7 +8,7 @@ import {XAppConnectionClient} from "../XAppConnectionClient.sol";
import {IBridgeToken} from "../../interfaces/bridge/IBridgeToken.sol";
import {BridgeMessage} from "./BridgeMessage.sol";
// ============ External Imports ============
import {Home} from "@abacus-network/abacus-sol/contracts/Home.sol";
import {Outbox} from "@abacus-network/abacus-sol/contracts/Outbox.sol";
import {Version0} from "@abacus-network/abacus-sol/contracts/Version0.sol";
import {TypeCasts} from "@abacus-network/abacus-sol/contracts/XAppConnectionManager.sol";
import {TypedMemView} from "@summa-tx/memview-sol/contracts/TypedMemView.sol";
@ -82,7 +82,7 @@ contract BridgeRouter is Version0, Router, TokenRegistry {
uint32 _origin,
bytes32 _sender,
bytes memory _message
) external override onlyReplica onlyRemoteRouter(_origin, _sender) {
) external override onlyInbox onlyRemoteRouter(_origin, _sender) {
// parse tokenId and action from message
bytes29 _msg = _message.ref(0).mustBeMessage();
bytes29 _tokenId = _msg.tokenId();
@ -146,7 +146,7 @@ contract BridgeRouter is Version0, Router, TokenRegistry {
// format Transfer Tokens action
bytes29 _action = BridgeMessage.formatTransfer(_recipient, _amount);
// send message to remote chain via Abacus
Home(xAppConnectionManager.home()).dispatch(
Outbox(xAppConnectionManager.outbox()).dispatch(
_destination,
_remote,
BridgeMessage.formatMessage(_formatTokenId(_token), _action)
@ -355,7 +355,7 @@ contract BridgeRouter is Version0, Router, TokenRegistry {
_bridgeToken.decimals()
);
// send message to remote chain via Abacus
Home(xAppConnectionManager.home()).dispatch(
Outbox(xAppConnectionManager.outbox()).dispatch(
_messageOrigin,
_messageRemoteRouter,
BridgeMessage.formatMessage(_tokenId, _updateDetailsAction)
@ -393,7 +393,7 @@ contract BridgeRouter is Version0, Router, TokenRegistry {
// format Request Details message
bytes29 _action = BridgeMessage.formatRequestDetails();
// send message to remote chain via Abacus
Home(xAppConnectionManager.home()).dispatch(
Outbox(xAppConnectionManager.outbox()).dispatch(
_destination,
_remote,
BridgeMessage.formatMessage(_tokenId, _action)

@ -64,7 +64,7 @@ contract PingPongRouter is Router {
uint32 _origin,
bytes32 _sender,
bytes memory _message
) external override onlyReplica onlyRemoteRouter(_origin, _sender) {
) external override onlyInbox onlyRemoteRouter(_origin, _sender) {
bytes29 _msg = _message.ref(0);
if (_msg.isPing()) {
_handlePing(_origin, _msg);
@ -152,7 +152,11 @@ contract PingPongRouter is Router {
? PingPongMessage.formatPing(_match, _count)
: PingPongMessage.formatPong(_match, _count);
// send the message to the xApp Router
(_home()).dispatch(_destinationDomain, _remoteRouterAddress, _message);
(_outbox()).dispatch(
_destinationDomain,
_remoteRouterAddress,
_message
);
// emit a Sent event
emit Sent(_destinationDomain, _match, _count, _isPing);
}

@ -42,7 +42,7 @@ contract RouterTemplate is Router {
/**
* @notice Receive messages sent via Abacus from other remote xApp Routers;
* parse the contents of the message and enact the message's effects on the local chain
* @dev Called by an Abacus Replica contract while processing a message sent via Abacus
* @dev Called by an Abacus Inbox contract while processing a message sent via Abacus
* @param _origin The domain the message is coming from
* @param _sender The address the message is coming from
* @param _message The message in the form of raw bytes
@ -51,7 +51,7 @@ contract RouterTemplate is Router {
uint32 _origin,
bytes32 _sender,
bytes memory _message
) external override onlyReplica onlyRemoteRouter(_origin, _sender) {
) external override onlyInbox onlyRemoteRouter(_origin, _sender) {
bytes29 _msg = _message.ref(0);
// route message to appropriate _handle function
// based on what type of message is encoded
@ -96,7 +96,7 @@ contract RouterTemplate is Router {
// encode a message to send to the remote xApp Router
bytes memory _outboundMessage = Message.formatTypeA(_number);
// send the message to the xApp Router
_home().dispatch(
_outbox().dispatch(
_destinationDomain,
_remoteRouterAddress,
_outboundMessage

@ -72,7 +72,7 @@ describe('EthHelper', async () => {
});
await expect(sendTx).to.emit(
abacusDeployment.home(localDomain),
abacusDeployment.outbox(localDomain),
'Dispatch',
);
});
@ -85,7 +85,7 @@ describe('EthHelper', async () => {
});
await expect(sendTx).to.emit(
abacusDeployment.home(localDomain),
abacusDeployment.outbox(localDomain),
'Dispatch',
);
});
@ -98,7 +98,7 @@ describe('EthHelper', async () => {
});
await expect(sendTx).to.emit(
abacusDeployment.home(localDomain),
abacusDeployment.outbox(localDomain),
'Dispatch',
);
});

@ -40,11 +40,11 @@ describe('BridgeRouter', async () => {
deployerAddress = await deployer.getAddress();
deployerId = toBytes32(await deployer.getAddress()).toLowerCase();
abacusDeployment = await abacus.deployment.fromDomains(domains, deployer);
// Enroll ourselves as a replica so we can send messages directly to the
// Enroll ourselves as a inbox so we can send messages directly to the
// local router.
await abacusDeployment
.connectionManager(localDomain)
.enrollReplica(deployerAddress, remoteDomain);
.enrollInbox(deployerAddress, remoteDomain);
});
beforeEach(async () => {
@ -108,7 +108,7 @@ describe('BridgeRouter', async () => {
'TokenDeployed',
);
await expect(handleTx).to.emit(
abacusDeployment.home(localDomain),
abacusDeployment.outbox(localDomain),
'Dispatch',
);
expect(await repr.balanceOf(deployer.address)).to.equal(
@ -171,7 +171,7 @@ describe('BridgeRouter', async () => {
.send(repr.address, TOKEN_VALUE, remoteDomain, deployerId);
await expect(sendTx).to.emit(
abacusDeployment.home(localDomain),
abacusDeployment.outbox(localDomain),
'Dispatch',
);
@ -269,7 +269,7 @@ describe('BridgeRouter', async () => {
.send(localToken.address, TOKEN_VALUE, remoteDomain, deployerId);
await expect(sendTx).to.emit(
abacusDeployment.home(localDomain),
abacusDeployment.outbox(localDomain),
'Dispatch',
);
@ -586,7 +586,7 @@ describe('BridgeRouter', async () => {
const requestDetails = bridge.serializeMessage(requestDetailsObj);
await expect(requestTx).to.emit(
abacusDeployment.home(localDomain),
abacusDeployment.outbox(localDomain),
'Dispatch',
);
});
@ -597,7 +597,7 @@ describe('BridgeRouter', async () => {
.handle(remoteDomain, deployerId, requestMessage);
await expect(handleTx).to.emit(
abacusDeployment.home(localDomain),
abacusDeployment.outbox(localDomain),
'Dispatch',
);
});
@ -793,7 +793,7 @@ describe('BridgeRouter', async () => {
.router(localDomain)
.send(defaultRepr.address, TOKEN_VALUE, remoteDomain, deployerId);
await expect(defaultSendTx).to.emit(
abacusDeployment.home(localDomain),
abacusDeployment.outbox(localDomain),
'Dispatch',
);
@ -801,7 +801,7 @@ describe('BridgeRouter', async () => {
.router(localDomain)
.send(customRepr.address, TOKEN_VALUE, remoteDomain, deployerId);
await expect(customSendTx).to.emit(
abacusDeployment.home(localDomain),
abacusDeployment.outbox(localDomain),
'Dispatch',
);
});

@ -19,7 +19,7 @@ import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface ReplicaInterface extends ethers.utils.Interface {
interface InboxInterface extends ethers.utils.Interface {
functions: {
"PROCESS_GAS()": FunctionFragment;
"RESERVE_GAS()": FunctionFragment;
@ -250,7 +250,7 @@ interface ReplicaInterface extends ethers.utils.Interface {
getEvent(nameOrSignatureOrTopic: "Process"): EventFragment;
}
export class Replica extends BaseContract {
export class Inbox extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
@ -291,7 +291,7 @@ export class Replica extends BaseContract {
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: ReplicaInterface;
interface: InboxInterface;
functions: {
PROCESS_GAS(overrides?: CallOverrides): Promise<[BigNumber]>;

@ -19,7 +19,7 @@ import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface HomeInterface extends ethers.utils.Interface {
interface OutboxInterface extends ethers.utils.Interface {
functions: {
"MAX_MESSAGE_BODY_BYTES()": FunctionFragment;
"VERSION()": FunctionFragment;
@ -163,7 +163,7 @@ interface HomeInterface extends ethers.utils.Interface {
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
}
export class Home extends BaseContract {
export class Outbox extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
@ -204,7 +204,7 @@ export class Home extends BaseContract {
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: HomeInterface;
interface: OutboxInterface;
functions: {
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<[BigNumber]>;

@ -21,96 +21,96 @@ import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface XAppConnectionManagerInterface extends ethers.utils.Interface {
functions: {
"domainToReplica(uint32)": FunctionFragment;
"enrollReplica(address,uint32)": FunctionFragment;
"home()": FunctionFragment;
"isReplica(address)": FunctionFragment;
"domainToInbox(uint32)": FunctionFragment;
"enrollInbox(address,uint32)": FunctionFragment;
"inboxToDomain(address)": FunctionFragment;
"isInbox(address)": FunctionFragment;
"localDomain()": FunctionFragment;
"outbox()": FunctionFragment;
"owner()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"replicaToDomain(address)": FunctionFragment;
"setHome(address)": FunctionFragment;
"setOutbox(address)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"unenrollReplica(address)": FunctionFragment;
"unenrollInbox(address)": FunctionFragment;
};
encodeFunctionData(
functionFragment: "domainToReplica",
functionFragment: "domainToInbox",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "enrollReplica",
functionFragment: "enrollInbox",
values: [string, BigNumberish]
): string;
encodeFunctionData(functionFragment: "home", values?: undefined): string;
encodeFunctionData(functionFragment: "isReplica", values: [string]): string;
encodeFunctionData(
functionFragment: "inboxToDomain",
values: [string]
): string;
encodeFunctionData(functionFragment: "isInbox", values: [string]): string;
encodeFunctionData(
functionFragment: "localDomain",
values?: undefined
): string;
encodeFunctionData(functionFragment: "outbox", values?: undefined): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "replicaToDomain",
values: [string]
): string;
encodeFunctionData(functionFragment: "setHome", values: [string]): string;
encodeFunctionData(functionFragment: "setOutbox", values: [string]): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(
functionFragment: "unenrollReplica",
functionFragment: "unenrollInbox",
values: [string]
): string;
decodeFunctionResult(
functionFragment: "domainToReplica",
functionFragment: "domainToInbox",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "enrollReplica",
functionFragment: "enrollInbox",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "home", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "isReplica", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "localDomain",
functionFragment: "inboxToDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "isInbox", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
functionFragment: "localDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "outbox", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "replicaToDomain",
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setHome", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "setOutbox", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "unenrollReplica",
functionFragment: "unenrollInbox",
data: BytesLike
): Result;
events: {
"NewHome(address)": EventFragment;
"InboxEnrolled(uint32,address)": EventFragment;
"InboxUnenrolled(uint32,address)": EventFragment;
"NewOutbox(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
"ReplicaEnrolled(uint32,address)": EventFragment;
"ReplicaUnenrolled(uint32,address)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "NewHome"): EventFragment;
getEvent(nameOrSignatureOrTopic: "InboxEnrolled"): EventFragment;
getEvent(nameOrSignatureOrTopic: "InboxUnenrolled"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewOutbox"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ReplicaEnrolled"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ReplicaUnenrolled"): EventFragment;
}
export class XAppConnectionManager extends BaseContract {
@ -157,33 +157,33 @@ export class XAppConnectionManager extends BaseContract {
interface: XAppConnectionManagerInterface;
functions: {
domainToReplica(
domainToInbox(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<[string]>;
enrollReplica(
_replica: string,
enrollInbox(
_inbox: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
home(overrides?: CallOverrides): Promise<[string]>;
inboxToDomain(arg0: string, overrides?: CallOverrides): Promise<[number]>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<[boolean]>;
isInbox(_inbox: string, overrides?: CallOverrides): Promise<[boolean]>;
localDomain(overrides?: CallOverrides): Promise<[number]>;
outbox(overrides?: CallOverrides): Promise<[string]>;
owner(overrides?: CallOverrides): Promise<[string]>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
replicaToDomain(arg0: string, overrides?: CallOverrides): Promise<[number]>;
setHome(
_home: string,
setOutbox(
_outbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
@ -192,39 +192,36 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
unenrollReplica(
_replica: string,
unenrollInbox(
_inbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
};
domainToReplica(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<string>;
domainToInbox(arg0: BigNumberish, overrides?: CallOverrides): Promise<string>;
enrollReplica(
_replica: string,
enrollInbox(
_inbox: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
home(overrides?: CallOverrides): Promise<string>;
inboxToDomain(arg0: string, overrides?: CallOverrides): Promise<number>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<boolean>;
isInbox(_inbox: string, overrides?: CallOverrides): Promise<boolean>;
localDomain(overrides?: CallOverrides): Promise<number>;
outbox(overrides?: CallOverrides): Promise<string>;
owner(overrides?: CallOverrides): Promise<string>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
replicaToDomain(arg0: string, overrides?: CallOverrides): Promise<number>;
setHome(
_home: string,
setOutbox(
_outbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
@ -233,47 +230,59 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
unenrollReplica(
_replica: string,
unenrollInbox(
_inbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
callStatic: {
domainToReplica(
domainToInbox(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<string>;
enrollReplica(
_replica: string,
enrollInbox(
_inbox: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<void>;
home(overrides?: CallOverrides): Promise<string>;
inboxToDomain(arg0: string, overrides?: CallOverrides): Promise<number>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<boolean>;
isInbox(_inbox: string, overrides?: CallOverrides): Promise<boolean>;
localDomain(overrides?: CallOverrides): Promise<number>;
outbox(overrides?: CallOverrides): Promise<string>;
owner(overrides?: CallOverrides): Promise<string>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
replicaToDomain(arg0: string, overrides?: CallOverrides): Promise<number>;
setHome(_home: string, overrides?: CallOverrides): Promise<void>;
setOutbox(_outbox: string, overrides?: CallOverrides): Promise<void>;
transferOwnership(
newOwner: string,
overrides?: CallOverrides
): Promise<void>;
unenrollReplica(_replica: string, overrides?: CallOverrides): Promise<void>;
unenrollInbox(_inbox: string, overrides?: CallOverrides): Promise<void>;
};
filters: {
NewHome(home?: string | null): TypedEventFilter<[string], { home: string }>;
InboxEnrolled(
domain?: BigNumberish | null,
inbox?: null
): TypedEventFilter<[number, string], { domain: number; inbox: string }>;
InboxUnenrolled(
domain?: BigNumberish | null,
inbox?: null
): TypedEventFilter<[number, string], { domain: number; inbox: string }>;
NewOutbox(
outbox?: string | null
): TypedEventFilter<[string], { outbox: string }>;
OwnershipTransferred(
previousOwner?: string | null,
@ -282,49 +291,36 @@ export class XAppConnectionManager extends BaseContract {
[string, string],
{ previousOwner: string; newOwner: string }
>;
ReplicaEnrolled(
domain?: BigNumberish | null,
replica?: null
): TypedEventFilter<[number, string], { domain: number; replica: string }>;
ReplicaUnenrolled(
domain?: BigNumberish | null,
replica?: null
): TypedEventFilter<[number, string], { domain: number; replica: string }>;
};
estimateGas: {
domainToReplica(
domainToInbox(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
enrollReplica(
_replica: string,
enrollInbox(
_inbox: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
home(overrides?: CallOverrides): Promise<BigNumber>;
inboxToDomain(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<BigNumber>;
isInbox(_inbox: string, overrides?: CallOverrides): Promise<BigNumber>;
localDomain(overrides?: CallOverrides): Promise<BigNumber>;
outbox(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
replicaToDomain(
arg0: string,
overrides?: CallOverrides
): Promise<BigNumber>;
setHome(
_home: string,
setOutbox(
_outbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
@ -333,46 +329,46 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
unenrollReplica(
_replica: string,
unenrollInbox(
_inbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
};
populateTransaction: {
domainToReplica(
domainToInbox(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
enrollReplica(
_replica: string,
enrollInbox(
_inbox: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
home(overrides?: CallOverrides): Promise<PopulatedTransaction>;
inboxToDomain(
arg0: string,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
isReplica(
_replica: string,
isInbox(
_inbox: string,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
outbox(overrides?: CallOverrides): Promise<PopulatedTransaction>;
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
replicaToDomain(
arg0: string,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
setHome(
_home: string,
setOutbox(
_outbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
@ -381,8 +377,8 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
unenrollReplica(
_replica: string,
unenrollInbox(
_inbox: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -101,7 +101,7 @@ const _abi = [
];
const _bytecode =
"0x60c060405234801561001057600080fd5b5060405161045d38038061045d8339818101604052604081101561003357600080fd5b5080516020909101516001600160601b0319606083811b821660805282901b1660a0526040805163095ea7b360e01b81526001600160a01b038084166004830152600019602483015291519184169163095ea7b39160448082019260009290919082900301818387803b1580156100a957600080fd5b505af11580156100bd573d6000803e3d6000fd5b50505050505060805160601c60a05160601c6103626100fb6000398061023e52806102e052508061014152806101fb52806102bc52506103626000f3fe60806040526004361061005a5760003560e01c80633fc8cef3116100435780633fc8cef3146100ad578063e78cea92146100eb578063ec93e5f0146101005761005a565b806303c1d2831461005f5780632e96d5a31461008a575b600080fd5b6100886004803603604081101561007557600080fd5b5063ffffffff813516906020013561013f565b005b610088600480360360208110156100a057600080fd5b503563ffffffff166102a5565b3480156100b957600080fd5b506100c26102ba565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156100f757600080fd5b506100c26102de565b6100886004803603604081101561011657600080fd5b50803563ffffffff16906020013573ffffffffffffffffffffffffffffffffffffffff16610302565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156101a757600080fd5b505af11580156101bb573d6000803e3d6000fd5b5050604080517f1cabf08f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116600483015234602483015263ffffffff881660448301526064820187905291517f00000000000000000000000000000000000000000000000000000000000000009092169450631cabf08f9350608480820193506000929182900301818387803b15801561028957600080fd5b505af115801561029d573d6000803e3d6000fd5b505050505050565b6102b7816102b233610313565b61013f565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b61030f826102b283610313565b5050565b73ffffffffffffffffffffffffffffffffffffffff169056fea26469706673582212207b28e8db32b1551a9dd067e5728c98f1301170b0a42d77447a8f80cff5e8c6b464736f6c63430007060033";
"0x60c060405234801561001057600080fd5b5060405161045d38038061045d8339818101604052604081101561003357600080fd5b5080516020909101516001600160601b0319606083811b821660805282901b1660a0526040805163095ea7b360e01b81526001600160a01b038084166004830152600019602483015291519184169163095ea7b39160448082019260009290919082900301818387803b1580156100a957600080fd5b505af11580156100bd573d6000803e3d6000fd5b50505050505060805160601c60a05160601c6103626100fb6000398061023e52806102e052508061014152806101fb52806102bc52506103626000f3fe60806040526004361061005a5760003560e01c80633fc8cef3116100435780633fc8cef3146100ad578063e78cea92146100eb578063ec93e5f0146101005761005a565b806303c1d2831461005f5780632e96d5a31461008a575b600080fd5b6100886004803603604081101561007557600080fd5b5063ffffffff813516906020013561013f565b005b610088600480360360208110156100a057600080fd5b503563ffffffff166102a5565b3480156100b957600080fd5b506100c26102ba565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156100f757600080fd5b506100c26102de565b6100886004803603604081101561011657600080fd5b50803563ffffffff16906020013573ffffffffffffffffffffffffffffffffffffffff16610302565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156101a757600080fd5b505af11580156101bb573d6000803e3d6000fd5b5050604080517f1cabf08f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116600483015234602483015263ffffffff881660448301526064820187905291517f00000000000000000000000000000000000000000000000000000000000000009092169450631cabf08f9350608480820193506000929182900301818387803b15801561028957600080fd5b505af115801561029d573d6000803e3d6000fd5b505050505050565b6102b7816102b233610313565b61013f565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b61030f826102b283610313565b5050565b73ffffffffffffffffffffffffffffffffffffffff169056fea264697066735822122053302b58ffcb570da23cb4212db7e6cf8530029f922542aaaeaf3ae0001f72e964736f6c63430007060033";
export class ETHHelper__factory extends ContractFactory {
constructor(signer?: Signer) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -17,17 +17,17 @@ declare module "hardhat/types/runtime" {
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.Common__factory>;
getContractFactory(
name: "Home",
name: "Inbox",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.Home__factory>;
): Promise<Contracts.Inbox__factory>;
getContractFactory(
name: "MerkleTreeManager",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.MerkleTreeManager__factory>;
getContractFactory(
name: "Replica",
name: "Outbox",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.Replica__factory>;
): Promise<Contracts.Outbox__factory>;
getContractFactory(
name: "UpgradeBeaconProxy",
signerOrOptions?: ethers.Signer | FactoryOptions

@ -2,9 +2,9 @@
/* tslint:disable */
/* eslint-disable */
export type { Common } from "./Common";
export type { Home } from "./Home";
export type { Inbox } from "./Inbox";
export type { MerkleTreeManager } from "./MerkleTreeManager";
export type { Replica } from "./Replica";
export type { Outbox } from "./Outbox";
export type { UpgradeBeaconProxy } from "./UpgradeBeaconProxy";
export type { Version0 } from "./Version0";
export type { XAppConnectionManager } from "./XAppConnectionManager";
@ -30,9 +30,9 @@ export type { IBridgeToken } from "./IBridgeToken";
export type { IWeth } from "./IWeth";
export { Common__factory } from "./factories/Common__factory";
export { Home__factory } from "./factories/Home__factory";
export { Inbox__factory } from "./factories/Inbox__factory";
export { MerkleTreeManager__factory } from "./factories/MerkleTreeManager__factory";
export { Replica__factory } from "./factories/Replica__factory";
export { Outbox__factory } from "./factories/Outbox__factory";
export { UpgradeBeaconProxy__factory } from "./factories/UpgradeBeaconProxy__factory";
export { Version0__factory } from "./factories/Version0__factory";
export { XAppConnectionManager__factory } from "./factories/XAppConnectionManager__factory";

@ -5,7 +5,7 @@ async function main() {
const environment = await getEnvironment();
const coreDeploys = await getCoreDeploys(environment);
const deployer = new ImplementationDeployer(coreDeploys);
await deployer.deployReplicaImplementations();
await deployer.deployInboxImplementations();
deployer.writeDeploys(environment);
}
main().then(console.log).catch(console.error);

@ -30,13 +30,13 @@ async function main() {
const batch = await builder.build();
const domains = deploys.map((d) => d.chain.domain);
for (const home of domains) {
for (const outbox of domains) {
for (const remote of domains) {
if (home === remote) continue;
if (outbox === remote) continue;
const core = context.mustGetCore(remote);
const replica = core.getReplica(home);
const inbox = core.getInbox(outbox);
const transferOwnership =
await replica!.populateTransaction.transferOwnership(
await inbox!.populateTransaction.transferOwnership(
core._governanceRouter,
);
batch.push(remote, transferOwnership as Call);
@ -45,7 +45,7 @@ async function main() {
const txs = await batch.build();
// For each domain, expect one call to upgrade the contract and then three
// calls to transfer replica ownership.
// calls to transfer inbox ownership.
expectCalls(batch, domains, new Array(chains.length).fill(chains.length));
// Change to `batch.execute` in order to run.
const receipts = await batch.estimateGas();

@ -52,11 +52,11 @@ async function helmValuesForChain(
abacus: {
runEnv: agentConfig.runEnv,
baseConfig: `${chainName}_config.json`,
homeChain: {
outboxChain: {
name: chainName,
},
aws: !!agentConfig.aws,
replicaChains: chains
inboxChains: chains
.filter((_) => _.name !== chainName)
.map((remoteChain) => {
return {
@ -101,24 +101,24 @@ async function helmValuesForChain(
}
export async function getAgentEnvVars(
homeChainName: ChainName,
outboxChainName: ChainName,
role: KEY_ROLE_ENUM,
agentConfig: AgentConfig,
chains: ChainConfig[],
) {
const valueDict = await helmValuesForChain(
homeChainName,
outboxChainName,
agentConfig,
chains,
);
const envVars: string[] = [];
const rpcEndpoints = await getSecretRpcEndpoints(agentConfig, chains);
envVars.push(`OPT_BASE_HOME_CONNECTION_URL=${rpcEndpoints[homeChainName]}`);
valueDict.abacus.replicaChains.forEach((replicaChain: any) => {
envVars.push(`OPT_BASE_HOME_CONNECTION_URL=${rpcEndpoints[outboxChainName]}`);
valueDict.abacus.inboxChains.forEach((inboxChain: any) => {
envVars.push(
`OPT_BASE_REPLICAS_${replicaChain.name.toUpperCase()}_CONNECTION_URL=${
rpcEndpoints[replicaChain.name]
`OPT_BASE_REPLICAS_${inboxChain.name.toUpperCase()}_CONNECTION_URL=${
rpcEndpoints[inboxChain.name]
}`,
);
});
@ -132,7 +132,7 @@ export async function getAgentEnvVars(
try {
const gcpKeys = await fetchAgentGCPKeys(
agentConfig.environment,
homeChainName,
outboxChainName,
);
// Signer keys
chains.forEach((network) => {
@ -147,7 +147,7 @@ export async function getAgentEnvVars(
if (role.startsWith('validator')) {
envVars.push(
`OPT_BASE_UPDATER_KEY=${strip0x(
gcpKeys[homeChainName + '-' + KEY_ROLE_ENUM.UpdaterAttestation]
gcpKeys[outboxChainName + '-' + KEY_ROLE_ENUM.UpdaterAttestation]
.privateKey,
)}`,
);
@ -177,7 +177,7 @@ export async function getAgentEnvVars(
// Updater attestation key
if (role.startsWith('validator')) {
const key = new AgentAwsKey(agentConfig, role, homeChainName);
const key = new AgentAwsKey(agentConfig, role, outboxChainName);
envVars.push(`OPT_BASE_UPDATER_TYPE=aws`);
envVars.push(
`OPT_BASE_UPDATER_ID=${key.credentialsAsHelmValue.aws.keyId}`,
@ -250,11 +250,11 @@ async function getSecretForEachChain(
export async function runAgentHelmCommand(
action: HelmCommand,
agentConfig: AgentConfig,
homeChainConfig: ChainConfig,
outboxChainConfig: ChainConfig,
chains: ChainConfig[],
) {
const valueDict = await helmValuesForChain(
homeChainConfig.name,
outboxChainConfig.name,
agentConfig,
chains,
);
@ -267,7 +267,7 @@ export async function runAgentHelmCommand(
return execCmd(
`helm ${action} ${
homeChainConfig.name
outboxChainConfig.name
} ../../rust/helm/abacus-agent/ --namespace ${
agentConfig.namespace
} ${values.join(' ')} ${extraPipe}`,
@ -304,12 +304,12 @@ export async function runKeymasterHelmCommand(
];
}),
),
homes: Object.fromEntries(
outboxes: Object.fromEntries(
chains.map((chain) => {
return [
chain.name,
{
replicas: chains.map((c) => c.name),
inboxs: chains.map((c) => c.name),
addresses: Object.fromEntries(
KEY_ROLES.filter((_) => _.endsWith('signer')).map((role) => [
role,

@ -262,7 +262,7 @@ async function persistAddresses(
await rm(fileName);
}
// This function returns all the GCP keys for a given home chain in a dictionary where the key is either the role or `${chainName}-${role}` in the case of attestation keys
// This function returns all the GCP keys for a given outbox chain in a dictionary where the key is either the role or `${chainName}-${role}` in the case of attestation keys
export async function fetchAgentGCPKeys(
environment: string,
chainName: string,

@ -28,7 +28,7 @@ export class BridgeContracts extends Contracts {
): BridgeContracts {
const b = new BridgeContracts();
// TODO: needs type magic for turning governance, home and replicas to BeaconProxy contracts
// TODO: needs type magic for turning governance, outbox and inboxs to BeaconProxy contracts
const routerImplementation = xAppContracts.BridgeRouter__factory.connect(
addresses.bridgeRouter.implementation,
provider,

@ -11,9 +11,9 @@ export type CoreContractAddresses = {
xAppConnectionManager: Address;
validatorManager: Address;
governanceRouter: ProxiedAddress;
home: ProxiedAddress;
outbox: ProxiedAddress;
// TODO: Put chain name in here
replicas?: Record<number, ProxiedAddress>;
inboxs?: Record<number, ProxiedAddress>;
};
export type BridgeContractAddresses = {

@ -48,8 +48,8 @@ export type RustContractBlock = {
export type RustConfig = {
environment: string;
signers: Record<string, RustSigner>;
replicas: Record<string, RustContractBlock>;
home: RustContractBlock;
inboxs: Record<string, RustContractBlock>;
outbox: RustContractBlock;
tracing: {
level: string;
fmt: 'json';

@ -12,20 +12,20 @@ export class CoreContracts extends Contracts {
xAppConnectionManager?: contracts.XAppConnectionManager;
validatorManager?: contracts.ValidatorManager;
governanceRouter?: BeaconProxy<contracts.GovernanceRouter>;
home?: BeaconProxy<contracts.Home>;
replicas: Record<number, BeaconProxy<contracts.Replica>>;
outbox?: BeaconProxy<contracts.Outbox>;
inboxs: Record<number, BeaconProxy<contracts.Inbox>>;
constructor() {
super();
this.replicas = {};
this.inboxs = {};
}
toObject(): CoreContractAddresses {
const replicas: Record<number, ProxiedAddress> = {};
Object.keys(this.replicas!)
const inboxs: Record<number, ProxiedAddress> = {};
Object.keys(this.inboxs!)
.map((d) => parseInt(d))
.map((domain: number) => {
replicas[domain] = this.replicas[domain].toObject();
inboxs[domain] = this.inboxs[domain].toObject();
});
return {
@ -33,8 +33,8 @@ export class CoreContracts extends Contracts {
xAppConnectionManager: this.xAppConnectionManager!.address,
validatorManager: this.validatorManager!.address,
governanceRouter: this.governanceRouter!.toObject(),
home: this.home!.toObject(),
replicas,
outbox: this.outbox!.toObject(),
inboxs,
};
}
@ -58,7 +58,7 @@ export class CoreContracts extends Contracts {
provider,
);
// TODO: needs type magic for turning governance, home and replicas to BeaconProxy contracts
// TODO: needs type magic for turning governance, outbox and inboxs to BeaconProxy contracts
const governanceRouterImplementation =
contracts.GovernanceRouter__factory.connect(
addresses.governanceRouter.implementation,
@ -79,43 +79,43 @@ export class CoreContracts extends Contracts {
governanceRouterUpgradeBeacon,
);
const homeImplementation = contracts.Home__factory.connect(
addresses.home.implementation,
const outboxImplementation = contracts.Outbox__factory.connect(
addresses.outbox.implementation,
provider,
);
const homeProxy = contracts.Home__factory.connect(
addresses.home.proxy,
const outboxProxy = contracts.Outbox__factory.connect(
addresses.outbox.proxy,
provider,
);
const homeUpgradeBeacon = contracts.UpgradeBeacon__factory.connect(
addresses.home.beacon,
const outboxUpgradeBeacon = contracts.UpgradeBeacon__factory.connect(
addresses.outbox.beacon,
provider,
);
core.home = new BeaconProxy<contracts.Home>(
homeImplementation,
homeProxy,
homeUpgradeBeacon,
core.outbox = new BeaconProxy<contracts.Outbox>(
outboxImplementation,
outboxProxy,
outboxUpgradeBeacon,
);
Object.keys(addresses.replicas!)
Object.keys(addresses.inboxs!)
.map((d) => parseInt(d))
.map((domain: number) => {
const replicaImplementation = contracts.Replica__factory.connect(
addresses.replicas![domain].implementation,
const inboxImplementation = contracts.Inbox__factory.connect(
addresses.inboxs![domain].implementation,
provider,
);
const replicaProxy = contracts.Replica__factory.connect(
addresses.replicas![domain].proxy,
const inboxProxy = contracts.Inbox__factory.connect(
addresses.inboxs![domain].proxy,
provider,
);
const replicaUpgradeBeacon = contracts.UpgradeBeacon__factory.connect(
addresses.replicas![domain].beacon,
const inboxUpgradeBeacon = contracts.UpgradeBeacon__factory.connect(
addresses.inboxs![domain].beacon,
provider,
);
core.replicas[domain] = new BeaconProxy<contracts.Replica>(
replicaImplementation,
replicaProxy,
replicaUpgradeBeacon,
core.inboxs[domain] = new BeaconProxy<contracts.Inbox>(
inboxImplementation,
inboxProxy,
inboxUpgradeBeacon,
);
});

@ -85,8 +85,8 @@ export class CoreDeploy extends Deploy<CoreContracts> {
}
static buildRustConfig(local: CoreDeploy, remotes: CoreDeploy[]): RustConfig {
const home = {
address: local.contracts.home!.proxy.address,
const outbox = {
address: local.contracts.outbox!.proxy.address,
domain: local.chain.domain.toString(),
name: local.chain.name,
rpcStyle: 'ethereum',
@ -99,10 +99,10 @@ export class CoreDeploy extends Deploy<CoreContracts> {
const rustConfig: RustConfig = {
environment: local.config.environment,
signers: {
[home.name]: { key: '', type: 'hexKey' },
[outbox.name]: { key: '', type: 'hexKey' },
},
replicas: {},
home,
inboxs: {},
outbox,
tracing: {
level: 'debug',
fmt: 'json',
@ -111,8 +111,8 @@ export class CoreDeploy extends Deploy<CoreContracts> {
};
for (var remote of remotes) {
const replica = {
address: remote.contracts.replicas[local.chain.domain].proxy.address,
const inbox = {
address: remote.contracts.inboxs[local.chain.domain].proxy.address,
domain: remote.chain.domain.toString(),
name: remote.chain.name,
rpcStyle: 'ethereum',
@ -122,8 +122,8 @@ export class CoreDeploy extends Deploy<CoreContracts> {
},
};
rustConfig.signers[replica.name] = { key: '', type: 'hexKey' };
rustConfig.replicas[replica.name] = replica;
rustConfig.signers[inbox.name] = { key: '', type: 'hexKey' };
rustConfig.inboxs[inbox.name] = inbox;
}
return rustConfig;

@ -20,8 +20,8 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
async checkDeploy(deploy: CoreDeploy): Promise<void> {
this.checkContractsDefined(deploy);
await this.checkBeaconProxies(deploy);
await this.checkHome(deploy);
await this.checkReplicas(deploy);
await this.checkOutbox(deploy);
await this.checkInboxs(deploy);
await this.checkGovernance(deploy);
await this.checkXAppConnectionManager(deploy);
await this.checkValidatorManager(deploy);
@ -30,21 +30,21 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
checkContractsDefined(deploy: CoreDeploy): void {
const contracts = deploy.contracts;
expect(contracts.home).to.not.be.undefined;
expect(contracts.outbox).to.not.be.undefined;
expect(contracts.governanceRouter).to.not.be.undefined;
expect(contracts.upgradeBeaconController).to.not.be.undefined;
expect(contracts.xAppConnectionManager).to.not.be.undefined;
expect(contracts.validatorManager).to.not.be.undefined;
for (const domain in contracts.replicas) {
expect(contracts.replicas[domain]).to.not.be.undefined;
for (const domain in contracts.inboxs) {
expect(contracts.inboxs[domain]).to.not.be.undefined;
}
}
async checkHome(deploy: CoreDeploy): Promise<void> {
async checkOutbox(deploy: CoreDeploy): Promise<void> {
// contracts are defined
const home = deploy.contracts.home!.proxy;
// validatorManager is set on Home
const actualManager = await home.validatorManager();
const outbox = deploy.contracts.outbox!.proxy;
// validatorManager is set on Outbox
const actualManager = await outbox.validatorManager();
const expectedManager = deploy.contracts.validatorManager!.address;
if (actualManager !== expectedManager) {
const violation: ValidatorManagerViolation = {
@ -77,20 +77,20 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
}
}
async checkReplicas(deploy: CoreDeploy): Promise<void> {
// Check if the Replicas on *remote* domains are set to the validator
async checkInboxs(deploy: CoreDeploy): Promise<void> {
// Check if the Inboxs on *remote* domains are set to the validator
// configured on our domain.
const domain = deploy.chain.domain;
const remoteDeploys = this._deploys.filter(
(d) => d.chain.domain !== domain,
);
if (remoteDeploys.length > 0) {
// Check that all replicas on this domain share the same implementation and
// Check that all inboxs on this domain share the same implementation and
// UpgradeBeacon.
const replicas = Object.values(deploy.contracts.replicas);
const implementations = replicas.map((r) => r.implementation.address);
const inboxs = Object.values(deploy.contracts.inboxs);
const implementations = inboxs.map((r) => r.implementation.address);
const identical = (a: any, b: any) => (a === b ? a : false);
const upgradeBeacons = replicas.map((r) => r.beacon.address);
const upgradeBeacons = inboxs.map((r) => r.beacon.address);
expect(implementations.reduce(identical)).to.not.be.false;
expect(upgradeBeacons.reduce(identical)).to.not.be.false;
}
@ -101,7 +101,7 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
// governanceRouter for each remote domain is registered
const registeredRouters = await Promise.all(
Object.keys(deploy.contracts.replicas).map((_) =>
Object.keys(deploy.contracts.inboxs).map((_) =>
deploy.contracts.governanceRouter?.proxy.routers(_),
),
);
@ -112,7 +112,7 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
const governorDomain =
await deploy.contracts.governanceRouter?.proxy.governorDomain();
const gov = await deploy.contracts.governanceRouter?.proxy.governor();
const localDomain = await deploy.contracts.home?.proxy.localDomain();
const localDomain = await deploy.contracts.outbox?.proxy.localDomain();
if (governorDomain == localDomain) {
expect(gov).to.not.equal(emptyAddr);
} else {
@ -123,9 +123,9 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
deploy.contracts.validatorManager?.owner()!,
deploy.contracts.xAppConnectionManager?.owner()!,
deploy.contracts.upgradeBeaconController?.owner()!,
deploy.contracts.home?.proxy.owner()!,
deploy.contracts.outbox?.proxy.owner()!,
];
Object.values(deploy.contracts.replicas).map((_) =>
Object.values(deploy.contracts.inboxs).map((_) =>
owners.push(_.proxy.owner()),
);
@ -136,17 +136,17 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
async checkXAppConnectionManager(deploy: CoreDeploy): Promise<void> {
expect(deploy.contracts.xAppConnectionManager).to.not.be.undefined;
for (const domain in deploy.contracts.replicas) {
// replica is enrolled in xAppConnectionManager
const enrolledReplica =
await deploy.contracts.xAppConnectionManager?.domainToReplica(domain);
expect(enrolledReplica).to.not.equal(emptyAddr);
for (const domain in deploy.contracts.inboxs) {
// inbox is enrolled in xAppConnectionManager
const enrolledInbox =
await deploy.contracts.xAppConnectionManager?.domainToInbox(domain);
expect(enrolledInbox).to.not.equal(emptyAddr);
}
// Home is set on xAppConnectionManager
const xAppManagerHome =
await deploy.contracts.xAppConnectionManager?.home();
const homeAddress = deploy.contracts.home?.proxy.address;
expect(xAppManagerHome).to.equal(homeAddress);
// Outbox is set on xAppConnectionManager
const xAppManagerOutbox =
await deploy.contracts.xAppConnectionManager?.outbox();
const outboxAddress = deploy.contracts.outbox?.proxy.address;
expect(xAppManagerOutbox).to.equal(outboxAddress);
}
getVerificationInputs(deploy: CoreDeploy): VerificationInput[] {
@ -166,10 +166,10 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
inputs.push([`${name} UpgradeBeacon`, contract.beacon]);
inputs.push([`${name} Proxy`, contract.proxy]);
};
addInputsForUpgradableContract(contracts.home!, 'Home');
addInputsForUpgradableContract(contracts.outbox!, 'Outbox');
addInputsForUpgradableContract(contracts.governanceRouter!, 'Governance');
for (const domain in contracts.replicas) {
addInputsForUpgradableContract(contracts.replicas[domain], 'Replica');
for (const domain in contracts.inboxs) {
addInputsForUpgradableContract(contracts.inboxs[domain], 'Inbox');
}
return inputs;
}
@ -177,8 +177,12 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
async checkBeaconProxies(deploy: CoreDeploy): Promise<void> {
const domain = deploy.chain.domain;
const contracts = deploy.contracts;
// Home upgrade setup contracts are defined
await this.checkBeaconProxyImplementation(domain, 'Home', contracts.home!);
// Outbox upgrade setup contracts are defined
await this.checkBeaconProxyImplementation(
domain,
'Outbox',
contracts.outbox!,
);
// GovernanceRouter upgrade setup contracts are defined
await this.checkBeaconProxyImplementation(
@ -188,8 +192,8 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
);
await Promise.all(
Object.values(contracts.replicas).map((_) =>
this.checkBeaconProxyImplementation(domain, 'Replica', _),
Object.values(contracts.inboxs).map((_) =>
this.checkBeaconProxyImplementation(domain, 'Inbox', _),
),
);
}

@ -11,12 +11,12 @@ export class ImplementationDeployer {
this._deploys = deploys;
}
deployHomeImplementations(): Promise<void> {
return this._deployImplementations(this._deployHomeImplementation);
deployOutboxImplementations(): Promise<void> {
return this._deployImplementations(this._deployOutboxImplementation);
}
deployReplicaImplementations(): Promise<void> {
return this._deployImplementations(this._deployReplicaImplementation);
deployInboxImplementations(): Promise<void> {
return this._deployImplementations(this._deployInboxImplementation);
}
writeDeploys(dir: string): void {
@ -25,63 +25,63 @@ export class ImplementationDeployer {
}
/**
* Deploys a Home implementation on the chain of the given deploy and updates
* Deploys a Outbox implementation on the chain of the given deploy and updates
* the deploy instance with the new contract.
*
* @param deploy - The deploy instance
*/
private async _deployHomeImplementation(deploy: CoreDeploy) {
private async _deployOutboxImplementation(deploy: CoreDeploy) {
const isTestDeploy: boolean = deploy.test;
if (isTestDeploy) warn('deploying test Home');
const homeFactory = isTestDeploy
? contracts.TestHome__factory
: contracts.Home__factory;
if (isTestDeploy) warn('deploying test Outbox');
const outboxFactory = isTestDeploy
? contracts.TestOutbox__factory
: contracts.Outbox__factory;
const implementation =
await proxyUtils.deployImplementation<contracts.Home>(
'Home',
await proxyUtils.deployImplementation<contracts.Outbox>(
'Outbox',
deploy,
new homeFactory(deploy.signer),
new outboxFactory(deploy.signer),
deploy.chain.domain,
);
deploy.contracts.home =
proxyUtils.overrideBeaconProxyImplementation<contracts.Home>(
deploy.contracts.outbox =
proxyUtils.overrideBeaconProxyImplementation<contracts.Outbox>(
implementation,
deploy,
new homeFactory(deploy.signer),
deploy.contracts.home!,
new outboxFactory(deploy.signer),
deploy.contracts.outbox!,
);
}
/**
* Deploys a Replica implementation on the chain of the given deploy and updates
* Deploys a Inbox implementation on the chain of the given deploy and updates
* the deploy instance with the new contracts.
*
* @param deploy - The deploy instance
*/
private async _deployReplicaImplementation(deploy: CoreDeploy) {
private async _deployInboxImplementation(deploy: CoreDeploy) {
const isTestDeploy: boolean = deploy.test;
if (isTestDeploy) warn('deploying test Replica');
const replicaFactory = isTestDeploy
? contracts.TestReplica__factory
: contracts.Replica__factory;
if (isTestDeploy) warn('deploying test Inbox');
const inboxFactory = isTestDeploy
? contracts.TestInbox__factory
: contracts.Inbox__factory;
const implementation =
await proxyUtils.deployImplementation<contracts.Replica>(
'Replica',
await proxyUtils.deployImplementation<contracts.Inbox>(
'Inbox',
deploy,
new replicaFactory(deploy.signer),
new inboxFactory(deploy.signer),
deploy.chain.domain,
deploy.config.processGas,
deploy.config.reserveGas,
);
for (const domain in deploy.contracts.replicas) {
deploy.contracts.replicas[domain] =
proxyUtils.overrideBeaconProxyImplementation<contracts.Replica>(
for (const domain in deploy.contracts.inboxs) {
deploy.contracts.inboxs[domain] =
proxyUtils.overrideBeaconProxyImplementation<contracts.Inbox>(
implementation,
deploy,
new replicaFactory(deploy.signer),
deploy.contracts.replicas[domain],
new inboxFactory(deploy.signer),
deploy.contracts.inboxs[domain],
);
}
}

@ -73,27 +73,27 @@ export async function deployXAppConnectionManager(deploy: CoreDeploy) {
}
/**
* Deploys the Home proxy on the chain of the given deploy and updates
* Deploys the Outbox proxy on the chain of the given deploy and updates
* the deploy instance with the new contract.
*
* @param deploy - The deploy instance
*/
export async function deployHome(deploy: CoreDeploy) {
export async function deployOutbox(deploy: CoreDeploy) {
const isTestDeploy: boolean = deploy.test;
if (isTestDeploy) warn('deploying test Home');
const homeFactory = isTestDeploy
? contracts.TestHome__factory
: contracts.Home__factory;
if (isTestDeploy) warn('deploying test Outbox');
const outboxFactory = isTestDeploy
? contracts.TestOutbox__factory
: contracts.Outbox__factory;
let { validatorManager } = deploy.contracts;
let initData = homeFactory
let initData = outboxFactory
.createInterface()
.encodeFunctionData('initialize', [validatorManager!.address]);
deploy.contracts.home = await proxyUtils.deployProxy<contracts.Home>(
'Home',
deploy.contracts.outbox = await proxyUtils.deployProxy<contracts.Outbox>(
'Outbox',
deploy,
new homeFactory(deploy.signer),
new outboxFactory(deploy.signer),
initData,
deploy.chain.domain,
);
@ -134,24 +134,24 @@ export async function deployGovernanceRouter(deploy: CoreDeploy) {
}
/**
* Deploys an unenrolled Replica proxy on the local chain and updates the local
* Deploys an unenrolled Inbox proxy on the local chain and updates the local
* deploy instance with the new contract.
*
* @param local - The local deploy instance
* @param remote - The remote deploy instance
*/
export async function deployUnenrolledReplica(
export async function deployUnenrolledInbox(
local: CoreDeploy,
remote: CoreDeploy,
) {
const isTestDeploy: boolean = remote.test;
if (isTestDeploy) warn('deploying test Replica');
if (isTestDeploy) warn('deploying test Inbox');
const replica = isTestDeploy
? contracts.TestReplica__factory
: contracts.Replica__factory;
const inbox = isTestDeploy
? contracts.TestInbox__factory
: contracts.Inbox__factory;
let initData = replica
let initData = inbox
.createInterface()
.encodeFunctionData('initialize', [
remote.chain.domain,
@ -160,18 +160,18 @@ export async function deployUnenrolledReplica(
0,
]);
// if we have no replicas, deploy the whole setup.
// if we have no inboxs, deploy the whole setup.
// otherwise just deploy a fresh proxy
let proxy;
if (Object.keys(local.contracts.replicas).length === 0) {
if (Object.keys(local.contracts.inboxs).length === 0) {
log(
isTestDeploy,
`${local.chain.name}: deploying initial Replica for ${remote.chain.name}`,
`${local.chain.name}: deploying initial Inbox for ${remote.chain.name}`,
);
proxy = await proxyUtils.deployProxy<contracts.Replica>(
'Replica',
proxy = await proxyUtils.deployProxy<contracts.Inbox>(
'Inbox',
local,
new replica(local.signer),
new inbox(local.signer),
initData,
local.chain.domain,
local.config.processGas,
@ -180,20 +180,20 @@ export async function deployUnenrolledReplica(
} else {
log(
isTestDeploy,
`${local.chain.name}: deploying additional Replica for ${remote.chain.name}`,
`${local.chain.name}: deploying additional Inbox for ${remote.chain.name}`,
);
const prev = Object.entries(local.contracts.replicas)[0][1];
proxy = await proxyUtils.duplicate<contracts.Replica>(
'Replica',
const prev = Object.entries(local.contracts.inboxs)[0][1];
proxy = await proxyUtils.duplicate<contracts.Inbox>(
'Inbox',
local,
prev,
initData,
);
}
local.contracts.replicas[remote.chain.domain] = proxy;
local.contracts.inboxs[remote.chain.domain] = proxy;
log(
isTestDeploy,
`${local.chain.name}: replica deployed for ${remote.chain.name}`,
`${local.chain.name}: inbox deployed for ${remote.chain.name}`,
);
}
@ -224,15 +224,15 @@ export async function deployAbacus(deploy: CoreDeploy) {
);
await deployXAppConnectionManager(deploy);
log(isTestDeploy, `${deploy.chain.name}: awaiting deploy Home(deploy);`);
await deployHome(deploy);
log(isTestDeploy, `${deploy.chain.name}: awaiting deploy Outbox(deploy);`);
await deployOutbox(deploy);
log(
isTestDeploy,
`${deploy.chain.name}: awaiting XAppConnectionManager.setHome(...);`,
`${deploy.chain.name}: awaiting XAppConnectionManager.setOutbox(...);`,
);
await deploy.contracts.xAppConnectionManager!.setHome(
deploy.contracts.home!.proxy.address,
await deploy.contracts.xAppConnectionManager!.setOutbox(
deploy.contracts.outbox!.proxy.address,
deploy.overrides,
);
@ -295,45 +295,43 @@ export async function relinquish(deploy: CoreDeploy) {
`${deploy.chain.name}: Dispatched relinquish upgradeBeaconController`,
);
Object.entries(deploy.contracts.replicas).forEach(
async ([domain, replica]) => {
await replica.proxy.transferOwnership(govRouter, deploy.overrides);
log(
isTestDeploy,
`${deploy.chain.name}: Dispatched relinquish Replica for domain ${domain}`,
);
},
);
Object.entries(deploy.contracts.inboxs).forEach(async ([domain, inbox]) => {
await inbox.proxy.transferOwnership(govRouter, deploy.overrides);
log(
isTestDeploy,
`${deploy.chain.name}: Dispatched relinquish Inbox for domain ${domain}`,
);
});
let tx = await deploy.contracts.home!.proxy.transferOwnership(
let tx = await deploy.contracts.outbox!.proxy.transferOwnership(
govRouter,
deploy.overrides,
);
log(isTestDeploy, `${deploy.chain.name}: Dispatched relinquish home`);
log(isTestDeploy, `${deploy.chain.name}: Dispatched relinquish outbox`);
await tx.wait(deploy.chain.confirmations);
log(isTestDeploy, `${deploy.chain.name}: Control relinquished`);
}
/**
* Enrolls a remote replica on the local chain.
* Enrolls a remote inbox on the local chain.
*
* @param local - The local deploy instance
* @param remote - The remote deploy instance
*/
export async function enrollReplica(local: CoreDeploy, remote: CoreDeploy) {
export async function enrollInbox(local: CoreDeploy, remote: CoreDeploy) {
const isTestDeploy = local.test;
log(isTestDeploy, `${local.chain.name}: starting replica enrollment`);
log(isTestDeploy, `${local.chain.name}: starting inbox enrollment`);
let tx = await local.contracts.xAppConnectionManager!.enrollReplica(
local.contracts.replicas[remote.chain.domain].proxy.address,
let tx = await local.contracts.xAppConnectionManager!.enrollInbox(
local.contracts.inboxs[remote.chain.domain].proxy.address,
remote.chain.domain,
local.overrides,
);
await tx.wait(local.chain.confirmations);
log(isTestDeploy, `${local.chain.name}: replica enrollment done`);
log(isTestDeploy, `${local.chain.name}: inbox enrollment done`);
}
/**
@ -384,14 +382,14 @@ export async function enrollValidator(local: CoreDeploy, remote: CoreDeploy) {
}
/**
* Enrolls a remote Replica, GovernanceRouter and Watchers on the local chain.
* Enrolls a remote Inbox, GovernanceRouter and Watchers on the local chain.
*
* @param local - The local deploy instance
* @param remote - The remote deploy instance
*/
export async function enrollRemote(local: CoreDeploy, remote: CoreDeploy) {
await deployUnenrolledReplica(local, remote);
await enrollReplica(local, remote);
await deployUnenrolledInbox(local, remote);
await enrollInbox(local, remote);
await enrollGovernanceRouter(local, remote);
await enrollValidator(local, remote);
}
@ -441,7 +439,7 @@ export async function appointGovernor(gov: CoreDeploy) {
/**
* Deploy the entire suite of Abacus contracts
* on each chain within the chains array
* including the upgradable Home, Replicas, and GovernanceRouter
* including the upgradable Outbox, Inboxs, and GovernanceRouter
* that have been deployed, initialized, and configured
* according to the deployAbacus script
*
@ -463,7 +461,7 @@ export async function deployNChains(deploys: CoreDeploy[]) {
deploys.forEach((deploy) => {
log(
isTestDeploy,
`Updater for ${deploy.chain.name} Home is ${deploy.validator}`,
`Updater for ${deploy.chain.name} Outbox is ${deploy.validator}`,
);
});
@ -483,7 +481,7 @@ export async function deployNChains(deploys: CoreDeploy[]) {
// enroll remotes on every chain
//
// NB: do not use Promise.all for this block. It introduces a race condition
// which results in multiple replica implementations on the home chain.
// which results in multiple inbox implementations on the outbox chain.
//
for (let local of deploys) {
const remotes = deploys.filter(

@ -15,11 +15,11 @@ export enum DeployEnvironment {
type XAppConnectionName = 'XAppConnectionManager';
type ValidatorManagerName = 'ValidatorManager';
type UBCName = 'UpgradeBeaconController';
type HomeName = 'Home UpgradeBeacon' | 'Home Proxy' | 'Home Implementation';
type ReplicaName =
| 'Replica UpgradeBeacon'
| 'Replica Proxy'
| 'Replica Implementation';
type OutboxName =
| 'Outbox UpgradeBeacon'
| 'Outbox Proxy'
| 'Outbox Implementation';
type InboxName = 'Inbox UpgradeBeacon' | 'Inbox Proxy' | 'Inbox Implementation';
type GovernanceName =
| 'Governance UpgradeBeacon'
| 'Governance Proxy'
@ -38,8 +38,8 @@ export type ContractVerificationName =
| XAppConnectionName
| ValidatorManagerName
| UBCName
| HomeName
| ReplicaName
| OutboxName
| InboxName
| GovernanceName
| EthHelperName
| BridgeTokenName

@ -20,17 +20,17 @@ export const ${coreDeploy.chain.name}: AbacusDomain = {
? `\n ethHelper: '${bridgeDeploy.contracts.ethHelper?.address}',`
: ''
}
home: '${coreDeploy.contracts.home!.proxy.address}',
outbox: '${coreDeploy.contracts.outbox!.proxy.address}',
governanceRouter: '${coreDeploy.contracts.governanceRouter!.proxy.address}',
xAppConnectionManager: '${
coreDeploy.contracts.xAppConnectionManager!.address
}',
replicas: [
${Object.keys(coreDeploy.contracts.replicas)
inboxs: [
${Object.keys(coreDeploy.contracts.inboxs)
.map(Number)
.map(
(replicaDomain) =>
` { domain: ${replicaDomain}, address: '${coreDeploy.contracts.replicas[replicaDomain].proxy.address}' },`,
(inboxDomain) =>
` { domain: ${inboxDomain}, address: '${coreDeploy.contracts.inboxs[inboxDomain].proxy.address}' },`,
)
.join('\n')}
],

@ -6,8 +6,8 @@ import { CoreDeploy } from '../core/CoreDeploy';
import { ProxiedAddress } from '../config/addresses';
export type ProxyNames =
| 'Home'
| 'Replica'
| 'Outbox'
| 'Inbox'
| 'Governance'
| 'BridgeToken'
| 'BridgeRouter';

@ -187,42 +187,42 @@ export class AbacusContext extends MultiProvider {
}
/**
* Resolve the replica for the Home domain on the Remote domain (if any).
* Resolve the inbox for the Outbox domain on the Remote domain (if any).
*
* WARNING: do not hold references to this contract, as it will not be
* reconnected in the event the chain connection changes.
*
* @param home the sending domain
* @param outbox the sending domain
* @param remote the receiving domain
* @returns An interface for the Replica (if any)
* @returns An interface for the Inbox (if any)
*/
getReplicaFor(
home: string | number,
getInboxFor(
outbox: string | number,
remote: string | number,
): core.Replica | undefined {
return this.getCore(remote)?.getReplica(this.resolveDomain(home));
): core.Inbox | undefined {
return this.getCore(remote)?.getInbox(this.resolveDomain(outbox));
}
/**
* Resolve the replica for the Home domain on the Remote domain (or throws).
* Resolve the inbox for the Outbox domain on the Remote domain (or throws).
*
* WARNING: do not hold references to this contract, as it will not be
* reconnected in the event the chain connection changes.
*
* @param home the sending domain
* @param outbox the sending domain
* @param remote the receiving domain
* @returns An interface for the Replica
* @throws If no replica is found.
* @returns An interface for the Inbox
* @throws If no inbox is found.
*/
mustGetReplicaFor(
home: string | number,
mustGetInboxFor(
outbox: string | number,
remote: string | number,
): core.Replica {
const replica = this.getReplicaFor(home, remote);
if (!replica) {
throw new Error(`Missing replica for home ${home} & remote ${remote}`);
): core.Inbox {
const inbox = this.getInboxFor(outbox, remote);
if (!inbox) {
throw new Error(`Missing inbox for outbox ${outbox} & remote ${remote}`);
}
return replica;
return inbox;
}
/**

@ -1,15 +1,15 @@
import { ethers } from 'ethers';
import { core } from '@abacus-network/ts-interface';
import { Contracts } from '../../contracts';
import { ReplicaInfo } from '../domains/domain';
import { InboxInfo } from '../domains/domain';
import { CallBatch } from '../govern';
type Address = string;
interface Core {
id: number;
home: Address;
replicas: ReplicaInfo[];
outbox: Address;
inboxs: InboxInfo[];
governanceRouter: Address;
xAppConnectionManager: Address;
}
@ -22,8 +22,8 @@ export type Governor = {
export class CoreContracts extends Contracts {
readonly domain: number;
readonly _home: Address;
readonly _replicas: Map<number, ReplicaInfo>;
readonly _outbox: Address;
readonly _inboxs: Map<number, InboxInfo>;
readonly _governanceRouter: Address;
readonly _xAppConnectionManager: Address;
private providerOrSigner?: ethers.providers.Provider | ethers.Signer;
@ -31,45 +31,42 @@ export class CoreContracts extends Contracts {
constructor(
domain: number,
home: Address,
replicas: ReplicaInfo[],
outbox: Address,
inboxs: InboxInfo[],
governanceRouter: Address,
xAppConnectionManager: Address,
providerOrSigner?: ethers.providers.Provider | ethers.Signer,
) {
super(domain, home, replicas, providerOrSigner);
super(domain, outbox, inboxs, providerOrSigner);
this.providerOrSigner = providerOrSigner;
this.domain = domain;
this._home = home;
this._outbox = outbox;
this._governanceRouter = governanceRouter;
this._xAppConnectionManager = xAppConnectionManager;
this._replicas = new Map();
replicas.forEach((replica) => {
this._replicas.set(replica.domain, {
address: replica.address,
domain: replica.domain,
this._inboxs = new Map();
inboxs.forEach((inbox) => {
this._inboxs.set(inbox.domain, {
address: inbox.address,
domain: inbox.domain,
});
});
}
getReplica(domain: number): core.Replica | undefined {
getInbox(domain: number): core.Inbox | undefined {
if (!this.providerOrSigner) {
throw new Error('No provider or signer. Call `connect` first.');
}
const replica = this._replicas.get(domain);
if (!replica) return;
return core.Replica__factory.connect(
replica.address,
this.providerOrSigner,
);
const inbox = this._inboxs.get(domain);
if (!inbox) return;
return core.Inbox__factory.connect(inbox.address, this.providerOrSigner);
}
get home(): core.Home {
get outbox(): core.Outbox {
if (!this.providerOrSigner) {
throw new Error('No provider or signer. Call `connect` first.');
}
return core.Home__factory.connect(this._home, this.providerOrSigner);
return core.Outbox__factory.connect(this._outbox, this.providerOrSigner);
}
get governanceRouter(): core.GovernanceRouter {
@ -114,23 +111,23 @@ export class CoreContracts extends Contracts {
}
toObject(): Core {
const replicas: ReplicaInfo[] = Array.from(this._replicas.values());
const inboxs: InboxInfo[] = Array.from(this._inboxs.values());
return {
id: this.domain,
home: this._home,
replicas: replicas,
outbox: this._outbox,
inboxs: inboxs,
governanceRouter: this._governanceRouter,
xAppConnectionManager: this._xAppConnectionManager,
};
}
static fromObject(data: Core, signer?: ethers.Signer): CoreContracts {
const { id, home, replicas, governanceRouter, xAppConnectionManager } =
const { id, outbox, inboxs, governanceRouter, xAppConnectionManager } =
data;
if (
!id ||
!home ||
!replicas ||
!outbox ||
!inboxs ||
!governanceRouter ||
!xAppConnectionManager
) {
@ -138,8 +135,8 @@ export class CoreContracts extends Contracts {
}
return new CoreContracts(
id,
home,
replicas,
outbox,
inboxs,
governanceRouter,
xAppConnectionManager,
signer,

@ -4,8 +4,8 @@ export const alfajores: AbacusDomain = {
name: 'alfajores',
id: 1000,
bridgeRouter: '0x684C74fBA4dF7F7A542709C5f9688AB806C7B828',
home: '0xeA057840858645bb68134a913A252a44a0C58652',
replicas: [
outbox: '0xeA057840858645bb68134a913A252a44a0C58652',
inboxs: [
{ domain: 5, address: '0x3354D5956612C38D0dD831dcdf83CF30BC674231' },
{ domain: 3000, address: '0x6AdB8ba7C826d70506D26eDdc74236fB88Fa647F' },
{ domain: 43113, address: '0x570EDeF0c271E3f1ba6B5C66D040195750a79762' },
@ -20,8 +20,8 @@ export const kovan: AbacusDomain = {
id: 3000,
bridgeRouter: '0x53d09A4B49443F7f7C66321C306601dC9d483D4F',
ethHelper: '0xFE7c9Cc7116429Ae50823a218315C7E01EC7A761',
home: '0xc53F82FAF17B4c521A85C514791593847Bdf1655',
replicas: [
outbox: '0xc53F82FAF17B4c521A85C514791593847Bdf1655',
inboxs: [
{ domain: 5, address: '0xc501ad2163Ebd9921B4a6E46B344Ef7bA76A2cBa' },
{ domain: 1000, address: '0xEdDA4762fe6388C69d37b8Ee15B1deC10cA3B964' },
{ domain: 43113, address: '0xf3855B99b7cEfa56C66f0C2d0550b545df11d54A' },
@ -36,8 +36,8 @@ export const gorli: AbacusDomain = {
id: 5,
bridgeRouter: '0x53d09A4B49443F7f7C66321C306601dC9d483D4F',
ethHelper: '0xFE7c9Cc7116429Ae50823a218315C7E01EC7A761',
home: '0xc53F82FAF17B4c521A85C514791593847Bdf1655',
replicas: [
outbox: '0xc53F82FAF17B4c521A85C514791593847Bdf1655',
inboxs: [
{ domain: 1000, address: '0xEdDA4762fe6388C69d37b8Ee15B1deC10cA3B964' },
{ domain: 3000, address: '0xc501ad2163Ebd9921B4a6E46B344Ef7bA76A2cBa' },
{ domain: 43113, address: '0xf3855B99b7cEfa56C66f0C2d0550b545df11d54A' },
@ -52,8 +52,8 @@ export const fuji: AbacusDomain = {
id: 43113,
bridgeRouter: '0xFE7c9Cc7116429Ae50823a218315C7E01EC7A761',
ethHelper: '0x7B99a9cf26c9813b16E3DDb3D6E593c3624c9EBA',
home: '0xc53F82FAF17B4c521A85C514791593847Bdf1655',
replicas: [
outbox: '0xc53F82FAF17B4c521A85C514791593847Bdf1655',
inboxs: [
{ domain: 5, address: '0xf3855B99b7cEfa56C66f0C2d0550b545df11d54A' },
{ domain: 1000, address: '0xEdDA4762fe6388C69d37b8Ee15B1deC10cA3B964' },
{ domain: 3000, address: '0xc501ad2163Ebd9921B4a6E46B344Ef7bA76A2cBa' },
@ -73,8 +73,8 @@ export const mumbai: AbacusDomain = {
},
bridgeRouter: '0xFE7c9Cc7116429Ae50823a218315C7E01EC7A761',
ethHelper: '0x7B99a9cf26c9813b16E3DDb3D6E593c3624c9EBA',
home: '0xc53F82FAF17B4c521A85C514791593847Bdf1655',
replicas: [
outbox: '0xc53F82FAF17B4c521A85C514791593847Bdf1655',
inboxs: [
{ domain: 5, address: '0xf3855B99b7cEfa56C66f0C2d0550b545df11d54A' },
{ domain: 1000, address: '0xEdDA4762fe6388C69d37b8Ee15B1deC10cA3B964' },
{ domain: 3000, address: '0xc501ad2163Ebd9921B4a6E46B344Ef7bA76A2cBa' },

@ -4,13 +4,13 @@ import { Address } from '../../utils';
export interface AbacusDomain extends Domain {
bridgeRouter: Address;
ethHelper?: Address;
home: Address;
replicas: ReplicaInfo[];
outbox: Address;
inboxs: InboxInfo[];
governanceRouter: Address;
xAppConnectionManager: Address;
}
export interface ReplicaInfo {
export interface InboxInfo {
domain: number;
address: Address;
}

@ -1,4 +1,4 @@
export type { AbacusDomain, ReplicaInfo } from './domain';
export type { AbacusDomain, InboxInfo } from './domain';
export { mainnetDomains } from './mainnet';
export { mainnetLegacyDomains } from './mainnetLegacy';
export { devDomains } from './dev';

@ -4,10 +4,10 @@ export const celo: AbacusDomain = {
name: 'celo',
id: 1667591279,
bridgeRouter: '0x1548cf5cf7dBd93f4dA11f45fCce315573d21B60',
home: '0x913EE05036f3cbc94Ee4afDea87ceb430524648a',
outbox: '0x913EE05036f3cbc94Ee4afDea87ceb430524648a',
governanceRouter: '0xd13aC1024d266B73180cA7445Ca0E78b3Acfe8CE',
xAppConnectionManager: '0xaa099aF87ACE9E437b9B410a687F263eeaeC4321',
replicas: [
inboxs: [
{ domain: 6648936, address: '0xcDE146d1C673fE13f4fF1569d3F0d9f4d0b9c837' },
{
domain: 1635148152,
@ -25,10 +25,10 @@ export const ethereum: AbacusDomain = {
id: 6648936,
bridgeRouter: '0x4fc16De11deAc71E8b2Db539d82d93BE4b486892',
ethHelper: '0x2784a755690453035f32Ac5e28c52524d127AfE2',
home: '0xa73a3a74C7044B5411bD61E1990618A1400DA379',
outbox: '0xa73a3a74C7044B5411bD61E1990618A1400DA379',
governanceRouter: '0xcbcF180dbd02460dCFCdD282A0985DdC049a4c94',
xAppConnectionManager: '0x8A926cE79f83A5A4C234BeE93feAFCC85b1E40cD',
replicas: [
inboxs: [
{
domain: 1635148152,
address: '0xaa099aF87ACE9E437b9B410a687F263eeaeC4321',
@ -54,10 +54,10 @@ export const avalanche: AbacusDomain = {
},
bridgeRouter: '0xB6bB41B1fb8c381b002C405B8abB5D1De0C0abFE',
ethHelper: '0x4fc16De11deAc71E8b2Db539d82d93BE4b486892',
home: '0x101a39eA1143cb252fc8093847399046fc35Db89',
outbox: '0x101a39eA1143cb252fc8093847399046fc35Db89',
governanceRouter: '0x4d89F34dB307015F8002F97c1d100d84e3AFb76c',
xAppConnectionManager: '0x81B97dfBB743c343983e9bE7B863dB636DbD7373',
replicas: [
inboxs: [
{ domain: 6648936, address: '0xCf9066ee2fF063dD09862B745414c8dEa4Cc0497' },
{
domain: 1667591279,
@ -80,10 +80,10 @@ export const polygon: AbacusDomain = {
},
bridgeRouter: '0x3a5846882C0d5F8B0FA4bB04dc90C013104d125d',
ethHelper: '0xa489b8981ae5652C9Dd6515848cB8Dbecae5E1B0',
home: '0xCf9066ee2fF063dD09862B745414c8dEa4Cc0497',
outbox: '0xCf9066ee2fF063dD09862B745414c8dEa4Cc0497',
governanceRouter: '0xf1dd0edC8f8C9a881F350e8010e06bE9eaf7DafA',
xAppConnectionManager: '0x4eA75c12eD058F0e6651475688a941555FA62395',
replicas: [
inboxs: [
{ domain: 6648936, address: '0x2784a755690453035f32Ac5e28c52524d127AfE2' },
{
domain: 1635148152,

@ -5,10 +5,10 @@ export const ethereum: AbacusDomain = {
id: 6648936,
bridgeRouter: '0x6a39909e805A3eaDd2b61fFf61147796ca6aBB47',
ethHelper: '0xf1c1413096ff2278C3Df198a28F8D54e0369cF3A',
home: '0xf25C5932bb6EFc7afA4895D9916F2abD7151BF97',
outbox: '0xf25C5932bb6EFc7afA4895D9916F2abD7151BF97',
governanceRouter: '0x42303634F37956687fB7ff2c6146AC842481A052',
xAppConnectionManager: '0xcEc158A719d11005Bd9339865965bed938BEafA3',
replicas: [
inboxs: [
{
domain: 1667591279,
address: '0x07b5B57b08202294E657D51Eb453A189290f6385',
@ -30,10 +30,10 @@ export const polygon: AbacusDomain = {
},
bridgeRouter: '0xf244eA81F715F343040569398A4E7978De656bf6',
ethHelper: '0xc494bFEE14b5E1E118F93CfedF831f40dFA720fA',
home: '0x97bbda9A1D45D86631b243521380Bc070D6A4cBD',
outbox: '0x97bbda9A1D45D86631b243521380Bc070D6A4cBD',
governanceRouter: '0xcEc158A719d11005Bd9339865965bed938BEafA3',
xAppConnectionManager: '0x3BAD272559949B455f14ee394798E4D744342661',
replicas: [
inboxs: [
{ domain: 6648936, address: '0xf25C5932bb6EFc7afA4895D9916F2abD7151BF97' },
{
domain: 1667591279,
@ -46,10 +46,10 @@ export const celo: AbacusDomain = {
name: 'celo',
id: 1667591279,
bridgeRouter: '0xf244eA81F715F343040569398A4E7978De656bf6',
home: '0x97bbda9A1D45D86631b243521380Bc070D6A4cBD',
outbox: '0x97bbda9A1D45D86631b243521380Bc070D6A4cBD',
governanceRouter: '0xcEc158A719d11005Bd9339865965bed938BEafA3',
xAppConnectionManager: '0x3BAD272559949B455f14ee394798E4D744342661',
replicas: [
inboxs: [
{ domain: 6648936, address: '0xf25C5932bb6EFc7afA4895D9916F2abD7151BF97' },
{
domain: 1886350457,

@ -4,10 +4,10 @@ export const alfajores: AbacusDomain = {
name: 'alfajores',
id: 1000,
bridgeRouter: '0xe29Abbc3669064d8aF9F6BE378179a133664a92C',
home: '0xDf89d5d4039ada018BCDb992Bb6C2e05fEf86328',
outbox: '0xDf89d5d4039ada018BCDb992Bb6C2e05fEf86328',
governanceRouter: '0x1E2DE9CD3f64c4e9AadE11a60C7b3620dD026888',
xAppConnectionManager: '0x56Bf96be9ab395aa2861E7Ae4aCEFc11D8C2Ec49',
replicas: [
inboxs: [
{ domain: 3, address: '0xC9e581Cd4fF6533f5ccBA4Dc5d5f642B8b658B93' },
{ domain: 5, address: '0x4eAD31e37b950B32b9EBbE747f0ef4BffAc336a5' },
{ domain: 3000, address: '0x15fA9169F7495162ac52b4A7957c9054097Ab0FF' },
@ -19,10 +19,10 @@ export const ropsten: AbacusDomain = {
id: 3,
bridgeRouter: '0xe29Abbc3669064d8aF9F6BE378179a133664a92C',
ethHelper: '0x9A0e88a3D8CF09F3dc5Ba65640299DE3D87f926C',
home: '0x7E26E170dB94E81979927d2D39CB703048Ad599D',
outbox: '0x7E26E170dB94E81979927d2D39CB703048Ad599D',
governanceRouter: '0xa8C889D257d9eE02cb957941cd785CfffDe5a453',
xAppConnectionManager: '0xe5C92bC2a443016c00b3908dFA63f55bEe1a7a16',
replicas: [
inboxs: [
{ domain: 5, address: '0x15C1edbf6E6161d50d58682dF7587F0d61db5C38' },
{ domain: 1000, address: '0x30dAE25E9eBd644841d1A1fF25e303331B1CdEb3' },
{ domain: 3000, address: '0xF782C67AA111a9D75f6ccEf3d7aDB54620D5A8e9' },
@ -34,10 +34,10 @@ export const kovan: AbacusDomain = {
id: 3000,
bridgeRouter: '0x9A0e88a3D8CF09F3dc5Ba65640299DE3D87f926C',
ethHelper: '0x8c7510966c0312dEb2305A5E1C923CE48bbf55Ce',
home: '0x7E26E170dB94E81979927d2D39CB703048Ad599D',
outbox: '0x7E26E170dB94E81979927d2D39CB703048Ad599D',
governanceRouter: '0xa8C889D257d9eE02cb957941cd785CfffDe5a453',
xAppConnectionManager: '0xe5C92bC2a443016c00b3908dFA63f55bEe1a7a16',
replicas: [
inboxs: [
{ domain: 3, address: '0x15C1edbf6E6161d50d58682dF7587F0d61db5C38' },
{ domain: 5, address: '0xF782C67AA111a9D75f6ccEf3d7aDB54620D5A8e9' },
{ domain: 1000, address: '0x30dAE25E9eBd644841d1A1fF25e303331B1CdEb3' },
@ -49,10 +49,10 @@ export const gorli: AbacusDomain = {
id: 5,
bridgeRouter: '0xe29Abbc3669064d8aF9F6BE378179a133664a92C',
ethHelper: '0x9A0e88a3D8CF09F3dc5Ba65640299DE3D87f926C',
home: '0xDf89d5d4039ada018BCDb992Bb6C2e05fEf86328',
outbox: '0xDf89d5d4039ada018BCDb992Bb6C2e05fEf86328',
governanceRouter: '0x1E2DE9CD3f64c4e9AadE11a60C7b3620dD026888',
xAppConnectionManager: '0x56Bf96be9ab395aa2861E7Ae4aCEFc11D8C2Ec49',
replicas: [
inboxs: [
{ domain: 3, address: '0xC9e581Cd4fF6533f5ccBA4Dc5d5f642B8b658B93' },
{ domain: 1000, address: '0x15fA9169F7495162ac52b4A7957c9054097Ab0FF' },
{ domain: 3000, address: '0x4eAD31e37b950B32b9EBbE747f0ef4BffAc336a5' },

@ -4,10 +4,10 @@ export const alfajores: AbacusDomain = {
name: 'alfajores',
id: 1000,
bridgeRouter: '0xd6930Ee55C141E5Bb4079d5963cF64320956bb3E',
home: '0xc8abA9c65A292C84EA00441B81124d9507fB22A8',
outbox: '0xc8abA9c65A292C84EA00441B81124d9507fB22A8',
governanceRouter: '0x760AbbE9496BD9cEe159402E2B4d96E3d76dbE6a',
xAppConnectionManager: '0x02c144AeBA550634c8EE185F78657fd3C4a3F9B5',
replicas: [
inboxs: [
{ domain: 2000, address: '0x7149bF9f804F27e7259d0Ce328Dd5f6D5639ef19' },
{ domain: 3000, address: '0xE469D8587D45BF85297BD924b159E726E7CA5408' },
],
@ -18,10 +18,10 @@ export const kovan: AbacusDomain = {
id: 3000,
bridgeRouter: '0x359089D34687bDbFD019fCC5093fFC21bE9905f5',
ethHelper: '0x411ABcFD947212a0D64b97C9882556367b61704a',
home: '0xB6Ee3e8fE5b577Bd6aB9a06FA169F97303586E7C',
outbox: '0xB6Ee3e8fE5b577Bd6aB9a06FA169F97303586E7C',
governanceRouter: '0xa95868Ffaed7489e9059d4a08A0C1B0F78041b33',
xAppConnectionManager: '0x1d9Af80594930574201d919Af0fBfe6bb89800E2',
replicas: [
inboxs: [
{ domain: 1000, address: '0xF76995174f3C02e2900d0F6261e8cbeC04078E1f' },
{ domain: 2000, address: '0xFF47138c42119Fe0B1f267e2fa254321DE287Fc6' },
],
@ -32,10 +32,10 @@ export const rinkeby: AbacusDomain = {
id: 2000,
bridgeRouter: '0x8FbEA25D0bFDbff68F2B920df180e9498E9c856A',
ethHelper: '0x1BEBC8F1260d16EE5d1CFEE9366bB474bD13DC5f',
home: '0x8459EDe1ed4dADD6D5B142d845240088A6530Cf8',
outbox: '0x8459EDe1ed4dADD6D5B142d845240088A6530Cf8',
governanceRouter: '0x8f8424DC94b4c302984Ab5a03fc4c2d1Ec95DC92',
xAppConnectionManager: '0x53B94f2D4a3159b66fcCC4f406Ea388426A3f3cB',
replicas: [
inboxs: [
{ domain: 1000, address: '0xb473F5e0AAf47Ba54dac048633e7b578c1eBde01' },
{ domain: 3000, address: '0x7EB8450a5397b795F2d89BC48EA20c24fa147F11' },
],

@ -4,7 +4,7 @@ import { TransactionReceipt } from '@ethersproject/abstract-provider';
import { TypedEvent } from '@abacus-network/ts-interface/dist/abacus-core/commons';
// copied from the Home.d.ts
// copied from the Outbox.d.ts
export type DispatchTypes = [string, BigNumber, BigNumber, string, string];
export type DispatchArgs = {
messageHash: string;
@ -15,12 +15,12 @@ export type DispatchArgs = {
};
export type DispatchEvent = TypedEvent<DispatchTypes & DispatchArgs>;
// copied from the Home.d.ts
// copied from the Outbox.d.ts
export type CheckpointTypes = [string, BigNumber];
export type CheckpointArgs = { root: string; index: BigNumber };
export type CheckpointEvent = TypedEvent<CheckpointTypes & CheckpointArgs>;
// copied from the Replica.d.ts
// copied from the Inbox.d.ts
export type ProcessTypes = [string, boolean, string];
export type ProcessArgs = {
messageHash: string;

@ -42,15 +42,15 @@ export enum MessageStatus {
Processed = 3,
}
export enum ReplicaMessageStatus {
export enum InboxMessageStatus {
None = 0,
Proven,
Processed,
}
export type EventCache = {
homeCheckpoint?: AnnotatedCheckpoint;
replicaCheckpoint?: AnnotatedCheckpoint;
outboxCheckpoint?: AnnotatedCheckpoint;
inboxCheckpoint?: AnnotatedCheckpoint;
process?: AnnotatedProcess;
};
@ -77,8 +77,8 @@ export function parseMessage(message: string): ParsedMessage {
export class AbacusMessage {
readonly dispatch: AnnotatedDispatch;
readonly message: ParsedMessage;
readonly home: core.Home;
readonly replica: core.Replica;
readonly outbox: core.Outbox;
readonly inbox: core.Inbox;
readonly context: AbacusContext;
protected cache: EventCache;
@ -87,8 +87,8 @@ export class AbacusMessage {
this.context = context;
this.message = parseMessage(dispatch.event.args.message);
this.dispatch = dispatch;
this.home = context.mustGetCore(this.message.from).home;
this.replica = context.mustGetReplicaFor(
this.outbox = context.mustGetCore(this.message.from).outbox;
this.inbox = context.mustGetInboxFor(
this.message.from,
this.message.destination,
);
@ -116,11 +116,11 @@ export class AbacusMessage {
receipt: TransactionReceipt,
): AbacusMessage[] {
const messages: AbacusMessage[] = [];
const home = new core.Home__factory().interface;
const outbox = new core.Outbox__factory().interface;
for (const log of receipt.logs) {
try {
const parsed = home.parseLog(log);
const parsed = outbox.parseLog(log);
if (parsed.name === 'Dispatch') {
const dispatch = parsed as unknown as DispatchEvent;
dispatch.getBlock = () => {
@ -227,20 +227,20 @@ export class AbacusMessage {
}
/**
* Get the Home `Checkpoint` event associated with this message (if any)
* Get the Outbox `Checkpoint` event associated with this message (if any)
*
* @returns An {@link AnnotatedCheckpoint} (if any)
*/
async getHomeCheckpoint(): Promise<AnnotatedCheckpoint | undefined> {
async getOutboxCheckpoint(): Promise<AnnotatedCheckpoint | undefined> {
// if we have already gotten the event,
// return it without re-querying
if (this.cache.homeCheckpoint) {
return this.cache.homeCheckpoint;
if (this.cache.outboxCheckpoint) {
return this.cache.outboxCheckpoint;
}
const leafIndex = this.dispatch.event.args.leafIndex;
const [checkpointRoot, checkpointIndex] =
await this.home.latestCheckpoint();
await this.outbox.latestCheckpoint();
// The checkpoint index needs to be at least leafIndex + 1 to include
// the message.
if (checkpointIndex.lte(leafIndex)) {
@ -248,7 +248,7 @@ export class AbacusMessage {
}
// Query the latest checkpoint event.
const checkpointFilter = this.home.filters.Checkpoint(
const checkpointFilter = this.outbox.filters.Checkpoint(
checkpointRoot,
checkpointIndex,
);
@ -257,35 +257,35 @@ export class AbacusMessage {
await findAnnotatedSingleEvent<CheckpointTypes, CheckpointArgs>(
this.context,
this.origin,
this.home,
this.outbox,
checkpointFilter,
);
if (checkpointLogs.length === 1) {
// if event is returned, store it to the object
this.cache.homeCheckpoint = checkpointLogs[0];
this.cache.outboxCheckpoint = checkpointLogs[0];
} else if (checkpointLogs.length > 1) {
throw new Error('multiple home checkpoints for same root and index');
throw new Error('multiple outbox checkpoints for same root and index');
}
// return the event or undefined if it doesn't exist
return this.cache.homeCheckpoint;
return this.cache.outboxCheckpoint;
}
/**
* Get the Replica `Checkpoint` event associated with this message (if any)
* Get the Inbox `Checkpoint` event associated with this message (if any)
*
* @returns An {@link AnnotatedCheckpoint} (if any)
*/
async getReplicaCheckpoint(): Promise<AnnotatedCheckpoint | undefined> {
async getInboxCheckpoint(): Promise<AnnotatedCheckpoint | undefined> {
// if we have already gotten the event,
// return it without re-querying
if (this.cache.replicaCheckpoint) {
return this.cache.replicaCheckpoint;
if (this.cache.inboxCheckpoint) {
return this.cache.inboxCheckpoint;
}
const leafIndex = this.dispatch.event.args.leafIndex;
const [checkpointRoot, checkpointIndex] =
await this.replica.latestCheckpoint();
await this.inbox.latestCheckpoint();
// The checkpoint index needs to be at least leafIndex + 1 to include
// the message.
if (checkpointIndex.lte(leafIndex)) {
@ -293,7 +293,7 @@ export class AbacusMessage {
}
// if not, attempt to query the event
const checkpointFilter = this.replica.filters.Checkpoint(
const checkpointFilter = this.inbox.filters.Checkpoint(
checkpointRoot,
checkpointIndex,
);
@ -301,21 +301,21 @@ export class AbacusMessage {
await findAnnotatedSingleEvent<CheckpointTypes, CheckpointArgs>(
this.context,
this.destination,
this.replica,
this.inbox,
checkpointFilter,
);
if (checkpointLogs.length === 1) {
// if event is returned, store it to the object
this.cache.replicaCheckpoint = checkpointLogs[0];
this.cache.inboxCheckpoint = checkpointLogs[0];
} else if (checkpointLogs.length > 1) {
throw new Error('multiple replica checkpoints for same root');
throw new Error('multiple inbox checkpoints for same root');
}
// return the event or undefined if it wasn't found
return this.cache.replicaCheckpoint;
return this.cache.inboxCheckpoint;
}
/**
* Get the Replica `Process` event associated with this message (if any)
* Get the Inbox `Process` event associated with this message (if any)
*
* @returns An {@link AnnotatedProcess} (if any)
*/
@ -326,16 +326,16 @@ export class AbacusMessage {
return this.cache.process;
}
// if not, attempt to query the event
const processFilter = this.replica.filters.Process(this.leaf);
const processFilter = this.inbox.filters.Process(this.leaf);
const processLogs = await findAnnotatedSingleEvent<
ProcessTypes,
ProcessArgs
>(this.context, this.destination, this.replica, processFilter, startBlock);
>(this.context, this.destination, this.inbox, processFilter, startBlock);
if (processLogs.length === 1) {
// if event is returned, store it to the object
this.cache.process = processLogs[0];
} else if (processLogs.length > 1) {
throw new Error('multiple replica process for same message');
throw new Error('multiple inbox process for same message');
}
// return the process or undefined if it doesn't exist
return this.cache.process;
@ -348,32 +348,32 @@ export class AbacusMessage {
*/
async events(): Promise<AbacusStatus> {
const events: AnnotatedLifecycleEvent[] = [this.dispatch];
// attempt to get Home checkpoint
const homeCheckpoint = await this.getHomeCheckpoint();
if (!homeCheckpoint) {
// attempt to get Outbox checkpoint
const outboxCheckpoint = await this.getOutboxCheckpoint();
if (!outboxCheckpoint) {
return {
status: MessageStatus.Dispatched, // the message has been sent; nothing more
events,
};
}
events.push(homeCheckpoint);
// attempt to get Replica checkpoint
const replicaCheckpoint = await this.getReplicaCheckpoint();
if (!replicaCheckpoint) {
events.push(outboxCheckpoint);
// attempt to get Inbox checkpoint
const inboxCheckpoint = await this.getInboxCheckpoint();
if (!inboxCheckpoint) {
return {
status: MessageStatus.Included, // the message was sent, then included in an Checkpoint on Home
status: MessageStatus.Included, // the message was sent, then included in an Checkpoint on Outbox
events,
};
}
events.push(replicaCheckpoint);
// attempt to get Replica process
const process = await this.getProcess(replicaCheckpoint.blockNumber);
events.push(inboxCheckpoint);
// attempt to get Inbox process
const process = await this.getProcess(inboxCheckpoint.blockNumber);
if (!process) {
// NOTE: when this is the status, you may way to
// query confirmAt() to check if challenge period
// on the Replica has elapsed or not
// on the Inbox has elapsed or not
return {
status: MessageStatus.Relayed, // the message was sent, included in an Checkpoint, then relayed to the Replica
status: MessageStatus.Relayed, // the message was sent, included in an Checkpoint, then relayed to the Inbox
events,
};
}
@ -385,13 +385,13 @@ export class AbacusMessage {
}
/**
* Retrieve the replica status of this message.
* Retrieve the inbox status of this message.
*
* @returns The {@link ReplicaMessageStatus} corresponding to the solidity
* @returns The {@link InboxMessageStatus} corresponding to the solidity
* status of the message.
*/
async replicaStatus(): Promise<ReplicaMessageStatus> {
return this.replica.messages(this.leaf);
async inboxStatus(): Promise<InboxMessageStatus> {
return this.inbox.messages(this.leaf);
}
/**
@ -400,8 +400,8 @@ export class AbacusMessage {
* @returns true if processed, else false.
*/
async delivered(): Promise<boolean> {
const status = await this.replicaStatus();
return status === ReplicaMessageStatus.Processed;
const status = await this.inboxStatus();
return status === InboxMessageStatus.Processed;
}
/**
@ -487,7 +487,7 @@ export class AbacusMessage {
}
/**
* The messageHash committed to the tree in the Home contract.
* The messageHash committed to the tree in the Outbox contract.
*/
get leaf(): string {
return this.dispatch.event.args.messageHash;

@ -5,7 +5,7 @@ metadata:
labels:
{{- include "monitor.labels" . | nindent 4 }}
spec:
replicas: 1
inboxs: 1
selector:
matchLabels:
{{- include "monitor.selectorLabels" . | nindent 6 }}

@ -1,4 +1,4 @@
replicaCount: 1
inboxCount: 1
image:
repository: gcr.io/clabs-optics/optics-monitor

@ -6,7 +6,7 @@ export class MetricCollector {
private numDispatchedGauge: Gauge<string>;
private numProcessedGauge: Gauge<string>;
private numUnprocessedGauge: Gauge<string>;
private homeStateGauge: Gauge<string>;
private outboxStateGauge: Gauge<string>;
private governorRecoveryActiveAt: Gauge<string>;
private readonly logger: Logger;
@ -32,9 +32,9 @@ export class MetricCollector {
labelNames: ['network', 'environment'],
});
this.homeStateGauge = new Gauge({
name: 'optics_home_state',
help: 'Gauge that tracks the state of a home contract for a network',
this.outboxStateGauge = new Gauge({
name: 'optics_outbox_state',
help: 'Gauge that tracks the state of a outbox contract for a network',
labelNames: ['network', 'environment'],
});
@ -59,8 +59,8 @@ export class MetricCollector {
this.numUnprocessedGauge.set({ network, environment }, unprocessed);
}
setHomeState(network: string, environment: string, state: number) {
this.homeStateGauge.set({ network, environment }, state);
setOutboxState(network: string, environment: string, state: number) {
this.outboxStateGauge.set({ network, environment }, state);
}
setGovernorRecoveryActiveAt(

@ -13,26 +13,26 @@ export async function monitorCore(
originNetwork,
});
originLogger.info(`Getting home state and Dispatch logs`);
const home = context.mustGetCore(originNetwork).home;
const dispatchFilter = home.filters.Dispatch();
originLogger.info(`Getting outbox state and Dispatch logs`);
const outbox = context.mustGetCore(originNetwork).outbox;
const dispatchFilter = outbox.filters.Dispatch();
const dispatchLogs = await getEvents(
context,
originNetwork,
home,
outbox,
dispatchFilter,
);
const homeState = await home.state();
config.metrics.setHomeState(originNetwork, config.environment, homeState);
const outboxState = await outbox.state();
config.metrics.setOutboxState(originNetwork, config.environment, outboxState);
// Get metrics for each replica
// Get metrics for each inbox
const processedLogs = [];
for (const remoteNetwork of remoteNetworks) {
const remoteLogger = originLogger.child({
remoteNetwork,
});
const processLogs = await monitorCoreReplica(
const processLogs = await monitorCoreInbox(
context,
originNetwork,
remoteNetwork,
@ -65,20 +65,20 @@ export async function monitorCore(
writeUnprocessedMessages(unprocessedDetails, originNetwork);
}
async function monitorCoreReplica(
async function monitorCoreInbox(
context: AbacusContext,
originNetwork: string,
remoteNetwork: string,
logger: Logger,
) {
logger.info(`Getting replica state and Process logs`);
logger.info(`Getting inbox state and Process logs`);
const replica = context.mustGetReplicaFor(originNetwork, remoteNetwork);
const processFilter = replica.filters.Process();
const inbox = context.mustGetInboxFor(originNetwork, remoteNetwork);
const processFilter = inbox.filters.Process();
const processLogs = await getEvents(
context,
remoteNetwork,
replica,
inbox,
processFilter,
);
return processLogs;

@ -23,9 +23,9 @@ export function blockExplorerURL(
}
export const STATUS_TO_STRING = {
[MessageStatus.Dispatched]: 'Dispatched on Home',
[MessageStatus.Included]: 'Included in Home Checkpoint',
[MessageStatus.Relayed]: 'Relayed to Replica',
[MessageStatus.Dispatched]: 'Dispatched on Outbox',
[MessageStatus.Included]: 'Included in Outbox Checkpoint',
[MessageStatus.Relayed]: 'Relayed to Inbox',
[MessageStatus.Processed]: 'Processed',
};

@ -1,127 +0,0 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import {
ethers,
EventFilter,
Signer,
BigNumber,
BigNumberish,
PopulatedTransaction,
BaseContract,
ContractTransaction,
Overrides,
CallOverrides,
} from "ethers";
import { BytesLike } from "@ethersproject/bytes";
import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface IUpdaterManagerInterface extends ethers.utils.Interface {
functions: {
"slashUpdater(address)": FunctionFragment;
"updater()": FunctionFragment;
};
encodeFunctionData(
functionFragment: "slashUpdater",
values: [string]
): string;
encodeFunctionData(functionFragment: "updater", values?: undefined): string;
decodeFunctionResult(
functionFragment: "slashUpdater",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "updater", data: BytesLike): Result;
events: {};
}
export class IUpdaterManager extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
listeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject>
): Array<TypedListener<EventArgsArray, EventArgsObject>>;
off<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
on<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
once<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeListener<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>
): this;
listeners(eventName?: string): Array<Listener>;
off(eventName: string, listener: Listener): this;
on(eventName: string, listener: Listener): this;
once(eventName: string, listener: Listener): this;
removeListener(eventName: string, listener: Listener): this;
removeAllListeners(eventName?: string): this;
queryFilter<EventArgsArray extends Array<any>, EventArgsObject>(
event: TypedEventFilter<EventArgsArray, EventArgsObject>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: IUpdaterManagerInterface;
functions: {
slashUpdater(
_reporter: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<[string]>;
};
slashUpdater(
_reporter: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<string>;
callStatic: {
slashUpdater(_reporter: string, overrides?: CallOverrides): Promise<void>;
updater(overrides?: CallOverrides): Promise<string>;
};
filters: {};
estimateGas: {
slashUpdater(
_reporter: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
updater(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
slashUpdater(
_reporter: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
updater(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

File diff suppressed because it is too large Load Diff

@ -1,246 +0,0 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import {
ethers,
EventFilter,
Signer,
BigNumber,
BigNumberish,
PopulatedTransaction,
BaseContract,
ContractTransaction,
CallOverrides,
} from "ethers";
import { BytesLike } from "@ethersproject/bytes";
import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface MerkleLibInterface extends ethers.utils.Interface {
functions: {
"zeroHashes()": FunctionFragment;
};
encodeFunctionData(
functionFragment: "zeroHashes",
values?: undefined
): string;
decodeFunctionResult(functionFragment: "zeroHashes", data: BytesLike): Result;
events: {};
}
export class MerkleLib extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
listeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject>
): Array<TypedListener<EventArgsArray, EventArgsObject>>;
off<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
on<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
once<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeListener<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>
): this;
listeners(eventName?: string): Array<Listener>;
off(eventName: string, listener: Listener): this;
on(eventName: string, listener: Listener): this;
once(eventName: string, listener: Listener): this;
removeListener(eventName: string, listener: Listener): this;
removeAllListeners(eventName?: string): this;
queryFilter<EventArgsArray extends Array<any>, EventArgsObject>(
event: TypedEventFilter<EventArgsArray, EventArgsObject>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: MerkleLibInterface;
functions: {
zeroHashes(
overrides?: CallOverrides
): Promise<
[
[
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string
]
] & {
_zeroes: [
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string
];
}
>;
};
zeroHashes(
overrides?: CallOverrides
): Promise<
[
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string
]
>;
callStatic: {
zeroHashes(
overrides?: CallOverrides
): Promise<
[
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string,
string
]
>;
};
filters: {};
estimateGas: {
zeroHashes(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
zeroHashes(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -0,0 +1,570 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import {
ethers,
EventFilter,
Signer,
BigNumber,
BigNumberish,
PopulatedTransaction,
BaseContract,
ContractTransaction,
Overrides,
CallOverrides,
} from "ethers";
import { BytesLike } from "@ethersproject/bytes";
import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface OutboxInterface extends ethers.utils.Interface {
functions: {
"MAX_MESSAGE_BODY_BYTES()": FunctionFragment;
"VERSION()": FunctionFragment;
"checkpoint()": FunctionFragment;
"checkpointedRoot()": FunctionFragment;
"checkpoints(bytes32)": FunctionFragment;
"count()": FunctionFragment;
"dispatch(uint32,bytes32,bytes)": FunctionFragment;
"fail()": FunctionFragment;
"initialize(address)": FunctionFragment;
"latestCheckpoint()": FunctionFragment;
"localDomain()": FunctionFragment;
"nonces(uint32)": FunctionFragment;
"owner()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"root()": FunctionFragment;
"setValidatorManager(address)": FunctionFragment;
"state()": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"tree()": FunctionFragment;
"validatorManager()": FunctionFragment;
};
encodeFunctionData(
functionFragment: "MAX_MESSAGE_BODY_BYTES",
values?: undefined
): string;
encodeFunctionData(functionFragment: "VERSION", values?: undefined): string;
encodeFunctionData(
functionFragment: "checkpoint",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "checkpointedRoot",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "checkpoints",
values: [BytesLike]
): string;
encodeFunctionData(functionFragment: "count", values?: undefined): string;
encodeFunctionData(
functionFragment: "dispatch",
values: [BigNumberish, BytesLike, BytesLike]
): string;
encodeFunctionData(functionFragment: "fail", values?: undefined): string;
encodeFunctionData(functionFragment: "initialize", values: [string]): string;
encodeFunctionData(
functionFragment: "latestCheckpoint",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "localDomain",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "nonces",
values: [BigNumberish]
): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(functionFragment: "root", values?: undefined): string;
encodeFunctionData(
functionFragment: "setValidatorManager",
values: [string]
): string;
encodeFunctionData(functionFragment: "state", values?: undefined): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(functionFragment: "tree", values?: undefined): string;
encodeFunctionData(
functionFragment: "validatorManager",
values?: undefined
): string;
decodeFunctionResult(
functionFragment: "MAX_MESSAGE_BODY_BYTES",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "VERSION", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "checkpoint", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "checkpointedRoot",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "checkpoints",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "count", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "dispatch", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "fail", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "latestCheckpoint",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "localDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "root", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "setValidatorManager",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "state", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "tree", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "validatorManager",
data: BytesLike
): Result;
events: {
"Checkpoint(bytes32,uint256)": EventFragment;
"Dispatch(bytes32,uint256,uint64,bytes32,bytes)": EventFragment;
"Fail()": EventFragment;
"NewValidatorManager(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "Checkpoint"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Dispatch"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Fail"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewValidatorManager"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
}
export class Outbox extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
listeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject>
): Array<TypedListener<EventArgsArray, EventArgsObject>>;
off<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
on<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
once<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeListener<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>
): this;
listeners(eventName?: string): Array<Listener>;
off(eventName: string, listener: Listener): this;
on(eventName: string, listener: Listener): this;
once(eventName: string, listener: Listener): this;
removeListener(eventName: string, listener: Listener): this;
removeAllListeners(eventName?: string): this;
queryFilter<EventArgsArray extends Array<any>, EventArgsObject>(
event: TypedEventFilter<EventArgsArray, EventArgsObject>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: OutboxInterface;
functions: {
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<[BigNumber]>;
VERSION(overrides?: CallOverrides): Promise<[number]>;
checkpoint(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
checkpointedRoot(overrides?: CallOverrides): Promise<[string]>;
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<[BigNumber]>;
count(overrides?: CallOverrides): Promise<[BigNumber]>;
dispatch(
_destinationDomain: BigNumberish,
_recipientAddress: BytesLike,
_messageBody: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
initialize(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<[number]>;
nonces(arg0: BigNumberish, overrides?: CallOverrides): Promise<[number]>;
owner(overrides?: CallOverrides): Promise<[string]>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
root(overrides?: CallOverrides): Promise<[string]>;
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<[number]>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
tree(
overrides?: CallOverrides
): Promise<[BigNumber] & { count: BigNumber }>;
validatorManager(overrides?: CallOverrides): Promise<[string]>;
};
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<BigNumber>;
VERSION(overrides?: CallOverrides): Promise<number>;
checkpoint(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
count(overrides?: CallOverrides): Promise<BigNumber>;
dispatch(
_destinationDomain: BigNumberish,
_recipientAddress: BytesLike,
_messageBody: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
initialize(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
nonces(arg0: BigNumberish, overrides?: CallOverrides): Promise<number>;
owner(overrides?: CallOverrides): Promise<string>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
root(overrides?: CallOverrides): Promise<string>;
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<number>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
tree(overrides?: CallOverrides): Promise<BigNumber>;
validatorManager(overrides?: CallOverrides): Promise<string>;
callStatic: {
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<BigNumber>;
VERSION(overrides?: CallOverrides): Promise<number>;
checkpoint(overrides?: CallOverrides): Promise<void>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
count(overrides?: CallOverrides): Promise<BigNumber>;
dispatch(
_destinationDomain: BigNumberish,
_recipientAddress: BytesLike,
_messageBody: BytesLike,
overrides?: CallOverrides
): Promise<void>;
fail(overrides?: CallOverrides): Promise<void>;
initialize(
_validatorManager: string,
overrides?: CallOverrides
): Promise<void>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
nonces(arg0: BigNumberish, overrides?: CallOverrides): Promise<number>;
owner(overrides?: CallOverrides): Promise<string>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
root(overrides?: CallOverrides): Promise<string>;
setValidatorManager(
_validatorManager: string,
overrides?: CallOverrides
): Promise<void>;
state(overrides?: CallOverrides): Promise<number>;
transferOwnership(
newOwner: string,
overrides?: CallOverrides
): Promise<void>;
tree(overrides?: CallOverrides): Promise<BigNumber>;
validatorManager(overrides?: CallOverrides): Promise<string>;
};
filters: {
Checkpoint(
root?: BytesLike | null,
index?: BigNumberish | null
): TypedEventFilter<
[string, BigNumber],
{ root: string; index: BigNumber }
>;
Dispatch(
messageHash?: BytesLike | null,
leafIndex?: BigNumberish | null,
destinationAndNonce?: BigNumberish | null,
checkpointedRoot?: null,
message?: null
): TypedEventFilter<
[string, BigNumber, BigNumber, string, string],
{
messageHash: string;
leafIndex: BigNumber;
destinationAndNonce: BigNumber;
checkpointedRoot: string;
message: string;
}
>;
Fail(): TypedEventFilter<[], {}>;
NewValidatorManager(
validatorManager?: null
): TypedEventFilter<[string], { validatorManager: string }>;
OwnershipTransferred(
previousOwner?: string | null,
newOwner?: string | null
): TypedEventFilter<
[string, string],
{ previousOwner: string; newOwner: string }
>;
};
estimateGas: {
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<BigNumber>;
VERSION(overrides?: CallOverrides): Promise<BigNumber>;
checkpoint(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
checkpointedRoot(overrides?: CallOverrides): Promise<BigNumber>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
count(overrides?: CallOverrides): Promise<BigNumber>;
dispatch(
_destinationDomain: BigNumberish,
_recipientAddress: BytesLike,
_messageBody: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
initialize(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
latestCheckpoint(overrides?: CallOverrides): Promise<BigNumber>;
localDomain(overrides?: CallOverrides): Promise<BigNumber>;
nonces(arg0: BigNumberish, overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
root(overrides?: CallOverrides): Promise<BigNumber>;
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
state(overrides?: CallOverrides): Promise<BigNumber>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
tree(overrides?: CallOverrides): Promise<BigNumber>;
validatorManager(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
MAX_MESSAGE_BODY_BYTES(
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
VERSION(overrides?: CallOverrides): Promise<PopulatedTransaction>;
checkpoint(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
checkpointedRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
count(overrides?: CallOverrides): Promise<PopulatedTransaction>;
dispatch(
_destinationDomain: BigNumberish,
_recipientAddress: BytesLike,
_messageBody: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
initialize(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
latestCheckpoint(overrides?: CallOverrides): Promise<PopulatedTransaction>;
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
nonces(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
root(overrides?: CallOverrides): Promise<PopulatedTransaction>;
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
state(overrides?: CallOverrides): Promise<PopulatedTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
tree(overrides?: CallOverrides): Promise<PopulatedTransaction>;
validatorManager(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -1,145 +0,0 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import {
ethers,
EventFilter,
Signer,
BigNumber,
BigNumberish,
PopulatedTransaction,
BaseContract,
ContractTransaction,
CallOverrides,
} from "ethers";
import { BytesLike } from "@ethersproject/bytes";
import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface QueueManagerInterface extends ethers.utils.Interface {
functions: {
"queueContains(bytes32)": FunctionFragment;
"queueEnd()": FunctionFragment;
"queueLength()": FunctionFragment;
};
encodeFunctionData(
functionFragment: "queueContains",
values: [BytesLike]
): string;
encodeFunctionData(functionFragment: "queueEnd", values?: undefined): string;
encodeFunctionData(
functionFragment: "queueLength",
values?: undefined
): string;
decodeFunctionResult(
functionFragment: "queueContains",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "queueEnd", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "queueLength",
data: BytesLike
): Result;
events: {};
}
export class QueueManager extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
listeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject>
): Array<TypedListener<EventArgsArray, EventArgsObject>>;
off<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
on<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
once<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeListener<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>
): this;
listeners(eventName?: string): Array<Listener>;
off(eventName: string, listener: Listener): this;
on(eventName: string, listener: Listener): this;
once(eventName: string, listener: Listener): this;
removeListener(eventName: string, listener: Listener): this;
removeAllListeners(eventName?: string): this;
queryFilter<EventArgsArray extends Array<any>, EventArgsObject>(
event: TypedEventFilter<EventArgsArray, EventArgsObject>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: QueueManagerInterface;
functions: {
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<[boolean]>;
queueEnd(overrides?: CallOverrides): Promise<[string]>;
queueLength(overrides?: CallOverrides): Promise<[BigNumber]>;
};
queueContains(_item: BytesLike, overrides?: CallOverrides): Promise<boolean>;
queueEnd(overrides?: CallOverrides): Promise<string>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
callStatic: {
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
queueEnd(overrides?: CallOverrides): Promise<string>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
};
filters: {};
estimateGas: {
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<BigNumber>;
queueEnd(overrides?: CallOverrides): Promise<BigNumber>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
queueEnd(overrides?: CallOverrides): Promise<PopulatedTransaction>;
queueLength(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -19,7 +19,7 @@ import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface TestReplicaInterface extends ethers.utils.Interface {
interface TestInboxInterface extends ethers.utils.Interface {
functions: {
"PROCESS_GAS()": FunctionFragment;
"RESERVE_GAS()": FunctionFragment;
@ -323,7 +323,7 @@ interface TestReplicaInterface extends ethers.utils.Interface {
getEvent(nameOrSignatureOrTopic: "Process"): EventFragment;
}
export class TestReplica extends BaseContract {
export class TestInbox extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
@ -364,7 +364,7 @@ export class TestReplica extends BaseContract {
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: TestReplicaInterface;
interface: TestInboxInterface;
functions: {
PROCESS_GAS(overrides?: CallOverrides): Promise<[BigNumber]>;

@ -19,7 +19,7 @@ import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface TestHomeInterface extends ethers.utils.Interface {
interface TestOutboxInterface extends ethers.utils.Interface {
functions: {
"MAX_MESSAGE_BODY_BYTES()": FunctionFragment;
"VERSION()": FunctionFragment;
@ -181,7 +181,7 @@ interface TestHomeInterface extends ethers.utils.Interface {
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
}
export class TestHome extends BaseContract {
export class TestOutbox extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
@ -222,7 +222,7 @@ export class TestHome extends BaseContract {
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: TestHomeInterface;
interface: TestOutboxInterface;
functions: {
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<[BigNumber]>;

@ -1,363 +0,0 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import {
ethers,
EventFilter,
Signer,
BigNumber,
BigNumberish,
PopulatedTransaction,
BaseContract,
ContractTransaction,
Overrides,
CallOverrides,
} from "ethers";
import { BytesLike } from "@ethersproject/bytes";
import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface TestQueueInterface extends ethers.utils.Interface {
functions: {
"contains(bytes32)": FunctionFragment;
"dequeue()": FunctionFragment;
"dequeueMany(uint256)": FunctionFragment;
"drain()": FunctionFragment;
"enqueue(bytes32)": FunctionFragment;
"enqueueMany(bytes32[])": FunctionFragment;
"initializeAgain()": FunctionFragment;
"lastItem()": FunctionFragment;
"length()": FunctionFragment;
"peek()": FunctionFragment;
"queueContains(bytes32)": FunctionFragment;
"queueEnd()": FunctionFragment;
"queueLength()": FunctionFragment;
};
encodeFunctionData(functionFragment: "contains", values: [BytesLike]): string;
encodeFunctionData(functionFragment: "dequeue", values?: undefined): string;
encodeFunctionData(
functionFragment: "dequeueMany",
values: [BigNumberish]
): string;
encodeFunctionData(functionFragment: "drain", values?: undefined): string;
encodeFunctionData(functionFragment: "enqueue", values: [BytesLike]): string;
encodeFunctionData(
functionFragment: "enqueueMany",
values: [BytesLike[]]
): string;
encodeFunctionData(
functionFragment: "initializeAgain",
values?: undefined
): string;
encodeFunctionData(functionFragment: "lastItem", values?: undefined): string;
encodeFunctionData(functionFragment: "length", values?: undefined): string;
encodeFunctionData(functionFragment: "peek", values?: undefined): string;
encodeFunctionData(
functionFragment: "queueContains",
values: [BytesLike]
): string;
encodeFunctionData(functionFragment: "queueEnd", values?: undefined): string;
encodeFunctionData(
functionFragment: "queueLength",
values?: undefined
): string;
decodeFunctionResult(functionFragment: "contains", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "dequeue", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "dequeueMany",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "drain", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "enqueue", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "enqueueMany",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "initializeAgain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "lastItem", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "length", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "peek", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "queueContains",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "queueEnd", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "queueLength",
data: BytesLike
): Result;
events: {};
}
export class TestQueue extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
listeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject>
): Array<TypedListener<EventArgsArray, EventArgsObject>>;
off<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
on<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
once<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeListener<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>
): this;
listeners(eventName?: string): Array<Listener>;
off(eventName: string, listener: Listener): this;
on(eventName: string, listener: Listener): this;
once(eventName: string, listener: Listener): this;
removeListener(eventName: string, listener: Listener): this;
removeAllListeners(eventName?: string): this;
queryFilter<EventArgsArray extends Array<any>, EventArgsObject>(
event: TypedEventFilter<EventArgsArray, EventArgsObject>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: TestQueueInterface;
functions: {
contains(_item: BytesLike, overrides?: CallOverrides): Promise<[boolean]>;
dequeue(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
dequeueMany(
_number: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
drain(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
enqueue(
_item: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
enqueueMany(
_items: BytesLike[],
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
initializeAgain(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
lastItem(overrides?: CallOverrides): Promise<[string]>;
length(overrides?: CallOverrides): Promise<[BigNumber]>;
peek(overrides?: CallOverrides): Promise<[string] & { _item: string }>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<[boolean]>;
queueEnd(overrides?: CallOverrides): Promise<[string]>;
queueLength(overrides?: CallOverrides): Promise<[BigNumber]>;
};
contains(_item: BytesLike, overrides?: CallOverrides): Promise<boolean>;
dequeue(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
dequeueMany(
_number: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
drain(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
enqueue(
_item: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
enqueueMany(
_items: BytesLike[],
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
initializeAgain(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
lastItem(overrides?: CallOverrides): Promise<string>;
length(overrides?: CallOverrides): Promise<BigNumber>;
peek(overrides?: CallOverrides): Promise<string>;
queueContains(_item: BytesLike, overrides?: CallOverrides): Promise<boolean>;
queueEnd(overrides?: CallOverrides): Promise<string>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
callStatic: {
contains(_item: BytesLike, overrides?: CallOverrides): Promise<boolean>;
dequeue(overrides?: CallOverrides): Promise<string>;
dequeueMany(
_number: BigNumberish,
overrides?: CallOverrides
): Promise<string[]>;
drain(overrides?: CallOverrides): Promise<void>;
enqueue(_item: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
enqueueMany(
_items: BytesLike[],
overrides?: CallOverrides
): Promise<BigNumber>;
initializeAgain(overrides?: CallOverrides): Promise<void>;
lastItem(overrides?: CallOverrides): Promise<string>;
length(overrides?: CallOverrides): Promise<BigNumber>;
peek(overrides?: CallOverrides): Promise<string>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
queueEnd(overrides?: CallOverrides): Promise<string>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
};
filters: {};
estimateGas: {
contains(_item: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
dequeue(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
dequeueMany(
_number: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
drain(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
enqueue(
_item: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
enqueueMany(
_items: BytesLike[],
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
initializeAgain(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
lastItem(overrides?: CallOverrides): Promise<BigNumber>;
length(overrides?: CallOverrides): Promise<BigNumber>;
peek(overrides?: CallOverrides): Promise<BigNumber>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<BigNumber>;
queueEnd(overrides?: CallOverrides): Promise<BigNumber>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
contains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
dequeue(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
dequeueMany(
_number: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
drain(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
enqueue(
_item: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
enqueueMany(
_items: BytesLike[],
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
initializeAgain(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
lastItem(overrides?: CallOverrides): Promise<PopulatedTransaction>;
length(overrides?: CallOverrides): Promise<PopulatedTransaction>;
peek(overrides?: CallOverrides): Promise<PopulatedTransaction>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
queueEnd(overrides?: CallOverrides): Promise<PopulatedTransaction>;
queueLength(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -1,575 +0,0 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import {
ethers,
EventFilter,
Signer,
BigNumber,
BigNumberish,
PopulatedTransaction,
BaseContract,
ContractTransaction,
Overrides,
CallOverrides,
} from "ethers";
import { BytesLike } from "@ethersproject/bytes";
import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface TestXAppConnectionManagerInterface extends ethers.utils.Interface {
functions: {
"domainToReplica(uint32)": FunctionFragment;
"home()": FunctionFragment;
"isReplica(address)": FunctionFragment;
"localDomain()": FunctionFragment;
"owner()": FunctionFragment;
"ownerEnrollReplica(address,uint32)": FunctionFragment;
"ownerUnenrollReplica(address)": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"replicaToDomain(address)": FunctionFragment;
"setHome(address)": FunctionFragment;
"setWatcherPermission(address,uint32,bool)": FunctionFragment;
"testRecoverWatcherFromSig(uint32,address,address,bytes)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"unenrollReplica(uint32,bytes32,bytes)": FunctionFragment;
"watcherPermission(address,uint32)": FunctionFragment;
};
encodeFunctionData(
functionFragment: "domainToReplica",
values: [BigNumberish]
): string;
encodeFunctionData(functionFragment: "home", values?: undefined): string;
encodeFunctionData(functionFragment: "isReplica", values: [string]): string;
encodeFunctionData(
functionFragment: "localDomain",
values?: undefined
): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(
functionFragment: "ownerEnrollReplica",
values: [string, BigNumberish]
): string;
encodeFunctionData(
functionFragment: "ownerUnenrollReplica",
values: [string]
): string;
encodeFunctionData(
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "replicaToDomain",
values: [string]
): string;
encodeFunctionData(functionFragment: "setHome", values: [string]): string;
encodeFunctionData(
functionFragment: "setWatcherPermission",
values: [string, BigNumberish, boolean]
): string;
encodeFunctionData(
functionFragment: "testRecoverWatcherFromSig",
values: [BigNumberish, string, string, BytesLike]
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(
functionFragment: "unenrollReplica",
values: [BigNumberish, BytesLike, BytesLike]
): string;
encodeFunctionData(
functionFragment: "watcherPermission",
values: [string, BigNumberish]
): string;
decodeFunctionResult(
functionFragment: "domainToReplica",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "home", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "isReplica", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "localDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "ownerEnrollReplica",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "ownerUnenrollReplica",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "replicaToDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setHome", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "setWatcherPermission",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "testRecoverWatcherFromSig",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "unenrollReplica",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "watcherPermission",
data: BytesLike
): Result;
events: {
"OwnershipTransferred(address,address)": EventFragment;
"ReplicaEnrolled(uint32,address)": EventFragment;
"ReplicaUnenrolled(uint32,address)": EventFragment;
"WatcherPermissionSet(uint32,address,bool)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ReplicaEnrolled"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ReplicaUnenrolled"): EventFragment;
getEvent(nameOrSignatureOrTopic: "WatcherPermissionSet"): EventFragment;
}
export class TestXAppConnectionManager extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
listeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject>
): Array<TypedListener<EventArgsArray, EventArgsObject>>;
off<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
on<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
once<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeListener<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>
): this;
listeners(eventName?: string): Array<Listener>;
off(eventName: string, listener: Listener): this;
on(eventName: string, listener: Listener): this;
once(eventName: string, listener: Listener): this;
removeListener(eventName: string, listener: Listener): this;
removeAllListeners(eventName?: string): this;
queryFilter<EventArgsArray extends Array<any>, EventArgsObject>(
event: TypedEventFilter<EventArgsArray, EventArgsObject>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: TestXAppConnectionManagerInterface;
functions: {
domainToReplica(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<[string]>;
home(overrides?: CallOverrides): Promise<[string]>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<[boolean]>;
localDomain(overrides?: CallOverrides): Promise<[number]>;
owner(overrides?: CallOverrides): Promise<[string]>;
ownerEnrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
ownerUnenrollReplica(
_replica: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
replicaToDomain(arg0: string, overrides?: CallOverrides): Promise<[number]>;
setHome(
_home: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setWatcherPermission(
_watcher: string,
_domain: BigNumberish,
_access: boolean,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
testRecoverWatcherFromSig(
_domain: BigNumberish,
_replica: string,
_updater: string,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<[string]>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
unenrollReplica(
_domain: BigNumberish,
_updater: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
watcherPermission(
_watcher: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<[boolean]>;
};
domainToReplica(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<string>;
home(overrides?: CallOverrides): Promise<string>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<boolean>;
localDomain(overrides?: CallOverrides): Promise<number>;
owner(overrides?: CallOverrides): Promise<string>;
ownerEnrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
ownerUnenrollReplica(
_replica: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
replicaToDomain(arg0: string, overrides?: CallOverrides): Promise<number>;
setHome(
_home: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setWatcherPermission(
_watcher: string,
_domain: BigNumberish,
_access: boolean,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
testRecoverWatcherFromSig(
_domain: BigNumberish,
_replica: string,
_updater: string,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<string>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
unenrollReplica(
_domain: BigNumberish,
_updater: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
watcherPermission(
_watcher: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<boolean>;
callStatic: {
domainToReplica(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<string>;
home(overrides?: CallOverrides): Promise<string>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<boolean>;
localDomain(overrides?: CallOverrides): Promise<number>;
owner(overrides?: CallOverrides): Promise<string>;
ownerEnrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<void>;
ownerUnenrollReplica(
_replica: string,
overrides?: CallOverrides
): Promise<void>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
replicaToDomain(arg0: string, overrides?: CallOverrides): Promise<number>;
setHome(_home: string, overrides?: CallOverrides): Promise<void>;
setWatcherPermission(
_watcher: string,
_domain: BigNumberish,
_access: boolean,
overrides?: CallOverrides
): Promise<void>;
testRecoverWatcherFromSig(
_domain: BigNumberish,
_replica: string,
_updater: string,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<string>;
transferOwnership(
newOwner: string,
overrides?: CallOverrides
): Promise<void>;
unenrollReplica(
_domain: BigNumberish,
_updater: BytesLike,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<void>;
watcherPermission(
_watcher: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<boolean>;
};
filters: {
OwnershipTransferred(
previousOwner?: string | null,
newOwner?: string | null
): TypedEventFilter<
[string, string],
{ previousOwner: string; newOwner: string }
>;
ReplicaEnrolled(
domain?: BigNumberish | null,
replica?: null
): TypedEventFilter<[number, string], { domain: number; replica: string }>;
ReplicaUnenrolled(
domain?: BigNumberish | null,
replica?: null
): TypedEventFilter<[number, string], { domain: number; replica: string }>;
WatcherPermissionSet(
domain?: BigNumberish | null,
watcher?: null,
access?: null
): TypedEventFilter<
[number, string, boolean],
{ domain: number; watcher: string; access: boolean }
>;
};
estimateGas: {
domainToReplica(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
home(overrides?: CallOverrides): Promise<BigNumber>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<BigNumber>;
localDomain(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<BigNumber>;
ownerEnrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
ownerUnenrollReplica(
_replica: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
replicaToDomain(
arg0: string,
overrides?: CallOverrides
): Promise<BigNumber>;
setHome(
_home: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
setWatcherPermission(
_watcher: string,
_domain: BigNumberish,
_access: boolean,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
testRecoverWatcherFromSig(
_domain: BigNumberish,
_replica: string,
_updater: string,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<BigNumber>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
unenrollReplica(
_domain: BigNumberish,
_updater: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
watcherPermission(
_watcher: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
};
populateTransaction: {
domainToReplica(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
home(overrides?: CallOverrides): Promise<PopulatedTransaction>;
isReplica(
_replica: string,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
ownerEnrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
ownerUnenrollReplica(
_replica: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
replicaToDomain(
arg0: string,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
setHome(
_home: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
setWatcherPermission(
_watcher: string,
_domain: BigNumberish,
_access: boolean,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
testRecoverWatcherFromSig(
_domain: BigNumberish,
_replica: string,
_updater: string,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
unenrollReplica(
_domain: BigNumberish,
_updater: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
watcherPermission(
_watcher: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
};
}

@ -1,276 +0,0 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import {
ethers,
EventFilter,
Signer,
BigNumber,
BigNumberish,
PopulatedTransaction,
BaseContract,
ContractTransaction,
Overrides,
CallOverrides,
} from "ethers";
import { BytesLike } from "@ethersproject/bytes";
import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface UpdaterManagerInterface extends ethers.utils.Interface {
functions: {
"owner()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"setHome(address)": FunctionFragment;
"setUpdater(address)": FunctionFragment;
"slashUpdater(address)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"updater()": FunctionFragment;
};
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(functionFragment: "setHome", values: [string]): string;
encodeFunctionData(functionFragment: "setUpdater", values: [string]): string;
encodeFunctionData(
functionFragment: "slashUpdater",
values: [string]
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(functionFragment: "updater", values?: undefined): string;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setHome", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "setUpdater", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "slashUpdater",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "updater", data: BytesLike): Result;
events: {
"FakeSlashed(address)": EventFragment;
"NewHome(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "FakeSlashed"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewHome"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
}
export class UpdaterManager extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
listeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject>
): Array<TypedListener<EventArgsArray, EventArgsObject>>;
off<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
on<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
once<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeListener<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>
): this;
listeners(eventName?: string): Array<Listener>;
off(eventName: string, listener: Listener): this;
on(eventName: string, listener: Listener): this;
once(eventName: string, listener: Listener): this;
removeListener(eventName: string, listener: Listener): this;
removeAllListeners(eventName?: string): this;
queryFilter<EventArgsArray extends Array<any>, EventArgsObject>(
event: TypedEventFilter<EventArgsArray, EventArgsObject>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: UpdaterManagerInterface;
functions: {
owner(overrides?: CallOverrides): Promise<[string]>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setHome(
_home: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setUpdater(
_updaterAddress: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
slashUpdater(
_reporter: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<[string]>;
};
owner(overrides?: CallOverrides): Promise<string>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setHome(
_home: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setUpdater(
_updaterAddress: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
slashUpdater(
_reporter: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<string>;
callStatic: {
owner(overrides?: CallOverrides): Promise<string>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
setHome(_home: string, overrides?: CallOverrides): Promise<void>;
setUpdater(
_updaterAddress: string,
overrides?: CallOverrides
): Promise<void>;
slashUpdater(_reporter: string, overrides?: CallOverrides): Promise<void>;
transferOwnership(
newOwner: string,
overrides?: CallOverrides
): Promise<void>;
updater(overrides?: CallOverrides): Promise<string>;
};
filters: {
FakeSlashed(
reporter?: null
): TypedEventFilter<[string], { reporter: string }>;
NewHome(home?: null): TypedEventFilter<[string], { home: string }>;
OwnershipTransferred(
previousOwner?: string | null,
newOwner?: string | null
): TypedEventFilter<
[string, string],
{ previousOwner: string; newOwner: string }
>;
};
estimateGas: {
owner(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
setHome(
_home: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
setUpdater(
_updaterAddress: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
slashUpdater(
_reporter: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
updater(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
setHome(
_home: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
setUpdater(
_updaterAddress: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
slashUpdater(
_reporter: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
updater(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -146,7 +146,7 @@ export class ValidatorManager extends BaseContract {
): Promise<[string]>;
improperCheckpoint(
_home: string,
_outbox: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
@ -187,7 +187,7 @@ export class ValidatorManager extends BaseContract {
domainHash(_domain: BigNumberish, overrides?: CallOverrides): Promise<string>;
improperCheckpoint(
_home: string,
_outbox: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
@ -228,7 +228,7 @@ export class ValidatorManager extends BaseContract {
): Promise<string>;
improperCheckpoint(
_home: string,
_outbox: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
@ -263,7 +263,7 @@ export class ValidatorManager extends BaseContract {
filters: {
ImproperCheckpoint(
home?: string | null,
outbox?: string | null,
domain?: BigNumberish | null,
validator?: string | null,
root?: null,
@ -272,7 +272,7 @@ export class ValidatorManager extends BaseContract {
): TypedEventFilter<
[string, number, string, string, BigNumber, string],
{
home: string;
outbox: string;
domain: number;
validator: string;
root: string;
@ -305,7 +305,7 @@ export class ValidatorManager extends BaseContract {
): Promise<BigNumber>;
improperCheckpoint(
_home: string,
_outbox: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
@ -350,7 +350,7 @@ export class ValidatorManager extends BaseContract {
): Promise<PopulatedTransaction>;
improperCheckpoint(
_home: string,
_outbox: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save