This contract has been partially verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- Bridge
- Optimization enabled
- true
- Compiler version
- v0.6.4+commit.1dca32f3
- Optimization runs
- 200
- EVM Version
- istanbul
- Verified at
- 2023-03-31T15:01:17.173186Z
/Users/denis/_/_Workspace2/safe-bridge-contract/contracts/Bridge.sol
pragma solidity 0.6.4;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/access/AccessControl.sol";
import "./utils/Pausable.sol";
import "./utils/SafeMath.sol";
import "./interfaces/IDepositExecute.sol";
import "./interfaces/IBridge.sol";
import "./interfaces/IERCHandler.sol";
import "./interfaces/IGenericHandler.sol";
/**
@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 _totalProposals;
uint256 public _fee;
uint256 public _expiry;
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;
// 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(uint indexed newThreshold);
event RelayerAdded(address indexed relayer);
event RelayerRemoved(address indexed relayer);
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");
modifier onlyAdmin() {
_onlyAdmin();
_;
}
modifier onlyAdminOrRelayer() {
_onlyAdminOrRelayer();
_;
}
modifier onlyRelayers() {
_onlyRelayers();
_;
}
function _onlyAdminOrRelayer() private {
require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender) || hasRole(RELAYER_ROLE, msg.sender),
"sender is not relayer 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");
}
/**
@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, uint 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);
for (uint 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 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 onlyAdmin {
_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 onlyAdmin {
_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(uint 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 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,
bytes4 executeFunctionSig
) external onlyAdmin {
_resourceIDToHandlerAddress[resourceID] = handlerAddress;
IGenericHandler handler = IGenericHandler(handlerAddress);
handler.setResource(resourceID, contractAddress, depositFunctionSig, 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(uint newFee) external onlyAdmin {
require(_fee != newFee, "Current fee is equal to new fee");
_fee = newFee;
}
/**
@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 {
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 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 (uint i = 0; i < addrs.length; i++) {
addrs[i].transfer(amounts[i]);
}
}
}
/_openzeppelin/contracts/utils/EnumerableSet.sol
pragma solidity ^0.6.0;
/**
* @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));
}
}
/_openzeppelin/contracts/utils/Address.sol
pragma solidity ^0.6.2;
/**
* @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");
}
}
/_openzeppelin/contracts/access/AccessControl.sol
pragma solidity ^0.6.0;
import "../utils/EnumerableSet.sol";
import "../utils/Address.sol";
import "../GSN/Context.sol";
/**
* @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());
}
}
}
/_openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.6.0;
/*
* @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;
}
}
/Users/denis/_/_Workspace2/safe-bridge-contract/contracts/utils/SafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @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;
}
}
/Users/denis/_/_Workspace2/safe-bridge-contract/contracts/utils/Pausable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @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);
}
}
/Users/denis/_/_Workspace2/safe-bridge-contract/contracts/interfaces/IGenericHandler.sol
pragma solidity 0.6.4;
/**
@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 executeFunctionSig Function signature of method to be called in {contractAddress} when a deposit is executed.
*/
function setResource(bytes32 resourceID, address contractAddress, bytes4 depositFunctionSig, bytes4 executeFunctionSig) external;
}
/Users/denis/_/_Workspace2/safe-bridge-contract/contracts/interfaces/IERCHandler.sol
pragma solidity 0.6.4;
/**
@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;
}
/Users/denis/_/_Workspace2/safe-bridge-contract/contracts/interfaces/IDepositExecute.sol
pragma solidity 0.6.4;
/**
@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;
}
/Users/denis/_/_Workspace2/safe-bridge-contract/contracts/interfaces/IBridge.sol
pragma solidity 0.6.4;
/**
@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);
}
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":"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":"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":"_totalProposals","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_totalRelayers","inputs":[]},{"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":"adminPauseTransfers","inputs":[]},{"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":"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":"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":"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":"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":"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
0x6080604052600436106102305760003560e01c806384db809f1161012e578063beab7131116100ab578063cdb0f73a1161006f578063cdb0f73a1461067b578063d547741f1461069b578063d7a9cd79146106bb578063e8437ee7146106d0578063ffaac0eb146106f057610230565b8063beab7131146105ef578063c5b37c2214610611578063c5ec897014610626578063ca15c8731461063b578063cb10f2151461065b57610230565b8063926d7d7f116100f2578063926d7d7f146105635780639d5773e0146105785780639d82dd631461058d578063a217fddf146105ad578063a9cf69fa146105c257610230565b806384db809f146104b65780638c0c2631146104e35780639010d07c1461050357806391c404ac1461052357806391d148541461054357610230565b80634b0b919d116101bc5780635e1fab0f116101805780635e1fab0f1461042c578063780cf0041461044c5780637febe63f1461046c578063802aabe81461048c57806380ae1c28146104a157610230565b80634b0b919d1461036d5780634e0560051461039a57806350598719146103ba578063541d5548146103ea5780635c975abb1461041757610230565b80632f2ff15d116102035780632f2ff15d146102c057806336568abe146102e05780633ee7094a146103005780634454b20d1461032d5780634603ae381461034d57610230565b806305e2ca171461023557806317f03ce51461024a5780631ff013f11461026a578063248a9ca31461028a575b600080fd5b610248610243366004612147565b610705565b005b34801561025657600080fd5b50610248610265366004612193565b610872565b34801561027657600080fd5b506102486102853660046121d0565b610965565b34801561029657600080fd5b506102aa6102a5366004612051565b610d77565b6040516102b791906123c6565b60405180910390f35b3480156102cc57600080fd5b506102486102db366004612069565b610d8c565b3480156102ec57600080fd5b506102486102fb366004612069565b610dd4565b34801561030c57600080fd5b5061032061031b3660046120ae565b610e16565b6040516102b791906124c1565b34801561033957600080fd5b5061024861034836600461221f565b610eba565b34801561035957600080fd5b50610248610368366004611fe9565b6110b2565b34801561037957600080fd5b5061038d61038836600461212c565b611140565b6040516102b79190612a68565b3480156103a657600080fd5b506102486103b5366004612051565b61115b565b3480156103c657600080fd5b506103da6103d53660046120e2565b611196565b6040516102b79493929190612425565b3480156103f657600080fd5b5061040a610405366004611e9d565b6111ce565b6040516102b791906123bb565b34801561042357600080fd5b5061040a6111f3565b34801561043857600080fd5b50610248610447366004611e9d565b6111fd565b34801561045857600080fd5b50610248610467366004611ef1565b61121e565b34801561047857600080fd5b5061040a61048736600461210d565b611291565b34801561049857600080fd5b506102aa6112b7565b3480156104ad57600080fd5b506102486112bd565b3480156104c257600080fd5b506104d66104d1366004612051565b6112cf565b6040516102b79190612383565b3480156104ef57600080fd5b506102486104fe366004611eb9565b6112ea565b34801561050f57600080fd5b506104d661051e36600461208d565b611357565b34801561052f57600080fd5b5061024861053e366004612051565b61137c565b34801561054f57600080fd5b5061040a61055e366004612069565b6113ab565b34801561056f57600080fd5b506102aa6113c9565b34801561058457600080fd5b506102aa6113e0565b34801561059957600080fd5b506102486105a8366004611e9d565b6113e6565b3480156105b957600080fd5b506102aa611485565b3480156105ce57600080fd5b506105e26105dd366004612193565b61148a565b6040516102b791906129ee565b3480156105fb57600080fd5b506106046115db565b6040516102b79190612a7c565b34801561061d57600080fd5b506102aa6115e4565b34801561063257600080fd5b506102aa6115ea565b34801561064757600080fd5b506102aa610656366004612051565b6115f0565b34801561066757600080fd5b50610248610676366004611f41565b611607565b34801561068757600080fd5b50610248610696366004611e9d565b611698565b3480156106a757600080fd5b506102486106b6366004612069565b611729565b3480156106c757600080fd5b506102aa611763565b3480156106dc57600080fd5b506102486106eb366004611f82565b611769565b3480156106fc57600080fd5b50610248611800565b61070d611810565b60065434146107375760405162461bcd60e51b815260040161072e90612697565b60405180910390fd5b6000838152600960205260409020546001600160a01b03168061076c5760405162461bcd60e51b815260040161072e90612735565b60ff8516600081815260086020908152604080832080546001600160401b0380821660010190811667ffffffffffffffff1990921682179092558452600a83528184209484529390915290206107c3908585611c99565b506040516338995da960e01b815282906001600160a01b038216906338995da9906107fc9089908b90879033908c908c90600401612472565b600060405180830381600087803b15801561081657600080fd5b505af115801561082a573d6000803e3d6000fd5b50505050816001600160401b0316868860ff167fdbb69440df8433824a026ef190652f29929eb64b4d1d5d2a69be8afe3e6eaed860405160405180910390a450505050505050565b61087a611833565b68ffffffffffffffff00600883901b1660ff8416176001600160481b0381166000908152600b6020908152604080832085845290915290206004808083015460ff16908111156108c657fe5b14156108e45760405162461bcd60e51b815260040161072e906126fe565b6007546108f543836005015461187d565b116109125760405162461bcd60e51b815260040161072e906127ba565b6004818101805460ff191682179055815460018301546040516001600160401b0388169260ff8a1692600080516020612acb83398151915292610956929190612417565b60405180910390a45050505050565b61096d6118bf565b610975611810565b68ffffffffffffffff00600884901b1660ff8516176001600160481b0381166000908152600b6020908152604080832085845282528083208684526009909252909120546001600160a01b03166109de5760405162461bcd60e51b815260040161072e90612968565b60048082015460019160ff909116908111156109f657fe5b1115610a145760405162461bcd60e51b815260040161072e90612850565b6001600160481b0382166000908152600c60209081526040808320868452825280832033845290915290205460ff1615610a605760405162461bcd60e51b815260040161072e90612603565b60048082015460ff1690811115610a7357fe5b610beb576005805460019081019091556040805160c0810182528681526020810186905281518381528083018352909291830191816020016020820280368337505050815260408051600080825260208083018452808501929092526001838501819052436060909501949094526001600160481b0387168152600b82528281208882528252829020845181558482015193810193909355908301518051610b219260028501920190611d17565b5060608201518051610b3d916003840191602090910190611d17565b5060808201518160040160006101000a81548160ff02191690836004811115610b6257fe5b021790555060a082015181600501559050503381600201600081548110610b8557fe5b600091825260209091200180546001600160a01b0319166001600160a01b039290921691909117905560015b856001600160401b03168760ff16600080516020612acb8339815191528787604051610bde929190612417565b60405180910390a4610c61565b600754610bfc43836005015461187d565b1115610c16576004818101805460ff191682179055610bb1565b80600101548314610c395760405162461bcd60e51b815260040161072e9061293d565b600281018054600181018255600091825260209091200180546001600160a01b031916331790555b60048181015460ff1681811115610c7457fe5b14610d6f576001600160481b0382166000908152600c6020908152604080832086845282528083203384529091529020805460ff1916600117905560048082015460ff1690811115610cc257fe5b856001600160401b03168760ff167f25f8daaa4635a7729927ba3f5b3d59cc3320aca7c32c9db4e7ca7b957434364087604051610cff91906123c6565b60405180910390a46001600354111580610d1f5750600354600282015410155b15610d6f5760048101805460ff191660029081179091556040516001600160401b0387169060ff891690600080516020612acb83398151915290610d669089908990612417565b60405180910390a45b505050505050565b60009081526001602052604090206002015490565b600082815260016020526040902060020154610daa9061055e6118ea565b610dc65760405162461bcd60e51b815260040161072e906125b4565b610dd082826118ee565b5050565b610ddc6118ea565b6001600160a01b0316816001600160a01b031614610e0c5760405162461bcd60e51b815260040161072e9061299f565b610dd0828261195d565b600a6020908152600092835260408084208252918352918190208054825160026001831615610100026000190190921691909104601f810185900485028201850190935282815292909190830182828015610eb25780601f10610e8757610100808354040283529160200191610eb2565b820191906000526020600020905b815481529060010190602001808311610e9557829003601f168201915b505050505081565b610ec26118bf565b610eca611810565b60008181526009602090815260408083205490516001600160a01b039091169268ffffffffffffffff00600889901b1660ff8a1617929091610f12918591899189910161233f565b60408051601f1981840301815291815281516020928301206001600160481b0385166000908152600b84528281208282529093529082209092509060048083015460ff1690811115610f6057fe5b1415610f7e5760405162461bcd60e51b815260040161072e9061250b565b600260048083015460ff1690811115610f9357fe5b14610fb05760405162461bcd60e51b815260040161072e906124d4565b80600101548214610fd35760405162461bcd60e51b815260040161072e906126c7565b6004818101805460ff1916600317905581546000818152600960205260409081902054905163712467f960e11b81526001600160a01b0390911692839263e248cff292611024928d918d910161244f565b600060405180830381600087803b15801561103e57600080fd5b505af1158015611052573d6000803e3d6000fd5b50505060048084015460ff16915081111561106957fe5b896001600160401b03168b60ff16600080516020612acb8339815191528560000154866001015460405161109e929190612417565b60405180910390a450505050505050505050565b6110ba6119cc565b60005b83811015611139578484828181106110d157fe5b90506020020160208101906110e69190611e9d565b6001600160a01b03166108fc8484848181106110fe57fe5b905060200201359081150290604051600060405180830381858888f19350505050158015611130573d6000803e3d6000fd5b506001016110bd565b5050505050565b6008602052600090815260409020546001600160401b031681565b6111636119cc565b600381905560405181907fa20d6b84cd798a24038be305eff8a45ca82ef54a2aa2082005d8e14c0a4746c890600090a250565b600b60209081526000928352604080842090915290825290208054600182015460048301546005909301549192909160ff9091169084565b60006111ed6040516111df9061236b565b6040518091039020836113ab565b92915050565b60005460ff165b90565b6112056119cc565b611210600082610d8c565b61121b600033610dd4565b50565b6112266119cc565b604051636ce5768960e11b815284906001600160a01b0382169063d9caed129061125890879087908790600401612397565b600060405180830381600087803b15801561127257600080fd5b505af1158015611286573d6000803e3d6000fd5b505050505050505050565b600c60209081526000938452604080852082529284528284209052825290205460ff1681565b60045481565b6112c56119cc565b6112cd6119f3565b565b6009602052600090815260409020546001600160a01b031681565b6112f26119cc565b6040516307b7ed9960e01b815282906001600160a01b038216906307b7ed9990611320908590600401612383565b600060405180830381600087803b15801561133a57600080fd5b505af115801561134e573d6000803e3d6000fd5b50505050505050565b6000828152600160205260408120611375908363ffffffff611a4216565b9392505050565b6113846119cc565b8060065414156113a65760405162461bcd60e51b815260040161072e90612906565b600655565b6000828152600160205260408120611375908363ffffffff611a4e16565b6040516113d59061236b565b604051809103902081565b60055481565b6113ee6119cc565b61140b6040516113fd9061236b565b6040518091039020826113ab565b6114275760405162461bcd60e51b815260040161072e90612660565b6114446040516114369061236b565b604051809103902082611729565b6040516001600160a01b038216907f10e1f7ce9fd7d1b90a66d13a2ab3cb8dd7f29f3f8d520b143b063ccfbab6906b90600090a25060048054600019019055565b600081565b611492611d78565b68ffffffffffffffff00600884901b1660ff8516176001600160481b0381166000908152600b60209081526040808320868452825291829020825160c081018452815481526001820154818401526002820180548551818602810186018752818152929593949386019383018282801561153557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611517575b505050505081526020016003820180548060200260200160405190810160405280929190818152602001828054801561159757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611579575b505050918352505060048281015460209092019160ff16908111156115b857fe5b60048111156115c357fe5b81526020016005820154815250509150509392505050565b60025460ff1681565b60065481565b60075481565b60008181526001602052604081206111ed90611a63565b61160f6119cc565b6000828152600960205260409081902080546001600160a01b0319166001600160a01b0386169081179091559051635c7d1b9b60e11b815284919063b8fa37369061166090869086906004016123cf565b600060405180830381600087803b15801561167a57600080fd5b505af115801561168e573d6000803e3d6000fd5b5050505050505050565b6116a06119cc565b6116af6040516113fd9061236b565b156116cc5760405162461bcd60e51b815260040161072e90612819565b6116e96040516116db9061236b565b604051809103902082610d8c565b6040516001600160a01b038216907f03580ee9f53a62b7cb409a2cb56f9be87747dd15017afc5cef6eef321e4fb2c590600090a250600480546001019055565b6000828152600160205260409020600201546117479061055e6118ea565b610e0c5760405162461bcd60e51b815260040161072e9061276a565b60035481565b6117716119cc565b6000848152600960205260409081902080546001600160a01b0319166001600160a01b0388169081179091559051635dd40c2d60e11b815286919063bba8185a906117c69088908890889088906004016123e6565b600060405180830381600087803b1580156117e057600080fd5b505af11580156117f4573d6000803e3d6000fd5b50505050505050505050565b6118086119cc565b6112cd611a6e565b60005460ff16156112cd5760405162461bcd60e51b815260040161072e906127ef565b61183e6000336113ab565b8061186157506118616040516118539061236b565b6040518091039020336113ab565b6112cd5760405162461bcd60e51b815260040161072e9061257d565b600061137583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ab0565b6118ce6040516118539061236b565b6112cd5760405162461bcd60e51b815260040161072e9061289a565b3390565b600082815260016020526040902061190c908263ffffffff611adc16565b15610dd0576119196118ea565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260016020526040902061197b908263ffffffff611af116565b15610dd0576119886118ea565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6119d76000336113ab565b6112cd5760405162461bcd60e51b815260040161072e906128cf565b6119fb611810565b6000805460ff191660011790556040517f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890611a38903390612383565b60405180910390a1565b60006113758383611b06565b6000611375836001600160a01b038416611b4b565b60006111ed82611b63565b611a76611b67565b6000805460ff191690556040517f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90611a38903390612383565b60008184841115611ad45760405162461bcd60e51b815260040161072e91906124c1565b505050900390565b6000611375836001600160a01b038416611b89565b6000611375836001600160a01b038416611bd3565b81546000908210611b295760405162461bcd60e51b815260040161072e9061253b565b826000018281548110611b3857fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b60005460ff166112cd5760405162461bcd60e51b815260040161072e90612632565b6000611b958383611b4b565b611bcb575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556111ed565b5060006111ed565b60008181526001830160205260408120548015611c8f5783546000198083019190810190600090879083908110611c0657fe5b9060005260206000200154905080876000018481548110611c2357fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080611c5357fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506111ed565b60009150506111ed565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611cda5782800160ff19823516178555611d07565b82800160010185558215611d07579182015b82811115611d07578235825591602001919060010190611cec565b50611d13929150611db0565b5090565b828054828255906000526020600020908101928215611d6c579160200282015b82811115611d6c57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611d37565b50611d13929150611dca565b6040805160c0810182526000808252602082018190526060928201839052828201929092529060808201908152602001600081525090565b6111fa91905b80821115611d135760008155600101611db6565b6111fa91905b80821115611d135780546001600160a01b0319168155600101611dd0565b60008083601f840112611dff578182fd5b5081356001600160401b03811115611e15578182fd5b6020830191508360208083028501011115611e2f57600080fd5b9250929050565b60008083601f840112611e47578182fd5b5081356001600160401b03811115611e5d578182fd5b602083019150836020828501011115611e2f57600080fd5b80356001600160401b03811681146111ed57600080fd5b803560ff811681146111ed57600080fd5b600060208284031215611eae578081fd5b813561137581612a8a565b60008060408385031215611ecb578081fd5b8235611ed681612a8a565b91506020830135611ee681612a8a565b809150509250929050565b60008060008060808587031215611f06578182fd5b8435611f1181612a8a565b93506020850135611f2181612a8a565b92506040850135611f3181612a8a565b9396929550929360600135925050565b600080600060608486031215611f55578283fd5b8335611f6081612a8a565b9250602084013591506040840135611f7781612a8a565b809150509250925092565b600080600080600060a08688031215611f99578081fd5b8535611fa481612a8a565b9450602086013593506040860135611fbb81612a8a565b92506060860135611fcb81612a9f565b91506080860135611fdb81612a9f565b809150509295509295909350565b60008060008060408587031215611ffe578384fd5b84356001600160401b0380821115612014578586fd5b61202088838901611dee565b90965094506020870135915080821115612038578384fd5b5061204587828801611dee565b95989497509550505050565b600060208284031215612062578081fd5b5035919050565b6000806040838503121561207b578182fd5b823591506020830135611ee681612a8a565b6000806040838503121561209f578182fd5b50508035926020909101359150565b600080604083850312156120c0578081fd5b6120ca8484611e75565b91506120d98460208501611e8c565b90509250929050565b600080604083850312156120f4578182fd5b82356120ff81612ab5565b946020939093013593505050565b600080600060608486031215612121578081fd5b8335611f6081612ab5565b60006020828403121561213d578081fd5b6113758383611e8c565b6000806000806060858703121561215c578182fd5b6121668686611e8c565b93506020850135925060408501356001600160401b03811115612187578283fd5b61204587828801611e36565b6000806000606084860312156121a7578081fd5b6121b18585611e8c565b92506121c08560208601611e75565b9150604084013590509250925092565b600080600080608085870312156121e5578182fd5b6121ef8686611e8c565b935060208501356001600160401b038116811461220a578283fd5b93969395505050506040820135916060013590565b600080600080600060808688031215612236578283fd5b6122408787611e8c565b945061224f8760208801611e75565b935060408601356001600160401b03811115612269578384fd5b61227588828901611e36565b96999598509660600135949350505050565b6000815180845260208085019450808401835b838110156122bf5781516001600160a01b03168752958201959082019060010161229a565b509495945050505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b60008151808452815b81811015612319576020818501810151868301820152016122fd565b8181111561232a5782602083870101525b50601f01601f19169290920160200192915050565b60006bffffffffffffffffffffffff198560601b16825282846014840137910160140190815292915050565b6b52454c415945525f524f4c4560a01b8152600c0190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b901515815260200190565b90815260200190565b9182526001600160a01b0316602082015260400190565b9384526001600160a01b039290921660208401526001600160e01b0319908116604084015216606082015260800190565b918252602082015260400190565b84815260208101849052608081016005841061243d57fe5b60408201939093526060015292915050565b6000848252604060208301526124696040830184866122ca565b95945050505050565b86815260ff861660208201526001600160401b03851660408201526001600160a01b038416606082015260a0608082018190526000906124b590830184866122ca565b98975050505050505050565b60006020825261137560208301846122f4565b6020808252601c908201527f70726f706f73616c20616c7265616479207472616e7366657272656400000000604082015260600190565b60208082526016908201527570726f706f73616c206973206e6f742061637469766560501b604082015260600190565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b6020808252601e908201527f73656e646572206973206e6f742072656c61796572206f722061646d696e0000604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526e0818591b5a5b881d1bc819dc985b9d608a1b606082015260800190565b6020808252601590820152741c995b185e595c88185b1c9958591e481d9bdd1959605a1b604082015260600190565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b6020808252601f908201527f6164647220646f65736e277420686176652072656c6179657220726f6c652100604082015260600190565b602080825260169082015275125b98dbdc9c9958dd08199959481cdd5c1c1b1a595960521b604082015260600190565b6020808252601b908201527f6461746120646f65736e2774206d617463682064617461686173680000000000604082015260600190565b6020808252601a908201527f50726f706f73616c20616c72656164792063616e63656c6c6564000000000000604082015260600190565b6020808252818101527f7265736f757263654944206e6f74206d617070656420746f2068616e646c6572604082015260600190565b60208082526030908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526f2061646d696e20746f207265766f6b6560801b606082015260800190565b6020808252818101527f50726f706f73616c206e6f7420617420657870697279207468726573686f6c64604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601e908201527f6164647220616c7265616479206861732072656c6179657220726f6c65210000604082015260600190565b6020808252602a908201527f70726f706f73616c20616c7265616479207061737365642f65786563757465646040820152690bd8d85b98d95b1b195960b21b606082015260800190565b6020808252818101527f73656e64657220646f65736e277420686176652072656c6179657220726f6c65604082015260600190565b6020808252601e908201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604082015260600190565b6020808252601f908201527f43757272656e742066656520697320657175616c20746f206e65772066656500604082015260600190565b6020808252601190820152700c8c2e8c2d0c2e6d040dad2e6dac2e8c6d607b1b604082015260600190565b60208082526019908201527f6e6f2068616e646c657220666f72207265736f75726365494400000000000000604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b6000602082528251602083015260208301516040830152604083015160c06060840152612a1e60e0840182612287565b6060850151848203601f190160808601529150612a3b8183612287565b6080860151925060058310612a4c57fe5b8260a086015260a086015160c086015280935050505092915050565b6001600160401b0391909116815260200190565b60ff91909116815260200190565b6001600160a01b038116811461121b57600080fd5b6001600160e01b03198116811461121b57600080fd5b6001600160481b038116811461121b57600080fdfe803c5a12f6bde629cea32e63d4b92d1b560816a6fb72e939d3c89e1cab650417a26469706673582212201583627495adf0d8ce592acf8252e15923b63e759cd61b273395cc4d07c8271964736f6c63430006040033