Low cost relay model contract implementation (#165)
parent
472aedfddb
commit
d1de95e81b
@ -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(); |
||||
} |
||||
} |
@ -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")); |
||||
} |
||||
} |
@ -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(); |
||||
} |
||||
} |
@ -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,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); |
||||
}); |
||||
}); |
@ -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'); |
||||
}); |
||||
}); |
||||
}); |
@ -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>; |
||||
}; |
||||
} |
@ -1,363 +0,0 @@ |
||||
/* Autogenerated file. Do not edit manually. */ |
||||
/* tslint:disable */ |
||||
/* eslint-disable */ |
||||
|
||||
import { |
||||
ethers, |
||||
EventFilter, |
||||
Signer, |
||||
BigNumber, |
||||
BigNumberish, |
||||
PopulatedTransaction, |
||||
BaseContract, |
||||
ContractTransaction, |
||||
Overrides, |
||||
CallOverrides, |
||||
} from "ethers"; |
||||
import { BytesLike } from "@ethersproject/bytes"; |
||||
import { Listener, Provider } from "@ethersproject/providers"; |
||||
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; |
||||
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons"; |
||||
|
||||
interface TestQueueInterface extends ethers.utils.Interface { |
||||
functions: { |
||||
"contains(bytes32)": FunctionFragment; |
||||
"dequeue()": FunctionFragment; |
||||
"dequeueMany(uint256)": FunctionFragment; |
||||
"drain()": FunctionFragment; |
||||
"enqueue(bytes32)": FunctionFragment; |
||||
"enqueueMany(bytes32[])": FunctionFragment; |
||||
"initializeAgain()": FunctionFragment; |
||||
"lastItem()": FunctionFragment; |
||||
"length()": FunctionFragment; |
||||
"peek()": FunctionFragment; |
||||
"queueContains(bytes32)": FunctionFragment; |
||||
"queueEnd()": FunctionFragment; |
||||
"queueLength()": FunctionFragment; |
||||
}; |
||||
|
||||
encodeFunctionData(functionFragment: "contains", values: [BytesLike]): string; |
||||
encodeFunctionData(functionFragment: "dequeue", values?: undefined): string; |
||||
encodeFunctionData( |
||||
functionFragment: "dequeueMany", |
||||
values: [BigNumberish] |
||||
): string; |
||||
encodeFunctionData(functionFragment: "drain", values?: undefined): string; |
||||
encodeFunctionData(functionFragment: "enqueue", values: [BytesLike]): string; |
||||
encodeFunctionData( |
||||
functionFragment: "enqueueMany", |
||||
values: [BytesLike[]] |
||||
): string; |
||||
encodeFunctionData( |
||||
functionFragment: "initializeAgain", |
||||
values?: undefined |
||||
): string; |
||||
encodeFunctionData(functionFragment: "lastItem", values?: undefined): string; |
||||
encodeFunctionData(functionFragment: "length", values?: undefined): string; |
||||
encodeFunctionData(functionFragment: "peek", values?: undefined): string; |
||||
encodeFunctionData( |
||||
functionFragment: "queueContains", |
||||
values: [BytesLike] |
||||
): string; |
||||
encodeFunctionData(functionFragment: "queueEnd", values?: undefined): string; |
||||
encodeFunctionData( |
||||
functionFragment: "queueLength", |
||||
values?: undefined |
||||
): string; |
||||
|
||||
decodeFunctionResult(functionFragment: "contains", data: BytesLike): Result; |
||||
decodeFunctionResult(functionFragment: "dequeue", data: BytesLike): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "dequeueMany", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult(functionFragment: "drain", data: BytesLike): Result; |
||||
decodeFunctionResult(functionFragment: "enqueue", data: BytesLike): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "enqueueMany", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "initializeAgain", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult(functionFragment: "lastItem", data: BytesLike): Result; |
||||
decodeFunctionResult(functionFragment: "length", data: BytesLike): Result; |
||||
decodeFunctionResult(functionFragment: "peek", data: BytesLike): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "queueContains", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult(functionFragment: "queueEnd", data: BytesLike): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "queueLength", |
||||
data: BytesLike |
||||
): Result; |
||||
|
||||
events: {}; |
||||
} |
||||
|
||||
export class TestQueue extends BaseContract { |
||||
connect(signerOrProvider: Signer | Provider | string): this; |
||||
attach(addressOrName: string): this; |
||||
deployed(): Promise<this>; |
||||
|
||||
listeners<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject> |
||||
): Array<TypedListener<EventArgsArray, EventArgsObject>>; |
||||
off<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>, |
||||
listener: TypedListener<EventArgsArray, EventArgsObject> |
||||
): this; |
||||
on<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>, |
||||
listener: TypedListener<EventArgsArray, EventArgsObject> |
||||
): this; |
||||
once<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>, |
||||
listener: TypedListener<EventArgsArray, EventArgsObject> |
||||
): this; |
||||
removeListener<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>, |
||||
listener: TypedListener<EventArgsArray, EventArgsObject> |
||||
): this; |
||||
removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject> |
||||
): this; |
||||
|
||||
listeners(eventName?: string): Array<Listener>; |
||||
off(eventName: string, listener: Listener): this; |
||||
on(eventName: string, listener: Listener): this; |
||||
once(eventName: string, listener: Listener): this; |
||||
removeListener(eventName: string, listener: Listener): this; |
||||
removeAllListeners(eventName?: string): this; |
||||
|
||||
queryFilter<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
event: TypedEventFilter<EventArgsArray, EventArgsObject>, |
||||
fromBlockOrBlockhash?: string | number | undefined, |
||||
toBlock?: string | number | undefined |
||||
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>; |
||||
|
||||
interface: TestQueueInterface; |
||||
|
||||
functions: { |
||||
contains(_item: BytesLike, overrides?: CallOverrides): Promise<[boolean]>; |
||||
|
||||
dequeue( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
dequeueMany( |
||||
_number: BigNumberish, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
drain( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
enqueue( |
||||
_item: BytesLike, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
enqueueMany( |
||||
_items: BytesLike[], |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
initializeAgain( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
lastItem(overrides?: CallOverrides): Promise<[string]>; |
||||
|
||||
length(overrides?: CallOverrides): Promise<[BigNumber]>; |
||||
|
||||
peek(overrides?: CallOverrides): Promise<[string] & { _item: string }>; |
||||
|
||||
queueContains( |
||||
_item: BytesLike, |
||||
overrides?: CallOverrides |
||||
): Promise<[boolean]>; |
||||
|
||||
queueEnd(overrides?: CallOverrides): Promise<[string]>; |
||||
|
||||
queueLength(overrides?: CallOverrides): Promise<[BigNumber]>; |
||||
}; |
||||
|
||||
contains(_item: BytesLike, overrides?: CallOverrides): Promise<boolean>; |
||||
|
||||
dequeue( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
dequeueMany( |
||||
_number: BigNumberish, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
drain( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
enqueue( |
||||
_item: BytesLike, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
enqueueMany( |
||||
_items: BytesLike[], |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
initializeAgain( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
lastItem(overrides?: CallOverrides): Promise<string>; |
||||
|
||||
length(overrides?: CallOverrides): Promise<BigNumber>; |
||||
|
||||
peek(overrides?: CallOverrides): Promise<string>; |
||||
|
||||
queueContains(_item: BytesLike, overrides?: CallOverrides): Promise<boolean>; |
||||
|
||||
queueEnd(overrides?: CallOverrides): Promise<string>; |
||||
|
||||
queueLength(overrides?: CallOverrides): Promise<BigNumber>; |
||||
|
||||
callStatic: { |
||||
contains(_item: BytesLike, overrides?: CallOverrides): Promise<boolean>; |
||||
|
||||
dequeue(overrides?: CallOverrides): Promise<string>; |
||||
|
||||
dequeueMany( |
||||
_number: BigNumberish, |
||||
overrides?: CallOverrides |
||||
): Promise<string[]>; |
||||
|
||||
drain(overrides?: CallOverrides): Promise<void>; |
||||
|
||||
enqueue(_item: BytesLike, overrides?: CallOverrides): Promise<BigNumber>; |
||||
|
||||
enqueueMany( |
||||
_items: BytesLike[], |
||||
overrides?: CallOverrides |
||||
): Promise<BigNumber>; |
||||
|
||||
initializeAgain(overrides?: CallOverrides): Promise<void>; |
||||
|
||||
lastItem(overrides?: CallOverrides): Promise<string>; |
||||
|
||||
length(overrides?: CallOverrides): Promise<BigNumber>; |
||||
|
||||
peek(overrides?: CallOverrides): Promise<string>; |
||||
|
||||
queueContains( |
||||
_item: BytesLike, |
||||
overrides?: CallOverrides |
||||
): Promise<boolean>; |
||||
|
||||
queueEnd(overrides?: CallOverrides): Promise<string>; |
||||
|
||||
queueLength(overrides?: CallOverrides): Promise<BigNumber>; |
||||
}; |
||||
|
||||
filters: {}; |
||||
|
||||
estimateGas: { |
||||
contains(_item: BytesLike, overrides?: CallOverrides): Promise<BigNumber>; |
||||
|
||||
dequeue( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<BigNumber>; |
||||
|
||||
dequeueMany( |
||||
_number: BigNumberish, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<BigNumber>; |
||||
|
||||
drain( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<BigNumber>; |
||||
|
||||
enqueue( |
||||
_item: BytesLike, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<BigNumber>; |
||||
|
||||
enqueueMany( |
||||
_items: BytesLike[], |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<BigNumber>; |
||||
|
||||
initializeAgain( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<BigNumber>; |
||||
|
||||
lastItem(overrides?: CallOverrides): Promise<BigNumber>; |
||||
|
||||
length(overrides?: CallOverrides): Promise<BigNumber>; |
||||
|
||||
peek(overrides?: CallOverrides): Promise<BigNumber>; |
||||
|
||||
queueContains( |
||||
_item: BytesLike, |
||||
overrides?: CallOverrides |
||||
): Promise<BigNumber>; |
||||
|
||||
queueEnd(overrides?: CallOverrides): Promise<BigNumber>; |
||||
|
||||
queueLength(overrides?: CallOverrides): Promise<BigNumber>; |
||||
}; |
||||
|
||||
populateTransaction: { |
||||
contains( |
||||
_item: BytesLike, |
||||
overrides?: CallOverrides |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
dequeue( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
dequeueMany( |
||||
_number: BigNumberish, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
drain( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
enqueue( |
||||
_item: BytesLike, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
enqueueMany( |
||||
_items: BytesLike[], |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
initializeAgain( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
lastItem(overrides?: CallOverrides): Promise<PopulatedTransaction>; |
||||
|
||||
length(overrides?: CallOverrides): Promise<PopulatedTransaction>; |
||||
|
||||
peek(overrides?: CallOverrides): Promise<PopulatedTransaction>; |
||||
|
||||
queueContains( |
||||
_item: BytesLike, |
||||
overrides?: CallOverrides |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
queueEnd(overrides?: CallOverrides): Promise<PopulatedTransaction>; |
||||
|
||||
queueLength(overrides?: CallOverrides): Promise<PopulatedTransaction>; |
||||
}; |
||||
} |
@ -1,575 +0,0 @@ |
||||
/* Autogenerated file. Do not edit manually. */ |
||||
/* tslint:disable */ |
||||
/* eslint-disable */ |
||||
|
||||
import { |
||||
ethers, |
||||
EventFilter, |
||||
Signer, |
||||
BigNumber, |
||||
BigNumberish, |
||||
PopulatedTransaction, |
||||
BaseContract, |
||||
ContractTransaction, |
||||
Overrides, |
||||
CallOverrides, |
||||
} from "ethers"; |
||||
import { BytesLike } from "@ethersproject/bytes"; |
||||
import { Listener, Provider } from "@ethersproject/providers"; |
||||
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; |
||||
import { TypedEventFilter, TypedEvent, TypedListener } from "./commons"; |
||||
|
||||
interface TestXAppConnectionManagerInterface extends ethers.utils.Interface { |
||||
functions: { |
||||
"domainToReplica(uint32)": FunctionFragment; |
||||
"home()": FunctionFragment; |
||||
"isReplica(address)": FunctionFragment; |
||||
"localDomain()": FunctionFragment; |
||||
"owner()": FunctionFragment; |
||||
"ownerEnrollReplica(address,uint32)": FunctionFragment; |
||||
"ownerUnenrollReplica(address)": FunctionFragment; |
||||
"renounceOwnership()": FunctionFragment; |
||||
"replicaToDomain(address)": FunctionFragment; |
||||
"setHome(address)": FunctionFragment; |
||||
"setWatcherPermission(address,uint32,bool)": FunctionFragment; |
||||
"testRecoverWatcherFromSig(uint32,address,address,bytes)": FunctionFragment; |
||||
"transferOwnership(address)": FunctionFragment; |
||||
"unenrollReplica(uint32,bytes32,bytes)": FunctionFragment; |
||||
"watcherPermission(address,uint32)": FunctionFragment; |
||||
}; |
||||
|
||||
encodeFunctionData( |
||||
functionFragment: "domainToReplica", |
||||
values: [BigNumberish] |
||||
): string; |
||||
encodeFunctionData(functionFragment: "home", values?: undefined): string; |
||||
encodeFunctionData(functionFragment: "isReplica", values: [string]): string; |
||||
encodeFunctionData( |
||||
functionFragment: "localDomain", |
||||
values?: undefined |
||||
): string; |
||||
encodeFunctionData(functionFragment: "owner", values?: undefined): string; |
||||
encodeFunctionData( |
||||
functionFragment: "ownerEnrollReplica", |
||||
values: [string, BigNumberish] |
||||
): string; |
||||
encodeFunctionData( |
||||
functionFragment: "ownerUnenrollReplica", |
||||
values: [string] |
||||
): string; |
||||
encodeFunctionData( |
||||
functionFragment: "renounceOwnership", |
||||
values?: undefined |
||||
): string; |
||||
encodeFunctionData( |
||||
functionFragment: "replicaToDomain", |
||||
values: [string] |
||||
): string; |
||||
encodeFunctionData(functionFragment: "setHome", values: [string]): string; |
||||
encodeFunctionData( |
||||
functionFragment: "setWatcherPermission", |
||||
values: [string, BigNumberish, boolean] |
||||
): string; |
||||
encodeFunctionData( |
||||
functionFragment: "testRecoverWatcherFromSig", |
||||
values: [BigNumberish, string, string, BytesLike] |
||||
): string; |
||||
encodeFunctionData( |
||||
functionFragment: "transferOwnership", |
||||
values: [string] |
||||
): string; |
||||
encodeFunctionData( |
||||
functionFragment: "unenrollReplica", |
||||
values: [BigNumberish, BytesLike, BytesLike] |
||||
): string; |
||||
encodeFunctionData( |
||||
functionFragment: "watcherPermission", |
||||
values: [string, BigNumberish] |
||||
): string; |
||||
|
||||
decodeFunctionResult( |
||||
functionFragment: "domainToReplica", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult(functionFragment: "home", data: BytesLike): Result; |
||||
decodeFunctionResult(functionFragment: "isReplica", data: BytesLike): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "localDomain", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "ownerEnrollReplica", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "ownerUnenrollReplica", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "renounceOwnership", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "replicaToDomain", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult(functionFragment: "setHome", data: BytesLike): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "setWatcherPermission", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "testRecoverWatcherFromSig", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "transferOwnership", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "unenrollReplica", |
||||
data: BytesLike |
||||
): Result; |
||||
decodeFunctionResult( |
||||
functionFragment: "watcherPermission", |
||||
data: BytesLike |
||||
): Result; |
||||
|
||||
events: { |
||||
"OwnershipTransferred(address,address)": EventFragment; |
||||
"ReplicaEnrolled(uint32,address)": EventFragment; |
||||
"ReplicaUnenrolled(uint32,address)": EventFragment; |
||||
"WatcherPermissionSet(uint32,address,bool)": EventFragment; |
||||
}; |
||||
|
||||
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; |
||||
getEvent(nameOrSignatureOrTopic: "ReplicaEnrolled"): EventFragment; |
||||
getEvent(nameOrSignatureOrTopic: "ReplicaUnenrolled"): EventFragment; |
||||
getEvent(nameOrSignatureOrTopic: "WatcherPermissionSet"): EventFragment; |
||||
} |
||||
|
||||
export class TestXAppConnectionManager extends BaseContract { |
||||
connect(signerOrProvider: Signer | Provider | string): this; |
||||
attach(addressOrName: string): this; |
||||
deployed(): Promise<this>; |
||||
|
||||
listeners<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject> |
||||
): Array<TypedListener<EventArgsArray, EventArgsObject>>; |
||||
off<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>, |
||||
listener: TypedListener<EventArgsArray, EventArgsObject> |
||||
): this; |
||||
on<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>, |
||||
listener: TypedListener<EventArgsArray, EventArgsObject> |
||||
): this; |
||||
once<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>, |
||||
listener: TypedListener<EventArgsArray, EventArgsObject> |
||||
): this; |
||||
removeListener<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>, |
||||
listener: TypedListener<EventArgsArray, EventArgsObject> |
||||
): this; |
||||
removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject> |
||||
): this; |
||||
|
||||
listeners(eventName?: string): Array<Listener>; |
||||
off(eventName: string, listener: Listener): this; |
||||
on(eventName: string, listener: Listener): this; |
||||
once(eventName: string, listener: Listener): this; |
||||
removeListener(eventName: string, listener: Listener): this; |
||||
removeAllListeners(eventName?: string): this; |
||||
|
||||
queryFilter<EventArgsArray extends Array<any>, EventArgsObject>( |
||||
event: TypedEventFilter<EventArgsArray, EventArgsObject>, |
||||
fromBlockOrBlockhash?: string | number | undefined, |
||||
toBlock?: string | number | undefined |
||||
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>; |
||||
|
||||
interface: TestXAppConnectionManagerInterface; |
||||
|
||||
functions: { |
||||
domainToReplica( |
||||
arg0: BigNumberish, |
||||
overrides?: CallOverrides |
||||
): Promise<[string]>; |
||||
|
||||
home(overrides?: CallOverrides): Promise<[string]>; |
||||
|
||||
isReplica(_replica: string, overrides?: CallOverrides): Promise<[boolean]>; |
||||
|
||||
localDomain(overrides?: CallOverrides): Promise<[number]>; |
||||
|
||||
owner(overrides?: CallOverrides): Promise<[string]>; |
||||
|
||||
ownerEnrollReplica( |
||||
_replica: string, |
||||
_domain: BigNumberish, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
ownerUnenrollReplica( |
||||
_replica: string, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
renounceOwnership( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
replicaToDomain(arg0: string, overrides?: CallOverrides): Promise<[number]>; |
||||
|
||||
setHome( |
||||
_home: string, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
setWatcherPermission( |
||||
_watcher: string, |
||||
_domain: BigNumberish, |
||||
_access: boolean, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
testRecoverWatcherFromSig( |
||||
_domain: BigNumberish, |
||||
_replica: string, |
||||
_updater: string, |
||||
_signature: BytesLike, |
||||
overrides?: CallOverrides |
||||
): Promise<[string]>; |
||||
|
||||
transferOwnership( |
||||
newOwner: string, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
unenrollReplica( |
||||
_domain: BigNumberish, |
||||
_updater: BytesLike, |
||||
_signature: BytesLike, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
watcherPermission( |
||||
_watcher: string, |
||||
_domain: BigNumberish, |
||||
overrides?: CallOverrides |
||||
): Promise<[boolean]>; |
||||
}; |
||||
|
||||
domainToReplica( |
||||
arg0: BigNumberish, |
||||
overrides?: CallOverrides |
||||
): Promise<string>; |
||||
|
||||
home(overrides?: CallOverrides): Promise<string>; |
||||
|
||||
isReplica(_replica: string, overrides?: CallOverrides): Promise<boolean>; |
||||
|
||||
localDomain(overrides?: CallOverrides): Promise<number>; |
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>; |
||||
|
||||
ownerEnrollReplica( |
||||
_replica: string, |
||||
_domain: BigNumberish, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
ownerUnenrollReplica( |
||||
_replica: string, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
renounceOwnership( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
replicaToDomain(arg0: string, overrides?: CallOverrides): Promise<number>; |
||||
|
||||
setHome( |
||||
_home: string, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
setWatcherPermission( |
||||
_watcher: string, |
||||
_domain: BigNumberish, |
||||
_access: boolean, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
testRecoverWatcherFromSig( |
||||
_domain: BigNumberish, |
||||
_replica: string, |
||||
_updater: string, |
||||
_signature: BytesLike, |
||||
overrides?: CallOverrides |
||||
): Promise<string>; |
||||
|
||||
transferOwnership( |
||||
newOwner: string, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
unenrollReplica( |
||||
_domain: BigNumberish, |
||||
_updater: BytesLike, |
||||
_signature: BytesLike, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<ContractTransaction>; |
||||
|
||||
watcherPermission( |
||||
_watcher: string, |
||||
_domain: BigNumberish, |
||||
overrides?: CallOverrides |
||||
): Promise<boolean>; |
||||
|
||||
callStatic: { |
||||
domainToReplica( |
||||
arg0: BigNumberish, |
||||
overrides?: CallOverrides |
||||
): Promise<string>; |
||||
|
||||
home(overrides?: CallOverrides): Promise<string>; |
||||
|
||||
isReplica(_replica: string, overrides?: CallOverrides): Promise<boolean>; |
||||
|
||||
localDomain(overrides?: CallOverrides): Promise<number>; |
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>; |
||||
|
||||
ownerEnrollReplica( |
||||
_replica: string, |
||||
_domain: BigNumberish, |
||||
overrides?: CallOverrides |
||||
): Promise<void>; |
||||
|
||||
ownerUnenrollReplica( |
||||
_replica: string, |
||||
overrides?: CallOverrides |
||||
): Promise<void>; |
||||
|
||||
renounceOwnership(overrides?: CallOverrides): Promise<void>; |
||||
|
||||
replicaToDomain(arg0: string, overrides?: CallOverrides): Promise<number>; |
||||
|
||||
setHome(_home: string, overrides?: CallOverrides): Promise<void>; |
||||
|
||||
setWatcherPermission( |
||||
_watcher: string, |
||||
_domain: BigNumberish, |
||||
_access: boolean, |
||||
overrides?: CallOverrides |
||||
): Promise<void>; |
||||
|
||||
testRecoverWatcherFromSig( |
||||
_domain: BigNumberish, |
||||
_replica: string, |
||||
_updater: string, |
||||
_signature: BytesLike, |
||||
overrides?: CallOverrides |
||||
): Promise<string>; |
||||
|
||||
transferOwnership( |
||||
newOwner: string, |
||||
overrides?: CallOverrides |
||||
): Promise<void>; |
||||
|
||||
unenrollReplica( |
||||
_domain: BigNumberish, |
||||
_updater: BytesLike, |
||||
_signature: BytesLike, |
||||
overrides?: CallOverrides |
||||
): Promise<void>; |
||||
|
||||
watcherPermission( |
||||
_watcher: string, |
||||
_domain: BigNumberish, |
||||
overrides?: CallOverrides |
||||
): Promise<boolean>; |
||||
}; |
||||
|
||||
filters: { |
||||
OwnershipTransferred( |
||||
previousOwner?: string | null, |
||||
newOwner?: string | null |
||||
): TypedEventFilter< |
||||
[string, string], |
||||
{ previousOwner: string; newOwner: string } |
||||
>; |
||||
|
||||
ReplicaEnrolled( |
||||
domain?: BigNumberish | null, |
||||
replica?: null |
||||
): TypedEventFilter<[number, string], { domain: number; replica: string }>; |
||||
|
||||
ReplicaUnenrolled( |
||||
domain?: BigNumberish | null, |
||||
replica?: null |
||||
): TypedEventFilter<[number, string], { domain: number; replica: string }>; |
||||
|
||||
WatcherPermissionSet( |
||||
domain?: BigNumberish | null, |
||||
watcher?: null, |
||||
access?: null |
||||
): TypedEventFilter< |
||||
[number, string, boolean], |
||||
{ domain: number; watcher: string; access: boolean } |
||||
>; |
||||
}; |
||||
|
||||
estimateGas: { |
||||
domainToReplica( |
||||
arg0: BigNumberish, |
||||
overrides?: CallOverrides |
||||
): Promise<BigNumber>; |
||||
|
||||
home(overrides?: CallOverrides): Promise<BigNumber>; |
||||
|
||||
isReplica(_replica: string, overrides?: CallOverrides): Promise<BigNumber>; |
||||
|
||||
localDomain(overrides?: CallOverrides): Promise<BigNumber>; |
||||
|
||||
owner(overrides?: CallOverrides): Promise<BigNumber>; |
||||
|
||||
ownerEnrollReplica( |
||||
_replica: string, |
||||
_domain: BigNumberish, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<BigNumber>; |
||||
|
||||
ownerUnenrollReplica( |
||||
_replica: string, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<BigNumber>; |
||||
|
||||
renounceOwnership( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<BigNumber>; |
||||
|
||||
replicaToDomain( |
||||
arg0: string, |
||||
overrides?: CallOverrides |
||||
): Promise<BigNumber>; |
||||
|
||||
setHome( |
||||
_home: string, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<BigNumber>; |
||||
|
||||
setWatcherPermission( |
||||
_watcher: string, |
||||
_domain: BigNumberish, |
||||
_access: boolean, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<BigNumber>; |
||||
|
||||
testRecoverWatcherFromSig( |
||||
_domain: BigNumberish, |
||||
_replica: string, |
||||
_updater: string, |
||||
_signature: BytesLike, |
||||
overrides?: CallOverrides |
||||
): Promise<BigNumber>; |
||||
|
||||
transferOwnership( |
||||
newOwner: string, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<BigNumber>; |
||||
|
||||
unenrollReplica( |
||||
_domain: BigNumberish, |
||||
_updater: BytesLike, |
||||
_signature: BytesLike, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<BigNumber>; |
||||
|
||||
watcherPermission( |
||||
_watcher: string, |
||||
_domain: BigNumberish, |
||||
overrides?: CallOverrides |
||||
): Promise<BigNumber>; |
||||
}; |
||||
|
||||
populateTransaction: { |
||||
domainToReplica( |
||||
arg0: BigNumberish, |
||||
overrides?: CallOverrides |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
home(overrides?: CallOverrides): Promise<PopulatedTransaction>; |
||||
|
||||
isReplica( |
||||
_replica: string, |
||||
overrides?: CallOverrides |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
localDomain(overrides?: CallOverrides): Promise<PopulatedTransaction>; |
||||
|
||||
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>; |
||||
|
||||
ownerEnrollReplica( |
||||
_replica: string, |
||||
_domain: BigNumberish, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
ownerUnenrollReplica( |
||||
_replica: string, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
renounceOwnership( |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
replicaToDomain( |
||||
arg0: string, |
||||
overrides?: CallOverrides |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
setHome( |
||||
_home: string, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
setWatcherPermission( |
||||
_watcher: string, |
||||
_domain: BigNumberish, |
||||
_access: boolean, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
testRecoverWatcherFromSig( |
||||
_domain: BigNumberish, |
||||
_replica: string, |
||||
_updater: string, |
||||
_signature: BytesLike, |
||||
overrides?: CallOverrides |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
transferOwnership( |
||||
newOwner: string, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
unenrollReplica( |
||||
_domain: BigNumberish, |
||||
_updater: BytesLike, |
||||
_signature: BytesLike, |
||||
overrides?: Overrides & { from?: string | Promise<string> } |
||||
): Promise<PopulatedTransaction>; |
||||
|
||||
watcherPermission( |
||||
_watcher: string, |
||||
_domain: BigNumberish, |
||||
overrides?: CallOverrides |
||||
): Promise<PopulatedTransaction>; |
||||
}; |
||||
} |
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
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
@ -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
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue