Source Code
Overview
S Balance
S Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
LumosPredictionV2
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 99999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IPyth} from "@pythnetwork/pyth-sdk-solidity/IPyth.sol";
import {PythStructs} from "@pythnetwork/pyth-sdk-solidity/PythStructs.sol";
/**
* @title LumosPredictionV2
*/
contract LumosPredictionV2 is Ownable, Pausable, ReentrancyGuard {
using SafeERC20 for IERC20;
IPyth public oracle;
bytes32 public priceFeedId; // Pyth price feed ID for S token
bool public genesisLockOnce = false;
bool public genesisStartOnce = false;
address public adminAddress; // address of the admin
address public operatorAddress; // address of the operator
uint256 public bufferSeconds; // number of seconds for valid execution of a prediction round
uint256 public intervalSeconds; // interval in seconds between two prediction rounds
uint256 public minBetAmount; // minimum betting amount (denominated in wei)
uint256 public treasuryFee; // treasury rate (e.g. 200 = 2%, 150 = 1.50%)
uint256 public treasuryAmount; // treasury amount that was not claimed
uint256 public currentEpoch; // current epoch for prediction round
uint256 public oracleLatestRoundId; // now represents publishTime from Pyth
uint256 public oracleUpdateAllowance; // seconds - max age for price data
uint256 public constant MAX_TREASURY_FEE = 1000; // 10%
mapping(uint256 => mapping(address => BetInfo)) public ledger;
mapping(uint256 => Round) public rounds;
mapping(address => uint256[]) public userRounds;
enum Position {
Bull,
Bear
}
struct Round {
uint256 epoch;
uint256 startTimestamp;
uint256 lockTimestamp;
uint256 closeTimestamp;
int256 lockPrice;
int256 closePrice;
uint256 lockOracleId;
uint256 closeOracleId;
uint256 totalAmount;
uint256 bullAmount;
uint256 bearAmount;
uint256 rewardBaseCalAmount;
uint256 rewardAmount;
bool oracleCalled;
}
struct BetInfo {
Position position;
uint256 amount;
bool claimed; // default false
}
event BetBear(address indexed sender, uint256 indexed epoch, uint256 amount);
event BetBull(address indexed sender, uint256 indexed epoch, uint256 amount);
event Claim(address indexed sender, uint256 indexed epoch, uint256 amount);
event EndRound(uint256 indexed epoch, uint256 indexed roundId, int256 price);
event LockRound(uint256 indexed epoch, uint256 indexed roundId, int256 price);
event NewAdminAddress(address admin);
event NewBufferAndIntervalSeconds(uint256 bufferSeconds, uint256 intervalSeconds);
event NewMinBetAmount(uint256 indexed epoch, uint256 minBetAmount);
event NewTreasuryFee(uint256 indexed epoch, uint256 treasuryFee);
event NewOperatorAddress(address operator);
event NewOracle(address oracle);
event NewOracleUpdateAllowance(uint256 oracleUpdateAllowance);
event Pause(uint256 indexed epoch);
event RewardsCalculated(
uint256 indexed epoch,
uint256 rewardBaseCalAmount,
uint256 rewardAmount,
uint256 treasuryAmount
);
event StartRound(uint256 indexed epoch);
event TokenRecovery(address indexed token, uint256 amount);
event TreasuryClaim(uint256 amount);
event Unpause(uint256 indexed epoch);
modifier onlyAdmin() {
require(msg.sender == adminAddress, "Not admin");
_;
}
modifier onlyAdminOrOperator() {
require(msg.sender == adminAddress || msg.sender == operatorAddress, "Not operator/admin");
_;
}
modifier onlyOperator() {
require(msg.sender == operatorAddress, "Not operator");
_;
}
modifier notContract() {
require(!_isContract(msg.sender), "Contract not allowed");
require(msg.sender == tx.origin, "Proxy contract not allowed");
_;
}
/**
* @notice Constructor
* @param _oracleAddress: Pyth oracle address
* @param _priceFeedId: Pyth price feed ID for S token
* @param _adminAddress: admin address
* @param _operatorAddress: operator address
* @param _intervalSeconds: number of time within an interval
* @param _bufferSeconds: buffer of time for resolution of price
* @param _minBetAmount: minimum bet amounts (in wei)
* @param _oracleUpdateAllowance: oracle update allowance (max age in seconds)
* @param _treasuryFee: treasury fee (1000 = 10%)
*/
constructor(
address _oracleAddress,
bytes32 _priceFeedId,
address _adminAddress,
address _operatorAddress,
uint256 _intervalSeconds,
uint256 _bufferSeconds,
uint256 _minBetAmount,
uint256 _oracleUpdateAllowance,
uint256 _treasuryFee
) {
require(_treasuryFee <= MAX_TREASURY_FEE, "Treasury fee too high");
oracle = IPyth(_oracleAddress);
priceFeedId = _priceFeedId;
adminAddress = _adminAddress;
operatorAddress = _operatorAddress;
intervalSeconds = _intervalSeconds;
bufferSeconds = _bufferSeconds;
minBetAmount = _minBetAmount;
oracleUpdateAllowance = _oracleUpdateAllowance;
treasuryFee = _treasuryFee;
}
/**
* @notice Bet bear position
* @param epoch: epoch
*/
function betBear(uint256 epoch) external payable whenNotPaused nonReentrant notContract {
require(epoch == currentEpoch, "Bet is too early/late");
require(_bettable(epoch), "Round not bettable");
require(msg.value >= minBetAmount, "Bet amount must be greater than minBetAmount");
require(ledger[epoch][msg.sender].amount == 0, "Can only bet once per round");
// Update round data
uint256 amount = msg.value;
Round storage round = rounds[epoch];
round.totalAmount = round.totalAmount + amount;
round.bearAmount = round.bearAmount + amount;
// Update user data
BetInfo storage betInfo = ledger[epoch][msg.sender];
betInfo.position = Position.Bear;
betInfo.amount = amount;
userRounds[msg.sender].push(epoch);
emit BetBear(msg.sender, epoch, amount);
}
/**
* @notice Bet bull position
* @param epoch: epoch
*/
function betBull(uint256 epoch) external payable whenNotPaused nonReentrant notContract {
require(epoch == currentEpoch, "Bet is too early/late");
require(_bettable(epoch), "Round not bettable");
require(msg.value >= minBetAmount, "Bet amount must be greater than minBetAmount");
require(ledger[epoch][msg.sender].amount == 0, "Can only bet once per round");
// Update round data
uint256 amount = msg.value;
Round storage round = rounds[epoch];
round.totalAmount = round.totalAmount + amount;
round.bullAmount = round.bullAmount + amount;
// Update user data
BetInfo storage betInfo = ledger[epoch][msg.sender];
betInfo.position = Position.Bull;
betInfo.amount = amount;
userRounds[msg.sender].push(epoch);
emit BetBull(msg.sender, epoch, amount);
}
/**
* @notice Claim reward for an array of epochs
* @param epochs: array of epochs
*/
function claim(uint256[] calldata epochs) external nonReentrant notContract {
uint256 reward; // Initializes reward
for (uint256 i = 0; i < epochs.length; i++) {
require(rounds[epochs[i]].startTimestamp != 0, "Round has not started");
require(block.timestamp > rounds[epochs[i]].closeTimestamp, "Round has not ended");
uint256 addedReward = 0;
// Round valid, claim rewards
if (rounds[epochs[i]].oracleCalled) {
require(claimable(epochs[i], msg.sender), "Not eligible for claim");
Round memory round = rounds[epochs[i]];
addedReward = (ledger[epochs[i]][msg.sender].amount * round.rewardAmount) / round.rewardBaseCalAmount;
}
// Round invalid, refund bet amount
else {
require(refundable(epochs[i], msg.sender), "Not eligible for refund");
addedReward = ledger[epochs[i]][msg.sender].amount;
}
ledger[epochs[i]][msg.sender].claimed = true;
reward += addedReward;
emit Claim(msg.sender, epochs[i], addedReward);
}
if (reward > 0) {
_safeTransferBNB(address(msg.sender), reward);
}
}
/**
* @notice Start the next round n, lock price for round n-1, end round n-2
* @dev Callable by operator
*/
function executeRound() external whenNotPaused onlyOperator {
require(
genesisStartOnce && genesisLockOnce,
"Can only run after genesisStartRound and genesisLockRound is triggered"
);
(uint80 currentRoundId, int256 currentPrice) = _getPriceFromOracle();
oracleLatestRoundId = uint256(currentRoundId);
// CurrentEpoch refers to previous round (n-1)
_safeLockRound(currentEpoch, currentRoundId, currentPrice);
_safeEndRound(currentEpoch - 1, currentRoundId, currentPrice);
_calculateRewards(currentEpoch - 1);
// Increment currentEpoch to current round (n)
currentEpoch = currentEpoch + 1;
_safeStartRound(currentEpoch);
}
/**
* @notice Lock genesis round
* @dev Callable by operator
*/
function genesisLockRound() external whenNotPaused onlyOperator {
require(genesisStartOnce, "Can only run after genesisStartRound is triggered");
require(!genesisLockOnce, "Can only run genesisLockRound once");
(uint80 currentRoundId, int256 currentPrice) = _getPriceFromOracle();
oracleLatestRoundId = uint256(currentRoundId);
_safeLockRound(currentEpoch, currentRoundId, currentPrice);
currentEpoch = currentEpoch + 1;
_startRound(currentEpoch);
genesisLockOnce = true;
}
/**
* @notice Start genesis round
* @dev Callable by admin or operator
*/
function genesisStartRound() external whenNotPaused onlyOperator {
require(!genesisStartOnce, "Can only run genesisStartRound once");
currentEpoch = currentEpoch + 1;
_startRound(currentEpoch);
genesisStartOnce = true;
}
/**
* @notice called by the admin to pause, triggers stopped state
* @dev Callable by admin or operator
*/
function pause() external whenNotPaused onlyAdminOrOperator {
_pause();
emit Pause(currentEpoch);
}
/**
* @notice Claim all rewards in treasury
* @dev Callable by admin
*/
function claimTreasury() external nonReentrant onlyAdmin {
uint256 currentTreasuryAmount = treasuryAmount;
treasuryAmount = 0;
_safeTransferBNB(adminAddress, currentTreasuryAmount);
emit TreasuryClaim(currentTreasuryAmount);
}
/**
* @notice called by the admin or operator to unpause, returns to normal state
* Reset genesis state. Once paused, the rounds would need to be kickstarted by genesis
*/
function unpause() external whenPaused onlyAdminOrOperator {
genesisStartOnce = false;
genesisLockOnce = false;
_unpause();
emit Unpause(currentEpoch);
}
/**
* @notice Set buffer and interval (in seconds)
* @dev Callable by admin
*/
function setBufferAndIntervalSeconds(
uint256 _bufferSeconds,
uint256 _intervalSeconds
) external whenPaused onlyAdmin {
require(_bufferSeconds < _intervalSeconds, "bufferSeconds must be inferior to intervalSeconds");
bufferSeconds = _bufferSeconds;
intervalSeconds = _intervalSeconds;
emit NewBufferAndIntervalSeconds(_bufferSeconds, _intervalSeconds);
}
/**
* @notice Set minBetAmount
* @dev Callable by admin
*/
function setMinBetAmount(uint256 _minBetAmount) external whenPaused onlyAdmin {
require(_minBetAmount != 0, "Must be superior to 0");
minBetAmount = _minBetAmount;
emit NewMinBetAmount(currentEpoch, minBetAmount);
}
/**
* @notice Set operator address
* @dev Callable by admin
*/
function setOperator(address _operatorAddress) external onlyAdmin {
require(_operatorAddress != address(0), "Cannot be zero address");
operatorAddress = _operatorAddress;
emit NewOperatorAddress(_operatorAddress);
}
/**
* @notice Set Oracle address
* @dev Callable by admin
*/
function setOracle(address _oracle) external whenPaused onlyAdmin {
require(_oracle != address(0), "Cannot be zero address");
oracleLatestRoundId = 0;
oracle = IPyth(_oracle);
// Dummy check to make sure the interface implements this function properly
oracle.getPriceNoOlderThan(priceFeedId, oracleUpdateAllowance);
emit NewOracle(_oracle);
}
/**
* @notice Set price feed ID
* @dev Callable by admin
*/
function setPriceFeedId(bytes32 _priceFeedId) external whenPaused onlyAdmin {
require(_priceFeedId != bytes32(0), "Cannot be zero");
priceFeedId = _priceFeedId;
}
/**
* @notice Set oracle update allowance
* @dev Callable by admin
*/
function setOracleUpdateAllowance(uint256 _oracleUpdateAllowance) external whenPaused onlyAdmin {
oracleUpdateAllowance = _oracleUpdateAllowance;
emit NewOracleUpdateAllowance(_oracleUpdateAllowance);
}
/**
* @notice Set treasury fee
* @dev Callable by admin
*/
function setTreasuryFee(uint256 _treasuryFee) external whenPaused onlyAdmin {
require(_treasuryFee <= MAX_TREASURY_FEE, "Treasury fee too high");
treasuryFee = _treasuryFee;
emit NewTreasuryFee(currentEpoch, treasuryFee);
}
/**
* @notice It allows the owner to recover tokens sent to the contract by mistake
* @param _token: token address
* @param _amount: token amount
* @dev Callable by owner
*/
function recoverToken(address _token, uint256 _amount) external onlyOwner {
IERC20(_token).safeTransfer(address(msg.sender), _amount);
emit TokenRecovery(_token, _amount);
}
/**
* @notice Set admin address
* @dev Callable by owner
*/
function setAdmin(address _adminAddress) external onlyOwner {
require(_adminAddress != address(0), "Cannot be zero address");
adminAddress = _adminAddress;
emit NewAdminAddress(_adminAddress);
}
/**
* @notice Returns round epochs and bet information for a user that has participated
* @param user: user address
* @param cursor: cursor
* @param size: size
*/
function getUserRounds(
address user,
uint256 cursor,
uint256 size
) external view returns (uint256[] memory, BetInfo[] memory, uint256) {
uint256 length = size;
if (length > userRounds[user].length - cursor) {
length = userRounds[user].length - cursor;
}
uint256[] memory values = new uint256[](length);
BetInfo[] memory betInfo = new BetInfo[](length);
for (uint256 i = 0; i < length; i++) {
values[i] = userRounds[user][cursor + i];
betInfo[i] = ledger[values[i]][user];
}
return (values, betInfo, cursor + length);
}
/**
* @notice Returns round epochs length
* @param user: user address
*/
function getUserRoundsLength(address user) external view returns (uint256) {
return userRounds[user].length;
}
/**
* @notice Get the claimable stats of specific epoch and user account
* @param epoch: epoch
* @param user: user address
*/
function claimable(uint256 epoch, address user) public view returns (bool) {
BetInfo memory betInfo = ledger[epoch][user];
Round memory round = rounds[epoch];
if (round.lockPrice == round.closePrice) {
return false;
}
return
round.oracleCalled &&
betInfo.amount != 0 &&
!betInfo.claimed &&
((round.closePrice > round.lockPrice && betInfo.position == Position.Bull) ||
(round.closePrice < round.lockPrice && betInfo.position == Position.Bear));
}
/**
* @notice Get the refundable stats of specific epoch and user account
* @param epoch: epoch
* @param user: user address
*/
function refundable(uint256 epoch, address user) public view returns (bool) {
BetInfo memory betInfo = ledger[epoch][user];
Round memory round = rounds[epoch];
return
!round.oracleCalled &&
!betInfo.claimed &&
block.timestamp > round.closeTimestamp + bufferSeconds &&
betInfo.amount != 0;
}
/**
* @notice Calculate rewards for round
* @param epoch: epoch
*/
function _calculateRewards(uint256 epoch) internal {
require(rounds[epoch].rewardBaseCalAmount == 0 && rounds[epoch].rewardAmount == 0, "Rewards calculated");
Round storage round = rounds[epoch];
uint256 rewardBaseCalAmount;
uint256 treasuryAmt;
uint256 rewardAmount;
// Bull wins
if (round.closePrice > round.lockPrice) {
rewardBaseCalAmount = round.bullAmount;
treasuryAmt = (round.totalAmount * treasuryFee) / 10000;
rewardAmount = round.totalAmount - treasuryAmt;
}
// Bear wins
else if (round.closePrice < round.lockPrice) {
rewardBaseCalAmount = round.bearAmount;
treasuryAmt = (round.totalAmount * treasuryFee) / 10000;
rewardAmount = round.totalAmount - treasuryAmt;
}
// House wins
else {
rewardBaseCalAmount = 0;
rewardAmount = 0;
treasuryAmt = round.totalAmount;
}
round.rewardBaseCalAmount = rewardBaseCalAmount;
round.rewardAmount = rewardAmount;
// Add to treasury
treasuryAmount += treasuryAmt;
emit RewardsCalculated(epoch, rewardBaseCalAmount, rewardAmount, treasuryAmt);
}
/**
* @notice End round
* @param epoch: epoch
* @param roundId: roundId
* @param price: price of the round
*/
function _safeEndRound(uint256 epoch, uint256 roundId, int256 price) internal {
require(rounds[epoch].lockTimestamp != 0, "Can only end round after round has locked");
require(block.timestamp >= rounds[epoch].closeTimestamp, "Can only end round after closeTimestamp");
require(
block.timestamp <= rounds[epoch].closeTimestamp + bufferSeconds,
"Can only end round within bufferSeconds"
);
Round storage round = rounds[epoch];
round.closePrice = price;
round.closeOracleId = roundId;
round.oracleCalled = true;
emit EndRound(epoch, roundId, round.closePrice);
}
/**
* @notice Lock round
* @param epoch: epoch
* @param roundId: roundId
* @param price: price of the round
*/
function _safeLockRound(uint256 epoch, uint256 roundId, int256 price) internal {
require(rounds[epoch].startTimestamp != 0, "Can only lock round after round has started");
require(block.timestamp >= rounds[epoch].lockTimestamp, "Can only lock round after lockTimestamp");
require(
block.timestamp <= rounds[epoch].lockTimestamp + bufferSeconds,
"Can only lock round within bufferSeconds"
);
Round storage round = rounds[epoch];
round.closeTimestamp = block.timestamp + intervalSeconds;
round.lockPrice = price;
round.lockOracleId = roundId;
emit LockRound(epoch, roundId, round.lockPrice);
}
/**
* @notice Start round
* Previous round n-2 must end
* @param epoch: epoch
*/
function _safeStartRound(uint256 epoch) internal {
require(genesisStartOnce, "Can only run after genesisStartRound is triggered");
require(rounds[epoch - 2].closeTimestamp != 0, "Can only start round after round n-2 has ended");
require(
block.timestamp >= rounds[epoch - 2].closeTimestamp,
"Can only start new round after round n-2 closeTimestamp"
);
_startRound(epoch);
}
/**
* @notice Transfer BNB in a safe way
* @param to: address to transfer BNB to
* @param value: BNB amount to transfer (in wei)
*/
function _safeTransferBNB(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}("");
require(success, "TransferHelper: BNB_TRANSFER_FAILED");
}
/**
* @notice Start round
* Previous round n-2 must end
* @param epoch: epoch
*/
function _startRound(uint256 epoch) internal {
Round storage round = rounds[epoch];
round.startTimestamp = block.timestamp;
round.lockTimestamp = block.timestamp + intervalSeconds;
round.closeTimestamp = block.timestamp + (2 * intervalSeconds);
round.epoch = epoch;
round.totalAmount = 0;
emit StartRound(epoch);
}
/**
* @notice Determine if a round is valid for receiving bets
* Round must have started and locked
* Current timestamp must be within startTimestamp and closeTimestamp
*/
function _bettable(uint256 epoch) internal view returns (bool) {
return
rounds[epoch].startTimestamp != 0 &&
rounds[epoch].lockTimestamp != 0 &&
block.timestamp > rounds[epoch].startTimestamp &&
block.timestamp < rounds[epoch].lockTimestamp;
}
/**
* @notice Get latest recorded price from Pyth oracle
* Uses getPriceNoOlderThan to ensure price freshness
*/
function _getPriceFromOracle() internal view returns (uint80, int256) {
PythStructs.Price memory priceData = oracle.getPriceNoOlderThan(priceFeedId, oracleUpdateAllowance);
uint80 roundId = uint80(priceData.publishTime);
require(
uint256(roundId) > oracleLatestRoundId,
"Oracle update roundId must be larger than oracleLatestRoundId"
);
return (roundId, int256(priceData.price));
}
/**
* @notice Returns true if `account` is a contract.
* @param account: account address
*/
function _isContract(address account) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// 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 (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.4) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// 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.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 (last updated v4.9.4) (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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
import "./PythStructs.sol";
import "./IPythEvents.sol";
/// @title Consume prices from the Pyth Network (https://pyth.network/).
/// @dev Please refer to the guidance at https://docs.pyth.network/documentation/pythnet-price-feeds/best-practices for how to consume prices safely.
/// @author Pyth Data Association
interface IPyth is IPythEvents {
/// @notice Returns the price of a price feed without any sanity checks.
/// @dev This function returns the most recent price update in this contract without any recency checks.
/// This function is unsafe as the returned price update may be arbitrarily far in the past.
///
/// Users of this function should check the `publishTime` in the price to ensure that the returned price is
/// sufficiently recent for their application. If you are considering using this function, it may be
/// safer / easier to use `getPriceNoOlderThan`.
/// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
function getPriceUnsafe(
bytes32 id
) external view returns (PythStructs.Price memory price);
/// @notice Returns the price that is no older than `age` seconds of the current time.
/// @dev This function is a sanity-checked version of `getPriceUnsafe` which is useful in
/// applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently
/// recently.
/// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
function getPriceNoOlderThan(
bytes32 id,
uint age
) external view returns (PythStructs.Price memory price);
/// @notice Returns the exponentially-weighted moving average price of a price feed without any sanity checks.
/// @dev This function returns the same price as `getEmaPrice` in the case where the price is available.
/// However, if the price is not recent this function returns the latest available price.
///
/// The returned price can be from arbitrarily far in the past; this function makes no guarantees that
/// the returned price is recent or useful for any particular application.
///
/// Users of this function should check the `publishTime` in the price to ensure that the returned price is
/// sufficiently recent for their application. If you are considering using this function, it may be
/// safer / easier to use either `getEmaPrice` or `getEmaPriceNoOlderThan`.
/// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
function getEmaPriceUnsafe(
bytes32 id
) external view returns (PythStructs.Price memory price);
/// @notice Returns the exponentially-weighted moving average price that is no older than `age` seconds
/// of the current time.
/// @dev This function is a sanity-checked version of `getEmaPriceUnsafe` which is useful in
/// applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently
/// recently.
/// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
function getEmaPriceNoOlderThan(
bytes32 id,
uint age
) external view returns (PythStructs.Price memory price);
/// @notice Update price feeds with given update messages.
/// This method requires the caller to pay a fee in wei; the required fee can be computed by calling
/// `getUpdateFee` with the length of the `updateData` array.
/// Prices will be updated if they are more recent than the current stored prices.
/// The call will succeed even if the update is not the most recent.
/// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid.
/// @param updateData Array of price update data.
function updatePriceFeeds(bytes[] calldata updateData) external payable;
/// @notice Wrapper around updatePriceFeeds that rejects fast if a price update is not necessary. A price update is
/// necessary if the current on-chain publishTime is older than the given publishTime. It relies solely on the
/// given `publishTimes` for the price feeds and does not read the actual price update publish time within `updateData`.
///
/// This method requires the caller to pay a fee in wei; the required fee can be computed by calling
/// `getUpdateFee` with the length of the `updateData` array.
///
/// `priceIds` and `publishTimes` are two arrays with the same size that correspond to senders known publishTime
/// of each priceId when calling this method. If all of price feeds within `priceIds` have updated and have
/// a newer or equal publish time than the given publish time, it will reject the transaction to save gas.
/// Otherwise, it calls updatePriceFeeds method to update the prices.
///
/// @dev Reverts if update is not needed or the transferred fee is not sufficient or the updateData is invalid.
/// @param updateData Array of price update data.
/// @param priceIds Array of price ids.
/// @param publishTimes Array of publishTimes. `publishTimes[i]` corresponds to known `publishTime` of `priceIds[i]`
function updatePriceFeedsIfNecessary(
bytes[] calldata updateData,
bytes32[] calldata priceIds,
uint64[] calldata publishTimes
) external payable;
/// @notice Returns the required fee to update an array of price updates.
/// @param updateData Array of price update data.
/// @return feeAmount The required fee in Wei.
function getUpdateFee(
bytes[] calldata updateData
) external view returns (uint feeAmount);
/// @notice Returns the required fee to update a TWAP price.
/// @param updateData Array of price update data.
/// @return feeAmount The required fee in Wei.
function getTwapUpdateFee(
bytes[] calldata updateData
) external view returns (uint feeAmount);
/// @notice Parse `updateData` and return price feeds of the given `priceIds` if they are all published
/// within `minPublishTime` and `maxPublishTime`.
///
/// You can use this method if you want to use a Pyth price at a fixed time and not the most recent price;
/// otherwise, please consider using `updatePriceFeeds`. This method will not store the price updates on-chain.
///
/// This method requires the caller to pay a fee in wei; the required fee can be computed by calling
/// `getUpdateFee` with the length of the `updateData` array.
///
///
/// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid or there is
/// no update for any of the given `priceIds` within the given time range.
/// @param updateData Array of price update data.
/// @param priceIds Array of price ids.
/// @param minPublishTime minimum acceptable publishTime for the given `priceIds`.
/// @param maxPublishTime maximum acceptable publishTime for the given `priceIds`.
/// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order).
function parsePriceFeedUpdates(
bytes[] calldata updateData,
bytes32[] calldata priceIds,
uint64 minPublishTime,
uint64 maxPublishTime
) external payable returns (PythStructs.PriceFeed[] memory priceFeeds);
/// @notice Parse `updateData` and return price feeds of the given `priceIds` if they are all published
/// within `minPublishTime` and `maxPublishTime,` but choose to store price updates if `storeUpdatesIfFresh`.
///
/// You can use this method if you want to use a Pyth price at a fixed time and not the most recent price;
/// otherwise, please consider using `updatePriceFeeds`. This method may store the price updates on-chain, if they
/// are more recent than the current stored prices.
///
/// This method requires the caller to pay a fee in wei; the required fee can be computed by calling
/// `getUpdateFee` with the length of the `updateData` array.
///
/// This method will eventually allow the caller to determine whether parsed price feeds should update
/// the stored values as well.
///
/// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid or there is
/// no update for any of the given `priceIds` within the given time range.
/// @param updateData Array of price update data.
/// @param priceIds Array of price ids.
/// @param minAllowedPublishTime minimum acceptable publishTime for the given `priceIds`.
/// @param maxAllowedPublishTime maximum acceptable publishTime for the given `priceIds`.
/// @param storeUpdatesIfFresh flag for the parse function to
/// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order).
function parsePriceFeedUpdatesWithConfig(
bytes[] calldata updateData,
bytes32[] calldata priceIds,
uint64 minAllowedPublishTime,
uint64 maxAllowedPublishTime,
bool checkUniqueness,
bool checkUpdateDataIsMinimal,
bool storeUpdatesIfFresh
)
external
payable
returns (
PythStructs.PriceFeed[] memory priceFeeds,
uint64[] memory slots
);
/// @notice Parse time-weighted average price (TWAP) from two consecutive price updates for the given `priceIds`.
///
/// This method calculates TWAP between two data points by processing the difference in cumulative price values
/// divided by the time period. It requires exactly two updates that contain valid price information
/// for all the requested price IDs.
///
/// This method requires the caller to pay a fee in wei; the required fee can be computed by calling
/// `getUpdateFee` with the updateData array.
///
/// @dev Reverts if:
/// - The transferred fee is not sufficient
/// - The updateData is invalid or malformed
/// - The updateData array does not contain exactly 2 updates
/// - There is no update for any of the given `priceIds`
/// - The time ordering between data points is invalid (start time must be before end time)
/// @param updateData Array containing exactly two price updates (start and end points for TWAP calculation)
/// @param priceIds Array of price ids to calculate TWAP for
/// @return twapPriceFeeds Array of TWAP price feeds corresponding to the given `priceIds` (with the same order)
function parseTwapPriceFeedUpdates(
bytes[] calldata updateData,
bytes32[] calldata priceIds
)
external
payable
returns (PythStructs.TwapPriceFeed[] memory twapPriceFeeds);
/// @notice Similar to `parsePriceFeedUpdates` but ensures the updates returned are
/// the first updates published in minPublishTime. That is, if there are multiple updates for a given timestamp,
/// this method will return the first update. This method may store the price updates on-chain, if they
/// are more recent than the current stored prices.
///
///
/// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid or there is
/// no update for any of the given `priceIds` within the given time range and uniqueness condition.
/// @param updateData Array of price update data.
/// @param priceIds Array of price ids.
/// @param minPublishTime minimum acceptable publishTime for the given `priceIds`.
/// @param maxPublishTime maximum acceptable publishTime for the given `priceIds`.
/// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order).
function parsePriceFeedUpdatesUnique(
bytes[] calldata updateData,
bytes32[] calldata priceIds,
uint64 minPublishTime,
uint64 maxPublishTime
) external payable returns (PythStructs.PriceFeed[] memory priceFeeds);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
/// @title IPythEvents contains the events that Pyth contract emits.
/// @dev This interface can be used for listening to the updates for off-chain and testing purposes.
interface IPythEvents {
/// @dev Emitted when the price feed with `id` has received a fresh update.
/// @param id The Pyth Price Feed ID.
/// @param publishTime Publish time of the given price update.
/// @param price Price of the given price update.
/// @param conf Confidence interval of the given price update.
event PriceFeedUpdate(
bytes32 indexed id,
uint64 publishTime,
int64 price,
uint64 conf
);
/// @dev Emitted when the TWAP price feed with `id` has received a fresh update.
/// @param id The Pyth Price Feed ID.
/// @param startTime Start time of the TWAP.
/// @param endTime End time of the TWAP.
/// @param twapPrice Price of the TWAP.
/// @param twapConf Confidence interval of the TWAP.
/// @param downSlotsRatio Down slot ratio of the TWAP.
event TwapPriceFeedUpdate(
bytes32 indexed id,
uint64 startTime,
uint64 endTime,
int64 twapPrice,
uint64 twapConf,
uint32 downSlotsRatio
);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
contract PythStructs {
// A price with a degree of uncertainty, represented as a price +- a confidence interval.
//
// The confidence interval roughly corresponds to the standard error of a normal distribution.
// Both the price and confidence are stored in a fixed-point numeric representation,
// `x * (10^expo)`, where `expo` is the exponent.
//
// Please refer to the documentation at https://docs.pyth.network/documentation/pythnet-price-feeds/best-practices for how
// to how this price safely.
struct Price {
// Price
int64 price;
// Confidence interval around the price
uint64 conf;
// Price exponent
int32 expo;
// Unix timestamp describing when the price was published
uint publishTime;
}
// PriceFeed represents a current aggregate price from pyth publisher feeds.
struct PriceFeed {
// The price ID.
bytes32 id;
// Latest available price
Price price;
// Latest available exponentially-weighted moving average price
Price emaPrice;
}
struct TwapPriceFeed {
// The price ID.
bytes32 id;
// Start time of the TWAP
uint64 startTime;
// End time of the TWAP
uint64 endTime;
// TWAP price
Price twap;
// Down slot ratio represents the ratio of price feed updates that were missed or unavailable
// during the TWAP period, expressed as a fixed-point number between 0 and 1e6 (100%).
// For example:
// - 0 means all price updates were available
// - 500_000 means 50% of updates were missed
// - 1_000_000 means all updates were missed
// This can be used to assess the quality/reliability of the TWAP calculation.
// Applications should define a maximum acceptable ratio (e.g. 100000 for 10%)
// and revert if downSlotsRatio exceeds it.
uint32 downSlotsRatio;
}
// Information used to calculate time-weighted average prices (TWAP)
struct TwapPriceInfo {
// slot 1
int128 cumulativePrice;
uint128 cumulativeConf;
// slot 2
uint64 numDownSlots;
uint64 publishSlot;
uint64 publishTime;
uint64 prevPublishTime;
// slot 3
int32 expo;
}
}{
"optimizer": {
"enabled": true,
"runs": 99999
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_oracleAddress","type":"address"},{"internalType":"bytes32","name":"_priceFeedId","type":"bytes32"},{"internalType":"address","name":"_adminAddress","type":"address"},{"internalType":"address","name":"_operatorAddress","type":"address"},{"internalType":"uint256","name":"_intervalSeconds","type":"uint256"},{"internalType":"uint256","name":"_bufferSeconds","type":"uint256"},{"internalType":"uint256","name":"_minBetAmount","type":"uint256"},{"internalType":"uint256","name":"_oracleUpdateAllowance","type":"uint256"},{"internalType":"uint256","name":"_treasuryFee","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BetBear","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BetBull","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"int256","name":"price","type":"int256"}],"name":"EndRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"int256","name":"price","type":"int256"}],"name":"LockRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"admin","type":"address"}],"name":"NewAdminAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"bufferSeconds","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"intervalSeconds","type":"uint256"}],"name":"NewBufferAndIntervalSeconds","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minBetAmount","type":"uint256"}],"name":"NewMinBetAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"operator","type":"address"}],"name":"NewOperatorAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oracle","type":"address"}],"name":"NewOracle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oracleUpdateAllowance","type":"uint256"}],"name":"NewOracleUpdateAllowance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"treasuryFee","type":"uint256"}],"name":"NewTreasuryFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardBaseCalAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"treasuryAmount","type":"uint256"}],"name":"RewardsCalculated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"StartRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenRecovery","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TreasuryClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MAX_TREASURY_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"betBear","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"betBull","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"bufferSeconds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"epochs","type":"uint256[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"claimable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"executeRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"genesisLockOnce","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"genesisLockRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"genesisStartOnce","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"genesisStartRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"cursor","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"}],"name":"getUserRounds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"components":[{"internalType":"enum LumosPredictionV2.Position","name":"position","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"claimed","type":"bool"}],"internalType":"struct LumosPredictionV2.BetInfo[]","name":"","type":"tuple[]"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserRoundsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"intervalSeconds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"ledger","outputs":[{"internalType":"enum LumosPredictionV2.Position","name":"position","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"claimed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minBetAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"contract IPyth","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracleLatestRoundId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracleUpdateAllowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceFeedId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recoverToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"refundable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rounds","outputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"lockTimestamp","type":"uint256"},{"internalType":"uint256","name":"closeTimestamp","type":"uint256"},{"internalType":"int256","name":"lockPrice","type":"int256"},{"internalType":"int256","name":"closePrice","type":"int256"},{"internalType":"uint256","name":"lockOracleId","type":"uint256"},{"internalType":"uint256","name":"closeOracleId","type":"uint256"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"uint256","name":"bullAmount","type":"uint256"},{"internalType":"uint256","name":"bearAmount","type":"uint256"},{"internalType":"uint256","name":"rewardBaseCalAmount","type":"uint256"},{"internalType":"uint256","name":"rewardAmount","type":"uint256"},{"internalType":"bool","name":"oracleCalled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_adminAddress","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bufferSeconds","type":"uint256"},{"internalType":"uint256","name":"_intervalSeconds","type":"uint256"}],"name":"setBufferAndIntervalSeconds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minBetAmount","type":"uint256"}],"name":"setMinBetAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operatorAddress","type":"address"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_oracleUpdateAllowance","type":"uint256"}],"name":"setOracleUpdateAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_priceFeedId","type":"bytes32"}],"name":"setPriceFeedId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_treasuryFee","type":"uint256"}],"name":"setTreasuryFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasuryFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userRounds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60806040526004805461ffff191690553480156200001c57600080fd5b5060405162004ee338038062004ee38339810160408190526200003f9162000193565b6200004a3362000126565b6000805460ff60a01b19169055600180556103e8811115620000b25760405162461bcd60e51b815260206004820152601560248201527f54726561737572792066656520746f6f20686967680000000000000000000000604482015260640160405180910390fd5b600280546001600160a01b039a8b166001600160a01b03199182161790915560039890985560048054978a16620100000262010000600160b01b03199098169790971790965560058054959098169490961693909317909555600755600693909355600892909255600d5560095562000217565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200018e57600080fd5b919050565b60008060008060008060008060006101208a8c031215620001b2578485fd5b620001bd8a62000176565b985060208a01519750620001d460408b0162000176565b9650620001e460608b0162000176565b955060808a0151945060a08a0151935060c08a0151925060e08a015191506101008a015190509295985092959850929598565b614cbc80620002276000396000f3fe6080604052600436106102e65760003560e01c80637d1cd04f11610184578063cc32d176116100d6578063ec3247031161008a578063f7fdec2811610064578063f7fdec2814610905578063fa968eea14610924578063fc6f94681461093a57600080fd5b8063ec324703146108b9578063f2b3c809146108cf578063f2fde38b146108e557600080fd5b8063d9d55eac116100bb578063d9d55eac1461086e578063dd1f759614610883578063eaba2361146108a357600080fd5b8063cc32d17614610838578063cf2f50391461084e57600080fd5b80638da5cb5b11610138578063aa6b873a11610112578063aa6b873a146107e5578063b29a8140146107f8578063b3ab15fb1461081857600080fd5b80638da5cb5b1461076b578063951fd60014610796578063a0c7f71c146107c557600080fd5b80638456cb59116101695780638456cb5914610641578063890dc766146106565780638c65c81f1461067657600080fd5b80637d1cd04f146105fe5780637dc0d1d01461061457600080fd5b8063605540111161023d5780637285c58b116101f15780637adbf973116101cb5780637adbf973146105a95780637b3205f5146105c95780637bf41254146105de57600080fd5b80637285c58b14610518578063766718081461057357806377e741c71461058957600080fd5b80636c188593116102225780636c188593146104c3578063704b6c02146104e3578063715018a61461050357600080fd5b8063605540111461048d5780636ba4c138146104a357600080fd5b8063273867d41161029f578063452fd75a11610279578063452fd75a1461043557806357fb096f1461044a5780635c975abb1461045d57600080fd5b8063273867d4146103c7578063368acb091461040a5780633f4ba83a1461042057600080fd5b8063127effb2116102d0578063127effb2146103315780631999bb9e1461038357806325df52e3146103a757600080fd5b80623bdc74146102eb5780630f74174f14610302575b600080fd5b3480156102f757600080fd5b5061030061096d565b005b34801561030e57600080fd5b5060045461031c9060ff1681565b60405190151581526020015b60405180910390f35b34801561033d57600080fd5b5060055461035e9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610328565b34801561038f57600080fd5b5061039960035481565b604051908152602001610328565b3480156103b357600080fd5b506103006103c23660046148d2565b610a72565b3480156103d357600080fd5b506103996103e23660046147c6565b73ffffffffffffffffffffffffffffffffffffffff1660009081526010602052604090205490565b34801561041657600080fd5b50610399600a5481565b34801561042c57600080fd5b50610300610b6d565b34801561044157600080fd5b50610300610c7c565b6103006104583660046148d2565b610de7565b34801561046957600080fd5b5060005474010000000000000000000000000000000000000000900460ff1661031c565b34801561049957600080fd5b50610399600d5481565b3480156104af57600080fd5b506103006104be366004614842565b611199565b3480156104cf57600080fd5b506103006104de3660046148d2565b611969565b3480156104ef57600080fd5b506103006104fe3660046147c6565b611a9e565b34801561050f57600080fd5b50610300611ba5565b34801561052457600080fd5b5061056461053336600461498f565b600e60209081526000928352604080842090915290825290208054600182015460029092015460ff91821692911683565b60405161032893929190614ad4565b34801561057f57600080fd5b50610399600b5481565b34801561059557600080fd5b506103006105a43660046148d2565b611bb7565b3480156105b557600080fd5b506103006105c43660046147c6565b611cea565b3480156105d557600080fd5b50610300611f17565b3480156105ea57600080fd5b5061031c6105f936600461498f565b6120fe565b34801561060a57600080fd5b5061039960075481565b34801561062057600080fd5b5060025461035e9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561064d57600080fd5b506103006122c9565b34801561066257600080fd5b506103006106713660046149ba565b6123b0565b34801561068257600080fd5b506107016106913660046148d2565b600f60205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a8b0154600b8c0154600c8d0154600d909d01549b9c9a9b999a98999798969795969495939492939192909160ff168e565b604080519e8f5260208f019d909d529b8d019a909a5260608c019890985260808b019690965260a08a019490945260c089019290925260e088015261010087015261012086015261014085015261016084015261018083015215156101a08201526101c001610328565b34801561077757600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661035e565b3480156107a257600080fd5b506107b66107b1366004614810565b612515565b60405161032893929190614a32565b3480156107d157600080fd5b5061031c6107e036600461498f565b6128f6565b6103006107f33660046148d2565b612b67565b34801561080457600080fd5b506103006108133660046147e7565b612f09565b34801561082457600080fd5b506103006108333660046147c6565b612f86565b34801561084457600080fd5b5061039960095481565b34801561085a57600080fd5b506103006108693660046148d2565b6130fd565b34801561087a57600080fd5b506103006131c1565b34801561088f57600080fd5b5061039961089e3660046147e7565b6133fa565b3480156108af57600080fd5b5061039960065481565b3480156108c557600080fd5b50610399600c5481565b3480156108db57600080fd5b506103996103e881565b3480156108f157600080fd5b506103006109003660046147c6565b61342b565b34801561091157600080fd5b5060045461031c90610100900460ff1681565b34801561093057600080fd5b5061039960085481565b34801561094657600080fd5b5060045461035e9062010000900473ffffffffffffffffffffffffffffffffffffffff1681565b6109756134df565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff163314610a01576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b600a80546000909155600454610a339062010000900473ffffffffffffffffffffffffffffffffffffffff1682613553565b6040518181527fb9197c6b8e21274bd1e2d9c956a88af5cfee510f630fab3f046300f88b4223619060200160405180910390a150610a7060018055565b565b610a7a613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff163314610b01576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b80610b68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f43616e6e6f74206265207a65726f00000000000000000000000000000000000060448201526064016109f8565b600355565b610b75613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff16331480610bb8575060055473ffffffffffffffffffffffffffffffffffffffff1633145b610c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f4e6f74206f70657261746f722f61646d696e000000000000000000000000000060448201526064016109f8565b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000169055610c4e6136cc565b600b546040517faaa520fdd7d2c83061d632fa017b0432407e798818af63ea908589fceda39ab790600090a2565b610c84613749565b60055473ffffffffffffffffffffffffffffffffffffffff163314610d05576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f74206f70657261746f72000000000000000000000000000000000000000060448201526064016109f8565b600454610100900460ff1615610d9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f43616e206f6e6c792072756e2067656e657369735374617274526f756e64206f60448201527f6e6365000000000000000000000000000000000000000000000000000000000060648201526084016109f8565b600b54610dab906001614b49565b600b819055610db9906137ce565b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b610def613749565b610df76134df565b333b15610e60576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f77656400000000000000000000000060448201526064016109f8565b333214610ec9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f77656400000000000060448201526064016109f8565b600b548114610f34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42657420697320746f6f206561726c792f6c617465000000000000000000000060448201526064016109f8565b610f3d8161384c565b610fa3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f526f756e64206e6f74206265747461626c65000000000000000000000000000060448201526064016109f8565b600854341015611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f42657420616d6f756e74206d7573742062652067726561746572207468616e2060448201527f6d696e426574416d6f756e74000000000000000000000000000000000000000060648201526084016109f8565b6000818152600e60209081526040808320338452909152902060010154156110b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f43616e206f6e6c7920626574206f6e63652070657220726f756e64000000000060448201526064016109f8565b6000818152600f6020526040902060088101543491906110da908390614b49565b600882015560098101546110ef908390614b49565b60098201556000838152600e602090815260408083203380855290835281842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016815560018082018890556010855283862080549182018155865294849020909401879055905185815286927f438122d8cff518d18388099a5181f0d17a12b4f1b55faedf6e4a6acee0060c1291015b60405180910390a350505061119660018055565b50565b6111a16134df565b333b1561120a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f77656400000000000000000000000060448201526064016109f8565b333214611273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f77656400000000000060448201526064016109f8565b6000805b8281101561194a57600f60008585848181106112bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201358152602001908152602001600020600101546000141561133f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f526f756e6420686173206e6f742073746172746564000000000000000000000060448201526064016109f8565b600f600085858481811061137c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002013581526020019081526020016000206003015442116113fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f526f756e6420686173206e6f7420656e6465640000000000000000000000000060448201526064016109f8565b6000600f600086868581811061143c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029290920135835250810191909152604001600020600d015460ff16156116c1576114aa85858481811061149d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135336128f6565b611510576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4e6f7420656c696769626c6520666f7220636c61696d0000000000000000000060448201526064016109f8565b6000600f600087878681811061154f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029290920135835250818101929092526040908101600090812082516101c081018452815481526001820154948101949094526002810154928401929092526003820154606084015260048201546080840152600582015460a0840152600682015460c0840152600782015460e084015260088201546101008401526009820154610120840152600a820154610140840152600b8201546101608401819052600c8301546101808501819052600d9093015460ff1615156101a0850152929350600e9089898881811061164f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546116af9190614b9a565b6116b99190614b61565b915050611806565b61170a8585848181106116fd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135336120fe565b611770576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420656c696769626c6520666f7220726566756e6400000000000000000060448201526064016109f8565b600e60008686858181106117ad577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490505b6001600e6000878786818110611845577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602090810292909201358352508181019290925260409081016000908120338252909252902060020180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790556118a58184614b49565b92508484838181106118e0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201353373ffffffffffffffffffffffffffffffffffffffff167f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf78360405161192f91815260200190565b60405180910390a3508061194281614c1e565b915050611277565b50801561195b5761195b3382613553565b5061196560018055565b5050565b611971613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff1633146119f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b80611a5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d757374206265207375706572696f7220746f2030000000000000000000000060448201526064016109f8565b6008819055600b546040518281527f90eb87c560a0213754ceb3a7fa3012f01acab0a35602c1e1995adf69dabc9d50906020015b60405180910390a250565b611aa66138b7565b73ffffffffffffffffffffffffffffffffffffffff8116611b23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f43616e6e6f74206265207a65726f20616464726573730000000000000000000060448201526064016109f8565b600480547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff8416908102919091179091556040519081527f137b621413925496477d46e5055ac0d56178bdd724ba8bf843afceef18268ba3906020015b60405180910390a150565b611bad6138b7565b610a706000613938565b611bbf613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff163314611c46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b6103e8811115611cb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f54726561737572792066656520746f6f2068696768000000000000000000000060448201526064016109f8565b6009819055600b546040518281527fb1c4ee38d35556741133da7ff9b6f7ab0fa88d0406133126ff128f635490a85790602001611a93565b611cf2613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff163314611d79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b73ffffffffffffffffffffffffffffffffffffffff8116611df6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f43616e6e6f74206265207a65726f20616464726573730000000000000000000060448201526064016109f8565b6000600c55600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117909155600354600d546040517fa4ae35e00000000000000000000000000000000000000000000000000000000081526004810192909252602482015263a4ae35e09060440160806040518083038186803b158015611e9857600080fd5b505afa158015611eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed091906148ea565b5060405173ffffffffffffffffffffffffffffffffffffffff821681527fb3eacd0e351fafdfefdec84e1cd19679b38dbcd63ea7c2c24da17fd2bc3b3c0e90602001611b9a565b611f1f613749565b60055473ffffffffffffffffffffffffffffffffffffffff163314611fa0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f74206f70657261746f72000000000000000000000000000000000000000060448201526064016109f8565b600454610100900460ff168015611fb9575060045460ff165b61206b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f43616e206f6e6c792072756e2061667465722067656e6573697353746172745260448201527f6f756e6420616e642067656e657369734c6f636b526f756e642069732074726960648201527f6767657265640000000000000000000000000000000000000000000000000000608482015260a4016109f8565b6000806120766139ad565b915091508169ffffffffffffffffffff16600c819055506120a6600b548369ffffffffffffffffffff1683613b16565b6120cb6001600b546120b89190614bd7565b8369ffffffffffffffffffff1683613d6f565b6120e26001600b546120dd9190614bd7565b613fdc565b600b546120f0906001614b49565b600b8190556119659061417f565b6000828152600e6020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152808220815160608101909252805483929190829060ff16600181111561217a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60018111156121b2577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b815260018281015460208084019190915260029384015460ff908116151560409485015260008a8152600f835284902084516101c08101865281548152938101549284019290925293810154928201929092526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201526009820154610120820152600a820154610140820152600b820154610160820152600c820154610180820152600d909101549091161580156101a08301819052929350909161229357508160400151155b80156122af575060065481606001516122ac9190614b49565b42115b80156122be5750602082015115155b925050505b92915050565b6122d1613749565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff16331480612314575060055473ffffffffffffffffffffffffffffffffffffffff1633145b61237a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f4e6f74206f70657261746f722f61646d696e000000000000000000000000000060448201526064016109f8565b612382614380565b600b546040517f68b095021b1f40fe513109f513c66692f0b3219aee674a69f4efc57badb8201d90600090a2565b6123b8613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff16331461243f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b8082106124ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f6275666665725365636f6e6473206d75737420626520696e666572696f72207460448201527f6f20696e74657276616c5365636f6e647300000000000000000000000000000060648201526084016109f8565b6006829055600781905560408051838152602081018390527fe60149e0431fec12df63dfab5fce2a9cefe9a4d3df5f41cb626f579ae1f2b91a910160405180910390a15050565b73ffffffffffffffffffffffffffffffffffffffff83166000908152601060205260408120546060918291849061254d908790614bd7565b8111156125885773ffffffffffffffffffffffffffffffffffffffff8716600090815260106020526040902054612585908790614bd7565b90505b60008167ffffffffffffffff8111156125ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156125f3578160200160208202803683370190505b50905060008267ffffffffffffffff811115612638577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156126a157816020015b60408051606081018252600080825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816126565790505b50905060005b838110156128d75773ffffffffffffffffffffffffffffffffffffffff8a1660009081526010602052604090206126de828b614b49565b81548110612715577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154838281518110612759577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018181525050600e60008483815181106127a2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020908102919091018101518252818101929092526040908101600090812073ffffffffffffffffffffffffffffffffffffffff8e168252909252908190208151606081019092528054829060ff166001811115612829577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6001811115612861577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b81526001820154602082015260029091015460ff16151560409091015282518390839081106128b9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018190525080806128cf90614c1e565b9150506126a7565b5081816128e4858b614b49565b95509550955050505093509350939050565b6000828152600e6020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152808220815160608101909252805483929190829060ff166001811115612972577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60018111156129aa577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b815260018281015460208084019190915260029384015460ff908116151560409485015260008a8152600f835284902084516101c081018652815481529381015492840192909252938101549282019290925260038201546060820152600482015460808201819052600583015460a08301819052600684015460c0840152600784015460e084015260088401546101008401526009840154610120840152600a840154610140840152600b840154610160840152600c840154610180840152600d9093015490931615156101a08201529293501415612a8f576000925050506122c3565b806101a001518015612aa45750602082015115155b8015612ab257508160400151155b80156122be575080608001518160a00151138015612b095750600082516001811115612b07577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b145b806122be575080608001518160a001511280156122be5750600182516001811115612b5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b1495945050505050565b612b6f613749565b612b776134df565b333b15612be0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f77656400000000000000000000000060448201526064016109f8565b333214612c49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f77656400000000000060448201526064016109f8565b600b548114612cb4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42657420697320746f6f206561726c792f6c617465000000000000000000000060448201526064016109f8565b612cbd8161384c565b612d23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f526f756e64206e6f74206265747461626c65000000000000000000000000000060448201526064016109f8565b600854341015612db5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f42657420616d6f756e74206d7573742062652067726561746572207468616e2060448201527f6d696e426574416d6f756e74000000000000000000000000000000000000000060648201526084016109f8565b6000818152600e6020908152604080832033845290915290206001015415612e39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f43616e206f6e6c7920626574206f6e63652070657220726f756e64000000000060448201526064016109f8565b6000818152600f602052604090206008810154349190612e5a908390614b49565b6008820155600a810154612e6f908390614b49565b600a8201556000838152600e602090815260408083203380855290835281842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811782558082018890556010855283862080549182018155865294849020909401879055905185815286927f0d8c1fe3e67ab767116a81f122b83c2557a8c2564019cb7c4f83de1aeb1f1f0d9101611182565b612f116138b7565b612f3273ffffffffffffffffffffffffffffffffffffffff831633836143ef565b8173ffffffffffffffffffffffffffffffffffffffff167f14f11966a996e0629572e51064726d2057a80fbd34efc066682c06a71dbb6e9882604051612f7a91815260200190565b60405180910390a25050565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff16331461300d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b73ffffffffffffffffffffffffffffffffffffffff811661308a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f43616e6e6f74206265207a65726f20616464726573730000000000000000000060448201526064016109f8565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527fc47d127c07bdd56c5ccba00463ce3bd3c1bca71b4670eea6e5d0c02e4aa156e290602001611b9a565b613105613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff16331461318c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b600d8190556040518181527f93ccaceac092ffb842c46b8718667a13a80e9058dcd0bd403d0b47215b30da0790602001611b9a565b6131c9613749565b60055473ffffffffffffffffffffffffffffffffffffffff16331461324a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f74206f70657261746f72000000000000000000000000000000000000000060448201526064016109f8565b600454610100900460ff166132e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f43616e206f6e6c792072756e2061667465722067656e6573697353746172745260448201527f6f756e642069732074726967676572656400000000000000000000000000000060648201526084016109f8565b60045460ff1615613374576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f43616e206f6e6c792072756e2067656e657369734c6f636b526f756e64206f6e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016109f8565b60008061337f6139ad565b915091508169ffffffffffffffffffff16600c819055506133af600b548369ffffffffffffffffffff1683613b16565b600b546133bd906001614b49565b600b8190556133cb906137ce565b5050600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b6010602052816000526040600020818154811061341657600080fd5b90600052602060002001600091509150505481565b6134336138b7565b73ffffffffffffffffffffffffffffffffffffffff81166134d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016109f8565b61119681613938565b6002600154141561354c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109f8565b6002600155565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146135ad576040519150601f19603f3d011682016040523d82523d6000602084013e6135b2565b606091505b5050905080613643576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f5472616e7366657248656c7065723a20424e425f5452414e534645525f46414960448201527f4c4544000000000000000000000000000000000000000000000000000000000060648201526084016109f8565b505050565b60005474010000000000000000000000000000000000000000900460ff16610a70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016109f8565b6136d4613648565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b60005474010000000000000000000000000000000000000000900460ff1615610a70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016109f8565b6000818152600f6020526040902042600182018190556007546137f091614b49565b60028083019190915560075461380591614b9a565b61380f9042614b49565b600382015581815560006008820181905560405183917f939f42374aa9bf1d8d8cd56d8a9110cb040cd8dfeae44080c6fcf2645e51b45291a25050565b6000818152600f60205260408120600101541580159061387c57506000828152600f602052604090206002015415155b801561389857506000828152600f602052604090206001015442115b80156122c35750506000908152600f6020526040902060020154421090565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109f8565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600254600354600d546040517fa4ae35e0000000000000000000000000000000000000000000000000000000008152600481019290925260248201526000918291829173ffffffffffffffffffffffffffffffffffffffff169063a4ae35e09060440160806040518083038186803b158015613a2857600080fd5b505afa158015613a3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a6091906148ea565b6060810151600c549192509069ffffffffffffffffffff821611613b06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f4f7261636c652075706461746520726f756e644964206d757374206265206c6160448201527f72676572207468616e206f7261636c654c6174657374526f756e64496400000060648201526084016109f8565b9051909360079190910b92509050565b6000838152600f6020526040902060010154613bb4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f43616e206f6e6c79206c6f636b20726f756e6420616674657220726f756e642060448201527f686173207374617274656400000000000000000000000000000000000000000060648201526084016109f8565b6000838152600f6020526040902060020154421015613c55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f43616e206f6e6c79206c6f636b20726f756e64206166746572206c6f636b546960448201527f6d657374616d700000000000000000000000000000000000000000000000000060648201526084016109f8565b6006546000848152600f6020526040902060020154613c749190614b49565b421115613d03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f43616e206f6e6c79206c6f636b20726f756e642077697468696e20627566666560448201527f725365636f6e647300000000000000000000000000000000000000000000000060648201526084016109f8565b6000838152600f60205260409020600754613d1e9042614b49565b60038201556004810182905560068101839055604051828152839085907f482e76a65b448a42deef26e99e58fb20c85e26f075defff8df6aa80459b39006906020015b60405180910390a350505050565b6000838152600f6020526040902060020154613e0d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f43616e206f6e6c7920656e6420726f756e6420616674657220726f756e64206860448201527f6173206c6f636b6564000000000000000000000000000000000000000000000060648201526084016109f8565b6000838152600f6020526040902060030154421015613eae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f43616e206f6e6c7920656e6420726f756e6420616674657220636c6f7365546960448201527f6d657374616d700000000000000000000000000000000000000000000000000060648201526084016109f8565b6006546000848152600f6020526040902060030154613ecd9190614b49565b421115613f5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f43616e206f6e6c7920656e6420726f756e642077697468696e2062756666657260448201527f5365636f6e64730000000000000000000000000000000000000000000000000060648201526084016109f8565b6000838152600f6020526040908190206005810183905560078101849055600d810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790559051839085907fb6ff1fe915db84788cbbbc017f0d2bef9485fad9fd0bd8ce9340fde0d8410dd890613d619086815260200190565b6000818152600f60205260409020600b015415801561400a57506000818152600f60205260409020600c0154155b614070576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f526577617264732063616c63756c61746564000000000000000000000000000060448201526064016109f8565b6000818152600f60205260408120600481015460058201549192918291829113156140d4578360090154925061271060095485600801546140b19190614b9a565b6140bb9190614b61565b91508184600801546140cd9190614bd7565b905061410d565b8360040154846005015412156141005783600a0154925061271060095485600801546140b19190614b9a565b5050506008810154600090815b600b8401839055600c8401819055600a8054839190600090614130908490614b49565b9091555050604080518481526020810183905290810183905285907f6dfdfcb09c8804d0058826cd2539f1acfbe3cb887c9be03d928035bce0f1a58d9060600160405180910390a25050505050565b600454610100900460ff16614216576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f43616e206f6e6c792072756e2061667465722067656e6573697353746172745260448201527f6f756e642069732074726967676572656400000000000000000000000000000060648201526084016109f8565b600f6000614225600284614bd7565b815260200190815260200160002060030154600014156142c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f43616e206f6e6c7920737461727420726f756e6420616674657220726f756e6460448201527f206e2d322068617320656e64656400000000000000000000000000000000000060648201526084016109f8565b600f60006142d6600284614bd7565b815260200190815260200160002060030154421015614377576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f43616e206f6e6c79207374617274206e657720726f756e64206166746572207260448201527f6f756e64206e2d3220636c6f736554696d657374616d7000000000000000000060648201526084016109f8565b611196816137ce565b614388613749565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861371f3390565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092018352602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656490840152613643928692916000916144ba918516908490614567565b90508051600014806144db5750808060200190518101906144db91906148b2565b613643576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016109f8565b6060614576848460008561457e565b949350505050565b606082471015614610576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016109f8565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516146399190614a16565b60006040518083038185875af1925050503d8060008114614676576040519150601f19603f3d011682016040523d82523d6000602084013e61467b565b606091505b509150915061468c87838387614697565b979650505050505050565b6060831561472a5782516147235773ffffffffffffffffffffffffffffffffffffffff85163b614723576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109f8565b5081614576565b614576838381511561473f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f89190614af8565b803573ffffffffffffffffffffffffffffffffffffffff8116811461479757600080fd5b919050565b8051600381900b811461479757600080fd5b805167ffffffffffffffff8116811461479757600080fd5b6000602082840312156147d7578081fd5b6147e082614773565b9392505050565b600080604083850312156147f9578081fd5b61480283614773565b946020939093013593505050565b600080600060608486031215614824578081fd5b61482d84614773565b95602085013595506040909401359392505050565b60008060208385031215614854578182fd5b823567ffffffffffffffff8082111561486b578384fd5b818501915085601f83011261487e578384fd5b81358181111561488c578485fd5b8660208260051b85010111156148a0578485fd5b60209290920196919550909350505050565b6000602082840312156148c3578081fd5b815180151581146147e0578182fd5b6000602082840312156148e3578081fd5b5035919050565b6000608082840312156148fb578081fd5b6040516080810181811067ffffffffffffffff82111715614943577f4e487b710000000000000000000000000000000000000000000000000000000083526041600452602483fd5b6040528251600781900b8114614957578283fd5b8152614965602084016147ae565b60208201526149766040840161479c565b6040820152606083015160608201528091505092915050565b600080604083850312156149a1578182fd5b823591506149b160208401614773565b90509250929050565b600080604083850312156149cc578182fd5b50508035926020909101359150565b60028110614a12577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b60008251614a28818460208701614bee565b9190910192915050565b60608082528451828201819052600091906020906080850190828901855b82811015614a6c57815184529284019290840190600101614a50565b50505084810382860152865180825287830191830190855b81811015614abd578351614a998482516149db565b80860151848701526040908101511515908401529284019291850191600101614a84565b505080945050505050826040830152949350505050565b60608101614ae282866149db565b8360208301528215156040830152949350505050565b6020815260008251806020840152614b17816040850160208701614bee565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60008219821115614b5c57614b5c614c57565b500190565b600082614b95577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614bd257614bd2614c57565b500290565b600082821015614be957614be9614c57565b500390565b60005b83811015614c09578181015183820152602001614bf1565b83811115614c18576000848401525b50505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614c5057614c50614c57565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea264697066735822122084e6bc89adbf2ad85bd3b8940571bc3544f7bd87e53d38a6be93af6f40519b4c64736f6c634300080400330000000000000000000000002880ab155794e7179c9ee2e38200202908c17b43f490b178d0c85683b7a0f2388b40af2e6f7c90cbe0f96b31f315f08d0e5a2d6d0000000000000000000000004b9a16f82569d5edea55823df185614751bda0320000000000000000000000004b9a16f82569d5edea55823df185614751bda032000000000000000000000000000000000000000000000000000000000000012c000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000012c
Deployed Bytecode
0x6080604052600436106102e65760003560e01c80637d1cd04f11610184578063cc32d176116100d6578063ec3247031161008a578063f7fdec2811610064578063f7fdec2814610905578063fa968eea14610924578063fc6f94681461093a57600080fd5b8063ec324703146108b9578063f2b3c809146108cf578063f2fde38b146108e557600080fd5b8063d9d55eac116100bb578063d9d55eac1461086e578063dd1f759614610883578063eaba2361146108a357600080fd5b8063cc32d17614610838578063cf2f50391461084e57600080fd5b80638da5cb5b11610138578063aa6b873a11610112578063aa6b873a146107e5578063b29a8140146107f8578063b3ab15fb1461081857600080fd5b80638da5cb5b1461076b578063951fd60014610796578063a0c7f71c146107c557600080fd5b80638456cb59116101695780638456cb5914610641578063890dc766146106565780638c65c81f1461067657600080fd5b80637d1cd04f146105fe5780637dc0d1d01461061457600080fd5b8063605540111161023d5780637285c58b116101f15780637adbf973116101cb5780637adbf973146105a95780637b3205f5146105c95780637bf41254146105de57600080fd5b80637285c58b14610518578063766718081461057357806377e741c71461058957600080fd5b80636c188593116102225780636c188593146104c3578063704b6c02146104e3578063715018a61461050357600080fd5b8063605540111461048d5780636ba4c138146104a357600080fd5b8063273867d41161029f578063452fd75a11610279578063452fd75a1461043557806357fb096f1461044a5780635c975abb1461045d57600080fd5b8063273867d4146103c7578063368acb091461040a5780633f4ba83a1461042057600080fd5b8063127effb2116102d0578063127effb2146103315780631999bb9e1461038357806325df52e3146103a757600080fd5b80623bdc74146102eb5780630f74174f14610302575b600080fd5b3480156102f757600080fd5b5061030061096d565b005b34801561030e57600080fd5b5060045461031c9060ff1681565b60405190151581526020015b60405180910390f35b34801561033d57600080fd5b5060055461035e9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610328565b34801561038f57600080fd5b5061039960035481565b604051908152602001610328565b3480156103b357600080fd5b506103006103c23660046148d2565b610a72565b3480156103d357600080fd5b506103996103e23660046147c6565b73ffffffffffffffffffffffffffffffffffffffff1660009081526010602052604090205490565b34801561041657600080fd5b50610399600a5481565b34801561042c57600080fd5b50610300610b6d565b34801561044157600080fd5b50610300610c7c565b6103006104583660046148d2565b610de7565b34801561046957600080fd5b5060005474010000000000000000000000000000000000000000900460ff1661031c565b34801561049957600080fd5b50610399600d5481565b3480156104af57600080fd5b506103006104be366004614842565b611199565b3480156104cf57600080fd5b506103006104de3660046148d2565b611969565b3480156104ef57600080fd5b506103006104fe3660046147c6565b611a9e565b34801561050f57600080fd5b50610300611ba5565b34801561052457600080fd5b5061056461053336600461498f565b600e60209081526000928352604080842090915290825290208054600182015460029092015460ff91821692911683565b60405161032893929190614ad4565b34801561057f57600080fd5b50610399600b5481565b34801561059557600080fd5b506103006105a43660046148d2565b611bb7565b3480156105b557600080fd5b506103006105c43660046147c6565b611cea565b3480156105d557600080fd5b50610300611f17565b3480156105ea57600080fd5b5061031c6105f936600461498f565b6120fe565b34801561060a57600080fd5b5061039960075481565b34801561062057600080fd5b5060025461035e9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561064d57600080fd5b506103006122c9565b34801561066257600080fd5b506103006106713660046149ba565b6123b0565b34801561068257600080fd5b506107016106913660046148d2565b600f60205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a8b0154600b8c0154600c8d0154600d909d01549b9c9a9b999a98999798969795969495939492939192909160ff168e565b604080519e8f5260208f019d909d529b8d019a909a5260608c019890985260808b019690965260a08a019490945260c089019290925260e088015261010087015261012086015261014085015261016084015261018083015215156101a08201526101c001610328565b34801561077757600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661035e565b3480156107a257600080fd5b506107b66107b1366004614810565b612515565b60405161032893929190614a32565b3480156107d157600080fd5b5061031c6107e036600461498f565b6128f6565b6103006107f33660046148d2565b612b67565b34801561080457600080fd5b506103006108133660046147e7565b612f09565b34801561082457600080fd5b506103006108333660046147c6565b612f86565b34801561084457600080fd5b5061039960095481565b34801561085a57600080fd5b506103006108693660046148d2565b6130fd565b34801561087a57600080fd5b506103006131c1565b34801561088f57600080fd5b5061039961089e3660046147e7565b6133fa565b3480156108af57600080fd5b5061039960065481565b3480156108c557600080fd5b50610399600c5481565b3480156108db57600080fd5b506103996103e881565b3480156108f157600080fd5b506103006109003660046147c6565b61342b565b34801561091157600080fd5b5060045461031c90610100900460ff1681565b34801561093057600080fd5b5061039960085481565b34801561094657600080fd5b5060045461035e9062010000900473ffffffffffffffffffffffffffffffffffffffff1681565b6109756134df565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff163314610a01576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b600a80546000909155600454610a339062010000900473ffffffffffffffffffffffffffffffffffffffff1682613553565b6040518181527fb9197c6b8e21274bd1e2d9c956a88af5cfee510f630fab3f046300f88b4223619060200160405180910390a150610a7060018055565b565b610a7a613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff163314610b01576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b80610b68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f43616e6e6f74206265207a65726f00000000000000000000000000000000000060448201526064016109f8565b600355565b610b75613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff16331480610bb8575060055473ffffffffffffffffffffffffffffffffffffffff1633145b610c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f4e6f74206f70657261746f722f61646d696e000000000000000000000000000060448201526064016109f8565b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000169055610c4e6136cc565b600b546040517faaa520fdd7d2c83061d632fa017b0432407e798818af63ea908589fceda39ab790600090a2565b610c84613749565b60055473ffffffffffffffffffffffffffffffffffffffff163314610d05576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f74206f70657261746f72000000000000000000000000000000000000000060448201526064016109f8565b600454610100900460ff1615610d9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f43616e206f6e6c792072756e2067656e657369735374617274526f756e64206f60448201527f6e6365000000000000000000000000000000000000000000000000000000000060648201526084016109f8565b600b54610dab906001614b49565b600b819055610db9906137ce565b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055565b610def613749565b610df76134df565b333b15610e60576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f77656400000000000000000000000060448201526064016109f8565b333214610ec9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f77656400000000000060448201526064016109f8565b600b548114610f34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42657420697320746f6f206561726c792f6c617465000000000000000000000060448201526064016109f8565b610f3d8161384c565b610fa3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f526f756e64206e6f74206265747461626c65000000000000000000000000000060448201526064016109f8565b600854341015611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f42657420616d6f756e74206d7573742062652067726561746572207468616e2060448201527f6d696e426574416d6f756e74000000000000000000000000000000000000000060648201526084016109f8565b6000818152600e60209081526040808320338452909152902060010154156110b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f43616e206f6e6c7920626574206f6e63652070657220726f756e64000000000060448201526064016109f8565b6000818152600f6020526040902060088101543491906110da908390614b49565b600882015560098101546110ef908390614b49565b60098201556000838152600e602090815260408083203380855290835281842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016815560018082018890556010855283862080549182018155865294849020909401879055905185815286927f438122d8cff518d18388099a5181f0d17a12b4f1b55faedf6e4a6acee0060c1291015b60405180910390a350505061119660018055565b50565b6111a16134df565b333b1561120a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f77656400000000000000000000000060448201526064016109f8565b333214611273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f77656400000000000060448201526064016109f8565b6000805b8281101561194a57600f60008585848181106112bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201358152602001908152602001600020600101546000141561133f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f526f756e6420686173206e6f742073746172746564000000000000000000000060448201526064016109f8565b600f600085858481811061137c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002013581526020019081526020016000206003015442116113fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f526f756e6420686173206e6f7420656e6465640000000000000000000000000060448201526064016109f8565b6000600f600086868581811061143c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029290920135835250810191909152604001600020600d015460ff16156116c1576114aa85858481811061149d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135336128f6565b611510576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4e6f7420656c696769626c6520666f7220636c61696d0000000000000000000060448201526064016109f8565b6000600f600087878681811061154f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029290920135835250818101929092526040908101600090812082516101c081018452815481526001820154948101949094526002810154928401929092526003820154606084015260048201546080840152600582015460a0840152600682015460c0840152600782015460e084015260088201546101008401526009820154610120840152600a820154610140840152600b8201546101608401819052600c8301546101808501819052600d9093015460ff1615156101a0850152929350600e9089898881811061164f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546116af9190614b9a565b6116b99190614b61565b915050611806565b61170a8585848181106116fd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135336120fe565b611770576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420656c696769626c6520666f7220726566756e6400000000000000000060448201526064016109f8565b600e60008686858181106117ad577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020135815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015490505b6001600e6000878786818110611845577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602090810292909201358352508181019290925260409081016000908120338252909252902060020180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790556118a58184614b49565b92508484838181106118e0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201353373ffffffffffffffffffffffffffffffffffffffff167f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf78360405161192f91815260200190565b60405180910390a3508061194281614c1e565b915050611277565b50801561195b5761195b3382613553565b5061196560018055565b5050565b611971613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff1633146119f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b80611a5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d757374206265207375706572696f7220746f2030000000000000000000000060448201526064016109f8565b6008819055600b546040518281527f90eb87c560a0213754ceb3a7fa3012f01acab0a35602c1e1995adf69dabc9d50906020015b60405180910390a250565b611aa66138b7565b73ffffffffffffffffffffffffffffffffffffffff8116611b23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f43616e6e6f74206265207a65726f20616464726573730000000000000000000060448201526064016109f8565b600480547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff8416908102919091179091556040519081527f137b621413925496477d46e5055ac0d56178bdd724ba8bf843afceef18268ba3906020015b60405180910390a150565b611bad6138b7565b610a706000613938565b611bbf613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff163314611c46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b6103e8811115611cb2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f54726561737572792066656520746f6f2068696768000000000000000000000060448201526064016109f8565b6009819055600b546040518281527fb1c4ee38d35556741133da7ff9b6f7ab0fa88d0406133126ff128f635490a85790602001611a93565b611cf2613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff163314611d79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b73ffffffffffffffffffffffffffffffffffffffff8116611df6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f43616e6e6f74206265207a65726f20616464726573730000000000000000000060448201526064016109f8565b6000600c55600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117909155600354600d546040517fa4ae35e00000000000000000000000000000000000000000000000000000000081526004810192909252602482015263a4ae35e09060440160806040518083038186803b158015611e9857600080fd5b505afa158015611eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed091906148ea565b5060405173ffffffffffffffffffffffffffffffffffffffff821681527fb3eacd0e351fafdfefdec84e1cd19679b38dbcd63ea7c2c24da17fd2bc3b3c0e90602001611b9a565b611f1f613749565b60055473ffffffffffffffffffffffffffffffffffffffff163314611fa0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f74206f70657261746f72000000000000000000000000000000000000000060448201526064016109f8565b600454610100900460ff168015611fb9575060045460ff165b61206b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f43616e206f6e6c792072756e2061667465722067656e6573697353746172745260448201527f6f756e6420616e642067656e657369734c6f636b526f756e642069732074726960648201527f6767657265640000000000000000000000000000000000000000000000000000608482015260a4016109f8565b6000806120766139ad565b915091508169ffffffffffffffffffff16600c819055506120a6600b548369ffffffffffffffffffff1683613b16565b6120cb6001600b546120b89190614bd7565b8369ffffffffffffffffffff1683613d6f565b6120e26001600b546120dd9190614bd7565b613fdc565b600b546120f0906001614b49565b600b8190556119659061417f565b6000828152600e6020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152808220815160608101909252805483929190829060ff16600181111561217a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60018111156121b2577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b815260018281015460208084019190915260029384015460ff908116151560409485015260008a8152600f835284902084516101c08101865281548152938101549284019290925293810154928201929092526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201526009820154610120820152600a820154610140820152600b820154610160820152600c820154610180820152600d909101549091161580156101a08301819052929350909161229357508160400151155b80156122af575060065481606001516122ac9190614b49565b42115b80156122be5750602082015115155b925050505b92915050565b6122d1613749565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff16331480612314575060055473ffffffffffffffffffffffffffffffffffffffff1633145b61237a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f4e6f74206f70657261746f722f61646d696e000000000000000000000000000060448201526064016109f8565b612382614380565b600b546040517f68b095021b1f40fe513109f513c66692f0b3219aee674a69f4efc57badb8201d90600090a2565b6123b8613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff16331461243f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b8082106124ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f6275666665725365636f6e6473206d75737420626520696e666572696f72207460448201527f6f20696e74657276616c5365636f6e647300000000000000000000000000000060648201526084016109f8565b6006829055600781905560408051838152602081018390527fe60149e0431fec12df63dfab5fce2a9cefe9a4d3df5f41cb626f579ae1f2b91a910160405180910390a15050565b73ffffffffffffffffffffffffffffffffffffffff83166000908152601060205260408120546060918291849061254d908790614bd7565b8111156125885773ffffffffffffffffffffffffffffffffffffffff8716600090815260106020526040902054612585908790614bd7565b90505b60008167ffffffffffffffff8111156125ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156125f3578160200160208202803683370190505b50905060008267ffffffffffffffff811115612638577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156126a157816020015b60408051606081018252600080825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816126565790505b50905060005b838110156128d75773ffffffffffffffffffffffffffffffffffffffff8a1660009081526010602052604090206126de828b614b49565b81548110612715577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154838281518110612759577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018181525050600e60008483815181106127a2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020908102919091018101518252818101929092526040908101600090812073ffffffffffffffffffffffffffffffffffffffff8e168252909252908190208151606081019092528054829060ff166001811115612829577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6001811115612861577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b81526001820154602082015260029091015460ff16151560409091015282518390839081106128b9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018190525080806128cf90614c1e565b9150506126a7565b5081816128e4858b614b49565b95509550955050505093509350939050565b6000828152600e6020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152808220815160608101909252805483929190829060ff166001811115612972577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60018111156129aa577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b815260018281015460208084019190915260029384015460ff908116151560409485015260008a8152600f835284902084516101c081018652815481529381015492840192909252938101549282019290925260038201546060820152600482015460808201819052600583015460a08301819052600684015460c0840152600784015460e084015260088401546101008401526009840154610120840152600a840154610140840152600b840154610160840152600c840154610180840152600d9093015490931615156101a08201529293501415612a8f576000925050506122c3565b806101a001518015612aa45750602082015115155b8015612ab257508160400151155b80156122be575080608001518160a00151138015612b095750600082516001811115612b07577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b145b806122be575080608001518160a001511280156122be5750600182516001811115612b5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b1495945050505050565b612b6f613749565b612b776134df565b333b15612be0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f436f6e7472616374206e6f7420616c6c6f77656400000000000000000000000060448201526064016109f8565b333214612c49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f77656400000000000060448201526064016109f8565b600b548114612cb4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42657420697320746f6f206561726c792f6c617465000000000000000000000060448201526064016109f8565b612cbd8161384c565b612d23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f526f756e64206e6f74206265747461626c65000000000000000000000000000060448201526064016109f8565b600854341015612db5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f42657420616d6f756e74206d7573742062652067726561746572207468616e2060448201527f6d696e426574416d6f756e74000000000000000000000000000000000000000060648201526084016109f8565b6000818152600e6020908152604080832033845290915290206001015415612e39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f43616e206f6e6c7920626574206f6e63652070657220726f756e64000000000060448201526064016109f8565b6000818152600f602052604090206008810154349190612e5a908390614b49565b6008820155600a810154612e6f908390614b49565b600a8201556000838152600e602090815260408083203380855290835281842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811782558082018890556010855283862080549182018155865294849020909401879055905185815286927f0d8c1fe3e67ab767116a81f122b83c2557a8c2564019cb7c4f83de1aeb1f1f0d9101611182565b612f116138b7565b612f3273ffffffffffffffffffffffffffffffffffffffff831633836143ef565b8173ffffffffffffffffffffffffffffffffffffffff167f14f11966a996e0629572e51064726d2057a80fbd34efc066682c06a71dbb6e9882604051612f7a91815260200190565b60405180910390a25050565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff16331461300d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b73ffffffffffffffffffffffffffffffffffffffff811661308a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f43616e6e6f74206265207a65726f20616464726573730000000000000000000060448201526064016109f8565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527fc47d127c07bdd56c5ccba00463ce3bd3c1bca71b4670eea6e5d0c02e4aa156e290602001611b9a565b613105613648565b60045462010000900473ffffffffffffffffffffffffffffffffffffffff16331461318c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f742061646d696e000000000000000000000000000000000000000000000060448201526064016109f8565b600d8190556040518181527f93ccaceac092ffb842c46b8718667a13a80e9058dcd0bd403d0b47215b30da0790602001611b9a565b6131c9613749565b60055473ffffffffffffffffffffffffffffffffffffffff16331461324a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f74206f70657261746f72000000000000000000000000000000000000000060448201526064016109f8565b600454610100900460ff166132e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f43616e206f6e6c792072756e2061667465722067656e6573697353746172745260448201527f6f756e642069732074726967676572656400000000000000000000000000000060648201526084016109f8565b60045460ff1615613374576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f43616e206f6e6c792072756e2067656e657369734c6f636b526f756e64206f6e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016109f8565b60008061337f6139ad565b915091508169ffffffffffffffffffff16600c819055506133af600b548369ffffffffffffffffffff1683613b16565b600b546133bd906001614b49565b600b8190556133cb906137ce565b5050600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b6010602052816000526040600020818154811061341657600080fd5b90600052602060002001600091509150505481565b6134336138b7565b73ffffffffffffffffffffffffffffffffffffffff81166134d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016109f8565b61119681613938565b6002600154141561354c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109f8565b6002600155565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146135ad576040519150601f19603f3d011682016040523d82523d6000602084013e6135b2565b606091505b5050905080613643576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f5472616e7366657248656c7065723a20424e425f5452414e534645525f46414960448201527f4c4544000000000000000000000000000000000000000000000000000000000060648201526084016109f8565b505050565b60005474010000000000000000000000000000000000000000900460ff16610a70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016109f8565b6136d4613648565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b60005474010000000000000000000000000000000000000000900460ff1615610a70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016109f8565b6000818152600f6020526040902042600182018190556007546137f091614b49565b60028083019190915560075461380591614b9a565b61380f9042614b49565b600382015581815560006008820181905560405183917f939f42374aa9bf1d8d8cd56d8a9110cb040cd8dfeae44080c6fcf2645e51b45291a25050565b6000818152600f60205260408120600101541580159061387c57506000828152600f602052604090206002015415155b801561389857506000828152600f602052604090206001015442115b80156122c35750506000908152600f6020526040902060020154421090565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109f8565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600254600354600d546040517fa4ae35e0000000000000000000000000000000000000000000000000000000008152600481019290925260248201526000918291829173ffffffffffffffffffffffffffffffffffffffff169063a4ae35e09060440160806040518083038186803b158015613a2857600080fd5b505afa158015613a3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a6091906148ea565b6060810151600c549192509069ffffffffffffffffffff821611613b06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f4f7261636c652075706461746520726f756e644964206d757374206265206c6160448201527f72676572207468616e206f7261636c654c6174657374526f756e64496400000060648201526084016109f8565b9051909360079190910b92509050565b6000838152600f6020526040902060010154613bb4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f43616e206f6e6c79206c6f636b20726f756e6420616674657220726f756e642060448201527f686173207374617274656400000000000000000000000000000000000000000060648201526084016109f8565b6000838152600f6020526040902060020154421015613c55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f43616e206f6e6c79206c6f636b20726f756e64206166746572206c6f636b546960448201527f6d657374616d700000000000000000000000000000000000000000000000000060648201526084016109f8565b6006546000848152600f6020526040902060020154613c749190614b49565b421115613d03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f43616e206f6e6c79206c6f636b20726f756e642077697468696e20627566666560448201527f725365636f6e647300000000000000000000000000000000000000000000000060648201526084016109f8565b6000838152600f60205260409020600754613d1e9042614b49565b60038201556004810182905560068101839055604051828152839085907f482e76a65b448a42deef26e99e58fb20c85e26f075defff8df6aa80459b39006906020015b60405180910390a350505050565b6000838152600f6020526040902060020154613e0d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f43616e206f6e6c7920656e6420726f756e6420616674657220726f756e64206860448201527f6173206c6f636b6564000000000000000000000000000000000000000000000060648201526084016109f8565b6000838152600f6020526040902060030154421015613eae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f43616e206f6e6c7920656e6420726f756e6420616674657220636c6f7365546960448201527f6d657374616d700000000000000000000000000000000000000000000000000060648201526084016109f8565b6006546000848152600f6020526040902060030154613ecd9190614b49565b421115613f5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f43616e206f6e6c7920656e6420726f756e642077697468696e2062756666657260448201527f5365636f6e64730000000000000000000000000000000000000000000000000060648201526084016109f8565b6000838152600f6020526040908190206005810183905560078101849055600d810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790559051839085907fb6ff1fe915db84788cbbbc017f0d2bef9485fad9fd0bd8ce9340fde0d8410dd890613d619086815260200190565b6000818152600f60205260409020600b015415801561400a57506000818152600f60205260409020600c0154155b614070576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f526577617264732063616c63756c61746564000000000000000000000000000060448201526064016109f8565b6000818152600f60205260408120600481015460058201549192918291829113156140d4578360090154925061271060095485600801546140b19190614b9a565b6140bb9190614b61565b91508184600801546140cd9190614bd7565b905061410d565b8360040154846005015412156141005783600a0154925061271060095485600801546140b19190614b9a565b5050506008810154600090815b600b8401839055600c8401819055600a8054839190600090614130908490614b49565b9091555050604080518481526020810183905290810183905285907f6dfdfcb09c8804d0058826cd2539f1acfbe3cb887c9be03d928035bce0f1a58d9060600160405180910390a25050505050565b600454610100900460ff16614216576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f43616e206f6e6c792072756e2061667465722067656e6573697353746172745260448201527f6f756e642069732074726967676572656400000000000000000000000000000060648201526084016109f8565b600f6000614225600284614bd7565b815260200190815260200160002060030154600014156142c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f43616e206f6e6c7920737461727420726f756e6420616674657220726f756e6460448201527f206e2d322068617320656e64656400000000000000000000000000000000000060648201526084016109f8565b600f60006142d6600284614bd7565b815260200190815260200160002060030154421015614377576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f43616e206f6e6c79207374617274206e657720726f756e64206166746572207260448201527f6f756e64206e2d3220636c6f736554696d657374616d7000000000000000000060648201526084016109f8565b611196816137ce565b614388613749565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861371f3390565b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092018352602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656490840152613643928692916000916144ba918516908490614567565b90508051600014806144db5750808060200190518101906144db91906148b2565b613643576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016109f8565b6060614576848460008561457e565b949350505050565b606082471015614610576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016109f8565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516146399190614a16565b60006040518083038185875af1925050503d8060008114614676576040519150601f19603f3d011682016040523d82523d6000602084013e61467b565b606091505b509150915061468c87838387614697565b979650505050505050565b6060831561472a5782516147235773ffffffffffffffffffffffffffffffffffffffff85163b614723576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109f8565b5081614576565b614576838381511561473f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f89190614af8565b803573ffffffffffffffffffffffffffffffffffffffff8116811461479757600080fd5b919050565b8051600381900b811461479757600080fd5b805167ffffffffffffffff8116811461479757600080fd5b6000602082840312156147d7578081fd5b6147e082614773565b9392505050565b600080604083850312156147f9578081fd5b61480283614773565b946020939093013593505050565b600080600060608486031215614824578081fd5b61482d84614773565b95602085013595506040909401359392505050565b60008060208385031215614854578182fd5b823567ffffffffffffffff8082111561486b578384fd5b818501915085601f83011261487e578384fd5b81358181111561488c578485fd5b8660208260051b85010111156148a0578485fd5b60209290920196919550909350505050565b6000602082840312156148c3578081fd5b815180151581146147e0578182fd5b6000602082840312156148e3578081fd5b5035919050565b6000608082840312156148fb578081fd5b6040516080810181811067ffffffffffffffff82111715614943577f4e487b710000000000000000000000000000000000000000000000000000000083526041600452602483fd5b6040528251600781900b8114614957578283fd5b8152614965602084016147ae565b60208201526149766040840161479c565b6040820152606083015160608201528091505092915050565b600080604083850312156149a1578182fd5b823591506149b160208401614773565b90509250929050565b600080604083850312156149cc578182fd5b50508035926020909101359150565b60028110614a12577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b60008251614a28818460208701614bee565b9190910192915050565b60608082528451828201819052600091906020906080850190828901855b82811015614a6c57815184529284019290840190600101614a50565b50505084810382860152865180825287830191830190855b81811015614abd578351614a998482516149db565b80860151848701526040908101511515908401529284019291850191600101614a84565b505080945050505050826040830152949350505050565b60608101614ae282866149db565b8360208301528215156040830152949350505050565b6020815260008251806020840152614b17816040850160208701614bee565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60008219821115614b5c57614b5c614c57565b500190565b600082614b95577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614bd257614bd2614c57565b500290565b600082821015614be957614be9614c57565b500390565b60005b83811015614c09578181015183820152602001614bf1565b83811115614c18576000848401525b50505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614c5057614c50614c57565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea264697066735822122084e6bc89adbf2ad85bd3b8940571bc3544f7bd87e53d38a6be93af6f40519b4c64736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b43f490b178d0c85683b7a0f2388b40af2e6f7c90cbe0f96b31f315f08d0e5a2d6d0000000000000000000000004b9a16f82569d5edea55823df185614751bda0320000000000000000000000004b9a16f82569d5edea55823df185614751bda032000000000000000000000000000000000000000000000000000000000000012c000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000012c
-----Decoded View---------------
Arg [0] : _oracleAddress (address): 0x2880aB155794e7179c9eE2e38200202908C17B43
Arg [1] : _priceFeedId (bytes32): 0xf490b178d0c85683b7a0f2388b40af2e6f7c90cbe0f96b31f315f08d0e5a2d6d
Arg [2] : _adminAddress (address): 0x4b9A16f82569D5edEA55823Df185614751BDA032
Arg [3] : _operatorAddress (address): 0x4b9A16f82569D5edEA55823Df185614751BDA032
Arg [4] : _intervalSeconds (uint256): 300
Arg [5] : _bufferSeconds (uint256): 60
Arg [6] : _minBetAmount (uint256): 1000000000000000
Arg [7] : _oracleUpdateAllowance (uint256): 60
Arg [8] : _treasuryFee (uint256): 300
-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b43
Arg [1] : f490b178d0c85683b7a0f2388b40af2e6f7c90cbe0f96b31f315f08d0e5a2d6d
Arg [2] : 0000000000000000000000004b9a16f82569d5edea55823df185614751bda032
Arg [3] : 0000000000000000000000004b9a16f82569d5edea55823df185614751bda032
Arg [4] : 000000000000000000000000000000000000000000000000000000000000012c
Arg [5] : 000000000000000000000000000000000000000000000000000000000000003c
Arg [6] : 00000000000000000000000000000000000000000000000000038d7ea4c68000
Arg [7] : 000000000000000000000000000000000000000000000000000000000000003c
Arg [8] : 000000000000000000000000000000000000000000000000000000000000012c
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in S
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
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.