Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
Contract is not verified. However, we found a verified contract with the same bytecode in Blockscout DB 0x301797ce7c309e3c88181c688413117fef39a38b.
All metadata displayed below is from that contract. In order to verify current contract, click Verify & Publish button
Verify & Publish
All metadata displayed below is from that contract. In order to verify current contract, click Verify & Publish button
- Contract name:
- IcariaSmartToken
- Optimization enabled
- true
- Compiler version
- v0.8.28+commit.7893614a
- Optimization runs
- 20
- Verified at
- 2025-09-01T17:31:00.691835Z
contracts/icaria/IcariaSmartToken.sol
//
//
//
// ██╗ ██████╗ █████╗ ██████╗ ██╗ █████╗ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗
// ██║██╔════╝██╔══██╗██╔══██╗██║██╔══██╗ ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝
// ██║██║ ███████║██████╔╝██║███████║ █████╗ ██║ ██║██████╔╝██║ ███╗█████╗
// ██║██║ ██╔══██║██╔══██╗██║██╔══██║ ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝
// ██║╚██████╗██║ ██║██║ ██║██║██║ ██║ ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗
// ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
//
//
//
// Forge
// Web: https://forge.icaria.pro
// Tg: https://t.me/icariaforge
//
// Icaria
// Web: https://icaria.pro
// Tg: https://t.me/icarusprc20
// X: https://x.com/IcarusPRC20
//
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import { ERC20 } from "../ERC20.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IcariaRYManager } from "./IcariaRYManager.sol";
import { Ownable }from "@openzeppelin/contracts/access/Ownable.sol";
import { IUniswapV2Factory } from "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import { IUniswapV2Router02 } from "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import { IUniswapV2Pair } from "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
import { IIcariaHelpers } from "./interfaces/IIcariaHelpers.sol";
import { IIcariaSmartTrader } from "./interfaces/IIcariaSmartTrader.sol";
import { IIcariaSmartTokenFactory } from "./interfaces/IIcariaSmartTokenFactory.sol";
import { IWETH } from "./interfaces/IWETH.sol";
contract IcariaSmartToken is ERC20, Ownable, IcariaRYManager {
// --- Trading control ---
bool public tradingEnabled;
error TradingDisabled();
error AlreadyEnabled();
uint256 public constant tokenVersion = 2;
uint256 public initialSupply;
uint256 private constant GLOBAL_DIVIDER = 10000;
address private icariaSmartTrader;
address private deployer;
address private factory;
address[] private routers = [0x98bf93ebf5c380C0e6Ae8e192A7e2AE08edAcc02, 0x165C3410fC91EF562C50559f7d2289fEbed552d9, 0xcC73b59F8D7b7c532703bDfea2808a28a488cF47, 0xeB45a3c4aedd0F47F345fB4c8A1802BB5740d725];
mapping (address => bool) isTaxExcluded;
uint256 private currentSwapAmount;
uint256 private accumulatedIcariaFee;
bool private icariaFeeEnabled = false;
bool private shouldAccumulateIcariaFee = false;
bool private reflectionsEnabled = false;
bool private yieldEnabled = false;
bool private firstPairInteractionHappened = false;
bool private processedTaxesInTx;
IIcariaHelpers.Tax[] public taxes;
event TradingEnabled();
constructor(
string memory name_,
string memory symbol_,
address _owner,
address _mintTo,
uint256 _initialSupply,
IIcariaHelpers.Tax[] memory _taxes,
address _icariaSmartTrader,
address _factory,
address _helpers,
bool _tradingEnabled
) ERC20(name_, symbol_) Ownable(_owner) IcariaRYManager(_helpers) {
tradingEnabled = _tradingEnabled;
_mint(_mintTo, _initialSupply);
deployer = _mintTo;
initialSupply = _initialSupply;
icariaSmartTrader = _icariaSmartTrader;
factory = _factory;
inititlizeTaxExclusions();
if(_taxes.length > 0) {
address[] memory _yieldTokens;
icariaFeeEnabled = true;
(shouldAccumulateIcariaFee, reflectionsEnabled, yieldEnabled, taxes, _yieldTokens) = IIcariaHelpers(helpers).taxesInitialize(_taxes);
if (reflectionsEnabled || yieldEnabled) initializeReflectionExclusions();
for(uint256 i = 0; i < _yieldTokens.length; i++) {
addYieldToken(_yieldTokens[i]);
}
}
}
function _transfer(address from, address to, uint256 value) internal override {
processedTaxesInTx = false;
if(isDeadAddress(to)) {
super._burn(from, value);
return;
}
if(!tradingEnabled && !isTaxExcluded[from]) revert TradingDisabled();
if (taxes.length == 0 || !firstPairInteractionHappened || isTaxExcluded[from] || isTaxExcluded[to] || inSwap) {
if(!firstPairInteractionHappened && isPair(to)) firstPairInteractionHappened = true;
_claimYield(from, to);
super._transfer(from, to, value);
return;
}
if(isPair(to) && !isReflectionExcluded[to]) isReflectionExcluded[to] = true;
currentSwapAmount = value;
uint256 amountAfterTaxs = processTaxes(from, to, value);
if (hasAccumulatedTaxes() && firstPairInteractionHappened && !inSwap && !processedTaxesInTx || shouldAccumulateIcariaFee ) {
if(!isBuy(from, to)) {
processAccumulatedTaxes();
processedTaxesInTx = true;
}
}
_claimYield(from, to);
_claimReflections(from, to);
super._transfer(from, to, amountAfterTaxs);
}
function processTaxes(address from, address to, uint256 amount) internal returns (uint256) {
uint256 totalTaxAmount = 0;
uint256 totalIcariaFee = 0;
for (uint256 i = 0; i < taxes.length; i++) {
IIcariaHelpers.Tax memory tax = taxes[i];
uint256 taxAmount;
uint256 icariaFee;
if (tax.taxMoment == IIcariaHelpers.TaxMoment.Both) {
(taxAmount, icariaFee) = calculateTaxAmount(amount, tax);
processTaxType(from, taxAmount, tax);
} else if (tax.taxMoment == IIcariaHelpers.TaxMoment.Buy && isBuy(from, to)) {
(taxAmount, icariaFee) = calculateTaxAmount(amount, tax);
processTaxType(from, taxAmount, tax);
} else if (tax.taxMoment == IIcariaHelpers.TaxMoment.Sell && isSell(from, to)) {
(taxAmount, icariaFee) = calculateTaxAmount(amount, tax);
processTaxType(from, taxAmount, tax);
}
totalTaxAmount += taxAmount;
totalIcariaFee += icariaFee;
}
if (totalIcariaFee > 0) {
if (shouldAccumulateIcariaFee) {
super._transfer(from, address(this), totalIcariaFee);
accumulatedIcariaFee += totalIcariaFee;
} else {
super._transfer(from, getIcariaWallet(), totalIcariaFee);
}
}
return amount - totalTaxAmount - totalIcariaFee;
}
function calculateTaxAmount(uint256 originalAmount, IIcariaHelpers.Tax memory tax) internal view returns (uint256 taxAmount, uint256 icariaFee) {
return IIcariaHelpers(helpers).calculateTaxAmount(
originalAmount,
tax.percentage,
getIcariaFee(),
icariaFeeEnabled,
GLOBAL_DIVIDER
);
}
function processTaxType(address from, uint256 taxAmount, IIcariaHelpers.Tax memory tax) internal {
if (isBurnTax(tax)) {
processBurnTax(from, taxAmount, tax);
} else if (isReflectionTax(tax)) {
processReflectionTax(from, taxAmount, tax);
} else if (isDevTax(tax)) {
processDevTax(from, taxAmount, tax);
} else if (isExternalBurnTax(tax)) {
processExternalBurnTax(from, taxAmount, tax);
} else if (isYieldTax(tax)) {
processYieldTax(from, taxAmount, tax);
} else if (isLiquifyTax(tax)) {
processLiquifyTax(from, taxAmount, tax);
}
}
function processBurnTax(address from, uint256 taxAmount, IIcariaHelpers.Tax memory tax) internal {
super._burn(from, taxAmount);
addToTotal(taxAmount, tax);
}
function processDevTax(address from, uint256 taxAmount, IIcariaHelpers.Tax memory tax) internal {
if(!isTaxExcluded[tax.receiver]) isTaxExcluded[tax.receiver] = true;
if (tax.rewardInPls) {
getTaxAndAccumulate(from, taxAmount, tax);
} else {
super._transfer(from, tax.receiver, taxAmount);
}
}
function processReflectionTax(address from, uint256 taxAmount, IIcariaHelpers.Tax memory tax) internal {
super._transfer(from, address(this), taxAmount);
uint256 supply = totalSupply() - balanceOf(address(this));
if (supply > 0) {
reflectionsPerShareAmount += (taxAmount * PRECISION) / supply;
}
addToTotal(taxAmount, tax);
}
function processExternalBurnTax(address from, uint256 taxAmount, IIcariaHelpers.Tax memory tax) internal lockSwap {
getTaxAndAccumulate(from, taxAmount, tax);
}
function processYieldTax(address from, uint256 taxAmount, IIcariaHelpers.Tax memory tax) internal lockSwap {
getTaxAndAccumulate(from, taxAmount, tax);
}
function processLiquifyTax(address from, uint256 taxAmount, IIcariaHelpers.Tax memory tax) internal lockSwap {
getTaxAndAccumulate(from, taxAmount, tax);
}
function getTaxAndAccumulate(address from, uint256 taxAmount, IIcariaHelpers.Tax memory tax) internal {
super._transfer(from, address(this), taxAmount);
taxes[tax.id].amountAccumulated += taxAmount;
}
function addToTotal(uint256 taxAmount, IIcariaHelpers.Tax memory tax) internal {
taxes[tax.id].total += taxAmount;
}
function processAccumulatedTaxes() internal lockSwap {
uint256 totalToSwap = 0;
uint256 totalTokenTypes = 0;
bool[] memory taxesToProcess = new bool[](taxes.length);
uint256[] memory taxAmounts = new uint256[](taxes.length);
for (uint256 i = 0; i < taxes.length; i++) {
IIcariaHelpers.Tax storage tax = taxes[i];
if (tax.amountAccumulated == 0) continue;
// Check if this tax type should be processed
bool shouldProcess = isExternalBurnTax(tax) ||
(isDevTax(tax) && tax.rewardInPls) ||
isYieldTax(tax) ||
isLiquifyTax(tax);
if (!shouldProcess) continue;
// Get the amount to process
(uint256 swapAmount, uint256 newAccumulatedAmount) = getProcessingAmount(tax.amountAccumulated);
if (swapAmount > 0) {
uint256 amountToSwap = swapAmount;
uint256 finalAccumulatedAmount = newAccumulatedAmount;
// Special handling for Liquify tax type
if (isLiquifyTax(tax)) {
// For Liquify, we only swap half of the tokens
amountToSwap = swapAmount / 2;
// Keep the other half for liquidity
finalAccumulatedAmount = newAccumulatedAmount + (swapAmount - amountToSwap);
}
taxesToProcess[i] = true;
taxAmounts[i] = amountToSwap;
totalToSwap += amountToSwap;
totalTokenTypes++;
taxes[i].amountAccumulated = finalAccumulatedAmount;
} else {
taxes[i].amountAccumulated = newAccumulatedAmount;
}
}
(/*address bestPair*/, address bestRouter) = getBestPair(address(this), wethAddress);
if (bestRouter == address(0)) return;
(uint256 icariaToProcess, uint256 newAccumulatedIcariaAmount) = getProcessingAmount(accumulatedIcariaFee);
totalToSwap += icariaToProcess;
if (totalToSwap == 0) return;
uint256 icariaToTaxesRatio = icariaToProcess * PRECISION / totalToSwap;
accumulatedIcariaFee = newAccumulatedIcariaAmount;
_approve(address(this), icariaSmartTrader, totalToSwap);
try IIcariaSmartTrader(icariaSmartTrader).swapExactTokensForTokensSupportingFeeOnTransferTokens(
bestRouter,
address(this),
totalToSwap,
getTokenWETHPath(address(this))
) {
} catch {
for (uint256 i = 0; i < taxes.length; i++) {
if (taxesToProcess[i]) {
taxes[i].amountAccumulated += taxAmounts[i];
}
}
accumulatedIcariaFee += icariaToProcess;
return;
}
uint256 totalWethReceived = IERC20(wethAddress).balanceOf(address(this)) - wethYieldBalance;
uint256 _icariaFee = totalWethReceived * icariaToTaxesRatio / PRECISION;
sendWETH(_icariaFee, getIcariaWallet());
totalWethReceived -= _icariaFee;
totalToSwap -= icariaToProcess;
if (totalWethReceived == 0) return;
for (uint256 i = 0; i < taxes.length; i++) {
if (!taxesToProcess[i] || taxAmounts[i] == 0) continue;
uint256 wethPortion = (taxAmounts[i] * totalWethReceived) / totalToSwap;
IIcariaHelpers.Tax storage tax = taxes[i];
if (isExternalBurnTax(tax)) {
processExternalBurnWeth(wethPortion, tax);
} else if (isDevTax(tax) && tax.rewardInPls) {
sendWETH(wethPortion, tax.receiver);
} else if (isYieldTax(tax)) {
processYieldWeth(wethPortion, tax);
} else if (isLiquifyTax(tax)) {
processLiquifyWeth(wethPortion, tax);
addToTotal(wethPortion*2, tax);
}
}
}
function processExternalBurnWeth(uint256 wethAmount, IIcariaHelpers.Tax memory tax) internal {
if (wethAmount == 0) return;
if (tax.tokenAddress == wethAddress) {
sendWETH(wethAmount, tax.receiver);
return;
}
(/*address bestTargetPair*/, address bestTargetRouter) = getBestPair(wethAddress, tax.tokenAddress);
uint256 initialBalance = IERC20(tax.tokenAddress).balanceOf(deadAddress);
IERC20(wethAddress).approve(icariaSmartTrader, wethAmount);
try IIcariaSmartTrader(icariaSmartTrader).buyToken(bestTargetRouter, deadAddress, wethAmount, getWETHBuyBurnPath(tax.tokenAddress)) {
uint256 finalTokenBalance = IERC20(tax.tokenAddress).balanceOf(deadAddress);
uint256 boughtAmount = finalTokenBalance - initialBalance;
addToTotal(boughtAmount, tax);
} catch {
sendWETH(wethAmount, deadAddress);
}
}
function sendWETH(uint256 wethAmount, address receiver) internal {
if (wethAmount == 0) return;
try IWETH(wethAddress).withdraw(wethAmount){
(bool success,) = receiver.call{value: wethAmount}("");
if (!success) {
IERC20(wethAddress).transfer(receiver, wethAmount);
}
} catch {
IERC20(wethAddress).transfer(receiver, wethAmount);
}
}
function processYieldWeth(uint256 wethAmount, IIcariaHelpers.Tax memory tax) internal {
if (wethAmount == 0) return;
if (tax.tokenAddress == wethAddress) {
wethYieldBalance += wethAmount;
uint256 tokenIndex = addYieldToken(tax.tokenAddress);
uint256 supply = totalSupply() - balanceOf(address(this));
if (supply > 0) {
yieldTokens[tokenIndex].reflectionsPerShareAmount += (wethAmount * PRECISION) / supply;
}
return;
}
(/*address bestTargetPair*/, address bestTargetRouter) = getBestPair(wethAddress, tax.tokenAddress);
uint256 initialTokenBalance = IERC20(tax.tokenAddress).balanceOf(address(this));
IERC20(wethAddress).approve(icariaSmartTrader, wethAmount);
try IIcariaSmartTrader(icariaSmartTrader).buyToken(bestTargetRouter, address(this), wethAmount, getWETHBuyBurnPath(tax.tokenAddress)) {
uint256 finalTokenBalance = IERC20(tax.tokenAddress).balanceOf(address(this));
uint256 boughtAmount = finalTokenBalance - initialTokenBalance;
if (boughtAmount > 0) {
uint256 tokenIndex = addYieldToken(tax.tokenAddress);
uint256 supply = totalSupply() - balanceOf(address(this));
if (supply > 0) {
yieldTokens[tokenIndex].reflectionsPerShareAmount += (boughtAmount * PRECISION) / supply;
}
addToTotal(boughtAmount, tax);
}
} catch {}
}
function processLiquifyWeth(uint256 wethAmount, IIcariaHelpers.Tax memory tax) internal {
if (wethAmount == 0) return;
// Use the tokens that were kept in the contract for liquidity
uint256 tokensForLiquidity = tax.amountAccumulated;
if (tokensForLiquidity == 0) return;
(/*address bestPair*/, address bestRouter) = getBestPair(address(this), wethAddress);
if (bestRouter == address(0)) return;
// Approve tokens for liquidity
_approve(address(this), icariaSmartTrader, tokensForLiquidity);
IERC20(wethAddress).approve(icariaSmartTrader, wethAmount);
try IIcariaSmartTrader(icariaSmartTrader).addLiquidity(
bestRouter,
address(this),
wethAddress,
tokensForLiquidity,
wethAmount,
deadAddress
) {
// Successfully added liquidity and LP tokens are burned
// Clear the accumulated amount since we've used it all
taxes[tax.id].amountAccumulated = 0;
} catch {
// If adding liquidity fails, keep the tokens in the contract for the next cycle
}
}
function _claimReflections(address from, address to) internal {
if (!reflectionsEnabled) return;
(uint256 fromAmount, uint256 toAmount, uint256 deployerAmount) = updateAndClaimReflections(from, to, deployer);
if(fromAmount != 0){
if(!isPair(from)){
super._transfer(address(this), from, fromAmount);
}
}
if(toAmount != 0){
if(!isPair(to)){
super._transfer(address(this), to, toAmount);
}
}
if(deployerAmount != 0){
super._transfer(address(this), deployer, deployerAmount);
}
}
function initializeReflectionExclusions() internal {
isReflectionExcluded[address(0)] = true;
isReflectionExcluded[address(this)] = true;
for (uint256 i = 0; i < routers.length; ) {
isReflectionExcluded[routers[i]] = true;
unchecked { i++; }
}
}
function isDeadAddress(address _address) internal view returns (bool) {
return IIcariaHelpers(helpers).isDeadAddress(_address);
}
function isPair(address _address) internal view returns (bool) {
return IIcariaHelpers(helpers).isPair(_address, address(this));
}
function isBuy(address from, address to) internal view returns (bool) {
return IIcariaHelpers(helpers).isBuy(from, to, address(this));
}
function isSell(address from, address to) internal view returns (bool) {
return IIcariaHelpers(helpers).isSell(from, to, address(this));
}
function getProcessingAmount(uint256 accumulatedAmount) internal view returns (uint256 processAmount, uint256 newAccumulatedAmount) {
return IIcariaHelpers(helpers).getProcessingAmount(accumulatedAmount, currentSwapAmount);
}
function getTokenWETHPath(address tokenAddress) internal view returns (address[] memory) {
return IIcariaHelpers(helpers).getTokenWPLSPath(tokenAddress);
}
function getWETHBuyBurnPath(address tokenAddress) internal view returns (address[] memory) {
return IIcariaHelpers(helpers).getWPLSBuyBurnPath(tokenAddress);
}
function getTaxes() public view returns (IIcariaHelpers.Tax[] memory) {
return taxes;
}
function getIcariaFee() public view returns (uint256) {
return IIcariaSmartTokenFactory(factory).ICARIA_FEE();
}
function getIcariaWallet() public view returns (address) {
return IIcariaSmartTokenFactory(factory).ICARIA_WALLET();
}
function getAccumulatedIcariaFee() external view returns (uint256) {
return accumulatedIcariaFee;
}
function enableTrading() external onlyOwner {
if(tradingEnabled) revert AlreadyEnabled();
tradingEnabled = true;
emit TradingEnabled();
}
function getTotalTaxs() external view returns (uint256) {
return IIcariaHelpers(helpers).getTotalTaxs(taxes);
}
function forceProcessAccumulatedTaxes() external onlyOwner {
processAccumulatedTaxes();
}
function _claimYield(address from, address to) internal {
if (yieldEnabled) {
updateAndClaimYield(from, to, deployer);
}
}
function claimYield() external returns (bool) {
_claimYield(msg.sender, msg.sender);
return true;
}
function hasAccumulatedTaxes() internal view returns (bool) {
return IIcariaHelpers(helpers).hasAccumulatedTaxes(taxes);
}
function addTaxExclusion(address _address) external onlyOwner {
if(!isPair(_address)) {
isTaxExcluded[_address] = true;
}
}
function removeTaxExclusion(address _address) external onlyOwner {
isTaxExcluded[_address] = false;
}
function getBestPair(address tokenA, address tokenB) internal view returns (address bestPair, address bestRouter) {
return IIcariaHelpers(helpers).getBestPair(tokenA, tokenB, routers);
}
function inititlizeTaxExclusions() internal {
isTaxExcluded[deployer] = true;
isTaxExcluded[address(this)] = true;
isTaxExcluded[icariaSmartTrader] = true;
}
function isBurnTax(IIcariaHelpers.Tax memory tax) internal pure returns (bool) {
return tax.taxType == IIcariaHelpers.TaxType.Burn;
}
function isReflectionTax(IIcariaHelpers.Tax memory tax) internal pure returns (bool) {
return tax.taxType == IIcariaHelpers.TaxType.Reflection;
}
function isDevTax(IIcariaHelpers.Tax memory tax) internal pure returns (bool) {
return tax.taxType == IIcariaHelpers.TaxType.Dev;
}
function isExternalBurnTax(IIcariaHelpers.Tax memory tax) internal pure returns (bool) {
return tax.taxType == IIcariaHelpers.TaxType.ExternalBurn;
}
function isYieldTax(IIcariaHelpers.Tax memory tax) internal pure returns (bool) {
return tax.taxType == IIcariaHelpers.TaxType.Yield;
}
function isLiquifyTax(IIcariaHelpers.Tax memory tax) internal pure returns (bool) {
return tax.taxType == IIcariaHelpers.TaxType.Liquify;
}
receive() external payable {}
}
@openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
@openzeppelin/contracts/interfaces/draft-IERC6093.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC-721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC-1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
@openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
@openzeppelin/contracts/utils/ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}
@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol
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;
}
@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol
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;
}
@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol
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);
}
@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol
pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 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;
}
contracts/ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {Context} from "@openzeppelin/contracts/utils/Context.sol";
import {IERC20Errors} from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC-20
* applications.
*/
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address account => uint256) private _balances;
mapping(address account => mapping(address spender => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Skips emitting an {Approval} event indicating an allowance update. This is not
* required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(address from, address to, uint256 value) internal virtual {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* Emits a {Transfer} event.
*/
function _update(address from, address to, uint256 value) internal virtual {
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
_totalSupply += value;
} else {
uint256 fromBalance = _balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
_balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
_totalSupply -= value;
}
} else {
unchecked {
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
_balances[to] += value;
}
}
emit Transfer(from, to, value);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _mint(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(address(0), account, value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead
*/
function _burn(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(account, address(0), value);
}
/**
* @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
* true using the following override:
*
* ```solidity
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
_allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance < type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(spender, currentAllowance, value);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
}
contracts/icaria/IcariaRYManager.sol
//
//
//
// ██╗ ██████╗ █████╗ ██████╗ ██╗ █████╗ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗
// ██║██╔════╝██╔══██╗██╔══██╗██║██╔══██╗ ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝
// ██║██║ ███████║██████╔╝██║███████║ █████╗ ██║ ██║██████╔╝██║ ███╗█████╗
// ██║██║ ██╔══██║██╔══██╗██║██╔══██║ ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝
// ██║╚██████╗██║ ██║██║ ██║██║██║ ██║ ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗
// ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
//
//
//
// Forge
// Web: https://forge.icaria.pro
// Tg: https://t.me/icariaforge
//
// Icaria
// Web: https://icaria.pro
// Tg: https://t.me/icarusprc20
// X: https://x.com/IcarusPRC20
//
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import { IERC20 }from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IIcariaHelpers } from "./interfaces/IIcariaHelpers.sol";
contract IcariaRYManager {
struct YieldToken {
address tokenAddress;
uint256 reflectionsPerShareAmount;
}
YieldToken[] internal yieldTokens;
uint256 internal PRECISION;
uint256 internal reflectionsPerShareAmount;
uint256 internal wethYieldBalance;
address internal helpers;
address internal wethAddress = 0xA1077a294dDE1B09bB078844df40758a5D0f9a27; // WPLS on PulseChain
address internal deadAddress = 0x0000000000000000000000000000000000000369;
mapping(address => mapping(address => uint256)) public userYieldsPaid;
mapping(address => uint256) internal reflectionDebt;
mapping(address => bool) public isReflectionExcluded;
mapping(address => uint256[]) internal yieldTokenReflectionDebts;
bool internal inSwap;
modifier lockSwap() {
inSwap = true;
_;
inSwap = false;
}
constructor(address _helpers) {
PRECISION = 10**28;
helpers = _helpers;
}
// ------------------------------------------ REFLECTIONS -------------------------------------------------//
function getCurrentReflectionsPerShareAmount() external view returns (uint256) {
return reflectionsPerShareAmount;
}
function isExcludedFromReflections(address account) public view returns (bool) {
return isReflectionExcluded[account];
}
function pendingReflections(address account) public view returns (uint256) {
if (isExcludedFromReflections(account)) {
return 0;
}
return cleanPendingReflections(account);
}
function cleanPendingReflections(address account) internal view returns (uint256) {
return IIcariaHelpers(helpers).cleanPendingReflections(
account,
address(this),
reflectionsPerShareAmount,
reflectionDebt[account],
PRECISION
);
}
function updateAndClaimReflections(address from, address to, address deployer) internal returns (uint256 fromAmount, uint256 toAmount, uint256 deployerAmount) {
if (from == to) {
fromAmount = isExcludedFromReflections(from) ? 0 : pendingReflections(from);
toAmount = 0; // Set to zero to avoid double claiming
} else {
fromAmount = isExcludedFromReflections(from) ? 0 : pendingReflections(from);
toAmount = isExcludedFromReflections(to) ? 0 : pendingReflections(to);
}
deployerAmount = cleanPendingReflections(deployer);
reflectionDebt[deployer] = reflectionsPerShareAmount;
reflectionDebt[from] = reflectionsPerShareAmount;
reflectionDebt[to] = reflectionsPerShareAmount;
}
// function tokenPendingReflections() public view returns (uint256) {
// uint256 currentBalance = IERC20(address(this)).balanceOf(address(this));
// uint256 newReflectionDebt = reflectionsPerShareAmount;
// if (newReflectionDebt <= reflectionDebt[address(this)]) {
// return 0;
// }
// return (newReflectionDebt - reflectionDebt[address(this)]) * currentBalance / PRECISION;
// }
// ------------------------------------------ YIELD TOKENS REFLECTIONS -------------------------------------------------//
function addYieldToken(address tokenAddress) internal returns (uint256 tokenIndex) {
for (uint256 i = 0; i < yieldTokens.length; i++) {
if (yieldTokens[i].tokenAddress == tokenAddress) {
return i;
}
}
yieldTokens.push(YieldToken({
tokenAddress: tokenAddress,
reflectionsPerShareAmount: 0
}));
return yieldTokens.length - 1;
}
function pendingYields(address account, uint256 tokenIndex) public view returns (uint256) {
if (tokenIndex >= yieldTokenReflectionDebts[account].length) {
return 0;
}
return IIcariaHelpers(helpers).pendingYields(
account,
address(this),
yieldTokens[tokenIndex].reflectionsPerShareAmount,
yieldTokenReflectionDebts[account][tokenIndex],
PRECISION
);
}
function updateAndClaimYield(address from, address to, address deployer) internal {
for (uint256 i = 0; i < yieldTokens.length; i++) {
while (yieldTokenReflectionDebts[from].length <= i) {
yieldTokenReflectionDebts[from].push(yieldTokens[i].reflectionsPerShareAmount);
}
while (yieldTokenReflectionDebts[to].length <= i) {
yieldTokenReflectionDebts[to].push(yieldTokens[i].reflectionsPerShareAmount);
}
while (yieldTokenReflectionDebts[deployer].length <= i) {
yieldTokenReflectionDebts[deployer].push(yieldTokens[i].reflectionsPerShareAmount);
}
uint256 fromAmount = isExcludedFromReflections(from) ? 0 : pendingYields(from, i);
uint256 toAmount = 0; // Initialize to 0
if (from != to) {
toAmount = isExcludedFromReflections(to) ? 0 : pendingYields(to, i);
}
uint256[] memory transferAmounts = new uint256[](2);
address[] memory recipients = new address[](2);
uint256 recipientCount = 0;
if (fromAmount > 0) {
transferAmounts[recipientCount] = fromAmount;
recipients[recipientCount] = from;
recipientCount++;
}
if (toAmount > 0) {
transferAmounts[recipientCount] = toAmount;
recipients[recipientCount] = to;
recipientCount++;
}
for (uint256 j = 0; j < recipientCount; j++) {
if(transferAmounts[j] > 0){
try IERC20(yieldTokens[i].tokenAddress).transfer(recipients[j], transferAmounts[j]) {
if(yieldTokens[i].tokenAddress == wethAddress) {
wethYieldBalance -= transferAmounts[j];
}
yieldTokenReflectionDebts[recipients[j]][i] = yieldTokens[i].reflectionsPerShareAmount;
userYieldsPaid[recipients[j]][yieldTokens[i].tokenAddress] += transferAmounts[j];
} catch {
}
}
}
}
}
function getYieldTokens() public view returns (YieldToken[] memory) {
return yieldTokens;
}
function getYieldTokenReflectionDebts(address account) public view returns (uint256[] memory) {
return yieldTokenReflectionDebts[account];
}
// function getYieldsPerShare(uint256 index) public view returns (uint256) {
// return yieldTokens[index].reflectionsPerShareAmount;
// }
// ------------------------------------------ END REFLECTIONS -----------------------------------------------//
//-------------------------------------------- HELPERS FUNCTIONS -------------------------------------------------//
// function excludeFromReflections(address account) external onlyOwner {
// require(!isExcludedFromReflections(account), "Account already excluded");
// isReflectionExcluded[account] = true;
// updateAndClaimReflections(account);
// }
// function includeInReflections(address account) external onlyOwner {
// require(isReflectionExcluded[account], "Not excluded");
// isReflectionExcluded[account] = false;
// reflectionDebt[account] = (balanceOf(account) * reflectionsPerShareAmount) / PRECISION;
// }
}
contracts/icaria/IcariaSmartTokenFactory.sol
//
//
//
// ██╗ ██████╗ █████╗ ██████╗ ██╗ █████╗ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗
// ██║██╔════╝██╔══██╗██╔══██╗██║██╔══██╗ ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝
// ██║██║ ███████║██████╔╝██║███████║ █████╗ ██║ ██║██████╔╝██║ ███╗█████╗
// ██║██║ ██╔══██║██╔══██╗██║██╔══██║ ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝
// ██║╚██████╗██║ ██║██║ ██║██║██║ ██║ ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗
// ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
//
//
//
// Forge
// Web: https://forge.icaria.pro
// Tg: https://t.me/icariaforge
//
// Icaria
// Web: https://icaria.pro
// Tg: https://t.me/icarusprc20
// X: https://x.com/IcarusPRC20
//
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import { IcariaSmartToken } from "./IcariaSmartToken.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IIcariaHelpers } from "./interfaces/IIcariaHelpers.sol";
// --- Custom errors for gas & bytecode savings ---
error Denied();
error InsufficientPayment();
error NotFactoryToken();
error FeeTooHigh();
error InvalidAddress();
error WalletExists();
error WalletsEmpty();
error InvalidAmount();
error InvalidInput();
error LowAmount();
error TransferFailed();
contract IcariaSmartTokenFactory is Ownable, ReentrancyGuard {
uint256 public constant GLOBAL_DIVIDER = 10000;
uint256 public ICARIA_FEE = 750; // 7.5% from total taxes (like if total taxes are 1% then ICARIA_FEE = 0.075%)
address public ICARIA_WALLET;
address public manager;
uint256 public tokenCreationPrice;
address public helpersAddress;
mapping(address => bool) public isFactoryToken;
// Array of wallets for distribution
address processorWallet;
address[] public distributionWallets;
event TokenCreated(address indexed tokenAddress, string name, string symbol, address indexed owner);
modifier onlyManager() {
if(!(owner() == _msgSender() || manager == _msgSender() || processorWallet == _msgSender())) revert Denied();
_;
}
constructor(uint256 _tokenCreationPrice, address _helpersAddress, address[] memory _distributionWallets) Ownable(msg.sender) {
tokenCreationPrice = _tokenCreationPrice;
ICARIA_WALLET = address(this);
helpersAddress = _helpersAddress;
processorWallet = msg.sender;
distributionWallets = _distributionWallets;
}
function createToken(
string memory name_,
string memory symbol_,
uint256 _initialSupply,
IIcariaHelpers.Tax[] memory _taxes,
bool ownershipRenounced,
address _icariaSmartTrader,
bool _tradingEnabled
) external payable nonReentrant returns (address) {
if (_taxes.length > 0) {
if(msg.value < tokenCreationPrice) revert InsufficientPayment();
}
IcariaSmartToken newToken = new IcariaSmartToken(
name_,
symbol_,
address(this),
msg.sender,
_initialSupply,
_taxes,
_icariaSmartTrader,
address(this),
helpersAddress,
_tradingEnabled
);
isFactoryToken[address(newToken)] = true;
ownershipRenounced ? newToken.renounceOwnership() : newToken.transferOwnership(msg.sender);
if (_taxes.length > 0 && tokenCreationPrice > 0) {
_withdrawPLS(tokenCreationPrice);
}
emit TokenCreated(address(newToken), name_, symbol_, msg.sender);
return address(newToken);
}
function getTokenTaxData(address tokenAddress) external view returns (IIcariaHelpers.Tax[] memory) {
if(!isFactoryToken[tokenAddress]) revert NotFactoryToken();
return IcariaSmartToken(payable(tokenAddress)).getTaxes();
}
function getTokenData(address tokenAddress) external view returns (
string memory name,
string memory symbol,
uint256 initialSupply,
uint256 currentSupply,
bool ownershipRenounced,
IIcariaHelpers.Tax[] memory taxes,
bool tradingEnabled
) {
if(!isFactoryToken[tokenAddress]) revert NotFactoryToken();
IcariaSmartToken token = IcariaSmartToken(payable(tokenAddress));
name = token.name();
symbol = token.symbol();
initialSupply = token.initialSupply();
currentSupply = token.totalSupply();
ownershipRenounced = token.owner() == address(0);
taxes = token.getTaxes();
tradingEnabled = token.tradingEnabled();
return (name, symbol, initialSupply, currentSupply, ownershipRenounced, taxes, tradingEnabled);
}
function setTokenCreationPrice(uint256 newPrice) external onlyOwner {
tokenCreationPrice = newPrice;
}
function setIcariaFee(uint256 newFee) external onlyOwner {
if(newFee > GLOBAL_DIVIDER) revert FeeTooHigh();
ICARIA_FEE = newFee;
}
function setIcariaWallet(address wallet) external onlyOwner {
if(wallet == address(0)) revert InvalidAddress();
ICARIA_WALLET = wallet;
}
function setProcessorWallet(address wallet) external onlyOwner {
if(wallet == address(0)) revert InvalidAddress();
processorWallet = wallet;
}
function addDistributionWallet(address wallet) external onlyOwner {
if(wallet == address(0)) revert InvalidAddress();
// Check if wallet already exists
for(uint256 i = 0; i < distributionWallets.length; i++) {
if(distributionWallets[i] == wallet) {
revert WalletExists();
}
}
distributionWallets.push(wallet);
}
function removeDistributionWallet(address walletToRemove) external onlyOwner {
if(distributionWallets.length == 0) revert WalletsEmpty();
for(uint256 i = 0; i < distributionWallets.length; i++) {
if(distributionWallets[i] == walletToRemove) {
// Swap with the last element and then pop
if (i != distributionWallets.length - 1) {
distributionWallets[i] = distributionWallets[distributionWallets.length - 1];
}
distributionWallets.pop();
return;
}
}
revert();
}
function getDistributionWallets() external view returns (address[] memory) {
return distributionWallets;
}
function processPLS(uint256 amount) external onlyManager {
if(amount == 0 || amount > address(this).balance) revert InvalidAmount();
(bool success, ) = processorWallet.call{value: amount}("");
}
function _withdrawPLS(uint256 amount) internal {
uint256 walletsCount = distributionWallets.length;
if(!(walletsCount > 0 && amount > 0 && amount <= address(this).balance)) revert InvalidInput();
uint256 amountPerWallet = amount / walletsCount;
if(amountPerWallet == 0) revert LowAmount();
for(uint256 i = 0; i < walletsCount; i++) {
(bool success, ) = distributionWallets[i].call{value: amountPerWallet}("");
}
}
function withdrawPLS(uint256 amount) external onlyManager nonReentrant {
_withdrawPLS(amount);
}
function setManager(address newManager) external onlyOwner {
manager = newManager;
}
function withdrawERC20(address tokenAddress, address to) external onlyManager nonReentrant {
if(tokenAddress == address(0)) revert InvalidAddress();
IERC20 token = IERC20(tokenAddress);
uint256 balance = token.balanceOf(address(this));
if(!token.transfer(to, balance)) revert TransferFailed();
}
receive() external payable {}
}
contracts/icaria/interfaces/IIcariaHelpers.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IIcariaHelpers {
enum TaxType { Burn, ExternalBurn, Dev, Reflection, Yield, Liquify }
enum TaxMoment { Both, Buy, Sell }
struct Tax {
uint256 id;
TaxType taxType;
TaxMoment taxMoment;
uint256 percentage;
address receiver;
address tokenAddress;
address burnAddress;
bool rewardInPls;
uint256 amountAccumulated;
uint256 total;
}
function getBestPair(
address tokenA,
address tokenB,
address[] memory routers
) external view returns (address bestPair, address bestRouter);
function getTotalPairsBalance(address tokenA, address tokenB, address[] memory routers) external view returns (uint256);
function isPair(address _address, address _tokenAddress) external view returns (bool);
function isBuy(address _from, address _to, address _tokenAddress) external view returns (bool);
function isSell(address _from, address _to, address _tokenAddress) external view returns (bool);
function getTokenWPLSPath(address tokenAddress) external pure returns (address[] memory path);
function getWPLSBuyBurnPath(address tokenAddress) external pure returns (address[] memory path);
function getProcessingAmount(
uint256 accumulatedAmount,
uint256 currentSwapAmount
) external pure returns (uint256 processAmount, uint256 newAccumulatedAmount);
function calculateTaxAmount(
uint256 originalAmount,
uint256 taxPercentage,
uint256 icariaFee,
bool icariaFeeEnabled,
uint256 globalDivider
) external pure returns (uint256 taxAmount, uint256 icariaFeeAmount);
function hasAccumulatedTaxes(Tax[] memory taxes) external pure returns (bool);
function getTotalTaxs(Tax[] memory taxes) external pure returns (uint256);
function cleanPendingReflections(
address account,
address tokenAddress,
uint256 reflectionsPerShareAmount,
uint256 reflectionDebt,
uint256 precision
) external view returns (uint256);
function pendingYields(
address account,
address tokenAddress,
uint256 reflectionsPerShareAmount,
uint256 reflectionDebt,
uint256 precision
) external view returns (uint256);
function isExcludedFromTax(
address from,
address to,
address icariaSmartTrader,
address deployer,
address thisContract
) external pure returns (bool);
function taxesInitialize(IIcariaHelpers.Tax[] memory _taxes) external pure returns (bool, bool, bool, IIcariaHelpers.Tax[] memory, address[] memory);
function isDeadAddress(address _address) external pure returns (bool);
}
contracts/icaria/interfaces/IIcariaSmartTokenFactory.sol
//
//
//
// ██╗ ██████╗ █████╗ ██████╗ ██╗ █████╗ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗
// ██║██╔════╝██╔══██╗██╔══██╗██║██╔══██╗ ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝
// ██║██║ ███████║██████╔╝██║███████║ █████╗ ██║ ██║██████╔╝██║ ███╗█████╗
// ██║██║ ██╔══██║██╔══██╗██║██╔══██║ ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝
// ██║╚██████╗██║ ██║██║ ██║██║██║ ██║ ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗
// ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
//
//
//
// Forge
// Web: https://forge.icaria.pro
// Tg: https://t.me/icariaforge
//
// Icaria
// Web: https://icaria.pro
// Tg: https://t.me/icarusprc20
// X: https://x.com/IcarusPRC20
//
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IIcariaSmartTokenFactory {
function ICARIA_FEE() external view returns (uint256);
function ICARIA_WALLET() external view returns (address);
}
contracts/icaria/interfaces/IIcariaSmartTrader.sol
//
//
//
// ██╗ ██████╗ █████╗ ██████╗ ██╗ █████╗ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗
// ██║██╔════╝██╔══██╗██╔══██╗██║██╔══██╗ ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝
// ██║██║ ███████║██████╔╝██║███████║ █████╗ ██║ ██║██████╔╝██║ ███╗█████╗
// ██║██║ ██╔══██║██╔══██╗██║██╔══██║ ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝
// ██║╚██████╗██║ ██║██║ ██║██║██║ ██║ ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗
// ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
//
//
//
// Forge
// Web: https://forge.icaria.pro
// Tg: https://t.me/icariaforge
//
// Icaria
// Web: https://icaria.pro
// Tg: https://t.me/icarusprc20
// X: https://x.com/IcarusPRC20
//
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IIcariaSmartTrader {
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
address _router,
address _receiver,
uint256 amountIn,
address[] memory path
) external;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
address _router,
address _receiver,
uint256 amountIn,
address[] calldata path
) external;
function buyToken(
address _router,
address _receiver,
uint256 amountIn,
address[] memory path
) external;
function addLiquidity(
address _router,
address _tokenA,
address _tokenB,
uint256 _amountTokenA,
uint256 _amountTokenB,
address _to
) external;
}
contracts/icaria/interfaces/IWETH.sol
//
//
//
// ██╗ ██████╗ █████╗ ██████╗ ██╗ █████╗ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗
// ██║██╔════╝██╔══██╗██╔══██╗██║██╔══██╗ ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝
// ██║██║ ███████║██████╔╝██║███████║ █████╗ ██║ ██║██████╔╝██║ ███╗█████╗
// ██║██║ ██╔══██║██╔══██╗██║██╔══██║ ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝
// ██║╚██████╗██║ ██║██║ ██║██║██║ ██║ ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗
// ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
//
//
//
// Forge
// Web: https://forge.icaria.pro
// Tg: https://t.me/icariaforge
//
// Icaria
// Web: https://icaria.pro
// Tg: https://t.me/icarusprc20
// X: https://x.com/IcarusPRC20
//
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IWETH {
function withdraw(uint256 wad) external;
}
Compiler Settings
{"viaIR":true,"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}},"optimizer":{"runs":20,"enabled":true},"libraries":{},"evmVersion":"paris"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"string","name":"name_","internalType":"string"},{"type":"string","name":"symbol_","internalType":"string"},{"type":"address","name":"_owner","internalType":"address"},{"type":"address","name":"_mintTo","internalType":"address"},{"type":"uint256","name":"_initialSupply","internalType":"uint256"},{"type":"tuple[]","name":"_taxes","internalType":"struct IIcariaHelpers.Tax[]","components":[{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint8","name":"taxType","internalType":"enum IIcariaHelpers.TaxType"},{"type":"uint8","name":"taxMoment","internalType":"enum IIcariaHelpers.TaxMoment"},{"type":"uint256","name":"percentage","internalType":"uint256"},{"type":"address","name":"receiver","internalType":"address"},{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"address","name":"burnAddress","internalType":"address"},{"type":"bool","name":"rewardInPls","internalType":"bool"},{"type":"uint256","name":"amountAccumulated","internalType":"uint256"},{"type":"uint256","name":"total","internalType":"uint256"}]},{"type":"address","name":"_icariaSmartTrader","internalType":"address"},{"type":"address","name":"_factory","internalType":"address"},{"type":"address","name":"_helpers","internalType":"address"},{"type":"bool","name":"_tradingEnabled","internalType":"bool"}]},{"type":"error","name":"AlreadyEnabled","inputs":[]},{"type":"error","name":"ERC20InsufficientAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"allowance","internalType":"uint256"},{"type":"uint256","name":"needed","internalType":"uint256"}]},{"type":"error","name":"ERC20InsufficientBalance","inputs":[{"type":"address","name":"sender","internalType":"address"},{"type":"uint256","name":"balance","internalType":"uint256"},{"type":"uint256","name":"needed","internalType":"uint256"}]},{"type":"error","name":"ERC20InvalidApprover","inputs":[{"type":"address","name":"approver","internalType":"address"}]},{"type":"error","name":"ERC20InvalidReceiver","inputs":[{"type":"address","name":"receiver","internalType":"address"}]},{"type":"error","name":"ERC20InvalidSender","inputs":[{"type":"address","name":"sender","internalType":"address"}]},{"type":"error","name":"ERC20InvalidSpender","inputs":[{"type":"address","name":"spender","internalType":"address"}]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"TradingDisabled","inputs":[]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"TradingEnabled","inputs":[],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addTaxExclusion","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"claimYield","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"enableTrading","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"forceProcessAccumulatedTaxes","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getAccumulatedIcariaFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getCurrentReflectionsPerShareAmount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getIcariaFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getIcariaWallet","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct IIcariaHelpers.Tax[]","components":[{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint8","name":"taxType","internalType":"enum IIcariaHelpers.TaxType"},{"type":"uint8","name":"taxMoment","internalType":"enum IIcariaHelpers.TaxMoment"},{"type":"uint256","name":"percentage","internalType":"uint256"},{"type":"address","name":"receiver","internalType":"address"},{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"address","name":"burnAddress","internalType":"address"},{"type":"bool","name":"rewardInPls","internalType":"bool"},{"type":"uint256","name":"amountAccumulated","internalType":"uint256"},{"type":"uint256","name":"total","internalType":"uint256"}]}],"name":"getTaxes","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTotalTaxs","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getYieldTokenReflectionDebts","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct IcariaRYManager.YieldToken[]","components":[{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"uint256","name":"reflectionsPerShareAmount","internalType":"uint256"}]}],"name":"getYieldTokens","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"initialSupply","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isExcludedFromReflections","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isReflectionExcluded","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingReflections","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingYields","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"tokenIndex","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeTaxExclusion","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint8","name":"taxType","internalType":"enum IIcariaHelpers.TaxType"},{"type":"uint8","name":"taxMoment","internalType":"enum IIcariaHelpers.TaxMoment"},{"type":"uint256","name":"percentage","internalType":"uint256"},{"type":"address","name":"receiver","internalType":"address"},{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"address","name":"burnAddress","internalType":"address"},{"type":"bool","name":"rewardInPls","internalType":"bool"},{"type":"uint256","name":"amountAccumulated","internalType":"uint256"},{"type":"uint256","name":"total","internalType":"uint256"}],"name":"taxes","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenVersion","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"tradingEnabled","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userYieldsPaid","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"}]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x60808060405234610be6576144df803803809161001c8285610beb565b8339810161014082820312610be65781516001600160401b038111610be65781610047918401610c0e565b60208301516001600160401b038111610be65782610066918501610c0e565b61007260408501610c7d565b9161007f60608601610c7d565b608086015160a087015190959192916001600160401b038211610be6576100a7918801610cb5565b956100b460c08201610c7d565b946100c160e08301610c7d565b946100dc6101206100d56101008601610c7d565b9401610ca8565b845190946001600160401b038211610a015760035490600182811c92168015610bdc575b6020831014610afa5781601f849311610b8d575b50602090601f8311600114610b2557600092610b1a575b50508160011b916000199060031b1c1916176003555b8051906001600160401b038211610a015760045490600182811c92168015610b10575b6020831014610afa5781601f849311610aa0575b50602090601f8311600114610a3857600092610a2d575b50508160011b916000199060031b1c1916176004555b6001600160a01b0316908115610a1757600580546001600160a01b03198116841790915560405192906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3600b80546001600160a01b031990811673a1077a294dde1b09bb078844df40758a5d0f9a2717909155600c805482166103691790556b204fce5e3e25026110000000600755600a80549091166001600160a01b0392909216919091179055608081016001600160401b03811182821017610a01576040527398bf93ebf5c380c0e6ae8e192a7e2ae08edacc02815273165c3410fc91ef562c50559f7d2289febed552d9602082015273cc73b59f8d7b7c532703bdfea2808a28a488cf47604082015273eb45a3c4aedd0f47f345fb4c8a1802bb5740d72560608201526016546004601655806004106109bc575b50601660005260206000209060005b6004811061099f575050601a805464ffffffffff19169055506011805461ff00191691151560081b61ff00169190911790556001600160a01b03169182156109895760025484810180911161097357600255600093838552846020526040852081815401905583857fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020604051858152a3601480546001600160a01b031990811686179091556012919091556013805482166001600160a01b0393841617815560158054909216938316939093179055918352601760208181526040808620805460ff1990811660019081179092553088528484528288208054821683179055945490951686529190528320805490911690911790558151610425575b6040516135c09081610eff8239f35b600160ff19601a541617601a558060018060a01b03600a54169260405193849163113b791d60e11b83526024830160206004850152815180915260206044850192019085905b8082106108b15750505082809103915afa9182156108a4578182908392849085966107ae575b5080519068010000000000000000821161079a57601b5482601b5580831061070e575b50601b865285907f3ad8aa4f87544323a9d1e5dd902f40c356527a7955687113db5f9a85ad579dc1906020015b8383106105fa575050505062ff00009063ff00000061ff00601a5492151560081b1694151560181b169063ffffff0019161791151560101b16171780601a5560ff8160101c169081156105ec575b50610572575b805b825181101561056857600581901b83016020015160019190610561906001600160a01b0316610e1d565b5001610537565b5050503880610416565b808052600f60205260408120600160ff19825416179055308152600f60205260408120600160ff19825416179055805b6016548110156105e6576000805160206144bf8339815191528101546001600160a01b03168252600f60205260408220805460ff19166001908117909155016105a2565b50610535565b60ff915060181c163861052f565b80518051835560018301602082015160068110156106fa578154604084015160038110156106e65761ffff1990911660ff90921691909117600891821b61ff0016179091556060820151600285015560808201516003850180546001600160a01b03199081166001600160a01b039384161790915560a0808501516004880180549093169084161790915560c084015160058701805460e08701516001600160a81b0319909116929094169190911792151590911b60ff60a01b1691909117905561010082015160068501556101209091015160078401556001939093019291909101906020016104e1565b634e487b7160e01b8d52602160045260248dfd5b634e487b7160e01b8b52602160045260248bfd5b6001600160fd1b0381168103610786576001600160fd1b038316830361078657601b8752602087209060031b8101908360031b015b81811061075057506104b4565b80886008925588600182015588600282015588600382015588600482015588600582015588600682015588600782015501610743565b634e487b7160e01b87526011600452602487fd5b634e487b7160e01b86526041600452602486fd5b9550505050503d8082843e6107c38184610beb565b82019160a0818403126108a0576107d981610ca8565b6107e560208301610ca8565b6107f160408401610ca8565b60608401519092906001600160401b0381116108985786610813918601610cb5565b608085015190946001600160401b03821161089c57019580601f8801121561089857865161084081610c91565b9761084e604051998a610beb565b8189526020808a019260051b82010192831161089457602001905b82821061087c5750505090919238610491565b6020809161088984610c7d565b815201910190610869565b8780fd5b8580fd5b8680fd5b5080fd5b50604051903d90823e3d90fd5b929194509294508351805182526020810151600681101561095f5760208301526040810151600381101561095f5782610120602093610140936040600197015260608101516060840152858060a01b036080820151166080840152858060a01b0360a08201511660a0840152858060a01b0360c08201511660c084015260e0810151151560e0840152610100810151610100840152015161012082015201940192019185949287949261046b565b634e487b7160e01b88526021600452602488fd5b634e487b7160e01b600052601160045260246000fd5b63ec442f0560e01b600052600060045260246000fd5b81516001600160a01b0316818401556020909101906001016102f8565b60166000526109fb906000805160206144bf833981519152017fd833147d7dc355ba459fc788f669e58cfaf9dc25ddcd0702e87d69c7b512428d610dd1565b386102e9565b634e487b7160e01b600052604160045260246000fd5b631e4fbdf760e01b600052600060045260246000fd5b01519050388061018f565b600460009081528281209350601f198516905b818110610a885750908460019594939210610a6f575b505050811b016004556101a5565b015160001960f88460031b161c19169055388080610a61565b92936020600181928786015181550195019301610a4b565b6004600052610aea907f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f850160051c81019160208610610af0575b601f0160051c0190610dd1565b38610178565b9091508190610add565b634e487b7160e01b600052602260045260246000fd5b91607f1691610164565b01519050388061012b565b600360009081528281209350601f198516905b818110610b755750908460019594939210610b5c575b505050811b01600355610141565b015160001960f88460031b161c19169055388080610b4e565b92936020600181928786015181550195019301610b38565b6003600052610bd6907fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b601f850160051c81019160208610610af057601f0160051c0190610dd1565b38610114565b91607f1691610100565b600080fd5b601f909101601f19168101906001600160401b03821190821017610a0157604052565b81601f82011215610be6578051906001600160401b038211610a015760405192610c42601f8401601f191660200185610beb565b82845260208383010111610be65760005b828110610c6857505060206000918301015290565b80602080928401015182828701015201610c53565b51906001600160a01b0382168203610be657565b6001600160401b038111610a015760051b60200190565b51908115158203610be657565b81601f82011215610be657805190610ccc82610c91565b92610cda6040519485610beb565b8284526020610140818601940283010191818311610be657602001925b828410610d05575050505090565b61014084830312610be6576040519061014082016001600160401b03811183821017610a01576040528451825260208501516006811015610be65760208301526040850151906003821015610be65782602092604061014095015260608701516060820152610d7660808801610c7d565b6080820152610d8760a08801610c7d565b60a0820152610d9860c08801610c7d565b60c0820152610da960e08801610ca8565b60e0820152610100870151610100820152610120870151610120820152815201930192610cf7565b818110610ddc575050565b60008155600101610dd1565b600654811015610e0757600660005260206000209060011b0190600090565b634e487b7160e01b600052603260045260246000fd5b6006549060005b828110610ed3575060408051919082016001600160401b03811183821017610a01576040526001600160a01b031681526000602082019081529168010000000000000000811015610a0157806001610e7f9201600655610de8565b929092610ebd57905182546001600160a01b0319166001600160a01b0391909116178255516001919091015560065460001981019081116109735790565b634e487b7160e01b600052600060045260246000fd5b610edc81610de8565b50546001600160a01b03838116911614610ef857600101610e24565b9150509056fe608080604052600436101561001d575b50361561001b57600080fd5b005b60003560e01c90816306fdde0314610dff57508063095ea7b314610dd95780631781d15914610d8857806318160ddd14610d6a57806323b872dd14610c7d5780632973ef2d14610b3e578063313ce56714610b22578063378dc3dc14610b04578063406cf22914610ae95780634ada218b14610ac35780634f30800d14610aa557806356cdad1d14610a875780635f75baf614610a6c578063695d69b314610a495780636a2072d41461098f578063709df63c1461089c57806370a0823114610862578063715018a6146108055780638453ef99146107cb5780638a8c523c146107605780638da5cb5b146107375780639045be58146102ba57806395d89b41146106305780639b165f4e146105db578063a9059cbb146105aa578063c5be2bc7146104e1578063cb78c16314610379578063dd62ed3e14610328578063e4f8d62e146102f9578063e6375d3e146102ba578063eb50c06114610278578063f2fde38b146101ee578063f56b4d05146101c15763fec4ff17146101a0573861000f565b346101bc5760003660031901126101bc57602060405160028152f35b600080fd5b346101bc5760003660031901126101bc5760206101dc611265565b6040516001600160a01b039091168152f35b346101bc5760203660031901126101bc57610207610f03565b61020f611c99565b6001600160a01b0316801561026257600580546001600160a01b0319811683179091556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b631e4fbdf760e01b600052600060045260246000fd5b346101bc5760203660031901126101bc57610291610f03565b610299611c99565b6001600160a01b03166000908152601760205260409020805460ff19169055005b346101bc5760203660031901126101bc576001600160a01b036102db610f03565b16600052600f602052602060ff604060002054166040519015158152f35b346101bc5760403660031901126101bc576020610320610317610f03565b602435906111b0565b604051908152f35b346101bc5760403660031901126101bc57610341610f03565b610349610f19565b6001600160a01b039182166000908152600160209081526040808320949093168252928352819020549051908152f35b346101bc5760003660031901126101bc57600a54604051631c9a151b60e21b815260206004820152601b805460248301819052600091825291926001600160a01b0316918391604483019160008051602061356b833981519152915b81811061044357505050918180846020955003915afa801561043757600090610404575b602090604051908152f35b506020813d60201161042f575b8161041e60209383610fc5565b810103126101bc57602090516103f9565b3d9150610411565b6040513d6000823e3d90fd5b919350916008610140600192865481526104798488015461046a6020840160ff8316610f2f565b60ff6040840191861c16610f52565b60028701546060820152600387015460a085811b86900391821660808401526004890154821681840152600589015491821660c08401521c60ff16151560e08201526006870154610100820152600787015461012082015288969101949101929091016103d5565b346101bc5760203660031901126101bc57600435601b548110156101bc5761050b61014091610f5f565b50805460018201546002830154600384015460048501546005860154600687015460079097015460405196875295969460ff9491936001600160a01b03938416931691906105719061056260208b01888316610f2f565b8660408b019160081c16610f52565b6060880152608087015260a0808701919091526001600160a01b03821660c08701521c16151560e0840152610100830152610120820152f35b346101bc5760403660031901126101bc576105d06105c6610f03565b60243590336112d1565b602060405160018152f35b346101bc5760203660031901126101bc576105f4610f03565b6105fc611c99565b6106058161239d565b1561060c57005b6001600160a01b03166000908152601760205260409020805460ff19166001179055005b346101bc5760003660031901126101bc5760405160006004548060011c9060018116801561072d575b602083108114610719578285529081156106f55750600114610696575b6106928361068681850382610fc5565b60405191829182610eba565b0390f35b600460009081527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b939250905b8082106106db57509091508101602001610686610676565b9192600181602092548385880101520191019092916106c3565b60ff191660208086019190915291151560051b840190910191506106869050610676565b634e487b7160e01b84526022600452602484fd5b91607f1691610659565b346101bc5760003660031901126101bc576005546040516001600160a01b039091168152602090f35b346101bc5760003660031901126101bc57610779611c99565b60115460ff8160081c166107ba5761ff001916610100176011557f799663458a5ef2936f7fa0c99b3336c69c25890f82974f04e811e5bb359186c7600080a1005b637952fbad60e11b60005260046000fd5b346101bc5760003660031901126101bc576107e4611c99565b600160ff1960115416176011556107f9611db9565b6011805460ff19169055005b346101bc5760003660031901126101bc5761081e611c99565b600580546001600160a01b031981169091556000906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346101bc5760203660031901126101bc576001600160a01b03610883610f03565b1660005260006020526020604060002054604051908152f35b346101bc5760003660031901126101bc576006546108b981610fe6565b906108c76040519283610fc5565b808252600660009081526020830191907ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f835b83831061095b5784866040519182916020830190602084525180915260408301919060005b81811061092d575050500390f35b825180516001600160a01b03168552602090810151818601528695506040909401939092019160010161091f565b6002602060019260405161096e81610f94565b848060a01b03865416815284860154838201528152019201920191906108fa565b346101bc5760203660031901126101bc576001600160a01b036109b0610f03565b16600052601060205260406000206040518060208354918281520190819360005260206000209060005b818110610a3357505050816109f0910382610fc5565b6040519182916020830190602084525180915260408301919060005b818110610a1a575050500390f35b8251845285945060209384019390920191600101610a0c565b82548452602090930192600192830192016109da565b346101bc5760203660031901126101bc576020610320610a67610f03565b611115565b346101bc5760003660031901126101bc5760206103206110ae565b346101bc5760003660031901126101bc576020601954604051908152f35b346101bc5760003660031901126101bc576020600854604051908152f35b346101bc5760003660031901126101bc57602060ff60115460081c166040519015158152f35b346101bc5760003660031901126101bc576105d033336118b5565b346101bc5760003660031901126101bc576020601254604051908152f35b346101bc5760003660031901126101bc57602060405160128152f35b346101bc5760003660031901126101bc57601b54610b5b81610fe6565b90610b696040519283610fc5565b808252601b600090815260208301919060008051602061356b833981519152835b838310610c5f5784866040519182916020830190602084525180915260408301919060005b818110610bbd575050500390f35b919350916020610140600192610120875180518352610be28582015186850190610f2f565b610bf460408201516040850190610f52565b60608101516060840152858060a01b036080820151166080840152858060a01b0360a08201511660a0840152858060a01b0360c08201511660c084015260e0810151151560e08401526101008101516101008401520151610120820152019401910191849392610baf565b60086020600192610c6f85610ffd565b815201920192019190610b8a565b346101bc5760603660031901126101bc57610c96610f03565b610c9e610f19565b6001600160a01b0382166000818152600160209081526040808320338452909152902054909260443592916000198110610cde575b506105d093506112d1565b838110610d4d578415610d37573315610d21576105d0946000526001602052604060002060018060a01b0333166000526020528360406000209103905584610cd3565b634a1406b160e11b600052600060045260246000fd5b63e602df0560e01b600052600060045260246000fd5b8390637dc7a0d960e11b6000523360045260245260445260646000fd5b346101bc5760003660031901126101bc576020600254604051908152f35b346101bc5760403660031901126101bc57610da1610f03565b610da9610f19565b6001600160a01b039182166000908152600d60209081526040808320949093168252928352819020549051908152f35b346101bc5760403660031901126101bc576105d0610df5610f03565b60243590336123fc565b346101bc5760003660031901126101bc5760006003548060011c90600181168015610eb0575b602083108114610719578285529081156106f55750600114610e51576106928361068681850382610fc5565b600360009081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b939250905b808210610e9657509091508101602001610686610676565b919260018160209254838588010152019101909291610e7e565b91607f1691610e25565b91909160208152825180602083015260005b818110610eed575060409293506000838284010152601f8019910116010190565b8060208092870101516040828601015201610ecc565b600435906001600160a01b03821682036101bc57565b602435906001600160a01b03821682036101bc57565b906006821015610f3c5752565b634e487b7160e01b600052602160045260246000fd5b906003821015610f3c5752565b601b54811015610f7e57601b60005260206000209060031b0190600090565b634e487b7160e01b600052603260045260246000fd5b604081019081106001600160401b03821117610faf57604052565b634e487b7160e01b600052604160045260246000fd5b90601f801991011681019081106001600160401b03821117610faf57604052565b6001600160401b038111610faf5760051b60200190565b9060405161014081018181106001600160401b03821117610faf57604052809280548252600181015460ff8116906006821015610f3c5760ff91602085015260081c166003811015610f3c5760408301526002810154606083015260038101546001600160a01b0390811660808401526004820154811660a080850191909152600583015491821660c08501521c60ff16151560e08301526006810154610100830152600701546101209190910152565b60155460405163441062ed60e01b815290602090829060049082906001600160a01b03165afa908115610437576000916110e6575090565b90506020813d60201161110d575b8161110160209383610fc5565b810103126101bc575190565b3d91506110f4565b6001600160a01b0381166000908152600f602052604090205460ff166111415761113e90611c4b565b90565b50600090565b600654811015610f7e57600660005260206000209060011b0190600090565b8054821015610f7e5760005260206000200190600090565b6001600160a01b0391821681529116602082015260408101919091526060810191909152608081019190915260a00190565b6001600160a01b0381166000818152601060205260409020549192918210156112495760209161120560018060a01b03600a54169160016111f082611147565b50015493600052601085526040600020611166565b90549060031b1c91600754946112336040519687958694859463a89055e560e01b865230906004870161117e565b03915afa908115610437576000916110e6575090565b505050600090565b51906001600160a01b03821682036101bc57565b6015546040516327ab5d0f60e01b815290602090829060049082906001600160a01b03165afa9081156104375760009161129d575090565b90506020813d6020116112c9575b816112b860209383610fc5565b810103126101bc5761113e90611251565b3d91506112ab565b601a805460ff60281b19169055600a54604051639ca7068f60e01b81526001600160a01b03848116600483018190529596959260209183916024918391165afa90811561043757600091611896575b506118895760115460ff8160081c161580611866575b61185557601b5415908115611844575b8115611821575b8115611807575b81156117fc575b506117ae576113698361239d565b80611795575b611777575b5083601855600090600080925b601b548410156115425761139d61139785610f5f565b50610ffd565b90600080604084018051906003821015610f3c576000916113f25750505050816113e36113de6113e9936113d36001968d613227565b92909294838a61329a565b611d05565b93611d05565b93019290611381565b8051600381101561152e576001148061151e575b156114265750505050816113e36113de6113e9936113d36001968d613227565b9391929351600381101561150a576002149081611475575b50916113e9939160019593611459575b6113e3929350611d05565b6113e3925061146d91506113d3848d613227565b83925061144e565b90506114a760208860018060a01b03600a54168c60405180958194829363154b004960e31b84523091600485016125a9565b03915afa9182156114fe57916113e99593916001979593916114d0575b5091939550919361143e565b6114f1915060203d81116114f7575b6114e98183610fc5565b810190612385565b386114c4565b503d6114df565b604051903d90823e3d90fd5b634e487b7160e01b82526021600452602482fd5b506115298a896125cc565b611406565b634e487b7160e01b83526021600452602483fd5b61155993506115549192959683611738575b611ce2565b600a5460405163d8993e1360e01b815260206004820152601b80546024830181905260009182529195939493926001600160a01b0316918691604483019160008051602061356b833981519152915b8181106116a957505050918180846020955003915afa8015610437576116089460009161168a575b508061167b575b8061166e575b8061165e575b801561164f575b61160a575b6115f982826118b5565b6116038282612616565b6124fa565b565b61161482826125cc565b6115ef57600160ff19601154161760115561162d611db9565b6011805460ff19169055601a805460ff60281b1916600160281b1790556115ef565b5060ff601a5460081c166115ea565b5060ff601a5460281c16156115e3565b5060ff60115416156115dd565b5060ff601a5460201c166115d7565b6116a3915060203d6020116114f7576114e98183610fc5565b386115d0565b919350916008610140600192865481526116d08488015461046a6020840160ff8316610f2f565b60028701546060820152600387015460a085811b86900391821660808401526004890154821681840152600589015491821660c08401521c60ff16151560e0820152600687015461010082015260078701546101208201528b969101949101929091016115a8565b601a5460081c60ff1615611765576117518430896124fa565b61175d84601954611d05565b601955611ce2565b61155484611771611265565b896124fa565b600052600f6020526040600020600160ff1982541617905538611374565b5080600052600f60205260ff604060002054161561136f565b5090611608929391601a5460ff8160201c1615806117ed575b6117d7575b5061160382826118b5565b60ff60201b1916600160201b17601a55386117cc565b506117f78361239d565b6117c7565b60ff9150163861135b565b905081600052601760205260ff6040600020541690611354565b6001600160a01b03841660009081526017602052604090205460ff16915061134d565b601a5460201c60ff16159150611346565b63bcb8b8fb60e01b60005260046000fd5b506001600160a01b03831660009081526017602052604090205460ff1615611336565b5061160892939150612463565b6118af915060203d6020116114f7576114e98183610fc5565b38611320565b60ff601a5460181c166118c6575050565b6014546001600160a01b0390811693600093838316939281169290916060916040918587141591905b600654891015611c3f575b8760005260106020528860406000205411611939578760005260106020526119346040600020600161192b8c611147565b50015490612767565b6118fa565b9692939495965b8760005260106020528860406000205411611976578760005260106020526119716040600020600161192b8c611147565b611940565b96939495965b89600052601060205288604060002054116119b2578960005260106020526119ad6040600020600161192b8c611147565b61197c565b979694929695939587600052600f60205260ff60406000205416600014611c305760005b600084611c09575b6040516119eb8882610fc5565b600281528636602083013760405191611a048984610fc5565b600283528736602085013760009380611be8575b5080611bbf575b5060005b838110611a375750505050600101976118ef565b80611a4460019284611d1f565b51611a50575b01611a23565b611aa36020611a5e88611147565b505460a085901b85900390811690611a768589611d1f565b511690611a838588611d1f565b5191600060405180968195829463a9059cbb60e01b84526004840161278a565b03925af19081611ba3575b5015611a4a57611abd86611147565b5054600b5460a084901b849003908116911614611b85575b611b2682611ae288611147565b500154838060a01b03611af58488611d1f565b51166000526010602052611b0d886040600020611166565b90919082549060031b91821b91600019901b1916179055565b611b308184611d1f565b51828060a01b03611b418387611d1f565b5116600052600d602052611b7e604080600020611b5d8a611147565b505460a087901b879003166000908152602091909152208054909290611d05565b9055611a4a565b611b9b611b928285611d1f565b51600954611ce2565b600955611ad5565b611bba9060203d81116114f7576114e98183610fc5565b611aae565b928193611bcf82611be194611d1f565b528a611bdb8285611d1f565b52611d33565b9138611a1f565b909350611bf482611d12565b528a611bff83611d12565b5260019238611a18565b888152600f60205260ff6040822054166000036119de5750611c2b82886111b0565b6119de565b611c3a81836111b0565b6119d6565b98505050505050505050565b602060018060a01b03600a54166008549060018060a01b038416600052600e8352604060002054916007549461123360405196879586948594631d2fa43b60e11b865230906004870161117e565b6005546001600160a01b03163303611cad57565b63118cdaa760e01b6000523360045260246000fd5b8115611ccc570490565b634e487b7160e01b600052601260045260246000fd5b91908203918211611cef57565b634e487b7160e01b600052601160045260246000fd5b91908201809211611cef57565b805115610f7e5760200190565b8051821015610f7e5760209160051b010190565b6000198114611cef5760010190565b81810292918115918404141715611cef57565b60a091936020936080830195600180861b03168352600180851b03168483015260408201526080606082015284518094520192019060005b818110611d9a5750505090565b82516001600160a01b0316845260209384019390920191600101611d8d565b60008081601b5491611dca83610fe6565b92611dd86040519485610fc5565b808452601f19611de782610fe6565b01366020860137611df781610fe6565b90611e056040519283610fc5565b808252611e14601f1991610fe6565b01366020830137845b601b54811015611f8457611e3081610f5f565b509260068401548015611f2657611e4e611e4986610ffd565b6127a5565b8015611f5b575b8015611f44575b8015611f32575b15611f2657611e7190612807565b91908015611f0b578092611e8d611e888298610ffd565b6127de565b611edb575b5050611ebc8392611ec2926001611eaa81978c611d1f565b5281611eb68689611d1f565b52611d05565b95611d33565b936006611ece83610f5f565b5001555b01929192611e1d565b611ec2929650600194935090611f01611ebc92611efb83881c8094611ce2565b90611d05565b9692509293611e92565b50949350906001916006611f1e83610f5f565b500155611ed2565b50939250600190611ed2565b50611f3f611e8886610ffd565b611e63565b50611f56611f5186610ffd565b6127cb565b611e5c565b50611f6d611f6886610ffd565b6127b8565b8015611e55575060ff600586015460a01c16611e55565b509294915092611f9e60018060a01b03600b54163061287f565b90506001600160a01b0381161561237d57611fc6611fbd601954612807565b91908097611d05565b91821561237357602490611fe584611fe06007548b611d42565b611cc2565b92601955611ffe8460018060a01b0360135416306123fc565b601354600a546040516343d7ef9f60e11b8152306004820152936001600160a01b03928316939288928692918391165afa928315612368578693612344575b50813b1561234057918591858361206d9560405196879586948593637e18437960e01b8552309060048601611d55565b03925af1908161232c575b506120e25750505b601b548110156120cd578061209760019287611d1f565b516120a3575b01612080565b6120ad8185611d1f565b516120c660066120bc84610f5f565b5001918254611d05565b905561209d565b509250506120dd90601954611d05565b601955565b909294959391956024602060018060a01b03600b5416604051928380926370a0823160e01b82523060048301525afa9081156123215788916122ed575b506121629261214a61214161213a61215c9460095490611ce2565b9283611d42565b60075490611cc2565b90611554612156611265565b836129fe565b93611ce2565b9282156122e557855b601b548110156122dc5761217f8183611d1f565b511580156122ca575b6122c2576121a485611fe08661219e8588611d1f565b51611d42565b6121ad82610f5f565b506121ba611e4982610ffd565b156121db57600192916121cf6121d592610ffd565b90612fbe565b0161216b565b6121e7611f6882610ffd565b806122b1575b1561221257600301546001929161220d916001600160a01b0316906129fe565b6121d5565b61221e611f5182610ffd565b15612239576001929161223361220d92610ffd565b90612cb9565b612245611e8882610ffd565b612254575b50506001906121d5565b61226661226082610ffd565b83612b56565b8160011b918083046002149015171561229d579061229460076120bc61228e60019695610ffd565b51610f5f565b9055903861224a565b634e487b7160e01b89526011600452602489fd5b5060ff600582015460a01c166121ed565b6001906121d5565b506122d58184611d1f565b5115612188565b50505050509050565b505050509050565b90506020813d602011612319575b8161230860209383610fc5565b810103126101bc575161216261211f565b3d91506122fb565b6040513d8a823e3d90fd5b8461233991959295610fc5565b9238612078565b8580fd5b6123619193503d8088833e6123598183610fc5565b81019061297d565b913861203d565b6040513d88823e3d90fd5b5050505092505050565b505092505050565b908160209103126101bc575180151581036101bc5790565b600a54604051630d5c7b5d60e41b81526001600160a01b0392831660048201523060248201529160209183916044918391165afa908115610437576000916123e3575090565b61113e915060203d6020116114f7576114e98183610fc5565b6001600160a01b0316908115610d37576001600160a01b0316918215610d215760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b6001600160a01b031680156124e4576000918183528260205260408320548181106124cb57817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef926020928587528684520360408620558060025403600255604051908152a3565b6064939263391434e360e21b8452600452602452604452fd5b634b637e8f60e11b600052600060045260246000fd5b6001600160a01b03169081156124e4576001600160a01b03169182156125935760008281528060205260408120548281106125795791604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef958760209652828652038282205586815280845220818154019055604051908152a3565b916064928463391434e360e21b8452600452602452604452fd5b63ec442f0560e01b600052600060045260246000fd5b6001600160a01b0391821681529181166020830152909116604082015260600190565b600a54604051636468b51760e01b81529260209284926001600160a01b0316918391829161260091309190600485016125a9565b03915afa908115610437576000916123e3575090565b9060ff601a5460101c1615612763576014546001600160a01b038381169391811691908316600085820361270d575084600052600f60205260ff604060002054166000146126ff5760005b906000935b61266f81611c4b565b6008546000928352600e602052604080842082905598835288832081905592825296902055806126e1575b5050806126c3575b5050806126ac5750565b60145461160891906001600160a01b0316306124fa565b6126cc8261239d565b6126a2576126da91306124fa565b38806126a2565b6126ea8261239d565b61269a576126f891306124fa565b388061269a565b61270882611115565b612661565b858152600f602052604081205460ff1615612754575b9080600052600f60205260ff604060002054166000146127465760005b93612666565b61274f85611115565b612740565b5061275e82611115565b612723565b5050565b80549190600160401b831015610faf5782611b0d91600161160895018155611166565b6001600160a01b039091168152602081019190915260400190565b602001516006811015610f3c5760011490565b602001516006811015610f3c5760021490565b602001516006811015610f3c5760041490565b602001516006811015610f3c5760051490565b91908260409103126101bc576020825192015190565b90604060018060a01b03600a5416926044601854918351958693849263059b6d4760e21b8452600484015260248301525afa9182156104375760009060009361284f57509190565b905061287491925060403d604011612878575b61286c8183610fc5565b8101906127f1565b9091565b503d612862565b600a54604051632a8ddb2f60e01b81526001600160a01b039283166004820152928216602484015260606044840152601680546064850181905260009182529394939290911691849160848301917fd833147d7dc355ba459fc788f669e58cfaf9dc25ddcd0702e87d69c7b5124289915b81811061295b5750505091818060409403915afa9182156104375760009060009361291a57509190565b9250506040823d604011612953575b8161293660409383610fc5565b810103126101bc5761113e602061294c84611251565b9301611251565b3d9150612929565b82546001600160a01b03168452879450602090930192600192830192016128f0565b6020818303126101bc578051906001600160401b0382116101bc57019080601f830112156101bc5781516129b081610fe6565b926129be6040519485610fc5565b81845260208085019260051b8201019283116101bc57602001905b8282106129e65750505090565b602080916129f384611251565b8152019101906129d9565b906000908215612aec57600b546001600160a01b0316803b15612b5257828091602460405180948193632e1a7d4d60e01b83528960048401525af19081612b3e575b50612aa757600b5460405163a9059cbb60e01b81529360209285926001600160a01b031691839186918391612a7991906004840161278a565b03925af19081156114fe5750612a8c5750565b612aa49060203d6020116114f7576114e98183610fc5565b50565b8180808086855af13d15612b39573d6001600160401b038111612b255760405190612adc601f8201601f191660200183610fc5565b81528360203d92013e5b15612af1575b505050565b600b5460405163a9059cbb60e01b81529360209285926001600160a01b031691839186918391612a7991906004840161278a565b634e487b7160e01b84526041600452602484fd5b612ae6565b83612b4b91949294610fc5565b9138612a40565b8280fd5b906000918015612aec57610100820151908115612cb357600b54612b83906001600160a01b03163061287f565b6001600160a01b031690508015612cac57601354612bac9084906001600160a01b0316306123fc565b600b5460135460405163095ea7b360e01b81529160209183916001600160a01b039081169183918b918391612be7918b91166004840161278a565b03925af1801561236857612c8f575b50601354600b54600c546001600160a01b039182169492821692911690823b15612c8b5760c492889594928692604051988997889663863f15cd60e01b8852600488015230602488015260448701526064860152608485015260a48401525af19081612c77575b50612c66575050565b612c7260069151610f5f565b500155565b83612c8491949294610fc5565b9138612c5d565b8780fd5b612ca79060203d6020116114f7576114e98183610fc5565b612bf6565b5050505050565b50505050565b9060008215612aec5760a082018051600b549194916001600160a01b03908116911614612f5857600b5484516024926001600160a01b03928316929091612d0191168361287f565b87516040516370a0823160e01b81523060048201529591949250602091869182906001600160a01b03165afa938415612f14578594612f1f575b5060135460405163095ea7b360e01b815291602091839190829089908290612d719089906001600160a01b03166004840161278a565b03925af18015612f1457612ef7575b5060135486516001600160a01b039182169291612d9d91166134db565b92823b156123405791612dcd939186809460405196879586948593632d4d638360e11b8552309060048601611d55565b03925af19081612ee3575b50612de35750505050565b83516040516370a0823160e01b81523060048201529190602090839060249082906001600160a01b03165afa8015612ed8578390612ea4575b612e269250611ce2565b928315612cb35751612e73926007926120bc92612e6590612e4f906001600160a01b031661340f565b9160406002549130815280602052205490611ce2565b80612e7e575b505051610f5f565b905538808080612cb3565b60016120bc612e95612e9b93611fe089548c611d42565b93611147565b90553880612e6b565b506020823d602011612ed0575b81612ebe60209383610fc5565b810103126101bc57612e269151612e1c565b3d9150612eb1565b6040513d85823e3d90fd5b83612ef091949294610fc5565b9138612dd8565b612f0f9060203d6020116114f7576114e98183610fc5565b612d80565b6040513d87823e3d90fd5b9093506020813d602011612f50575b81612f3b60209383610fc5565b81010312612f4c5751926020612d3b565b8480fd5b3d9150612f2e565b915091612f80612f9691612f6e84600954611d05565b600955516001600160a01b031661340f565b9260406002549130815280602052205490611ce2565b9081612fa157505050565b6120bc612e95612fba93611fe060019460075490611d42565b9055565b60008115612aec5760a083018051600b549192916001600160a01b0390811691161461320e57600b5482516001600160a01b03918216939161300191168461287f565b8251600c546040516370a0823160e01b81526001600160a01b0391821660048201529692935060209187916024918391165afa9485156131c65790869185966131d1575b5060135460405163095ea7b360e01b8152926020928492909183918991839161307b91906001600160a01b03166004840161278a565b03925af180156131c6576131a9575b50601354600c5483516001600160a01b0392831692918216916130ad91166134db565b92823b15612340579187918680946130db60405197889687958694632d4d638360e11b865260048601611d55565b03925af19081613195575b50613106575050600c5461160893506001600160a01b03169190506129fe565b51600c546040516370a0823160e01b81526001600160a01b03918216600482015293945091929160209183916024918391165afa9182156114fe5791613161575b506120bc61315a612fba93600793611ce2565b9351610f5f565b90506020813d60201161318d575b8161317c60209383610fc5565b810103126101bc57516120bc613147565b3d915061316f565b836131a291949294610fc5565b91386130e6565b6131c19060203d6020116114f7576114e98183610fc5565b61308a565b6040513d86823e3d90fd5b915094506020813d602011613206575b816131ee60209383610fc5565b81010312613202575193859061307b613045565b8380fd5b3d91506131e1565b505061160891608060018060a01b0391015116906129fe565b600a546060909201516001600160a01b0392909216929160409160a49061324c6110ae565b9560ff601a541685519788958694632b8d28ef60e21b86526004860152602485015260448401521515606483015261271060848301525afa9182156104375760009060009361284f57509190565b602083018051906006821015610f3c576000916132c75750506120bc829361228e612fba94600794612463565b91909151600681101561152e5760030361333a57829361330a6007936132f5612fba966120bc9530906124fa565b60406002549130815280602052205490611ce2565b80613317575b5051610f5f565b61332961333191611fe0865489611d42565b600854611d05565b60085538613310565b90613344846127b8565b156133c3576080840180516001600160a01b031682526017602052604082205490919060ff161561339c575b5060e0840151156133875750906116089291613554565b5161160893506001600160a01b0316906124fa565b81516001600160a01b03168152601760205260409020805460ff1916600117905538613370565b5091906133cf826127a5565b156133dd5761160892613530565b6133e6826127cb565b156133f45761160892613530565b6133fd826127de565b61340657505050565b61160892613530565b6006549060005b8281106134b057506040519061342b82610f94565b6001600160a01b0316815260006020820190815291600160401b811015610faf5780600161345c9201600655611147565b92909261349a57905182546001600160a01b0319166001600160a01b039190911617825551600191909101556006546000198101908111611cef5790565b634e487b7160e01b600052600060045260246000fd5b6134b981611147565b50546001600160a01b038381169116146134d557600101613416565b91505090565b600a546040516377a9efe360e11b81526001600160a01b0392831660048201529160009183916024918391165afa9081156104375760009161351b575090565b61113e91503d806000833e6123598183610fc5565b906135489291600160ff196011541617601155613554565b60ff1960115416601155565b6120bc829361228e612fba9460069430906124fa56fe3ad8aa4f87544323a9d1e5dd902f40c356527a7955687113db5f9a85ad579dc1a26469706673582212208fbf314bcf8a8d82158838f99468067fc1d651e8cd2f5b2ca057c2b4d082554664736f6c634300081c0033d833147d7dc355ba459fc788f669e58cfaf9dc25ddcd0702e87d69c7b512428900000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000180000000000000000000000000f5ae65f5fc19e5404ed746581a6d7f4f73f3216a000000000000000000000000ec4c15765c88090d6fd5f11251700fff6be12b4c000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000007329702b34b8405591ac6bedb69ead82cf4b2661000000000000000000000000f5ae65f5fc19e5404ed746581a6d7f4f73f3216a000000000000000000000000e2f8eea237439b28bd66a62c3f42f27afe60ea94000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000174f6e636861696e2041737365742047656e657261746f7200000000000000000000000000000000000000000000000000000000000000000000000000000000034f41470000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000006f49eda57d10802f0102220a36eccda053a08d1c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003690000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015d38573d2feeb82e7ad5187ab8c1d52810b1f0700000000000000000000000000000000000000000000000000000000000003690000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000038a3d6c44cfc5fb66cce59185ef3399f1d750a4c000000000000000000000000000000000000000000000000000000000000036900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b17d901469b9208b17d916112988a3fed19b5ca1000000000000000000000000000000000000000000000000000000000000036900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee2d275dbb79c7871f8c6eb2a4d0687dd85409d10000000000000000000000000000000000000000000000000000000000000369000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f105121a10247de9a92e818554dd5fcd2063ae7000000000000000000000000000000000000000000000000000000000000036900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000685c7864e566b4b56a0bc50f8af0eab3488d44bc000000000000000000000000000000000000000000000000000000000000036900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042b48a98b37042d58bc8defeeb7ca4ec76e61060000000000000000000000000000000000000000000000000000000000000369000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Deployed ByteCode
0x608080604052600436101561001d575b50361561001b57600080fd5b005b60003560e01c90816306fdde0314610dff57508063095ea7b314610dd95780631781d15914610d8857806318160ddd14610d6a57806323b872dd14610c7d5780632973ef2d14610b3e578063313ce56714610b22578063378dc3dc14610b04578063406cf22914610ae95780634ada218b14610ac35780634f30800d14610aa557806356cdad1d14610a875780635f75baf614610a6c578063695d69b314610a495780636a2072d41461098f578063709df63c1461089c57806370a0823114610862578063715018a6146108055780638453ef99146107cb5780638a8c523c146107605780638da5cb5b146107375780639045be58146102ba57806395d89b41146106305780639b165f4e146105db578063a9059cbb146105aa578063c5be2bc7146104e1578063cb78c16314610379578063dd62ed3e14610328578063e4f8d62e146102f9578063e6375d3e146102ba578063eb50c06114610278578063f2fde38b146101ee578063f56b4d05146101c15763fec4ff17146101a0573861000f565b346101bc5760003660031901126101bc57602060405160028152f35b600080fd5b346101bc5760003660031901126101bc5760206101dc611265565b6040516001600160a01b039091168152f35b346101bc5760203660031901126101bc57610207610f03565b61020f611c99565b6001600160a01b0316801561026257600580546001600160a01b0319811683179091556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b631e4fbdf760e01b600052600060045260246000fd5b346101bc5760203660031901126101bc57610291610f03565b610299611c99565b6001600160a01b03166000908152601760205260409020805460ff19169055005b346101bc5760203660031901126101bc576001600160a01b036102db610f03565b16600052600f602052602060ff604060002054166040519015158152f35b346101bc5760403660031901126101bc576020610320610317610f03565b602435906111b0565b604051908152f35b346101bc5760403660031901126101bc57610341610f03565b610349610f19565b6001600160a01b039182166000908152600160209081526040808320949093168252928352819020549051908152f35b346101bc5760003660031901126101bc57600a54604051631c9a151b60e21b815260206004820152601b805460248301819052600091825291926001600160a01b0316918391604483019160008051602061356b833981519152915b81811061044357505050918180846020955003915afa801561043757600090610404575b602090604051908152f35b506020813d60201161042f575b8161041e60209383610fc5565b810103126101bc57602090516103f9565b3d9150610411565b6040513d6000823e3d90fd5b919350916008610140600192865481526104798488015461046a6020840160ff8316610f2f565b60ff6040840191861c16610f52565b60028701546060820152600387015460a085811b86900391821660808401526004890154821681840152600589015491821660c08401521c60ff16151560e08201526006870154610100820152600787015461012082015288969101949101929091016103d5565b346101bc5760203660031901126101bc57600435601b548110156101bc5761050b61014091610f5f565b50805460018201546002830154600384015460048501546005860154600687015460079097015460405196875295969460ff9491936001600160a01b03938416931691906105719061056260208b01888316610f2f565b8660408b019160081c16610f52565b6060880152608087015260a0808701919091526001600160a01b03821660c08701521c16151560e0840152610100830152610120820152f35b346101bc5760403660031901126101bc576105d06105c6610f03565b60243590336112d1565b602060405160018152f35b346101bc5760203660031901126101bc576105f4610f03565b6105fc611c99565b6106058161239d565b1561060c57005b6001600160a01b03166000908152601760205260409020805460ff19166001179055005b346101bc5760003660031901126101bc5760405160006004548060011c9060018116801561072d575b602083108114610719578285529081156106f55750600114610696575b6106928361068681850382610fc5565b60405191829182610eba565b0390f35b600460009081527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b939250905b8082106106db57509091508101602001610686610676565b9192600181602092548385880101520191019092916106c3565b60ff191660208086019190915291151560051b840190910191506106869050610676565b634e487b7160e01b84526022600452602484fd5b91607f1691610659565b346101bc5760003660031901126101bc576005546040516001600160a01b039091168152602090f35b346101bc5760003660031901126101bc57610779611c99565b60115460ff8160081c166107ba5761ff001916610100176011557f799663458a5ef2936f7fa0c99b3336c69c25890f82974f04e811e5bb359186c7600080a1005b637952fbad60e11b60005260046000fd5b346101bc5760003660031901126101bc576107e4611c99565b600160ff1960115416176011556107f9611db9565b6011805460ff19169055005b346101bc5760003660031901126101bc5761081e611c99565b600580546001600160a01b031981169091556000906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346101bc5760203660031901126101bc576001600160a01b03610883610f03565b1660005260006020526020604060002054604051908152f35b346101bc5760003660031901126101bc576006546108b981610fe6565b906108c76040519283610fc5565b808252600660009081526020830191907ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f835b83831061095b5784866040519182916020830190602084525180915260408301919060005b81811061092d575050500390f35b825180516001600160a01b03168552602090810151818601528695506040909401939092019160010161091f565b6002602060019260405161096e81610f94565b848060a01b03865416815284860154838201528152019201920191906108fa565b346101bc5760203660031901126101bc576001600160a01b036109b0610f03565b16600052601060205260406000206040518060208354918281520190819360005260206000209060005b818110610a3357505050816109f0910382610fc5565b6040519182916020830190602084525180915260408301919060005b818110610a1a575050500390f35b8251845285945060209384019390920191600101610a0c565b82548452602090930192600192830192016109da565b346101bc5760203660031901126101bc576020610320610a67610f03565b611115565b346101bc5760003660031901126101bc5760206103206110ae565b346101bc5760003660031901126101bc576020601954604051908152f35b346101bc5760003660031901126101bc576020600854604051908152f35b346101bc5760003660031901126101bc57602060ff60115460081c166040519015158152f35b346101bc5760003660031901126101bc576105d033336118b5565b346101bc5760003660031901126101bc576020601254604051908152f35b346101bc5760003660031901126101bc57602060405160128152f35b346101bc5760003660031901126101bc57601b54610b5b81610fe6565b90610b696040519283610fc5565b808252601b600090815260208301919060008051602061356b833981519152835b838310610c5f5784866040519182916020830190602084525180915260408301919060005b818110610bbd575050500390f35b919350916020610140600192610120875180518352610be28582015186850190610f2f565b610bf460408201516040850190610f52565b60608101516060840152858060a01b036080820151166080840152858060a01b0360a08201511660a0840152858060a01b0360c08201511660c084015260e0810151151560e08401526101008101516101008401520151610120820152019401910191849392610baf565b60086020600192610c6f85610ffd565b815201920192019190610b8a565b346101bc5760603660031901126101bc57610c96610f03565b610c9e610f19565b6001600160a01b0382166000818152600160209081526040808320338452909152902054909260443592916000198110610cde575b506105d093506112d1565b838110610d4d578415610d37573315610d21576105d0946000526001602052604060002060018060a01b0333166000526020528360406000209103905584610cd3565b634a1406b160e11b600052600060045260246000fd5b63e602df0560e01b600052600060045260246000fd5b8390637dc7a0d960e11b6000523360045260245260445260646000fd5b346101bc5760003660031901126101bc576020600254604051908152f35b346101bc5760403660031901126101bc57610da1610f03565b610da9610f19565b6001600160a01b039182166000908152600d60209081526040808320949093168252928352819020549051908152f35b346101bc5760403660031901126101bc576105d0610df5610f03565b60243590336123fc565b346101bc5760003660031901126101bc5760006003548060011c90600181168015610eb0575b602083108114610719578285529081156106f55750600114610e51576106928361068681850382610fc5565b600360009081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b939250905b808210610e9657509091508101602001610686610676565b919260018160209254838588010152019101909291610e7e565b91607f1691610e25565b91909160208152825180602083015260005b818110610eed575060409293506000838284010152601f8019910116010190565b8060208092870101516040828601015201610ecc565b600435906001600160a01b03821682036101bc57565b602435906001600160a01b03821682036101bc57565b906006821015610f3c5752565b634e487b7160e01b600052602160045260246000fd5b906003821015610f3c5752565b601b54811015610f7e57601b60005260206000209060031b0190600090565b634e487b7160e01b600052603260045260246000fd5b604081019081106001600160401b03821117610faf57604052565b634e487b7160e01b600052604160045260246000fd5b90601f801991011681019081106001600160401b03821117610faf57604052565b6001600160401b038111610faf5760051b60200190565b9060405161014081018181106001600160401b03821117610faf57604052809280548252600181015460ff8116906006821015610f3c5760ff91602085015260081c166003811015610f3c5760408301526002810154606083015260038101546001600160a01b0390811660808401526004820154811660a080850191909152600583015491821660c08501521c60ff16151560e08301526006810154610100830152600701546101209190910152565b60155460405163441062ed60e01b815290602090829060049082906001600160a01b03165afa908115610437576000916110e6575090565b90506020813d60201161110d575b8161110160209383610fc5565b810103126101bc575190565b3d91506110f4565b6001600160a01b0381166000908152600f602052604090205460ff166111415761113e90611c4b565b90565b50600090565b600654811015610f7e57600660005260206000209060011b0190600090565b8054821015610f7e5760005260206000200190600090565b6001600160a01b0391821681529116602082015260408101919091526060810191909152608081019190915260a00190565b6001600160a01b0381166000818152601060205260409020549192918210156112495760209161120560018060a01b03600a54169160016111f082611147565b50015493600052601085526040600020611166565b90549060031b1c91600754946112336040519687958694859463a89055e560e01b865230906004870161117e565b03915afa908115610437576000916110e6575090565b505050600090565b51906001600160a01b03821682036101bc57565b6015546040516327ab5d0f60e01b815290602090829060049082906001600160a01b03165afa9081156104375760009161129d575090565b90506020813d6020116112c9575b816112b860209383610fc5565b810103126101bc5761113e90611251565b3d91506112ab565b601a805460ff60281b19169055600a54604051639ca7068f60e01b81526001600160a01b03848116600483018190529596959260209183916024918391165afa90811561043757600091611896575b506118895760115460ff8160081c161580611866575b61185557601b5415908115611844575b8115611821575b8115611807575b81156117fc575b506117ae576113698361239d565b80611795575b611777575b5083601855600090600080925b601b548410156115425761139d61139785610f5f565b50610ffd565b90600080604084018051906003821015610f3c576000916113f25750505050816113e36113de6113e9936113d36001968d613227565b92909294838a61329a565b611d05565b93611d05565b93019290611381565b8051600381101561152e576001148061151e575b156114265750505050816113e36113de6113e9936113d36001968d613227565b9391929351600381101561150a576002149081611475575b50916113e9939160019593611459575b6113e3929350611d05565b6113e3925061146d91506113d3848d613227565b83925061144e565b90506114a760208860018060a01b03600a54168c60405180958194829363154b004960e31b84523091600485016125a9565b03915afa9182156114fe57916113e99593916001979593916114d0575b5091939550919361143e565b6114f1915060203d81116114f7575b6114e98183610fc5565b810190612385565b386114c4565b503d6114df565b604051903d90823e3d90fd5b634e487b7160e01b82526021600452602482fd5b506115298a896125cc565b611406565b634e487b7160e01b83526021600452602483fd5b61155993506115549192959683611738575b611ce2565b600a5460405163d8993e1360e01b815260206004820152601b80546024830181905260009182529195939493926001600160a01b0316918691604483019160008051602061356b833981519152915b8181106116a957505050918180846020955003915afa8015610437576116089460009161168a575b508061167b575b8061166e575b8061165e575b801561164f575b61160a575b6115f982826118b5565b6116038282612616565b6124fa565b565b61161482826125cc565b6115ef57600160ff19601154161760115561162d611db9565b6011805460ff19169055601a805460ff60281b1916600160281b1790556115ef565b5060ff601a5460081c166115ea565b5060ff601a5460281c16156115e3565b5060ff60115416156115dd565b5060ff601a5460201c166115d7565b6116a3915060203d6020116114f7576114e98183610fc5565b386115d0565b919350916008610140600192865481526116d08488015461046a6020840160ff8316610f2f565b60028701546060820152600387015460a085811b86900391821660808401526004890154821681840152600589015491821660c08401521c60ff16151560e0820152600687015461010082015260078701546101208201528b969101949101929091016115a8565b601a5460081c60ff1615611765576117518430896124fa565b61175d84601954611d05565b601955611ce2565b61155484611771611265565b896124fa565b600052600f6020526040600020600160ff1982541617905538611374565b5080600052600f60205260ff604060002054161561136f565b5090611608929391601a5460ff8160201c1615806117ed575b6117d7575b5061160382826118b5565b60ff60201b1916600160201b17601a55386117cc565b506117f78361239d565b6117c7565b60ff9150163861135b565b905081600052601760205260ff6040600020541690611354565b6001600160a01b03841660009081526017602052604090205460ff16915061134d565b601a5460201c60ff16159150611346565b63bcb8b8fb60e01b60005260046000fd5b506001600160a01b03831660009081526017602052604090205460ff1615611336565b5061160892939150612463565b6118af915060203d6020116114f7576114e98183610fc5565b38611320565b60ff601a5460181c166118c6575050565b6014546001600160a01b0390811693600093838316939281169290916060916040918587141591905b600654891015611c3f575b8760005260106020528860406000205411611939578760005260106020526119346040600020600161192b8c611147565b50015490612767565b6118fa565b9692939495965b8760005260106020528860406000205411611976578760005260106020526119716040600020600161192b8c611147565b611940565b96939495965b89600052601060205288604060002054116119b2578960005260106020526119ad6040600020600161192b8c611147565b61197c565b979694929695939587600052600f60205260ff60406000205416600014611c305760005b600084611c09575b6040516119eb8882610fc5565b600281528636602083013760405191611a048984610fc5565b600283528736602085013760009380611be8575b5080611bbf575b5060005b838110611a375750505050600101976118ef565b80611a4460019284611d1f565b51611a50575b01611a23565b611aa36020611a5e88611147565b505460a085901b85900390811690611a768589611d1f565b511690611a838588611d1f565b5191600060405180968195829463a9059cbb60e01b84526004840161278a565b03925af19081611ba3575b5015611a4a57611abd86611147565b5054600b5460a084901b849003908116911614611b85575b611b2682611ae288611147565b500154838060a01b03611af58488611d1f565b51166000526010602052611b0d886040600020611166565b90919082549060031b91821b91600019901b1916179055565b611b308184611d1f565b51828060a01b03611b418387611d1f565b5116600052600d602052611b7e604080600020611b5d8a611147565b505460a087901b879003166000908152602091909152208054909290611d05565b9055611a4a565b611b9b611b928285611d1f565b51600954611ce2565b600955611ad5565b611bba9060203d81116114f7576114e98183610fc5565b611aae565b928193611bcf82611be194611d1f565b528a611bdb8285611d1f565b52611d33565b9138611a1f565b909350611bf482611d12565b528a611bff83611d12565b5260019238611a18565b888152600f60205260ff6040822054166000036119de5750611c2b82886111b0565b6119de565b611c3a81836111b0565b6119d6565b98505050505050505050565b602060018060a01b03600a54166008549060018060a01b038416600052600e8352604060002054916007549461123360405196879586948594631d2fa43b60e11b865230906004870161117e565b6005546001600160a01b03163303611cad57565b63118cdaa760e01b6000523360045260246000fd5b8115611ccc570490565b634e487b7160e01b600052601260045260246000fd5b91908203918211611cef57565b634e487b7160e01b600052601160045260246000fd5b91908201809211611cef57565b805115610f7e5760200190565b8051821015610f7e5760209160051b010190565b6000198114611cef5760010190565b81810292918115918404141715611cef57565b60a091936020936080830195600180861b03168352600180851b03168483015260408201526080606082015284518094520192019060005b818110611d9a5750505090565b82516001600160a01b0316845260209384019390920191600101611d8d565b60008081601b5491611dca83610fe6565b92611dd86040519485610fc5565b808452601f19611de782610fe6565b01366020860137611df781610fe6565b90611e056040519283610fc5565b808252611e14601f1991610fe6565b01366020830137845b601b54811015611f8457611e3081610f5f565b509260068401548015611f2657611e4e611e4986610ffd565b6127a5565b8015611f5b575b8015611f44575b8015611f32575b15611f2657611e7190612807565b91908015611f0b578092611e8d611e888298610ffd565b6127de565b611edb575b5050611ebc8392611ec2926001611eaa81978c611d1f565b5281611eb68689611d1f565b52611d05565b95611d33565b936006611ece83610f5f565b5001555b01929192611e1d565b611ec2929650600194935090611f01611ebc92611efb83881c8094611ce2565b90611d05565b9692509293611e92565b50949350906001916006611f1e83610f5f565b500155611ed2565b50939250600190611ed2565b50611f3f611e8886610ffd565b611e63565b50611f56611f5186610ffd565b6127cb565b611e5c565b50611f6d611f6886610ffd565b6127b8565b8015611e55575060ff600586015460a01c16611e55565b509294915092611f9e60018060a01b03600b54163061287f565b90506001600160a01b0381161561237d57611fc6611fbd601954612807565b91908097611d05565b91821561237357602490611fe584611fe06007548b611d42565b611cc2565b92601955611ffe8460018060a01b0360135416306123fc565b601354600a546040516343d7ef9f60e11b8152306004820152936001600160a01b03928316939288928692918391165afa928315612368578693612344575b50813b1561234057918591858361206d9560405196879586948593637e18437960e01b8552309060048601611d55565b03925af1908161232c575b506120e25750505b601b548110156120cd578061209760019287611d1f565b516120a3575b01612080565b6120ad8185611d1f565b516120c660066120bc84610f5f565b5001918254611d05565b905561209d565b509250506120dd90601954611d05565b601955565b909294959391956024602060018060a01b03600b5416604051928380926370a0823160e01b82523060048301525afa9081156123215788916122ed575b506121629261214a61214161213a61215c9460095490611ce2565b9283611d42565b60075490611cc2565b90611554612156611265565b836129fe565b93611ce2565b9282156122e557855b601b548110156122dc5761217f8183611d1f565b511580156122ca575b6122c2576121a485611fe08661219e8588611d1f565b51611d42565b6121ad82610f5f565b506121ba611e4982610ffd565b156121db57600192916121cf6121d592610ffd565b90612fbe565b0161216b565b6121e7611f6882610ffd565b806122b1575b1561221257600301546001929161220d916001600160a01b0316906129fe565b6121d5565b61221e611f5182610ffd565b15612239576001929161223361220d92610ffd565b90612cb9565b612245611e8882610ffd565b612254575b50506001906121d5565b61226661226082610ffd565b83612b56565b8160011b918083046002149015171561229d579061229460076120bc61228e60019695610ffd565b51610f5f565b9055903861224a565b634e487b7160e01b89526011600452602489fd5b5060ff600582015460a01c166121ed565b6001906121d5565b506122d58184611d1f565b5115612188565b50505050509050565b505050509050565b90506020813d602011612319575b8161230860209383610fc5565b810103126101bc575161216261211f565b3d91506122fb565b6040513d8a823e3d90fd5b8461233991959295610fc5565b9238612078565b8580fd5b6123619193503d8088833e6123598183610fc5565b81019061297d565b913861203d565b6040513d88823e3d90fd5b5050505092505050565b505092505050565b908160209103126101bc575180151581036101bc5790565b600a54604051630d5c7b5d60e41b81526001600160a01b0392831660048201523060248201529160209183916044918391165afa908115610437576000916123e3575090565b61113e915060203d6020116114f7576114e98183610fc5565b6001600160a01b0316908115610d37576001600160a01b0316918215610d215760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b6001600160a01b031680156124e4576000918183528260205260408320548181106124cb57817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef926020928587528684520360408620558060025403600255604051908152a3565b6064939263391434e360e21b8452600452602452604452fd5b634b637e8f60e11b600052600060045260246000fd5b6001600160a01b03169081156124e4576001600160a01b03169182156125935760008281528060205260408120548281106125795791604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef958760209652828652038282205586815280845220818154019055604051908152a3565b916064928463391434e360e21b8452600452602452604452fd5b63ec442f0560e01b600052600060045260246000fd5b6001600160a01b0391821681529181166020830152909116604082015260600190565b600a54604051636468b51760e01b81529260209284926001600160a01b0316918391829161260091309190600485016125a9565b03915afa908115610437576000916123e3575090565b9060ff601a5460101c1615612763576014546001600160a01b038381169391811691908316600085820361270d575084600052600f60205260ff604060002054166000146126ff5760005b906000935b61266f81611c4b565b6008546000928352600e602052604080842082905598835288832081905592825296902055806126e1575b5050806126c3575b5050806126ac5750565b60145461160891906001600160a01b0316306124fa565b6126cc8261239d565b6126a2576126da91306124fa565b38806126a2565b6126ea8261239d565b61269a576126f891306124fa565b388061269a565b61270882611115565b612661565b858152600f602052604081205460ff1615612754575b9080600052600f60205260ff604060002054166000146127465760005b93612666565b61274f85611115565b612740565b5061275e82611115565b612723565b5050565b80549190600160401b831015610faf5782611b0d91600161160895018155611166565b6001600160a01b039091168152602081019190915260400190565b602001516006811015610f3c5760011490565b602001516006811015610f3c5760021490565b602001516006811015610f3c5760041490565b602001516006811015610f3c5760051490565b91908260409103126101bc576020825192015190565b90604060018060a01b03600a5416926044601854918351958693849263059b6d4760e21b8452600484015260248301525afa9182156104375760009060009361284f57509190565b905061287491925060403d604011612878575b61286c8183610fc5565b8101906127f1565b9091565b503d612862565b600a54604051632a8ddb2f60e01b81526001600160a01b039283166004820152928216602484015260606044840152601680546064850181905260009182529394939290911691849160848301917fd833147d7dc355ba459fc788f669e58cfaf9dc25ddcd0702e87d69c7b5124289915b81811061295b5750505091818060409403915afa9182156104375760009060009361291a57509190565b9250506040823d604011612953575b8161293660409383610fc5565b810103126101bc5761113e602061294c84611251565b9301611251565b3d9150612929565b82546001600160a01b03168452879450602090930192600192830192016128f0565b6020818303126101bc578051906001600160401b0382116101bc57019080601f830112156101bc5781516129b081610fe6565b926129be6040519485610fc5565b81845260208085019260051b8201019283116101bc57602001905b8282106129e65750505090565b602080916129f384611251565b8152019101906129d9565b906000908215612aec57600b546001600160a01b0316803b15612b5257828091602460405180948193632e1a7d4d60e01b83528960048401525af19081612b3e575b50612aa757600b5460405163a9059cbb60e01b81529360209285926001600160a01b031691839186918391612a7991906004840161278a565b03925af19081156114fe5750612a8c5750565b612aa49060203d6020116114f7576114e98183610fc5565b50565b8180808086855af13d15612b39573d6001600160401b038111612b255760405190612adc601f8201601f191660200183610fc5565b81528360203d92013e5b15612af1575b505050565b600b5460405163a9059cbb60e01b81529360209285926001600160a01b031691839186918391612a7991906004840161278a565b634e487b7160e01b84526041600452602484fd5b612ae6565b83612b4b91949294610fc5565b9138612a40565b8280fd5b906000918015612aec57610100820151908115612cb357600b54612b83906001600160a01b03163061287f565b6001600160a01b031690508015612cac57601354612bac9084906001600160a01b0316306123fc565b600b5460135460405163095ea7b360e01b81529160209183916001600160a01b039081169183918b918391612be7918b91166004840161278a565b03925af1801561236857612c8f575b50601354600b54600c546001600160a01b039182169492821692911690823b15612c8b5760c492889594928692604051988997889663863f15cd60e01b8852600488015230602488015260448701526064860152608485015260a48401525af19081612c77575b50612c66575050565b612c7260069151610f5f565b500155565b83612c8491949294610fc5565b9138612c5d565b8780fd5b612ca79060203d6020116114f7576114e98183610fc5565b612bf6565b5050505050565b50505050565b9060008215612aec5760a082018051600b549194916001600160a01b03908116911614612f5857600b5484516024926001600160a01b03928316929091612d0191168361287f565b87516040516370a0823160e01b81523060048201529591949250602091869182906001600160a01b03165afa938415612f14578594612f1f575b5060135460405163095ea7b360e01b815291602091839190829089908290612d719089906001600160a01b03166004840161278a565b03925af18015612f1457612ef7575b5060135486516001600160a01b039182169291612d9d91166134db565b92823b156123405791612dcd939186809460405196879586948593632d4d638360e11b8552309060048601611d55565b03925af19081612ee3575b50612de35750505050565b83516040516370a0823160e01b81523060048201529190602090839060249082906001600160a01b03165afa8015612ed8578390612ea4575b612e269250611ce2565b928315612cb35751612e73926007926120bc92612e6590612e4f906001600160a01b031661340f565b9160406002549130815280602052205490611ce2565b80612e7e575b505051610f5f565b905538808080612cb3565b60016120bc612e95612e9b93611fe089548c611d42565b93611147565b90553880612e6b565b506020823d602011612ed0575b81612ebe60209383610fc5565b810103126101bc57612e269151612e1c565b3d9150612eb1565b6040513d85823e3d90fd5b83612ef091949294610fc5565b9138612dd8565b612f0f9060203d6020116114f7576114e98183610fc5565b612d80565b6040513d87823e3d90fd5b9093506020813d602011612f50575b81612f3b60209383610fc5565b81010312612f4c5751926020612d3b565b8480fd5b3d9150612f2e565b915091612f80612f9691612f6e84600954611d05565b600955516001600160a01b031661340f565b9260406002549130815280602052205490611ce2565b9081612fa157505050565b6120bc612e95612fba93611fe060019460075490611d42565b9055565b60008115612aec5760a083018051600b549192916001600160a01b0390811691161461320e57600b5482516001600160a01b03918216939161300191168461287f565b8251600c546040516370a0823160e01b81526001600160a01b0391821660048201529692935060209187916024918391165afa9485156131c65790869185966131d1575b5060135460405163095ea7b360e01b8152926020928492909183918991839161307b91906001600160a01b03166004840161278a565b03925af180156131c6576131a9575b50601354600c5483516001600160a01b0392831692918216916130ad91166134db565b92823b15612340579187918680946130db60405197889687958694632d4d638360e11b865260048601611d55565b03925af19081613195575b50613106575050600c5461160893506001600160a01b03169190506129fe565b51600c546040516370a0823160e01b81526001600160a01b03918216600482015293945091929160209183916024918391165afa9182156114fe5791613161575b506120bc61315a612fba93600793611ce2565b9351610f5f565b90506020813d60201161318d575b8161317c60209383610fc5565b810103126101bc57516120bc613147565b3d915061316f565b836131a291949294610fc5565b91386130e6565b6131c19060203d6020116114f7576114e98183610fc5565b61308a565b6040513d86823e3d90fd5b915094506020813d602011613206575b816131ee60209383610fc5565b81010312613202575193859061307b613045565b8380fd5b3d91506131e1565b505061160891608060018060a01b0391015116906129fe565b600a546060909201516001600160a01b0392909216929160409160a49061324c6110ae565b9560ff601a541685519788958694632b8d28ef60e21b86526004860152602485015260448401521515606483015261271060848301525afa9182156104375760009060009361284f57509190565b602083018051906006821015610f3c576000916132c75750506120bc829361228e612fba94600794612463565b91909151600681101561152e5760030361333a57829361330a6007936132f5612fba966120bc9530906124fa565b60406002549130815280602052205490611ce2565b80613317575b5051610f5f565b61332961333191611fe0865489611d42565b600854611d05565b60085538613310565b90613344846127b8565b156133c3576080840180516001600160a01b031682526017602052604082205490919060ff161561339c575b5060e0840151156133875750906116089291613554565b5161160893506001600160a01b0316906124fa565b81516001600160a01b03168152601760205260409020805460ff1916600117905538613370565b5091906133cf826127a5565b156133dd5761160892613530565b6133e6826127cb565b156133f45761160892613530565b6133fd826127de565b61340657505050565b61160892613530565b6006549060005b8281106134b057506040519061342b82610f94565b6001600160a01b0316815260006020820190815291600160401b811015610faf5780600161345c9201600655611147565b92909261349a57905182546001600160a01b0319166001600160a01b039190911617825551600191909101556006546000198101908111611cef5790565b634e487b7160e01b600052600060045260246000fd5b6134b981611147565b50546001600160a01b038381169116146134d557600101613416565b91505090565b600a546040516377a9efe360e11b81526001600160a01b0392831660048201529160009183916024918391165afa9081156104375760009161351b575090565b61113e91503d806000833e6123598183610fc5565b906135489291600160ff196011541617601155613554565b60ff1960115416601155565b6120bc829361228e612fba9460069430906124fa56fe3ad8aa4f87544323a9d1e5dd902f40c356527a7955687113db5f9a85ad579dc1a26469706673582212208fbf314bcf8a8d82158838f99468067fc1d651e8cd2f5b2ca057c2b4d082554664736f6c634300081c0033