More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
View more zero value Internal Transactions in Advanced View mode
Loading...
Loading
Contract Name:
BridgeV2
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 2000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@uniswap/lib/contracts/libraries/TransferHelper.sol"; import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; import "../../utils/AdminableUpgradeable.sol"; import "../../utils/RevertMessageParser.sol"; import "../metarouter/MetaRouteStructs.sol"; contract BridgeV2 is Initializable, AdminableUpgradeable { /// ** PUBLIC states ** address public newMPC; address public oldMPC; uint256 public newMPCEffectiveTime; mapping(address => bool) public isTransmitter; /// ** EVENTS ** event LogChangeMPC( address indexed oldMPC, address indexed newMPC, uint256 indexed effectiveTime, uint256 chainId ); event SetTransmitterStatus(address indexed transmitter, bool status); event OracleRequest( address bridge, bytes callData, address receiveSide, address oppositeBridge, uint256 chainId ); event OracleRequestBTC( address bridge, address from, bytes to, uint256 amount, BtcSerial burnSerial ); /// ** MODIFIERs ** modifier onlyMPC() { require(msg.sender == mpc(), "BridgeV2: forbidden"); _; } modifier onlyTransmitter() { require(isTransmitter[msg.sender], "BridgeV2: not a transmitter"); _; } modifier onlyOwnerOrMPC() { require( mpc() == msg.sender || owner() == msg.sender, "BridgeV2: only owner or MPC can call" ); _; } modifier onlySignedByMPC(bytes32 hash, bytes memory signature) { require(SignatureChecker.isValidSignatureNow(mpc(), hash, signature), "BridgeV2: invalid signature"); _; } /// ** INITIALIZER ** function initialize(address _mpc) public virtual initializer { __Ownable_init(); newMPC = _mpc; newMPCEffectiveTime = block.timestamp; } /// ** VIEW functions ** function getRequestHash(bytes memory _callData, address _receiveSide) external view returns (bytes32) { return keccak256(bytes.concat("receiveRequestV2", _callData, bytes20(_receiveSide), bytes32(block.chainid), bytes20(address(this)))); } function getMpcHash(address _newMPC) external view returns (bytes32) { return keccak256(bytes.concat("changeMPC", bytes20(_newMPC), bytes32(block.chainid), bytes20(address(this)))); } /** * @notice Returns MPC */ function mpc() public view returns (address) { if (block.timestamp >= newMPCEffectiveTime) { return newMPC; } return oldMPC; } /** * @notice Returns chain ID of block */ function currentChainId() public view returns (uint256) { return block.chainid; } /// ** MPC functions ** /** * @notice Receives requests */ function receiveRequestV2(bytes memory _callData, address _receiveSide) external onlyMPC { _processRequest(_callData, _receiveSide); } /** * @notice Receives requests */ function receiveRequestV2Signed(bytes memory _callData, address _receiveSide, bytes memory signature) external onlySignedByMPC(this.getRequestHash(_callData, _receiveSide), signature) { _processRequest(_callData, _receiveSide); } /// ** TRANSMITTER functions ** /** * @notice transmits request */ function transmitRequestV2( bytes memory _callData, address _receiveSide, address _oppositeBridge, uint256 _chainId ) public onlyTransmitter { emit OracleRequest( address(this), _callData, _receiveSide, _oppositeBridge, _chainId ); } /** * @notice transmits request */ function transmitRequestBTC( address _from, bytes calldata _to, uint256 _amount, BtcSerial _burnSerial ) public onlyTransmitter { emit OracleRequestBTC( address(this), _from, _to, _amount, _burnSerial ); } /// ** OWNER functions ** /** * @notice Sets transmitter status */ function setTransmitterStatus(address _transmitter, bool _status) external onlyOwner { isTransmitter[_transmitter] = _status; emit SetTransmitterStatus(_transmitter, _status); } /** * @notice Changes MPC by owner or MPC */ function changeMPC(address _newMPC) external onlyOwnerOrMPC returns (bool) { return _changeMPC(_newMPC); } /** * @notice Changes MPC with signature */ function changeMPCSigned(address _newMPC, bytes memory signature) external onlySignedByMPC(this.getMpcHash(_newMPC), signature) returns (bool) { return _changeMPC(_newMPC); } /** * @notice Withdraw fee by owner or admin */ function withdrawFee(address token, address to, uint256 amount) external onlyOwnerOrAdmin returns (bool) { TransferHelper.safeTransfer(token, to, amount); return true; } /// ** Private functions ** /** * @notice Private function that handles request processing */ function _processRequest(bytes memory _callData, address _receiveSide) private { require(isTransmitter[_receiveSide], "BridgeV2: untrusted transmitter"); (bool success, bytes memory data) = _receiveSide.call(_callData); if (!success) { revert(RevertMessageParser.getRevertMessage(data, "BridgeV2: call failed")); } } /** * @notice Private function that changes MPC */ function _changeMPC(address _newMPC) private returns (bool) { require(_newMPC != address(0), "BridgeV2: address(0x0)"); oldMPC = mpc(); newMPC = _newMPC; newMPCEffectiveTime = block.timestamp; emit LogChangeMPC( oldMPC, newMPC, newMPCEffectiveTime, currentChainId() ); return true; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Context_init_unchained(); __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @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) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @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"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 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. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { __Context_init_unchained(); } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC1271 standard signature validation method for * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. * * _Available since v4.1._ */ interface IERC1271 { /** * @dev Should return whether the signature provided is valid for the provided data * @param hash Hash of the data to be signed * @param signature Signature byte array associated with _data */ function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @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) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @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"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/SignatureChecker.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; import "../Address.sol"; import "../../interfaces/IERC1271.sol"; /** * @dev Signature verification helper: Provide a single mechanism to verify both private-key (EOA) ECDSA signature and * ERC1271 contract signatures. Using this instead of ECDSA.recover in your contract will make them compatible with * smart contract wallets such as Argent and Gnosis. * * Note: unlike ECDSA signatures, contract signature's are revocable, and the outcome of this function can thus change * through time. It could return true at block N and false at block N+1 (or the opposite). * * _Available since v4.1._ */ library SignatureChecker { function isValidSignatureNow( address signer, bytes32 hash, bytes memory signature ) internal view returns (bool) { (address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature); if (error == ECDSA.RecoverError.NoError && recovered == signer) { return true; } (bool success, bytes memory result) = signer.staticcall( abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature) ); return (success && result.length == 32 && abi.decode(result, (bytes4)) == IERC1271.isValidSignature.selector); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.6.0; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeApprove: approve failed' ); } function safeTransfer( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeTransfer: transfer failed' ); } function safeTransferFrom( address token, address from, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::transferFrom: transferFrom failed' ); } function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, 'TransferHelper::safeTransferETH: ETH transfer failed'); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "../types/BtcSerial.sol"; library MetaRouteStructs { struct MetaBurnTransaction { uint256 stableBridgingFee; uint256 amount; bytes32 crossChainID; address syntCaller; address finalReceiveSide; address sToken; bytes finalCallData; uint256 finalOffset; address chain2address; address receiveSide; address oppositeBridge; address revertableAddress; uint256 chainID; bytes32 clientID; } struct MetaMintTransaction { uint256 stableBridgingFee; uint256 amount; bytes32 crossChainID; bytes32 externalID; address tokenReal; uint256 chainID; address to; address[] swapTokens; address secondDexRouter; bytes secondSwapCalldata; address finalReceiveSide; bytes finalCalldata; uint256 finalOffset; } struct MetaMintTransactionBTC { uint256 stableBridgingFee; uint256 amount; BtcSerial serial; bytes32 crossChainID; bytes32 externalID; address tokenReal; uint256 chainID; address to; address receiveSide; bytes receiveSideCalldata; uint256 receiveSideOffset; } struct MetaRouteTransaction { bytes firstSwapCalldata; bytes secondSwapCalldata; address[] approvedTokens; address firstDexRouter; address secondDexRouter; uint256 amount; bool nativeIn; address relayRecipient; bytes otherSideCalldata; } struct MetaSynthesizeTransaction { uint256 stableBridgingFee; uint256 amount; address rtoken; address chain2address; address receiveSide; address oppositeBridge; address syntCaller; uint256 chainID; address[] swapTokens; address secondDexRouter; bytes secondSwapCalldata; address finalReceiveSide; bytes finalCalldata; uint256 finalOffset; address revertableAddress; bytes32 clientID; } struct MetaRevertTransaction { uint256 stableBridgingFee; bytes32 internalID; address receiveSide; address managerChainBridge; address sourceChainBridge; uint256 managerChainId; uint256 sourceChainId; address router; bytes swapCalldata; address sourceChainSynthesis; address burnToken; bytes burnCalldata; bytes32 clientID; } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.19; type BtcSerial is uint64; using {inc, equal as ==} for BtcSerial global; function inc(BtcSerial a) pure returns (BtcSerial) { return BtcSerial.wrap(BtcSerial.unwrap(a) + 1); } function equal(BtcSerial a, BtcSerial b) pure returns (bool) { return BtcSerial.unwrap(a) == BtcSerial.unwrap(b); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; abstract contract AdminableUpgradeable is OwnableUpgradeable { mapping(address => bool) public isAdmin; event SetAdminPermission(address indexed admin, bool permission); modifier onlyAdmin { require(isAdmin[msg.sender], "Only admin can call"); _; } modifier onlyOwnerOrAdmin { require((owner() == msg.sender) || isAdmin[msg.sender], "Only owner or admin can call"); _; } function __Adminable_init() internal onlyInitializing { __Ownable_init(); } function setAdminPermission(address _user, bool _permission) external onlyOwner { isAdmin[_user] = _permission; emit SetAdminPermission(_user, _permission); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; library RevertMessageParser { function getRevertMessage(bytes memory _data, string memory _defaultMessage) internal pure returns (string memory) { // If the _data length is less than 68, then the transaction failed silently (without a revert message) if (_data.length < 68) return _defaultMessage; assembly { // Slice the sighash _data := add(_data, 0x04) } return abi.decode(_data, (string)); } }
{ "viaIR": true, "optimizer": { "enabled": true, "runs": 2000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldMPC","type":"address"},{"indexed":true,"internalType":"address","name":"newMPC","type":"address"},{"indexed":true,"internalType":"uint256","name":"effectiveTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"chainId","type":"uint256"}],"name":"LogChangeMPC","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"bridge","type":"address"},{"indexed":false,"internalType":"bytes","name":"callData","type":"bytes"},{"indexed":false,"internalType":"address","name":"receiveSide","type":"address"},{"indexed":false,"internalType":"address","name":"oppositeBridge","type":"address"},{"indexed":false,"internalType":"uint256","name":"chainId","type":"uint256"}],"name":"OracleRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"bridge","type":"address"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"bytes","name":"to","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"BtcSerial","name":"burnSerial","type":"uint64"}],"name":"OracleRequestBTC","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"bool","name":"permission","type":"bool"}],"name":"SetAdminPermission","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"transmitter","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SetTransmitterStatus","type":"event"},{"inputs":[{"internalType":"address","name":"_newMPC","type":"address"}],"name":"changeMPC","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newMPC","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"changeMPCSigned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newMPC","type":"address"}],"name":"getMpcHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_callData","type":"bytes"},{"internalType":"address","name":"_receiveSide","type":"address"}],"name":"getRequestHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_mpc","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isTransmitter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mpc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"newMPC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"newMPCEffectiveTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oldMPC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_callData","type":"bytes"},{"internalType":"address","name":"_receiveSide","type":"address"}],"name":"receiveRequestV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_callData","type":"bytes"},{"internalType":"address","name":"_receiveSide","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"receiveRequestV2Signed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"bool","name":"_permission","type":"bool"}],"name":"setAdminPermission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_transmitter","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setTransmitterStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"bytes","name":"_to","type":"bytes"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"BtcSerial","name":"_burnSerial","type":"uint64"}],"name":"transmitRequestBTC","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_callData","type":"bytes"},{"internalType":"address","name":"_receiveSide","type":"address"},{"internalType":"address","name":"_oppositeBridge","type":"address"},{"internalType":"uint256","name":"_chainId","type":"uint256"}],"name":"transmitRequestV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawFee","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608080604052346100165761174c908161001c8239f35b600080fdfe6080604052600436101561001257600080fd5b60003560e01c80631095b6d714610177578063154fbf241461017257806319117d931461016d57806324d7806c1461016857806338899935146101635780633d05b0881461015e578063405fb4f714610159578063474a245a146101545780635b7b018c1461014f57806365f341ce1461014a5780636cbadbfa146101455780636cebc9c2146101405780636fac30071461013b578063715018a61461013657806375f3974b1461013157806384d61c971461012c5780638da5cb5b14610127578063c00f8a3d14610122578063c4d66de81461011d578063f2fde38b14610118578063f75c2664146101135763f7f1baf01461010e57600080fd5b610cea565b610cbe565b610c14565b610b1a565b610af3565b610acc565b6109fd565b610977565b610907565b6108c8565b61080a565b6107ef565b610781565b6106c2565b61069b565b61067d565b6105d9565b6104b7565b6103a2565b610311565b610281565b6101c3565b600435906001600160a01b038216820361019257565b600080fd5b602435906001600160a01b038216820361019257565b604435906001600160a01b038216820361019257565b34610192576060600319360112610192576101dc61017c565b6101e4610197565b6001600160a01b036033541633148015610269575b15610225576102219161020f9160443591611353565b60405190151581529081906020820190565b0390f35b606460405162461bcd60e51b815260206004820152601c60248201527f4f6e6c79206f776e6572206f722061646d696e2063616e2063616c6c000000006044820152fd5b5033600052606560205260ff604060002054166101f9565b3461019257602060031936011261019257602061029c61017c565b604051828101917f6368616e67654d5043000000000000000000000000000000000000000000000083526bffffffffffffffffffffffff19809160601b16602983015246603d8301523060601b16605d820152605181526102fc81610410565b519020604051908152f35b8015150361019257565b346101925760406003193601126101925761032a61017c565b7feeec8b4e2d317fc608f301f859237a6081b9813f150a3fcfb02fd54276c8be4060206024359261035a84610307565b6001600160a01b039061037282603354163314610d5c565b169283600052606982526103978160406000209060ff60ff1983541691151516179055565b6040519015158152a2005b34610192576020600319360112610192576001600160a01b036103c361017c565b166000526065602052602060ff604060002054166040519015158152f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6080810190811067ffffffffffffffff82111761042c57604052565b6103e1565b90601f601f19910116810190811067ffffffffffffffff82111761042c57604052565b67ffffffffffffffff811161042c57601f01601f191660200190565b81601f820112156101925780359061048782610454565b926104956040519485610431565b8284526020838301011161019257816000926020809301838601378301015290565b34610192576040600319360112610192576104d061017c565b60243567ffffffffffffffff8111610192576104f0903690600401610470565b604051917f154fbf240000000000000000000000000000000000000000000000000000000083526001600160a01b0381166004840152602083602481305afa80156105925761055a61020f9361055f9261022196600091610564575b50610555610eea565b611058565b610f52565b611577565b610585915060203d811161058b575b61057d8183610431565b810190610f12565b3861054c565b503d610573565b610f46565b6040600319820112610192576004359067ffffffffffffffff8211610192576105c291600401610470565b906024356001600160a01b03811681036101925790565b34610192576102216105ea36610597565b61066a6078604051809360208201957f72656365697665526571756573745632000000000000000000000000000000008752610630815180926020603087019101610ec7565b8201906bffffffffffffffffffffffff19809160601b1660308301524660448301523060601b166064820152036058810184520182610431565b5190206040519081529081906020820190565b34610192576000600319360112610192576020606854604051908152f35b346101925760006003193601126101925760206001600160a01b0360665416604051908152f35b34610192576020600319360112610192576106db61017c565b6106e3610eea565b6001600160a01b039081163314908115610773575b501561070a5761020f61022191611577565b608460405162461bcd60e51b8152602060048201526024808201527f42726964676556323a206f6e6c79206f776e6572206f72204d50432063616e2060448201527f63616c6c000000000000000000000000000000000000000000000000000000006064820152fd5b6033541633149050386106f8565b346101925760806003193601126101925761079a61017c565b67ffffffffffffffff6024358181116101925736602382011215610192578060040135828111610192573660248284010111610192576064359283168303610192576107ed9360246044359301906112bd565b005b34610192576000600319360112610192576020604051468152f35b346101925760806003193601126101925760043567ffffffffffffffff8111610192576108a461085f7f532dbb6d061eee97ab4370060f60ede10b3dc361cc1214c07ae5e34dd86e6aaf923690600401610470565b610867610197565b61086f6101ad565b9033600052606960205261088a60ff60406000205416611272565b60405193849330855260a0602086015260a0850190610f21565b916001600160a01b03809216604085015216606083015260643560808301520390a1005b34610192576020600319360112610192576001600160a01b036108e961017c565b166000526069602052602060ff604060002054166040519015158152f35b3461019257600080600319360112610974578060335473ffffffffffffffffffffffffffffffffffffffff196001600160a01b03821691610949338414610d5c565b166033557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b346101925760406003193601126101925761099061017c565b7f0e7bea53cb2b3130dd1aac8d56b61cc8da7ebab0432e2d1622513523d848f2e76020602435926109c084610307565b6001600160a01b03906109d882603354163314610d5c565b169283600052606582526103978160406000209060ff60ff1983541691151516179055565b346101925760606003193601126101925767ffffffffffffffff60043581811161019257610a2f903690600401610470565b90610a38610197565b9060443590811161019257610a51903690600401610470565b916040517f3d05b0880000000000000000000000000000000000000000000000000000000081526040600482015260208180610a906044820186610f21565b6001600160a01b03871660248301520381305afa908115610592576107ed94610ac79261055a926000916105645750610555610eea565b6114c0565b346101925760006003193601126101925760206001600160a01b0360335416604051908152f35b346101925760006003193601126101925760206001600160a01b0360675416604051908152f35b3461019257602060031936011261019257610b3361017c565b60005460ff8160081c169081600014610c0b5750303b155b15610ba157610b6090159182610b7657610dfc565b610b6657005b6107ed61ff001960005416600055565b610b8a61010061ff00196000541617600055565b610b9c600160ff196000541617600055565b610dfc565b608460405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152fd5b60ff1615610b4b565b3461019257602060031936011261019257610c2d61017c565b6001600160a01b03610c4481603354163314610d5c565b811615610c54576107ed90610da7565b608460405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b34610192576000600319360112610192576020610cd9610eea565b6001600160a01b0360405191168152f35b3461019257610cf836610597565b6001600160a01b03610d08610eea565b163303610d18576107ed916114c0565b606460405162461bcd60e51b815260206004820152601360248201527f42726964676556323a20666f7262696464656e000000000000000000000000006044820152fd5b15610d6357565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b603354906001600160a01b03809116918273ffffffffffffffffffffffffffffffffffffffff19821617603355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b6001600160a01b0390610e2860ff60005460081c16610e1a81610e56565b610e2381610e56565b610e56565b610e3133610da7565b1673ffffffffffffffffffffffffffffffffffffffff19606654161760665542606855565b15610e5d57565b608460405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152fd5b60005b838110610eda5750506000910152565b8181015183820152602001610eca565b606854421015610f03576001600160a01b036067541690565b6001600160a01b036066541690565b90816020910312610192575190565b90601f19601f602093610f3f81518092818752878088019101610ec7565b0116010190565b6040513d6000823e3d90fd5b15610f5957565b606460405162461bcd60e51b815260206004820152601b60248201527f42726964676556323a20696e76616c6964207369676e617475726500000000006044820152fd5b60051115610fa757565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b604090610fed939281528160208201520190610f21565b90565b3d1561101b573d9061100182610454565b9161100f6040519384610431565b82523d6000602084013e565b606090565b9081602091031261019257517fffffffff00000000000000000000000000000000000000000000000000000000811681036101925790565b9091611064818461114d565b61106d81610f9d565b159081611137575b5061112f5760009182916040516110ca816110bc60208201947f1626ba7e00000000000000000000000000000000000000000000000000000000998a875260248401610fd6565b03601f198101835282610431565b51915afa906110d7610ff0565b82611123575b826110e757505090565b7fffffffff000000000000000000000000000000000000000000000000000000009192508060208061111e93518301019101611020565b161490565b805160201492506110dd565b505050600190565b90506001600160a01b0380841691161438611075565b81516041810361117a575090611176916020820151906060604084015193015160001a906111ca565b9091565b6040036111c057816040602061117694015191015191601b7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84169360ff1c01906111ca565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116112665760ff16601b8114158061125b575b61124f579160809493916020936040519384528484015260408301526060820152600093849182805260015afa156105925781516001600160a01b03811615611249579190565b50600190565b50505050600090600490565b50601c811415611202565b50505050600090600390565b1561127957565b606460405162461bcd60e51b815260206004820152601b60248201527f42726964676556323a206e6f742061207472616e736d697474657200000000006044820152fd5b90601f8367ffffffffffffffff7f5c55966fbba0d47f447dea3e020841aec17c07a1e3b0e7699268a2ec0b640cd1976001600160a01b039760c097601f199633600052606960205261131660ff60406000205416611272565b6040519a8b99308b521660208a015260a060408a01528160a08a0152898901376000888589010152606087015216608085015201168101030190a1565b60009291838093604051906001600160a01b0360208301947fa9059cbb0000000000000000000000000000000000000000000000000000000086521660248301526044820152604481526113a681610410565b51925af16113b2610ff0565b8161142d575b50156113c357600190565b608460405162461bcd60e51b815260206004820152602d60248201527f5472616e7366657248656c7065723a3a736166655472616e736665723a20747260448201527f616e73666572206661696c6564000000000000000000000000000000000000006064820152fd5b8051801592508215611442575b5050386113b8565b8192509060209181010312610192576020015161145e81610307565b388061143a565b604051906040820182811067ffffffffffffffff82111761042c57604052601582527f42726964676556323a2063616c6c206661696c656400000000000000000000006020830152565b906020610fed928181520190610f21565b906001600160a01b038116600052606960205260ff60406000205416156115335781600092918360208194519301915af16114f9610ff0565b90156115025750565b61151761152f91611511611465565b90611694565b60405191829162461bcd60e51b8352600483016114af565b0390fd5b606460405162461bcd60e51b815260206004820152601f60248201527f42726964676556323a20756e74727573746564207472616e736d6974746572006044820152fd5b6001600160a01b039081811615611650576115e9906115c0611597610eea565b6001600160a01b031673ffffffffffffffffffffffffffffffffffffffff196067541617606755565b6001600160a01b031673ffffffffffffffffffffffffffffffffffffffff196066541617606655565b6115f242606855565b6067546001600160a01b03166066546001600160a01b03167fcda32bc39904597666dfa9f9c845714756e1ffffad55b52e0d344673a2198121606854938060405193169316918061164846829190602083019252565b0390a4600190565b606460405162461bcd60e51b815260206004820152601660248201527f42726964676556323a20616464726573732830783029000000000000000000006044820152fd5b90604482511061171157506004810151810190602081602484019303126101925760248101519067ffffffffffffffff82116101925701816043820112156101925760248101516116e481610454565b926116f26040519485610431565b8184526044828401011161019257610fed916044602085019101610ec7565b90509056fea26469706673582212204c1fd3c832120d7e67f4275069fe218f85cc9989eba79bd4650fdc4a7601628864736f6c63430008130033
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c80631095b6d714610177578063154fbf241461017257806319117d931461016d57806324d7806c1461016857806338899935146101635780633d05b0881461015e578063405fb4f714610159578063474a245a146101545780635b7b018c1461014f57806365f341ce1461014a5780636cbadbfa146101455780636cebc9c2146101405780636fac30071461013b578063715018a61461013657806375f3974b1461013157806384d61c971461012c5780638da5cb5b14610127578063c00f8a3d14610122578063c4d66de81461011d578063f2fde38b14610118578063f75c2664146101135763f7f1baf01461010e57600080fd5b610cea565b610cbe565b610c14565b610b1a565b610af3565b610acc565b6109fd565b610977565b610907565b6108c8565b61080a565b6107ef565b610781565b6106c2565b61069b565b61067d565b6105d9565b6104b7565b6103a2565b610311565b610281565b6101c3565b600435906001600160a01b038216820361019257565b600080fd5b602435906001600160a01b038216820361019257565b604435906001600160a01b038216820361019257565b34610192576060600319360112610192576101dc61017c565b6101e4610197565b6001600160a01b036033541633148015610269575b15610225576102219161020f9160443591611353565b60405190151581529081906020820190565b0390f35b606460405162461bcd60e51b815260206004820152601c60248201527f4f6e6c79206f776e6572206f722061646d696e2063616e2063616c6c000000006044820152fd5b5033600052606560205260ff604060002054166101f9565b3461019257602060031936011261019257602061029c61017c565b604051828101917f6368616e67654d5043000000000000000000000000000000000000000000000083526bffffffffffffffffffffffff19809160601b16602983015246603d8301523060601b16605d820152605181526102fc81610410565b519020604051908152f35b8015150361019257565b346101925760406003193601126101925761032a61017c565b7feeec8b4e2d317fc608f301f859237a6081b9813f150a3fcfb02fd54276c8be4060206024359261035a84610307565b6001600160a01b039061037282603354163314610d5c565b169283600052606982526103978160406000209060ff60ff1983541691151516179055565b6040519015158152a2005b34610192576020600319360112610192576001600160a01b036103c361017c565b166000526065602052602060ff604060002054166040519015158152f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6080810190811067ffffffffffffffff82111761042c57604052565b6103e1565b90601f601f19910116810190811067ffffffffffffffff82111761042c57604052565b67ffffffffffffffff811161042c57601f01601f191660200190565b81601f820112156101925780359061048782610454565b926104956040519485610431565b8284526020838301011161019257816000926020809301838601378301015290565b34610192576040600319360112610192576104d061017c565b60243567ffffffffffffffff8111610192576104f0903690600401610470565b604051917f154fbf240000000000000000000000000000000000000000000000000000000083526001600160a01b0381166004840152602083602481305afa80156105925761055a61020f9361055f9261022196600091610564575b50610555610eea565b611058565b610f52565b611577565b610585915060203d811161058b575b61057d8183610431565b810190610f12565b3861054c565b503d610573565b610f46565b6040600319820112610192576004359067ffffffffffffffff8211610192576105c291600401610470565b906024356001600160a01b03811681036101925790565b34610192576102216105ea36610597565b61066a6078604051809360208201957f72656365697665526571756573745632000000000000000000000000000000008752610630815180926020603087019101610ec7565b8201906bffffffffffffffffffffffff19809160601b1660308301524660448301523060601b166064820152036058810184520182610431565b5190206040519081529081906020820190565b34610192576000600319360112610192576020606854604051908152f35b346101925760006003193601126101925760206001600160a01b0360665416604051908152f35b34610192576020600319360112610192576106db61017c565b6106e3610eea565b6001600160a01b039081163314908115610773575b501561070a5761020f61022191611577565b608460405162461bcd60e51b8152602060048201526024808201527f42726964676556323a206f6e6c79206f776e6572206f72204d50432063616e2060448201527f63616c6c000000000000000000000000000000000000000000000000000000006064820152fd5b6033541633149050386106f8565b346101925760806003193601126101925761079a61017c565b67ffffffffffffffff6024358181116101925736602382011215610192578060040135828111610192573660248284010111610192576064359283168303610192576107ed9360246044359301906112bd565b005b34610192576000600319360112610192576020604051468152f35b346101925760806003193601126101925760043567ffffffffffffffff8111610192576108a461085f7f532dbb6d061eee97ab4370060f60ede10b3dc361cc1214c07ae5e34dd86e6aaf923690600401610470565b610867610197565b61086f6101ad565b9033600052606960205261088a60ff60406000205416611272565b60405193849330855260a0602086015260a0850190610f21565b916001600160a01b03809216604085015216606083015260643560808301520390a1005b34610192576020600319360112610192576001600160a01b036108e961017c565b166000526069602052602060ff604060002054166040519015158152f35b3461019257600080600319360112610974578060335473ffffffffffffffffffffffffffffffffffffffff196001600160a01b03821691610949338414610d5c565b166033557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b346101925760406003193601126101925761099061017c565b7f0e7bea53cb2b3130dd1aac8d56b61cc8da7ebab0432e2d1622513523d848f2e76020602435926109c084610307565b6001600160a01b03906109d882603354163314610d5c565b169283600052606582526103978160406000209060ff60ff1983541691151516179055565b346101925760606003193601126101925767ffffffffffffffff60043581811161019257610a2f903690600401610470565b90610a38610197565b9060443590811161019257610a51903690600401610470565b916040517f3d05b0880000000000000000000000000000000000000000000000000000000081526040600482015260208180610a906044820186610f21565b6001600160a01b03871660248301520381305afa908115610592576107ed94610ac79261055a926000916105645750610555610eea565b6114c0565b346101925760006003193601126101925760206001600160a01b0360335416604051908152f35b346101925760006003193601126101925760206001600160a01b0360675416604051908152f35b3461019257602060031936011261019257610b3361017c565b60005460ff8160081c169081600014610c0b5750303b155b15610ba157610b6090159182610b7657610dfc565b610b6657005b6107ed61ff001960005416600055565b610b8a61010061ff00196000541617600055565b610b9c600160ff196000541617600055565b610dfc565b608460405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152fd5b60ff1615610b4b565b3461019257602060031936011261019257610c2d61017c565b6001600160a01b03610c4481603354163314610d5c565b811615610c54576107ed90610da7565b608460405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b34610192576000600319360112610192576020610cd9610eea565b6001600160a01b0360405191168152f35b3461019257610cf836610597565b6001600160a01b03610d08610eea565b163303610d18576107ed916114c0565b606460405162461bcd60e51b815260206004820152601360248201527f42726964676556323a20666f7262696464656e000000000000000000000000006044820152fd5b15610d6357565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b603354906001600160a01b03809116918273ffffffffffffffffffffffffffffffffffffffff19821617603355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b6001600160a01b0390610e2860ff60005460081c16610e1a81610e56565b610e2381610e56565b610e56565b610e3133610da7565b1673ffffffffffffffffffffffffffffffffffffffff19606654161760665542606855565b15610e5d57565b608460405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152fd5b60005b838110610eda5750506000910152565b8181015183820152602001610eca565b606854421015610f03576001600160a01b036067541690565b6001600160a01b036066541690565b90816020910312610192575190565b90601f19601f602093610f3f81518092818752878088019101610ec7565b0116010190565b6040513d6000823e3d90fd5b15610f5957565b606460405162461bcd60e51b815260206004820152601b60248201527f42726964676556323a20696e76616c6964207369676e617475726500000000006044820152fd5b60051115610fa757565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b604090610fed939281528160208201520190610f21565b90565b3d1561101b573d9061100182610454565b9161100f6040519384610431565b82523d6000602084013e565b606090565b9081602091031261019257517fffffffff00000000000000000000000000000000000000000000000000000000811681036101925790565b9091611064818461114d565b61106d81610f9d565b159081611137575b5061112f5760009182916040516110ca816110bc60208201947f1626ba7e00000000000000000000000000000000000000000000000000000000998a875260248401610fd6565b03601f198101835282610431565b51915afa906110d7610ff0565b82611123575b826110e757505090565b7fffffffff000000000000000000000000000000000000000000000000000000009192508060208061111e93518301019101611020565b161490565b805160201492506110dd565b505050600190565b90506001600160a01b0380841691161438611075565b81516041810361117a575090611176916020820151906060604084015193015160001a906111ca565b9091565b6040036111c057816040602061117694015191015191601b7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84169360ff1c01906111ca565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116112665760ff16601b8114158061125b575b61124f579160809493916020936040519384528484015260408301526060820152600093849182805260015afa156105925781516001600160a01b03811615611249579190565b50600190565b50505050600090600490565b50601c811415611202565b50505050600090600390565b1561127957565b606460405162461bcd60e51b815260206004820152601b60248201527f42726964676556323a206e6f742061207472616e736d697474657200000000006044820152fd5b90601f8367ffffffffffffffff7f5c55966fbba0d47f447dea3e020841aec17c07a1e3b0e7699268a2ec0b640cd1976001600160a01b039760c097601f199633600052606960205261131660ff60406000205416611272565b6040519a8b99308b521660208a015260a060408a01528160a08a0152898901376000888589010152606087015216608085015201168101030190a1565b60009291838093604051906001600160a01b0360208301947fa9059cbb0000000000000000000000000000000000000000000000000000000086521660248301526044820152604481526113a681610410565b51925af16113b2610ff0565b8161142d575b50156113c357600190565b608460405162461bcd60e51b815260206004820152602d60248201527f5472616e7366657248656c7065723a3a736166655472616e736665723a20747260448201527f616e73666572206661696c6564000000000000000000000000000000000000006064820152fd5b8051801592508215611442575b5050386113b8565b8192509060209181010312610192576020015161145e81610307565b388061143a565b604051906040820182811067ffffffffffffffff82111761042c57604052601582527f42726964676556323a2063616c6c206661696c656400000000000000000000006020830152565b906020610fed928181520190610f21565b906001600160a01b038116600052606960205260ff60406000205416156115335781600092918360208194519301915af16114f9610ff0565b90156115025750565b61151761152f91611511611465565b90611694565b60405191829162461bcd60e51b8352600483016114af565b0390fd5b606460405162461bcd60e51b815260206004820152601f60248201527f42726964676556323a20756e74727573746564207472616e736d6974746572006044820152fd5b6001600160a01b039081811615611650576115e9906115c0611597610eea565b6001600160a01b031673ffffffffffffffffffffffffffffffffffffffff196067541617606755565b6001600160a01b031673ffffffffffffffffffffffffffffffffffffffff196066541617606655565b6115f242606855565b6067546001600160a01b03166066546001600160a01b03167fcda32bc39904597666dfa9f9c845714756e1ffffad55b52e0d344673a2198121606854938060405193169316918061164846829190602083019252565b0390a4600190565b606460405162461bcd60e51b815260206004820152601660248201527f42726964676556323a20616464726573732830783029000000000000000000006044820152fd5b90604482511061171157506004810151810190602081602484019303126101925760248101519067ffffffffffffffff82116101925701816043820112156101925760248101516116e481610454565b926116f26040519485610431565b8184526044828401011161019257610fed916044602085019101610ec7565b90509056fea26469706673582212204c1fd3c832120d7e67f4275069fe218f85cc9989eba79bd4650fdc4a7601628864736f6c63430008130033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
TAIKO | 100.00% | $0.989931 | 0.1046 | $0.1035 |
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.