Low cost relay model contract implementation (#165)

pull/177/head
Asa Oines 3 years ago committed by GitHub
parent 472aedfddb
commit d1de95e81b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      package-lock.json
  2. 195
      solidity/abacus-core/contracts/Common.sol
  3. 251
      solidity/abacus-core/contracts/Home.sol
  4. 54
      solidity/abacus-core/contracts/Queue.sol
  5. 146
      solidity/abacus-core/contracts/Replica.sol
  6. 104
      solidity/abacus-core/contracts/UpdaterManager.sol
  7. 131
      solidity/abacus-core/contracts/ValidatorManager.sol
  8. 121
      solidity/abacus-core/contracts/XAppConnectionManager.sol
  9. 25
      solidity/abacus-core/contracts/test/TestCommon.sol
  10. 10
      solidity/abacus-core/contracts/test/TestHome.sol
  11. 2
      solidity/abacus-core/contracts/test/TestMessage.sol
  12. 61
      solidity/abacus-core/contracts/test/TestQueue.sol
  13. 9
      solidity/abacus-core/contracts/test/TestReplica.sol
  14. 24
      solidity/abacus-core/contracts/test/TestXAppConnectionManager.sol
  15. 8
      solidity/abacus-core/interfaces/IUpdaterManager.sol
  16. 11
      solidity/abacus-core/interfaces/IValidatorManager.sol
  17. 166
      solidity/abacus-core/libs/Queue.sol
  18. 133
      solidity/abacus-core/test/common.test.ts
  19. 75
      solidity/abacus-core/test/cross-chain/governanceRouter.test.ts
  20. 38
      solidity/abacus-core/test/cross-chain/recoveryManager.test.ts
  21. 76
      solidity/abacus-core/test/cross-chain/simpleMessage.test.ts
  22. 105
      solidity/abacus-core/test/cross-chain/utils.ts
  23. 188
      solidity/abacus-core/test/home.test.ts
  24. 84
      solidity/abacus-core/test/lib/AbacusDeployment.ts
  25. 48
      solidity/abacus-core/test/lib/core.ts
  26. 18
      solidity/abacus-core/test/lib/types.ts
  27. 73
      solidity/abacus-core/test/queue.test.ts
  28. 204
      solidity/abacus-core/test/replica.test.ts
  29. 149
      solidity/abacus-core/test/validatorManager.test.ts
  30. 199
      solidity/abacus-core/test/xAppConnectionManager.test.ts
  31. 273
      solidity/abacus-core/typechain/Common.d.ts
  32. 491
      solidity/abacus-core/typechain/Home.d.ts
  33. 76
      solidity/abacus-core/typechain/IValidatorManager.d.ts
  34. 246
      solidity/abacus-core/typechain/MerkleLib.d.ts
  35. 368
      solidity/abacus-core/typechain/Replica.d.ts
  36. 300
      solidity/abacus-core/typechain/TestCommon.d.ts
  37. 518
      solidity/abacus-core/typechain/TestHome.d.ts
  38. 363
      solidity/abacus-core/typechain/TestQueue.d.ts
  39. 408
      solidity/abacus-core/typechain/TestReplica.d.ts
  40. 575
      solidity/abacus-core/typechain/TestXAppConnectionManager.d.ts
  41. 260
      solidity/abacus-core/typechain/ValidatorManager.d.ts
  42. 237
      solidity/abacus-core/typechain/XAppConnectionManager.d.ts
  43. 135
      solidity/abacus-core/typechain/factories/Common__factory.ts
  44. 2
      solidity/abacus-core/typechain/factories/GovernanceRouter__factory.ts
  45. 365
      solidity/abacus-core/typechain/factories/Home__factory.ts
  46. 52
      solidity/abacus-core/typechain/factories/IUpdaterManager__factory.ts
  47. 60
      solidity/abacus-core/typechain/factories/IValidatorManager__factory.ts
  48. 60
      solidity/abacus-core/typechain/factories/MerkleLib__factory.ts
  49. 92
      solidity/abacus-core/typechain/factories/QueueManager__factory.ts
  50. 204
      solidity/abacus-core/typechain/factories/Replica__factory.ts
  51. 173
      solidity/abacus-core/typechain/factories/TestCommon__factory.ts
  52. 2
      solidity/abacus-core/typechain/factories/TestGovernanceRouter__factory.ts
  53. 373
      solidity/abacus-core/typechain/factories/TestHome__factory.ts
  54. 2
      solidity/abacus-core/typechain/factories/TestMessage__factory.ts
  55. 239
      solidity/abacus-core/typechain/factories/TestQueue__factory.ts
  56. 222
      solidity/abacus-core/typechain/factories/TestReplica__factory.ts
  57. 405
      solidity/abacus-core/typechain/factories/TestXAppConnectionManager__factory.ts
  58. 202
      solidity/abacus-core/typechain/factories/UpdaterManager__factory.ts
  59. 293
      solidity/abacus-core/typechain/factories/ValidatorManager__factory.ts
  60. 148
      solidity/abacus-core/typechain/factories/XAppConnectionManager__factory.ts
  61. 24
      solidity/abacus-core/typechain/hardhat.d.ts
  62. 14
      solidity/abacus-core/typechain/index.ts
  63. 2
      solidity/abacus-xapps/test/bridge.test.ts
  64. 273
      solidity/abacus-xapps/typechain/Common.d.ts
  65. 491
      solidity/abacus-xapps/typechain/Home.d.ts
  66. 82
      solidity/abacus-xapps/typechain/IValidatorManager.d.ts
  67. 368
      solidity/abacus-xapps/typechain/Replica.d.ts
  68. 237
      solidity/abacus-xapps/typechain/XAppConnectionManager.d.ts
  69. 2
      solidity/abacus-xapps/typechain/factories/BridgeRouter__factory.ts
  70. 2
      solidity/abacus-xapps/typechain/factories/BridgeToken__factory.ts
  71. 135
      solidity/abacus-xapps/typechain/factories/Common__factory.ts
  72. 2
      solidity/abacus-xapps/typechain/factories/ETHHelper__factory.ts
  73. 365
      solidity/abacus-xapps/typechain/factories/Home__factory.ts
  74. 60
      solidity/abacus-xapps/typechain/factories/IValidatorManager__factory.ts
  75. 2
      solidity/abacus-xapps/typechain/factories/MockWeth__factory.ts
  76. 204
      solidity/abacus-xapps/typechain/factories/Replica__factory.ts
  77. 2
      solidity/abacus-xapps/typechain/factories/RouterTemplate__factory.ts
  78. 148
      solidity/abacus-xapps/typechain/factories/XAppConnectionManager__factory.ts
  79. 8
      solidity/abacus-xapps/typechain/hardhat.d.ts
  80. 6
      solidity/abacus-xapps/typechain/index.ts
  81. 25
      typescript/abacus-deploy/config/environments/dev/core.ts
  82. 13
      typescript/abacus-deploy/config/environments/mainnet/core.ts
  83. 13
      typescript/abacus-deploy/config/environments/testnet-legacy/core.ts
  84. 13
      typescript/abacus-deploy/config/environments/testnet/core.ts
  85. 2
      typescript/abacus-deploy/config/networks/mainnets/avalanche.ts
  86. 4
      typescript/abacus-deploy/config/networks/mainnets/celo.ts
  87. 2
      typescript/abacus-deploy/config/networks/mainnets/ethereum.ts
  88. 2
      typescript/abacus-deploy/config/networks/mainnets/polygon.ts
  89. 5
      typescript/abacus-deploy/scripts/set-updater.ts
  90. 22
      typescript/abacus-deploy/src/agents.ts
  91. 29
      typescript/abacus-deploy/src/checks.ts
  92. 5
      typescript/abacus-deploy/src/config/addresses.ts
  93. 20
      typescript/abacus-deploy/src/config/chain.ts
  94. 1
      typescript/abacus-deploy/src/config/core.ts
  95. 8
      typescript/abacus-deploy/src/core/CoreContracts.ts
  96. 11
      typescript/abacus-deploy/src/core/CoreDeploy.ts
  97. 81
      typescript/abacus-deploy/src/core/checks.ts
  98. 34
      typescript/abacus-deploy/src/core/govern.ts
  99. 179
      typescript/abacus-deploy/src/core/index.ts
  100. 4
      typescript/abacus-deploy/src/deploy.ts
  101. Some files were not shown because too many files have changed in this diff Show More

2
package-lock.json generated

@ -26332,7 +26332,7 @@
"dotenv": "^10.0.0",
"ethereum-waffle": "^3.2.2",
"ethers": "^5.4.7",
"hardhat": "^2.8.3",
"hardhat": "^2.8.4",
"prettier": "^2.3.1",
"ts-node": "^10.1.0",
"typechain": "^5.0.0",

@ -2,31 +2,17 @@
pragma solidity >=0.6.11;
// ============ Internal Imports ============
import {Message} from "../libs/Message.sol";
import {IValidatorManager} from "../interfaces/IValidatorManager.sol";
// ============ External Imports ============
import {ECDSA} from "@openzeppelin/contracts/cryptography/ECDSA.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
/**
* @title Common
* @author Celo Labs Inc.
* @notice Shared utilities between Home and Replica.
*/
abstract contract Common is Initializable {
// ============ Enums ============
// States:
// 0 - UnInitialized - before initialize function is called
// note: the contract is initialized at deploy time, so it should never be in this state
// 1 - Active - as long as the contract has not become fraudulent
// 2 - Failed - after a valid fraud proof has been submitted;
// contract will no longer accept updates or new messages
enum States {
UnInitialized,
Active,
Failed
}
abstract contract Common is OwnableUpgradeable {
// ============ Immutable Variables ============
// Domain of chain on which the contract is deployed
@ -34,12 +20,12 @@ abstract contract Common is Initializable {
// ============ Public Variables ============
// Address of bonded Updater
address public updater;
// Current state of contract
States public state;
// The latest root that has been signed by the Updater
bytes32 public committedRoot;
// Checkpoints of root => leaf index
mapping(bytes32 => uint256) public checkpoints;
// The latest checkpointed root
bytes32 public checkpointedRoot;
// Address of ValidatorManager contract.
IValidatorManager public validatorManager;
// ============ Upgrade Gap ============
@ -49,51 +35,21 @@ abstract contract Common is Initializable {
// ============ Events ============
/**
* @notice Emitted when update is made on Home
* or unconfirmed update root is submitted on Replica
* @param homeDomain Domain of home contract
* @param oldRoot Old merkle root
* @param newRoot New merkle root
* @param signature Updater's signature on `oldRoot` and `newRoot`
*/
event Update(
uint32 indexed homeDomain,
bytes32 indexed oldRoot,
bytes32 indexed newRoot,
bytes signature
);
/**
* @notice Emitted when proof of a double update is submitted,
* which sets the contract to FAILED state
* @param oldRoot Old root shared between two conflicting updates
* @param newRoot Array containing two conflicting new roots
* @param signature Signature on `oldRoot` and `newRoot`[0]
* @param signature2 Signature on `oldRoot` and `newRoot`[1]
* @notice Emitted when a root is checkpointed on Home or a signed
* checkpoint is relayed to a Replica.
* @param root Merkle root
* @param index Leaf index
*/
event DoubleUpdate(
bytes32 oldRoot,
bytes32[2] newRoot,
bytes signature,
bytes signature2
);
event Checkpoint(bytes32 indexed root, uint256 indexed index);
/**
* @notice Emitted when Updater is rotated
* @param updater The address of the new updater
* @notice Emitted when the ValidatorManager contract is changed
* @param validatorManager The address of the new validatorManager
*/
event NewUpdater(address updater);
event NewValidatorManager(address validatorManager);
// ============ Modifiers ============
/**
* @notice Ensures that contract state != FAILED when the function is called
*/
modifier notFailed() {
require(state != States.Failed, "failed state");
_;
}
// ============ Constructor ============
constructor(uint32 _localDomain) {
@ -102,102 +58,67 @@ abstract contract Common is Initializable {
// ============ Initializer ============
function __Common_initialize(address _updater) internal initializer {
updater = _updater;
state = States.Active;
function __Common_initialize(address _validatorManager)
internal
initializer
{
// initialize owner
__Ownable_init();
_setValidatorManager(IValidatorManager(_validatorManager));
}
// ============ External Functions ============
/**
* @notice Called by external agent. Checks that signatures on two sets of
* roots are valid and that the new roots conflict with each other. If both
* cases hold true, the contract is failed and a `DoubleUpdate` event is
* emitted.
* @dev When `fail()` is called on Home, updater is slashed.
* @param _oldRoot Old root shared between two conflicting updates
* @param _newRoot Array containing two conflicting new roots
* @param _signature Signature on `_oldRoot` and `_newRoot`[0]
* @param _signature2 Signature on `_oldRoot` and `_newRoot`[1]
* @notice Set a new ValidatorManager contract
* @dev Home(s) 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
*/
function doubleUpdate(
bytes32 _oldRoot,
bytes32[2] calldata _newRoot,
bytes calldata _signature,
bytes calldata _signature2
) external notFailed {
if (
Common._isUpdaterSignature(_oldRoot, _newRoot[0], _signature) &&
Common._isUpdaterSignature(_oldRoot, _newRoot[1], _signature2) &&
_newRoot[0] != _newRoot[1]
) {
_fail();
emit DoubleUpdate(_oldRoot, _newRoot, _signature, _signature2);
}
function setValidatorManager(address _validatorManager) external onlyOwner {
_setValidatorManager(IValidatorManager(_validatorManager));
}
// ============ Public Functions ============
/**
* @notice Hash of Home domain concatenated with "OPTICS"
* @notice Returns the latest checkpoint for the Validators to sign.
* @return root Latest checkpointed root
* @return index Latest checkpointed index
*/
function homeDomainHash() public view virtual returns (bytes32);
function latestCheckpoint()
external
view
returns (bytes32 root, uint256 index)
{
root = checkpointedRoot;
index = checkpoints[root];
}
// ============ Internal Functions ============
/**
* @notice Hash of Home domain concatenated with "OPTICS"
* @param _homeDomain the Home domain to hash
* @notice Set the ValidatorManager
* @param _validatorManager Address of the ValidatorManager
*/
function _homeDomainHash(uint32 _homeDomain)
function _setValidatorManager(IValidatorManager _validatorManager)
internal
pure
returns (bytes32)
{
return keccak256(abi.encodePacked(_homeDomain, "OPTICS"));
}
/**
* @notice Set contract state to FAILED
* @dev Called when a valid fraud proof is submitted
*/
function _setFailed() internal {
state = States.Failed;
}
/**
* @notice Moves the contract into failed state
* @dev Called when fraud is proven
* (Double Update is submitted on Home or Replica,
* or Improper Update is submitted on Home)
*/
function _fail() internal virtual;
/**
* @notice Checks that signature was signed by Updater
* @param _oldRoot Old merkle root
* @param _newRoot New merkle root
* @param _signature Signature on `_oldRoot` and `_newRoot`
* @return TRUE iff signature is valid signed by updater
**/
function _isUpdaterSignature(
bytes32 _oldRoot,
bytes32 _newRoot,
bytes memory _signature
) internal view returns (bool) {
bytes32 _digest = keccak256(
abi.encodePacked(homeDomainHash(), _oldRoot, _newRoot)
require(
Address.isContract(address(_validatorManager)),
"!contract validatorManager"
);
_digest = ECDSA.toEthSignedMessageHash(_digest);
return (ECDSA.recover(_digest, _signature) == updater);
validatorManager = _validatorManager;
emit NewValidatorManager(address(_validatorManager));
}
/**
* @notice Set the Updater
* @param _updater Address of the Updater
* @notice Store the provided checkpoint.
* @param _root The merkle root
* @param _index The next available leaf index of the merkle tree.
*/
function _setUpdater(address _updater) internal {
updater = _updater;
emit NewUpdater(_updater);
function _checkpoint(bytes32 _root, uint256 _index) internal {
checkpoints[_root] = _index;
checkpointedRoot = _root;
emit Checkpoint(_root, _index);
}
}

@ -4,36 +4,23 @@ pragma solidity >=0.6.11;
// ============ Internal Imports ============
import {Version0} from "./Version0.sol";
import {Common} from "./Common.sol";
import {QueueLib} from "../libs/Queue.sol";
import {MerkleLib} from "../libs/Merkle.sol";
import {Message} from "../libs/Message.sol";
import {MerkleTreeManager} from "./Merkle.sol";
import {QueueManager} from "./Queue.sol";
import {IUpdaterManager} from "../interfaces/IUpdaterManager.sol";
// ============ External Imports ============
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
/**
* @title Home
* @author Celo Labs Inc.
* @notice Accepts messages to be dispatched to remote chains,
* constructs a Merkle tree of the messages,
* and accepts signatures from a bonded Updater
* and accepts signatures from a bonded Validator
* which notarize the Merkle tree roots.
* Accepts submissions of fraudulent signatures
* by the Updater and slashes the Updater in this case.
* by the Validator and slashes the Validator in this case.
*/
contract Home is
Version0,
QueueManager,
MerkleTreeManager,
Common,
OwnableUpgradeable
{
contract Home is Version0, MerkleTreeManager, Common {
// ============ Libraries ============
using QueueLib for QueueLib.Queue;
using MerkleLib for MerkleLib.Tree;
// ============ Constants ============
@ -42,12 +29,26 @@ contract Home is
// (somewhat arbitrarily set to begin)
uint256 public constant MAX_MESSAGE_BODY_BYTES = 2 * 2**10;
// ============ Enums ============
// States:
// 0 - UnInitialized - before initialize function is called
// note: the contract is initialized at deploy time, so it should never be in this state
// 1 - Active - as long as the contract has not become fraudulent
// 2 - Failed - after a valid fraud proof has been submitted;
// contract will no longer accept updates or new messages
enum States {
UnInitialized,
Active,
Failed
}
// ============ Public Storage Variables ============
// Current state of contract
States public state;
// domain => next available nonce for the domain
mapping(uint32 => uint32) public nonces;
// contract responsible for Updater bonding, slashing and rotation
IUpdaterManager public updaterManager;
// ============ Upgrade Gap ============
@ -58,43 +59,23 @@ contract Home is
/**
* @notice Emitted when a new message is dispatched via Abacus
* @param messageHash Hash of message; the leaf inserted to the Merkle tree for the message
* @param leafIndex Index of message's leaf in merkle tree
* @param destinationAndNonce Destination and destination-specific
* nonce combined in single field ((destination << 32) & nonce)
* @param messageHash Hash of message; the leaf inserted to the Merkle tree for the message
* @param committedRoot the latest notarized root submitted in the last signed Update
* @param checkpointedRoot the latest checkpointed root
* @param message Raw bytes of message
*/
event Dispatch(
bytes32 indexed messageHash,
uint256 indexed leafIndex,
uint64 indexed destinationAndNonce,
bytes32 committedRoot,
// Remove checkpointedRoot.
bytes32 checkpointedRoot,
bytes message
);
/**
* @notice Emitted when proof of an improper update is submitted,
* which sets the contract to FAILED state
* @param oldRoot Old root of the improper update
* @param newRoot New root of the improper update
* @param signature Signature on `oldRoot` and `newRoot
*/
event ImproperUpdate(bytes32 oldRoot, bytes32 newRoot, bytes signature);
/**
* @notice Emitted when the Updater is slashed
* (should be paired with ImproperUpdater or DoubleUpdate event)
* @param updater The address of the updater
* @param reporter The address of the entity that reported the updater misbehavior
*/
event UpdaterSlashed(address indexed updater, address indexed reporter);
/**
* @notice Emitted when the UpdaterManager contract is changed
* @param updaterManager The address of the new updaterManager
*/
event NewUpdaterManager(address updaterManager);
event Fail();
// ============ Constructor ============
@ -102,46 +83,27 @@ contract Home is
// ============ Initializer ============
function initialize(IUpdaterManager _updaterManager) public initializer {
// initialize owner & queue
__Ownable_init();
__QueueManager_initialize();
// set Updater Manager contract and initialize Updater
_setUpdaterManager(_updaterManager);
address _updater = updaterManager.updater();
__Common_initialize(_updater);
emit NewUpdater(_updater);
function initialize(address _validatorManager) public initializer {
__Common_initialize(_validatorManager);
state = States.Active;
}
// ============ Modifiers ============
/**
* @notice Ensures that function is called by the UpdaterManager contract
* @notice Ensures that contract state != FAILED when the function is called
*/
modifier onlyUpdaterManager() {
require(msg.sender == address(updaterManager), "!updaterManager");
modifier notFailed() {
require(state != States.Failed, "failed state");
_;
}
// ============ External: Updater & UpdaterManager Configuration ============
/**
* @notice Set a new Updater
* @param _updater the new Updater
*/
function setUpdater(address _updater) external onlyUpdaterManager {
_setUpdater(_updater);
}
/**
* @notice Set a new UpdaterManager contract
* @dev Home(s) will initially be initialized using a trusted UpdaterManager contract;
* we will progressively decentralize by swapping the trusted contract with a new implementation
* that implements Updater bonding & slashing, and rules for Updater selection & rotation
* @param _updaterManager the new UpdaterManager contract
* @notice Ensures that function is called by the ValidatorManager contract
*/
function setUpdaterManager(address _updaterManager) external onlyOwner {
_setUpdaterManager(IUpdaterManager(_updaterManager));
modifier onlyValidatorManager() {
require(msg.sender == address(validatorManager), "!validatorManager");
_;
}
// ============ External Functions ============
@ -149,7 +111,7 @@ contract Home is
/**
* @notice Dispatch the message it to the destination domain & recipient
* @dev Format the message, insert its hash into Merkle tree,
* enqueue the new Merkle root, and emit `Dispatch` event with message information.
* and emit `Dispatch` event with message information.
* @param _destinationDomain Domain of destination chain
* @param _recipientAddress Address of recipient on destination chain as bytes32
* @param _messageBody Raw bytes content of message
@ -175,153 +137,42 @@ contract Home is
// insert the hashed message into the Merkle tree
bytes32 _messageHash = keccak256(_message);
tree.insert(_messageHash);
// enqueue the new Merkle root after inserting the message
queue.enqueue(root());
// Emit Dispatch event with message information
// note: leafIndex is count() - 1 since new leaf has already been inserted
emit Dispatch(
_messageHash,
count() - 1,
_destinationAndNonce(_destinationDomain, _nonce),
committedRoot,
checkpointedRoot,
_message
);
}
/**
* @notice Submit a signature from the Updater "notarizing" a root,
* which updates the Home contract's `committedRoot`,
* and publishes the signature which will be relayed to Replica contracts
* @dev emits Update event
* @dev If _newRoot is not contained in the queue,
* the Update is a fraudulent Improper Update, so
* the Updater is slashed & Home is set to FAILED state
* @param _committedRoot Current updated merkle root which the update is building off of
* @param _newRoot New merkle root to update the contract state to
* @param _signature Updater signature on `_committedRoot` and `_newRoot`
* @notice Checkpoints the latest root and index.
* Validators are expected to sign this checkpoint so that it can be
* relayed to the Replica contracts.
* @dev emits Checkpoint event
*/
function update(
bytes32 _committedRoot,
bytes32 _newRoot,
bytes memory _signature
) external notFailed {
// check that the update is not fraudulent;
// if fraud is detected, Updater is slashed & Home is set to FAILED state
// Opportunity for gas savings, we iterate through the queue twice.
if (improperUpdate(_committedRoot, _newRoot, _signature)) return;
// clear all of the intermediate roots contained in this update from the queue
while (true) {
bytes32 _next = queue.dequeue();
if (_next == _newRoot) break;
}
// update the Home state with the latest signed root & emit event
committedRoot = _newRoot;
emit Update(localDomain, _committedRoot, _newRoot, _signature);
function checkpoint() external notFailed {
uint256 count = count();
require(count > 0, "!count");
bytes32 root = root();
_checkpoint(root, count);
}
/**
* @notice Suggest an update for the Updater to sign and submit.
* @dev If queue is empty, null bytes returned for both
* (No update is necessary because no messages have been dispatched since the last update)
* @return _committedRoot Latest root signed by the Updater
* @return _new Latest enqueued Merkle root
* @notice Set contract state to FAILED.
* @dev Called by the ValidatorManager when fraud is proven.
*/
function suggestUpdate()
external
view
returns (bytes32 _committedRoot, bytes32 _new)
{
if (queue.length() != 0) {
_committedRoot = committedRoot;
_new = queue.lastItem();
}
}
// ============ Public Functions ============
/**
* @notice Hash of Home domain concatenated with "OPTICS"
*/
function homeDomainHash() public view override returns (bytes32) {
return _homeDomainHash(localDomain);
}
/**
* @notice Check if an Update is an Improper Update;
* if so, slash the Updater and set the contract to FAILED state.
*
* An Improper Update is an update building off of the Home's `committedRoot`
* for which the `_newRoot` does not currently exist in the Home's queue.
* This would mean that message(s) that were not truly
* dispatched on Home were falsely included in the signed root.
*
* An Improper Update will only be accepted as valid by the Replica
* If an Improper Update is attempted on Home,
* the Updater will be slashed immediately.
* If an Improper Update is submitted to the Replica,
* it should be relayed to the Home contract using this function
* in order to slash the Updater with an Improper Update.
*
* An Improper Update submitted to the Replica is only valid
* while the `_oldRoot` is still equal to the `committedRoot` on Home;
* if the `committedRoot` on Home has already been updated with a valid Update,
* then the Updater should be slashed with a Double Update.
* @dev Reverts (and doesn't slash updater) if signature is invalid or
* update not current
* @param _oldRoot Old merkle tree root (should equal home's committedRoot)
* @param _newRoot New merkle tree root
* @param _signature Updater signature on `_oldRoot` and `_newRoot`
* @return TRUE if update was an Improper Update (implying Updater was slashed)
*/
function improperUpdate(
bytes32 _oldRoot,
bytes32 _newRoot,
bytes memory _signature
) public notFailed returns (bool) {
require(
_isUpdaterSignature(_oldRoot, _newRoot, _signature),
"!updater sig"
);
require(_oldRoot == committedRoot, "not a current update");
// if the _newRoot is not currently contained in the queue,
// slash the Updater and set the contract to FAILED state
if (!queue.contains(_newRoot)) {
_fail();
emit ImproperUpdate(_oldRoot, _newRoot, _signature);
return true;
}
// if the _newRoot is contained in the queue,
// this is not an improper update
return false;
function fail() external onlyValidatorManager {
// set contract to FAILED
state = States.Failed;
emit Fail();
}
// ============ Internal Functions ============
/**
* @notice Set the UpdaterManager
* @param _updaterManager Address of the UpdaterManager
*/
function _setUpdaterManager(IUpdaterManager _updaterManager) internal {
require(
Address.isContract(address(_updaterManager)),
"!contract updaterManager"
);
updaterManager = IUpdaterManager(_updaterManager);
emit NewUpdaterManager(address(_updaterManager));
}
/**
* @notice Slash the Updater and set contract state to FAILED
* @dev Called when fraud is proven (Improper Update or Double Update)
*/
function _fail() internal override {
// set contract to FAILED
_setFailed();
// slash Updater
updaterManager.slashUpdater(msg.sender);
emit UpdaterSlashed(updater, msg.sender);
}
/**
* @notice Internal utility function that combines
* `_destination` and `_nonce`.

@ -1,54 +0,0 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
// ============ Internal Imports ============
import {QueueLib} from "../libs/Queue.sol";
// ============ External Imports ============
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
/**
* @title QueueManager
* @author Celo Labs Inc.
* @notice Contains a queue instance and
* exposes view functions for the queue.
**/
contract QueueManager is Initializable {
// ============ Libraries ============
using QueueLib for QueueLib.Queue;
QueueLib.Queue internal queue;
// ============ Upgrade Gap ============
// gap for upgrade safety
uint256[49] private __GAP;
// ============ Initializer ============
function __QueueManager_initialize() internal initializer {
queue.initialize();
}
// ============ Public Functions ============
/**
* @notice Returns number of elements in queue
*/
function queueLength() external view returns (uint256) {
return queue.length();
}
/**
* @notice Returns TRUE iff `_item` is in the queue
*/
function queueContains(bytes32 _item) external view returns (bool) {
return queue.contains(_item);
}
/**
* @notice Returns last item enqueued to the queue
*/
function queueEnd() external view returns (bytes32) {
return queue.lastItem();
}
}

@ -47,29 +47,18 @@ contract Replica is Version0, Common {
// Domain of home chain
uint32 public remoteDomain;
// Number of seconds to wait before root becomes confirmable
uint256 public optimisticSeconds;
// re-entrancy guard
uint8 private entered;
// Mapping of roots to allowable confirmation times
mapping(bytes32 => uint256) public confirmAt;
// Mapping of message leaves to MessageStatus
mapping(bytes32 => MessageStatus) public messages;
// address responsible for Updater rotation
address private _owner;
// ============ Upgrade Gap ============
// gap for upgrade safety
uint256[44] private __GAP;
uint256[47] private __GAP;
// ============ Events ============
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @notice Emitted when message is processed
* @param messageHash Hash of message that failed to process
@ -100,71 +89,43 @@ contract Replica is Version0, Common {
function initialize(
uint32 _remoteDomain,
address _updater,
bytes32 _committedRoot,
uint256 _optimisticSeconds
address _validatorManager,
bytes32 _checkpointedRoot,
uint256 _checkpointedIndex
) public initializer {
__Common_initialize(_updater);
__Common_initialize(_validatorManager);
entered = 1;
remoteDomain = _remoteDomain;
committedRoot = _committedRoot;
confirmAt[_committedRoot] = 1;
optimisticSeconds = _optimisticSeconds;
transferOwnership(msg.sender);
}
// ============ Modifiers ============
/**
* @notice Ensures that function is called by the owner
* @dev NOTE THAT WHEN OWNER IS THE NULL ADDRESS ANYONE CAN CALL ONLYOWNER
* FUNCTIONS. This is to allow the owner to be set post-facto. As such,
* renouncing ownership to the null address is unsafe and disabled.
*/
modifier onlyOwner() {
bool ok = msg.sender == owner() || owner() == address(0);
require(ok, "!owner");
_;
_checkpoint(_checkpointedRoot, _checkpointedIndex);
}
// ============ External Functions ============
/**
* @notice Set a new Updater
* @param _updater the new Updater
*/
function setUpdater(address _updater) external onlyOwner {
_setUpdater(_updater);
}
/**
* @notice Called by external agent. Submits the signed update's new root,
* marks root's allowable confirmation time, and emits an `Update` event.
* @dev Reverts if update doesn't build off latest committedRoot
* or if signature is invalid.
* @param _oldRoot Old merkle root
* @param _newRoot New merkle root
* @param _signature Updater's signature on `_oldRoot` and `_newRoot`
* @notice Checkpoints the provided root and index given a signature.
* @dev Reverts if checkpoints's index is not greater than our latest index.
* @param _root Checkpoint's merkle root
* @param _index Checkpoint's index
* @param _signature Validator's signature on `_root` and `_index`
*/
function update(
bytes32 _oldRoot,
bytes32 _newRoot,
function checkpoint(
bytes32 _root,
uint256 _index,
bytes memory _signature
) external notFailed {
// ensure that update is building off the last submitted root
require(_oldRoot == committedRoot, "not current update");
// validate updater signature
) external {
// ensure that update is more recent than the latest we've seen
require(_index > checkpoints[checkpointedRoot], "old checkpoint");
// validate validator signature
require(
_isUpdaterSignature(_oldRoot, _newRoot, _signature),
"!updater sig"
validatorManager.isValidatorSignature(
remoteDomain,
_root,
_index,
_signature
),
"!validator sig"
);
// Hook for future use
_beforeUpdate();
// set the new root's confirmation timer
confirmAt[_newRoot] = block.timestamp + optimisticSeconds;
// update committedRoot
committedRoot = _newRoot;
emit Update(remoteDomain, _oldRoot, _newRoot, _signature);
_checkpoint(_root, _index);
}
/**
@ -187,23 +148,6 @@ contract Replica is Version0, Common {
// ============ Public Functions ============
/**
* @notice Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "!newOwner");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
/**
* @notice Given formatted message, attempts to dispatch
* message payload to end recipient.
@ -278,21 +222,6 @@ contract Replica is Version0, Common {
entered = 1;
}
/**
* @notice Check that the root has been submitted
* and that the optimistic timeout period has expired,
* meaning the root can be processed
* @param _root the Merkle root, submitted in an update, to check
* @return TRUE iff root has been submitted & timeout has expired
*/
function acceptableRoot(bytes32 _root) public view returns (bool) {
uint256 _time = confirmAt[_root];
if (_time == 0) {
return false;
}
return block.timestamp >= _time;
}
/**
* @notice Attempts to prove the validity of message given its leaf, the
* merkle proof of inclusion for the leaf, and the index of the leaf.
@ -315,31 +244,10 @@ contract Replica is Version0, Common {
// calculate the expected root based on the proof
bytes32 _calculatedRoot = MerkleLib.branchRoot(_leaf, _proof, _index);
// if the root is valid, change status to Proven
if (acceptableRoot(_calculatedRoot)) {
if (checkpoints[_calculatedRoot] > 0) {
messages[_leaf] = MessageStatus.Proven;
return true;
}
return false;
}
/**
* @notice Hash of Home domain concatenated with "OPTICS"
*/
function homeDomainHash() public view override returns (bytes32) {
return _homeDomainHash(remoteDomain);
}
// ============ Internal Functions ============
/**
* @notice Moves the contract into failed state
* @dev Called when a Double Update is submitted
*/
function _fail() internal override {
_setFailed();
}
/// @notice Hook for potential future use
// solhint-disable-next-line no-empty-blocks
function _beforeUpdate() internal {}
}

@ -1,104 +0,0 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
// ============ Internal Imports ============
import {IUpdaterManager} from "../interfaces/IUpdaterManager.sol";
import {Home} from "./Home.sol";
// ============ External Imports ============
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
/**
* @title UpdaterManager
* @author Celo Labs Inc.
* @notice MVP / centralized version of contract
* that will manage Updater bonding, slashing,
* selection and rotation
*/
contract UpdaterManager is IUpdaterManager, Ownable {
// ============ Internal Storage ============
// address of home contract
address internal home;
// ============ Private Storage ============
// address of the current updater
address private _updater;
// ============ Events ============
/**
* @notice Emitted when a new home is set
* @param home The address of the new home contract
*/
event NewHome(address home);
/**
* @notice Emitted when slashUpdater is called
*/
event FakeSlashed(address reporter);
// ============ Modifiers ============
/**
* @notice Require that the function is called
* by the Home contract
*/
modifier onlyHome() {
require(msg.sender == home, "!home");
_;
}
// ============ Constructor ============
constructor(address _updaterAddress) payable Ownable() {
_updater = _updaterAddress;
}
// ============ External Functions ============
/**
* @notice Set the address of the a new home contract
* @dev only callable by trusted owner
* @param _home The address of the new home contract
*/
function setHome(address _home) external onlyOwner {
require(Address.isContract(_home), "!contract home");
home = _home;
emit NewHome(_home);
}
/**
* @notice Set the address of a new updater
* @dev only callable by trusted owner
* @param _updaterAddress The address of the new updater
*/
function setUpdater(address _updaterAddress) external onlyOwner {
_updater = _updaterAddress;
Home(home).setUpdater(_updaterAddress);
}
/**
* @notice Slashes the updater
* @dev Currently does nothing, functionality will be implemented later
* when updater bonding and rotation are also implemented
* @param _reporter The address of the entity that reported the updater fraud
*/
function slashUpdater(address payable _reporter)
external
override
onlyHome
{
emit FakeSlashed(_reporter);
}
/**
* @notice Get address of current updater
* @return the updater address
*/
function updater() external view override returns (address) {
return _updater;
}
}

@ -0,0 +1,131 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
// ============ Internal Imports ============
import {IValidatorManager} from "../interfaces/IValidatorManager.sol";
import {Home} from "./Home.sol";
// ============ External Imports ============
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ECDSA} from "@openzeppelin/contracts/cryptography/ECDSA.sol";
/**
* @title ValidatorManager
* @author Celo Labs Inc.
* @notice MVP version of contract that will manage Validator selection and
* rotataion.
*/
contract ValidatorManager is IValidatorManager, Ownable {
// Mapping of domain -> validator address.
mapping(uint32 => address) public validators;
// ============ Events ============
/**
* @notice Emitted when a validator is set
* @param domain The domain for which the validator is being set
* @param validator The address of the validator
*/
event NewValidator(uint32 indexed domain, address indexed validator);
/**
* @notice Emitted when proof of an improper checkpoint is submitted,
* which sets the contract to FAILED state
* @param root Root of the improper checkpoint
* @param index Index of the improper checkpoint
* @param signature Signature on `root` and `index`
*/
event ImproperCheckpoint(
address indexed home,
uint32 indexed domain,
address indexed validator,
bytes32 root,
uint256 index,
bytes signature
);
// ============ Constructor ============
constructor() Ownable() {}
// ============ External Functions ============
/**
* @notice Set the address of a new validator
* @dev only callable by trusted owner
* @param _domain The domain for which the validator is being set
* @param _validator The address of the validator
*/
function setValidator(uint32 _domain, address _validator)
external
onlyOwner
{
validators[_domain] = _validator;
emit NewValidator(_domain, _validator);
}
/**
* @notice Check if an Checkpoint is an Improper Checkpoint;
* if so, set the provided Home 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 _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,
bytes32 _root,
uint256 _index,
bytes memory _signature
) external returns (bool) {
uint32 _domain = Home(_home).localDomain();
require(
isValidatorSignature(_domain, _root, _index, _signature),
"!validator sig"
);
require(Home(_home).checkpoints(_root) != _index, "!improper");
Home(_home).fail();
emit ImproperCheckpoint(
_home,
_domain,
validators[_domain],
_root,
_index,
_signature
);
return true;
}
// ============ Public Functions ============
/**
* @notice Checks that signature was signed by Validator
* @param _domain Domain of Home contract
* @param _root Merkle root
* @param _index Corresponding leaf index
* @param _signature Signature on `_root` and `_index`
* @return TRUE iff signature is valid signed by validator
**/
function isValidatorSignature(
uint32 _domain,
bytes32 _root,
uint256 _index,
bytes memory _signature
) public view override returns (bool) {
bytes32 _digest = keccak256(
abi.encodePacked(domainHash(_domain), _root, _index)
);
_digest = ECDSA.toEthSignedMessageHash(_digest);
return (ECDSA.recover(_digest, _signature) == validators[_domain]);
}
/**
* @notice Hash of domain concatenated with "OPTICS"
* @param _domain the domain to hash
*/
function domainHash(uint32 _domain) public pure returns (bytes32) {
return keccak256(abi.encodePacked(_domain, "OPTICS"));
}
}

@ -12,9 +12,8 @@ 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 domains. Accepts Watcher signatures
* to un-enroll Replicas attached to fraudulent remote Homes
* @notice Manages a registry of local Replica contracts for remote Home
* domains.
*/
contract XAppConnectionManager is Ownable {
// ============ Public Storage ============
@ -25,11 +24,15 @@ contract XAppConnectionManager is Ownable {
mapping(address => uint32) public replicaToDomain;
// remote Home domain => local Replica address
mapping(uint32 => address) public domainToReplica;
// watcher address => replica remote domain => has/doesn't have permission
mapping(address => mapping(uint32 => bool)) private watcherPermissions;
// ============ Events ============
/**
* @notice Emitted when a new Home is set.
* @param home the address of the Home
*/
event NewHome(address indexed home);
/**
* @notice Emitted when a new Replica is enrolled / added
* @param domain the remote domain of the Home contract for the Replica
@ -44,25 +47,6 @@ contract XAppConnectionManager is Ownable {
*/
event ReplicaUnenrolled(uint32 indexed domain, address replica);
/**
* @notice Emitted when Watcher permissions are changed
* @param domain the remote domain of the Home contract for the Replica
* @param watcher the address of the Watcher
* @param access TRUE if the Watcher was given permissions, FALSE if permissions were removed
*/
event WatcherPermissionSet(
uint32 indexed domain,
address watcher,
bool access
);
// ============ Modifiers ============
modifier onlyReplica() {
require(isReplica(msg.sender), "!replica");
_;
}
// ============ Constructor ============
// solhint-disable-next-line no-empty-blocks
@ -70,48 +54,13 @@ contract XAppConnectionManager is Ownable {
// ============ External Functions ============
/**
* @notice Un-Enroll a replica contract
* in the case that fraud was detected on the Home
* @dev in the future, if fraud occurs on the Home contract,
* the Watcher will submit their signature directly to the Home
* and it can be relayed to all remote chains to un-enroll the Replicas
* @param _domain the remote domain of the Home contract for the Replica
* @param _updater the address of the Updater for the Home contract (also stored on Replica)
* @param _signature signature of watcher on (domain, replica address, updater address)
*/
function unenrollReplica(
uint32 _domain,
bytes32 _updater,
bytes memory _signature
) external {
// ensure that the replica is currently set
address _replica = domainToReplica[_domain];
require(_replica != address(0), "!replica exists");
// ensure that the signature is on the proper updater
require(
Replica(_replica).updater() == TypeCasts.bytes32ToAddress(_updater),
"!current updater"
);
// get the watcher address from the signature
// and ensure that the watcher has permission to un-enroll this replica
address _watcher = _recoverWatcherFromSig(
_domain,
TypeCasts.addressToBytes32(_replica),
_updater,
_signature
);
require(watcherPermissions[_watcher][_domain], "!valid watcher");
// remove the replica from mappings
_unenrollReplica(_replica);
}
/**
* @notice Set the address of the local Home contract
* @param _home the address of the local Home contract
*/
function setHome(address _home) external onlyOwner {
home = Home(_home);
emit NewHome(_home);
}
/**
@ -119,7 +68,7 @@ contract XAppConnectionManager is Ownable {
* @param _replica the address of the Replica
* @param _domain the remote domain of the Home contract for the Replica
*/
function ownerEnrollReplica(address _replica, uint32 _domain)
function enrollReplica(address _replica, uint32 _domain)
external
onlyOwner
{
@ -135,25 +84,10 @@ contract XAppConnectionManager is Ownable {
* @notice Allow Owner to un-enroll Replica contract
* @param _replica the address of the Replica
*/
function ownerUnenrollReplica(address _replica) external onlyOwner {
function unenrollReplica(address _replica) external onlyOwner {
_unenrollReplica(_replica);
}
/**
* @notice Allow Owner to set Watcher permissions for a Replica
* @param _watcher the address of the Watcher
* @param _domain the remote domain of the Home contract for the Replica
* @param _access TRUE to give the Watcher permissions, FALSE to remove permissions
*/
function setWatcherPermission(
address _watcher,
uint32 _domain,
bool _access
) external onlyOwner {
watcherPermissions[_watcher][_domain] = _access;
emit WatcherPermissionSet(_domain, _watcher, _access);
}
/**
* @notice Query local domain from Home
* @return local domain
@ -162,20 +96,6 @@ contract XAppConnectionManager is Ownable {
return home.localDomain();
}
/**
* @notice Get access permissions for the watcher on the domain
* @param _watcher the address of the watcher
* @param _domain the domain to check for watcher permissions
* @return TRUE iff _watcher has permission to un-enroll replicas on _domain
*/
function watcherPermission(address _watcher, uint32 _domain)
external
view
returns (bool)
{
return watcherPermissions[_watcher][_domain];
}
// ============ Public Functions ============
/**
@ -199,23 +119,4 @@ contract XAppConnectionManager is Ownable {
replicaToDomain[_replica] = 0;
emit ReplicaUnenrolled(_currentDomain, _replica);
}
/**
* @notice Get the Watcher address from the provided signature
* @return address of watcher that signed
*/
function _recoverWatcherFromSig(
uint32 _domain,
bytes32 _replica,
bytes32 _updater,
bytes memory _signature
) internal view returns (address) {
bytes32 _homeDomainHash = Replica(TypeCasts.bytes32ToAddress(_replica))
.homeDomainHash();
bytes32 _digest = keccak256(
abi.encodePacked(_homeDomainHash, _domain, _updater)
);
_digest = ECDSA.toEthSignedMessageHash(_digest);
return ECDSA.recover(_digest, _signature);
}
}

@ -4,28 +4,9 @@ pragma solidity >=0.6.11;
import "../Common.sol";
contract TestCommon is Common {
constructor(uint32 _localDomain, address _updater) Common(_localDomain) {
__Common_initialize(_updater);
}
function setUpdater(address _updater) external {
updater = _updater;
}
function testIsUpdaterSignature(
bytes32 _oldRoot,
bytes32 _newRoot,
bytes memory _signature
) external view returns (bool) {
return _isUpdaterSignature(_oldRoot, _newRoot, _signature);
}
/// @notice Hash of Home's domain concatenated with "OPTICS"
function homeDomainHash() public view override returns (bytes32) {
return keccak256(abi.encodePacked(localDomain, "OPTICS"));
}
constructor(uint32 _localDomain) Common(_localDomain) {}
function _fail() internal override {
_setFailed();
function initialize(address _validatorManager) external {
__Common_initialize(_validatorManager);
}
}

@ -1,7 +1,9 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
// ============ Internal Imports ============
import "../Home.sol";
import {IValidatorManager} from "../../interfaces/IValidatorManager.sol";
contract TestHome is Home {
constructor(uint32 _localDomain) Home(_localDomain) {} // solhint-disable-line no-empty-blocks
@ -14,7 +16,11 @@ contract TestHome is Home {
return _destinationAndNonce(_destination, _nonce);
}
function setFailed() public {
_setFailed();
/**
* @notice Set the ValidatorManager
* @param _validatorManager Address of the ValidatorManager
*/
function testSetValidatorManager(address _validatorManager) external {
validatorManager = IValidatorManager(_validatorManager);
}
}

@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
import {Message} from "../../libs/Message.sol";
import {TypedMemView} from "@summa-tx/memview-sol/contracts/TypedMemView.sol";
import "../Common.sol";
contract TestMessage {
using Message for bytes29;

@ -1,61 +0,0 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
import "../Queue.sol";
contract TestQueue is QueueManager {
using QueueLib for QueueLib.Queue;
// solhint-disable-next-line no-empty-blocks
constructor() QueueManager() {}
// NB: this is unfortunately expensive
function enqueue(bytes32 _item) external returns (uint256 _last) {
return queue.enqueue(_item);
}
function dequeue() external returns (bytes32 _item) {
return queue.dequeue();
}
function enqueueMany(bytes32[] calldata _items)
external
returns (uint256 _last)
{
return queue.enqueue(_items);
}
function dequeueMany(uint256 _number)
external
returns (bytes32[] memory _items)
{
return queue.dequeue(_number);
}
function drain() external {
while (queue.length() != 0) {
queue.dequeue();
}
}
function initializeAgain() external {
queue.initialize();
}
function contains(bytes32 _item) external view returns (bool) {
return queue.contains(_item);
}
function lastItem() external view returns (bytes32) {
return queue.lastItem();
}
function peek() external view returns (bytes32 _item) {
return queue.peek();
}
function length() external view returns (uint256) {
return queue.length();
}
}

@ -14,18 +14,13 @@ contract TestReplica is Replica {
uint256
) Replica(_localDomain, 850_000, 15_000) {} // solhint-disable-line no-empty-blocks
function setFailed() public {
_setFailed();
}
function setMessageProven(bytes memory _message) external {
bytes29 _m = _message.ref(0);
messages[_m.keccak()] = MessageStatus.Proven;
}
function setCommittedRoot(bytes32 _newRoot) external {
committedRoot = _newRoot;
confirmAt[_newRoot] = 1;
function setCheckpoint(bytes32 _root, uint256 _index) external {
checkpoints[_root] = _index;
}
function testBranchRoot(

@ -1,24 +0,0 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
import "../XAppConnectionManager.sol";
import "../../libs/TypeCasts.sol";
contract TestXAppConnectionManager is XAppConnectionManager {
constructor() XAppConnectionManager() {} // solhint-disable-line no-empty-blocks
function testRecoverWatcherFromSig(
uint32 _domain,
address _replica,
address _updater,
bytes memory _signature
) external view returns (address) {
return
_recoverWatcherFromSig(
_domain,
TypeCasts.addressToBytes32(_replica),
TypeCasts.addressToBytes32(_updater),
_signature
);
}
}

@ -1,8 +0,0 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
interface IUpdaterManager {
function slashUpdater(address payable _reporter) external;
function updater() external view returns (address);
}

@ -0,0 +1,11 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
interface IValidatorManager {
function isValidatorSignature(
uint32 _domain,
bytes32 _root,
uint256 _index,
bytes memory _signature
) external view returns (bool);
}

@ -1,166 +0,0 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
/**
* @title QueueLib
* @author Celo Labs Inc.
* @notice Library containing queue struct and operations for queue used by
* Home and Replica.
**/
library QueueLib {
/**
* @notice Queue struct
* @dev Internally keeps track of the `first` and `last` elements through
* indices and a mapping of indices to enqueued elements.
**/
struct Queue {
uint128 first;
uint128 last;
mapping(uint256 => bytes32) queue;
}
/**
* @notice Initializes the queue
* @dev Empty state denoted by _q.first > q._last. Queue initialized
* with _q.first = 1 and _q.last = 0.
**/
function initialize(Queue storage _q) internal {
if (_q.first == 0) {
_q.first = 1;
}
}
/**
* @notice Enqueues a single new element
* @param _item New element to be enqueued
* @return _last Index of newly enqueued element
**/
function enqueue(Queue storage _q, bytes32 _item)
internal
returns (uint128 _last)
{
_last = _q.last + 1;
_q.last = _last;
if (_item != bytes32(0)) {
// saves gas if we're queueing 0
_q.queue[_last] = _item;
}
}
/**
* @notice Dequeues element at front of queue
* @dev Removes dequeued element from storage
* @return _item Dequeued element
**/
function dequeue(Queue storage _q) internal returns (bytes32 _item) {
uint128 _last = _q.last;
uint128 _first = _q.first;
require(_length(_last, _first) != 0, "Empty");
_item = _q.queue[_first];
if (_item != bytes32(0)) {
// saves gas if we're dequeuing 0
delete _q.queue[_first];
}
_q.first = _first + 1;
}
/**
* @notice Batch enqueues several elements
* @param _items Array of elements to be enqueued
* @return _last Index of last enqueued element
**/
function enqueue(Queue storage _q, bytes32[] memory _items)
internal
returns (uint128 _last)
{
_last = _q.last;
for (uint256 i = 0; i < _items.length; i += 1) {
_last += 1;
bytes32 _item = _items[i];
if (_item != bytes32(0)) {
_q.queue[_last] = _item;
}
}
_q.last = _last;
}
/**
* @notice Batch dequeues `_number` elements
* @dev Reverts if `_number` > queue length
* @param _number Number of elements to dequeue
* @return Array of dequeued elements
**/
function dequeue(Queue storage _q, uint256 _number)
internal
returns (bytes32[] memory)
{
uint128 _last = _q.last;
uint128 _first = _q.first;
// Cannot underflow unless state is corrupted
require(_length(_last, _first) >= _number, "Insufficient");
bytes32[] memory _items = new bytes32[](_number);
for (uint256 i = 0; i < _number; i++) {
_items[i] = _q.queue[_first];
delete _q.queue[_first];
_first++;
}
_q.first = _first;
return _items;
}
/**
* @notice Returns true if `_item` is in the queue and false if otherwise
* @dev Linearly scans from _q.first to _q.last looking for `_item`
* @param _item Item being searched for in queue
* @return True if `_item` currently exists in queue, false if otherwise
**/
function contains(Queue storage _q, bytes32 _item)
internal
view
returns (bool)
{
for (uint256 i = _q.first; i <= _q.last; i++) {
if (_q.queue[i] == _item) {
return true;
}
}
return false;
}
/// @notice Returns last item in queue
/// @dev Returns bytes32(0) if queue empty
function lastItem(Queue storage _q) internal view returns (bytes32) {
return _q.queue[_q.last];
}
/// @notice Returns element at front of queue without removing element
/// @dev Reverts if queue is empty
function peek(Queue storage _q) internal view returns (bytes32 _item) {
require(!isEmpty(_q), "Empty");
_item = _q.queue[_q.first];
}
/// @notice Returns true if queue is empty and false if otherwise
function isEmpty(Queue storage _q) internal view returns (bool) {
return _q.last < _q.first;
}
/// @notice Returns number of elements in queue
function length(Queue storage _q) internal view returns (uint256) {
uint128 _last = _q.last;
uint128 _first = _q.first;
// Cannot underflow unless state is corrupted
return _length(_last, _first);
}
/// @notice Returns number of elements between `_last` and `_first` (used internally)
function _length(uint128 _last, uint128 _first)
internal
pure
returns (uint256)
{
return uint256(_last + 1 - _first);
}
}

@ -1,136 +1,47 @@
import { ethers } from 'hardhat';
import { expect } from 'chai';
import { AbacusState, Updater } from './lib/core';
import { Signer } from './lib/types';
import { Address, Signer } from './lib/types';
import { TestCommon__factory, TestCommon } from '../typechain';
const signedUpdateTestCases = require('../../../vectors/signedUpdate.json');
const localDomain = 1000;
const ONLY_OWNER_REVERT_MSG = 'Ownable: caller is not the owner';
describe('Common', async () => {
let signer: Signer,
fakeSigner: Signer,
common: TestCommon,
updater: Updater,
fakeUpdater: Updater;
let owner: Signer, nonowner: Signer, common: TestCommon;
before(async () => {
[signer, fakeSigner] = await ethers.getSigners();
updater = await Updater.fromSigner(signer, localDomain);
fakeUpdater = await Updater.fromSigner(fakeSigner, localDomain);
[owner, nonowner] = await ethers.getSigners();
});
beforeEach(async () => {
const commonFactory = new TestCommon__factory(signer);
common = await commonFactory.deploy(localDomain, updater.address);
const commonFactory = new TestCommon__factory(owner);
common = await commonFactory.deploy(localDomain);
// The ValidatorManager is unused in these tests *but* needs to be a
// contract.
await common.initialize(common.address);
expect(await common.validatorManager()).to.equal(common.address);
});
it('Accepts updater signature', async () => {
const oldRoot = ethers.utils.formatBytes32String('old root');
const newRoot = ethers.utils.formatBytes32String('new root');
const { signature } = await updater.signUpdate(oldRoot, newRoot);
const isValid = await common.testIsUpdaterSignature(
oldRoot,
newRoot,
signature,
it('Cannot be initialized twice', async () => {
await expect(common.initialize(common.address)).to.be.revertedWith(
'Initializable: contract is already initialized',
);
expect(isValid).to.be.true;
});
it('Rejects non-updater signature', async () => {
const oldRoot = ethers.utils.formatBytes32String('old root');
const newRoot = ethers.utils.formatBytes32String('new root');
const { signature: fakeSignature } = await fakeUpdater.signUpdate(
oldRoot,
newRoot,
it('Allows owner to update the ValidatorManager', async () => {
const commonFactory = new TestCommon__factory(owner);
const newValidatorManager = await commonFactory.deploy(localDomain);
await common.setValidatorManager(newValidatorManager.address);
expect(await common.validatorManager()).to.equal(
newValidatorManager.address,
);
expect(await common.testIsUpdaterSignature(oldRoot, newRoot, fakeSignature))
.to.be.false;
});
it('Fails on valid double update proof', async () => {
const oldRoot = ethers.utils.formatBytes32String('old root');
const newRoot = ethers.utils.formatBytes32String('new root 1');
const newRoot2 = ethers.utils.formatBytes32String('new root 2');
const { signature } = await updater.signUpdate(oldRoot, newRoot);
const { signature: signature2 } = await updater.signUpdate(
oldRoot,
newRoot2,
);
it('Does not allow nonowner to update the ValidatorManager', async () => {
await expect(
common.doubleUpdate(oldRoot, [newRoot, newRoot2], signature, signature2),
).to.emit(common, 'DoubleUpdate');
expect(await common.state()).to.equal(AbacusState.FAILED);
});
it('Does not fail contract on invalid double update proof', async () => {
const oldRoot = ethers.utils.formatBytes32String('old root');
const newRoot = ethers.utils.formatBytes32String('new root');
const { signature } = await updater.signUpdate(oldRoot, newRoot);
// Double update proof uses same roots and signatures
await common.doubleUpdate(
oldRoot,
[newRoot, newRoot],
signature,
signature,
);
// State should not be failed because double update proof does not
// demonstrate fraud
const state = await common.state();
expect(state).not.to.equal(AbacusState.FAILED);
expect(state).to.equal(AbacusState.ACTIVE);
});
it('Does not fail on double update after updater rotation', async () => {
const oldRoot = ethers.utils.formatBytes32String('old root');
const newRoot = ethers.utils.formatBytes32String('new root 1');
const newRoot2 = ethers.utils.formatBytes32String('new root 2');
const { signature } = await updater.signUpdate(oldRoot, newRoot);
const { signature: signature2 } = await updater.signUpdate(
oldRoot,
newRoot2,
);
await common.setUpdater(fakeUpdater.address);
await common.doubleUpdate(
oldRoot,
[newRoot, newRoot2],
signature,
signature2,
);
// State should not be failed because double update proof does not
// use current updater.
const state = await common.state();
expect(state).not.to.equal(AbacusState.FAILED);
expect(state).to.equal(AbacusState.ACTIVE);
});
it('Checks Rust-produced SignedUpdate', async () => {
// Compare Rust output in json file to solidity output
for (let testCase of signedUpdateTestCases) {
const { oldRoot, newRoot, signature, signer } = testCase;
const signerAddress = ethers.utils.getAddress(signer);
await common.setUpdater(signerAddress);
expect(
await common.testIsUpdaterSignature(
oldRoot,
newRoot,
ethers.utils.joinSignature(signature),
),
).to.be.true;
}
common.connect(nonowner).setValidatorManager(common.address),
).to.be.revertedWith(ONLY_OWNER_REVERT_MSG);
});
});

@ -1,9 +1,9 @@
import { ethers, abacus } from 'hardhat';
import { expect } from 'chai';
import { updateReplica, formatCall, formatAbacusMessage } from './utils';
import { formatCall, formatAbacusMessage } from './utils';
import { increaseTimestampBy, UpgradeTestHelpers } from '../utils';
import { Updater } from '../lib/core';
import { Validator } from '../lib/core';
import { Address, Signer } from '../lib/types';
import { AbacusDeployment } from '../lib/AbacusDeployment';
import { GovernanceDeployment } from '../lib/GovernanceDeployment';
@ -25,6 +25,7 @@ const thirdDomain = 3000;
const domains = [governorDomain, nonGovernorDomain, thirdDomain];
const processGas = 850000;
const reserveGas = 15000;
const nullRoot = '0x' + '00'.repeat(32);
/*
* Deploy the full Abacus suite on two chains
@ -42,7 +43,7 @@ describe('GovernanceRouter', async () => {
governorHome: Home,
governorReplicaOnNonGovernorChain: TestReplica,
nonGovernorReplicaOnGovernorChain: TestReplica,
updater: Updater;
validator: Validator;
async function expectGovernor(
governanceRouter: TestGovernanceRouter,
@ -57,7 +58,7 @@ describe('GovernanceRouter', async () => {
before(async () => {
[thirdRouter, signer, secondSigner] = await ethers.getSigners();
updater = await Updater.fromSigner(signer, governorDomain);
validator = await Validator.fromSigner(signer, governorDomain);
});
beforeEach(async () => {
@ -114,7 +115,7 @@ describe('GovernanceRouter', async () => {
// dispatch call on local governorRouter
let tx = await governorRouter.callRemote(nonGovernorDomain, [call]);
await abacusDeployment.processMessages();
await abacusDeployment.processMessagesFromDomain(governorDomain);
// test implementation was upgraded
await upgradeUtils.expectMysteryMathV2(mysteryMath.proxy);
});
@ -126,10 +127,11 @@ describe('GovernanceRouter', async () => {
processGas,
reserveGas,
);
// The ValdiatorManager is unused in this test, but needs to be a contract.
await unenrolledReplica.initialize(
thirdDomain,
await signer.getAddress(),
ethers.constants.HashZero,
unenrolledReplica.address,
nullRoot,
0,
);
@ -273,8 +275,6 @@ describe('GovernanceRouter', async () => {
it('Transfers governorship', async () => {
// Transfer governor on current governor chain
// get root on governor chain before transferring governor
const committedRoot = await governorHome.committedRoot();
// Governor HAS NOT been transferred on original governor domain
await expectGovernor(governorRouter, governorDomain, firstGovernor);
@ -301,14 +301,6 @@ describe('GovernanceRouter', async () => {
ethers.constants.AddressZero,
);
// get new root and signed update
const newRoot = await governorHome.queueEnd();
const { signature } = await updater.signUpdate(committedRoot, newRoot);
// update governor chain home
await governorHome.update(committedRoot, newRoot, signature);
const transferGovernorMessage = abacus.governance.formatTransferGovernor(
nonGovernorDomain,
abacus.ethersAddressToBytes32(secondGovernor),
@ -321,22 +313,6 @@ describe('GovernanceRouter', async () => {
transferGovernorMessage,
);
// Set current root on replica
await governorReplicaOnNonGovernorChain.setCommittedRoot(newRoot);
// Governor HAS been transferred on original governor domain
await expectGovernor(
governorRouter,
nonGovernorDomain,
ethers.constants.AddressZero,
);
// Governor HAS NOT been transferred on original non-governor domain
await expectGovernor(
nonGovernorRouter,
governorDomain,
ethers.constants.AddressZero,
);
// Process transfer governor message on Replica
await governorReplicaOnNonGovernorChain.process(abacusMessage);
@ -385,29 +361,32 @@ describe('GovernanceRouter', async () => {
await upgradeUtils.expectMysteryMathV2(mysteryMath.proxy);
});
it('Calls UpdaterManager to change the Updater on Home', async () => {
const [newUpdater] = await ethers.getSigners();
const updaterManager = abacusDeployment.updaterManager(governorDomain);
await updaterManager.transferOwnership(governorRouter.address);
it('Calls ValidatorManager to set the validator for a domain', async () => {
const [newValidator] = await ethers.getSigners();
const validatorManager = abacusDeployment.validatorManager(governorDomain);
await validatorManager.transferOwnership(governorRouter.address);
// check current Updater address on Home
let currentUpdaterAddr = await governorHome.updater();
expect(currentUpdaterAddr).to.equal(
await abacusDeployment.updater(governorDomain).signer.getAddress(),
// check current Validator address on Home
let currentValidatorAddr = await validatorManager.validators(
governorDomain,
);
expect(currentValidatorAddr).to.equal(
await abacusDeployment.validator(governorDomain).signer.getAddress(),
);
// format abacus call message
const call = await formatCall(updaterManager, 'setUpdater', [
newUpdater.address,
const call = await formatCall(validatorManager, 'setValidator', [
governorDomain,
newValidator.address,
]);
await expect(governorRouter.callLocal([call])).to.emit(
governorHome,
'NewUpdater',
validatorManager,
'NewValidator',
);
// check for new updater
currentUpdaterAddr = await governorHome.updater();
expect(currentUpdaterAddr).to.equal(newUpdater.address);
// check for new validator
currentValidatorAddr = await validatorManager.validators(governorDomain);
expect(currentValidatorAddr).to.equal(newValidator.address);
});
});

@ -4,10 +4,10 @@ import * as types from 'ethers';
import { formatCall, sendFromSigner } from './utils';
import { increaseTimestampBy } from '../utils';
import { Updater } from '../lib/core';
import { Validator } from '../lib/core';
import { Signer } from '../lib/types';
import {
UpdaterManager,
ValidatorManager,
TestGovernanceRouter,
TestHome,
} from '../../typechain';
@ -15,7 +15,7 @@ import { AbacusDeployment } from '../lib/AbacusDeployment';
import { GovernanceDeployment } from '../lib/GovernanceDeployment';
async function expectNotInRecovery(
updaterManager: UpdaterManager,
validatorManager: ValidatorManager,
recoveryManager: types.Signer,
randomSigner: Signer,
governor: Signer,
@ -25,7 +25,8 @@ async function expectNotInRecovery(
expect(await governanceRouter.inRecovery()).to.be.false;
// Format abacus call message
const call = await formatCall(updaterManager, 'setUpdater', [
const call = await formatCall(validatorManager, 'setValidator', [
1000,
randomSigner.address,
]);
@ -34,8 +35,8 @@ async function expectNotInRecovery(
await expect(
sendFromSigner(governor, governanceRouter, 'callLocal', [[call]]),
)
.to.emit(home, 'NewUpdater')
.withArgs(randomSigner.address);
.to.emit(validatorManager, 'NewValidator')
.withArgs(1000, randomSigner.address);
// dispatch call on local governorRouter
await expect(
@ -210,11 +211,11 @@ describe('RecoveryManager', async () => {
randomSigner: Signer,
governanceRouter: TestGovernanceRouter,
home: TestHome,
updaterManager: UpdaterManager;
validatorManager: ValidatorManager;
before(async () => {
[governor, recoveryManager, randomSigner] = await ethers.getSigners();
const updater = await Updater.fromSigner(randomSigner, localDomain);
const validator = await Validator.fromSigner(randomSigner, localDomain);
abacusDeployment = await abacus.deployment.fromDomains(
domains,
randomSigner,
@ -232,7 +233,7 @@ describe('RecoveryManager', async () => {
governanceRouter = governanceDeployment.router(localDomain);
home = abacusDeployment.home(localDomain);
updaterManager = abacusDeployment.updaterManager(localDomain);
validatorManager = abacusDeployment.validatorManager(localDomain);
// set governor
await governanceRouter.transferGovernor(localDomain, governor.address);
@ -250,7 +251,7 @@ describe('RecoveryManager', async () => {
it('Before Recovery Initiated: Not in Recovery (Governor CAN Call Local & Remote; Recovery Manager CANNOT Call either)', async () => {
await expectNotInRecovery(
updaterManager,
validatorManager,
recoveryManager,
randomSigner,
governor,
@ -290,7 +291,7 @@ describe('RecoveryManager', async () => {
it('Before Recovery Active: Not in Recovery (Governor CAN Call Local & Remote; Recovery Manager CANNOT Call either)', async () => {
await expectNotInRecovery(
updaterManager,
validatorManager,
recoveryManager,
randomSigner,
governor,
@ -335,7 +336,8 @@ describe('RecoveryManager', async () => {
it('Recovery Active: RecoveryManager CAN call local', async () => {
// Format abacus call message
const call = await formatCall(updaterManager, 'setUpdater', [
const call = await formatCall(validatorManager, 'setValidator', [
localDomain,
randomSigner.address,
]);
@ -343,13 +345,14 @@ describe('RecoveryManager', async () => {
await expect(
sendFromSigner(recoveryManager, governanceRouter, 'callLocal', [[call]]),
)
.to.emit(home, 'NewUpdater')
.withArgs(randomSigner.address);
.to.emit(validatorManager, 'NewValidator')
.withArgs(localDomain, randomSigner.address);
});
it('Recovery Active: RecoveryManager CANNOT call remote', async () => {
// Format abacus call message
const call = await formatCall(updaterManager, 'setUpdater', [
const call = await formatCall(validatorManager, 'setValidator', [
localDomain,
randomSigner.address,
]);
@ -402,7 +405,8 @@ describe('RecoveryManager', async () => {
it('Recovery Active: Governor CANNOT call local OR remote', async () => {
// Format abacus call message
const call = await formatCall(updaterManager, 'setUpdater', [
const call = await formatCall(validatorManager, 'setValidator', [
localDomain,
randomSigner.address,
]);
@ -460,7 +464,7 @@ describe('RecoveryManager', async () => {
it('Exited Recovery: Not in Recovery (Governor CAN Call Local & Remote; Recovery Manager CANNOT Call either)', async () => {
await expectNotInRecovery(
updaterManager,
validatorManager,
recoveryManager,
randomSigner,
governor,

@ -2,8 +2,8 @@ import { abacus, ethers } from 'hardhat';
import { expect } from 'chai';
import * as utils from './utils';
import { Updater, MessageStatus } from '../lib/core';
import { Update, Signer, BytesArray } from '../lib/types';
import { Validator, MessageStatus } from '../lib/core';
import { Signer, BytesArray } from '../lib/types';
import { TestRecipient__factory, TestReplica } from '../../typechain';
import { AbacusDeployment } from '../lib/AbacusDeployment';
import { GovernanceDeployment } from '../lib/GovernanceDeployment';
@ -17,19 +17,18 @@ const remoteDomain = domains[1];
/*
* Deploy the full Abacus suite on two chains
* dispatch messages to Home
* sign and submit updates to Home
* relay updates to Replica
* confirm updates on Replica
* checkpoint on Home
* Sign and relay checkpoints to Replica
* TODO prove and process messages on Replica
*/
describe('SimpleCrossChainMessage', async () => {
let abacusDeployment: AbacusDeployment;
let governanceDeployment: GovernanceDeployment;
let randomSigner: Signer, updater: Updater, latestUpdate: Update;
let randomSigner: Signer, validator: Validator;
before(async () => {
[randomSigner] = await ethers.getSigners();
updater = await Updater.fromSigner(randomSigner, localDomain);
validator = await Validator.fromSigner(randomSigner, localDomain);
abacusDeployment = await abacus.deployment.fromDomains(
domains,
randomSigner,
@ -43,70 +42,43 @@ describe('SimpleCrossChainMessage', async () => {
it('All Homes have correct initial state', async () => {
const nullRoot = '0x' + '00'.repeat(32);
// governorHome has 0 updates
const governorHome = abacusDeployment.home(localDomain);
let length = await governorHome.queueLength();
expect(length).to.equal(0);
let [root, index] = await governorHome.latestCheckpoint();
expect(root).to.equal(nullRoot);
expect(index).to.equal(0);
let [suggestedCommitted, suggestedNew] = await governorHome.suggestUpdate();
expect(suggestedCommitted).to.equal(nullRoot);
expect(suggestedNew).to.equal(nullRoot);
// nonGovernorHome has 2 updates
const nonGovernorHome = abacusDeployment.home(remoteDomain);
length = await nonGovernorHome.queueLength();
expect(length).to.equal(2);
[suggestedCommitted, suggestedNew] = await nonGovernorHome.suggestUpdate();
expect(suggestedCommitted).to.equal(nullRoot);
expect(suggestedNew).to.not.equal(nullRoot);
[root, index] = await nonGovernorHome.latestCheckpoint();
expect(root).to.equal(nullRoot);
expect(index).to.equal(0);
});
it('Origin Home Accepts one valid update', async () => {
it('Origin Home accepts valid messages', async () => {
const messages = ['message'].map((message) =>
utils.formatMessage(message, remoteDomain, randomSigner.address),
);
const update = await utils.dispatchMessagesAndUpdateHome(
abacusDeployment.home(localDomain),
messages,
updater,
);
latestUpdate = update;
await utils.dispatchMessages(abacusDeployment.home(localDomain), messages);
});
it('Destination Replica Accepts the first update', async () => {
await utils.updateReplica(
latestUpdate,
abacusDeployment.replica(remoteDomain, localDomain),
);
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('Origin Home Accepts an update with several batched messages', async () => {
it('Origin Home accepts batched messages', async () => {
const messages = ['message1', 'message2', 'message3'].map((message) =>
utils.formatMessage(message, remoteDomain, randomSigner.address),
);
const update = await utils.dispatchMessagesAndUpdateHome(
abacusDeployment.home(localDomain),
messages,
updater,
);
latestUpdate = update;
});
it('Destination Replica Accepts the second update', async () => {
await utils.updateReplica(
latestUpdate,
abacusDeployment.replica(remoteDomain, localDomain),
);
await utils.dispatchMessages(abacusDeployment.home(localDomain), messages);
});
it('Destination Replica shows latest update as the committed root', async () => {
it('Destination Replica Accepts a second checkpoint', async () => {
const home = abacusDeployment.home(localDomain);
const replica = abacusDeployment.replica(remoteDomain, localDomain);
const { newRoot } = latestUpdate;
expect(await replica.committedRoot()).to.equal(newRoot);
await utils.checkpoint(home, replica, validator);
});
it('Proves and processes a message on Replica', async () => {
@ -148,7 +120,7 @@ describe('SimpleCrossChainMessage', async () => {
path as BytesArray,
index,
);
await replica.setCommittedRoot(proofRoot);
await replica.setCheckpoint(proofRoot, 1);
// prove and process message
await replica.proveAndProcess(abacusMessage, path as BytesArray, index);

@ -2,8 +2,8 @@ import { expect } from 'chai';
import { ethers, abacus } from 'hardhat';
import * as types from 'ethers';
import { Updater } from '../lib/core';
import { Update, CallData, Address } from '../lib/types';
import { Validator } from '../lib/core';
import { CallData, Address } from '../lib/types';
import {
Replica,
TestReplica,
@ -18,22 +18,17 @@ type MessageDetails = {
};
/*
* Dispatch a message from the specified Home contract
* and return the updated root
* Dispatch a message from the specified Home contract.
*
* @param chainDetails - ChainDetails type containing every deployed domain
* @param homeDomain - domain of the Home contract
* @param messageDetails - Message type containing
* the message string,
* the destination domain to which the message will be sent,
* the recipient address on the destination domain to which the message will be dispatched
*
* @return newRoot - bytes32 of the latest root
*/
export async function dispatchMessage(
home: Home,
messageDetails: MessageDetails,
): Promise<string> {
) {
const { message, destinationDomain, recipientAddress } = messageDetails;
// Send message with random signer address as msg.sender
@ -42,95 +37,37 @@ export async function dispatchMessage(
abacus.ethersAddressToBytes32(recipientAddress),
ethers.utils.formatBytes32String(message),
);
const [, newRoot] = await home.suggestUpdate();
return newRoot;
}
/*
* Dispatch a set of messages to the specified Home contract,
* then sign and submit an update to the Home contract
* Dispatch a set of messages to the specified Home contract.
*
* @param chainDetails - ChainDetails type containing every deployed domain
* @param homeDomain - domain of the Home contract
* @param messages - Message[]
*
* @return update - Update type
*/
export async function dispatchMessagesAndUpdateHome(
home: Home,
messages: MessageDetails[],
updater: Updater,
): Promise<Update> {
const homeDomain = await home.localDomain();
const oldRoot = await home.committedRoot();
// dispatch each message from Home and get the intermediate root
const roots = [];
export async function dispatchMessages(home: Home, messages: MessageDetails[]) {
for (let message of messages) {
const newRoot = await dispatchMessage(home, message);
roots.push(newRoot);
}
// ensure that Home queue contains
// all of the roots we just enqueued
for (let root of roots) {
expect(await home.queueContains(root)).to.be.true;
}
// sign & submit an update from oldRoot to newRoot
const newRoot = roots[roots.length - 1];
const { signature } = await updater.signUpdate(oldRoot, newRoot);
await expect(home.update(oldRoot, newRoot, signature))
.to.emit(home, 'Update')
.withArgs(homeDomain, oldRoot, newRoot, signature);
// ensure that Home root is now newRoot
expect(await home.committedRoot()).to.equal(newRoot);
// ensure that Home queue no longer contains
// any of the roots we just enqueued -
// they should be removed from queue when update is submitted
for (let root of roots) {
expect(await home.queueContains(root)).to.be.false;
await dispatchMessage(home, message);
}
return {
oldRoot,
newRoot,
signature,
};
}
/*
* Submit a signed update to the Replica contract
* Checkpoints a Home, signs that checkpoint, and checkpoints the Replica
*
* @param chainDetails - ChainDetails type containing every deployed domain
* @param latestUpdateOnOriginChain - Update type, the last Update submitted to the Home chain for this Replica
* @param homeDomain - domain of the Home contract from which the update originated
* @param replicaDomain - domain of the Replica contract where the update will be submitted
*
* @return finalRoot - updated state root submitted to the Replica
* @param home - The Home contract
* @param replica - The Replica contract
* @param validator - The Validator
*/
export async function updateReplica(
latestUpdateOnOriginChain: Update,
export async function checkpoint(
home: Home,
replica: Replica,
): Promise<string> {
const homeDomain = await replica.remoteDomain();
const { oldRoot, newRoot, signature } = latestUpdateOnOriginChain;
await expect(replica.update(oldRoot, newRoot, signature))
.to.emit(replica, 'Update')
.withArgs(homeDomain, oldRoot, newRoot, signature);
expect(await replica.committedRoot()).to.equal(newRoot);
return newRoot;
validator: Validator,
) {
await home.checkpoint();
const [root, index] = await home.latestCheckpoint();
const { signature } = await validator.signCheckpoint(root, index.toNumber());
await replica.checkpoint(root, index, signature);
const checkpointedIndex = await replica.checkpoints(root);
expect(checkpointedIndex).to.equal(index);
}
/*

@ -1,71 +1,41 @@
import { ethers, abacus } from 'hardhat';
import { expect } from 'chai';
import { AbacusState, Updater } from './lib/core';
import { AbacusState, Validator } from './lib/core';
import { Signer } from './lib/types';
import {
TestHome,
TestHome__factory,
UpdaterManager__factory,
UpdaterManager,
} from '../typechain';
import { TestHome, TestHome__factory } from '../typechain';
const homeDomainHashTestCases = require('../../../vectors/homeDomainHash.json');
const destinationNonceTestCases = require('../../../vectors/destinationNonce.json');
const localDomain = 1000;
const destDomain = 2000;
const emptyAddress: string = '0x' + '00'.repeat(32);
const nullAddress: string = '0x' + '00'.repeat(32);
describe('Home', async () => {
let home: TestHome,
signer: Signer,
fakeSigner: Signer,
recipient: Signer,
updater: Updater,
fakeUpdater: Updater,
updaterManager: UpdaterManager;
// Helper function that dispatches message and returns intermediate root.
// The message recipient is the same for all messages dispatched.
const dispatchMessageAndGetRoot = async (message: string) => {
message = ethers.utils.formatBytes32String(message);
await home.dispatch(
destDomain,
abacus.ethersAddressToBytes32(recipient.address),
message,
);
const [, latestRoot] = await home.suggestUpdate();
return latestRoot;
};
let home: TestHome, signer: Signer, recipient: Signer;
before(async () => {
[signer, fakeSigner, recipient] = await ethers.getSigners();
updater = await Updater.fromSigner(signer, localDomain);
fakeUpdater = await Updater.fromSigner(fakeSigner, localDomain);
// deploy UpdaterManagers
const updaterManagerFactory = new UpdaterManager__factory(signer);
updaterManager = await updaterManagerFactory.deploy(updater.address);
[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);
await home.initialize(updaterManager.address);
// set home on UpdaterManager
await updaterManager.setHome(home.address);
// The ValidatorManager is unused in these tests *but* needs to be a
// contract.
await home.initialize(home.address);
});
it('Cannot be initialized twice', async () => {
await expect(home.initialize(updaterManager.address)).to.be.revertedWith(
await expect(home.initialize(home.address)).to.be.revertedWith(
'Initializable: contract is already initialized',
);
});
it('Halts on fail', async () => {
await home.setFailed();
it('ValidatorManager can fail', async () => {
await home.testSetValidatorManager(signer.address);
await home.fail();
expect(await home.state()).to.equal(AbacusState.FAILED);
const message = ethers.utils.formatBytes32String('message');
@ -78,28 +48,20 @@ describe('Home', async () => {
).to.be.revertedWith('failed state');
});
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 homeDomainHashTestCases) {
const homeFactory = new TestHome__factory(signer);
const tempHome = await homeFactory.deploy(testCase.homeDomain);
const { expectedDomainHash } = testCase;
const homeDomainHash = await tempHome.homeDomainHash();
expect(homeDomainHash).to.equal(expectedDomainHash);
}
it('Non ValidatorManager cannot fail', async () => {
await expect(home.connect(recipient).fail()).to.be.revertedWith(
'!validatorManager',
);
});
it('Does not dispatch too large messages', async () => {
const message = `0x${Buffer.alloc(3000).toString('hex')}`;
await expect(
home
.connect(signer)
.dispatch(
destDomain,
abacus.ethersAddressToBytes32(recipient.address),
message,
),
home.dispatch(
destDomain,
abacus.ethersAddressToBytes32(recipient.address),
message,
),
).to.be.revertedWith('msg too long');
});
@ -120,7 +82,7 @@ describe('Home', async () => {
);
const messageHash = abacus.messageHash(abacusMessage);
const leafIndex = await home.tree();
const committedRoot = await home.committedRoot();
const [checkpointedRoot] = await home.latestCheckpoint();
// Send message with signer address as msg.sender
await expect(
@ -137,116 +99,22 @@ describe('Home', async () => {
messageHash,
leafIndex,
destinationAndNonce,
committedRoot,
checkpointedRoot,
abacusMessage,
);
});
it('Suggests current root and latest root on suggestUpdate', async () => {
const committedRoot = await home.committedRoot();
it('Checkpoints the latest root', async () => {
const message = ethers.utils.formatBytes32String('message');
await home.dispatch(
destDomain,
abacus.ethersAddressToBytes32(recipient.address),
message,
);
const latestEnqueuedRoot = await home.queueEnd();
const [suggestedCommitted, suggestedNew] = await home.suggestUpdate();
expect(suggestedCommitted).to.equal(committedRoot);
expect(suggestedNew).to.equal(latestEnqueuedRoot);
});
it('Suggests empty update values when queue is empty', async () => {
const length = await home.queueLength();
expect(length).to.equal(0);
const [suggestedCommitted, suggestedNew] = await home.suggestUpdate();
expect(suggestedCommitted).to.equal(emptyAddress);
expect(suggestedNew).to.equal(emptyAddress);
});
it('Accepts a valid update', async () => {
const committedRoot = await home.committedRoot();
const newRoot = await dispatchMessageAndGetRoot('message');
const { signature } = await updater.signUpdate(committedRoot, newRoot);
await expect(home.update(committedRoot, newRoot, signature))
.to.emit(home, 'Update')
.withArgs(localDomain, committedRoot, newRoot, signature);
expect(await home.committedRoot()).to.equal(newRoot);
expect(await home.queueContains(newRoot)).to.be.false;
});
it('Batch-accepts several updates', async () => {
const committedRoot = await home.committedRoot();
const newRoot1 = await dispatchMessageAndGetRoot('message1');
const newRoot2 = await dispatchMessageAndGetRoot('message2');
const newRoot3 = await dispatchMessageAndGetRoot('message3');
const { signature } = await updater.signUpdate(committedRoot, newRoot3);
await expect(home.update(committedRoot, newRoot3, signature))
.to.emit(home, 'Update')
.withArgs(localDomain, committedRoot, newRoot3, signature);
expect(await home.committedRoot()).to.equal(newRoot3);
expect(await home.queueContains(newRoot1)).to.be.false;
expect(await home.queueContains(newRoot2)).to.be.false;
expect(await home.queueContains(newRoot3)).to.be.false;
});
it('Rejects update that does not build off of current root', async () => {
// First root is committedRoot
const secondRoot = await dispatchMessageAndGetRoot('message');
const thirdRoot = await dispatchMessageAndGetRoot('message2');
// Try to submit update that skips the current (first) root
const { signature } = await updater.signUpdate(secondRoot, thirdRoot);
await expect(
home.update(secondRoot, thirdRoot, signature),
).to.be.revertedWith('not a current update');
});
it('Rejects update that does not exist in queue', async () => {
const committedRoot = await home.committedRoot();
const fakeNewRoot = ethers.utils.formatBytes32String('fake root');
const { signature } = await updater.signUpdate(committedRoot, fakeNewRoot);
await expect(home.update(committedRoot, fakeNewRoot, signature)).to.emit(
home,
'ImproperUpdate',
);
expect(await home.state()).to.equal(AbacusState.FAILED);
});
it('Rejects update from non-updater address', async () => {
const committedRoot = await home.committedRoot();
const newRoot = await dispatchMessageAndGetRoot('message');
const { signature: fakeSignature } = await fakeUpdater.signUpdate(
committedRoot,
newRoot,
);
await expect(
home.update(committedRoot, newRoot, fakeSignature),
).to.be.revertedWith('!updater sig');
});
it('Fails on valid double update proof', async () => {
const firstRoot = await home.committedRoot();
const secondRoot = await dispatchMessageAndGetRoot('message');
const thirdRoot = await dispatchMessageAndGetRoot('message2');
const { signature } = await updater.signUpdate(firstRoot, secondRoot);
const { signature: signature2 } = await updater.signUpdate(
firstRoot,
thirdRoot,
);
await expect(
home.doubleUpdate(
firstRoot,
[secondRoot, thirdRoot],
signature,
signature2,
),
).to.emit(home, 'DoubleUpdate');
expect(await home.state()).to.equal(AbacusState.FAILED);
await home.checkpoint();
const [root, index] = await home.latestCheckpoint();
expect(root).to.not.equal(nullAddress);
expect(index).to.equal(1);
});
it('Correctly calculates destinationAndNonce', async () => {

@ -3,13 +3,13 @@ import { assert } from 'chai';
import * as ethers from 'ethers';
import * as types from './types';
import { Updater } from './core';
import { Validator } from './core';
import {
TestHome,
TestHome__factory,
UpdaterManager,
UpdaterManager__factory,
ValidatorManager,
ValidatorManager__factory,
UpgradeBeaconController,
UpgradeBeaconController__factory,
XAppConnectionManager,
@ -20,8 +20,8 @@ import {
export interface AbacusInstance {
domain: types.Domain;
updater: Updater;
updaterManager: UpdaterManager;
validator: Validator;
validatorManager: ValidatorManager;
home: TestHome;
connectionManager: XAppConnectionManager;
ubc: UpgradeBeaconController;
@ -30,7 +30,7 @@ export interface AbacusInstance {
const processGas = 850000;
const reserveGas = 15000;
const optimisticSeconds = 0;
const nullRoot = '0x' + '00'.repeat(32);
export class AbacusDeployment {
constructor(
@ -57,9 +57,13 @@ export class AbacusDeployment {
remotes: types.Domain[],
signer: ethers.Signer,
): Promise<AbacusInstance> {
const updaterManagerFactory = new UpdaterManager__factory(signer);
const updaterManager = await updaterManagerFactory.deploy(
await signer.getAddress(),
const validatorManagerFactory = new ValidatorManager__factory(signer);
const validatorManager = await validatorManagerFactory.deploy();
await validatorManager.setValidator(local, await signer.getAddress());
await Promise.all(
remotes.map(async (remoteDomain) =>
validatorManager.setValidator(remoteDomain, await signer.getAddress()),
),
);
const ubcFactory = new UpgradeBeaconController__factory(signer);
@ -67,8 +71,7 @@ export class AbacusDeployment {
const homeFactory = new TestHome__factory(signer);
const home = await homeFactory.deploy(local);
await home.initialize(updaterManager.address);
await updaterManager.setHome(home.address);
await home.initialize(validatorManager.address);
const connectionManagerFactory = new XAppConnectionManager__factory(signer);
const connectionManager = await connectionManagerFactory.deploy();
@ -84,20 +87,20 @@ export class AbacusDeployment {
);
await replica.initialize(
remoteDomain,
await signer.getAddress(),
ethers.constants.HashZero,
optimisticSeconds,
validatorManager.address,
nullRoot,
0,
);
await connectionManager.ownerEnrollReplica(replica.address, remoteDomain);
await connectionManager.enrollReplica(replica.address, remoteDomain);
replicas[remoteDomain] = replica;
});
await Promise.all(deploys);
return {
domain: local,
updater: await Updater.fromSigner(signer, local),
validator: await Validator.fromSigner(signer, local),
home,
connectionManager,
updaterManager,
validatorManager,
replicas,
ubc,
};
@ -107,7 +110,7 @@ export class AbacusDeployment {
await this.home(domain).transferOwnership(address);
await this.ubc(domain).transferOwnership(address);
await this.connectionManager(domain).transferOwnership(address);
await this.updaterManager(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);
@ -123,8 +126,8 @@ export class AbacusDeployment {
return this.instances[domain].ubc;
}
updater(domain: types.Domain): Updater {
return this.instances[domain].updater;
validator(domain: types.Domain): Validator {
return this.instances[domain].validator;
}
replica(local: types.Domain, remote: types.Domain): TestReplica {
@ -135,8 +138,8 @@ export class AbacusDeployment {
return this.instances[domain].connectionManager;
}
updaterManager(domain: types.Domain): UpdaterManager {
return this.instances[domain].updaterManager;
validatorManager(domain: types.Domain): ValidatorManager {
return this.instances[domain].validatorManager;
}
async processMessages() {
@ -147,29 +150,40 @@ export class AbacusDeployment {
async processMessagesFromDomain(local: types.Domain) {
const home = this.home(local);
const [committedRoot, latestRoot] = await home.suggestUpdate();
// Find the block number of the last update submitted on Home.
const updateFilter = home.filters.Update(null, null, committedRoot);
const updates = await home.queryFilter(updateFilter);
assert(updates.length === 0 || updates.length === 1);
const fromBlock = updates.length === 0 ? 0 : updates[0].blockNumber;
const [checkpointedRoot] = await home.latestCheckpoint();
// Find the block number of the last checkpoint submitted on Home.
const checkpointFilter = home.filters.Checkpoint(checkpointedRoot);
const checkpoints = await home.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();
// If there have been no checkpoints since the last checkpoint, return.
if (
index.eq(0) ||
(checkpoints.length == 1 && index.eq(checkpoints[0].args.index))
) {
return;
}
// Update the Home and Replicas to the latest roots.
// This is technically not necessary given that we are not proving against
// a root in the TestReplica.
const updater = this.updater(local);
const { signature } = await updater.signUpdate(committedRoot, latestRoot);
await home.update(committedRoot, latestRoot, signature);
const validator = this.validator(local);
const { signature } = await validator.signCheckpoint(
root,
index.toNumber(),
);
for (const remote of this.domains) {
if (remote !== local) {
const replica = this.replica(remote, local);
await replica.update(committedRoot, latestRoot, signature);
await replica.checkpoint(root, index, signature);
}
}
// Find all messages dispatched on the home since the previous update.
// Find all messages dispatched on the home since the previous checkpoint.
const dispatchFilter = home.filters.Dispatch();
const dispatches = await home.queryFilter(dispatchFilter, fromBlock);
for (const dispatch of dispatches) {

@ -5,7 +5,7 @@ import * as types from './types';
import { getHexStringByteLength } from './utils';
import { AbacusDeployment } from './AbacusDeployment';
export class Updater {
export class Validator {
localDomain: types.Domain;
signer: ethers.Signer;
address: types.Address;
@ -17,7 +17,7 @@ export class Updater {
disableWarn: boolean,
) {
if (!disableWarn) {
throw new Error('Please use `Updater.fromSigner()` to instantiate.');
throw new Error('Please use `Validator.fromSigner()` to instantiate.');
}
this.localDomain = localDomain ? localDomain : 0;
this.signer = signer;
@ -25,25 +25,28 @@ export class Updater {
}
static async fromSigner(signer: ethers.Signer, localDomain: types.Domain) {
return new Updater(signer, await signer.getAddress(), localDomain, true);
return new Validator(signer, await signer.getAddress(), localDomain, true);
}
domainHash() {
return domainHash(this.localDomain);
}
message(oldRoot: types.HexString, newRoot: types.HexString) {
return ethers.utils.concat([this.domainHash(), oldRoot, newRoot]);
message(root: types.HexString, index: number) {
return ethers.utils.solidityPack(
['bytes32', 'bytes32', 'uint256'],
[this.domainHash(), root, index],
);
}
async signUpdate(oldRoot: types.HexString, newRoot: types.HexString) {
let message = this.message(oldRoot, newRoot);
async signCheckpoint(root: types.HexString, index: number) {
let message = this.message(root, index);
let msgHash = ethers.utils.arrayify(ethers.utils.keccak256(message));
let signature = await this.signer.signMessage(msgHash);
return {
origin: this.localDomain,
oldRoot,
newRoot,
root,
index,
signature,
};
}
@ -130,32 +133,6 @@ function domainHash(domain: Number): string {
);
}
async function signedFailureNotification(
signer: ethers.Signer,
domain: types.Domain,
updaterAddress: types.Address,
): Promise<types.SignedFailureNotification> {
const domainCommitment = domainHash(domain);
const updaterBytes32 = ethersAddressToBytes32(updaterAddress);
const failureNotification = ethers.utils.solidityPack(
['bytes32', 'uint32', 'bytes32'],
[domainCommitment, domain, updaterBytes32],
);
const signature = await signer.signMessage(
ethers.utils.arrayify(ethers.utils.keccak256(failureNotification)),
);
return {
failureNotification: {
domainCommitment,
domain,
updaterBytes32,
},
signature,
};
}
function formatCalls(callsData: types.CallData[]): string {
let callBody = '0x';
const numCalls = callsData.length;
@ -195,5 +172,4 @@ export const abacus: types.HardhatAbacusHelpers = {
ethersAddressToBytes32,
destinationAndNonce,
domainHash,
signedFailureNotification,
};

@ -15,7 +15,6 @@ export interface HardhatAbacusHelpers {
ethersAddressToBytes32: Function;
destinationAndNonce: Function;
domainHash: Function;
signedFailureNotification: Function;
}
declare module 'hardhat/types/runtime' {
@ -66,9 +65,9 @@ export type BytesArray = [
];
/********* OPTICS CORE *********/
export type Update = {
oldRoot: string;
newRoot: string;
export type Checkpoint = {
root: string;
index: number;
signature: string;
};
@ -76,14 +75,3 @@ export type CallData = {
to: Address;
data: string;
};
export type FailureNotification = {
domainCommitment: string;
domain: number;
updaterBytes32: string;
};
export type SignedFailureNotification = {
failureNotification: FailureNotification;
signature: string;
};

@ -1,73 +0,0 @@
import { ethers } from 'hardhat';
import { expect } from 'chai';
import { TestQueue, TestQueue__factory } from '../typechain';
// create a proper hex encoded bytes32 filled with number. e.g 0x01010101...
const bytes32 = (num: number) => `0x${Buffer.alloc(32, num).toString('hex')}`;
describe('Queue', async () => {
let queue: TestQueue;
before(async () => {
const [signer] = await ethers.getSigners();
const queueFactory = new TestQueue__factory(signer);
queue = await queueFactory.deploy();
});
it('should function as a queue', async () => {
// we put this here for coverage to check that init properly does nothing
await queue.initializeAgain();
const items = Array.from(new Array(10).keys()).map((i) => bytes32(i));
for (const [idx, item] of Array.from(items.entries())) {
await queue.enqueue(item);
const length = await queue.length();
expect(length).to.equal(idx + 1);
}
// last item
const last = await queue.lastItem();
expect(last).to.equal(items[items.length - 1]);
// contains
expect(await queue.contains(bytes32(3))).to.be.true;
expect(await queue.contains(bytes32(0xff))).to.be.false;
for (const [idx, item] of Array.from(items.entries())) {
// peek and dequeue
const dequeued = await queue.peek();
await queue.dequeue();
expect(dequeued).to.equal(item);
// length
const length = await queue.length();
expect(length).to.equal(items.length - idx - 1);
}
// reverts
await expect(queue.dequeue()).to.be.revertedWith('Empty');
await expect(queue.peek()).to.be.revertedWith('Empty');
// Multi-enq
await queue.enqueueMany(items);
let length = await queue.length();
expect(length).to.equal(items.length);
// Multi-deq static call to check ret val
let deqed = await queue.callStatic.dequeueMany(items.length);
items.forEach((item, idx) => {
expect(item).to.equal(deqed[idx]);
});
// Multi-deq that exceeds size reverts
await expect(queue.dequeueMany(items.length + 1)).to.be.revertedWith(
'Insufficient',
);
// Multi-deq tx to check function
await queue.dequeueMany(items.length);
length = await queue.length();
expect(length).to.equal(0);
});
});

@ -1,7 +1,7 @@
import { ethers, abacus } from 'hardhat';
import { expect } from 'chai';
import { Updater, AbacusState, MessageStatus } from './lib/core';
import { Validator, AbacusState, MessageStatus } from './lib/core';
import { Signer, BytesArray } from './lib/types';
import {
BadRecipient1__factory,
@ -13,6 +13,8 @@ import {
BadRecipientHandle__factory,
TestReplica,
TestReplica__factory,
ValidatorManager,
ValidatorManager__factory,
TestRecipient__factory,
} from '../typechain';
@ -24,7 +26,7 @@ const localDomain = 2000;
const remoteDomain = 1000;
const processGas = 850000;
const reserveGas = 15000;
const optimisticSeconds = 3;
const nullRoot = '0x' + '00'.repeat(32);
describe('Replica', async () => {
const badRecipientFactories = [
@ -37,23 +39,20 @@ describe('Replica', async () => {
];
let replica: TestReplica,
validatorManager: ValidatorManager,
signer: Signer,
fakeSigner: Signer,
abacusMessageSender: Signer,
updater: Updater,
fakeUpdater: Updater;
const submitValidUpdate = async (newRoot: string) => {
const oldRoot = await replica.committedRoot();
const { signature } = await updater.signUpdate(oldRoot, newRoot);
await replica.update(oldRoot, newRoot, signature);
};
validator: Validator,
fakeValidator: Validator;
before(async () => {
[signer, fakeSigner, abacusMessageSender] = await ethers.getSigners();
updater = await Updater.fromSigner(signer, remoteDomain);
fakeUpdater = await Updater.fromSigner(fakeSigner, remoteDomain);
validator = await Validator.fromSigner(signer, remoteDomain);
fakeValidator = await Validator.fromSigner(fakeSigner, remoteDomain);
const validatorManagerFactory = new ValidatorManager__factory(signer);
validatorManager = await validatorManagerFactory.deploy();
await validatorManager.setValidator(remoteDomain, validator.address);
});
beforeEach(async () => {
@ -61,155 +60,52 @@ describe('Replica', async () => {
replica = await replicaFactory.deploy(localDomain, processGas, reserveGas);
await replica.initialize(
remoteDomain,
updater.address,
ethers.constants.HashZero,
optimisticSeconds,
validatorManager.address,
nullRoot,
0,
);
});
it('Cannot be initialized twice', async () => {
await expect(
replica.initialize(
remoteDomain,
updater.address,
ethers.constants.HashZero,
optimisticSeconds,
),
replica.initialize(remoteDomain, validatorManager.address, nullRoot, 0),
).to.be.revertedWith('Initializable: contract is already initialized');
});
it('Owner can transfer ownership', async () => {
const oldOwner = await replica.owner();
const newOwner = fakeUpdater.address;
expect(oldOwner).to.not.be.equal(newOwner);
await replica.transferOwnership(newOwner);
expect(await replica.owner()).to.be.equal(newOwner);
});
it('Nonowner cannot transfer ownership', async () => {
const newOwner = fakeUpdater.address;
await expect(
replica.connect(fakeSigner).transferOwnership(newOwner),
).to.be.revertedWith('!owner');
});
it('Owner can rotate updater', async () => {
const newUpdater = fakeUpdater.address;
await replica.setUpdater(newUpdater);
expect(await replica.updater()).to.equal(newUpdater);
});
it('Nonowner cannot rotate updater', async () => {
const newUpdater = fakeUpdater.address;
await expect(
replica.connect(fakeSigner).setUpdater(newUpdater),
).to.be.revertedWith('!owner');
});
it('Halts on fail', async () => {
await replica.setFailed();
expect(await replica.state()).to.equal(AbacusState.FAILED);
const newRoot = ethers.utils.formatBytes32String('new root');
await expect(submitValidUpdate(newRoot)).to.be.revertedWith('failed state');
});
it('Calculated domain hash matches Rust-produced domain hash', async () => {
// Compare Rust output in json file to solidity output (json file matches
// hash for remote domain of 1000)
for (let testCase of homeDomainHashTestCases) {
// deploy replica
const replicaFactory = new TestReplica__factory(signer);
const tempReplica = await replicaFactory.deploy(
testCase.homeDomain,
processGas,
reserveGas,
);
await tempReplica.initialize(
testCase.homeDomain,
updater.address,
ethers.constants.HashZero,
optimisticSeconds,
);
const { expectedDomainHash } = testCase;
const homeDomainHash = await tempReplica.homeDomainHash();
expect(homeDomainHash).to.equal(expectedDomainHash);
}
});
it('Enqueues pending updates', async () => {
const firstNewRoot = ethers.utils.formatBytes32String('first new root');
await submitValidUpdate(firstNewRoot);
expect(await replica.committedRoot()).to.equal(firstNewRoot);
const secondNewRoot = ethers.utils.formatBytes32String('second next root');
await submitValidUpdate(secondNewRoot);
expect(await replica.committedRoot()).to.equal(secondNewRoot);
it('Accepts signed checkpoint from validator', 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();
expect(croot).to.equal(root);
expect(cindex).to.equal(index);
});
it('Rejects update with invalid signature', async () => {
const firstNewRoot = ethers.utils.formatBytes32String('first new root');
await submitValidUpdate(firstNewRoot);
const secondNewRoot = ethers.utils.formatBytes32String('second new root');
const { signature: fakeSignature } = await fakeUpdater.signUpdate(
firstNewRoot,
secondNewRoot,
it('Rejects signed checkpoint from non-validator', 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(
'!validator sig',
);
await expect(
replica.update(firstNewRoot, secondNewRoot, fakeSignature),
).to.be.revertedWith('!updater sig');
});
it('Rejects initial update not building off initial root', async () => {
const fakeInitialRoot = ethers.utils.formatBytes32String('fake root');
const newRoot = ethers.utils.formatBytes32String('new root');
const { signature } = await updater.signUpdate(fakeInitialRoot, newRoot);
await expect(
replica.update(fakeInitialRoot, newRoot, signature),
).to.be.revertedWith('not current update');
});
it('Rejects updates not building off latest enqueued root', async () => {
const firstNewRoot = ethers.utils.formatBytes32String('first new root');
await submitValidUpdate(firstNewRoot);
const fakeLatestRoot = ethers.utils.formatBytes32String('fake root');
const secondNewRoot = ethers.utils.formatBytes32String('second new root');
const { signature } = await updater.signUpdate(
fakeLatestRoot,
secondNewRoot,
it('Rejects old signed checkpoint from validator', 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();
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(
'old checkpoint',
);
await expect(
replica.update(fakeLatestRoot, secondNewRoot, signature),
).to.be.revertedWith('not current update');
});
it('Accepts a double update proof', async () => {
const firstRoot = await replica.committedRoot();
const secondRoot = ethers.utils.formatBytes32String('second root');
const thirdRoot = ethers.utils.formatBytes32String('third root');
const { signature } = await updater.signUpdate(firstRoot, secondRoot);
const { signature: signature2 } = await updater.signUpdate(
firstRoot,
thirdRoot,
);
await expect(
replica.doubleUpdate(
firstRoot,
[secondRoot, thirdRoot],
signature,
signature2,
),
).to.emit(replica, 'DoubleUpdate');
expect(await replica.state()).to.equal(AbacusState.FAILED);
});
it('Proves a valid message', async () => {
@ -217,7 +113,7 @@ describe('Replica', async () => {
const testCase = merkleTestCases[0];
let { leaf, index, path } = testCase.proofs[0];
await replica.setCommittedRoot(testCase.expectedRoot);
await replica.setCheckpoint(testCase.expectedRoot, 1);
// Ensure proper static call return value
expect(await replica.callStatic.prove(leaf, path as BytesArray, index)).to
@ -231,7 +127,7 @@ describe('Replica', async () => {
const testCase = merkleTestCases[0];
let { leaf, index, path } = testCase.proofs[0];
await replica.setCommittedRoot(testCase.expectedRoot);
await replica.setCheckpoint(testCase.expectedRoot, 1);
// Prove message, which changes status to MessageStatus.Pending
await replica.prove(leaf, path as BytesArray, index);
@ -253,7 +149,7 @@ describe('Replica', async () => {
path[0] = path[1];
path[1] = firstHash;
await replica.setCommittedRoot(testCase.expectedRoot);
await replica.setCheckpoint(testCase.expectedRoot, 1);
expect(await replica.callStatic.prove(leaf, path as BytesArray, index)).to
.be.false;
@ -449,7 +345,7 @@ describe('Replica', async () => {
path as BytesArray,
index,
);
await replica.setCommittedRoot(proofRoot);
await replica.setCheckpoint(proofRoot, 1);
await replica.proveAndProcess(abacusMessage, path as BytesArray, index);
@ -478,13 +374,13 @@ describe('Replica', async () => {
// Ensure root given in proof and actual root don't match so that
// replica.prove(...) will fail
const actualRoot = await replica.committedRoot();
const proofRoot = await replica.testBranchRoot(
leaf,
path as BytesArray,
index,
);
expect(proofRoot).to.not.equal(actualRoot);
const rootIndex = await replica.checkpoints(proofRoot);
expect(rootIndex).to.equal(0);
await expect(
replica.proveAndProcess(abacusMessage, path as BytesArray, index),

@ -0,0 +1,149 @@
import { ethers, abacus } from 'hardhat';
import { expect } from 'chai';
import { AbacusState, Validator } from './lib/core';
import { Signer } from './lib/types';
import {
Home__factory,
Home,
ValidatorManager__factory,
ValidatorManager,
} from '../typechain';
const homeDomainHashCases = require('../../../vectors/homeDomainHash.json');
const localDomain = 1000;
describe('ValidatorManager', async () => {
let signer: Signer,
fakeSigner: Signer,
validatorManager: ValidatorManager,
validator: Validator,
fakeValidator: Validator;
before(async () => {
[signer, fakeSigner] = await ethers.getSigners();
validator = await Validator.fromSigner(signer, localDomain);
fakeValidator = await Validator.fromSigner(fakeSigner, localDomain);
});
beforeEach(async () => {
const validatorManagerFactory = new ValidatorManager__factory(signer);
validatorManager = await validatorManagerFactory.deploy();
await validatorManager.setValidator(localDomain, validator.address);
});
it('Accepts validator signature', async () => {
const root = ethers.utils.formatBytes32String('root');
const index = 1;
const { signature } = await validator.signCheckpoint(root, index);
const isValid = await validatorManager.isValidatorSignature(
localDomain,
root,
index,
signature,
);
expect(isValid).to.be.true;
});
it('Rejects non-validator signature', async () => {
const root = ethers.utils.formatBytes32String('root');
const index = 1;
const { signature } = await fakeValidator.signCheckpoint(root, index);
const isValid = await validatorManager.isValidatorSignature(
localDomain,
root,
index,
signature,
);
expect(isValid).to.be.false;
});
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) {
const { expectedDomainHash } = testCase;
const domainHash = await validatorManager.domainHash(testCase.homeDomain);
expect(domainHash).to.equal(expectedDomainHash);
}
});
describe('improper checkpoints', async () => {
let home: Home;
beforeEach(async () => {
const homeFactory = new Home__factory(signer);
home = await homeFactory.deploy(localDomain);
await home.initialize(validatorManager.address);
});
it('Accepts improper checkpoint from validator', async () => {
const root = ethers.utils.formatBytes32String('root');
const index = 1;
const { signature } = await validator.signCheckpoint(root, index);
// Send message with signer address as msg.sender
await expect(
validatorManager.improperCheckpoint(
home.address,
root,
index,
signature,
),
)
.to.emit(validatorManager, 'ImproperCheckpoint')
.withArgs(
home.address,
localDomain,
validator.address,
root,
index,
signature,
);
expect(await home.state()).to.equal(AbacusState.FAILED);
});
it('Rejects improper checkpoint from non-validator', async () => {
const root = ethers.utils.formatBytes32String('root');
const index = 1;
const { signature } = await fakeValidator.signCheckpoint(root, index);
// Send message with signer address as msg.sender
await expect(
validatorManager.improperCheckpoint(
home.address,
root,
index,
signature,
),
).to.be.revertedWith('!validator sig');
});
it('Rejects proper checkpoint from validator', async () => {
const message = `0x${Buffer.alloc(10).toString('hex')}`;
await home.dispatch(
localDomain,
abacus.ethersAddressToBytes32(signer.address),
message,
);
await home.checkpoint();
const [root, index] = await home.latestCheckpoint();
const { signature } = await validator.signCheckpoint(
root,
index.toNumber(),
);
// Send message with signer address as msg.sender
await expect(
validatorManager.improperCheckpoint(
home.address,
root,
index,
signature,
),
).to.be.revertedWith('!improper');
});
});
});

@ -4,11 +4,11 @@ import { expect } from 'chai';
import {
TestHome__factory,
TestReplica__factory,
TestXAppConnectionManager,
TestXAppConnectionManager__factory,
XAppConnectionManager,
XAppConnectionManager__factory,
TestReplica,
} from '../typechain';
import { Updater } from './lib/core';
import { Validator } from './lib/core';
import { Signer } from './lib/types';
const signedFailureTestCases = require('../../../vectors/signedFailure.json');
@ -18,17 +18,17 @@ const localDomain = 1000;
const remoteDomain = 2000;
const processGas = 850000;
const reserveGas = 15000;
const optimisticSeconds = 3;
const nullRoot = '0x' + '00'.repeat(32);
describe('XAppConnectionManager', async () => {
let connectionManager: TestXAppConnectionManager,
let connectionManager: XAppConnectionManager,
enrolledReplica: TestReplica,
signer: Signer,
updater: Updater;
validator: Validator;
before(async () => {
[signer] = await ethers.getSigners();
updater = await Updater.fromSigner(signer, localDomain);
validator = await Validator.fromSigner(signer, localDomain);
});
beforeEach(async () => {
@ -41,19 +41,14 @@ describe('XAppConnectionManager', async () => {
processGas,
reserveGas,
);
await enrolledReplica.initialize(
remoteDomain,
updater.address,
ethers.constants.HashZero,
optimisticSeconds,
);
// The ValidatorManager is unused in these tests *but* needs to be a
// contract.
await enrolledReplica.initialize(remoteDomain, home.address, nullRoot, 0);
const connectionManagerFactory = new TestXAppConnectionManager__factory(
signer,
);
const connectionManagerFactory = new XAppConnectionManager__factory(signer);
connectionManager = await connectionManagerFactory.deploy();
await connectionManager.setHome(home.address);
await connectionManager.ownerEnrollReplica(
await connectionManager.enrollReplica(
enrolledReplica.address,
remoteDomain,
);
@ -86,7 +81,7 @@ describe('XAppConnectionManager', async () => {
expect(await connectionManager.home()).to.equal(newHome.address);
});
it('Owner can enroll a new replica', async () => {
it('Owner can enroll a replica', async () => {
const newRemoteDomain = 3000;
const replicaFactory = new TestReplica__factory(signer);
const newReplica = await replicaFactory.deploy(
@ -99,7 +94,7 @@ describe('XAppConnectionManager', async () => {
expect(await connectionManager.isReplica(newReplica.address)).to.be.false;
await expect(
connectionManager.ownerEnrollReplica(newReplica.address, newRemoteDomain),
connectionManager.enrollReplica(newReplica.address, newRemoteDomain),
).to.emit(connectionManager, 'ReplicaEnrolled');
expect(await connectionManager.domainToReplica(newRemoteDomain)).to.equal(
@ -113,66 +108,7 @@ describe('XAppConnectionManager', async () => {
it('Owner can unenroll a replica', async () => {
await expect(
connectionManager.ownerUnenrollReplica(enrolledReplica.address),
).to.emit(connectionManager, 'ReplicaUnenrolled');
expect(
await connectionManager.replicaToDomain(enrolledReplica.address),
).to.equal(0);
expect(await connectionManager.domainToReplica(localDomain)).to.equal(
ethers.constants.AddressZero,
);
expect(await connectionManager.isReplica(enrolledReplica.address)).to.be
.false;
});
it('Owner can set watcher permissions', async () => {
const [watcher] = await ethers.getSigners();
expect(
await connectionManager.watcherPermission(watcher.address, remoteDomain),
).to.be.false;
await expect(
connectionManager.setWatcherPermission(
watcher.address,
remoteDomain,
true,
),
).to.emit(connectionManager, 'WatcherPermissionSet');
expect(
await connectionManager.watcherPermission(watcher.address, remoteDomain),
).to.be.true;
});
it('Unenrolls a replica given valid SignedFailureNotification', async () => {
// Set watcher permissions for domain of currently enrolled replica
const [watcher] = await ethers.getSigners();
await connectionManager.setWatcherPermission(
watcher.address,
remoteDomain,
true,
);
// Create signed failure notification and signature
const { failureNotification, signature } =
await abacus.signedFailureNotification(
watcher,
remoteDomain,
await updater.signer.getAddress(),
);
// Assert new replica considered replica before unenrolled
expect(await connectionManager.isReplica(enrolledReplica.address)).to.be
.true;
// Unenroll replica using data + signature
await expect(
connectionManager.unenrollReplica(
failureNotification.domain,
failureNotification.updaterBytes32,
signature,
),
connectionManager.unenrollReplica(enrolledReplica.address),
).to.emit(connectionManager, 'ReplicaUnenrolled');
expect(
@ -184,109 +120,4 @@ describe('XAppConnectionManager', async () => {
expect(await connectionManager.isReplica(enrolledReplica.address)).to.be
.false;
});
it('unenrollReplica reverts if there is no replica for provided domain', async () => {
const noReplicaDomain = 3000;
// Set watcher permissions for noReplicaDomain
const [watcher] = await ethers.getSigners();
await connectionManager.setWatcherPermission(
watcher.address,
noReplicaDomain,
true,
);
// Create signed failure notification and signature for noReplicaDomain
const { failureNotification, signature } =
await abacus.signedFailureNotification(
watcher,
noReplicaDomain,
await updater.signer.getAddress(),
);
// Expect unenrollReplica call to revert
await expect(
connectionManager.unenrollReplica(
failureNotification.domain,
failureNotification.updaterBytes32,
signature,
),
).to.be.revertedWith('!replica exists');
});
it('unenrollReplica reverts if provided updater does not match replica updater', async () => {
const [watcher, nonUpdater] = await ethers.getSigners();
// Set watcher permissions
await connectionManager.setWatcherPermission(
watcher.address,
remoteDomain,
true,
);
// Create signed failure notification and signature with nonUpdater
const { failureNotification, signature } =
await abacus.signedFailureNotification(
watcher,
remoteDomain,
nonUpdater.address,
);
// Expect unenrollReplica call to revert
await expect(
connectionManager.unenrollReplica(
failureNotification.domain,
failureNotification.updaterBytes32,
signature,
),
).to.be.revertedWith('!current updater');
});
it('unenrollReplica reverts if incorrect watcher provided', async () => {
const [watcher, nonWatcher] = await ethers.getSigners();
// Set watcher permissions
await connectionManager.setWatcherPermission(
watcher.address,
remoteDomain,
true,
);
// Create signed failure notification and signature with nonWatcher
const { failureNotification, signature } =
await abacus.signedFailureNotification(
nonWatcher,
remoteDomain,
await updater.signer.getAddress(),
);
// Expect unenrollReplica call to revert
await expect(
connectionManager.unenrollReplica(
failureNotification.domain,
failureNotification.updaterBytes32,
signature,
),
).to.be.revertedWith('!valid watcher');
});
it('Checks Rust-produced SignedFailureNotification', async () => {
// Compare Rust output in json file to solidity output
const testCase = signedFailureTestCases[0];
const { domain, updater, signature, signer } = testCase;
await enrolledReplica.setUpdater(updater);
await connectionManager.setWatcherPermission(signer, domain, true);
// Just performs signature recovery (not dependent on replica state, just
// tests functionality)
const watcher = await connectionManager.testRecoverWatcherFromSig(
domain,
enrolledReplica.address,
updater,
ethers.utils.joinSignature(signature),
);
expect(watcher.toLowerCase()).to.equal(signer);
});
});

@ -21,61 +21,94 @@ import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface CommonInterface extends ethers.utils.Interface {
functions: {
"committedRoot()": FunctionFragment;
"doubleUpdate(bytes32,bytes32[2],bytes,bytes)": FunctionFragment;
"homeDomainHash()": FunctionFragment;
"checkpointedRoot()": FunctionFragment;
"checkpoints(bytes32)": FunctionFragment;
"latestCheckpoint()": FunctionFragment;
"localDomain()": FunctionFragment;
"state()": FunctionFragment;
"updater()": FunctionFragment;
"owner()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"setValidatorManager(address)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"validatorManager()": FunctionFragment;
};
encodeFunctionData(
functionFragment: "committedRoot",
functionFragment: "checkpointedRoot",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "doubleUpdate",
values: [BytesLike, [BytesLike, BytesLike], BytesLike, BytesLike]
functionFragment: "checkpoints",
values: [BytesLike]
): string;
encodeFunctionData(
functionFragment: "homeDomainHash",
functionFragment: "latestCheckpoint",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "localDomain",
values?: undefined
): string;
encodeFunctionData(functionFragment: "state", values?: undefined): string;
encodeFunctionData(functionFragment: "updater", values?: undefined): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "setValidatorManager",
values: [string]
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(
functionFragment: "validatorManager",
values?: undefined
): string;
decodeFunctionResult(
functionFragment: "committedRoot",
functionFragment: "checkpointedRoot",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "doubleUpdate",
functionFragment: "checkpoints",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "homeDomainHash",
functionFragment: "latestCheckpoint",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "localDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "state", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "updater", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "setValidatorManager",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "validatorManager",
data: BytesLike
): Result;
events: {
"DoubleUpdate(bytes32,bytes32[2],bytes,bytes)": EventFragment;
"NewUpdater(address)": EventFragment;
"Update(uint32,bytes32,bytes32,bytes)": EventFragment;
"Checkpoint(bytes32,uint256)": EventFragment;
"NewValidatorManager(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "DoubleUpdate"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewUpdater"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Update"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Checkpoint"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewValidatorManager"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
}
export class Common extends BaseContract {
@ -122,134 +155,172 @@ export class Common extends BaseContract {
interface: CommonInterface;
functions: {
committedRoot(overrides?: CallOverrides): Promise<[string]>;
checkpointedRoot(overrides?: CallOverrides): Promise<[string]>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<[BigNumber]>;
homeDomainHash(overrides?: CallOverrides): Promise<[string]>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<[number]>;
state(overrides?: CallOverrides): Promise<[number]>;
owner(overrides?: CallOverrides): Promise<[string]>;
updater(overrides?: CallOverrides): Promise<[string]>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
validatorManager(overrides?: CallOverrides): Promise<[string]>;
};
committedRoot(overrides?: CallOverrides): Promise<string>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
state(overrides?: CallOverrides): Promise<number>;
owner(overrides?: CallOverrides): Promise<string>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setValidatorManager(
_validatorManager: 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>;
validatorManager(overrides?: CallOverrides): Promise<string>;
callStatic: {
committedRoot(overrides?: CallOverrides): Promise<string>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: CallOverrides
): Promise<void>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
state(overrides?: CallOverrides): Promise<number>;
owner(overrides?: CallOverrides): Promise<string>;
updater(overrides?: CallOverrides): Promise<string>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
setValidatorManager(
_validatorManager: string,
overrides?: CallOverrides
): Promise<void>;
transferOwnership(
newOwner: string,
overrides?: CallOverrides
): Promise<void>;
validatorManager(overrides?: CallOverrides): Promise<string>;
};
filters: {
DoubleUpdate(
oldRoot?: null,
newRoot?: null,
signature?: null,
signature2?: null
Checkpoint(
root?: BytesLike | null,
index?: BigNumberish | null
): TypedEventFilter<
[string, [string, string], string, string],
{
oldRoot: string;
newRoot: [string, string];
signature: string;
signature2: string;
}
[string, BigNumber],
{ root: string; index: BigNumber }
>;
NewUpdater(updater?: null): TypedEventFilter<[string], { updater: string }>;
NewValidatorManager(
validatorManager?: null
): TypedEventFilter<[string], { validatorManager: string }>;
Update(
homeDomain?: BigNumberish | null,
oldRoot?: BytesLike | null,
newRoot?: BytesLike | null,
signature?: null
OwnershipTransferred(
previousOwner?: string | null,
newOwner?: string | null
): TypedEventFilter<
[number, string, string, string],
{
homeDomain: number;
oldRoot: string;
newRoot: string;
signature: string;
}
[string, string],
{ previousOwner: string; newOwner: string }
>;
};
estimateGas: {
committedRoot(overrides?: CallOverrides): Promise<BigNumber>;
checkpointedRoot(overrides?: CallOverrides): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
homeDomainHash(overrides?: CallOverrides): Promise<BigNumber>;
latestCheckpoint(overrides?: CallOverrides): Promise<BigNumber>;
localDomain(overrides?: CallOverrides): Promise<BigNumber>;
state(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<BigNumber>;
updater(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
validatorManager(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
committedRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
checkpointedRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<PopulatedTransaction>;
latestCheckpoint(overrides?: CallOverrides): Promise<PopulatedTransaction>;
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
state(overrides?: CallOverrides): Promise<PopulatedTransaction>;
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
setValidatorManager(
_validatorManager: 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>;
validatorManager(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -23,30 +23,24 @@ interface HomeInterface extends ethers.utils.Interface {
functions: {
"MAX_MESSAGE_BODY_BYTES()": FunctionFragment;
"VERSION()": FunctionFragment;
"committedRoot()": FunctionFragment;
"checkpoint()": FunctionFragment;
"checkpointedRoot()": FunctionFragment;
"checkpoints(bytes32)": FunctionFragment;
"count()": FunctionFragment;
"dispatch(uint32,bytes32,bytes)": FunctionFragment;
"doubleUpdate(bytes32,bytes32[2],bytes,bytes)": FunctionFragment;
"homeDomainHash()": FunctionFragment;
"improperUpdate(bytes32,bytes32,bytes)": FunctionFragment;
"fail()": FunctionFragment;
"initialize(address)": FunctionFragment;
"latestCheckpoint()": FunctionFragment;
"localDomain()": FunctionFragment;
"nonces(uint32)": FunctionFragment;
"owner()": FunctionFragment;
"queueContains(bytes32)": FunctionFragment;
"queueEnd()": FunctionFragment;
"queueLength()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"root()": FunctionFragment;
"setUpdater(address)": FunctionFragment;
"setUpdaterManager(address)": FunctionFragment;
"setValidatorManager(address)": FunctionFragment;
"state()": FunctionFragment;
"suggestUpdate()": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"tree()": FunctionFragment;
"update(bytes32,bytes32,bytes)": FunctionFragment;
"updater()": FunctionFragment;
"updaterManager()": FunctionFragment;
"validatorManager()": FunctionFragment;
};
encodeFunctionData(
@ -55,27 +49,28 @@ interface HomeInterface extends ethers.utils.Interface {
): string;
encodeFunctionData(functionFragment: "VERSION", values?: undefined): string;
encodeFunctionData(
functionFragment: "committedRoot",
functionFragment: "checkpoint",
values?: undefined
): string;
encodeFunctionData(functionFragment: "count", values?: undefined): string;
encodeFunctionData(
functionFragment: "dispatch",
values: [BigNumberish, BytesLike, BytesLike]
functionFragment: "checkpointedRoot",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "doubleUpdate",
values: [BytesLike, [BytesLike, BytesLike], BytesLike, BytesLike]
functionFragment: "checkpoints",
values: [BytesLike]
): string;
encodeFunctionData(functionFragment: "count", values?: undefined): string;
encodeFunctionData(
functionFragment: "homeDomainHash",
values?: undefined
functionFragment: "dispatch",
values: [BigNumberish, BytesLike, BytesLike]
): string;
encodeFunctionData(functionFragment: "fail", values?: undefined): string;
encodeFunctionData(functionFragment: "initialize", values: [string]): string;
encodeFunctionData(
functionFragment: "improperUpdate",
values: [BytesLike, BytesLike, BytesLike]
functionFragment: "latestCheckpoint",
values?: undefined
): string;
encodeFunctionData(functionFragment: "initialize", values: [string]): string;
encodeFunctionData(
functionFragment: "localDomain",
values?: undefined
@ -85,42 +80,23 @@ interface HomeInterface extends ethers.utils.Interface {
values: [BigNumberish]
): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(
functionFragment: "queueContains",
values: [BytesLike]
): string;
encodeFunctionData(functionFragment: "queueEnd", values?: undefined): string;
encodeFunctionData(
functionFragment: "queueLength",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(functionFragment: "root", values?: undefined): string;
encodeFunctionData(functionFragment: "setUpdater", values: [string]): string;
encodeFunctionData(
functionFragment: "setUpdaterManager",
functionFragment: "setValidatorManager",
values: [string]
): string;
encodeFunctionData(functionFragment: "state", values?: undefined): string;
encodeFunctionData(
functionFragment: "suggestUpdate",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(functionFragment: "tree", values?: undefined): string;
encodeFunctionData(
functionFragment: "update",
values: [BytesLike, BytesLike, BytesLike]
): string;
encodeFunctionData(functionFragment: "updater", values?: undefined): string;
encodeFunctionData(
functionFragment: "updaterManager",
functionFragment: "validatorManager",
values?: undefined
): string;
@ -129,86 +105,62 @@ interface HomeInterface extends ethers.utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "VERSION", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "checkpoint", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "committedRoot",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "count", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "dispatch", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "doubleUpdate",
functionFragment: "checkpointedRoot",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "homeDomainHash",
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: "improperUpdate",
functionFragment: "latestCheckpoint",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "localDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "queueContains",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "queueEnd", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "queueLength",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "root", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "setUpdater", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "setUpdaterManager",
functionFragment: "setValidatorManager",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "state", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "suggestUpdate",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "tree", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "update", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "updater", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "updaterManager",
functionFragment: "validatorManager",
data: BytesLike
): Result;
events: {
"Checkpoint(bytes32,uint256)": EventFragment;
"Dispatch(bytes32,uint256,uint64,bytes32,bytes)": EventFragment;
"DoubleUpdate(bytes32,bytes32[2],bytes,bytes)": EventFragment;
"ImproperUpdate(bytes32,bytes32,bytes)": EventFragment;
"NewUpdater(address)": EventFragment;
"NewUpdaterManager(address)": EventFragment;
"Fail()": EventFragment;
"NewValidatorManager(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
"Update(uint32,bytes32,bytes32,bytes)": EventFragment;
"UpdaterSlashed(address,address)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "Checkpoint"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Dispatch"): EventFragment;
getEvent(nameOrSignatureOrTopic: "DoubleUpdate"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ImproperUpdate"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewUpdater"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewUpdaterManager"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Fail"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewValidatorManager"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Update"): EventFragment;
getEvent(nameOrSignatureOrTopic: "UpdaterSlashed"): EventFragment;
}
export class Home extends BaseContract {
@ -259,7 +211,16 @@ export class Home extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<[number]>;
committedRoot(overrides?: CallOverrides): Promise<[string]>;
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]>;
@ -270,65 +231,38 @@ export class Home extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<[string]>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
initialize(
_updaterManager: string,
_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]>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<[boolean]>;
queueEnd(overrides?: CallOverrides): Promise<[string]>;
queueLength(overrides?: CallOverrides): Promise<[BigNumber]>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
root(overrides?: CallOverrides): Promise<[string]>;
setUpdater(
_updater: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setUpdaterManager(
_updaterManager: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<[number]>;
suggestUpdate(
overrides?: CallOverrides
): Promise<[string, string] & { _committedRoot: string; _new: string }>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
@ -338,23 +272,20 @@ export class Home extends BaseContract {
overrides?: CallOverrides
): Promise<[BigNumber] & { count: BigNumber }>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<[string]>;
updaterManager(overrides?: CallOverrides): Promise<[string]>;
validatorManager(overrides?: CallOverrides): Promise<[string]>;
};
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<BigNumber>;
VERSION(overrides?: CallOverrides): Promise<number>;
committedRoot(overrides?: CallOverrides): Promise<string>;
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>;
@ -365,62 +296,38 @@ export class Home extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
initialize(
_updaterManager: string,
_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>;
queueContains(_item: BytesLike, overrides?: CallOverrides): Promise<boolean>;
queueEnd(overrides?: CallOverrides): Promise<string>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
root(overrides?: CallOverrides): Promise<string>;
setUpdater(
_updater: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setUpdaterManager(
_updaterManager: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<number>;
suggestUpdate(
overrides?: CallOverrides
): Promise<[string, string] & { _committedRoot: string; _new: string }>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
@ -428,23 +335,18 @@ export class Home extends BaseContract {
tree(overrides?: CallOverrides): Promise<BigNumber>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<string>;
updaterManager(overrides?: CallOverrides): Promise<string>;
validatorManager(overrides?: CallOverrides): Promise<string>;
callStatic: {
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<BigNumber>;
VERSION(overrides?: CallOverrides): Promise<number>;
committedRoot(overrides?: CallOverrides): Promise<string>;
checkpoint(overrides?: CallOverrides): Promise<void>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
count(overrides?: CallOverrides): Promise<BigNumber>;
@ -455,60 +357,34 @@ export class Home extends BaseContract {
overrides?: CallOverrides
): Promise<void>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: CallOverrides
): Promise<void>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
fail(overrides?: CallOverrides): Promise<void>;
initialize(
_updaterManager: string,
_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>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
queueEnd(overrides?: CallOverrides): Promise<string>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
root(overrides?: CallOverrides): Promise<string>;
setUpdater(_updater: string, overrides?: CallOverrides): Promise<void>;
setUpdaterManager(
_updaterManager: string,
setValidatorManager(
_validatorManager: string,
overrides?: CallOverrides
): Promise<void>;
state(overrides?: CallOverrides): Promise<number>;
suggestUpdate(
overrides?: CallOverrides
): Promise<[string, string] & { _committedRoot: string; _new: string }>;
transferOwnership(
newOwner: string,
overrides?: CallOverrides
@ -516,24 +392,23 @@ export class Home extends BaseContract {
tree(overrides?: CallOverrides): Promise<BigNumber>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<void>;
updater(overrides?: CallOverrides): Promise<string>;
updaterManager(overrides?: CallOverrides): Promise<string>;
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,
committedRoot?: null,
checkpointedRoot?: null,
message?: null
): TypedEventFilter<
[string, BigNumber, BigNumber, string, string],
@ -541,40 +416,16 @@ export class Home extends BaseContract {
messageHash: string;
leafIndex: BigNumber;
destinationAndNonce: BigNumber;
committedRoot: string;
checkpointedRoot: string;
message: string;
}
>;
DoubleUpdate(
oldRoot?: null,
newRoot?: null,
signature?: null,
signature2?: null
): TypedEventFilter<
[string, [string, string], string, string],
{
oldRoot: string;
newRoot: [string, string];
signature: string;
signature2: string;
}
>;
Fail(): TypedEventFilter<[], {}>;
ImproperUpdate(
oldRoot?: null,
newRoot?: null,
signature?: null
): TypedEventFilter<
[string, string, string],
{ oldRoot: string; newRoot: string; signature: string }
>;
NewUpdater(updater?: null): TypedEventFilter<[string], { updater: string }>;
NewUpdaterManager(
updaterManager?: null
): TypedEventFilter<[string], { updaterManager: string }>;
NewValidatorManager(
validatorManager?: null
): TypedEventFilter<[string], { validatorManager: string }>;
OwnershipTransferred(
previousOwner?: string | null,
@ -583,29 +434,6 @@ export class Home extends BaseContract {
[string, string],
{ previousOwner: string; newOwner: string }
>;
Update(
homeDomain?: BigNumberish | null,
oldRoot?: BytesLike | null,
newRoot?: BytesLike | null,
signature?: null
): TypedEventFilter<
[number, string, string, string],
{
homeDomain: number;
oldRoot: string;
newRoot: string;
signature: string;
}
>;
UpdaterSlashed(
updater?: string | null,
reporter?: string | null
): TypedEventFilter<
[string, string],
{ updater: string; reporter: string }
>;
};
estimateGas: {
@ -613,7 +441,13 @@ export class Home extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<BigNumber>;
committedRoot(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>;
@ -624,63 +458,36 @@ export class Home extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
homeDomainHash(overrides?: CallOverrides): Promise<BigNumber>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
initialize(
_updaterManager: string,
_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>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<BigNumber>;
queueEnd(overrides?: CallOverrides): Promise<BigNumber>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
root(overrides?: CallOverrides): Promise<BigNumber>;
setUpdater(
_updater: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
setUpdaterManager(
_updaterManager: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
state(overrides?: CallOverrides): Promise<BigNumber>;
suggestUpdate(overrides?: CallOverrides): Promise<BigNumber>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
@ -688,16 +495,7 @@ export class Home extends BaseContract {
tree(overrides?: CallOverrides): Promise<BigNumber>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
updater(overrides?: CallOverrides): Promise<BigNumber>;
updaterManager(overrides?: CallOverrides): Promise<BigNumber>;
validatorManager(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
@ -707,7 +505,16 @@ export class Home extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<PopulatedTransaction>;
committedRoot(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>;
@ -718,28 +525,17 @@ export class Home extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<PopulatedTransaction>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
initialize(
_updaterManager: string,
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
latestCheckpoint(overrides?: CallOverrides): Promise<PopulatedTransaction>;
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
nonces(
@ -749,35 +545,19 @@ export class Home extends BaseContract {
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
queueEnd(overrides?: CallOverrides): Promise<PopulatedTransaction>;
queueLength(overrides?: CallOverrides): Promise<PopulatedTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
root(overrides?: CallOverrides): Promise<PopulatedTransaction>;
setUpdater(
_updater: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
setUpdaterManager(
_updaterManager: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
state(overrides?: CallOverrides): Promise<PopulatedTransaction>;
suggestUpdate(overrides?: CallOverrides): Promise<PopulatedTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
@ -785,15 +565,6 @@ export class Home extends BaseContract {
tree(overrides?: CallOverrides): Promise<PopulatedTransaction>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
updater(overrides?: CallOverrides): Promise<PopulatedTransaction>;
updaterManager(overrides?: CallOverrides): Promise<PopulatedTransaction>;
validatorManager(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -11,7 +11,6 @@ import {
PopulatedTransaction,
BaseContract,
ContractTransaction,
Overrides,
CallOverrides,
} from "ethers";
import { BytesLike } from "@ethersproject/bytes";
@ -19,28 +18,25 @@ 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 {
interface IValidatorManagerInterface extends ethers.utils.Interface {
functions: {
"slashUpdater(address)": FunctionFragment;
"updater()": FunctionFragment;
"isValidatorSignature(uint32,bytes32,uint256,bytes)": FunctionFragment;
};
encodeFunctionData(
functionFragment: "slashUpdater",
values: [string]
functionFragment: "isValidatorSignature",
values: [BigNumberish, BytesLike, BigNumberish, BytesLike]
): string;
encodeFunctionData(functionFragment: "updater", values?: undefined): string;
decodeFunctionResult(
functionFragment: "slashUpdater",
functionFragment: "isValidatorSignature",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "updater", data: BytesLike): Result;
events: {};
}
export class IUpdaterManager extends BaseContract {
export class IValidatorManager extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
@ -81,47 +77,55 @@ export class IUpdaterManager extends BaseContract {
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: IUpdaterManagerInterface;
interface: IValidatorManagerInterface;
functions: {
slashUpdater(
_reporter: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<[string]>;
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<[boolean]>;
};
slashUpdater(
_reporter: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<string>;
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
callStatic: {
slashUpdater(_reporter: string, overrides?: CallOverrides): Promise<void>;
updater(overrides?: CallOverrides): Promise<string>;
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
};
filters: {};
estimateGas: {
slashUpdater(
_reporter: string,
overrides?: Overrides & { from?: string | Promise<string> }
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<BigNumber>;
updater(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
slashUpdater(
_reporter: string,
overrides?: Overrides & { from?: string | Promise<string> }
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
updater(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -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>;
};
}

@ -24,25 +24,22 @@ interface ReplicaInterface extends ethers.utils.Interface {
"PROCESS_GAS()": FunctionFragment;
"RESERVE_GAS()": FunctionFragment;
"VERSION()": FunctionFragment;
"acceptableRoot(bytes32)": FunctionFragment;
"committedRoot()": FunctionFragment;
"confirmAt(bytes32)": FunctionFragment;
"doubleUpdate(bytes32,bytes32[2],bytes,bytes)": FunctionFragment;
"homeDomainHash()": FunctionFragment;
"checkpoint(bytes32,uint256,bytes)": FunctionFragment;
"checkpointedRoot()": FunctionFragment;
"checkpoints(bytes32)": FunctionFragment;
"initialize(uint32,address,bytes32,uint256)": FunctionFragment;
"latestCheckpoint()": FunctionFragment;
"localDomain()": FunctionFragment;
"messages(bytes32)": FunctionFragment;
"optimisticSeconds()": FunctionFragment;
"owner()": FunctionFragment;
"process(bytes)": FunctionFragment;
"prove(bytes32,bytes32[32],uint256)": FunctionFragment;
"proveAndProcess(bytes,bytes32[32],uint256)": FunctionFragment;
"remoteDomain()": FunctionFragment;
"setUpdater(address)": FunctionFragment;
"state()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"setValidatorManager(address)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"update(bytes32,bytes32,bytes)": FunctionFragment;
"updater()": FunctionFragment;
"validatorManager()": FunctionFragment;
};
encodeFunctionData(
@ -55,38 +52,30 @@ interface ReplicaInterface extends ethers.utils.Interface {
): string;
encodeFunctionData(functionFragment: "VERSION", values?: undefined): string;
encodeFunctionData(
functionFragment: "acceptableRoot",
values: [BytesLike]
functionFragment: "checkpoint",
values: [BytesLike, BigNumberish, BytesLike]
): string;
encodeFunctionData(
functionFragment: "committedRoot",
functionFragment: "checkpointedRoot",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "confirmAt",
functionFragment: "checkpoints",
values: [BytesLike]
): string;
encodeFunctionData(
functionFragment: "doubleUpdate",
values: [BytesLike, [BytesLike, BytesLike], BytesLike, BytesLike]
): string;
encodeFunctionData(
functionFragment: "homeDomainHash",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "initialize",
values: [BigNumberish, string, BytesLike, BigNumberish]
): string;
encodeFunctionData(
functionFragment: "localDomain",
functionFragment: "latestCheckpoint",
values?: undefined
): string;
encodeFunctionData(functionFragment: "messages", values: [BytesLike]): string;
encodeFunctionData(
functionFragment: "optimisticSeconds",
functionFragment: "localDomain",
values?: undefined
): string;
encodeFunctionData(functionFragment: "messages", values: [BytesLike]): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(functionFragment: "process", values: [BytesLike]): string;
encodeFunctionData(
@ -175,17 +164,22 @@ interface ReplicaInterface extends ethers.utils.Interface {
functionFragment: "remoteDomain",
values?: undefined
): string;
encodeFunctionData(functionFragment: "setUpdater", values: [string]): string;
encodeFunctionData(functionFragment: "state", values?: undefined): string;
encodeFunctionData(
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "setValidatorManager",
values: [string]
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(
functionFragment: "update",
values: [BytesLike, BytesLike, BytesLike]
functionFragment: "validatorManager",
values?: undefined
): string;
encodeFunctionData(functionFragment: "updater", values?: undefined): string;
decodeFunctionResult(
functionFragment: "PROCESS_GAS",
@ -196,33 +190,25 @@ interface ReplicaInterface extends ethers.utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "VERSION", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "checkpoint", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "acceptableRoot",
functionFragment: "checkpointedRoot",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "committedRoot",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "confirmAt", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "doubleUpdate",
functionFragment: "checkpoints",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "homeDomainHash",
functionFragment: "latestCheckpoint",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "localDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "messages", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "optimisticSeconds",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "process", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "prove", data: BytesLike): Result;
@ -234,28 +220,34 @@ interface ReplicaInterface extends ethers.utils.Interface {
functionFragment: "remoteDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setUpdater", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "state", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "setValidatorManager",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "update", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "updater", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "validatorManager",
data: BytesLike
): Result;
events: {
"DoubleUpdate(bytes32,bytes32[2],bytes,bytes)": EventFragment;
"NewUpdater(address)": EventFragment;
"Checkpoint(bytes32,uint256)": EventFragment;
"NewValidatorManager(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
"Process(bytes32,bool,bytes)": EventFragment;
"Update(uint32,bytes32,bytes32,bytes)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "DoubleUpdate"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewUpdater"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Checkpoint"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewValidatorManager"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Process"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Update"): EventFragment;
}
export class Replica extends BaseContract {
@ -308,39 +300,36 @@ export class Replica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<[number]>;
acceptableRoot(
checkpoint(
_root: BytesLike,
overrides?: CallOverrides
): Promise<[boolean]>;
committedRoot(overrides?: CallOverrides): Promise<[string]>;
confirmAt(arg0: BytesLike, overrides?: CallOverrides): Promise<[BigNumber]>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_index: BigNumberish,
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<[string]>;
checkpointedRoot(overrides?: CallOverrides): Promise<[string]>;
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<[BigNumber]>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<[number]>;
messages(arg0: BytesLike, overrides?: CallOverrides): Promise<[number]>;
optimisticSeconds(overrides?: CallOverrides): Promise<[BigNumber]>;
owner(overrides?: CallOverrides): Promise<[string]>;
process(
@ -430,26 +419,21 @@ export class Replica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<[number]>;
setUpdater(
_updater: string,
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<[number]>;
transferOwnership(
newOwner: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<[string]>;
validatorManager(overrides?: CallOverrides): Promise<[string]>;
};
PROCESS_GAS(overrides?: CallOverrides): Promise<BigNumber>;
@ -458,36 +442,33 @@ export class Replica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<number>;
acceptableRoot(_root: BytesLike, overrides?: CallOverrides): Promise<boolean>;
committedRoot(overrides?: CallOverrides): Promise<string>;
confirmAt(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
checkpoint(
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
messages(arg0: BytesLike, overrides?: CallOverrides): Promise<number>;
optimisticSeconds(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<string>;
process(
@ -577,26 +558,21 @@ export class Replica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<number>;
setUpdater(
_updater: string,
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<number>;
transferOwnership(
newOwner: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<string>;
validatorManager(overrides?: CallOverrides): Promise<string>;
callStatic: {
PROCESS_GAS(overrides?: CallOverrides): Promise<BigNumber>;
@ -605,39 +581,33 @@ export class Replica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<number>;
acceptableRoot(
checkpoint(
_root: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
committedRoot(overrides?: CallOverrides): Promise<string>;
confirmAt(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_index: BigNumberish,
_signature: BytesLike,
_signature2: BytesLike,
overrides?: CallOverrides
): Promise<void>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: CallOverrides
): Promise<void>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
messages(arg0: BytesLike, overrides?: CallOverrides): Promise<number>;
optimisticSeconds(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<string>;
process(_message: BytesLike, overrides?: CallOverrides): Promise<boolean>;
@ -724,42 +694,33 @@ export class Replica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<number>;
setUpdater(_updater: string, overrides?: CallOverrides): Promise<void>;
state(overrides?: CallOverrides): Promise<number>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
transferOwnership(
newOwner: string,
setValidatorManager(
_validatorManager: string,
overrides?: CallOverrides
): Promise<void>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
transferOwnership(
newOwner: string,
overrides?: CallOverrides
): Promise<void>;
updater(overrides?: CallOverrides): Promise<string>;
validatorManager(overrides?: CallOverrides): Promise<string>;
};
filters: {
DoubleUpdate(
oldRoot?: null,
newRoot?: null,
signature?: null,
signature2?: null
Checkpoint(
root?: BytesLike | null,
index?: BigNumberish | null
): TypedEventFilter<
[string, [string, string], string, string],
{
oldRoot: string;
newRoot: [string, string];
signature: string;
signature2: string;
}
[string, BigNumber],
{ root: string; index: BigNumber }
>;
NewUpdater(updater?: null): TypedEventFilter<[string], { updater: string }>;
NewValidatorManager(
validatorManager?: null
): TypedEventFilter<[string], { validatorManager: string }>;
OwnershipTransferred(
previousOwner?: string | null,
@ -777,21 +738,6 @@ export class Replica extends BaseContract {
[string, boolean, string],
{ messageHash: string; success: boolean; returnData: string }
>;
Update(
homeDomain?: BigNumberish | null,
oldRoot?: BytesLike | null,
newRoot?: BytesLike | null,
signature?: null
): TypedEventFilter<
[number, string, string, string],
{
homeDomain: number;
oldRoot: string;
newRoot: string;
signature: string;
}
>;
};
estimateGas: {
@ -801,39 +747,31 @@ export class Replica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<BigNumber>;
acceptableRoot(
checkpoint(
_root: BytesLike,
overrides?: CallOverrides
): Promise<BigNumber>;
committedRoot(overrides?: CallOverrides): Promise<BigNumber>;
confirmAt(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_index: BigNumberish,
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
homeDomainHash(overrides?: CallOverrides): Promise<BigNumber>;
checkpointedRoot(overrides?: CallOverrides): Promise<BigNumber>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
latestCheckpoint(overrides?: CallOverrides): Promise<BigNumber>;
localDomain(overrides?: CallOverrides): Promise<BigNumber>;
messages(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
optimisticSeconds(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<BigNumber>;
process(
@ -923,26 +861,21 @@ export class Replica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<BigNumber>;
setUpdater(
_updater: string,
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
state(overrides?: CallOverrides): Promise<BigNumber>;
transferOwnership(
newOwner: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
updater(overrides?: CallOverrides): Promise<BigNumber>;
validatorManager(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
@ -952,36 +885,30 @@ export class Replica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<PopulatedTransaction>;
acceptableRoot(
checkpoint(
_root: BytesLike,
overrides?: CallOverrides
_index: BigNumberish,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
committedRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
checkpointedRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
confirmAt(
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<PopulatedTransaction>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
latestCheckpoint(overrides?: CallOverrides): Promise<PopulatedTransaction>;
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
messages(
@ -989,8 +916,6 @@ export class Replica extends BaseContract {
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
optimisticSeconds(overrides?: CallOverrides): Promise<PopulatedTransaction>;
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
process(
@ -1080,25 +1005,20 @@ export class Replica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
setUpdater(
_updater: string,
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
state(overrides?: CallOverrides): Promise<PopulatedTransaction>;
transferOwnership(
newOwner: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
updater(overrides?: CallOverrides): Promise<PopulatedTransaction>;
validatorManager(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -21,73 +21,97 @@ import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface TestCommonInterface extends ethers.utils.Interface {
functions: {
"committedRoot()": FunctionFragment;
"doubleUpdate(bytes32,bytes32[2],bytes,bytes)": FunctionFragment;
"homeDomainHash()": FunctionFragment;
"checkpointedRoot()": FunctionFragment;
"checkpoints(bytes32)": FunctionFragment;
"initialize(address)": FunctionFragment;
"latestCheckpoint()": FunctionFragment;
"localDomain()": FunctionFragment;
"setUpdater(address)": FunctionFragment;
"state()": FunctionFragment;
"testIsUpdaterSignature(bytes32,bytes32,bytes)": FunctionFragment;
"updater()": FunctionFragment;
"owner()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"setValidatorManager(address)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"validatorManager()": FunctionFragment;
};
encodeFunctionData(
functionFragment: "committedRoot",
functionFragment: "checkpointedRoot",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "doubleUpdate",
values: [BytesLike, [BytesLike, BytesLike], BytesLike, BytesLike]
functionFragment: "checkpoints",
values: [BytesLike]
): string;
encodeFunctionData(functionFragment: "initialize", values: [string]): string;
encodeFunctionData(
functionFragment: "homeDomainHash",
functionFragment: "latestCheckpoint",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "localDomain",
values?: undefined
): string;
encodeFunctionData(functionFragment: "setUpdater", values: [string]): string;
encodeFunctionData(functionFragment: "state", values?: undefined): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(
functionFragment: "testIsUpdaterSignature",
values: [BytesLike, BytesLike, BytesLike]
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "setValidatorManager",
values: [string]
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(
functionFragment: "validatorManager",
values?: undefined
): string;
encodeFunctionData(functionFragment: "updater", values?: undefined): string;
decodeFunctionResult(
functionFragment: "committedRoot",
functionFragment: "checkpointedRoot",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "doubleUpdate",
functionFragment: "checkpoints",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "homeDomainHash",
functionFragment: "latestCheckpoint",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "localDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setUpdater", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "state", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "setValidatorManager",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "testIsUpdaterSignature",
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "validatorManager",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "updater", data: BytesLike): Result;
events: {
"DoubleUpdate(bytes32,bytes32[2],bytes,bytes)": EventFragment;
"NewUpdater(address)": EventFragment;
"Update(uint32,bytes32,bytes32,bytes)": EventFragment;
"Checkpoint(bytes32,uint256)": EventFragment;
"NewValidatorManager(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "DoubleUpdate"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewUpdater"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Update"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Checkpoint"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewValidatorManager"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
}
export class TestCommon extends BaseContract {
@ -134,191 +158,197 @@ export class TestCommon extends BaseContract {
interface: TestCommonInterface;
functions: {
committedRoot(overrides?: CallOverrides): Promise<[string]>;
checkpointedRoot(overrides?: CallOverrides): Promise<[string]>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<[BigNumber]>;
initialize(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<[string]>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<[number]>;
setUpdater(
_updater: string,
owner(overrides?: CallOverrides): Promise<[string]>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<[number]>;
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
testIsUpdaterSignature(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<[boolean]>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<[string]>;
validatorManager(overrides?: CallOverrides): Promise<[string]>;
};
committedRoot(overrides?: CallOverrides): Promise<string>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
initialize(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
setUpdater(
_updater: string,
owner(overrides?: CallOverrides): Promise<string>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<number>;
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
testIsUpdaterSignature(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<string>;
validatorManager(overrides?: CallOverrides): Promise<string>;
callStatic: {
committedRoot(overrides?: CallOverrides): Promise<string>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
initialize(
_validatorManager: string,
overrides?: CallOverrides
): Promise<void>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
setUpdater(_updater: string, overrides?: CallOverrides): Promise<void>;
owner(overrides?: CallOverrides): Promise<string>;
state(overrides?: CallOverrides): Promise<number>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
testIsUpdaterSignature(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
setValidatorManager(
_validatorManager: string,
overrides?: CallOverrides
): Promise<boolean>;
): Promise<void>;
updater(overrides?: CallOverrides): Promise<string>;
transferOwnership(
newOwner: string,
overrides?: CallOverrides
): Promise<void>;
validatorManager(overrides?: CallOverrides): Promise<string>;
};
filters: {
DoubleUpdate(
oldRoot?: null,
newRoot?: null,
signature?: null,
signature2?: null
Checkpoint(
root?: BytesLike | null,
index?: BigNumberish | null
): TypedEventFilter<
[string, [string, string], string, string],
{
oldRoot: string;
newRoot: [string, string];
signature: string;
signature2: string;
}
[string, BigNumber],
{ root: string; index: BigNumber }
>;
NewUpdater(updater?: null): TypedEventFilter<[string], { updater: string }>;
NewValidatorManager(
validatorManager?: null
): TypedEventFilter<[string], { validatorManager: string }>;
Update(
homeDomain?: BigNumberish | null,
oldRoot?: BytesLike | null,
newRoot?: BytesLike | null,
signature?: null
OwnershipTransferred(
previousOwner?: string | null,
newOwner?: string | null
): TypedEventFilter<
[number, string, string, string],
{
homeDomain: number;
oldRoot: string;
newRoot: string;
signature: string;
}
[string, string],
{ previousOwner: string; newOwner: string }
>;
};
estimateGas: {
committedRoot(overrides?: CallOverrides): Promise<BigNumber>;
checkpointedRoot(overrides?: CallOverrides): Promise<BigNumber>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
initialize(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
homeDomainHash(overrides?: CallOverrides): Promise<BigNumber>;
latestCheckpoint(overrides?: CallOverrides): Promise<BigNumber>;
localDomain(overrides?: CallOverrides): Promise<BigNumber>;
setUpdater(
_updater: string,
owner(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
state(overrides?: CallOverrides): Promise<BigNumber>;
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
testIsUpdaterSignature(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: CallOverrides
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
updater(overrides?: CallOverrides): Promise<BigNumber>;
validatorManager(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
committedRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
checkpointedRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
initialize(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<PopulatedTransaction>;
latestCheckpoint(overrides?: CallOverrides): Promise<PopulatedTransaction>;
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
setUpdater(
_updater: string,
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
state(overrides?: CallOverrides): Promise<PopulatedTransaction>;
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
testIsUpdaterSignature(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: CallOverrides
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
updater(overrides?: CallOverrides): Promise<PopulatedTransaction>;
validatorManager(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -23,32 +23,26 @@ interface TestHomeInterface extends ethers.utils.Interface {
functions: {
"MAX_MESSAGE_BODY_BYTES()": FunctionFragment;
"VERSION()": FunctionFragment;
"committedRoot()": FunctionFragment;
"checkpoint()": FunctionFragment;
"checkpointedRoot()": FunctionFragment;
"checkpoints(bytes32)": FunctionFragment;
"count()": FunctionFragment;
"destinationAndNonce(uint32,uint32)": FunctionFragment;
"dispatch(uint32,bytes32,bytes)": FunctionFragment;
"doubleUpdate(bytes32,bytes32[2],bytes,bytes)": FunctionFragment;
"homeDomainHash()": FunctionFragment;
"improperUpdate(bytes32,bytes32,bytes)": FunctionFragment;
"fail()": FunctionFragment;
"initialize(address)": FunctionFragment;
"latestCheckpoint()": FunctionFragment;
"localDomain()": FunctionFragment;
"nonces(uint32)": FunctionFragment;
"owner()": FunctionFragment;
"queueContains(bytes32)": FunctionFragment;
"queueEnd()": FunctionFragment;
"queueLength()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"root()": FunctionFragment;
"setFailed()": FunctionFragment;
"setUpdater(address)": FunctionFragment;
"setUpdaterManager(address)": FunctionFragment;
"setValidatorManager(address)": FunctionFragment;
"state()": FunctionFragment;
"suggestUpdate()": FunctionFragment;
"testSetValidatorManager(address)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"tree()": FunctionFragment;
"update(bytes32,bytes32,bytes)": FunctionFragment;
"updater()": FunctionFragment;
"updaterManager()": FunctionFragment;
"validatorManager()": FunctionFragment;
};
encodeFunctionData(
@ -57,9 +51,17 @@ interface TestHomeInterface extends ethers.utils.Interface {
): string;
encodeFunctionData(functionFragment: "VERSION", values?: undefined): string;
encodeFunctionData(
functionFragment: "committedRoot",
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: "destinationAndNonce",
@ -69,19 +71,12 @@ interface TestHomeInterface extends ethers.utils.Interface {
functionFragment: "dispatch",
values: [BigNumberish, BytesLike, BytesLike]
): string;
encodeFunctionData(functionFragment: "fail", values?: undefined): string;
encodeFunctionData(functionFragment: "initialize", values: [string]): string;
encodeFunctionData(
functionFragment: "doubleUpdate",
values: [BytesLike, [BytesLike, BytesLike], BytesLike, BytesLike]
): string;
encodeFunctionData(
functionFragment: "homeDomainHash",
functionFragment: "latestCheckpoint",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "improperUpdate",
values: [BytesLike, BytesLike, BytesLike]
): string;
encodeFunctionData(functionFragment: "initialize", values: [string]): string;
encodeFunctionData(
functionFragment: "localDomain",
values?: undefined
@ -91,30 +86,19 @@ interface TestHomeInterface extends ethers.utils.Interface {
values: [BigNumberish]
): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(
functionFragment: "queueContains",
values: [BytesLike]
): string;
encodeFunctionData(functionFragment: "queueEnd", values?: undefined): string;
encodeFunctionData(
functionFragment: "queueLength",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(functionFragment: "root", values?: undefined): string;
encodeFunctionData(functionFragment: "setFailed", values?: undefined): string;
encodeFunctionData(functionFragment: "setUpdater", values: [string]): string;
encodeFunctionData(
functionFragment: "setUpdaterManager",
functionFragment: "setValidatorManager",
values: [string]
): string;
encodeFunctionData(functionFragment: "state", values?: undefined): string;
encodeFunctionData(
functionFragment: "suggestUpdate",
values?: undefined
functionFragment: "testSetValidatorManager",
values: [string]
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
@ -122,12 +106,7 @@ interface TestHomeInterface extends ethers.utils.Interface {
): string;
encodeFunctionData(functionFragment: "tree", values?: undefined): string;
encodeFunctionData(
functionFragment: "update",
values: [BytesLike, BytesLike, BytesLike]
): string;
encodeFunctionData(functionFragment: "updater", values?: undefined): string;
encodeFunctionData(
functionFragment: "updaterManager",
functionFragment: "validatorManager",
values?: undefined
): string;
@ -136,58 +115,45 @@ interface TestHomeInterface extends ethers.utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "VERSION", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "checkpoint", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "committedRoot",
functionFragment: "checkpointedRoot",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "count", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "destinationAndNonce",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "dispatch", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "doubleUpdate",
functionFragment: "checkpoints",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "count", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "homeDomainHash",
functionFragment: "destinationAndNonce",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "dispatch", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "fail", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "improperUpdate",
functionFragment: "latestCheckpoint",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "localDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "queueContains",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "queueEnd", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "queueLength",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "root", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "setFailed", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "setUpdater", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "setUpdaterManager",
functionFragment: "setValidatorManager",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "state", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "suggestUpdate",
functionFragment: "testSetValidatorManager",
data: BytesLike
): Result;
decodeFunctionResult(
@ -195,32 +161,24 @@ interface TestHomeInterface extends ethers.utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "tree", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "update", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "updater", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "updaterManager",
functionFragment: "validatorManager",
data: BytesLike
): Result;
events: {
"Checkpoint(bytes32,uint256)": EventFragment;
"Dispatch(bytes32,uint256,uint64,bytes32,bytes)": EventFragment;
"DoubleUpdate(bytes32,bytes32[2],bytes,bytes)": EventFragment;
"ImproperUpdate(bytes32,bytes32,bytes)": EventFragment;
"NewUpdater(address)": EventFragment;
"NewUpdaterManager(address)": EventFragment;
"Fail()": EventFragment;
"NewValidatorManager(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
"Update(uint32,bytes32,bytes32,bytes)": EventFragment;
"UpdaterSlashed(address,address)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "Checkpoint"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Dispatch"): EventFragment;
getEvent(nameOrSignatureOrTopic: "DoubleUpdate"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ImproperUpdate"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewUpdater"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewUpdaterManager"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Fail"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewValidatorManager"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Update"): EventFragment;
getEvent(nameOrSignatureOrTopic: "UpdaterSlashed"): EventFragment;
}
export class TestHome extends BaseContract {
@ -271,7 +229,16 @@ export class TestHome extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<[number]>;
committedRoot(overrides?: CallOverrides): Promise<[string]>;
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]>;
@ -288,69 +255,43 @@ export class TestHome extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<[string]>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
initialize(
_updaterManager: string,
_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]>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<[boolean]>;
queueEnd(overrides?: CallOverrides): Promise<[string]>;
queueLength(overrides?: CallOverrides): Promise<[BigNumber]>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
root(overrides?: CallOverrides): Promise<[string]>;
setFailed(
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setUpdater(
_updater: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<[number]>;
setUpdaterManager(
_updaterManager: string,
testSetValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<[number]>;
suggestUpdate(
overrides?: CallOverrides
): Promise<[string, string] & { _committedRoot: string; _new: string }>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
@ -360,23 +301,20 @@ export class TestHome extends BaseContract {
overrides?: CallOverrides
): Promise<[BigNumber] & { count: BigNumber }>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<[string]>;
updaterManager(overrides?: CallOverrides): Promise<[string]>;
validatorManager(overrides?: CallOverrides): Promise<[string]>;
};
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<BigNumber>;
VERSION(overrides?: CallOverrides): Promise<number>;
committedRoot(overrides?: CallOverrides): Promise<string>;
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>;
@ -393,66 +331,43 @@ export class TestHome extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
initialize(
_updaterManager: string,
_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>;
queueContains(_item: BytesLike, overrides?: CallOverrides): Promise<boolean>;
queueEnd(overrides?: CallOverrides): Promise<string>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
root(overrides?: CallOverrides): Promise<string>;
setFailed(
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setUpdater(
_updater: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<number>;
setUpdaterManager(
_updaterManager: string,
testSetValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<number>;
suggestUpdate(
overrides?: CallOverrides
): Promise<[string, string] & { _committedRoot: string; _new: string }>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
@ -460,23 +375,18 @@ export class TestHome extends BaseContract {
tree(overrides?: CallOverrides): Promise<BigNumber>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<string>;
updaterManager(overrides?: CallOverrides): Promise<string>;
validatorManager(overrides?: CallOverrides): Promise<string>;
callStatic: {
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<BigNumber>;
VERSION(overrides?: CallOverrides): Promise<number>;
committedRoot(overrides?: CallOverrides): Promise<string>;
checkpoint(overrides?: CallOverrides): Promise<void>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
count(overrides?: CallOverrides): Promise<BigNumber>;
@ -493,61 +403,38 @@ export class TestHome extends BaseContract {
overrides?: CallOverrides
): Promise<void>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: CallOverrides
): Promise<void>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
fail(overrides?: CallOverrides): Promise<void>;
initialize(
_updaterManager: string,
_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>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
queueEnd(overrides?: CallOverrides): Promise<string>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
root(overrides?: CallOverrides): Promise<string>;
setFailed(overrides?: CallOverrides): Promise<void>;
setUpdater(_updater: string, overrides?: CallOverrides): Promise<void>;
setUpdaterManager(
_updaterManager: string,
setValidatorManager(
_validatorManager: string,
overrides?: CallOverrides
): Promise<void>;
state(overrides?: CallOverrides): Promise<number>;
suggestUpdate(
testSetValidatorManager(
_validatorManager: string,
overrides?: CallOverrides
): Promise<[string, string] & { _committedRoot: string; _new: string }>;
): Promise<void>;
transferOwnership(
newOwner: string,
@ -556,24 +443,23 @@ export class TestHome extends BaseContract {
tree(overrides?: CallOverrides): Promise<BigNumber>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<void>;
updater(overrides?: CallOverrides): Promise<string>;
updaterManager(overrides?: CallOverrides): Promise<string>;
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,
committedRoot?: null,
checkpointedRoot?: null,
message?: null
): TypedEventFilter<
[string, BigNumber, BigNumber, string, string],
@ -581,40 +467,16 @@ export class TestHome extends BaseContract {
messageHash: string;
leafIndex: BigNumber;
destinationAndNonce: BigNumber;
committedRoot: string;
checkpointedRoot: string;
message: string;
}
>;
DoubleUpdate(
oldRoot?: null,
newRoot?: null,
signature?: null,
signature2?: null
): TypedEventFilter<
[string, [string, string], string, string],
{
oldRoot: string;
newRoot: [string, string];
signature: string;
signature2: string;
}
>;
Fail(): TypedEventFilter<[], {}>;
ImproperUpdate(
oldRoot?: null,
newRoot?: null,
signature?: null
): TypedEventFilter<
[string, string, string],
{ oldRoot: string; newRoot: string; signature: string }
>;
NewUpdater(updater?: null): TypedEventFilter<[string], { updater: string }>;
NewUpdaterManager(
updaterManager?: null
): TypedEventFilter<[string], { updaterManager: string }>;
NewValidatorManager(
validatorManager?: null
): TypedEventFilter<[string], { validatorManager: string }>;
OwnershipTransferred(
previousOwner?: string | null,
@ -623,29 +485,6 @@ export class TestHome extends BaseContract {
[string, string],
{ previousOwner: string; newOwner: string }
>;
Update(
homeDomain?: BigNumberish | null,
oldRoot?: BytesLike | null,
newRoot?: BytesLike | null,
signature?: null
): TypedEventFilter<
[number, string, string, string],
{
homeDomain: number;
oldRoot: string;
newRoot: string;
signature: string;
}
>;
UpdaterSlashed(
updater?: string | null,
reporter?: string | null
): TypedEventFilter<
[string, string],
{ updater: string; reporter: string }
>;
};
estimateGas: {
@ -653,7 +492,13 @@ export class TestHome extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<BigNumber>;
committedRoot(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>;
@ -670,67 +515,41 @@ export class TestHome extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
homeDomainHash(overrides?: CallOverrides): Promise<BigNumber>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
initialize(
_updaterManager: string,
_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>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<BigNumber>;
queueEnd(overrides?: CallOverrides): Promise<BigNumber>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
root(overrides?: CallOverrides): Promise<BigNumber>;
setFailed(
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
setUpdater(
_updater: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
state(overrides?: CallOverrides): Promise<BigNumber>;
setUpdaterManager(
_updaterManager: string,
testSetValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
state(overrides?: CallOverrides): Promise<BigNumber>;
suggestUpdate(overrides?: CallOverrides): Promise<BigNumber>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
@ -738,16 +557,7 @@ export class TestHome extends BaseContract {
tree(overrides?: CallOverrides): Promise<BigNumber>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
updater(overrides?: CallOverrides): Promise<BigNumber>;
updaterManager(overrides?: CallOverrides): Promise<BigNumber>;
validatorManager(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
@ -757,7 +567,16 @@ export class TestHome extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<PopulatedTransaction>;
committedRoot(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>;
@ -774,28 +593,17 @@ export class TestHome extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<PopulatedTransaction>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
initialize(
_updaterManager: string,
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
latestCheckpoint(overrides?: CallOverrides): Promise<PopulatedTransaction>;
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
nonces(
@ -805,39 +613,24 @@ export class TestHome extends BaseContract {
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
queueEnd(overrides?: CallOverrides): Promise<PopulatedTransaction>;
queueLength(overrides?: CallOverrides): Promise<PopulatedTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
root(overrides?: CallOverrides): Promise<PopulatedTransaction>;
setFailed(
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
setUpdater(
_updater: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
state(overrides?: CallOverrides): Promise<PopulatedTransaction>;
setUpdaterManager(
_updaterManager: string,
testSetValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
state(overrides?: CallOverrides): Promise<PopulatedTransaction>;
suggestUpdate(overrides?: CallOverrides): Promise<PopulatedTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
@ -845,15 +638,6 @@ export class TestHome extends BaseContract {
tree(overrides?: CallOverrides): Promise<PopulatedTransaction>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
updater(overrides?: CallOverrides): Promise<PopulatedTransaction>;
updaterManager(overrides?: CallOverrides): Promise<PopulatedTransaction>;
validatorManager(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -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>;
};
}

@ -24,30 +24,26 @@ interface TestReplicaInterface extends ethers.utils.Interface {
"PROCESS_GAS()": FunctionFragment;
"RESERVE_GAS()": FunctionFragment;
"VERSION()": FunctionFragment;
"acceptableRoot(bytes32)": FunctionFragment;
"committedRoot()": FunctionFragment;
"confirmAt(bytes32)": FunctionFragment;
"doubleUpdate(bytes32,bytes32[2],bytes,bytes)": FunctionFragment;
"homeDomainHash()": FunctionFragment;
"checkpoint(bytes32,uint256,bytes)": FunctionFragment;
"checkpointedRoot()": FunctionFragment;
"checkpoints(bytes32)": FunctionFragment;
"initialize(uint32,address,bytes32,uint256)": FunctionFragment;
"latestCheckpoint()": FunctionFragment;
"localDomain()": FunctionFragment;
"messages(bytes32)": FunctionFragment;
"optimisticSeconds()": FunctionFragment;
"owner()": FunctionFragment;
"process(bytes)": FunctionFragment;
"prove(bytes32,bytes32[32],uint256)": FunctionFragment;
"proveAndProcess(bytes,bytes32[32],uint256)": FunctionFragment;
"remoteDomain()": FunctionFragment;
"setCommittedRoot(bytes32)": FunctionFragment;
"setFailed()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"setCheckpoint(bytes32,uint256)": FunctionFragment;
"setMessageProven(bytes)": FunctionFragment;
"setUpdater(address)": FunctionFragment;
"state()": FunctionFragment;
"setValidatorManager(address)": FunctionFragment;
"testBranchRoot(bytes32,bytes32[32],uint256)": FunctionFragment;
"testProcess(bytes)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"update(bytes32,bytes32,bytes)": FunctionFragment;
"updater()": FunctionFragment;
"validatorManager()": FunctionFragment;
};
encodeFunctionData(
@ -60,38 +56,30 @@ interface TestReplicaInterface extends ethers.utils.Interface {
): string;
encodeFunctionData(functionFragment: "VERSION", values?: undefined): string;
encodeFunctionData(
functionFragment: "acceptableRoot",
values: [BytesLike]
functionFragment: "checkpoint",
values: [BytesLike, BigNumberish, BytesLike]
): string;
encodeFunctionData(
functionFragment: "committedRoot",
functionFragment: "checkpointedRoot",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "confirmAt",
functionFragment: "checkpoints",
values: [BytesLike]
): string;
encodeFunctionData(
functionFragment: "doubleUpdate",
values: [BytesLike, [BytesLike, BytesLike], BytesLike, BytesLike]
): string;
encodeFunctionData(
functionFragment: "homeDomainHash",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "initialize",
values: [BigNumberish, string, BytesLike, BigNumberish]
): string;
encodeFunctionData(
functionFragment: "localDomain",
functionFragment: "latestCheckpoint",
values?: undefined
): string;
encodeFunctionData(functionFragment: "messages", values: [BytesLike]): string;
encodeFunctionData(
functionFragment: "optimisticSeconds",
functionFragment: "localDomain",
values?: undefined
): string;
encodeFunctionData(functionFragment: "messages", values: [BytesLike]): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(functionFragment: "process", values: [BytesLike]): string;
encodeFunctionData(
@ -181,16 +169,21 @@ interface TestReplicaInterface extends ethers.utils.Interface {
values?: undefined
): string;
encodeFunctionData(
functionFragment: "setCommittedRoot",
values: [BytesLike]
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "setCheckpoint",
values: [BytesLike, BigNumberish]
): string;
encodeFunctionData(functionFragment: "setFailed", values?: undefined): string;
encodeFunctionData(
functionFragment: "setMessageProven",
values: [BytesLike]
): string;
encodeFunctionData(functionFragment: "setUpdater", values: [string]): string;
encodeFunctionData(functionFragment: "state", values?: undefined): string;
encodeFunctionData(
functionFragment: "setValidatorManager",
values: [string]
): string;
encodeFunctionData(
functionFragment: "testBranchRoot",
values: [
@ -241,10 +234,9 @@ interface TestReplicaInterface extends ethers.utils.Interface {
values: [string]
): string;
encodeFunctionData(
functionFragment: "update",
values: [BytesLike, BytesLike, BytesLike]
functionFragment: "validatorManager",
values?: undefined
): string;
encodeFunctionData(functionFragment: "updater", values?: undefined): string;
decodeFunctionResult(
functionFragment: "PROCESS_GAS",
@ -255,33 +247,25 @@ interface TestReplicaInterface extends ethers.utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "VERSION", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "checkpoint", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "acceptableRoot",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "committedRoot",
functionFragment: "checkpointedRoot",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "confirmAt", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "doubleUpdate",
functionFragment: "checkpoints",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "homeDomainHash",
functionFragment: "latestCheckpoint",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "localDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "messages", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "optimisticSeconds",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "process", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "prove", data: BytesLike): Result;
@ -294,16 +278,21 @@ interface TestReplicaInterface extends ethers.utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "setCommittedRoot",
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "setCheckpoint",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setFailed", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "setMessageProven",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setUpdater", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "state", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "setValidatorManager",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "testBranchRoot",
data: BytesLike
@ -316,22 +305,22 @@ interface TestReplicaInterface extends ethers.utils.Interface {
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "update", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "updater", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "validatorManager",
data: BytesLike
): Result;
events: {
"DoubleUpdate(bytes32,bytes32[2],bytes,bytes)": EventFragment;
"NewUpdater(address)": EventFragment;
"Checkpoint(bytes32,uint256)": EventFragment;
"NewValidatorManager(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
"Process(bytes32,bool,bytes)": EventFragment;
"Update(uint32,bytes32,bytes32,bytes)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "DoubleUpdate"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewUpdater"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Checkpoint"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewValidatorManager"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Process"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Update"): EventFragment;
}
export class TestReplica extends BaseContract {
@ -384,39 +373,36 @@ export class TestReplica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<[number]>;
acceptableRoot(
checkpoint(
_root: BytesLike,
overrides?: CallOverrides
): Promise<[boolean]>;
committedRoot(overrides?: CallOverrides): Promise<[string]>;
confirmAt(arg0: BytesLike, overrides?: CallOverrides): Promise<[BigNumber]>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_index: BigNumberish,
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<[string]>;
checkpointedRoot(overrides?: CallOverrides): Promise<[string]>;
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<[BigNumber]>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<[number]>;
messages(arg0: BytesLike, overrides?: CallOverrides): Promise<[number]>;
optimisticSeconds(overrides?: CallOverrides): Promise<[BigNumber]>;
owner(overrides?: CallOverrides): Promise<[string]>;
process(
@ -506,12 +492,13 @@ export class TestReplica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<[number]>;
setCommittedRoot(
_newRoot: BytesLike,
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setFailed(
setCheckpoint(
_root: BytesLike,
_index: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
@ -520,13 +507,11 @@ export class TestReplica extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setUpdater(
_updater: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<[number]>;
testBranchRoot(
leaf: BytesLike,
proof: [
@ -577,14 +562,7 @@ export class TestReplica extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<[string]>;
validatorManager(overrides?: CallOverrides): Promise<[string]>;
};
PROCESS_GAS(overrides?: CallOverrides): Promise<BigNumber>;
@ -593,36 +571,33 @@ export class TestReplica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<number>;
acceptableRoot(_root: BytesLike, overrides?: CallOverrides): Promise<boolean>;
committedRoot(overrides?: CallOverrides): Promise<string>;
confirmAt(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
checkpoint(
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
messages(arg0: BytesLike, overrides?: CallOverrides): Promise<number>;
optimisticSeconds(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<string>;
process(
@ -712,12 +687,13 @@ export class TestReplica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<number>;
setCommittedRoot(
_newRoot: BytesLike,
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setFailed(
setCheckpoint(
_root: BytesLike,
_index: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
@ -726,13 +702,11 @@ export class TestReplica extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setUpdater(
_updater: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<number>;
testBranchRoot(
leaf: BytesLike,
proof: [
@ -783,14 +757,7 @@ export class TestReplica extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<string>;
validatorManager(overrides?: CallOverrides): Promise<string>;
callStatic: {
PROCESS_GAS(overrides?: CallOverrides): Promise<BigNumber>;
@ -799,39 +766,33 @@ export class TestReplica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<number>;
acceptableRoot(
checkpoint(
_root: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
committedRoot(overrides?: CallOverrides): Promise<string>;
confirmAt(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_index: BigNumberish,
_signature: BytesLike,
_signature2: BytesLike,
overrides?: CallOverrides
): Promise<void>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: CallOverrides
): Promise<void>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
messages(arg0: BytesLike, overrides?: CallOverrides): Promise<number>;
optimisticSeconds(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<string>;
process(_message: BytesLike, overrides?: CallOverrides): Promise<boolean>;
@ -918,21 +879,23 @@ export class TestReplica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<number>;
setCommittedRoot(
_newRoot: BytesLike,
renounceOwnership(overrides?: CallOverrides): Promise<void>;
setCheckpoint(
_root: BytesLike,
_index: BigNumberish,
overrides?: CallOverrides
): Promise<void>;
setFailed(overrides?: CallOverrides): Promise<void>;
setMessageProven(
_message: BytesLike,
overrides?: CallOverrides
): Promise<void>;
setUpdater(_updater: string, overrides?: CallOverrides): Promise<void>;
state(overrides?: CallOverrides): Promise<number>;
setValidatorManager(
_validatorManager: string,
overrides?: CallOverrides
): Promise<void>;
testBranchRoot(
leaf: BytesLike,
@ -984,33 +947,21 @@ export class TestReplica extends BaseContract {
overrides?: CallOverrides
): Promise<void>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<void>;
updater(overrides?: CallOverrides): Promise<string>;
validatorManager(overrides?: CallOverrides): Promise<string>;
};
filters: {
DoubleUpdate(
oldRoot?: null,
newRoot?: null,
signature?: null,
signature2?: null
Checkpoint(
root?: BytesLike | null,
index?: BigNumberish | null
): TypedEventFilter<
[string, [string, string], string, string],
{
oldRoot: string;
newRoot: [string, string];
signature: string;
signature2: string;
}
[string, BigNumber],
{ root: string; index: BigNumber }
>;
NewUpdater(updater?: null): TypedEventFilter<[string], { updater: string }>;
NewValidatorManager(
validatorManager?: null
): TypedEventFilter<[string], { validatorManager: string }>;
OwnershipTransferred(
previousOwner?: string | null,
@ -1028,21 +979,6 @@ export class TestReplica extends BaseContract {
[string, boolean, string],
{ messageHash: string; success: boolean; returnData: string }
>;
Update(
homeDomain?: BigNumberish | null,
oldRoot?: BytesLike | null,
newRoot?: BytesLike | null,
signature?: null
): TypedEventFilter<
[number, string, string, string],
{
homeDomain: number;
oldRoot: string;
newRoot: string;
signature: string;
}
>;
};
estimateGas: {
@ -1052,39 +988,31 @@ export class TestReplica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<BigNumber>;
acceptableRoot(
checkpoint(
_root: BytesLike,
overrides?: CallOverrides
): Promise<BigNumber>;
committedRoot(overrides?: CallOverrides): Promise<BigNumber>;
confirmAt(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_index: BigNumberish,
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
homeDomainHash(overrides?: CallOverrides): Promise<BigNumber>;
checkpointedRoot(overrides?: CallOverrides): Promise<BigNumber>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
latestCheckpoint(overrides?: CallOverrides): Promise<BigNumber>;
localDomain(overrides?: CallOverrides): Promise<BigNumber>;
messages(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
optimisticSeconds(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<BigNumber>;
process(
@ -1174,12 +1102,13 @@ export class TestReplica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<BigNumber>;
setCommittedRoot(
_newRoot: BytesLike,
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
setFailed(
setCheckpoint(
_root: BytesLike,
_index: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
@ -1188,13 +1117,11 @@ export class TestReplica extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
setUpdater(
_updater: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
state(overrides?: CallOverrides): Promise<BigNumber>;
testBranchRoot(
leaf: BytesLike,
proof: [
@ -1245,14 +1172,7 @@ export class TestReplica extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
updater(overrides?: CallOverrides): Promise<BigNumber>;
validatorManager(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
@ -1262,36 +1182,30 @@ export class TestReplica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<PopulatedTransaction>;
acceptableRoot(
checkpoint(
_root: BytesLike,
overrides?: CallOverrides
_index: BigNumberish,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
committedRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
checkpointedRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
confirmAt(
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<PopulatedTransaction>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
latestCheckpoint(overrides?: CallOverrides): Promise<PopulatedTransaction>;
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
messages(
@ -1299,8 +1213,6 @@ export class TestReplica extends BaseContract {
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
optimisticSeconds(overrides?: CallOverrides): Promise<PopulatedTransaction>;
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
process(
@ -1390,12 +1302,13 @@ export class TestReplica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
setCommittedRoot(
_newRoot: BytesLike,
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
setFailed(
setCheckpoint(
_root: BytesLike,
_index: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
@ -1404,13 +1317,11 @@ export class TestReplica extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
setUpdater(
_updater: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
state(overrides?: CallOverrides): Promise<PopulatedTransaction>;
testBranchRoot(
leaf: BytesLike,
proof: [
@ -1461,13 +1372,6 @@ export class TestReplica extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
updater(overrides?: CallOverrides): Promise<PopulatedTransaction>;
validatorManager(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>;
};
}

@ -19,63 +19,84 @@ 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 {
interface ValidatorManagerInterface extends ethers.utils.Interface {
functions: {
"domainHash(uint32)": FunctionFragment;
"improperCheckpoint(address,bytes32,uint256,bytes)": FunctionFragment;
"isValidatorSignature(uint32,bytes32,uint256,bytes)": FunctionFragment;
"owner()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"setHome(address)": FunctionFragment;
"setUpdater(address)": FunctionFragment;
"slashUpdater(address)": FunctionFragment;
"setValidator(uint32,address)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"updater()": FunctionFragment;
"validators(uint32)": FunctionFragment;
};
encodeFunctionData(
functionFragment: "domainHash",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "improperCheckpoint",
values: [string, BytesLike, BigNumberish, BytesLike]
): string;
encodeFunctionData(
functionFragment: "isValidatorSignature",
values: [BigNumberish, BytesLike, BigNumberish, BytesLike]
): string;
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]
functionFragment: "setValidator",
values: [BigNumberish, string]
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(functionFragment: "updater", values?: undefined): string;
encodeFunctionData(
functionFragment: "validators",
values: [BigNumberish]
): string;
decodeFunctionResult(functionFragment: "domainHash", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "improperCheckpoint",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "isValidatorSignature",
data: BytesLike
): Result;
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",
functionFragment: "setValidator",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "updater", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "validators", data: BytesLike): Result;
events: {
"FakeSlashed(address)": EventFragment;
"NewHome(address)": EventFragment;
"ImproperCheckpoint(address,uint32,address,bytes32,uint256,bytes)": EventFragment;
"NewValidator(uint32,address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "FakeSlashed"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewHome"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ImproperCheckpoint"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewValidator"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
}
export class UpdaterManager extends BaseContract {
export class ValidatorManager extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
@ -116,27 +137,39 @@ export class UpdaterManager extends BaseContract {
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: UpdaterManagerInterface;
interface: ValidatorManagerInterface;
functions: {
owner(overrides?: CallOverrides): Promise<[string]>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
domainHash(
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<[string]>;
setHome(
improperCheckpoint(
_home: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setUpdater(
_updaterAddress: string,
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<[boolean]>;
owner(overrides?: CallOverrides): Promise<[string]>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
slashUpdater(
_reporter: string,
setValidator(
_domain: BigNumberish,
_validator: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
@ -145,27 +178,39 @@ export class UpdaterManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<[string]>;
validators(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<[string]>;
};
owner(overrides?: CallOverrides): Promise<string>;
domainHash(_domain: BigNumberish, overrides?: CallOverrides): Promise<string>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setHome(
improperCheckpoint(
_home: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setUpdater(
_updaterAddress: string,
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
owner(overrides?: CallOverrides): Promise<string>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
slashUpdater(
_reporter: string,
setValidator(
_domain: BigNumberish,
_validator: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
@ -174,36 +219,75 @@ export class UpdaterManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<string>;
validators(arg0: BigNumberish, overrides?: CallOverrides): Promise<string>;
callStatic: {
domainHash(
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<string>;
improperCheckpoint(
_home: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
owner(overrides?: CallOverrides): Promise<string>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
setHome(_home: string, overrides?: CallOverrides): Promise<void>;
setUpdater(
_updaterAddress: string,
setValidator(
_domain: BigNumberish,
_validator: string,
overrides?: CallOverrides
): Promise<void>;
slashUpdater(_reporter: string, overrides?: CallOverrides): Promise<void>;
transferOwnership(
newOwner: string,
overrides?: CallOverrides
): Promise<void>;
updater(overrides?: CallOverrides): Promise<string>;
validators(arg0: BigNumberish, overrides?: CallOverrides): Promise<string>;
};
filters: {
FakeSlashed(
reporter?: null
): TypedEventFilter<[string], { reporter: string }>;
ImproperCheckpoint(
home?: string | null,
domain?: BigNumberish | null,
validator?: string | null,
root?: null,
index?: null,
signature?: null
): TypedEventFilter<
[string, number, string, string, BigNumber, string],
{
home: string;
domain: number;
validator: string;
root: string;
index: BigNumber;
signature: string;
}
>;
NewHome(home?: null): TypedEventFilter<[string], { home: string }>;
NewValidator(
domain?: BigNumberish | null,
validator?: string | null
): TypedEventFilter<
[number, string],
{ domain: number; validator: string }
>;
OwnershipTransferred(
previousOwner?: string | null,
@ -215,24 +299,36 @@ export class UpdaterManager extends BaseContract {
};
estimateGas: {
owner(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
domainHash(
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
setHome(
improperCheckpoint(
_home: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
setUpdater(
_updaterAddress: string,
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
slashUpdater(
_reporter: string,
setValidator(
_domain: BigNumberish,
_validator: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
@ -241,28 +337,43 @@ export class UpdaterManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
updater(overrides?: CallOverrides): Promise<BigNumber>;
validators(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
};
populateTransaction: {
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
domainHash(
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
setHome(
improperCheckpoint(
_home: string,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
setUpdater(
_updaterAddress: string,
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
slashUpdater(
_reporter: string,
setValidator(
_domain: BigNumberish,
_validator: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
@ -271,6 +382,9 @@ export class UpdaterManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
updater(overrides?: CallOverrides): Promise<PopulatedTransaction>;
validators(
arg0: BigNumberish,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
};
}

@ -22,25 +22,26 @@ 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;
"localDomain()": FunctionFragment;
"owner()": FunctionFragment;
"ownerEnrollReplica(address,uint32)": FunctionFragment;
"ownerUnenrollReplica(address)": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"replicaToDomain(address)": FunctionFragment;
"setHome(address)": FunctionFragment;
"setWatcherPermission(address,uint32,bool)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"unenrollReplica(uint32,bytes32,bytes)": FunctionFragment;
"watcherPermission(address,uint32)": FunctionFragment;
"unenrollReplica(address)": FunctionFragment;
};
encodeFunctionData(
functionFragment: "domainToReplica",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "enrollReplica",
values: [string, BigNumberish]
): string;
encodeFunctionData(functionFragment: "home", values?: undefined): string;
encodeFunctionData(functionFragment: "isReplica", values: [string]): string;
encodeFunctionData(
@ -48,14 +49,6 @@ interface XAppConnectionManagerInterface extends ethers.utils.Interface {
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
@ -65,27 +58,23 @@ interface XAppConnectionManagerInterface extends ethers.utils.Interface {
values: [string]
): string;
encodeFunctionData(functionFragment: "setHome", values: [string]): string;
encodeFunctionData(
functionFragment: "setWatcherPermission",
values: [string, BigNumberish, boolean]
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(
functionFragment: "unenrollReplica",
values: [BigNumberish, BytesLike, BytesLike]
): string;
encodeFunctionData(
functionFragment: "watcherPermission",
values: [string, BigNumberish]
values: [string]
): string;
decodeFunctionResult(
functionFragment: "domainToReplica",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "enrollReplica",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "home", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "isReplica", data: BytesLike): Result;
decodeFunctionResult(
@ -93,14 +82,6 @@ interface XAppConnectionManagerInterface extends ethers.utils.Interface {
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
@ -110,10 +91,6 @@ interface XAppConnectionManagerInterface extends ethers.utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setHome", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "setWatcherPermission",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
@ -122,22 +99,18 @@ interface XAppConnectionManagerInterface extends ethers.utils.Interface {
functionFragment: "unenrollReplica",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "watcherPermission",
data: BytesLike
): Result;
events: {
"NewHome(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
"ReplicaEnrolled(uint32,address)": EventFragment;
"ReplicaUnenrolled(uint32,address)": EventFragment;
"WatcherPermissionSet(uint32,address,bool)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "NewHome"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ReplicaEnrolled"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ReplicaUnenrolled"): EventFragment;
getEvent(nameOrSignatureOrTopic: "WatcherPermissionSet"): EventFragment;
}
export class XAppConnectionManager extends BaseContract {
@ -189,6 +162,12 @@ export class XAppConnectionManager extends BaseContract {
overrides?: CallOverrides
): Promise<[string]>;
enrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
home(overrides?: CallOverrides): Promise<[string]>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<[boolean]>;
@ -197,17 +176,6 @@ export class XAppConnectionManager extends BaseContract {
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>;
@ -219,30 +187,15 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setWatcherPermission(
_watcher: string,
_domain: BigNumberish,
_access: boolean,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
unenrollReplica(
_domain: BigNumberish,
_updater: BytesLike,
_signature: BytesLike,
_replica: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
watcherPermission(
_watcher: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<[boolean]>;
};
domainToReplica(
@ -250,6 +203,12 @@ export class XAppConnectionManager extends BaseContract {
overrides?: CallOverrides
): Promise<string>;
enrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
home(overrides?: CallOverrides): Promise<string>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<boolean>;
@ -258,17 +217,6 @@ export class XAppConnectionManager extends BaseContract {
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>;
@ -280,37 +228,28 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setWatcherPermission(
_watcher: string,
_domain: BigNumberish,
_access: boolean,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
unenrollReplica(
_domain: BigNumberish,
_updater: BytesLike,
_signature: BytesLike,
_replica: string,
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>;
enrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<void>;
home(overrides?: CallOverrides): Promise<string>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<boolean>;
@ -319,50 +258,23 @@ export class XAppConnectionManager extends BaseContract {
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>;
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>;
unenrollReplica(_replica: string, overrides?: CallOverrides): Promise<void>;
};
filters: {
NewHome(home?: string | null): TypedEventFilter<[string], { home: string }>;
OwnershipTransferred(
previousOwner?: string | null,
newOwner?: string | null
@ -380,15 +292,6 @@ export class XAppConnectionManager extends BaseContract {
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: {
@ -397,6 +300,12 @@ export class XAppConnectionManager extends BaseContract {
overrides?: CallOverrides
): Promise<BigNumber>;
enrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
home(overrides?: CallOverrides): Promise<BigNumber>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<BigNumber>;
@ -405,17 +314,6 @@ export class XAppConnectionManager extends BaseContract {
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>;
@ -430,30 +328,15 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
setWatcherPermission(
_watcher: string,
_domain: BigNumberish,
_access: boolean,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
unenrollReplica(
_domain: BigNumberish,
_updater: BytesLike,
_signature: BytesLike,
_replica: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
watcherPermission(
_watcher: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
};
populateTransaction: {
@ -462,6 +345,12 @@ export class XAppConnectionManager extends BaseContract {
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
enrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
home(overrides?: CallOverrides): Promise<PopulatedTransaction>;
isReplica(
@ -473,17 +362,6 @@ export class XAppConnectionManager extends BaseContract {
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>;
@ -498,29 +376,14 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
setWatcherPermission(
_watcher: string,
_domain: BigNumberish,
_access: boolean,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
unenrollReplica(
_domain: BigNumberish,
_updater: BytesLike,
_signature: BytesLike,
_replica: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
watcherPermission(
_watcher: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
};
}

@ -11,31 +11,19 @@ const _abi = [
anonymous: false,
inputs: [
{
indexed: false,
indexed: true,
internalType: "bytes32",
name: "oldRoot",
name: "root",
type: "bytes32",
},
{
indexed: false,
internalType: "bytes32[2]",
name: "newRoot",
type: "bytes32[2]",
},
{
indexed: false,
internalType: "bytes",
name: "signature",
type: "bytes",
},
{
indexed: false,
internalType: "bytes",
name: "signature2",
type: "bytes",
indexed: true,
internalType: "uint256",
name: "index",
type: "uint256",
},
],
name: "DoubleUpdate",
name: "Checkpoint",
type: "event",
},
{
@ -44,11 +32,11 @@ const _abi = [
{
indexed: false,
internalType: "address",
name: "updater",
name: "validatorManager",
type: "address",
},
],
name: "NewUpdater",
name: "NewValidatorManager",
type: "event",
},
{
@ -56,35 +44,23 @@ const _abi = [
inputs: [
{
indexed: true,
internalType: "uint32",
name: "homeDomain",
type: "uint32",
},
{
indexed: true,
internalType: "bytes32",
name: "oldRoot",
type: "bytes32",
internalType: "address",
name: "previousOwner",
type: "address",
},
{
indexed: true,
internalType: "bytes32",
name: "newRoot",
type: "bytes32",
},
{
indexed: false,
internalType: "bytes",
name: "signature",
type: "bytes",
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "Update",
name: "OwnershipTransferred",
type: "event",
},
{
inputs: [],
name: "committedRoot",
name: "checkpointedRoot",
outputs: [
{
internalType: "bytes32",
@ -99,39 +75,35 @@ const _abi = [
inputs: [
{
internalType: "bytes32",
name: "_oldRoot",
name: "",
type: "bytes32",
},
],
name: "checkpoints",
outputs: [
{
internalType: "bytes32[2]",
name: "_newRoot",
type: "bytes32[2]",
},
{
internalType: "bytes",
name: "_signature",
type: "bytes",
},
{
internalType: "bytes",
name: "_signature2",
type: "bytes",
internalType: "uint256",
name: "",
type: "uint256",
},
],
name: "doubleUpdate",
outputs: [],
stateMutability: "nonpayable",
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "homeDomainHash",
name: "latestCheckpoint",
outputs: [
{
internalType: "bytes32",
name: "",
name: "root",
type: "bytes32",
},
{
internalType: "uint256",
name: "index",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
@ -151,12 +123,12 @@ const _abi = [
},
{
inputs: [],
name: "state",
name: "owner",
outputs: [
{
internalType: "enum Common.States",
internalType: "address",
name: "",
type: "uint8",
type: "address",
},
],
stateMutability: "view",
@ -164,10 +136,43 @@ const _abi = [
},
{
inputs: [],
name: "updater",
outputs: [
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_validatorManager",
type: "address",
},
],
name: "setValidatorManager",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "validatorManager",
outputs: [
{
internalType: "contract IValidatorManager",
name: "",
type: "address",
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,52 +0,0 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from "ethers";
import { Provider } from "@ethersproject/providers";
import type {
IUpdaterManager,
IUpdaterManagerInterface,
} from "../IUpdaterManager";
const _abi = [
{
inputs: [
{
internalType: "address payable",
name: "_reporter",
type: "address",
},
],
name: "slashUpdater",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "updater",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
];
export class IUpdaterManager__factory {
static readonly abi = _abi;
static createInterface(): IUpdaterManagerInterface {
return new utils.Interface(_abi) as IUpdaterManagerInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): IUpdaterManager {
return new Contract(address, _abi, signerOrProvider) as IUpdaterManager;
}
}

@ -0,0 +1,60 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from "ethers";
import { Provider } from "@ethersproject/providers";
import type {
IValidatorManager,
IValidatorManagerInterface,
} from "../IValidatorManager";
const _abi = [
{
inputs: [
{
internalType: "uint32",
name: "_domain",
type: "uint32",
},
{
internalType: "bytes32",
name: "_root",
type: "bytes32",
},
{
internalType: "uint256",
name: "_index",
type: "uint256",
},
{
internalType: "bytes",
name: "_signature",
type: "bytes",
},
],
name: "isValidatorSignature",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
];
export class IValidatorManager__factory {
static readonly abi = _abi;
static createInterface(): IValidatorManagerInterface {
return new utils.Interface(_abi) as IValidatorManagerInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): IValidatorManager {
return new Contract(address, _abi, signerOrProvider) as IValidatorManager;
}
}

@ -1,60 +0,0 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers";
import { Provider, TransactionRequest } from "@ethersproject/providers";
import type { MerkleLib, MerkleLibInterface } from "../MerkleLib";
const _abi = [
{
inputs: [],
name: "zeroHashes",
outputs: [
{
internalType: "bytes32[32]",
name: "_zeroes",
type: "bytes32[32]",
},
],
stateMutability: "pure",
type: "function",
},
];
const _bytecode =
"0x610591610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c8063b35658081461003a575b600080fd5b61004261007b565b604051808261040080838360005b83811015610068578181015183820152602001610050565b5050505090500191505060405180910390f35b61008361053c565b600081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb560208201527fb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d3060408201527f21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba8560608201527fe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a1934460808201527f0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d60a08201527f887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a196860c08201527fffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f8360e08201527f9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af6101008201527fcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e06101208201527ff9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a56101408201527ff8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf8926101608201527f3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c6101808201527fc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb6101a08201527f5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc6101c08201527fda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d26101e08201527f2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f6102008201527fe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a6102208201527f5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a06102408201527fb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa06102608201527fc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e26102808201527ff4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd96102a08201527f5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e3776102c08201527f4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee6526102e08201527fcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef6103008201527f0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d6103208201527fb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d06103408201527f838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e6103608201527f662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e6103808201527f388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea3226103a08201527f93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d7356103c08201527f8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a96103e082015290565b604051806104000160405280602090602082028036833750919291505056fea2646970667358221220ad3bfe4cefe5c51f17b8c40895bafc1076c16176a71ee813684032f85042016e64736f6c63430007060033";
export class MerkleLib__factory extends ContractFactory {
constructor(signer?: Signer) {
super(_abi, _bytecode, signer);
}
deploy(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<MerkleLib> {
return super.deploy(overrides || {}) as Promise<MerkleLib>;
}
getDeployTransaction(
overrides?: Overrides & { from?: string | Promise<string> }
): TransactionRequest {
return super.getDeployTransaction(overrides || {});
}
attach(address: string): MerkleLib {
return super.attach(address) as MerkleLib;
}
connect(signer: Signer): MerkleLib__factory {
return super.connect(signer) as MerkleLib__factory;
}
static readonly bytecode = _bytecode;
static readonly abi = _abi;
static createInterface(): MerkleLibInterface {
return new utils.Interface(_abi) as MerkleLibInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): MerkleLib {
return new Contract(address, _abi, signerOrProvider) as MerkleLib;
}
}

@ -1,92 +0,0 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers";
import { Provider, TransactionRequest } from "@ethersproject/providers";
import type { QueueManager, QueueManagerInterface } from "../QueueManager";
const _abi = [
{
inputs: [
{
internalType: "bytes32",
name: "_item",
type: "bytes32",
},
],
name: "queueContains",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "queueEnd",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "queueLength",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
];
const _bytecode =
"0x608060405234801561001057600080fd5b50610210806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632bef289214610046578063ab91c7b014610077578063f6d1610214610091575b600080fd5b6100636004803603602081101561005c57600080fd5b5035610099565b604080519115158252519081900360200190f35b61007f6100ac565b60408051918252519081900360200190f35b61007f6100bd565b60006100a66001836100c9565b92915050565b60006100b86001610143565b905090565b60006100b86001610183565b81546000906fffffffffffffffffffffffffffffffff165b835470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1681116101395760008181526001850160205260409020548314156101315760019150506100a6565b6001016100e1565b5060009392505050565b80546000906fffffffffffffffffffffffffffffffff70010000000000000000000000000000000082048116911661017b82826101c0565b949350505050565b805470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1660009081526001909101602052604090205490565b60019103016fffffffffffffffffffffffffffffffff169056fea26469706673582212203986df16bf8151067b530f7c4dd7bfa6f63b1423d179f41091358a28bd2a54e564736f6c63430007060033";
export class QueueManager__factory extends ContractFactory {
constructor(signer?: Signer) {
super(_abi, _bytecode, signer);
}
deploy(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<QueueManager> {
return super.deploy(overrides || {}) as Promise<QueueManager>;
}
getDeployTransaction(
overrides?: Overrides & { from?: string | Promise<string> }
): TransactionRequest {
return super.getDeployTransaction(overrides || {});
}
attach(address: string): QueueManager {
return super.attach(address) as QueueManager;
}
connect(signer: Signer): QueueManager__factory {
return super.connect(signer) as QueueManager__factory;
}
static readonly bytecode = _bytecode;
static readonly abi = _abi;
static createInterface(): QueueManagerInterface {
return new utils.Interface(_abi) as QueueManagerInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): QueueManager {
return new Contract(address, _abi, signerOrProvider) as QueueManager;
}
}

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,202 +0,0 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import {
Signer,
utils,
Contract,
ContractFactory,
PayableOverrides,
} from "ethers";
import { Provider, TransactionRequest } from "@ethersproject/providers";
import type {
UpdaterManager,
UpdaterManagerInterface,
} from "../UpdaterManager";
const _abi = [
{
inputs: [
{
internalType: "address",
name: "_updaterAddress",
type: "address",
},
],
stateMutability: "payable",
type: "constructor",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "reporter",
type: "address",
},
],
name: "FakeSlashed",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "home",
type: "address",
},
],
name: "NewHome",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "previousOwner",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "OwnershipTransferred",
type: "event",
},
{
inputs: [],
name: "owner",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_home",
type: "address",
},
],
name: "setHome",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_updaterAddress",
type: "address",
},
],
name: "setUpdater",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address payable",
name: "_reporter",
type: "address",
},
],
name: "slashUpdater",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "updater",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
];
const _bytecode =
"0x60806040526040516109663803806109668339818101604052602081101561002657600080fd5b505160006100326100a1565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600280546001600160a01b0319166001600160a01b03929092169190911790556100a5565b3390565b6108b2806100b46000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100f25780639d54f41914610123578063df034cd014610156578063f2fde38b1461015e5761007d565b80635b3c2cbf146100825780636ef0f37f146100b7578063715018a6146100ea575b600080fd5b6100b56004803603602081101561009857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610191565b005b6100b5600480360360208110156100cd57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610263565b6100b56103f8565b6100fa61050f565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100b56004803603602081101561013957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661052b565b6100fa61068f565b6100b56004803603602081101561017457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166106ab565b60015473ffffffffffffffffffffffffffffffffffffffff16331461021757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f21686f6d65000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8316815290517f4180932f5f5f11458bcd408e42c54626987799e7c4c89f40f484fefdfdfff14f9181900360200190a150565b61026b61084c565b73ffffffffffffffffffffffffffffffffffffffff1661028961050f565b73ffffffffffffffffffffffffffffffffffffffff161461030b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61031481610850565b61037f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f21636f6e747261637420686f6d65000000000000000000000000000000000000604482015290519081900360640190fd5b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915560408051918252517fa6c230e5615262e310dcb42eaf014e813e5d8580abf5b00d2186ca8e9833de219181900360200190a150565b61040061084c565b73ffffffffffffffffffffffffffffffffffffffff1661041e61050f565b73ffffffffffffffffffffffffffffffffffffffff16146104a057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b61053361084c565b73ffffffffffffffffffffffffffffffffffffffff1661055161050f565b73ffffffffffffffffffffffffffffffffffffffff16146105d357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217909255600154604080517f9d54f419000000000000000000000000000000000000000000000000000000008152600481019390935251921691639d54f4199160248082019260009290919082900301818387803b15801561067457600080fd5b505af1158015610688573d6000803e3d6000fd5b5050505050565b60025473ffffffffffffffffffffffffffffffffffffffff1690565b6106b361084c565b73ffffffffffffffffffffffffffffffffffffffff166106d161050f565b73ffffffffffffffffffffffffffffffffffffffff161461075357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81166107bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806108576026913960400191505060405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b3390565b3b15159056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212206a89c5c4e18144cd4168abe90868abf0d0cd57bdd92b36ff23b682243dda36c064736f6c63430007060033";
export class UpdaterManager__factory extends ContractFactory {
constructor(signer?: Signer) {
super(_abi, _bytecode, signer);
}
deploy(
_updaterAddress: string,
overrides?: PayableOverrides & { from?: string | Promise<string> }
): Promise<UpdaterManager> {
return super.deploy(
_updaterAddress,
overrides || {}
) as Promise<UpdaterManager>;
}
getDeployTransaction(
_updaterAddress: string,
overrides?: PayableOverrides & { from?: string | Promise<string> }
): TransactionRequest {
return super.getDeployTransaction(_updaterAddress, overrides || {});
}
attach(address: string): UpdaterManager {
return super.attach(address) as UpdaterManager;
}
connect(signer: Signer): UpdaterManager__factory {
return super.connect(signer) as UpdaterManager__factory;
}
static readonly bytecode = _bytecode;
static readonly abi = _abi;
static createInterface(): UpdaterManagerInterface {
return new utils.Interface(_abi) as UpdaterManagerInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): UpdaterManager {
return new Contract(address, _abi, signerOrProvider) as UpdaterManager;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -40,10 +40,6 @@ declare module "hardhat/types/runtime" {
name: "MerkleTreeManager",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.MerkleTreeManager__factory>;
getContractFactory(
name: "QueueManager",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.QueueManager__factory>;
getContractFactory(
name: "Replica",
signerOrOptions?: ethers.Signer | FactoryOptions
@ -108,10 +104,6 @@ declare module "hardhat/types/runtime" {
name: "TestMessage",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.TestMessage__factory>;
getContractFactory(
name: "TestQueue",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.TestQueue__factory>;
getContractFactory(
name: "TestRecipient",
signerOrOptions?: ethers.Signer | FactoryOptions
@ -120,14 +112,6 @@ declare module "hardhat/types/runtime" {
name: "TestReplica",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.TestReplica__factory>;
getContractFactory(
name: "TestXAppConnectionManager",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.TestXAppConnectionManager__factory>;
getContractFactory(
name: "UpdaterManager",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.UpdaterManager__factory>;
getContractFactory(
name: "UpgradeBeacon",
signerOrOptions?: ethers.Signer | FactoryOptions
@ -140,6 +124,10 @@ declare module "hardhat/types/runtime" {
name: "UpgradeBeaconProxy",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.UpgradeBeaconProxy__factory>;
getContractFactory(
name: "ValidatorManager",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.ValidatorManager__factory>;
getContractFactory(
name: "Version0",
signerOrOptions?: ethers.Signer | FactoryOptions
@ -153,9 +141,9 @@ declare module "hardhat/types/runtime" {
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.IMessageRecipient__factory>;
getContractFactory(
name: "IUpdaterManager",
name: "IValidatorManager",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.IUpdaterManager__factory>;
): Promise<Contracts.IValidatorManager__factory>;
// default types
getContractFactory(

@ -8,7 +8,6 @@ export type { Common } from "./Common";
export type { GovernanceRouter } from "./GovernanceRouter";
export type { Home } from "./Home";
export type { MerkleTreeManager } from "./MerkleTreeManager";
export type { QueueManager } from "./QueueManager";
export type { Replica } from "./Replica";
export type { BadRecipient1 } from "./BadRecipient1";
export type { BadRecipient2 } from "./BadRecipient2";
@ -25,18 +24,16 @@ export type { TestGovernanceRouter } from "./TestGovernanceRouter";
export type { TestHome } from "./TestHome";
export type { TestMerkle } from "./TestMerkle";
export type { TestMessage } from "./TestMessage";
export type { TestQueue } from "./TestQueue";
export type { TestRecipient } from "./TestRecipient";
export type { TestReplica } from "./TestReplica";
export type { TestXAppConnectionManager } from "./TestXAppConnectionManager";
export type { UpdaterManager } from "./UpdaterManager";
export type { UpgradeBeacon } from "./UpgradeBeacon";
export type { UpgradeBeaconController } from "./UpgradeBeaconController";
export type { UpgradeBeaconProxy } from "./UpgradeBeaconProxy";
export type { ValidatorManager } from "./ValidatorManager";
export type { Version0 } from "./Version0";
export type { XAppConnectionManager } from "./XAppConnectionManager";
export type { IMessageRecipient } from "./IMessageRecipient";
export type { IUpdaterManager } from "./IUpdaterManager";
export type { IValidatorManager } from "./IValidatorManager";
export { OwnableUpgradeable__factory } from "./factories/OwnableUpgradeable__factory";
export { Ownable__factory } from "./factories/Ownable__factory";
@ -45,7 +42,6 @@ export { Common__factory } from "./factories/Common__factory";
export { GovernanceRouter__factory } from "./factories/GovernanceRouter__factory";
export { Home__factory } from "./factories/Home__factory";
export { MerkleTreeManager__factory } from "./factories/MerkleTreeManager__factory";
export { QueueManager__factory } from "./factories/QueueManager__factory";
export { Replica__factory } from "./factories/Replica__factory";
export { BadRecipient1__factory } from "./factories/BadRecipient1__factory";
export { BadRecipient2__factory } from "./factories/BadRecipient2__factory";
@ -62,15 +58,13 @@ export { TestGovernanceRouter__factory } from "./factories/TestGovernanceRouter_
export { TestHome__factory } from "./factories/TestHome__factory";
export { TestMerkle__factory } from "./factories/TestMerkle__factory";
export { TestMessage__factory } from "./factories/TestMessage__factory";
export { TestQueue__factory } from "./factories/TestQueue__factory";
export { TestRecipient__factory } from "./factories/TestRecipient__factory";
export { TestReplica__factory } from "./factories/TestReplica__factory";
export { TestXAppConnectionManager__factory } from "./factories/TestXAppConnectionManager__factory";
export { UpdaterManager__factory } from "./factories/UpdaterManager__factory";
export { UpgradeBeacon__factory } from "./factories/UpgradeBeacon__factory";
export { UpgradeBeaconController__factory } from "./factories/UpgradeBeaconController__factory";
export { UpgradeBeaconProxy__factory } from "./factories/UpgradeBeaconProxy__factory";
export { ValidatorManager__factory } from "./factories/ValidatorManager__factory";
export { Version0__factory } from "./factories/Version0__factory";
export { XAppConnectionManager__factory } from "./factories/XAppConnectionManager__factory";
export { IMessageRecipient__factory } from "./factories/IMessageRecipient__factory";
export { IUpdaterManager__factory } from "./factories/IUpdaterManager__factory";
export { IValidatorManager__factory } from "./factories/IValidatorManager__factory";

@ -44,7 +44,7 @@ describe('BridgeRouter', async () => {
// local router.
await abacusDeployment
.connectionManager(localDomain)
.ownerEnrollReplica(deployerAddress, remoteDomain);
.enrollReplica(deployerAddress, remoteDomain);
});
beforeEach(async () => {

@ -21,61 +21,94 @@ import { TypedEventFilter, TypedEvent, TypedListener } from "./commons";
interface CommonInterface extends ethers.utils.Interface {
functions: {
"committedRoot()": FunctionFragment;
"doubleUpdate(bytes32,bytes32[2],bytes,bytes)": FunctionFragment;
"homeDomainHash()": FunctionFragment;
"checkpointedRoot()": FunctionFragment;
"checkpoints(bytes32)": FunctionFragment;
"latestCheckpoint()": FunctionFragment;
"localDomain()": FunctionFragment;
"state()": FunctionFragment;
"updater()": FunctionFragment;
"owner()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"setValidatorManager(address)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"validatorManager()": FunctionFragment;
};
encodeFunctionData(
functionFragment: "committedRoot",
functionFragment: "checkpointedRoot",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "doubleUpdate",
values: [BytesLike, [BytesLike, BytesLike], BytesLike, BytesLike]
functionFragment: "checkpoints",
values: [BytesLike]
): string;
encodeFunctionData(
functionFragment: "homeDomainHash",
functionFragment: "latestCheckpoint",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "localDomain",
values?: undefined
): string;
encodeFunctionData(functionFragment: "state", values?: undefined): string;
encodeFunctionData(functionFragment: "updater", values?: undefined): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "setValidatorManager",
values: [string]
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(
functionFragment: "validatorManager",
values?: undefined
): string;
decodeFunctionResult(
functionFragment: "committedRoot",
functionFragment: "checkpointedRoot",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "doubleUpdate",
functionFragment: "checkpoints",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "homeDomainHash",
functionFragment: "latestCheckpoint",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "localDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "state", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "updater", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "setValidatorManager",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "validatorManager",
data: BytesLike
): Result;
events: {
"DoubleUpdate(bytes32,bytes32[2],bytes,bytes)": EventFragment;
"NewUpdater(address)": EventFragment;
"Update(uint32,bytes32,bytes32,bytes)": EventFragment;
"Checkpoint(bytes32,uint256)": EventFragment;
"NewValidatorManager(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "DoubleUpdate"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewUpdater"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Update"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Checkpoint"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewValidatorManager"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
}
export class Common extends BaseContract {
@ -122,134 +155,172 @@ export class Common extends BaseContract {
interface: CommonInterface;
functions: {
committedRoot(overrides?: CallOverrides): Promise<[string]>;
checkpointedRoot(overrides?: CallOverrides): Promise<[string]>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<[BigNumber]>;
homeDomainHash(overrides?: CallOverrides): Promise<[string]>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<[number]>;
state(overrides?: CallOverrides): Promise<[number]>;
owner(overrides?: CallOverrides): Promise<[string]>;
updater(overrides?: CallOverrides): Promise<[string]>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
validatorManager(overrides?: CallOverrides): Promise<[string]>;
};
committedRoot(overrides?: CallOverrides): Promise<string>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
state(overrides?: CallOverrides): Promise<number>;
owner(overrides?: CallOverrides): Promise<string>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setValidatorManager(
_validatorManager: 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>;
validatorManager(overrides?: CallOverrides): Promise<string>;
callStatic: {
committedRoot(overrides?: CallOverrides): Promise<string>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: CallOverrides
): Promise<void>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
state(overrides?: CallOverrides): Promise<number>;
owner(overrides?: CallOverrides): Promise<string>;
updater(overrides?: CallOverrides): Promise<string>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
setValidatorManager(
_validatorManager: string,
overrides?: CallOverrides
): Promise<void>;
transferOwnership(
newOwner: string,
overrides?: CallOverrides
): Promise<void>;
validatorManager(overrides?: CallOverrides): Promise<string>;
};
filters: {
DoubleUpdate(
oldRoot?: null,
newRoot?: null,
signature?: null,
signature2?: null
Checkpoint(
root?: BytesLike | null,
index?: BigNumberish | null
): TypedEventFilter<
[string, [string, string], string, string],
{
oldRoot: string;
newRoot: [string, string];
signature: string;
signature2: string;
}
[string, BigNumber],
{ root: string; index: BigNumber }
>;
NewUpdater(updater?: null): TypedEventFilter<[string], { updater: string }>;
NewValidatorManager(
validatorManager?: null
): TypedEventFilter<[string], { validatorManager: string }>;
Update(
homeDomain?: BigNumberish | null,
oldRoot?: BytesLike | null,
newRoot?: BytesLike | null,
signature?: null
OwnershipTransferred(
previousOwner?: string | null,
newOwner?: string | null
): TypedEventFilter<
[number, string, string, string],
{
homeDomain: number;
oldRoot: string;
newRoot: string;
signature: string;
}
[string, string],
{ previousOwner: string; newOwner: string }
>;
};
estimateGas: {
committedRoot(overrides?: CallOverrides): Promise<BigNumber>;
checkpointedRoot(overrides?: CallOverrides): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
homeDomainHash(overrides?: CallOverrides): Promise<BigNumber>;
latestCheckpoint(overrides?: CallOverrides): Promise<BigNumber>;
localDomain(overrides?: CallOverrides): Promise<BigNumber>;
state(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<BigNumber>;
updater(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
validatorManager(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
committedRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
checkpointedRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<PopulatedTransaction>;
latestCheckpoint(overrides?: CallOverrides): Promise<PopulatedTransaction>;
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
state(overrides?: CallOverrides): Promise<PopulatedTransaction>;
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
setValidatorManager(
_validatorManager: 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>;
validatorManager(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -23,30 +23,24 @@ interface HomeInterface extends ethers.utils.Interface {
functions: {
"MAX_MESSAGE_BODY_BYTES()": FunctionFragment;
"VERSION()": FunctionFragment;
"committedRoot()": FunctionFragment;
"checkpoint()": FunctionFragment;
"checkpointedRoot()": FunctionFragment;
"checkpoints(bytes32)": FunctionFragment;
"count()": FunctionFragment;
"dispatch(uint32,bytes32,bytes)": FunctionFragment;
"doubleUpdate(bytes32,bytes32[2],bytes,bytes)": FunctionFragment;
"homeDomainHash()": FunctionFragment;
"improperUpdate(bytes32,bytes32,bytes)": FunctionFragment;
"fail()": FunctionFragment;
"initialize(address)": FunctionFragment;
"latestCheckpoint()": FunctionFragment;
"localDomain()": FunctionFragment;
"nonces(uint32)": FunctionFragment;
"owner()": FunctionFragment;
"queueContains(bytes32)": FunctionFragment;
"queueEnd()": FunctionFragment;
"queueLength()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"root()": FunctionFragment;
"setUpdater(address)": FunctionFragment;
"setUpdaterManager(address)": FunctionFragment;
"setValidatorManager(address)": FunctionFragment;
"state()": FunctionFragment;
"suggestUpdate()": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"tree()": FunctionFragment;
"update(bytes32,bytes32,bytes)": FunctionFragment;
"updater()": FunctionFragment;
"updaterManager()": FunctionFragment;
"validatorManager()": FunctionFragment;
};
encodeFunctionData(
@ -55,27 +49,28 @@ interface HomeInterface extends ethers.utils.Interface {
): string;
encodeFunctionData(functionFragment: "VERSION", values?: undefined): string;
encodeFunctionData(
functionFragment: "committedRoot",
functionFragment: "checkpoint",
values?: undefined
): string;
encodeFunctionData(functionFragment: "count", values?: undefined): string;
encodeFunctionData(
functionFragment: "dispatch",
values: [BigNumberish, BytesLike, BytesLike]
functionFragment: "checkpointedRoot",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "doubleUpdate",
values: [BytesLike, [BytesLike, BytesLike], BytesLike, BytesLike]
functionFragment: "checkpoints",
values: [BytesLike]
): string;
encodeFunctionData(functionFragment: "count", values?: undefined): string;
encodeFunctionData(
functionFragment: "homeDomainHash",
values?: undefined
functionFragment: "dispatch",
values: [BigNumberish, BytesLike, BytesLike]
): string;
encodeFunctionData(functionFragment: "fail", values?: undefined): string;
encodeFunctionData(functionFragment: "initialize", values: [string]): string;
encodeFunctionData(
functionFragment: "improperUpdate",
values: [BytesLike, BytesLike, BytesLike]
functionFragment: "latestCheckpoint",
values?: undefined
): string;
encodeFunctionData(functionFragment: "initialize", values: [string]): string;
encodeFunctionData(
functionFragment: "localDomain",
values?: undefined
@ -85,42 +80,23 @@ interface HomeInterface extends ethers.utils.Interface {
values: [BigNumberish]
): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(
functionFragment: "queueContains",
values: [BytesLike]
): string;
encodeFunctionData(functionFragment: "queueEnd", values?: undefined): string;
encodeFunctionData(
functionFragment: "queueLength",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(functionFragment: "root", values?: undefined): string;
encodeFunctionData(functionFragment: "setUpdater", values: [string]): string;
encodeFunctionData(
functionFragment: "setUpdaterManager",
functionFragment: "setValidatorManager",
values: [string]
): string;
encodeFunctionData(functionFragment: "state", values?: undefined): string;
encodeFunctionData(
functionFragment: "suggestUpdate",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(functionFragment: "tree", values?: undefined): string;
encodeFunctionData(
functionFragment: "update",
values: [BytesLike, BytesLike, BytesLike]
): string;
encodeFunctionData(functionFragment: "updater", values?: undefined): string;
encodeFunctionData(
functionFragment: "updaterManager",
functionFragment: "validatorManager",
values?: undefined
): string;
@ -129,86 +105,62 @@ interface HomeInterface extends ethers.utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "VERSION", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "checkpoint", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "committedRoot",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "count", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "dispatch", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "doubleUpdate",
functionFragment: "checkpointedRoot",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "homeDomainHash",
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: "improperUpdate",
functionFragment: "latestCheckpoint",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "localDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "queueContains",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "queueEnd", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "queueLength",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "root", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "setUpdater", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "setUpdaterManager",
functionFragment: "setValidatorManager",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "state", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "suggestUpdate",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "tree", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "update", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "updater", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "updaterManager",
functionFragment: "validatorManager",
data: BytesLike
): Result;
events: {
"Checkpoint(bytes32,uint256)": EventFragment;
"Dispatch(bytes32,uint256,uint64,bytes32,bytes)": EventFragment;
"DoubleUpdate(bytes32,bytes32[2],bytes,bytes)": EventFragment;
"ImproperUpdate(bytes32,bytes32,bytes)": EventFragment;
"NewUpdater(address)": EventFragment;
"NewUpdaterManager(address)": EventFragment;
"Fail()": EventFragment;
"NewValidatorManager(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
"Update(uint32,bytes32,bytes32,bytes)": EventFragment;
"UpdaterSlashed(address,address)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "Checkpoint"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Dispatch"): EventFragment;
getEvent(nameOrSignatureOrTopic: "DoubleUpdate"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ImproperUpdate"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewUpdater"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewUpdaterManager"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Fail"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewValidatorManager"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Update"): EventFragment;
getEvent(nameOrSignatureOrTopic: "UpdaterSlashed"): EventFragment;
}
export class Home extends BaseContract {
@ -259,7 +211,16 @@ export class Home extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<[number]>;
committedRoot(overrides?: CallOverrides): Promise<[string]>;
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]>;
@ -270,65 +231,38 @@ export class Home extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<[string]>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
initialize(
_updaterManager: string,
_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]>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<[boolean]>;
queueEnd(overrides?: CallOverrides): Promise<[string]>;
queueLength(overrides?: CallOverrides): Promise<[BigNumber]>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
root(overrides?: CallOverrides): Promise<[string]>;
setUpdater(
_updater: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setUpdaterManager(
_updaterManager: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<[number]>;
suggestUpdate(
overrides?: CallOverrides
): Promise<[string, string] & { _committedRoot: string; _new: string }>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
@ -338,23 +272,20 @@ export class Home extends BaseContract {
overrides?: CallOverrides
): Promise<[BigNumber] & { count: BigNumber }>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<[string]>;
updaterManager(overrides?: CallOverrides): Promise<[string]>;
validatorManager(overrides?: CallOverrides): Promise<[string]>;
};
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<BigNumber>;
VERSION(overrides?: CallOverrides): Promise<number>;
committedRoot(overrides?: CallOverrides): Promise<string>;
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>;
@ -365,62 +296,38 @@ export class Home extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
initialize(
_updaterManager: string,
_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>;
queueContains(_item: BytesLike, overrides?: CallOverrides): Promise<boolean>;
queueEnd(overrides?: CallOverrides): Promise<string>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
root(overrides?: CallOverrides): Promise<string>;
setUpdater(
_updater: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setUpdaterManager(
_updaterManager: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<number>;
suggestUpdate(
overrides?: CallOverrides
): Promise<[string, string] & { _committedRoot: string; _new: string }>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
@ -428,23 +335,18 @@ export class Home extends BaseContract {
tree(overrides?: CallOverrides): Promise<BigNumber>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<string>;
updaterManager(overrides?: CallOverrides): Promise<string>;
validatorManager(overrides?: CallOverrides): Promise<string>;
callStatic: {
MAX_MESSAGE_BODY_BYTES(overrides?: CallOverrides): Promise<BigNumber>;
VERSION(overrides?: CallOverrides): Promise<number>;
committedRoot(overrides?: CallOverrides): Promise<string>;
checkpoint(overrides?: CallOverrides): Promise<void>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
count(overrides?: CallOverrides): Promise<BigNumber>;
@ -455,60 +357,34 @@ export class Home extends BaseContract {
overrides?: CallOverrides
): Promise<void>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: CallOverrides
): Promise<void>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
fail(overrides?: CallOverrides): Promise<void>;
initialize(
_updaterManager: string,
_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>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
queueEnd(overrides?: CallOverrides): Promise<string>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
root(overrides?: CallOverrides): Promise<string>;
setUpdater(_updater: string, overrides?: CallOverrides): Promise<void>;
setUpdaterManager(
_updaterManager: string,
setValidatorManager(
_validatorManager: string,
overrides?: CallOverrides
): Promise<void>;
state(overrides?: CallOverrides): Promise<number>;
suggestUpdate(
overrides?: CallOverrides
): Promise<[string, string] & { _committedRoot: string; _new: string }>;
transferOwnership(
newOwner: string,
overrides?: CallOverrides
@ -516,24 +392,23 @@ export class Home extends BaseContract {
tree(overrides?: CallOverrides): Promise<BigNumber>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<void>;
updater(overrides?: CallOverrides): Promise<string>;
updaterManager(overrides?: CallOverrides): Promise<string>;
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,
committedRoot?: null,
checkpointedRoot?: null,
message?: null
): TypedEventFilter<
[string, BigNumber, BigNumber, string, string],
@ -541,40 +416,16 @@ export class Home extends BaseContract {
messageHash: string;
leafIndex: BigNumber;
destinationAndNonce: BigNumber;
committedRoot: string;
checkpointedRoot: string;
message: string;
}
>;
DoubleUpdate(
oldRoot?: null,
newRoot?: null,
signature?: null,
signature2?: null
): TypedEventFilter<
[string, [string, string], string, string],
{
oldRoot: string;
newRoot: [string, string];
signature: string;
signature2: string;
}
>;
Fail(): TypedEventFilter<[], {}>;
ImproperUpdate(
oldRoot?: null,
newRoot?: null,
signature?: null
): TypedEventFilter<
[string, string, string],
{ oldRoot: string; newRoot: string; signature: string }
>;
NewUpdater(updater?: null): TypedEventFilter<[string], { updater: string }>;
NewUpdaterManager(
updaterManager?: null
): TypedEventFilter<[string], { updaterManager: string }>;
NewValidatorManager(
validatorManager?: null
): TypedEventFilter<[string], { validatorManager: string }>;
OwnershipTransferred(
previousOwner?: string | null,
@ -583,29 +434,6 @@ export class Home extends BaseContract {
[string, string],
{ previousOwner: string; newOwner: string }
>;
Update(
homeDomain?: BigNumberish | null,
oldRoot?: BytesLike | null,
newRoot?: BytesLike | null,
signature?: null
): TypedEventFilter<
[number, string, string, string],
{
homeDomain: number;
oldRoot: string;
newRoot: string;
signature: string;
}
>;
UpdaterSlashed(
updater?: string | null,
reporter?: string | null
): TypedEventFilter<
[string, string],
{ updater: string; reporter: string }
>;
};
estimateGas: {
@ -613,7 +441,13 @@ export class Home extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<BigNumber>;
committedRoot(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>;
@ -624,63 +458,36 @@ export class Home extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
homeDomainHash(overrides?: CallOverrides): Promise<BigNumber>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
initialize(
_updaterManager: string,
_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>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<BigNumber>;
queueEnd(overrides?: CallOverrides): Promise<BigNumber>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
root(overrides?: CallOverrides): Promise<BigNumber>;
setUpdater(
_updater: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
setUpdaterManager(
_updaterManager: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
state(overrides?: CallOverrides): Promise<BigNumber>;
suggestUpdate(overrides?: CallOverrides): Promise<BigNumber>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
@ -688,16 +495,7 @@ export class Home extends BaseContract {
tree(overrides?: CallOverrides): Promise<BigNumber>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
updater(overrides?: CallOverrides): Promise<BigNumber>;
updaterManager(overrides?: CallOverrides): Promise<BigNumber>;
validatorManager(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
@ -707,7 +505,16 @@ export class Home extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<PopulatedTransaction>;
committedRoot(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>;
@ -718,28 +525,17 @@ export class Home extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<PopulatedTransaction>;
improperUpdate(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
fail(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
initialize(
_updaterManager: string,
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
latestCheckpoint(overrides?: CallOverrides): Promise<PopulatedTransaction>;
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
nonces(
@ -749,35 +545,19 @@ export class Home extends BaseContract {
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
queueContains(
_item: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
queueEnd(overrides?: CallOverrides): Promise<PopulatedTransaction>;
queueLength(overrides?: CallOverrides): Promise<PopulatedTransaction>;
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
root(overrides?: CallOverrides): Promise<PopulatedTransaction>;
setUpdater(
_updater: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
setUpdaterManager(
_updaterManager: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
state(overrides?: CallOverrides): Promise<PopulatedTransaction>;
suggestUpdate(overrides?: CallOverrides): Promise<PopulatedTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
@ -785,15 +565,6 @@ export class Home extends BaseContract {
tree(overrides?: CallOverrides): Promise<PopulatedTransaction>;
update(
_committedRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
updater(overrides?: CallOverrides): Promise<PopulatedTransaction>;
updaterManager(overrides?: CallOverrides): Promise<PopulatedTransaction>;
validatorManager(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -18,37 +18,25 @@ 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 {
interface IValidatorManagerInterface extends ethers.utils.Interface {
functions: {
"queueContains(bytes32)": FunctionFragment;
"queueEnd()": FunctionFragment;
"queueLength()": FunctionFragment;
"isValidatorSignature(uint32,bytes32,uint256,bytes)": FunctionFragment;
};
encodeFunctionData(
functionFragment: "queueContains",
values: [BytesLike]
): string;
encodeFunctionData(functionFragment: "queueEnd", values?: undefined): string;
encodeFunctionData(
functionFragment: "queueLength",
values?: undefined
functionFragment: "isValidatorSignature",
values: [BigNumberish, BytesLike, BigNumberish, BytesLike]
): string;
decodeFunctionResult(
functionFragment: "queueContains",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "queueEnd", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "queueLength",
functionFragment: "isValidatorSignature",
data: BytesLike
): Result;
events: {};
}
export class QueueManager extends BaseContract {
export class IValidatorManager extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
@ -89,57 +77,55 @@ export class QueueManager extends BaseContract {
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: QueueManagerInterface;
interface: IValidatorManagerInterface;
functions: {
queueContains(
_item: BytesLike,
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: 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>;
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
callStatic: {
queueContains(
_item: BytesLike,
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
queueEnd(overrides?: CallOverrides): Promise<string>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
};
filters: {};
estimateGas: {
queueContains(
_item: BytesLike,
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<BigNumber>;
queueEnd(overrides?: CallOverrides): Promise<BigNumber>;
queueLength(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
queueContains(
_item: BytesLike,
isValidatorSignature(
_domain: BigNumberish,
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
queueEnd(overrides?: CallOverrides): Promise<PopulatedTransaction>;
queueLength(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -24,25 +24,22 @@ interface ReplicaInterface extends ethers.utils.Interface {
"PROCESS_GAS()": FunctionFragment;
"RESERVE_GAS()": FunctionFragment;
"VERSION()": FunctionFragment;
"acceptableRoot(bytes32)": FunctionFragment;
"committedRoot()": FunctionFragment;
"confirmAt(bytes32)": FunctionFragment;
"doubleUpdate(bytes32,bytes32[2],bytes,bytes)": FunctionFragment;
"homeDomainHash()": FunctionFragment;
"checkpoint(bytes32,uint256,bytes)": FunctionFragment;
"checkpointedRoot()": FunctionFragment;
"checkpoints(bytes32)": FunctionFragment;
"initialize(uint32,address,bytes32,uint256)": FunctionFragment;
"latestCheckpoint()": FunctionFragment;
"localDomain()": FunctionFragment;
"messages(bytes32)": FunctionFragment;
"optimisticSeconds()": FunctionFragment;
"owner()": FunctionFragment;
"process(bytes)": FunctionFragment;
"prove(bytes32,bytes32[32],uint256)": FunctionFragment;
"proveAndProcess(bytes,bytes32[32],uint256)": FunctionFragment;
"remoteDomain()": FunctionFragment;
"setUpdater(address)": FunctionFragment;
"state()": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"setValidatorManager(address)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"update(bytes32,bytes32,bytes)": FunctionFragment;
"updater()": FunctionFragment;
"validatorManager()": FunctionFragment;
};
encodeFunctionData(
@ -55,38 +52,30 @@ interface ReplicaInterface extends ethers.utils.Interface {
): string;
encodeFunctionData(functionFragment: "VERSION", values?: undefined): string;
encodeFunctionData(
functionFragment: "acceptableRoot",
values: [BytesLike]
functionFragment: "checkpoint",
values: [BytesLike, BigNumberish, BytesLike]
): string;
encodeFunctionData(
functionFragment: "committedRoot",
functionFragment: "checkpointedRoot",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "confirmAt",
functionFragment: "checkpoints",
values: [BytesLike]
): string;
encodeFunctionData(
functionFragment: "doubleUpdate",
values: [BytesLike, [BytesLike, BytesLike], BytesLike, BytesLike]
): string;
encodeFunctionData(
functionFragment: "homeDomainHash",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "initialize",
values: [BigNumberish, string, BytesLike, BigNumberish]
): string;
encodeFunctionData(
functionFragment: "localDomain",
functionFragment: "latestCheckpoint",
values?: undefined
): string;
encodeFunctionData(functionFragment: "messages", values: [BytesLike]): string;
encodeFunctionData(
functionFragment: "optimisticSeconds",
functionFragment: "localDomain",
values?: undefined
): string;
encodeFunctionData(functionFragment: "messages", values: [BytesLike]): string;
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
encodeFunctionData(functionFragment: "process", values: [BytesLike]): string;
encodeFunctionData(
@ -175,17 +164,22 @@ interface ReplicaInterface extends ethers.utils.Interface {
functionFragment: "remoteDomain",
values?: undefined
): string;
encodeFunctionData(functionFragment: "setUpdater", values: [string]): string;
encodeFunctionData(functionFragment: "state", values?: undefined): string;
encodeFunctionData(
functionFragment: "renounceOwnership",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "setValidatorManager",
values: [string]
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(
functionFragment: "update",
values: [BytesLike, BytesLike, BytesLike]
functionFragment: "validatorManager",
values?: undefined
): string;
encodeFunctionData(functionFragment: "updater", values?: undefined): string;
decodeFunctionResult(
functionFragment: "PROCESS_GAS",
@ -196,33 +190,25 @@ interface ReplicaInterface extends ethers.utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "VERSION", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "checkpoint", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "acceptableRoot",
functionFragment: "checkpointedRoot",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "committedRoot",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "confirmAt", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "doubleUpdate",
functionFragment: "checkpoints",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "homeDomainHash",
functionFragment: "latestCheckpoint",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "localDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "messages", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "optimisticSeconds",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "process", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "prove", data: BytesLike): Result;
@ -234,28 +220,34 @@ interface ReplicaInterface extends ethers.utils.Interface {
functionFragment: "remoteDomain",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setUpdater", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "state", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "renounceOwnership",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "setValidatorManager",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "update", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "updater", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "validatorManager",
data: BytesLike
): Result;
events: {
"DoubleUpdate(bytes32,bytes32[2],bytes,bytes)": EventFragment;
"NewUpdater(address)": EventFragment;
"Checkpoint(bytes32,uint256)": EventFragment;
"NewValidatorManager(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
"Process(bytes32,bool,bytes)": EventFragment;
"Update(uint32,bytes32,bytes32,bytes)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "DoubleUpdate"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewUpdater"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Checkpoint"): EventFragment;
getEvent(nameOrSignatureOrTopic: "NewValidatorManager"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Process"): EventFragment;
getEvent(nameOrSignatureOrTopic: "Update"): EventFragment;
}
export class Replica extends BaseContract {
@ -308,39 +300,36 @@ export class Replica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<[number]>;
acceptableRoot(
checkpoint(
_root: BytesLike,
overrides?: CallOverrides
): Promise<[boolean]>;
committedRoot(overrides?: CallOverrides): Promise<[string]>;
confirmAt(arg0: BytesLike, overrides?: CallOverrides): Promise<[BigNumber]>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_index: BigNumberish,
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<[string]>;
checkpointedRoot(overrides?: CallOverrides): Promise<[string]>;
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<[BigNumber]>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<[number]>;
messages(arg0: BytesLike, overrides?: CallOverrides): Promise<[number]>;
optimisticSeconds(overrides?: CallOverrides): Promise<[BigNumber]>;
owner(overrides?: CallOverrides): Promise<[string]>;
process(
@ -430,26 +419,21 @@ export class Replica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<[number]>;
setUpdater(
_updater: string,
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<[number]>;
transferOwnership(
newOwner: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<[string]>;
validatorManager(overrides?: CallOverrides): Promise<[string]>;
};
PROCESS_GAS(overrides?: CallOverrides): Promise<BigNumber>;
@ -458,36 +442,33 @@ export class Replica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<number>;
acceptableRoot(_root: BytesLike, overrides?: CallOverrides): Promise<boolean>;
committedRoot(overrides?: CallOverrides): Promise<string>;
confirmAt(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
checkpoint(
_root: BytesLike,
_index: BigNumberish,
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
messages(arg0: BytesLike, overrides?: CallOverrides): Promise<number>;
optimisticSeconds(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<string>;
process(
@ -577,26 +558,21 @@ export class Replica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<number>;
setUpdater(
_updater: string,
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
state(overrides?: CallOverrides): Promise<number>;
transferOwnership(
newOwner: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
updater(overrides?: CallOverrides): Promise<string>;
validatorManager(overrides?: CallOverrides): Promise<string>;
callStatic: {
PROCESS_GAS(overrides?: CallOverrides): Promise<BigNumber>;
@ -605,39 +581,33 @@ export class Replica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<number>;
acceptableRoot(
checkpoint(
_root: BytesLike,
overrides?: CallOverrides
): Promise<boolean>;
committedRoot(overrides?: CallOverrides): Promise<string>;
confirmAt(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_index: BigNumberish,
_signature: BytesLike,
_signature2: BytesLike,
overrides?: CallOverrides
): Promise<void>;
homeDomainHash(overrides?: CallOverrides): Promise<string>;
checkpointedRoot(overrides?: CallOverrides): Promise<string>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: CallOverrides
): Promise<void>;
latestCheckpoint(
overrides?: CallOverrides
): Promise<[string, BigNumber] & { root: string; index: BigNumber }>;
localDomain(overrides?: CallOverrides): Promise<number>;
messages(arg0: BytesLike, overrides?: CallOverrides): Promise<number>;
optimisticSeconds(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<string>;
process(_message: BytesLike, overrides?: CallOverrides): Promise<boolean>;
@ -724,42 +694,33 @@ export class Replica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<number>;
setUpdater(_updater: string, overrides?: CallOverrides): Promise<void>;
state(overrides?: CallOverrides): Promise<number>;
renounceOwnership(overrides?: CallOverrides): Promise<void>;
transferOwnership(
newOwner: string,
setValidatorManager(
_validatorManager: string,
overrides?: CallOverrides
): Promise<void>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
transferOwnership(
newOwner: string,
overrides?: CallOverrides
): Promise<void>;
updater(overrides?: CallOverrides): Promise<string>;
validatorManager(overrides?: CallOverrides): Promise<string>;
};
filters: {
DoubleUpdate(
oldRoot?: null,
newRoot?: null,
signature?: null,
signature2?: null
Checkpoint(
root?: BytesLike | null,
index?: BigNumberish | null
): TypedEventFilter<
[string, [string, string], string, string],
{
oldRoot: string;
newRoot: [string, string];
signature: string;
signature2: string;
}
[string, BigNumber],
{ root: string; index: BigNumber }
>;
NewUpdater(updater?: null): TypedEventFilter<[string], { updater: string }>;
NewValidatorManager(
validatorManager?: null
): TypedEventFilter<[string], { validatorManager: string }>;
OwnershipTransferred(
previousOwner?: string | null,
@ -777,21 +738,6 @@ export class Replica extends BaseContract {
[string, boolean, string],
{ messageHash: string; success: boolean; returnData: string }
>;
Update(
homeDomain?: BigNumberish | null,
oldRoot?: BytesLike | null,
newRoot?: BytesLike | null,
signature?: null
): TypedEventFilter<
[number, string, string, string],
{
homeDomain: number;
oldRoot: string;
newRoot: string;
signature: string;
}
>;
};
estimateGas: {
@ -801,39 +747,31 @@ export class Replica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<BigNumber>;
acceptableRoot(
checkpoint(
_root: BytesLike,
overrides?: CallOverrides
): Promise<BigNumber>;
committedRoot(overrides?: CallOverrides): Promise<BigNumber>;
confirmAt(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_index: BigNumberish,
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
homeDomainHash(overrides?: CallOverrides): Promise<BigNumber>;
checkpointedRoot(overrides?: CallOverrides): Promise<BigNumber>;
checkpoints(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
latestCheckpoint(overrides?: CallOverrides): Promise<BigNumber>;
localDomain(overrides?: CallOverrides): Promise<BigNumber>;
messages(arg0: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
optimisticSeconds(overrides?: CallOverrides): Promise<BigNumber>;
owner(overrides?: CallOverrides): Promise<BigNumber>;
process(
@ -923,26 +861,21 @@ export class Replica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<BigNumber>;
setUpdater(
_updater: string,
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
state(overrides?: CallOverrides): Promise<BigNumber>;
transferOwnership(
newOwner: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
updater(overrides?: CallOverrides): Promise<BigNumber>;
validatorManager(overrides?: CallOverrides): Promise<BigNumber>;
};
populateTransaction: {
@ -952,36 +885,30 @@ export class Replica extends BaseContract {
VERSION(overrides?: CallOverrides): Promise<PopulatedTransaction>;
acceptableRoot(
checkpoint(
_root: BytesLike,
overrides?: CallOverrides
_index: BigNumberish,
_signature: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
committedRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
checkpointedRoot(overrides?: CallOverrides): Promise<PopulatedTransaction>;
confirmAt(
checkpoints(
arg0: BytesLike,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
doubleUpdate(
_oldRoot: BytesLike,
_newRoot: [BytesLike, BytesLike],
_signature: BytesLike,
_signature2: BytesLike,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
homeDomainHash(overrides?: CallOverrides): Promise<PopulatedTransaction>;
initialize(
_remoteDomain: BigNumberish,
_updater: string,
_committedRoot: BytesLike,
_optimisticSeconds: BigNumberish,
_validatorManager: string,
_checkpointedRoot: BytesLike,
_checkpointedIndex: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
latestCheckpoint(overrides?: CallOverrides): Promise<PopulatedTransaction>;
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
messages(
@ -989,8 +916,6 @@ export class Replica extends BaseContract {
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
optimisticSeconds(overrides?: CallOverrides): Promise<PopulatedTransaction>;
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
process(
@ -1080,25 +1005,20 @@ export class Replica extends BaseContract {
remoteDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>;
setUpdater(
_updater: string,
renounceOwnership(
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
state(overrides?: CallOverrides): Promise<PopulatedTransaction>;
transferOwnership(
newOwner: string,
setValidatorManager(
_validatorManager: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
update(
_oldRoot: BytesLike,
_newRoot: BytesLike,
_signature: BytesLike,
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
updater(overrides?: CallOverrides): Promise<PopulatedTransaction>;
validatorManager(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}

@ -22,25 +22,26 @@ 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;
"localDomain()": FunctionFragment;
"owner()": FunctionFragment;
"ownerEnrollReplica(address,uint32)": FunctionFragment;
"ownerUnenrollReplica(address)": FunctionFragment;
"renounceOwnership()": FunctionFragment;
"replicaToDomain(address)": FunctionFragment;
"setHome(address)": FunctionFragment;
"setWatcherPermission(address,uint32,bool)": FunctionFragment;
"transferOwnership(address)": FunctionFragment;
"unenrollReplica(uint32,bytes32,bytes)": FunctionFragment;
"watcherPermission(address,uint32)": FunctionFragment;
"unenrollReplica(address)": FunctionFragment;
};
encodeFunctionData(
functionFragment: "domainToReplica",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "enrollReplica",
values: [string, BigNumberish]
): string;
encodeFunctionData(functionFragment: "home", values?: undefined): string;
encodeFunctionData(functionFragment: "isReplica", values: [string]): string;
encodeFunctionData(
@ -48,14 +49,6 @@ interface XAppConnectionManagerInterface extends ethers.utils.Interface {
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
@ -65,27 +58,23 @@ interface XAppConnectionManagerInterface extends ethers.utils.Interface {
values: [string]
): string;
encodeFunctionData(functionFragment: "setHome", values: [string]): string;
encodeFunctionData(
functionFragment: "setWatcherPermission",
values: [string, BigNumberish, boolean]
): string;
encodeFunctionData(
functionFragment: "transferOwnership",
values: [string]
): string;
encodeFunctionData(
functionFragment: "unenrollReplica",
values: [BigNumberish, BytesLike, BytesLike]
): string;
encodeFunctionData(
functionFragment: "watcherPermission",
values: [string, BigNumberish]
values: [string]
): string;
decodeFunctionResult(
functionFragment: "domainToReplica",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "enrollReplica",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "home", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "isReplica", data: BytesLike): Result;
decodeFunctionResult(
@ -93,14 +82,6 @@ interface XAppConnectionManagerInterface extends ethers.utils.Interface {
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
@ -110,10 +91,6 @@ interface XAppConnectionManagerInterface extends ethers.utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "setHome", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "setWatcherPermission",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "transferOwnership",
data: BytesLike
@ -122,22 +99,18 @@ interface XAppConnectionManagerInterface extends ethers.utils.Interface {
functionFragment: "unenrollReplica",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "watcherPermission",
data: BytesLike
): Result;
events: {
"NewHome(address)": EventFragment;
"OwnershipTransferred(address,address)": EventFragment;
"ReplicaEnrolled(uint32,address)": EventFragment;
"ReplicaUnenrolled(uint32,address)": EventFragment;
"WatcherPermissionSet(uint32,address,bool)": EventFragment;
};
getEvent(nameOrSignatureOrTopic: "NewHome"): EventFragment;
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ReplicaEnrolled"): EventFragment;
getEvent(nameOrSignatureOrTopic: "ReplicaUnenrolled"): EventFragment;
getEvent(nameOrSignatureOrTopic: "WatcherPermissionSet"): EventFragment;
}
export class XAppConnectionManager extends BaseContract {
@ -189,6 +162,12 @@ export class XAppConnectionManager extends BaseContract {
overrides?: CallOverrides
): Promise<[string]>;
enrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
home(overrides?: CallOverrides): Promise<[string]>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<[boolean]>;
@ -197,17 +176,6 @@ export class XAppConnectionManager extends BaseContract {
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>;
@ -219,30 +187,15 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setWatcherPermission(
_watcher: string,
_domain: BigNumberish,
_access: boolean,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
unenrollReplica(
_domain: BigNumberish,
_updater: BytesLike,
_signature: BytesLike,
_replica: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
watcherPermission(
_watcher: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<[boolean]>;
};
domainToReplica(
@ -250,6 +203,12 @@ export class XAppConnectionManager extends BaseContract {
overrides?: CallOverrides
): Promise<string>;
enrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
home(overrides?: CallOverrides): Promise<string>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<boolean>;
@ -258,17 +217,6 @@ export class XAppConnectionManager extends BaseContract {
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>;
@ -280,37 +228,28 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
setWatcherPermission(
_watcher: string,
_domain: BigNumberish,
_access: boolean,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
unenrollReplica(
_domain: BigNumberish,
_updater: BytesLike,
_signature: BytesLike,
_replica: string,
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>;
enrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<void>;
home(overrides?: CallOverrides): Promise<string>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<boolean>;
@ -319,50 +258,23 @@ export class XAppConnectionManager extends BaseContract {
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>;
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>;
unenrollReplica(_replica: string, overrides?: CallOverrides): Promise<void>;
};
filters: {
NewHome(home?: string | null): TypedEventFilter<[string], { home: string }>;
OwnershipTransferred(
previousOwner?: string | null,
newOwner?: string | null
@ -380,15 +292,6 @@ export class XAppConnectionManager extends BaseContract {
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: {
@ -397,6 +300,12 @@ export class XAppConnectionManager extends BaseContract {
overrides?: CallOverrides
): Promise<BigNumber>;
enrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
home(overrides?: CallOverrides): Promise<BigNumber>;
isReplica(_replica: string, overrides?: CallOverrides): Promise<BigNumber>;
@ -405,17 +314,6 @@ export class XAppConnectionManager extends BaseContract {
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>;
@ -430,30 +328,15 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
setWatcherPermission(
_watcher: string,
_domain: BigNumberish,
_access: boolean,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
unenrollReplica(
_domain: BigNumberish,
_updater: BytesLike,
_signature: BytesLike,
_replica: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
watcherPermission(
_watcher: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<BigNumber>;
};
populateTransaction: {
@ -462,6 +345,12 @@ export class XAppConnectionManager extends BaseContract {
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
enrollReplica(
_replica: string,
_domain: BigNumberish,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
home(overrides?: CallOverrides): Promise<PopulatedTransaction>;
isReplica(
@ -473,17 +362,6 @@ export class XAppConnectionManager extends BaseContract {
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>;
@ -498,29 +376,14 @@ export class XAppConnectionManager extends BaseContract {
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
setWatcherPermission(
_watcher: string,
_domain: BigNumberish,
_access: boolean,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
transferOwnership(
newOwner: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
unenrollReplica(
_domain: BigNumberish,
_updater: BytesLike,
_signature: BytesLike,
_replica: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
watcherPermission(
_watcher: string,
_domain: BigNumberish,
overrides?: CallOverrides
): Promise<PopulatedTransaction>;
};
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -11,31 +11,19 @@ const _abi = [
anonymous: false,
inputs: [
{
indexed: false,
indexed: true,
internalType: "bytes32",
name: "oldRoot",
name: "root",
type: "bytes32",
},
{
indexed: false,
internalType: "bytes32[2]",
name: "newRoot",
type: "bytes32[2]",
},
{
indexed: false,
internalType: "bytes",
name: "signature",
type: "bytes",
},
{
indexed: false,
internalType: "bytes",
name: "signature2",
type: "bytes",
indexed: true,
internalType: "uint256",
name: "index",
type: "uint256",
},
],
name: "DoubleUpdate",
name: "Checkpoint",
type: "event",
},
{
@ -44,11 +32,11 @@ const _abi = [
{
indexed: false,
internalType: "address",
name: "updater",
name: "validatorManager",
type: "address",
},
],
name: "NewUpdater",
name: "NewValidatorManager",
type: "event",
},
{
@ -56,35 +44,23 @@ const _abi = [
inputs: [
{
indexed: true,
internalType: "uint32",
name: "homeDomain",
type: "uint32",
},
{
indexed: true,
internalType: "bytes32",
name: "oldRoot",
type: "bytes32",
internalType: "address",
name: "previousOwner",
type: "address",
},
{
indexed: true,
internalType: "bytes32",
name: "newRoot",
type: "bytes32",
},
{
indexed: false,
internalType: "bytes",
name: "signature",
type: "bytes",
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "Update",
name: "OwnershipTransferred",
type: "event",
},
{
inputs: [],
name: "committedRoot",
name: "checkpointedRoot",
outputs: [
{
internalType: "bytes32",
@ -99,39 +75,35 @@ const _abi = [
inputs: [
{
internalType: "bytes32",
name: "_oldRoot",
name: "",
type: "bytes32",
},
],
name: "checkpoints",
outputs: [
{
internalType: "bytes32[2]",
name: "_newRoot",
type: "bytes32[2]",
},
{
internalType: "bytes",
name: "_signature",
type: "bytes",
},
{
internalType: "bytes",
name: "_signature2",
type: "bytes",
internalType: "uint256",
name: "",
type: "uint256",
},
],
name: "doubleUpdate",
outputs: [],
stateMutability: "nonpayable",
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "homeDomainHash",
name: "latestCheckpoint",
outputs: [
{
internalType: "bytes32",
name: "",
name: "root",
type: "bytes32",
},
{
internalType: "uint256",
name: "index",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
@ -151,12 +123,12 @@ const _abi = [
},
{
inputs: [],
name: "state",
name: "owner",
outputs: [
{
internalType: "enum Common.States",
internalType: "address",
name: "",
type: "uint8",
type: "address",
},
],
stateMutability: "view",
@ -164,10 +136,43 @@ const _abi = [
},
{
inputs: [],
name: "updater",
outputs: [
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_validatorManager",
type: "address",
},
],
name: "setValidatorManager",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "validatorManager",
outputs: [
{
internalType: "contract IValidatorManager",
name: "",
type: "address",
},

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

File diff suppressed because one or more lines are too long

@ -0,0 +1,60 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from "ethers";
import { Provider } from "@ethersproject/providers";
import type {
IValidatorManager,
IValidatorManagerInterface,
} from "../IValidatorManager";
const _abi = [
{
inputs: [
{
internalType: "uint32",
name: "_domain",
type: "uint32",
},
{
internalType: "bytes32",
name: "_root",
type: "bytes32",
},
{
internalType: "uint256",
name: "_index",
type: "uint256",
},
{
internalType: "bytes",
name: "_signature",
type: "bytes",
},
],
name: "isValidatorSignature",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
];
export class IValidatorManager__factory {
static readonly abi = _abi;
static createInterface(): IValidatorManagerInterface {
return new utils.Interface(_abi) as IValidatorManagerInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): IValidatorManager {
return new Contract(address, _abi, signerOrProvider) as IValidatorManager;
}
}

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

@ -24,10 +24,6 @@ declare module "hardhat/types/runtime" {
name: "MerkleTreeManager",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.MerkleTreeManager__factory>;
getContractFactory(
name: "QueueManager",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.QueueManager__factory>;
getContractFactory(
name: "Replica",
signerOrOptions?: ethers.Signer | FactoryOptions
@ -49,9 +45,9 @@ declare module "hardhat/types/runtime" {
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.IMessageRecipient__factory>;
getContractFactory(
name: "IUpdaterManager",
name: "IValidatorManager",
signerOrOptions?: ethers.Signer | FactoryOptions
): Promise<Contracts.IUpdaterManager__factory>;
): Promise<Contracts.IValidatorManager__factory>;
getContractFactory(
name: "OwnableUpgradeable",
signerOrOptions?: ethers.Signer | FactoryOptions

@ -4,13 +4,12 @@
export type { Common } from "./Common";
export type { Home } from "./Home";
export type { MerkleTreeManager } from "./MerkleTreeManager";
export type { QueueManager } from "./QueueManager";
export type { Replica } from "./Replica";
export type { UpgradeBeaconProxy } from "./UpgradeBeaconProxy";
export type { Version0 } from "./Version0";
export type { XAppConnectionManager } from "./XAppConnectionManager";
export type { IMessageRecipient } from "./IMessageRecipient";
export type { IUpdaterManager } from "./IUpdaterManager";
export type { IValidatorManager } from "./IValidatorManager";
export type { OwnableUpgradeable } from "./OwnableUpgradeable";
export type { Ownable } from "./Ownable";
export type { IERC20 } from "./IERC20";
@ -33,13 +32,12 @@ export type { IWeth } from "./IWeth";
export { Common__factory } from "./factories/Common__factory";
export { Home__factory } from "./factories/Home__factory";
export { MerkleTreeManager__factory } from "./factories/MerkleTreeManager__factory";
export { QueueManager__factory } from "./factories/QueueManager__factory";
export { Replica__factory } from "./factories/Replica__factory";
export { UpgradeBeaconProxy__factory } from "./factories/UpgradeBeaconProxy__factory";
export { Version0__factory } from "./factories/Version0__factory";
export { XAppConnectionManager__factory } from "./factories/XAppConnectionManager__factory";
export { IMessageRecipient__factory } from "./factories/IMessageRecipient__factory";
export { IUpdaterManager__factory } from "./factories/IUpdaterManager__factory";
export { IValidatorManager__factory } from "./factories/IValidatorManager__factory";
export { OwnableUpgradeable__factory } from "./factories/OwnableUpgradeable__factory";
export { Ownable__factory } from "./factories/Ownable__factory";
export { IERC20__factory } from "./factories/IERC20__factory";

@ -3,49 +3,40 @@ import { DeployEnvironment } from '../../../src/deploy';
export const core: CoreConfig = {
environment: DeployEnvironment.dev,
optimisticSeconds: 10,
recoveryTimelock: 180,
processGas: 850_000,
reserveGas: 15_000,
addresses: {
alfajores: {
updater: '0x91631845fab02614e53e5F5A68dFBB0E2f1a9B6d',
watchers: ['0x3019Bf39Df97942F2C53EFc6e831b82D158593CF'],
validator: '0x91631845fab02614e53e5F5A68dFBB0E2f1a9B6d',
recoveryManager: '0x4FbBB2b0820CF0cF027BbB58DC7F7f760BC0c57e',
},
fuji: {
updater: '0x91631845fab02614e53e5F5A68dFBB0E2f1a9B6d',
watchers: ['0x3019Bf39Df97942F2C53EFc6e831b82D158593CF'],
validator: '0x91631845fab02614e53e5F5A68dFBB0E2f1a9B6d',
recoveryManager: '0x4FbBB2b0820CF0cF027BbB58DC7F7f760BC0c57e',
},
gorli: {
updater: '0x91631845fab02614e53e5F5A68dFBB0E2f1a9B6d',
watchers: ['0x3019Bf39Df97942F2C53EFc6e831b82D158593CF'],
validator: '0x91631845fab02614e53e5F5A68dFBB0E2f1a9B6d',
recoveryManager: '0x4FbBB2b0820CF0cF027BbB58DC7F7f760BC0c57e',
},
kovan: {
updater: '0x2eA2B6cbc3fC269Bf91C2fCfcc460489378f1251',
watchers: ['0x3019Bf39Df97942F2C53EFc6e831b82D158593CF'],
validator: '0x2eA2B6cbc3fC269Bf91C2fCfcc460489378f1251',
recoveryManager: '0x4FbBB2b0820CF0cF027BbB58DC7F7f760BC0c57e',
},
mumbai: {
updater: '0x91631845fab02614e53e5F5A68dFBB0E2f1a9B6d',
watchers: ['0x3019Bf39Df97942F2C53EFc6e831b82D158593CF'],
validator: '0x91631845fab02614e53e5F5A68dFBB0E2f1a9B6d',
recoveryManager: '0x4FbBB2b0820CF0cF027BbB58DC7F7f760BC0c57e',
},
rinkarby: {
updater: '0x4177372FD9581ceb2367e0Ce84adC5DAD9DF8D55',
watchers: ['0x20aC2FD664bA5406A7262967C34107e708dCb18E'],
validator: '0x4177372FD9581ceb2367e0Ce84adC5DAD9DF8D55',
recoveryManager: '0x24F6c874F56533d9a1422e85e5C7A806ED11c036',
},
rinkeby: {
updater: '0x4177372FD9581ceb2367e0Ce84adC5DAD9DF8D55',
watchers: ['0x20aC2FD664bA5406A7262967C34107e708dCb18E'],
validator: '0x4177372FD9581ceb2367e0Ce84adC5DAD9DF8D55',
recoveryManager: '0x24F6c874F56533d9a1422e85e5C7A806ED11c036',
},
ropsten: {
updater: '0x4177372FD9581ceb2367e0Ce84adC5DAD9DF8D55',
watchers: ['0x20aC2FD664bA5406A7262967C34107e708dCb18E'],
validator: '0x4177372FD9581ceb2367e0Ce84adC5DAD9DF8D55',
recoveryManager: '0x24F6c874F56533d9a1422e85e5C7A806ED11c036',
},
},

@ -4,29 +4,24 @@ import { DeployEnvironment } from '../../../src/deploy';
export const core: CoreConfig = {
environment: DeployEnvironment.mainnet,
recoveryTimelock: 60 * 60 * 24 * 14, // 14 days
optimisticSeconds: 60 * 30, // 30 minutes
processGas: 850_000,
reserveGas: 15_000,
addresses: {
avalanche: {
updater: '0x6e29236E86a039F8225834F7E7cd4122dc166e51',
watchers: ['0x74C1580f920E4d694502Ca95838d6382caecb1dE'],
validator: '0x6e29236E86a039F8225834F7E7cd4122dc166e51',
recoveryManager: '0x8a11d528d12ea09ccbf86e21B7813812b53a6900',
},
celo: {
recoveryManager: '0x070c2843402Aa0637ae0F2E2edf601aAB5E72509',
updater: '0x703643995262c92ab013E3CCA810BdcB9239d45a',
watchers: ['0x97D510A1F9464d220E2716Cc52Cb03851D6d595c'],
validator: '0x703643995262c92ab013E3CCA810BdcB9239d45a',
governor: '0x070c2843402Aa0637ae0F2E2edf601aAB5E72509',
},
ethereum: {
updater: '0x5Ef6e0F6A7E1f866612D806041799a9D762b62c0',
validator: '0x5Ef6e0F6A7E1f866612D806041799a9D762b62c0',
recoveryManager: '0x2bb2a5a724170357cb691841f40d26a950d8c33d',
watchers: ['0xD0D09d9CF712ccE87141Dfa22a3aBBDb7B1c296e'],
},
polygon: {
updater: '0x65Fb23bDaD54574713AD756EFE16ce2eEb1F5855',
watchers: ['0x68015B84182c71F9c2EE6C8061405D6F1f56314B'],
validator: '0x65Fb23bDaD54574713AD756EFE16ce2eEb1F5855',
recoveryManager: '0x8A1405C70c8a45177b5ac71b1d22779272E5d48b',
},
},

@ -3,29 +3,24 @@ import { DeployEnvironment } from '../../../src/deploy';
export const core: CoreConfig = {
environment: DeployEnvironment.testnetLegacy,
optimisticSeconds: 10,
recoveryTimelock: 180,
processGas: 850_000,
reserveGas: 15_000,
addresses: {
alfajores: {
updater: '0x201dd86063Dc251cA5a576d1b7365C38e5fB4CD5',
watchers: ['0x22B2855635154Baa41C306BcA979C8c9a077A180'],
validator: '0x201dd86063Dc251cA5a576d1b7365C38e5fB4CD5',
recoveryManager: '0x24F6c874F56533d9a1422e85e5C7A806ED11c036',
},
kovan: {
updater: '0x201dd86063Dc251cA5a576d1b7365C38e5fB4CD5',
watchers: ['0x22B2855635154Baa41C306BcA979C8c9a077A180'],
validator: '0x201dd86063Dc251cA5a576d1b7365C38e5fB4CD5',
recoveryManager: '0x24F6c874F56533d9a1422e85e5C7A806ED11c036',
},
rinkarby: {
updater: '0x201dd86063Dc251cA5a576d1b7365C38e5fB4CD5',
watchers: ['0x22B2855635154Baa41C306BcA979C8c9a077A180'],
validator: '0x201dd86063Dc251cA5a576d1b7365C38e5fB4CD5',
recoveryManager: '0x24F6c874F56533d9a1422e85e5C7A806ED11c036',
},
rinkeby: {
updater: '0x201dd86063Dc251cA5a576d1b7365C38e5fB4CD5',
watchers: ['0x22B2855635154Baa41C306BcA979C8c9a077A180'],
validator: '0x201dd86063Dc251cA5a576d1b7365C38e5fB4CD5',
recoveryManager: '0x24F6c874F56533d9a1422e85e5C7A806ED11c036',
},
},

@ -3,29 +3,24 @@ import { DeployEnvironment } from '../../../src/deploy';
export const core: CoreConfig = {
environment: DeployEnvironment.testnet,
optimisticSeconds: 10,
recoveryTimelock: 180,
processGas: 850_000,
reserveGas: 15_000,
addresses: {
alfajores: {
updater: '0xf0B3C01E16cE288f7Cd7112B4b2F5A859Ba72307',
watchers: ['0xC3Ef93917f0d0AC4D70E675824270b290E0a2667'],
validator: '0xf0B3C01E16cE288f7Cd7112B4b2F5A859Ba72307',
recoveryManager: '0x075fE802D26a983423caE0a16b8250F155AbeB03',
},
gorli: {
updater: '0xDd89dCA09Ef81154dAf919b4d7C33f9d8DCf6c7C',
watchers: ['0x0b2bABd063CDc3e663489e32Bf9F74ACA1C6286f'],
validator: '0xDd89dCA09Ef81154dAf919b4d7C33f9d8DCf6c7C',
recoveryManager: '0xDd89dCA09Ef81154dAf919b4d7C33f9d8DCf6c7C',
},
kovan: {
updater: '0xED576b49c3bD42862340e21a7A0AcCA3814bfE18',
watchers: ['0x5830e4a749e0eAEF5955069f12B37Fd82C234c23'],
validator: '0xED576b49c3bD42862340e21a7A0AcCA3814bfE18',
recoveryManager: '0xED576b49c3bD42862340e21a7A0AcCA3814bfE18',
},
ropsten: {
updater: '0x6f37CaE0b16589FA55152732f2E04f6F0F7dcE97',
watchers: ['0x405a8C080Ca64e038554a2B03eA1bdA96DAFA52C'],
validator: '0x6f37CaE0b16589FA55152732f2E04f6F0F7dcE97',
recoveryManager: '0x6f37CaE0b16589FA55152732f2E04f6F0F7dcE97',
},
},

@ -25,7 +25,7 @@ export async function getChain(
maxFeePerGas: '50000000000', // 50 nAVAX (50 gwei)
maxPriorityFeePerGas: '10000000000', // 10 nAVAX (10 gwei)
weth: '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7', // Actually WAVAX but ok
updaterInterval: 300,
validatorInterval: 300,
};
return new ChainConfig(chainJson);
}

@ -18,8 +18,8 @@ export async function getChain(
rpc: await getSecretRpcEndpoint(environment, name),
deployerKey: await getSecretDeployerKey(deployerKeySecretName),
domain: 0x63656c6f, // b'celo' interpreted as an int
updaterInterval: 300,
updaterPause: 15,
validatorInterval: 300,
validatorPause: 15,
};
return new ChainConfig(chainJson);
}

@ -24,7 +24,7 @@ export async function getChain(
maxFeePerGas: '300000000000', // 300 gwei
maxPriorityFeePerGas: '4000000000', // 4 gwei
weth: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
updaterInterval: 300,
validatorInterval: 300,
};
return new ChainConfig(chainJson);
}

@ -20,7 +20,7 @@ export async function getChain(
domain: 0x706f6c79, // b'poly' interpreted as an int
gasPrice: '5000000000', // 50 gwei
weth: '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', // Actually WMATIC but ok
updaterInterval: 300,
validatorInterval: 300,
};
return new ChainConfig(chainJson);
}

@ -20,10 +20,7 @@ async function main() {
const deploys = await getCoreDeploys(environment);
const checker = new CoreInvariantChecker(deploys);
await checker.checkDeploys();
checker.expectViolations(
[ViolationType.ReplicaUpdater, ViolationType.HomeUpdater],
[chains.length - 1, 1],
);
checker.expectViolations([ViolationType.Validator], [chains.length]);
const builder = new GovernanceCallBatchBuilder(
deploys,

@ -8,8 +8,8 @@ import { fetchAgentGCPKeys } from './agents/gcp';
import { AgentAwsKey } from './agents/aws';
export enum KEY_ROLE_ENUM {
UpdaterAttestation = 'updater-attestation',
UpdaterSigner = 'updater-signer',
UpdaterAttestation = 'validator-attestation',
UpdaterSigner = 'validator-signer',
ProcessorSigner = 'processor-signer',
RelayerSigner = 'relayer-signer',
WatcherAttestation = 'watcher-attestation',
@ -18,8 +18,8 @@ export enum KEY_ROLE_ENUM {
Bank = 'bank',
}
export const KEY_ROLES = [
'updater-attestation',
'updater-signer',
'validator-attestation',
'validator-signer',
'processor-signer',
'relayer-signer',
'watcher-attestation',
@ -63,7 +63,7 @@ async function helmValuesForChain(
name: remoteChain.name,
};
}),
updater: {
validator: {
enabled: true,
transactionSigners: chains.map((chain) => ({
name: chain.name,
@ -72,10 +72,12 @@ async function helmValuesForChain(
attestationSigner: {
...credentials(KEY_ROLE_ENUM.UpdaterAttestation),
},
...include(!!chain.updaterInterval, {
pollingInterval: chain.updaterInterval,
...include(!!chain.validatorInterval, {
pollingInterval: chain.validatorInterval,
}),
...include(!!chain.validatorPause, {
updatePause: chain.validatorPause,
}),
...include(!!chain.updaterPause, { updatePause: chain.updaterPause }),
},
relayer: {
enabled: true,
@ -142,7 +144,7 @@ export async function getAgentEnvVars(
});
// Updater attestation key
if (role.startsWith('updater')) {
if (role.startsWith('validator')) {
envVars.push(
`OPT_BASE_UPDATER_KEY=${strip0x(
gcpKeys[homeChainName + '-' + KEY_ROLE_ENUM.UpdaterAttestation]
@ -174,7 +176,7 @@ export async function getAgentEnvVars(
});
// Updater attestation key
if (role.startsWith('updater')) {
if (role.startsWith('validator')) {
const key = new AgentAwsKey(agentConfig, role, homeChainName);
envVars.push(`OPT_BASE_UPDATER_TYPE=aws`);
envVars.push(

@ -6,9 +6,8 @@ import { ProxyNames, BeaconProxy } from './utils/proxy';
export enum ViolationType {
UpgradeBeacon = 'UpgradeBeacon',
VerificationInput = 'VerificationInput',
UpdaterManager = 'UpdaterManager',
HomeUpdater = 'HomeUpdater',
ReplicaUpdater = 'ReplicaUpdater',
ValidatorManager = 'ValidatorManager',
Validator = 'Validator',
}
export interface UpgradeBeaconViolation {
@ -27,24 +26,17 @@ interface VerificationInputViolation {
address: string;
}
export interface UpdaterManagerViolation {
export interface ValidatorManagerViolation {
domain: number;
type: ViolationType.UpdaterManager;
type: ViolationType.ValidatorManager;
expected: string;
actual: string;
}
export interface HomeUpdaterViolation {
domain: number;
type: ViolationType.HomeUpdater;
expected: string;
actual: string;
}
export interface ReplicaUpdaterViolation {
domain: number;
remoteDomain: number;
type: ViolationType.ReplicaUpdater;
export interface ValidatorViolation {
local: number;
remote: number;
type: ViolationType.Validator;
expected: string;
actual: string;
}
@ -52,9 +44,8 @@ export interface ReplicaUpdaterViolation {
export type Violation =
| UpgradeBeaconViolation
| VerificationInputViolation
| HomeUpdaterViolation
| ReplicaUpdaterViolation
| UpdaterManagerViolation;
| ValidatorViolation
| ValidatorManagerViolation;
export type VerificationInput = [string, Contract];

@ -9,7 +9,7 @@ export type ProxiedAddress = {
export type CoreContractAddresses = {
upgradeBeaconController: Address;
xAppConnectionManager: Address;
updaterManager: Address;
validatorManager: Address;
governanceRouter: ProxiedAddress;
home: ProxiedAddress;
// TODO: Put chain name in here
@ -23,8 +23,7 @@ export type BridgeContractAddresses = {
};
export type CoreConfigAddresses = {
updater: Address;
watchers: Address[];
validator: Address;
recoveryManager: Address;
governor?: Address;
};

@ -38,10 +38,10 @@ export type ChainConfigJson = DomainedChain & {
maxFeePerGas?: ethers.BigNumberish;
maxPriorityFeePerGas?: ethers.BigNumberish;
weth?: Address;
// How often an updater should check for new updates
updaterInterval?: number;
// How long an updater should wait for relevant state changes afterwords
updaterPause?: number;
// How often an validator should check for new updates
validatorInterval?: number;
// How long an validator should wait for relevant state changes afterwords
validatorPause?: number;
};
export class ChainConfig {
@ -56,10 +56,10 @@ export class ChainConfig {
maxFeePerGas?: ethers.BigNumber;
maxPriorityFeePerGas?: ethers.BigNumber;
weth?: Address;
// How often an updater should check for new updates
updaterInterval?: number;
// How long an updater should wait for relevant state changes afterwords
updaterPause?: number;
// How often an validator should check for new updates
validatorInterval?: number;
// How long an validator should wait for relevant state changes afterwords
validatorPause?: number;
constructor(json: ChainConfigJson) {
this.name = json.name;
@ -79,8 +79,8 @@ export class ChainConfig {
? ethers.BigNumber.from(json.maxPriorityFeePerGas)
: undefined;
this.weth = json.weth;
this.updaterInterval = json.updaterInterval;
this.updaterPause = json.updaterPause;
this.validatorInterval = json.validatorInterval;
this.validatorPause = json.validatorPause;
}
replaceSigner(privateKey: string) {

@ -6,7 +6,6 @@ import { DeployEnvironment } from '../deploy';
export interface CoreConfig {
environment: DeployEnvironment;
recoveryTimelock: number;
optimisticSeconds: number;
processGas: BigNumberish;
reserveGas: BigNumberish;
addresses: Partial<Record<ChainName, CoreConfigAddresses>>;

@ -10,7 +10,7 @@ import * as ethers from 'ethers';
export class CoreContracts extends Contracts {
upgradeBeaconController?: contracts.UpgradeBeaconController;
xAppConnectionManager?: contracts.XAppConnectionManager;
updaterManager?: contracts.UpdaterManager;
validatorManager?: contracts.ValidatorManager;
governanceRouter?: BeaconProxy<contracts.GovernanceRouter>;
home?: BeaconProxy<contracts.Home>;
replicas: Record<number, BeaconProxy<contracts.Replica>>;
@ -31,7 +31,7 @@ export class CoreContracts extends Contracts {
return {
upgradeBeaconController: this.upgradeBeaconController!.address,
xAppConnectionManager: this.xAppConnectionManager!.address,
updaterManager: this.updaterManager!.address,
validatorManager: this.validatorManager!.address,
governanceRouter: this.governanceRouter!.toObject(),
home: this.home!.toObject(),
replicas,
@ -53,8 +53,8 @@ export class CoreContracts extends Contracts {
addresses.xAppConnectionManager,
provider,
);
core.updaterManager = contracts.UpdaterManager__factory.connect(
addresses.updaterManager,
core.validatorManager = contracts.ValidatorManager__factory.connect(
addresses.validatorManager,
provider,
);

@ -26,9 +26,8 @@ export class CoreDeploy extends Deploy<CoreContracts> {
return {
...this.contracts.toObject(),
recoveryManager: this.recoveryManager,
updater: this.updater,
validator: this.validator,
governor: this.governor,
watchers: this.watchers,
};
}
@ -40,18 +39,14 @@ export class CoreDeploy extends Deploy<CoreContracts> {
return this.contracts.upgradeBeaconController?.address;
}
get updater(): Address {
return this.coreConfigAddresses.updater;
get validator(): Address {
return this.coreConfigAddresses.validator;
}
get recoveryManager(): Address {
return this.coreConfigAddresses.recoveryManager;
}
get watchers(): Address[] {
return this.coreConfigAddresses.watchers;
}
get governor(): Address | undefined {
return this.coreConfigAddresses.governor;
}

@ -5,9 +5,8 @@ import { CoreDeploy } from './CoreDeploy';
import {
VerificationInput,
ViolationType,
HomeUpdaterViolation,
ReplicaUpdaterViolation,
UpdaterManagerViolation,
ValidatorViolation,
ValidatorManagerViolation,
InvariantChecker,
} from '../checks';
@ -25,6 +24,7 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
await this.checkReplicas(deploy);
await this.checkGovernance(deploy);
await this.checkXAppConnectionManager(deploy);
await this.checkValidatorManager(deploy);
this.checkVerificationInputs(deploy);
}
@ -34,7 +34,7 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
expect(contracts.governanceRouter).to.not.be.undefined;
expect(contracts.upgradeBeaconController).to.not.be.undefined;
expect(contracts.xAppConnectionManager).to.not.be.undefined;
expect(contracts.updaterManager).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;
}
@ -43,60 +43,48 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
async checkHome(deploy: CoreDeploy): Promise<void> {
// contracts are defined
const home = deploy.contracts.home!.proxy;
// updaterManager is set on Home
const actualManager = await home.updaterManager();
const expectedManager = deploy.contracts.updaterManager!.address;
// validatorManager is set on Home
const actualManager = await home.validatorManager();
const expectedManager = deploy.contracts.validatorManager!.address;
if (actualManager !== expectedManager) {
const violation: UpdaterManagerViolation = {
const violation: ValidatorManagerViolation = {
domain: deploy.chain.domain,
type: ViolationType.UpdaterManager,
type: ViolationType.ValidatorManager,
actual: actualManager,
expected: expectedManager,
};
this.addViolation(violation);
}
const actual = await home?.updater()!;
expect(actual).to.not.be.undefined;
const expected = deploy.updater;
if (actual !== expected) {
const violation: HomeUpdaterViolation = {
domain: deploy.chain.domain,
type: ViolationType.HomeUpdater,
actual,
expected,
};
this.addViolation(violation);
}
}
async checkReplicas(deploy: CoreDeploy): Promise<void> {
// Check if the Replicas on *remote* domains are set to the updater
// configured on our domain.
const domain = deploy.chain.domain;
const addReplicaUpdaterViolations = async (remoteDeploy: CoreDeploy) => {
const replica = remoteDeploy.contracts.replicas[domain];
// Sanity check correct replica.
const actualRemoteDomain = await replica.proxy.remoteDomain();
expect(actualRemoteDomain).to.be.equal(domain);
const actual = await replica.proxy.updater();
const expected = deploy.updater;
async checkValidatorManager(deploy: CoreDeploy): Promise<void> {
const manager = deploy.contracts.validatorManager!;
for (const _deploy of this._deploys) {
const expected = _deploy.validator;
const actual = await manager.validators(_deploy.chain.domain)!;
expect(actual).to.not.be.undefined;
if (actual !== expected) {
const violation: ReplicaUpdaterViolation = {
domain: remoteDeploy.chain.domain,
remoteDomain: domain,
type: ViolationType.ReplicaUpdater,
const violation: ValidatorViolation = {
local: deploy.chain.domain,
remote: _deploy.chain.domain,
type: ViolationType.Validator,
actual,
expected,
};
this.addViolation(violation);
}
};
}
}
async checkReplicas(deploy: CoreDeploy): Promise<void> {
// Check if the Replicas 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) {
await Promise.all(remoteDeploys.map(addReplicaUpdaterViolations));
// Check that all replicas on this domain share the same implementation and
// UpgradeBeacon.
const replicas = Object.values(deploy.contracts.replicas);
@ -132,7 +120,7 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
}
const owners = [
deploy.contracts.updaterManager?.owner()!,
deploy.contracts.validatorManager?.owner()!,
deploy.contracts.xAppConnectionManager?.owner()!,
deploy.contracts.upgradeBeaconController?.owner()!,
deploy.contracts.home?.proxy.owner()!,
@ -153,17 +141,6 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
const enrolledReplica =
await deploy.contracts.xAppConnectionManager?.domainToReplica(domain);
expect(enrolledReplica).to.not.equal(emptyAddr);
//watchers have permission in xAppConnectionManager
await Promise.all(
deploy.watchers.map(async (watcher) => {
const watcherPermissions =
await deploy.contracts.xAppConnectionManager?.watcherPermission(
watcher,
domain,
);
expect(watcherPermissions).to.be.true;
}),
);
}
// Home is set on xAppConnectionManager
const xAppManagerHome =
@ -180,7 +157,7 @@ export class CoreInvariantChecker extends InvariantChecker<CoreDeploy> {
contracts.upgradeBeaconController!,
]);
inputs.push(['XAppConnectionManager', contracts.xAppConnectionManager!]);
inputs.push(['UpdaterManager', contracts.updaterManager!]);
inputs.push(['ValidatorManager', contracts.validatorManager!]);
const addInputsForUpgradableContract = (
contract: BeaconProxy<any>,
name: string,

@ -2,8 +2,7 @@ import { expect } from 'chai';
import { AbacusContext } from '@abacus-network/sdk';
import { CoreDeploy } from './CoreDeploy';
import {
HomeUpdaterViolation,
ReplicaUpdaterViolation,
ValidatorViolation,
UpgradeBeaconViolation,
Violation,
ViolationType,
@ -44,10 +43,8 @@ export class GovernanceCallBatchBuilder {
switch (v.type) {
case ViolationType.UpgradeBeacon:
return this.handleUpgradeBeaconViolation(v);
case ViolationType.HomeUpdater:
return this.handleHomeUpdaterViolation(v);
case ViolationType.ReplicaUpdater:
return this.handleReplicaUpdaterViolation(v);
case ViolationType.Validator:
return this.handleValidatorViolation(v);
default:
throw new Error(`No handler for violation type ${v.type}`);
break;
@ -69,28 +66,15 @@ export class GovernanceCallBatchBuilder {
return { domain, call: tx as Call };
}
async handleHomeUpdaterViolation(
violation: HomeUpdaterViolation,
async handleValidatorViolation(
violation: ValidatorViolation,
): Promise<DomainedCall> {
const domain = violation.domain;
const domain = violation.local;
const deploy = this.getDeploy(domain);
const manager = deploy.contracts.updaterManager;
const manager = deploy.contracts.validatorManager;
expect(manager).to.not.be.undefined;
const tx = await manager!.populateTransaction.setUpdater(
violation.expected,
);
if (tx.to === undefined) throw new Error('undefined tx.to');
return { domain, call: tx as Call };
}
async handleReplicaUpdaterViolation(
violation: ReplicaUpdaterViolation,
): Promise<DomainedCall> {
const domain = violation.domain;
const deploy = this.getDeploy(domain);
const replica = deploy.contracts.replicas[violation.remoteDomain];
expect(replica).to.not.be.undefined;
const tx = await replica!.proxy.populateTransaction.setUpdater(
const tx = await manager!.populateTransaction.setValidator(
violation.remote,
violation.expected,
);
if (tx.to === undefined) throw new Error('undefined tx.to');

@ -1,4 +1,3 @@
import * as ethers from 'ethers';
import { assert } from 'console';
import fs from 'fs';
@ -8,6 +7,7 @@ import * as contracts from '@abacus-network/ts-interface/dist/abacus-core';
import { CoreInvariantChecker } from './checks';
import { log, warn, toBytes32 } from '../utils/utils';
const nullRoot: string = '0x' + '00'.repeat(32);
export async function deployUpgradeBeaconController(deploy: CoreDeploy) {
let factory = new contracts.UpgradeBeaconController__factory(deploy.signer);
deploy.contracts.upgradeBeaconController = await factory.deploy(
@ -27,26 +27,23 @@ export async function deployUpgradeBeaconController(deploy: CoreDeploy) {
}
/**
* Deploys the UpdaterManager on the chain of the given deploy and updates
* Deploys the ValidatorManager on the chain of the given deploy and updates
* the deploy instance with the new contract.
*
* @param deploy - The deploy instance
*/
export async function deployUpdaterManager(deploy: CoreDeploy) {
let factory = new contracts.UpdaterManager__factory(deploy.signer);
deploy.contracts.updaterManager = await factory.deploy(
deploy.updater,
deploy.overrides,
);
await deploy.contracts.updaterManager.deployTransaction.wait(
export async function deployValidatorManager(deploy: CoreDeploy) {
let factory = new contracts.ValidatorManager__factory(deploy.signer);
deploy.contracts.validatorManager = await factory.deploy(deploy.overrides);
await deploy.contracts.validatorManager.deployTransaction.wait(
deploy.chain.confirmations,
);
// add contract information to Etherscan verification array
deploy.verificationInput.push({
name: 'UpdaterManager',
address: deploy.contracts.updaterManager!.address,
constructorArguments: [deploy.updater],
name: 'ValidatorManager',
address: deploy.contracts.validatorManager!.address,
constructorArguments: [deploy.validator],
});
}
@ -57,13 +54,8 @@ export async function deployUpdaterManager(deploy: CoreDeploy) {
* @param deploy - The deploy instance
*/
export async function deployXAppConnectionManager(deploy: CoreDeploy) {
const isTestDeploy: boolean = deploy.test;
if (isTestDeploy) warn('deploying test XAppConnectionManager');
const signer = deploy.signer;
const factory = isTestDeploy
? new contracts.TestXAppConnectionManager__factory(signer)
: new contracts.XAppConnectionManager__factory(signer);
const factory = new contracts.XAppConnectionManager__factory(signer);
deploy.contracts.xAppConnectionManager = await factory.deploy(
deploy.overrides,
@ -93,10 +85,10 @@ export async function deployHome(deploy: CoreDeploy) {
? contracts.TestHome__factory
: contracts.Home__factory;
let { updaterManager } = deploy.contracts;
let { validatorManager } = deploy.contracts;
let initData = homeFactory
.createInterface()
.encodeFunctionData('initialize', [updaterManager!.address]);
.encodeFunctionData('initialize', [validatorManager!.address]);
deploy.contracts.home = await proxyUtils.deployProxy<contracts.Home>(
'Home',
@ -159,12 +151,14 @@ export async function deployUnenrolledReplica(
? contracts.TestReplica__factory
: contracts.Replica__factory;
let initData = replica.createInterface().encodeFunctionData('initialize', [
remote.chain.domain,
remote.updater,
ethers.constants.HashZero, // TODO: allow configuration
remote.config.optimisticSeconds,
]);
let initData = replica
.createInterface()
.encodeFunctionData('initialize', [
remote.chain.domain,
local.contracts.validatorManager!.address,
nullRoot,
0,
]);
// if we have no replicas, deploy the whole setup.
// otherwise just deploy a fresh proxy
@ -220,9 +214,9 @@ export async function deployAbacus(deploy: CoreDeploy) {
log(
isTestDeploy,
`${deploy.chain.name}: awaiting deploy UpdaterManager(deploy);`,
`${deploy.chain.name}: awaiting deploy ValidatorManager(deploy);`,
);
await deployUpdaterManager(deploy);
await deployValidatorManager(deploy);
log(
isTestDeploy,
@ -244,10 +238,11 @@ export async function deployAbacus(deploy: CoreDeploy) {
log(
isTestDeploy,
`${deploy.chain.name}: awaiting updaterManager.setHome(...);`,
`${deploy.chain.name}: awaiting validatorManager.setValidator(...);`,
);
await deploy.contracts.updaterManager!.setHome(
deploy.contracts.home!.proxy.address,
await deploy.contracts.validatorManager!.setValidator(
deploy.chain.domain,
deploy.validator,
deploy.overrides,
);
@ -270,14 +265,14 @@ export async function relinquish(deploy: CoreDeploy) {
const govRouter = await deploy.contracts.governanceRouter!.proxy.address;
log(isTestDeploy, `${deploy.chain.name}: Relinquishing control`);
await deploy.contracts.updaterManager!.transferOwnership(
await deploy.contracts.validatorManager!.transferOwnership(
govRouter,
deploy.overrides,
);
log(
isTestDeploy,
`${deploy.chain.name}: Dispatched relinquish updatermanager`,
`${deploy.chain.name}: Dispatched relinquish validatormanager`,
);
await deploy.contracts.xAppConnectionManager!.transferOwnership(
@ -331,7 +326,7 @@ export async function enrollReplica(local: CoreDeploy, remote: CoreDeploy) {
const isTestDeploy = local.test;
log(isTestDeploy, `${local.chain.name}: starting replica enrollment`);
let tx = await local.contracts.xAppConnectionManager!.ownerEnrollReplica(
let tx = await local.contracts.xAppConnectionManager!.enrollReplica(
local.contracts.replicas[remote.chain.domain].proxy.address,
remote.chain.domain,
local.overrides,
@ -341,32 +336,6 @@ export async function enrollReplica(local: CoreDeploy, remote: CoreDeploy) {
log(isTestDeploy, `${local.chain.name}: replica enrollment done`);
}
/**
* Enrolls a remote watcher on the local chain.
*
* @param local - The local deploy instance
* @param remote - The remote deploy instance
*/
export async function enrollWatchers(left: CoreDeploy, right: CoreDeploy) {
const isTestDeploy = left.test;
log(isTestDeploy, `${left.chain.name}: starting watcher enrollment`);
await Promise.all(
left.watchers.map(async (watcher) => {
const tx =
await left.contracts.xAppConnectionManager!.setWatcherPermission(
watcher,
right.chain.domain,
true,
left.overrides,
);
await tx.wait(left.chain.confirmations);
}),
);
log(isTestDeploy, `${left.chain.name}: watcher enrollment done`);
}
/**
* Enrolls a remote GovernanceRouter on the local chain.
*
@ -394,6 +363,26 @@ export async function enrollGovernanceRouter(
);
}
/**
* Enrolls a remote validator on the local chain.
*
* @param local - The local deploy instance
* @param remote - The remote deploy instance
*/
export async function enrollValidator(local: CoreDeploy, remote: CoreDeploy) {
const isTestDeploy = local.test;
log(isTestDeploy, `${local.chain.name}: starting validator enrollment`);
let tx = await local.contracts.validatorManager!.setValidator(
remote.chain.domain,
remote.validator,
local.overrides,
);
await tx.wait(local.chain.confirmations);
log(isTestDeploy, `${local.chain.name}: validator enrollment done`);
}
/**
* Enrolls a remote Replica, GovernanceRouter and Watchers on the local chain.
*
@ -403,8 +392,8 @@ export async function enrollGovernanceRouter(
export async function enrollRemote(local: CoreDeploy, remote: CoreDeploy) {
await deployUnenrolledReplica(local, remote);
await enrollReplica(local, remote);
await enrollWatchers(local, remote);
await enrollGovernanceRouter(local, remote);
await enrollValidator(local, remote);
}
/**
@ -449,70 +438,6 @@ export async function appointGovernor(gov: CoreDeploy) {
}
}
/**
* Deploys the entire abacus suite of contracts on two chains.
*
* @notice `gov` has the governance capability after setup
*
* @param gov - The governor chain deploy instance
* @param non - The non-governor chain deploy instance
*/
export async function deployTwoChains(gov: CoreDeploy, non: CoreDeploy) {
const isTestDeploy: boolean = gov.test || non.test;
log(isTestDeploy, 'Beginning Two Chain deploy process');
log(isTestDeploy, `Deploy env is ${gov.config.environment}`);
log(isTestDeploy, `${gov.chain.name} is governing`);
log(isTestDeploy, `Updater for ${gov.chain.name} Home is ${gov.updater}`);
log(isTestDeploy, `Updater for ${non.chain.name} Home is ${non.updater}`);
log(isTestDeploy, 'awaiting provider ready');
await Promise.all([gov.ready(), non.ready()]);
log(isTestDeploy, 'done readying');
await Promise.all([deployAbacus(gov), deployAbacus(non)]);
log(isTestDeploy, 'initial deploys done');
await Promise.all([
deployUnenrolledReplica(gov, non),
deployUnenrolledReplica(non, gov),
]);
log(isTestDeploy, 'replica deploys done');
await Promise.all([enrollReplica(gov, non), enrollReplica(non, gov)]);
log(isTestDeploy, 'replica enrollment done');
await Promise.all([enrollWatchers(gov, non), enrollWatchers(non, gov)]);
await Promise.all([
enrollGovernanceRouter(gov, non),
enrollGovernanceRouter(non, gov),
]);
if (gov.governor) {
log(isTestDeploy, `appoint governor: ${gov.governor}`);
await appointGovernor(gov);
}
await transferGovernorship(gov, non);
await Promise.all([relinquish(gov), relinquish(non)]);
// checks deploys are correct
const checker = new CoreInvariantChecker([gov, non]);
await checker.checkDeploys();
checker.expectEmpty();
if (!isTestDeploy) {
gov.writeDeployOutput();
non.writeDeployOutput();
writeRustConfigs([gov, non]);
}
}
/**
* Deploy the entire suite of Abacus contracts
* on each chain within the chains array
@ -538,7 +463,7 @@ export async function deployNChains(deploys: CoreDeploy[]) {
deploys.forEach((deploy) => {
log(
isTestDeploy,
`Updater for ${deploy.chain.name} Home is ${deploy.updater}`,
`Updater for ${deploy.chain.name} Home is ${deploy.validator}`,
);
});
@ -613,7 +538,7 @@ export function writePartials(dir: string) {
// make folder if it doesn't exist already
fs.mkdirSync(dir, { recursive: true });
const defaultDir = '../../rust/config/default';
const partialNames = ['kathy', 'processor', 'relayer', 'updater', 'watcher'];
const partialNames = ['kathy', 'processor', 'relayer', 'validator'];
// copy partial config from default directory to given directory
for (let partialName of partialNames) {
const filename = `${partialName}-partial.json`;

@ -13,7 +13,7 @@ export enum DeployEnvironment {
}
type XAppConnectionName = 'XAppConnectionManager';
type UpdaterManagerName = 'UpdaterManager';
type ValidatorManagerName = 'ValidatorManager';
type UBCName = 'UpgradeBeaconController';
type HomeName = 'Home UpgradeBeacon' | 'Home Proxy' | 'Home Implementation';
type ReplicaName =
@ -36,7 +36,7 @@ type BridgeRouterName =
export type ContractVerificationName =
| XAppConnectionName
| UpdaterManagerName
| ValidatorManagerName
| UBCName
| HomeName
| ReplicaName

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

Loading…
Cancel
Save