Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- Executor
- Optimization enabled
- true
- Compiler version
- v0.8.22+commit.4fc1097e
- Optimization runs
- 20000
- EVM Version
- paris
- Verified at
- 2026-03-07T18:53:31.157381Z
contracts/Executor.sol
// SPDX-License-Identifier: LZBL-1.2
pragma solidity ^0.8.20;
import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import { Proxied } from "hardhat-deploy/solc_0.8/proxy/Proxied.sol";
import { Origin } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";
import { PacketV1Codec } from "@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol";
import { IUltraLightNode301 } from "./uln/uln301/interfaces/IUltraLightNode301.sol";
import { IExecutor } from "./interfaces/IExecutor.sol";
import { IExecutorFeeLib } from "./interfaces/IExecutorFeeLib.sol";
import { WorkerUpgradeable } from "./upgradeable/WorkerUpgradeable.sol";
interface ILayerZeroEndpointV2 {
function eid() external view returns (uint32);
function lzReceive(
Origin calldata _origin,
address _receiver,
bytes32 _guid,
bytes calldata _message,
bytes calldata _extraData
) external payable;
function lzReceiveAlert(
Origin calldata _origin,
address _receiver,
bytes32 _guid,
uint256 _gas,
uint256 _value,
bytes calldata _message,
bytes calldata _extraData,
bytes calldata _reason
) external;
function lzCompose(
address _from,
address _to,
bytes32 _guid,
uint16 _index,
bytes calldata _message,
bytes calldata _extraData
) external payable;
function lzComposeAlert(
address _from,
address _to,
bytes32 _guid,
uint16 _index,
uint256 _gas,
uint256 _value,
bytes calldata _message,
bytes calldata _extraData,
bytes calldata _reason
) external;
}
contract Executor is WorkerUpgradeable, ReentrancyGuardUpgradeable, Proxied, IExecutor {
using PacketV1Codec for bytes;
mapping(uint32 dstEid => DstConfig) public dstConfig;
// endpoint v2
address public endpoint;
uint32 public localEidV2;
// endpoint v1
address public receiveUln301;
function initialize(
address _endpoint,
address _receiveUln301,
address[] memory _messageLibs,
address _priceFeed,
address _roleAdmin,
address[] memory _admins
) external proxied initializer {
__ReentrancyGuard_init();
__Worker_init(_messageLibs, _priceFeed, 12000, _roleAdmin, _admins);
endpoint = _endpoint;
localEidV2 = ILayerZeroEndpointV2(_endpoint).eid();
receiveUln301 = _receiveUln301;
}
function onUpgrade(address _receiveUln301) external proxied {
receiveUln301 = _receiveUln301;
}
// --- Admin ---
function setDstConfig(DstConfigParam[] memory _params) external onlyRole(ADMIN_ROLE) {
for (uint256 i = 0; i < _params.length; i++) {
DstConfigParam memory param = _params[i];
dstConfig[param.dstEid] = DstConfig(
param.lzReceiveBaseGas,
param.multiplierBps,
param.floorMarginUSD,
param.nativeCap,
param.lzComposeBaseGas
);
}
emit DstConfigSet(_params);
}
function nativeDrop(
Origin calldata _origin,
uint32 _dstEid,
address _oapp,
NativeDropParams[] calldata _nativeDropParams,
uint256 _nativeDropGasLimit
) external payable onlyRole(ADMIN_ROLE) nonReentrant {
_nativeDrop(_origin, _dstEid, _oapp, _nativeDropParams, _nativeDropGasLimit);
}
function nativeDropAndExecute301(
Origin calldata _origin,
NativeDropParams[] calldata _nativeDropParams,
uint256 _nativeDropGasLimit,
bytes calldata _packet,
uint256 _gasLimit
) external payable onlyRole(ADMIN_ROLE) nonReentrant {
_nativeDrop(_origin, _packet.dstEid(), _packet.receiverB20(), _nativeDropParams, _nativeDropGasLimit);
IUltraLightNode301(receiveUln301).commitVerification(_packet, _gasLimit);
}
function execute301(bytes calldata _packet, uint256 _gasLimit) external onlyRole(ADMIN_ROLE) nonReentrant {
IUltraLightNode301(receiveUln301).commitVerification(_packet, _gasLimit);
}
function execute302(ExecutionParams calldata _executionParams) external payable onlyRole(ADMIN_ROLE) nonReentrant {
try
ILayerZeroEndpointV2(endpoint).lzReceive{ value: msg.value, gas: _executionParams.gasLimit }(
_executionParams.origin,
_executionParams.receiver,
_executionParams.guid,
_executionParams.message,
_executionParams.extraData
)
{
// do nothing
} catch (bytes memory reason) {
ILayerZeroEndpointV2(endpoint).lzReceiveAlert(
_executionParams.origin,
_executionParams.receiver,
_executionParams.guid,
_executionParams.gasLimit,
msg.value,
_executionParams.message,
_executionParams.extraData,
reason
);
}
}
function compose302(
address _from,
address _to,
bytes32 _guid,
uint16 _index,
bytes calldata _message,
bytes calldata _extraData,
uint256 _gasLimit
) external payable onlyRole(ADMIN_ROLE) nonReentrant {
try
ILayerZeroEndpointV2(endpoint).lzCompose{ value: msg.value, gas: _gasLimit }(
_from,
_to,
_guid,
_index,
_message,
_extraData
)
{
// do nothing
} catch (bytes memory reason) {
ILayerZeroEndpointV2(endpoint).lzComposeAlert(
_from,
_to,
_guid,
_index,
_gasLimit,
msg.value,
_message,
_extraData,
reason
);
}
}
function nativeDropAndExecute302(
NativeDropParams[] calldata _nativeDropParams,
uint256 _nativeDropGasLimit,
ExecutionParams calldata _executionParams
) external payable onlyRole(ADMIN_ROLE) nonReentrant {
uint256 spent = _nativeDrop(
_executionParams.origin,
localEidV2,
_executionParams.receiver,
_nativeDropParams,
_nativeDropGasLimit
);
uint256 value = msg.value - spent;
try
ILayerZeroEndpointV2(endpoint).lzReceive{ value: value, gas: _executionParams.gasLimit }(
_executionParams.origin,
_executionParams.receiver,
_executionParams.guid,
_executionParams.message,
_executionParams.extraData
)
{
// do nothing
} catch (bytes memory reason) {
ILayerZeroEndpointV2(endpoint).lzReceiveAlert(
_executionParams.origin,
_executionParams.receiver,
_executionParams.guid,
_executionParams.gasLimit,
value,
_executionParams.message,
_executionParams.extraData,
reason
);
}
}
// --- Message Lib ---
function assignJob(
uint32 _dstEid,
address _sender,
uint256 _calldataSize,
bytes calldata _options
) external onlyRole(MESSAGE_LIB_ROLE) onlyAcl(_sender) whenNotPaused returns (uint256 fee) {
IExecutorFeeLib.FeeParams memory params = IExecutorFeeLib.FeeParams(
priceFeed,
_dstEid,
_sender,
_calldataSize,
defaultMultiplierBps
);
fee = IExecutorFeeLib(workerFeeLib).getFeeOnSend(params, dstConfig[_dstEid], _options);
}
// assignJob for CmdLib
function assignJob(
address _sender,
bytes calldata _options
) external onlyRole(MESSAGE_LIB_ROLE) onlyAcl(_sender) whenNotPaused returns (uint256 fee) {
IExecutorFeeLib.FeeParamsForRead memory params = IExecutorFeeLib.FeeParamsForRead(
priceFeed,
_sender,
defaultMultiplierBps
);
fee = IExecutorFeeLib(workerFeeLib).getFeeOnSend(params, dstConfig[localEidV2], _options);
}
// --- Only ACL ---
function getFee(
uint32 _dstEid,
address _sender,
uint256 _calldataSize,
bytes calldata _options
) external view onlyAcl(_sender) whenNotPaused returns (uint256 fee) {
IExecutorFeeLib.FeeParams memory params = IExecutorFeeLib.FeeParams(
priceFeed,
_dstEid,
_sender,
_calldataSize,
defaultMultiplierBps
);
fee = IExecutorFeeLib(workerFeeLib).getFee(params, dstConfig[_dstEid], _options);
}
function getFee(
address _sender,
bytes calldata _options
) external view onlyAcl(_sender) whenNotPaused returns (uint256 fee) {
IExecutorFeeLib.FeeParamsForRead memory params = IExecutorFeeLib.FeeParamsForRead(
priceFeed,
_sender,
defaultMultiplierBps
);
fee = IExecutorFeeLib(workerFeeLib).getFee(params, dstConfig[localEidV2], _options);
}
function _nativeDrop(
Origin calldata _origin,
uint32 _dstEid,
address _oapp,
NativeDropParams[] calldata _nativeDropParams,
uint256 _nativeDropGasLimit
) internal returns (uint256 spent) {
bool[] memory success = new bool[](_nativeDropParams.length);
for (uint256 i = 0; i < _nativeDropParams.length; i++) {
NativeDropParams memory param = _nativeDropParams[i];
(bool sent, ) = param.receiver.call{ value: param.amount, gas: _nativeDropGasLimit }("");
success[i] = sent;
spent += param.amount;
}
emit NativeDropApplied(_origin, _dstEid, _oapp, _nativeDropParams, success);
}
}
node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol
// SPDX-License-Identifier: LZBL-1.2
pragma solidity ^0.8.20;
import { Packet } from "../../interfaces/ISendLib.sol";
import { AddressCast } from "../../libs/AddressCast.sol";
library PacketV1Codec {
using AddressCast for address;
using AddressCast for bytes32;
uint8 internal constant PACKET_VERSION = 1;
// header (version + nonce + path)
// version
uint256 private constant PACKET_VERSION_OFFSET = 0;
// nonce
uint256 private constant NONCE_OFFSET = 1;
// path
uint256 private constant SRC_EID_OFFSET = 9;
uint256 private constant SENDER_OFFSET = 13;
uint256 private constant DST_EID_OFFSET = 45;
uint256 private constant RECEIVER_OFFSET = 49;
// payload (guid + message)
uint256 private constant GUID_OFFSET = 81; // keccak256(nonce + path)
uint256 private constant MESSAGE_OFFSET = 113;
function encode(Packet memory _packet) internal pure returns (bytes memory encodedPacket) {
encodedPacket = abi.encodePacked(
PACKET_VERSION,
_packet.nonce,
_packet.srcEid,
_packet.sender.toBytes32(),
_packet.dstEid,
_packet.receiver,
_packet.guid,
_packet.message
);
}
function encodePacketHeader(Packet memory _packet) internal pure returns (bytes memory) {
return
abi.encodePacked(
PACKET_VERSION,
_packet.nonce,
_packet.srcEid,
_packet.sender.toBytes32(),
_packet.dstEid,
_packet.receiver
);
}
function encodePayload(Packet memory _packet) internal pure returns (bytes memory) {
return abi.encodePacked(_packet.guid, _packet.message);
}
function header(bytes calldata _packet) internal pure returns (bytes calldata) {
return _packet[0:GUID_OFFSET];
}
function version(bytes calldata _packet) internal pure returns (uint8) {
return uint8(bytes1(_packet[PACKET_VERSION_OFFSET:NONCE_OFFSET]));
}
function nonce(bytes calldata _packet) internal pure returns (uint64) {
return uint64(bytes8(_packet[NONCE_OFFSET:SRC_EID_OFFSET]));
}
function srcEid(bytes calldata _packet) internal pure returns (uint32) {
return uint32(bytes4(_packet[SRC_EID_OFFSET:SENDER_OFFSET]));
}
function sender(bytes calldata _packet) internal pure returns (bytes32) {
return bytes32(_packet[SENDER_OFFSET:DST_EID_OFFSET]);
}
function senderAddressB20(bytes calldata _packet) internal pure returns (address) {
return sender(_packet).toAddress();
}
function dstEid(bytes calldata _packet) internal pure returns (uint32) {
return uint32(bytes4(_packet[DST_EID_OFFSET:RECEIVER_OFFSET]));
}
function receiver(bytes calldata _packet) internal pure returns (bytes32) {
return bytes32(_packet[RECEIVER_OFFSET:GUID_OFFSET]);
}
function receiverB20(bytes calldata _packet) internal pure returns (address) {
return receiver(_packet).toAddress();
}
function guid(bytes calldata _packet) internal pure returns (bytes32) {
return bytes32(_packet[GUID_OFFSET:MESSAGE_OFFSET]);
}
function message(bytes calldata _packet) internal pure returns (bytes calldata) {
return bytes(_packet[MESSAGE_OFFSET:]);
}
function payload(bytes calldata _packet) internal pure returns (bytes calldata) {
return bytes(_packet[GUID_OFFSET:]);
}
function payloadHash(bytes calldata _packet) internal pure returns (bytes32) {
return keccak256(payload(_packet));
}
}
contracts/interfaces/ILayerZeroReadExecutor.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
interface ILayerZeroReadExecutor {
// @notice query price and assign jobs at the same time
// @param _sender - the source sending contract address. executors may apply price discrimination to senders
// @param _options - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain
function assignJob(address _sender, bytes calldata _options) external returns (uint256 fee);
// @notice query the executor price for executing the payload on this chain
// @param _sender - the source sending contract address. executors may apply price discrimination to senders
// @param _options - optional parameters for extra service plugins, e.g. sending dust tokens
function getFee(address _sender, bytes calldata _options) external view returns (uint256 fee);
}
node_modules/@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165Upgradeable {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
contracts/upgradeable/WorkerUpgradeable.sol
// SPDX-License-Identifier: LZBL-1.2
pragma solidity ^0.8.20;
import { PausableUpgradeable } from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { ISendLib } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol";
import { Transfer } from "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Transfer.sol";
import { IWorker } from "../interfaces/IWorker.sol";
abstract contract WorkerUpgradeable is Initializable, AccessControlUpgradeable, PausableUpgradeable, IWorker {
bytes32 internal constant MESSAGE_LIB_ROLE = keccak256("MESSAGE_LIB_ROLE");
bytes32 internal constant ALLOWLIST = keccak256("ALLOWLIST");
bytes32 internal constant DENYLIST = keccak256("DENYLIST");
bytes32 internal constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
address public workerFeeLib;
uint64 public allowlistSize;
uint16 public defaultMultiplierBps;
address public priceFeed;
mapping(uint32 eid => uint8[] optionTypes) internal supportedOptionTypes;
/// @param _messageLibs array of message lib addresses that are granted the MESSAGE_LIB_ROLE
/// @param _priceFeed price feed address
/// @param _defaultMultiplierBps default multiplier for worker fee
/// @param _roleAdmin address that is granted the DEFAULT_ADMIN_ROLE (can grant and revoke all roles)
/// @param _admins array of admin addresses that are granted the ADMIN_ROLE
function __Worker_init(
address[] memory _messageLibs,
address _priceFeed,
uint16 _defaultMultiplierBps,
address _roleAdmin,
address[] memory _admins
) internal onlyInitializing {
__Context_init_unchained();
__AccessControl_init_unchained();
__Pausable_init_unchained();
__Worker_init_unchained(_messageLibs, _priceFeed, _defaultMultiplierBps, _roleAdmin, _admins);
}
function __Worker_init_unchained(
address[] memory _messageLibs,
address _priceFeed,
uint16 _defaultMultiplierBps,
address _roleAdmin,
address[] memory _admins
) internal onlyInitializing {
defaultMultiplierBps = _defaultMultiplierBps;
priceFeed = _priceFeed;
if (_roleAdmin != address(0x0)) {
_grantRole(DEFAULT_ADMIN_ROLE, _roleAdmin); // _roleAdmin can grant and revoke all roles
}
for (uint256 i = 0; i < _messageLibs.length; ++i) {
_grantRole(MESSAGE_LIB_ROLE, _messageLibs[i]);
}
for (uint256 i = 0; i < _admins.length; ++i) {
_grantRole(ADMIN_ROLE, _admins[i]);
}
}
// ========================= Modifier =========================
modifier onlyAcl(address _sender) {
if (!hasAcl(_sender)) {
revert Worker_NotAllowed();
}
_;
}
/// @dev Access control list using allowlist and denylist
/// @dev 1) if one address is in the denylist -> deny
/// @dev 2) else if address in the allowlist OR allowlist is empty (allows everyone)-> allow
/// @dev 3) else deny
/// @param _sender address to check
function hasAcl(address _sender) public view returns (bool) {
if (hasRole(DENYLIST, _sender)) {
return false;
} else if (allowlistSize == 0 || hasRole(ALLOWLIST, _sender)) {
return true;
} else {
return false;
}
}
// ========================= OnyDefaultAdmin =========================
/// @dev flag to pause execution of workers (if used with whenNotPaused modifier)
/// @param _paused true to pause, false to unpause
function setPaused(bool _paused) external onlyRole(DEFAULT_ADMIN_ROLE) {
if (_paused) {
_pause();
} else {
_unpause();
}
}
// ========================= OnlyAdmin =========================
/// @param _priceFeed price feed address
function setPriceFeed(address _priceFeed) external onlyRole(ADMIN_ROLE) {
priceFeed = _priceFeed;
emit SetPriceFeed(_priceFeed);
}
/// @param _workerFeeLib worker fee lib address
function setWorkerFeeLib(address _workerFeeLib) external onlyRole(ADMIN_ROLE) {
workerFeeLib = _workerFeeLib;
emit SetWorkerLib(_workerFeeLib);
}
/// @param _multiplierBps default multiplier for worker fee
function setDefaultMultiplierBps(uint16 _multiplierBps) external onlyRole(ADMIN_ROLE) {
defaultMultiplierBps = _multiplierBps;
emit SetDefaultMultiplierBps(_multiplierBps);
}
/// @dev supports withdrawing fee from ULN301, ULN302 and more
/// @param _lib message lib address
/// @param _to address to withdraw fee to
/// @param _amount amount to withdraw
function withdrawFee(address _lib, address _to, uint256 _amount) external onlyRole(ADMIN_ROLE) {
if (!hasRole(MESSAGE_LIB_ROLE, _lib)) revert Worker_OnlyMessageLib();
ISendLib(_lib).withdrawFee(_to, _amount);
emit Withdraw(_lib, _to, _amount);
}
/// @dev supports withdrawing token from the contract
/// @param _token token address
/// @param _to address to withdraw token to
/// @param _amount amount to withdraw
function withdrawToken(address _token, address _to, uint256 _amount) external onlyRole(ADMIN_ROLE) {
// transfers native if _token is address(0x0)
Transfer.nativeOrToken(_token, _to, _amount);
}
function setSupportedOptionTypes(uint32 _eid, uint8[] calldata _optionTypes) external onlyRole(ADMIN_ROLE) {
supportedOptionTypes[_eid] = _optionTypes;
}
// ========================= View Functions =========================
function getSupportedOptionTypes(uint32 _eid) external view returns (uint8[] memory) {
return supportedOptionTypes[_eid];
}
// ========================= Internal Functions =========================
/// @dev overrides AccessControl to allow for counting of allowlistSize
/// @param _role role to grant
/// @param _account address to grant role to
function _grantRole(bytes32 _role, address _account) internal override {
if (_role == ALLOWLIST && !hasRole(_role, _account)) {
++allowlistSize;
}
super._grantRole(_role, _account);
}
/// @dev overrides AccessControl to allow for counting of allowlistSize
/// @param _role role to revoke
/// @param _account address to revoke role from
function _revokeRole(bytes32 _role, address _account) internal override {
if (_role == ALLOWLIST && hasRole(_role, _account)) {
--allowlistSize;
}
super._revokeRole(_role, _account);
}
/// @dev overrides AccessControl to disable renouncing of roles
function renounceRole(bytes32 /*role*/, address /*account*/) public pure override {
revert Worker_RoleRenouncingDisabled();
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[47] private __gap;
}
contracts/uln/uln301/interfaces/IUltraLightNode301.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
interface IUltraLightNode301 {
function commitVerification(bytes calldata _packet, uint256 _gasLimit) external;
}
node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol
// SPDX-License-Identifier: LZBL-1.2
pragma solidity ^0.8.20;
library AddressCast {
error AddressCast_InvalidSizeForAddress();
error AddressCast_InvalidAddress();
function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) {
if (_addressBytes.length > 32) revert AddressCast_InvalidAddress();
result = bytes32(_addressBytes);
unchecked {
uint256 offset = 32 - _addressBytes.length;
result = result >> (offset * 8);
}
}
function toBytes32(address _address) internal pure returns (bytes32 result) {
result = bytes32(uint256(uint160(_address)));
}
function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) {
if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress();
result = new bytes(_size);
unchecked {
uint256 offset = 256 - _size * 8;
assembly {
mstore(add(result, 32), shl(offset, _addressBytes32))
}
}
}
function toAddress(bytes32 _addressBytes32) internal pure returns (address result) {
result = address(uint160(uint256(_addressBytes32)));
}
function toAddress(bytes calldata _addressBytes) internal pure returns (address result) {
if (_addressBytes.length != 20) revert AddressCast_InvalidAddress();
result = address(bytes20(_addressBytes));
}
}
node_modules/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../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 {
}
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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
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 proxied contracts do not make use of 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.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* 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 prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}
contracts/interfaces/IExecutor.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import { Origin } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";
import { IWorker } from "./IWorker.sol";
import { ILayerZeroExecutor } from "./ILayerZeroExecutor.sol";
import { ILayerZeroReadExecutor } from "./ILayerZeroReadExecutor.sol";
interface IExecutor is IWorker, ILayerZeroExecutor, ILayerZeroReadExecutor {
struct DstConfigParam {
uint32 dstEid;
uint64 lzReceiveBaseGas;
uint64 lzComposeBaseGas;
uint16 multiplierBps;
uint128 floorMarginUSD;
uint128 nativeCap;
}
struct DstConfig {
uint64 lzReceiveBaseGas;
uint16 multiplierBps;
uint128 floorMarginUSD; // uses priceFeed PRICE_RATIO_DENOMINATOR
uint128 nativeCap;
uint64 lzComposeBaseGas;
}
struct ExecutionParams {
address receiver;
Origin origin;
bytes32 guid;
bytes message;
bytes extraData;
uint256 gasLimit;
}
struct NativeDropParams {
address receiver;
uint256 amount;
}
event DstConfigSet(DstConfigParam[] params);
event NativeDropApplied(Origin origin, uint32 dstEid, address oapp, NativeDropParams[] params, bool[] success);
function dstConfig(uint32 _dstEid) external view returns (uint64, uint16, uint128, uint128, uint64);
}
contracts/interfaces/IWorker.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
interface IWorker {
event SetWorkerLib(address workerLib);
event SetPriceFeed(address priceFeed);
event SetDefaultMultiplierBps(uint16 multiplierBps);
event SetSupportedOptionTypes(uint32 dstEid, uint8[] optionTypes);
event Withdraw(address lib, address to, uint256 amount);
error Worker_NotAllowed();
error Worker_OnlyMessageLib();
error Worker_RoleRenouncingDisabled();
function setPriceFeed(address _priceFeed) external;
function priceFeed() external view returns (address);
function setDefaultMultiplierBps(uint16 _multiplierBps) external;
function defaultMultiplierBps() external view returns (uint16);
function withdrawFee(address _lib, address _to, uint256 _amount) external;
function setSupportedOptionTypes(uint32 _eid, uint8[] calldata _optionTypes) external;
function getSupportedOptionTypes(uint32 _eid) external view returns (uint8[] memory);
}
node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 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://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or 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 {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLib.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import { SetConfigParam } from "./IMessageLibManager.sol";
enum MessageLibType {
Send,
Receive,
SendAndReceive
}
interface IMessageLib is IERC165 {
function setConfig(address _oapp, SetConfigParam[] calldata _config) external;
function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config);
function isSupportedEid(uint32 _eid) external view returns (bool);
// message libs of same major version are compatible
function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion);
function messageLibType() external view returns (MessageLibType);
}
node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
interface IMessagingComposer {
event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message);
event ComposeDelivered(address from, address to, bytes32 guid, uint16 index);
event LzComposeAlert(
address indexed from,
address indexed to,
address indexed executor,
bytes32 guid,
uint16 index,
uint256 gas,
uint256 value,
bytes message,
bytes extraData,
bytes reason
);
function composeQueue(
address _from,
address _to,
bytes32 _guid,
uint16 _index
) external view returns (bytes32 messageHash);
function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external;
function lzCompose(
address _from,
address _to,
bytes32 _guid,
uint16 _index,
bytes calldata _message,
bytes calldata _extraData
) external payable;
}
node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import { IMessageLibManager } from "./IMessageLibManager.sol";
import { IMessagingComposer } from "./IMessagingComposer.sol";
import { IMessagingChannel } from "./IMessagingChannel.sol";
import { IMessagingContext } from "./IMessagingContext.sol";
struct MessagingParams {
uint32 dstEid;
bytes32 receiver;
bytes message;
bytes options;
bool payInLzToken;
}
struct MessagingReceipt {
bytes32 guid;
uint64 nonce;
MessagingFee fee;
}
struct MessagingFee {
uint256 nativeFee;
uint256 lzTokenFee;
}
struct Origin {
uint32 srcEid;
bytes32 sender;
uint64 nonce;
}
interface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext {
event PacketSent(bytes encodedPayload, bytes options, address sendLibrary);
event PacketVerified(Origin origin, address receiver, bytes32 payloadHash);
event PacketDelivered(Origin origin, address receiver);
event LzReceiveAlert(
address indexed receiver,
address indexed executor,
Origin origin,
bytes32 guid,
uint256 gas,
uint256 value,
bytes message,
bytes extraData,
bytes reason
);
event LzTokenSet(address token);
event DelegateSet(address sender, address delegate);
function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory);
function send(
MessagingParams calldata _params,
address _refundAddress
) external payable returns (MessagingReceipt memory);
function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external;
function verifiable(Origin calldata _origin, address _receiver) external view returns (bool);
function initializable(Origin calldata _origin, address _receiver) external view returns (bool);
function lzReceive(
Origin calldata _origin,
address _receiver,
bytes32 _guid,
bytes calldata _message,
bytes calldata _extraData
) external payable;
// oapp can burn messages partially by calling this function with its own business logic if messages are verified in order
function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;
function setLzToken(address _lzToken) external;
function lzToken() external view returns (address);
function nativeToken() external view returns (address);
function setDelegate(address _delegate) external;
}
node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
interface IMessagingContext {
function isSendingMessage() external view returns (bool);
function getSendContext() external view returns (uint32 dstEid, address sender);
}
node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
/**
* @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.
*/
function __Pausable_init() internal onlyInitializing {
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal onlyInitializing {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
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(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
interface IMessagingChannel {
event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);
event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);
event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);
function eid() external view returns (uint32);
// this is an emergency function if a message cannot be verified for some reasons
// required to provide _nextNonce to avoid race condition
function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;
function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;
function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;
function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);
function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);
function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);
function inboundPayloadHash(
address _receiver,
uint32 _srcEid,
bytes32 _sender,
uint64 _nonce
) external view returns (bytes32);
function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);
}
node_modules/@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library MathUpgradeable {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}
node_modules/@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/MathUpgradeable.sol";
import "./math/SignedMathUpgradeable.sol";
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = MathUpgradeable.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, MathUpgradeable.log256(value) + 1);
}
}
/**
* @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] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}
node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import { MessagingFee } from "./ILayerZeroEndpointV2.sol";
import { IMessageLib } from "./IMessageLib.sol";
struct Packet {
uint64 nonce;
uint32 srcEid;
address sender;
uint32 dstEid;
bytes32 receiver;
bytes32 guid;
bytes message;
}
interface ISendLib is IMessageLib {
function send(
Packet calldata _packet,
bytes calldata _options,
bool _payInLzToken
) external returns (MessagingFee memory, bytes memory encodedPacket);
function quote(
Packet calldata _packet,
bytes calldata _options,
bool _payInLzToken
) external view returns (MessagingFee memory);
function setTreasury(address _treasury) external;
function withdrawFee(address _to, uint256 _amount) external;
function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external;
}
node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}
node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
struct SetConfigParam {
uint32 eid;
uint32 configType;
bytes config;
}
interface IMessageLibManager {
struct Timeout {
address lib;
uint256 expiry;
}
event LibraryRegistered(address newLib);
event DefaultSendLibrarySet(uint32 eid, address newLib);
event DefaultReceiveLibrarySet(uint32 eid, address newLib);
event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry);
event SendLibrarySet(address sender, uint32 eid, address newLib);
event ReceiveLibrarySet(address receiver, uint32 eid, address newLib);
event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout);
function registerLibrary(address _lib) external;
function isRegisteredLibrary(address _lib) external view returns (bool);
function getRegisteredLibraries() external view returns (address[] memory);
function setDefaultSendLibrary(uint32 _eid, address _newLib) external;
function defaultSendLibrary(uint32 _eid) external view returns (address);
function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _timeout) external;
function defaultReceiveLibrary(uint32 _eid) external view returns (address);
function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external;
function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry);
function isSupportedEid(uint32 _eid) external view returns (bool);
function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool);
/// ------------------- OApp interfaces -------------------
function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external;
function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib);
function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool);
function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external;
function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault);
function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _gracePeriod) external;
function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry);
function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external;
function getConfig(
address _oapp,
address _lib,
uint32 _eid,
uint32 _configType
) external view returns (bytes memory config);
}
node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuardUpgradeable is Initializable {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
node_modules/hardhat-deploy/solc_0.8/proxy/Proxied.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Proxied {
/// @notice to be used by initialisation / postUpgrade function so that only the proxy's admin can execute them
/// It also allows these functions to be called inside a contructor
/// even if the contract is meant to be used without proxy
modifier proxied() {
address proxyAdminAddress = _proxyAdmin();
// With hardhat-deploy proxies
// the proxyAdminAddress is zero only for the implementation contract
// if the implementation contract want to be used as a standalone/immutable contract
// it simply has to execute the `proxied` function
// This ensure the proxyAdminAddress is never zero post deployment
// And allow you to keep the same code for both proxied contract and immutable contract
if (proxyAdminAddress == address(0)) {
// ensure can not be called twice when used outside of proxy : no admin
// solhint-disable-next-line security/no-inline-assembly
assembly {
sstore(
0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
)
}
} else {
require(msg.sender == proxyAdminAddress);
}
_;
}
modifier onlyProxyAdmin() {
require(msg.sender == _proxyAdmin(), "NOT_AUTHORIZED");
_;
}
function _proxyAdmin() internal view returns (address ownerAddress) {
// solhint-disable-next-line security/no-inline-assembly
assembly {
ownerAddress := sload(0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103)
}
}
}
node_modules/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* 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:
*
* ```solidity
* 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}:
*
* ```solidity
* 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. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
function __AccessControl_init() internal onlyInitializing {
}
function __AccessControl_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
StringsUpgradeable.toHexString(account),
" is missing role ",
StringsUpgradeable.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @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 virtual override 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.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_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.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_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 revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address account) public virtual override {
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.
*
* May emit a {RoleGranted} event.
*
* [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}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
contracts/interfaces/IExecutorFeeLib.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import { IExecutor } from "./IExecutor.sol";
interface IExecutorFeeLib {
struct FeeParams {
address priceFeed;
uint32 dstEid;
address sender;
uint256 calldataSize;
uint16 defaultMultiplierBps;
}
struct FeeParamsForRead {
address priceFeed;
address sender;
uint16 defaultMultiplierBps;
}
error Executor_NoOptions();
error Executor_NativeAmountExceedsCap(uint256 amount, uint256 cap);
error Executor_UnsupportedOptionType(uint8 optionType);
error Executor_InvalidExecutorOptions(uint256 cursor);
error Executor_ZeroLzReceiveGasProvided();
error Executor_ZeroLzComposeGasProvided();
error Executor_ZeroCalldataSizeProvided();
error Executor_EidNotSupported(uint32 eid);
function getFeeOnSend(
FeeParams calldata _params,
IExecutor.DstConfig calldata _dstConfig,
bytes calldata _options
) external returns (uint256 fee);
function getFee(
FeeParams calldata _params,
IExecutor.DstConfig calldata _dstConfig,
bytes calldata _options
) external view returns (uint256 fee);
function getFeeOnSend(
FeeParamsForRead calldata _params,
IExecutor.DstConfig calldata _dstConfig,
bytes calldata _options
) external returns (uint256 fee);
function getFee(
FeeParamsForRead calldata _params,
IExecutor.DstConfig calldata _dstConfig,
bytes calldata _options
) external view returns (uint256 fee);
function version() external view returns (uint64 major, uint8 minor);
}
contracts/interfaces/ILayerZeroExecutor.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
interface ILayerZeroExecutor {
// @notice query price and assign jobs at the same time
// @param _dstEid - the destination endpoint identifier
// @param _sender - the source sending contract address. executors may apply price discrimination to senders
// @param _calldataSize - dynamic data size of message + caller params
// @param _options - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain
function assignJob(
uint32 _dstEid,
address _sender,
uint256 _calldataSize,
bytes calldata _options
) external returns (uint256 price);
// @notice query the executor price for relaying the payload and its proof to the destination chain
// @param _dstEid - the destination endpoint identifier
// @param _sender - the source sending contract address. executors may apply price discrimination to senders
// @param _calldataSize - dynamic data size of message + caller params
// @param _options - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain
function getFee(
uint32 _dstEid,
address _sender,
uint256 _calldataSize,
bytes calldata _options
) external view returns (uint256 price);
}
node_modules/@openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 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://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or 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 {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
node_modules/@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_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) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @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) external;
/**
* @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) external;
/**
* @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) external;
}
node_modules/@openzeppelin/contracts-upgradeable/utils/math/SignedMathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMathUpgradeable {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}
node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Transfer.sol
// SPDX-License-Identifier: LZBL-1.2
pragma solidity ^0.8.20;
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
library Transfer {
using SafeERC20 for IERC20;
address internal constant ADDRESS_ZERO = address(0);
error Transfer_NativeFailed(address _to, uint256 _value);
error Transfer_ToAddressIsZero();
function native(address _to, uint256 _value) internal {
if (_to == ADDRESS_ZERO) revert Transfer_ToAddressIsZero();
(bool success, ) = _to.call{ value: _value }("");
if (!success) revert Transfer_NativeFailed(_to, _value);
}
function token(address _token, address _to, uint256 _value) internal {
if (_to == ADDRESS_ZERO) revert Transfer_ToAddressIsZero();
IERC20(_token).safeTransfer(_to, _value);
}
function nativeOrToken(address _token, address _to, uint256 _value) internal {
if (_token == ADDRESS_ZERO) {
native(_to, _value);
} else {
token(_token, _to, _value);
}
}
}
Compiler Settings
{"viaIR":false,"remappings":["@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/","@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/","solidity-bytes-utils/=node_modules/solidity-bytes-utils/","hardhat-deploy/=node_modules/hardhat-deploy/","@layerzerolabs/lz-evm-protocol-v2/=node_modules/@layerzerolabs/lz-evm-protocol-v2/","@layerzerolabs/lz-evm-v1-0.7/=node_modules/@layerzerolabs/lz-evm-v1-0.7/","@axelar-network/axelar-gmp-sdk-solidity/=node_modules/@axelar-network/axelar-gmp-sdk-solidity/","@chainlink/contracts-ccip/=node_modules/@chainlink/contracts-ccip/","forge-std/=/Users/simonperriard/Documents/Work/LayerZero-v2/lib/forge-std/src/"],"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":20000,"enabled":true},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"libraries":{},"evmVersion":"paris"}
Contract ABI
[{"type":"error","name":"Transfer_NativeFailed","inputs":[{"type":"address","name":"_to","internalType":"address"},{"type":"uint256","name":"_value","internalType":"uint256"}]},{"type":"error","name":"Transfer_ToAddressIsZero","inputs":[]},{"type":"error","name":"Worker_NotAllowed","inputs":[]},{"type":"error","name":"Worker_OnlyMessageLib","inputs":[]},{"type":"error","name":"Worker_RoleRenouncingDisabled","inputs":[]},{"type":"event","name":"DstConfigSet","inputs":[{"type":"tuple[]","name":"params","internalType":"struct IExecutor.DstConfigParam[]","indexed":false,"components":[{"type":"uint32","name":"dstEid","internalType":"uint32"},{"type":"uint64","name":"lzReceiveBaseGas","internalType":"uint64"},{"type":"uint64","name":"lzComposeBaseGas","internalType":"uint64"},{"type":"uint16","name":"multiplierBps","internalType":"uint16"},{"type":"uint128","name":"floorMarginUSD","internalType":"uint128"},{"type":"uint128","name":"nativeCap","internalType":"uint128"}]}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"NativeDropApplied","inputs":[{"type":"tuple","name":"origin","internalType":"struct Origin","indexed":false,"components":[{"type":"uint32","name":"srcEid","internalType":"uint32"},{"type":"bytes32","name":"sender","internalType":"bytes32"},{"type":"uint64","name":"nonce","internalType":"uint64"}]},{"type":"uint32","name":"dstEid","internalType":"uint32","indexed":false},{"type":"address","name":"oapp","internalType":"address","indexed":false},{"type":"tuple[]","name":"params","internalType":"struct IExecutor.NativeDropParams[]","indexed":false,"components":[{"type":"address","name":"receiver","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"bool[]","name":"success","internalType":"bool[]","indexed":false}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","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":"SetDefaultMultiplierBps","inputs":[{"type":"uint16","name":"multiplierBps","internalType":"uint16","indexed":false}],"anonymous":false},{"type":"event","name":"SetPriceFeed","inputs":[{"type":"address","name":"priceFeed","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"SetSupportedOptionTypes","inputs":[{"type":"uint32","name":"dstEid","internalType":"uint32","indexed":false},{"type":"uint8[]","name":"optionTypes","internalType":"uint8[]","indexed":false}],"anonymous":false},{"type":"event","name":"SetWorkerLib","inputs":[{"type":"address","name":"workerLib","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"address","name":"lib","internalType":"address","indexed":false},{"type":"address","name":"to","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","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":"uint64","name":"","internalType":"uint64"}],"name":"allowlistSize","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"fee","internalType":"uint256"}],"name":"assignJob","inputs":[{"type":"uint32","name":"_dstEid","internalType":"uint32"},{"type":"address","name":"_sender","internalType":"address"},{"type":"uint256","name":"_calldataSize","internalType":"uint256"},{"type":"bytes","name":"_options","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"fee","internalType":"uint256"}],"name":"assignJob","inputs":[{"type":"address","name":"_sender","internalType":"address"},{"type":"bytes","name":"_options","internalType":"bytes"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"compose302","inputs":[{"type":"address","name":"_from","internalType":"address"},{"type":"address","name":"_to","internalType":"address"},{"type":"bytes32","name":"_guid","internalType":"bytes32"},{"type":"uint16","name":"_index","internalType":"uint16"},{"type":"bytes","name":"_message","internalType":"bytes"},{"type":"bytes","name":"_extraData","internalType":"bytes"},{"type":"uint256","name":"_gasLimit","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint16","name":"","internalType":"uint16"}],"name":"defaultMultiplierBps","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint64","name":"lzReceiveBaseGas","internalType":"uint64"},{"type":"uint16","name":"multiplierBps","internalType":"uint16"},{"type":"uint128","name":"floorMarginUSD","internalType":"uint128"},{"type":"uint128","name":"nativeCap","internalType":"uint128"},{"type":"uint64","name":"lzComposeBaseGas","internalType":"uint64"}],"name":"dstConfig","inputs":[{"type":"uint32","name":"dstEid","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"endpoint","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"execute301","inputs":[{"type":"bytes","name":"_packet","internalType":"bytes"},{"type":"uint256","name":"_gasLimit","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"execute302","inputs":[{"type":"tuple","name":"_executionParams","internalType":"struct IExecutor.ExecutionParams","components":[{"type":"address","name":"receiver","internalType":"address"},{"type":"tuple","name":"origin","internalType":"struct Origin","components":[{"type":"uint32","name":"srcEid","internalType":"uint32"},{"type":"bytes32","name":"sender","internalType":"bytes32"},{"type":"uint64","name":"nonce","internalType":"uint64"}]},{"type":"bytes32","name":"guid","internalType":"bytes32"},{"type":"bytes","name":"message","internalType":"bytes"},{"type":"bytes","name":"extraData","internalType":"bytes"},{"type":"uint256","name":"gasLimit","internalType":"uint256"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"fee","internalType":"uint256"}],"name":"getFee","inputs":[{"type":"uint32","name":"_dstEid","internalType":"uint32"},{"type":"address","name":"_sender","internalType":"address"},{"type":"uint256","name":"_calldataSize","internalType":"uint256"},{"type":"bytes","name":"_options","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"fee","internalType":"uint256"}],"name":"getFee","inputs":[{"type":"address","name":"_sender","internalType":"address"},{"type":"bytes","name":"_options","internalType":"bytes"}]},{"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":"uint8[]","name":"","internalType":"uint8[]"}],"name":"getSupportedOptionTypes","inputs":[{"type":"uint32","name":"_eid","internalType":"uint32"}]},{"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":"hasAcl","inputs":[{"type":"address","name":"_sender","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":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_endpoint","internalType":"address"},{"type":"address","name":"_receiveUln301","internalType":"address"},{"type":"address[]","name":"_messageLibs","internalType":"address[]"},{"type":"address","name":"_priceFeed","internalType":"address"},{"type":"address","name":"_roleAdmin","internalType":"address"},{"type":"address[]","name":"_admins","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"localEidV2","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"nativeDrop","inputs":[{"type":"tuple","name":"_origin","internalType":"struct Origin","components":[{"type":"uint32","name":"srcEid","internalType":"uint32"},{"type":"bytes32","name":"sender","internalType":"bytes32"},{"type":"uint64","name":"nonce","internalType":"uint64"}]},{"type":"uint32","name":"_dstEid","internalType":"uint32"},{"type":"address","name":"_oapp","internalType":"address"},{"type":"tuple[]","name":"_nativeDropParams","internalType":"struct IExecutor.NativeDropParams[]","components":[{"type":"address","name":"receiver","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"uint256","name":"_nativeDropGasLimit","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"nativeDropAndExecute301","inputs":[{"type":"tuple","name":"_origin","internalType":"struct Origin","components":[{"type":"uint32","name":"srcEid","internalType":"uint32"},{"type":"bytes32","name":"sender","internalType":"bytes32"},{"type":"uint64","name":"nonce","internalType":"uint64"}]},{"type":"tuple[]","name":"_nativeDropParams","internalType":"struct IExecutor.NativeDropParams[]","components":[{"type":"address","name":"receiver","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"uint256","name":"_nativeDropGasLimit","internalType":"uint256"},{"type":"bytes","name":"_packet","internalType":"bytes"},{"type":"uint256","name":"_gasLimit","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"nativeDropAndExecute302","inputs":[{"type":"tuple[]","name":"_nativeDropParams","internalType":"struct IExecutor.NativeDropParams[]","components":[{"type":"address","name":"receiver","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"uint256","name":"_nativeDropGasLimit","internalType":"uint256"},{"type":"tuple","name":"_executionParams","internalType":"struct IExecutor.ExecutionParams","components":[{"type":"address","name":"receiver","internalType":"address"},{"type":"tuple","name":"origin","internalType":"struct Origin","components":[{"type":"uint32","name":"srcEid","internalType":"uint32"},{"type":"bytes32","name":"sender","internalType":"bytes32"},{"type":"uint64","name":"nonce","internalType":"uint64"}]},{"type":"bytes32","name":"guid","internalType":"bytes32"},{"type":"bytes","name":"message","internalType":"bytes"},{"type":"bytes","name":"extraData","internalType":"bytes"},{"type":"uint256","name":"gasLimit","internalType":"uint256"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"onUpgrade","inputs":[{"type":"address","name":"_receiveUln301","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"priceFeed","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"receiveUln301","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"},{"type":"address","name":"","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":"setDefaultMultiplierBps","inputs":[{"type":"uint16","name":"_multiplierBps","internalType":"uint16"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDstConfig","inputs":[{"type":"tuple[]","name":"_params","internalType":"struct IExecutor.DstConfigParam[]","components":[{"type":"uint32","name":"dstEid","internalType":"uint32"},{"type":"uint64","name":"lzReceiveBaseGas","internalType":"uint64"},{"type":"uint64","name":"lzComposeBaseGas","internalType":"uint64"},{"type":"uint16","name":"multiplierBps","internalType":"uint16"},{"type":"uint128","name":"floorMarginUSD","internalType":"uint128"},{"type":"uint128","name":"nativeCap","internalType":"uint128"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPaused","inputs":[{"type":"bool","name":"_paused","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPriceFeed","inputs":[{"type":"address","name":"_priceFeed","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSupportedOptionTypes","inputs":[{"type":"uint32","name":"_eid","internalType":"uint32"},{"type":"uint8[]","name":"_optionTypes","internalType":"uint8[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWorkerFeeLib","inputs":[{"type":"address","name":"_workerFeeLib","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawFee","inputs":[{"type":"address","name":"_lib","internalType":"address"},{"type":"address","name":"_to","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawToken","inputs":[{"type":"address","name":"_token","internalType":"address"},{"type":"address","name":"_to","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"workerFeeLib","inputs":[]}]
Contract Creation Code
0x608060405234801561001057600080fd5b50614c73806100206000396000f3fe6080604052600436106102835760003560e01c8063724e78da11610153578063c358de0a116100cb578063cfc325701161007f578063d547741f11610064578063d547741f14610881578063e395eb5c146108a1578063fa34c84e146108ec57600080fd5b8063cfc325701461081c578063d2ae21041461082f57600080fd5b8063c7b2370b116100b0578063c7b2370b146107bc578063c8f8dcd1146107dc578063cd88b903146107fc57600080fd5b8063c358de0a1461076f578063c416aa511461078f57600080fd5b806391d1485411610122578063a217fddf11610107578063a217fddf1461070c578063c015bb7d14610721578063c2803b2c1461074157600080fd5b806391d14854146105dc5780639e9449651461062f57600080fd5b8063724e78da14610569578063741bef1a146105895780637cd44734146105b65780638624ba07146105c957600080fd5b80632f2ff15d11610201578063475b6d9e116101b55780635e280f111161019a5780635e280f11146104d6578063709eb66414610529578063717e8a421461054957600080fd5b8063475b6d9e146104ab5780635c975abb146104be57600080fd5b806336568abe116101e657806336568abe146104585780633927c075146104785780633d85ac331461048b57600080fd5b80632f2ff15d146104185780633146646a1461043857600080fd5b80631095b6d711610258578063248a9ca31161023d578063248a9ca31461038d57806326e67a37146103cb5780632de11376146103f857600080fd5b80631095b6d71461034d57806316c38b3c1461036d57600080fd5b80629fc68114610288578062bf2e80146102aa57806301e33667146102fd57806301ffc9a71461031d575b600080fd5b34801561029457600080fd5b506102a86102a3366004613a59565b61090c565b005b3480156102b657600080fd5b5060c9546102e5907c0100000000000000000000000000000000000000000000000000000000900461ffff1681565b60405161ffff90911681526020015b60405180910390f35b34801561030957600080fd5b506102a8610318366004613afe565b610cab565b34801561032957600080fd5b5061033d610338366004613b3a565b610ce6565b60405190151581526020016102f4565b34801561035957600080fd5b506102a8610368366004613afe565b610d7f565b34801561037957600080fd5b506102a8610388366004613b8a565b610f0e565b34801561039957600080fd5b506103bd6103a8366004613ba7565b60009081526065602052604090206001015490565b6040519081526020016102f4565b3480156103d757600080fd5b506103eb6103e6366004613bd2565b610f33565b6040516102f49190613bef565b34801561040457600080fd5b5061033d610413366004613c36565b610fba565b34801561042457600080fd5b506102a8610433366004613c51565b61109e565b34801561044457600080fd5b506102a8610453366004613cc6565b6110c8565b34801561046457600080fd5b506102a8610473366004613c51565b611191565b6102a8610486366004613d6f565b6111c3565b34801561049757600080fd5b506102a86104a6366004613e4d565b6112ad565b6102a86104b9366004613f55565b611493565b3480156104ca57600080fd5b5060975460ff1661033d565b3480156104e257600080fd5b5061012e546105049073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102f4565b34801561053557600080fd5b506103bd610544366004613fd6565b6114e7565b34801561055557600080fd5b506103bd610564366004613fd6565b611640565b34801561057557600080fd5b506102a8610584366004613c36565b6117c6565b34801561059557600080fd5b5060ca546105049073ffffffffffffffffffffffffffffffffffffffff1681565b6102a86105c4366004614047565b611863565b6102a86105d736600461410d565b611a18565b3480156105e857600080fd5b5061033d6105f7366004613c51565b600091825260656020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b34801561063b57600080fd5b506106bf61064a366004613bd2565b61012d602052600090815260409020805460019091015467ffffffffffffffff8083169261ffff68010000000000000000820416926fffffffffffffffffffffffffffffffff6a0100000000000000000000909204821692918116917001000000000000000000000000000000009091041685565b6040805167ffffffffffffffff968716815261ffff90951660208601526fffffffffffffffffffffffffffffffff938416908501529116606083015291909116608082015260a0016102f4565b34801561071857600080fd5b506103bd600081565b34801561072d57600080fd5b506103bd61073c366004614180565b611c2e565b34801561074d57600080fd5b5061012f546105049073ffffffffffffffffffffffffffffffffffffffff1681565b34801561077b57600080fd5b506102a861078a3660046141d3565b611dc2565b34801561079b57600080fd5b5060c9546105049073ffffffffffffffffffffffffffffffffffffffff1681565b3480156107c857600080fd5b506102a86107d7366004613c36565b611e6f565b3480156107e857600080fd5b506103bd6107f7366004614180565b611f0c565b34801561080857600080fd5b506102a86108173660046141ee565b612073565b6102a861082a366004614276565b6120bd565b34801561083b57600080fd5b5060c9546108689074010000000000000000000000000000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016102f4565b34801561088d57600080fd5b506102a861089c366004613c51565b612279565b3480156108ad57600080fd5b5061012e546108d79074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff90911681526020016102f4565b3480156108f857600080fd5b506102a8610907366004613c36565b61229e565b60006109367fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b905073ffffffffffffffffffffffffffffffffffffffff811661098f5773ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103556109b1565b3373ffffffffffffffffffffffffffffffffffffffff8216146109b157600080fd5b600054610100900460ff16158080156109d15750600054600160ff909116105b806109eb5750303b1580156109eb575060005460ff166001145b610a7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610ada57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610ae261238c565b610af18686612ee0878761242d565b61012e80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a16908117909155604080517f416ecebf000000000000000000000000000000000000000000000000000000008152905163416ecebf916004808201926020929091908290030181865afa158015610b89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bad91906142ab565b61012e80547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff939093169290920291909117905561012f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff89161790558015610ca157600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610cd5816124e9565b610ce08484846124f6565b50505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b000000000000000000000000000000000000000000000000000000001480610d7957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610da9816124e9565b73ffffffffffffffffffffffffffffffffffffffff841660009081527fe3a3b2721d010eec8988605a93cd7c15d969808c0e2b42f6155dc2b4fa13c081602052604090205460ff16610e27576040517f5ee08b9700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517ffd9be52200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820184905285169063fd9be52290604401600060405180830381600087803b158015610e9757600080fd5b505af1158015610eab573d6000803e3d6000fd5b50506040805173ffffffffffffffffffffffffffffffffffffffff8089168252871660208201529081018590527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9250606001905060405180910390a150505050565b6000610f19816124e9565b8115610f2b57610f27612526565b5050565b610f276125ab565b63ffffffff8116600090815260cb6020908152604091829020805483518184028101840190945280845260609392830182828015610fae57602002820191906000526020600020906000905b825461010083900a900460ff16815260206001928301818104948501949093039092029101808411610f7f5790505b50505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff811660009081527f0f6a9529577ef7bf1cbc8fccda1cc3c881f755c7e92e34c7c4deac1fa3c1c791602052604081205460ff161561100f57506000919050565b60c95474010000000000000000000000000000000000000000900467ffffffffffffffff161580611084575073ffffffffffffffffffffffffffffffffffffffff821660009081527f35c5067391a9036240763c1067bfa438a7b0131204a675a2fe562dd73782ce85602052604090205460ff165b1561109157506001919050565b506000919050565b919050565b6000828152606560205260409020600101546110b9816124e9565b6110c38383612602565b505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756110f2816124e9565b6110fa6126c9565b61012f546040517fe65106f800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063e65106f89061115590879087908790600401614311565b600060405180830381600087803b15801561116f57600080fd5b505af1158015611183573d6000803e3d6000fd5b50505050610ce0600160fb55565b6040517fdec9f03100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756111ed816124e9565b6111f56126c9565b611215886112038686612743565b61120d8787612766565b8a8a8a61277f565b5061012f546040517fe65106f800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063e65106f89061127190879087908790600401614311565b600060405180830381600087803b15801561128b57600080fd5b505af115801561129f573d6000803e3d6000fd5b50505050610ca1600160fb55565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756112d7816124e9565b60005b82518110156114575760008382815181106112f7576112f7614335565b6020908102919091018101516040805160a080820183528385015167ffffffffffffffff908116835260608086015161ffff9081168589019081526080808901516fffffffffffffffffffffffffffffffff908116888a01908152968a01518116948801948552888a01518616918801918252985163ffffffff16600090815261012d909a5296909820945185549851945188166a0100000000000000000000027fffffffffffff00000000000000000000000000000000ffffffffffffffffffff9590921668010000000000000000027fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000090991690841617979097179290921695909517825551600191820180549351909516700100000000000000000000000000000000027fffffffffffffffff000000000000000000000000000000000000000000000000909316931692909217179091559190910190506112da565b507fb99f6de5e22c60c178b03bfacf2daeb4b6089f5b37e0fe2c48a5d5141191fc53826040516114879190614364565b60405180910390a15050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756114bd816124e9565b6114c56126c9565b6114d387878787878761277f565b506114de600160fb55565b50505050505050565b6000846114f381610fba565b611529576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115316128f4565b6040805160a08101825260ca5473ffffffffffffffffffffffffffffffffffffffff908116825263ffffffff8a1660208084018290528a831684860152606084018a905260c95461ffff7c01000000000000000000000000000000000000000000000000000000008204166080860152600092835261012d9091529084902093517f434ee016000000000000000000000000000000000000000000000000000000008152929391169163434ee016916115f3918591908a908a9060040161440b565b602060405180830381865afa158015611610573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163491906144c9565b98975050505050505050565b60007f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de61166c816124e9565b8561167681610fba565b6116ac576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6116b46128f4565b6040805160a08101825260ca5473ffffffffffffffffffffffffffffffffffffffff908116825263ffffffff8b1660208084018290528b831684860152606084018b905260c95461ffff7c01000000000000000000000000000000000000000000000000000000008204166080860152600092835261012d9091529084902093517f566ef762000000000000000000000000000000000000000000000000000000008152929391169163566ef76291611776918591908b908b9060040161440b565b6020604051808303816000875af1158015611795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b991906144c9565b9998505050505050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756117f0816124e9565b60ca80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040519081527ff724a45d041687842411f2b977ef22ab8f43c8f1104f4592b42a00f9b34a643d90602001611487565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561188d816124e9565b6118956126c9565b61012e546040517f91d20fa100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906391d20fa190849034906118fe908f908f908f908f908f908f908f908f906004016144e2565b6000604051808303818589803b15801561191757600080fd5b5088f1945050505050801561192a575060015b611a02573d808015611958576040519150601f19603f3d011682016040523d82523d6000602084013e61195d565b606091505b5061012e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663697fe6b68c8c8c8c88348e8e8e8e8c6040518c63ffffffff1660e01b81526004016119ce9b9a999897969594939291906145bc565b600060405180830381600087803b1580156119e857600080fd5b505af11580156119fc573d6000803e3d6000fd5b50505050505b611a0c600160fb55565b50505050505050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611a42816124e9565b611a4a6126c9565b61012e54600090611a8a90602085019074010000000000000000000000000000000000000000900463ffffffff16611a828287613c36565b89898961277f565b90506000611a98823461467e565b61012e5490915073ffffffffffffffffffffffffffffffffffffffff16630c0c389e60e08601358360208801611ace818a613c36565b60808a0135611ae060a08c018c614691565b611aed60c08e018e614691565b6040518a63ffffffff1660e01b8152600401611b0f9796959493929190614732565b6000604051808303818589803b158015611b2857600080fd5b5088f19450505050508015611b3b575060015b611c1b573d808015611b69576040519150601f19603f3d011682016040523d82523d6000602084013e611b6e565b606091505b5061012e5473ffffffffffffffffffffffffffffffffffffffff16636bf73fa360208701611b9c8189613c36565b608089013560e08a013587611bb460a08d018d614691565b611bc160c08f018f614691565b8b6040518b63ffffffff1660e01b8152600401611be79a99989796959493929190614796565b600060405180830381600087803b158015611c0157600080fd5b505af1158015611c15573d6000803e3d6000fd5b50505050505b5050611c27600160fb55565b5050505050565b60007f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de611c5a816124e9565b84611c6481610fba565b611c9a576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611ca26128f4565b6040805160608101825260ca5473ffffffffffffffffffffffffffffffffffffffff908116825288811660208084019190915260c9547c0100000000000000000000000000000000000000000000000000000000810461ffff168486015261012e5474010000000000000000000000000000000000000000900463ffffffff16600090815261012d9092529084902093517f650037840000000000000000000000000000000000000000000000000000000081529293911691636500378491611d74918591908b908b90600401614822565b6020604051808303816000875af1158015611d93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611db791906144c9565b979650505050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611dec816124e9565b60c980547fffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000061ffff8516908102919091179091556040519081527f7af0ac740036ffb1c97b03697859d729e80a44ae5030543d64971c313565ab4d90602001611487565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611e99816124e9565b60c980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040519081527f1399be28223800f8669b3ba5f8721d9fc16fc4e8d0bbf98378791c8c5a3015e090602001611487565b600083611f1881610fba565b611f4e576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611f566128f4565b6040805160608101825260ca5473ffffffffffffffffffffffffffffffffffffffff908116825287811660208084019190915260c9547c0100000000000000000000000000000000000000000000000000000000810461ffff168486015261012e5474010000000000000000000000000000000000000000900463ffffffff16600090815261012d9092529084902093517f337c7a9e000000000000000000000000000000000000000000000000000000008152929391169163337c7a9e91612028918591908a908a90600401614822565b602060405180830381865afa158015612045573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061206991906144c9565b9695505050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561209d816124e9565b63ffffffff8416600090815260cb60205260409020611c27908484613836565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756120e7816124e9565b6120ef6126c9565b61012e5473ffffffffffffffffffffffffffffffffffffffff16630c0c389e60e084013534602086016121228188613c36565b608088013561213460a08a018a614691565b61214160c08c018c614691565b6040518a63ffffffff1660e01b81526004016121639796959493929190614732565b6000604051808303818589803b15801561217c57600080fd5b5088f1945050505050801561218f575060015b61226f573d8080156121bd576040519150601f19603f3d011682016040523d82523d6000602084013e6121c2565b606091505b5061012e5473ffffffffffffffffffffffffffffffffffffffff16636bf73fa3602085016121f08187613c36565b608087013560e08801353461220860a08b018b614691565b61221560c08d018d614691565b8b6040518b63ffffffff1660e01b815260040161223b9a99989796959493929190614796565b600060405180830381600087803b15801561225557600080fd5b505af1158015612269573d6000803e3d6000fd5b50505050505b610f27600160fb55565b600082815260656020526040902060010154612294816124e9565b6110c38383612961565b60006122c87fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b905073ffffffffffffffffffffffffffffffffffffffff81166123215773ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355612343565b3373ffffffffffffffffffffffffffffffffffffffff82161461234357600080fd5b5061012f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600054610100900460ff16612423576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a73565b61242b612a27565b565b600054610100900460ff166124c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a73565b6124cc612abe565b6124d4612abe565b6124dc612b55565b611c278585858585612c16565b6124f38133612dfb565b50565b73ffffffffffffffffffffffffffffffffffffffff831661251b576110c38282612eb5565b6110c3838383612fbb565b61252e6128f4565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125813390565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b6125b3613029565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612581565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca821480156126615750600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16155b156126bf5760c980546014906126989074010000000000000000000000000000000000000000900467ffffffffffffffff166148d3565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b610f278282613095565b600260fb5403612735576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a73565b600260fb55565b600160fb55565b60006127536031602d84866148fa565b61275c91614924565b60e01c9392505050565b60006127786127758484613189565b90565b9392505050565b6000808367ffffffffffffffff81111561279b5761279b613918565b6040519080825280602002602001820160405280156127c4578160200160208202803683370190505b50905060005b848110156128a75760008686838181106127e6576127e6614335565b9050604002018036038101906127fc919061496c565b90506000816000015173ffffffffffffffffffffffffffffffffffffffff1682602001518790604051600060405180830381858888f193505050503d8060008114612863576040519150601f19603f3d011682016040523d82523d6000602084013e612868565b606091505b505090508084848151811061287f5761287f614335565b91151560209283029190910182015282015161289b90866149c3565b945050506001016127ca565b507f1f48172553121d8bf273ce457a5a3dd180d464e0add3e0143045b7fa039c34688888888888866040516128e196959493929190614a14565b60405180910390a1509695505050505050565b60975460ff161561242b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a73565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca821480156129bf5750600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff165b15612a1d5760c980546014906129f69074010000000000000000000000000000000000000000900467ffffffffffffffff16614aa6565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b610f2782826131a2565b600054610100900460ff1661273c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a73565b600054610100900460ff1661242b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a73565b600054610100900460ff16612bec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a73565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600054610100900460ff16612cad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a73565b60c980547fffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000061ffff86160217905560ca80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691909117909155821615612d5157612d51600083612602565b60005b8551811015612da857612da07f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de878381518110612d9357612d93614335565b6020026020010151612602565b600101612d54565b5060005b8151811015612df357612deb7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775838381518110612d9357612d93614335565b600101612dac565b505050505050565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610f2757612e3b8161325d565b612e4683602061327c565b604051602001612e57929190614ae8565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610a7391600401614b69565b73ffffffffffffffffffffffffffffffffffffffff8216612f02576040517f6b7a931000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114612f5c576040519150601f19603f3d011682016040523d82523d6000602084013e612f61565b606091505b50509050806110c3576040517f465bc83400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260248101839052604401610a73565b73ffffffffffffffffffffffffffffffffffffffff8216613008576040517f6b7a931000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110c373ffffffffffffffffffffffffffffffffffffffff841683836134bf565b60975460ff1661242b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610a73565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610f2757600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561312b3390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006131996051603184866148fa565b61277891614b7c565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610f2757600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6060610d7973ffffffffffffffffffffffffffffffffffffffff831660145b6060600061328b836002614bb8565b6132969060026149c3565b67ffffffffffffffff8111156132ae576132ae613918565b6040519080825280601f01601f1916602001820160405280156132d8576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061330f5761330f614335565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061337257613372614335565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006133ae846002614bb8565b6133b99060016149c3565b90505b6001811115613456577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106133fa576133fa614335565b1a60f81b82828151811061341057613410614335565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361344f81614bcf565b90506133bc565b508315612778576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a73565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092018352602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908401526110c39286929160009161358a918516908490613637565b90508051600014806135ab5750808060200190518101906135ab9190614c04565b6110c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610a73565b6060613646848460008561364e565b949350505050565b6060824710156136e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610a73565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516137099190614c21565b60006040518083038185875af1925050503d8060008114613746576040519150601f19603f3d011682016040523d82523d6000602084013e61374b565b606091505b5091509150611db787838387606083156137ed5782516000036137e65773ffffffffffffffffffffffffffffffffffffffff85163b6137e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a73565b5081613646565b61364683838151156138025781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a739190614b69565b82805482825590600052602060002090601f016020900481019282156138cf5791602002820160005b838211156138a057833560ff1683826101000a81548160ff021916908360ff160217905550926020019260010160208160000104928301926001030261385f565b80156138cd5782816101000a81549060ff02191690556001016020816000010492830192600103026138a0565b505b506138db9291506138df565b5090565b5b808211156138db57600081556001016138e0565b803573ffffffffffffffffffffffffffffffffffffffff8116811461109957600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160c0810167ffffffffffffffff8111828210171561396a5761396a613918565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156139b7576139b7613918565b604052919050565b600067ffffffffffffffff8211156139d9576139d9613918565b5060051b60200190565b600082601f8301126139f457600080fd5b81356020613a09613a04836139bf565b613970565b8083825260208201915060208460051b870101935086841115613a2b57600080fd5b602086015b84811015613a4e57613a41816138f4565b8352918301918301613a30565b509695505050505050565b60008060008060008060c08789031215613a7257600080fd5b613a7b876138f4565b9550613a89602088016138f4565b9450604087013567ffffffffffffffff80821115613aa657600080fd5b613ab28a838b016139e3565b9550613ac060608a016138f4565b9450613ace60808a016138f4565b935060a0890135915080821115613ae457600080fd5b50613af189828a016139e3565b9150509295509295509295565b600080600060608486031215613b1357600080fd5b613b1c846138f4565b9250613b2a602085016138f4565b9150604084013590509250925092565b600060208284031215613b4c57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461277857600080fd5b80151581146124f357600080fd5b600060208284031215613b9c57600080fd5b813561277881613b7c565b600060208284031215613bb957600080fd5b5035919050565b63ffffffff811681146124f357600080fd5b600060208284031215613be457600080fd5b813561277881613bc0565b6020808252825182820181905260009190848201906040850190845b81811015613c2a57835160ff1683529284019291840191600101613c0b565b50909695505050505050565b600060208284031215613c4857600080fd5b612778826138f4565b60008060408385031215613c6457600080fd5b82359150613c74602084016138f4565b90509250929050565b60008083601f840112613c8f57600080fd5b50813567ffffffffffffffff811115613ca757600080fd5b602083019150836020828501011115613cbf57600080fd5b9250929050565b600080600060408486031215613cdb57600080fd5b833567ffffffffffffffff811115613cf257600080fd5b613cfe86828701613c7d565b909790965060209590950135949350505050565b600060608284031215613d2457600080fd5b50919050565b60008083601f840112613d3c57600080fd5b50813567ffffffffffffffff811115613d5457600080fd5b6020830191508360208260061b8501011115613cbf57600080fd5b600080600080600080600060e0888a031215613d8a57600080fd5b613d948989613d12565b9650606088013567ffffffffffffffff80821115613db157600080fd5b613dbd8b838c01613d2a565b909850965060808a0135955060a08a0135915080821115613ddd57600080fd5b50613dea8a828b01613c7d565b989b979a5095989497959660c090950135949350505050565b803567ffffffffffffffff8116811461109957600080fd5b803561ffff8116811461109957600080fd5b80356fffffffffffffffffffffffffffffffff8116811461109957600080fd5b60006020808385031215613e6057600080fd5b823567ffffffffffffffff811115613e7757600080fd5b8301601f81018513613e8857600080fd5b8035613e96613a04826139bf565b81815260c09182028301840191848201919088841115613eb557600080fd5b938501935b83851015613f495780858a031215613ed25760008081fd5b613eda613947565b8535613ee581613bc0565b8152613ef2868801613e03565b878201526040613f03818801613e03565b908201526060613f14878201613e1b565b908201526080613f25878201613e2d565b9082015260a0613f36878201613e2d565b9082015283529384019391850191613eba565b50979650505050505050565b60008060008060008060e08789031215613f6e57600080fd5b613f788888613d12565b95506060870135613f8881613bc0565b9450613f96608088016138f4565b935060a087013567ffffffffffffffff811115613fb257600080fd5b613fbe89828a01613d2a565b979a969950949794969560c090950135949350505050565b600080600080600060808688031215613fee57600080fd5b8535613ff981613bc0565b9450614007602087016138f4565b935060408601359250606086013567ffffffffffffffff81111561402a57600080fd5b61403688828901613c7d565b969995985093965092949392505050565b600080600080600080600080600060e08a8c03121561406557600080fd5b61406e8a6138f4565b985061407c60208b016138f4565b975060408a0135965061409160608b01613e1b565b955060808a013567ffffffffffffffff808211156140ae57600080fd5b6140ba8d838e01613c7d565b909750955060a08c01359150808211156140d357600080fd5b506140e08c828d01613c7d565b9a9d999c50979a9699959894979660c00135949350505050565b60006101008284031215613d2457600080fd5b6000806000806060858703121561412357600080fd5b843567ffffffffffffffff8082111561413b57600080fd5b61414788838901613d2a565b909650945060208701359350604087013591508082111561416757600080fd5b50614174878288016140fa565b91505092959194509250565b60008060006040848603121561419557600080fd5b61419e846138f4565b9250602084013567ffffffffffffffff8111156141ba57600080fd5b6141c686828701613c7d565b9497909650939450505050565b6000602082840312156141e557600080fd5b61277882613e1b565b60008060006040848603121561420357600080fd5b833561420e81613bc0565b9250602084013567ffffffffffffffff8082111561422b57600080fd5b818601915086601f83011261423f57600080fd5b81358181111561424e57600080fd5b8760208260051b850101111561426357600080fd5b6020830194508093505050509250925092565b60006020828403121561428857600080fd5b813567ffffffffffffffff81111561429f57600080fd5b613646848285016140fa565b6000602082840312156142bd57600080fd5b815161277881613bc0565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b6040815260006143256040830185876142c8565b9050826020830152949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602080825282518282018190526000919060409081850190868401855b828110156143fe578151805163ffffffff1685528681015167ffffffffffffffff9081168887015286820151168686015260608082015161ffff16908601526080808201516fffffffffffffffffffffffffffffffff9081169187019190915260a091820151169085015260c09093019290850190600101614381565b5091979650505050505050565b845173ffffffffffffffffffffffffffffffffffffffff908116825260208087015163ffffffff1690830152604080870151909116818301526060808701519083015260808087015161ffff90811682850152865467ffffffffffffffff80821660a08701529381901c90911660c085015260501c6fffffffffffffffffffffffffffffffff90811660e08501526001870154908116610100850152901c16610120820152600061016080610140840152611db781840185876142c8565b6000602082840312156144db57600080fd5b5051919050565b600073ffffffffffffffffffffffffffffffffffffffff808b168352808a1660208401525087604083015261ffff8716606083015260c0608083015261452c60c0830186886142c8565b82810360a084015261453f8185876142c8565b9b9a5050505050505050505050565b60005b83811015614569578181015183820152602001614551565b50506000910152565b6000815180845261458a81602086016020860161454e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600061012073ffffffffffffffffffffffffffffffffffffffff808f168452808e166020850152508b604084015261ffff8b1660608401528960808401528860a08401528060c0840152614613818401888a6142c8565b905082810360e08401526146288186886142c8565b905082810361010084015261463d8185614572565b9e9d5050505050505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610d7957610d7961464f565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126146c657600080fd5b83018035915067ffffffffffffffff8211156146e157600080fd5b602001915036819003821315613cbf57600080fd5b803561470181613bc0565b63ffffffff1682526020818101359083015267ffffffffffffffff61472860408301613e03565b1660408301525050565b61473c81896146f6565b73ffffffffffffffffffffffffffffffffffffffff8716606082015285608082015260e060a0820152600061477560e0830186886142c8565b82810360c08401526147888185876142c8565b9a9950505050505050505050565b60006101406147a5838e6146f6565b73ffffffffffffffffffffffffffffffffffffffff8c1660608401528a60808401528960a08401528860c08401528060e08401526147e6818401888a6142c8565b90508281036101008401526147fc8186886142c8565b90508281036101208401526148118185614572565b9d9c50505050505050505050505050565b600061012073ffffffffffffffffffffffffffffffffffffffff8088511684528060208901511660208501525061ffff60408801511660408401526148bf6060840187805467ffffffffffffffff808216845261ffff8260401c1660208501526fffffffffffffffffffffffffffffffff808360501c16604086015260018401549250808316606086015250808260801c16608085015250505050565b80610100840152611db781840185876142c8565b600067ffffffffffffffff8083168181036148f0576148f061464f565b6001019392505050565b6000808585111561490a57600080fd5b8386111561491757600080fd5b5050820193919092039150565b7fffffffff0000000000000000000000000000000000000000000000000000000081358181169160048510156149645780818660040360031b1b83161692505b505092915050565b60006040828403121561497e57600080fd5b6040516040810181811067ffffffffffffffff821117156149a1576149a1613918565b6040526149ad836138f4565b8152602083013560208201528091505092915050565b80820180821115610d7957610d7961464f565b60008151808452602080850194506020840160005b83811015614a095781511515875295820195908201906001016149eb565b509495945050505050565b600060e08201614a24838a6146f6565b63ffffffff8816606084015273ffffffffffffffffffffffffffffffffffffffff878116608085015260e060a0850152908590528590610100840160005b87811015614a935782614a74856138f4565b1682526020848101359083015260409384019390910190600101614a62565b5084810360c086015261453f81876149d6565b600067ffffffffffffffff821680614ac057614ac061464f565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614b2081601785016020880161454e565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351614b5d81602884016020880161454e565b01602801949350505050565b6020815260006127786020830184614572565b80356020831015610d79577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b8082028115828204841417610d7957610d7961464f565b600081614bde57614bde61464f565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b600060208284031215614c1657600080fd5b815161277881613b7c565b60008251614c3381846020870161454e565b919091019291505056fea2646970667358221220a37e2888a46667ffc638ad92d3c98f50b8b8950a768deacaaa3f876dede027c364736f6c63430008160033
Deployed ByteCode
0x6080604052600436106102835760003560e01c8063724e78da11610153578063c358de0a116100cb578063cfc325701161007f578063d547741f11610064578063d547741f14610881578063e395eb5c146108a1578063fa34c84e146108ec57600080fd5b8063cfc325701461081c578063d2ae21041461082f57600080fd5b8063c7b2370b116100b0578063c7b2370b146107bc578063c8f8dcd1146107dc578063cd88b903146107fc57600080fd5b8063c358de0a1461076f578063c416aa511461078f57600080fd5b806391d1485411610122578063a217fddf11610107578063a217fddf1461070c578063c015bb7d14610721578063c2803b2c1461074157600080fd5b806391d14854146105dc5780639e9449651461062f57600080fd5b8063724e78da14610569578063741bef1a146105895780637cd44734146105b65780638624ba07146105c957600080fd5b80632f2ff15d11610201578063475b6d9e116101b55780635e280f111161019a5780635e280f11146104d6578063709eb66414610529578063717e8a421461054957600080fd5b8063475b6d9e146104ab5780635c975abb146104be57600080fd5b806336568abe116101e657806336568abe146104585780633927c075146104785780633d85ac331461048b57600080fd5b80632f2ff15d146104185780633146646a1461043857600080fd5b80631095b6d711610258578063248a9ca31161023d578063248a9ca31461038d57806326e67a37146103cb5780632de11376146103f857600080fd5b80631095b6d71461034d57806316c38b3c1461036d57600080fd5b80629fc68114610288578062bf2e80146102aa57806301e33667146102fd57806301ffc9a71461031d575b600080fd5b34801561029457600080fd5b506102a86102a3366004613a59565b61090c565b005b3480156102b657600080fd5b5060c9546102e5907c0100000000000000000000000000000000000000000000000000000000900461ffff1681565b60405161ffff90911681526020015b60405180910390f35b34801561030957600080fd5b506102a8610318366004613afe565b610cab565b34801561032957600080fd5b5061033d610338366004613b3a565b610ce6565b60405190151581526020016102f4565b34801561035957600080fd5b506102a8610368366004613afe565b610d7f565b34801561037957600080fd5b506102a8610388366004613b8a565b610f0e565b34801561039957600080fd5b506103bd6103a8366004613ba7565b60009081526065602052604090206001015490565b6040519081526020016102f4565b3480156103d757600080fd5b506103eb6103e6366004613bd2565b610f33565b6040516102f49190613bef565b34801561040457600080fd5b5061033d610413366004613c36565b610fba565b34801561042457600080fd5b506102a8610433366004613c51565b61109e565b34801561044457600080fd5b506102a8610453366004613cc6565b6110c8565b34801561046457600080fd5b506102a8610473366004613c51565b611191565b6102a8610486366004613d6f565b6111c3565b34801561049757600080fd5b506102a86104a6366004613e4d565b6112ad565b6102a86104b9366004613f55565b611493565b3480156104ca57600080fd5b5060975460ff1661033d565b3480156104e257600080fd5b5061012e546105049073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102f4565b34801561053557600080fd5b506103bd610544366004613fd6565b6114e7565b34801561055557600080fd5b506103bd610564366004613fd6565b611640565b34801561057557600080fd5b506102a8610584366004613c36565b6117c6565b34801561059557600080fd5b5060ca546105049073ffffffffffffffffffffffffffffffffffffffff1681565b6102a86105c4366004614047565b611863565b6102a86105d736600461410d565b611a18565b3480156105e857600080fd5b5061033d6105f7366004613c51565b600091825260656020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b34801561063b57600080fd5b506106bf61064a366004613bd2565b61012d602052600090815260409020805460019091015467ffffffffffffffff8083169261ffff68010000000000000000820416926fffffffffffffffffffffffffffffffff6a0100000000000000000000909204821692918116917001000000000000000000000000000000009091041685565b6040805167ffffffffffffffff968716815261ffff90951660208601526fffffffffffffffffffffffffffffffff938416908501529116606083015291909116608082015260a0016102f4565b34801561071857600080fd5b506103bd600081565b34801561072d57600080fd5b506103bd61073c366004614180565b611c2e565b34801561074d57600080fd5b5061012f546105049073ffffffffffffffffffffffffffffffffffffffff1681565b34801561077b57600080fd5b506102a861078a3660046141d3565b611dc2565b34801561079b57600080fd5b5060c9546105049073ffffffffffffffffffffffffffffffffffffffff1681565b3480156107c857600080fd5b506102a86107d7366004613c36565b611e6f565b3480156107e857600080fd5b506103bd6107f7366004614180565b611f0c565b34801561080857600080fd5b506102a86108173660046141ee565b612073565b6102a861082a366004614276565b6120bd565b34801561083b57600080fd5b5060c9546108689074010000000000000000000000000000000000000000900467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016102f4565b34801561088d57600080fd5b506102a861089c366004613c51565b612279565b3480156108ad57600080fd5b5061012e546108d79074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff90911681526020016102f4565b3480156108f857600080fd5b506102a8610907366004613c36565b61229e565b60006109367fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b905073ffffffffffffffffffffffffffffffffffffffff811661098f5773ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103556109b1565b3373ffffffffffffffffffffffffffffffffffffffff8216146109b157600080fd5b600054610100900460ff16158080156109d15750600054600160ff909116105b806109eb5750303b1580156109eb575060005460ff166001145b610a7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610ada57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610ae261238c565b610af18686612ee0878761242d565b61012e80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8a16908117909155604080517f416ecebf000000000000000000000000000000000000000000000000000000008152905163416ecebf916004808201926020929091908290030181865afa158015610b89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bad91906142ab565b61012e80547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff939093169290920291909117905561012f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff89161790558015610ca157600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610cd5816124e9565b610ce08484846124f6565b50505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b000000000000000000000000000000000000000000000000000000001480610d7957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610da9816124e9565b73ffffffffffffffffffffffffffffffffffffffff841660009081527fe3a3b2721d010eec8988605a93cd7c15d969808c0e2b42f6155dc2b4fa13c081602052604090205460ff16610e27576040517f5ee08b9700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517ffd9be52200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820184905285169063fd9be52290604401600060405180830381600087803b158015610e9757600080fd5b505af1158015610eab573d6000803e3d6000fd5b50506040805173ffffffffffffffffffffffffffffffffffffffff8089168252871660208201529081018590527f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9250606001905060405180910390a150505050565b6000610f19816124e9565b8115610f2b57610f27612526565b5050565b610f276125ab565b63ffffffff8116600090815260cb6020908152604091829020805483518184028101840190945280845260609392830182828015610fae57602002820191906000526020600020906000905b825461010083900a900460ff16815260206001928301818104948501949093039092029101808411610f7f5790505b50505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff811660009081527f0f6a9529577ef7bf1cbc8fccda1cc3c881f755c7e92e34c7c4deac1fa3c1c791602052604081205460ff161561100f57506000919050565b60c95474010000000000000000000000000000000000000000900467ffffffffffffffff161580611084575073ffffffffffffffffffffffffffffffffffffffff821660009081527f35c5067391a9036240763c1067bfa438a7b0131204a675a2fe562dd73782ce85602052604090205460ff165b1561109157506001919050565b506000919050565b919050565b6000828152606560205260409020600101546110b9816124e9565b6110c38383612602565b505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756110f2816124e9565b6110fa6126c9565b61012f546040517fe65106f800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063e65106f89061115590879087908790600401614311565b600060405180830381600087803b15801561116f57600080fd5b505af1158015611183573d6000803e3d6000fd5b50505050610ce0600160fb55565b6040517fdec9f03100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756111ed816124e9565b6111f56126c9565b611215886112038686612743565b61120d8787612766565b8a8a8a61277f565b5061012f546040517fe65106f800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063e65106f89061127190879087908790600401614311565b600060405180830381600087803b15801561128b57600080fd5b505af115801561129f573d6000803e3d6000fd5b50505050610ca1600160fb55565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756112d7816124e9565b60005b82518110156114575760008382815181106112f7576112f7614335565b6020908102919091018101516040805160a080820183528385015167ffffffffffffffff908116835260608086015161ffff9081168589019081526080808901516fffffffffffffffffffffffffffffffff908116888a01908152968a01518116948801948552888a01518616918801918252985163ffffffff16600090815261012d909a5296909820945185549851945188166a0100000000000000000000027fffffffffffff00000000000000000000000000000000ffffffffffffffffffff9590921668010000000000000000027fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000090991690841617979097179290921695909517825551600191820180549351909516700100000000000000000000000000000000027fffffffffffffffff000000000000000000000000000000000000000000000000909316931692909217179091559190910190506112da565b507fb99f6de5e22c60c178b03bfacf2daeb4b6089f5b37e0fe2c48a5d5141191fc53826040516114879190614364565b60405180910390a15050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756114bd816124e9565b6114c56126c9565b6114d387878787878761277f565b506114de600160fb55565b50505050505050565b6000846114f381610fba565b611529576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115316128f4565b6040805160a08101825260ca5473ffffffffffffffffffffffffffffffffffffffff908116825263ffffffff8a1660208084018290528a831684860152606084018a905260c95461ffff7c01000000000000000000000000000000000000000000000000000000008204166080860152600092835261012d9091529084902093517f434ee016000000000000000000000000000000000000000000000000000000008152929391169163434ee016916115f3918591908a908a9060040161440b565b602060405180830381865afa158015611610573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163491906144c9565b98975050505050505050565b60007f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de61166c816124e9565b8561167681610fba565b6116ac576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6116b46128f4565b6040805160a08101825260ca5473ffffffffffffffffffffffffffffffffffffffff908116825263ffffffff8b1660208084018290528b831684860152606084018b905260c95461ffff7c01000000000000000000000000000000000000000000000000000000008204166080860152600092835261012d9091529084902093517f566ef762000000000000000000000000000000000000000000000000000000008152929391169163566ef76291611776918591908b908b9060040161440b565b6020604051808303816000875af1158015611795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b991906144c9565b9998505050505050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756117f0816124e9565b60ca80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040519081527ff724a45d041687842411f2b977ef22ab8f43c8f1104f4592b42a00f9b34a643d90602001611487565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561188d816124e9565b6118956126c9565b61012e546040517f91d20fa100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906391d20fa190849034906118fe908f908f908f908f908f908f908f908f906004016144e2565b6000604051808303818589803b15801561191757600080fd5b5088f1945050505050801561192a575060015b611a02573d808015611958576040519150601f19603f3d011682016040523d82523d6000602084013e61195d565b606091505b5061012e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663697fe6b68c8c8c8c88348e8e8e8e8c6040518c63ffffffff1660e01b81526004016119ce9b9a999897969594939291906145bc565b600060405180830381600087803b1580156119e857600080fd5b505af11580156119fc573d6000803e3d6000fd5b50505050505b611a0c600160fb55565b50505050505050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611a42816124e9565b611a4a6126c9565b61012e54600090611a8a90602085019074010000000000000000000000000000000000000000900463ffffffff16611a828287613c36565b89898961277f565b90506000611a98823461467e565b61012e5490915073ffffffffffffffffffffffffffffffffffffffff16630c0c389e60e08601358360208801611ace818a613c36565b60808a0135611ae060a08c018c614691565b611aed60c08e018e614691565b6040518a63ffffffff1660e01b8152600401611b0f9796959493929190614732565b6000604051808303818589803b158015611b2857600080fd5b5088f19450505050508015611b3b575060015b611c1b573d808015611b69576040519150601f19603f3d011682016040523d82523d6000602084013e611b6e565b606091505b5061012e5473ffffffffffffffffffffffffffffffffffffffff16636bf73fa360208701611b9c8189613c36565b608089013560e08a013587611bb460a08d018d614691565b611bc160c08f018f614691565b8b6040518b63ffffffff1660e01b8152600401611be79a99989796959493929190614796565b600060405180830381600087803b158015611c0157600080fd5b505af1158015611c15573d6000803e3d6000fd5b50505050505b5050611c27600160fb55565b5050505050565b60007f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de611c5a816124e9565b84611c6481610fba565b611c9a576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611ca26128f4565b6040805160608101825260ca5473ffffffffffffffffffffffffffffffffffffffff908116825288811660208084019190915260c9547c0100000000000000000000000000000000000000000000000000000000810461ffff168486015261012e5474010000000000000000000000000000000000000000900463ffffffff16600090815261012d9092529084902093517f650037840000000000000000000000000000000000000000000000000000000081529293911691636500378491611d74918591908b908b90600401614822565b6020604051808303816000875af1158015611d93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611db791906144c9565b979650505050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611dec816124e9565b60c980547fffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000061ffff8516908102919091179091556040519081527f7af0ac740036ffb1c97b03697859d729e80a44ae5030543d64971c313565ab4d90602001611487565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775611e99816124e9565b60c980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040519081527f1399be28223800f8669b3ba5f8721d9fc16fc4e8d0bbf98378791c8c5a3015e090602001611487565b600083611f1881610fba565b611f4e576040517f4ab5ebcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611f566128f4565b6040805160608101825260ca5473ffffffffffffffffffffffffffffffffffffffff908116825287811660208084019190915260c9547c0100000000000000000000000000000000000000000000000000000000810461ffff168486015261012e5474010000000000000000000000000000000000000000900463ffffffff16600090815261012d9092529084902093517f337c7a9e000000000000000000000000000000000000000000000000000000008152929391169163337c7a9e91612028918591908a908a90600401614822565b602060405180830381865afa158015612045573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061206991906144c9565b9695505050505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561209d816124e9565b63ffffffff8416600090815260cb60205260409020611c27908484613836565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756120e7816124e9565b6120ef6126c9565b61012e5473ffffffffffffffffffffffffffffffffffffffff16630c0c389e60e084013534602086016121228188613c36565b608088013561213460a08a018a614691565b61214160c08c018c614691565b6040518a63ffffffff1660e01b81526004016121639796959493929190614732565b6000604051808303818589803b15801561217c57600080fd5b5088f1945050505050801561218f575060015b61226f573d8080156121bd576040519150601f19603f3d011682016040523d82523d6000602084013e6121c2565b606091505b5061012e5473ffffffffffffffffffffffffffffffffffffffff16636bf73fa3602085016121f08187613c36565b608087013560e08801353461220860a08b018b614691565b61221560c08d018d614691565b8b6040518b63ffffffff1660e01b815260040161223b9a99989796959493929190614796565b600060405180830381600087803b15801561225557600080fd5b505af1158015612269573d6000803e3d6000fd5b50505050505b610f27600160fb55565b600082815260656020526040902060010154612294816124e9565b6110c38383612961565b60006122c87fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b905073ffffffffffffffffffffffffffffffffffffffff81166123215773ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355612343565b3373ffffffffffffffffffffffffffffffffffffffff82161461234357600080fd5b5061012f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600054610100900460ff16612423576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a73565b61242b612a27565b565b600054610100900460ff166124c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a73565b6124cc612abe565b6124d4612abe565b6124dc612b55565b611c278585858585612c16565b6124f38133612dfb565b50565b73ffffffffffffffffffffffffffffffffffffffff831661251b576110c38282612eb5565b6110c3838383612fbb565b61252e6128f4565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125813390565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b6125b3613029565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612581565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca821480156126615750600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16155b156126bf5760c980546014906126989074010000000000000000000000000000000000000000900467ffffffffffffffff166148d3565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b610f278282613095565b600260fb5403612735576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a73565b600260fb55565b600160fb55565b60006127536031602d84866148fa565b61275c91614924565b60e01c9392505050565b60006127786127758484613189565b90565b9392505050565b6000808367ffffffffffffffff81111561279b5761279b613918565b6040519080825280602002602001820160405280156127c4578160200160208202803683370190505b50905060005b848110156128a75760008686838181106127e6576127e6614335565b9050604002018036038101906127fc919061496c565b90506000816000015173ffffffffffffffffffffffffffffffffffffffff1682602001518790604051600060405180830381858888f193505050503d8060008114612863576040519150601f19603f3d011682016040523d82523d6000602084013e612868565b606091505b505090508084848151811061287f5761287f614335565b91151560209283029190910182015282015161289b90866149c3565b945050506001016127ca565b507f1f48172553121d8bf273ce457a5a3dd180d464e0add3e0143045b7fa039c34688888888888866040516128e196959493929190614a14565b60405180910390a1509695505050505050565b60975460ff161561242b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610a73565b7f74845de37cfabd357633214b47fa91ccd19b05b7c5a08ac22c187f811fb62bca821480156129bf5750600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff165b15612a1d5760c980546014906129f69074010000000000000000000000000000000000000000900467ffffffffffffffff16614aa6565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505b610f2782826131a2565b600054610100900460ff1661273c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a73565b600054610100900460ff1661242b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a73565b600054610100900460ff16612bec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a73565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600054610100900460ff16612cad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a73565b60c980547fffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000061ffff86160217905560ca80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691909117909155821615612d5157612d51600083612602565b60005b8551811015612da857612da07f724aface199fe5bed93ae8508474576a9adf3dc443b2c451842a2242919f19de878381518110612d9357612d93614335565b6020026020010151612602565b600101612d54565b5060005b8151811015612df357612deb7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775838381518110612d9357612d93614335565b600101612dac565b505050505050565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610f2757612e3b8161325d565b612e4683602061327c565b604051602001612e57929190614ae8565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610a7391600401614b69565b73ffffffffffffffffffffffffffffffffffffffff8216612f02576040517f6b7a931000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114612f5c576040519150601f19603f3d011682016040523d82523d6000602084013e612f61565b606091505b50509050806110c3576040517f465bc83400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260248101839052604401610a73565b73ffffffffffffffffffffffffffffffffffffffff8216613008576040517f6b7a931000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6110c373ffffffffffffffffffffffffffffffffffffffff841683836134bf565b60975460ff1661242b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610a73565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610f2757600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561312b3390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006131996051603184866148fa565b61277891614b7c565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610f2757600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6060610d7973ffffffffffffffffffffffffffffffffffffffff831660145b6060600061328b836002614bb8565b6132969060026149c3565b67ffffffffffffffff8111156132ae576132ae613918565b6040519080825280601f01601f1916602001820160405280156132d8576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061330f5761330f614335565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061337257613372614335565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006133ae846002614bb8565b6133b99060016149c3565b90505b6001811115613456577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106133fa576133fa614335565b1a60f81b82828151811061341057613410614335565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c9361344f81614bcf565b90506133bc565b508315612778576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a73565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092018352602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908401526110c39286929160009161358a918516908490613637565b90508051600014806135ab5750808060200190518101906135ab9190614c04565b6110c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610a73565b6060613646848460008561364e565b949350505050565b6060824710156136e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610a73565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516137099190614c21565b60006040518083038185875af1925050503d8060008114613746576040519150601f19603f3d011682016040523d82523d6000602084013e61374b565b606091505b5091509150611db787838387606083156137ed5782516000036137e65773ffffffffffffffffffffffffffffffffffffffff85163b6137e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a73565b5081613646565b61364683838151156138025781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a739190614b69565b82805482825590600052602060002090601f016020900481019282156138cf5791602002820160005b838211156138a057833560ff1683826101000a81548160ff021916908360ff160217905550926020019260010160208160000104928301926001030261385f565b80156138cd5782816101000a81549060ff02191690556001016020816000010492830192600103026138a0565b505b506138db9291506138df565b5090565b5b808211156138db57600081556001016138e0565b803573ffffffffffffffffffffffffffffffffffffffff8116811461109957600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160c0810167ffffffffffffffff8111828210171561396a5761396a613918565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156139b7576139b7613918565b604052919050565b600067ffffffffffffffff8211156139d9576139d9613918565b5060051b60200190565b600082601f8301126139f457600080fd5b81356020613a09613a04836139bf565b613970565b8083825260208201915060208460051b870101935086841115613a2b57600080fd5b602086015b84811015613a4e57613a41816138f4565b8352918301918301613a30565b509695505050505050565b60008060008060008060c08789031215613a7257600080fd5b613a7b876138f4565b9550613a89602088016138f4565b9450604087013567ffffffffffffffff80821115613aa657600080fd5b613ab28a838b016139e3565b9550613ac060608a016138f4565b9450613ace60808a016138f4565b935060a0890135915080821115613ae457600080fd5b50613af189828a016139e3565b9150509295509295509295565b600080600060608486031215613b1357600080fd5b613b1c846138f4565b9250613b2a602085016138f4565b9150604084013590509250925092565b600060208284031215613b4c57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461277857600080fd5b80151581146124f357600080fd5b600060208284031215613b9c57600080fd5b813561277881613b7c565b600060208284031215613bb957600080fd5b5035919050565b63ffffffff811681146124f357600080fd5b600060208284031215613be457600080fd5b813561277881613bc0565b6020808252825182820181905260009190848201906040850190845b81811015613c2a57835160ff1683529284019291840191600101613c0b565b50909695505050505050565b600060208284031215613c4857600080fd5b612778826138f4565b60008060408385031215613c6457600080fd5b82359150613c74602084016138f4565b90509250929050565b60008083601f840112613c8f57600080fd5b50813567ffffffffffffffff811115613ca757600080fd5b602083019150836020828501011115613cbf57600080fd5b9250929050565b600080600060408486031215613cdb57600080fd5b833567ffffffffffffffff811115613cf257600080fd5b613cfe86828701613c7d565b909790965060209590950135949350505050565b600060608284031215613d2457600080fd5b50919050565b60008083601f840112613d3c57600080fd5b50813567ffffffffffffffff811115613d5457600080fd5b6020830191508360208260061b8501011115613cbf57600080fd5b600080600080600080600060e0888a031215613d8a57600080fd5b613d948989613d12565b9650606088013567ffffffffffffffff80821115613db157600080fd5b613dbd8b838c01613d2a565b909850965060808a0135955060a08a0135915080821115613ddd57600080fd5b50613dea8a828b01613c7d565b989b979a5095989497959660c090950135949350505050565b803567ffffffffffffffff8116811461109957600080fd5b803561ffff8116811461109957600080fd5b80356fffffffffffffffffffffffffffffffff8116811461109957600080fd5b60006020808385031215613e6057600080fd5b823567ffffffffffffffff811115613e7757600080fd5b8301601f81018513613e8857600080fd5b8035613e96613a04826139bf565b81815260c09182028301840191848201919088841115613eb557600080fd5b938501935b83851015613f495780858a031215613ed25760008081fd5b613eda613947565b8535613ee581613bc0565b8152613ef2868801613e03565b878201526040613f03818801613e03565b908201526060613f14878201613e1b565b908201526080613f25878201613e2d565b9082015260a0613f36878201613e2d565b9082015283529384019391850191613eba565b50979650505050505050565b60008060008060008060e08789031215613f6e57600080fd5b613f788888613d12565b95506060870135613f8881613bc0565b9450613f96608088016138f4565b935060a087013567ffffffffffffffff811115613fb257600080fd5b613fbe89828a01613d2a565b979a969950949794969560c090950135949350505050565b600080600080600060808688031215613fee57600080fd5b8535613ff981613bc0565b9450614007602087016138f4565b935060408601359250606086013567ffffffffffffffff81111561402a57600080fd5b61403688828901613c7d565b969995985093965092949392505050565b600080600080600080600080600060e08a8c03121561406557600080fd5b61406e8a6138f4565b985061407c60208b016138f4565b975060408a0135965061409160608b01613e1b565b955060808a013567ffffffffffffffff808211156140ae57600080fd5b6140ba8d838e01613c7d565b909750955060a08c01359150808211156140d357600080fd5b506140e08c828d01613c7d565b9a9d999c50979a9699959894979660c00135949350505050565b60006101008284031215613d2457600080fd5b6000806000806060858703121561412357600080fd5b843567ffffffffffffffff8082111561413b57600080fd5b61414788838901613d2a565b909650945060208701359350604087013591508082111561416757600080fd5b50614174878288016140fa565b91505092959194509250565b60008060006040848603121561419557600080fd5b61419e846138f4565b9250602084013567ffffffffffffffff8111156141ba57600080fd5b6141c686828701613c7d565b9497909650939450505050565b6000602082840312156141e557600080fd5b61277882613e1b565b60008060006040848603121561420357600080fd5b833561420e81613bc0565b9250602084013567ffffffffffffffff8082111561422b57600080fd5b818601915086601f83011261423f57600080fd5b81358181111561424e57600080fd5b8760208260051b850101111561426357600080fd5b6020830194508093505050509250925092565b60006020828403121561428857600080fd5b813567ffffffffffffffff81111561429f57600080fd5b613646848285016140fa565b6000602082840312156142bd57600080fd5b815161277881613bc0565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b6040815260006143256040830185876142c8565b9050826020830152949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602080825282518282018190526000919060409081850190868401855b828110156143fe578151805163ffffffff1685528681015167ffffffffffffffff9081168887015286820151168686015260608082015161ffff16908601526080808201516fffffffffffffffffffffffffffffffff9081169187019190915260a091820151169085015260c09093019290850190600101614381565b5091979650505050505050565b845173ffffffffffffffffffffffffffffffffffffffff908116825260208087015163ffffffff1690830152604080870151909116818301526060808701519083015260808087015161ffff90811682850152865467ffffffffffffffff80821660a08701529381901c90911660c085015260501c6fffffffffffffffffffffffffffffffff90811660e08501526001870154908116610100850152901c16610120820152600061016080610140840152611db781840185876142c8565b6000602082840312156144db57600080fd5b5051919050565b600073ffffffffffffffffffffffffffffffffffffffff808b168352808a1660208401525087604083015261ffff8716606083015260c0608083015261452c60c0830186886142c8565b82810360a084015261453f8185876142c8565b9b9a5050505050505050505050565b60005b83811015614569578181015183820152602001614551565b50506000910152565b6000815180845261458a81602086016020860161454e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600061012073ffffffffffffffffffffffffffffffffffffffff808f168452808e166020850152508b604084015261ffff8b1660608401528960808401528860a08401528060c0840152614613818401888a6142c8565b905082810360e08401526146288186886142c8565b905082810361010084015261463d8185614572565b9e9d5050505050505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610d7957610d7961464f565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126146c657600080fd5b83018035915067ffffffffffffffff8211156146e157600080fd5b602001915036819003821315613cbf57600080fd5b803561470181613bc0565b63ffffffff1682526020818101359083015267ffffffffffffffff61472860408301613e03565b1660408301525050565b61473c81896146f6565b73ffffffffffffffffffffffffffffffffffffffff8716606082015285608082015260e060a0820152600061477560e0830186886142c8565b82810360c08401526147888185876142c8565b9a9950505050505050505050565b60006101406147a5838e6146f6565b73ffffffffffffffffffffffffffffffffffffffff8c1660608401528a60808401528960a08401528860c08401528060e08401526147e6818401888a6142c8565b90508281036101008401526147fc8186886142c8565b90508281036101208401526148118185614572565b9d9c50505050505050505050505050565b600061012073ffffffffffffffffffffffffffffffffffffffff8088511684528060208901511660208501525061ffff60408801511660408401526148bf6060840187805467ffffffffffffffff808216845261ffff8260401c1660208501526fffffffffffffffffffffffffffffffff808360501c16604086015260018401549250808316606086015250808260801c16608085015250505050565b80610100840152611db781840185876142c8565b600067ffffffffffffffff8083168181036148f0576148f061464f565b6001019392505050565b6000808585111561490a57600080fd5b8386111561491757600080fd5b5050820193919092039150565b7fffffffff0000000000000000000000000000000000000000000000000000000081358181169160048510156149645780818660040360031b1b83161692505b505092915050565b60006040828403121561497e57600080fd5b6040516040810181811067ffffffffffffffff821117156149a1576149a1613918565b6040526149ad836138f4565b8152602083013560208201528091505092915050565b80820180821115610d7957610d7961464f565b60008151808452602080850194506020840160005b83811015614a095781511515875295820195908201906001016149eb565b509495945050505050565b600060e08201614a24838a6146f6565b63ffffffff8816606084015273ffffffffffffffffffffffffffffffffffffffff878116608085015260e060a0850152908590528590610100840160005b87811015614a935782614a74856138f4565b1682526020848101359083015260409384019390910190600101614a62565b5084810360c086015261453f81876149d6565b600067ffffffffffffffff821680614ac057614ac061464f565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614b2081601785016020880161454e565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351614b5d81602884016020880161454e565b01602801949350505050565b6020815260006127786020830184614572565b80356020831015610d79577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b8082028115828204841417610d7957610d7961464f565b600081614bde57614bde61464f565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b600060208284031215614c1657600080fd5b815161277881613b7c565b60008251614c3381846020870161454e565b919091019291505056fea2646970667358221220a37e2888a46667ffc638ad92d3c98f50b8b8950a768deacaaa3f876dede027c364736f6c63430008160033