ERC-20
Overview
Max Total Supply
2,049 NIST
Holders
18
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
0.5357142857142857 NISTValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
NitroStakingToken
Compiler Version
v0.6.6+commit.6c089d02
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.6.6; import '@openzeppelin/contracts/access/Ownable.sol'; import { SafeERC20, SafeMath, IERC20, Address, NitroStaking, UniswapV2Library, IKeep3rV1Mini } from "./NitroStaking.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import { UniswapV2OracleLibrary , FixedPoint } from "@uniswap/v2-periphery/contracts/libraries/UniswapV2OracleLibrary.sol"; // @dev DegenerateGameTheorist contract NitroStakingToken is ERC20, NitroStaking, Ownable, Pausable { using SafeMath for uint256; /// @notice Scale factor for NITRO calculations uint256 public constant scaleFactor = 1e18; /// @notice Total supply uint256 public constant total_supply = 2049 ether; /// @notice uniswap listing rate uint256 public constant INITIAL_TOKENS_PER_ETH = 2 * 1 ether; /// @dev The minimum amount of time an address must be above minimumRewardBalance to receive rewards (1 hour in seconds) uint256 minimumBalanceHoldingTime = 1 hours; /// @notice self-explanatory address public constant uniswapV2Factory = address(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); address public initialDistributionAddress; address public presaleContractAddress; uint256 public presaleInitFunds; /// @notice liquidity sources (e.g. UniswapV2Router) mapping(address => bool) public whitelistedSenders; /// @notice exchange addresses (tokens sent here will count as sell orders in NITRO Protocol) mapping(address => bool) public exchangeAddresses; /// @notice uniswap pair for LAMBO/ETH address public uniswapPair; /// @notice Whether or not this token is first in uniswap LAMBO<>ETH pair bool public isThisToken0; /// @notice last TWAP update time (Short calculation) uint32 public blockTimestampLast; /// @notice last TWAP cumulative price (Short calculation) uint256 public priceCumulativeLast; /// @notice last TWAP average price (Short calculation) uint256 public priceAverageLast; /// @notice last TWAP update time uint32 public blockTimestampLastLong; /// @notice last TWAP cumulative price uint256 public priceCumulativeLastLong; /// @notice last TWAP average price uint256 public priceAverageLastLong; /// @notice TWAP min delta (48-hour) uint256 public minDeltaTwapLong; /// @notice TWAP min delta (Short) uint256 public minDeltaTwapShort; /// @notice The previous calculated Nitro value for buyers uint256 public lastBuyNitroPercent; /// @notice The previous calculated Nitro value for sellers uint256 public lastSellNitroPercent; //Lets us check to see if the user account is moving lambo at this address' request address public uniswapv2RouterAddress; //The contract describing the LP tokens users can stake IERC20 public LPTokenContract; //Emittable Events event TwapUpdated(uint256 priceCumulativeLast, uint256 blockTimestampLast, uint256 priceAverageLast); event LongTwapUpdated(uint256 priceCumulativeLastLong, uint256 blockTimestampLastLong, uint256 priceAverageLastLong); event MaxSellRemovalUpdated(uint256 new_MSR); event MaxBuyBonusUpdated(uint256 new_MBB); event ExchangeListUpdated(address exchangeAddress, bool isExchange); // ------------------ Contract Start Functions --------------------- // constructor( uint256 _minDeltaTwapLong, uint256 _minDeltaTwapShort, address rlrToken ) public Ownable() ERC20("Nitro Staking Token", "NIST") { previousRewardDistributionTimestamp = block.timestamp; setMinDeltaTwap(_minDeltaTwapLong, _minDeltaTwapShort); _setMaxBuyBonusPercentage(5*scaleFactor.div(100)); _changeMaxSellRemoval(10*scaleFactor.div(100)); initialDistributionAddress = owner(); //The contract owner handles all initial distribution, except for presale _distributeTokens(); initPair(); _pause(); setUniswapRouterAddress(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); //Approve uniswap router to spend nist _approve(address(this), uniswapv2RouterAddress, uint256(-1)); whitelistedSenders[address(this)] = true;//Whitelist the contract itself to swap to eth without burn RLR = IKeep3rV1Mini(rlrToken); } modifier whenNotPausedOrInitialDistribution(address tokensender) { //Only used on transfer function require(!paused() || msg.sender == initialDistributionAddress || _isWhitelistedSender(msg.sender) || (msg.sender == uniswapv2RouterAddress && tokensender == owner()), "!paused && !initialDistributionAddress !InitialLiquidityProvider"); _; } modifier onlyInitialDistributionAddress() { //Only used to initialize twap require(msg.sender == initialDistributionAddress, "!initialDistributionAddress"); _; } function _distributeTokens() internal { _mint(address(this), total_supply); setWhitelistedSender(address(this), true); } /* * Initialize the uniswap pair address to predict it and define it as an exchange address. */ function initPair() internal { // Create a uniswap pair for this new token uniswapPair = IUniswapV2Factory(uniswapV2Factory).createPair(address(this), router.WETH()); setExchangeAddress(uniswapPair, true); (address token0,) = UniswapV2Library.sortTokens(address(this), router.WETH()); isThisToken0 = (token0 == address(this)); } /* function _initializePair() internal { (address token0, address token1) = UniswapV2Library.sortTokens(address(this), address(WETH)); isThisToken0 = (token0 == address(this)); uniswapPair = UniswapV2Library.pairFor(uniswapV2Factory, token0, token1); setExchangeAddress(uniswapPair, true); } */ function setUniswapRouterAddress(address newUniRouterAddy) public onlyOwner { uniswapv2RouterAddress = newUniRouterAddy; } function setLiquidityTokenContract(address LPTokenAddy) public onlyOwner { LPTokenContract = IERC20(LPTokenAddy); } //////////////////---------------- Administrative Functions ----------------/////////////// /** * @dev Unpauses all transfers from the distribution address (initial liquidity pool). */ function unpause() external virtual onlyOwner { super._unpause(); } //////////////////----------------Modify Nitro Protocol Variables----------------/////////////// //Modify the maxSellRemoval function changeMaxSellRemoval(uint256 maxSellRemoval) public onlyOwner { require(maxSellRemoval < 100, "Max Sell Removal is too high!"); require(maxSellRemoval > 0, "Max Sell Removal is too small!"); //Send it to the NitroProtocol _changeMaxSellRemoval(maxSellRemoval); //Emit this transaction emit MaxSellRemovalUpdated(maxSellRemoval); } /* * Sets the address of the presale contract ; required for project to work properly. * The presale contract address can only be set one time, to prevent re-sending of the 508 lambo. */ function setPresaleContractAddress(address presaleContract) public onlyOwner { //We only want this to fire off once so the dev can't do any shady shit if(presaleContractAddress==address(0)){ //Store address for posterity presaleContractAddress = presaleContract; //Whitelist the presale contract so that it can transfer tokens while contract is paused setWhitelistedSender(presaleContractAddress, true); //Send the tokens to the presale contract. super._transfer(address(this), presaleContractAddress, balanceOf(address(this))); initialDistributionAddress = presaleContract; //Transfer ownership to presale contract transferOwnership(presaleContract); } } /** * @dev Set the maximum percent order volume of bonus tokens for buyers */ function setMaxBuyBonusPercentage(uint256 _maxBuyBonus) public onlyOwner { require(_maxBuyBonus < 100*scaleFactor.div(100), "Max Buy Bonus is too high!"); require(_maxBuyBonus > 0, "Max Buy Bonus is too small!"); _setMaxBuyBonusPercentage(_maxBuyBonus); //Emit Buy Bonus was updated emit MaxBuyBonusUpdated(_maxBuyBonus); } //////////////////----------------Modify Contract Variables----------------/////////////// /** * @dev Min time elapsed before twap is updated. */ function setMinDeltaTwap(uint256 _minDeltaTwapLong, uint256 _minDeltaTwapShort) internal { require(_minDeltaTwapLong > 1 seconds, "Minimum delTWAP (Long) is too small!"); require(_minDeltaTwapShort > 1 seconds, "Minimum delTWAP (Short) is too small!"); require(_minDeltaTwapLong > _minDeltaTwapShort, "Long delta is smaller than short delta!"); minDeltaTwapLong = _minDeltaTwapLong; minDeltaTwapShort = _minDeltaTwapShort; } /** * @dev Sets a whitelisted sender/receiver (nitro protocol does not apply). */ function setWhitelistedSender(address _address, bool _whitelisted) public onlyOwner { whitelistedSenders[_address] = _whitelisted; } /** * @dev Sets a known exchange address (tokens sent from these addresses will count as buy orders, tokens sent to these addresses count as sell orders) */ function setExchangeAddress(address _address, bool _isexchange) public onlyOwner { exchangeAddresses[_address] = _isexchange; emit ExchangeListUpdated(_address, _isexchange); } function _isWhitelistedSender(address _sender) internal view returns (bool) { return whitelistedSenders[_sender]; } //Public to allow us to easily update exchange addresses in the future function isExchangeAddress(address _sender) public view returns (bool) { return exchangeAddresses[_sender]; } function setRelayerJobAddress(address job) public onlyOwner { RelayerJob = payable(job); } // ------------------ Nitro Implementation --------------------- // function _transfer(address sender, address recipient, uint256 amount) internal virtual override whenNotPausedOrInitialDistribution(sender) { //If this isn't a whitelisted sender(such as, this contract itself, the distribution address, or the router) if(!_isWhitelistedSender(sender)){ //if msg sender is an exchange, then this was a buy if(isExchangeAddress(sender)){ _updateTwapsAndNitro(); //Perform the core transaction (exchange address to user) super._transfer(sender, recipient, amount); //Calculate how many bonus tokens they've earned uint256 bonus_tokens_amount = lastBuyNitroPercent.mul(amount).div(scaleFactor); //Check we can afford it from the Nitro Protocol balance if(balanceOf(address(this)) > bonus_tokens_amount.add(_totalNistToDist)){ super._transfer(address(this), recipient, bonus_tokens_amount); } //if recipient is an exchange, then this was a sell }else if(isExchangeAddress(recipient)) { _updateTwapsAndNitro(); //Calculate how many tokens need to be removed from the order uint256 removed_tokens_amount = lastSellNitroPercent.mul(amount).div(scaleFactor); //Remove the tokens from the amount to be sent amount = amount.sub(removed_tokens_amount,"sellUnderflow"); updateStakingOutputPerSecond(_totalNistToDist.add(removed_tokens_amount.div(2)), remainingNISTToAllocate.add(removed_tokens_amount.div(2))); //Perform the core transaction (user to exchange address) super._transfer(sender, recipient, amount); //Send the nitro tokens to this contract so we can swap them for eth super._transfer(sender, address(this), removed_tokens_amount); //Take this opportunity to update staking data for this nonwhitelisted,nonexchange sender updateStake(sender, balanceOf(sender)); }else { //Take this opportunity to update staking data for this nonwhitelisted, nonexchange sender updateStake(sender, balanceOf(sender).sub(amount)); //Perform the core transaction (user to user) super._transfer(sender, recipient, amount); } }else { //Perform the core transaction (whitelisted to anything) super._transfer(sender, recipient, amount); } //Tell the NitroStaker to update the recipients possible staking balance if(!_isWhitelistedSender(recipient) && !isExchangeAddress(recipient)) updateStake(recipient, balanceOf(recipient)); } // ------------------ TWAP Functions --------------------- // /* * This function updates the most realtime price you can possibly get, given a short mindeltatwapshort (5-10 minutes) */ function getCurrentShortTwap() public view returns (uint256) { (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) = UniswapV2OracleLibrary.currentCumulativePrices(uniswapPair); uint32 timeElapsed = blockTimestamp - blockTimestampLast; uint256 priceCumulative = isThisToken0 ? price1Cumulative : price0Cumulative; FixedPoint.uq112x112 memory priceAverage = FixedPoint.uq112x112( uint224((priceCumulative - priceCumulativeLast) / timeElapsed) ); return FixedPoint.decode144(FixedPoint.mul(priceAverage, 1 ether)); } /* * Use this function to get the current short TWAP */ function getLastShortTwap() public view returns (uint256) { return priceAverageLast; } /* * Use this function to get the current 48-hour TWAP */ function getLastLongTwap() public view returns (uint256) { return priceAverageLastLong; } /** * @notice This function updates the short TWAP Given the short TWAP period has passed. * @dev The Nitro % is also updated given that either TWAP was changed - reducing # of calcs on user transfer */ function _updateTwapsAndNitro() internal virtual { (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) = UniswapV2OracleLibrary.currentCumulativePrices(uniswapPair); uint256 priceCumulative = isThisToken0 ? price1Cumulative : price0Cumulative; uint32 timeElapsedShort = blockTimestamp - blockTimestampLast; // overflow is desired uint32 timeElapsedLong = blockTimestamp - blockTimestampLastLong; bool recalculateNitro = false; if (timeElapsedShort > minDeltaTwapShort) { // cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed FixedPoint.uq112x112 memory priceAverage = FixedPoint.uq112x112( uint224((priceCumulative - priceCumulativeLast) / timeElapsedShort) ); priceCumulativeLast = priceCumulative; blockTimestampLast = blockTimestamp; priceAverageLast = FixedPoint.decode144(FixedPoint.mul(priceAverage, 1 ether)); recalculateNitro = true; } if (timeElapsedLong > minDeltaTwapLong) { // cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed FixedPoint.uq112x112 memory priceAverage = FixedPoint.uq112x112( uint224((priceCumulative - priceCumulativeLastLong) / timeElapsedLong) ); priceCumulativeLastLong = priceCumulative; blockTimestampLastLong = blockTimestamp; priceAverageLastLong = FixedPoint.decode144(FixedPoint.mul(priceAverage, 1 ether)); recalculateNitro = true; } if(recalculateNitro){ (lastBuyNitroPercent, lastSellNitroPercent) = calculateCurrentNitroRate(); } } /** * @dev Initializes the TWAP cumulative values for the burn curve. */ function initializeTwap() external onlyInitialDistributionAddress { require(blockTimestampLast == 0, "Both TWAPS already initialized"); (uint256 price0Cumulative, uint256 price1Cumulative, uint32 blockTimestamp) = UniswapV2OracleLibrary.currentCumulativePrices(uniswapPair); uint256 priceCumulative = isThisToken0 ? price1Cumulative : price0Cumulative; //Initialize the short TWAP values blockTimestampLast = blockTimestamp; priceCumulativeLast = priceCumulative; priceAverageLast = INITIAL_TOKENS_PER_ETH; //Initialize the long TWAP values blockTimestampLastLong = blockTimestamp; priceCumulativeLastLong = priceCumulative; priceAverageLastLong = INITIAL_TOKENS_PER_ETH; } // ------------------ User Functions --------------------- // /* * Function if for some reason the predicted trading pair address doesn't match real life trading pair address. */ function setUniswapPair(address newUniswapPair) public onlyOwner { setExchangeAddress(uniswapPair, false); uniswapPair = newUniswapPair; updateStake(uniswapPair, 0); setExchangeAddress(uniswapPair, true); } /** * @notice Changes the minimum auto-payout balance */ function updateMinimumAutoPayout(uint256 new_min) public onlyOwner { updateMinimumAutoPayoutBalance(new_min); } /** * @notice Calculates the current running % for the Nitro protocol. That is, * The percent bonus tokens for any buyers at the current moment * The percent tokens removed for any sellers at the current moment * This is calculated using the TWAP and the realtimeprice. Calling this DOESN'T Update the TWAP. * * @return buyNitro A uint256 of 0.XX * 1 eth units, where XX is the current % for buyers (6% will return 0.06*1ether) * @return sellNitro A uint256 of 0.XX * 1 eth units, where XX is the current % for sellers (6% will return 0.06*1ether) */ function calculateCurrentNitroRate() public view returns (uint256 buyNitro, uint256 sellNitro) { //The units on both of these is tokens per eth uint256 currentRealTimePrice = getLastShortTwap(); uint256 currentTwap = getLastLongTwap(); uint256 nitro; //Calculate the Nitro rate based on which is larger to keep it positive if(currentRealTimePrice > currentTwap){ //Calculation explanation: //(RTP-TWAP)*scaleFactor/TWAP is typical percent calc but with the scaleFactor moved up b/c uint256 // The *scaleFactor.dv has to cancel out the scaleFactor to get back to fractions of 100, but in units of ether // nitro = (currentRealTimePrice.sub(currentTwap).mul(scaleFactor).div(currentTwap))*scaleFactor.div(scaleFactor); nitro = (currentRealTimePrice.sub(currentTwap).mul(scaleFactor).div(currentTwap)); } else{ //Simply the above calculation * -1 to offset the negative nitro = (currentTwap.sub(currentRealTimePrice).mul(scaleFactor).div(currentTwap)); } //Validate that the nitro value is within the defined bounds and return buyNitro = (nitro > maxBuyBonus()) ? maxBuyBonus() : nitro; sellNitro = (nitro.mul(2) > maxSellRemoval()) ? maxSellRemoval() : nitro.mul(2); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../GSN/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 () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = 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"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.6; import { SafeERC20, SafeMath, IERC20, Address } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import '@uniswap/lib/contracts/libraries/TransferHelper.sol'; import "./libraries/UniswapV2Library.sol"; import "./interfaces/Uniswap/IUniswapV2Router.sol"; import './interfaces/Relayer/IKeep3rV1Mini.sol'; contract NitroStaking { using SafeMath for uint256; uint256 internal scalefactor = 1e18; uint256 private _maxSellRemoval; uint256 private _maxBuyBonus; uint256 internal _totalNistToDist = 0; /// @notice Describes the minimum balance required to receive auto-rewards uint256 public minimumRewardBalance = 1 * 1 ether; /// @notice The minimum balance required to be eligible for automatic payouts uint256 public minimumAutoPayoutBalance = 0.1 * 1 ether; uint256 private totalstakes; /// @notice Describes the remaining ETH in the contract balance that is unallocated to rewards // I.E. The contract may have 20 ETh in it but 10 ETH might already be allocated to existing stakers accruing a balance uint256 public remainingNISTToAllocate; /** * @notice The previous timestamp for reward allocation. Gets set to block.timestamp on reward distribution. */ uint256 public previousRewardDistributionTimestamp; /** * @dev This is instantiated to 48 hours currently.The time over which the entire balance of this contract, if unchanged, would be sent to stakers. */ uint balance_emission_time = 48 hours; /** * @notice The nist output per second in the staking system. * @dev This is only updated every time the eth balance of the contract increases. */ uint256 public nist_output_per_second; /** * @param stake The amount of NIST staked. * @param S_init The value of S at the time this stake occured. * @param owed_rewards Any NIST rewards this user accrued that we want to keep track of for historical reasons. */ struct StakeData{ uint256 stake; uint256 S_init; uint256 owed_rewards; } /** * @notice The stakes for each stakeholder. */ mapping(address => StakeData) public _stakes; /** * @dev All of the addresses involved in the staking system. */ address[] internal _stakeholders; /** * @dev The running total of eth payout per staked NIST. */ uint256 public S; // IUniswapV2Router router = IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); address payable public RelayerJob; //RLR contract which will add eth credit to the job IKeep3rV1Mini public RLR; //////////////////----------------Public View Variables----------------/////////////// //Return the maxSellRemoval function maxSellRemoval() public view returns (uint256) { return _maxSellRemoval; } function maxBuyBonus() public view returns (uint256) { return _maxBuyBonus; } /** * @notice A method to get the stakeholders as a memory address array * @return uint256 The list of stakeholders */ function stakeHolders() public view returns (address[] memory) { return _stakeholders; } /** * @notice A method to the aggregated stakes from all _stakeholders. * @return uint256 The aggregated stakes from all _stakeholders. */ function totalStakes() public view returns(uint256) { uint256 _totalStakes = 0; for (uint256 s = 0; s < _stakeholders.length; s += 1){ _totalStakes = _totalStakes.add(_stakes[_stakeholders[s]].stake); } return _totalStakes; } /** * @notice A method to the aggregated rewards from all _stakeholders. * @return uint256 The aggregated rewards from all _stakeholders. */ function totalUnclaimedRewards() public view returns(uint256) { uint256 _totalRewards = 0; for (uint256 s = 0; s < _stakeholders.length; s += 1){ _totalRewards = _totalRewards.add(calculateRewardWithFee(_stakeholders[s])); } return _totalRewards; } function getEligibleCount(uint256 target) internal view returns (uint256 count) { count = 0; for (uint256 s = 0; s < _stakeholders.length; s += 1){ if(count >= target && target != 0) return count; if(calculateRewardWithFee(_stakeholders[s]) > minimumAutoPayoutBalance){ count += 1; } } } /** * @notice Returns an iterable list of addresses that qualify for automatic payout * @dev This is pretty bad to use because it can run out of gas, please supplement with getNextEligibleAddressForAutomaticPayout and * try again with a lower numToFind. * @param numToFind Is the number of addresses to pull from the database; Set to 0 to find all. * Returns An array that from 0->i has eligible addresses then from i->_stakeholders.length contains empty and total_rewards The total amount of NIST required to be liquidated if these users were paid * Use static call if you are using scripts to get data */ function getEligibleAddressesForAutomaticPayout(uint256 numToFind) public view returns(address[] memory eligible_addresses, uint256 total_rewards) { (uint256 eligible_count) = getEligibleCount(numToFind); eligible_addresses = new address[](eligible_count); uint256 count = 0; total_rewards = 0; for (uint256 s = 0; s < _stakeholders.length && count < eligible_addresses.length ; s++){ uint256 reward = calculateRewardWithFee(_stakeholders[s]); if(reward > minimumAutoPayoutBalance){ eligible_addresses[count] = _stakeholders[s]; total_rewards += reward; count += 1; } } return (eligible_addresses, total_rewards); } /** * @notice Returns the next address in the list that is available for auto payout * @dev External iteration required * @return The next address eligible for auto payout. */ function getNextEligibleAddressForAutomaticPayout() public view returns(address) { for (uint256 s = 0; s < _stakeholders.length; s += 1){ if(calculateRewardWithFee(_stakeholders[s]) > minimumAutoPayoutBalance) return _stakeholders[s]; } return address(0); } /** * @notice A method to check if an address is a stakeholder. * @param _address The address to verify. * @return bool, uint256 Whether the address is a stakeholder, * and if so its position in the _stakeholders array. */ function isStakeholder(address _address) public view returns(bool, uint256) { for (uint256 s = 0; s < _stakeholders.length; s += 1){ if (_address == _stakeholders[s]) return (true, s); } return (false, 0); } /** * @notice A method to retrieve the stake for a stakeholder. * @param _stakeholder The stakeholder to retrieve the stake for. * @return uint256 The amount of wei staked. */ function stakeOf(address _stakeholder) public view returns(uint256) { return _stakes[_stakeholder].stake; } /** * @notice A simple method that calculates the rewards for a given stakeholder. * @param _stakeholder The stakeholder to calculate rewards for. * @return The amount of ETH owed to this _stakeholder. */ function calculateRewardWithFee(address _stakeholder) public view returns(uint256) { return calculateRewardWithoutFee(_stakeholder).mul(94).div(100); } function getNistToETHPath() internal view returns (address[] memory) { //Create path address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); return path; } function getEstimateAmounts(uint256 nistAmount) internal view returns (uint256[] memory amountarr) { if(nistAmount <= 0){ amountarr = new uint256[](2); amountarr[0] = 0; amountarr[1] = 0; return amountarr; } //Get estimated output amountarr = UniswapV2Library.getAmountsOut(router.factory(),nistAmount,getNistToETHPath()); } /** * @notice Since 5% of earned fees go to RLR worker, the public function removes the fee. For the purposes of calculating, this is the * function with the true number of tokens earned by the user. */ function calculateRewardWithoutFee(address _stakeholder) internal view returns(uint256) { uint256 earned_nist = calculateEarnedNIST(_stakeholder); return getEstimateAmounts(earned_nist)[1]; } /** * @notice Returns the amount of NIST earned in the internal staking system. * @dev Use this to get the amount of NIST earned before it's converted to ETH. */ function calculateEarnedNIST(address _stakeholder) public view returns (uint256 earned_NIST) { //(user's Stake)*(S- S_when_user_joined) + owed_rewards return ((_stakes[_stakeholder].stake).mul(S.sub(_stakes[_stakeholder].S_init)).div(scalefactor)).add(_stakes[_stakeholder].owed_rewards); } /** * @notice An approximate value for the NIST introduced into the system assuming price and global staking balance is constant. * @return The amount of ETH / NIST a user should expect to receive over the next distribution period. */ function approximateETHPerNISTOutput() public view returns(uint256) { return getEstimateAmounts(remainingNISTToAllocate)[1].div(totalStakes()); } //////////////////----------------Modify Variables, Internal----------------/////////////// modifier onlyRelayerJob() { require(msg.sender == RelayerJob); _; } /** * @notice Set the maximum percent order volume of tokens taken in a sell order */ function _changeMaxSellRemoval(uint256 new_maxSellRemoval) internal { _maxSellRemoval = new_maxSellRemoval; } /** * @notice Set the maximum percent order volume of bonus tokens for buyers */ function _setMaxBuyBonusPercentage(uint256 new_maxBuyBonus) internal { _maxBuyBonus = new_maxBuyBonus; } /** * @notice A method to add a stakeholder. * @param _stakeholder The stakeholder to add. */ function addStakeholder(address _stakeholder) internal { (bool _isStakeholder, ) = isStakeholder(_stakeholder); if(!_isStakeholder) _stakeholders.push(_stakeholder); } /** * @notice A method to remove a stakeholder. * @param _stakeholder The stakeholder to remove. */ function removeStakeholder(address _stakeholder) internal { (bool _isStakeholder, uint256 s) = isStakeholder(_stakeholder); if(_isStakeholder){ _stakeholders[s] = _stakeholders[_stakeholders.length - 1]; _stakeholders.pop(); } } /** * @notice A method for a stakeholder to create a stake. * @param _stakeholder The address of the stakeholder. * @dev Every addition resets the stake history. ETH transfer is included to claim the rewards for the user. */ function updateStake(address _stakeholder, uint256 user_current_balance) internal { (bool _isStakeholder,) = isStakeholder(_stakeholder); if(user_current_balance >= minimumRewardBalance){ //Possibly add to stakeholder list if not included addStakeholder(_stakeholder); //Update the staking data to the current balance saveRewardData(_stakeholder, user_current_balance); }else if (_isStakeholder){ // User doesn't qualify for staking but is still included as stakeholder, needs to be removed //Update the staking data to the current balance saveRewardData(_stakeholder, user_current_balance); //Remove from stakeholder list removeStakeholder(_stakeholder); } } /** * @notice In the event that a stake is updated, we have to store the staking reward information for later for recall. * This saves the data in a way that doesn't destroy previous reward history. */ function saveRewardData(address _stakeholder, uint256 user_current_balance) internal { //Get the most up-to-date reward distribution distributeRewards(calcInstantaneousDistributionAmount()); //Update the staking data for this user to the current S value, with the stored IOU rewards _stakes[_stakeholder] = StakeData(user_current_balance, S, calculateEarnedNIST(_stakeholder)); } /** * @notice A method to allow a stakeholder to withdraw his rewards. * @dev This one doesn't liquidate the allocated nist for this user */ function claimRewardsInternal(address _stakeholder) internal { uint256 reward = calculateRewardWithFee(_stakeholder); if(reward != 0 && address(this).balance >= reward){ //We can't check if it's above minimum auto payout, b/c we sometimes payout even if they don't qualify (like if they update their stake) //Transfer the owed reward to the user TransferHelper.safeTransferETH(_stakeholder,reward); //Reset user's S_init to be current S _stakes[_stakeholder] = StakeData(_stakes[_stakeholder].stake, S, 0); } } /** * @notice The public method for claiming rewards, which includes a swap of nist to eth for the tokens needed */ function claimRewardsPublic(address _stakeholder) public { distributeRewards(calcInstantaneousDistributionAmount()); uint256 num_tokens_to_liquidate = calculateEarnedNIST(_stakeholder); if(num_tokens_to_liquidate != 0){ swapTokenstoETH(num_tokens_to_liquidate); claimRewardsInternal(_stakeholder); } } // ------------------ Admin functions --------------// /** * @notice A method to distribute rewards to all _stakeholders. * @param r The amount of NIST at this moment in time to be distributed between all stakers when they eventually withdraw. * @dev Implementing this function with calcInstantaneousDistributionAmount() is how the RLR will perform the distribution job */ function distributeRewards(uint256 r) internal { uint256 total_stakes = totalStakes(); if(total_stakes != 0 && r <= remainingNISTToAllocate){ S = S.add(r.mul(scalefactor).div(total_stakes)); //Make sure we keep track of how much nist we have left to allocate remainingNISTToAllocate = remainingNISTToAllocate.sub(r); //Update the distribution timestamp to keep emissions constant previousRewardDistributionTimestamp = block.timestamp; } } /** * @notice Calculates what the variable r in distributeRewards should be given the current timestamp, last distribution timestamp, and the current rate * @dev This function will be used as the input to distribute rewards. * @return The amount of NIST appropriate to be distributed at this moment */ function calcInstantaneousDistributionAmount() public view returns (uint256) { uint256 initCalc = (block.timestamp.sub(previousRewardDistributionTimestamp)).mul(nist_output_per_second); //If we've reached the end of the distribution period without a change in the NIST balance of the contract, // it will attempt to continue the same rate of distribution. This returns zero in this case return (initCalc > remainingNISTToAllocate) ? 0 : initCalc; } /** * @notice Updates the emissions rate of the distribution mechanism. * @dev This currently is used for when the NIST for staking balance changes */ function updateStakingOutputPerSecond(uint256 newTotalNist, uint256 newAllocNist) internal { _totalNistToDist = newTotalNist; remainingNISTToAllocate = newAllocNist; nist_output_per_second = remainingNISTToAllocate.div(balance_emission_time); } receive() external payable { if(RelayerJob != address(0) && msg.sender != RelayerJob) { //Send 5% of eth to rlr contract to add credit RLR.addCreditETH{value:msg.value.mul(5).div(100) }(RelayerJob); } } function swapTokenstoETH(uint256 numTokens) internal { //Get estimated output uint256[] memory amounts = getEstimateAmounts(numTokens); //swap with eth send to self router.swapExactTokensForETHSupportingFeeOnTransferTokens( amounts[0], amounts[1], getNistToETHPath(), address(this), block.timestamp ); //Update the tracked NIST to distribute updateStakingOutputPerSecond(_totalNistToDist.sub(amounts[0]), remainingNISTToAllocate.sub(amounts[0])); } /** /** * @notice The primary interface function for hte relayer job to send rewards to eligible _stakeholders * @dev This needs to be compliant with the RLR protocols */ function processAutoRewardPayouts(address[] calldata stakers,uint256 tokens_to_liquidate) external onlyRelayerJob { require(_totalNistToDist > 0, "!NIST_To_Distribute"); distributeRewards(calcInstantaneousDistributionAmount()); swapTokenstoETH(tokens_to_liquidate); for(uint i = 0;i<stakers.length;i++) claimRewardsInternal(stakers[i]); } function updateMinimumAutoPayoutBalance(uint256 new_minimum) internal { minimumAutoPayoutBalance = new_minimum; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../../GSN/Context.sol"; import "./IERC20.sol"; import "../../math/SafeMath.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) public { _name = name_; _symbol = symbol_; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../GSN/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 () internal { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!_paused, "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { 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()); } }
pragma solidity >=0.5.0; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; }
pragma solidity >=0.5.0; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; }
pragma solidity >=0.5.0; import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; import '@uniswap/lib/contracts/libraries/FixedPoint.sol'; // library with helper methods for oracles that are concerned with computing average prices library UniswapV2OracleLibrary { using FixedPoint for *; // helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1] function currentBlockTimestamp() internal view returns (uint32) { return uint32(block.timestamp % 2 ** 32); } // produces the cumulative price using counterfactuals to save gas and avoid a call to sync. function currentCumulativePrices( address pair ) internal view returns (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) { blockTimestamp = currentBlockTimestamp(); price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast(); price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast(); // if time has elapsed since the last update on the pair, mock the accumulated price values (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves(); if (blockTimestampLast != blockTimestamp) { // subtraction overflow is desired uint32 timeElapsed = blockTimestamp - blockTimestampLast; // addition overflow is desired // counterfactual price0Cumulative += uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed; // counterfactual price1Cumulative += uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed; } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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 GSN 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 payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./IERC20.sol"; import "../../math/SafeMath.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 SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } 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' // solhint-disable-next-line max-line-length 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)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @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"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.6.0; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeApprove: approve failed' ); } function safeTransfer( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeTransfer: transfer failed' ); } function safeTransferFrom( address token, address from, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::transferFrom: transferFrom failed' ); } function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, 'TransferHelper::safeTransferETH: ETH transfer failed'); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.6; import '@openzeppelin/contracts/math/SafeMath.sol'; import '../interfaces/Uniswap/IUniswapV2Pair.sol'; library UniswapV2Library { using SafeMath for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash )))); } // fetches and sorts the reserves for a pair function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } // given an output amount of an asset and pair reserves, returns a required input amount of the other asset function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2; import './IUniswapV2Router01.sol'; interface IUniswapV2Router is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; }
//SPDX-License-Identifier: MIT pragma solidity ^0.6.6; interface IKeep3rV1Mini { function isKeeper(address) external returns (bool); function worked(address keeper) external; function totalBonded() external view returns (uint); function bonds(address keeper, address credit) external view returns (uint); function votes(address keeper) external view returns (uint); function isMinKeeper(address keeper, uint minBond, uint earned, uint age) external returns (bool); function addCreditETH(address job) external payable; function credits(address job, address credit) external view returns (uint); function receipt(address credit, address keeper, uint amount) external; function ETH() external view returns (address); function receiptETH(address keeper, uint amount) external; function addJob(address job) external; function mint(uint amount) external; function bond(address bonding, uint amount) external; function activate(address bonding) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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 `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool); /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.6; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.4.0; import './FullMath.sol'; import './Babylonian.sol'; import './BitMath.sol'; // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format)) library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint256 _x; } uint8 public constant RESOLUTION = 112; uint256 public constant Q112 = 0x10000000000000000000000000000; // 2**112 uint256 private constant Q224 = 0x100000000000000000000000000000000000000000000000000000000; // 2**224 uint256 private constant LOWER_MASK = 0xffffffffffffffffffffffffffff; // decimal of UQ*x112 (lower 112 bits) // encode a uint112 as a UQ112x112 function encode(uint112 x) internal pure returns (uq112x112 memory) { return uq112x112(uint224(x) << RESOLUTION); } // encodes a uint144 as a UQ144x112 function encode144(uint144 x) internal pure returns (uq144x112 memory) { return uq144x112(uint256(x) << RESOLUTION); } // decode a UQ112x112 into a uint112 by truncating after the radix point function decode(uq112x112 memory self) internal pure returns (uint112) { return uint112(self._x >> RESOLUTION); } // decode a UQ144x112 into a uint144 by truncating after the radix point function decode144(uq144x112 memory self) internal pure returns (uint144) { return uint144(self._x >> RESOLUTION); } // multiply a UQ112x112 by a uint, returning a UQ144x112 // reverts on overflow function mul(uq112x112 memory self, uint256 y) internal pure returns (uq144x112 memory) { uint256 z = 0; require(y == 0 || (z = self._x * y) / y == self._x, 'FixedPoint::mul: overflow'); return uq144x112(z); } // multiply a UQ112x112 by an int and decode, returning an int // reverts on overflow function muli(uq112x112 memory self, int256 y) internal pure returns (int256) { uint256 z = FullMath.mulDiv(self._x, uint256(y < 0 ? -y : y), Q112); require(z < 2**255, 'FixedPoint::muli: overflow'); return y < 0 ? -int256(z) : int256(z); } // multiply a UQ112x112 by a UQ112x112, returning a UQ112x112 // lossy function muluq(uq112x112 memory self, uq112x112 memory other) internal pure returns (uq112x112 memory) { if (self._x == 0 || other._x == 0) { return uq112x112(0); } uint112 upper_self = uint112(self._x >> RESOLUTION); // * 2^0 uint112 lower_self = uint112(self._x & LOWER_MASK); // * 2^-112 uint112 upper_other = uint112(other._x >> RESOLUTION); // * 2^0 uint112 lower_other = uint112(other._x & LOWER_MASK); // * 2^-112 // partial products uint224 upper = uint224(upper_self) * upper_other; // * 2^0 uint224 lower = uint224(lower_self) * lower_other; // * 2^-224 uint224 uppers_lowero = uint224(upper_self) * lower_other; // * 2^-112 uint224 uppero_lowers = uint224(upper_other) * lower_self; // * 2^-112 // so the bit shift does not overflow require(upper <= uint112(-1), 'FixedPoint::muluq: upper overflow'); // this cannot exceed 256 bits, all values are 224 bits uint256 sum = uint256(upper << RESOLUTION) + uppers_lowero + uppero_lowers + (lower >> RESOLUTION); // so the cast does not overflow require(sum <= uint224(-1), 'FixedPoint::muluq: sum overflow'); return uq112x112(uint224(sum)); } // divide a UQ112x112 by a UQ112x112, returning a UQ112x112 function divuq(uq112x112 memory self, uq112x112 memory other) internal pure returns (uq112x112 memory) { require(other._x > 0, 'FixedPoint::divuq: division by zero'); if (self._x == other._x) { return uq112x112(uint224(Q112)); } if (self._x <= uint144(-1)) { uint256 value = (uint256(self._x) << RESOLUTION) / other._x; require(value <= uint224(-1), 'FixedPoint::divuq: overflow'); return uq112x112(uint224(value)); } uint256 result = FullMath.mulDiv(Q112, self._x, other._x); require(result <= uint224(-1), 'FixedPoint::divuq: overflow'); return uq112x112(uint224(result)); } // returns a UQ112x112 which represents the ratio of the numerator to the denominator // can be lossy function fraction(uint256 numerator, uint256 denominator) internal pure returns (uq112x112 memory) { require(denominator > 0, 'FixedPoint::fraction: division by zero'); if (numerator == 0) return FixedPoint.uq112x112(0); if (numerator <= uint144(-1)) { uint256 result = (numerator << RESOLUTION) / denominator; require(result <= uint224(-1), 'FixedPoint::fraction: overflow'); return uq112x112(uint224(result)); } else { uint256 result = FullMath.mulDiv(numerator, Q112, denominator); require(result <= uint224(-1), 'FixedPoint::fraction: overflow'); return uq112x112(uint224(result)); } } // take the reciprocal of a UQ112x112 // reverts on overflow // lossy function reciprocal(uq112x112 memory self) internal pure returns (uq112x112 memory) { require(self._x != 0, 'FixedPoint::reciprocal: reciprocal of zero'); require(self._x != 1, 'FixedPoint::reciprocal: overflow'); return uq112x112(uint224(Q224 / self._x)); } // square root of a UQ112x112 // lossy between 0/1 and 40 bits function sqrt(uq112x112 memory self) internal pure returns (uq112x112 memory) { if (self._x <= uint144(-1)) { return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << 112))); } uint8 safeShiftBits = 255 - BitMath.mostSignificantBit(self._x); safeShiftBits -= safeShiftBits % 2; return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << safeShiftBits) << ((112 - safeShiftBits) / 2))); } }
// SPDX-License-Identifier: CC-BY-4.0 pragma solidity >=0.4.0; // taken from https://medium.com/coinmonks/math-in-solidity-part-3-percents-and-proportions-4db014e080b1 // license is CC-BY-4.0 library FullMath { function fullMul(uint256 x, uint256 y) internal pure returns (uint256 l, uint256 h) { uint256 mm = mulmod(x, y, uint256(-1)); l = x * y; h = mm - l; if (mm < l) h -= 1; } function fullDiv( uint256 l, uint256 h, uint256 d ) private pure returns (uint256) { uint256 pow2 = d & -d; d /= pow2; l /= pow2; l += h * ((-pow2) / pow2 + 1); uint256 r = 1; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; return l * r; } function mulDiv( uint256 x, uint256 y, uint256 d ) internal pure returns (uint256) { (uint256 l, uint256 h) = fullMul(x, y); uint256 mm = mulmod(x, y, d); if (mm > l) h -= 1; l -= mm; if (h == 0) return l / d; require(h < d, 'FullMath: FULLDIV_OVERFLOW'); return fullDiv(l, h, d); } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.4.0; // computes square roots using the babylonian method // https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method library Babylonian { // credit for this implementation goes to // https://github.com/abdk-consulting/abdk-libraries-solidity/blob/master/ABDKMath64x64.sol#L687 function sqrt(uint256 x) internal pure returns (uint256) { if (x == 0) return 0; // this block is equivalent to r = uint256(1) << (BitMath.mostSignificantBit(x) / 2); // however that code costs significantly more gas uint256 xx = x; uint256 r = 1; if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; } if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; } if (xx >= 0x100000000) { xx >>= 32; r <<= 16; } if (xx >= 0x10000) { xx >>= 16; r <<= 8; } if (xx >= 0x100) { xx >>= 8; r <<= 4; } if (xx >= 0x10) { xx >>= 4; r <<= 2; } if (xx >= 0x8) { r <<= 1; } r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; r = (r + x / r) >> 1; // Seven iterations should be enough uint256 r1 = x / r; return (r < r1 ? r : r1); } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.5.0; library BitMath { // returns the 0 indexed position of the most significant bit of the input x // s.t. x >= 2**msb and x < 2**(msb+1) function mostSignificantBit(uint256 x) internal pure returns (uint8 r) { require(x > 0, 'BitMath::mostSignificantBit: zero'); if (x >= 0x100000000000000000000000000000000) { x >>= 128; r += 128; } if (x >= 0x10000000000000000) { x >>= 64; r += 64; } if (x >= 0x100000000) { x >>= 32; r += 32; } if (x >= 0x10000) { x >>= 16; r += 16; } if (x >= 0x100) { x >>= 8; r += 8; } if (x >= 0x10) { x >>= 4; r += 4; } if (x >= 0x4) { x >>= 2; r += 2; } if (x >= 0x2) r += 1; } // returns the 0 indexed position of the least significant bit of the input x // s.t. (x & 2**lsb) != 0 and (x & (2**(lsb) - 1)) == 0) // i.e. the bit at the index is set and the mask of all lower bits is 0 function leastSignificantBit(uint256 x) internal pure returns (uint8 r) { require(x > 0, 'BitMath::leastSignificantBit: zero'); r = 255; if (x & uint128(-1) > 0) { r -= 128; } else { x >>= 128; } if (x & uint64(-1) > 0) { r -= 64; } else { x >>= 64; } if (x & uint32(-1) > 0) { r -= 32; } else { x >>= 32; } if (x & uint16(-1) > 0) { r -= 16; } else { x >>= 16; } if (x & uint8(-1) > 0) { r -= 8; } else { x >>= 8; } if (x & 0xf > 0) { r -= 4; } else { x >>= 4; } if (x & 0x3 > 0) { r -= 2; } else { x >>= 2; } if (x & 0x1 > 0) r -= 1; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint256","name":"_minDeltaTwapLong","type":"uint256"},{"internalType":"uint256","name":"_minDeltaTwapShort","type":"uint256"},{"internalType":"address","name":"rlrToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"exchangeAddress","type":"address"},{"indexed":false,"internalType":"bool","name":"isExchange","type":"bool"}],"name":"ExchangeListUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"priceCumulativeLastLong","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"blockTimestampLastLong","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"priceAverageLastLong","type":"uint256"}],"name":"LongTwapUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"new_MBB","type":"uint256"}],"name":"MaxBuyBonusUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"new_MSR","type":"uint256"}],"name":"MaxSellRemovalUpdated","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"priceCumulativeLast","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"blockTimestampLast","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"priceAverageLast","type":"uint256"}],"name":"TwapUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"INITIAL_TOKENS_PER_ETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LPTokenContract","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RLR","outputs":[{"internalType":"contract IKeep3rV1Mini","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RelayerJob","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"S","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_stakes","outputs":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"S_init","type":"uint256"},{"internalType":"uint256","name":"owed_rewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approximateETHPerNISTOutput","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blockTimestampLast","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blockTimestampLastLong","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calcInstantaneousDistributionAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calculateCurrentNitroRate","outputs":[{"internalType":"uint256","name":"buyNitro","type":"uint256"},{"internalType":"uint256","name":"sellNitro","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeholder","type":"address"}],"name":"calculateEarnedNIST","outputs":[{"internalType":"uint256","name":"earned_NIST","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeholder","type":"address"}],"name":"calculateRewardWithFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxSellRemoval","type":"uint256"}],"name":"changeMaxSellRemoval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeholder","type":"address"}],"name":"claimRewardsPublic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"exchangeAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentShortTwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"numToFind","type":"uint256"}],"name":"getEligibleAddressesForAutomaticPayout","outputs":[{"internalType":"address[]","name":"eligible_addresses","type":"address[]"},{"internalType":"uint256","name":"total_rewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastLongTwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastShortTwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextEligibleAddressForAutomaticPayout","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialDistributionAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initializeTwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"}],"name":"isExchangeAddress","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isStakeholder","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isThisToken0","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastBuyNitroPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastSellNitroPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxBuyBonus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSellRemoval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minDeltaTwapLong","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minDeltaTwapShort","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumAutoPayoutBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumRewardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nist_output_per_second","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":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleContractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleInitFunds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"previousRewardDistributionTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceAverageLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceAverageLastLong","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceCumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceCumulativeLastLong","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"stakers","type":"address[]"},{"internalType":"uint256","name":"tokens_to_liquidate","type":"uint256"}],"name":"processAutoRewardPayouts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"remainingNISTToAllocate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"scaleFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bool","name":"_isexchange","type":"bool"}],"name":"setExchangeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"LPTokenAddy","type":"address"}],"name":"setLiquidityTokenContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxBuyBonus","type":"uint256"}],"name":"setMaxBuyBonusPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"presaleContract","type":"address"}],"name":"setPresaleContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"job","type":"address"}],"name":"setRelayerJobAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newUniswapPair","type":"address"}],"name":"setUniswapPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newUniRouterAddy","type":"address"}],"name":"setUniswapRouterAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bool","name":"_whitelisted","type":"bool"}],"name":"setWhitelistedSender","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakeHolders","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeholder","type":"address"}],"name":"stakeOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStakes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalUnclaimedRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"total_supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapPair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapV2Factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapv2RouterAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"new_min","type":"uint256"}],"name":"updateMinimumAutoPayout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedSenders","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6080604052670de0b6b3a764000060068190556000600955600a5567016345785d8a0000600b556202a300600f55601480546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d179055610e106018553480156200006657600080fd5b506040516200537f3803806200537f833981810160405260608110156200008c57600080fd5b50805160208083015160409384015184518086018652601381527f4e6974726f205374616b696e6720546f6b656e0000000000000000000000000081850190815286518088019097526004875263139254d560e21b948701949094528051949592949193909291620001019160039162000d20565b5080516200011790600490602084019062000d20565b50506005805460ff191660121790555060006200013c6001600160e01b036200031716565b601780546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506017805460ff60a01b1916905542600e55620001b083836001600160e01b036200031c16565b620001e9620001d76064670de0b6b3a7640000620003e960201b620011c21790919060201c565b6005026001600160e01b036200043a16565b62000222620002106064670de0b6b3a7640000620003e960201b620011c21790919060201c565b600a026001600160e01b036200043f16565b620002356001600160e01b036200044416565b601980546001600160a01b0319166001600160a01b03929092169190911790556200025f62000453565b620002726001600160e01b036200048916565b620002856001600160e01b036200069716565b620002ad737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160e01b036200074e16565b602854620002d29030906001600160a01b03166000196001600160e01b03620007d516565b306000908152601c60205260409020805460ff19166001179055601680546001600160a01b03929092166001600160a01b03199092169190911790555062000dc29050565b335b90565b600182116200035d5760405162461bcd60e51b8152600401808060200182810382526024815260200180620052a66024913960400191505060405180910390fd5b600181116200039e5760405162461bcd60e51b8152600401808060200182810382526025815260200180620053366025913960400191505060405180910390fd5b808211620003de5760405162461bcd60e51b8152600401808060200182810382526027815260200180620052ef6027913960400191505060405180910390fd5b602491909155602555565b60006200043383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250620008c560201b60201c565b9392505050565b600855565b600755565b6017546001600160a01b031690565b6200047130686f139653eec76400006001600160e01b036200096c16565b620004873060016001600160e01b0362000a8416565b565b735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f6001600160a01b031663c9c6539630601460009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015620004fc57600080fd5b505afa15801562000511573d6000803e3d6000fd5b505050506040513d60208110156200052857600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b1580156200057b57600080fd5b505af115801562000590573d6000803e3d6000fd5b505050506040513d6020811015620005a757600080fd5b5051601e80546001600160a01b0319166001600160a01b039283161790819055620005d59116600162000b14565b60006200066b30601460009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156200062b57600080fd5b505afa15801562000640573d6000803e3d6000fd5b505050506040513d60208110156200065757600080fd5b505162000bdd602090811b6200403f17901c565b50601e805460ff60a01b1916306001600160a01b039390931692909214600160a01b0291909117905550565b601754600160a01b900460ff1615620006ea576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6017805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258620007316001600160e01b036200031716565b604080516001600160a01b039092168252519081900360200190a1565b620007616001600160e01b036200031716565b6017546001600160a01b03908116911614620007b3576040805162461bcd60e51b8152602060048201819052602482015260008051602062005316833981519152604482015290519081900360640190fd5b602880546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166200081c5760405162461bcd60e51b81526004018080602001828103825260248152602001806200535b6024913960400191505060405180910390fd5b6001600160a01b038216620008635760405162461bcd60e51b8152600401808060200182810382526022815260200180620052846022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60008183620009555760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101562000919578181015183820152602001620008ff565b50505050905090810190601f168015620009475780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816200096257fe5b0495945050505050565b6001600160a01b038216620009c8576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b620009df600083836001600160e01b0362000cc016565b620009fb8160025462000cc560201b6200300d1790919060201c565b6002556001600160a01b0382166000908152602081815260409091205462000a2e9183906200300d62000cc5821b17901c565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b62000a976001600160e01b036200031716565b6017546001600160a01b0390811691161462000ae9576040805162461bcd60e51b8152602060048201819052602482015260008051602062005316833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152601c60205260409020805460ff1916911515919091179055565b62000b276001600160e01b036200031716565b6017546001600160a01b0390811691161462000b79576040805162461bcd60e51b8152602060048201819052602482015260008051602062005316833981519152604482015290519081900360640190fd5b6001600160a01b0382166000818152601d6020908152604091829020805460ff191685151590811790915582519384529083015280517fe8bce7c68f90d290265fc32126eb383798b54548b31a0337f02476bf01db55b69281900390910190a15050565b600080826001600160a01b0316846001600160a01b0316141562000c335760405162461bcd60e51b8152600401808060200182810382526025815260200180620052ca6025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b03161062000c5557828462000c58565b83835b90925090506001600160a01b03821662000cb9576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b505050565b60008282018381101562000433576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000d6357805160ff191683800117855562000d93565b8280016001018555821562000d93579182015b8281111562000d9357825182559160200191906001019062000d76565b5062000da192915062000da5565b5090565b6200031991905b8082111562000da1576000815560010162000dac565b6144b28062000dd26000396000f3fe60806040526004361061046a5760003560e01c80636c7fa76f1161024a578063ae7dedd111610139578063db15d185116100b6578063ef037b901161007a578063ef037b9014611050578063f2fde38b1461109e578063f6cdce06146110d1578063fd2d4824146110e6578063fd3197481461114b57610531565b8063db15d18514610fa3578063dc166f7414610fd6578063dd62ed3e14610feb578063e379c31b14611026578063ee98950d1461103b57610531565b8063c5700a02116100fd578063c5700a0214610ec2578063c816841b14610ed7578063c91ceccc14610eec578063d5aed6bf14610f3d578063d9351b5c14610f7057610531565b8063ae7dedd114610e1d578063b65dd2f514610e32578063bc9cc89b14610e65578063bf720d5e14610e7a578063bf9befb114610ead57610531565b80638da5cb5b116101c75780639b1961631161018b5780639b19616314610d4e578063a3b49cd614610d63578063a457c2d714610d96578063a9059cbb14610dcf578063aaf3a69614610e0857610531565b80638da5cb5b14610c7d5780638f76c35214610c9257806395d89b4114610ca7578063982ce10914610cbc5780639aa0820614610cd157610531565b80637955ee681161020e5780637955ee6814610bbb5780637c92a89e14610bd057806386cefcb614610be557806388b8227614610c20578063896b693114610c4a57610531565b80636c7fa76f14610b345780636d7893c114610b495780636ee9eae314610b5e57806370a0823114610b73578063715018a614610ba657610531565b80632f43c1bc1161036657806346274415116102e35780635f8ee763116102a75780635f8ee76314610a4657806364365f1e14610a5b578063683dd19114610a8557806369f066a314610a9a5780636b36f52e14610aaf57610531565b806346274415146109c45780634be1c796146109f2578063524d4edc14610a0757806359d0f71314610a1c5780635c975abb14610a3157610531565b80633f4ba83a1161032a5780633f4ba83a1461091f5780633f5b7d671461093457806340a1437f14610967578063426233601461097c57806342ac935d146109af57610531565b80632f43c1bc1461087c578063313ce5671461089157806334956a7f146108bc5780633940e9ee146108d157806339509351146108e657610531565b80631b3aa77d116103f457806326369728116103b857806326369728146107b1578063272efc69146107c65780632887d765146107f9578063299238381461080e5780632bb8d1521461084957610531565b80631b3aa77d1461071a5780631d2647111461072f57806321345f1f1461074457806323b872dd1461075957806324e597b11461079c57610531565b8063095ea7b31161043b578063095ea7b31461064e5780631393ca991461069b57806316280d1c146106c257806318160ddd146106d757806318953efc146106ec57610531565b80626b305914610536578062c2f35e1461056057806306fdde0314610591578063082ea4841461061b57610531565b36610531576015546001600160a01b03161580159061049457506015546001600160a01b03163314155b1561052f576016546001600160a01b0316636dab5dcf6104cc60646104c034600563ffffffff61116016565b9063ffffffff6111c216565b601554604080516001600160e01b031960e086901b1681526001600160a01b03909216600483015251602480830192600092919082900301818588803b15801561051557600080fd5b505af1158015610529573d6000803e3d6000fd5b50505050505b005b600080fd5b34801561054257600080fd5b5061052f6004803603602081101561055957600080fd5b5035611204565b34801561056c57600080fd5b50610575611345565b604080516001600160a01b039092168252519081900360200190f35b34801561059d57600080fd5b506105a6611354565b6040805160208082528351818301528351919283929083019185019080838360005b838110156105e05781810151838201526020016105c8565b50505050905090810190601f16801561060d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561062757600080fd5b5061052f6004803603602081101561063e57600080fd5b50356001600160a01b03166113eb565b34801561065a57600080fd5b506106876004803603604081101561067157600080fd5b506001600160a01b038135169060200135611424565b604080519115158252519081900360200190f35b3480156106a757600080fd5b506106b0611441565b60408051918252519081900360200190f35b3480156106ce57600080fd5b506106b0611447565b3480156106e357600080fd5b506106b061144d565b3480156106f857600080fd5b50610701611453565b6040805163ffffffff9092168252519081900360200190f35b34801561072657600080fd5b506106b061145f565b34801561073b57600080fd5b506106b0611465565b34801561075057600080fd5b506105756114a9565b34801561076557600080fd5b506106876004803603606081101561077c57600080fd5b506001600160a01b038135811691602081013590911690604001356114b8565b3480156107a857600080fd5b50610575611546565b3480156107bd57600080fd5b506106b06115c2565b3480156107d257600080fd5b50610687600480360360208110156107e957600080fd5b50356001600160a01b03166115c8565b34801561080557600080fd5b506106b06115dd565b34801561081a57600080fd5b5061052f6004803603604081101561083157600080fd5b506001600160a01b03813516906020013515156115e9565b34801561085557600080fd5b5061052f6004803603602081101561086c57600080fd5b50356001600160a01b031661166c565b34801561088857600080fd5b506106b0611748565b34801561089d57600080fd5b506108a661174e565b6040805160ff9092168252519081900360200190f35b3480156108c857600080fd5b506106b0611757565b3480156108dd57600080fd5b506106b061175d565b3480156108f257600080fd5b506106876004803603604081101561090957600080fd5b506001600160a01b03813516906020013561176a565b34801561092b57600080fd5b5061052f6117be565b34801561094057600080fd5b506106876004803603602081101561095757600080fd5b50356001600160a01b0316611820565b34801561097357600080fd5b506106b0611842565b34801561098857600080fd5b506106b06004803603602081101561099f57600080fd5b50356001600160a01b0316611848565b3480156109bb57600080fd5b506106b0611863565b3480156109d057600080fd5b506109d9611869565b6040805192835260208301919091528051918290030190f35b3480156109fe57600080fd5b506106b061193b565b348015610a1357600080fd5b506106b0611941565b348015610a2857600080fd5b506105756119f8565b348015610a3d57600080fd5b50610687611a10565b348015610a5257600080fd5b506106b0611a20565b348015610a6757600080fd5b5061052f60048036036020811015610a7e57600080fd5b5035611a26565b348015610a9157600080fd5b506106b0611b81565b348015610aa657600080fd5b506106b0611b8d565b348015610abb57600080fd5b50610ad960048036036020811015610ad257600080fd5b5035611bcc565b6040518080602001838152602001828103825284818151815260200191508051906020019060200280838360005b83811015610b1f578181015183820152602001610b07565b50505050905001935050505060405180910390f35b348015610b4057600080fd5b50610575611cd0565b348015610b5557600080fd5b506106b0611cdf565b348015610b6a57600080fd5b506106b0611ce5565b348015610b7f57600080fd5b506106b060048036036020811015610b9657600080fd5b50356001600160a01b0316611ceb565b348015610bb257600080fd5b5061052f611d06565b348015610bc757600080fd5b506106b0611da8565b348015610bdc57600080fd5b50610575611dae565b348015610bf157600080fd5b5061052f60048036036040811015610c0857600080fd5b506001600160a01b0381351690602001351515611dbd565b348015610c2c57600080fd5b5061052f60048036036020811015610c4357600080fd5b5035611e79565b348015610c5657600080fd5b506106b060048036036020811015610c6d57600080fd5b50356001600160a01b0316611eda565b348015610c8957600080fd5b50610575611eef565b348015610c9e57600080fd5b506106b0611efe565b348015610cb357600080fd5b506105a6611f04565b348015610cc857600080fd5b506106b0611f65565b348015610cdd57600080fd5b5061052f60048036036040811015610cf457600080fd5b810190602081018135640100000000811115610d0f57600080fd5b820183602082011115610d2157600080fd5b80359060200191846020830284011164010000000083111715610d4357600080fd5b919350915035611f6b565b348015610d5a57600080fd5b506106b0612020565b348015610d6f57600080fd5b5061068760048036036020811015610d8657600080fd5b50356001600160a01b031661205f565b348015610da257600080fd5b5061068760048036036040811015610db957600080fd5b506001600160a01b038135169060200135612074565b348015610ddb57600080fd5b5061068760048036036040811015610df257600080fd5b506001600160a01b0381351690602001356120e2565b348015610e1457600080fd5b506106876120f6565b348015610e2957600080fd5b50610575612106565b348015610e3e57600080fd5b506106b060048036036020811015610e5557600080fd5b50356001600160a01b0316612115565b348015610e7157600080fd5b506106b061218d565b348015610e8657600080fd5b5061052f60048036036020811015610e9d57600080fd5b50356001600160a01b0316612193565b348015610eb957600080fd5b506106b061220d565b348015610ece57600080fd5b5061070161226c565b348015610ee357600080fd5b5061057561227f565b348015610ef857600080fd5b50610f1f60048036036020811015610f0f57600080fd5b50356001600160a01b031661228e565b60408051938452602084019290925282820152519081900360600190f35b348015610f4957600080fd5b5061052f60048036036020811015610f6057600080fd5b50356001600160a01b03166122af565b348015610f7c57600080fd5b5061052f60048036036020811015610f9357600080fd5b50356001600160a01b0316612362565b348015610faf57600080fd5b5061052f60048036036020811015610fc657600080fd5b50356001600160a01b03166123dc565b348015610fe257600080fd5b50610575612456565b348015610ff757600080fd5b506106b06004803603604081101561100e57600080fd5b506001600160a01b0381358116916020013516612465565b34801561103257600080fd5b5061052f612490565b34801561104757600080fd5b506106b06125e2565b34801561105c57600080fd5b506110836004803603602081101561107357600080fd5b50356001600160a01b03166125e8565b60408051921515835260208301919091528051918290030190f35b3480156110aa57600080fd5b5061052f600480360360208110156110c157600080fd5b50356001600160a01b0316612642565b3480156110dd57600080fd5b506106b061273b565b3480156110f257600080fd5b506110fb612741565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561113757818101518382015260200161111f565b505050509050019250505060405180910390f35b34801561115757600080fd5b506106b06127a2565b60008261116f575060006111bc565b8282028284828161117c57fe5b04146111b95760405162461bcd60e51b815260040180806020018281038252602181526020018061437b6021913960400191505060405180910390fd5b90505b92915050565b60006111b983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506127a8565b61120c61284a565b6017546001600160a01b0390811691161461125c576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b606481106112b1576040805162461bcd60e51b815260206004820152601d60248201527f4d61782053656c6c2052656d6f76616c20697320746f6f206869676821000000604482015290519081900360640190fd5b60008111611306576040805162461bcd60e51b815260206004820152601e60248201527f4d61782053656c6c2052656d6f76616c20697320746f6f20736d616c6c210000604482015290519081900360640190fd5b61130f8161284e565b6040805182815290517f908a26ad08354a79cb2c3e0d18c0bcd4d6ab7a2cb1013a3ce9c1092ab720a2a49181900360200190a150565b6019546001600160a01b031681565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156113e05780601f106113b5576101008083540402835291602001916113e0565b820191906000526020600020905b8154815290600101906020018083116113c357829003601f168201915b505050505090505b90565b6113fb6113f6611465565b612853565b600061140682612115565b9050801561142057611417816128c1565b61142082612a2a565b5050565b600061143861143161284a565b8484612aa7565b50600192915050565b601b5481565b60235481565b60025490565b60215463ffffffff1681565b600d5481565b60008061148f601054611483600e5442612b9390919063ffffffff16565b9063ffffffff61116016565b9050600d5481116114a057806114a3565b60005b91505090565b601a546001600160a01b031681565b60006114c5848484612bd5565b61153b846114d161284a565b6115368560405180606001604052806028815260200161439c602891396001600160a01b038a1660009081526001602052604081209061150f61284a565b6001600160a01b03168152602081019190915260400160002054919063ffffffff612e4c16565b612aa7565b5060015b9392505050565b6000805b6012548110156115ba57600b546115816012838154811061156757fe5b6000918252602090912001546001600160a01b0316611eda565b11156115b2576012818154811061159457fe5b6000918252602090912001546001600160a01b031691506113e89050565b60010161154a565b506000905090565b60105481565b601c6020526000908152604090205460ff1681565b671bc16d674ec8000081565b6115f161284a565b6017546001600160a01b03908116911614611641576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152601c60205260409020805460ff1916911515919091179055565b61167461284a565b6017546001600160a01b039081169116146116c4576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b601a546001600160a01b031661174557601a80546001600160a01b0319166001600160a01b038381169190911791829055611701911660016115e9565b601a546117219030906001600160a01b031661171c82611ceb565b612ea6565b601980546001600160a01b0319166001600160a01b03831617905561174581612642565b50565b601f5481565b60055460ff1690565b60275481565b686f139653eec764000081565b600061143861177761284a565b84611536856001600061178861284a565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61300d16565b6117c661284a565b6017546001600160a01b03908116911614611816576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b61181e613067565b565b6001600160a01b0381166000908152601d602052604090205460ff165b919050565b600b5481565b6001600160a01b031660009081526011602052604090205490565b60245481565b6000806000611876611ce5565b905060006118826125e2565b90506000818311156118b5576118ae826104c0670de0b6b3a7640000611483878463ffffffff612b9316565b90506118d8565b6118d5826104c0670de0b6b3a7640000611483838863ffffffff612b9316565b90505b6118e0611f65565b81116118ec57806118f4565b6118f4611f65565b94506118fe6127a2565b61190f82600263ffffffff61116016565b1161192a5761192581600263ffffffff61116016565b611932565b6119326127a2565b93505050509091565b60135481565b601e5460009081908190819061195f906001600160a01b031661310f565b601e549295509093509150600160a81b810463ffffffff16820390600090600160a01b900460ff166119915784611993565b835b905061199d6141dd565b60405180602001604052808463ffffffff16601f548503816119bb57fe5b046001600160e01b031681525090506119e46119df82670de0b6b3a76400006132fe565b613392565b6001600160901b0316965050505050505090565b735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b601754600160a01b900460ff1690565b60205481565b611a2e61284a565b6017546001600160a01b03908116911614611a7e576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b611a97670de0b6b3a7640000606463ffffffff6111c216565b6064028110611aed576040805162461bcd60e51b815260206004820152601a60248201527f4d61782042757920426f6e757320697320746f6f206869676821000000000000604482015290519081900360640190fd5b60008111611b42576040805162461bcd60e51b815260206004820152601b60248201527f4d61782042757920426f6e757320697320746f6f20736d616c6c210000000000604482015290519081900360640190fd5b611b4b81613399565b6040805182815290517fc84fe0ead4fe02d80b59499c259e42858b7497dca97f77ed4e4ee2b142259d569181900360200190a150565b670de0b6b3a764000081565b600080805b601254811015611bc657611bbc611baf6012838154811061156757fe5b839063ffffffff61300d16565b9150600101611b92565b50905090565b6060600080611bda8461339e565b90508067ffffffffffffffff81118015611bf357600080fd5b50604051908082528060200260200182016040528015611c1d578160200160208202803683370190505b5092506000915081805b60125481108015611c385750845182105b15611cc7576000611c4f6012838154811061156757fe5b9050600b54811115611cbe5760128281548110611c6857fe5b9060005260206000200160009054906101000a90046001600160a01b0316868481518110611c9257fe5b60200260200101906001600160a01b031690816001600160a01b03168152505080850194506001830192505b50600101611c27565b5050505b915091565b6029546001600160a01b031681565b60265481565b60205490565b6001600160a01b031660009081526020819052604090205490565b611d0e61284a565b6017546001600160a01b03908116911614611d5e576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b6017546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3601780546001600160a01b0319169055565b60255481565b6015546001600160a01b031681565b611dc561284a565b6017546001600160a01b03908116911614611e15576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b6001600160a01b0382166000818152601d6020908152604091829020805460ff191685151590811790915582519384529083015280517fe8bce7c68f90d290265fc32126eb383798b54548b31a0337f02476bf01db55b69281900390910190a15050565b611e8161284a565b6017546001600160a01b03908116911614611ed1576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b611745816133f4565b60006111bc60646104c0605e611483866133f9565b6017546001600160a01b031690565b600e5481565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156113e05780601f106113b5576101008083540402835291602001916113e0565b60085490565b6015546001600160a01b03163314611f8257600080fd5b600060095411611fcf576040805162461bcd60e51b8152602060048201526013602482015272214e4953545f546f5f4469737472696275746560681b604482015290519081900360640190fd5b611fda6113f6611465565b611fe3816128c1565b60005b8281101561201a57612012848483818110611ffd57fe5b905060200201356001600160a01b0316612a2a565b600101611fe6565b50505050565b600061205a61202d61220d565b612038600d5461342c565b60018151811061204457fe5b60200260200101516111c290919063ffffffff16565b905090565b601d6020526000908152604090205460ff1681565b600061143861208161284a565b846115368560405180606001604052806025815260200161445860259139600160006120ab61284a565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff612e4c16565b60006114386120ef61284a565b8484612bd5565b601e54600160a01b900460ff1681565b6016546001600160a01b031681565b6001600160a01b038116600090815260116020526040812060028101546006546001909201546013546111bc936121819290916104c09161215c919063ffffffff612b9316565b6001600160a01b0388166000908152601160205260409020549063ffffffff61116016565b9063ffffffff61300d16565b600a5481565b61219b61284a565b6017546001600160a01b039081169116146121eb576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b602980546001600160a01b0319166001600160a01b0392909216919091179055565b600080805b601254811015611bc657612262601160006012848154811061223057fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054839063ffffffff61300d16565b9150600101612212565b601e54600160a81b900463ffffffff1681565b601e546001600160a01b031681565b60116020526000908152604090208054600182015460029092015490919083565b6122b761284a565b6017546001600160a01b03908116911614612307576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b601e5461231e906001600160a01b03166000611dbd565b601e80546001600160a01b0319166001600160a01b03838116919091179182905561234b91166000613510565b601e54611745906001600160a01b03166001611dbd565b61236a61284a565b6017546001600160a01b039081169116146123ba576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b601580546001600160a01b0319166001600160a01b0392909216919091179055565b6123e461284a565b6017546001600160a01b03908116911614612434576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b602880546001600160a01b0319166001600160a01b0392909216919091179055565b6028546001600160a01b031681565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6019546001600160a01b031633146124ef576040805162461bcd60e51b815260206004820152601b60248201527f21696e697469616c446973747269627574696f6e416464726573730000000000604482015290519081900360640190fd5b601e54600160a81b900463ffffffff1615612551576040805162461bcd60e51b815260206004820152601e60248201527f426f746820545741505320616c726561647920696e697469616c697a65640000604482015290519081900360640190fd5b601e546000908190819061256d906001600160a01b031661310f565b9250925092506000601e60149054906101000a900460ff1661258f5783612591565b825b601e805463ffffffff60a81b1916600160a81b63ffffffff95909516948502179055601f819055671bc16d674ec8000060208190556021805463ffffffff1916909417909355602255506023555050565b60235490565b600080805b601254811015612636576012818154811061260457fe5b6000918252602090912001546001600160a01b038581169116141561262e57600192509050611ccb565b6001016125ed565b50600093849350915050565b61264a61284a565b6017546001600160a01b0390811691161461269a576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b6001600160a01b0381166126df5760405162461bcd60e51b81526004018080602001828103825260268152602001806142266026913960400191505060405180910390fd5b6017546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3601780546001600160a01b0319166001600160a01b0392909216919091179055565b60225481565b606060128054806020026020016040519081016040528092919081815260200182805480156113e057602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161277b575050505050905090565b60075490565b600081836128345760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156127f95781810151838201526020016127e1565b50505050905090810190601f1680156128265780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161284057fe5b0495945050505050565b3390565b600755565b600061285d61220d565b905080158015906128705750600d548211155b15611420576128a0612891826104c06006548661116090919063ffffffff16565b6013549063ffffffff61300d16565b601355600d546128b6908363ffffffff612b9316565b600d5542600e555050565b60606128cc8261342c565b60145481519192506001600160a01b03169063791ac9479083906000906128ef57fe5b60200260200101518360018151811061290457fe5b602002602001015161291461355d565b30426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03166001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561298f578181015183820152602001612977565b505050509050019650505050505050600060405180830381600087803b1580156129b857600080fd5b505af11580156129cc573d6000803e3d6000fd5b505050506114206129fc826000815181106129e357fe5b6020026020010151600954612b9390919063ffffffff16565b612a2583600081518110612a0c57fe5b6020026020010151600d54612b9390919063ffffffff16565b61363b565b6000612a3582611eda565b90508015801590612a465750804710155b1561142057612a558282613660565b604080516060810182526001600160a01b038416600081815260116020818152858320805486526013548287019081529686018481529490935252915182559151600182015590516002909101555050565b6001600160a01b038316612aec5760405162461bcd60e51b81526004018080602001828103825260248152602001806144096024913960400191505060405180910390fd5b6001600160a01b038216612b315760405162461bcd60e51b815260040180806020018281038252602281526020018061424c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60006111b983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612e4c565b82612bde611a10565b1580612bf457506019546001600160a01b031633145b80612c035750612c0333613753565b80612c3b57506028546001600160a01b031633148015612c3b5750612c26611eef565b6001600160a01b0316816001600160a01b0316145b612c765760405162461bcd60e51b815260040180806020018281038252604081526020018061433b6040913960400191505060405180910390fd5b612c7f84613753565b612e1357612c8c84611820565b15612cfe57612c99613771565b612ca4848484612ea6565b6000612cc7670de0b6b3a76400006104c08560265461116090919063ffffffff16565b9050612cde6009548261300d90919063ffffffff16565b612ce730611ceb565b1115612cf857612cf8308583612ea6565b50612e0e565b612d0783611820565b15612de657612d14613771565b6000612d37670de0b6b3a76400006104c08560275461116090919063ffffffff16565b9050612d73816040518060400160405280600d81526020016c73656c6c556e646572666c6f7760981b81525085612e4c9092919063ffffffff16565b9250612dbe612d9b612d8c83600263ffffffff6111c216565b6009549063ffffffff61300d16565b612a25612daf84600263ffffffff6111c216565b600d549063ffffffff61300d16565b612dc9858585612ea6565b612dd4853083612ea6565b612cf885612de187611ceb565b613510565b612e0384612de184612df788611ceb565b9063ffffffff612b9316565b612e0e848484612ea6565b612e1e565b612e1e848484612ea6565b612e2783613753565b158015612e3a5750612e3883611820565b155b1561201a5761201a83612de185611ceb565b60008184841115612e9e5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156127f95781810151838201526020016127e1565b505050900390565b6001600160a01b038316612eeb5760405162461bcd60e51b81526004018080602001828103825260258152602001806143e46025913960400191505060405180910390fd5b6001600160a01b038216612f305760405162461bcd60e51b81526004018080602001828103825260238152602001806142036023913960400191505060405180910390fd5b612f3b838383613558565b612f7e8160405180606001604052806026815260200161426e602691396001600160a01b038616600090815260208190526040902054919063ffffffff612e4c16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612fb3908263ffffffff61300d16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000828201838110156111b9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b601754600160a01b900460ff166130bc576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6017805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6130f261284a565b604080516001600160a01b039092168252519081900360200190a1565b600080600061311c613902565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561315757600080fd5b505afa15801561316b573d6000803e3d6000fd5b505050506040513d602081101561318157600080fd5b505160408051635a3d549360e01b815290519194506001600160a01b03861691635a3d549391600480820192602092909190829003018186803b1580156131c757600080fd5b505afa1580156131db573d6000803e3d6000fd5b505050506040513d60208110156131f157600080fd5b505160408051630240bc6b60e21b81529051919350600091829182916001600160a01b03891691630902f1ac916004808301926060929190829003018186803b15801561323d57600080fd5b505afa158015613251573d6000803e3d6000fd5b505050506040513d606081101561326757600080fd5b5080516020820151604090920151909450909250905063ffffffff808216908516146132f45780840363ffffffff81166132ad6001600160701b0380861690871661390c565b600001516001600160e01b031602870196508063ffffffff166132e2856001600160701b0316856001600160701b031661390c565b516001600160e01b0316029590950194505b5050509193909250565b6133066141ef565b600082158061332c57505082516001600160e01b03168281029083828161332957fe5b04145b61337d576040805162461bcd60e51b815260206004820152601960248201527f4669786564506f696e743a3a6d756c3a206f766572666c6f7700000000000000604482015290519081900360640190fd5b60408051602081019091529081529392505050565b5160701c90565b600855565b6000805b6012548110156133ee578282101580156133bb57508215155b156133c6575061183d565b600b546133d96012838154811061156757fe5b11156133e6576001820191505b6001016133a2565b50919050565b600b55565b60008061340583612115565b90506134108161342c565b60018151811061341c57fe5b6020026020010151915050919050565b60606000821161349057604080516002808252606082018352909160208301908036833701905050905060008160008151811061346557fe5b60200260200101818152505060008160018151811061348057fe5b602090810291909101015261183d565b6014546040805163c45a015560e01b815290516111bc926001600160a01b03169163c45a0155916004808301926020929190829003018186803b1580156134d657600080fd5b505afa1580156134ea573d6000803e3d6000fd5b505050506040513d602081101561350057600080fd5b50518361350b61355d565b613a78565b600061351b836125e8565b509050600a54821061353f5761353083613bc4565b61353a8383613c28565b613558565b80156135585761354f8383613c28565b61355883613c90565b505050565b604080516002808252606080830184529283929190602083019080368337019050509050308160008151811061358f57fe5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156135e357600080fd5b505afa1580156135f7573d6000803e3d6000fd5b505050506040513d602081101561360d57600080fd5b505181518290600190811061361e57fe5b6001600160a01b0390921660209283029190910190910152905090565b6009829055600d819055600f5461365990829063ffffffff6111c216565b6010555050565b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b602083106136ac5780518252601f19909201916020918201910161368d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461370e576040519150601f19603f3d011682016040523d82523d6000602084013e613713565b606091505b50509050806135585760405162461bcd60e51b81526004018080602001828103825260348152602001806142946034913960400191505060405180910390fd5b6001600160a01b03166000908152601c602052604090205460ff1690565b601e546000908190819061378d906001600160a01b031661310f565b9250925092506000601e60149054906101000a900460ff166137af57836137b1565b825b601e5460215460255492935063ffffffff600160a81b9092048216850392908216850391600091908416111561385f576137e96141dd565b60405180602001604052808563ffffffff16601f5488038161380757fe5b046001600160e01b03169052601f869055601e805463ffffffff60a81b1916600160a81b63ffffffff8a1602179055905061384d6119df82670de0b6b3a76400006132fe565b6001600160901b031660205550600190505b6024548263ffffffff1611156138e4576138776141dd565b60405180602001604052808463ffffffff1660225488038161389557fe5b046001600160e01b0316905260228690556021805463ffffffff191663ffffffff891617905590506138d26119df82670de0b6b3a76400006132fe565b6001600160901b031660235550600190505b80156138f9576138f2611869565b6027556026555b50505050505050565b63ffffffff421690565b6139146141dd565b600082116139535760405162461bcd60e51b81526004018080602001828103825260268152602001806142ed6026913960400191505060405180910390fd5b8261396d57506040805160208101909152600081526111bc565b6001600160901b038311613a0957600082607085901b8161398a57fe5b0490506001600160e01b038111156139e9576040805162461bcd60e51b815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b6040518060200160405280826001600160e01b03168152509150506111bc565b6000613a1a84600160701b85613d3e565b90506001600160e01b038111156139e9576040805162461bcd60e51b815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b6060600282511015613ad1576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a20494e56414c49445f504154480000604482015290519081900360640190fd5b815167ffffffffffffffff81118015613ae957600080fd5b50604051908082528060200260200182016040528015613b13578160200160208202803683370190505b5090508281600081518110613b2457fe5b60200260200101818152505060005b6001835103811015613bbc57600080613b7687868581518110613b5257fe5b6020026020010151878660010181518110613b6957fe5b6020026020010151613df7565b91509150613b98848481518110613b8957fe5b60200260200101518383613ebe565b848460010181518110613ba757fe5b60209081029190910101525050600101613b33565b509392505050565b6000613bcf826125e8565b5090508061142057601280546001810182556000919091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec34440180546001600160a01b0384166001600160a01b03199091161790555050565b613c336113f6611465565b60405180606001604052808281526020016013548152602001613c5584612115565b90526001600160a01b039092166000908152601160209081526040918290208451815590840151600182015592015160029092019190915550565b600080613c9c836125e8565b91509150811561355857601280546000198101908110613cb857fe5b600091825260209091200154601280546001600160a01b039092169183908110613cde57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506012805480613d1757fe5b600082815260209020810160001990810180546001600160a01b0319169055019055505050565b6000806000613d4d8686613fa2565b9150915060008480613d5b57fe5b868809905082811115613d6f576001820391505b918290039181613d8d57848381613d8257fe5b04935050505061153f565b848210613de1576040805162461bcd60e51b815260206004820152601a60248201527f46756c6c4d6174683a2046554c4c4449565f4f564552464c4f57000000000000604482015290519081900360640190fd5b613dec838387613fcf565b979650505050505050565b6000806000613e06858561403f565b509050600080613e1788888861411d565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015613e4f57600080fd5b505afa158015613e63573d6000803e3d6000fd5b505050506040513d6060811015613e7957600080fd5b5080516020909101516001600160701b0391821693501690506001600160a01b0387811690841614613eac578082613eaf565b81815b90999098509650505050505050565b6000808411613efe5760405162461bcd60e51b815260040180806020018281038252602b81526020018061442d602b913960400191505060405180910390fd5b600083118015613f0e5750600082115b613f495760405162461bcd60e51b81526004018080602001828103825260288152602001806143136028913960400191505060405180910390fd5b6000613f5d856103e563ffffffff61116016565b90506000613f71828563ffffffff61116016565b90506000613f8b83612181886103e863ffffffff61116016565b9050808281613f9657fe5b04979650505050505050565b6000808060001984860990508385029250828103915082811015613fc7576001820391505b509250929050565b60008181038216808381613fdf57fe5b049250808581613feb57fe5b049450808160000381613ffa57fe5b60028581038087028203028087028203028087028203028087028203028087028203028087028203029586029003909402930460010193909302939093010292915050565b600080826001600160a01b0316846001600160a01b031614156140935760405162461bcd60e51b81526004018080602001828103825260258152602001806142c86025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b0316106140b35782846140b6565b83835b90925090506001600160a01b038216614116576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b600080600061412c858561403f565b604080516bffffffffffffffffffffffff19606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501206001600160f81b031960688401529a90941b9093166069840152607d8301989098527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b60408051602081019091526000815290565b604051806020016040528060008152509056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63655472616e7366657248656c7065723a3a736166655472616e736665724554483a20455448207472616e73666572206661696c6564556e697377617056324c6962726172793a204944454e544943414c5f4144445245535345534669786564506f696e743a3a6672616374696f6e3a206469766973696f6e206279207a65726f556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459217061757365642026262021696e697469616c446973747269627574696f6e416464726573732021496e697469616c4c697175696469747950726f7669646572536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e5445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122018877741ccf2e810a2840c4728ee3c20861c26d898171fe62c6c15fa4cb1199e64736f6c6343000606003345524332303a20617070726f766520746f20746865207a65726f20616464726573734d696e696d756d2064656c5457415020284c6f6e672920697320746f6f20736d616c6c21556e697377617056324c6962726172793a204944454e544943414c5f4144445245535345534c6f6e672064656c746120697320736d616c6c6572207468616e2073686f72742064656c7461214f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724d696e696d756d2064656c54574150202853686f72742920697320746f6f20736d616c6c2145524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373000000000000000000000000000000000000000000000000000000000000a8c0000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000e3ef895c59e7db27214ab5bbf56347ce115a3f4
Deployed Bytecode
0x60806040526004361061046a5760003560e01c80636c7fa76f1161024a578063ae7dedd111610139578063db15d185116100b6578063ef037b901161007a578063ef037b9014611050578063f2fde38b1461109e578063f6cdce06146110d1578063fd2d4824146110e6578063fd3197481461114b57610531565b8063db15d18514610fa3578063dc166f7414610fd6578063dd62ed3e14610feb578063e379c31b14611026578063ee98950d1461103b57610531565b8063c5700a02116100fd578063c5700a0214610ec2578063c816841b14610ed7578063c91ceccc14610eec578063d5aed6bf14610f3d578063d9351b5c14610f7057610531565b8063ae7dedd114610e1d578063b65dd2f514610e32578063bc9cc89b14610e65578063bf720d5e14610e7a578063bf9befb114610ead57610531565b80638da5cb5b116101c75780639b1961631161018b5780639b19616314610d4e578063a3b49cd614610d63578063a457c2d714610d96578063a9059cbb14610dcf578063aaf3a69614610e0857610531565b80638da5cb5b14610c7d5780638f76c35214610c9257806395d89b4114610ca7578063982ce10914610cbc5780639aa0820614610cd157610531565b80637955ee681161020e5780637955ee6814610bbb5780637c92a89e14610bd057806386cefcb614610be557806388b8227614610c20578063896b693114610c4a57610531565b80636c7fa76f14610b345780636d7893c114610b495780636ee9eae314610b5e57806370a0823114610b73578063715018a614610ba657610531565b80632f43c1bc1161036657806346274415116102e35780635f8ee763116102a75780635f8ee76314610a4657806364365f1e14610a5b578063683dd19114610a8557806369f066a314610a9a5780636b36f52e14610aaf57610531565b806346274415146109c45780634be1c796146109f2578063524d4edc14610a0757806359d0f71314610a1c5780635c975abb14610a3157610531565b80633f4ba83a1161032a5780633f4ba83a1461091f5780633f5b7d671461093457806340a1437f14610967578063426233601461097c57806342ac935d146109af57610531565b80632f43c1bc1461087c578063313ce5671461089157806334956a7f146108bc5780633940e9ee146108d157806339509351146108e657610531565b80631b3aa77d116103f457806326369728116103b857806326369728146107b1578063272efc69146107c65780632887d765146107f9578063299238381461080e5780632bb8d1521461084957610531565b80631b3aa77d1461071a5780631d2647111461072f57806321345f1f1461074457806323b872dd1461075957806324e597b11461079c57610531565b8063095ea7b31161043b578063095ea7b31461064e5780631393ca991461069b57806316280d1c146106c257806318160ddd146106d757806318953efc146106ec57610531565b80626b305914610536578062c2f35e1461056057806306fdde0314610591578063082ea4841461061b57610531565b36610531576015546001600160a01b03161580159061049457506015546001600160a01b03163314155b1561052f576016546001600160a01b0316636dab5dcf6104cc60646104c034600563ffffffff61116016565b9063ffffffff6111c216565b601554604080516001600160e01b031960e086901b1681526001600160a01b03909216600483015251602480830192600092919082900301818588803b15801561051557600080fd5b505af1158015610529573d6000803e3d6000fd5b50505050505b005b600080fd5b34801561054257600080fd5b5061052f6004803603602081101561055957600080fd5b5035611204565b34801561056c57600080fd5b50610575611345565b604080516001600160a01b039092168252519081900360200190f35b34801561059d57600080fd5b506105a6611354565b6040805160208082528351818301528351919283929083019185019080838360005b838110156105e05781810151838201526020016105c8565b50505050905090810190601f16801561060d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561062757600080fd5b5061052f6004803603602081101561063e57600080fd5b50356001600160a01b03166113eb565b34801561065a57600080fd5b506106876004803603604081101561067157600080fd5b506001600160a01b038135169060200135611424565b604080519115158252519081900360200190f35b3480156106a757600080fd5b506106b0611441565b60408051918252519081900360200190f35b3480156106ce57600080fd5b506106b0611447565b3480156106e357600080fd5b506106b061144d565b3480156106f857600080fd5b50610701611453565b6040805163ffffffff9092168252519081900360200190f35b34801561072657600080fd5b506106b061145f565b34801561073b57600080fd5b506106b0611465565b34801561075057600080fd5b506105756114a9565b34801561076557600080fd5b506106876004803603606081101561077c57600080fd5b506001600160a01b038135811691602081013590911690604001356114b8565b3480156107a857600080fd5b50610575611546565b3480156107bd57600080fd5b506106b06115c2565b3480156107d257600080fd5b50610687600480360360208110156107e957600080fd5b50356001600160a01b03166115c8565b34801561080557600080fd5b506106b06115dd565b34801561081a57600080fd5b5061052f6004803603604081101561083157600080fd5b506001600160a01b03813516906020013515156115e9565b34801561085557600080fd5b5061052f6004803603602081101561086c57600080fd5b50356001600160a01b031661166c565b34801561088857600080fd5b506106b0611748565b34801561089d57600080fd5b506108a661174e565b6040805160ff9092168252519081900360200190f35b3480156108c857600080fd5b506106b0611757565b3480156108dd57600080fd5b506106b061175d565b3480156108f257600080fd5b506106876004803603604081101561090957600080fd5b506001600160a01b03813516906020013561176a565b34801561092b57600080fd5b5061052f6117be565b34801561094057600080fd5b506106876004803603602081101561095757600080fd5b50356001600160a01b0316611820565b34801561097357600080fd5b506106b0611842565b34801561098857600080fd5b506106b06004803603602081101561099f57600080fd5b50356001600160a01b0316611848565b3480156109bb57600080fd5b506106b0611863565b3480156109d057600080fd5b506109d9611869565b6040805192835260208301919091528051918290030190f35b3480156109fe57600080fd5b506106b061193b565b348015610a1357600080fd5b506106b0611941565b348015610a2857600080fd5b506105756119f8565b348015610a3d57600080fd5b50610687611a10565b348015610a5257600080fd5b506106b0611a20565b348015610a6757600080fd5b5061052f60048036036020811015610a7e57600080fd5b5035611a26565b348015610a9157600080fd5b506106b0611b81565b348015610aa657600080fd5b506106b0611b8d565b348015610abb57600080fd5b50610ad960048036036020811015610ad257600080fd5b5035611bcc565b6040518080602001838152602001828103825284818151815260200191508051906020019060200280838360005b83811015610b1f578181015183820152602001610b07565b50505050905001935050505060405180910390f35b348015610b4057600080fd5b50610575611cd0565b348015610b5557600080fd5b506106b0611cdf565b348015610b6a57600080fd5b506106b0611ce5565b348015610b7f57600080fd5b506106b060048036036020811015610b9657600080fd5b50356001600160a01b0316611ceb565b348015610bb257600080fd5b5061052f611d06565b348015610bc757600080fd5b506106b0611da8565b348015610bdc57600080fd5b50610575611dae565b348015610bf157600080fd5b5061052f60048036036040811015610c0857600080fd5b506001600160a01b0381351690602001351515611dbd565b348015610c2c57600080fd5b5061052f60048036036020811015610c4357600080fd5b5035611e79565b348015610c5657600080fd5b506106b060048036036020811015610c6d57600080fd5b50356001600160a01b0316611eda565b348015610c8957600080fd5b50610575611eef565b348015610c9e57600080fd5b506106b0611efe565b348015610cb357600080fd5b506105a6611f04565b348015610cc857600080fd5b506106b0611f65565b348015610cdd57600080fd5b5061052f60048036036040811015610cf457600080fd5b810190602081018135640100000000811115610d0f57600080fd5b820183602082011115610d2157600080fd5b80359060200191846020830284011164010000000083111715610d4357600080fd5b919350915035611f6b565b348015610d5a57600080fd5b506106b0612020565b348015610d6f57600080fd5b5061068760048036036020811015610d8657600080fd5b50356001600160a01b031661205f565b348015610da257600080fd5b5061068760048036036040811015610db957600080fd5b506001600160a01b038135169060200135612074565b348015610ddb57600080fd5b5061068760048036036040811015610df257600080fd5b506001600160a01b0381351690602001356120e2565b348015610e1457600080fd5b506106876120f6565b348015610e2957600080fd5b50610575612106565b348015610e3e57600080fd5b506106b060048036036020811015610e5557600080fd5b50356001600160a01b0316612115565b348015610e7157600080fd5b506106b061218d565b348015610e8657600080fd5b5061052f60048036036020811015610e9d57600080fd5b50356001600160a01b0316612193565b348015610eb957600080fd5b506106b061220d565b348015610ece57600080fd5b5061070161226c565b348015610ee357600080fd5b5061057561227f565b348015610ef857600080fd5b50610f1f60048036036020811015610f0f57600080fd5b50356001600160a01b031661228e565b60408051938452602084019290925282820152519081900360600190f35b348015610f4957600080fd5b5061052f60048036036020811015610f6057600080fd5b50356001600160a01b03166122af565b348015610f7c57600080fd5b5061052f60048036036020811015610f9357600080fd5b50356001600160a01b0316612362565b348015610faf57600080fd5b5061052f60048036036020811015610fc657600080fd5b50356001600160a01b03166123dc565b348015610fe257600080fd5b50610575612456565b348015610ff757600080fd5b506106b06004803603604081101561100e57600080fd5b506001600160a01b0381358116916020013516612465565b34801561103257600080fd5b5061052f612490565b34801561104757600080fd5b506106b06125e2565b34801561105c57600080fd5b506110836004803603602081101561107357600080fd5b50356001600160a01b03166125e8565b60408051921515835260208301919091528051918290030190f35b3480156110aa57600080fd5b5061052f600480360360208110156110c157600080fd5b50356001600160a01b0316612642565b3480156110dd57600080fd5b506106b061273b565b3480156110f257600080fd5b506110fb612741565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561113757818101518382015260200161111f565b505050509050019250505060405180910390f35b34801561115757600080fd5b506106b06127a2565b60008261116f575060006111bc565b8282028284828161117c57fe5b04146111b95760405162461bcd60e51b815260040180806020018281038252602181526020018061437b6021913960400191505060405180910390fd5b90505b92915050565b60006111b983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506127a8565b61120c61284a565b6017546001600160a01b0390811691161461125c576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b606481106112b1576040805162461bcd60e51b815260206004820152601d60248201527f4d61782053656c6c2052656d6f76616c20697320746f6f206869676821000000604482015290519081900360640190fd5b60008111611306576040805162461bcd60e51b815260206004820152601e60248201527f4d61782053656c6c2052656d6f76616c20697320746f6f20736d616c6c210000604482015290519081900360640190fd5b61130f8161284e565b6040805182815290517f908a26ad08354a79cb2c3e0d18c0bcd4d6ab7a2cb1013a3ce9c1092ab720a2a49181900360200190a150565b6019546001600160a01b031681565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156113e05780601f106113b5576101008083540402835291602001916113e0565b820191906000526020600020905b8154815290600101906020018083116113c357829003601f168201915b505050505090505b90565b6113fb6113f6611465565b612853565b600061140682612115565b9050801561142057611417816128c1565b61142082612a2a565b5050565b600061143861143161284a565b8484612aa7565b50600192915050565b601b5481565b60235481565b60025490565b60215463ffffffff1681565b600d5481565b60008061148f601054611483600e5442612b9390919063ffffffff16565b9063ffffffff61116016565b9050600d5481116114a057806114a3565b60005b91505090565b601a546001600160a01b031681565b60006114c5848484612bd5565b61153b846114d161284a565b6115368560405180606001604052806028815260200161439c602891396001600160a01b038a1660009081526001602052604081209061150f61284a565b6001600160a01b03168152602081019190915260400160002054919063ffffffff612e4c16565b612aa7565b5060015b9392505050565b6000805b6012548110156115ba57600b546115816012838154811061156757fe5b6000918252602090912001546001600160a01b0316611eda565b11156115b2576012818154811061159457fe5b6000918252602090912001546001600160a01b031691506113e89050565b60010161154a565b506000905090565b60105481565b601c6020526000908152604090205460ff1681565b671bc16d674ec8000081565b6115f161284a565b6017546001600160a01b03908116911614611641576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152601c60205260409020805460ff1916911515919091179055565b61167461284a565b6017546001600160a01b039081169116146116c4576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b601a546001600160a01b031661174557601a80546001600160a01b0319166001600160a01b038381169190911791829055611701911660016115e9565b601a546117219030906001600160a01b031661171c82611ceb565b612ea6565b601980546001600160a01b0319166001600160a01b03831617905561174581612642565b50565b601f5481565b60055460ff1690565b60275481565b686f139653eec764000081565b600061143861177761284a565b84611536856001600061178861284a565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61300d16565b6117c661284a565b6017546001600160a01b03908116911614611816576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b61181e613067565b565b6001600160a01b0381166000908152601d602052604090205460ff165b919050565b600b5481565b6001600160a01b031660009081526011602052604090205490565b60245481565b6000806000611876611ce5565b905060006118826125e2565b90506000818311156118b5576118ae826104c0670de0b6b3a7640000611483878463ffffffff612b9316565b90506118d8565b6118d5826104c0670de0b6b3a7640000611483838863ffffffff612b9316565b90505b6118e0611f65565b81116118ec57806118f4565b6118f4611f65565b94506118fe6127a2565b61190f82600263ffffffff61116016565b1161192a5761192581600263ffffffff61116016565b611932565b6119326127a2565b93505050509091565b60135481565b601e5460009081908190819061195f906001600160a01b031661310f565b601e549295509093509150600160a81b810463ffffffff16820390600090600160a01b900460ff166119915784611993565b835b905061199d6141dd565b60405180602001604052808463ffffffff16601f548503816119bb57fe5b046001600160e01b031681525090506119e46119df82670de0b6b3a76400006132fe565b613392565b6001600160901b0316965050505050505090565b735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b601754600160a01b900460ff1690565b60205481565b611a2e61284a565b6017546001600160a01b03908116911614611a7e576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b611a97670de0b6b3a7640000606463ffffffff6111c216565b6064028110611aed576040805162461bcd60e51b815260206004820152601a60248201527f4d61782042757920426f6e757320697320746f6f206869676821000000000000604482015290519081900360640190fd5b60008111611b42576040805162461bcd60e51b815260206004820152601b60248201527f4d61782042757920426f6e757320697320746f6f20736d616c6c210000000000604482015290519081900360640190fd5b611b4b81613399565b6040805182815290517fc84fe0ead4fe02d80b59499c259e42858b7497dca97f77ed4e4ee2b142259d569181900360200190a150565b670de0b6b3a764000081565b600080805b601254811015611bc657611bbc611baf6012838154811061156757fe5b839063ffffffff61300d16565b9150600101611b92565b50905090565b6060600080611bda8461339e565b90508067ffffffffffffffff81118015611bf357600080fd5b50604051908082528060200260200182016040528015611c1d578160200160208202803683370190505b5092506000915081805b60125481108015611c385750845182105b15611cc7576000611c4f6012838154811061156757fe5b9050600b54811115611cbe5760128281548110611c6857fe5b9060005260206000200160009054906101000a90046001600160a01b0316868481518110611c9257fe5b60200260200101906001600160a01b031690816001600160a01b03168152505080850194506001830192505b50600101611c27565b5050505b915091565b6029546001600160a01b031681565b60265481565b60205490565b6001600160a01b031660009081526020819052604090205490565b611d0e61284a565b6017546001600160a01b03908116911614611d5e576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b6017546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3601780546001600160a01b0319169055565b60255481565b6015546001600160a01b031681565b611dc561284a565b6017546001600160a01b03908116911614611e15576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b6001600160a01b0382166000818152601d6020908152604091829020805460ff191685151590811790915582519384529083015280517fe8bce7c68f90d290265fc32126eb383798b54548b31a0337f02476bf01db55b69281900390910190a15050565b611e8161284a565b6017546001600160a01b03908116911614611ed1576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b611745816133f4565b60006111bc60646104c0605e611483866133f9565b6017546001600160a01b031690565b600e5481565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156113e05780601f106113b5576101008083540402835291602001916113e0565b60085490565b6015546001600160a01b03163314611f8257600080fd5b600060095411611fcf576040805162461bcd60e51b8152602060048201526013602482015272214e4953545f546f5f4469737472696275746560681b604482015290519081900360640190fd5b611fda6113f6611465565b611fe3816128c1565b60005b8281101561201a57612012848483818110611ffd57fe5b905060200201356001600160a01b0316612a2a565b600101611fe6565b50505050565b600061205a61202d61220d565b612038600d5461342c565b60018151811061204457fe5b60200260200101516111c290919063ffffffff16565b905090565b601d6020526000908152604090205460ff1681565b600061143861208161284a565b846115368560405180606001604052806025815260200161445860259139600160006120ab61284a565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff612e4c16565b60006114386120ef61284a565b8484612bd5565b601e54600160a01b900460ff1681565b6016546001600160a01b031681565b6001600160a01b038116600090815260116020526040812060028101546006546001909201546013546111bc936121819290916104c09161215c919063ffffffff612b9316565b6001600160a01b0388166000908152601160205260409020549063ffffffff61116016565b9063ffffffff61300d16565b600a5481565b61219b61284a565b6017546001600160a01b039081169116146121eb576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b602980546001600160a01b0319166001600160a01b0392909216919091179055565b600080805b601254811015611bc657612262601160006012848154811061223057fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054839063ffffffff61300d16565b9150600101612212565b601e54600160a81b900463ffffffff1681565b601e546001600160a01b031681565b60116020526000908152604090208054600182015460029092015490919083565b6122b761284a565b6017546001600160a01b03908116911614612307576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b601e5461231e906001600160a01b03166000611dbd565b601e80546001600160a01b0319166001600160a01b03838116919091179182905561234b91166000613510565b601e54611745906001600160a01b03166001611dbd565b61236a61284a565b6017546001600160a01b039081169116146123ba576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b601580546001600160a01b0319166001600160a01b0392909216919091179055565b6123e461284a565b6017546001600160a01b03908116911614612434576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b602880546001600160a01b0319166001600160a01b0392909216919091179055565b6028546001600160a01b031681565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6019546001600160a01b031633146124ef576040805162461bcd60e51b815260206004820152601b60248201527f21696e697469616c446973747269627574696f6e416464726573730000000000604482015290519081900360640190fd5b601e54600160a81b900463ffffffff1615612551576040805162461bcd60e51b815260206004820152601e60248201527f426f746820545741505320616c726561647920696e697469616c697a65640000604482015290519081900360640190fd5b601e546000908190819061256d906001600160a01b031661310f565b9250925092506000601e60149054906101000a900460ff1661258f5783612591565b825b601e805463ffffffff60a81b1916600160a81b63ffffffff95909516948502179055601f819055671bc16d674ec8000060208190556021805463ffffffff1916909417909355602255506023555050565b60235490565b600080805b601254811015612636576012818154811061260457fe5b6000918252602090912001546001600160a01b038581169116141561262e57600192509050611ccb565b6001016125ed565b50600093849350915050565b61264a61284a565b6017546001600160a01b0390811691161461269a576040805162461bcd60e51b815260206004820181905260248201526000805160206143c4833981519152604482015290519081900360640190fd5b6001600160a01b0381166126df5760405162461bcd60e51b81526004018080602001828103825260268152602001806142266026913960400191505060405180910390fd5b6017546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3601780546001600160a01b0319166001600160a01b0392909216919091179055565b60225481565b606060128054806020026020016040519081016040528092919081815260200182805480156113e057602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161277b575050505050905090565b60075490565b600081836128345760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156127f95781810151838201526020016127e1565b50505050905090810190601f1680156128265780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161284057fe5b0495945050505050565b3390565b600755565b600061285d61220d565b905080158015906128705750600d548211155b15611420576128a0612891826104c06006548661116090919063ffffffff16565b6013549063ffffffff61300d16565b601355600d546128b6908363ffffffff612b9316565b600d5542600e555050565b60606128cc8261342c565b60145481519192506001600160a01b03169063791ac9479083906000906128ef57fe5b60200260200101518360018151811061290457fe5b602002602001015161291461355d565b30426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03166001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561298f578181015183820152602001612977565b505050509050019650505050505050600060405180830381600087803b1580156129b857600080fd5b505af11580156129cc573d6000803e3d6000fd5b505050506114206129fc826000815181106129e357fe5b6020026020010151600954612b9390919063ffffffff16565b612a2583600081518110612a0c57fe5b6020026020010151600d54612b9390919063ffffffff16565b61363b565b6000612a3582611eda565b90508015801590612a465750804710155b1561142057612a558282613660565b604080516060810182526001600160a01b038416600081815260116020818152858320805486526013548287019081529686018481529490935252915182559151600182015590516002909101555050565b6001600160a01b038316612aec5760405162461bcd60e51b81526004018080602001828103825260248152602001806144096024913960400191505060405180910390fd5b6001600160a01b038216612b315760405162461bcd60e51b815260040180806020018281038252602281526020018061424c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60006111b983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612e4c565b82612bde611a10565b1580612bf457506019546001600160a01b031633145b80612c035750612c0333613753565b80612c3b57506028546001600160a01b031633148015612c3b5750612c26611eef565b6001600160a01b0316816001600160a01b0316145b612c765760405162461bcd60e51b815260040180806020018281038252604081526020018061433b6040913960400191505060405180910390fd5b612c7f84613753565b612e1357612c8c84611820565b15612cfe57612c99613771565b612ca4848484612ea6565b6000612cc7670de0b6b3a76400006104c08560265461116090919063ffffffff16565b9050612cde6009548261300d90919063ffffffff16565b612ce730611ceb565b1115612cf857612cf8308583612ea6565b50612e0e565b612d0783611820565b15612de657612d14613771565b6000612d37670de0b6b3a76400006104c08560275461116090919063ffffffff16565b9050612d73816040518060400160405280600d81526020016c73656c6c556e646572666c6f7760981b81525085612e4c9092919063ffffffff16565b9250612dbe612d9b612d8c83600263ffffffff6111c216565b6009549063ffffffff61300d16565b612a25612daf84600263ffffffff6111c216565b600d549063ffffffff61300d16565b612dc9858585612ea6565b612dd4853083612ea6565b612cf885612de187611ceb565b613510565b612e0384612de184612df788611ceb565b9063ffffffff612b9316565b612e0e848484612ea6565b612e1e565b612e1e848484612ea6565b612e2783613753565b158015612e3a5750612e3883611820565b155b1561201a5761201a83612de185611ceb565b60008184841115612e9e5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156127f95781810151838201526020016127e1565b505050900390565b6001600160a01b038316612eeb5760405162461bcd60e51b81526004018080602001828103825260258152602001806143e46025913960400191505060405180910390fd5b6001600160a01b038216612f305760405162461bcd60e51b81526004018080602001828103825260238152602001806142036023913960400191505060405180910390fd5b612f3b838383613558565b612f7e8160405180606001604052806026815260200161426e602691396001600160a01b038616600090815260208190526040902054919063ffffffff612e4c16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612fb3908263ffffffff61300d16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000828201838110156111b9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b601754600160a01b900460ff166130bc576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6017805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6130f261284a565b604080516001600160a01b039092168252519081900360200190a1565b600080600061311c613902565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561315757600080fd5b505afa15801561316b573d6000803e3d6000fd5b505050506040513d602081101561318157600080fd5b505160408051635a3d549360e01b815290519194506001600160a01b03861691635a3d549391600480820192602092909190829003018186803b1580156131c757600080fd5b505afa1580156131db573d6000803e3d6000fd5b505050506040513d60208110156131f157600080fd5b505160408051630240bc6b60e21b81529051919350600091829182916001600160a01b03891691630902f1ac916004808301926060929190829003018186803b15801561323d57600080fd5b505afa158015613251573d6000803e3d6000fd5b505050506040513d606081101561326757600080fd5b5080516020820151604090920151909450909250905063ffffffff808216908516146132f45780840363ffffffff81166132ad6001600160701b0380861690871661390c565b600001516001600160e01b031602870196508063ffffffff166132e2856001600160701b0316856001600160701b031661390c565b516001600160e01b0316029590950194505b5050509193909250565b6133066141ef565b600082158061332c57505082516001600160e01b03168281029083828161332957fe5b04145b61337d576040805162461bcd60e51b815260206004820152601960248201527f4669786564506f696e743a3a6d756c3a206f766572666c6f7700000000000000604482015290519081900360640190fd5b60408051602081019091529081529392505050565b5160701c90565b600855565b6000805b6012548110156133ee578282101580156133bb57508215155b156133c6575061183d565b600b546133d96012838154811061156757fe5b11156133e6576001820191505b6001016133a2565b50919050565b600b55565b60008061340583612115565b90506134108161342c565b60018151811061341c57fe5b6020026020010151915050919050565b60606000821161349057604080516002808252606082018352909160208301908036833701905050905060008160008151811061346557fe5b60200260200101818152505060008160018151811061348057fe5b602090810291909101015261183d565b6014546040805163c45a015560e01b815290516111bc926001600160a01b03169163c45a0155916004808301926020929190829003018186803b1580156134d657600080fd5b505afa1580156134ea573d6000803e3d6000fd5b505050506040513d602081101561350057600080fd5b50518361350b61355d565b613a78565b600061351b836125e8565b509050600a54821061353f5761353083613bc4565b61353a8383613c28565b613558565b80156135585761354f8383613c28565b61355883613c90565b505050565b604080516002808252606080830184529283929190602083019080368337019050509050308160008151811061358f57fe5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156135e357600080fd5b505afa1580156135f7573d6000803e3d6000fd5b505050506040513d602081101561360d57600080fd5b505181518290600190811061361e57fe5b6001600160a01b0390921660209283029190910190910152905090565b6009829055600d819055600f5461365990829063ffffffff6111c216565b6010555050565b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b602083106136ac5780518252601f19909201916020918201910161368d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461370e576040519150601f19603f3d011682016040523d82523d6000602084013e613713565b606091505b50509050806135585760405162461bcd60e51b81526004018080602001828103825260348152602001806142946034913960400191505060405180910390fd5b6001600160a01b03166000908152601c602052604090205460ff1690565b601e546000908190819061378d906001600160a01b031661310f565b9250925092506000601e60149054906101000a900460ff166137af57836137b1565b825b601e5460215460255492935063ffffffff600160a81b9092048216850392908216850391600091908416111561385f576137e96141dd565b60405180602001604052808563ffffffff16601f5488038161380757fe5b046001600160e01b03169052601f869055601e805463ffffffff60a81b1916600160a81b63ffffffff8a1602179055905061384d6119df82670de0b6b3a76400006132fe565b6001600160901b031660205550600190505b6024548263ffffffff1611156138e4576138776141dd565b60405180602001604052808463ffffffff1660225488038161389557fe5b046001600160e01b0316905260228690556021805463ffffffff191663ffffffff891617905590506138d26119df82670de0b6b3a76400006132fe565b6001600160901b031660235550600190505b80156138f9576138f2611869565b6027556026555b50505050505050565b63ffffffff421690565b6139146141dd565b600082116139535760405162461bcd60e51b81526004018080602001828103825260268152602001806142ed6026913960400191505060405180910390fd5b8261396d57506040805160208101909152600081526111bc565b6001600160901b038311613a0957600082607085901b8161398a57fe5b0490506001600160e01b038111156139e9576040805162461bcd60e51b815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b6040518060200160405280826001600160e01b03168152509150506111bc565b6000613a1a84600160701b85613d3e565b90506001600160e01b038111156139e9576040805162461bcd60e51b815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b6060600282511015613ad1576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a20494e56414c49445f504154480000604482015290519081900360640190fd5b815167ffffffffffffffff81118015613ae957600080fd5b50604051908082528060200260200182016040528015613b13578160200160208202803683370190505b5090508281600081518110613b2457fe5b60200260200101818152505060005b6001835103811015613bbc57600080613b7687868581518110613b5257fe5b6020026020010151878660010181518110613b6957fe5b6020026020010151613df7565b91509150613b98848481518110613b8957fe5b60200260200101518383613ebe565b848460010181518110613ba757fe5b60209081029190910101525050600101613b33565b509392505050565b6000613bcf826125e8565b5090508061142057601280546001810182556000919091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec34440180546001600160a01b0384166001600160a01b03199091161790555050565b613c336113f6611465565b60405180606001604052808281526020016013548152602001613c5584612115565b90526001600160a01b039092166000908152601160209081526040918290208451815590840151600182015592015160029092019190915550565b600080613c9c836125e8565b91509150811561355857601280546000198101908110613cb857fe5b600091825260209091200154601280546001600160a01b039092169183908110613cde57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506012805480613d1757fe5b600082815260209020810160001990810180546001600160a01b0319169055019055505050565b6000806000613d4d8686613fa2565b9150915060008480613d5b57fe5b868809905082811115613d6f576001820391505b918290039181613d8d57848381613d8257fe5b04935050505061153f565b848210613de1576040805162461bcd60e51b815260206004820152601a60248201527f46756c6c4d6174683a2046554c4c4449565f4f564552464c4f57000000000000604482015290519081900360640190fd5b613dec838387613fcf565b979650505050505050565b6000806000613e06858561403f565b509050600080613e1788888861411d565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015613e4f57600080fd5b505afa158015613e63573d6000803e3d6000fd5b505050506040513d6060811015613e7957600080fd5b5080516020909101516001600160701b0391821693501690506001600160a01b0387811690841614613eac578082613eaf565b81815b90999098509650505050505050565b6000808411613efe5760405162461bcd60e51b815260040180806020018281038252602b81526020018061442d602b913960400191505060405180910390fd5b600083118015613f0e5750600082115b613f495760405162461bcd60e51b81526004018080602001828103825260288152602001806143136028913960400191505060405180910390fd5b6000613f5d856103e563ffffffff61116016565b90506000613f71828563ffffffff61116016565b90506000613f8b83612181886103e863ffffffff61116016565b9050808281613f9657fe5b04979650505050505050565b6000808060001984860990508385029250828103915082811015613fc7576001820391505b509250929050565b60008181038216808381613fdf57fe5b049250808581613feb57fe5b049450808160000381613ffa57fe5b60028581038087028203028087028203028087028203028087028203028087028203028087028203029586029003909402930460010193909302939093010292915050565b600080826001600160a01b0316846001600160a01b031614156140935760405162461bcd60e51b81526004018080602001828103825260258152602001806142c86025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b0316106140b35782846140b6565b83835b90925090506001600160a01b038216614116576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b600080600061412c858561403f565b604080516bffffffffffffffffffffffff19606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501206001600160f81b031960688401529a90941b9093166069840152607d8301989098527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b60408051602081019091526000815290565b604051806020016040528060008152509056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63655472616e7366657248656c7065723a3a736166655472616e736665724554483a20455448207472616e73666572206661696c6564556e697377617056324c6962726172793a204944454e544943414c5f4144445245535345534669786564506f696e743a3a6672616374696f6e3a206469766973696f6e206279207a65726f556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459217061757365642026262021696e697469616c446973747269627574696f6e416464726573732021496e697469616c4c697175696469747950726f7669646572536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e5445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122018877741ccf2e810a2840c4728ee3c20861c26d898171fe62c6c15fa4cb1199e64736f6c63430006060033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000a8c0000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000e3ef895c59e7db27214ab5bbf56347ce115a3f4
-----Decoded View---------------
Arg [0] : _minDeltaTwapLong (uint256): 43200
Arg [1] : _minDeltaTwapShort (uint256): 30
Arg [2] : rlrToken (address): 0x0E3EF895c59E7Db27214AB5bbf56347cE115A3f4
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000000a8c0
Arg [1] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [2] : 0000000000000000000000000e3ef895c59e7db27214ab5bbf56347ce115a3f4
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.