Source Code
Latest 25 from a total of 79,281 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Lottery Tick... | 7812675 | 1 min ago | IN | 0 HYPE | 0.00001806 | ||||
Set Lottery Tick... | 7812666 | 2 mins ago | IN | 0 HYPE | 0.00001815 | ||||
Set Lottery Tick... | 7812662 | 2 mins ago | IN | 0 HYPE | 0.00002136 | ||||
Set Lottery Tick... | 7812657 | 2 mins ago | IN | 0 HYPE | 0.00002148 | ||||
Set Lottery Tick... | 7812653 | 2 mins ago | IN | 0 HYPE | 0.00002137 | ||||
Set Lottery Tick... | 7812648 | 2 mins ago | IN | 0 HYPE | 0.00002149 | ||||
Set Lottery Tick... | 7812639 | 2 mins ago | IN | 0 HYPE | 0.00001477 | ||||
Set Lottery Tick... | 7812633 | 2 mins ago | IN | 0 HYPE | 0.00001483 | ||||
Set Lottery Tick... | 7812629 | 2 mins ago | IN | 0 HYPE | 0.00001806 | ||||
Set Lottery Tick... | 7812624 | 2 mins ago | IN | 0 HYPE | 0.00001815 | ||||
Set Lottery Tick... | 7812619 | 2 mins ago | IN | 0 HYPE | 0.00001816 | ||||
Set Lottery Tick... | 7812613 | 2 mins ago | IN | 0 HYPE | 0.00001824 | ||||
Set Lottery Tick... | 7812368 | 6 mins ago | IN | 0 HYPE | 0.00001806 | ||||
Set Lottery Tick... | 7812360 | 7 mins ago | IN | 0 HYPE | 0.00001819 | ||||
Set Lottery Tick... | 7812356 | 7 mins ago | IN | 0 HYPE | 0.00002136 | ||||
Set Lottery Tick... | 7812351 | 7 mins ago | IN | 0 HYPE | 0.00002147 | ||||
Set Lottery Tick... | 7812346 | 7 mins ago | IN | 0 HYPE | 0.00002137 | ||||
Set Lottery Tick... | 7812342 | 7 mins ago | IN | 0 HYPE | 0.00002507 | ||||
Set Lottery Tick... | 7812333 | 7 mins ago | IN | 0 HYPE | 0.00001477 | ||||
Set Lottery Tick... | 7812328 | 7 mins ago | IN | 0 HYPE | 0.00001482 | ||||
Set Lottery Tick... | 7812323 | 7 mins ago | IN | 0 HYPE | 0.00001806 | ||||
Set Lottery Tick... | 7812318 | 7 mins ago | IN | 0 HYPE | 0.00001815 | ||||
Set Lottery Tick... | 7812313 | 7 mins ago | IN | 0 HYPE | 0.00001806 | ||||
Set Lottery Tick... | 7812308 | 7 mins ago | IN | 0 HYPE | 0.00001815 | ||||
Set Lottery Tick... | 7812056 | 12 mins ago | IN | 0 HYPE | 0.00001806 |
Loading...
Loading
Contract Name:
Prophet
Compiler Version
v0.8.19+commit.7dd6d404
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.19; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Context } from "@openzeppelin/contracts/utils/Context.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { AccessControlEnumerable } from "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import { Pausable } from "@openzeppelin/contracts/security/Pausable.sol"; import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol"; import { ILayerZeroReceiver } from "@LayerZero/contracts/interfaces/ILayerZeroReceiver.sol"; import { ILayerZeroUserApplicationConfig } from "@LayerZero/contracts/interfaces/ILayerZeroUserApplicationConfig.sol"; import { ILayerZeroEndpoint } from "@LayerZero/contracts/interfaces/ILayerZeroEndpoint.sol"; import { AccessControlAdminProtection } from "./util/AccessControlAdminProtection.sol"; import { IProphetTicketManager } from "./interfaces/IProphetTicketManager.sol"; import { StargateStruct } from "./interfaces/StargateStruct.sol"; import { IStargateReceiver } from "./interfaces/IStargateReceiver.sol"; import { IStargateRouter } from "./interfaces/IStargateRouter.sol"; import { IPool } from "./interfaces/IPool.sol"; import { IProphet, Lottery, LotteryData, LotteryParams } from "./interfaces/IProphet.sol"; import { IProphetPriceFeed } from "./interfaces/IProphetPriceFeed.sol"; /** * @notice Contract for creating and managing prediction lotteries. * * Assumptions: * * The outcome of a prediction lottery is determined using an oracle service conforming to * the IProphetPriceFeed interface. Prices can be scaled as deemed appropriate by the price feed, * but all prices should fit in 128 bits. We disallow purchasing tickets for prices that do not * fit in 128 bits. * * The collateral token must be an ERC-20 where the change in balance resulting from a token * transfer is exactly equal to the specified transfer amount. This means fee-on-transfer tokens * are not supported, and an attempted payment into the contract with such a mechanism will * revert. Tokens with rebasing mechanisms are also not supported as collateral. */ contract Prophet is IProphet, ReentrancyGuard, Pausable, AccessControlAdminProtection, IStargateReceiver, ILayerZeroReceiver, ILayerZeroUserApplicationConfig { using SafeERC20 for IERC20; using SafeCast for uint256; struct PoolInfo { address token; address poolAddress; uint256 convertRate; } // ===================== Constants ===================== // // AccessControl roles. bytes32 public constant PRICE_SETTER_ROLE = keccak256("PRICE_SETTER_ROLE"); bytes32 public constant FEE_RECIPIENT_ROLE = keccak256("FEE_RECIPIENT_ROLE"); bytes32 public constant LOTTERY_MANAGER_ROLE = keccak256("LOTTERY_MANAGER_ROLE"); uint256 public constant FEE_PRECISION = 100e6; // 100% uint256 public constant MAX_FEE_RATE = 20e6; // 20% // External contracts. IProphetPriceFeed public immutable prophetPriceFeed; StargateStruct public stargateStruct; ILayerZeroEndpoint public immutable layerZeroEndpoint; IProphetTicketManager public immutable ProphetTicketManager; // ===================== Storage ===================== // mapping(uint16 chainId => uint256 gas) public dstGasReserve; uint256 public interchainTransactionFees = 0; /// @dev The current rate for protocol fees, as a fraction of FEE_PRECISION. uint256 public _FEE_RATE_; /// @dev The last lottery ID, or zero if no lotteries were created. /// /// This is also equal to the number of lotteries that have been created. uint256 public _LAST_LOTTERY_ID_; /// @dev Mapping (lotteryId => Lottery) for lottery parameters and state. mapping(uint256 => Lottery) private _LOTTERIES_; /// @dev Mapping (collateralToken -> feeCollected) for accumulated protocol fees. mapping(IERC20 => uint256) public _FEE_COLLECTED_; mapping(uint256 => PoolInfo) public _POOL_ID_TO_INFO_; // cache pool info mapping(uint16 chainId => uint256 fee) public fundBridgeFee; // fee for bridging funds from chainId -> current chain. (not from current chain -> chainId) mapping(address collateralToken => mapping(address account => uint256 refundAmount)) public _USER_REFUND_AMOUNT_; mapping(uint16 chainId => bytes trustedRemote) public trustedRemoteLookup; // ===================== Constructor ===================== // constructor( IProphetPriceFeed _prophetPriceFeed, StargateStruct memory _stargateStruct, ILayerZeroEndpoint _layerZeroEndpoint, address _admin, IProphetTicketManager _prophetTicketManager ) { // Set immutable variables. prophetPriceFeed = _prophetPriceFeed; stargateStruct = _stargateStruct; layerZeroEndpoint = _layerZeroEndpoint; ProphetTicketManager = _prophetTicketManager; // Set storage. _setFeeRate(1*1e5); // 0.1% // Grant admin role. _grantRole(DEFAULT_ADMIN_ROLE, _admin); } // ===================== Admin-Only External Functions (Cold) ===================== // function pauseContract() external nonReentrant onlyRole(DEFAULT_ADMIN_ROLE) { _pause(); } function unpauseContract() external nonReentrant onlyRole(DEFAULT_ADMIN_ROLE) { _unpause(); } function setFeeRate( uint256 _feeRate ) external nonReentrant whenNotPaused onlyRole(DEFAULT_ADMIN_ROLE) { _setFeeRate(_feeRate); } function setDstGasReserve(uint16 _chainId, uint256 _dstGasReserve) whenNotPaused onlyRole(DEFAULT_ADMIN_ROLE) external { dstGasReserve[_chainId] = _dstGasReserve; } function setFundBridgeFee(uint16 _chainId, uint256 _fundBridgeFee) public onlyRole(DEFAULT_ADMIN_ROLE) { fundBridgeFee[_chainId] = _fundBridgeFee; } // ===================== Admin-Only External Functions (Hot) ===================== // function extractNative(uint256 amount) onlyRole(DEFAULT_ADMIN_ROLE) external { if(amount == 0){ amount = interchainTransactionFees; } require(amount <= interchainTransactionFees); interchainTransactionFees -= amount; (bool sent, ) = payable(msg.sender).call{value: amount}(""); require(sent); } function createLottery( LotteryParams calldata _lotteryParams ) external nonReentrant whenNotPaused onlyRole(LOTTERY_MANAGER_ROLE) { require( _lotteryParams.openTimestamp > block.timestamp, "invalid openTimestamp" ); require( _lotteryParams.closeTimestamp > _lotteryParams.openTimestamp, "invalid closeTimestamp" ); require( _lotteryParams.maturityTimestamp > _lotteryParams.closeTimestamp, "invalid maturityTimestamp" ); require( _lotteryParams.bucketSize > 0, "invalid bucketSize" ); uint256 lotteryId = ++_LAST_LOTTERY_ID_; _LOTTERIES_[lotteryId].params = _lotteryParams; emit LotteryCreated( lotteryId, _lotteryParams ); } /** * @notice Set the ticket prices for a lottery. */ function setLotteryTicketsPrice( uint256 _lotteryId, uint256 _firstBucketLowerBound, uint256[] calldata _bucketTicketPrices ) external nonReentrant whenNotPaused onlyRole(PRICE_SETTER_ROLE) { Lottery storage lottery = _getLottery(_lotteryId); require( _bucketTicketPrices.length > 0, "empty price list" ); require( block.timestamp < lottery.params.closeTimestamp, "lottery closed" ); // Set the ticket prices for each bucket. lottery.firstBucketLowerBound = _firstBucketLowerBound; lottery.bucketTicketPrices = _bucketTicketPrices; // Set the ticket prices for all buckets outside the range of the _bucketTicketPrices array. uint256 firstPrice = _bucketTicketPrices[0]; uint256 lastPrice = _bucketTicketPrices[_bucketTicketPrices.length - 1]; lottery.minimumTicketPrice = firstPrice < lastPrice ? firstPrice : lastPrice; emit SetLotteryPrices( _lotteryId, _firstBucketLowerBound, lottery.minimumTicketPrice, _bucketTicketPrices ); } /** * @notice Transfer proceeds from a previous lottery to a current lottery. * * This can only be called if the previous lottery has matured without a winner. */ function transferProceeds( uint256 _prevLotteryId, uint256 _forwardLotteryId ) external nonReentrant whenNotPaused onlyRole(LOTTERY_MANAGER_ROLE) { Lottery storage prevLottery = _getLottery(_prevLotteryId); Lottery storage forwardLottery = _getLottery(_forwardLotteryId); require( prevLottery.params.collateralToken == forwardLottery.params.collateralToken, "collateral token mismatch" ); require( block.timestamp >= prevLottery.params.maturityTimestamp, "lottery not matured" ); if (!prevLottery.isResolved) { _resolveLottery(_prevLotteryId); } // Do not allow transfer if any tickets were sold for the winning bucket. if (prevLottery.ticketsSoldCounts[prevLottery.winningBucketLowerBound] != 0) { return; } require( block.timestamp >= forwardLottery.params.openTimestamp, "lottery not open" ); require( block.timestamp < forwardLottery.params.closeTimestamp, "lottery closed" ); forwardLottery.proceeds += prevLottery.proceeds; prevLottery.proceeds = 0; emit TransferProceeds( _prevLotteryId, _forwardLotteryId ); } /** * @notice Add bonus proceeds to a lottery by making an ERC-20 transfer. */ function addProceeds( uint256 _lotteryId, uint256 _amount ) external nonReentrant whenNotPaused onlyRole(LOTTERY_MANAGER_ROLE) { Lottery storage lottery = _getLottery(_lotteryId); require( block.timestamp < lottery.params.closeTimestamp, "lottery closed" ); _addProceedsViaTransfer(lottery, _msgSender(), _amount); emit AddProceeds( _lotteryId, _amount ); } /** * @notice Withdraw protocol fees. */ function withdrawFees( address _recipient, IERC20 _token, uint256 _amount ) external nonReentrant whenNotPaused onlyRole(LOTTERY_MANAGER_ROLE) { require( hasRole(FEE_RECIPIENT_ROLE, _recipient), "Invalid recipient" ); require( _amount <= _FEE_COLLECTED_[_token], "amount too large" ); _FEE_COLLECTED_[_token] -= _amount; _token.safeTransfer( _recipient, _amount ); emit FeeWithdrawn( _recipient, _amount ); } function setTrustedRemote(uint16 _remoteChainId, bytes calldata _path) external onlyRole(DEFAULT_ADMIN_ROLE) { trustedRemoteLookup[_remoteChainId] = _path; emit SetTrustedRemote(_remoteChainId, _path); } function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyRole(DEFAULT_ADMIN_ROLE) { trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this)); } // ===================== Other External Functions ===================== // /** * @notice Buy lottery tickets. * @param _lotteryId the lottery to buy the tickets on * @param _bucketLowerBound lower bound of the range to but tickets from * @param _buyTicketCount number of tickets to buy */ function buyTickets( uint256 _lotteryId, uint128 _bucketLowerBound, uint256 _buyTicketCount, address _receiver ) external nonReentrant whenNotPaused { _buyTickets(_lotteryId,_bucketLowerBound,_buyTicketCount, _msgSender(), _receiver, false, address(0), 0); } /** * @notice Buy lottery tickets. * @param _lotteryId the lottery to buy the tickets on * @param _multiBucketLowerBound list of lower bounds of the ranges to buy tickets from * @param _multiBuyTicketCount list of number of tickets to buy from each range */ function buyMultipleTickets( uint256 _lotteryId, uint128[] calldata _multiBucketLowerBound, uint256[] calldata _multiBuyTicketCount, address _receiver ) external nonReentrant whenNotPaused { require(_multiBucketLowerBound.length == _multiBuyTicketCount.length, "Invalid input"); for(uint i = 0; i < _multiBucketLowerBound.length; i++){ _buyTickets(_lotteryId,_multiBucketLowerBound[i],_multiBuyTicketCount[i], _msgSender(), _receiver, false, address(0), 0); } } /** * @notice Buy lottery tickets on a lottery that exists on a different chain. * @param _lotteryId the lottery to buy the tickets on * @param _bucketLowerBound lower bound of the range to but tickets from * @param _buyTicketCount number of tickets to buy * @param _dstChainId the chain on which the lottery exists * @param _srcPoolId the pool id of the appropriate token on current chain * @param _dstPoolId the pool id of the appropriate token on destination chain * @param _amountLD the amount of tokens we want send to buy tickets * @param _minAmountLD the min amount of tokens we want to get on other chain after slippage * @param _to the address of prophet on the other chain. */ function buyTicketsCrossChain( uint256 _lotteryId, uint128 _bucketLowerBound, uint256 _buyTicketCount, uint16 _dstChainId, uint256 _srcPoolId, uint256 _dstPoolId, uint256 _amountLD, uint256 _minAmountLD, address _to ) external payable nonReentrant whenNotPaused { PoolInfo memory poolInfo = _getPoolInfo(_srcPoolId); IERC20(poolInfo.token).safeTransferFrom(_msgSender(), address(this), _amountLD); // construct payload (buy info needed on dstChain) bytes memory payload = abi.encode(_msgSender(), _lotteryId, _bucketLowerBound, _buyTicketCount); // send token to the Prophet address on dstChain _sendToChain(_dstChainId, _srcPoolId, _dstPoolId, _amountLD, _minAmountLD, _to, true, payload); } /** * @param - source chain identifier * @param - source address identifier * @param - message ordering nonce * @param _token - token contract * @param _amountLD - amount (local decimals) to recieve * @param _payload - bytes containing the toAddress */ function sgReceive( uint16, bytes memory, uint256, address _token, uint256 _amountLD, bytes memory _payload ) external override { // we use msg.sender here as stargate will not call using a gasless transaction. require(msg.sender == address(stargateStruct.STARGATE_COMPOSER), "stargate: only router"); ( address sender, uint256 lotteryId, uint128 bucketLowerBound, uint256 buyTicketCount ) = abi.decode(_payload, (address, uint256, uint128, uint256)); _buyTickets(lotteryId, bucketLowerBound, buyTicketCount, sender, sender, true, _token, _amountLD); } /** * @notice claim winnings from lotteries on current chain. * @param _lotteryIds the lotteries to claim winnings from */ function claim( uint256[] calldata _lotteryIds ) external nonReentrant whenNotPaused { address claimer = _msgSender(); for (uint256 i = 0; i < _lotteryIds.length;) { uint256 lotteryId = _lotteryIds[i]; _claim(lotteryId, claimer, false, 0, 0, 0); unchecked { i++; } } } /** * @notice Trigger the claim process on dstChain by sending a LZ message * @dev The Prophet address on dstChain will handle the request with lzReceive. If the lotteryId sent is 0, then the user will be claiming their refunds from the other chain. * @notice Buy lottery tickets on a lottery that exists on a different chain. * @param _lotteryId the lottery to buy the tickets on * @param _dstChainId the chain on which the lottery exists * @param _srcPoolId the pool id of the appropriate token on current chain * @param _dstPoolId the pool id of the appropriate token on destination chain * @param _dstChainGas the gas we want to use on the transaction on the other chain */ function claimOnChain( uint256 _lotteryId, uint16 _dstChainId, uint256 _srcPoolId, uint256 _dstPoolId, uint256 _dstChainGas ) external payable nonReentrant whenNotPaused { address claimer = _msgSender(); require(msg.value > fundBridgeFee[_dstChainId], "not enough fees"); interchainTransactionFees+=fundBridgeFee[_dstChainId]; require(_dstChainGas >= dstGasReserve[_dstChainId], "not enough dstgas"); bytes memory trustedRemote = trustedRemoteLookup[_dstChainId]; bytes memory adapterParams = abi.encodePacked(uint16(1), _dstChainGas); bytes memory payload = abi.encode(claimer, _lotteryId, _srcPoolId, _dstPoolId); layerZeroEndpoint.send{value: msg.value - fundBridgeFee[_dstChainId]}(_dstChainId, trustedRemote, payload, payable(_msgSender()), address(0x0), adapterParams); } /** * @notice Resolve a lottery that has matured. */ function resolveLottery( uint256 _lotteryId ) external nonReentrant whenNotPaused { _resolveLottery(_lotteryId); } function getLottery( uint256 _lotteryId ) external view returns (LotteryData memory) { Lottery storage lottery = _getLottery(_lotteryId); return LotteryData({ params: lottery.params, firstBucketLowerBound: lottery.firstBucketLowerBound, bucketTicketPrices: lottery.bucketTicketPrices, minimumTicketPrice: lottery.minimumTicketPrice, isResolved: lottery.isResolved, winningBucketLowerBound: lottery.winningBucketLowerBound, proceeds: lottery.proceeds }); } function getTicketsSoldCount( uint256 _lotteryId, uint256 _bucketLowerBound ) external view returns (uint256) { Lottery storage lottery = _getLottery(_lotteryId); return lottery.ticketsSoldCounts[_bucketLowerBound]; } // ===================== Public Functions ===================== // function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 , bytes calldata _payload) public virtual override { // we use msg.sender here as layerzero will not call using a gasless transaction. require(msg.sender == address(layerZeroEndpoint)); 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" ); ( address sender, uint256 lotteryId, uint256 dstPoolId, uint256 srcPoolId ) = abi.decode(_payload, (address, uint256, uint256, uint256)); if(lotteryId != 0){ _claim(lotteryId, sender, true, _srcChainId, srcPoolId, dstPoolId); } else{ _giveRefund(sender, _srcChainId, srcPoolId, dstPoolId); } } function quoteInterChainBuyFee( uint256 _lotteryId, uint128 _bucketLowerBound, uint256 _buyTicketCount, uint16 _dstChainId, uint256 _dstGasForCall, address _to ) external view returns(uint256, uint256) { bytes memory payload = abi.encode(_to, _lotteryId, _bucketLowerBound, _buyTicketCount); IStargateRouter.lzTxObj memory _sgTxParams; _sgTxParams.dstGasForCall += _dstGasForCall; _sgTxParams.dstNativeAddr = abi.encodePacked(_to); return stargateStruct.STARGATE_COMPOSER.quoteLayerZeroFee(_dstChainId, 1, abi.encodePacked(_to), payload, _sgTxParams); } function quoteInterChainClaimFee( uint256 _lotteryId, uint16 _dstChainId, uint256 _srcPoolId, uint256 _dstPoolId, address _receiver, uint256 _dstChainGas ) external view returns (uint) { bytes memory adapterParams = abi.encodePacked(uint16(1), _dstChainGas); bytes memory payload = abi.encode(_receiver, _lotteryId, _srcPoolId, _dstPoolId); (uint256 lzFee, ) = layerZeroEndpoint.estimateFees(_dstChainId, address(this), payload, false, adapterParams); return fundBridgeFee[_dstChainId] + lzFee; } function exists( uint256 _lotteryId ) public view returns (bool) { return _lotteryId != 0 && _lotteryId <= _LAST_LOTTERY_ID_; } /** * @dev See {IERC1155-supportsInterface}. */ function supportsInterface( bytes4 _interfaceId ) public view override(AccessControlEnumerable) returns (bool) { return ( _interfaceId == type(IProphet).interfaceId || AccessControlEnumerable.supportsInterface(_interfaceId) ); } // ===================== Internal Functions ===================== // function _buyTickets( uint256 _lotteryId, uint128 _bucketLowerBound, uint256 _buyTicketCount, address _sender, address _receiver, bool _fromOtherChain, address _collateralToken, uint256 _amountLD ) internal { if(_fromOtherChain){ if(!exists(_lotteryId)){ _increaseRefund(_collateralToken, _receiver, _amountLD); return; } } Lottery storage lottery = _getLottery(_lotteryId); if (_fromOtherChain && _collateralToken != address(lottery.params.collateralToken)) { _lotteryId = 0; } if(block.timestamp < lottery.params.openTimestamp){ _lotteryId = 0; } if(lottery.bucketTicketPrices.length <= 0){ _lotteryId = 0; } if(block.timestamp >= lottery.params.closeTimestamp){ _lotteryId = 0; } if(_buyTicketCount <= 0){ _lotteryId = 0; } if(_bucketLowerBound % lottery.params.bucketSize != 0){ _lotteryId = 0; } if(_lotteryId == 0){ if(_fromOtherChain){ _increaseRefund(_collateralToken, _receiver, _amountLD); return; } else{ revert(); } } // Determine whether the requested bucket is within the range of priced buckets. uint256 pricedRange = lottery.bucketTicketPrices.length * lottery.params.bucketSize; bool isPricedBucket = ( _bucketLowerBound >= lottery.firstBucketLowerBound && _bucketLowerBound < lottery.firstBucketLowerBound + pricedRange ); // Get the index of the requested bucket within the priced buckets. // If the requested bucket is not within the range of priced buckets, the index will be 0 // and will be unused. uint256 bucketId = isPricedBucket ? ( (_bucketLowerBound - lottery.firstBucketLowerBound) / lottery.params.bucketSize ) : 0; // Get the price of tickets from the requested bucket. uint256 ticketPrice = isPricedBucket ? lottery.bucketTicketPrices[bucketId] : lottery.minimumTicketPrice; // Calculate the total cost of the tickets. uint256 ticketsCost = _buyTicketCount * ticketPrice; // Charge the buyer for the tickets. // // Note: Intentionally violating CEI pattern under assumption we are protected by the // reentrancy guard. Charge the buyer before minting tickets. if(!_fromOtherChain){ _addProceedsViaTransfer(lottery, _sender, ticketsCost); } else{ if(_amountLD < ticketsCost){ _increaseRefund(_collateralToken, _receiver, _amountLD); return; } else{ if((_amountLD - ticketsCost) > 0){ _increaseRefund(_collateralToken, _receiver, _amountLD - ticketsCost); } lottery.proceeds += ticketsCost; } } lottery.ticketsSoldCounts[_bucketLowerBound] += _buyTicketCount; ProphetTicketManager.mintTickets( _receiver, _lotteryId, _bucketLowerBound, _buyTicketCount, "" ); emit BoughtTickets( _lotteryId, _receiver, _bucketLowerBound, _buyTicketCount, ticketsCost ); } function _claim( uint256 _lotteryId, address _claimer, bool _isInterChain, uint16 _dstChainId, uint256 _srcPoolId, uint256 _dstPoolId ) internal { Lottery storage lottery = _getLottery(_lotteryId); if (!lottery.isResolved) { _resolveLottery(_lotteryId); } // Note: This will revert if the resolved price does not fit in 128 bits. The lottery // params and price oracle should be chosen to ensure that this cannot occur. // If it does somehow occur, there will be no winning tickets for that lottery // since we disallow purchasing tickets for prices that do not fit in 128 bits. uint128 winningBucketLowerBound = lottery.winningBucketLowerBound.toUint128(); uint256 userWinningTicketBalance = ProphetTicketManager.ticketBalanceOf( _claimer, _lotteryId, winningBucketLowerBound ); uint256 claimAmount = ( userWinningTicketBalance * lottery.proceeds / lottery.ticketsSoldCounts[lottery.winningBucketLowerBound] ); if(claimAmount > 0){ if(_isInterChain){ _sendToChain(_dstChainId, _srcPoolId, _dstPoolId, claimAmount, 0, _claimer, false, ""); } else{ lottery.params.collateralToken.safeTransfer( _claimer, claimAmount ); } ProphetTicketManager.burnTickets( _claimer, _lotteryId, winningBucketLowerBound, userWinningTicketBalance ); emit Claimed( _lotteryId, _claimer ); } } function _giveRefund(address _sender, uint16 _srcChainId, uint256 _srcPoolId, uint256 _dstPoolId) internal { PoolInfo memory poolInfo = _getPoolInfo(_srcPoolId); uint256 claimAmount = _USER_REFUND_AMOUNT_[poolInfo.token][_sender]; _USER_REFUND_AMOUNT_[poolInfo.token][_sender] = 0; _sendToChain(_srcChainId, _srcPoolId, _dstPoolId, claimAmount, 0, _sender, false, ""); emit Refund( _sender, poolInfo.token, claimAmount, true ); } /** * @dev Send token to another chain with Stargate pool swap * @param desChainId ChainID to swap to * @param _srcPoolId Stargate PoolID on current chain * @param _dstPoolId Stargate PoolID on destination Chain * @param _amount Amount to swap * @param _minAmount Min amount to receive * @param _receiver Receiver address on destination chain **/ function _sendToChain( uint16 desChainId, uint _srcPoolId, uint _dstPoolId, uint _amount, uint _minAmount, address _receiver, bool _useMsgValueForFee, bytes memory _payload ) internal { PoolInfo memory poolInfo = _getPoolInfo(_srcPoolId); // remove dust if (poolInfo.convertRate > 1) _amount = ((_amount / poolInfo.convertRate) * poolInfo.convertRate); bytes memory claimerBytes = abi.encodePacked(_receiver); IStargateRouter.lzTxObj memory lzTxParams; lzTxParams.dstGasForCall = dstGasReserve[desChainId]; lzTxParams.dstNativeAddr = claimerBytes; uint fee; address refundAddress; if (_useMsgValueForFee) { fee = msg.value; refundAddress = _msgSender(); } else { // query fee in eth (fee, ) = stargateStruct.STARGATE_COMPOSER.quoteLayerZeroFee(desChainId, 1, claimerBytes, "", lzTxParams); refundAddress = address(this); if(interchainTransactionFees < fee){ _increaseRefund(poolInfo.token, _receiver, _amount); return; } } if(_payload.length > 0){ stargateStruct.STARGATE_COMPOSER.swap{value: fee}( desChainId, _srcPoolId, _dstPoolId, payable(refundAddress), _amount, _minAmount, lzTxParams, abi.encodePacked(_receiver), _payload ); } else{ stargateStruct.STARGATE_RELAYER.swap{value: fee}( desChainId, _srcPoolId, _dstPoolId, payable(refundAddress), _amount, _minAmount, lzTxParams, abi.encodePacked(_receiver), "" ); } if(!_useMsgValueForFee){ interchainTransactionFees-=fee; } } function _setFeeRate( uint256 _feeRate ) internal { require( _feeRate <= MAX_FEE_RATE, "feeRate too large" ); _FEE_RATE_ = _feeRate; emit FeeRateChanged( _feeRate ); } function _resolveLottery( uint256 _lotteryId ) internal { Lottery storage lottery = _getLottery(_lotteryId); require( block.timestamp >= lottery.params.maturityTimestamp, "lottery not matured" ); require( !lottery.isResolved, "lottery already resolved" ); uint256 price = prophetPriceFeed.getHistoricalPrice( lottery.params.token, lottery.params.maturityTimestamp ); // Calculate the lower bound of the bucket containing the price at maturity. // Each bucket includes its lower bound and excludes its upper bound. lottery.winningBucketLowerBound = ( price / lottery.params.bucketSize * lottery.params.bucketSize ); // Collect protocol fee off of the proceeds. uint256 fee = lottery.proceeds * _FEE_RATE_ / FEE_PRECISION; _FEE_COLLECTED_[lottery.params.collateralToken] += fee; lottery.proceeds -= fee; // Mark the lottery as resolved. lottery.isResolved = true; emit LotteryResolved( _lotteryId, price, lottery.winningBucketLowerBound ); } /** * @dev Perform ERC-20 transfer of collateral and increase proceeds of a lottery accordingly. * * Require that the ERC-20 change in balance is exactly equal to the transfer amount. * This means that ERC-20 tokens with fee-on-transfer mechanisms are not supported. */ function _addProceedsViaTransfer( Lottery storage _lottery, address _spender, uint256 _amount ) internal { IERC20 token = _lottery.params.collateralToken; // Note: Intentionally violating CEI pattern to execute transfer before adding proceeds. uint256 balanceBefore = token.balanceOf(address(this)); token.safeTransferFrom(_spender, address(this), _amount); uint256 balanceAfter = token.balanceOf(address(this)); require(balanceBefore + _amount == balanceAfter, "invalid ERC-20 transfer"); _lottery.proceeds += _amount; } function _increaseRefund(address _token, address _user, uint _amount) internal { _USER_REFUND_AMOUNT_[_token][_user] += _amount; emit Refund(_user, _token, _amount, false); } function _getLottery( uint256 _lotteryId ) internal view returns (Lottery storage) { require( exists(_lotteryId), "invalid lottery id" ); return _LOTTERIES_[_lotteryId]; } function getPoolInfo(uint256 _poolId) external returns (PoolInfo memory poolInfo) { return _getPoolInfo(_poolId); } function _getPoolInfo(uint256 _poolId) internal returns (PoolInfo memory poolInfo) { // return early if its already been called if (_POOL_ID_TO_INFO_[_poolId].poolAddress != address(0)) { return _POOL_ID_TO_INFO_[_poolId]; } address pool = stargateStruct.STARGATE_FACTORY.getPool(_poolId); require(address(pool) != address(0), "stargate: pool does not exist"); IERC20(pool).safeApprove(address(stargateStruct.STARGATE_COMPOSER), type(uint256).max); address token = IPool(pool).token(); require(address(token) != address(0), "stargate: token does not exist"); IERC20(token).safeApprove(address(stargateStruct.STARGATE_COMPOSER), type(uint256).max); IERC20(token).safeApprove(address(stargateStruct.STARGATE_RELAYER), type(uint256).max); uint256 convertRate = IPool(pool).convertRate(); poolInfo = PoolInfo({token: token, poolAddress: pool, convertRate: convertRate}); _POOL_ID_TO_INFO_[_poolId] = poolInfo; } receive() external payable { interchainTransactionFees+=msg.value; } function setConfig( uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config ) external override onlyRole(DEFAULT_ADMIN_ROLE) { layerZeroEndpoint.setConfig(_version, _chainId, _configType, _config); } function setSendVersion(uint16 _version) external override onlyRole(DEFAULT_ADMIN_ROLE) { layerZeroEndpoint.setSendVersion(_version); } function setReceiveVersion(uint16 _version) external override onlyRole(DEFAULT_ADMIN_ROLE) { layerZeroEndpoint.setReceiveVersion(_version); } function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyRole(DEFAULT_ADMIN_ROLE) { layerZeroEndpoint.forceResumeReceive(_srcChainId, _srcAddress); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol) // This file was procedurally generated from scripts/generate/templates/SafeCast.js. pragma solidity ^0.8.0; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. * * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing * all math on `uint256` and `int256` and then downcasting. */ library SafeCast { /** * @dev Returns the downcasted uint248 from uint256, reverting on * overflow (when the input is greater than largest uint248). * * Counterpart to Solidity's `uint248` operator. * * Requirements: * * - input must fit into 248 bits * * _Available since v4.7._ */ function toUint248(uint256 value) internal pure returns (uint248) { require(value <= type(uint248).max, "SafeCast: value doesn't fit in 248 bits"); return uint248(value); } /** * @dev Returns the downcasted uint240 from uint256, reverting on * overflow (when the input is greater than largest uint240). * * Counterpart to Solidity's `uint240` operator. * * Requirements: * * - input must fit into 240 bits * * _Available since v4.7._ */ function toUint240(uint256 value) internal pure returns (uint240) { require(value <= type(uint240).max, "SafeCast: value doesn't fit in 240 bits"); return uint240(value); } /** * @dev Returns the downcasted uint232 from uint256, reverting on * overflow (when the input is greater than largest uint232). * * Counterpart to Solidity's `uint232` operator. * * Requirements: * * - input must fit into 232 bits * * _Available since v4.7._ */ function toUint232(uint256 value) internal pure returns (uint232) { require(value <= type(uint232).max, "SafeCast: value doesn't fit in 232 bits"); return uint232(value); } /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits * * _Available since v4.2._ */ function toUint224(uint256 value) internal pure returns (uint224) { require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits"); return uint224(value); } /** * @dev Returns the downcasted uint216 from uint256, reverting on * overflow (when the input is greater than largest uint216). * * Counterpart to Solidity's `uint216` operator. * * Requirements: * * - input must fit into 216 bits * * _Available since v4.7._ */ function toUint216(uint256 value) internal pure returns (uint216) { require(value <= type(uint216).max, "SafeCast: value doesn't fit in 216 bits"); return uint216(value); } /** * @dev Returns the downcasted uint208 from uint256, reverting on * overflow (when the input is greater than largest uint208). * * Counterpart to Solidity's `uint208` operator. * * Requirements: * * - input must fit into 208 bits * * _Available since v4.7._ */ function toUint208(uint256 value) internal pure returns (uint208) { require(value <= type(uint208).max, "SafeCast: value doesn't fit in 208 bits"); return uint208(value); } /** * @dev Returns the downcasted uint200 from uint256, reverting on * overflow (when the input is greater than largest uint200). * * Counterpart to Solidity's `uint200` operator. * * Requirements: * * - input must fit into 200 bits * * _Available since v4.7._ */ function toUint200(uint256 value) internal pure returns (uint200) { require(value <= type(uint200).max, "SafeCast: value doesn't fit in 200 bits"); return uint200(value); } /** * @dev Returns the downcasted uint192 from uint256, reverting on * overflow (when the input is greater than largest uint192). * * Counterpart to Solidity's `uint192` operator. * * Requirements: * * - input must fit into 192 bits * * _Available since v4.7._ */ function toUint192(uint256 value) internal pure returns (uint192) { require(value <= type(uint192).max, "SafeCast: value doesn't fit in 192 bits"); return uint192(value); } /** * @dev Returns the downcasted uint184 from uint256, reverting on * overflow (when the input is greater than largest uint184). * * Counterpart to Solidity's `uint184` operator. * * Requirements: * * - input must fit into 184 bits * * _Available since v4.7._ */ function toUint184(uint256 value) internal pure returns (uint184) { require(value <= type(uint184).max, "SafeCast: value doesn't fit in 184 bits"); return uint184(value); } /** * @dev Returns the downcasted uint176 from uint256, reverting on * overflow (when the input is greater than largest uint176). * * Counterpart to Solidity's `uint176` operator. * * Requirements: * * - input must fit into 176 bits * * _Available since v4.7._ */ function toUint176(uint256 value) internal pure returns (uint176) { require(value <= type(uint176).max, "SafeCast: value doesn't fit in 176 bits"); return uint176(value); } /** * @dev Returns the downcasted uint168 from uint256, reverting on * overflow (when the input is greater than largest uint168). * * Counterpart to Solidity's `uint168` operator. * * Requirements: * * - input must fit into 168 bits * * _Available since v4.7._ */ function toUint168(uint256 value) internal pure returns (uint168) { require(value <= type(uint168).max, "SafeCast: value doesn't fit in 168 bits"); return uint168(value); } /** * @dev Returns the downcasted uint160 from uint256, reverting on * overflow (when the input is greater than largest uint160). * * Counterpart to Solidity's `uint160` operator. * * Requirements: * * - input must fit into 160 bits * * _Available since v4.7._ */ function toUint160(uint256 value) internal pure returns (uint160) { require(value <= type(uint160).max, "SafeCast: value doesn't fit in 160 bits"); return uint160(value); } /** * @dev Returns the downcasted uint152 from uint256, reverting on * overflow (when the input is greater than largest uint152). * * Counterpart to Solidity's `uint152` operator. * * Requirements: * * - input must fit into 152 bits * * _Available since v4.7._ */ function toUint152(uint256 value) internal pure returns (uint152) { require(value <= type(uint152).max, "SafeCast: value doesn't fit in 152 bits"); return uint152(value); } /** * @dev Returns the downcasted uint144 from uint256, reverting on * overflow (when the input is greater than largest uint144). * * Counterpart to Solidity's `uint144` operator. * * Requirements: * * - input must fit into 144 bits * * _Available since v4.7._ */ function toUint144(uint256 value) internal pure returns (uint144) { require(value <= type(uint144).max, "SafeCast: value doesn't fit in 144 bits"); return uint144(value); } /** * @dev Returns the downcasted uint136 from uint256, reverting on * overflow (when the input is greater than largest uint136). * * Counterpart to Solidity's `uint136` operator. * * Requirements: * * - input must fit into 136 bits * * _Available since v4.7._ */ function toUint136(uint256 value) internal pure returns (uint136) { require(value <= type(uint136).max, "SafeCast: value doesn't fit in 136 bits"); return uint136(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits * * _Available since v2.5._ */ function toUint128(uint256 value) internal pure returns (uint128) { require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits"); return uint128(value); } /** * @dev Returns the downcasted uint120 from uint256, reverting on * overflow (when the input is greater than largest uint120). * * Counterpart to Solidity's `uint120` operator. * * Requirements: * * - input must fit into 120 bits * * _Available since v4.7._ */ function toUint120(uint256 value) internal pure returns (uint120) { require(value <= type(uint120).max, "SafeCast: value doesn't fit in 120 bits"); return uint120(value); } /** * @dev Returns the downcasted uint112 from uint256, reverting on * overflow (when the input is greater than largest uint112). * * Counterpart to Solidity's `uint112` operator. * * Requirements: * * - input must fit into 112 bits * * _Available since v4.7._ */ function toUint112(uint256 value) internal pure returns (uint112) { require(value <= type(uint112).max, "SafeCast: value doesn't fit in 112 bits"); return uint112(value); } /** * @dev Returns the downcasted uint104 from uint256, reverting on * overflow (when the input is greater than largest uint104). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 104 bits * * _Available since v4.7._ */ function toUint104(uint256 value) internal pure returns (uint104) { require(value <= type(uint104).max, "SafeCast: value doesn't fit in 104 bits"); return uint104(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits * * _Available since v4.2._ */ function toUint96(uint256 value) internal pure returns (uint96) { require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits"); return uint96(value); } /** * @dev Returns the downcasted uint88 from uint256, reverting on * overflow (when the input is greater than largest uint88). * * Counterpart to Solidity's `uint88` operator. * * Requirements: * * - input must fit into 88 bits * * _Available since v4.7._ */ function toUint88(uint256 value) internal pure returns (uint88) { require(value <= type(uint88).max, "SafeCast: value doesn't fit in 88 bits"); return uint88(value); } /** * @dev Returns the downcasted uint80 from uint256, reverting on * overflow (when the input is greater than largest uint80). * * Counterpart to Solidity's `uint80` operator. * * Requirements: * * - input must fit into 80 bits * * _Available since v4.7._ */ function toUint80(uint256 value) internal pure returns (uint80) { require(value <= type(uint80).max, "SafeCast: value doesn't fit in 80 bits"); return uint80(value); } /** * @dev Returns the downcasted uint72 from uint256, reverting on * overflow (when the input is greater than largest uint72). * * Counterpart to Solidity's `uint72` operator. * * Requirements: * * - input must fit into 72 bits * * _Available since v4.7._ */ function toUint72(uint256 value) internal pure returns (uint72) { require(value <= type(uint72).max, "SafeCast: value doesn't fit in 72 bits"); return uint72(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits * * _Available since v2.5._ */ function toUint64(uint256 value) internal pure returns (uint64) { require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits"); return uint64(value); } /** * @dev Returns the downcasted uint56 from uint256, reverting on * overflow (when the input is greater than largest uint56). * * Counterpart to Solidity's `uint56` operator. * * Requirements: * * - input must fit into 56 bits * * _Available since v4.7._ */ function toUint56(uint256 value) internal pure returns (uint56) { require(value <= type(uint56).max, "SafeCast: value doesn't fit in 56 bits"); return uint56(value); } /** * @dev Returns the downcasted uint48 from uint256, reverting on * overflow (when the input is greater than largest uint48). * * Counterpart to Solidity's `uint48` operator. * * Requirements: * * - input must fit into 48 bits * * _Available since v4.7._ */ function toUint48(uint256 value) internal pure returns (uint48) { require(value <= type(uint48).max, "SafeCast: value doesn't fit in 48 bits"); return uint48(value); } /** * @dev Returns the downcasted uint40 from uint256, reverting on * overflow (when the input is greater than largest uint40). * * Counterpart to Solidity's `uint40` operator. * * Requirements: * * - input must fit into 40 bits * * _Available since v4.7._ */ function toUint40(uint256 value) internal pure returns (uint40) { require(value <= type(uint40).max, "SafeCast: value doesn't fit in 40 bits"); return uint40(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits * * _Available since v2.5._ */ function toUint32(uint256 value) internal pure returns (uint32) { require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits"); return uint32(value); } /** * @dev Returns the downcasted uint24 from uint256, reverting on * overflow (when the input is greater than largest uint24). * * Counterpart to Solidity's `uint24` operator. * * Requirements: * * - input must fit into 24 bits * * _Available since v4.7._ */ function toUint24(uint256 value) internal pure returns (uint24) { require(value <= type(uint24).max, "SafeCast: value doesn't fit in 24 bits"); return uint24(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits * * _Available since v2.5._ */ function toUint16(uint256 value) internal pure returns (uint16) { require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits"); return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits * * _Available since v2.5._ */ function toUint8(uint256 value) internal pure returns (uint8) { require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits"); return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. * * _Available since v3.0._ */ function toUint256(int256 value) internal pure returns (uint256) { require(value >= 0, "SafeCast: value must be positive"); return uint256(value); } /** * @dev Returns the downcasted int248 from int256, reverting on * overflow (when the input is less than smallest int248 or * greater than largest int248). * * Counterpart to Solidity's `int248` operator. * * Requirements: * * - input must fit into 248 bits * * _Available since v4.7._ */ function toInt248(int256 value) internal pure returns (int248 downcasted) { downcasted = int248(value); require(downcasted == value, "SafeCast: value doesn't fit in 248 bits"); } /** * @dev Returns the downcasted int240 from int256, reverting on * overflow (when the input is less than smallest int240 or * greater than largest int240). * * Counterpart to Solidity's `int240` operator. * * Requirements: * * - input must fit into 240 bits * * _Available since v4.7._ */ function toInt240(int256 value) internal pure returns (int240 downcasted) { downcasted = int240(value); require(downcasted == value, "SafeCast: value doesn't fit in 240 bits"); } /** * @dev Returns the downcasted int232 from int256, reverting on * overflow (when the input is less than smallest int232 or * greater than largest int232). * * Counterpart to Solidity's `int232` operator. * * Requirements: * * - input must fit into 232 bits * * _Available since v4.7._ */ function toInt232(int256 value) internal pure returns (int232 downcasted) { downcasted = int232(value); require(downcasted == value, "SafeCast: value doesn't fit in 232 bits"); } /** * @dev Returns the downcasted int224 from int256, reverting on * overflow (when the input is less than smallest int224 or * greater than largest int224). * * Counterpart to Solidity's `int224` operator. * * Requirements: * * - input must fit into 224 bits * * _Available since v4.7._ */ function toInt224(int256 value) internal pure returns (int224 downcasted) { downcasted = int224(value); require(downcasted == value, "SafeCast: value doesn't fit in 224 bits"); } /** * @dev Returns the downcasted int216 from int256, reverting on * overflow (when the input is less than smallest int216 or * greater than largest int216). * * Counterpart to Solidity's `int216` operator. * * Requirements: * * - input must fit into 216 bits * * _Available since v4.7._ */ function toInt216(int256 value) internal pure returns (int216 downcasted) { downcasted = int216(value); require(downcasted == value, "SafeCast: value doesn't fit in 216 bits"); } /** * @dev Returns the downcasted int208 from int256, reverting on * overflow (when the input is less than smallest int208 or * greater than largest int208). * * Counterpart to Solidity's `int208` operator. * * Requirements: * * - input must fit into 208 bits * * _Available since v4.7._ */ function toInt208(int256 value) internal pure returns (int208 downcasted) { downcasted = int208(value); require(downcasted == value, "SafeCast: value doesn't fit in 208 bits"); } /** * @dev Returns the downcasted int200 from int256, reverting on * overflow (when the input is less than smallest int200 or * greater than largest int200). * * Counterpart to Solidity's `int200` operator. * * Requirements: * * - input must fit into 200 bits * * _Available since v4.7._ */ function toInt200(int256 value) internal pure returns (int200 downcasted) { downcasted = int200(value); require(downcasted == value, "SafeCast: value doesn't fit in 200 bits"); } /** * @dev Returns the downcasted int192 from int256, reverting on * overflow (when the input is less than smallest int192 or * greater than largest int192). * * Counterpart to Solidity's `int192` operator. * * Requirements: * * - input must fit into 192 bits * * _Available since v4.7._ */ function toInt192(int256 value) internal pure returns (int192 downcasted) { downcasted = int192(value); require(downcasted == value, "SafeCast: value doesn't fit in 192 bits"); } /** * @dev Returns the downcasted int184 from int256, reverting on * overflow (when the input is less than smallest int184 or * greater than largest int184). * * Counterpart to Solidity's `int184` operator. * * Requirements: * * - input must fit into 184 bits * * _Available since v4.7._ */ function toInt184(int256 value) internal pure returns (int184 downcasted) { downcasted = int184(value); require(downcasted == value, "SafeCast: value doesn't fit in 184 bits"); } /** * @dev Returns the downcasted int176 from int256, reverting on * overflow (when the input is less than smallest int176 or * greater than largest int176). * * Counterpart to Solidity's `int176` operator. * * Requirements: * * - input must fit into 176 bits * * _Available since v4.7._ */ function toInt176(int256 value) internal pure returns (int176 downcasted) { downcasted = int176(value); require(downcasted == value, "SafeCast: value doesn't fit in 176 bits"); } /** * @dev Returns the downcasted int168 from int256, reverting on * overflow (when the input is less than smallest int168 or * greater than largest int168). * * Counterpart to Solidity's `int168` operator. * * Requirements: * * - input must fit into 168 bits * * _Available since v4.7._ */ function toInt168(int256 value) internal pure returns (int168 downcasted) { downcasted = int168(value); require(downcasted == value, "SafeCast: value doesn't fit in 168 bits"); } /** * @dev Returns the downcasted int160 from int256, reverting on * overflow (when the input is less than smallest int160 or * greater than largest int160). * * Counterpart to Solidity's `int160` operator. * * Requirements: * * - input must fit into 160 bits * * _Available since v4.7._ */ function toInt160(int256 value) internal pure returns (int160 downcasted) { downcasted = int160(value); require(downcasted == value, "SafeCast: value doesn't fit in 160 bits"); } /** * @dev Returns the downcasted int152 from int256, reverting on * overflow (when the input is less than smallest int152 or * greater than largest int152). * * Counterpart to Solidity's `int152` operator. * * Requirements: * * - input must fit into 152 bits * * _Available since v4.7._ */ function toInt152(int256 value) internal pure returns (int152 downcasted) { downcasted = int152(value); require(downcasted == value, "SafeCast: value doesn't fit in 152 bits"); } /** * @dev Returns the downcasted int144 from int256, reverting on * overflow (when the input is less than smallest int144 or * greater than largest int144). * * Counterpart to Solidity's `int144` operator. * * Requirements: * * - input must fit into 144 bits * * _Available since v4.7._ */ function toInt144(int256 value) internal pure returns (int144 downcasted) { downcasted = int144(value); require(downcasted == value, "SafeCast: value doesn't fit in 144 bits"); } /** * @dev Returns the downcasted int136 from int256, reverting on * overflow (when the input is less than smallest int136 or * greater than largest int136). * * Counterpart to Solidity's `int136` operator. * * Requirements: * * - input must fit into 136 bits * * _Available since v4.7._ */ function toInt136(int256 value) internal pure returns (int136 downcasted) { downcasted = int136(value); require(downcasted == value, "SafeCast: value doesn't fit in 136 bits"); } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits * * _Available since v3.1._ */ function toInt128(int256 value) internal pure returns (int128 downcasted) { downcasted = int128(value); require(downcasted == value, "SafeCast: value doesn't fit in 128 bits"); } /** * @dev Returns the downcasted int120 from int256, reverting on * overflow (when the input is less than smallest int120 or * greater than largest int120). * * Counterpart to Solidity's `int120` operator. * * Requirements: * * - input must fit into 120 bits * * _Available since v4.7._ */ function toInt120(int256 value) internal pure returns (int120 downcasted) { downcasted = int120(value); require(downcasted == value, "SafeCast: value doesn't fit in 120 bits"); } /** * @dev Returns the downcasted int112 from int256, reverting on * overflow (when the input is less than smallest int112 or * greater than largest int112). * * Counterpart to Solidity's `int112` operator. * * Requirements: * * - input must fit into 112 bits * * _Available since v4.7._ */ function toInt112(int256 value) internal pure returns (int112 downcasted) { downcasted = int112(value); require(downcasted == value, "SafeCast: value doesn't fit in 112 bits"); } /** * @dev Returns the downcasted int104 from int256, reverting on * overflow (when the input is less than smallest int104 or * greater than largest int104). * * Counterpart to Solidity's `int104` operator. * * Requirements: * * - input must fit into 104 bits * * _Available since v4.7._ */ function toInt104(int256 value) internal pure returns (int104 downcasted) { downcasted = int104(value); require(downcasted == value, "SafeCast: value doesn't fit in 104 bits"); } /** * @dev Returns the downcasted int96 from int256, reverting on * overflow (when the input is less than smallest int96 or * greater than largest int96). * * Counterpart to Solidity's `int96` operator. * * Requirements: * * - input must fit into 96 bits * * _Available since v4.7._ */ function toInt96(int256 value) internal pure returns (int96 downcasted) { downcasted = int96(value); require(downcasted == value, "SafeCast: value doesn't fit in 96 bits"); } /** * @dev Returns the downcasted int88 from int256, reverting on * overflow (when the input is less than smallest int88 or * greater than largest int88). * * Counterpart to Solidity's `int88` operator. * * Requirements: * * - input must fit into 88 bits * * _Available since v4.7._ */ function toInt88(int256 value) internal pure returns (int88 downcasted) { downcasted = int88(value); require(downcasted == value, "SafeCast: value doesn't fit in 88 bits"); } /** * @dev Returns the downcasted int80 from int256, reverting on * overflow (when the input is less than smallest int80 or * greater than largest int80). * * Counterpart to Solidity's `int80` operator. * * Requirements: * * - input must fit into 80 bits * * _Available since v4.7._ */ function toInt80(int256 value) internal pure returns (int80 downcasted) { downcasted = int80(value); require(downcasted == value, "SafeCast: value doesn't fit in 80 bits"); } /** * @dev Returns the downcasted int72 from int256, reverting on * overflow (when the input is less than smallest int72 or * greater than largest int72). * * Counterpart to Solidity's `int72` operator. * * Requirements: * * - input must fit into 72 bits * * _Available since v4.7._ */ function toInt72(int256 value) internal pure returns (int72 downcasted) { downcasted = int72(value); require(downcasted == value, "SafeCast: value doesn't fit in 72 bits"); } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits * * _Available since v3.1._ */ function toInt64(int256 value) internal pure returns (int64 downcasted) { downcasted = int64(value); require(downcasted == value, "SafeCast: value doesn't fit in 64 bits"); } /** * @dev Returns the downcasted int56 from int256, reverting on * overflow (when the input is less than smallest int56 or * greater than largest int56). * * Counterpart to Solidity's `int56` operator. * * Requirements: * * - input must fit into 56 bits * * _Available since v4.7._ */ function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); require(downcasted == value, "SafeCast: value doesn't fit in 56 bits"); } /** * @dev Returns the downcasted int48 from int256, reverting on * overflow (when the input is less than smallest int48 or * greater than largest int48). * * Counterpart to Solidity's `int48` operator. * * Requirements: * * - input must fit into 48 bits * * _Available since v4.7._ */ function toInt48(int256 value) internal pure returns (int48 downcasted) { downcasted = int48(value); require(downcasted == value, "SafeCast: value doesn't fit in 48 bits"); } /** * @dev Returns the downcasted int40 from int256, reverting on * overflow (when the input is less than smallest int40 or * greater than largest int40). * * Counterpart to Solidity's `int40` operator. * * Requirements: * * - input must fit into 40 bits * * _Available since v4.7._ */ function toInt40(int256 value) internal pure returns (int40 downcasted) { downcasted = int40(value); require(downcasted == value, "SafeCast: value doesn't fit in 40 bits"); } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits * * _Available since v3.1._ */ function toInt32(int256 value) internal pure returns (int32 downcasted) { downcasted = int32(value); require(downcasted == value, "SafeCast: value doesn't fit in 32 bits"); } /** * @dev Returns the downcasted int24 from int256, reverting on * overflow (when the input is less than smallest int24 or * greater than largest int24). * * Counterpart to Solidity's `int24` operator. * * Requirements: * * - input must fit into 24 bits * * _Available since v4.7._ */ function toInt24(int256 value) internal pure returns (int24 downcasted) { downcasted = int24(value); require(downcasted == value, "SafeCast: value doesn't fit in 24 bits"); } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits * * _Available since v3.1._ */ function toInt16(int256 value) internal pure returns (int16 downcasted) { downcasted = int16(value); require(downcasted == value, "SafeCast: value doesn't fit in 16 bits"); } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits * * _Available since v3.1._ */ function toInt8(int256 value) internal pure returns (int8 downcasted) { downcasted = int8(value); require(downcasted == value, "SafeCast: value doesn't fit in 8 bits"); } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. * * _Available since v3.0._ */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256"); return int256(value); } }
// SPDX-License-Identifier: BUSL-1.1 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 receiver 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: BUSL-1.1 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: BUSL-1.1 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 // OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerable.sol"; import "./AccessControl.sol"; import "../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./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); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with 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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; interface IPool { function token() external view returns (address); function convertRate() external view returns (uint256); }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; struct LotteryParams { string token; uint256 bucketSize; uint256 openTimestamp; uint256 closeTimestamp; uint256 maturityTimestamp; IERC20 collateralToken; } struct Lottery { LotteryParams params; uint256 firstBucketLowerBound; /// @dev Ticket price for each bucket starting from firstBucketLowerBound. uint256[] bucketTicketPrices; /// @dev The minimum ticket price, taken as the min of the first and last bucket ticket prices. uint256 minimumTicketPrice; /// @dev Tickets sold for each bucket. /// /// Mapping (bucket lower bound) => (no. of tickets sold) mapping(uint256 => uint256) ticketsSoldCounts; bool isResolved; uint256 winningBucketLowerBound; uint256 proceeds; } /// @dev Contains the non-mapping state from a lottery. struct LotteryData { LotteryParams params; uint256 firstBucketLowerBound; uint256[] bucketTicketPrices; uint256 minimumTicketPrice; bool isResolved; uint256 winningBucketLowerBound; uint256 proceeds; } interface IProphet { event LotteryCreated ( uint256 indexed lotteryId, LotteryParams params ); event SetLotteryPrices( uint256 indexed lotteryId, uint256 firstBucketLowerBound, uint256 minimumTicketPrice, uint256[] bucketTicketPrices ); event BoughtTickets( uint256 indexed lotteryId, address indexed buyer, uint256 bucketLowerBound, uint256 ticketsBought, uint256 ticketsCost ); event LotteryResolved( uint256 indexed lotteryId, uint256 resolvedPrice, uint256 winningBucketLowerBound ); event Claimed( uint256 indexed lotteryId, address indexed claimer ); event TransferProceeds( uint256 indexed lotteryId, uint256 indexed newLotteryId ); event AddProceeds( uint256 indexed lotteryId, uint256 amount ); event FeeRateChanged( uint256 newFeeRate ); event FeeWithdrawn( address indexed recipient, uint256 amount ); event Refund( address indexed user, address token, uint256 amount, bool claimed ); event SetTrustedRemote( uint16 remoteChainId, bytes path ); }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; interface IProphetPriceFeed { function getHistoricalPrice( string calldata token, uint256 queryTimestamp ) external view returns (uint256); function getPrice( string calldata token ) external view returns (uint256); }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; interface IProphetTicketManager { function ticketBalanceOf( address account, uint256 lotteryId, uint128 bucketLowerBound ) external view returns (uint256); function mintTickets( address to, uint256 lotteryId, uint128 bucketLowerBound, uint256 count, bytes memory data ) external; function burnTickets( address from, uint256 lotteryId, uint128 bucketLowerBound, uint256 count ) external; function generateTicketId( uint256 lotteryId, uint128 bucketLowerBound ) external pure returns (uint256); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; interface IStargateFactory { function allPoolsLength() external view returns (uint256); function allPools(uint256 index) external view returns (address); function getPool(uint256 poolId) external view returns (address); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; interface IStargateReceiver { function sgReceive( uint16 _srcChainId, // the remote chainId sending the tokens bytes memory _srcAddress, // the remote Bridge address uint256 _nonce, address _token, // the token contract on the local chain uint256 amountLD, // the qty of local _token contract tokens bytes memory payload ) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; pragma abicoder v2; interface IStargateRouter { struct lzTxObj { uint256 dstGasForCall; uint256 dstNativeAmount; bytes dstNativeAddr; } function addLiquidity( uint256 _poolId, uint256 _amountLD, address _to ) external; function swap( uint16 _dstChainId, uint256 _srcPoolId, uint256 _dstPoolId, address payable _refundAddress, uint256 _amountLD, uint256 _minAmountLD, lzTxObj memory _lzTxParams, bytes calldata _to, bytes calldata _payload ) external payable; function redeemRemote( uint16 _dstChainId, uint256 _srcPoolId, uint256 _dstPoolId, address payable _refundAddress, uint256 _amountLP, uint256 _minAmountLD, bytes calldata _to, lzTxObj memory _lzTxParams ) external payable; function instantRedeemLocal( uint16 _srcPoolId, uint256 _amountLP, address _to ) external returns (uint256); function redeemLocal( uint16 _dstChainId, uint256 _srcPoolId, uint256 _dstPoolId, address payable _refundAddress, uint256 _amountLP, bytes calldata _to, lzTxObj memory _lzTxParams ) external payable; function sendCredits( uint16 _dstChainId, uint256 _srcPoolId, uint256 _dstPoolId, address payable _refundAddress ) external payable; function quoteLayerZeroFee( uint16 _dstChainId, uint8 _functionType, bytes calldata _toAddress, bytes calldata _transferAndCallPayload, lzTxObj memory _lzTxParams ) external view returns (uint256, uint256); }
// StargateStruct.sol pragma solidity ^0.8.0; import {IStargateRouter} from "../interfaces/IStargateRouter.sol"; import {IStargateFactory} from "../interfaces/IStargateFactory.sol"; // Define a simple struct struct StargateStruct { IStargateRouter STARGATE_COMPOSER; IStargateRouter STARGATE_RELAYER; IStargateFactory STARGATE_FACTORY; }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.19; import { AccessControlEnumerable } from "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol"; import { IAccessControl } from "@openzeppelin/contracts/access/IAccessControl.sol"; /** * @title AccessControlAdminProtection * @notice AccessControl with additional protections to mitigate the chance of having no admin. */ abstract contract AccessControlAdminProtection is AccessControlEnumerable { function revokeRole( bytes32 role, address account ) public virtual override(AccessControl, IAccessControl) { if (role == DEFAULT_ADMIN_ROLE) { require( getRoleMemberCount(DEFAULT_ADMIN_ROLE) > 1, "cannot revoke last admin" ); } super.revokeRole(role, account); } function renounceRole( bytes32 role, address account ) public virtual override(AccessControl, IAccessControl) { if (role == DEFAULT_ADMIN_ROLE) { require( getRoleMemberCount(DEFAULT_ADMIN_ROLE) > 1, "last admin cannot renounce" ); } super.renounceRole(role, account); } }
{ "evmVersion": "paris", "libraries": {}, "metadata": { "appendCBOR": true, "bytecodeHash": "ipfs", "useLiteralContent": false }, "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "remappings": [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "@LayerZero/contracts/=lib/LayerZero/contracts/", "@solidity-bytes-utils/contracts/=lib/solidity-bytes-utils/contracts/", "forge-std/=lib/forge-std/src/", "LayerZero/=lib/LayerZero/contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "openzeppelin/=lib/openzeppelin-contracts/contracts/", "solidity-bytes-utils/=lib/solidity-bytes-utils/contracts/", "solidity-examples/=lib/solidity-examples/contracts/" ], "viaIR": true }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IProphetPriceFeed","name":"_prophetPriceFeed","type":"address"},{"components":[{"internalType":"contract IStargateRouter","name":"STARGATE_COMPOSER","type":"address"},{"internalType":"contract IStargateRouter","name":"STARGATE_RELAYER","type":"address"},{"internalType":"contract IStargateFactory","name":"STARGATE_FACTORY","type":"address"}],"internalType":"struct StargateStruct","name":"_stargateStruct","type":"tuple"},{"internalType":"contract ILayerZeroEndpoint","name":"_layerZeroEndpoint","type":"address"},{"internalType":"address","name":"_admin","type":"address"},{"internalType":"contract IProphetTicketManager","name":"_prophetTicketManager","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"lotteryId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AddProceeds","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"lotteryId","type":"uint256"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"bucketLowerBound","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ticketsBought","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ticketsCost","type":"uint256"}],"name":"BoughtTickets","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"lotteryId","type":"uint256"},{"indexed":true,"internalType":"address","name":"claimer","type":"address"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newFeeRate","type":"uint256"}],"name":"FeeRateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeeWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"lotteryId","type":"uint256"},{"components":[{"internalType":"string","name":"token","type":"string"},{"internalType":"uint256","name":"bucketSize","type":"uint256"},{"internalType":"uint256","name":"openTimestamp","type":"uint256"},{"internalType":"uint256","name":"closeTimestamp","type":"uint256"},{"internalType":"uint256","name":"maturityTimestamp","type":"uint256"},{"internalType":"contract IERC20","name":"collateralToken","type":"address"}],"indexed":false,"internalType":"struct LotteryParams","name":"params","type":"tuple"}],"name":"LotteryCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"lotteryId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"resolvedPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"winningBucketLowerBound","type":"uint256"}],"name":"LotteryResolved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"claimed","type":"bool"}],"name":"Refund","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"lotteryId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"firstBucketLowerBound","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minimumTicketPrice","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"bucketTicketPrices","type":"uint256[]"}],"name":"SetLotteryPrices","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":true,"internalType":"uint256","name":"lotteryId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newLotteryId","type":"uint256"}],"name":"TransferProceeds","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_RECIPIENT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LOTTERY_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_FEE_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ProphetTicketManager","outputs":[{"internalType":"contract IProphetTicketManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"_FEE_COLLECTED_","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_FEE_RATE_","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_LAST_LOTTERY_ID_","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_POOL_ID_TO_INFO_","outputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"poolAddress","type":"address"},{"internalType":"uint256","name":"convertRate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"_USER_REFUND_AMOUNT_","outputs":[{"internalType":"uint256","name":"refundAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lotteryId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"addProceeds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lotteryId","type":"uint256"},{"internalType":"uint128[]","name":"_multiBucketLowerBound","type":"uint128[]"},{"internalType":"uint256[]","name":"_multiBuyTicketCount","type":"uint256[]"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"buyMultipleTickets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lotteryId","type":"uint256"},{"internalType":"uint128","name":"_bucketLowerBound","type":"uint128"},{"internalType":"uint256","name":"_buyTicketCount","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"buyTickets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lotteryId","type":"uint256"},{"internalType":"uint128","name":"_bucketLowerBound","type":"uint128"},{"internalType":"uint256","name":"_buyTicketCount","type":"uint256"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"_srcPoolId","type":"uint256"},{"internalType":"uint256","name":"_dstPoolId","type":"uint256"},{"internalType":"uint256","name":"_amountLD","type":"uint256"},{"internalType":"uint256","name":"_minAmountLD","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"buyTicketsCrossChain","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_lotteryIds","type":"uint256[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lotteryId","type":"uint256"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"_srcPoolId","type":"uint256"},{"internalType":"uint256","name":"_dstPoolId","type":"uint256"},{"internalType":"uint256","name":"_dstChainGas","type":"uint256"}],"name":"claimOnChain","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"token","type":"string"},{"internalType":"uint256","name":"bucketSize","type":"uint256"},{"internalType":"uint256","name":"openTimestamp","type":"uint256"},{"internalType":"uint256","name":"closeTimestamp","type":"uint256"},{"internalType":"uint256","name":"maturityTimestamp","type":"uint256"},{"internalType":"contract IERC20","name":"collateralToken","type":"address"}],"internalType":"struct LotteryParams","name":"_lotteryParams","type":"tuple"}],"name":"createLottery","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"chainId","type":"uint16"}],"name":"dstGasReserve","outputs":[{"internalType":"uint256","name":"gas","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lotteryId","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"extractNative","outputs":[],"stateMutability":"nonpayable","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":"chainId","type":"uint16"}],"name":"fundBridgeFee","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lotteryId","type":"uint256"}],"name":"getLottery","outputs":[{"components":[{"components":[{"internalType":"string","name":"token","type":"string"},{"internalType":"uint256","name":"bucketSize","type":"uint256"},{"internalType":"uint256","name":"openTimestamp","type":"uint256"},{"internalType":"uint256","name":"closeTimestamp","type":"uint256"},{"internalType":"uint256","name":"maturityTimestamp","type":"uint256"},{"internalType":"contract IERC20","name":"collateralToken","type":"address"}],"internalType":"struct LotteryParams","name":"params","type":"tuple"},{"internalType":"uint256","name":"firstBucketLowerBound","type":"uint256"},{"internalType":"uint256[]","name":"bucketTicketPrices","type":"uint256[]"},{"internalType":"uint256","name":"minimumTicketPrice","type":"uint256"},{"internalType":"bool","name":"isResolved","type":"bool"},{"internalType":"uint256","name":"winningBucketLowerBound","type":"uint256"},{"internalType":"uint256","name":"proceeds","type":"uint256"}],"internalType":"struct LotteryData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"}],"name":"getPoolInfo","outputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"poolAddress","type":"address"},{"internalType":"uint256","name":"convertRate","type":"uint256"}],"internalType":"struct Prophet.PoolInfo","name":"poolInfo","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lotteryId","type":"uint256"},{"internalType":"uint256","name":"_bucketLowerBound","type":"uint256"}],"name":"getTicketsSoldCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"interchainTransactionFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"layerZeroEndpoint","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":"","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prophetPriceFeed","outputs":[{"internalType":"contract IProphetPriceFeed","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lotteryId","type":"uint256"},{"internalType":"uint128","name":"_bucketLowerBound","type":"uint128"},{"internalType":"uint256","name":"_buyTicketCount","type":"uint256"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"_dstGasForCall","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"quoteInterChainBuyFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lotteryId","type":"uint256"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"_srcPoolId","type":"uint256"},{"internalType":"uint256","name":"_dstPoolId","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_dstChainGas","type":"uint256"}],"name":"quoteInterChainClaimFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lotteryId","type":"uint256"}],"name":"resolveLottery","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","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":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_dstGasReserve","type":"uint256"}],"name":"setDstGasReserve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeRate","type":"uint256"}],"name":"setFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_fundBridgeFee","type":"uint256"}],"name":"setFundBridgeFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lotteryId","type":"uint256"},{"internalType":"uint256","name":"_firstBucketLowerBound","type":"uint256"},{"internalType":"uint256[]","name":"_bucketTicketPrices","type":"uint256[]"}],"name":"setLotteryTicketsPrice","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":"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":"uint16","name":"","type":"uint16"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amountLD","type":"uint256"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"sgReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stargateStruct","outputs":[{"internalType":"contract IStargateRouter","name":"STARGATE_COMPOSER","type":"address"},{"internalType":"contract IStargateRouter","name":"STARGATE_RELAYER","type":"address"},{"internalType":"contract IStargateFactory","name":"STARGATE_FACTORY","type":"address"}],"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":"_prevLotteryId","type":"uint256"},{"internalType":"uint256","name":"_forwardLotteryId","type":"uint256"}],"name":"transferProceeds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"chainId","type":"uint16"}],"name":"trustedRemoteLookup","outputs":[{"internalType":"bytes","name":"trustedRemote","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpauseContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60e0346200026257601f196200543738819003601f810183168401936001600160401b039390929091838610858711176200026757808492604097885283398101039260e0841262000262578251936001600160a01b03928386168603620002625760609101126200026257845190606082019081118282101762000267578552602093620000908585016200027d565b82526200009f8685016200027d565b948083019586526060850151918483168303620002625787840192835260808601518581168103620002625760a087015196868816809803620002625760c0015190868216820362000262576200019b9887600396818d9a60009a60018c5560ff199889600154166001558c60085560805251169360018060a01b0319948560045416176004555116836005541617600555511690600654161760065560a05260c0527fdd72d2879718489eb363ba6099239f89d49542612862c71545503d35cfddda4682620186a0806009558751908152a183805260028252848420868552825260ff85852054161562000219575b50828052522062000292565b505161511790816200032082396080518181816102d30152614844015260a0518181816103f901528181610d9f015281816113e3015281816121df0152818161257701528181612686015281816127060152612bac015260c051818181610c8101528181611b8401528181612c7801528181614111015261438c0152f35b8380526002825284842086855282526001858520918254161790553385847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4386200018f565b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036200026257565b91906001830160009082825280602052604082205415600014620003195784549468010000000000000000861015620003055760018601808255861015620002f157836040949596828552602085200155549382526020522055600190565b634e487b7160e01b83526032600452602483fd5b634e487b7160e01b83526041600452602483fd5b5092505056fe6080604052600436101561002a575b361561001957600080fd5b61002534600854613797565b600855005b6000803560e01c80621d356714612b3f5780630162fe26146127f057806301ffc9a71461276d57806303c3d4831461273557806307968db1146126f057806307e0db17146126625780630bc1bcb114612627578063105b024f146125f45780631078d4a4146125d657806310ddb1371461255257806312ccf19a146125225780631cd3f85b146124e95780631fdabd43146124bc578063248a9ca31461248f5780632f2ff15d146123ca5780632f380b351461237c57806336568abe14612289578063391904a41461223257806342d65a8d146121c2578063439766ce1461215c57806345596e2e146120b55780634f558e791461208c57806351c24d8f14611dc35780635c975abb14611da05780636ba4c13814611b375780636c89b802146119d75780637533d7881461198b57806377fe962d14611928578063789abd1e146118275780639010d07c146117e157806391d148541461179557806392e845f61461153c57806392f6576e1461151d5780639a3ebfee146112f35780639adfab33146112d5578063a1eaacad146112a5578063a217fddf14611289578063a6c3d16514611160578063a786c3b71461112d578063ab8236f31461102c578063b33712c514610f8b578063b7c1d57c14610f3c578063bd2e6ca314610f1e578063beef236914610ede578063c2b3c7fc14610e6e578063ca15c87314610e44578063cbed8b9c14610d51578063d547741f14610cb0578063d74cb2f714610c6b578063dd89d4c714610c2e578063e55dc4e614610ac9578063e62003f8146106cc578063e63a391f146106ad578063e82748ca14610672578063eb8d72b714610517578063f00acbaa146104dc578063f4343e5d14610491578063fc39b54f146103055763fc9ed84f146102be575061000e565b346103025780600319360112610302576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b80fd5b50346103025760031960c03682011261048d57610320612fb3565b6001600160a01b0391608435918383168303610488576103a09361ffff6103e0926103f56040956103ae875198600160f01b60208b015260a43560228b015260228a5261036c8a613166565b88516001600160a01b039091166020820152600435604082015260443560608201526064356080820152998a9060a0820190565b03601f1981018b528a6131d2565b86519788968795869563040a7bb160e41b8752169a8b600487015230602487015260a0604487015260a48601906132bc565b918b60648601528483030160848501526132bc565b03917f0000000000000000000000000000000000000000000000000000000000000000165afa90811561047d57908361044493926020959261044c575b50604091928152600e85522054613797565b604051908152f35b6040925061046f90833d8511610476575b61046781836131d2565b810190613fb4565b5091610432565b503d61045d565b6040513d85823e3d90fd5b600080fd5b5080fd5b5034610302576080366003190112610302576104d56104ae613087565b6104b6613033565b906104bf6139aa565b6104c7613966565b339060443590600435614028565b6001815580f35b503461030257806003193601126103025760206040517f04824fcb60e7cc526d70b264caa65b62ed44d9c8e5d230e8ff6b0c7373843b8a8152f35b50346103025761052636613049565b929161053061353f565b61ffff8116835260206010815260408420906001600160401b03861161065e576105648661055e84546130cd565b84613a63565b8490601f87116001146105d35750946105c2918186977ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab97916105c8575b508260011b906000198460031b1c19161790555b60405193849384613e71565b0390a180f35b9050850135386105a2565b90601f1987168387528287209287905b828210610646575050916105c29391887ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab9899941061062c575b5050600182811b0190556105b6565b860135600019600385901b60f8161c19169055388061061d565b80600185968294968b013581550195019301906105e3565b634e487b7160e01b85526041600452602485fd5b503461030257806003193601126103025760206040517fb6edeab710812f8917b946c63c63b900f456e6a1abea66a90b1f8277f035664b8152f35b503461030257806003193601126103025760206040516305f5e1008152f35b503461030257606036600319011261030257600435602480356001600160401b03604435818111610ac55761070590369060040161309d565b9390916107106139aa565b610718613966565b3360009081527f8961fde0fd1ff6d64501170d4a03ba8833245a768b7e71bc72d058bc597cb4bb60209081526040909120549092907f04824fcb60e7cc526d70b264caa65b62ed44d9c8e5d230e8ff6b0c7373843b8a9060ff16156108f9575061078187614b52565b9186156108c25761079760038401544210613ac9565b856006840155600783019087116108af57600160401b87116108af578054878255808810610895575b50885282882084895b888110610883575050843591600019880191508782116108715750906107f460089493928887613b06565b358082101561086757509283915b01556040519384528301526060604083015282606083015260018060fb1b03831161086357816080917f53060a781c837d1ce0355372341dff9f556d20eb84c77d0c0cf70eae190f09b89460051b8091848401378101030190a26001815580f35b8480fd5b9050928391610802565b634e487b7160e01b8a52601160045289fd5b813583820155908501906001016107c9565b818a52848a206108a9918101908901613a4c565b386107c0565b50634e487b7160e01b8852604160045287fd5b60405162461bcd60e51b8152600481018590526010818401526f195b5c1d1e481c1c9a58d9481b1a5cdd60821b6044820152606490fd5b8390610904336137cb565b90604051610911816131b7565b60428152838101916060368437815115610ab057603083538151600190811015610a9b57607860218401536041905b808211610a2d5750506109eb5760486109e7936109bc936109cb9360405195869376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a860152610993815180928c603789019101613299565b8401917001034b99036b4b9b9b4b733903937b6329607d1b603784015251809386840190613299565b010360288101845201826131d2565b60405193849362461bcd60e51b855260048501528301906132bc565b0390fd5b606485856040519162461bcd60e51b83528160048401528201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f81166010811015610a86576f181899199a1a9b1b9c1cb0b131b232b360811b901a610a5c84866137a4565b5360041c918015610a71576000190190610940565b87634e487b7160e01b60005260116004526000fd5b88634e487b7160e01b60005260326004526000fd5b86634e487b7160e01b60005260326004526000fd5b85634e487b7160e01b60005260326004526000fd5b8580fd5b503461030257606036600319011261030257610ae3613007565b610aeb61301d565b90604435610af76139aa565b610aff613966565b610b07613351565b7fb6edeab710812f8917b946c63c63b900f456e6a1abea66a90b1f8277f035664b845260209160028352604085209360018060a01b038083169586600052855260ff6040600020541615610bf5578116808752600c855260408720548411610bbd57928092610baf927f78473f3f373f7673597f4f0fa5873cb4d375fea6d4339ad6b56dbd411513cb3f96958952600c865260408920610ba8848254613a00565b9055613caa565b604051908152a26001815580f35b60405162461bcd60e51b815260048101869052601060248201526f616d6f756e7420746f6f206c6172676560801b6044820152606490fd5b60405162461bcd60e51b8152600481018690526011602482015270125b9d985b1a59081c9958da5c1a595b9d607a1b6044820152606490fd5b5034610302578060031936011261030257606060018060a01b03806004541690806005541690600654169060405192835260208301526040820152f35b50346103025780600319360112610302576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b503461030257604036600319011261030257600435610ccd61301d565b8115610cf8575b81610cf59284526002602052610cf06001604086200154613663565b614f68565b80f35b82805260036020526001604084205411610cd45760405162461bcd60e51b815260206004820152601860248201527f63616e6e6f74207265766f6b65206c6173742061646d696e00000000000000006044820152606490fd5b50346103025760803660031901126103025780610d6c612f91565b610d74612fb3565b6064356001600160401b038111610e3f57610d93903690600401612fc4565b9092610d9d61353f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690813b15610ac557858094610e13604051978896879586946332fb62e760e21b865261ffff80921660048701521660248501526044356044850152608060648501526084840191613aa8565b03925af18015610e3457610e245750f35b610e2d90613107565b6103025780f35b6040513d84823e3d90fd5b505050fd5b50346103025760203660031901126103025760406020916004358152600383522054604051908152f35b50346103025760207fae4c931479f884f2e585f0c898f9d3630f545a6f7891f3fefdd33b3f1f547641610ea036612ff1565b610eab9391936139aa565b610eb3613966565b610ebb613351565b610baf81610ec886614b52565b610ed760038201544210613ac9565b3390614996565b50346103025760403660031901126103025761ffff610efb612f91565b610f03613966565b610f0b61353f565b1681526007602052602435604082205580f35b50346103025780600319360112610302576020600954604051908152f35b503461030257604036600319011261030257610f56613007565b6040610f6061301d565b9260018060a01b038093168152600f6020522091166000526020526020604060002054604051908152f35b5034610302578060031936011261030257610fa46139aa565b610fac61353f565b60015460ff811615610ff05760ff19166001557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16001815580f35b60405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606490fd5b50346103025760c036600319011261030257611046612f91565b506001600160401b0360243581811161112957611067903690600401613333565b50611070613033565b9060a43590811161112957611089903690600401613333565b6004546001600160a01b039290831633036110ec576080828051810103126110e85760208201519283168093036110e8576040820151926060830151936001600160801b0385168503610ac557610cf594608060843595015191614246565b8380fd5b60405162461bcd60e51b815260206004820152601560248201527439ba30b933b0ba329d1037b7363c903937baba32b960591b6044820152606490fd5b8280fd5b503461030257602036600319011261030257604060209161ffff61114f612f91565b168152600783522054604051908152f35b50346103025761ffff9061117336613049565b93909161117e61353f565b6111a860346040518781986020978884013781013060601b878201520360148101885201866131d2565b1682526010815260408220908351906001600160401b038211611275576111d9826111d385546130cd565b85613a63565b80601f83116001146112135750839482939492611208575b50508160011b916000199060031b1c191617905580f35b0151905038806111f1565b90601f198316958486528286209286905b88821061125d57505083600195969710611244575b505050811b01905580f35b015160001960f88460031b161c19169055388080611239565b80600185968294968601518155019501930190611224565b634e487b7160e01b84526041600452602484fd5b5034610302578060031936011261030257602090604051908152f35b50346103025760406020916112c560096112be36612ff1565b9290614b52565b0190825283522054604051908152f35b50346103025780600319360112610302576020600a54604051908152f35b506003199060a0368301126103025761130a612fb3565b61ffff608435916113196139aa565b611321613966565b1690818352602093600e855260408420543411156114e657828452600e85526113506040852054600854613797565b60085582845260078552604084205482106114ad5783948385526010815261137a604086206131f3565b60405193600160f01b8386015260228501526022845261139984613166565b6040805133848201908152600435602082015260443592810192909252606435606083015295906113d89087906080015b03601f1981018852876131d2565b600e60018060a01b037f0000000000000000000000000000000000000000000000000000000000000000169382895252611416604088205434613a00565b90833b156114a95761147e6114539589976114636040519a8b998a98899762c5803160e81b8952600489015260c0602489015260c48801906132bc565b90848783030160448801526132bc565b913360648601528960848601528483030160a48501526132bc565b03925af18015610e3457611495575b506001905580f35b61149e90613107565b61030257803861148d565b8780fd5b60405162461bcd60e51b81526004810186905260116024820152706e6f7420656e6f7567682064737467617360781b6044820152606490fd5b60405162461bcd60e51b815260048101869052600f60248201526e6e6f7420656e6f756768206665657360881b6044820152606490fd5b503461030257806003193601126103025760206040516301312d008152f35b5034610302576020366003190112610302578060c060405161155d81613130565b6040516115698161314b565b606081528360208201528360408201528360608201528360808201528360a08201528152826020820152606060408201528260608201528260808201528260a082015201526115b9600435614b52565b90600682015491600881015460ff600a83015416600b830154916007600c85015494604051976115e889613130565b6040516115f48161314b565b60405161160c816116058187613efe565b03826131d2565b81526001830154602082015260028301546040820152600383015460608201526004830154608082015260018060a01b0360058401541660a0820152895260208901526040519081928391016020815493848152019089526020892092895b81811061177c575050611680925003826131d2565b604087015260608601521515608085015260a084015260c0830152604051906020825282519060e060208401526116c5825160c06101008601526101c08501906132bc565b602080840151610120860152604080850151610140870152606080860151610160880152608086015161018088015260a0909501516001600160a01b03166101a08701528682015181870152860151858303601f19019486019490945283518083529181019301915b8181106117665750505060c08360608495015160808501526080810151151560a085015260a081015182850152015160e08301520390f35b825184526020938401939092019160010161172e565b845483526001948501948694506020909301920161166b565b50346103025760403660031901126103025760406117b161301d565b9160043581526002602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b50346103025760403660031901126103025761180e602091600435815260038352604060243591206138c9565b905460405160039290921b1c6001600160a01b03168152f35b5034610302576080366003190112610302576004356001600160401b036024358181116110e85761185c90369060040161309d565b9290916044359081116108635761187790369060040161309d565b611882929192613033565b9461188b6139aa565b611893613966565b8181036118f357865b8181106118ab57876001815580f35b6118b6818388613b06565b35906001600160801b03821682036118ef576118e5886118ea9333906118dd85898c613b06565b359089614028565b613a3d565b61189c565b8880fd5b60405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b6044820152606490fd5b5034610302576020366003190112610302578060043561194661353f565b8015611982575b6008549081811161197e5782816119678294938394613a00565b600855335af1611975613a0d565b50156103025780f35b5050fd5b5060085461194d565b5034610302576020366003190112610302576119bf60406119d39261ffff6119b1612f91565b1681526010602052206131f3565b6040519182916020835260208301906132bc565b0390f35b5034610302576003199060c036830112610302576119f3613087565b6119fb612fa2565b9260a435906001600160a01b03808316830361048857611acb95611aea6113ca9361ffff93611a3c6040988951978891604435906004358c60208601613e8c565b611adb611a47613f93565b91611a556084358451613797565b83528951986001600160601b03199060601b169889602082015260148152611a7c8161319c565b8a840152600454169689519860208a015260148952611a9a8961319c565b89519b8c998a988998630a51236960e01b8a521660048901526001602489015260a0604489015260a48801906132bc565b90848783030160648801526132bc565b91848303016084850152613fca565b03915afa8015611b2a576040928291611b0b575b5082519182526020820152f35b9050611b249150823d84116104765761046781836131d2565b38611afe565b50604051903d90823e3d90fd5b50346103025760208060031936011261048d576004356001600160401b03811161112957611b6990369060040161309d565b91611b726139aa565b611b7a613966565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811693855b818110611bb757866001815580f35b611bc2818387613b06565b35611bcc81614b52565b60ff600a8201541615611d92575b600b810154906001600160801b03808311611d3d5790829160649594931691888b604051978880926383b672fd60e01b82523360048301528860248301528760448301525afa958615611d0057600096611d0c575b50611c5890611c42600c8401548861376e565b90600052600983018a5260406000205490614008565b9081611c6d575b505050506001915001611ba8565b90611c7f918860053392015416613caa565b883b156104885760405163f0692d0d60e01b81529360009185918291611cab9190863360048601613e8c565b0381838c5af1928315611d0057600193611cf1575b5033907f6aa3eac93d079e5e100b1029be716caa33586c96aa4baac390669fb5c2a21212600080a338808080611c5f565b611cfa90613107565b38611cc0565b6040513d6000823e3d90fd5b90958982813d8311611d36575b611d2381836131d2565b8101031261030257505194611c58611c2f565b503d611d19565b60405162461bcd60e51b815260048101899052602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608490fd5b611d9b826147de565b611bda565b5034610302578060031936011261030257602060ff600154166040519015158152f35b50600319610120368201811361112957611ddb613087565b91611de4612fa2565b6101049390916001600160a01b039190853590838216820361048857611e086139aa565b611e10613966565b6084359284611e1e85614be8565b511697611e3260c435809a30903390613eba565b60405191611e5e83611e506020936044359060043533878601613e8c565b03601f1981018552846131d2565b89976040611e6b88614be8565b01805160009c6001821161206b575b505050604051956001600160601b03199060601b1697888388015260148752611ea28761319c565b61ffff611ead613f93565b9216808d52600784526040808e20548452830197909752845115611fb35760045416976040519283015260148252611ee48261319c565b873b15611faf5791611f57611f659492611f478d9b9a999897956040519d8e9c8d9b8c9b6327efc43f60e21b8d5260048d015260248c015260a43560448c01523360648c015260848b015260e43560a48b015260c48a0152610124890190613fca565b90858883030160e48901526132bc565b9285840301908501526132bc565b039134905af18015610e3457908291611f9b575b50505b611f87576001815580f35b611f9334600854613a00565b6008556104d5565b611fa490613107565b610302578038611f79565b8a80fd5b909194935060059b9a9996979b5416956040519b858d015260148c52611fd88c61319c565b863b1561206757899a9b611f478b9a9b9493612035936040519d8e9c8d9b6327efc43f60e21b8d5260048d015260248c015260a43560448c01523360648c015260848b015260e43560a48b015260c48a0152610124890190613fca565b908582039384019086015252019134905af18015610e3457612058575b50611f7c565b61206190613107565b38612052565b8980fd5b612083939b509061207b91614008565b90519061376e565b97388080611e7a565b50346103025760203660031901126103025760206120ab600435613ff1565b6040519015158152f35b5034610302576020366003190112610302576004356120d26139aa565b6120da613966565b6120e261353f565b6301312d008111612123576020817fdd72d2879718489eb363ba6099239f89d49542612862c71545503d35cfddda4692600955604051908152a16001815580f35b60405162461bcd60e51b81526020600482015260116024820152706665655261746520746f6f206c6172676560781b6044820152606490fd5b50346103025780600319360112610302576121756139aa565b61217d61353f565b612185613966565b600160ff19815416176001557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16001815580f35b503461030257806121d236613049565b6121dd92919261353f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316803b1561086357610e1393858094604051968795869485936342d65a8d60e01b855260048501613e71565b5034610302576020366003190112610302576004358152600d60209081526040918290208054600182015460029092015484516001600160a01b039283168152919092169281019290925291810191909152606090f35b5034610302576040366003190112610302576004356122a661301d565b8115612323575b336001600160a01b038216036122c657610cf591614f68565b60405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608490fd5b828052600360205260016040842054116122ad5760405162461bcd60e51b815260206004820152601a60248201527f6c6173742061646d696e2063616e6e6f742072656e6f756e63650000000000006044820152606490fd5b503461030257602036600319011261030257612396614baa565b5060606123a4600435614be8565b604080519160018060a01b03808251168452602082015116602084015201516040820152f35b50346103025760403660031901126103025761243e60043560036123ec61301d565b91808552602090600282526124076001604088200154613663565b8086526002825260408087206001600160a01b03909516600081815295845294205460ff1615612442575b855252604083206138e1565b5080f35b80865260028252604086208460005282526040600020600160ff198254161790553384827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8980a4612432565b50346103025760203660031901126103025760016040602092600435815260028452200154604051908152f35b5034610302576020366003190112610302576124d66139aa565b6124de613966565b6104d56004356147de565b5034610302576020366003190112610302576020906040906001600160a01b03612511613007565b168152600c83522054604051908152f35b5034610302576104d561253436612ff1565b9061253d6139aa565b612545613966565b61254d613351565b613b58565b5034610302576020366003190112610302578061256d612f91565b61257561353f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690813b1561197e5761ffff602484928360405195869485936310ddb13760e01b85521660048401525af18015610e3457610e245750f35b50346103025780600319360112610302576020600854604051908152f35b503461030257602036600319011261030257604060209161ffff612616612f91565b168152600e83522054604051908152f35b503461030257806003193601126103025760206040517f16b9b21c34f72b61b038f4735d1e3b86ea577a372ef2c98f5d64e83848a713c28152f35b50346103025760203660031901126103025761267c612f91565b61268461353f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316908290823b1561048d57602461ffff918360405195869485936307e0db1760e01b85521660048401525af18015610e34576126e7575080f35b610cf590613107565b50346103025780600319360112610302576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50346103025760403660031901126103025761ffff612752612f91565b61275a61353f565b168152600e602052602435604082205580f35b50346103025760203660031901126103025760043563ffffffff60e01b811680910361048d5780602091159081156127ab575b506040519015158152f35b635a05180f60e01b8114915081156127c5575b50826127a0565b637965db0b60e01b8114915081156127df575b50826127be565b6301ffc9a760e01b149050826127d8565b50346103025760206003198181360112611129576001600160401b03906004358281116108635760c0813603928301126108635761282c6139aa565b612834613966565b61283c613351565b604481013542811115612b025760648201359181831115612ac457608481013583811115612a7f5760249384830135938415612a465761287d600a54613a3d565b9889600a55898b52600b815260408b2085600401359860221901891215612a42578886016004810135908b8211612a3e578d8236038b830113610302578a916128d0846128ca87546130cd565b87613a63565b81601f85116001146129cd5791849391600596956129c0575b5050508160011b916000199060031b1c19161781555b876001820155836002820155846003820155856004820155019460a48101359560018060a01b0387168097036129bc57866001600160601b0360a01b82541617905560405198828a52019660048801359701988711611faf578636038913611faf577fb362a0ab21ba3a158a0c45f03e607cd10cb7731e03aaa535248d1f055dde08d098889760c0612998938a015260e0890191613aa8565b9460408701526060860152608085015260a084015260c08301520390a26001815580f35b8c80fd5b01013590508a38806128e9565b929091601f198516868552878520945b88828210612a2357505091859391600597966001969410612a07575b50505050811b0181556128ff565b60001960f88660031b161c199201013516905538808c816129f9565b8584019094013586556001909501948e9392830192016129dd565b8d80fd5b8b80fd5b60405162461bcd60e51b8152600481018a905260128188015271696e76616c6964206275636b657453697a6560701b6044820152606490fd5b60405162461bcd60e51b815260048101889052601960248201527f696e76616c6964206d6174757269747954696d657374616d70000000000000006044820152606490fd5b60405162461bcd60e51b81526004810187905260166024820152750696e76616c696420636c6f736554696d657374616d760541b6044820152606490fd5b60405162461bcd60e51b81526004810186905260156024820152740696e76616c6964206f70656e54696d657374616d7605c1b6044820152606490fd5b503461030257608036600319011261030257612b59612f91565b6001600160401b036024358181116110e857612b79903690600401612fc4565b9091604435818116036108635760643590811161086357612b9e903690600401612fc4565b90916001600160a01b0391907f000000000000000000000000000000000000000000000000000000000000000083163303612f8d5761ffff8616875260209460108652612bed604089206131f3565b908151928381149384612f83575b5083612f60575b50505015612f0c57826080918101031261086357813593818516809503610ac55782840135936060840135936040013587878715612e74575050612c4586614b52565b92600a8401549560ff8a971615612e66575b600b8501546001600160801b03808211612e1157908b9695949392918116977f00000000000000000000000000000000000000000000000000000000000000001694604051966383b672fd60e01b88528c60048901528b602489015289604489015281886064818a5afa978815612e06578998612dd0575b5090600982612ce6600c612cf7969501548b61376e565b938b52019052604088205490614008565b80612d0b575b505050505050505050505080f35b612d26938b9260405194612d1e86613181565b8986526144e7565b803b1561112957612d50938360405180968195829463f0692d0d60e01b84528b8d60048601613e8c565b03925af18015612dc557612d94575b50807f6aa3eac93d079e5e100b1029be716caa33586c96aa4baac390669fb5c2a2121291a33880808084818080808080612cfd565b612d9e9150613107565b827f6aa3eac93d079e5e100b1029be716caa33586c96aa4baac390669fb5c2a21212612d5f565b6040513d87823e3d90fd5b92918091985083813d8311612dff575b612dea81836131d2565b810103126118ef579151969091906009612ccf565b503d612de0565b6040513d8b823e3d90fd5b60405162461bcd60e51b815260048101879052602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608490fd5b612e6f886147de565b612c57565b7f0ab53f3b2b4bb5242c8314feba0bc95633253fca8b4890f31c3872b481337bc4975090612ef5918795612eac606099989698614be8565b94868651168452600f89526040842083855289526040842054978892888851168652600f8b52604086208587528b5285604081205560405195612eee87613181565b86526144e7565b51169160405192835282015260016040820152a280f35b60405162461bcd60e51b815260048101859052602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b6064820152608490fd5b612f6d92935036916132fc565b8581519101209085815191012014388080612c02565b1515935038612bfb565b8680fd5b6004359061ffff8216820361048857565b6064359061ffff8216820361048857565b6024359061ffff8216820361048857565b9181601f84011215610488578235916001600160401b038311610488576020838186019501011161048857565b6040906003190112610488576004359060243590565b600435906001600160a01b038216820361048857565b602435906001600160a01b038216820361048857565b606435906001600160a01b038216820361048857565b9060406003198301126104885760043561ffff811681036104885791602435906001600160401b0382116104885761308391600401612fc4565b9091565b602435906001600160801b038216820361048857565b9181601f84011215610488578235916001600160401b038311610488576020808501948460051b01011161048857565b90600182811c921680156130fd575b60208310146130e757565b634e487b7160e01b600052602260045260246000fd5b91607f16916130dc565b6001600160401b03811161311a57604052565b634e487b7160e01b600052604160045260246000fd5b60e081019081106001600160401b0382111761311a57604052565b60c081019081106001600160401b0382111761311a57604052565b606081019081106001600160401b0382111761311a57604052565b602081019081106001600160401b0382111761311a57604052565b604081019081106001600160401b0382111761311a57604052565b608081019081106001600160401b0382111761311a57604052565b90601f801991011681019081106001600160401b0382111761311a57604052565b9060405191826000825492613207846130cd565b9081845260019485811690816000146132765750600114613233575b5050613231925003836131d2565b565b9093915060005260209081600020936000915b81831061325e57505061323193508201013880613223565b85548884018501529485019487945091830191613246565b91505061323194506020925060ff191682840152151560051b8201013880613223565b60005b8381106132ac5750506000910152565b818101518382015260200161329c565b906020916132d581518092818552858086019101613299565b601f01601f1916010190565b6001600160401b03811161311a57601f01601f191660200190565b929192613308826132e1565b9161331660405193846131d2565b829481845281830111610488578281602093846000960137010152565b9080601f830112156104885781602061334e933591016132fc565b90565b3360009081527ff6cbf6420acd3f0a67b53e4366d2541782dd8df82dd82f57d735a0756dbc50f2602090815260408083205490927f16b9b21c34f72b61b038f4735d1e3b86ea577a372ef2c98f5d64e83848a713c29160ff16156133b55750505050565b6133be336137cb565b918451906133cb826131b7565b6042825284820192606036853782511561352b576030845382519060019182101561352b5790607860218501536041915b8183116134bd5750505061347b5760486109e793869361345f93613450985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a860152610993815180928c603789019101613299565b010360288101875201856131d2565b5192839262461bcd60e51b8452600484015260248301906132bc565b60648486519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f81166010811015613517576f181899199a1a9b1b9c1cb0b131b232b360811b901a6134ed85876137a4565b5360041c928015613503576000190191906133fc565b634e487b7160e01b82526011600452602482fd5b634e487b7160e01b83526032600452602483fd5b634e487b7160e01b81526032600452602490fd5b3360009081527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b602090815260408083205490929060ff161561358157505050565b61358a336137cb565b9080845190613598826131b7565b6042825284820192606036853782511561352b576030845382519060019182101561352b5790607860218501536041915b81831161361d5750505061347b5760486109e793869361345f93613450985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a860152610993815180928c603789019101613299565b909192600f81166010811015613517576f181899199a1a9b1b9c1cb0b131b232b360811b901a61364d85876137a4565b5360041c928015613503576000190191906135c9565b60009080825260209060028252604092838120338252835260ff84822054161561368d5750505050565b613696336137cb565b918451906136a3826131b7565b6042825284820192606036853782511561352b576030845382519060019182101561352b5790607860218501536041915b8183116137285750505061347b5760486109e793869361345f93613450985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a860152610993815180928c603789019101613299565b909192600f81166010811015613517576f181899199a1a9b1b9c1cb0b131b232b360811b901a61375885876137a4565b5360041c928015613503576000190191906136d4565b8181029291811591840414171561378157565b634e487b7160e01b600052601160045260246000fd5b9190820180921161378157565b9081518110156137b5570160200190565b634e487b7160e01b600052603260045260246000fd5b604051906137d882613166565b602a82526020820160403682378251156137b5576030905381516001908110156137b557607860218401536029905b80821161385b5750506138175790565b606460405162461bcd60e51b815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f811660108110156138b4576f181899199a1a9b1b9c1cb0b131b232b360811b901a61388a84866137a4565b5360041c91801561389f576000190190613807565b60246000634e487b7160e01b81526011600452fd5b60246000634e487b7160e01b81526032600452fd5b80548210156137b55760005260206000200190600090565b9190600183016000908282528060205260408220541560001461396057845494600160401b86101561394c578361393c613925886001604098999a018555846138c9565b819391549060031b91821b91600019901b19161790565b9055549382526020522055600190565b634e487b7160e01b83526041600452602483fd5b50925050565b60ff6001541661397257565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b6002600054146139bb576002600055565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b9190820391821161378157565b3d15613a38573d90613a1e826132e1565b91613a2c60405193846131d2565b82523d6000602084013e565b606090565b60001981146137815760010190565b818110613a57575050565b60008155600101613a4c565b9190601f8111613a7257505050565b613231926000526020600020906020601f840160051c83019310613a9e575b601f0160051c0190613a4c565b9091508190613a91565b908060209392818452848401376000828201840152601f01601f1916010190565b15613ad057565b60405162461bcd60e51b815260206004820152600e60248201526d1b1bdd1d195c9e4818db1bdcd95960921b6044820152606490fd5b91908110156137b55760051b0190565b15613b1d57565b60405162461bcd60e51b81526020600482015260136024820152721b1bdd1d195c9e481b9bdd081b585d1d5c9959606a1b6044820152606490fd5b613b6181614b52565b613b6a83614b52565b600582810154908201546001600160a01b03918216911603613c6557613b966004830154421015613b16565b60ff600a8301541615613c57575b600b82015460005260098201602052604060002054613c515760028101544210613c1957600c600092613bdc60038401544210613ac9565b0190613bef600c83549201918254613797565b9055557f8b7ea892cd9964c88c51a116c3428e78cf1deabfbc97682d031a2ebe2af49e70600080a3565b60405162461bcd60e51b815260206004820152601060248201526f3637ba3a32b93c903737ba1037b832b760811b6044820152606490fd5b50505050565b613c60836147de565b613ba4565b60405162461bcd60e51b815260206004820152601960248201527f636f6c6c61746572616c20746f6b656e206d69736d61746368000000000000006044820152606490fd5b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815261323191613ce3826131b7565b60018060a01b031690613d42604051613cfb8161319c565b6020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af1613d3c613a0d565b91613dd8565b805191821591848315613db4575b505050905015613d5d5750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b91938180945001031261048d57820151908115158203610302575080388084613d50565b91929015613e3a5750815115613dec575090565b3b15613df55790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015613e4d5750805190602001fd5b60405162461bcd60e51b8152602060048201529081906109e79060248301906132bc565b60409061ffff61334e95931681528160208201520191613aa8565b909493926001600160801b0390606093608084019760018060a01b0316845260208401521660408201520152565b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815261323191613ce36084836131d2565b9060009291805491613f0f836130cd565b918282526001938481169081600014613f705750600114613f305750505050565b90919394506000526020928360002092846000945b838610613f5c575050505001019038808080613c51565b805485870183015294019385908201613f45565b9294505050602093945060ff191683830152151560051b01019038808080613c51565b60405190613fa082613166565b606060408360008152600060208201520152565b9190826040910312610488576020825192015190565b906060604061334e93805184526020810151602085015201519181604082015201906132bc565b8015159081613ffe575090565b9050600a54101590565b8115614012570490565b634e487b7160e01b600052601260045260246000fd5b929091600061403685614b52565b6002810154421061423d575b600781018054958615614234575b600383015442101561422b575b8415614222575b6001600160801b036001840154911696811561420e57818806614205575b8815610488579061409781600995949361376e565b90600684015490818a101592836141f0575b5082156141e7576140bd6140c2928b613a00565b614008565b905b156141d5576140d96140e7916140ef936138c9565b90549060031b1c5b8661376e565b809683614996565b8583520160205260408120614105838254613797565b90556001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811696873b1561112957829160c4839260405194859384926333d1989f60e01b8452169b8c60048401528b60248401528a604484015288606484015260a060848401528160a48401525af18015610e34576141c1575b5050916060917f9c0412b06a9ff04b2b01757d2cacf95919d6d08f79df38ea8d35a2ffd364d9589360405192835260208301526040820152a3565b6141cb8291613107565b6103025780614186565b50506140ef6140e760088301546140e1565b505084906140c4565b6141fc91935082613797565b891091386140a9565b97508397614082565b634e487b7160e01b85526012600452602485fd5b96508296614064565b9650829661405d565b96508296614050565b94508094614042565b919493929461425483613ff1565b156144da5761426283614b52565b60058101546001600160a01b039391908416868516036144d1575b600281015442106144c8575b600781018054156144bf575b60038201544210156144b6575b83156144ad575b60018201906001600160801b03825494169380156140125784066144a4575b8615614493576142dc81549254809361376e565b9160068401549081861015938461447e575b506000841561447557506140bd6143059287613a00565b915b156144665761432791614319916138c9565b90549060031b1c5b8461376e565b9081881015614340575050505050509161323192614ae2565b90600992949689896143558480989a9c613a00565b61444a575b50505050600c810161436d848254613797565b905583600052016020526040600020614387848254613797565b9055837f00000000000000000000000000000000000000000000000000000000000000001695863b156104885760009460c4869260405197889384926333d1989f60e01b8452169a8b60048401528a602484015287604484015288606484015260a060848401528160a48401525af1928315611d00577f9c0412b06a9ff04b2b01757d2cacf95919d6d08f79df38ea8d35a2ffd364d9589460609461443b575b5060405192835260208301526040820152a3565b61444490613107565b38614427565b61445d9361445791613a00565b91614ae2565b8238898161435a565b50506143276008820154614321565b91505091614307565b61448a91945082613797565b851092386142ee565b505050505050509161323192614ae2565b600096506142c8565b600095506142a9565b600095506142a2565b60009550614295565b60009450614289565b6000945061427d565b5050509161323192614ae2565b92919593956144f582614be8565b956040928388018051600181116147c8575b50508351956001600160601b03198a60601b168060208901526014885261452d8861319c565b614535613f93565b9161ffff16906000809b83825260076020528882205485528a89860152600160a01b60019003908982600454169c81519d8e808093630a51236960e01b82528a600483015260248201600190526044820160a0905260a48201614597916132bc565b818103600319998a820160648501528252601c0160848301526020016145bd908c613fca565b03915afa9b8c156147bc578e9c61479c575b508b6008541061478257508c9d50869c98999a9b9c5115156000146146bf5760045416958951926020840152601483526146088361319c565b863b156118ef57614671614681936146618e978d519e8f9c8d9b8c9a6327efc43f60e21b8c5260048c015260248b015260448a01523060648a015260848901528c60a489015261012060c4890152610124880190613fca565b90848783030160e48801526132bc565b91848303016101048501526132bc565b03925af19081156146b657506146a29394506146a7575b505b600854613a00565b600855565b6146b090613107565b38614698565b513d86823e3d90fd5b909192949699955060055416948851926020840152601483526146e18361319c565b853b156114a9576147496020936147398d968b948d519e8f9c8d9b6327efc43f60e21b8d5260048d015260248c015260448b01523060648b015260848a01528460a48a015261012060c48a0152610124890190613fca565b90848883030160e48901526132bc565b8581039283016101048701525201925af19081156146b657506146a2939450614773575b5061469a565b61477c90613107565b3861476d565b9850989a9c99505050505050505061323194505116614ae2565b6147b4919c508a3d8c116104765761046781836131d2565b509a386145cf565b8e8b51903d90823e3d90fd5b61207b906147d69397614008565b933880614507565b906147e882614b52565b9160048301546147fa81421015613b16565b600a84019060ff82541661495157604091825195634a7d1f1b60e11b875283600488015261482b6044880182613efe565b92602488015260209182888060018060a01b03960381877f0000000000000000000000000000000000000000000000000000000000000000165afa93841561494657600094614914575b7fcb071a1f0712c00e535dd8693fc40af46a18ac5dd2ef06912487aa42a0eaf5f6969798506148fa6148b460018501546148af8189614008565b61376e565b93600b8101948555600c81019260056305f5e1006148d686546009549061376e565b0492015416600052600c8652876000206148f1828254613797565b90558254613a00565b9055805460ff1916600117905554835192835290820152a2565b93978381813d831161493f575b61492b81836131d2565b810103126118ef5751969750879693614875565b503d614921565b85513d6000823e3d90fd5b60405162461bcd60e51b815260206004820152601860248201527f6c6f747465727920616c7265616479207265736f6c76656400000000000000006044820152606490fd5b60058101546040516370a0823160e01b808252306004830152929360209391926001600160a01b0316918484602481865afa938415611d005785928891600096614aa9575b50906149e991309086613eba565b60246040518094819382523060048301525afa918215611d00578591600093614a75575b5090614a1891613797565b03614a315750600c614a2d9101918254613797565b9055565b6064906040519062461bcd60e51b82526004820152601760248201527f696e76616c6964204552432d3230207472616e736665720000000000000000006044820152fd5b9150918382813d8311614aa2575b614a8d81836131d2565b81010312610302575051908490614a18614a0d565b503d614a83565b84819495929793503d8311614adb575b614ac381836131d2565b810103126103025750519284919087906149e96149db565b503d614ab9565b6060907f0ab53f3b2b4bb5242c8314feba0bc95633253fca8b4890f31c3872b481337bc4929360018060a01b038092169182600052600f6020526040600020951694856000526020526040600020614b3b828254613797565b9055604051918252602082015260006040820152a2565b614b5b81613ff1565b15614b7057600052600b602052604060002090565b60405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a59081b1bdd1d195c9e481a5960721b6044820152606490fd5b60405190614bb782613166565b60006040838281528260208201520152565b9081602091031261048857516001600160a01b03811681036104885790565b614bf0614baa565b506000918183526020600d815260408085209060018060a01b03918260018201541680614e33575050816006541691815163068bcd8d60e01b815284816024816004978b898301525afa908115614e29579082918991614e0c575b5016918215614dca57614c618285541684614e5b565b8051637e062a3560e11b815285818681875afa908115614d51579083918a91614d9d575b5016948515614d5b57614c9b8386541687614e5b565b614ca9836005541687614e5b565b808251809663feb56b1560e01b825281875afa948515614d51578995614d21575b5090600295969798600d8493835199614ce28b613166565b8a52808a01968752838a01978852899b83525220955116906001600160601b0360a01b9182875416178655600186019251169082541617905551910155565b9080955081813d8311614d4a575b614d3981836131d2565b810103126118ef5751936002614cca565b503d614d2f565b82513d8b823e3d90fd5b8490606492519162461bcd60e51b8352820152601e60248201527f73746172676174653a20746f6b656e20646f6573206e6f7420657869737400006044820152fd5b614dbd9150873d8911614dc3575b614db581836131d2565b810190614bc9565b38614c85565b503d614dab565b5162461bcd60e51b8152808401859052601d60248201527f73746172676174653a20706f6f6c20646f6573206e6f742065786973740000006044820152606490fd5b614e239150863d8811614dc357614db581836131d2565b38614c4b565b83513d8a823e3d90fd5b9180959750600294919396505195614e4a87613166565b835416865285015201549082015290565b604051636eb1769f60e11b81523060048201526001600160a01b039283166024820181905260209390919084908290604490829087165afa908115611d0057600091614f3b575b50614ed7579061323192916040519263095ea7b360e01b908401526024830152600019604483015260448252613ce3826131b7565b60405162461bcd60e51b815260048101849052603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608490fd5b908482813d8311614f61575b614f5181836131d2565b8101031261030257505138614ea2565b503d614f47565b906040614fa69260009080825260026020528282209360018060a01b03169384835260205260ff8383205416614fa9575b8152600360205220614ff1565b50565b808252600260205282822084835260205282822060ff1981541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a4614f99565b906001820190600092818452826020526040842054908115156000146150da57600019918083018181116150c6578254908482019182116150b25780820361507d575b505050805480156150695782019161504c83836138c9565b909182549160031b1b191690555582526020526040812055600190565b634e487b7160e01b86526031600452602486fd5b61509d61508d61392593866138c9565b90549060031b1c928392866138c9565b90558652846020526040862055388080615034565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b87526011600452602487fd5b505050509056fea26469706673582212202356595bc5b1aa933fe58f213fcee3d511fb8adc0d187e853cb2eb02232aad7364736f6c6343000813003300000000000000000000000072ca61f7caba90e29ccfdd14c2fd1da47e9400650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f9c572697e7aef7b2baad8152e607b57d0561f4e0000000000000000000000000ef29d26e2a6a451e6a827c6bd39e5d0698d0845
Deployed Bytecode
0x6080604052600436101561002a575b361561001957600080fd5b61002534600854613797565b600855005b6000803560e01c80621d356714612b3f5780630162fe26146127f057806301ffc9a71461276d57806303c3d4831461273557806307968db1146126f057806307e0db17146126625780630bc1bcb114612627578063105b024f146125f45780631078d4a4146125d657806310ddb1371461255257806312ccf19a146125225780631cd3f85b146124e95780631fdabd43146124bc578063248a9ca31461248f5780632f2ff15d146123ca5780632f380b351461237c57806336568abe14612289578063391904a41461223257806342d65a8d146121c2578063439766ce1461215c57806345596e2e146120b55780634f558e791461208c57806351c24d8f14611dc35780635c975abb14611da05780636ba4c13814611b375780636c89b802146119d75780637533d7881461198b57806377fe962d14611928578063789abd1e146118275780639010d07c146117e157806391d148541461179557806392e845f61461153c57806392f6576e1461151d5780639a3ebfee146112f35780639adfab33146112d5578063a1eaacad146112a5578063a217fddf14611289578063a6c3d16514611160578063a786c3b71461112d578063ab8236f31461102c578063b33712c514610f8b578063b7c1d57c14610f3c578063bd2e6ca314610f1e578063beef236914610ede578063c2b3c7fc14610e6e578063ca15c87314610e44578063cbed8b9c14610d51578063d547741f14610cb0578063d74cb2f714610c6b578063dd89d4c714610c2e578063e55dc4e614610ac9578063e62003f8146106cc578063e63a391f146106ad578063e82748ca14610672578063eb8d72b714610517578063f00acbaa146104dc578063f4343e5d14610491578063fc39b54f146103055763fc9ed84f146102be575061000e565b346103025780600319360112610302576040517f00000000000000000000000072ca61f7caba90e29ccfdd14c2fd1da47e9400656001600160a01b03168152602090f35b80fd5b50346103025760031960c03682011261048d57610320612fb3565b6001600160a01b0391608435918383168303610488576103a09361ffff6103e0926103f56040956103ae875198600160f01b60208b015260a43560228b015260228a5261036c8a613166565b88516001600160a01b039091166020820152600435604082015260443560608201526064356080820152998a9060a0820190565b03601f1981018b528a6131d2565b86519788968795869563040a7bb160e41b8752169a8b600487015230602487015260a0604487015260a48601906132bc565b918b60648601528483030160848501526132bc565b03917f0000000000000000000000000000000000000000000000000000000000000000165afa90811561047d57908361044493926020959261044c575b50604091928152600e85522054613797565b604051908152f35b6040925061046f90833d8511610476575b61046781836131d2565b810190613fb4565b5091610432565b503d61045d565b6040513d85823e3d90fd5b600080fd5b5080fd5b5034610302576080366003190112610302576104d56104ae613087565b6104b6613033565b906104bf6139aa565b6104c7613966565b339060443590600435614028565b6001815580f35b503461030257806003193601126103025760206040517f04824fcb60e7cc526d70b264caa65b62ed44d9c8e5d230e8ff6b0c7373843b8a8152f35b50346103025761052636613049565b929161053061353f565b61ffff8116835260206010815260408420906001600160401b03861161065e576105648661055e84546130cd565b84613a63565b8490601f87116001146105d35750946105c2918186977ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab97916105c8575b508260011b906000198460031b1c19161790555b60405193849384613e71565b0390a180f35b9050850135386105a2565b90601f1987168387528287209287905b828210610646575050916105c29391887ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab9899941061062c575b5050600182811b0190556105b6565b860135600019600385901b60f8161c19169055388061061d565b80600185968294968b013581550195019301906105e3565b634e487b7160e01b85526041600452602485fd5b503461030257806003193601126103025760206040517fb6edeab710812f8917b946c63c63b900f456e6a1abea66a90b1f8277f035664b8152f35b503461030257806003193601126103025760206040516305f5e1008152f35b503461030257606036600319011261030257600435602480356001600160401b03604435818111610ac55761070590369060040161309d565b9390916107106139aa565b610718613966565b3360009081527f8961fde0fd1ff6d64501170d4a03ba8833245a768b7e71bc72d058bc597cb4bb60209081526040909120549092907f04824fcb60e7cc526d70b264caa65b62ed44d9c8e5d230e8ff6b0c7373843b8a9060ff16156108f9575061078187614b52565b9186156108c25761079760038401544210613ac9565b856006840155600783019087116108af57600160401b87116108af578054878255808810610895575b50885282882084895b888110610883575050843591600019880191508782116108715750906107f460089493928887613b06565b358082101561086757509283915b01556040519384528301526060604083015282606083015260018060fb1b03831161086357816080917f53060a781c837d1ce0355372341dff9f556d20eb84c77d0c0cf70eae190f09b89460051b8091848401378101030190a26001815580f35b8480fd5b9050928391610802565b634e487b7160e01b8a52601160045289fd5b813583820155908501906001016107c9565b818a52848a206108a9918101908901613a4c565b386107c0565b50634e487b7160e01b8852604160045287fd5b60405162461bcd60e51b8152600481018590526010818401526f195b5c1d1e481c1c9a58d9481b1a5cdd60821b6044820152606490fd5b8390610904336137cb565b90604051610911816131b7565b60428152838101916060368437815115610ab057603083538151600190811015610a9b57607860218401536041905b808211610a2d5750506109eb5760486109e7936109bc936109cb9360405195869376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a860152610993815180928c603789019101613299565b8401917001034b99036b4b9b9b4b733903937b6329607d1b603784015251809386840190613299565b010360288101845201826131d2565b60405193849362461bcd60e51b855260048501528301906132bc565b0390fd5b606485856040519162461bcd60e51b83528160048401528201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f81166010811015610a86576f181899199a1a9b1b9c1cb0b131b232b360811b901a610a5c84866137a4565b5360041c918015610a71576000190190610940565b87634e487b7160e01b60005260116004526000fd5b88634e487b7160e01b60005260326004526000fd5b86634e487b7160e01b60005260326004526000fd5b85634e487b7160e01b60005260326004526000fd5b8580fd5b503461030257606036600319011261030257610ae3613007565b610aeb61301d565b90604435610af76139aa565b610aff613966565b610b07613351565b7fb6edeab710812f8917b946c63c63b900f456e6a1abea66a90b1f8277f035664b845260209160028352604085209360018060a01b038083169586600052855260ff6040600020541615610bf5578116808752600c855260408720548411610bbd57928092610baf927f78473f3f373f7673597f4f0fa5873cb4d375fea6d4339ad6b56dbd411513cb3f96958952600c865260408920610ba8848254613a00565b9055613caa565b604051908152a26001815580f35b60405162461bcd60e51b815260048101869052601060248201526f616d6f756e7420746f6f206c6172676560801b6044820152606490fd5b60405162461bcd60e51b8152600481018690526011602482015270125b9d985b1a59081c9958da5c1a595b9d607a1b6044820152606490fd5b5034610302578060031936011261030257606060018060a01b03806004541690806005541690600654169060405192835260208301526040820152f35b50346103025780600319360112610302576040517f0000000000000000000000000ef29d26e2a6a451e6a827c6bd39e5d0698d08456001600160a01b03168152602090f35b503461030257604036600319011261030257600435610ccd61301d565b8115610cf8575b81610cf59284526002602052610cf06001604086200154613663565b614f68565b80f35b82805260036020526001604084205411610cd45760405162461bcd60e51b815260206004820152601860248201527f63616e6e6f74207265766f6b65206c6173742061646d696e00000000000000006044820152606490fd5b50346103025760803660031901126103025780610d6c612f91565b610d74612fb3565b6064356001600160401b038111610e3f57610d93903690600401612fc4565b9092610d9d61353f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690813b15610ac557858094610e13604051978896879586946332fb62e760e21b865261ffff80921660048701521660248501526044356044850152608060648501526084840191613aa8565b03925af18015610e3457610e245750f35b610e2d90613107565b6103025780f35b6040513d84823e3d90fd5b505050fd5b50346103025760203660031901126103025760406020916004358152600383522054604051908152f35b50346103025760207fae4c931479f884f2e585f0c898f9d3630f545a6f7891f3fefdd33b3f1f547641610ea036612ff1565b610eab9391936139aa565b610eb3613966565b610ebb613351565b610baf81610ec886614b52565b610ed760038201544210613ac9565b3390614996565b50346103025760403660031901126103025761ffff610efb612f91565b610f03613966565b610f0b61353f565b1681526007602052602435604082205580f35b50346103025780600319360112610302576020600954604051908152f35b503461030257604036600319011261030257610f56613007565b6040610f6061301d565b9260018060a01b038093168152600f6020522091166000526020526020604060002054604051908152f35b5034610302578060031936011261030257610fa46139aa565b610fac61353f565b60015460ff811615610ff05760ff19166001557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16001815580f35b60405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606490fd5b50346103025760c036600319011261030257611046612f91565b506001600160401b0360243581811161112957611067903690600401613333565b50611070613033565b9060a43590811161112957611089903690600401613333565b6004546001600160a01b039290831633036110ec576080828051810103126110e85760208201519283168093036110e8576040820151926060830151936001600160801b0385168503610ac557610cf594608060843595015191614246565b8380fd5b60405162461bcd60e51b815260206004820152601560248201527439ba30b933b0ba329d1037b7363c903937baba32b960591b6044820152606490fd5b8280fd5b503461030257602036600319011261030257604060209161ffff61114f612f91565b168152600783522054604051908152f35b50346103025761ffff9061117336613049565b93909161117e61353f565b6111a860346040518781986020978884013781013060601b878201520360148101885201866131d2565b1682526010815260408220908351906001600160401b038211611275576111d9826111d385546130cd565b85613a63565b80601f83116001146112135750839482939492611208575b50508160011b916000199060031b1c191617905580f35b0151905038806111f1565b90601f198316958486528286209286905b88821061125d57505083600195969710611244575b505050811b01905580f35b015160001960f88460031b161c19169055388080611239565b80600185968294968601518155019501930190611224565b634e487b7160e01b84526041600452602484fd5b5034610302578060031936011261030257602090604051908152f35b50346103025760406020916112c560096112be36612ff1565b9290614b52565b0190825283522054604051908152f35b50346103025780600319360112610302576020600a54604051908152f35b506003199060a0368301126103025761130a612fb3565b61ffff608435916113196139aa565b611321613966565b1690818352602093600e855260408420543411156114e657828452600e85526113506040852054600854613797565b60085582845260078552604084205482106114ad5783948385526010815261137a604086206131f3565b60405193600160f01b8386015260228501526022845261139984613166565b6040805133848201908152600435602082015260443592810192909252606435606083015295906113d89087906080015b03601f1981018852876131d2565b600e60018060a01b037f0000000000000000000000000000000000000000000000000000000000000000169382895252611416604088205434613a00565b90833b156114a95761147e6114539589976114636040519a8b998a98899762c5803160e81b8952600489015260c0602489015260c48801906132bc565b90848783030160448801526132bc565b913360648601528960848601528483030160a48501526132bc565b03925af18015610e3457611495575b506001905580f35b61149e90613107565b61030257803861148d565b8780fd5b60405162461bcd60e51b81526004810186905260116024820152706e6f7420656e6f7567682064737467617360781b6044820152606490fd5b60405162461bcd60e51b815260048101869052600f60248201526e6e6f7420656e6f756768206665657360881b6044820152606490fd5b503461030257806003193601126103025760206040516301312d008152f35b5034610302576020366003190112610302578060c060405161155d81613130565b6040516115698161314b565b606081528360208201528360408201528360608201528360808201528360a08201528152826020820152606060408201528260608201528260808201528260a082015201526115b9600435614b52565b90600682015491600881015460ff600a83015416600b830154916007600c85015494604051976115e889613130565b6040516115f48161314b565b60405161160c816116058187613efe565b03826131d2565b81526001830154602082015260028301546040820152600383015460608201526004830154608082015260018060a01b0360058401541660a0820152895260208901526040519081928391016020815493848152019089526020892092895b81811061177c575050611680925003826131d2565b604087015260608601521515608085015260a084015260c0830152604051906020825282519060e060208401526116c5825160c06101008601526101c08501906132bc565b602080840151610120860152604080850151610140870152606080860151610160880152608086015161018088015260a0909501516001600160a01b03166101a08701528682015181870152860151858303601f19019486019490945283518083529181019301915b8181106117665750505060c08360608495015160808501526080810151151560a085015260a081015182850152015160e08301520390f35b825184526020938401939092019160010161172e565b845483526001948501948694506020909301920161166b565b50346103025760403660031901126103025760406117b161301d565b9160043581526002602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b50346103025760403660031901126103025761180e602091600435815260038352604060243591206138c9565b905460405160039290921b1c6001600160a01b03168152f35b5034610302576080366003190112610302576004356001600160401b036024358181116110e85761185c90369060040161309d565b9290916044359081116108635761187790369060040161309d565b611882929192613033565b9461188b6139aa565b611893613966565b8181036118f357865b8181106118ab57876001815580f35b6118b6818388613b06565b35906001600160801b03821682036118ef576118e5886118ea9333906118dd85898c613b06565b359089614028565b613a3d565b61189c565b8880fd5b60405162461bcd60e51b815260206004820152600d60248201526c125b9d985b1a59081a5b9c1d5d609a1b6044820152606490fd5b5034610302576020366003190112610302578060043561194661353f565b8015611982575b6008549081811161197e5782816119678294938394613a00565b600855335af1611975613a0d565b50156103025780f35b5050fd5b5060085461194d565b5034610302576020366003190112610302576119bf60406119d39261ffff6119b1612f91565b1681526010602052206131f3565b6040519182916020835260208301906132bc565b0390f35b5034610302576003199060c036830112610302576119f3613087565b6119fb612fa2565b9260a435906001600160a01b03808316830361048857611acb95611aea6113ca9361ffff93611a3c6040988951978891604435906004358c60208601613e8c565b611adb611a47613f93565b91611a556084358451613797565b83528951986001600160601b03199060601b169889602082015260148152611a7c8161319c565b8a840152600454169689519860208a015260148952611a9a8961319c565b89519b8c998a988998630a51236960e01b8a521660048901526001602489015260a0604489015260a48801906132bc565b90848783030160648801526132bc565b91848303016084850152613fca565b03915afa8015611b2a576040928291611b0b575b5082519182526020820152f35b9050611b249150823d84116104765761046781836131d2565b38611afe565b50604051903d90823e3d90fd5b50346103025760208060031936011261048d576004356001600160401b03811161112957611b6990369060040161309d565b91611b726139aa565b611b7a613966565b6001600160a01b037f0000000000000000000000000ef29d26e2a6a451e6a827c6bd39e5d0698d0845811693855b818110611bb757866001815580f35b611bc2818387613b06565b35611bcc81614b52565b60ff600a8201541615611d92575b600b810154906001600160801b03808311611d3d5790829160649594931691888b604051978880926383b672fd60e01b82523360048301528860248301528760448301525afa958615611d0057600096611d0c575b50611c5890611c42600c8401548861376e565b90600052600983018a5260406000205490614008565b9081611c6d575b505050506001915001611ba8565b90611c7f918860053392015416613caa565b883b156104885760405163f0692d0d60e01b81529360009185918291611cab9190863360048601613e8c565b0381838c5af1928315611d0057600193611cf1575b5033907f6aa3eac93d079e5e100b1029be716caa33586c96aa4baac390669fb5c2a21212600080a338808080611c5f565b611cfa90613107565b38611cc0565b6040513d6000823e3d90fd5b90958982813d8311611d36575b611d2381836131d2565b8101031261030257505194611c58611c2f565b503d611d19565b60405162461bcd60e51b815260048101899052602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608490fd5b611d9b826147de565b611bda565b5034610302578060031936011261030257602060ff600154166040519015158152f35b50600319610120368201811361112957611ddb613087565b91611de4612fa2565b6101049390916001600160a01b039190853590838216820361048857611e086139aa565b611e10613966565b6084359284611e1e85614be8565b511697611e3260c435809a30903390613eba565b60405191611e5e83611e506020936044359060043533878601613e8c565b03601f1981018552846131d2565b89976040611e6b88614be8565b01805160009c6001821161206b575b505050604051956001600160601b03199060601b1697888388015260148752611ea28761319c565b61ffff611ead613f93565b9216808d52600784526040808e20548452830197909752845115611fb35760045416976040519283015260148252611ee48261319c565b873b15611faf5791611f57611f659492611f478d9b9a999897956040519d8e9c8d9b8c9b6327efc43f60e21b8d5260048d015260248c015260a43560448c01523360648c015260848b015260e43560a48b015260c48a0152610124890190613fca565b90858883030160e48901526132bc565b9285840301908501526132bc565b039134905af18015610e3457908291611f9b575b50505b611f87576001815580f35b611f9334600854613a00565b6008556104d5565b611fa490613107565b610302578038611f79565b8a80fd5b909194935060059b9a9996979b5416956040519b858d015260148c52611fd88c61319c565b863b1561206757899a9b611f478b9a9b9493612035936040519d8e9c8d9b6327efc43f60e21b8d5260048d015260248c015260a43560448c01523360648c015260848b015260e43560a48b015260c48a0152610124890190613fca565b908582039384019086015252019134905af18015610e3457612058575b50611f7c565b61206190613107565b38612052565b8980fd5b612083939b509061207b91614008565b90519061376e565b97388080611e7a565b50346103025760203660031901126103025760206120ab600435613ff1565b6040519015158152f35b5034610302576020366003190112610302576004356120d26139aa565b6120da613966565b6120e261353f565b6301312d008111612123576020817fdd72d2879718489eb363ba6099239f89d49542612862c71545503d35cfddda4692600955604051908152a16001815580f35b60405162461bcd60e51b81526020600482015260116024820152706665655261746520746f6f206c6172676560781b6044820152606490fd5b50346103025780600319360112610302576121756139aa565b61217d61353f565b612185613966565b600160ff19815416176001557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16001815580f35b503461030257806121d236613049565b6121dd92919261353f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316803b1561086357610e1393858094604051968795869485936342d65a8d60e01b855260048501613e71565b5034610302576020366003190112610302576004358152600d60209081526040918290208054600182015460029092015484516001600160a01b039283168152919092169281019290925291810191909152606090f35b5034610302576040366003190112610302576004356122a661301d565b8115612323575b336001600160a01b038216036122c657610cf591614f68565b60405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608490fd5b828052600360205260016040842054116122ad5760405162461bcd60e51b815260206004820152601a60248201527f6c6173742061646d696e2063616e6e6f742072656e6f756e63650000000000006044820152606490fd5b503461030257602036600319011261030257612396614baa565b5060606123a4600435614be8565b604080519160018060a01b03808251168452602082015116602084015201516040820152f35b50346103025760403660031901126103025761243e60043560036123ec61301d565b91808552602090600282526124076001604088200154613663565b8086526002825260408087206001600160a01b03909516600081815295845294205460ff1615612442575b855252604083206138e1565b5080f35b80865260028252604086208460005282526040600020600160ff198254161790553384827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8980a4612432565b50346103025760203660031901126103025760016040602092600435815260028452200154604051908152f35b5034610302576020366003190112610302576124d66139aa565b6124de613966565b6104d56004356147de565b5034610302576020366003190112610302576020906040906001600160a01b03612511613007565b168152600c83522054604051908152f35b5034610302576104d561253436612ff1565b9061253d6139aa565b612545613966565b61254d613351565b613b58565b5034610302576020366003190112610302578061256d612f91565b61257561353f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690813b1561197e5761ffff602484928360405195869485936310ddb13760e01b85521660048401525af18015610e3457610e245750f35b50346103025780600319360112610302576020600854604051908152f35b503461030257602036600319011261030257604060209161ffff612616612f91565b168152600e83522054604051908152f35b503461030257806003193601126103025760206040517f16b9b21c34f72b61b038f4735d1e3b86ea577a372ef2c98f5d64e83848a713c28152f35b50346103025760203660031901126103025761267c612f91565b61268461353f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316908290823b1561048d57602461ffff918360405195869485936307e0db1760e01b85521660048401525af18015610e34576126e7575080f35b610cf590613107565b50346103025780600319360112610302576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50346103025760403660031901126103025761ffff612752612f91565b61275a61353f565b168152600e602052602435604082205580f35b50346103025760203660031901126103025760043563ffffffff60e01b811680910361048d5780602091159081156127ab575b506040519015158152f35b635a05180f60e01b8114915081156127c5575b50826127a0565b637965db0b60e01b8114915081156127df575b50826127be565b6301ffc9a760e01b149050826127d8565b50346103025760206003198181360112611129576001600160401b03906004358281116108635760c0813603928301126108635761282c6139aa565b612834613966565b61283c613351565b604481013542811115612b025760648201359181831115612ac457608481013583811115612a7f5760249384830135938415612a465761287d600a54613a3d565b9889600a55898b52600b815260408b2085600401359860221901891215612a42578886016004810135908b8211612a3e578d8236038b830113610302578a916128d0846128ca87546130cd565b87613a63565b81601f85116001146129cd5791849391600596956129c0575b5050508160011b916000199060031b1c19161781555b876001820155836002820155846003820155856004820155019460a48101359560018060a01b0387168097036129bc57866001600160601b0360a01b82541617905560405198828a52019660048801359701988711611faf578636038913611faf577fb362a0ab21ba3a158a0c45f03e607cd10cb7731e03aaa535248d1f055dde08d098889760c0612998938a015260e0890191613aa8565b9460408701526060860152608085015260a084015260c08301520390a26001815580f35b8c80fd5b01013590508a38806128e9565b929091601f198516868552878520945b88828210612a2357505091859391600597966001969410612a07575b50505050811b0181556128ff565b60001960f88660031b161c199201013516905538808c816129f9565b8584019094013586556001909501948e9392830192016129dd565b8d80fd5b8b80fd5b60405162461bcd60e51b8152600481018a905260128188015271696e76616c6964206275636b657453697a6560701b6044820152606490fd5b60405162461bcd60e51b815260048101889052601960248201527f696e76616c6964206d6174757269747954696d657374616d70000000000000006044820152606490fd5b60405162461bcd60e51b81526004810187905260166024820152750696e76616c696420636c6f736554696d657374616d760541b6044820152606490fd5b60405162461bcd60e51b81526004810186905260156024820152740696e76616c6964206f70656e54696d657374616d7605c1b6044820152606490fd5b503461030257608036600319011261030257612b59612f91565b6001600160401b036024358181116110e857612b79903690600401612fc4565b9091604435818116036108635760643590811161086357612b9e903690600401612fc4565b90916001600160a01b0391907f000000000000000000000000000000000000000000000000000000000000000083163303612f8d5761ffff8616875260209460108652612bed604089206131f3565b908151928381149384612f83575b5083612f60575b50505015612f0c57826080918101031261086357813593818516809503610ac55782840135936060840135936040013587878715612e74575050612c4586614b52565b92600a8401549560ff8a971615612e66575b600b8501546001600160801b03808211612e1157908b9695949392918116977f0000000000000000000000000ef29d26e2a6a451e6a827c6bd39e5d0698d08451694604051966383b672fd60e01b88528c60048901528b602489015289604489015281886064818a5afa978815612e06578998612dd0575b5090600982612ce6600c612cf7969501548b61376e565b938b52019052604088205490614008565b80612d0b575b505050505050505050505080f35b612d26938b9260405194612d1e86613181565b8986526144e7565b803b1561112957612d50938360405180968195829463f0692d0d60e01b84528b8d60048601613e8c565b03925af18015612dc557612d94575b50807f6aa3eac93d079e5e100b1029be716caa33586c96aa4baac390669fb5c2a2121291a33880808084818080808080612cfd565b612d9e9150613107565b827f6aa3eac93d079e5e100b1029be716caa33586c96aa4baac390669fb5c2a21212612d5f565b6040513d87823e3d90fd5b92918091985083813d8311612dff575b612dea81836131d2565b810103126118ef579151969091906009612ccf565b503d612de0565b6040513d8b823e3d90fd5b60405162461bcd60e51b815260048101879052602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608490fd5b612e6f886147de565b612c57565b7f0ab53f3b2b4bb5242c8314feba0bc95633253fca8b4890f31c3872b481337bc4975090612ef5918795612eac606099989698614be8565b94868651168452600f89526040842083855289526040842054978892888851168652600f8b52604086208587528b5285604081205560405195612eee87613181565b86526144e7565b51169160405192835282015260016040820152a280f35b60405162461bcd60e51b815260048101859052602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b6064820152608490fd5b612f6d92935036916132fc565b8581519101209085815191012014388080612c02565b1515935038612bfb565b8680fd5b6004359061ffff8216820361048857565b6064359061ffff8216820361048857565b6024359061ffff8216820361048857565b9181601f84011215610488578235916001600160401b038311610488576020838186019501011161048857565b6040906003190112610488576004359060243590565b600435906001600160a01b038216820361048857565b602435906001600160a01b038216820361048857565b606435906001600160a01b038216820361048857565b9060406003198301126104885760043561ffff811681036104885791602435906001600160401b0382116104885761308391600401612fc4565b9091565b602435906001600160801b038216820361048857565b9181601f84011215610488578235916001600160401b038311610488576020808501948460051b01011161048857565b90600182811c921680156130fd575b60208310146130e757565b634e487b7160e01b600052602260045260246000fd5b91607f16916130dc565b6001600160401b03811161311a57604052565b634e487b7160e01b600052604160045260246000fd5b60e081019081106001600160401b0382111761311a57604052565b60c081019081106001600160401b0382111761311a57604052565b606081019081106001600160401b0382111761311a57604052565b602081019081106001600160401b0382111761311a57604052565b604081019081106001600160401b0382111761311a57604052565b608081019081106001600160401b0382111761311a57604052565b90601f801991011681019081106001600160401b0382111761311a57604052565b9060405191826000825492613207846130cd565b9081845260019485811690816000146132765750600114613233575b5050613231925003836131d2565b565b9093915060005260209081600020936000915b81831061325e57505061323193508201013880613223565b85548884018501529485019487945091830191613246565b91505061323194506020925060ff191682840152151560051b8201013880613223565b60005b8381106132ac5750506000910152565b818101518382015260200161329c565b906020916132d581518092818552858086019101613299565b601f01601f1916010190565b6001600160401b03811161311a57601f01601f191660200190565b929192613308826132e1565b9161331660405193846131d2565b829481845281830111610488578281602093846000960137010152565b9080601f830112156104885781602061334e933591016132fc565b90565b3360009081527ff6cbf6420acd3f0a67b53e4366d2541782dd8df82dd82f57d735a0756dbc50f2602090815260408083205490927f16b9b21c34f72b61b038f4735d1e3b86ea577a372ef2c98f5d64e83848a713c29160ff16156133b55750505050565b6133be336137cb565b918451906133cb826131b7565b6042825284820192606036853782511561352b576030845382519060019182101561352b5790607860218501536041915b8183116134bd5750505061347b5760486109e793869361345f93613450985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a860152610993815180928c603789019101613299565b010360288101875201856131d2565b5192839262461bcd60e51b8452600484015260248301906132bc565b60648486519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f81166010811015613517576f181899199a1a9b1b9c1cb0b131b232b360811b901a6134ed85876137a4565b5360041c928015613503576000190191906133fc565b634e487b7160e01b82526011600452602482fd5b634e487b7160e01b83526032600452602483fd5b634e487b7160e01b81526032600452602490fd5b3360009081527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b602090815260408083205490929060ff161561358157505050565b61358a336137cb565b9080845190613598826131b7565b6042825284820192606036853782511561352b576030845382519060019182101561352b5790607860218501536041915b81831161361d5750505061347b5760486109e793869361345f93613450985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a860152610993815180928c603789019101613299565b909192600f81166010811015613517576f181899199a1a9b1b9c1cb0b131b232b360811b901a61364d85876137a4565b5360041c928015613503576000190191906135c9565b60009080825260209060028252604092838120338252835260ff84822054161561368d5750505050565b613696336137cb565b918451906136a3826131b7565b6042825284820192606036853782511561352b576030845382519060019182101561352b5790607860218501536041915b8183116137285750505061347b5760486109e793869361345f93613450985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a860152610993815180928c603789019101613299565b909192600f81166010811015613517576f181899199a1a9b1b9c1cb0b131b232b360811b901a61375885876137a4565b5360041c928015613503576000190191906136d4565b8181029291811591840414171561378157565b634e487b7160e01b600052601160045260246000fd5b9190820180921161378157565b9081518110156137b5570160200190565b634e487b7160e01b600052603260045260246000fd5b604051906137d882613166565b602a82526020820160403682378251156137b5576030905381516001908110156137b557607860218401536029905b80821161385b5750506138175790565b606460405162461bcd60e51b815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f811660108110156138b4576f181899199a1a9b1b9c1cb0b131b232b360811b901a61388a84866137a4565b5360041c91801561389f576000190190613807565b60246000634e487b7160e01b81526011600452fd5b60246000634e487b7160e01b81526032600452fd5b80548210156137b55760005260206000200190600090565b9190600183016000908282528060205260408220541560001461396057845494600160401b86101561394c578361393c613925886001604098999a018555846138c9565b819391549060031b91821b91600019901b19161790565b9055549382526020522055600190565b634e487b7160e01b83526041600452602483fd5b50925050565b60ff6001541661397257565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b6002600054146139bb576002600055565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b9190820391821161378157565b3d15613a38573d90613a1e826132e1565b91613a2c60405193846131d2565b82523d6000602084013e565b606090565b60001981146137815760010190565b818110613a57575050565b60008155600101613a4c565b9190601f8111613a7257505050565b613231926000526020600020906020601f840160051c83019310613a9e575b601f0160051c0190613a4c565b9091508190613a91565b908060209392818452848401376000828201840152601f01601f1916010190565b15613ad057565b60405162461bcd60e51b815260206004820152600e60248201526d1b1bdd1d195c9e4818db1bdcd95960921b6044820152606490fd5b91908110156137b55760051b0190565b15613b1d57565b60405162461bcd60e51b81526020600482015260136024820152721b1bdd1d195c9e481b9bdd081b585d1d5c9959606a1b6044820152606490fd5b613b6181614b52565b613b6a83614b52565b600582810154908201546001600160a01b03918216911603613c6557613b966004830154421015613b16565b60ff600a8301541615613c57575b600b82015460005260098201602052604060002054613c515760028101544210613c1957600c600092613bdc60038401544210613ac9565b0190613bef600c83549201918254613797565b9055557f8b7ea892cd9964c88c51a116c3428e78cf1deabfbc97682d031a2ebe2af49e70600080a3565b60405162461bcd60e51b815260206004820152601060248201526f3637ba3a32b93c903737ba1037b832b760811b6044820152606490fd5b50505050565b613c60836147de565b613ba4565b60405162461bcd60e51b815260206004820152601960248201527f636f6c6c61746572616c20746f6b656e206d69736d61746368000000000000006044820152606490fd5b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815261323191613ce3826131b7565b60018060a01b031690613d42604051613cfb8161319c565b6020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af1613d3c613a0d565b91613dd8565b805191821591848315613db4575b505050905015613d5d5750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b91938180945001031261048d57820151908115158203610302575080388084613d50565b91929015613e3a5750815115613dec575090565b3b15613df55790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015613e4d5750805190602001fd5b60405162461bcd60e51b8152602060048201529081906109e79060248301906132bc565b60409061ffff61334e95931681528160208201520191613aa8565b909493926001600160801b0390606093608084019760018060a01b0316845260208401521660408201520152565b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815261323191613ce36084836131d2565b9060009291805491613f0f836130cd565b918282526001938481169081600014613f705750600114613f305750505050565b90919394506000526020928360002092846000945b838610613f5c575050505001019038808080613c51565b805485870183015294019385908201613f45565b9294505050602093945060ff191683830152151560051b01019038808080613c51565b60405190613fa082613166565b606060408360008152600060208201520152565b9190826040910312610488576020825192015190565b906060604061334e93805184526020810151602085015201519181604082015201906132bc565b8015159081613ffe575090565b9050600a54101590565b8115614012570490565b634e487b7160e01b600052601260045260246000fd5b929091600061403685614b52565b6002810154421061423d575b600781018054958615614234575b600383015442101561422b575b8415614222575b6001600160801b036001840154911696811561420e57818806614205575b8815610488579061409781600995949361376e565b90600684015490818a101592836141f0575b5082156141e7576140bd6140c2928b613a00565b614008565b905b156141d5576140d96140e7916140ef936138c9565b90549060031b1c5b8661376e565b809683614996565b8583520160205260408120614105838254613797565b90556001600160a01b037f0000000000000000000000000ef29d26e2a6a451e6a827c6bd39e5d0698d0845811696873b1561112957829160c4839260405194859384926333d1989f60e01b8452169b8c60048401528b60248401528a604484015288606484015260a060848401528160a48401525af18015610e34576141c1575b5050916060917f9c0412b06a9ff04b2b01757d2cacf95919d6d08f79df38ea8d35a2ffd364d9589360405192835260208301526040820152a3565b6141cb8291613107565b6103025780614186565b50506140ef6140e760088301546140e1565b505084906140c4565b6141fc91935082613797565b891091386140a9565b97508397614082565b634e487b7160e01b85526012600452602485fd5b96508296614064565b9650829661405d565b96508296614050565b94508094614042565b919493929461425483613ff1565b156144da5761426283614b52565b60058101546001600160a01b039391908416868516036144d1575b600281015442106144c8575b600781018054156144bf575b60038201544210156144b6575b83156144ad575b60018201906001600160801b03825494169380156140125784066144a4575b8615614493576142dc81549254809361376e565b9160068401549081861015938461447e575b506000841561447557506140bd6143059287613a00565b915b156144665761432791614319916138c9565b90549060031b1c5b8461376e565b9081881015614340575050505050509161323192614ae2565b90600992949689896143558480989a9c613a00565b61444a575b50505050600c810161436d848254613797565b905583600052016020526040600020614387848254613797565b9055837f0000000000000000000000000ef29d26e2a6a451e6a827c6bd39e5d0698d08451695863b156104885760009460c4869260405197889384926333d1989f60e01b8452169a8b60048401528a602484015287604484015288606484015260a060848401528160a48401525af1928315611d00577f9c0412b06a9ff04b2b01757d2cacf95919d6d08f79df38ea8d35a2ffd364d9589460609461443b575b5060405192835260208301526040820152a3565b61444490613107565b38614427565b61445d9361445791613a00565b91614ae2565b8238898161435a565b50506143276008820154614321565b91505091614307565b61448a91945082613797565b851092386142ee565b505050505050509161323192614ae2565b600096506142c8565b600095506142a9565b600095506142a2565b60009550614295565b60009450614289565b6000945061427d565b5050509161323192614ae2565b92919593956144f582614be8565b956040928388018051600181116147c8575b50508351956001600160601b03198a60601b168060208901526014885261452d8861319c565b614535613f93565b9161ffff16906000809b83825260076020528882205485528a89860152600160a01b60019003908982600454169c81519d8e808093630a51236960e01b82528a600483015260248201600190526044820160a0905260a48201614597916132bc565b818103600319998a820160648501528252601c0160848301526020016145bd908c613fca565b03915afa9b8c156147bc578e9c61479c575b508b6008541061478257508c9d50869c98999a9b9c5115156000146146bf5760045416958951926020840152601483526146088361319c565b863b156118ef57614671614681936146618e978d519e8f9c8d9b8c9a6327efc43f60e21b8c5260048c015260248b015260448a01523060648a015260848901528c60a489015261012060c4890152610124880190613fca565b90848783030160e48801526132bc565b91848303016101048501526132bc565b03925af19081156146b657506146a29394506146a7575b505b600854613a00565b600855565b6146b090613107565b38614698565b513d86823e3d90fd5b909192949699955060055416948851926020840152601483526146e18361319c565b853b156114a9576147496020936147398d968b948d519e8f9c8d9b6327efc43f60e21b8d5260048d015260248c015260448b01523060648b015260848a01528460a48a015261012060c48a0152610124890190613fca565b90848883030160e48901526132bc565b8581039283016101048701525201925af19081156146b657506146a2939450614773575b5061469a565b61477c90613107565b3861476d565b9850989a9c99505050505050505061323194505116614ae2565b6147b4919c508a3d8c116104765761046781836131d2565b509a386145cf565b8e8b51903d90823e3d90fd5b61207b906147d69397614008565b933880614507565b906147e882614b52565b9160048301546147fa81421015613b16565b600a84019060ff82541661495157604091825195634a7d1f1b60e11b875283600488015261482b6044880182613efe565b92602488015260209182888060018060a01b03960381877f00000000000000000000000072ca61f7caba90e29ccfdd14c2fd1da47e940065165afa93841561494657600094614914575b7fcb071a1f0712c00e535dd8693fc40af46a18ac5dd2ef06912487aa42a0eaf5f6969798506148fa6148b460018501546148af8189614008565b61376e565b93600b8101948555600c81019260056305f5e1006148d686546009549061376e565b0492015416600052600c8652876000206148f1828254613797565b90558254613a00565b9055805460ff1916600117905554835192835290820152a2565b93978381813d831161493f575b61492b81836131d2565b810103126118ef5751969750879693614875565b503d614921565b85513d6000823e3d90fd5b60405162461bcd60e51b815260206004820152601860248201527f6c6f747465727920616c7265616479207265736f6c76656400000000000000006044820152606490fd5b60058101546040516370a0823160e01b808252306004830152929360209391926001600160a01b0316918484602481865afa938415611d005785928891600096614aa9575b50906149e991309086613eba565b60246040518094819382523060048301525afa918215611d00578591600093614a75575b5090614a1891613797565b03614a315750600c614a2d9101918254613797565b9055565b6064906040519062461bcd60e51b82526004820152601760248201527f696e76616c6964204552432d3230207472616e736665720000000000000000006044820152fd5b9150918382813d8311614aa2575b614a8d81836131d2565b81010312610302575051908490614a18614a0d565b503d614a83565b84819495929793503d8311614adb575b614ac381836131d2565b810103126103025750519284919087906149e96149db565b503d614ab9565b6060907f0ab53f3b2b4bb5242c8314feba0bc95633253fca8b4890f31c3872b481337bc4929360018060a01b038092169182600052600f6020526040600020951694856000526020526040600020614b3b828254613797565b9055604051918252602082015260006040820152a2565b614b5b81613ff1565b15614b7057600052600b602052604060002090565b60405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a59081b1bdd1d195c9e481a5960721b6044820152606490fd5b60405190614bb782613166565b60006040838281528260208201520152565b9081602091031261048857516001600160a01b03811681036104885790565b614bf0614baa565b506000918183526020600d815260408085209060018060a01b03918260018201541680614e33575050816006541691815163068bcd8d60e01b815284816024816004978b898301525afa908115614e29579082918991614e0c575b5016918215614dca57614c618285541684614e5b565b8051637e062a3560e11b815285818681875afa908115614d51579083918a91614d9d575b5016948515614d5b57614c9b8386541687614e5b565b614ca9836005541687614e5b565b808251809663feb56b1560e01b825281875afa948515614d51578995614d21575b5090600295969798600d8493835199614ce28b613166565b8a52808a01968752838a01978852899b83525220955116906001600160601b0360a01b9182875416178655600186019251169082541617905551910155565b9080955081813d8311614d4a575b614d3981836131d2565b810103126118ef5751936002614cca565b503d614d2f565b82513d8b823e3d90fd5b8490606492519162461bcd60e51b8352820152601e60248201527f73746172676174653a20746f6b656e20646f6573206e6f7420657869737400006044820152fd5b614dbd9150873d8911614dc3575b614db581836131d2565b810190614bc9565b38614c85565b503d614dab565b5162461bcd60e51b8152808401859052601d60248201527f73746172676174653a20706f6f6c20646f6573206e6f742065786973740000006044820152606490fd5b614e239150863d8811614dc357614db581836131d2565b38614c4b565b83513d8a823e3d90fd5b9180959750600294919396505195614e4a87613166565b835416865285015201549082015290565b604051636eb1769f60e11b81523060048201526001600160a01b039283166024820181905260209390919084908290604490829087165afa908115611d0057600091614f3b575b50614ed7579061323192916040519263095ea7b360e01b908401526024830152600019604483015260448252613ce3826131b7565b60405162461bcd60e51b815260048101849052603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608490fd5b908482813d8311614f61575b614f5181836131d2565b8101031261030257505138614ea2565b503d614f47565b906040614fa69260009080825260026020528282209360018060a01b03169384835260205260ff8383205416614fa9575b8152600360205220614ff1565b50565b808252600260205282822084835260205282822060ff1981541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a4614f99565b906001820190600092818452826020526040842054908115156000146150da57600019918083018181116150c6578254908482019182116150b25780820361507d575b505050805480156150695782019161504c83836138c9565b909182549160031b1b191690555582526020526040812055600190565b634e487b7160e01b86526031600452602486fd5b61509d61508d61392593866138c9565b90549060031b1c928392866138c9565b90558652846020526040862055388080615034565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b87526011600452602487fd5b505050509056fea26469706673582212202356595bc5b1aa933fe58f213fcee3d511fb8adc0d187e853cb2eb02232aad7364736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000072ca61f7caba90e29ccfdd14c2fd1da47e9400650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f9c572697e7aef7b2baad8152e607b57d0561f4e0000000000000000000000000ef29d26e2a6a451e6a827c6bd39e5d0698d0845
-----Decoded View---------------
Arg [0] : _prophetPriceFeed (address): 0x72ca61f7cAbA90e29ccFdD14c2fD1Da47E940065
Arg [1] : _stargateStruct (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [2] : _layerZeroEndpoint (address): 0x0000000000000000000000000000000000000000
Arg [3] : _admin (address): 0xF9c572697e7AEf7B2baAd8152E607B57D0561F4E
Arg [4] : _prophetTicketManager (address): 0x0Ef29D26e2a6a451e6a827C6BD39E5D0698d0845
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 00000000000000000000000072ca61f7caba90e29ccfdd14c2fd1da47e940065
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 000000000000000000000000f9c572697e7aef7b2baad8152e607b57d0561f4e
Arg [6] : 0000000000000000000000000ef29d26e2a6a451e6a827c6bd39e5d0698d0845
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.