Transactions
Token Transfers
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
- Contract name:
- Bridge
- Optimization enabled
- true
- Compiler version
- v0.6.4+commit.1dca32f3
- Optimization runs
- 200
- EVM Version
- constantinople
- Verified at
- 2021-10-28T23:59:01.033983Z
Constructor Arguments
000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f6c75ea68bec6205def2c5a4043ab9f4f85bb9ea
Arg [0] (uint8) : 8
Arg [1] (address[]) : [0xf6c75ea68bec6205def2c5a4043ab9f4f85bb9ea]
Arg [2] (uint256) : 1
Arg [3] (uint256) : 0
Arg [4] (uint256) : 28800
Contract source code
pragma solidity 0.6.4; pragma experimental ABIEncoderV2; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view returns (bool) { return _roles[role].members.contains(account); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } } // SPDX-License-Identifier: MIT /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This is a stripped down version of Open zeppelin's Pausable contract. * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/EnumerableSet.sol * */ contract Pausable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor () internal { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _whenNotPaused(); _; } function _whenNotPaused() private view { require(!_paused, "Pausable: paused"); } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenPaused() { _whenPaused(); _; } function _whenPaused() private view { require(_paused, "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(msg.sender); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(msg.sender); } } // SPDX-License-Identifier: MIT /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * note that this is a stripped down version of open zeppelin's safemath * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return _sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function _sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } } /** @title Interface for handler contracts that support deposits and deposit executions. @author ChainSafe Systems. */ interface IDepositExecute { /** @notice It is intended that deposit are made using the Bridge contract. @param destinationChainID Chain ID deposit is expected to be bridged to. @param depositNonce This value is generated as an ID by the Bridge contract. @param depositer Address of account making the deposit in the Bridge contract. @param data Consists of additional data needed for a specific deposit. */ function deposit(bytes32 resourceID, uint8 destinationChainID, uint64 depositNonce, address depositer, bytes calldata data) external; /** @notice It is intended that proposals are executed by the Bridge contract. @param data Consists of additional data needed for a specific deposit execution. */ function executeProposal(bytes32 resourceID, bytes calldata data) external; } /** @title Interface for Bridge contract. @author ChainSafe Systems. */ interface IBridge { /** @notice Exposing getter for {_chainID} instead of forcing the use of call. @return uint8 The {_chainID} that is currently set for the Bridge contract. */ function _chainID() external returns (uint8); } /** @title Interface to be used with handlers that support ERC20s and ERC721s. @author ChainSafe Systems. */ interface IERCHandler { /** @notice Correlates {resourceID} with {contractAddress}. @param resourceID ResourceID to be used when making deposits. @param contractAddress Address of contract to be called when a deposit is made and a deposited is executed. */ function setResource(bytes32 resourceID, address contractAddress) external; /** @notice Marks {contractAddress} as mintable/burnable. @param contractAddress Address of contract to be used when making or executing deposits. */ function setBurnable(address contractAddress) external; /** @notice Used to manually release funds from ERC safes. @param tokenAddress Address of token contract to release. @param recipient Address to release tokens to. @param amountOrTokenID Either the amount of ERC20 tokens or the ERC721 token ID to release. */ function withdraw(address tokenAddress, address recipient, uint256 amountOrTokenID) external; function _wtokenAddress() external returns (address); /** @notice Used to update the _bridgeAddress @param newBridgeAddress Address of the updated bridge address. */ function updateBridgeAddress(address newBridgeAddress) external; } /** @title Interface for handler that handles generic deposits and deposit executions. @author ChainSafe Systems. */ interface IGenericHandler { /** @notice Correlates {resourceID} with {contractAddress}, {depositFunctionSig}, and {executeFunctionSig}. @param resourceID ResourceID to be used when making deposits. @param contractAddress Address of contract to be called when a deposit is made and a deposited is executed. @param depositFunctionSig Function signature of method to be called in {contractAddress} when a deposit is made. @param depositFunctionDepositerOffset Depositer address position offset in the metadata, in bytes. @param executeFunctionSig Function signature of method to be called in {contractAddress} when a deposit is executed. */ function setResource( bytes32 resourceID, address contractAddress, bytes4 depositFunctionSig, uint depositFunctionDepositerOffset, bytes4 executeFunctionSig) external; } interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function withdraw(uint) external; } /** @title Facilitates deposits, creation and votiing of deposit proposals, and deposit executions. @author ChainSafe Systems. */ contract Bridge is Pausable, AccessControl, SafeMath { uint8 public _chainID; uint256 public _relayerThreshold; uint256 public _totalRelayers; uint256 public _totalOperators; uint256 public _totalProposals; uint256 public _fee; uint256 public _expiry; address public _wtokenAddress; enum Vote {No, Yes} enum ProposalStatus {Inactive, Active, Passed, Executed, Cancelled} struct Proposal { bytes32 _resourceID; bytes32 _dataHash; address[] _yesVotes; address[] _noVotes; ProposalStatus _status; uint256 _proposedBlock; } // destinationChainID => number of deposits mapping(uint8 => uint64) public _depositCounts; // destinationID ==> specailFee other than _fee mapping(uint8 => uint256) public _specialFee; // resourceID => handler address mapping(bytes32 => address) public _resourceIDToHandlerAddress; // depositNonce => destinationChainID => bytes mapping(uint64 => mapping(uint8 => bytes)) public _depositRecords; // destinationChainID + depositNonce => dataHash => Proposal mapping(uint72 => mapping(bytes32 => Proposal)) public _proposals; // destinationChainID + depositNonce => dataHash => relayerAddress => bool mapping(uint72 => mapping(bytes32 => mapping(address => bool))) public _hasVotedOnProposal; event RelayerThresholdChanged(uint256 indexed newThreshold); event RelayerAdded(address indexed relayer); event RelayerRemoved(address indexed relayer); event OperatorAdded(address indexed operator); event OperatorRemoved(address indexed operator); event Deposit( uint8 indexed destinationChainID, bytes32 indexed resourceID, uint64 indexed depositNonce ); event ProposalEvent( uint8 indexed originChainID, uint64 indexed depositNonce, ProposalStatus indexed status, bytes32 resourceID, bytes32 dataHash ); event ProposalVote( uint8 indexed originChainID, uint64 indexed depositNonce, ProposalStatus indexed status, bytes32 resourceID ); bytes32 public constant RELAYER_ROLE = keccak256("RELAYER_ROLE"); bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE"); modifier onlyAdmin() { _onlyAdmin(); _; } modifier onlyAdminOrRelayer() { _onlyAdminOrRelayer(); _; } modifier onlyRelayers() { _onlyRelayers(); _; } modifier onlyOperators() { _onlyOperators(); _; } modifier onlyAdminOrOperator() { _onlyAdminOrOperator(); _; } function _onlyAdminOrRelayer() private { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender) || hasRole(RELAYER_ROLE, msg.sender), "sender is not relayer or admin"); } function _onlyAdminOrOperator() private { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender) || hasRole(OPERATOR_ROLE, msg.sender), "sender is not operator or admin"); } function _onlyAdmin() private { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "sender doesn't have admin role"); } function _onlyRelayers() private { require(hasRole(RELAYER_ROLE, msg.sender), "sender doesn't have relayer role"); } function _onlyOperators() private { require(hasRole(OPERATOR_ROLE, msg.sender), "sender doesn't have relayer role"); } /** @notice Initializes Bridge, creates and grants {msg.sender} the admin role, creates and grants {initialRelayers} the relayer role. @param chainID ID of chain the Bridge contract exists on. @param initialRelayers Addresses that should be initially granted the relayer role. @param initialRelayerThreshold Number of votes needed for a deposit proposal to be considered passed. */ constructor (uint8 chainID, address[] memory initialRelayers, uint256 initialRelayerThreshold, uint256 fee, uint256 expiry) public { _chainID = chainID; _relayerThreshold = initialRelayerThreshold; _fee = fee; _expiry = expiry; _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setRoleAdmin(RELAYER_ROLE, DEFAULT_ADMIN_ROLE); _setRoleAdmin(OPERATOR_ROLE, DEFAULT_ADMIN_ROLE); for (uint256 i; i < initialRelayers.length; i++) { grantRole(RELAYER_ROLE, initialRelayers[i]); _totalRelayers++; } } /** @notice Returns true if {relayer} has the relayer role. @param relayer Address to check. */ function isRelayer(address relayer) external view returns (bool) { return hasRole(RELAYER_ROLE, relayer); } /** @notice Returns true if {operator} has the operator role. @param operator Address to check. */ function isOperator(address operator) external view returns (bool) { return hasRole(OPERATOR_ROLE, operator); } /** @notice Removes admin role from {msg.sender} and grants it to {newAdmin}. @notice Only callable by an address that currently has the admin role. @param newAdmin Address that admin role will be granted to. */ function renounceAdmin(address newAdmin) external onlyAdmin { grantRole(DEFAULT_ADMIN_ROLE, newAdmin); renounceRole(DEFAULT_ADMIN_ROLE, msg.sender); } /** @notice Pauses deposits, proposal creation and voting, and deposit executions. @notice Only callable by an address that currently has the admin role. */ function adminPauseTransfers() external onlyAdminOrOperator { _pause(); } /** @notice Unpauses deposits, proposal creation and voting, and deposit executions. @notice Only callable by an address that currently has the admin role. */ function adminUnpauseTransfers() external onlyAdminOrOperator { _unpause(); } /** @notice Modifies the number of votes required for a proposal to be considered passed. @notice Only callable by an address that currently has the admin role. @param newThreshold Value {_relayerThreshold} will be changed to. @notice Emits {RelayerThresholdChanged} event. */ function adminChangeRelayerThreshold(uint256 newThreshold) external onlyAdmin { _relayerThreshold = newThreshold; emit RelayerThresholdChanged(newThreshold); } /** @notice Grants {relayerAddress} the relayer role and increases {_totalRelayer} count. @notice Only callable by an address that currently has the admin role. @param relayerAddress Address of relayer to be added. @notice Emits {RelayerAdded} event. */ function adminAddRelayer(address relayerAddress) external onlyAdmin { require(!hasRole(RELAYER_ROLE, relayerAddress), "addr already has relayer role!"); grantRole(RELAYER_ROLE, relayerAddress); emit RelayerAdded(relayerAddress); _totalRelayers++; } /** @notice Removes relayer role for {relayerAddress} and decreases {_totalRelayer} count. @notice Only callable by an address that currently has the admin role. @param relayerAddress Address of relayer to be removed. @notice Emits {RelayerRemoved} event. */ function adminRemoveRelayer(address relayerAddress) external onlyAdmin { require(hasRole(RELAYER_ROLE, relayerAddress), "addr doesn't have relayer role!"); revokeRole(RELAYER_ROLE, relayerAddress); emit RelayerRemoved(relayerAddress); _totalRelayers--; } /** @notice Grants {operatorAddress} the relayer role and increases {_totalOperator} count. @notice Only callable by an address that currently has the admin role. @param operatorAddress Address of operator to be added. @notice Emits {OperatorAdded} event. */ function adminAddOperator(address operatorAddress) external onlyAdmin { require(!hasRole(OPERATOR_ROLE, operatorAddress), "addr already has operator role!"); grantRole(OPERATOR_ROLE, operatorAddress); emit OperatorAdded(operatorAddress); _totalOperators++; } /** @notice Removes operator role for {operatorAddress} and decreases {_totalOperator} count. @notice Only callable by an address that currently has the admin role. @param operatorAddress Address of relayer to be removed. @notice Emits {OperatorRemoved} event. */ function adminRemoveOperator(address operatorAddress) external onlyAdmin { require(hasRole(OPERATOR_ROLE, operatorAddress), "addr doesn't have operator role!"); revokeRole(OPERATOR_ROLE, operatorAddress); emit OperatorRemoved(operatorAddress); _totalOperators--; } /** @notice Sets a new resource for handler contracts that use the IERCHandler interface, and maps the {handlerAddress} to {resourceID} in {_resourceIDToHandlerAddress}. @notice Only callable by an address that currently has the admin role. @param handlerAddress Address of handler resource will be set for. @param resourceID ResourceID to be used when making deposits. @param tokenAddress Address of contract to be called when a deposit is made and a deposited is executed. */ function adminSetResource(address handlerAddress, bytes32 resourceID, address tokenAddress) external onlyAdmin { _resourceIDToHandlerAddress[resourceID] = handlerAddress; IERCHandler handler = IERCHandler(handlerAddress); handler.setResource(resourceID, tokenAddress); } /** @notice Sets a new resource for handler contracts that use the IGenericHandler interface, and maps the {handlerAddress} to {resourceID} in {_resourceIDToHandlerAddress}. @notice Only callable by an address that currently has the admin role. @param handlerAddress Address of handler resource will be set for. @param resourceID ResourceID to be used when making deposits. @param contractAddress Address of contract to be called when a deposit is made and a deposited is executed. */ function adminSetGenericResource( address handlerAddress, bytes32 resourceID, address contractAddress, bytes4 depositFunctionSig, uint256 depositFunctionDepositerOffset, bytes4 executeFunctionSig ) external onlyAdmin { _resourceIDToHandlerAddress[resourceID] = handlerAddress; IGenericHandler handler = IGenericHandler(handlerAddress); handler.setResource(resourceID, contractAddress, depositFunctionSig, depositFunctionDepositerOffset, executeFunctionSig); } /** @notice Sets a resource as burnable for handler contracts that use the IERCHandler interface. @notice Only callable by an address that currently has the admin role. @param handlerAddress Address of handler resource will be set for. @param tokenAddress Address of contract to be called when a deposit is made and a deposited is executed. */ function adminSetBurnable(address handlerAddress, address tokenAddress) external onlyAdmin { IERCHandler handler = IERCHandler(handlerAddress); handler.setBurnable(tokenAddress); } /** @notice Returns a proposal. @param originChainID Chain ID deposit originated from. @param depositNonce ID of proposal generated by proposal's origin Bridge contract. @param dataHash Hash of data to be provided when deposit proposal is executed. @return Proposal which consists of: - _dataHash Hash of data to be provided when deposit proposal is executed. - _yesVotes Number of votes in favor of proposal. - _noVotes Number of votes against proposal. - _status Current status of proposal. */ function getProposal(uint8 originChainID, uint64 depositNonce, bytes32 dataHash) external view returns (Proposal memory) { uint72 nonceAndID = (uint72(depositNonce) << 8) | uint72(originChainID); return _proposals[nonceAndID][dataHash]; } /** @notice Changes deposit fee. @notice Only callable by admin. @param newFee Value {_fee} will be updated to. */ function adminChangeFee(uint256 newFee) external onlyAdmin { require(_fee != newFee, "Current fee is equal to new fee"); _fee = newFee; } /** @notice Changes deposit fee. @notice Only callable by admin. @param newFee Value {_specialFee} will be updated to. @param chainID Value {_specialFeeChainID} will be updated to */ function adminChangeSpecialFee(uint256 newFee, uint8 chainID) external onlyAdminOrOperator { uint256 current = _specialFee[chainID]; require((current != newFee), "Current special fee equals to the new fee"); _specialFee[chainID] = newFee; } /** @notice Get bridge fee, Returns fee of destionation chainID. @param destinationChainID Value destination chainID @return _fee */ function _getFee(uint8 destinationChainID) internal view returns (uint256) { uint256 special = _specialFee[destinationChainID]; if (special != 0) { return special; } else { return _fee; } } function getFee(uint8 destinationChainID) external view returns (uint256) { return _getFee(destinationChainID); } /** @notice Used to manually withdraw funds from ERC safes. @param handlerAddress Address of handler to withdraw from. @param newBridgeAddress Address of the updated _bridgeAddress. */ function adminUpdateBridgeAddress( address handlerAddress, address newBridgeAddress ) external onlyAdmin { IERCHandler handler = IERCHandler(handlerAddress); handler.updateBridgeAddress(newBridgeAddress); } /** @notice Used to manually withdraw funds from ERC safes. @param handlerAddress Address of handler to withdraw from. @param tokenAddress Address of token to withdraw. @param recipient Address to withdraw tokens to. @param amountOrTokenID Either the amount of ERC20 tokens or the ERC721 token ID to withdraw. */ function adminWithdraw( address handlerAddress, address tokenAddress, address recipient, uint256 amountOrTokenID ) external onlyAdmin { IERCHandler handler = IERCHandler(handlerAddress); handler.withdraw(tokenAddress, recipient, amountOrTokenID); } /** @notice Initiates a transfer using a specified handler contract. @notice Only callable when Bridge is not paused. @param destinationChainID ID of chain deposit will be bridged to. @param resourceID ResourceID used to find address of handler to be used for deposit. @param data Additional data to be passed to specified handler. @notice Emits {Deposit} event. */ function deposit(uint8 destinationChainID, bytes32 resourceID, bytes calldata data) external payable whenNotPaused { uint256 fee = _getFee(destinationChainID); require(msg.value == fee, "Incorrect fee supplied"); address handler = _resourceIDToHandlerAddress[resourceID]; require(handler != address(0), "resourceID not mapped to handler"); uint64 depositNonce = ++_depositCounts[destinationChainID]; _depositRecords[depositNonce][destinationChainID] = data; IDepositExecute depositHandler = IDepositExecute(handler); depositHandler.deposit(resourceID, destinationChainID, depositNonce, msg.sender, data); emit Deposit(destinationChainID, resourceID, depositNonce); } /** @notice Initiates a transfer using a specified handler contract. @notice Only callable when Bridge is not paused. @param destinationChainID ID of chain deposit will be bridged to. @param resourceID ResourceID used to find address of handler to be used for deposit. @param data Additional data to be passed to specified handler. @notice Emits {Deposit} event. */ function depositETH(uint8 destinationChainID, bytes32 resourceID, bytes calldata data) external payable whenNotPaused { uint256 fee = _getFee(destinationChainID); require(msg.value >= fee, "Insufficient fee supplied"); address handler = _resourceIDToHandlerAddress[resourceID]; require(handler != address(0), "resourceID not mapped to handler"); uint256 value = msg.value - fee; uint256 amount; assembly { amount := calldataload(0x84) } require (amount == value, "msg.value and data mismatched"); address wtokenAddress = IERCHandler(handler)._wtokenAddress(); require(wtokenAddress != address(0), "_wtokenAddress is 0x"); IWETH(wtokenAddress).deposit{value: value}(); IWETH(wtokenAddress).transfer(address(handler), value); uint64 depositNonce = ++_depositCounts[destinationChainID]; _depositRecords[depositNonce][destinationChainID] = data; IDepositExecute depositHandler = IDepositExecute(handler); depositHandler.deposit(resourceID, destinationChainID, depositNonce, msg.sender, data); emit Deposit(destinationChainID, resourceID, depositNonce); } /** @notice When called, {msg.sender} will be marked as voting in favor of proposal. @notice Only callable by relayers when Bridge is not paused. @param chainID ID of chain deposit originated from. @param depositNonce ID of deposited generated by origin Bridge contract. @param dataHash Hash of data provided when deposit was made. @notice Proposal must not have already been passed or executed. @notice {msg.sender} must not have already voted on proposal. @notice Emits {ProposalEvent} event with status indicating the proposal status. @notice Emits {ProposalVote} event. */ function voteProposal(uint8 chainID, uint64 depositNonce, bytes32 resourceID, bytes32 dataHash) external onlyRelayers whenNotPaused { uint72 nonceAndID = (uint72(depositNonce) << 8) | uint72(chainID); Proposal storage proposal = _proposals[nonceAndID][dataHash]; require(_resourceIDToHandlerAddress[resourceID] != address(0), "no handler for resourceID"); require(uint(proposal._status) <= 1, "proposal already passed/executed/cancelled"); require(!_hasVotedOnProposal[nonceAndID][dataHash][msg.sender], "relayer already voted"); if (uint(proposal._status) == 0) { ++_totalProposals; _proposals[nonceAndID][dataHash] = Proposal({ _resourceID : resourceID, _dataHash : dataHash, _yesVotes : new address[](1), _noVotes : new address[](0), _status : ProposalStatus.Active, _proposedBlock : block.number }); proposal._yesVotes[0] = msg.sender; emit ProposalEvent(chainID, depositNonce, ProposalStatus.Active, resourceID, dataHash); } else { if (sub(block.number, proposal._proposedBlock) > _expiry) { // if the number of blocks that has passed since this proposal was // submitted exceeds the expiry threshold set, cancel the proposal proposal._status = ProposalStatus.Cancelled; emit ProposalEvent(chainID, depositNonce, ProposalStatus.Cancelled, resourceID, dataHash); } else { require(dataHash == proposal._dataHash, "datahash mismatch"); proposal._yesVotes.push(msg.sender); } } if (proposal._status != ProposalStatus.Cancelled) { _hasVotedOnProposal[nonceAndID][dataHash][msg.sender] = true; emit ProposalVote(chainID, depositNonce, proposal._status, resourceID); // If _depositThreshold is set to 1, then auto finalize // or if _relayerThreshold has been exceeded if (_relayerThreshold <= 1 || proposal._yesVotes.length >= _relayerThreshold) { proposal._status = ProposalStatus.Passed; emit ProposalEvent(chainID, depositNonce, ProposalStatus.Passed, resourceID, dataHash); } } } /** @notice Executes a deposit proposal that is considered passed using a specified handler contract. @notice Only callable by relayers when Bridge is not paused. @param chainID ID of chain deposit originated from. @param depositNonce ID of deposited generated by origin Bridge contract. @param dataHash Hash of data originally provided when deposit was made. @notice Proposal must be past expiry threshold. @notice Emits {ProposalEvent} event with status {Cancelled}. */ function cancelProposal(uint8 chainID, uint64 depositNonce, bytes32 dataHash) public onlyAdminOrRelayer { uint72 nonceAndID = (uint72(depositNonce) << 8) | uint72(chainID); Proposal storage proposal = _proposals[nonceAndID][dataHash]; require(proposal._status != ProposalStatus.Cancelled, "Proposal already cancelled"); require(sub(block.number, proposal._proposedBlock) > _expiry, "Proposal not at expiry threshold"); proposal._status = ProposalStatus.Cancelled; emit ProposalEvent(chainID, depositNonce, ProposalStatus.Cancelled, proposal._resourceID, proposal._dataHash); } /** @notice Executes a deposit proposal that is considered passed using a specified handler contract. @notice Only callable by relayers when Bridge is not paused. @param chainID ID of chain deposit originated from. @param resourceID ResourceID to be used when making deposits. @param depositNonce ID of deposited generated by origin Bridge contract. @param data Data originally provided when deposit was made. @notice Proposal must have Passed status. @notice Hash of {data} must equal proposal's {dataHash}. @notice Emits {ProposalEvent} event with status {Executed}. */ function executeProposal(uint8 chainID, uint64 depositNonce, bytes calldata data, bytes32 resourceID) external onlyRelayers whenNotPaused { address handler = _resourceIDToHandlerAddress[resourceID]; uint72 nonceAndID = (uint72(depositNonce) << 8) | uint72(chainID); bytes32 dataHash = keccak256(abi.encodePacked(handler, data)); Proposal storage proposal = _proposals[nonceAndID][dataHash]; require(proposal._status != ProposalStatus.Inactive, "proposal is not active"); require(proposal._status == ProposalStatus.Passed, "proposal already transferred"); require(dataHash == proposal._dataHash, "data doesn't match datahash"); proposal._status = ProposalStatus.Executed; IDepositExecute depositHandler = IDepositExecute(_resourceIDToHandlerAddress[proposal._resourceID]); depositHandler.executeProposal(proposal._resourceID, data); emit ProposalEvent(chainID, depositNonce, proposal._status, proposal._resourceID, proposal._dataHash); } /** @notice Transfers eth in the contract to the specified addresses. The parameters addrs and amounts are mapped 1-1. This means that the address at index 0 for addrs will receive the amount (in WEI) from amounts at index 0. @param addrs Array of addresses to transfer {amounts} to. @param amounts Array of amonuts to transfer to {addrs}. */ function transferFunds(address payable[] calldata addrs, uint[] calldata amounts) external onlyAdmin { for (uint256 i = 0; i < addrs.length; i++) { addrs[i].transfer(amounts[i]); } } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"uint8","name":"chainID","internalType":"uint8"},{"type":"address[]","name":"initialRelayers","internalType":"address[]"},{"type":"uint256","name":"initialRelayerThreshold","internalType":"uint256"},{"type":"uint256","name":"fee","internalType":"uint256"},{"type":"uint256","name":"expiry","internalType":"uint256"}]},{"type":"event","name":"Deposit","inputs":[{"type":"uint8","name":"destinationChainID","internalType":"uint8","indexed":true},{"type":"bytes32","name":"resourceID","internalType":"bytes32","indexed":true},{"type":"uint64","name":"depositNonce","internalType":"uint64","indexed":true}],"anonymous":false},{"type":"event","name":"OperatorAdded","inputs":[{"type":"address","name":"operator","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OperatorRemoved","inputs":[{"type":"address","name":"operator","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"ProposalEvent","inputs":[{"type":"uint8","name":"originChainID","internalType":"uint8","indexed":true},{"type":"uint64","name":"depositNonce","internalType":"uint64","indexed":true},{"type":"uint8","name":"status","internalType":"enum Bridge.ProposalStatus","indexed":true},{"type":"bytes32","name":"resourceID","internalType":"bytes32","indexed":false},{"type":"bytes32","name":"dataHash","internalType":"bytes32","indexed":false}],"anonymous":false},{"type":"event","name":"ProposalVote","inputs":[{"type":"uint8","name":"originChainID","internalType":"uint8","indexed":true},{"type":"uint64","name":"depositNonce","internalType":"uint64","indexed":true},{"type":"uint8","name":"status","internalType":"enum Bridge.ProposalStatus","indexed":true},{"type":"bytes32","name":"resourceID","internalType":"bytes32","indexed":false}],"anonymous":false},{"type":"event","name":"RelayerAdded","inputs":[{"type":"address","name":"relayer","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RelayerRemoved","inputs":[{"type":"address","name":"relayer","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RelayerThresholdChanged","inputs":[{"type":"uint256","name":"newThreshold","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"OPERATOR_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"RELAYER_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"_chainID","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint64","name":"","internalType":"uint64"}],"name":"_depositCounts","inputs":[{"type":"uint8","name":"","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"_depositRecords","inputs":[{"type":"uint64","name":"","internalType":"uint64"},{"type":"uint8","name":"","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_expiry","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_fee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"_hasVotedOnProposal","inputs":[{"type":"uint72","name":"","internalType":"uint72"},{"type":"bytes32","name":"","internalType":"bytes32"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"_resourceID","internalType":"bytes32"},{"type":"bytes32","name":"_dataHash","internalType":"bytes32"},{"type":"uint8","name":"_status","internalType":"enum Bridge.ProposalStatus"},{"type":"uint256","name":"_proposedBlock","internalType":"uint256"}],"name":"_proposals","inputs":[{"type":"uint72","name":"","internalType":"uint72"},{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_relayerThreshold","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"_resourceIDToHandlerAddress","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_specialFee","inputs":[{"type":"uint8","name":"","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_totalOperators","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_totalProposals","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_totalRelayers","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"_wtokenAddress","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminAddOperator","inputs":[{"type":"address","name":"operatorAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminAddRelayer","inputs":[{"type":"address","name":"relayerAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminChangeFee","inputs":[{"type":"uint256","name":"newFee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminChangeRelayerThreshold","inputs":[{"type":"uint256","name":"newThreshold","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminChangeSpecialFee","inputs":[{"type":"uint256","name":"newFee","internalType":"uint256"},{"type":"uint8","name":"chainID","internalType":"uint8"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminPauseTransfers","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminRemoveOperator","inputs":[{"type":"address","name":"operatorAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminRemoveRelayer","inputs":[{"type":"address","name":"relayerAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminSetBurnable","inputs":[{"type":"address","name":"handlerAddress","internalType":"address"},{"type":"address","name":"tokenAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminSetGenericResource","inputs":[{"type":"address","name":"handlerAddress","internalType":"address"},{"type":"bytes32","name":"resourceID","internalType":"bytes32"},{"type":"address","name":"contractAddress","internalType":"address"},{"type":"bytes4","name":"depositFunctionSig","internalType":"bytes4"},{"type":"uint256","name":"depositFunctionDepositerOffset","internalType":"uint256"},{"type":"bytes4","name":"executeFunctionSig","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminSetResource","inputs":[{"type":"address","name":"handlerAddress","internalType":"address"},{"type":"bytes32","name":"resourceID","internalType":"bytes32"},{"type":"address","name":"tokenAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminUnpauseTransfers","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminUpdateBridgeAddress","inputs":[{"type":"address","name":"handlerAddress","internalType":"address"},{"type":"address","name":"newBridgeAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminWithdraw","inputs":[{"type":"address","name":"handlerAddress","internalType":"address"},{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amountOrTokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cancelProposal","inputs":[{"type":"uint8","name":"chainID","internalType":"uint8"},{"type":"uint64","name":"depositNonce","internalType":"uint64"},{"type":"bytes32","name":"dataHash","internalType":"bytes32"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"deposit","inputs":[{"type":"uint8","name":"destinationChainID","internalType":"uint8"},{"type":"bytes32","name":"resourceID","internalType":"bytes32"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"depositETH","inputs":[{"type":"uint8","name":"destinationChainID","internalType":"uint8"},{"type":"bytes32","name":"resourceID","internalType":"bytes32"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"executeProposal","inputs":[{"type":"uint8","name":"chainID","internalType":"uint8"},{"type":"uint64","name":"depositNonce","internalType":"uint64"},{"type":"bytes","name":"data","internalType":"bytes"},{"type":"bytes32","name":"resourceID","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getFee","inputs":[{"type":"uint8","name":"destinationChainID","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct Bridge.Proposal","components":[{"type":"bytes32","name":"_resourceID","internalType":"bytes32"},{"type":"bytes32","name":"_dataHash","internalType":"bytes32"},{"type":"address[]","name":"_yesVotes","internalType":"address[]"},{"type":"address[]","name":"_noVotes","internalType":"address[]"},{"type":"uint8","name":"_status","internalType":"enum Bridge.ProposalStatus"},{"type":"uint256","name":"_proposedBlock","internalType":"uint256"}]}],"name":"getProposal","inputs":[{"type":"uint8","name":"originChainID","internalType":"uint8"},{"type":"uint64","name":"depositNonce","internalType":"uint64"},{"type":"bytes32","name":"dataHash","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getRoleMember","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getRoleMemberCount","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isOperator","inputs":[{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isRelayer","inputs":[{"type":"address","name":"relayer","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceAdmin","inputs":[{"type":"address","name":"newAdmin","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferFunds","inputs":[{"type":"address[]","name":"addrs","internalType":"address payable[]"},{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"voteProposal","inputs":[{"type":"uint8","name":"chainID","internalType":"uint8"},{"type":"uint64","name":"depositNonce","internalType":"uint64"},{"type":"bytes32","name":"resourceID","internalType":"bytes32"},{"type":"bytes32","name":"dataHash","internalType":"bytes32"}]}]
Deployed ByteCode
0x6080604052600436106102c95760003560e01c806380ae1c2811610175578063beab7131116100dc578063d547741f11610095578063f5b541a61161006f578063f5b541a614610871578063f69bd04414610886578063febce92c1461089b578063ffaac0eb146108bb576102c9565b8063d547741f14610829578063d7a9cd7914610849578063f179637c1461085e576102c9565b8063beab71311461077d578063c5b37c221461079f578063c5ec8970146107b4578063ca15c873146107c9578063cb10f215146107e9578063cdb0f73a14610809576102c9565b8063926d7d7f1161012e578063926d7d7f146106d157806395b15e98146106e65780639d5773e0146107065780639d82dd631461071b578063a217fddf1461073b578063a9cf69fa14610750576102c9565b806380ae1c281461061c57806384db809f146106315780638c0c2631146106515780639010d07c1461067157806391c404ac1461069157806391d14854146106b1576102c9565b80634b0b919d116102345780635c975abb116101ed5780636d70f7ae116101c75780636d70f7ae146105a7578063780cf004146105c75780637febe63f146105e7578063802aabe814610607576102c9565b80635c975abb146105525780635e1fab0f1461056757806369a8c24614610587576102c9565b80634b0b919d146104665780634e0560051461049357806350598719146104b357806353ec4105146104e3578063541d5548146105055780635a1ad87c14610532576102c9565b80632f2ff15d116102865780632f2ff15d14610399578063320b9006146103b957806336568abe146103d95780633ee7094a146103f95780634454b20d146104265780634603ae3814610446576102c9565b806305e2ca17146102ce578063083132c4146102e357806317f03ce5146103195780631a5ae9ad146103395780631ff013f114610359578063248a9ca314610379575b600080fd5b6102e16102dc3660046128e9565b6108d0565b005b3480156102ef57600080fd5b506103036102fe3660046128ce565b610a49565b6040516103109190612b9a565b60405180910390f35b34801561032557600080fd5b506102e1610334366004612935565b610a5c565b34801561034557600080fd5b506103036103543660046128ce565b610b4f565b34801561036557600080fd5b506102e1610374366004612972565b610b61565b34801561038557600080fd5b506103036103943660046127ca565b610f73565b3480156103a557600080fd5b506102e16103b43660046127e2565b610f88565b3480156103c557600080fd5b506102e16103d43660046125cb565b610fd0565b3480156103e557600080fd5b506102e16103f43660046127e2565b61106f565b34801561040557600080fd5b50610419610414366004612850565b6110b1565b6040516103109190612c99565b34801561043257600080fd5b506102e16104413660046129c1565b611155565b34801561045257600080fd5b506102e1610461366004612742565b61134d565b34801561047257600080fd5b506104866104813660046128ce565b6113db565b60405161031091906133c7565b34801561049f57600080fd5b506102e16104ae3660046127ca565b6113f6565b3480156104bf57600080fd5b506104d36104ce366004612884565b611431565b6040516103109493929190612bfe565b3480156104ef57600080fd5b506104f8611469565b6040516103109190612b3e565b34801561051157600080fd5b506105256105203660046125cb565b611478565b6040516103109190612b8f565b34801561053e57600080fd5b506102e161054d3660046126d3565b611497565b34801561055e57600080fd5b50610525611531565b34801561057357600080fd5b506102e16105823660046125cb565b61153b565b34801561059357600080fd5b506102e16105a2366004612827565b61155c565b3480156105b357600080fd5b506105256105c23660046125cb565b6115ac565b3480156105d357600080fd5b506102e16105e2366004612642565b6115bd565b3480156105f357600080fd5b506105256106023660046128af565b611630565b34801561061357600080fd5b50610303611656565b34801561062857600080fd5b506102e161165c565b34801561063d57600080fd5b506104f861064c3660046127ca565b61166e565b34801561065d57600080fd5b506102e161066c36600461260a565b611689565b34801561067d57600080fd5b506104f861068c366004612806565b6116f6565b34801561069d57600080fd5b506102e16106ac3660046127ca565b61171d565b3480156106bd57600080fd5b506105256106cc3660046127e2565b61174c565b3480156106dd57600080fd5b5061030361176a565b3480156106f257600080fd5b506102e161070136600461260a565b611781565b34801561071257600080fd5b506103036117b7565b34801561072757600080fd5b506102e16107363660046125cb565b6117bd565b34801561074757600080fd5b50610303611840565b34801561075c57600080fd5b5061077061076b366004612935565b611845565b604051610310919061334e565b34801561078957600080fd5b50610792611996565b60405161031091906133db565b3480156107ab57600080fd5b5061030361199f565b3480156107c057600080fd5b506103036119a5565b3480156107d557600080fd5b506103036107e43660046127ca565b6119ab565b3480156107f557600080fd5b506102e1610804366004612692565b6119c2565b34801561081557600080fd5b506102e16108243660046125cb565b611a53565b34801561083557600080fd5b506102e16108443660046127e2565b611ae4565b34801561085557600080fd5b50610303611b1e565b6102e161086c3660046128e9565b611b24565b34801561087d57600080fd5b50610303611e33565b34801561089257600080fd5b50610303611e3f565b3480156108a757600080fd5b506102e16108b63660046125cb565b611e45565b3480156108c757600080fd5b506102e1611ec8565b6108d8611ed8565b60006108e385611efb565b905080341461090d5760405162461bcd60e51b815260040161090490612ea6565b60405180910390fd5b6000848152600c60205260409020546001600160a01b0316806109425760405162461bcd60e51b815260040161090490612f7b565b60ff86166000818152600a6020908152604080832080546001600160401b0380821660010190811667ffffffffffffffff1990921682179092558452600d83528184209484529390915290206109999086866123c7565b506040516338995da960e01b815282906001600160a01b038216906338995da9906109d2908a908c90879033908d908d90600401612c4a565b600060405180830381600087803b1580156109ec57600080fd5b505af1158015610a00573d6000803e3d6000fd5b50505050816001600160401b0316878960ff167fdbb69440df8433824a026ef190652f29929eb64b4d1d5d2a69be8afe3e6eaed860405160405180910390a45050505050505050565b6000610a5482611efb565b90505b919050565b610a64611f25565b68ffffffffffffffff00600883901b1660ff8416176001600160481b0381166000908152600e6020908152604080832085845290915290206004808083015460ff1690811115610ab057fe5b1415610ace5760405162461bcd60e51b815260040161090490612f0d565b600854610adf438360050154611f6f565b11610afc5760405162461bcd60e51b815260040161090490613000565b6004818101805460ff191682179055815460018301546040516001600160401b0388169260ff8a169260008051602061343483398151915292610b40929190612bf0565b60405180910390a45050505050565b600b6020526000908152604090205481565b610b69611fb1565b610b71611ed8565b68ffffffffffffffff00600884901b1660ff8516176001600160481b0381166000908152600e602090815260408083208584528252808320868452600c909252909120546001600160a01b0316610bda5760405162461bcd60e51b8152600401610904906132c8565b60048082015460019160ff90911690811115610bf257fe5b1115610c105760405162461bcd60e51b81526004016109049061317b565b6001600160481b0382166000908152600f60209081526040808320868452825280832033845290915290205460ff1615610c5c5760405162461bcd60e51b815260040161090490612e12565b60048082015460ff1690811115610c6f57fe5b610de7576006805460019081019091556040805160c0810182528681526020810186905281518381528083018352909291830191816020016020820280368337505050815260408051600080825260208083018452808501929092526001838501819052436060909501949094526001600160481b0387168152600e82528281208882528252829020845181558482015193810193909355908301518051610d1d9260028501920190612445565b5060608201518051610d39916003840191602090910190612445565b5060808201518160040160006101000a81548160ff02191690836004811115610d5e57fe5b021790555060a082015181600501559050503381600201600081548110610d8157fe5b600091825260209091200180546001600160a01b0319166001600160a01b039290921691909117905560015b856001600160401b03168760ff166000805160206134348339815191528787604051610dda929190612bf0565b60405180910390a4610e5d565b600854610df8438360050154611f6f565b1115610e12576004818101805460ff191682179055610dad565b80600101548314610e355760405162461bcd60e51b81526004016109049061329d565b600281018054600181018255600091825260209091200180546001600160a01b031916331790555b60048181015460ff1681811115610e7057fe5b14610f6b576001600160481b0382166000908152600f6020908152604080832086845282528083203384529091529020805460ff1916600117905560048082015460ff1690811115610ebe57fe5b856001600160401b03168760ff167f25f8daaa4635a7729927ba3f5b3d59cc3320aca7c32c9db4e7ca7b957434364087604051610efb9190612b9a565b60405180910390a46001600354111580610f1b5750600354600282015410155b15610f6b5760048101805460ff191660029081179091556040516001600160401b0387169060ff89169060008051602061343483398151915290610f629089908990612bf0565b60405180910390a45b505050505050565b60009081526001602052604090206002015490565b600082815260016020526040902060020154610fa6906106cc611fdc565b610fc25760405162461bcd60e51b815260040161090490612dc3565b610fcc8282611fe0565b5050565b610fd861204f565b610ff5604051610fe790612b0d565b60405180910390208261174c565b6110115760405162461bcd60e51b815260040161090490613268565b61102e60405161102090612b0d565b604051809103902082611ae4565b6040516001600160a01b038216907f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d90600090a25060058054600019019055565b611077611fdc565b6001600160a01b0316816001600160a01b0316146110a75760405162461bcd60e51b8152600401610904906132ff565b610fcc8282612076565b600d6020908152600092835260408084208252918352918190208054825160026001831615610100026000190190921691909104601f81018590048502820185019093528281529290919083018282801561114d5780601f106111225761010080835404028352916020019161114d565b820191906000526020600020905b81548152906001019060200180831161113057829003601f168201915b505050505081565b61115d611fb1565b611165611ed8565b6000818152600c602090815260408083205490516001600160a01b039091169268ffffffffffffffff00600889901b1660ff8a16179290916111ad9185918991899101612ae1565b60408051601f1981840301815291815281516020928301206001600160481b0385166000908152600e84528281208282529093529082209092509060048083015460ff16908111156111fb57fe5b14156112195760405162461bcd60e51b815260040161090490612ce3565b600260048083015460ff169081111561122e57fe5b1461124b5760405162461bcd60e51b815260040161090490612cac565b8060010154821461126e5760405162461bcd60e51b815260040161090490612ed6565b6004818101805460ff1916600317905581546000818152600c60205260409081902054905163712467f960e11b81526001600160a01b0390911692839263e248cff2926112bf928d918d9101612c27565b600060405180830381600087803b1580156112d957600080fd5b505af11580156112ed573d6000803e3d6000fd5b50505060048084015460ff16915081111561130457fe5b896001600160401b03168b60ff1660008051602061343483398151915285600001548660010154604051611339929190612bf0565b60405180910390a450505050505050505050565b61135561204f565b60005b838110156113d45784848281811061136c57fe5b905060200201602081019061138191906125cb565b6001600160a01b03166108fc84848481811061139957fe5b905060200201359081150290604051600060405180830381858888f193505050501580156113cb573d6000803e3d6000fd5b50600101611358565b5050505050565b600a602052600090815260409020546001600160401b031681565b6113fe61204f565b600381905560405181907fa20d6b84cd798a24038be305eff8a45ca82ef54a2aa2082005d8e14c0a4746c890600090a250565b600e60209081526000928352604080842090915290825290208054600182015460048301546005909301549192909160ff9091169084565b6009546001600160a01b031681565b6000610a5460405161148990612b26565b60405180910390208361174c565b61149f61204f565b6000858152600c60205260409081902080546001600160a01b0319166001600160a01b038916908117909155905163de319d9960e01b815287919063de319d99906114f69089908990899089908990600401612bba565b600060405180830381600087803b15801561151057600080fd5b505af1158015611524573d6000803e3d6000fd5b5050505050505050505050565b60005460ff165b90565b61154361204f565b61154e600082610f88565b61155960003361106f565b50565b6115646120e5565b60ff81166000908152600b6020526040902054828114156115975760405162461bcd60e51b8152600401610904906130c4565b5060ff166000908152600b6020526040902055565b6000610a5460405161148990612b0d565b6115c561204f565b604051636ce5768960e11b815284906001600160a01b0382169063d9caed12906115f790879087908790600401612b52565b600060405180830381600087803b15801561161157600080fd5b505af1158015611625573d6000803e3d6000fd5b505050505050505050565b600f60209081526000938452604080852082529284528284209052825290205460ff1681565b60045481565b6116646120e5565b61166c612121565b565b600c602052600090815260409020546001600160a01b031681565b61169161204f565b6040516307b7ed9960e01b815282906001600160a01b038216906307b7ed99906116bf908590600401612b3e565b600060405180830381600087803b1580156116d957600080fd5b505af11580156116ed573d6000803e3d6000fd5b50505050505050565b6000828152600160205260408120611714908363ffffffff61217016565b90505b92915050565b61172561204f565b8060075414156117475760405162461bcd60e51b815260040161090490613231565b600755565b6000828152600160205260408120611714908363ffffffff61217c16565b60405161177690612b26565b604051809103902081565b61178961204f565b60405163645c8a4b60e01b815282906001600160a01b0382169063645c8a4b906116bf908590600401612b3e565b60065481565b6117c561204f565b6117d4604051610fe790612b26565b6117f05760405162461bcd60e51b815260040161090490612e6f565b6117ff60405161102090612b26565b6040516001600160a01b038216907f10e1f7ce9fd7d1b90a66d13a2ab3cb8dd7f29f3f8d520b143b063ccfbab6906b90600090a25060048054600019019055565b600081565b61184d6124a6565b68ffffffffffffffff00600884901b1660ff8516176001600160481b0381166000908152600e60209081526040808320868452825291829020825160c08101845281548152600182015481840152600282018054855181860281018601875281815292959394938601938301828280156118f057602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116118d2575b505050505081526020016003820180548060200260200160405190810160405280929190818152602001828054801561195257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611934575b505050918352505060048281015460209092019160ff169081111561197357fe5b600481111561197e57fe5b81526020016005820154815250509150509392505050565b60025460ff1681565b60075481565b60085481565b6000818152600160205260408120610a5490612191565b6119ca61204f565b6000828152600c60205260409081902080546001600160a01b0319166001600160a01b0386169081179091559051635c7d1b9b60e11b815284919063b8fa373690611a1b9086908690600401612ba3565b600060405180830381600087803b158015611a3557600080fd5b505af1158015611a49573d6000803e3d6000fd5b5050505050505050565b611a5b61204f565b611a6a604051610fe790612b26565b15611a875760405162461bcd60e51b81526004016109049061308d565b611aa4604051611a9690612b26565b604051809103902082610f88565b6040516001600160a01b038216907f03580ee9f53a62b7cb409a2cb56f9be87747dd15017afc5cef6eef321e4fb2c590600090a250600480546001019055565b600082815260016020526040902060020154611b02906106cc611fdc565b6110a75760405162461bcd60e51b815260040161090490612fb0565b60035481565b611b2c611ed8565b6000611b3785611efb565b905080341015611b595760405162461bcd60e51b815260040161090490613144565b6000848152600c60205260409020546001600160a01b031680611b8e5760405162461bcd60e51b815260040161090490612f7b565b34829003608435808214611bb45760405162461bcd60e51b815260040161090490612d55565b6000836001600160a01b03166353ec41056040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611bf157600080fd5b505af1158015611c05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2991906125ee565b90506001600160a01b038116611c515760405162461bcd60e51b81526004016109049061305f565b806001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b158015611c8c57600080fd5b505af1158015611ca0573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b038516935063a9059cbb9250611cd3915087908790600401612b76565b602060405180830381600087803b158015611ced57600080fd5b505af1158015611d01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d2591906127aa565b5060ff89166000818152600a6020908152604080832080546001600160401b0380821660010190811667ffffffffffffffff1990921682179092558452600d8352818420948452939091529020611d7d9089896123c7565b506000859050806001600160a01b03166338995da98b8d85338e8e6040518763ffffffff1660e01b8152600401611db996959493929190612c4a565b600060405180830381600087803b158015611dd357600080fd5b505af1158015611de7573d6000803e3d6000fd5b50505050816001600160401b03168a8c60ff167fdbb69440df8433824a026ef190652f29929eb64b4d1d5d2a69be8afe3e6eaed860405160405180910390a45050505050505050505050565b60405161177690612b0d565b60055481565b611e4d61204f565b611e5c604051610fe790612b0d565b15611e795760405162461bcd60e51b81526004016109049061310d565b611e88604051611a9690612b0d565b6040516001600160a01b038216907fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d90600090a250600580546001019055565b611ed06120e5565b61166c61219c565b60005460ff161561166c5760405162461bcd60e51b815260040161090490613035565b60ff81166000908152600b60205260408120548015611f1b579050610a57565b5050600754610a57565b611f3060003361174c565b80611f535750611f53604051611f4590612b26565b60405180910390203361174c565b61166c5760405162461bcd60e51b815260040161090490612d8c565b600061171483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121de565b611fc0604051611f4590612b26565b61166c5760405162461bcd60e51b8152600401610904906131c5565b3390565b6000828152600160205260409020611ffe908263ffffffff61220a16565b15610fcc5761200b611fdc565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61205a60003361174c565b61166c5760405162461bcd60e51b8152600401610904906131fa565b6000828152600160205260409020612094908263ffffffff61221f16565b15610fcc576120a1611fdc565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6120f060003361174c565b806121055750612105604051611f4590612b0d565b61166c5760405162461bcd60e51b815260040161090490612f44565b612129611ed8565b6000805460ff191660011790556040517f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890612166903390612b3e565b60405180910390a1565b60006117148383612234565b6000611714836001600160a01b038416612279565b6000610a5482612291565b6121a4612295565b6000805460ff191690556040517f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90612166903390612b3e565b600081848411156122025760405162461bcd60e51b81526004016109049190612c99565b505050900390565b6000611714836001600160a01b0384166122b7565b6000611714836001600160a01b038416612301565b815460009082106122575760405162461bcd60e51b815260040161090490612d13565b82600001828154811061226657fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b60005460ff1661166c5760405162461bcd60e51b815260040161090490612e41565b60006122c38383612279565b6122f957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611717565b506000611717565b600081815260018301602052604081205480156123bd578354600019808301919081019060009087908390811061233457fe5b906000526020600020015490508087600001848154811061235157fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061238157fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611717565b6000915050611717565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106124085782800160ff19823516178555612435565b82800160010185558215612435579182015b8281111561243557823582559160200191906001019061241a565b506124419291506124de565b5090565b82805482825590600052602060002090810192821561249a579160200282015b8281111561249a57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612465565b506124419291506124f8565b6040805160c0810182526000808252602082018190526060928201839052828201929092529060808201908152602001600081525090565b61153891905b8082111561244157600081556001016124e4565b61153891905b808211156124415780546001600160a01b03191681556001016124fe565b60008083601f84011261252d578182fd5b5081356001600160401b03811115612543578182fd5b602083019150836020808302850101111561255d57600080fd5b9250929050565b60008083601f840112612575578182fd5b5081356001600160401b0381111561258b578182fd5b60208301915083602082850101111561255d57600080fd5b80356001600160401b038116811461171757600080fd5b803560ff8116811461171757600080fd5b6000602082840312156125dc578081fd5b81356125e7816133f3565b9392505050565b6000602082840312156125ff578081fd5b81516125e7816133f3565b6000806040838503121561261c578081fd5b8235612627816133f3565b91506020830135612637816133f3565b809150509250929050565b60008060008060808587031215612657578182fd5b8435612662816133f3565b93506020850135612672816133f3565b92506040850135612682816133f3565b9396929550929360600135925050565b6000806000606084860312156126a6578283fd5b83356126b1816133f3565b92506020840135915060408401356126c8816133f3565b809150509250925092565b60008060008060008060c087890312156126eb578182fd5b86356126f6816133f3565b955060208701359450604087013561270d816133f3565b9350606087013561271d81613408565b92506080870135915060a087013561273481613408565b809150509295509295509295565b60008060008060408587031215612757578384fd5b84356001600160401b038082111561276d578586fd5b6127798883890161251c565b90965094506020870135915080821115612791578384fd5b5061279e8782880161251c565b95989497509550505050565b6000602082840312156127bb578081fd5b815180151581146125e7578182fd5b6000602082840312156127db578081fd5b5035919050565b600080604083850312156127f4578182fd5b823591506020830135612637816133f3565b60008060408385031215612818578182fd5b50508035926020909101359150565b60008060408385031215612839578182fd5b82359150602083013560ff81168114612637578182fd5b60008060408385031215612862578182fd5b61286c84846125a3565b915061287b84602085016125ba565b90509250929050565b60008060408385031215612896578182fd5b82356128a18161341e565b946020939093013593505050565b6000806000606084860312156128c3578081fd5b83356126b18161341e565b6000602082840312156128df578081fd5b61171483836125ba565b600080600080606085870312156128fe578182fd5b61290886866125ba565b93506020850135925060408501356001600160401b03811115612929578283fd5b61279e87828801612564565b600080600060608486031215612949578081fd5b61295385856125ba565b925061296285602086016125a3565b9150604084013590509250925092565b60008060008060808587031215612987578182fd5b61299186866125ba565b935060208501356001600160401b03811681146129ac578283fd5b93969395505050506040820135916060013590565b6000806000806000608086880312156129d8578283fd5b6129e287876125ba565b94506129f187602088016125a3565b935060408601356001600160401b03811115612a0b578384fd5b612a1788828901612564565b96999598509660600135949350505050565b6000815180845260208085019450808401835b83811015612a615781516001600160a01b031687529582019590820190600101612a3c565b509495945050505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b60008151808452815b81811015612abb57602081850181015186830182015201612a9f565b81811115612acc5782602083870101525b50601f01601f19169290920160200192915050565b60006bffffffffffffffffffffffff198560601b16825282846014840137910160140190815292915050565b6c4f50455241544f525f524f4c4560981b8152600d0190565b6b52454c415945525f524f4c4560a01b8152600c0190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b9182526001600160a01b0316602082015260400190565b9485526001600160a01b039390931660208501526001600160e01b03199182166040850152606084015216608082015260a00190565b918252602082015260400190565b8481526020810184905260808101612c15846133e9565b60408201939093526060015292915050565b600084825260406020830152612c41604083018486612a6c565b95945050505050565b86815260ff861660208201526001600160401b03851660408201526001600160a01b038416606082015260a060808201819052600090612c8d9083018486612a6c565b98975050505050505050565b6000602082526117146020830184612a96565b6020808252601c908201527f70726f706f73616c20616c7265616479207472616e7366657272656400000000604082015260600190565b60208082526016908201527570726f706f73616c206973206e6f742061637469766560501b604082015260600190565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b6020808252601d908201527f6d73672e76616c756520616e642064617461206d69736d617463686564000000604082015260600190565b6020808252601e908201527f73656e646572206973206e6f742072656c61796572206f722061646d696e0000604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526e0818591b5a5b881d1bc819dc985b9d608a1b606082015260800190565b6020808252601590820152741c995b185e595c88185b1c9958591e481d9bdd1959605a1b604082015260600190565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b6020808252601f908201527f6164647220646f65736e277420686176652072656c6179657220726f6c652100604082015260600190565b602080825260169082015275125b98dbdc9c9958dd08199959481cdd5c1c1b1a595960521b604082015260600190565b6020808252601b908201527f6461746120646f65736e2774206d617463682064617461686173680000000000604082015260600190565b6020808252601a908201527f50726f706f73616c20616c72656164792063616e63656c6c6564000000000000604082015260600190565b6020808252601f908201527f73656e646572206973206e6f74206f70657261746f72206f722061646d696e00604082015260600190565b6020808252818101527f7265736f757263654944206e6f74206d617070656420746f2068616e646c6572604082015260600190565b60208082526030908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526f2061646d696e20746f207265766f6b6560801b606082015260800190565b6020808252818101527f50726f706f73616c206e6f7420617420657870697279207468726573686f6c64604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601490820152730beeee8ded6cadc82c8c8e4cae6e640d2e64060f60631b604082015260600190565b6020808252601e908201527f6164647220616c7265616479206861732072656c6179657220726f6c65210000604082015260600190565b60208082526029908201527f43757272656e74207370656369616c2066656520657175616c7320746f20746860408201526865206e65772066656560b81b606082015260800190565b6020808252601f908201527f6164647220616c726561647920686173206f70657261746f7220726f6c652100604082015260600190565b60208082526019908201527f496e73756666696369656e742066656520737570706c69656400000000000000604082015260600190565b6020808252602a908201527f70726f706f73616c20616c7265616479207061737365642f65786563757465646040820152690bd8d85b98d95b1b195960b21b606082015260800190565b6020808252818101527f73656e64657220646f65736e277420686176652072656c6179657220726f6c65604082015260600190565b6020808252601e908201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604082015260600190565b6020808252601f908201527f43757272656e742066656520697320657175616c20746f206e65772066656500604082015260600190565b6020808252818101527f6164647220646f65736e27742068617665206f70657261746f7220726f6c6521604082015260600190565b6020808252601190820152700c8c2e8c2d0c2e6d040dad2e6dac2e8c6d607b1b604082015260600190565b60208082526019908201527f6e6f2068616e646c657220666f72207265736f75726365494400000000000000604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b6000602082528251602083015260208301516040830152604083015160c0606084015261337e60e0840182612a29565b6060850151848203601f19016080860152915061339b8183612a29565b608086015192506133ab836133e9565b8260a086015260a086015160c086015280935050505092915050565b6001600160401b0391909116815260200190565b60ff91909116815260200190565b6005811061155957fe5b6001600160a01b038116811461155957600080fd5b6001600160e01b03198116811461155957600080fd5b6001600160481b038116811461155957600080fdfe803c5a12f6bde629cea32e63d4b92d1b560816a6fb72e939d3c89e1cab650417a264697066735822122011f6db6412485588a89608bb255e26930e7743ea1c504450c5bc5137631a6e8964736f6c63430006040033