Feature Tip: Add private address tag to any address under My Name Tag !
ERC-20
Artificial Intelligence
Overview
Max Total Supply
7,509,898,515.660876 DUEL
Holders
4,806 ( 0.104%)
Market
Price
$0.00 @ 0.000001 ETH (+6.21%)
Onchain Market Cap
$18,893,477.87
Circulating Supply Market Cap
$7,433,627.10
Other Info
Token Contract (WITH 18 Decimals)
Balance
100,000.359057841913512183 DUELValue
$251.58 ( ~0.0815534536469545 Eth) [0.0013%]Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|---|---|---|---|---|
1 | Bybit | DUEL-USDT | $0.0025 0.0000008 Eth | $238,265.00 97,022,599.150 DUEL | 32.8199% |
2 | Bitget | DUEL-USDT | $0.0025 0.0000008 Eth | $185,792.00 74,935,434.780 DUEL | 25.3485% |
3 | Gate.io | DUEL-USDT | $0.0025 0.0000008 Eth | $118,443.00 47,889,641.700 DUEL | 16.1997% |
4 | BingX | DUEL-USDT | $0.0024 0.0000008 Eth | $82,179.00 33,128,419.510 DUEL | 11.2064% |
5 | PancakeSwap (v2) | 0XA1ED0BD9A4776830C5B7BA004F26427B71152CA5-0XBB4CDB9CBD36B01BD1CBAEBF2DE08D9173BC095C | $0.0025 0.0000008 Eth | $49,517.00 20,368,366.780 0XA1ED0BD9A4776830C5B7BA004F26427B71152CA5 | 6.8900% |
6 | CoinW | DUEL-USDT | $0.0025 0.0000008 Eth | $49,426.00 19,654,911.580 DUEL | 6.6487% |
7 | Bitrue | DUEL-USDT | $0.0025 0.0000008 Eth | $32,130.00 12,796,160.080 DUEL | 4.3286% |
8 | Uniswap V2 (Ethereum) | 0X943AF2ECE93118B973C95C2F698EE9D15002E604-0XC02AAA39B223FE8D0A0E5C4F27EAD9083C756CC2 | $0.0025 0.0000008 Eth | $29,508.00 11,820,158.067 0X943AF2ECE93118B973C95C2F698EE9D15002E604 | 3.9984% |
9 | MEXC | DUEL-USDT | $0.0025 0.0000008 Eth | $27,000.00 10,860,123.360 DUEL | 3.6737% |
10 | XT.COM | DUEL-USDT | $0.0025 0.0000008 Eth | $19,942.32 8,177,443.760 DUEL | 2.7662% |
11 | CoinEx | DUEL-USDT | $0.0025 0.0000008 Eth | $4,493.44 1,819,590.363 DUEL | 0.6155% |
12 | BitMart | DUEL-USDT | $0.0025 0.0000008 Eth | $2,741.11 1,099,665.520 DUEL | 0.3720% |
13 | Deepcoin | DUEL-USDT | $0.13 0.0000422 Eth | $286.66 4,633.960 DUEL | 0.0016% |
14 | AscendEX (BitMax) | DUEL-USDT | $0.0025 0.0000008 Eth | $68.37 27,271.990 DUEL | 0.0092% |
15 | Uniswap V3 (BSC) | 0XA1ED0BD9A4776830C5B7BA004F26427B71152CA5-0XBB4CDB9CBD36B01BD1CBAEBF2DE08D9173BC095C | $0.0025 0.0000008 Eth | $23.70 9,722.824 0XA1ED0BD9A4776830C5B7BA004F26427B71152CA5 | 0.0033% |
Contract Name:
DUELToken
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./UniswapV2/interfaces/IUniswapV2Router.sol"; import "./lzoft/oft/v2/OFTV2.sol"; interface IVesting { function allocateDUEL(address, uint256) external; function allocateDUEL(address, uint256, uint256) external; function claimDUEL() external; } interface IStaking { function stakeFor( address wallet, uint256 amount, uint32 periodDays ) external; } /// @title Main ERC-20 DUEL Token with vesting contract connection and convertRain() functionality /// @author Haider /// @notice Contract is ownable for the period of vesting, ownership to renounced later contract DUELToken is OFTV2 { address private _rainToken; address private _wethToken; address private _usdtToken; address private _dynamicVestingContract; address private _stakingContract; uint256 private _markedUpRainValueUnit; uint256 public constant _deploymentTime = 1702765019; IUniswapV2Router _uniswapRouter; constructor( address rainToken, address wethToken, address usdtToken, IUniswapV2Router uniswapRouter, address _lzEndpoint ) Ownable(msg.sender) OFTV2("DUEL Token", "DUEL", 6, _lzEndpoint) { _rainToken = rainToken; _wethToken = wethToken; _usdtToken = usdtToken; _uniswapRouter = uniswapRouter; _markedUpRainValueUnit = 1 * 10 ** 4; if (block.chainid == 1) { _mint(owner(), 10000000000 * 10 ** 18); // 10bil total supply only on ETH Mainnet } } function setVestingContract(address dynamicVesting) external onlyOwner { _dynamicVestingContract = dynamicVesting; } function setStakingContract(address newStaker) external onlyOwner { _stakingContract = newStaker; } function setRainMarkup(uint256 newRate) external onlyOwner { _markedUpRainValueUnit = newRate; } function getRainValue() public view returns (uint256) { address[] memory route = new address[](3); route[0] = address(_rainToken); route[1] = address(_wethToken); route[2] = address(_usdtToken); uint256[] memory amounts = _uniswapRouter.getAmountsOut( 1 * 10 ** 18, route ); return amounts[2]; } function _convertInternal( uint256 rainAmount ) internal returns (uint256 baseDuelAmount, uint256 bonusDuelAmount) { IERC20(_rainToken).transferFrom( _msgSender(), 0x000000000000000000000000000000000000dEaD, rainAmount ); // [6 decimals] Fetch market price of RAIN in USD uint256 rainValueUnit = getRainValue(); // [6 decimals] Calculate user's provided RAIN token's USD worth // Dividing by 10**18 is eliminating rainAmount's decimal offset uint256 rainValueUSD = (rainAmount * rainValueUnit) / 10 ** 18; uint markedUpRainValueUnit = 100000; // $0.01 // It is the rain value that is decaying not the bonus if (block.timestamp >= _deploymentTime + 60 days) { markedUpRainValueUnit = 60000; // $0.006 } else if (block.timestamp >= _deploymentTime + 30 days) { markedUpRainValueUnit = 80000; // $0.008 } // [6 decimals] Calculate rewarded RAIN value in USD (including bonus) uint256 markedUpRainValueUSD = (block.timestamp >= _deploymentTime + 180 days) ? rainValueUSD : (rainAmount * _markedUpRainValueUnit) / 10 ** 18; // [6 decimals] Set parameters for duel value at $0.0045 uint256 duelValueUnit = 4500; uint256 duelValueBase = 10 ** 6; // [18 decimals] Calculate duel amount to reward in total (base + bonus) baseDuelAmount = ((markedUpRainValueUSD * duelValueBase) / duelValueUnit) * 10 ** 12; // By default, we assume that there is no bonus, i.e. rainValueUSD > markedUpRainValueUSD // In this case, user will get all the baseDuelAmount after 30 days bonusDuelAmount = 0; // Check if bonus is applicable if (markedUpRainValueUSD > rainValueUSD) { // [6 decimals] Calculate the bonus value USD uint256 difference = markedUpRainValueUSD - rainValueUSD; // [18 decimals] Set the bonus duel amount for 90-days lockup bonusDuelAmount = ((difference * duelValueBase) / duelValueUnit) * 10 ** 12; // [18 decimals] Set the 1:1 duel amount for 30-days lockup baseDuelAmount -= bonusDuelAmount; } } function isContract(address addr) internal view returns (bool) { uint size; assembly { size := extcodesize(addr) } return size > 0; } function convertRain(uint256 rainAmount) external { require(!isContract(_msgSender()), "ACCESS_FORBIDDEN"); (uint256 baseDuelAmount, uint256 bonusDuelAmount) = _convertInternal( rainAmount ); IVesting(_dynamicVestingContract).allocateDUEL( _msgSender(), baseDuelAmount, bonusDuelAmount ); } function swapAndStake(uint256 rainAmount, uint32 stakePeriodDays) external { require( stakePeriodDays >= 3 * 30, "Minimum stake duration is 3 months" ); require(!isContract(_msgSender()), "ACCESS_FORBIDDEN"); (uint256 baseDuelAmount, uint256 bonusDuelAmount) = _convertInternal( rainAmount ); IStaking(_stakingContract).stakeFor( _msgSender(), baseDuelAmount + bonusDuelAmount, stakePeriodDays * 1 days ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC20Metadata} from "./extensions/IERC20Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. */ abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors { mapping(address account => uint256) private _balances; mapping(address account => mapping(address spender => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `value`. */ function transfer(address to, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _transfer(owner, to, value); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, value); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `value`. * - the caller must have allowance for ``from``'s tokens of at least * `value`. */ function transferFrom(address from, address to, uint256 value) public virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, value); _transfer(from, to, value); return true; } /** * @dev Moves a `value` amount of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _transfer(address from, address to, uint256 value) internal { if (from == address(0)) { revert ERC20InvalidSender(address(0)); } if (to == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(from, to, value); } /** * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding * this function. * * Emits a {Transfer} event. */ function _update(address from, address to, uint256 value) internal virtual { if (from == address(0)) { // Overflow check required: The rest of the code assumes that totalSupply never overflows _totalSupply += value; } else { uint256 fromBalance = _balances[from]; if (fromBalance < value) { revert ERC20InsufficientBalance(from, fromBalance, value); } unchecked { // Overflow not possible: value <= fromBalance <= totalSupply. _balances[from] = fromBalance - value; } } if (to == address(0)) { unchecked { // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply. _totalSupply -= value; } } else { unchecked { // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256. _balances[to] += value; } } emit Transfer(from, to, value); } /** * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0). * Relies on the `_update` mechanism * * Emits a {Transfer} event with `from` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _mint(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(address(0), account, value); } /** * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply. * Relies on the `_update` mechanism. * * Emits a {Transfer} event with `to` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead */ function _burn(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidSender(address(0)); } _update(account, address(0), value); } /** * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address owner, address spender, uint256 value) internal { _approve(owner, spender, value, true); } /** * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event. * * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any * `Approval` event during `transferFrom` operations. * * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to * true using the following override: * ``` * function _approve(address owner, address spender, uint256 value, bool) internal virtual override { * super._approve(owner, spender, value, true); * } * ``` * * Requirements are the same as {_approve}. */ function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual { if (owner == address(0)) { revert ERC20InvalidApprover(address(0)); } if (spender == address(0)) { revert ERC20InvalidSpender(address(0)); } _allowances[owner][spender] = value; if (emitEvent) { emit Approval(owner, spender, value); } } /** * @dev Updates `owner` s allowance for `spender` based on spent `value`. * * Does not update the allowance value in case of infinite allowance. * Revert if not enough allowance is available. * * Does not emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 value) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { if (currentAllowance < value) { revert ERC20InsufficientAllowance(spender, currentAllowance, value); } unchecked { _approve(owner, spender, currentAllowance - value, false); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @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 value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` 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 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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 Context { 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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.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); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @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); }
// SPDX-License-Identifier: Unlicense /* * @title Solidity Bytes Arrays Utils * @author Gonçalo Sá <[email protected]> * * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity. * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage. */ pragma solidity >=0.8.0 <0.9.0; library BytesLib { function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) { bytes memory tempBytes; assembly { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // Store the length of the first bytes array at the beginning of // the memory for tempBytes. let length := mload(_preBytes) mstore(tempBytes, length) // Maintain a memory counter for the current write location in the // temp bytes array by adding the 32 bytes for the array length to // the starting location. let mc := add(tempBytes, 0x20) // Stop copying when the memory counter reaches the length of the // first bytes array. let end := add(mc, length) for { // Initialize a copy counter to the start of the _preBytes data, // 32 bytes into its memory. let cc := add(_preBytes, 0x20) } lt(mc, end) { // Increase both counters by 32 bytes each iteration. mc := add(mc, 0x20) cc := add(cc, 0x20) } { // Write the _preBytes data into the tempBytes memory 32 bytes // at a time. mstore(mc, mload(cc)) } // Add the length of _postBytes to the current length of tempBytes // and store it as the new length in the first 32 bytes of the // tempBytes memory. length := mload(_postBytes) mstore(tempBytes, add(length, mload(tempBytes))) // Move the memory counter back from a multiple of 0x20 to the // actual end of the _preBytes data. mc := end // Stop copying when the memory counter reaches the new combined // length of the arrays. end := add(mc, length) for { let cc := add(_postBytes, 0x20) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } // Update the free-memory pointer by padding our last write location // to 32 bytes: add 31 bytes to the end of tempBytes to move to the // next 32 byte block, then round down to the nearest multiple of // 32. If the sum of the length of the two arrays is zero then add // one before rounding down to leave a blank 32 bytes (the length block with 0). mstore( 0x40, and( add(add(end, iszero(add(length, mload(_preBytes)))), 31), not(31) // Round down to the nearest 32 bytes. ) ) } return tempBytes; } function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal { assembly { // Read the first 32 bytes of _preBytes storage, which is the length // of the array. (We don't need to use the offset into the slot // because arrays use the entire slot.) let fslot := sload(_preBytes.slot) // Arrays of 31 bytes or less have an even value in their slot, // while longer arrays have an odd value. The actual length is // the slot divided by two for odd values, and the lowest order // byte divided by two for even values. // If the slot is even, bitwise and the slot with 255 and divide by // two to get the length. If the slot is odd, bitwise and the slot // with -1 and divide by two. let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2) let mlength := mload(_postBytes) let newlength := add(slength, mlength) // slength can contain both the length and contents of the array // if length < 32 bytes so let's prepare for that // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage switch add(lt(slength, 32), lt(newlength, 32)) case 2 { // Since the new array still fits in the slot, we just need to // update the contents of the slot. // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length sstore( _preBytes.slot, // all the modifications to the slot are inside this // next block add( // we can just add to the slot contents because the // bytes we want to change are the LSBs fslot, add( mul( div( // load the bytes from memory mload(add(_postBytes, 0x20)), // zero all bytes to the right exp(0x100, sub(32, mlength)) ), // and now shift left the number of bytes to // leave space for the length in the slot exp(0x100, sub(32, newlength)) ), // increase length by the double of the memory // bytes length mul(mlength, 2) ) ) ) } case 1 { // The stored value fits in the slot, but the combined value // will exceed it. // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) let sc := add(keccak256(0x0, 0x20), div(slength, 32)) // save new length sstore(_preBytes.slot, add(mul(newlength, 2), 1)) // The contents of the _postBytes array start 32 bytes into // the structure. Our first read should obtain the `submod` // bytes that can fit into the unused space in the last word // of the stored array. To get this, we read 32 bytes starting // from `submod`, so the data we read overlaps with the array // contents by `submod` bytes. Masking the lowest-order // `submod` bytes allows us to add that value directly to the // stored value. let submod := sub(32, slength) let mc := add(_postBytes, submod) let end := add(_postBytes, mlength) let mask := sub(exp(0x100, submod), 1) sstore(sc, add(and(fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00), and(mload(mc), mask))) for { mc := add(mc, 0x20) sc := add(sc, 1) } lt(mc, end) { sc := add(sc, 1) mc := add(mc, 0x20) } { sstore(sc, mload(mc)) } mask := exp(0x100, sub(mc, end)) sstore(sc, mul(div(mload(mc), mask), mask)) } default { // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) // Start copying to the last used word of the stored array. let sc := add(keccak256(0x0, 0x20), div(slength, 32)) // save new length sstore(_preBytes.slot, add(mul(newlength, 2), 1)) // Copy over the first `submod` bytes of the new data as in // case 1 above. let slengthmod := mod(slength, 32) let mlengthmod := mod(mlength, 32) let submod := sub(32, slengthmod) let mc := add(_postBytes, submod) let end := add(_postBytes, mlength) let mask := sub(exp(0x100, submod), 1) sstore(sc, add(sload(sc), and(mload(mc), mask))) for { sc := add(sc, 1) mc := add(mc, 0x20) } lt(mc, end) { sc := add(sc, 1) mc := add(mc, 0x20) } { sstore(sc, mload(mc)) } mask := exp(0x100, sub(mc, end)) sstore(sc, mul(div(mload(mc), mask), mask)) } } } function slice( bytes memory _bytes, uint _start, uint _length ) internal pure returns (bytes memory) { require(_length + 31 >= _length, "slice_overflow"); require(_bytes.length >= _start + _length, "slice_outOfBounds"); bytes memory tempBytes; assembly { switch iszero(_length) case 0 { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // The first word of the slice result is potentially a partial // word read from the original array. To read it, we calculate // the length of that partial word and start copying that many // bytes into the array. The first word we copy will start with // data we don't care about, but the last `lengthmod` bytes will // land at the beginning of the contents of the new array. When // we're done copying, we overwrite the full first word with // the actual length of the slice. let lengthmod := and(_length, 31) // The multiplication in the next line is necessary // because when slicing multiples of 32 bytes (lengthmod == 0) // the following copy loop was copying the origin's length // and then ending prematurely not copying everything it should. let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod))) let end := add(mc, _length) for { // The multiplication in the next line has the same exact purpose // as the one above. let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } mstore(tempBytes, _length) //update free-memory pointer //allocating the array padded to 32 bytes like the compiler does now mstore(0x40, and(add(mc, 31), not(31))) } //if we want a zero-length slice let's just return a zero-length array default { tempBytes := mload(0x40) //zero out the 32 bytes slice we are about to return //we need to do it because Solidity does not garbage collect mstore(tempBytes, 0) mstore(0x40, add(tempBytes, 0x20)) } } return tempBytes; } function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) { require(_bytes.length >= _start + 20, "toAddress_outOfBounds"); address tempAddress; assembly { tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000) } return tempAddress; } function toUint8(bytes memory _bytes, uint _start) internal pure returns (uint8) { require(_bytes.length >= _start + 1, "toUint8_outOfBounds"); uint8 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x1), _start)) } return tempUint; } function toUint16(bytes memory _bytes, uint _start) internal pure returns (uint16) { require(_bytes.length >= _start + 2, "toUint16_outOfBounds"); uint16 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x2), _start)) } return tempUint; } function toUint32(bytes memory _bytes, uint _start) internal pure returns (uint32) { require(_bytes.length >= _start + 4, "toUint32_outOfBounds"); uint32 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x4), _start)) } return tempUint; } function toUint64(bytes memory _bytes, uint _start) internal pure returns (uint64) { require(_bytes.length >= _start + 8, "toUint64_outOfBounds"); uint64 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x8), _start)) } return tempUint; } function toUint96(bytes memory _bytes, uint _start) internal pure returns (uint96) { require(_bytes.length >= _start + 12, "toUint96_outOfBounds"); uint96 tempUint; assembly { tempUint := mload(add(add(_bytes, 0xc), _start)) } return tempUint; } function toUint128(bytes memory _bytes, uint _start) internal pure returns (uint128) { require(_bytes.length >= _start + 16, "toUint128_outOfBounds"); uint128 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x10), _start)) } return tempUint; } function toUint256(bytes memory _bytes, uint _start) internal pure returns (uint) { require(_bytes.length >= _start + 32, "toUint256_outOfBounds"); uint tempUint; assembly { tempUint := mload(add(add(_bytes, 0x20), _start)) } return tempUint; } function toBytes32(bytes memory _bytes, uint _start) internal pure returns (bytes32) { require(_bytes.length >= _start + 32, "toBytes32_outOfBounds"); bytes32 tempBytes32; assembly { tempBytes32 := mload(add(add(_bytes, 0x20), _start)) } return tempBytes32; } function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) { bool success = true; assembly { let length := mload(_preBytes) // if lengths don't match the arrays are not equal switch eq(length, mload(_postBytes)) case 1 { // cb is a circuit breaker in the for loop since there's // no said feature for inline assembly loops // cb = 1 - don't breaker // cb = 0 - break let cb := 1 let mc := add(_preBytes, 0x20) let end := add(mc, length) for { let cc := add(_postBytes, 0x20) // the next line is the loop condition: // while(uint256(mc < end) + cb == 2) } eq(add(lt(mc, end), cb), 2) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { // if any of these checks fails then arrays are not equal if iszero(eq(mload(mc), mload(cc))) { // unsuccess: success := 0 cb := 0 } } } default { // unsuccess: success := 0 } } return success; } function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) { bool success = true; assembly { // we know _preBytes_offset is 0 let fslot := sload(_preBytes.slot) // Decode the length of the stored array like in concatStorage(). let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2) let mlength := mload(_postBytes) // if lengths don't match the arrays are not equal switch eq(slength, mlength) case 1 { // slength can contain both the length and contents of the array // if length < 32 bytes so let's prepare for that // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage if iszero(iszero(slength)) { switch lt(slength, 32) case 1 { // blank the last byte which is the length fslot := mul(div(fslot, 0x100), 0x100) if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) { // unsuccess: success := 0 } } default { // cb is a circuit breaker in the for loop since there's // no said feature for inline assembly loops // cb = 1 - don't breaker // cb = 0 - break let cb := 1 // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) let sc := keccak256(0x0, 0x20) let mc := add(_postBytes, 0x20) let end := add(mc, mlength) // the next line is the loop condition: // while(uint256(mc < end) + cb == 2) for { } eq(add(lt(mc, end), cb), 2) { sc := add(sc, 1) mc := add(mc, 0x20) } { if iszero(eq(sload(sc), mload(mc))) { // unsuccess: success := 0 cb := 0 } } } } } default { // unsuccess: success := 0 } } return success; } }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.7.6; library ExcessivelySafeCall { uint constant LOW_28_MASK = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff; /// @notice Use when you _really_ really _really_ don't trust the called /// contract. This prevents the called contract from causing reversion of /// the caller in as many ways as we can. /// @dev The main difference between this and a solidity low-level call is /// that we limit the number of bytes that the callee can cause to be /// copied to caller memory. This prevents stupid things like malicious /// contracts returning 10,000,000 bytes causing a local OOG when copying /// to memory. /// @param _target The address to call /// @param _gas The amount of gas to forward to the remote contract /// @param _maxCopy The maximum number of bytes of returndata to copy /// to memory. /// @param _calldata The data to send to the remote contract /// @return success and returndata, as `.call()`. Returndata is capped to /// `_maxCopy` bytes. function excessivelySafeCall( address _target, uint _gas, uint16 _maxCopy, bytes memory _calldata ) internal returns (bool, bytes memory) { // set up for assembly call uint _toCopy; bool _success; bytes memory _returnData = new bytes(_maxCopy); // dispatch message to recipient // by assembly calling "handle" function // we call via assembly to avoid memcopying a very large returndata // returned by a malicious contract assembly { _success := call( _gas, // gas _target, // recipient 0, // ether value add(_calldata, 0x20), // inloc mload(_calldata), // inlen 0, // outloc 0 // outlen ) // limit our copy to 256 bytes _toCopy := returndatasize() if gt(_toCopy, _maxCopy) { _toCopy := _maxCopy } // Store the length of the copied bytes mstore(_returnData, _toCopy) // copy the bytes from returndata[0:_toCopy] returndatacopy(add(_returnData, 0x20), 0, _toCopy) } return (_success, _returnData); } /// @notice Use when you _really_ really _really_ don't trust the called /// contract. This prevents the called contract from causing reversion of /// the caller in as many ways as we can. /// @dev The main difference between this and a solidity low-level call is /// that we limit the number of bytes that the callee can cause to be /// copied to caller memory. This prevents stupid things like malicious /// contracts returning 10,000,000 bytes causing a local OOG when copying /// to memory. /// @param _target The address to call /// @param _gas The amount of gas to forward to the remote contract /// @param _maxCopy The maximum number of bytes of returndata to copy /// to memory. /// @param _calldata The data to send to the remote contract /// @return success and returndata, as `.call()`. Returndata is capped to /// `_maxCopy` bytes. function excessivelySafeStaticCall( address _target, uint _gas, uint16 _maxCopy, bytes memory _calldata ) internal view returns (bool, bytes memory) { // set up for assembly call uint _toCopy; bool _success; bytes memory _returnData = new bytes(_maxCopy); // dispatch message to recipient // by assembly calling "handle" function // we call via assembly to avoid memcopying a very large returndata // returned by a malicious contract assembly { _success := staticcall( _gas, // gas _target, // recipient add(_calldata, 0x20), // inloc mload(_calldata), // inlen 0, // outloc 0 // outlen ) // limit our copy to 256 bytes _toCopy := returndatasize() if gt(_toCopy, _maxCopy) { _toCopy := _maxCopy } // Store the length of the copied bytes mstore(_returnData, _toCopy) // copy the bytes from returndata[0:_toCopy] returndatacopy(add(_returnData, 0x20), 0, _toCopy) } return (_success, _returnData); } /** * @notice Swaps function selectors in encoded contract calls * @dev Allows reuse of encoded calldata for functions with identical * argument types but different names. It simply swaps out the first 4 bytes * for the new selector. This function modifies memory in place, and should * only be used with caution. * @param _newSelector The new 4-byte selector * @param _buf The encoded contract args */ function swapSelector(bytes4 _newSelector, bytes memory _buf) internal pure { require(_buf.length >= 4); uint _mask = LOW_28_MASK; assembly { // load the first word of let _word := mload(add(_buf, 0x20)) // mask out the top 4 bytes // /x _word := and(_word, _mask) _word := or(_newSelector, _word) mstore(add(_buf, 0x20), _word) } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; import "./ILayerZeroUserApplicationConfig.sol"; interface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig { // @notice send a LayerZero message to the specified address at a LayerZero endpoint. // @param _dstChainId - the destination chain identifier // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains // @param _payload - a custom bytes payload to send to the destination contract // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination function send( uint16 _dstChainId, bytes calldata _destination, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams ) external payable; // @notice used by the messaging library to publish verified payload // @param _srcChainId - the source chain identifier // @param _srcAddress - the source contract (as bytes) at the source chain // @param _dstAddress - the address on destination chain // @param _nonce - the unbound message ordering nonce // @param _gasLimit - the gas limit for external contract execution // @param _payload - verified payload to send to the destination contract function receivePayload( uint16 _srcChainId, bytes calldata _srcAddress, address _dstAddress, uint64 _nonce, uint _gasLimit, bytes calldata _payload ) external; // @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64); // @notice get the outboundNonce from this source chain which, consequently, is always an EVM // @param _srcAddress - the source chain contract address function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64); // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery // @param _dstChainId - the destination chain identifier // @param _userApplication - the user app address on this EVM chain // @param _payload - the custom message to send over LayerZero // @param _payInZRO - if false, user app pays the protocol fee in native token // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain function estimateFees( uint16 _dstChainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam ) external view returns (uint nativeFee, uint zroFee); // @notice get this Endpoint's immutable source identifier function getChainId() external view returns (uint16); // @notice the interface to retry failed message on this Endpoint destination // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address // @param _payload - the payload to be retried function retryPayload( uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload ) external; // @notice query if any STORED payload (message blocking) at the endpoint. // @param _srcChainId - the source chain identifier // @param _srcAddress - the source chain contract address function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool); // @notice query if the _libraryAddress is valid for sending msgs. // @param _userApplication - the user app address on this EVM chain function getSendLibraryAddress(address _userApplication) external view returns (address); // @notice query if the _libraryAddress is valid for receiving msgs. // @param _userApplication - the user app address on this EVM chain function getReceiveLibraryAddress(address _userApplication) external view returns (address); // @notice query if the non-reentrancy guard for send() is on // @return true if the guard is on. false otherwise function isSendingPayload() external view returns (bool); // @notice query if the non-reentrancy guard for receive() is on // @return true if the guard is on. false otherwise function isReceivingPayload() external view returns (bool); // @notice get the configuration of the LayerZero messaging library of the specified version // @param _version - messaging library version // @param _chainId - the chainId for the pending config change // @param _userApplication - the contract address of the user application // @param _configType - type of configuration. every messaging library has its own convention. function getConfig( uint16 _version, uint16 _chainId, address _userApplication, uint _configType ) external view returns (bytes memory); // @notice get the send() LayerZero messaging library version // @param _userApplication - the contract address of the user application function getSendVersion(address _userApplication) external view returns (uint16); // @notice get the lzReceive() LayerZero messaging library version // @param _userApplication - the contract address of the user application function getReceiveVersion(address _userApplication) external view returns (uint16); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface ILayerZeroReceiver { // @notice LayerZero endpoint will invoke this function to deliver the message on the destination // @param _srcChainId - the source endpoint identifier // @param _srcAddress - the source sending contract address from the source chain // @param _nonce - the ordered message nonce // @param _payload - the signed payload is the UA bytes has encoded to be sent function lzReceive( uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload ) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; interface ILayerZeroUserApplicationConfig { // @notice set the configuration of the LayerZero messaging library of the specified version // @param _version - messaging library version // @param _chainId - the chainId for the pending config change // @param _configType - type of configuration. every messaging library has its own convention. // @param _config - configuration in the bytes. can encode arbitrary content. function setConfig( uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config ) external; // @notice set the send() LayerZero messaging library version to _version // @param _version - new messaging library version function setSendVersion(uint16 _version) external; // @notice set the lzReceive() LayerZero messaging library version to _version // @param _version - new messaging library version function setReceiveVersion(uint16 _version) external; // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload // @param _srcChainId - the chainId of the source chain // @param _srcAddress - the contract address of the source contract at the source chain function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "./interfaces/ILayerZeroReceiver.sol"; import "./interfaces/ILayerZeroUserApplicationConfig.sol"; import "./interfaces/ILayerZeroEndpoint.sol"; import "../libraries/BytesLib.sol"; /* * a generic LzReceiver implementation */ abstract contract LzApp is Ownable, ILayerZeroReceiver, ILayerZeroUserApplicationConfig { using BytesLib for bytes; // ua can not send payload larger than this by default, but it can be changed by the ua owner uint public constant DEFAULT_PAYLOAD_SIZE_LIMIT = 10000; ILayerZeroEndpoint public immutable lzEndpoint; mapping(uint16 => bytes) public trustedRemoteLookup; mapping(uint16 => mapping(uint16 => uint)) public minDstGasLookup; mapping(uint16 => uint) public payloadSizeLimitLookup; address public precrime; event SetPrecrime(address precrime); event SetTrustedRemote(uint16 _remoteChainId, bytes _path); event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress); event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint _minDstGas); constructor(address _endpoint) { lzEndpoint = ILayerZeroEndpoint(_endpoint); } function lzReceive( uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload ) public virtual override { // lzReceive must be called by the endpoint for security require(_msgSender() == address(lzEndpoint), "LzApp: invalid endpoint caller"); bytes memory trustedRemote = trustedRemoteLookup[_srcChainId]; // if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote. require( _srcAddress.length == trustedRemote.length && trustedRemote.length > 0 && keccak256(_srcAddress) == keccak256(trustedRemote), "LzApp: invalid source sending contract" ); _blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload); } // abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging function _blockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual; function _lzSend( uint16 _dstChainId, bytes memory _payload, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams, uint _nativeFee ) internal virtual { bytes memory trustedRemote = trustedRemoteLookup[_dstChainId]; require(trustedRemote.length != 0, "LzApp: destination chain is not a trusted source"); _checkPayloadSize(_dstChainId, _payload.length); lzEndpoint.send{value: _nativeFee}(_dstChainId, trustedRemote, _payload, _refundAddress, _zroPaymentAddress, _adapterParams); } function _checkGasLimit( uint16 _dstChainId, uint16 _type, bytes memory _adapterParams, uint _extraGas ) internal view virtual { uint providedGasLimit = _getGasLimit(_adapterParams); uint minGasLimit = minDstGasLookup[_dstChainId][_type]; require(minGasLimit > 0, "LzApp: minGasLimit not set"); require(providedGasLimit >= minGasLimit + _extraGas, "LzApp: gas limit is too low"); } function _getGasLimit(bytes memory _adapterParams) internal pure virtual returns (uint gasLimit) { require(_adapterParams.length >= 34, "LzApp: invalid adapterParams"); assembly { gasLimit := mload(add(_adapterParams, 34)) } } function _checkPayloadSize(uint16 _dstChainId, uint _payloadSize) internal view virtual { uint payloadSizeLimit = payloadSizeLimitLookup[_dstChainId]; if (payloadSizeLimit == 0) { // use default if not set payloadSizeLimit = DEFAULT_PAYLOAD_SIZE_LIMIT; } require(_payloadSize <= payloadSizeLimit, "LzApp: payload size is too large"); } //---------------------------UserApplication config---------------------------------------- function getConfig( uint16 _version, uint16 _chainId, address, uint _configType ) external view returns (bytes memory) { return lzEndpoint.getConfig(_version, _chainId, address(this), _configType); } // generic config for LayerZero user Application function setConfig( uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config ) external override onlyOwner { lzEndpoint.setConfig(_version, _chainId, _configType, _config); } function setSendVersion(uint16 _version) external override onlyOwner { lzEndpoint.setSendVersion(_version); } function setReceiveVersion(uint16 _version) external override onlyOwner { lzEndpoint.setReceiveVersion(_version); } function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner { lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress); } // _path = abi.encodePacked(remoteAddress, localAddress) // this function set the trusted path for the cross-chain communication function setTrustedRemote(uint16 _remoteChainId, bytes calldata _path) external onlyOwner { trustedRemoteLookup[_remoteChainId] = _path; emit SetTrustedRemote(_remoteChainId, _path); } function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyOwner { trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this)); emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress); } function getTrustedRemoteAddress(uint16 _remoteChainId) external view returns (bytes memory) { bytes memory path = trustedRemoteLookup[_remoteChainId]; require(path.length != 0, "LzApp: no trusted path record"); return path.slice(0, path.length - 20); // the last 20 bytes should be address(this) } function setPrecrime(address _precrime) external onlyOwner { precrime = _precrime; emit SetPrecrime(_precrime); } function setMinDstGas( uint16 _dstChainId, uint16 _packetType, uint _minGas ) external onlyOwner { minDstGasLookup[_dstChainId][_packetType] = _minGas; emit SetMinDstGas(_dstChainId, _packetType, _minGas); } // if the size is 0, it means default size limit function setPayloadSizeLimit(uint16 _dstChainId, uint _size) external onlyOwner { payloadSizeLimitLookup[_dstChainId] = _size; } //--------------------------- VIEW FUNCTION ---------------------------------------- function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) { bytes memory trustedSource = trustedRemoteLookup[_srcChainId]; return keccak256(trustedSource) == keccak256(_srcAddress); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./LzApp.sol"; import "../libraries/ExcessivelySafeCall.sol"; /* * the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel * this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking * NOTE: if the srcAddress is not configured properly, it will still block the message pathway from (srcChainId, srcAddress) */ abstract contract NonblockingLzApp is LzApp { using ExcessivelySafeCall for address; constructor(address _endpoint) LzApp(_endpoint) {} mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages; event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload, bytes _reason); event RetryMessageSuccess(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _payloadHash); // overriding the virtual function in LzReceiver function _blockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual override { (bool success, bytes memory reason) = address(this).excessivelySafeCall( gasleft(), 150, abi.encodeWithSelector(this.nonblockingLzReceive.selector, _srcChainId, _srcAddress, _nonce, _payload) ); if (!success) { _storeFailedMessage(_srcChainId, _srcAddress, _nonce, _payload, reason); } } function _storeFailedMessage( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload, bytes memory _reason ) internal virtual { failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(_payload); emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload, _reason); } function nonblockingLzReceive( uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload ) public virtual { // only internal transaction require(_msgSender() == address(this), "NonblockingLzApp: caller must be LzApp"); _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload); } //@notice override this function function _nonblockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual; function retryMessage( uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload ) public payable virtual { // assert there is message to retry bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce]; require(payloadHash != bytes32(0), "NonblockingLzApp: no stored message"); require(keccak256(_payload) == payloadHash, "NonblockingLzApp: invalid payload"); // clear the stored message failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0); // execute the message. revert if it fails again _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload); emit RetryMessageSuccess(_srcChainId, _srcAddress, _nonce, payloadHash); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./OFTCoreV2.sol"; import "./interfaces/IOFTV2.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; abstract contract BaseOFTV2 is OFTCoreV2, ERC165, IOFTV2 { constructor(uint8 _sharedDecimals, address _lzEndpoint) OFTCoreV2(_sharedDecimals, _lzEndpoint) {} /************************************************************************ * public functions ************************************************************************/ function sendFrom( address _from, uint16 _dstChainId, bytes32 _toAddress, uint _amount, LzCallParams calldata _callParams ) public payable virtual override { _send(_from, _dstChainId, _toAddress, _amount, _callParams.refundAddress, _callParams.zroPaymentAddress, _callParams.adapterParams); } function sendAndCall( address _from, uint16 _dstChainId, bytes32 _toAddress, uint _amount, bytes calldata _payload, uint64 _dstGasForCall, LzCallParams calldata _callParams ) public payable virtual override { _sendAndCall( _from, _dstChainId, _toAddress, _amount, _payload, _dstGasForCall, _callParams.refundAddress, _callParams.zroPaymentAddress, _callParams.adapterParams ); } /************************************************************************ * public view functions ************************************************************************/ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IOFTV2).interfaceId || super.supportsInterface(interfaceId); } function estimateSendFee( uint16 _dstChainId, bytes32 _toAddress, uint _amount, bool _useZro, bytes calldata _adapterParams ) public view virtual override returns (uint nativeFee, uint zroFee) { return _estimateSendFee(_dstChainId, _toAddress, _amount, _useZro, _adapterParams); } function estimateSendAndCallFee( uint16 _dstChainId, bytes32 _toAddress, uint _amount, bytes calldata _payload, uint64 _dstGasForCall, bool _useZro, bytes calldata _adapterParams ) public view virtual override returns (uint nativeFee, uint zroFee) { return _estimateSendAndCallFee(_dstChainId, _toAddress, _amount, _payload, _dstGasForCall, _useZro, _adapterParams); } function circulatingSupply() public view virtual override returns (uint); function token() public view virtual override returns (address); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Interface of the IOFT core standard */ interface ICommonOFT is IERC165 { struct LzCallParams { address payable refundAddress; address zroPaymentAddress; bytes adapterParams; } /** * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`) * _dstChainId - L0 defined chain id to send tokens too * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain * _amount - amount of the tokens to transfer * _useZro - indicates to use zro to pay L0 fees * _adapterParam - flexible bytes array to indicate messaging adapter services in L0 */ function estimateSendFee(uint16 _dstChainId, bytes32 _toAddress, uint _amount, bool _useZro, bytes calldata _adapterParams) external view returns (uint nativeFee, uint zroFee); function estimateSendAndCallFee(uint16 _dstChainId, bytes32 _toAddress, uint _amount, bytes calldata _payload, uint64 _dstGasForCall, bool _useZro, bytes calldata _adapterParams) external view returns (uint nativeFee, uint zroFee); /** * @dev returns the circulating amount of tokens on current chain */ function circulatingSupply() external view returns (uint); /** * @dev returns the address of the ERC20 token */ function token() external view returns (address); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.5.0; interface IOFTReceiverV2 { /** * @dev Called by the OFT contract when tokens are received from source chain. * @param _srcChainId The chain id of the source chain. * @param _srcAddress The address of the OFT token contract on the source chain. * @param _nonce The nonce of the transaction on the source chain. * @param _from The address of the account who calls the sendAndCall() on the source chain. * @param _amount The amount of tokens to transfer. * @param _payload Additional data with no specified format. */ function onOFTReceived(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes32 _from, uint _amount, bytes calldata _payload) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; import "./ICommonOFT.sol"; /** * @dev Interface of the IOFT core standard */ interface IOFTV2 is ICommonOFT { /** * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from` * `_from` the owner of token * `_dstChainId` the destination chain identifier * `_toAddress` can be any size depending on the `dstChainId`. * `_amount` the quantity of tokens in wei * `_refundAddress` the address LayerZero refunds if too much message fee is sent * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token) * `_adapterParams` is a flexible bytes array to indicate messaging adapter services */ function sendFrom(address _from, uint16 _dstChainId, bytes32 _toAddress, uint _amount, LzCallParams calldata _callParams) external payable; function sendAndCall(address _from, uint16 _dstChainId, bytes32 _toAddress, uint _amount, bytes calldata _payload, uint64 _dstGasForCall, LzCallParams calldata _callParams) external payable; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../lzApp/NonblockingLzApp.sol"; import "../../libraries/ExcessivelySafeCall.sol"; import "./interfaces/ICommonOFT.sol"; import "./interfaces/IOFTReceiverV2.sol"; abstract contract OFTCoreV2 is NonblockingLzApp { using BytesLib for bytes; using ExcessivelySafeCall for address; uint public constant NO_EXTRA_GAS = 0; // packet type uint8 public constant PT_SEND = 0; uint8 public constant PT_SEND_AND_CALL = 1; uint8 public immutable sharedDecimals; mapping(uint16 => mapping(bytes => mapping(uint64 => bool))) public creditedPackets; /** * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`) * `_nonce` is the outbound nonce */ event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes32 indexed _toAddress, uint _amount); /** * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain. * `_nonce` is the inbound nonce. */ event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint _amount); event CallOFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _hash); event NonContractAddress(address _address); // _sharedDecimals should be the minimum decimals on all chains constructor(uint8 _sharedDecimals, address _lzEndpoint) NonblockingLzApp(_lzEndpoint) { sharedDecimals = _sharedDecimals; } /************************************************************************ * public functions ************************************************************************/ function callOnOFTReceived( uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes32 _from, address _to, uint _amount, bytes calldata _payload, uint _gasForCall ) public virtual { require(_msgSender() == address(this), "OFTCore: caller must be OFTCore"); // send _amount = _transferFrom(address(this), _to, _amount); emit ReceiveFromChain(_srcChainId, _to, _amount); // call IOFTReceiverV2(_to).onOFTReceived{gas: _gasForCall}(_srcChainId, _srcAddress, _nonce, _from, _amount, _payload); } /************************************************************************ * internal functions ************************************************************************/ function _estimateSendFee( uint16 _dstChainId, bytes32 _toAddress, uint _amount, bool _useZro, bytes memory _adapterParams ) internal view virtual returns (uint nativeFee, uint zroFee) { // mock the payload for sendFrom() bytes memory payload = _encodeSendPayload(_toAddress, _ld2sd(_amount)); return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams); } function _estimateSendAndCallFee( uint16 _dstChainId, bytes32 _toAddress, uint _amount, bytes memory _payload, uint64 _dstGasForCall, bool _useZro, bytes memory _adapterParams ) internal view virtual returns (uint nativeFee, uint zroFee) { // mock the payload for sendAndCall() bytes memory payload = _encodeSendAndCallPayload(msg.sender, _toAddress, _ld2sd(_amount), _payload, _dstGasForCall); return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams); } function _nonblockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual override { uint8 packetType = _payload.toUint8(0); if (packetType == PT_SEND) { _sendAck(_srcChainId, _srcAddress, _nonce, _payload); } else if (packetType == PT_SEND_AND_CALL) { _sendAndCallAck(_srcChainId, _srcAddress, _nonce, _payload); } else { revert("OFTCore: unknown packet type"); } } function _send( address _from, uint16 _dstChainId, bytes32 _toAddress, uint _amount, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams ) internal virtual returns (uint amount) { _checkGasLimit(_dstChainId, PT_SEND, _adapterParams, NO_EXTRA_GAS); (amount, ) = _removeDust(_amount); amount = _debitFrom(_from, _dstChainId, _toAddress, amount); // amount returned should not have dust require(amount > 0, "OFTCore: amount too small"); bytes memory lzPayload = _encodeSendPayload(_toAddress, _ld2sd(amount)); _lzSend(_dstChainId, lzPayload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value); emit SendToChain(_dstChainId, _from, _toAddress, amount); } function _sendAck( uint16 _srcChainId, bytes memory, uint64, bytes memory _payload ) internal virtual { (address to, uint64 amountSD) = _decodeSendPayload(_payload); if (to == address(0)) { to = address(0xdead); } uint amount = _sd2ld(amountSD); amount = _creditTo(_srcChainId, to, amount); emit ReceiveFromChain(_srcChainId, to, amount); } function _sendAndCall( address _from, uint16 _dstChainId, bytes32 _toAddress, uint _amount, bytes memory _payload, uint64 _dstGasForCall, address payable _refundAddress, address _zroPaymentAddress, bytes memory _adapterParams ) internal virtual returns (uint amount) { _checkGasLimit(_dstChainId, PT_SEND_AND_CALL, _adapterParams, _dstGasForCall); (amount, ) = _removeDust(_amount); amount = _debitFrom(_from, _dstChainId, _toAddress, amount); require(amount > 0, "OFTCore: amount too small"); // encode the msg.sender into the payload instead of _from bytes memory lzPayload = _encodeSendAndCallPayload(msg.sender, _toAddress, _ld2sd(amount), _payload, _dstGasForCall); _lzSend(_dstChainId, lzPayload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value); emit SendToChain(_dstChainId, _from, _toAddress, amount); } function _sendAndCallAck( uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload ) internal virtual { (bytes32 from, address to, uint64 amountSD, bytes memory payloadForCall, uint64 gasForCall) = _decodeSendAndCallPayload(_payload); bool credited = creditedPackets[_srcChainId][_srcAddress][_nonce]; uint amount = _sd2ld(amountSD); // credit to this contract first, and then transfer to receiver only if callOnOFTReceived() succeeds if (!credited) { amount = _creditTo(_srcChainId, address(this), amount); creditedPackets[_srcChainId][_srcAddress][_nonce] = true; } if (!_isContract(to)) { emit NonContractAddress(to); return; } // workaround for stack too deep uint16 srcChainId = _srcChainId; bytes memory srcAddress = _srcAddress; uint64 nonce = _nonce; bytes memory payload = _payload; bytes32 from_ = from; address to_ = to; uint amount_ = amount; bytes memory payloadForCall_ = payloadForCall; // no gas limit for the call if retry uint gas = credited ? gasleft() : gasForCall; (bool success, bytes memory reason) = address(this).excessivelySafeCall( gasleft(), 150, abi.encodeWithSelector(this.callOnOFTReceived.selector, srcChainId, srcAddress, nonce, from_, to_, amount_, payloadForCall_, gas) ); if (success) { bytes32 hash = keccak256(payload); emit CallOFTReceivedSuccess(srcChainId, srcAddress, nonce, hash); } else { // store the failed message into the nonblockingLzApp _storeFailedMessage(srcChainId, srcAddress, nonce, payload, reason); } } function _isContract(address _account) internal view returns (bool) { return _account.code.length > 0; } function _ld2sd(uint _amount) internal view virtual returns (uint64) { uint amountSD = _amount / _ld2sdRate(); require(amountSD <= type(uint64).max, "OFTCore: amountSD overflow"); return uint64(amountSD); } function _sd2ld(uint64 _amountSD) internal view virtual returns (uint) { return _amountSD * _ld2sdRate(); } function _removeDust(uint _amount) internal view virtual returns (uint amountAfter, uint dust) { dust = _amount % _ld2sdRate(); amountAfter = _amount - dust; } function _encodeSendPayload(bytes32 _toAddress, uint64 _amountSD) internal view virtual returns (bytes memory) { return abi.encodePacked(PT_SEND, _toAddress, _amountSD); } function _decodeSendPayload(bytes memory _payload) internal view virtual returns (address to, uint64 amountSD) { require(_payload.toUint8(0) == PT_SEND && _payload.length == 41, "OFTCore: invalid payload"); to = _payload.toAddress(13); // drop the first 12 bytes of bytes32 amountSD = _payload.toUint64(33); } function _encodeSendAndCallPayload( address _from, bytes32 _toAddress, uint64 _amountSD, bytes memory _payload, uint64 _dstGasForCall ) internal view virtual returns (bytes memory) { return abi.encodePacked(PT_SEND_AND_CALL, _toAddress, _amountSD, _addressToBytes32(_from), _dstGasForCall, _payload); } function _decodeSendAndCallPayload(bytes memory _payload) internal view virtual returns ( bytes32 from, address to, uint64 amountSD, bytes memory payload, uint64 dstGasForCall ) { require(_payload.toUint8(0) == PT_SEND_AND_CALL, "OFTCore: invalid payload"); to = _payload.toAddress(13); // drop the first 12 bytes of bytes32 amountSD = _payload.toUint64(33); from = _payload.toBytes32(41); dstGasForCall = _payload.toUint64(73); payload = _payload.slice(81, _payload.length - 81); } function _addressToBytes32(address _address) internal pure virtual returns (bytes32) { return bytes32(uint(uint160(_address))); } function _debitFrom( address _from, uint16 _dstChainId, bytes32 _toAddress, uint _amount ) internal virtual returns (uint); function _creditTo( uint16 _srcChainId, address _toAddress, uint _amount ) internal virtual returns (uint); function _transferFrom( address _from, address _to, uint _amount ) internal virtual returns (uint); function _ld2sdRate() internal view virtual returns (uint); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./BaseOFTV2.sol"; abstract contract OFTV2 is BaseOFTV2, ERC20 { uint internal immutable ld2sdRate; constructor( string memory _name, string memory _symbol, uint8 _sharedDecimals, address _lzEndpoint ) ERC20(_name, _symbol) BaseOFTV2(_sharedDecimals, _lzEndpoint) { uint8 decimals = decimals(); require(_sharedDecimals <= decimals, "OFT: sharedDecimals must be <= decimals"); ld2sdRate = 10**(decimals - _sharedDecimals); } /************************************************************************ * public functions ************************************************************************/ function circulatingSupply() public view virtual override returns (uint) { return totalSupply(); } function token() public view virtual override returns (address) { return address(this); } /************************************************************************ * internal functions ************************************************************************/ function _debitFrom( address _from, uint16, bytes32, uint _amount ) internal virtual override returns (uint) { address spender = _msgSender(); if (_from != spender) _spendAllowance(_from, spender, _amount); _burn(_from, _amount); return _amount; } function _creditTo( uint16, address _toAddress, uint _amount ) internal virtual override returns (uint) { _mint(_toAddress, _amount); return _amount; } function _transferFrom( address _from, address _to, uint _amount ) internal virtual override returns (uint) { address spender = _msgSender(); // if transfer from this contract, no need to check allowance if (_from != address(this) && _from != spender) _spendAllowance(_from, spender, _amount); _transfer(_from, _to, _amount); return _amount; } function _ld2sdRate() internal view virtual override returns (uint) { return ld2sdRate; } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; import {IUniswapV2Router01} from "./IUniswapV2Router01.sol"; interface IUniswapV2Router is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; //solhint-disable func-name-mixedcase interface IUniswapV2Router01 { function factory() external view returns (address); function WETH() external view returns (address); function addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); function removeLiquidity( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETH( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountToken, uint256 amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETHWithPermit( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountToken, uint256 amountETH); function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapTokensForExactTokens( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactETHForTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function swapTokensForExactETH( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactTokensForETH( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapETHForExactTokens( uint256 amountOut, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function quote( uint256 amountA, uint256 reserveA, uint256 reserveB ) external pure returns (uint256 amountB); function getAmountOut( uint256 amountIn, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountOut); function getAmountIn( uint256 amountOut, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountIn); function getAmountsOut( uint256 amountIn, address[] calldata path ) external view returns (uint256[] memory amounts); function getAmountsIn( uint256 amountOut, address[] calldata path ) external view returns (uint256[] memory amounts); }
{ "optimizer": { "enabled": true, "runs": 200, "details": { "yul": false } }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"rainToken","type":"address"},{"internalType":"address","name":"wethToken","type":"address"},{"internalType":"address","name":"usdtToken","type":"address"},{"internalType":"contract IUniswapV2Router","name":"uniswapRouter","type":"address"},{"internalType":"address","name":"_lzEndpoint","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"_hash","type":"bytes32"}],"name":"CallOFTReceivedSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"_payload","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"_reason","type":"bytes"}],"name":"MessageFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"NonContractAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ReceiveFromChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"RetryMessageSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"bytes32","name":"_toAddress","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"SendToChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"_type","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"_minDstGas","type":"uint256"}],"name":"SetMinDstGas","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"precrime","type":"address"}],"name":"SetPrecrime","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_path","type":"bytes"}],"name":"SetTrustedRemote","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_remoteAddress","type":"bytes"}],"name":"SetTrustedRemoteAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_PAYLOAD_SIZE_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NO_EXTRA_GAS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PT_SEND","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PT_SEND_AND_CALL","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_deploymentTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes32","name":"_from","type":"bytes32"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_payload","type":"bytes"},{"internalType":"uint256","name":"_gasForCall","type":"uint256"}],"name":"callOnOFTReceived","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"circulatingSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"rainAmount","type":"uint256"}],"name":"convertRain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint64","name":"","type":"uint64"}],"name":"creditedPackets","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes32","name":"_toAddress","type":"bytes32"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_payload","type":"bytes"},{"internalType":"uint64","name":"_dstGasForCall","type":"uint64"},{"internalType":"bool","name":"_useZro","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateSendAndCallFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes32","name":"_toAddress","type":"bytes32"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_useZro","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateSendFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint64","name":"","type":"uint64"}],"name":"failedMessages","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"forceResumeReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"_configType","type":"uint256"}],"name":"getConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRainValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"}],"name":"getTrustedRemoteAddress","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"isTrustedRemote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lzEndpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"minDstGasLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"nonblockingLzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"payloadSizeLimitLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"precrime","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"retryMessage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes32","name":"_toAddress","type":"bytes32"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_payload","type":"bytes"},{"internalType":"uint64","name":"_dstGasForCall","type":"uint64"},{"components":[{"internalType":"address payable","name":"refundAddress","type":"address"},{"internalType":"address","name":"zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"adapterParams","type":"bytes"}],"internalType":"struct ICommonOFT.LzCallParams","name":"_callParams","type":"tuple"}],"name":"sendAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes32","name":"_toAddress","type":"bytes32"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"components":[{"internalType":"address payable","name":"refundAddress","type":"address"},{"internalType":"address","name":"zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"adapterParams","type":"bytes"}],"internalType":"struct ICommonOFT.LzCallParams","name":"_callParams","type":"tuple"}],"name":"sendFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_configType","type":"uint256"},{"internalType":"bytes","name":"_config","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint16","name":"_packetType","type":"uint16"},{"internalType":"uint256","name":"_minGas","type":"uint256"}],"name":"setMinDstGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"_size","type":"uint256"}],"name":"setPayloadSizeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_precrime","type":"address"}],"name":"setPrecrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newRate","type":"uint256"}],"name":"setRainMarkup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setReceiveVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setSendVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newStaker","type":"address"}],"name":"setStakingContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"bytes","name":"_path","type":"bytes"}],"name":"setTrustedRemote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"bytes","name":"_remoteAddress","type":"bytes"}],"name":"setTrustedRemoteAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dynamicVesting","type":"address"}],"name":"setVestingContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sharedDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"rainAmount","type":"uint256"},{"internalType":"uint32","name":"stakePeriodDays","type":"uint32"}],"name":"swapAndStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"trustedRemoteLookup","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60e06040523480156200001157600080fd5b506040516200567b3803806200567b8339810160408190526200003491620003ec565b604080518082018252600a815269222aa2a6102a37b5b2b760b11b602080830191909152825180840190935260048352631115515360e21b908301529060068383838383818180803380620000aa576000604051631e4fbdf760e01b8152600401620000a1919062000481565b60405180910390fd5b620000b581620001d9565b506001600160a01b0316608052505060ff1660a05250600a9050620000db83826200059b565b50600b620000ea82826200059b565b5050506000620000ff6200022960201b60201c565b90508060ff168360ff1611156200012a5760405162461bcd60e51b8152600401620000a1906200066b565b620001368382620006cd565b6200014390600a6200081e565b60c0525050600c80546001600160a01b03808b166001600160a01b031992831617909255600d80548a8416908316179055600e8054898416908316179055601280549288169290911691909117905550506127106011555046600103620001ce57620001ce620001bb6000546001600160a01b031690565b6b204fce5e3e250261100000006200022e565b505050505062000898565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b601290565b6001600160a01b0382166200025b57600060405163ec442f0560e01b8152600401620000a1919062000481565b62000269600083836200026d565b5050565b6001600160a01b0383166200029c57806009600082825462000290919062000835565b90915550620002fe9050565b6001600160a01b03831660009081526007602052604090205481811015620002df5783818360405163391434e360e21b8152600401620000a19392919062000852565b6001600160a01b03841660009081526007602052604090209082900390555b6001600160a01b0382166200031c576009805482900390556200033b565b6001600160a01b03821660009081526007602052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405162000380919062000888565b60405180910390a3505050565b60006001600160a01b0382165b92915050565b620003ab816200038d565b8114620003b757600080fd5b50565b80516200039a81620003a0565b60006200039a826200038d565b620003ab81620003c7565b80516200039a81620003d4565b600080600080600060a08688031215620004095762000409600080fd5b6000620004178888620003ba565b95505060206200042a88828901620003ba565b94505060406200043d88828901620003ba565b93505060606200045088828901620003df565b92505060806200046388828901620003ba565b9150509295509295909350565b6200047b816200038d565b82525050565b602081016200039a828462000470565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052602260045260246000fd5b600281046001821680620004d257607f821691505b602082108103620004e757620004e7620004a7565b50919050565b60006200039a620004fb8381565b90565b6200050983620004ed565b815460001960089490940293841b1916921b91909117905550565b600062000533818484620004fe565b505050565b8181101562000269576200054e60008262000524565b60010162000538565b601f82111562000533576000818152602090206020601f85010481016020851015620005805750805b620005946020601f86010483018262000538565b5050505050565b81516001600160401b03811115620005b757620005b762000491565b620005c38254620004bd565b620005d082828562000557565b6020601f831160018114620006075760008415620005ee5750858201515b600019600886021c198116600286021786555062000663565b600085815260208120601f198616915b8281101562000639578885015182556020948501946001909201910162000617565b86831015620006565784890151600019601f89166008021c191682555b6001600288020188555050505b505050505050565b602080825281016200039a81602781527f4f46543a20736861726564446563696d616c73206d757374206265203c3d20646020820152666563696d616c7360c81b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60ff9182169190811690828203908111156200039a576200039a620006b7565b80825b600185111562000733578086048111156200070f576200070f620006b7565b60018516156200071e57908102905b80026200072b8560011c90565b9450620006f0565b94509492505050565b6000826200074d5750600162000817565b816200075c5750600062000817565b81600181146200077557600281146200078057620007b4565b600191505062000817565b60ff841115620007945762000794620006b7565b8360020a915084821115620007ad57620007ad620006b7565b5062000817565b5060208310610133831016604e8410600b8410161715620007ec575081810a83811115620007e657620007e6620006b7565b62000817565b620007fb8484846001620006ed565b92509050818404811115620008145762000814620006b7565b81025b9392505050565b600060ff831692506200081760001984846200073c565b808201808211156200039a576200039a620006b7565b806200047b565b6060810162000862828662000470565b6200087160208301856200084b565b6200088060408301846200084b565b949350505050565b602081016200039a82846200084b565b60805160a05160c051614d6662000915600039600081816127ab01528181612b720152612ddb015260006107160152600081816108e501528181610a8e01528181610d3901528181610f56015281816110fe0152818161180801528181611c1101528181611e4f015281816123b40152612cbc0152614d666000f3fe6080604052600436106103345760003560e01c806376203b48116101ab578063a9059cbb116100f7578063df2a5b3b11610095578063eb8d72b71161006f578063eb8d72b714610a18578063f2fde38b14610a38578063f5ecbdbc14610a58578063fc0c546a14610a7857600080fd5b8063df2a5b3b146109c3578063e6a20ae6146109e3578063eaffd49a146109f857600080fd5b8063c4461834116100d1578063c446183414610934578063cbed8b9c1461094a578063d1deba1f1461096a578063dd62ed3e1461097d57600080fd5b8063a9059cbb146108b3578063b353aaa7146108d3578063baf3292d1461091457600080fd5b8063950c8a74116101645780639dd373b91161013e5780639dd373b9146108335780639f38369a14610853578063a4c51df514610873578063a6c3d1651461089357600080fd5b8063950c8a74146107ac57806395d89b41146107cc5780639bdb9812146107e157600080fd5b806376203b48146106d15780638309179e146106e4578063857749b0146107045780638cfd8f5c146107385780638da5cb5b146107705780639358928b1461079757600080fd5b806338682268116102855780636282cbbc1161022357806370a08231116101fd57806370a0823114610646578063715018a61461067c57806374991569146106915780637533d788146106b157600080fd5b80636282cbbc146105f357806366ad5c8a14610613578063695ef6bf1461063357600080fd5b806342d65a8d1161025f57806342d65a8d1461055a578063447705151461057a5780634c42899a1461058f5780635b8c41e6146105a457600080fd5b806338682268146104ed5780633d8b38f61461050d5780633f1f4fa41461052d57600080fd5b80630df37483116102f257806318160ddd116102cc57806318160ddd1461046d57806323b872dd14610482578063313ce567146104a2578063365260b4146104bf57600080fd5b80630df374831461041557806310ddb1371461043557806312097e551461045557600080fd5b80621d35671461033957806301ffc9a71461035b57806306fdde031461039157806307e0db17146103b3578063095ea7b3146103d35780630d9c8a7e146103f3575b600080fd5b34801561034557600080fd5b506103596103543660046130b5565b610a8b565b005b34801561036757600080fd5b5061037b610376366004613170565b610c51565b604051610388919061319b565b60405180910390f35b34801561039d57600080fd5b506103a6610c88565b6040516103889190613201565b3480156103bf57600080fd5b506103596103ce366004613212565b610d1a565b3480156103df57600080fd5b5061037b6103ee366004613269565b610da3565b3480156103ff57600080fd5b50610408610dbb565b60405161038891906132ac565b34801561042157600080fd5b506103596104303660046132ba565b610f18565b34801561044157600080fd5b50610359610450366004613212565b610f37565b34801561046157600080fd5b5061040863657e21db81565b34801561047957600080fd5b50600954610408565b34801561048e57600080fd5b5061037b61049d3660046132dc565b610f8b565b3480156104ae57600080fd5b5060125b6040516103889190613335565b3480156104cb57600080fd5b506104df6104da366004613356565b610fb1565b6040516103889291906133d0565b3480156104f957600080fd5b506103596105083660046133eb565b611006565b34801561051957600080fd5b5061037b61052836600461340c565b611013565b34801561053957600080fd5b50610408610548366004613212565b60036020526000908152604090205481565b34801561056657600080fd5b5061035961057536600461340c565b6110df565b34801561058657600080fd5b50610408600081565b34801561059b57600080fd5b506104b2600081565b3480156105b057600080fd5b506104086105bf366004613560565b6005602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156105ff57600080fd5b5061035961060e3660046133eb565b611165565b34801561061f57600080fd5b5061035961062e3660046130b5565b6111d1565b6103596106413660046135db565b61126e565b34801561065257600080fd5b5061040861066136600461366d565b6001600160a01b031660009081526007602052604090205490565b34801561068857600080fd5b506103596112d9565b34801561069d57600080fd5b506103596106ac36600461366d565b6112ed565b3480156106bd57600080fd5b506103a66106cc366004613212565b611317565b6103596106df36600461368e565b6113b1565b3480156106f057600080fd5b506103596106ff36600461377c565b611460565b34801561071057600080fd5b506104b27f000000000000000000000000000000000000000000000000000000000000000081565b34801561074457600080fd5b506104086107533660046137af565b600260209081526000928352604080842090915290825290205481565b34801561077c57600080fd5b506000546001600160a01b03165b60405161038891906137eb565b3480156107a357600080fd5b5061040861153d565b3480156107b857600080fd5b5060045461078a906001600160a01b031681565b3480156107d857600080fd5b506103a661154d565b3480156107ed57600080fd5b5061037b6107fc366004613560565b6006602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205460ff1681565b34801561083f57600080fd5b5061035961084e36600461366d565b61155c565b34801561085f57600080fd5b506103a661086e366004613212565b611586565b34801561087f57600080fd5b506104df61088e3660046137f9565b611665565b34801561089f57600080fd5b506103596108ae36600461340c565b6116f4565b3480156108bf57600080fd5b5061037b6108ce366004613269565b61177d565b3480156108df57600080fd5b506109077f000000000000000000000000000000000000000000000000000000000000000081565b6040516103889190613916565b34801561092057600080fd5b5061035961092f36600461366d565b61178b565b34801561094057600080fd5b5061040861271081565b34801561095657600080fd5b50610359610965366004613924565b6117e9565b6103596109783660046130b5565b611873565b34801561098957600080fd5b506104086109983660046139a7565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b3480156109cf57600080fd5b506103596109de3660046139da565b611a13565b3480156109ef57600080fd5b506104b2600181565b348015610a0457600080fd5b50610359610a13366004613a0f565b611a72565b348015610a2457600080fd5b50610359610a3336600461340c565b611b5f565b348015610a4457600080fd5b50610359610a5336600461366d565b611bb9565b348015610a6457600080fd5b506103a6610a73366004613aff565b611bf7565b348015610a8457600080fd5b503061078a565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614610adc5760405162461bcd60e51b8152600401610ad390613b9a565b60405180910390fd5b61ffff861660009081526001602052604081208054610afa90613bc0565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2690613bc0565b8015610b735780601f10610b4857610100808354040283529160200191610b73565b820191906000526020600020905b815481529060010190602001808311610b5657829003601f168201915b50505050509050805186869050148015610b8e575060008151115b8015610bb6575080516020820120604051610bac9088908890613bf9565b6040518091039020145b610bd25760405162461bcd60e51b8152600401610ad390613c4c565b610c488787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a935091508890889081908401838280828437600092019190915250611c9c92505050565b50505050505050565b60006001600160e01b03198216631f7ecdf760e01b1480610c8257506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600a8054610c9790613bc0565b80601f0160208091040260200160405190810160405280929190818152602001828054610cc390613bc0565b8015610d105780601f10610ce557610100808354040283529160200191610d10565b820191906000526020600020905b815481529060010190602001808311610cf357829003601f168201915b5050505050905090565b610d22611d15565b6040516307e0db1760e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906307e0db1790610d6e908490600401613c66565b600060405180830381600087803b158015610d8857600080fd5b505af1158015610d9c573d6000803e3d6000fd5b5050505050565b600033610db1818585611d42565b5060019392505050565b60408051600380825260808201909252600091829190602082016060803683375050600c5482519293506001600160a01b031691839150600090610e0157610e01613c74565b6001600160a01b039283166020918202929092010152600d54825191169082906001908110610e3257610e32613c74565b6001600160a01b039283166020918202929092010152600e54825191169082906002908110610e6357610e63613c74565b6001600160a01b03928316602091820292909201015260125460405163d06ca61f60e01b8152600092919091169063d06ca61f90610eaf90670de0b6b3a7640000908690600401613cfc565b600060405180830381865afa158015610ecc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ef49190810190613dc9565b905080600281518110610f0957610f09613c74565b60200260200101519250505090565b610f20611d15565b61ffff909116600090815260036020526040902055565b610f3f611d15565b6040516310ddb13760e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906310ddb13790610d6e908490600401613c66565b600033610f99858285611d54565b610fa4858585611dbf565b60019150505b9392505050565b600080610ff78888888888888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611e1e92505050565b91509150965096945050505050565b61100e611d15565b601155565b61ffff83166000908152600160205260408120805482919061103490613bc0565b80601f016020809104026020016040519081016040528092919081815260200182805461106090613bc0565b80156110ad5780601f10611082576101008083540402835291602001916110ad565b820191906000526020600020905b81548152906001019060200180831161109057829003601f168201915b5050505050905083836040516110c4929190613bf9565b60405180910390208180519060200120149150509392505050565b6110e7611d15565b6040516342d65a8d60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906342d65a8d9061113790869086908690600401613e26565b600060405180830381600087803b15801561115157600080fd5b505af1158015610c48573d6000803e3d6000fd5b611170335b3b151590565b1561118d5760405162461bcd60e51b8152600401610ad390613e6e565b60008061119983611edb565b600f54604051636e0ecc0360e11b81529294509092506001600160a01b03169063dc1d98069061113790339086908690600401613e7e565b3330146111f05760405162461bcd60e51b8152600401610ad390613ee9565b6112668686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f89018190048102820181019092528781528993509150879087908190840183828082843760009201919091525061209092505050565b505050505050565b61126685858585611282602087018761366d565b611292604088016020890161366d565b61129f6040890189613ef9565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506120e792505050565b6112e1611d15565b6112eb60006121a1565b565b6112f5611d15565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6001602052600090815260409020805461133090613bc0565b80601f016020809104026020016040519081016040528092919081815260200182805461135c90613bc0565b80156113a95780601f1061137e576101008083540402835291602001916113a9565b820191906000526020600020905b81548152906001019060200180831161138c57829003601f168201915b505050505081565b6114558888888888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a92506113fe915050602089018961366d565b61140e60408a0160208b0161366d565b61141b60408b018b613ef9565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506121f192505050565b505050505050505050565b605a8163ffffffff1610156114875760405162461bcd60e51b8152600401610ad390613f96565b6114903361116a565b156114ad5760405162461bcd60e51b8152600401610ad390613e6e565b6000806114b984611edb565b60105491935091506001600160a01b03166340f320bb336114da8486613fbc565b6114e78762015180613fcf565b6040518463ffffffff1660e01b815260040161150593929190613ffe565b600060405180830381600087803b15801561151f57600080fd5b505af1158015611533573d6000803e3d6000fd5b5050505050505050565b600061154860095490565b905090565b6060600b8054610c9790613bc0565b611564611d15565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b61ffff81166000908152600160205260408120805460609291906115a990613bc0565b80601f01602080910402602001604051908101604052809291908181526020018280546115d590613bc0565b80156116225780601f106115f757610100808354040283529160200191611622565b820191906000526020600020905b81548152906001019060200180831161160557829003601f168201915b50505050509050805160000361164a5760405162461bcd60e51b8152600401610ad39061405a565b610faa60006014835161165d919061406a565b8391906122bf565b6000806116e28b8b8b8b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8d018190048102820181019092528b81528e93508d9250908c908c908190840183828082843760009201919091525061238792505050565b91509150995099975050505050505050565b6116fc611d15565b818130604051602001611711939291906140a5565b60408051601f1981840301815291815261ffff851660009081526001602052209061173c908261414e565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce83838360405161177093929190613e26565b60405180910390a1505050565b600033610db1818585611dbf565b611793611d15565b600480546001600160a01b0319166001600160a01b0383161790556040517f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b906117de9083906137eb565b60405180910390a150565b6117f1611d15565b6040516332fb62e760e21b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063cbed8b9c906118459088908890889088908890600401614210565b600060405180830381600087803b15801561185f57600080fd5b505af1158015611455573d6000803e3d6000fd5b61ffff861660009081526005602052604080822090516118969088908890613bf9565b90815260408051602092819003830190206001600160401b038716600090815292529020549050806118da5760405162461bcd60e51b8152600401610ad390614296565b8083836040516118eb929190613bf9565b6040518091039020146119105760405162461bcd60e51b8152600401610ad3906142e4565b61ffff871660009081526005602052604080822090516119339089908990613bf9565b90815260408051602092819003830181206001600160401b038916600090815290845282902093909355601f880182900482028301820190528682526119cb918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a93509150889088908190840183828082843760009201919091525061209092505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e58787878785604051611a02959493929190614303565b60405180910390a150505050505050565b611a1b611d15565b61ffff80841660009081526002602090815260408083209386168352929052819020829055517f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac0906117709085908590859061434a565b333014611a915760405162461bcd60e51b8152600401610ad390614399565b611a9c308686612442565b9350846001600160a01b03168a61ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf86604051611adc91906132ac565b60405180910390a3604051633fe79aed60e11b81526001600160a01b03861690637fcf35da908390611b20908e908e908e908e908e908d908d908d906004016143a9565b600060405180830381600088803b158015611b3a57600080fd5b5087f1158015611b4e573d6000803e3d6000fd5b505050505050505050505050505050565b611b67611d15565b61ffff83166000908152600160205260409020611b85828483614414565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab83838360405161177093929190613e26565b611bc1611d15565b6001600160a01b038116611beb576000604051631e4fbdf760e01b8152600401610ad391906137eb565b611bf4816121a1565b50565b604051633d7b2f6f60e21b81526060906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f5ecbdbc90611c4c9088908890309088906004016144d6565b600060405180830381865afa158015611c69573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611c919190810190614563565b90505b949350505050565b600080611cff5a60966366ad5c8a60e01b89898989604051602401611cc4949392919061459d565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915230929190612494565b915091508161126657611266868686868561251e565b6000546001600160a01b031633146112eb573360405163118cdaa760e01b8152600401610ad391906137eb565b611d4f83838360016125bb565b505050565b6001600160a01b038381166000908152600860209081526040808320938616835292905220546000198114611db95781811015611daa57828183604051637dc7a0d960e11b8152600401610ad393929190613e7e565b611db9848484840360006125bb565b50505050565b6001600160a01b038316611de9576000604051634b637e8f60e11b8152600401610ad391906137eb565b6001600160a01b038216611e1357600060405163ec442f0560e01b8152600401610ad391906137eb565b611d4f83838361268e565b6000806000611e3587611e30886127a3565b6127f9565b60405163040a7bb160e41b81529091506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906340a7bb1090611e8c908b90309086908b908b906004016145de565b6040805180830381865afa158015611ea8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ecc919061462c565b92509250509550959350505050565b600c5460009081906001600160a01b03166323b872dd3361dead866040518463ffffffff1660e01b8152600401611f149392919061465f565b6020604051808303816000875af1158015611f33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f579190614685565b506000611f62610dbb565b90506000670de0b6b3a7640000611f7983876146a6565b611f8391906146d4565b9050620186a0611f9a63657e21db624f1a00613fbc565b4210611fa9575061ea60611fc6565b611fba63657e21db62278d00613fbc565b4210611fc65750620138805b6000611fd963657e21db62ed4e00613fbc565b42101561200657670de0b6b3a764000060115488611ff791906146a6565b61200191906146d4565b612008565b825b9050611194620f42408161201c82856146a6565b61202691906146d4565b6120359064e8d4a510006146a6565b9750600096508483111561208557600061204f868561406a565b90508261205c83836146a6565b61206691906146d4565b6120759064e8d4a510006146a6565b9750612081888a61406a565b9850505b505050505050915091565b600061209c8282612828565b905060ff81166120b7576120b28585858561285e565b610d9c565b60001960ff8216016120cf576120b2858585856128ec565b60405162461bcd60e51b8152600401610ad39061471c565b60006120f587828481612af5565b6120fe85612b6a565b50905061210d88888884612baa565b90506000811161212f5760405162461bcd60e51b8152600401610ad390614760565b600061213e87611e30846127a3565b905061214e888287878734612bdc565b86896001600160a01b03168961ffff167fd81fc9b8523134ed613870ed029d6170cbb73aa6a6bc311b9a642689fb9df59a8560405161218d91906132ac565b60405180910390a450979650505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000612209896001846001600160401b038916612af5565b61221287612b6a565b5090506122218a8a8a84612baa565b9050600081116122435760405162461bcd60e51b8152600401610ad390614760565b600061225a338a612253856127a3565b8a8a612d38565b905061226a8a8287878734612bdc565b888b6001600160a01b03168b61ffff167fd81fc9b8523134ed613870ed029d6170cbb73aa6a6bc311b9a642689fb9df59a856040516122a991906132ac565b60405180910390a4509998505050505050505050565b6060816122cd81601f613fbc565b10156122eb5760405162461bcd60e51b8152600401610ad390614795565b6122f58284613fbc565b845110156123155760405162461bcd60e51b8152600401610ad3906147cd565b606082158015612334576040519150600082526020820160405261237e565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101561236d578051835260209283019201612355565b5050858452601f01601f1916604052505b50949350505050565b600080600061239a338a6122538b6127a3565b60405163040a7bb160e41b81529091506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906340a7bb10906123f1908d90309086908b908b906004016145de565b6040805180830381865afa15801561240d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612431919061462c565b925092505097509795505050505050565b600033306001600160a01b038616148015906124705750806001600160a01b0316856001600160a01b031614155b1561248057612480858285611d54565b61248b858585611dbf565b50909392505050565b6000606060008060008661ffff166001600160401b038111156124b9576124b9613467565b6040519080825280601f01601f1916602001820160405280156124e3576020820181803683370190505b50905060008087516020890160008d8df191503d925086831115612505578692505b828152826000602083013e909890975095505050505050565b8180519060200120600560008761ffff1661ffff1681526020019081526020016000208560405161254f91906147ff565b9081526040805191829003602090810183206001600160401b0388166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c906125ac908790879087908790879061480b565b60405180910390a15050505050565b6001600160a01b0384166125e557600060405163e602df0560e01b8152600401610ad391906137eb565b6001600160a01b03831661260f576000604051634a1406b160e11b8152600401610ad391906137eb565b6001600160a01b0380851660009081526008602090815260408083209387168352929052208290558015611db957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161268091906132ac565b60405180910390a350505050565b6001600160a01b0383166126b95780600960008282546126ae9190613fbc565b909155506127189050565b6001600160a01b038316600090815260076020526040902054818110156126f95783818360405163391434e360e21b8152600401610ad393929190613e7e565b6001600160a01b03841660009081526007602052604090209082900390555b6001600160a01b03821661273457600980548290039055612753565b6001600160a01b03821660009081526007602052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161279691906132ac565b60405180910390a3505050565b6000806127d07f0000000000000000000000000000000000000000000000000000000000000000846146d4565b90506001600160401b03811115610c825760405162461bcd60e51b8152600401610ad390614894565b606060008383604051602001612811939291906148da565b604051602081830303815290604052905092915050565b6000612835826001613fbc565b835110156128555760405162461bcd60e51b8152600401610ad39061493b565b50016001015190565b60008061286a83612d7a565b90925090506001600160a01b0382166128835761dead91505b600061288e82612dd4565b905061289b878483612e09565b9050826001600160a01b03168761ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf836040516128db91906132ac565b60405180910390a350505050505050565b60008060008060006128fd86612e1c565b945094509450945094506000600660008b61ffff1661ffff1681526020019081526020016000208960405161293291906147ff565b90815260408051602092819003830190206001600160401b038b166000908152925281205460ff16915061296585612dd4565b9050816129d3576129778b3083612e09565b61ffff8c1660009081526006602052604090819020905191925060019161299f908d906147ff565b90815260408051602092819003830190206001600160401b038d16600090815292529020805460ff19169115159190911790555b6001600160a01b0386163b612a25577f9aedf5fdba8716db3b6705ca00150643309995d4f818a249ed6dde6677e7792d86604051612a1191906137eb565b60405180910390a150505050505050611db9565b8a8a8a8a8a8a868a60008a612a43578b6001600160401b0316612a45565b5a5b9050600080612a775a609663eaffd49a60e01b8e8e8e8d8d8d8d8d604051602401611cc498979695949392919061494b565b915091508115612ad0578751602089012060405161ffff8d16907fb8890edbfc1c74692f527444645f95489c3703cc2df42e4a366f5d06fa6cd88490612ac2908e908e9086906149d0565b60405180910390a250612add565b612add8b8b8b8b8561251e565b50505050505050505050505050505050505050505050565b6000612b0083612ea8565b61ffff80871660009081526002602090815260408083209389168352929052205490915080612b415760405162461bcd60e51b8152600401610ad390614a24565b612b4b8382613fbc565b8210156112665760405162461bcd60e51b8152600401610ad390614a68565b600080612b977f000000000000000000000000000000000000000000000000000000000000000084614a78565b9050612ba3818461406a565b9150915091565b6000336001600160a01b0386168114612bc857612bc8868285611d54565b612bd28684612ed4565b5090949350505050565b61ffff861660009081526001602052604081208054612bfa90613bc0565b80601f0160208091040260200160405190810160405280929190818152602001828054612c2690613bc0565b8015612c735780601f10612c4857610100808354040283529160200191612c73565b820191906000526020600020905b815481529060010190602001808311612c5657829003601f168201915b505050505090508051600003612c9b5760405162461bcd60e51b8152600401610ad390614ad9565b612ca6878751612f0e565b60405162c5803160e81b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c5803100908490612cfd908b9086908c908c908c908c90600401614ae9565b6000604051808303818588803b158015612d1657600080fd5b505af1158015612d2a573d6000803e3d6000fd5b505050505050505050505050565b6060600185856001600160a01b0389168587604051602001612d5f96959493929190614b57565b60405160208183030381529060405290505b95945050505050565b60008080612d888482612828565b60ff16148015612d99575082516029145b612db55760405162461bcd60e51b8152600401610ad390614be7565b612dc083600d612f4f565b9150612dcd836021612f8c565b9050915091565b6000610c827f00000000000000000000000000000000000000000000000000000000000000006001600160401b0384166146a6565b6000612e158383612fc2565b5092915050565b600080806060816001612e2f8783612828565b60ff1614612e4f5760405162461bcd60e51b8152600401610ad390614be7565b612e5a86600d612f4f565b9350612e67866021612f8c565b9250612e74866029612ff8565b9450612e81866049612f8c565b9050612e9d6051808851612e95919061406a565b8891906122bf565b915091939590929450565b6000602282511015612ecc5760405162461bcd60e51b8152600401610ad390614c2b565b506022015190565b6001600160a01b038216612efe576000604051634b637e8f60e11b8152600401610ad391906137eb565b612f0a8260008361268e565b5050565b61ffff821660009081526003602052604081205490819003612f2f57506127105b80821115611d4f5760405162461bcd60e51b8152600401610ad390614c6d565b6000612f5c826014613fbc565b83511015612f7c5760405162461bcd60e51b8152600401610ad390614ca9565b500160200151600160601b900490565b6000612f99826008613fbc565b83511015612fb95760405162461bcd60e51b8152600401610ad390614ce4565b50016008015190565b6001600160a01b038216612fec57600060405163ec442f0560e01b8152600401610ad391906137eb565b612f0a6000838361268e565b6000613005826020613fbc565b835110156130255760405162461bcd60e51b8152600401610ad390614d20565b50016020015190565b61ffff81165b8114611bf457600080fd5b8035610c828161302e565b60008083601f84011261305f5761305f600080fd5b5081356001600160401b0381111561307957613079600080fd5b60208301915083600182028301111561309457613094600080fd5b9250929050565b6001600160401b038116613034565b8035610c828161309b565b600080600080600080608087890312156130d1576130d1600080fd5b60006130dd898961303f565b96505060208701356001600160401b038111156130fc576130fc600080fd5b61310889828a0161304a565b9550955050604061311b89828a016130aa565b93505060608701356001600160401b0381111561313a5761313a600080fd5b61314689828a0161304a565b92509250509295509295509295565b6001600160e01b03198116613034565b8035610c8281613155565b60006020828403121561318557613185600080fd5b6000611c948484613165565b8015155b82525050565b60208101610c828284613191565b60005b838110156131c45781810151838201526020016131ac565b50506000910152565b60006131d7825190565b8084526020840193506131ee8185602086016131a9565b601f19601f8201165b9093019392505050565b60208082528101610faa81846131cd565b60006020828403121561322757613227600080fd5b6000611c94848461303f565b60006001600160a01b038216610c82565b61303481613233565b8035610c8281613244565b80613034565b8035610c8281613258565b6000806040838503121561327f5761327f600080fd5b600061328b858561324d565b925050602061329c8582860161325e565b9150509250929050565b80613195565b60208101610c8282846132a6565b600080604083850312156132d0576132d0600080fd5b600061328b858561303f565b6000806000606084860312156132f4576132f4600080fd5b6000613300868661324d565b93505060206133118682870161324d565b92505060406133228682870161325e565b9150509250925092565b60ff8116613195565b60208101610c82828461332c565b801515613034565b8035610c8281613343565b60008060008060008060a0878903121561337257613372600080fd5b600061337e898961303f565b965050602061338f89828a0161325e565b95505060406133a089828a0161325e565b94505060606133b189828a0161334b565b93505060808701356001600160401b0381111561313a5761313a600080fd5b604081016133de82856132a6565b610faa60208301846132a6565b60006020828403121561340057613400600080fd5b6000611c94848461325e565b60008060006040848603121561342457613424600080fd5b6000613430868661303f565b93505060208401356001600160401b0381111561344f5761344f600080fd5b61345b8682870161304a565b92509250509250925092565b634e487b7160e01b600052604160045260246000fd5b601f19601f83011681018181106001600160401b03821117156134a2576134a2613467565b6040525050565b60006134b460405190565b90506134c0828261347d565b919050565b60006001600160401b038211156134de576134de613467565b601f19601f83011660200192915050565b82818337506000910152565b600061350e613509846134c5565b6134a9565b90508281526020810184848401111561352957613529600080fd5b6135348482856134ef565b509392505050565b600082601f83011261355057613550600080fd5b8135611c948482602086016134fb565b60008060006060848603121561357857613578600080fd5b6000613584868661303f565b93505060208401356001600160401b038111156135a3576135a3600080fd5b6135af8682870161353c565b9250506040613322868287016130aa565b6000606082840312156135d5576135d5600080fd5b50919050565b600080600080600060a086880312156135f6576135f6600080fd5b6000613602888861324d565b95505060206136138882890161303f565b94505060406136248882890161325e565b93505060606136358882890161325e565b92505060808601356001600160401b0381111561365457613654600080fd5b613660888289016135c0565b9150509295509295909350565b60006020828403121561368257613682600080fd5b6000611c94848461324d565b60008060008060008060008060e0898b0312156136ad576136ad600080fd5b60006136b98b8b61324d565b98505060206136ca8b828c0161303f565b97505060406136db8b828c0161325e565b96505060606136ec8b828c0161325e565b95505060808901356001600160401b0381111561370b5761370b600080fd5b6137178b828c0161304a565b945094505060a061372a8b828c016130aa565b92505060c08901356001600160401b0381111561374957613749600080fd5b6137558b828c016135c0565b9150509295985092959890939650565b63ffffffff8116613034565b8035610c8281613765565b6000806040838503121561379257613792600080fd5b600061379e858561325e565b925050602061329c85828601613771565b600080604083850312156137c5576137c5600080fd5b60006137d1858561303f565b925050602061329c8582860161303f565b61319581613233565b60208101610c8282846137e2565b600080600080600080600080600060e08a8c03121561381a5761381a600080fd5b60006138268c8c61303f565b99505060206138378c828d0161325e565b98505060406138488c828d0161325e565b97505060608a01356001600160401b0381111561386757613867600080fd5b6138738c828d0161304a565b965096505060806138868c828d016130aa565b94505060a06138978c828d0161334b565b93505060c08a01356001600160401b038111156138b6576138b6600080fd5b6138c28c828d0161304a565b92509250509295985092959850929598565b6000610c826001600160a01b0383166138eb565b90565b6001600160a01b031690565b6000610c82826138d4565b6000610c82826138f7565b61319581613902565b60208101610c82828461390d565b60008060008060006080868803121561393f5761393f600080fd5b600061394b888861303f565b955050602061395c8882890161303f565b945050604061396d8882890161325e565b93505060608601356001600160401b0381111561398c5761398c600080fd5b6139988882890161304a565b92509250509295509295909350565b600080604083850312156139bd576139bd600080fd5b60006139c9858561324d565b925050602061329c8582860161324d565b6000806000606084860312156139f2576139f2600080fd5b60006139fe868661303f565b93505060206133118682870161303f565b6000806000806000806000806000806101008b8d031215613a3257613a32600080fd5b6000613a3e8d8d61303f565b9a505060208b01356001600160401b03811115613a5d57613a5d600080fd5b613a698d828e0161304a565b99509950506040613a7c8d828e016130aa565b9750506060613a8d8d828e0161325e565b9650506080613a9e8d828e0161324d565b95505060a0613aaf8d828e0161325e565b94505060c08b01356001600160401b03811115613ace57613ace600080fd5b613ada8d828e0161304a565b935093505060e0613aed8d828e0161325e565b9150509295989b9194979a5092959850565b60008060008060808587031215613b1857613b18600080fd5b6000613b24878761303f565b9450506020613b358782880161303f565b9350506040613b468782880161324d565b9250506060613b578782880161325e565b91505092959194509250565b601e81526000602082017f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c65720000815291505b5060200190565b60208082528101610c8281613b63565b634e487b7160e01b600052602260045260246000fd5b600281046001821680613bd457607f821691505b6020821081036135d5576135d5613baa565b6000613bf38385846134ef565b50500190565b6000611c94828486613be6565b602681526000602082017f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f8152651b9d1c9858dd60d21b602082015291505b5060400190565b60208082528101610c8281613c06565b61ffff8116613195565b60208101610c828284613c5c565b634e487b7160e01b600052603260045260246000fd5b6000610c826138e88381565b61319581613c8a565b6000613cab83836137e2565b505060200190565b6000613cbd825190565b80845260209384019383018060005b83811015613cf1578151613ce08882613c9f565b975060208301925050600101613ccc565b509495945050505050565b60408101613d0a8285613c96565b8181036020830152611c948184613cb3565b60006001600160401b03821115613d3557613d35613467565b5060209081020190565b8051610c8281613258565b6000613d5861350984613d1c565b83815290506020808201908402830185811115613d7757613d77600080fd5b835b81811015613d9b5780613d8c8882613d3f565b84525060209283019201613d79565b5050509392505050565b600082601f830112613db957613db9600080fd5b8151611c94848260208601613d4a565b600060208284031215613dde57613dde600080fd5b81516001600160401b03811115613df757613df7600080fd5b611c9484828501613da5565b8183526000602084019350613e198385846134ef565b601f19601f8401166131f7565b60408101613e348286613c5c565b8181036020830152611c91818486613e03565b601081526000602082016f20a1a1a2a9a9afa327a92124a22222a760811b81529150613b93565b60208082528101610c8281613e47565b60608101613e8c82866137e2565b613e9960208301856132a6565b611c9460408301846132a6565b602681526000602082017f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062658152650204c7a4170760d41b60208201529150613c45565b60208082528101610c8281613ea6565b6000808335601e1936859003018112613f1457613f14600080fd5b8084019250823591506001600160401b03821115613f3457613f34600080fd5b602083019250600182023603831315613f4f57613f4f600080fd5b509250929050565b602281526000602082017f4d696e696d756d207374616b65206475726174696f6e2069732033206d6f6e74815261687360f01b60208201529150613c45565b60208082528101610c8281613f57565b634e487b7160e01b600052601160045260246000fd5b80820180821115610c8257610c82613fa6565b63ffffffff918216919081169082820290811690818114612e1557612e15613fa6565b63ffffffff8116613195565b6060810161400c82866137e2565b61401960208301856132a6565b611c946040830184613ff2565b601d81526000602082017f4c7a4170703a206e6f20747275737465642070617468207265636f726400000081529150613b93565b60208082528101610c8281614026565b81810381811115610c8257610c82613fa6565b6000610c828260601b90565b6000610c828261407d565b6131956140a082613233565b614089565b60006140b2828587613be6565b91506140be8284614094565b506014019392505050565b6140d283613c8a565b815460001960089490940293841b1916921b91909117905550565b6000611d4f8184846140c9565b81811015612f0a5761410d6000826140ed565b6001016140fa565b601f821115611d4f576000818152602090206020601f8501048101602085101561413c5750805b610d9c6020601f8601048301826140fa565b81516001600160401b0381111561416757614167613467565b6141718254613bc0565b61417c828285614115565b6020601f8311600181146141b057600084156141985750858201515b600019600886021c1981166002860217865550611266565b600085815260208120601f198616915b828110156141e057888501518255602094850194600190920191016141c0565b868310156141fc5784890151600019601f89166008021c191682555b600160028802018855505050505050505050565b6080810161421e8288613c5c565b61422b6020830187613c5c565b61423860408301866132a6565b818103606083015261424b818486613e03565b979650505050505050565b602381526000602082017f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737381526261676560e81b60208201529150613c45565b60208082528101610c8281614256565b602181526000602082017f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f618152601960fa1b60208201529150613c45565b60208082528101610c82816142a6565b6001600160401b038116613195565b608081016143118288613c5c565b8181036020830152614324818688613e03565b905061433360408301856142f4565b61434060608301846132a6565b9695505050505050565b606081016143588286613c5c565b613e996020830185613c5c565b601f81526000602082017f4f4654436f72653a2063616c6c6572206d757374206265204f4654436f72650081529150613b93565b60208082528101610c8281614365565b60c081016143b7828b613c5c565b81810360208301526143ca81898b613e03565b90506143d960408301886142f4565b6143e660608301876132a6565b6143f360808301866132a6565b81810360a0830152614406818486613e03565b9a9950505050505050505050565b826001600160401b0381111561442c5761442c613467565b6144368254613bc0565b614441828285614115565b6000601f831160018114614475576000841561445d5750858201355b600019600886021c1981166002860217865550610c48565b600085815260208120601f198616915b828110156144a55788850135825560209485019460019092019101614485565b868310156144c157600019601f88166008021c19858a01351682555b60016002880201885550505050505050505050565b608081016144e48287613c5c565b6144f16020830186613c5c565b6144fe60408301856137e2565b612d7160608301846132a6565b6000614519613509846134c5565b90508281526020810184848401111561453457614534600080fd5b6135348482856131a9565b600082601f83011261455357614553600080fd5b8151611c9484826020860161450b565b60006020828403121561457857614578600080fd5b81516001600160401b0381111561459157614591600080fd5b611c948482850161453f565b608081016145ab8287613c5c565b81810360208301526145bd81866131cd565b90506145cc60408301856142f4565b818103606083015261434081846131cd565b60a081016145ec8288613c5c565b6145f960208301876137e2565b818103604083015261460b81866131cd565b905061461a6060830185613191565b818103608083015261424b81846131cd565b6000806040838503121561464257614642600080fd5b600061464e8585613d3f565b925050602061329c85828601613d3f565b6060810161466d82866137e2565b613e9960208301856137e2565b8051610c8281613343565b60006020828403121561469a5761469a600080fd5b6000611c94848461467a565b818102808215838204851417612e1557612e15613fa6565b634e487b7160e01b600052601260045260246000fd5b6000826146e3576146e36146be565b500490565b601c81526000602082017f4f4654436f72653a20756e6b6e6f776e207061636b657420747970650000000081529150613b93565b60208082528101610c82816146e8565b601981526000602082017f4f4654436f72653a20616d6f756e7420746f6f20736d616c6c0000000000000081529150613b93565b60208082528101610c828161472c565b600e81526000602082016d736c6963655f6f766572666c6f7760901b81529150613b93565b60208082528101610c8281614770565b6011815260006020820170736c6963655f6f75744f66426f756e647360781b81529150613b93565b60208082528101610c82816147a5565b60006147e7825190565b6147f58185602086016131a9565b9290920192915050565b6000610faa82846147dd565b60a081016148198288613c5c565b818103602083015261482b81876131cd565b905061483a60408301866142f4565b818103606083015261484c81856131cd565b9050818103608083015261424b81846131cd565b601a81526000602082017f4f4654436f72653a20616d6f756e745344206f766572666c6f7700000000000081529150613b93565b60208082528101610c8281614860565b6000610c828260f81b90565b61319560ff82166148a4565b6000610c828260c01b90565b6131956001600160401b0382166148bc565b60006148e682866148b0565b6001820191506148f682856132a6565b60208201915061490682846148c8565b506008019392505050565b6013815260006020820172746f55696e74385f6f75744f66426f756e647360681b81529150613b93565b60208082528101610c8281614911565b610100810161495a828b613c5c565b818103602083015261496c818a6131cd565b905061497b60408301896142f4565b61498860608301886132a6565b61499560808301876137e2565b6149a260a08301866132a6565b81810360c08301526149b481856131cd565b90506149c360e08301846132a6565b9998505050505050505050565b606080825281016149e181866131cd565b9050613e9960208301856142f4565b601a81526000602082017f4c7a4170703a206d696e4761734c696d6974206e6f742073657400000000000081529150613b93565b60208082528101610c82816149f0565b601b81526000602082017f4c7a4170703a20676173206c696d697420697320746f6f206c6f77000000000081529150613b93565b60208082528101610c8281614a34565b600082614a8757614a876146be565b500690565b603081526000602082017f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742081526f61207472757374656420736f7572636560801b60208201529150613c45565b60208082528101610c8281614a8c565b60c08101614af78289613c5c565b8181036020830152614b0981886131cd565b90508181036040830152614b1d81876131cd565b9050614b2c60608301866137e2565b614b3960808301856137e2565b81810360a0830152614b4b81846131cd565b98975050505050505050565b6000614b6382896148b0565b600182019150614b7382886132a6565b602082019150614b8382876148c8565b600882019150614b9382866132a6565b602082019150614ba382856148c8565b600882019150614b4b82846147dd565b601881526000602082017f4f4654436f72653a20696e76616c6964207061796c6f6164000000000000000081529150613b93565b60208082528101610c8281614bb3565b601c81526000602082017f4c7a4170703a20696e76616c69642061646170746572506172616d730000000081529150613b93565b60208082528101610c8281614bf7565b60208082527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c6172676591019081526000613b93565b60208082528101610c8281614c3b565b6015815260006020820174746f416464726573735f6f75744f66426f756e647360581b81529150613b93565b60208082528101610c8281614c7d565b6014815260006020820173746f55696e7436345f6f75744f66426f756e647360601b81529150613b93565b60208082528101610c8281614cb9565b6015815260006020820174746f427974657333325f6f75744f66426f756e647360581b81529150613b93565b60208082528101610c8281614cf456fea26469706673582212204591bd6d8068c4724c294e077a9d1db3a36c67ba8366e633acb452cb7e90332364736f6c6343000814003300000000000000000000000071fc1f555a39e0b698653ab0b475488ec3c34d57000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675
Deployed Bytecode
0x6080604052600436106103345760003560e01c806376203b48116101ab578063a9059cbb116100f7578063df2a5b3b11610095578063eb8d72b71161006f578063eb8d72b714610a18578063f2fde38b14610a38578063f5ecbdbc14610a58578063fc0c546a14610a7857600080fd5b8063df2a5b3b146109c3578063e6a20ae6146109e3578063eaffd49a146109f857600080fd5b8063c4461834116100d1578063c446183414610934578063cbed8b9c1461094a578063d1deba1f1461096a578063dd62ed3e1461097d57600080fd5b8063a9059cbb146108b3578063b353aaa7146108d3578063baf3292d1461091457600080fd5b8063950c8a74116101645780639dd373b91161013e5780639dd373b9146108335780639f38369a14610853578063a4c51df514610873578063a6c3d1651461089357600080fd5b8063950c8a74146107ac57806395d89b41146107cc5780639bdb9812146107e157600080fd5b806376203b48146106d15780638309179e146106e4578063857749b0146107045780638cfd8f5c146107385780638da5cb5b146107705780639358928b1461079757600080fd5b806338682268116102855780636282cbbc1161022357806370a08231116101fd57806370a0823114610646578063715018a61461067c57806374991569146106915780637533d788146106b157600080fd5b80636282cbbc146105f357806366ad5c8a14610613578063695ef6bf1461063357600080fd5b806342d65a8d1161025f57806342d65a8d1461055a578063447705151461057a5780634c42899a1461058f5780635b8c41e6146105a457600080fd5b806338682268146104ed5780633d8b38f61461050d5780633f1f4fa41461052d57600080fd5b80630df37483116102f257806318160ddd116102cc57806318160ddd1461046d57806323b872dd14610482578063313ce567146104a2578063365260b4146104bf57600080fd5b80630df374831461041557806310ddb1371461043557806312097e551461045557600080fd5b80621d35671461033957806301ffc9a71461035b57806306fdde031461039157806307e0db17146103b3578063095ea7b3146103d35780630d9c8a7e146103f3575b600080fd5b34801561034557600080fd5b506103596103543660046130b5565b610a8b565b005b34801561036757600080fd5b5061037b610376366004613170565b610c51565b604051610388919061319b565b60405180910390f35b34801561039d57600080fd5b506103a6610c88565b6040516103889190613201565b3480156103bf57600080fd5b506103596103ce366004613212565b610d1a565b3480156103df57600080fd5b5061037b6103ee366004613269565b610da3565b3480156103ff57600080fd5b50610408610dbb565b60405161038891906132ac565b34801561042157600080fd5b506103596104303660046132ba565b610f18565b34801561044157600080fd5b50610359610450366004613212565b610f37565b34801561046157600080fd5b5061040863657e21db81565b34801561047957600080fd5b50600954610408565b34801561048e57600080fd5b5061037b61049d3660046132dc565b610f8b565b3480156104ae57600080fd5b5060125b6040516103889190613335565b3480156104cb57600080fd5b506104df6104da366004613356565b610fb1565b6040516103889291906133d0565b3480156104f957600080fd5b506103596105083660046133eb565b611006565b34801561051957600080fd5b5061037b61052836600461340c565b611013565b34801561053957600080fd5b50610408610548366004613212565b60036020526000908152604090205481565b34801561056657600080fd5b5061035961057536600461340c565b6110df565b34801561058657600080fd5b50610408600081565b34801561059b57600080fd5b506104b2600081565b3480156105b057600080fd5b506104086105bf366004613560565b6005602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156105ff57600080fd5b5061035961060e3660046133eb565b611165565b34801561061f57600080fd5b5061035961062e3660046130b5565b6111d1565b6103596106413660046135db565b61126e565b34801561065257600080fd5b5061040861066136600461366d565b6001600160a01b031660009081526007602052604090205490565b34801561068857600080fd5b506103596112d9565b34801561069d57600080fd5b506103596106ac36600461366d565b6112ed565b3480156106bd57600080fd5b506103a66106cc366004613212565b611317565b6103596106df36600461368e565b6113b1565b3480156106f057600080fd5b506103596106ff36600461377c565b611460565b34801561071057600080fd5b506104b27f000000000000000000000000000000000000000000000000000000000000000681565b34801561074457600080fd5b506104086107533660046137af565b600260209081526000928352604080842090915290825290205481565b34801561077c57600080fd5b506000546001600160a01b03165b60405161038891906137eb565b3480156107a357600080fd5b5061040861153d565b3480156107b857600080fd5b5060045461078a906001600160a01b031681565b3480156107d857600080fd5b506103a661154d565b3480156107ed57600080fd5b5061037b6107fc366004613560565b6006602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205460ff1681565b34801561083f57600080fd5b5061035961084e36600461366d565b61155c565b34801561085f57600080fd5b506103a661086e366004613212565b611586565b34801561087f57600080fd5b506104df61088e3660046137f9565b611665565b34801561089f57600080fd5b506103596108ae36600461340c565b6116f4565b3480156108bf57600080fd5b5061037b6108ce366004613269565b61177d565b3480156108df57600080fd5b506109077f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67581565b6040516103889190613916565b34801561092057600080fd5b5061035961092f36600461366d565b61178b565b34801561094057600080fd5b5061040861271081565b34801561095657600080fd5b50610359610965366004613924565b6117e9565b6103596109783660046130b5565b611873565b34801561098957600080fd5b506104086109983660046139a7565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b3480156109cf57600080fd5b506103596109de3660046139da565b611a13565b3480156109ef57600080fd5b506104b2600181565b348015610a0457600080fd5b50610359610a13366004613a0f565b611a72565b348015610a2457600080fd5b50610359610a3336600461340c565b611b5f565b348015610a4457600080fd5b50610359610a5336600461366d565b611bb9565b348015610a6457600080fd5b506103a6610a73366004613aff565b611bf7565b348015610a8457600080fd5b503061078a565b337f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd6756001600160a01b031614610adc5760405162461bcd60e51b8152600401610ad390613b9a565b60405180910390fd5b61ffff861660009081526001602052604081208054610afa90613bc0565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2690613bc0565b8015610b735780601f10610b4857610100808354040283529160200191610b73565b820191906000526020600020905b815481529060010190602001808311610b5657829003601f168201915b50505050509050805186869050148015610b8e575060008151115b8015610bb6575080516020820120604051610bac9088908890613bf9565b6040518091039020145b610bd25760405162461bcd60e51b8152600401610ad390613c4c565b610c488787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a935091508890889081908401838280828437600092019190915250611c9c92505050565b50505050505050565b60006001600160e01b03198216631f7ecdf760e01b1480610c8257506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600a8054610c9790613bc0565b80601f0160208091040260200160405190810160405280929190818152602001828054610cc390613bc0565b8015610d105780601f10610ce557610100808354040283529160200191610d10565b820191906000526020600020905b815481529060010190602001808311610cf357829003601f168201915b5050505050905090565b610d22611d15565b6040516307e0db1760e01b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67516906307e0db1790610d6e908490600401613c66565b600060405180830381600087803b158015610d8857600080fd5b505af1158015610d9c573d6000803e3d6000fd5b5050505050565b600033610db1818585611d42565b5060019392505050565b60408051600380825260808201909252600091829190602082016060803683375050600c5482519293506001600160a01b031691839150600090610e0157610e01613c74565b6001600160a01b039283166020918202929092010152600d54825191169082906001908110610e3257610e32613c74565b6001600160a01b039283166020918202929092010152600e54825191169082906002908110610e6357610e63613c74565b6001600160a01b03928316602091820292909201015260125460405163d06ca61f60e01b8152600092919091169063d06ca61f90610eaf90670de0b6b3a7640000908690600401613cfc565b600060405180830381865afa158015610ecc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ef49190810190613dc9565b905080600281518110610f0957610f09613c74565b60200260200101519250505090565b610f20611d15565b61ffff909116600090815260036020526040902055565b610f3f611d15565b6040516310ddb13760e01b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67516906310ddb13790610d6e908490600401613c66565b600033610f99858285611d54565b610fa4858585611dbf565b60019150505b9392505050565b600080610ff78888888888888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611e1e92505050565b91509150965096945050505050565b61100e611d15565b601155565b61ffff83166000908152600160205260408120805482919061103490613bc0565b80601f016020809104026020016040519081016040528092919081815260200182805461106090613bc0565b80156110ad5780601f10611082576101008083540402835291602001916110ad565b820191906000526020600020905b81548152906001019060200180831161109057829003601f168201915b5050505050905083836040516110c4929190613bf9565b60405180910390208180519060200120149150509392505050565b6110e7611d15565b6040516342d65a8d60e01b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67516906342d65a8d9061113790869086908690600401613e26565b600060405180830381600087803b15801561115157600080fd5b505af1158015610c48573d6000803e3d6000fd5b611170335b3b151590565b1561118d5760405162461bcd60e51b8152600401610ad390613e6e565b60008061119983611edb565b600f54604051636e0ecc0360e11b81529294509092506001600160a01b03169063dc1d98069061113790339086908690600401613e7e565b3330146111f05760405162461bcd60e51b8152600401610ad390613ee9565b6112668686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f89018190048102820181019092528781528993509150879087908190840183828082843760009201919091525061209092505050565b505050505050565b61126685858585611282602087018761366d565b611292604088016020890161366d565b61129f6040890189613ef9565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506120e792505050565b6112e1611d15565b6112eb60006121a1565b565b6112f5611d15565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6001602052600090815260409020805461133090613bc0565b80601f016020809104026020016040519081016040528092919081815260200182805461135c90613bc0565b80156113a95780601f1061137e576101008083540402835291602001916113a9565b820191906000526020600020905b81548152906001019060200180831161138c57829003601f168201915b505050505081565b6114558888888888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a92506113fe915050602089018961366d565b61140e60408a0160208b0161366d565b61141b60408b018b613ef9565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506121f192505050565b505050505050505050565b605a8163ffffffff1610156114875760405162461bcd60e51b8152600401610ad390613f96565b6114903361116a565b156114ad5760405162461bcd60e51b8152600401610ad390613e6e565b6000806114b984611edb565b60105491935091506001600160a01b03166340f320bb336114da8486613fbc565b6114e78762015180613fcf565b6040518463ffffffff1660e01b815260040161150593929190613ffe565b600060405180830381600087803b15801561151f57600080fd5b505af1158015611533573d6000803e3d6000fd5b5050505050505050565b600061154860095490565b905090565b6060600b8054610c9790613bc0565b611564611d15565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b61ffff81166000908152600160205260408120805460609291906115a990613bc0565b80601f01602080910402602001604051908101604052809291908181526020018280546115d590613bc0565b80156116225780601f106115f757610100808354040283529160200191611622565b820191906000526020600020905b81548152906001019060200180831161160557829003601f168201915b50505050509050805160000361164a5760405162461bcd60e51b8152600401610ad39061405a565b610faa60006014835161165d919061406a565b8391906122bf565b6000806116e28b8b8b8b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8d018190048102820181019092528b81528e93508d9250908c908c908190840183828082843760009201919091525061238792505050565b91509150995099975050505050505050565b6116fc611d15565b818130604051602001611711939291906140a5565b60408051601f1981840301815291815261ffff851660009081526001602052209061173c908261414e565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce83838360405161177093929190613e26565b60405180910390a1505050565b600033610db1818585611dbf565b611793611d15565b600480546001600160a01b0319166001600160a01b0383161790556040517f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b906117de9083906137eb565b60405180910390a150565b6117f1611d15565b6040516332fb62e760e21b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675169063cbed8b9c906118459088908890889088908890600401614210565b600060405180830381600087803b15801561185f57600080fd5b505af1158015611455573d6000803e3d6000fd5b61ffff861660009081526005602052604080822090516118969088908890613bf9565b90815260408051602092819003830190206001600160401b038716600090815292529020549050806118da5760405162461bcd60e51b8152600401610ad390614296565b8083836040516118eb929190613bf9565b6040518091039020146119105760405162461bcd60e51b8152600401610ad3906142e4565b61ffff871660009081526005602052604080822090516119339089908990613bf9565b90815260408051602092819003830181206001600160401b038916600090815290845282902093909355601f880182900482028301820190528682526119cb918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a93509150889088908190840183828082843760009201919091525061209092505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e58787878785604051611a02959493929190614303565b60405180910390a150505050505050565b611a1b611d15565b61ffff80841660009081526002602090815260408083209386168352929052819020829055517f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac0906117709085908590859061434a565b333014611a915760405162461bcd60e51b8152600401610ad390614399565b611a9c308686612442565b9350846001600160a01b03168a61ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf86604051611adc91906132ac565b60405180910390a3604051633fe79aed60e11b81526001600160a01b03861690637fcf35da908390611b20908e908e908e908e908e908d908d908d906004016143a9565b600060405180830381600088803b158015611b3a57600080fd5b5087f1158015611b4e573d6000803e3d6000fd5b505050505050505050505050505050565b611b67611d15565b61ffff83166000908152600160205260409020611b85828483614414565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab83838360405161177093929190613e26565b611bc1611d15565b6001600160a01b038116611beb576000604051631e4fbdf760e01b8152600401610ad391906137eb565b611bf4816121a1565b50565b604051633d7b2f6f60e21b81526060906001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675169063f5ecbdbc90611c4c9088908890309088906004016144d6565b600060405180830381865afa158015611c69573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611c919190810190614563565b90505b949350505050565b600080611cff5a60966366ad5c8a60e01b89898989604051602401611cc4949392919061459d565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915230929190612494565b915091508161126657611266868686868561251e565b6000546001600160a01b031633146112eb573360405163118cdaa760e01b8152600401610ad391906137eb565b611d4f83838360016125bb565b505050565b6001600160a01b038381166000908152600860209081526040808320938616835292905220546000198114611db95781811015611daa57828183604051637dc7a0d960e11b8152600401610ad393929190613e7e565b611db9848484840360006125bb565b50505050565b6001600160a01b038316611de9576000604051634b637e8f60e11b8152600401610ad391906137eb565b6001600160a01b038216611e1357600060405163ec442f0560e01b8152600401610ad391906137eb565b611d4f83838361268e565b6000806000611e3587611e30886127a3565b6127f9565b60405163040a7bb160e41b81529091506001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67516906340a7bb1090611e8c908b90309086908b908b906004016145de565b6040805180830381865afa158015611ea8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ecc919061462c565b92509250509550959350505050565b600c5460009081906001600160a01b03166323b872dd3361dead866040518463ffffffff1660e01b8152600401611f149392919061465f565b6020604051808303816000875af1158015611f33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f579190614685565b506000611f62610dbb565b90506000670de0b6b3a7640000611f7983876146a6565b611f8391906146d4565b9050620186a0611f9a63657e21db624f1a00613fbc565b4210611fa9575061ea60611fc6565b611fba63657e21db62278d00613fbc565b4210611fc65750620138805b6000611fd963657e21db62ed4e00613fbc565b42101561200657670de0b6b3a764000060115488611ff791906146a6565b61200191906146d4565b612008565b825b9050611194620f42408161201c82856146a6565b61202691906146d4565b6120359064e8d4a510006146a6565b9750600096508483111561208557600061204f868561406a565b90508261205c83836146a6565b61206691906146d4565b6120759064e8d4a510006146a6565b9750612081888a61406a565b9850505b505050505050915091565b600061209c8282612828565b905060ff81166120b7576120b28585858561285e565b610d9c565b60001960ff8216016120cf576120b2858585856128ec565b60405162461bcd60e51b8152600401610ad39061471c565b60006120f587828481612af5565b6120fe85612b6a565b50905061210d88888884612baa565b90506000811161212f5760405162461bcd60e51b8152600401610ad390614760565b600061213e87611e30846127a3565b905061214e888287878734612bdc565b86896001600160a01b03168961ffff167fd81fc9b8523134ed613870ed029d6170cbb73aa6a6bc311b9a642689fb9df59a8560405161218d91906132ac565b60405180910390a450979650505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000612209896001846001600160401b038916612af5565b61221287612b6a565b5090506122218a8a8a84612baa565b9050600081116122435760405162461bcd60e51b8152600401610ad390614760565b600061225a338a612253856127a3565b8a8a612d38565b905061226a8a8287878734612bdc565b888b6001600160a01b03168b61ffff167fd81fc9b8523134ed613870ed029d6170cbb73aa6a6bc311b9a642689fb9df59a856040516122a991906132ac565b60405180910390a4509998505050505050505050565b6060816122cd81601f613fbc565b10156122eb5760405162461bcd60e51b8152600401610ad390614795565b6122f58284613fbc565b845110156123155760405162461bcd60e51b8152600401610ad3906147cd565b606082158015612334576040519150600082526020820160405261237e565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101561236d578051835260209283019201612355565b5050858452601f01601f1916604052505b50949350505050565b600080600061239a338a6122538b6127a3565b60405163040a7bb160e41b81529091506001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd67516906340a7bb10906123f1908d90309086908b908b906004016145de565b6040805180830381865afa15801561240d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612431919061462c565b925092505097509795505050505050565b600033306001600160a01b038616148015906124705750806001600160a01b0316856001600160a01b031614155b1561248057612480858285611d54565b61248b858585611dbf565b50909392505050565b6000606060008060008661ffff166001600160401b038111156124b9576124b9613467565b6040519080825280601f01601f1916602001820160405280156124e3576020820181803683370190505b50905060008087516020890160008d8df191503d925086831115612505578692505b828152826000602083013e909890975095505050505050565b8180519060200120600560008761ffff1661ffff1681526020019081526020016000208560405161254f91906147ff565b9081526040805191829003602090810183206001600160401b0388166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c906125ac908790879087908790879061480b565b60405180910390a15050505050565b6001600160a01b0384166125e557600060405163e602df0560e01b8152600401610ad391906137eb565b6001600160a01b03831661260f576000604051634a1406b160e11b8152600401610ad391906137eb565b6001600160a01b0380851660009081526008602090815260408083209387168352929052208290558015611db957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161268091906132ac565b60405180910390a350505050565b6001600160a01b0383166126b95780600960008282546126ae9190613fbc565b909155506127189050565b6001600160a01b038316600090815260076020526040902054818110156126f95783818360405163391434e360e21b8152600401610ad393929190613e7e565b6001600160a01b03841660009081526007602052604090209082900390555b6001600160a01b03821661273457600980548290039055612753565b6001600160a01b03821660009081526007602052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161279691906132ac565b60405180910390a3505050565b6000806127d07f000000000000000000000000000000000000000000000000000000e8d4a51000846146d4565b90506001600160401b03811115610c825760405162461bcd60e51b8152600401610ad390614894565b606060008383604051602001612811939291906148da565b604051602081830303815290604052905092915050565b6000612835826001613fbc565b835110156128555760405162461bcd60e51b8152600401610ad39061493b565b50016001015190565b60008061286a83612d7a565b90925090506001600160a01b0382166128835761dead91505b600061288e82612dd4565b905061289b878483612e09565b9050826001600160a01b03168761ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf836040516128db91906132ac565b60405180910390a350505050505050565b60008060008060006128fd86612e1c565b945094509450945094506000600660008b61ffff1661ffff1681526020019081526020016000208960405161293291906147ff565b90815260408051602092819003830190206001600160401b038b166000908152925281205460ff16915061296585612dd4565b9050816129d3576129778b3083612e09565b61ffff8c1660009081526006602052604090819020905191925060019161299f908d906147ff565b90815260408051602092819003830190206001600160401b038d16600090815292529020805460ff19169115159190911790555b6001600160a01b0386163b612a25577f9aedf5fdba8716db3b6705ca00150643309995d4f818a249ed6dde6677e7792d86604051612a1191906137eb565b60405180910390a150505050505050611db9565b8a8a8a8a8a8a868a60008a612a43578b6001600160401b0316612a45565b5a5b9050600080612a775a609663eaffd49a60e01b8e8e8e8d8d8d8d8d604051602401611cc498979695949392919061494b565b915091508115612ad0578751602089012060405161ffff8d16907fb8890edbfc1c74692f527444645f95489c3703cc2df42e4a366f5d06fa6cd88490612ac2908e908e9086906149d0565b60405180910390a250612add565b612add8b8b8b8b8561251e565b50505050505050505050505050505050505050505050565b6000612b0083612ea8565b61ffff80871660009081526002602090815260408083209389168352929052205490915080612b415760405162461bcd60e51b8152600401610ad390614a24565b612b4b8382613fbc565b8210156112665760405162461bcd60e51b8152600401610ad390614a68565b600080612b977f000000000000000000000000000000000000000000000000000000e8d4a5100084614a78565b9050612ba3818461406a565b9150915091565b6000336001600160a01b0386168114612bc857612bc8868285611d54565b612bd28684612ed4565b5090949350505050565b61ffff861660009081526001602052604081208054612bfa90613bc0565b80601f0160208091040260200160405190810160405280929190818152602001828054612c2690613bc0565b8015612c735780601f10612c4857610100808354040283529160200191612c73565b820191906000526020600020905b815481529060010190602001808311612c5657829003601f168201915b505050505090508051600003612c9b5760405162461bcd60e51b8152600401610ad390614ad9565b612ca6878751612f0e565b60405162c5803160e81b81526001600160a01b037f00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675169063c5803100908490612cfd908b9086908c908c908c908c90600401614ae9565b6000604051808303818588803b158015612d1657600080fd5b505af1158015612d2a573d6000803e3d6000fd5b505050505050505050505050565b6060600185856001600160a01b0389168587604051602001612d5f96959493929190614b57565b60405160208183030381529060405290505b95945050505050565b60008080612d888482612828565b60ff16148015612d99575082516029145b612db55760405162461bcd60e51b8152600401610ad390614be7565b612dc083600d612f4f565b9150612dcd836021612f8c565b9050915091565b6000610c827f000000000000000000000000000000000000000000000000000000e8d4a510006001600160401b0384166146a6565b6000612e158383612fc2565b5092915050565b600080806060816001612e2f8783612828565b60ff1614612e4f5760405162461bcd60e51b8152600401610ad390614be7565b612e5a86600d612f4f565b9350612e67866021612f8c565b9250612e74866029612ff8565b9450612e81866049612f8c565b9050612e9d6051808851612e95919061406a565b8891906122bf565b915091939590929450565b6000602282511015612ecc5760405162461bcd60e51b8152600401610ad390614c2b565b506022015190565b6001600160a01b038216612efe576000604051634b637e8f60e11b8152600401610ad391906137eb565b612f0a8260008361268e565b5050565b61ffff821660009081526003602052604081205490819003612f2f57506127105b80821115611d4f5760405162461bcd60e51b8152600401610ad390614c6d565b6000612f5c826014613fbc565b83511015612f7c5760405162461bcd60e51b8152600401610ad390614ca9565b500160200151600160601b900490565b6000612f99826008613fbc565b83511015612fb95760405162461bcd60e51b8152600401610ad390614ce4565b50016008015190565b6001600160a01b038216612fec57600060405163ec442f0560e01b8152600401610ad391906137eb565b612f0a6000838361268e565b6000613005826020613fbc565b835110156130255760405162461bcd60e51b8152600401610ad390614d20565b50016020015190565b61ffff81165b8114611bf457600080fd5b8035610c828161302e565b60008083601f84011261305f5761305f600080fd5b5081356001600160401b0381111561307957613079600080fd5b60208301915083600182028301111561309457613094600080fd5b9250929050565b6001600160401b038116613034565b8035610c828161309b565b600080600080600080608087890312156130d1576130d1600080fd5b60006130dd898961303f565b96505060208701356001600160401b038111156130fc576130fc600080fd5b61310889828a0161304a565b9550955050604061311b89828a016130aa565b93505060608701356001600160401b0381111561313a5761313a600080fd5b61314689828a0161304a565b92509250509295509295509295565b6001600160e01b03198116613034565b8035610c8281613155565b60006020828403121561318557613185600080fd5b6000611c948484613165565b8015155b82525050565b60208101610c828284613191565b60005b838110156131c45781810151838201526020016131ac565b50506000910152565b60006131d7825190565b8084526020840193506131ee8185602086016131a9565b601f19601f8201165b9093019392505050565b60208082528101610faa81846131cd565b60006020828403121561322757613227600080fd5b6000611c94848461303f565b60006001600160a01b038216610c82565b61303481613233565b8035610c8281613244565b80613034565b8035610c8281613258565b6000806040838503121561327f5761327f600080fd5b600061328b858561324d565b925050602061329c8582860161325e565b9150509250929050565b80613195565b60208101610c8282846132a6565b600080604083850312156132d0576132d0600080fd5b600061328b858561303f565b6000806000606084860312156132f4576132f4600080fd5b6000613300868661324d565b93505060206133118682870161324d565b92505060406133228682870161325e565b9150509250925092565b60ff8116613195565b60208101610c82828461332c565b801515613034565b8035610c8281613343565b60008060008060008060a0878903121561337257613372600080fd5b600061337e898961303f565b965050602061338f89828a0161325e565b95505060406133a089828a0161325e565b94505060606133b189828a0161334b565b93505060808701356001600160401b0381111561313a5761313a600080fd5b604081016133de82856132a6565b610faa60208301846132a6565b60006020828403121561340057613400600080fd5b6000611c94848461325e565b60008060006040848603121561342457613424600080fd5b6000613430868661303f565b93505060208401356001600160401b0381111561344f5761344f600080fd5b61345b8682870161304a565b92509250509250925092565b634e487b7160e01b600052604160045260246000fd5b601f19601f83011681018181106001600160401b03821117156134a2576134a2613467565b6040525050565b60006134b460405190565b90506134c0828261347d565b919050565b60006001600160401b038211156134de576134de613467565b601f19601f83011660200192915050565b82818337506000910152565b600061350e613509846134c5565b6134a9565b90508281526020810184848401111561352957613529600080fd5b6135348482856134ef565b509392505050565b600082601f83011261355057613550600080fd5b8135611c948482602086016134fb565b60008060006060848603121561357857613578600080fd5b6000613584868661303f565b93505060208401356001600160401b038111156135a3576135a3600080fd5b6135af8682870161353c565b9250506040613322868287016130aa565b6000606082840312156135d5576135d5600080fd5b50919050565b600080600080600060a086880312156135f6576135f6600080fd5b6000613602888861324d565b95505060206136138882890161303f565b94505060406136248882890161325e565b93505060606136358882890161325e565b92505060808601356001600160401b0381111561365457613654600080fd5b613660888289016135c0565b9150509295509295909350565b60006020828403121561368257613682600080fd5b6000611c94848461324d565b60008060008060008060008060e0898b0312156136ad576136ad600080fd5b60006136b98b8b61324d565b98505060206136ca8b828c0161303f565b97505060406136db8b828c0161325e565b96505060606136ec8b828c0161325e565b95505060808901356001600160401b0381111561370b5761370b600080fd5b6137178b828c0161304a565b945094505060a061372a8b828c016130aa565b92505060c08901356001600160401b0381111561374957613749600080fd5b6137558b828c016135c0565b9150509295985092959890939650565b63ffffffff8116613034565b8035610c8281613765565b6000806040838503121561379257613792600080fd5b600061379e858561325e565b925050602061329c85828601613771565b600080604083850312156137c5576137c5600080fd5b60006137d1858561303f565b925050602061329c8582860161303f565b61319581613233565b60208101610c8282846137e2565b600080600080600080600080600060e08a8c03121561381a5761381a600080fd5b60006138268c8c61303f565b99505060206138378c828d0161325e565b98505060406138488c828d0161325e565b97505060608a01356001600160401b0381111561386757613867600080fd5b6138738c828d0161304a565b965096505060806138868c828d016130aa565b94505060a06138978c828d0161334b565b93505060c08a01356001600160401b038111156138b6576138b6600080fd5b6138c28c828d0161304a565b92509250509295985092959850929598565b6000610c826001600160a01b0383166138eb565b90565b6001600160a01b031690565b6000610c82826138d4565b6000610c82826138f7565b61319581613902565b60208101610c82828461390d565b60008060008060006080868803121561393f5761393f600080fd5b600061394b888861303f565b955050602061395c8882890161303f565b945050604061396d8882890161325e565b93505060608601356001600160401b0381111561398c5761398c600080fd5b6139988882890161304a565b92509250509295509295909350565b600080604083850312156139bd576139bd600080fd5b60006139c9858561324d565b925050602061329c8582860161324d565b6000806000606084860312156139f2576139f2600080fd5b60006139fe868661303f565b93505060206133118682870161303f565b6000806000806000806000806000806101008b8d031215613a3257613a32600080fd5b6000613a3e8d8d61303f565b9a505060208b01356001600160401b03811115613a5d57613a5d600080fd5b613a698d828e0161304a565b99509950506040613a7c8d828e016130aa565b9750506060613a8d8d828e0161325e565b9650506080613a9e8d828e0161324d565b95505060a0613aaf8d828e0161325e565b94505060c08b01356001600160401b03811115613ace57613ace600080fd5b613ada8d828e0161304a565b935093505060e0613aed8d828e0161325e565b9150509295989b9194979a5092959850565b60008060008060808587031215613b1857613b18600080fd5b6000613b24878761303f565b9450506020613b358782880161303f565b9350506040613b468782880161324d565b9250506060613b578782880161325e565b91505092959194509250565b601e81526000602082017f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c65720000815291505b5060200190565b60208082528101610c8281613b63565b634e487b7160e01b600052602260045260246000fd5b600281046001821680613bd457607f821691505b6020821081036135d5576135d5613baa565b6000613bf38385846134ef565b50500190565b6000611c94828486613be6565b602681526000602082017f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f8152651b9d1c9858dd60d21b602082015291505b5060400190565b60208082528101610c8281613c06565b61ffff8116613195565b60208101610c828284613c5c565b634e487b7160e01b600052603260045260246000fd5b6000610c826138e88381565b61319581613c8a565b6000613cab83836137e2565b505060200190565b6000613cbd825190565b80845260209384019383018060005b83811015613cf1578151613ce08882613c9f565b975060208301925050600101613ccc565b509495945050505050565b60408101613d0a8285613c96565b8181036020830152611c948184613cb3565b60006001600160401b03821115613d3557613d35613467565b5060209081020190565b8051610c8281613258565b6000613d5861350984613d1c565b83815290506020808201908402830185811115613d7757613d77600080fd5b835b81811015613d9b5780613d8c8882613d3f565b84525060209283019201613d79565b5050509392505050565b600082601f830112613db957613db9600080fd5b8151611c94848260208601613d4a565b600060208284031215613dde57613dde600080fd5b81516001600160401b03811115613df757613df7600080fd5b611c9484828501613da5565b8183526000602084019350613e198385846134ef565b601f19601f8401166131f7565b60408101613e348286613c5c565b8181036020830152611c91818486613e03565b601081526000602082016f20a1a1a2a9a9afa327a92124a22222a760811b81529150613b93565b60208082528101610c8281613e47565b60608101613e8c82866137e2565b613e9960208301856132a6565b611c9460408301846132a6565b602681526000602082017f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062658152650204c7a4170760d41b60208201529150613c45565b60208082528101610c8281613ea6565b6000808335601e1936859003018112613f1457613f14600080fd5b8084019250823591506001600160401b03821115613f3457613f34600080fd5b602083019250600182023603831315613f4f57613f4f600080fd5b509250929050565b602281526000602082017f4d696e696d756d207374616b65206475726174696f6e2069732033206d6f6e74815261687360f01b60208201529150613c45565b60208082528101610c8281613f57565b634e487b7160e01b600052601160045260246000fd5b80820180821115610c8257610c82613fa6565b63ffffffff918216919081169082820290811690818114612e1557612e15613fa6565b63ffffffff8116613195565b6060810161400c82866137e2565b61401960208301856132a6565b611c946040830184613ff2565b601d81526000602082017f4c7a4170703a206e6f20747275737465642070617468207265636f726400000081529150613b93565b60208082528101610c8281614026565b81810381811115610c8257610c82613fa6565b6000610c828260601b90565b6000610c828261407d565b6131956140a082613233565b614089565b60006140b2828587613be6565b91506140be8284614094565b506014019392505050565b6140d283613c8a565b815460001960089490940293841b1916921b91909117905550565b6000611d4f8184846140c9565b81811015612f0a5761410d6000826140ed565b6001016140fa565b601f821115611d4f576000818152602090206020601f8501048101602085101561413c5750805b610d9c6020601f8601048301826140fa565b81516001600160401b0381111561416757614167613467565b6141718254613bc0565b61417c828285614115565b6020601f8311600181146141b057600084156141985750858201515b600019600886021c1981166002860217865550611266565b600085815260208120601f198616915b828110156141e057888501518255602094850194600190920191016141c0565b868310156141fc5784890151600019601f89166008021c191682555b600160028802018855505050505050505050565b6080810161421e8288613c5c565b61422b6020830187613c5c565b61423860408301866132a6565b818103606083015261424b818486613e03565b979650505050505050565b602381526000602082017f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737381526261676560e81b60208201529150613c45565b60208082528101610c8281614256565b602181526000602082017f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f618152601960fa1b60208201529150613c45565b60208082528101610c82816142a6565b6001600160401b038116613195565b608081016143118288613c5c565b8181036020830152614324818688613e03565b905061433360408301856142f4565b61434060608301846132a6565b9695505050505050565b606081016143588286613c5c565b613e996020830185613c5c565b601f81526000602082017f4f4654436f72653a2063616c6c6572206d757374206265204f4654436f72650081529150613b93565b60208082528101610c8281614365565b60c081016143b7828b613c5c565b81810360208301526143ca81898b613e03565b90506143d960408301886142f4565b6143e660608301876132a6565b6143f360808301866132a6565b81810360a0830152614406818486613e03565b9a9950505050505050505050565b826001600160401b0381111561442c5761442c613467565b6144368254613bc0565b614441828285614115565b6000601f831160018114614475576000841561445d5750858201355b600019600886021c1981166002860217865550610c48565b600085815260208120601f198616915b828110156144a55788850135825560209485019460019092019101614485565b868310156144c157600019601f88166008021c19858a01351682555b60016002880201885550505050505050505050565b608081016144e48287613c5c565b6144f16020830186613c5c565b6144fe60408301856137e2565b612d7160608301846132a6565b6000614519613509846134c5565b90508281526020810184848401111561453457614534600080fd5b6135348482856131a9565b600082601f83011261455357614553600080fd5b8151611c9484826020860161450b565b60006020828403121561457857614578600080fd5b81516001600160401b0381111561459157614591600080fd5b611c948482850161453f565b608081016145ab8287613c5c565b81810360208301526145bd81866131cd565b90506145cc60408301856142f4565b818103606083015261434081846131cd565b60a081016145ec8288613c5c565b6145f960208301876137e2565b818103604083015261460b81866131cd565b905061461a6060830185613191565b818103608083015261424b81846131cd565b6000806040838503121561464257614642600080fd5b600061464e8585613d3f565b925050602061329c85828601613d3f565b6060810161466d82866137e2565b613e9960208301856137e2565b8051610c8281613343565b60006020828403121561469a5761469a600080fd5b6000611c94848461467a565b818102808215838204851417612e1557612e15613fa6565b634e487b7160e01b600052601260045260246000fd5b6000826146e3576146e36146be565b500490565b601c81526000602082017f4f4654436f72653a20756e6b6e6f776e207061636b657420747970650000000081529150613b93565b60208082528101610c82816146e8565b601981526000602082017f4f4654436f72653a20616d6f756e7420746f6f20736d616c6c0000000000000081529150613b93565b60208082528101610c828161472c565b600e81526000602082016d736c6963655f6f766572666c6f7760901b81529150613b93565b60208082528101610c8281614770565b6011815260006020820170736c6963655f6f75744f66426f756e647360781b81529150613b93565b60208082528101610c82816147a5565b60006147e7825190565b6147f58185602086016131a9565b9290920192915050565b6000610faa82846147dd565b60a081016148198288613c5c565b818103602083015261482b81876131cd565b905061483a60408301866142f4565b818103606083015261484c81856131cd565b9050818103608083015261424b81846131cd565b601a81526000602082017f4f4654436f72653a20616d6f756e745344206f766572666c6f7700000000000081529150613b93565b60208082528101610c8281614860565b6000610c828260f81b90565b61319560ff82166148a4565b6000610c828260c01b90565b6131956001600160401b0382166148bc565b60006148e682866148b0565b6001820191506148f682856132a6565b60208201915061490682846148c8565b506008019392505050565b6013815260006020820172746f55696e74385f6f75744f66426f756e647360681b81529150613b93565b60208082528101610c8281614911565b610100810161495a828b613c5c565b818103602083015261496c818a6131cd565b905061497b60408301896142f4565b61498860608301886132a6565b61499560808301876137e2565b6149a260a08301866132a6565b81810360c08301526149b481856131cd565b90506149c360e08301846132a6565b9998505050505050505050565b606080825281016149e181866131cd565b9050613e9960208301856142f4565b601a81526000602082017f4c7a4170703a206d696e4761734c696d6974206e6f742073657400000000000081529150613b93565b60208082528101610c82816149f0565b601b81526000602082017f4c7a4170703a20676173206c696d697420697320746f6f206c6f77000000000081529150613b93565b60208082528101610c8281614a34565b600082614a8757614a876146be565b500690565b603081526000602082017f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742081526f61207472757374656420736f7572636560801b60208201529150613c45565b60208082528101610c8281614a8c565b60c08101614af78289613c5c565b8181036020830152614b0981886131cd565b90508181036040830152614b1d81876131cd565b9050614b2c60608301866137e2565b614b3960808301856137e2565b81810360a0830152614b4b81846131cd565b98975050505050505050565b6000614b6382896148b0565b600182019150614b7382886132a6565b602082019150614b8382876148c8565b600882019150614b9382866132a6565b602082019150614ba382856148c8565b600882019150614b4b82846147dd565b601881526000602082017f4f4654436f72653a20696e76616c6964207061796c6f6164000000000000000081529150613b93565b60208082528101610c8281614bb3565b601c81526000602082017f4c7a4170703a20696e76616c69642061646170746572506172616d730000000081529150613b93565b60208082528101610c8281614bf7565b60208082527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c6172676591019081526000613b93565b60208082528101610c8281614c3b565b6015815260006020820174746f416464726573735f6f75744f66426f756e647360581b81529150613b93565b60208082528101610c8281614c7d565b6014815260006020820173746f55696e7436345f6f75744f66426f756e647360601b81529150613b93565b60208082528101610c8281614cb9565b6015815260006020820174746f427974657333325f6f75744f66426f756e647360581b81529150613b93565b60208082528101610c8281614cf456fea26469706673582212204591bd6d8068c4724c294e077a9d1db3a36c67ba8366e633acb452cb7e90332364736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000071fc1f555a39e0b698653ab0b475488ec3c34d57000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675
-----Decoded View---------------
Arg [0] : rainToken (address): 0x71Fc1F555a39E0B698653AB0b475488EC3c34D57
Arg [1] : wethToken (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : usdtToken (address): 0xdAC17F958D2ee523a2206206994597C13D831ec7
Arg [3] : uniswapRouter (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
Arg [4] : _lzEndpoint (address): 0x66A71Dcef29A0fFBDBE3c6a460a3B5BC225Cd675
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000071fc1f555a39e0b698653ab0b475488ec3c34d57
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [2] : 000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7
Arg [3] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
Arg [4] : 00000000000000000000000066a71dcef29a0ffbdbe3c6a460a3b5bc225cd675
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.