Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
XPERP
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 300 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.21; // xperp Token // ____ _____ ____ ____ // __ _| _ \| ____| _ \| _ \ // \ \/ / |_) | _| | |_) | |_) | // > <| __/| |___| _ <| __/ // /_/\_\_| |_____|_| \_\_| // Go long or short with leverage on @friendtech keys via Telegram // ===================================== // https://twitter.com/xperptech // https://xperp.tech // ===================================== // - Tokenomics: 35% in LP, 10% to Team, 5% to Collateral Partners, 49% for future airdrops // - Partnership: 1% has been sold to Handz of Gods. // - Supply: 1M tokens // - Tax: 3.5% tax on xperp traded (1.5% to revenue share, 2% to team and operating expenses). // - Revenue Sharing: 30% of trading revenue goes to holders. // - Eligibility: Holders of xperp tokens are entitled to revenue sharing. import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@oz-upgradeable/access/extensions/AccessControlEnumerableUpgradeable.sol"; import "@oz-upgradeable/utils/PausableUpgradeable.sol"; import "@oz-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@oz-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; import "@oz-upgradeable/token/ERC20/ERC20Upgradeable.sol"; contract XPERP is ERC20Upgradeable, PausableUpgradeable, AccessControlEnumerableUpgradeable, ReentrancyGuardUpgradeable, UUPSUpgradeable { // 1 Million is totalsuppy uint256 public constant oneMillion = 1_000_000 * 1 ether; // precision mitigation value, 100x100 uint256 public constant hundredPercent = 10_000; IUniswapV2Router02 public constant uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); // 1% of total supply, max tranfer amount possible uint256 public walletBalanceLimit; uint256 public sellLimit; // Taxation uint256 public totalTax; uint256 public teamWalletTax; bool public isTaxActive; // Claiming vs Airdropping bool public isAirDropActive; // address of the uniswap pair address public uniswapV2Pair; // team wallet address payable public teamWallet; /// @dev Enable trading on Uniswap bool public isTradingEnabled; // total swap tax collected, completely distributed among token holders, for analytical purposes only uint256 public swapTaxCollectedTotalXPERP; // revenue sharing tax collected for the distribution in the current snapshot (total tax less liquidity shares) uint256 public revShareAndTeamCurrentEpochXPERP; // revenue sharing tax collected, completely distributed among token holders, for analytical purposes only uint256 public tradingRevenueDistributedTotalETH; // Revenue sharing distribution info, 1 is the first epoch. struct EpochInfo { // Snapshot time uint256 epochTimestamp; // Snapshot supply uint256 epochCirculatingSupply; // ETH collected for rewards for re-investors uint256 epochRevenueFromSwapTaxCollectedXPERP; // Same in ETH uint256 epochSwapRevenueETH; // Injected 30% revenue from trading uint256 epochTradingRevenueETH; // Used to calculate holder balances at the time of snapshot mapping(address => uint256) depositedInEpoch; mapping(address => uint256) withdrawnInEpoch; } // Epochs array, each epoch contains the snapshot info, // 1 is the first epoch, // the current value (length-1) is the epoch currently in progress - not snapshotted yet // the previous value (length-2) is the last snapshotted epoch EpochInfo[] public epochs; // Claimed Epochs mapping(address => uint256) public lastClaimedEpochs; // ========== Events ========== event TradingOnUniSwapEnabled(); event TradingOnUniSwapDisabled(); event Snapshot(uint256 epoch, uint256 circulatingSupply, uint256 swapTaxCollected, uint256 tradingRevenueCollected); event SwappedToEth(uint256 amount, uint256 ethAmount); event SwappedToXperp(uint256 amount, uint256 ethAmount); event Claimed(address indexed user, uint256 amount); event ClaimedBot(address indexed user, uint256 amount); event ReceivedEther(address indexed from, uint256 amount); event TaxChanged(uint256 tax, uint256 teamWalletTax); event TaxActiveChanged(bool isActive); event WalletBalanceLimitChanged(uint256 walletBalanceLimit, uint256 sellLimit); event TeamWalletUpdated(address teamWallet); event AirDropToggled(bool isActive); event Taxed(address indexed from, uint256 amountXperp); // =========== Constants ======= /// @notice Admin role for upgrading, fees, and paused state bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); /// @notice Snapshot role for taking snapshots bytes32 public constant SNAPSHOT_ROLE = keccak256("SNAPSHOT_ROLE"); /// @notice Rescue role for rescuing tokens and Eth from the contract bytes32 public constant RESCUE_ROLE = keccak256("RESCUE_ROLE"); /// @notice WhiteList role for listing vesting and other addresses that should be excluded from circulaing supply to not lower the revenue share for participants bytes32 public constant EXCLUDED_FROM_CIRCULATION_ROLE = keccak256("EXCLUDED_FROM_CIRCULATION_ROLE"); /// @notice WhiteList role for untaxed transfer for funding, vesting, and airdrops bytes32 public constant EXCLUDED_FROM_TAXATION_ROLE = keccak256("EXCLUDED_FROM_TAXATION_ROLE"); // =========== Errors ========== error ZeroAddress(); // ========== Proxy ========== constructor() { _disableInitializers(); } function initialize(address payable _teamWallet) public initializer { if (_teamWallet == address(0)) revert ZeroAddress(); __ERC20_init("xperp", "xperp"); __AccessControlEnumerable_init(); __Pausable_init(); __UUPSUpgradeable_init(); __ReentrancyGuard_init(); teamWallet = _teamWallet; totalTax = 350; teamWalletTax = 150; isTaxActive = true; isTradingEnabled = false; walletBalanceLimit = 10_000 * 1 ether; sellLimit = 10_000 * 1 ether; isAirDropActive = false; // Grant admin role to owner _setRoleAdmin(DEFAULT_ADMIN_ROLE, DEFAULT_ADMIN_ROLE); _setRoleAdmin(ADMIN_ROLE, ADMIN_ROLE); _setRoleAdmin(EXCLUDED_FROM_CIRCULATION_ROLE, ADMIN_ROLE); _setRoleAdmin(EXCLUDED_FROM_TAXATION_ROLE, ADMIN_ROLE); _setRoleAdmin(SNAPSHOT_ROLE, SNAPSHOT_ROLE); _setRoleAdmin(RESCUE_ROLE, ADMIN_ROLE); _grantRole(ADMIN_ROLE, msg.sender); _grantRole(EXCLUDED_FROM_CIRCULATION_ROLE, msg.sender); _grantRole(EXCLUDED_FROM_TAXATION_ROLE, msg.sender); _grantRole(SNAPSHOT_ROLE, msg.sender); _grantRole(RESCUE_ROLE, msg.sender); _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); epochs.push(); epochs.push(); _mint(msg.sender, oneMillion); } function initPair() public onlyRole(ADMIN_ROLE) { uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair( address(this), uniswapV2Router.WETH() ); // approving uniswap router to spend xperp on behalf of the contract _approve(address(this), address(uniswapV2Router), type(uint256).max); } function pause() public onlyRole(ADMIN_ROLE) { _pause(); } function unpause() public onlyRole(ADMIN_ROLE) { _unpause(); } function _authorizeUpgrade(address newImplementation) internal override onlyRole(DEFAULT_ADMIN_ROLE) {} // ========== Configuration ========== /// @notice This function is used to set tax on transfers to and from the uniswap pair, xperp is swapped to ETH and prepared for snapshot distribution /// @param _tax The amount of totalTax to be applied on transfers to and from the U`niswap pair. /// @param _teamWalletTax The amount of tax sent to tresure, the rest (_tax - _teamWalletTax) is the holders' revenue share. function setTax(uint256 _tax, uint256 _teamWalletTax) external onlyRole(ADMIN_ROLE) { require(_tax <= 10000 && _teamWalletTax >= 0 && _teamWalletTax <= 10000, "Invalid tax"); totalTax = _tax; teamWalletTax = _teamWalletTax; emit TaxChanged(_tax, _teamWalletTax); } /// @notice This function is used to enable or disable tax on transfers to and from the uniswap pair /// @param _isTaxActive The new boolean value of isTaxActive function setTaxActive(bool _isTaxActive) external onlyRole(ADMIN_ROLE) { isTaxActive = _isTaxActive; emit TaxActiveChanged(_isTaxActive); } /// This function is used to set the wallet balance limit /// @param _walletBalanceLimit The new wallet balance limit, maximum allowed amount of tokens in a wallet, transfers are not prohibited function setWalletBalanceLimit(uint256 _walletBalanceLimit) external onlyRole(ADMIN_ROLE) { require(_walletBalanceLimit >= 0 && _walletBalanceLimit <= oneMillion, "Invalid wallet balance limit"); walletBalanceLimit = _walletBalanceLimit; emit WalletBalanceLimitChanged(_walletBalanceLimit, sellLimit); } /// This function is used to set the sell limit /// @param _sellLimit The new sell limit, maximum allowed amount of tokens to be sold in a single transaction function setSellLimit(uint256 _sellLimit) external onlyRole(ADMIN_ROLE) { require(_sellLimit >= 0 && _sellLimit <= oneMillion, "Invalid sell balance limit"); sellLimit = _sellLimit; emit WalletBalanceLimitChanged(walletBalanceLimit, _sellLimit); } /// @notice This function is used to set the team wallet /// @param _teamWallet The new team wallet getting the _teamWalletTax share from the swaps and trading revenue function updateTeamWallet(address payable _teamWallet) external onlyRole(ADMIN_ROLE) { require(_teamWallet != address(0), "Invalid team wallet"); teamWallet = _teamWallet; emit TeamWalletUpdated(_teamWallet); } /// @notice This function is used to enable trading on Uniswap function EnableTradingOnUniSwap() external onlyRole(ADMIN_ROLE) { isTradingEnabled = true; emit TradingOnUniSwapEnabled(); } /// @notice This function is used to disable trading on Uniswap function DisableTradingOnUniSwap() external onlyRole(ADMIN_ROLE) { isTradingEnabled = false; emit TradingOnUniSwapDisabled(); } /// @notice Toggles airdrop mode vs claim by holders function toggleAirDrop() external onlyRole(SNAPSHOT_ROLE) { isAirDropActive = !isAirDropActive; emit AirDropToggled(isAirDropActive); } // ========== ERC20 Overrides ========== /// @notice overriden ERC20 transfer to tax on transfers to and from the uniswap pair, xperp is swapped to ETH and prepared for snapshot distribution function _update(address from, address to, uint256 amount) internal override { bool isTradingTransfer = (from == uniswapV2Pair || to == uniswapV2Pair) && msg.sender != address(uniswapV2Router) && from != address(this) && to != address(this) && !hasRole(EXCLUDED_FROM_TAXATION_ROLE, from) && !hasRole(EXCLUDED_FROM_TAXATION_ROLE, to); require(isTradingEnabled || !isTradingTransfer, "Trading is not enabled yet"); // if trading is enabled, only allow transfers to and from the Uniswap pair uint256 amountAfterTax = amount; // calculate 5% swap tax // owner() is an exception to fund the liquidity pair and revenueDistributionBot as well to fund the revenue distribution to holders if (isTradingTransfer) { require(isTradingEnabled, "Trading is not enabled yet"); // Buying tokens if (from == uniswapV2Pair && walletBalanceLimit > 0) { require(balanceOf(to) + amount <= walletBalanceLimit, "Holding amount after buying exceeds maximum allowed tokens."); } // Selling tokens if (to == uniswapV2Pair && sellLimit > 0) { require(amount <= sellLimit, "Selling amount exceeds maximum allowed tokens."); } // 5% total tax on xperp traded (1% to LP, 2% to revenue share, 2% to team and operating expenses). if (isTaxActive) { uint256 taxAmountXPERP = (amount * totalTax) / hundredPercent; _transfer(from, address(this), taxAmountXPERP); emit Taxed(from, taxAmountXPERP); amountAfterTax -= taxAmountXPERP; swapTaxCollectedTotalXPERP += taxAmountXPERP; revShareAndTeamCurrentEpochXPERP += taxAmountXPERP; } } uint256 currentEpoch = epochs.length - 1; epochs[currentEpoch].depositedInEpoch[to] += amountAfterTax; epochs[currentEpoch].withdrawnInEpoch[from] += amount; super._update(from, to, amountAfterTax); } // ========== Revenue Sharing ========== /// @notice Function called by the revenue distribution bot to snapshot the state function snapshot() external payable onlyRole(SNAPSHOT_ROLE) nonReentrant { EpochInfo storage epoch = epochs[epochs.length - 1]; epoch.epochTimestamp = block.timestamp; uint256 _circulatingSupply = circulatingSupply(); uint256 xperpToSwap = revShareAndTeamCurrentEpochXPERP; require(xperpToSwap > 0 || msg.value > 0, "No tax collected yet and no ETH sent"); require(balanceOf(address(this)) >= xperpToSwap, "Balance less than required"); uint256 revAndTeamETH = xperpToSwap > 0 ? swapXPERPToETH(xperpToSwap) : 0; // 1.5% to team and operating expenses distributed immediately uint256 teamWalletTaxAmountETH = (revAndTeamETH * teamWalletTax) / totalTax; uint256 epochSwapRevenueETH = revAndTeamETH - teamWalletTaxAmountETH; teamWallet.transfer(teamWalletTaxAmountETH); // the rest in ETH is kept on the contract for revenue share distribution epoch.epochCirculatingSupply = _circulatingSupply; epoch.epochTradingRevenueETH = msg.value; epoch.epochRevenueFromSwapTaxCollectedXPERP = xperpToSwap; epoch.epochSwapRevenueETH = epochSwapRevenueETH; emit Snapshot(epochs.length, _circulatingSupply, epochSwapRevenueETH, msg.value); epochs.push(); revShareAndTeamCurrentEpochXPERP = 0; } /// @notice Function called by holders to claim their revenue share function claimAll() public nonReentrant { require(!isAirDropActive, "Claiming is switch to the xperp trading system currently"); uint256 holderShare = getClaimableOf(msg.sender); require(holderShare > 0, "Nothing to claim"); lastClaimedEpochs[msg.sender] = epochs.length - 2; require(address(this).balance >= holderShare, "Insufficient contract balance"); payable(msg.sender).transfer(holderShare); emit Claimed(msg.sender, holderShare); } /// @notice Function called by the xperp service to claim the revenue share instead of users /// @notice The xperp service does the following: /// @notice 1- Collects users in the table (tokentrasferevents) and determins all users. /// @notice Does steps 2-5 in batches of 1000 users /// @notice 2- Calls the getClaimableOfMulti for these users to get their claimable amount. /// @notice 3- Saves these amounts to the database (swaprewards) - wallet - amount /// @notice 4- Calls the claimBot function to claim the revenue share for these users with the total amount /// @notice 5- If successfull records the claim in the database (swaprewards) - wallet - amount - txhash of the claimbot call function claimBot(address payable operationalWallet, uint256 totalAmount, address[] memory _recipients) public onlyRole(SNAPSHOT_ROLE) nonReentrant { require(address(this).balance >= totalAmount, "Insufficient Ether"); for (uint256 i = 0; i < _recipients.length; i++) { lastClaimedEpochs[_recipients[i]] = epochs.length - 2; } operationalWallet.transfer(totalAmount); emit ClaimedBot(operationalWallet, totalAmount); } // ========== Internal Functions ========== function swapXPERPToETH(uint256 _amount) internal returns (uint256) { if (_amount == 0) return 0; address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); uint256 initialETHBalance = address(this).balance; uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( _amount, 0, path, address(this), block.timestamp ); uint256 finalETHBalance = address(this).balance; uint256 ETHReceived = finalETHBalance - initialETHBalance; emit SwappedToEth(_amount, ETHReceived); return ETHReceived; } // ========== Airdrop ========== /// @notice Mass send function, used for airdrops function airdrop( address[] memory _recipients, uint256[] memory _tokenAmounts, uint256[] memory _ethAmounts ) external payable onlyRole(SNAPSHOT_ROLE) { require(_recipients.length == _tokenAmounts.length && _recipients.length == _ethAmounts.length, "Invalid input lengths"); uint256 totalTokenAmount = 0; uint256 totalEthAmount = 0; for (uint256 i = 0; i < _tokenAmounts.length; i++) { totalTokenAmount += _tokenAmounts[i]; } for (uint256 j = 0; j < _ethAmounts.length; j++) { totalEthAmount += _ethAmounts[j]; } require(balanceOf(msg.sender) >= totalTokenAmount, "Insufficient token balance"); require(msg.value >= totalEthAmount, "Insufficient Ether sent"); for (uint256 i = 0; i < _recipients.length; i++) { if (_tokenAmounts[i] > 0) _transfer(msg.sender, _recipients[i], _tokenAmounts[i]); if (_ethAmounts[i] > 0) payable(_recipients[i]).transfer(_ethAmounts[i]); } } // ========== Rescue Functions ========== function rescueETH(uint256 _weiAmount) external onlyRole(RESCUE_ROLE) { payable(msg.sender).transfer(_weiAmount); } function rescueERC20(address _tokenAdd, uint256 _amount) external onlyRole(RESCUE_ROLE) { IERC20(_tokenAdd).transfer(msg.sender, _amount); } // ========== Fallbacks ========== receive() external payable { emit ReceivedEther(msg.sender, msg.value); } // ========== View functions ========== function getBalanceForEpochOf(address _user, uint256 _epoch) public view returns (uint256) { if (_epoch >= epochs.length) return 0; uint256 currentBalance = balanceOf(_user); if (epochs.length >= 1) { uint256 e = epochs.length - 1; while (true) { currentBalance += epochs[e].withdrawnInEpoch[_user]; currentBalance -= epochs[e].depositedInEpoch[_user]; if (e == _epoch + 1 || e == 0) { break; } e--; } } return currentBalance; } function getBalanceForEpoch(uint256 _epoch) public view returns (uint256) { return getBalanceForEpochOf(msg.sender, _epoch); } function getClaimableOf(address _user) public view returns (uint256) { require(epochs.length > 1, "No epochs yet"); if (hasRole(EXCLUDED_FROM_CIRCULATION_ROLE, _user)) return 0; uint256 holderShare = 0; for (uint256 i = lastClaimedEpochs[_user] + 1; i < epochs.length - 1; i++) holderShare += getClaimableForEpochOf(_user, i); return holderShare; } function getClaimableOfMulti(address[] memory _user) public view returns (uint256[] memory) { require(epochs.length > 1, "No epochs yet"); uint256[] memory holderShare = new uint256[](_user.length); for (uint256 i = 0; i < _user.length; i++) holderShare[i] = getClaimableOf(_user[i]); return holderShare; } function getClaimableForEpochOf(address _user, uint256 _epoch) public view returns (uint256) { if (epochs.length < 1 || epochs.length <= _epoch) return 0; EpochInfo storage epoch = epochs[_epoch]; if (_epoch <= lastClaimedEpochs[_user] || epoch.epochCirculatingSupply == 0) return 0; else return (getBalanceForEpochOf(_user, _epoch) * (epoch.epochSwapRevenueETH + epoch.epochTradingRevenueETH)) / epoch.epochCirculatingSupply; } function circulatingSupply() public view returns (uint256) { uint256 count = getRoleMemberCount(EXCLUDED_FROM_CIRCULATION_ROLE); uint256 excludedBalance = 0; for (uint256 i = 0; i < count; i++) { excludedBalance += balanceOf(getRoleMember(EXCLUDED_FROM_CIRCULATION_ROLE, i)); } excludedBalance += balanceOf(address(this)); excludedBalance += balanceOf(uniswapV2Pair); return totalSupply() - excludedBalance; } function getEpochsPassed() public view returns (uint256) { return epochs.length; } function getDepositedInEpoch(uint256 epochIndex, address userAddress) public view returns (uint256) { require(epochIndex < epochs.length, "Invalid epoch index"); return epochs[epochIndex].depositedInEpoch[userAddress]; } function getWithdrawnInEpoch(uint256 epochIndex, address userAddress) public view returns (uint256) { require(epochIndex < epochs.length, "Invalid epoch index"); return epochs[epochIndex].withdrawnInEpoch[userAddress]; } }
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; }
pragma solidity >=0.5.0; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; }
pragma solidity >=0.5.0; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol) pragma solidity ^0.8.20; import {IAccessControlEnumerable} from "@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol"; import {AccessControlUpgradeable} from "../AccessControlUpgradeable.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import {Initializable} from "../../proxy/utils/Initializable.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerable, AccessControlUpgradeable { using EnumerableSet for EnumerableSet.AddressSet; /// @custom:storage-location erc7201:openzeppelin.storage.AccessControlEnumerable struct AccessControlEnumerableStorage { mapping(bytes32 role => EnumerableSet.AddressSet) _roleMembers; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessControlEnumerable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant AccessControlEnumerableStorageLocation = 0xc1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000; function _getAccessControlEnumerableStorage() private pure returns (AccessControlEnumerableStorage storage $) { assembly { $.slot := AccessControlEnumerableStorageLocation } } function __AccessControlEnumerable_init() internal onlyInitializing { } function __AccessControlEnumerable_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) { AccessControlEnumerableStorage storage $ = _getAccessControlEnumerableStorage(); return $._roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) { AccessControlEnumerableStorage storage $ = _getAccessControlEnumerableStorage(); return $._roleMembers[role].length(); } /** * @dev Overload {AccessControl-_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override returns (bool) { AccessControlEnumerableStorage storage $ = _getAccessControlEnumerableStorage(); bool granted = super._grantRole(role, account); if (granted) { $._roleMembers[role].add(account); } return granted; } /** * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) { AccessControlEnumerableStorage storage $ = _getAccessControlEnumerableStorage(); bool revoked = super._revokeRole(role, account); if (revoked) { $._roleMembers[role].remove(account); } return revoked; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol) pragma solidity ^0.8.20; import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /// @custom:storage-location erc7201:openzeppelin.storage.Pausable struct PausableStorage { bool _paused; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Pausable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300; function _getPausableStorage() private pure returns (PausableStorage storage $) { assembly { $.slot := PausableStorageLocation } } /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); /** * @dev The operation failed because the contract is paused. */ error EnforcedPause(); /** * @dev The operation failed because the contract is not paused. */ error ExpectedPause(); /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { PausableStorage storage $ = _getPausableStorage(); $._paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { PausableStorage storage $ = _getPausableStorage(); return $._paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { if (paused()) { revert EnforcedPause(); } } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { if (!paused()) { revert ExpectedPause(); } } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { PausableStorage storage $ = _getPausableStorage(); $._paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { PausableStorage storage $ = _getPausableStorage(); $._paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.20; import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol"; import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol"; import {Initializable} from "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. */ abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable address private immutable __self = address(this); /** * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)` * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called, * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string. * If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function * during an upgrade. */ string public constant UPGRADE_INTERFACE_VERSION = "5.0.0"; /** * @dev The call is from an unauthorized context. */ error UUPSUnauthorizedCallContext(); /** * @dev The storage `slot` is unsupported as a UUID. */ error UUPSUnsupportedProxiableUUID(bytes32 slot); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { _checkProxy(); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { _checkNotDelegated(); _; } function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual notDelegated returns (bytes32) { return ERC1967Utils.IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data); } /** * @dev Reverts if the execution is not performed via delegatecall or the execution * context is not of a proxy with an ERC1967-compliant implementation pointing to self. * See {_onlyProxy}. */ function _checkProxy() internal view virtual { if ( address(this) == __self || // Must be called through delegatecall ERC1967Utils.getImplementation() != __self // Must be called through an active proxy ) { revert UUPSUnauthorizedCallContext(); } } /** * @dev Reverts if the execution is performed via delegatecall. * See {notDelegated}. */ function _checkNotDelegated() internal view virtual { if (address(this) != __self) { // Must not be called through delegatecall revert UUPSUnauthorizedCallContext(); } } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call. * * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value * is expected to be the implementation slot in ERC1967. * * Emits an {IERC1967-Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private { try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) { if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) { revert UUPSUnsupportedProxiableUUID(slot); } ERC1967Utils.upgradeToAndCall(newImplementation, data); } catch { // The implementation is not UUPS revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // 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; /// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard struct ReentrancyGuardStorage { uint256 _status; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00; function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) { assembly { $.slot := ReentrancyGuardStorageLocation } } /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); $._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 { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); // 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 { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); // 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) { ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage(); return $._status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.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 {ContextUpgradeable} from "../../utils/ContextUpgradeable.sol"; import {IERC20Errors} from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol"; import {Initializable} from "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. */ abstract contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20, IERC20Metadata, IERC20Errors { /// @custom:storage-location erc7201:openzeppelin.storage.ERC20 struct ERC20Storage { mapping(address account => uint256) _balances; mapping(address account => mapping(address spender => uint256)) _allowances; uint256 _totalSupply; string _name; string _symbol; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC20")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ERC20StorageLocation = 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00; function _getERC20Storage() private pure returns (ERC20Storage storage $) { assembly { $.slot := ERC20StorageLocation } } /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC20_init_unchained(name_, symbol_); } function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { ERC20Storage storage $ = _getERC20Storage(); $._name = name_; $._symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { ERC20Storage storage $ = _getERC20Storage(); return $._name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { ERC20Storage storage $ = _getERC20Storage(); 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) { ERC20Storage storage $ = _getERC20Storage(); return $._totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual returns (uint256) { ERC20Storage storage $ = _getERC20Storage(); 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) { ERC20Storage storage $ = _getERC20Storage(); return $._allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, value); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `value`. * - the caller must have allowance for ``from``'s tokens of at least * `value`. */ function transferFrom(address from, address to, uint256 value) public virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, value); _transfer(from, to, value); return true; } /** * @dev Moves a `value` amount of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _transfer(address from, address to, uint256 value) internal { if (from == address(0)) { revert ERC20InvalidSender(address(0)); } if (to == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(from, to, value); } /** * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding * this function. * * Emits a {Transfer} event. */ function _update(address from, address to, uint256 value) internal virtual { ERC20Storage storage $ = _getERC20Storage(); if (from == address(0)) { // Overflow check required: The rest of the code assumes that totalSupply never overflows $._totalSupply += value; } else { uint256 fromBalance = $._balances[from]; if (fromBalance < value) { revert ERC20InsufficientBalance(from, fromBalance, value); } unchecked { // Overflow not possible: value <= fromBalance <= totalSupply. $._balances[from] = fromBalance - value; } } if (to == address(0)) { unchecked { // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply. $._totalSupply -= value; } } else { unchecked { // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256. $._balances[to] += value; } } emit Transfer(from, to, value); } /** * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0). * Relies on the `_update` mechanism * * Emits a {Transfer} event with `from` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _mint(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(address(0), account, value); } /** * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply. * Relies on the `_update` mechanism. * * Emits a {Transfer} event with `to` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead */ function _burn(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidSender(address(0)); } _update(account, address(0), value); } /** * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address owner, address spender, uint256 value) internal { _approve(owner, spender, value, true); } /** * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event. * * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any * `Approval` event during `transferFrom` operations. * * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to * true using the following override: * ``` * function _approve(address owner, address spender, uint256 value, bool) internal virtual override { * super._approve(owner, spender, value, true); * } * ``` * * Requirements are the same as {_approve}. */ function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual { ERC20Storage storage $ = _getERC20Storage(); 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); } } } }
pragma solidity >=0.6.2; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol) pragma solidity ^0.8.20; import {IAccessControl} from "../IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol"; import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol"; import {ERC165Upgradeable} from "../utils/introspection/ERC165Upgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControl, ERC165Upgradeable { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /// @custom:storage-location erc7201:openzeppelin.storage.AccessControl struct AccessControlStorage { mapping(bytes32 role => RoleData) _roles; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessControl")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant AccessControlStorageLocation = 0x02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800; function _getAccessControlStorage() private pure returns (AccessControlStorage storage $) { assembly { $.slot := AccessControlStorageLocation } } /** * @dev Modifier that checks that an account has a specific role. Reverts * with an {AccessControlUnauthorizedAccount} error including the required role. */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual returns (bool) { AccessControlStorage storage $ = _getAccessControlStorage(); return $._roles[role].hasRole[account]; } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` * is missing `role`. */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert AccessControlUnauthorizedAccount(account, role); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { AccessControlStorage storage $ = _getAccessControlStorage(); return $._roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address callerConfirmation) public virtual { if (callerConfirmation != _msgSender()) { revert AccessControlBadConfirmation(); } _revokeRole(role, callerConfirmation); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { AccessControlStorage storage $ = _getAccessControlStorage(); bytes32 previousAdminRole = getRoleAdmin(role); $._roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual returns (bool) { AccessControlStorage storage $ = _getAccessControlStorage(); if (!hasRole(role, account)) { $._roles[role].hasRole[account] = true; emit RoleGranted(role, account, _msgSender()); return true; } else { return false; } } /** * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { AccessControlStorage storage $ = _getAccessControlStorage(); if (hasRole(role, account)) { $._roles[role].hasRole[account] = false; emit RoleRevoked(role, account, _msgSender()); return true; } else { return false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.20; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position is the index of the value in the `values` array plus 1. // Position 0 is used to mean a value is not in the set. mapping(bytes32 value => uint256) _positions; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._positions[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We cache the value's position to prevent multiple reads from the same storage slot uint256 position = set._positions[value]; if (position != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 valueIndex = position - 1; uint256 lastIndex = set._values.length - 1; if (valueIndex != lastIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the lastValue to the index where the value to delete is set._values[valueIndex] = lastValue; // Update the tracked position of the lastValue (that was just moved) set._positions[lastValue] = position; } // Delete the slot where the moved value was stored set._values.pop(); // Delete the tracked position for the deleted slot delete set._positions[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._positions[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.20; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822Proxiable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol) pragma solidity ^0.8.20; import {IBeacon} from "../beacon/IBeacon.sol"; import {Address} from "../../utils/Address.sol"; import {StorageSlot} from "../../utils/StorageSlot.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. */ library ERC1967Utils { // We re-declare ERC-1967 events here because they can't be used directly from IERC1967. // This will be fixed in Solidity 0.8.21. At that point we should remove these events. /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Emitted when the beacon is changed. */ event BeaconUpgraded(address indexed beacon); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev The `implementation` of the proxy is invalid. */ error ERC1967InvalidImplementation(address implementation); /** * @dev The `admin` of the proxy is invalid. */ error ERC1967InvalidAdmin(address admin); /** * @dev The `beacon` of the proxy is invalid. */ error ERC1967InvalidBeacon(address beacon); /** * @dev An upgrade function sees `msg.value > 0` that may be lost. */ error ERC1967NonPayable(); /** * @dev Returns the current implementation address. */ function getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { if (newImplementation.code.length == 0) { revert ERC1967InvalidImplementation(newImplementation); } StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Performs implementation upgrade with additional setup call if data is nonempty. * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected * to avoid stuck value in the contract. * * Emits an {IERC1967-Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); if (data.length > 0) { Address.functionDelegateCall(newImplementation, data); } else { _checkNonPayable(); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. * * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103` */ function getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { if (newAdmin == address(0)) { revert ERC1967InvalidAdmin(address(0)); } StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {IERC1967-AdminChanged} event. */ function changeAdmin(address newAdmin) internal { emit AdminChanged(getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Returns the current beacon. */ function getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { if (newBeacon.code.length == 0) { revert ERC1967InvalidBeacon(newBeacon); } StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon; address beaconImplementation = IBeacon(newBeacon).implementation(); if (beaconImplementation.code.length == 0) { revert ERC1967InvalidImplementation(beaconImplementation); } } /** * @dev Change the beacon and trigger a setup call if data is nonempty. * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected * to avoid stuck value in the contract. * * Emits an {IERC1967-BeaconUpgraded} event. * * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for * efficiency. */ function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } else { _checkNonPayable(); } } /** * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract * if an upgrade doesn't perform an initialization call. */ function _checkNonPayable() private { if (msg.value > 0) { revert ERC1967NonPayable(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol) pragma solidity ^0.8.20; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev The `account` is missing a role. */ error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); /** * @dev The caller of a function is not the expected one. * * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}. */ error AccessControlBadConfirmation(); /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. */ function renounceRole(bytes32 role, address callerConfirmation) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {Initializable} from "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165Upgradeable is Initializable, IERC165 { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.20; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {UpgradeableBeacon} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert FailedInnerCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.20; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(newImplementation.code.length > 0); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "remappings": [ "@openzeppelin/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/", "@prb/test/=lib/prb-test/src/", "forge-std/=lib/forge-std/src/", "@oz-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "@std/=lib/forge-std/src/", "@uniswap/v2-core/=lib/v2-core/", "@uniswap/v2-periphery/=lib/v2-periphery/", "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "openzeppelin/=lib/openzeppelin-contracts/contracts/", "prb-test/=lib/prb-test/src/", "v2-core/=lib/v2-core/contracts/", "v2-periphery/=lib/v2-periphery/contracts/" ], "optimizer": { "enabled": true, "runs": 300 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "none", "appendCBOR": false }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"AirDropToggled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimedBot","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ReceivedEther","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"circulatingSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"swapTaxCollected","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tradingRevenueCollected","type":"uint256"}],"name":"Snapshot","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"}],"name":"SwappedToEth","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"}],"name":"SwappedToXperp","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"TaxActiveChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tax","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"teamWalletTax","type":"uint256"}],"name":"TaxChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountXperp","type":"uint256"}],"name":"Taxed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"teamWallet","type":"address"}],"name":"TeamWalletUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"TradingOnUniSwapDisabled","type":"event"},{"anonymous":false,"inputs":[],"name":"TradingOnUniSwapEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"walletBalanceLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sellLimit","type":"uint256"}],"name":"WalletBalanceLimitChanged","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DisableTradingOnUniSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"EXCLUDED_FROM_CIRCULATION_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EXCLUDED_FROM_TAXATION_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EnableTradingOnUniSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"RESCUE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SNAPSHOT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_recipients","type":"address[]"},{"internalType":"uint256[]","name":"_tokenAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"_ethAmounts","type":"uint256[]"}],"name":"airdrop","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"circulatingSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"operationalWallet","type":"address"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"address[]","name":"_recipients","type":"address[]"}],"name":"claimBot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"epochs","outputs":[{"internalType":"uint256","name":"epochTimestamp","type":"uint256"},{"internalType":"uint256","name":"epochCirculatingSupply","type":"uint256"},{"internalType":"uint256","name":"epochRevenueFromSwapTaxCollectedXPERP","type":"uint256"},{"internalType":"uint256","name":"epochSwapRevenueETH","type":"uint256"},{"internalType":"uint256","name":"epochTradingRevenueETH","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"getBalanceForEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"getBalanceForEpochOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"getClaimableForEpochOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getClaimableOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_user","type":"address[]"}],"name":"getClaimableOfMulti","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epochIndex","type":"uint256"},{"internalType":"address","name":"userAddress","type":"address"}],"name":"getDepositedInEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getEpochsPassed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epochIndex","type":"uint256"},{"internalType":"address","name":"userAddress","type":"address"}],"name":"getWithdrawnInEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hundredPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_teamWallet","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isAirDropActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isTaxActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isTradingEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastClaimedEpochs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oneMillion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAdd","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"rescueERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_weiAmount","type":"uint256"}],"name":"rescueETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revShareAndTeamCurrentEpochXPERP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sellLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sellLimit","type":"uint256"}],"name":"setSellLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tax","type":"uint256"},{"internalType":"uint256","name":"_teamWalletTax","type":"uint256"}],"name":"setTax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isTaxActive","type":"bool"}],"name":"setTaxActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_walletBalanceLimit","type":"uint256"}],"name":"setWalletBalanceLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"snapshot","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapTaxCollectedTotalXPERP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"teamWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"teamWalletTax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleAirDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tradingRevenueDistributedTotalETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapV2Pair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapV2Router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_teamWallet","type":"address"}],"name":"updateTeamWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"walletBalanceLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a0604052306080523480156200001557600080fd5b506200002062000026565b620000da565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000775760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620000d75780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6080516146386200010460003960008181612bca01528181612bf30152612d5b01526146386000f3fe6080604052600436106104145760003560e01c806370a082311161021e578063a217fddf11610123578063ca15c873116100ab578063d9a553aa1161007a578063d9a553aa14610c75578063dd62ed3e14610c94578063e4ef93b814610cf9578063fe85b42b14610d19578063feb1dfcc14610d2f57600080fd5b8063ca15c87314610c00578063cdbafa1014610c20578063d1058e5914610c40578063d547741f14610c5557600080fd5b8063ad3cb1cc116100f2578063ad3cb1cc14610b18578063b131646014610b49578063b1a9f80914610b76578063c4d66de814610b98578063c6b61e4c14610bb857600080fd5b8063a217fddf14610aa3578063a9059cbb14610ab8578063a9bf2c0914610ad8578063aa65c54614610af857600080fd5b80638cd4426d116101a65780639358928b116101755780639358928b14610a3757806395d89b4114610a4c5780639711715a14610a6157806398a0dd0914610a695780639e252f0014610a8357600080fd5b80638cd4426d146109b75780639010d07c146109d757806390f5fd4b146109f757806391d1485414610a1757600080fd5b806382b2ed13116101ed57806382b2ed13146109415780638456cb5914610961578063853755fc146109765780638817f6f11461098b5780638a9cb361146109a157600080fd5b806370a08231146108ca57806375b238fc146108ea5780637cb332bb1461090c5780637ff976c71461092c57600080fd5b80633059f356116103245780634e2fe61f116102ac578063599270441161027b57806359927044146108235780635c975abb146108435780635e9177ae14610868578063667f6526146108885780637028e2cd146108a857600080fd5b80634e2fe61f146107c35780634f1ef286146107e55780634f91e48c146107f857806352d1902d1461080e57600080fd5b80633c88c0a3116102f35780633c88c0a3146107345780633f4ba83a14610754578063413e920d1461076957806349bd5a5e1461078757806349cb380f146107ad57600080fd5b80633059f356146106cc578063313ce567146106e257806336568abe146106fe57806337c279dc1461071e57600080fd5b80631c73bca4116103a7578063244519fa11610376578063244519fa14610600578063248a9ca3146106225780632bff8cd71461065f5780632f2ff15d1461068c5780632ffc1628146106ac57600080fd5b80631c73bca41461059557806321129fad146105aa578063233edfe7146105ca57806323b872dd146105e057600080fd5b8063095ea7b3116103e3578063095ea7b3146104e45780631694505e1461050457806318160ddd146105445780631bf2907b1461058257600080fd5b806301ffc9a71461045557806303c051c31461048a578063064a59d0146104a157806306fdde03146104c257600080fd5b366104505760405134815233907fa419615bc8fda4c87663805ee2a3597a6d71c1d476911d9892f340d965bc7bf19060200160405180910390a2005b600080fd5b34801561046157600080fd5b50610475610470366004613d30565b610d44565b60405190151581526020015b60405180910390f35b34801561049657600080fd5b5061049f610d6f565b005b3480156104ad57600080fd5b5060055461047590600160a01b900460ff1681565b3480156104ce57600080fd5b506104d7610dc0565b6040516104819190613d7e565b3480156104f057600080fd5b506104756104ff366004613dc6565b610e83565b34801561051057600080fd5b5061052c737a250d5630b4cf539739df2c5dacb4c659f2488d81565b6040516001600160a01b039091168152602001610481565b34801561055057600080fd5b507f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02545b604051908152602001610481565b61049f610590366004613f2c565b610e9b565b3480156105a157600080fd5b50600954610574565b3480156105b657600080fd5b5061049f6105c5366004613fb4565b611162565b3480156105d657600080fd5b5061057460075481565b3480156105ec57600080fd5b506104756105fb366004614003565b6112e1565b34801561060c57600080fd5b5061057460008051602061461883398151915281565b34801561062e57600080fd5b5061057461063d366004614044565b6000908152600080516020614598833981519152602052604090206001015490565b34801561066b57600080fd5b5061067f61067a36600461405d565b611307565b6040516104819190614092565b34801561069857600080fd5b5061049f6106a73660046140d6565b6113f8565b3480156106b857600080fd5b5061049f6106c7366004614114565b61142a565b3480156106d857600080fd5b5061057460035481565b3480156106ee57600080fd5b5060405160128152602001610481565b34801561070a57600080fd5b5061049f6107193660046140d6565b61148b565b34801561072a57600080fd5b5061057460065481565b34801561074057600080fd5b5061057461074f366004613dc6565b6114c3565b34801561076057600080fd5b5061049f6115c8565b34801561077557600080fd5b5061057469d3c21bcecceda100000081565b34801561079357600080fd5b5060045461052c906201000090046001600160a01b031681565b3480156107b957600080fd5b5061057460085481565b3480156107cf57600080fd5b5061057460008051602061453883398151915281565b61049f6107f3366004614131565b6115eb565b34801561080457600080fd5b5061057460015481565b34801561081a57600080fd5b5061057461160a565b34801561082f57600080fd5b5060055461052c906001600160a01b031681565b34801561084f57600080fd5b506000805160206145b88339815191525460ff16610475565b34801561087457600080fd5b50610574610883366004614044565b611639565b34801561089457600080fd5b5061049f6108a33660046141d9565b611645565b3480156108b457600080fd5b5061057460008051602061457883398151915281565b3480156108d657600080fd5b506105746108e53660046141fb565b6116fd565b3480156108f657600080fd5b506105746000805160206145d883398151915281565b34801561091857600080fd5b5061049f6109273660046141fb565b611725565b34801561093857600080fd5b5061049f6117d7565b34801561094d57600080fd5b5061057461095c3660046141fb565b61182e565b34801561096d57600080fd5b5061049f6118ff565b34801561098257600080fd5b5061049f61191f565b34801561099757600080fd5b5061057460005481565b3480156109ad57600080fd5b5061057461271081565b3480156109c357600080fd5b5061049f6109d2366004613dc6565b61199a565b3480156109e357600080fd5b5061052c6109f23660046141d9565b611a23565b348015610a0357600080fd5b50610574610a12366004613dc6565b611a64565b348015610a2357600080fd5b50610475610a323660046140d6565b611b30565b348015610a4357600080fd5b50610574611b68565b348015610a5857600080fd5b506104d7611c41565b61049f611c80565b348015610a7557600080fd5b506004546104759060ff1681565b348015610a8f57600080fd5b5061049f610a9e366004614044565b611eb0565b348015610aaf57600080fd5b50610574600081565b348015610ac457600080fd5b50610475610ad3366004613dc6565b611ef5565b348015610ae457600080fd5b5061049f610af3366004614044565b611f03565b348015610b0457600080fd5b50610574610b133660046140d6565b611fb3565b348015610b2457600080fd5b506104d7604051806040016040528060058152602001640352e302e360dc1b81525081565b348015610b5557600080fd5b50610574610b643660046141fb565b600a6020526000908152604090205481565b348015610b8257600080fd5b506105746000805160206145f883398151915281565b348015610ba457600080fd5b5061049f610bb33660046141fb565b612041565b348015610bc457600080fd5b50610bd8610bd3366004614044565b612385565b604080519586526020860194909452928401919091526060830152608082015260a001610481565b348015610c0c57600080fd5b50610574610c1b366004614044565b6123c6565b348015610c2c57600080fd5b50610574610c3b3660046140d6565b6123fe565b348015610c4c57600080fd5b5061049f61248c565b348015610c6157600080fd5b5061049f610c703660046140d6565b612660565b348015610c8157600080fd5b5060045461047590610100900460ff1681565b348015610ca057600080fd5b50610574610caf366004614218565b6001600160a01b0391821660009081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020908152604080832093909416825291909152205490565b348015610d0557600080fd5b5061049f610d14366004614044565b612692565b348015610d2557600080fd5b5061057460025481565b348015610d3b57600080fd5b5061049f612743565b60006001600160e01b03198216635a05180f60e01b1480610d695750610d698261290e565b92915050565b6000805160206145d8833981519152610d8781612943565b6005805460ff60a01b191690556040517ff6c0da004e5c54863f4e9c53375139d02174b08a4b6d00edcc264f31ce57092d90600090a150565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03805460609160008051602061455883398151915291610dff90614246565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2b90614246565b8015610e785780601f10610e4d57610100808354040283529160200191610e78565b820191906000526020600020905b815481529060010190602001808311610e5b57829003601f168201915b505050505091505090565b600033610e9181858561294d565b5060019392505050565b600080516020614578833981519152610eb381612943565b82518451148015610ec5575081518451145b610f165760405162461bcd60e51b815260206004820152601560248201527f496e76616c696420696e707574206c656e67746873000000000000000000000060448201526064015b60405180910390fd5b60008060005b8551811015610f5e57858181518110610f3757610f37614280565b602002602001015183610f4a91906142ac565b925080610f56816142bf565b915050610f1c565b5060005b8451811015610fa457848181518110610f7d57610f7d614280565b602002602001015182610f9091906142ac565b915080610f9c816142bf565b915050610f62565b5081610faf336116fd565b1015610ffd5760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e7420746f6b656e2062616c616e63650000000000006044820152606401610f0d565b8034101561104d5760405162461bcd60e51b815260206004820152601760248201527f496e73756666696369656e742045746865722073656e740000000000000000006044820152606401610f0d565b60005b865181101561115957600086828151811061106d5761106d614280565b602002602001015111156110b8576110b83388838151811061109157611091614280565b60200260200101518884815181106110ab576110ab614280565b602002602001015161295a565b60008582815181106110cc576110cc614280565b60200260200101511115611147578681815181106110ec576110ec614280565b60200260200101516001600160a01b03166108fc86838151811061111257611112614280565b60200260200101519081150290604051600060405180830381858888f19350505050158015611145573d6000803e3d6000fd5b505b80611151816142bf565b915050611050565b50505050505050565b60008051602061457883398151915261117a81612943565b6111826129b9565b824710156111c75760405162461bcd60e51b815260206004820152601260248201527124b739bab33334b1b4b2b73a1022ba3432b960711b6044820152606401610f0d565b60005b8251811015611237576009546111e2906002906142d8565b600a60008584815181106111f8576111f8614280565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808061122f906142bf565b9150506111ca565b506040516001600160a01b0385169084156108fc029085906000818181858888f1935050505015801561126e573d6000803e3d6000fd5b50836001600160a01b03167fdfe185ebaf59643e75abd7c7f4e5afcb58aa0bef1bdb941d1c23265bb89dcfce846040516112aa91815260200190565b60405180910390a26112db60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b50505050565b6000336112ef858285612a29565b6112fa85858561295a565b60019150505b9392505050565b60095460609060011061134c5760405162461bcd60e51b815260206004820152600d60248201526c139bc8195c1bd8da1cc81e595d609a1b6044820152606401610f0d565b6000825167ffffffffffffffff81111561136857611368613df2565b604051908082528060200260200182016040528015611391578160200160208202803683370190505b50905060005b83518110156113f1576113c28482815181106113b5576113b5614280565b602002602001015161182e565b8282815181106113d4576113d4614280565b6020908102919091010152806113e9816142bf565b915050611397565b5092915050565b6000828152600080516020614598833981519152602052604090206001015461142081612943565b6112db8383612ac0565b6000805160206145d883398151915261144281612943565b6004805460ff19168315159081179091556040519081527f540a527e51aeab0dddfb9797856930b60ffa5937b1d134ccf4e271a797dbe70a906020015b60405180910390a15050565b6001600160a01b03811633146114b45760405163334bd91960e11b815260040160405180910390fd5b6114be8282612b17565b505050565b60095460009082106114d757506000610d69565b60006114e2846116fd565b60095490915060011161130057600954600090611501906001906142d8565b90505b6009818154811061151757611517614280565b600091825260208083206001600160a01b03891684526006600790930201919091019052604090205461154a90836142ac565b91506009818154811061155f5761155f614280565b600091825260208083206001600160a01b03891684526005600790930201919091019052604090205461159290836142d8565b915061159f8460016142ac565b8114806115aa575080155b6115c057806115b8816142eb565b915050611504565b509392505050565b6000805160206145d88339815191526115e081612943565b6115e8612b65565b50565b6115f3612bbf565b6115fc82612c76565b6116068282612c81565b5050565b6000611614612d50565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b6000610d6933836114c3565b6000805160206145d883398151915261165d81612943565b612710831115801561166d575060015b801561167b57506127108211155b6116b55760405162461bcd60e51b815260206004820152600b60248201526a092dcecc2d8d2c840e8c2f60ab1b6044820152606401610f0d565b6002839055600382905560408051848152602081018490527f4ac0d6b0d694ec6c120242feaca94cfb6fbfe646756cd7026301e3a5984f0450910160405180910390a1505050565b6001600160a01b03166000908152600080516020614558833981519152602052604090205490565b6000805160206145d883398151915261173d81612943565b6001600160a01b0382166117895760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081d19585b481dd85b1b195d606a1b6044820152606401610f0d565b600580546001600160a01b0319166001600160a01b0384169081179091556040519081527ff6215f245bfd24e51265c56ef650fdd856aa4ece6221ee1ef395bbe0a55580109060200161147f565b6000805160206145d88339815191526117ef81612943565b6005805460ff60a01b1916600160a01b1790556040517f2d4fd5bae8f53dd83c59664d82f3c9a17a251e2ac3b1af3d85d6bec37d098f9f90600090a150565b6009546000906001106118735760405162461bcd60e51b815260206004820152600d60248201526c139bc8195c1bd8da1cc81e595d609a1b6044820152606401610f0d565b61188b60008051602061453883398151915283611b30565b1561189857506000919050565b6001600160a01b0382166000908152600a602052604081205481906118be9060016142ac565b90505b6009546118d0906001906142d8565b8110156113f1576118e18482611a64565b6118eb90836142ac565b9150806118f7816142bf565b9150506118c1565b6000805160206145d883398151915261191781612943565b6115e8612d99565b60008051602061457883398151915261193781612943565b6004805460ff610100808304821615810261ff001990931692909217928390556040517f406c46ebfaaea47203daefc50a4298117dc2a4d07342d50b54b526c8316b0d8f9361198f9390049091161515815260200190565b60405180910390a150565b6000805160206145f88339815191526119b281612943565b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b0384169063a9059cbb906044016020604051808303816000875af11580156119ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112db9190614302565b60008281527fc1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000602081905260408220611a5c9084612de2565b949350505050565b60095460009060011180611a7a57506009548210155b15611a8757506000610d69565b600060098381548110611a9c57611a9c614280565b90600052602060002090600702019050600a6000856001600160a01b03166001600160a01b031681526020019081526020016000205483111580611ae257506001810154155b15611af1576000915050610d69565b806001015481600401548260030154611b0a91906142ac565b611b1486866114c3565b611b1e919061431f565b611b289190614336565b915050610d69565b6000918252600080516020614598833981519152602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080611b826000805160206145388339815191526123c6565b90506000805b82811015611bc957611bab6108e560008051602061453883398151915283611a23565b611bb590836142ac565b915080611bc1816142bf565b915050611b88565b50611bd3306116fd565b611bdd90826142ac565b600454909150611bfb906201000090046001600160a01b03166116fd565b611c0590826142ac565b905080611c307f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace025490565b611c3a91906142d8565b9250505090565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace04805460609160008051602061455883398151915291610dff90614246565b600080516020614578833981519152611c9881612943565b611ca06129b9565b6009805460009190611cb4906001906142d8565b81548110611cc457611cc4614280565b600091825260208220426007909202019081559150611ce1611b68565b60075490915080151580611cf55750600034115b611d4d5760405162461bcd60e51b8152602060048201526024808201527f4e6f2074617820636f6c6c65637465642079657420616e64206e6f20455448206044820152631cd95b9d60e21b6064820152608401610f0d565b80611d57306116fd565b1015611da55760405162461bcd60e51b815260206004820152601a60248201527f42616c616e6365206c657373207468616e2072657175697265640000000000006044820152606401610f0d565b6000808211611db5576000611dbe565b611dbe82612dee565b9050600060025460035483611dd3919061431f565b611ddd9190614336565b90506000611deb82846142d8565b6005546040519192506001600160a01b03169083156108fc029084906000818181858888f19350505050158015611e26573d6000803e3d6000fd5b5060018601859055346004870181905560028701859055600387018290556009546040805191825260208201889052810183905260608101919091527f2b7e220b2babc392b7f28bbfb51e48a8ae7ab8d75e59253607e2483dd411edb79060800160405180910390a150506009805460010181556000908152600755506115e89250612a03915050565b6000805160206145f8833981519152611ec881612943565b604051339083156108fc029084906000818181858888f193505050501580156114be573d6000803e3d6000fd5b600033610e9181858561295a565b6000805160206145d8833981519152611f1b81612943565b69d3c21bcecceda1000000821115611f755760405162461bcd60e51b815260206004820152601a60248201527f496e76616c69642073656c6c2062616c616e6365206c696d69740000000000006044820152606401610f0d565b600182905560005460408051918252602082018490527f71d2b4d3f228f2d75fd480fb859115900b1af3df7a4f93fdff075e55271d8081910161147f565b6009546000908310611ffd5760405162461bcd60e51b8152602060048201526013602482015272092dcecc2d8d2c840cae0dec6d040d2dcc8caf606b1b6044820152606401610f0d565b6009838154811061201057612010614280565b600091825260208083206001600160a01b038616845260066007909302019190910190526040902054905092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156120875750825b905060008267ffffffffffffffff1660011480156120a45750303b155b9050811580156120b2575080155b156120d05760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156120fa57845460ff60401b1916600160401b1785555b6001600160a01b0386166121215760405163d92e233d60e01b815260040160405180910390fd5b61216560405180604001604052806005815260200164078706572760dc1b81525060405180604001604052806005815260200164078706572760dc1b815250612fbf565b61216d612fd1565b612175612fd9565b61217d612fd1565b612185612fe9565b6005805461015e60025560966003556004805474ffffffffffffffffffffffffffffffffffffffffff199092166001600160a01b038a161790925569021e19e0c9bab24000006000818155600191825561ffff19909216179091556121ea9080612ff9565b6122026000805160206145d883398151915280612ff9565b6122286000805160206145388339815191526000805160206145d8833981519152612ff9565b61224e6000805160206146188339815191526000805160206145d8833981519152612ff9565b61226660008051602061457883398151915280612ff9565b61228c6000805160206145f88339815191526000805160206145d8833981519152612ff9565b6122a46000805160206145d883398151915233612ac0565b506122bd60008051602061453883398151915233612ac0565b506122d660008051602061461883398151915233612ac0565b506122ef60008051602061457883398151915233612ac0565b506123086000805160206145f883398151915233612ac0565b50612314600033612ac0565b5060098054600082905260020190556123373369d3c21bcecceda1000000613079565b831561237d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b6009818154811061239557600080fd5b6000918252602090912060079091020180546001820154600283015460038401546004909401549294509092909185565b60008181527fc1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000602081905260408220611300906130af565b60095460009083106124485760405162461bcd60e51b8152602060048201526013602482015272092dcecc2d8d2c840cae0dec6d040d2dcc8caf606b1b6044820152606401610f0d565b6009838154811061245b5761245b614280565b600091825260208083206001600160a01b038616845260056007909302019190910190526040902054905092915050565b6124946129b9565b600454610100900460ff16156125125760405162461bcd60e51b815260206004820152603860248201527f436c61696d696e672069732073776974636820746f207468652078706572702060448201527f74726164696e672073797374656d2063757272656e746c7900000000000000006064820152608401610f0d565b600061251d3361182e565b9050600081116125625760405162461bcd60e51b815260206004820152601060248201526f4e6f7468696e6720746f20636c61696d60801b6044820152606401610f0d565b600954612571906002906142d8565b336000908152600a6020526040902055478111156125d15760405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e7420636f6e74726163742062616c616e63650000006044820152606401610f0d565b604051339082156108fc029083906000818181858888f193505050501580156125fe573d6000803e3d6000fd5b5060405181815233907fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a9060200160405180910390a25061265e60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b565b6000828152600080516020614598833981519152602052604090206001015461268881612943565b6112db8383612b17565b6000805160206145d88339815191526126aa81612943565b69d3c21bcecceda10000008211156127045760405162461bcd60e51b815260206004820152601c60248201527f496e76616c69642077616c6c65742062616c616e6365206c696d6974000000006044820152606401610f0d565b60008290556001546040805184815260208101929092527f71d2b4d3f228f2d75fd480fb859115900b1af3df7a4f93fdff075e55271d8081910161147f565b6000805160206145d883398151915261275b81612943565b737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156127ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127d19190614358565b6001600160a01b031663c9c6539630737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612832573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128569190614358565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156128a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c79190614358565b600460026101000a8154816001600160a01b0302191690836001600160a01b031602179055506115e830737a250d5630b4cf539739df2c5dacb4c659f2488d60001961294d565b60006001600160e01b03198216637965db0b60e01b1480610d6957506301ffc9a760e01b6001600160e01b0319831614610d69565b6115e881336130b9565b6114be83838360016130f2565b6001600160a01b03831661298457604051634b637e8f60e11b815260006004820152602401610f0d565b6001600160a01b0382166129ae5760405163ec442f0560e01b815260006004820152602401610f0d565b6114be8383836131da565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f008054600119016129fd57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6001600160a01b0383811660009081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01602090815260408083209386168352929052205460001981146112db5781811015612ab157604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610f0d565b6112db848484840360006130f2565b60007fc1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200081612aee858561363a565b90508015611a5c576000858152602083905260409020612b0e90856136df565b50949350505050565b60007fc1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200081612b4585856136f4565b90508015611a5c576000858152602083905260409020612b0e9085613770565b612b6d613785565b6000805160206145b8833981519152805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200161198f565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480612c5857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316612c4c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b1561265e5760405163703e46dd60e11b815260040160405180910390fd5b600061160681612943565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612cdb575060408051601f3d908101601f19168201909252612cd891810190614375565b60015b612d0357604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610f0d565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114612d4657604051632a87526960e21b815260048101829052602401610f0d565b6114be83836137b5565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461265e5760405163703e46dd60e11b815260040160405180910390fd5b612da161380b565b6000805160206145b8833981519152805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833612ba7565b6000611300838361383c565b600081600003612e0057506000919050565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110612e3557612e35614280565b60200260200101906001600160a01b031690816001600160a01b031681525050737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ea7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ecb9190614358565b81600181518110612ede57612ede614280565b6001600160a01b039092166020928302919091019091015260405163791ac94760e01b81524790737a250d5630b4cf539739df2c5dacb4c659f2488d9063791ac94790612f3890879060009087903090429060040161438e565b600060405180830381600087803b158015612f5257600080fd5b505af1158015612f66573d6000803e3d6000fd5b5047925060009150612f7a905083836142d8565b60408051888152602081018390529192507fa0948473da2b862876c9b294bc55a32b178b0e3c6c9da3c91555924ec8017ee9910160405180910390a195945050505050565b612fc7613866565b61160682826138af565b61265e613866565b612fe1613866565b61265e613900565b612ff1613866565b61265e613921565b6000805160206145988339815191526000613030846000908152600080516020614598833981519152602052604090206001015490565b600085815260208490526040808220600101869055519192508491839187917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a450505050565b6001600160a01b0382166130a35760405163ec442f0560e01b815260006004820152602401610f0d565b611606600083836131da565b6000610d69825490565b6130c38282611b30565b6116065760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610f0d565b6000805160206145588339815191526001600160a01b03851661312b5760405163e602df0560e01b815260006004820152602401610f0d565b6001600160a01b03841661315557604051634a1406b160e11b815260006004820152602401610f0d565b6001600160a01b038086166000908152600183016020908152604080832093881683529290522083905581156131d357836001600160a01b0316856001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040516131ca91815260200190565b60405180910390a35b5050505050565b6004546000906001600160a01b038581166201000090920416148061321257506004546001600160a01b038481166201000090920416145b8015613232575033737a250d5630b4cf539739df2c5dacb4c659f2488d14155b801561324757506001600160a01b0384163014155b801561325c57506001600160a01b0383163014155b801561327d575061327b60008051602061461883398151915285611b30565b155b801561329e575061329c60008051602061461883398151915284611b30565b155b600554909150600160a01b900460ff16806132b7575080155b6133035760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f7420656e61626c6564207965740000000000006044820152606401610f0d565b81811561356057600554600160a01b900460ff166133635760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f7420656e61626c6564207965740000000000006044820152606401610f0d565b6004546001600160a01b038681166201000090920416148015613387575060008054115b156134175760005483613399866116fd565b6133a391906142ac565b11156134175760405162461bcd60e51b815260206004820152603b60248201527f486f6c64696e6720616d6f756e7420616674657220627579696e67206578636560448201527f656473206d6178696d756d20616c6c6f77656420746f6b656e732e00000000006064820152608401610f0d565b6004546001600160a01b03858116620100009092041614801561343c57506000600154115b156134aa576001548311156134aa5760405162461bcd60e51b815260206004820152602e60248201527f53656c6c696e6720616d6f756e742065786365656473206d6178696d756d206160448201526d363637bbb2b2103a37b5b2b7399760911b6064820152608401610f0d565b60045460ff1615613560576000612710600254856134c8919061431f565b6134d29190614336565b90506134df86308361295a565b856001600160a01b03167f9174fcf222375951e43519967bd54a1083271e61dab0b523b644cdf98c975f348260405161351a91815260200190565b60405180910390a261352c81836142d8565b9150806006600082825461354091906142ac565b92505081905550806007600082825461355991906142ac565b9091555050505b600954600090613572906001906142d8565b9050816009828154811061358857613588614280565b90600052602060002090600702016005016000876001600160a01b03166001600160a01b0316815260200190815260200160002060008282546135cb91906142ac565b9250508190555083600982815481106135e6576135e6614280565b90600052602060002090600702016006016000886001600160a01b03166001600160a01b03168152602001908152602001600020600082825461362991906142ac565b9091555061237d9050868684613929565b60006000805160206145988339815191526136558484611b30565b6136d5576000848152602082815260408083206001600160a01b03871684529091529020805460ff1916600117905561368b3390565b6001600160a01b0316836001600160a01b0316857f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a46001915050610d69565b6000915050610d69565b6000611300836001600160a01b038416613a67565b600060008051602061459883398151915261370f8484611b30565b156136d5576000848152602082815260408083206001600160a01b0387168085529252808320805460ff1916905551339287917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a46001915050610d69565b6000611300836001600160a01b038416613ab6565b6000805160206145b88339815191525460ff1661265e57604051638dfc202b60e01b815260040160405180910390fd5b6137be82613b9f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115613803576114be8282613c16565b611606613c8c565b6000805160206145b88339815191525460ff161561265e5760405163d93c066560e01b815260040160405180910390fd5b600082600001828154811061385357613853614280565b9060005260206000200154905092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661265e57604051631afcd79f60e31b815260040160405180910390fd5b6138b7613866565b6000805160206145588339815191527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace036138f18482614445565b50600481016112db8382614445565b613908613866565b6000805160206145b8833981519152805460ff19169055565b612a03613866565b6000805160206145588339815191526001600160a01b038416613965578181600201600082825461395a91906142ac565b909155506139d79050565b6001600160a01b038416600090815260208290526040902054828110156139b85760405163391434e360e21b81526001600160a01b03861660048201526024810182905260448101849052606401610f0d565b6001600160a01b03851660009081526020839052604090209083900390555b6001600160a01b0383166139f5576002810180548390039055613a14565b6001600160a01b03831660009081526020829052604090208054830190555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051613a5991815260200190565b60405180910390a350505050565b6000818152600183016020526040812054613aae57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610d69565b506000610d69565b600081815260018301602052604081205480156136d5576000613ada6001836142d8565b8554909150600090613aee906001906142d8565b9050808214613b53576000866000018281548110613b0e57613b0e614280565b9060005260206000200154905080876000018481548110613b3157613b31614280565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613b6457613b64614505565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610d69565b806001600160a01b03163b600003613bd557604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610f0d565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051613c33919061451b565b600060405180830381855af49150503d8060008114613c6e576040519150601f19603f3d011682016040523d82523d6000602084013e613c73565b606091505b5091509150613c83858383613cab565b95945050505050565b341561265e5760405163b398979f60e01b815260040160405180910390fd5b606082613cc057613cbb82613d07565b611300565b8151158015613cd757506001600160a01b0384163b155b15613d0057604051639996b31560e01b81526001600160a01b0385166004820152602401610f0d565b5080611300565b805115613d175780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b600060208284031215613d4257600080fd5b81356001600160e01b03198116811461130057600080fd5b60005b83811015613d75578181015183820152602001613d5d565b50506000910152565b6020815260008251806020840152613d9d816040850160208701613d5a565b601f01601f19169190910160400192915050565b6001600160a01b03811681146115e857600080fd5b60008060408385031215613dd957600080fd5b8235613de481613db1565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613e3157613e31613df2565b604052919050565b600067ffffffffffffffff821115613e5357613e53613df2565b5060051b60200190565b600082601f830112613e6e57600080fd5b81356020613e83613e7e83613e39565b613e08565b82815260059290921b84018101918181019086841115613ea257600080fd5b8286015b84811015613ec6578035613eb981613db1565b8352918301918301613ea6565b509695505050505050565b600082601f830112613ee257600080fd5b81356020613ef2613e7e83613e39565b82815260059290921b84018101918181019086841115613f1157600080fd5b8286015b84811015613ec65780358352918301918301613f15565b600080600060608486031215613f4157600080fd5b833567ffffffffffffffff80821115613f5957600080fd5b613f6587838801613e5d565b94506020860135915080821115613f7b57600080fd5b613f8787838801613ed1565b93506040860135915080821115613f9d57600080fd5b50613faa86828701613ed1565b9150509250925092565b600080600060608486031215613fc957600080fd5b8335613fd481613db1565b925060208401359150604084013567ffffffffffffffff811115613ff757600080fd5b613faa86828701613e5d565b60008060006060848603121561401857600080fd5b833561402381613db1565b9250602084013561403381613db1565b929592945050506040919091013590565b60006020828403121561405657600080fd5b5035919050565b60006020828403121561406f57600080fd5b813567ffffffffffffffff81111561408657600080fd5b611a5c84828501613e5d565b6020808252825182820181905260009190848201906040850190845b818110156140ca578351835292840192918401916001016140ae565b50909695505050505050565b600080604083850312156140e957600080fd5b8235915060208301356140fb81613db1565b809150509250929050565b80151581146115e857600080fd5b60006020828403121561412657600080fd5b813561130081614106565b6000806040838503121561414457600080fd5b823561414f81613db1565b915060208381013567ffffffffffffffff8082111561416d57600080fd5b818601915086601f83011261418157600080fd5b81358181111561419357614193613df2565b6141a5601f8201601f19168501613e08565b915080825287848285010111156141bb57600080fd5b80848401858401376000848284010152508093505050509250929050565b600080604083850312156141ec57600080fd5b50508035926020909101359150565b60006020828403121561420d57600080fd5b813561130081613db1565b6000806040838503121561422b57600080fd5b823561423681613db1565b915060208301356140fb81613db1565b600181811c9082168061425a57607f821691505b60208210810361427a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610d6957610d69614296565b6000600182016142d1576142d1614296565b5060010190565b81810381811115610d6957610d69614296565b6000816142fa576142fa614296565b506000190190565b60006020828403121561431457600080fd5b815161130081614106565b8082028115828204841417610d6957610d69614296565b60008261435357634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561436a57600080fd5b815161130081613db1565b60006020828403121561438757600080fd5b5051919050565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156143de5784516001600160a01b0316835293830193918301916001016143b9565b50506001600160a01b03969096166060850152505050608001529392505050565b601f8211156114be57600081815260208120601f850160051c810160208610156144265750805b601f850160051c820191505b8181101561237d57828155600101614432565b815167ffffffffffffffff81111561445f5761445f613df2565b6144738161446d8454614246565b846143ff565b602080601f8311600181146144a857600084156144905750858301515b600019600386901b1c1916600185901b17855561237d565b600085815260208120601f198616915b828110156144d7578886015182559484019460019091019084016144b8565b50858210156144f55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603160045260246000fd5b6000825161452d818460208701613d5a565b919091019291505056fe2bfa5424769abb48caa3faa232f6faec62b33e75ed1d06512252216b523808d652c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace005fdbd35e8da83ee755d5e62a539e5ed7f47126abede0b8b10f9ea43dc6eed07f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775c4c453d647953c0fd35db5a34ee76e60fb4abc3a8fb891a25936b70b38f29253df112b612e9caae17b7645f3b1b08e97332b1641a13ce63785457f40efa3f27c
Deployed Bytecode
0x6080604052600436106104145760003560e01c806370a082311161021e578063a217fddf11610123578063ca15c873116100ab578063d9a553aa1161007a578063d9a553aa14610c75578063dd62ed3e14610c94578063e4ef93b814610cf9578063fe85b42b14610d19578063feb1dfcc14610d2f57600080fd5b8063ca15c87314610c00578063cdbafa1014610c20578063d1058e5914610c40578063d547741f14610c5557600080fd5b8063ad3cb1cc116100f2578063ad3cb1cc14610b18578063b131646014610b49578063b1a9f80914610b76578063c4d66de814610b98578063c6b61e4c14610bb857600080fd5b8063a217fddf14610aa3578063a9059cbb14610ab8578063a9bf2c0914610ad8578063aa65c54614610af857600080fd5b80638cd4426d116101a65780639358928b116101755780639358928b14610a3757806395d89b4114610a4c5780639711715a14610a6157806398a0dd0914610a695780639e252f0014610a8357600080fd5b80638cd4426d146109b75780639010d07c146109d757806390f5fd4b146109f757806391d1485414610a1757600080fd5b806382b2ed13116101ed57806382b2ed13146109415780638456cb5914610961578063853755fc146109765780638817f6f11461098b5780638a9cb361146109a157600080fd5b806370a08231146108ca57806375b238fc146108ea5780637cb332bb1461090c5780637ff976c71461092c57600080fd5b80633059f356116103245780634e2fe61f116102ac578063599270441161027b57806359927044146108235780635c975abb146108435780635e9177ae14610868578063667f6526146108885780637028e2cd146108a857600080fd5b80634e2fe61f146107c35780634f1ef286146107e55780634f91e48c146107f857806352d1902d1461080e57600080fd5b80633c88c0a3116102f35780633c88c0a3146107345780633f4ba83a14610754578063413e920d1461076957806349bd5a5e1461078757806349cb380f146107ad57600080fd5b80633059f356146106cc578063313ce567146106e257806336568abe146106fe57806337c279dc1461071e57600080fd5b80631c73bca4116103a7578063244519fa11610376578063244519fa14610600578063248a9ca3146106225780632bff8cd71461065f5780632f2ff15d1461068c5780632ffc1628146106ac57600080fd5b80631c73bca41461059557806321129fad146105aa578063233edfe7146105ca57806323b872dd146105e057600080fd5b8063095ea7b3116103e3578063095ea7b3146104e45780631694505e1461050457806318160ddd146105445780631bf2907b1461058257600080fd5b806301ffc9a71461045557806303c051c31461048a578063064a59d0146104a157806306fdde03146104c257600080fd5b366104505760405134815233907fa419615bc8fda4c87663805ee2a3597a6d71c1d476911d9892f340d965bc7bf19060200160405180910390a2005b600080fd5b34801561046157600080fd5b50610475610470366004613d30565b610d44565b60405190151581526020015b60405180910390f35b34801561049657600080fd5b5061049f610d6f565b005b3480156104ad57600080fd5b5060055461047590600160a01b900460ff1681565b3480156104ce57600080fd5b506104d7610dc0565b6040516104819190613d7e565b3480156104f057600080fd5b506104756104ff366004613dc6565b610e83565b34801561051057600080fd5b5061052c737a250d5630b4cf539739df2c5dacb4c659f2488d81565b6040516001600160a01b039091168152602001610481565b34801561055057600080fd5b507f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02545b604051908152602001610481565b61049f610590366004613f2c565b610e9b565b3480156105a157600080fd5b50600954610574565b3480156105b657600080fd5b5061049f6105c5366004613fb4565b611162565b3480156105d657600080fd5b5061057460075481565b3480156105ec57600080fd5b506104756105fb366004614003565b6112e1565b34801561060c57600080fd5b5061057460008051602061461883398151915281565b34801561062e57600080fd5b5061057461063d366004614044565b6000908152600080516020614598833981519152602052604090206001015490565b34801561066b57600080fd5b5061067f61067a36600461405d565b611307565b6040516104819190614092565b34801561069857600080fd5b5061049f6106a73660046140d6565b6113f8565b3480156106b857600080fd5b5061049f6106c7366004614114565b61142a565b3480156106d857600080fd5b5061057460035481565b3480156106ee57600080fd5b5060405160128152602001610481565b34801561070a57600080fd5b5061049f6107193660046140d6565b61148b565b34801561072a57600080fd5b5061057460065481565b34801561074057600080fd5b5061057461074f366004613dc6565b6114c3565b34801561076057600080fd5b5061049f6115c8565b34801561077557600080fd5b5061057469d3c21bcecceda100000081565b34801561079357600080fd5b5060045461052c906201000090046001600160a01b031681565b3480156107b957600080fd5b5061057460085481565b3480156107cf57600080fd5b5061057460008051602061453883398151915281565b61049f6107f3366004614131565b6115eb565b34801561080457600080fd5b5061057460015481565b34801561081a57600080fd5b5061057461160a565b34801561082f57600080fd5b5060055461052c906001600160a01b031681565b34801561084f57600080fd5b506000805160206145b88339815191525460ff16610475565b34801561087457600080fd5b50610574610883366004614044565b611639565b34801561089457600080fd5b5061049f6108a33660046141d9565b611645565b3480156108b457600080fd5b5061057460008051602061457883398151915281565b3480156108d657600080fd5b506105746108e53660046141fb565b6116fd565b3480156108f657600080fd5b506105746000805160206145d883398151915281565b34801561091857600080fd5b5061049f6109273660046141fb565b611725565b34801561093857600080fd5b5061049f6117d7565b34801561094d57600080fd5b5061057461095c3660046141fb565b61182e565b34801561096d57600080fd5b5061049f6118ff565b34801561098257600080fd5b5061049f61191f565b34801561099757600080fd5b5061057460005481565b3480156109ad57600080fd5b5061057461271081565b3480156109c357600080fd5b5061049f6109d2366004613dc6565b61199a565b3480156109e357600080fd5b5061052c6109f23660046141d9565b611a23565b348015610a0357600080fd5b50610574610a12366004613dc6565b611a64565b348015610a2357600080fd5b50610475610a323660046140d6565b611b30565b348015610a4357600080fd5b50610574611b68565b348015610a5857600080fd5b506104d7611c41565b61049f611c80565b348015610a7557600080fd5b506004546104759060ff1681565b348015610a8f57600080fd5b5061049f610a9e366004614044565b611eb0565b348015610aaf57600080fd5b50610574600081565b348015610ac457600080fd5b50610475610ad3366004613dc6565b611ef5565b348015610ae457600080fd5b5061049f610af3366004614044565b611f03565b348015610b0457600080fd5b50610574610b133660046140d6565b611fb3565b348015610b2457600080fd5b506104d7604051806040016040528060058152602001640352e302e360dc1b81525081565b348015610b5557600080fd5b50610574610b643660046141fb565b600a6020526000908152604090205481565b348015610b8257600080fd5b506105746000805160206145f883398151915281565b348015610ba457600080fd5b5061049f610bb33660046141fb565b612041565b348015610bc457600080fd5b50610bd8610bd3366004614044565b612385565b604080519586526020860194909452928401919091526060830152608082015260a001610481565b348015610c0c57600080fd5b50610574610c1b366004614044565b6123c6565b348015610c2c57600080fd5b50610574610c3b3660046140d6565b6123fe565b348015610c4c57600080fd5b5061049f61248c565b348015610c6157600080fd5b5061049f610c703660046140d6565b612660565b348015610c8157600080fd5b5060045461047590610100900460ff1681565b348015610ca057600080fd5b50610574610caf366004614218565b6001600160a01b0391821660009081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020908152604080832093909416825291909152205490565b348015610d0557600080fd5b5061049f610d14366004614044565b612692565b348015610d2557600080fd5b5061057460025481565b348015610d3b57600080fd5b5061049f612743565b60006001600160e01b03198216635a05180f60e01b1480610d695750610d698261290e565b92915050565b6000805160206145d8833981519152610d8781612943565b6005805460ff60a01b191690556040517ff6c0da004e5c54863f4e9c53375139d02174b08a4b6d00edcc264f31ce57092d90600090a150565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03805460609160008051602061455883398151915291610dff90614246565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2b90614246565b8015610e785780601f10610e4d57610100808354040283529160200191610e78565b820191906000526020600020905b815481529060010190602001808311610e5b57829003601f168201915b505050505091505090565b600033610e9181858561294d565b5060019392505050565b600080516020614578833981519152610eb381612943565b82518451148015610ec5575081518451145b610f165760405162461bcd60e51b815260206004820152601560248201527f496e76616c696420696e707574206c656e67746873000000000000000000000060448201526064015b60405180910390fd5b60008060005b8551811015610f5e57858181518110610f3757610f37614280565b602002602001015183610f4a91906142ac565b925080610f56816142bf565b915050610f1c565b5060005b8451811015610fa457848181518110610f7d57610f7d614280565b602002602001015182610f9091906142ac565b915080610f9c816142bf565b915050610f62565b5081610faf336116fd565b1015610ffd5760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e7420746f6b656e2062616c616e63650000000000006044820152606401610f0d565b8034101561104d5760405162461bcd60e51b815260206004820152601760248201527f496e73756666696369656e742045746865722073656e740000000000000000006044820152606401610f0d565b60005b865181101561115957600086828151811061106d5761106d614280565b602002602001015111156110b8576110b83388838151811061109157611091614280565b60200260200101518884815181106110ab576110ab614280565b602002602001015161295a565b60008582815181106110cc576110cc614280565b60200260200101511115611147578681815181106110ec576110ec614280565b60200260200101516001600160a01b03166108fc86838151811061111257611112614280565b60200260200101519081150290604051600060405180830381858888f19350505050158015611145573d6000803e3d6000fd5b505b80611151816142bf565b915050611050565b50505050505050565b60008051602061457883398151915261117a81612943565b6111826129b9565b824710156111c75760405162461bcd60e51b815260206004820152601260248201527124b739bab33334b1b4b2b73a1022ba3432b960711b6044820152606401610f0d565b60005b8251811015611237576009546111e2906002906142d8565b600a60008584815181106111f8576111f8614280565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808061122f906142bf565b9150506111ca565b506040516001600160a01b0385169084156108fc029085906000818181858888f1935050505015801561126e573d6000803e3d6000fd5b50836001600160a01b03167fdfe185ebaf59643e75abd7c7f4e5afcb58aa0bef1bdb941d1c23265bb89dcfce846040516112aa91815260200190565b60405180910390a26112db60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b50505050565b6000336112ef858285612a29565b6112fa85858561295a565b60019150505b9392505050565b60095460609060011061134c5760405162461bcd60e51b815260206004820152600d60248201526c139bc8195c1bd8da1cc81e595d609a1b6044820152606401610f0d565b6000825167ffffffffffffffff81111561136857611368613df2565b604051908082528060200260200182016040528015611391578160200160208202803683370190505b50905060005b83518110156113f1576113c28482815181106113b5576113b5614280565b602002602001015161182e565b8282815181106113d4576113d4614280565b6020908102919091010152806113e9816142bf565b915050611397565b5092915050565b6000828152600080516020614598833981519152602052604090206001015461142081612943565b6112db8383612ac0565b6000805160206145d883398151915261144281612943565b6004805460ff19168315159081179091556040519081527f540a527e51aeab0dddfb9797856930b60ffa5937b1d134ccf4e271a797dbe70a906020015b60405180910390a15050565b6001600160a01b03811633146114b45760405163334bd91960e11b815260040160405180910390fd5b6114be8282612b17565b505050565b60095460009082106114d757506000610d69565b60006114e2846116fd565b60095490915060011161130057600954600090611501906001906142d8565b90505b6009818154811061151757611517614280565b600091825260208083206001600160a01b03891684526006600790930201919091019052604090205461154a90836142ac565b91506009818154811061155f5761155f614280565b600091825260208083206001600160a01b03891684526005600790930201919091019052604090205461159290836142d8565b915061159f8460016142ac565b8114806115aa575080155b6115c057806115b8816142eb565b915050611504565b509392505050565b6000805160206145d88339815191526115e081612943565b6115e8612b65565b50565b6115f3612bbf565b6115fc82612c76565b6116068282612c81565b5050565b6000611614612d50565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b6000610d6933836114c3565b6000805160206145d883398151915261165d81612943565b612710831115801561166d575060015b801561167b57506127108211155b6116b55760405162461bcd60e51b815260206004820152600b60248201526a092dcecc2d8d2c840e8c2f60ab1b6044820152606401610f0d565b6002839055600382905560408051848152602081018490527f4ac0d6b0d694ec6c120242feaca94cfb6fbfe646756cd7026301e3a5984f0450910160405180910390a1505050565b6001600160a01b03166000908152600080516020614558833981519152602052604090205490565b6000805160206145d883398151915261173d81612943565b6001600160a01b0382166117895760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081d19585b481dd85b1b195d606a1b6044820152606401610f0d565b600580546001600160a01b0319166001600160a01b0384169081179091556040519081527ff6215f245bfd24e51265c56ef650fdd856aa4ece6221ee1ef395bbe0a55580109060200161147f565b6000805160206145d88339815191526117ef81612943565b6005805460ff60a01b1916600160a01b1790556040517f2d4fd5bae8f53dd83c59664d82f3c9a17a251e2ac3b1af3d85d6bec37d098f9f90600090a150565b6009546000906001106118735760405162461bcd60e51b815260206004820152600d60248201526c139bc8195c1bd8da1cc81e595d609a1b6044820152606401610f0d565b61188b60008051602061453883398151915283611b30565b1561189857506000919050565b6001600160a01b0382166000908152600a602052604081205481906118be9060016142ac565b90505b6009546118d0906001906142d8565b8110156113f1576118e18482611a64565b6118eb90836142ac565b9150806118f7816142bf565b9150506118c1565b6000805160206145d883398151915261191781612943565b6115e8612d99565b60008051602061457883398151915261193781612943565b6004805460ff610100808304821615810261ff001990931692909217928390556040517f406c46ebfaaea47203daefc50a4298117dc2a4d07342d50b54b526c8316b0d8f9361198f9390049091161515815260200190565b60405180910390a150565b6000805160206145f88339815191526119b281612943565b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b0384169063a9059cbb906044016020604051808303816000875af11580156119ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112db9190614302565b60008281527fc1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000602081905260408220611a5c9084612de2565b949350505050565b60095460009060011180611a7a57506009548210155b15611a8757506000610d69565b600060098381548110611a9c57611a9c614280565b90600052602060002090600702019050600a6000856001600160a01b03166001600160a01b031681526020019081526020016000205483111580611ae257506001810154155b15611af1576000915050610d69565b806001015481600401548260030154611b0a91906142ac565b611b1486866114c3565b611b1e919061431f565b611b289190614336565b915050610d69565b6000918252600080516020614598833981519152602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080611b826000805160206145388339815191526123c6565b90506000805b82811015611bc957611bab6108e560008051602061453883398151915283611a23565b611bb590836142ac565b915080611bc1816142bf565b915050611b88565b50611bd3306116fd565b611bdd90826142ac565b600454909150611bfb906201000090046001600160a01b03166116fd565b611c0590826142ac565b905080611c307f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace025490565b611c3a91906142d8565b9250505090565b7f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace04805460609160008051602061455883398151915291610dff90614246565b600080516020614578833981519152611c9881612943565b611ca06129b9565b6009805460009190611cb4906001906142d8565b81548110611cc457611cc4614280565b600091825260208220426007909202019081559150611ce1611b68565b60075490915080151580611cf55750600034115b611d4d5760405162461bcd60e51b8152602060048201526024808201527f4e6f2074617820636f6c6c65637465642079657420616e64206e6f20455448206044820152631cd95b9d60e21b6064820152608401610f0d565b80611d57306116fd565b1015611da55760405162461bcd60e51b815260206004820152601a60248201527f42616c616e6365206c657373207468616e2072657175697265640000000000006044820152606401610f0d565b6000808211611db5576000611dbe565b611dbe82612dee565b9050600060025460035483611dd3919061431f565b611ddd9190614336565b90506000611deb82846142d8565b6005546040519192506001600160a01b03169083156108fc029084906000818181858888f19350505050158015611e26573d6000803e3d6000fd5b5060018601859055346004870181905560028701859055600387018290556009546040805191825260208201889052810183905260608101919091527f2b7e220b2babc392b7f28bbfb51e48a8ae7ab8d75e59253607e2483dd411edb79060800160405180910390a150506009805460010181556000908152600755506115e89250612a03915050565b6000805160206145f8833981519152611ec881612943565b604051339083156108fc029084906000818181858888f193505050501580156114be573d6000803e3d6000fd5b600033610e9181858561295a565b6000805160206145d8833981519152611f1b81612943565b69d3c21bcecceda1000000821115611f755760405162461bcd60e51b815260206004820152601a60248201527f496e76616c69642073656c6c2062616c616e6365206c696d69740000000000006044820152606401610f0d565b600182905560005460408051918252602082018490527f71d2b4d3f228f2d75fd480fb859115900b1af3df7a4f93fdff075e55271d8081910161147f565b6009546000908310611ffd5760405162461bcd60e51b8152602060048201526013602482015272092dcecc2d8d2c840cae0dec6d040d2dcc8caf606b1b6044820152606401610f0d565b6009838154811061201057612010614280565b600091825260208083206001600160a01b038616845260066007909302019190910190526040902054905092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156120875750825b905060008267ffffffffffffffff1660011480156120a45750303b155b9050811580156120b2575080155b156120d05760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156120fa57845460ff60401b1916600160401b1785555b6001600160a01b0386166121215760405163d92e233d60e01b815260040160405180910390fd5b61216560405180604001604052806005815260200164078706572760dc1b81525060405180604001604052806005815260200164078706572760dc1b815250612fbf565b61216d612fd1565b612175612fd9565b61217d612fd1565b612185612fe9565b6005805461015e60025560966003556004805474ffffffffffffffffffffffffffffffffffffffffff199092166001600160a01b038a161790925569021e19e0c9bab24000006000818155600191825561ffff19909216179091556121ea9080612ff9565b6122026000805160206145d883398151915280612ff9565b6122286000805160206145388339815191526000805160206145d8833981519152612ff9565b61224e6000805160206146188339815191526000805160206145d8833981519152612ff9565b61226660008051602061457883398151915280612ff9565b61228c6000805160206145f88339815191526000805160206145d8833981519152612ff9565b6122a46000805160206145d883398151915233612ac0565b506122bd60008051602061453883398151915233612ac0565b506122d660008051602061461883398151915233612ac0565b506122ef60008051602061457883398151915233612ac0565b506123086000805160206145f883398151915233612ac0565b50612314600033612ac0565b5060098054600082905260020190556123373369d3c21bcecceda1000000613079565b831561237d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b6009818154811061239557600080fd5b6000918252602090912060079091020180546001820154600283015460038401546004909401549294509092909185565b60008181527fc1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000602081905260408220611300906130af565b60095460009083106124485760405162461bcd60e51b8152602060048201526013602482015272092dcecc2d8d2c840cae0dec6d040d2dcc8caf606b1b6044820152606401610f0d565b6009838154811061245b5761245b614280565b600091825260208083206001600160a01b038616845260056007909302019190910190526040902054905092915050565b6124946129b9565b600454610100900460ff16156125125760405162461bcd60e51b815260206004820152603860248201527f436c61696d696e672069732073776974636820746f207468652078706572702060448201527f74726164696e672073797374656d2063757272656e746c7900000000000000006064820152608401610f0d565b600061251d3361182e565b9050600081116125625760405162461bcd60e51b815260206004820152601060248201526f4e6f7468696e6720746f20636c61696d60801b6044820152606401610f0d565b600954612571906002906142d8565b336000908152600a6020526040902055478111156125d15760405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e7420636f6e74726163742062616c616e63650000006044820152606401610f0d565b604051339082156108fc029083906000818181858888f193505050501580156125fe573d6000803e3d6000fd5b5060405181815233907fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a9060200160405180910390a25061265e60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b565b6000828152600080516020614598833981519152602052604090206001015461268881612943565b6112db8383612b17565b6000805160206145d88339815191526126aa81612943565b69d3c21bcecceda10000008211156127045760405162461bcd60e51b815260206004820152601c60248201527f496e76616c69642077616c6c65742062616c616e6365206c696d6974000000006044820152606401610f0d565b60008290556001546040805184815260208101929092527f71d2b4d3f228f2d75fd480fb859115900b1af3df7a4f93fdff075e55271d8081910161147f565b6000805160206145d883398151915261275b81612943565b737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156127ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127d19190614358565b6001600160a01b031663c9c6539630737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612832573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128569190614358565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156128a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c79190614358565b600460026101000a8154816001600160a01b0302191690836001600160a01b031602179055506115e830737a250d5630b4cf539739df2c5dacb4c659f2488d60001961294d565b60006001600160e01b03198216637965db0b60e01b1480610d6957506301ffc9a760e01b6001600160e01b0319831614610d69565b6115e881336130b9565b6114be83838360016130f2565b6001600160a01b03831661298457604051634b637e8f60e11b815260006004820152602401610f0d565b6001600160a01b0382166129ae5760405163ec442f0560e01b815260006004820152602401610f0d565b6114be8383836131da565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f008054600119016129fd57604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b6001600160a01b0383811660009081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace01602090815260408083209386168352929052205460001981146112db5781811015612ab157604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610f0d565b6112db848484840360006130f2565b60007fc1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200081612aee858561363a565b90508015611a5c576000858152602083905260409020612b0e90856136df565b50949350505050565b60007fc1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200081612b4585856136f4565b90508015611a5c576000858152602083905260409020612b0e9085613770565b612b6d613785565b6000805160206145b8833981519152805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200161198f565b306001600160a01b037f0000000000000000000000005f5169239c87ac2f20485777f5abd9cdb2b7e685161480612c5857507f0000000000000000000000005f5169239c87ac2f20485777f5abd9cdb2b7e6856001600160a01b0316612c4c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b1561265e5760405163703e46dd60e11b815260040160405180910390fd5b600061160681612943565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612cdb575060408051601f3d908101601f19168201909252612cd891810190614375565b60015b612d0357604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610f0d565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114612d4657604051632a87526960e21b815260048101829052602401610f0d565b6114be83836137b5565b306001600160a01b037f0000000000000000000000005f5169239c87ac2f20485777f5abd9cdb2b7e685161461265e5760405163703e46dd60e11b815260040160405180910390fd5b612da161380b565b6000805160206145b8833981519152805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833612ba7565b6000611300838361383c565b600081600003612e0057506000919050565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110612e3557612e35614280565b60200260200101906001600160a01b031690816001600160a01b031681525050737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ea7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ecb9190614358565b81600181518110612ede57612ede614280565b6001600160a01b039092166020928302919091019091015260405163791ac94760e01b81524790737a250d5630b4cf539739df2c5dacb4c659f2488d9063791ac94790612f3890879060009087903090429060040161438e565b600060405180830381600087803b158015612f5257600080fd5b505af1158015612f66573d6000803e3d6000fd5b5047925060009150612f7a905083836142d8565b60408051888152602081018390529192507fa0948473da2b862876c9b294bc55a32b178b0e3c6c9da3c91555924ec8017ee9910160405180910390a195945050505050565b612fc7613866565b61160682826138af565b61265e613866565b612fe1613866565b61265e613900565b612ff1613866565b61265e613921565b6000805160206145988339815191526000613030846000908152600080516020614598833981519152602052604090206001015490565b600085815260208490526040808220600101869055519192508491839187917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a450505050565b6001600160a01b0382166130a35760405163ec442f0560e01b815260006004820152602401610f0d565b611606600083836131da565b6000610d69825490565b6130c38282611b30565b6116065760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610f0d565b6000805160206145588339815191526001600160a01b03851661312b5760405163e602df0560e01b815260006004820152602401610f0d565b6001600160a01b03841661315557604051634a1406b160e11b815260006004820152602401610f0d565b6001600160a01b038086166000908152600183016020908152604080832093881683529290522083905581156131d357836001600160a01b0316856001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040516131ca91815260200190565b60405180910390a35b5050505050565b6004546000906001600160a01b038581166201000090920416148061321257506004546001600160a01b038481166201000090920416145b8015613232575033737a250d5630b4cf539739df2c5dacb4c659f2488d14155b801561324757506001600160a01b0384163014155b801561325c57506001600160a01b0383163014155b801561327d575061327b60008051602061461883398151915285611b30565b155b801561329e575061329c60008051602061461883398151915284611b30565b155b600554909150600160a01b900460ff16806132b7575080155b6133035760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f7420656e61626c6564207965740000000000006044820152606401610f0d565b81811561356057600554600160a01b900460ff166133635760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f7420656e61626c6564207965740000000000006044820152606401610f0d565b6004546001600160a01b038681166201000090920416148015613387575060008054115b156134175760005483613399866116fd565b6133a391906142ac565b11156134175760405162461bcd60e51b815260206004820152603b60248201527f486f6c64696e6720616d6f756e7420616674657220627579696e67206578636560448201527f656473206d6178696d756d20616c6c6f77656420746f6b656e732e00000000006064820152608401610f0d565b6004546001600160a01b03858116620100009092041614801561343c57506000600154115b156134aa576001548311156134aa5760405162461bcd60e51b815260206004820152602e60248201527f53656c6c696e6720616d6f756e742065786365656473206d6178696d756d206160448201526d363637bbb2b2103a37b5b2b7399760911b6064820152608401610f0d565b60045460ff1615613560576000612710600254856134c8919061431f565b6134d29190614336565b90506134df86308361295a565b856001600160a01b03167f9174fcf222375951e43519967bd54a1083271e61dab0b523b644cdf98c975f348260405161351a91815260200190565b60405180910390a261352c81836142d8565b9150806006600082825461354091906142ac565b92505081905550806007600082825461355991906142ac565b9091555050505b600954600090613572906001906142d8565b9050816009828154811061358857613588614280565b90600052602060002090600702016005016000876001600160a01b03166001600160a01b0316815260200190815260200160002060008282546135cb91906142ac565b9250508190555083600982815481106135e6576135e6614280565b90600052602060002090600702016006016000886001600160a01b03166001600160a01b03168152602001908152602001600020600082825461362991906142ac565b9091555061237d9050868684613929565b60006000805160206145988339815191526136558484611b30565b6136d5576000848152602082815260408083206001600160a01b03871684529091529020805460ff1916600117905561368b3390565b6001600160a01b0316836001600160a01b0316857f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a46001915050610d69565b6000915050610d69565b6000611300836001600160a01b038416613a67565b600060008051602061459883398151915261370f8484611b30565b156136d5576000848152602082815260408083206001600160a01b0387168085529252808320805460ff1916905551339287917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a46001915050610d69565b6000611300836001600160a01b038416613ab6565b6000805160206145b88339815191525460ff1661265e57604051638dfc202b60e01b815260040160405180910390fd5b6137be82613b9f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115613803576114be8282613c16565b611606613c8c565b6000805160206145b88339815191525460ff161561265e5760405163d93c066560e01b815260040160405180910390fd5b600082600001828154811061385357613853614280565b9060005260206000200154905092915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661265e57604051631afcd79f60e31b815260040160405180910390fd5b6138b7613866565b6000805160206145588339815191527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace036138f18482614445565b50600481016112db8382614445565b613908613866565b6000805160206145b8833981519152805460ff19169055565b612a03613866565b6000805160206145588339815191526001600160a01b038416613965578181600201600082825461395a91906142ac565b909155506139d79050565b6001600160a01b038416600090815260208290526040902054828110156139b85760405163391434e360e21b81526001600160a01b03861660048201526024810182905260448101849052606401610f0d565b6001600160a01b03851660009081526020839052604090209083900390555b6001600160a01b0383166139f5576002810180548390039055613a14565b6001600160a01b03831660009081526020829052604090208054830190555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051613a5991815260200190565b60405180910390a350505050565b6000818152600183016020526040812054613aae57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610d69565b506000610d69565b600081815260018301602052604081205480156136d5576000613ada6001836142d8565b8554909150600090613aee906001906142d8565b9050808214613b53576000866000018281548110613b0e57613b0e614280565b9060005260206000200154905080876000018481548110613b3157613b31614280565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613b6457613b64614505565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610d69565b806001600160a01b03163b600003613bd557604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610f0d565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051613c33919061451b565b600060405180830381855af49150503d8060008114613c6e576040519150601f19603f3d011682016040523d82523d6000602084013e613c73565b606091505b5091509150613c83858383613cab565b95945050505050565b341561265e5760405163b398979f60e01b815260040160405180910390fd5b606082613cc057613cbb82613d07565b611300565b8151158015613cd757506001600160a01b0384163b155b15613d0057604051639996b31560e01b81526001600160a01b0385166004820152602401610f0d565b5080611300565b805115613d175780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b600060208284031215613d4257600080fd5b81356001600160e01b03198116811461130057600080fd5b60005b83811015613d75578181015183820152602001613d5d565b50506000910152565b6020815260008251806020840152613d9d816040850160208701613d5a565b601f01601f19169190910160400192915050565b6001600160a01b03811681146115e857600080fd5b60008060408385031215613dd957600080fd5b8235613de481613db1565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613e3157613e31613df2565b604052919050565b600067ffffffffffffffff821115613e5357613e53613df2565b5060051b60200190565b600082601f830112613e6e57600080fd5b81356020613e83613e7e83613e39565b613e08565b82815260059290921b84018101918181019086841115613ea257600080fd5b8286015b84811015613ec6578035613eb981613db1565b8352918301918301613ea6565b509695505050505050565b600082601f830112613ee257600080fd5b81356020613ef2613e7e83613e39565b82815260059290921b84018101918181019086841115613f1157600080fd5b8286015b84811015613ec65780358352918301918301613f15565b600080600060608486031215613f4157600080fd5b833567ffffffffffffffff80821115613f5957600080fd5b613f6587838801613e5d565b94506020860135915080821115613f7b57600080fd5b613f8787838801613ed1565b93506040860135915080821115613f9d57600080fd5b50613faa86828701613ed1565b9150509250925092565b600080600060608486031215613fc957600080fd5b8335613fd481613db1565b925060208401359150604084013567ffffffffffffffff811115613ff757600080fd5b613faa86828701613e5d565b60008060006060848603121561401857600080fd5b833561402381613db1565b9250602084013561403381613db1565b929592945050506040919091013590565b60006020828403121561405657600080fd5b5035919050565b60006020828403121561406f57600080fd5b813567ffffffffffffffff81111561408657600080fd5b611a5c84828501613e5d565b6020808252825182820181905260009190848201906040850190845b818110156140ca578351835292840192918401916001016140ae565b50909695505050505050565b600080604083850312156140e957600080fd5b8235915060208301356140fb81613db1565b809150509250929050565b80151581146115e857600080fd5b60006020828403121561412657600080fd5b813561130081614106565b6000806040838503121561414457600080fd5b823561414f81613db1565b915060208381013567ffffffffffffffff8082111561416d57600080fd5b818601915086601f83011261418157600080fd5b81358181111561419357614193613df2565b6141a5601f8201601f19168501613e08565b915080825287848285010111156141bb57600080fd5b80848401858401376000848284010152508093505050509250929050565b600080604083850312156141ec57600080fd5b50508035926020909101359150565b60006020828403121561420d57600080fd5b813561130081613db1565b6000806040838503121561422b57600080fd5b823561423681613db1565b915060208301356140fb81613db1565b600181811c9082168061425a57607f821691505b60208210810361427a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610d6957610d69614296565b6000600182016142d1576142d1614296565b5060010190565b81810381811115610d6957610d69614296565b6000816142fa576142fa614296565b506000190190565b60006020828403121561431457600080fd5b815161130081614106565b8082028115828204841417610d6957610d69614296565b60008261435357634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561436a57600080fd5b815161130081613db1565b60006020828403121561438757600080fd5b5051919050565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156143de5784516001600160a01b0316835293830193918301916001016143b9565b50506001600160a01b03969096166060850152505050608001529392505050565b601f8211156114be57600081815260208120601f850160051c810160208610156144265750805b601f850160051c820191505b8181101561237d57828155600101614432565b815167ffffffffffffffff81111561445f5761445f613df2565b6144738161446d8454614246565b846143ff565b602080601f8311600181146144a857600084156144905750858301515b600019600386901b1c1916600185901b17855561237d565b600085815260208120601f198616915b828110156144d7578886015182559484019460019091019084016144b8565b50858210156144f55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603160045260246000fd5b6000825161452d818460208701613d5a565b919091019291505056fe2bfa5424769abb48caa3faa232f6faec62b33e75ed1d06512252216b523808d652c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace005fdbd35e8da83ee755d5e62a539e5ed7f47126abede0b8b10f9ea43dc6eed07f02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775c4c453d647953c0fd35db5a34ee76e60fb4abc3a8fb891a25936b70b38f29253df112b612e9caae17b7645f3b1b08e97332b1641a13ce63785457f40efa3f27c
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.