Feature Tip: Add private address tag to any address under My Name Tag !
ERC-20
Overview
Max Total Supply
16,405,722.450451953816 PLSB
Holders
5,718
Market
Price
$0.02 @ 0.000007 ETH (+122.27%)
Onchain Market Cap
$315,120.62
Circulating Supply Market Cap
$0.00
Other Info
Token Contract (WITH 12 Decimals)
Balance
180.008817698484 PLSBValue
$3.46 ( ~0.00131315210761395 Eth) [0.0011%]Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
PulseBitcoin
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
/* /$$$$$$$ /$$ /$$$$$$$ /$$ /$$ /$$ | $$__ $$ | $$ | $$__ $$|__/ | $$ |__/ | $$ \ $$ /$$ /$$| $$ /$$$$$$$ /$$$$$$ | $$ \ $$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$ /$$ /$$$$$$$ | $$$$$$$/| $$ | $$| $$ /$$_____/ /$$__ $$| $$$$$$$ | $$|_ $$_/ /$$_____/ /$$__ $$| $$| $$__ $$ | $$____/ | $$ | $$| $$| $$$$$$ | $$$$$$$$| $$__ $$| $$ | $$ | $$ | $$ \ $$| $$| $$ \ $$ | $$ | $$ | $$| $$ \____ $$| $$_____/| $$ \ $$| $$ | $$ /$$| $$ | $$ | $$| $$| $$ | $$ | $$ | $$$$$$/| $$ /$$$$$$$/| $$$$$$$| $$$$$$$/| $$ | $$$$/| $$$$$$$| $$$$$$/| $$| $$ | $$ |__/ \______/ |__/|_______/ \_______/|_______/ |__/ \___/ \_______/ \______/ |__/|__/ |__/ */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.16; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "./tokens/ASIC.sol"; import "./tokens/ATM.sol"; import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; import "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol"; import "./lib/TickMath.sol"; import "./lib/FullMath.sol"; /// @title PulseBitcoin smart contract /// @author 01101000 01100101 01111000 01101001 01101110 01100110 01101111 00100000 00100110 00100000 01101011 01101111 01100100 01100101 /// @notice PulseBitcoin is a premier store of value that is mined through the process of a 30 day timelock deposit of ASIC. contract PulseBitcoin is ERC20, ReentrancyGuard { using SafeERC20 for IERC20; using Counters for Counters.Counter; // ASIC Token ASIC private immutable _asic; address public asic; // ASIC Token Miner NFT ATM private immutable _atm; address public atm; // constants uint256 private immutable LAUNCH_TIME; uint8 private constant TWAP_INTERVAL = 15; uint256 private constant MAX_MINER_SIZE = 140 * 1e6 * 1e12; uint256 private constant MIN_MINING_DURATION = 30; uint256 private constant WITHDRAW_GRACE_PERIOD = 30; uint256 private constant ATM_EVENT_LENGTH = 30; uint256 private constant DAYS_FOR_PENALTY = MIN_MINING_DURATION + WITHDRAW_GRACE_PERIOD; uint256 private constant SCALE_FACTOR = 1e6; uint256 private constant MIN_MINING_BITOSHIS = 1 * 1e12; uint256 private constant DECIMAL_RESOLUTION = 1e18; uint256 private constant TOTAL_MINTABLE_SUPPLY = 21 * 1e6 * 1e12; // 21 million // address constants address private constant WETH_ADDRESS = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); address private constant USDC_ADDRESS = address(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); address private constant USDT_ADDRESS = address(0xdAC17F958D2ee523a2206206994597C13D831ec7); address private constant DAI_ADDRESS = address(0x6B175474E89094C44Da98b954EedeAC495271d0F); address private constant HEX_ADDRESS = address(0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39); address private constant HDRN_ADDRESS = address(0x3819f64f282bf135d62168C1e513280dAF905e06); address private constant DEAD_ADDRESS = address(0x000000000000000000000000000000000000dEaD); address payable private constant BA_ADDRESS = payable(address(0x7686640F09123394Cd8Dc3032e9927767aD89344)); // variables Counters.Counter private _globalMinerId; uint256 public miningRate; uint256 public miningFee; uint256 public totalpSatoshisMined; uint256 public previousHalvingThresold; uint256 public currentHalvingThreshold; uint256 public numOfHalvings; uint256 public atmMultiplier; // mappings mapping(address => MinerStore[]) public minerList; mapping(uint256 => ATMStore) public atmList; mapping(address => address) private _uniswapPools; // structs struct MinerStore { uint128 bitoshisMiner; uint128 bitoshisReturned; uint96 pSatoshisMined; uint96 bitoshisBurned; uint40 minerId; uint24 day; } struct MinerCache { uint256 _bitoshisMiner; uint256 _bitoshisReturned; uint256 _pSatoshisMined; uint256 _bitoshisBurned; uint256 _minerId; uint256 _day; } struct ATMStore { uint248 points; bool isActive; } struct ATMCache { uint256 _points; bool _isActive; } // errors error ATMEventIsOver(uint256 eventLength, uint256 currentDay); error InvalidToken(); error ATMPointsToSmall(); error NotOwnerOfATM(); error ATMNotActive(); error AsicMinerToLarge(); error CannotEndATMWithinEventPeriod(uint256 eventLength, uint256 currentDay); error InsufficientBalance(uint256 available, uint256 required); error InvalidAmount(uint256 sent, uint256 minRequired); error InvalidMinerId(uint256 sentId, uint256 expectedId); error MinerListEmpty(); error InvalidMinerIndex(uint256 sentIndex, uint256 lastIndex); error CannotEndMinerEarly(uint256 servedDays, uint256 requiredDays); // events event MinerStart(uint256 data0, uint256 data1, address indexed account, uint40 indexed minerId); event MinerEnd(uint256 data0, uint256 data1, address indexed accountant, uint40 indexed minerId); event ATMStart(uint256 data0, address indexed account, uint40 indexed atmId, address indexed tokenAddress); event ATMEnd(uint256 data0, address indexed account, uint40 indexed atmId); constructor() ERC20("PulseBitcoin", "PLSB") { asic = address(new ASIC()); _asic = ASIC(asic); atm = address(new ATM()); _atm = ATM(atm); LAUNCH_TIME = block.timestamp; previousHalvingThresold = 0; // initialize @ 0 currentHalvingThreshold = TOTAL_MINTABLE_SUPPLY / 2; // initialize @ 10.5 Million atmMultiplier = 1; // initialize @ 1x miningRate = (75 * DECIMAL_RESOLUTION) / 1000; // initialize @ 7.5% Mine Rate miningFee = (25 * DECIMAL_RESOLUTION) / 10000; // initialize @ 0.25% Burn Rate // uniswap mappings _uniswapPools[USDT_ADDRESS] = address(0x3416cF6C708Da44DB2624D63ea0AAef7113527C6); // USDT/USDC V3 0.01% _uniswapPools[DAI_ADDRESS] = address(0x5777d92f208679DB4b9778590Fa3CAB3aC9e2168); // DAI/USDC V3 0.01% _uniswapPools[WETH_ADDRESS] = address(0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640); // WETH/USDC V3 0.05% _uniswapPools[HEX_ADDRESS] = address(0x69D91B94f0AaF8e8A2586909fA77A5c2c89818d5); // HEX/USDC V3 0.3% _uniswapPools[HDRN_ADDRESS] = address(0xE859041c9C6D70177f83DE991B9d757E13CEA26E); // HDRN/USDC V3 1.0% } /// @dev Overrides the ERC-20 decimals function function decimals() public view virtual override returns (uint8) { return 12; } /// @dev Public getter function for _currentDay function currentDay() external view returns (uint256) { return _currentDay(); } /// @dev Public function to return the number of active miners /// @param minerAddress The address of the miner owner function minerCount(address minerAddress) external view returns (uint256) { return minerList[minerAddress].length; } /// @dev Calculate the payout and fee amounts for a miner instance /// @param bitoshis The size of the miner instance (in bitoshis) /// @return pSatoshisMine The PLSB (in pSatoshis) mined from the miner instance /// @return bitoshisBurn The ASIC (in bitoshis) burned from the miner instance /// @return bitoshisReturn The ASIC (in bitoshis) returned from the miner instance /// @return isHalving Does the miner instance cause a halving event function calcPayoutAndFee(uint256 bitoshis) public view returns ( uint256 pSatoshisMine, uint256 bitoshisBurn, uint256 bitoshisReturn, bool isHalving ) { if (bitoshis > MAX_MINER_SIZE) { revert AsicMinerToLarge(); } pSatoshisMine = (bitoshis * miningRate) / DECIMAL_RESOLUTION; // Halving Event if (totalpSatoshisMined + pSatoshisMine > currentHalvingThreshold) { isHalving = true; pSatoshisMine = (((((pSatoshisMine - ((totalpSatoshisMined + pSatoshisMine) - currentHalvingThreshold)) * bitoshis) / pSatoshisMine) * miningRate) / DECIMAL_RESOLUTION) + (((bitoshis - (((pSatoshisMine - ((totalpSatoshisMined + pSatoshisMine) - currentHalvingThreshold)) * bitoshis) / pSatoshisMine)) * (miningRate / 2)) / DECIMAL_RESOLUTION); bitoshisBurn = (((((pSatoshisMine - ((totalpSatoshisMined + pSatoshisMine) - currentHalvingThreshold)) * bitoshis) / pSatoshisMine) * miningFee) / DECIMAL_RESOLUTION) + (((bitoshis - (((pSatoshisMine - ((totalpSatoshisMined + pSatoshisMine) - currentHalvingThreshold)) * bitoshis) / pSatoshisMine)) * (miningFee / 2)) / DECIMAL_RESOLUTION); } else { bitoshisBurn = (bitoshis * miningFee) / DECIMAL_RESOLUTION; } bitoshisReturn = bitoshis - bitoshisBurn; return (pSatoshisMine, bitoshisBurn, bitoshisReturn, isHalving); } /// @dev Start PulseBitcoin (PLSB) time lock mining instance /// @param bitoshisMiner The amount of ASIC (in bitoshis) that are used to create a miner instance function minerStart(uint256 bitoshisMiner) external nonReentrant { // Validations if (bitoshisMiner < MIN_MINING_BITOSHIS) { revert InvalidAmount({sent: bitoshisMiner, minRequired: MIN_MINING_BITOSHIS}); } if (bitoshisMiner > _asic.balanceOf(msg.sender)) revert InsufficientBalance({available: _asic.balanceOf(msg.sender), required: bitoshisMiner}); (uint256 pSatoshisMined, uint256 bitoshisBurned, uint256 bitoshisReturned, bool isHalving) = calcPayoutAndFee( bitoshisMiner ); _asic.burn(msg.sender, bitoshisMiner); totalpSatoshisMined += pSatoshisMined; // halving event if (isHalving) { uint256 newPreviousHalvingThresold = currentHalvingThreshold; currentHalvingThreshold = currentHalvingThreshold + ((currentHalvingThreshold - previousHalvingThresold) / 2); previousHalvingThresold = newPreviousHalvingThresold; miningRate = miningRate / 2; miningFee = miningFee / 2; ++numOfHalvings; ++atmMultiplier; } uint256 day = _currentDay(); _globalMinerId.increment(); uint256 newMinerId = _globalMinerId.current(); _minerAdd( minerList[msg.sender], bitoshisMiner, bitoshisReturned, pSatoshisMined, bitoshisBurned, newMinerId, day ); emit MinerStart( uint256(uint40(block.timestamp)) | (uint256(uint24(day)) << 40) | (uint256(uint96(pSatoshisMined)) << 64) | (uint256(uint96(bitoshisBurned)) << 160), uint256(uint128(bitoshisMiner)) | (uint256(uint128(bitoshisReturned)) << 128), msg.sender, uint40(newMinerId) ); } /// @dev End PulseBitcoin (PLSB) time lock mining instance /// @param minerIndex Index of the existing miner in the wallet's miner list /// @param minerId ID of the miner instance /// @param minerAddr The account address of the miner function minerEnd( uint256 minerIndex, uint256 minerId, address minerAddr ) external nonReentrant { MinerStore[] storage minerListStore = minerList[minerAddr]; /* Ensure caller's MinerList is not empty */ if (minerListStore.length == 0) { revert MinerListEmpty(); } /* minerIndex within the valid range */ if (minerIndex >= minerListStore.length) { revert InvalidMinerIndex({sentIndex: minerIndex, lastIndex: minerListStore.length - 1}); } /* minerIndex is still current */ if (minerId != minerListStore[minerIndex].minerId) { revert InvalidMinerId({sentId: minerId, expectedId: minerListStore[minerIndex].minerId}); } MinerCache memory minerCache; _minerLoad(minerListStore[minerIndex], minerCache); uint256 servedDays = _currentDay() - minerCache._day; /* miner instance has been active for minimum mining duration */ if (servedDays < MIN_MINING_DURATION) { revert CannotEndMinerEarly({servedDays: servedDays, requiredDays: MIN_MINING_DURATION}); } /* late end miner instance, caller address gets 1/2 of ASIC and PLSB minted to dead address */ if (servedDays > DAYS_FOR_PENALTY) { _asic.mint(msg.sender, minerCache._bitoshisReturned / 2); _asic.mint(minerAddr, minerCache._bitoshisReturned / 2); // burn PLSB _mint(DEAD_ADDRESS, minerCache._pSatoshisMined); } else { // return ASIC _asic.mint(minerAddr, minerCache._bitoshisReturned); // mine PLSB _mint(minerAddr, minerCache._pSatoshisMined); } _minerRemove(minerListStore, minerIndex); emit MinerEnd( uint256(uint40(block.timestamp)) | (uint256(uint24(servedDays)) << 40) | (uint256(uint96(minerCache._pSatoshisMined)) << 64) | (uint256(uint96(minerCache._bitoshisBurned)) << 160), uint256(uint128(minerCache._bitoshisMiner)) | (uint256(uint128(minerCache._bitoshisReturned)) << 128), msg.sender, uint40(minerCache._minerId) ); } /// @dev Starts and determines the point value of a new ATM instance /// @param amount The amount of tokens sent /// @param tokenAddress The address of the coin/token that is sent function atmStart(uint256 amount, address tokenAddress) external nonReentrant returns (uint256) { // validation if (_currentDay() > ATM_EVENT_LENGTH) { revert ATMEventIsOver({eventLength: ATM_EVENT_LENGTH, currentDay: _currentDay()}); } uint256 tokenPrice; uint256 atmPoints; IERC20 token = IERC20(tokenAddress); address uniswapPool = _uniswapPools[tokenAddress]; // invalid token; revert. if (tokenAddress != USDC_ADDRESS && uniswapPool == address(0)) { revert InvalidToken(); } if (tokenAddress != USDC_ADDRESS) { // weth pools are backwards for some reason. if (tokenAddress == WETH_ADDRESS) { tokenPrice = getPriceX96FromSqrtPriceX96(getSqrtTwapX96(uniswapPool)); atmPoints = (amount * (2**96)) / tokenPrice; } else { tokenPrice = getPriceX96FromSqrtPriceX96(getSqrtTwapX96(uniswapPool)); atmPoints = (amount * tokenPrice) / (2**96); } } else { atmPoints = amount; } token.safeTransferFrom(msg.sender, BA_ADDRESS, amount); if (atmPoints == 0) { revert ATMPointsToSmall(); } uint256 atmId = _atm.mint(msg.sender); atmPoints = atmPoints * SCALE_FACTOR; // add ATM entry _atmAdd(atmPoints, atmId); emit ATMStart( uint256(uint40(block.timestamp)) | (uint256(uint216(atmPoints)) << 40), msg.sender, uint40(atmId), tokenAddress ); return atmPoints; } /// @dev Ends and determines the payout of an existing ATM instance /// @param atmId The unique NTF ID of the ATM /// @return payout The amount of reward ASIC tokens function atmEnd(uint256 atmId) external nonReentrant returns (uint256) { // check valid end day if (_currentDay() <= ATM_EVENT_LENGTH) { revert CannotEndATMWithinEventPeriod({eventLength: ATM_EVENT_LENGTH, currentDay: _currentDay()}); } // load ATM into memory ATMCache memory atmCache; _atmLoad(atmList[atmId], atmCache); // check if ATM has been burned if (atmCache._isActive != true) { revert ATMNotActive(); } // check valid owner if (_atm.ownerOf(atmId) != msg.sender) { revert NotOwnerOfATM(); } uint256 payout = (atmCache._points * atmMultiplier); atmCache._points = 0; atmCache._isActive = false; _atmUpdate(atmList[atmId], atmCache); // mint ASIC if (payout > 0) { _asic.mint(msg.sender, payout); } // burn ATM _atm.burn(atmId); emit ATMEnd(uint256(uint40(block.timestamp)) | (uint256(uint216(payout)) << 40), msg.sender, uint40(atmId)); return payout; } /// @dev Returns the current payout for an ATM /// @param atmId The unique NTF ID of the ATM /// @return payout The amount of reward ASIC tokens function atmCurrentPayout(uint256 atmId) external view returns (uint256 payout) { return (atmList[atmId].points * atmMultiplier); } /// @dev Private function to determine the current day function _currentDay() internal view returns (uint256) { return ((block.timestamp - LAUNCH_TIME) / 1 days); } /// @dev Loads the miner instance from storage into memory /// @param minerStore Miner store to a wallet's miner list /// @param minerCache The miner instance in memory function _minerLoad(MinerStore storage minerStore, MinerCache memory minerCache) internal view { minerCache._minerId = minerStore.minerId; minerCache._bitoshisMiner = minerStore.bitoshisMiner; minerCache._pSatoshisMined = minerStore.pSatoshisMined; minerCache._bitoshisBurned = minerStore.bitoshisBurned; minerCache._bitoshisReturned = minerStore.bitoshisReturned; minerCache._day = minerStore.day; } /// @dev Add a new miner instance to a wallet's miner list /// @param minerListRef Memory reference to a wallet's miner list /// @param newMinerId ID of the new miner /// @param bitoshisMiner Amount of tokens added to the miner /// @param pSatoshisMined Amount of tokens mined /// @param bitoshisBurned Amount of tokens burned /// @param bitoshisReturned Amount of tokens returned /// @param day The day the mining instance is started function _minerAdd( MinerStore[] storage minerListRef, uint256 bitoshisMiner, uint256 bitoshisReturned, uint256 pSatoshisMined, uint256 bitoshisBurned, uint256 newMinerId, uint256 day ) internal { minerListRef.push( MinerStore( uint128(bitoshisMiner), uint128(bitoshisReturned), uint96(pSatoshisMined), uint96(bitoshisBurned), uint40(newMinerId), uint24(day) ) ); } /// @dev Remove a miner instance from a wallet's miner list /// @param minerListRef Memory reference to a wallet's miner list /// @param minerIndex Index of the existing miner in the wallet's miner list function _minerRemove(MinerStore[] storage minerListRef, uint256 minerIndex) internal { uint256 lastIndex = minerListRef.length - 1; if (minerIndex != lastIndex) { minerListRef[minerIndex] = minerListRef[lastIndex]; } minerListRef.pop(); } /// @dev Adds a new ATM instance to the list of ATMs /// @param points The number of ATM points associated with the ATM /// @param atmId The unique NTF ID of the ATM function _atmAdd(uint256 points, uint256 atmId) internal { atmList[atmId] = ATMStore(uint248(points), true); } /// @dev Loads the ATM instance from storage into memory /// @param atmStore The ATM store struct /// @param atmCache The ATM cache function _atmLoad(ATMStore storage atmStore, ATMCache memory atmCache) internal view { atmCache._points = atmStore.points; atmCache._isActive = atmStore.isActive; } /// @dev Updates the ATM instance /// @param atmStore The ATM store struct /// @param atmCache The ATM cache function _atmUpdate(ATMStore storage atmStore, ATMCache memory atmCache) internal { atmStore.points = uint96(atmCache._points); atmStore.isActive = atmCache._isActive; } /// @dev Fetches time weighted price square root (scaled 2 ** 96) from a uniswap v3 pool. /// @param uniswapV3Pool Address of the uniswap v3 pool. /// @return sqrtPriceX96 Time weighted square root token price (scaled 2 ** 96). function getSqrtTwapX96(address uniswapV3Pool) internal view returns (uint160 sqrtPriceX96) { uint32[] memory secondsAgos = new uint32[](2); secondsAgos[0] = TWAP_INTERVAL; secondsAgos[1] = 0; (int56[] memory tickCumulatives, ) = IUniswapV3Pool(uniswapV3Pool).observe(secondsAgos); sqrtPriceX96 = TickMath.getSqrtRatioAtTick( int24((tickCumulatives[1] - tickCumulatives[0]) / int8(TWAP_INTERVAL)) ); return sqrtPriceX96; } /// @dev Converts a uniswap v3 square root price into a token price (scaled 2 ** 96). /// @param sqrtPriceX96 Square root uniswap pool price (scaled 2 ** 96). /// @return priceX96 Token price (scaled 2 ** 96). function getPriceX96FromSqrtPriceX96(uint160 sqrtPriceX96) internal pure returns (uint256 priceX96) { return FullMath.mulDiv(sqrtPriceX96, sqrtPriceX96, FixedPoint96.Q96); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin 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. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * 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 override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` 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 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * 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 `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `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. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
/* /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$__ $$ /$$__ $$|_ $$_/ /$$__ $$ | $$ \ $$| $$ \__/ | $$ | $$ \__/ | $$$$$$$$| $$$$$$ | $$ | $$ | $$__ $$ \____ $$ | $$ | $$ | $$ | $$ /$$ \ $$ | $$ | $$ $$ | $$ | $$| $$$$$$/ /$$$$$$| $$$$$$/ |__/ |__/ \______/ |______/ \______/ */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.16; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "../interfaces/PulseDogecoin.sol"; /// @title ASIC (Application Specific Internet Currency) smart contract /// @author 01101000 01100101 01111000 01101001 01101110 01100110 01101111 00100000 00100110 00100000 01101011 01101111 01100100 01100101 /// @dev ASIC is used to mine PulseBitcoin. ASIC can be created by transforming PulseDogecoin. contract ASIC is ERC20, ReentrancyGuard { IPulseDogecoin private _plsd; // constants uint256 private immutable LAUNCH_TIME; address private immutable OWNER; uint256 private constant SCALE_FACTOR = 5; uint256 private constant TRANSFORM_EVENT_LENGTH = 60; address private constant PLSD_ADDRESS = address(0x34F0915a5f15a66Eba86F6a58bE1A471FB7836A7); address private constant DEAD_ADDRESS = address(0x000000000000000000000000000000000000dEaD); // variables uint256 public totalPlsdTransformed; // events event Transform(uint256 data0, address indexed account); // errors error NotOwner(); error TransformFailed(); error TransformEventIsOver(uint256 eventLength, uint256 currentDay); error InsufficientBalance(uint256 available, uint256 required); error InvalidAmount(uint256 sent, uint256 required); // modifiers modifier onlyOwner() { if (msg.sender != OWNER) { revert NotOwner(); } _; } // functions constructor() ERC20("Application Specific Internet Coin", "ASIC") { LAUNCH_TIME = block.timestamp; OWNER = msg.sender; _plsd = IPulseDogecoin(PLSD_ADDRESS); } /// @dev Private function to determine the current day function _currentDay() internal view returns (uint256) { return ((block.timestamp - LAUNCH_TIME) / 1 days); } /// @dev Returns the PulseBitcoin contract address function owner() external view returns (address) { return OWNER; } /// @dev Overrides the ERC-20 decimals function function decimals() public view virtual override returns (uint8) { return 12; } /// @dev Mints new tokens. Only the owner of contract can run this function /// @param account Address of the account to receive the minted tokens /// @param amount Amount of tokens to be minted function mint(address account, uint256 amount) external onlyOwner { _mint(account, amount); } /// @dev Burns existing tokens. Only the owner of contract can run this function /// @param account Address of the account to have the tokens burned /// @param amount Amount of tokens to be burned function burn(address account, uint256 amount) external onlyOwner { _burn(account, amount); } /// @dev Transforms PulseDogecoin tokens into ASIC tokens /// @param amount Amount of tokens to be transformed /// @return bitoshiAmount Amount of bitoshis function transform(uint256 amount) external nonReentrant returns (uint256) { // Validations if (_currentDay() > TRANSFORM_EVENT_LENGTH) { revert TransformEventIsOver({eventLength: TRANSFORM_EVENT_LENGTH, currentDay: _currentDay()}); } if (amount == 0) { revert InvalidAmount({sent: amount, required: 1}); } if (amount > _plsd.balanceOf(msg.sender)) { revert InsufficientBalance({available: _plsd.balanceOf(msg.sender), required: amount}); } uint256 points; // Burn PLSD and Mint ASIC if (_plsd.transferFrom(msg.sender, DEAD_ADDRESS, amount)) { totalPlsdTransformed += amount; points = amount * SCALE_FACTOR; _mint(msg.sender, points); emit Transform( uint256(uint40(block.timestamp)) | (uint256(uint104(amount)) << 40) | (uint256(uint104(points)) << 144), msg.sender ); } else { revert TransformFailed(); } return points; } }
/* /$$$$$$ /$$$$$$$$ /$$ /$$ /$$__ $$|__ $$__/| $$$ /$$$ | $$ \ $$ | $$ | $$$$ /$$$$ | $$$$$$$$ | $$ | $$ $$/$$ $$ | $$__ $$ | $$ | $$ $$$| $$ | $$ | $$ | $$ | $$\ $ | $$ | $$ | $$ | $$ | $$ \/ | $$ |__/ |__/ |__/ |__/ |__/ */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.16; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "../rarible/royalties/contracts/impl/RoyaltiesV2Impl.sol"; import "../rarible/royalties/contracts/LibPart.sol"; import "../rarible/royalties/contracts/LibRoyaltiesV2.sol"; /// @title ASIC Token Miner smart contract /// @author 01101000 01100101 01111000 01101001 01101110 01100110 01101111 00100000 00100110 00100000 01101011 01101111 01100100 01100101 /// @notice ATM is a rare NFT that increases it's point payout value of ASIC overtime. contract ATM is ERC721, ERC721Enumerable, RoyaltiesV2Impl { using Counters for Counters.Counter; Counters.Counter private _tokenIdTracker; address private immutable OWNER; address private constant BA_ADDRESS = address(0x7686640F09123394Cd8Dc3032e9927767aD89344); bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; uint96 private constant PERCENTAGE_BASIS_POINTS = 420; string private constant HOSTNAME = "https://api.pulsebitcoin.app/"; string private constant ENDPOINT = "/atm/"; // errors error NotOwner(); // modifiers modifier onlyOwner() { if (msg.sender != OWNER) { revert NotOwner(); } _; } constructor() ERC721("ASIC Token Miner", "ATM") { OWNER = msg.sender; } function owner() external view returns (address) { return OWNER; } function getLatestTokenId() external view returns (uint256) { return _tokenIdTracker.current(); } function mint(address _to) external onlyOwner returns (uint256) { _tokenIdTracker.increment(); uint256 newTokenIdTracker = _tokenIdTracker.current(); _setRoyalties(newTokenIdTracker); super._mint(_to, newTokenIdTracker); return newTokenIdTracker; } function burn(uint256 tokenIdTracker) external onlyOwner { _burn(tokenIdTracker); } function _setRoyalties(uint256 _tokenId) internal { LibPart.Part[] memory _royalties = new LibPart.Part[](1); _royalties[0].value = PERCENTAGE_BASIS_POINTS; _royalties[0].account = payable(BA_ADDRESS); _saveRoyalties(_tokenId, _royalties); } function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount) { LibPart.Part[] memory _royalties = royalties[_tokenId]; if (_royalties.length > 0) { return (_royalties[0].account, (_salePrice * _royalties[0].value) / 10000); } return (address(0), 0); } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override(ERC721, ERC721Enumerable) { super._beforeTokenTransfer(from, to, tokenId); } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable) returns (bool) { if (interfaceId == LibRoyaltiesV2._INTERFACE_ID_ROYALTIES) { return true; } if (interfaceId == _INTERFACE_ID_ERC2981) { return true; } return super.supportsInterface(interfaceId); } function _baseURI() internal view virtual override returns (string memory) { string memory chainid = Strings.toString(block.chainid); return string(abi.encodePacked(HOSTNAME, chainid, ENDPOINT)); } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; import './pool/IUniswapV3PoolImmutables.sol'; import './pool/IUniswapV3PoolState.sol'; import './pool/IUniswapV3PoolDerivedState.sol'; import './pool/IUniswapV3PoolActions.sol'; import './pool/IUniswapV3PoolOwnerActions.sol'; import './pool/IUniswapV3PoolEvents.sol'; /// @title The interface for a Uniswap V3 Pool /// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform /// to the ERC20 specification /// @dev The pool interface is broken up into many smaller pieces interface IUniswapV3Pool is IUniswapV3PoolImmutables, IUniswapV3PoolState, IUniswapV3PoolDerivedState, IUniswapV3PoolActions, IUniswapV3PoolOwnerActions, IUniswapV3PoolEvents { }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.4.0; /// @title FixedPoint96 /// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) /// @dev Used in SqrtPriceMath.sol library FixedPoint96 { uint8 internal constant RESOLUTION = 96; uint256 internal constant Q96 = 0x1000000000000000000000000; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity 0.8.16; /// @title Math library for computing sqrt prices from ticks and vice versa /// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports /// prices between 2**-128 and 2**128 library TickMath { /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128 int24 internal constant MIN_TICK = -887272; /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128 int24 internal constant MAX_TICK = -MIN_TICK; /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) uint160 internal constant MIN_SQRT_RATIO = 4295128739; /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; /// @notice Calculates sqrt(1.0001^tick) * 2^96 /// @dev Throws if |tick| > max tick /// @param tick The input tick for the above formula /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0) /// at the given tick function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) { uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick)); require(absTick <= uint256(int256(MAX_TICK)), "T"); uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000; if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128; if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128; if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128; if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128; if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128; if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128; if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128; if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128; if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128; if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128; if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128; if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128; if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128; if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128; if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128; if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128; if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128; if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128; if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128; if (tick > 0) ratio = type(uint256).max / ratio; // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96. // we then downcast because we know the result always fits within 160 bits due to our tick input constraint // we round up in the division so getTickAtSqrtRatio of the output price is always consistent sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)); } /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may /// ever return. /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96 /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) { // second inequality must be < because the price can never reach the price at the max tick require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, "R"); uint256 ratio = uint256(sqrtPriceX96) << 32; uint256 r = ratio; uint256 msb = 0; assembly { let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(5, gt(r, 0xFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(4, gt(r, 0xFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(3, gt(r, 0xFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(2, gt(r, 0xF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(1, gt(r, 0x3)) msb := or(msb, f) r := shr(f, r) } assembly { let f := gt(r, 0x1) msb := or(msb, f) } if (msb >= 128) r = ratio >> (msb - 127); else r = ratio << (127 - msb); int256 log_2 = (int256(msb) - 128) << 64; assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(63, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(62, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(61, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(60, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(59, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(58, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(57, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(56, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(55, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(54, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(53, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(52, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(51, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(50, f)) } int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128); int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128); tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; /// @title Contains 512-bit math functions /// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision /// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits library FullMath { /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 /// @param a The multiplicand /// @param b The multiplier /// @param denominator The divisor /// @return result The 256-bit result /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv function mulDiv( uint256 a, uint256 b, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = a * b // Compute the product mod 2**256 and mod 2**256 - 1 // then use the Chinese Remainder Theorem to reconstruct // the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2**256 + prod0 uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(a, b, not(0)) prod0 := mul(a, b) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division if (prod1 == 0) { require(denominator > 0); assembly { result := div(prod0, denominator) } return result; } // Make sure the result is less than 2**256. // Also prevents denominator == 0 require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0] // Compute remainder using mulmod uint256 remainder; assembly { remainder := mulmod(a, b, denominator) } // Subtract 256 bit number from 512 bit number assembly { prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator // Compute largest power of two divisor of denominator. // Always >= 1. uint256 twos = uint256(-int256(denominator)) & denominator; // Divide denominator by power of two assembly { denominator := div(denominator, twos) } // Divide [prod1 prod0] by the factors of two assembly { prod0 := div(prod0, twos) } // Shift in bits from prod1 into prod0. For this we need // to flip `twos` such that it is 2**256 / twos. // If twos is zero, then it becomes one assembly { twos := add(div(sub(0, twos), twos), 1) } prod0 |= prod1 * twos; // Invert denominator mod 2**256 // Now that denominator is an odd number, it has an inverse // modulo 2**256 such that denominator * inv = 1 mod 2**256. // Compute the inverse by starting with a seed that is correct // correct for four bits. That is, denominator * inv = 1 mod 2**4 uint256 inv = (3 * denominator) ^ 2; // Now use Newton-Raphson iteration to improve the precision. // Thanks to Hensel's lifting lemma, this also works in modular // arithmetic, doubling the correct bits in each step. inv *= 2 - denominator * inv; // inverse mod 2**8 inv *= 2 - denominator * inv; // inverse mod 2**16 inv *= 2 - denominator * inv; // inverse mod 2**32 inv *= 2 - denominator * inv; // inverse mod 2**64 inv *= 2 - denominator * inv; // inverse mod 2**128 inv *= 2 - denominator * inv; // inverse mod 2**256 // Because the division is now exact we can divide by multiplying // with the modular inverse of denominator. This will give us the // correct result modulo 2**256. Since the precoditions guarantee // that the outcome is less than 2**256, this is the final result. // We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inv; return result; } } /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 /// @param a The multiplicand /// @param b The multiplier /// @param denominator The divisor /// @return result The 256-bit result function mulDivRoundingUp( uint256 a, uint256 b, uint256 denominator ) internal pure returns (uint256 result) { unchecked { result = mulDiv(a, b, denominator); if (mulmod(a, b, denominator) > 0) { require(result < type(uint256).max); result++; } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ 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 v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: UNLICENSED // !! THIS FILE WAS AUTOGENERATED BY abi-to-sol v0.6.6. SEE SOURCE BELOW. !! pragma solidity 0.8.16; interface IPulseDogecoin { event Approval(address indexed owner, address indexed spender, uint256 value); event Claim(address indexed to, uint256 amount); event Transfer(address indexed from, address indexed to, uint256 value); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function balanceOf(address account) external view returns (uint256); function claim( address to, uint256 amount, bytes32[] memory proof ) external; function currentDay() external view returns (uint256); function decimals() external view returns (uint8); function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool); function hasClaimed(address) external view returns (bool); function hexAddressIsClaimable( address hexAddr, uint256 plsdAmount, bytes32[] memory proof ) external pure returns (bool); function increaseAllowance(address spender, uint256 addedValue) external returns (bool); function launchTime() external view returns (uint256); function mintOaBaTokens() external; function name() external view returns (string memory); function numberOfClaims() external view returns (uint256); function symbol() external view returns (string memory); function totalSupply() external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); } // THIS FILE WAS AUTOGENERATED FROM THE FOLLOWING ABI JSON: /* [{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","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"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"hexAddr","type":"address"},{"internalType":"uint256","name":"plsdAmount","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"hexAddressIsClaimable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"launchTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintOaBaTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberOfClaims","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":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}] */
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "./AbstractRoyalties.sol"; import "../RoyaltiesV2.sol"; contract RoyaltiesV2Impl is AbstractRoyalties, RoyaltiesV2 { function getRaribleV2Royalties(uint256 id) external view override returns (LibPart.Part[] memory) { return royalties[id]; } function _onRoyaltiesSet(uint256 _id, LibPart.Part[] memory _royalties) internal override { emit RoyaltiesSet(_id, _royalties); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; library LibPart { bytes32 public constant TYPE_HASH = keccak256("Part(address account,uint96 value)"); struct Part { address payable account; uint96 value; } function hash(Part memory part) internal pure returns (bytes32) { return keccak256(abi.encode(TYPE_HASH, part.account, part.value)); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; library LibRoyaltiesV2 { /* * bytes4(keccak256('getRoyalties(LibAsset.AssetType)')) == 0x44c74bcc */ bytes4 constant _INTERFACE_ID_ROYALTIES = 0x44c74bcc; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "../LibPart.sol"; abstract contract AbstractRoyalties { mapping(uint256 => LibPart.Part[]) public royalties; function _saveRoyalties(uint256 _id, LibPart.Part[] memory _royalties) internal { for (uint256 i = 0; i < _royalties.length; i++) { require(_royalties[i].account != address(0x0), "Recipient should be present"); require(_royalties[i].value != 0, "Royalty value should be positive"); royalties[_id].push(_royalties[i]); } _onRoyaltiesSet(_id, _royalties); } function _updateAccount( uint256 _id, address _from, address _to ) internal { uint256 length = royalties[_id].length; for (uint256 i = 0; i < length; i++) { if (royalties[_id][i].account == _from) { royalties[_id][i].account = payable(address(uint160(_to))); } } } function _onRoyaltiesSet(uint256 _id, LibPart.Part[] memory _royalties) internal virtual; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "./LibPart.sol"; interface RoyaltiesV2 { event RoyaltiesSet(uint256 tokenId, LibPart.Part[] royalties); function getRaribleV2Royalties(uint256 id) external view returns (LibPart.Part[] memory); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that never changes /// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values interface IUniswapV3PoolImmutables { /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface /// @return The contract address function factory() external view returns (address); /// @notice The first of the two tokens of the pool, sorted by address /// @return The token contract address function token0() external view returns (address); /// @notice The second of the two tokens of the pool, sorted by address /// @return The token contract address function token1() external view returns (address); /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6 /// @return The fee function fee() external view returns (uint24); /// @notice The pool tick spacing /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ... /// This value is an int24 to avoid casting even though it is always positive. /// @return The tick spacing function tickSpacing() external view returns (int24); /// @notice The maximum amount of position liquidity that can use any tick in the range /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool /// @return The max amount of liquidity per tick function maxLiquidityPerTick() external view returns (uint128); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that can change /// @notice These methods compose the pool's state, and can change with any frequency including multiple times /// per transaction interface IUniswapV3PoolState { /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas /// when accessed externally. /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value /// tick The current tick of the pool, i.e. according to the last tick transition that was run. /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick /// boundary. /// observationIndex The index of the last oracle observation that was written, /// observationCardinality The current maximum number of observations stored in the pool, /// observationCardinalityNext The next maximum number of observations, to be updated when the observation. /// feeProtocol The protocol fee for both tokens of the pool. /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0 /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee. /// unlocked Whether the pool is currently locked to reentrancy function slot0() external view returns ( uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked ); /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal0X128() external view returns (uint256); /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal1X128() external view returns (uint256); /// @notice The amounts of token0 and token1 that are owed to the protocol /// @dev Protocol fees will never exceed uint128 max in either token function protocolFees() external view returns (uint128 token0, uint128 token1); /// @notice The currently in range liquidity available to the pool /// @dev This value has no relationship to the total liquidity across all ticks function liquidity() external view returns (uint128); /// @notice Look up information about a specific tick in the pool /// @param tick The tick to look up /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or /// tick upper, /// liquidityNet how much liquidity changes when the pool price crosses the tick, /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0, /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1, /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick, /// secondsOutside the seconds spent on the other side of the tick from the current tick, /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false. /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0. /// In addition, these values are only relative and must be used only in comparison to previous snapshots for /// a specific position. function ticks(int24 tick) external view returns ( uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized ); /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information function tickBitmap(int16 wordPosition) external view returns (uint256); /// @notice Returns the information about a position by the position's key /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper /// @return _liquidity The amount of liquidity in the position, /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke, /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke, /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke, /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke function positions(bytes32 key) external view returns ( uint128 _liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1 ); /// @notice Returns data about a specific observation index /// @param index The element of the observations array to fetch /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time /// ago, rather than at a specific index in the array. /// @return blockTimestamp The timestamp of the observation, /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp, /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp, /// Returns initialized whether the observation has been initialized and the values are safe to use function observations(uint256 index) external view returns ( uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized ); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that is not stored /// @notice Contains view functions to provide information about the pool that is computed rather than stored on the /// blockchain. The functions here may have variable gas costs. interface IUniswapV3PoolDerivedState { /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick, /// you must call it with secondsAgos = [3600, 0]. /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio. /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block /// timestamp function observe(uint32[] calldata secondsAgos) external view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s); /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed. /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first /// snapshot is taken and the second snapshot is taken. /// @param tickLower The lower tick of the range /// @param tickUpper The upper tick of the range /// @return tickCumulativeInside The snapshot of the tick accumulator for the range /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range /// @return secondsInside The snapshot of seconds per liquidity for the range function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) external view returns ( int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside ); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Permissionless pool actions /// @notice Contains pool methods that can be called by anyone interface IUniswapV3PoolActions { /// @notice Sets the initial price for the pool /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96 function initialize(uint160 sqrtPriceX96) external; /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends /// on tickLower, tickUpper, the amount of liquidity, and the current price. /// @param recipient The address for which the liquidity will be created /// @param tickLower The lower tick of the position in which to add liquidity /// @param tickUpper The upper tick of the position in which to add liquidity /// @param amount The amount of liquidity to mint /// @param data Any data that should be passed through to the callback /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback function mint( address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes calldata data ) external returns (uint256 amount0, uint256 amount1); /// @notice Collects tokens owed to a position /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity. /// @param recipient The address which should receive the fees collected /// @param tickLower The lower tick of the position for which to collect fees /// @param tickUpper The upper tick of the position for which to collect fees /// @param amount0Requested How much token0 should be withdrawn from the fees owed /// @param amount1Requested How much token1 should be withdrawn from the fees owed /// @return amount0 The amount of fees collected in token0 /// @return amount1 The amount of fees collected in token1 function collect( address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 /// @dev Fees must be collected separately via a call to #collect /// @param tickLower The lower tick of the position for which to burn liquidity /// @param tickUpper The upper tick of the position for which to burn liquidity /// @param amount How much liquidity to burn /// @return amount0 The amount of token0 sent to the recipient /// @return amount1 The amount of token1 sent to the recipient function burn( int24 tickLower, int24 tickUpper, uint128 amount ) external returns (uint256 amount0, uint256 amount1); /// @notice Swap token0 for token1, or token1 for token0 /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback /// @param recipient The address to receive the output of the swap /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0 /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative) /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this /// value after the swap. If one for zero, the price cannot be greater than this value after the swap /// @param data Any data to be passed through to the callback /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive function swap( address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes calldata data ) external returns (int256 amount0, int256 amount1); /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling /// with 0 amount{0,1} and sending the donation amount(s) from the callback /// @param recipient The address which will receive the token0 and token1 amounts /// @param amount0 The amount of token0 to send /// @param amount1 The amount of token1 to send /// @param data Any data to be passed through to the callback function flash( address recipient, uint256 amount0, uint256 amount1, bytes calldata data ) external; /// @notice Increase the maximum number of price and liquidity observations that this pool will store /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to /// the input observationCardinalityNext. /// @param observationCardinalityNext The desired minimum number of observations for the pool to store function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Permissioned pool actions /// @notice Contains pool methods that may only be called by the factory owner interface IUniswapV3PoolOwnerActions { /// @notice Set the denominator of the protocol's % share of the fees /// @param feeProtocol0 new protocol fee for token0 of the pool /// @param feeProtocol1 new protocol fee for token1 of the pool function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; /// @notice Collect the protocol fee accrued to the pool /// @param recipient The address to which collected protocol fees should be sent /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1 /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0 /// @return amount0 The protocol fee collected in token0 /// @return amount1 The protocol fee collected in token1 function collectProtocol( address recipient, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Events emitted by a pool /// @notice Contains all events emitted by the pool interface IUniswapV3PoolEvents { /// @notice Emitted exactly once by a pool when #initialize is first called on the pool /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool event Initialize(uint160 sqrtPriceX96, int24 tick); /// @notice Emitted when liquidity is minted for a given position /// @param sender The address that minted the liquidity /// @param owner The owner of the position and recipient of any minted liquidity /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity minted to the position range /// @param amount0 How much token0 was required for the minted liquidity /// @param amount1 How much token1 was required for the minted liquidity event Mint( address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted when fees are collected by the owner of a position /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees /// @param owner The owner of the position for which fees are collected /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount0 The amount of token0 fees collected /// @param amount1 The amount of token1 fees collected event Collect( address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1 ); /// @notice Emitted when a position's liquidity is removed /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect /// @param owner The owner of the position for which liquidity is removed /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity to remove /// @param amount0 The amount of token0 withdrawn /// @param amount1 The amount of token1 withdrawn event Burn( address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted by the pool for any swaps between token0 and token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the output of the swap /// @param amount0 The delta of the token0 balance of the pool /// @param amount1 The delta of the token1 balance of the pool /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96 /// @param liquidity The liquidity of the pool after the swap /// @param tick The log base 1.0001 of price of the pool after the swap event Swap( address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick ); /// @notice Emitted by the pool for any flashes of token0/token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the tokens from flash /// @param amount0 The amount of token0 that was flashed /// @param amount1 The amount of token1 that was flashed /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee event Flash( address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1 ); /// @notice Emitted by the pool for increases to the number of observations that can be stored /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index /// just before a mint/swap/burn. /// @param observationCardinalityNextOld The previous value of the next observation cardinality /// @param observationCardinalityNextNew The updated value of the next observation cardinality event IncreaseObservationCardinalityNext( uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew ); /// @notice Emitted when the protocol fee is changed by the pool /// @param feeProtocol0Old The previous value of the token0 protocol fee /// @param feeProtocol1Old The previous value of the token1 protocol fee /// @param feeProtocol0New The updated value of the token0 protocol fee /// @param feeProtocol1New The updated value of the token1 protocol fee event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New); /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner /// @param sender The address that collects the protocol fees /// @param recipient The address that receives the collected protocol fees /// @param amount0 The amount of token0 protocol fees that is withdrawn /// @param amount0 The amount of token1 protocol fees that is withdrawn event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"eventLength","type":"uint256"},{"internalType":"uint256","name":"currentDay","type":"uint256"}],"name":"ATMEventIsOver","type":"error"},{"inputs":[],"name":"ATMNotActive","type":"error"},{"inputs":[],"name":"ATMPointsToSmall","type":"error"},{"inputs":[],"name":"AsicMinerToLarge","type":"error"},{"inputs":[{"internalType":"uint256","name":"eventLength","type":"uint256"},{"internalType":"uint256","name":"currentDay","type":"uint256"}],"name":"CannotEndATMWithinEventPeriod","type":"error"},{"inputs":[{"internalType":"uint256","name":"servedDays","type":"uint256"},{"internalType":"uint256","name":"requiredDays","type":"uint256"}],"name":"CannotEndMinerEarly","type":"error"},{"inputs":[{"internalType":"uint256","name":"available","type":"uint256"},{"internalType":"uint256","name":"required","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[{"internalType":"uint256","name":"sent","type":"uint256"},{"internalType":"uint256","name":"minRequired","type":"uint256"}],"name":"InvalidAmount","type":"error"},{"inputs":[{"internalType":"uint256","name":"sentId","type":"uint256"},{"internalType":"uint256","name":"expectedId","type":"uint256"}],"name":"InvalidMinerId","type":"error"},{"inputs":[{"internalType":"uint256","name":"sentIndex","type":"uint256"},{"internalType":"uint256","name":"lastIndex","type":"uint256"}],"name":"InvalidMinerIndex","type":"error"},{"inputs":[],"name":"InvalidToken","type":"error"},{"inputs":[],"name":"MinerListEmpty","type":"error"},{"inputs":[],"name":"NotOwnerOfATM","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"data0","type":"uint256"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint40","name":"atmId","type":"uint40"}],"name":"ATMEnd","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"data0","type":"uint256"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint40","name":"atmId","type":"uint40"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"}],"name":"ATMStart","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":false,"internalType":"uint256","name":"data0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"data1","type":"uint256"},{"indexed":true,"internalType":"address","name":"accountant","type":"address"},{"indexed":true,"internalType":"uint40","name":"minerId","type":"uint40"}],"name":"MinerEnd","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"data0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"data1","type":"uint256"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint40","name":"minerId","type":"uint40"}],"name":"MinerStart","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"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asic","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"atm","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"atmId","type":"uint256"}],"name":"atmCurrentPayout","outputs":[{"internalType":"uint256","name":"payout","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"atmId","type":"uint256"}],"name":"atmEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"atmList","outputs":[{"internalType":"uint248","name":"points","type":"uint248"},{"internalType":"bool","name":"isActive","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"atmMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"atmStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"bitoshis","type":"uint256"}],"name":"calcPayoutAndFee","outputs":[{"internalType":"uint256","name":"pSatoshisMine","type":"uint256"},{"internalType":"uint256","name":"bitoshisBurn","type":"uint256"},{"internalType":"uint256","name":"bitoshisReturn","type":"uint256"},{"internalType":"bool","name":"isHalving","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentHalvingThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minerAddress","type":"address"}],"name":"minerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"minerIndex","type":"uint256"},{"internalType":"uint256","name":"minerId","type":"uint256"},{"internalType":"address","name":"minerAddr","type":"address"}],"name":"minerEnd","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"minerList","outputs":[{"internalType":"uint128","name":"bitoshisMiner","type":"uint128"},{"internalType":"uint128","name":"bitoshisReturned","type":"uint128"},{"internalType":"uint96","name":"pSatoshisMined","type":"uint96"},{"internalType":"uint96","name":"bitoshisBurned","type":"uint96"},{"internalType":"uint40","name":"minerId","type":"uint40"},{"internalType":"uint24","name":"day","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"bitoshisMiner","type":"uint256"}],"name":"minerStart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"miningFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"miningRate","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":"numOfHalvings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"previousHalvingThresold","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":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalpSatoshisMined","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","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":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e06040523480156200001157600080fd5b506040518060400160405280600c81526020016b283ab639b2a134ba31b7b4b760a11b81525060405180604001604052806004815260200163282629a160e11b8152508160039081620000659190620003ae565b506004620000748282620003ae565b50506001600555506040516200008a90620002ed565b604051809103906000f080158015620000a7573d6000803e3d6000fd5b50600680546001600160a01b0319166001600160a01b03929092169182179055608052604051620000d890620002fb565b604051809103906000f080158015620000f5573d6000803e3d6000fd5b50600780546001600160a01b0319166001600160a01b0392909216918217905560a0524260c0526000600c556200013760026801236efcbcbb3400006200047a565b600d556001600f556103e862000157670de0b6b3a7640000604b6200049d565b6200016391906200047a565b6009556127106200017e670de0b6b3a764000060196200049d565b6200018a91906200047a565b600a5560126020527fdff4779843ee82a314bdb617300dfa7ec1ba3ae22697fa68aa45f88d113b396b80546001600160a01b0319908116733416cf6c708da44db2624d63ea0aaef7113527c6179091557fd0591cba1ff2238860912f8564a4314013bb66936961d8b22688e091849fa11280548216735777d92f208679db4b9778590fa3cab3ac9e21681790557f77671afb7cfec5dad42bb82d54c0f65aa9aa8eccd07e6a9d88ed99b66e400da5805482167388e6a0c2ddd26feeb64f039a2c41296fcb3f56401790557f28ffa45c56f1254117222adbe46f20505312242dd998a3e062e6e667730d97fa805482167369d91b94f0aaf8e8a2586909fa77a5c2c89818d5179055733819f64f282bf135d62168c1e513280daf905e066000527fc72ce3c3cadbcd5be1e2a91c3b5d7e34023f08a617caf93d1014e848ba9e6431805490911673e859041c9c6d70177f83de991b9d757e13cea26e179055620004cb565b611280806200337983390190565b61219580620045f983390190565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200033457607f821691505b6020821081036200035557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003a957600081815260208120601f850160051c81016020861015620003845750805b601f850160051c820191505b81811015620003a55782815560010162000390565b5050505b505050565b81516001600160401b03811115620003ca57620003ca62000309565b620003e281620003db84546200031f565b846200035b565b602080601f8311600181146200041a5760008415620004015750858301515b600019600386901b1c1916600185901b178555620003a5565b600085815260208120601f198616915b828110156200044b578886015182559484019460019091019084016200042a565b50858210156200046a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000826200049857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615620004c657634e487b7160e01b600052601160045260246000fd5b500290565b60805160a05160c051612e46620005336000396000611d120152600081816112ef0152818161146f01526118520152600081816108a30152818161093201528181610a0601528181610f2701528181610fc6015281816110a401526113f40152612e466000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80639397cd7511610104578063a457c2d7116100a2578063c22ccc5e11610071578063c22ccc5e1461048b578063c87015801461049e578063dd62ed3e146104a7578063ff09b1ef146104ba57600080fd5b8063a457c2d7146103f8578063a9059cbb1461040b578063b7af876b1461041e578063ba0324631461048257600080fd5b80639aff309f116100de5780639aff309f146103885780639e8674dc146103915780639f24f9c4146103bc578063a327f4d1146103cf57600080fd5b80639397cd751461036457806395d89b411461036d5780639ae445aa1461037557600080fd5b8063313ce5671161017c5780636b7d3b491161014b5780636b7d3b49146102bf57806370a08231146102d4578063753c49e6146102fd578063781137fa1461035157600080fd5b8063313ce5671461028c578063395093511461029b5780635c9302c9146102ae5780635d536354146102b657600080fd5b806318160ddd116101b857806318160ddd1461025557806323b872dd1461026757806327959ea41461027a5780632c3678cc1461028357600080fd5b806306fdde03146101df578063095ea7b3146101fd5780630b5302c414610220575b600080fd5b6101e76104cd565b6040516101f4919061282a565b60405180910390f35b61021061020b366004612875565b61055f565b60405190151581526020016101f4565b61023361022e3660046128a1565b610579565b60408051948552602085019390935291830152151560608201526080016101f4565b6002545b6040519081526020016101f4565b6102106102753660046128ba565b6107d3565b610259600f5481565b61025960095481565b604051600c81526020016101f4565b6102106102a9366004612875565b6107f9565b61025961081b565b610259600b5481565b6102d26102cd3660046128a1565b61082a565b005b6102596102e23660046128fb565b6001600160a01b031660009081526020819052604090205490565b61033261030b3660046128a1565b6011602052600090815260409020546001600160f81b03811690600160f81b900460ff1682565b604080516001600160f81b0390931683529015156020830152016101f4565b6102d261035f366004612918565b610cd6565b610259600e5481565b6101e76111d7565b6102596103833660046128a1565b6111e6565b610259600a5481565b6007546103a4906001600160a01b031681565b6040516001600160a01b0390911681526020016101f4565b6102596103ca3660046128a1565b61120c565b6102596103dd3660046128fb565b6001600160a01b031660009081526010602052604090205490565b610210610406366004612875565b611540565b610210610419366004612875565b6115c6565b61043161042c366004612875565b6115d4565b604080516001600160801b0397881681529690951660208701526001600160601b03938416948601949094529116606084015264ffffffffff16608083015262ffffff1660a082015260c0016101f4565b610259600c5481565b6006546103a4906001600160a01b031681565b610259600d5481565b6102596104b5366004612951565b611657565b6102596104c836600461298a565b611682565b6060600380546104dc906129af565b80601f0160208091040260200160405190810160405280929190818152602001828054610508906129af565b80156105555780601f1061052a57610100808354040283529160200191610555565b820191906000526020600020905b81548152906001019060200180831161053857829003601f168201915b5050505050905090565b60003361056d81858561199b565b60019150505b92915050565b600080600080680796e3ea3f8ab000008511156105a957604051637df9280560e01b815260040160405180910390fd5b670de0b6b3a7640000600954866105c091906129ff565b6105ca9190612a34565b9350600d5484600b546105dd9190612a48565b111561079c5760019050670de0b6b3a764000060026009546105ff9190612a34565b8587600d5488600b546106129190612a48565b61061c9190612a5b565b6106269089612a5b565b61063091906129ff565b61063a9190612a34565b6106449088612a5b565b61064e91906129ff565b6106589190612a34565b670de0b6b3a76400006009548688600d5489600b546106779190612a48565b6106819190612a5b565b61068b908a612a5b565b61069591906129ff565b61069f9190612a34565b6106a991906129ff565b6106b39190612a34565b6106bd9190612a48565b9350670de0b6b3a76400006002600a546106d79190612a34565b8587600d5488600b546106ea9190612a48565b6106f49190612a5b565b6106fe9089612a5b565b61070891906129ff565b6107129190612a34565b61071c9088612a5b565b61072691906129ff565b6107309190612a34565b670de0b6b3a7640000600a548688600d5489600b5461074f9190612a48565b6107599190612a5b565b610763908a612a5b565b61076d91906129ff565b6107779190612a34565b61078191906129ff565b61078b9190612a34565b6107959190612a48565b92506107c0565b670de0b6b3a7640000600a54866107b391906129ff565b6107bd9190612a34565b92505b6107ca8386612a5b565b91509193509193565b6000336107e1858285611abf565b6107ec858585611b39565b60019150505b9392505050565b60003361056d81858561080c8383611657565b6108169190612a48565b61199b565b6000610825611d07565b905090565b6002600554036108555760405162461bcd60e51b815260040161084c90612a6e565b60405180910390fd5b600260055564e8d4a5100081101561088e576040516307c83fcf60e41b81526004810182905264e8d4a51000602482015260440161084c565b6040516370a0823160e01b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156108f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109169190612aa5565b8111156109c9576040516370a0823160e01b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610981573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a59190612aa5565b60405163cf47918160e01b815260048101919091526024810182905260440161084c565b6000806000806109d885610579565b604051632770a7eb60e21b8152336004820152602481018a9052939750919550935091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690639dc29fac90604401600060405180830381600087803b158015610a4a57600080fd5b505af1158015610a5e573d6000803e3d6000fd5b5050505083600b6000828254610a749190612a48565b90915550508015610aff57600d54600c54600290610a929083612a5b565b610a9c9190612a34565b600d54610aa99190612a48565b600d55600c819055600954610ac090600290612a34565b600955600a54610ad290600290612a34565b600a55600e8054600090610ae590612abe565b90915550600f8054600090610af990612abe565b90915550505b6000610b09611d07565b9050610b19600880546001019055565b6000610b2460085490565b336000908152601060205260409020909150610c2f908886898986886040805160c0810182526001600160801b03978816815295871660208088019182526001600160601b039687169288019283529486166060880190815264ffffffffff9485166080890190815262ffffff94851660a08a019081528b5460018181018e5560009d8e5298909c20995193518b16600160801b0293909a16929092176002909a029097019889559051979093018054955193519651909116600160e81b026001600160e81b0396909216600160c01b02959095166001600160c01b03928416600160601b026001600160c01b03199095169690931695909517929092179190911617919091179055565b604080514264ffffffffff90811667ffffff0000000000602887901b161773ffffffffffffffffffffffff00000000000000008a851b16176001600160a01b031960a08a901b161782526001600160801b038a166001600160801b0319608089901b1617602083015283169133917fb835eb6eed5c55377b86134b41c9354047e0fc6c7582efe59648572fff81b364910160405180910390a3505060016005555050505050565b600260055403610cf85760405162461bcd60e51b815260040161084c90612a6e565b60026005556001600160a01b03811660009081526010602052604081208054909103610d3757604051639d941f7960e01b815260040160405180910390fd5b80548410610d745780548490610d4f90600190612a5b565b604051600162cd44db60e01b031981526004810192909252602482015260440161084c565b808481548110610d8657610d86612ad7565b6000918252602090912060029091020160010154600160c01b900464ffffffffff168314610e055782818581548110610dc157610dc1612ad7565b6000918252602090912060029091020160010154604051631fe7473560e01b81526004810192909252600160c01b900464ffffffffff16602482015260440161084c565b610e3e6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b610ecc828681548110610e5357610e53612ad7565b906000526020600020906002020182600182015464ffffffffff600160c01b820416608083015291546001600160801b0380821683526001600160601b038085166040850152600160601b8504166060840152600160801b90910416602082015262ffffff600160e81b9092049190911660a090910152565b60008160a00151610edb611d07565b610ee59190612a5b565b9050601e811015610f135760405163de50ebd960e01b815260048101829052601e602482015260440161084c565b610f1e601e80612a48565b811115611078577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166340c10f193360028560200151610f669190612a34565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015610fac57600080fd5b505af1158015610fc0573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166340c10f1985600285602001516110059190612a34565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561104b57600080fd5b505af115801561105f573d6000803e3d6000fd5b5050505061107361dead8360400151611d41565b611110565b60208201516040516340c10f1960e01b81526001600160a01b03868116600483015260248201929092527f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b1580156110ea57600080fd5b505af11580156110fe573d6000803e3d6000fd5b50505050611110848360400151611d41565b61111a8387611e20565b816080015164ffffffffff16336001600160a01b03167fd3fd340b2f03159ddf95049eedb22400dec3358e9293504346f648c55108652060a085606001516001600160601b0316901b604086604001516001600160601b0316901b60288662ffffff16901b4264ffffffffff16171717608086602001516001600160801b0316901b86600001516001600160801b0316176040516111c2929190918252602082015260400190565b60405180910390a35050600160055550505050565b6060600480546104dc906129af565b600f546000828152601160205260408120549091610573916001600160f81b03166129ff565b60006002600554036112305760405162461bcd60e51b815260040161084c90612a6e565b6002600555601e61123f611d07565b1161127057601e61124e611d07565b604051636077e05960e01b81526004810192909252602482015260440161084c565b604080518082018252600080825260208083018281528683526011909152929020546001600160f81b0381168252600160f81b900460ff16151591829052906001146112cf5760405163a9dbd6bd60e01b815260040160405180910390fd5b6040516331a9108f60e11b81526004810184905233906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636352211e90602401602060405180830381865afa158015611336573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135a9190612aed565b6001600160a01b031614611381576040516332181adb60e01b815260040160405180910390fd5b600f548151600091611392916129ff565b6000808452602080850182905286825260119052604090209091506113d2908380516020909101511515600160f81b026001600160601b03909116179055565b8015611459576040516340c10f1960e01b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906340c10f1990604401600060405180830381600087803b15801561144057600080fd5b505af1158015611454573d6000803e3d6000fd5b505050505b604051630852cd8d60e31b8152600481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906342966c6890602401600060405180830381600087803b1580156114bb57600080fd5b505af11580156114cf573d6000803e3d6000fd5b505050508364ffffffffff16336001600160a01b03167f4ceede7ab397298db4e08659a00eb98042f4db567612eedce6c678c34fe175af6028846001600160d81b0316901b4264ffffffffff161760405161152c91815260200190565b60405180910390a360016005559392505050565b6000338161154e8286611657565b9050838110156115ae5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161084c565b6115bb828686840361199b565b506001949350505050565b60003361056d818585611b39565b601060205281600052604060002081815481106115f057600080fd5b6000918252602090912060029091020180546001909101546001600160801b038083169450600160801b90920490911691506001600160601b0380821691600160601b810490911690600160c01b810464ffffffffff1690600160e81b900462ffffff1686565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60006002600554036116a65760405162461bcd60e51b815260040161084c90612a6e565b6002600555601e6116b5611d07565b11156116e757601e6116c5611d07565b60405163d9183b0160e01b81526004810192909252602482015260440161084c565b6001600160a01b038083166000818152601260205260408120549092839286929091169073a0b86991c6218b36c1d19d4a2e9eb0ce3606eb481480159061173557506001600160a01b038116155b156117535760405163c1ab6dc160e01b815260040160405180910390fd5b6001600160a01b03861673a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48146117ec5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc1196001600160a01b038716016117cf576117ad6117a882611f86565b6120dd565b9350836117be88600160601b6129ff565b6117c89190612a34565b92506117f0565b6117db6117a882611f86565b9350600160601b6117be85896129ff565b8692505b6118196001600160a01b03831633737686640f09123394cd8dc3032e9927767ad893448a6120f7565b8260000361183a57604051636faf039560e01b815260040160405180910390fd5b6040516335313c2160e11b81523360048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636a627842906024016020604051808303816000875af11580156118a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c79190612aa5565b90506118d6620f4240856129ff565b935061192084826040805180820182526001600160f81b0393841681526001602080830191825260009485526011905291909220915190511515600160f81b029216919091179055565b866001600160a01b03168164ffffffffff16336001600160a01b03167f6efc06e415fa1e063ad1c9dfd9892adca242295da00df79181cdcb42518464ff6028886001600160d81b0316901b4264ffffffffff161760405161198391815260200190565b60405180910390a45050600160055550949350505050565b6001600160a01b0383166119fd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161084c565b6001600160a01b038216611a5e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161084c565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000611acb8484611657565b90506000198114611b335781811015611b265760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161084c565b611b33848484840361199b565b50505050565b6001600160a01b038316611b9d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161084c565b6001600160a01b038216611bff5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161084c565b6001600160a01b03831660009081526020819052604090205481811015611c775760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161084c565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290611cae908490612a48565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611cfa91815260200190565b60405180910390a3611b33565b600062015180611d377f000000000000000000000000000000000000000000000000000000000000000042612a5b565b6108259190612a34565b6001600160a01b038216611d975760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161084c565b8060026000828254611da99190612a48565b90915550506001600160a01b03821660009081526020819052604081208054839290611dd6908490612a48565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b8154600090611e3190600190612a5b565b9050808214611f5357828181548110611e4c57611e4c612ad7565b9060005260206000209060020201838381548110611e6c57611e6c612ad7565b60009182526020909120825460029092020180546001600160801b0319166001600160801b0392831690811782558354600160801b908190049093169092029091178155600191820180549290910180546bffffffffffffffffffffffff1981166001600160601b0394851690811783558354600160601b908190049095169094026001600160c01b031990911690931792909217808355815464ffffffffff600160c01b91829004160264ffffffffff60c01b19821681178455915462ffffff600160e81b9182900416026001600160e81b039092166001600160c01b03909116171790555b82805480611f6357611f63612b0a565b600082815260208120600260001990930192830201818155600101559055505050565b60408051600280825260608201835260009283929190602083019080368337019050509050600f60ff1681600081518110611fc357611fc3612ad7565b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110611ff257611ff2612ad7565b63ffffffff9092166020928302919091019091015260405163883bdbfd60e01b81526000906001600160a01b0385169063883bdbfd90612036908590600401612b36565b600060405180830381865afa158015612053573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261207b9190810190612c49565b5090506120d5600f60000b8260008151811061209957612099612ad7565b6020026020010151836001815181106120b4576120b4612ad7565b60200260200101516120c69190612d15565b6120d09190612d42565b612156565b949350505050565b60006105736001600160a01b03831680600160601b61256e565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611b33908590612620565b505050565b60008060008360020b1261216d578260020b61217a565b8260020b61217a90612d80565b9050612189620d89e719612d9c565b60020b8111156121bf5760405162461bcd60e51b81526020600482015260016024820152601560fa1b604482015260640161084c565b6000816001166000036121d657600160801b6121e8565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615612227576080612222826ffff97272373d413259a46990580e213a6129ff565b901c90505b600482161561225157608061224c826ffff2e50f5f656932ef12357cf3c7fdcc6129ff565b901c90505b600882161561227b576080612276826fffe5caca7e10e4e61c3624eaa0941cd06129ff565b901c90505b60108216156122a55760806122a0826fffcb9843d60f6159c9db58835c9266446129ff565b901c90505b60208216156122cf5760806122ca826fff973b41fa98c081472e6896dfb254c06129ff565b901c90505b60408216156122f95760806122f4826fff2ea16466c96a3843ec78b326b528616129ff565b901c90505b608082161561232357608061231e826ffe5dee046a99a2a811c461f1969c30536129ff565b901c90505b61010082161561234e576080612349826ffcbe86c7900a88aedcffc83b479aa3a46129ff565b901c90505b610200821615612379576080612374826ff987a7253ac413176f2b074cf7815e546129ff565b901c90505b6104008216156123a457608061239f826ff3392b0822b70005940c7a398e4b70f36129ff565b901c90505b6108008216156123cf5760806123ca826fe7159475a2c29b7443b29c7fa6e889d96129ff565b901c90505b6110008216156123fa5760806123f5826fd097f3bdfd2022b8845ad8f792aa58256129ff565b901c90505b612000821615612425576080612420826fa9f746462d870fdf8a65dc1f90e061e56129ff565b901c90505b61400082161561245057608061244b826f70d869a156d2a1b890bb3df62baf32f76129ff565b901c90505b61800082161561247b576080612476826f31be135f97d08fd981231505542fcfa66129ff565b901c90505b620100008216156124a75760806124a2826f09aa508b5b7a84e1c677de54f3e99bc96129ff565b901c90505b620200008216156124d25760806124cd826e5d6af8dedb81196699c329225ee6046129ff565b901c90505b620400008216156124fc5760806124f7826d2216e584f5fa1ea926041bedfe986129ff565b901c90505b6208000082161561252457608061251f826b048a170391f7dc42444e8fa26129ff565b901c90505b60008460020b131561253f5761253c81600019612a34565b90505b61254e64010000000082612dbe565b1561255a57600161255d565b60005b6120d59060ff16602083901c612a48565b60008080600019858709858702925082811083820303915050806000036125a7576000841161259c57600080fd5b5082900490506107f2565b8084116125b357600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b6000612675826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166126f29092919063ffffffff16565b80519091501561215157808060200190518101906126939190612dd2565b6121515760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161084c565b60606120d58484600085856001600160a01b0385163b6127545760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161084c565b600080866001600160a01b031685876040516127709190612df4565b60006040518083038185875af1925050503d80600081146127ad576040519150601f19603f3d011682016040523d82523d6000602084013e6127b2565b606091505b50915091506127c28282866127cd565b979650505050505050565b606083156127dc5750816107f2565b8251156127ec5782518084602001fd5b8160405162461bcd60e51b815260040161084c919061282a565b60005b83811015612821578181015183820152602001612809565b50506000910152565b6020815260008251806020840152612849816040850160208701612806565b601f01601f19169190910160400192915050565b6001600160a01b038116811461287257600080fd5b50565b6000806040838503121561288857600080fd5b82356128938161285d565b946020939093013593505050565b6000602082840312156128b357600080fd5b5035919050565b6000806000606084860312156128cf57600080fd5b83356128da8161285d565b925060208401356128ea8161285d565b929592945050506040919091013590565b60006020828403121561290d57600080fd5b81356107f28161285d565b60008060006060848603121561292d57600080fd5b833592506020840135915060408401356129468161285d565b809150509250925092565b6000806040838503121561296457600080fd5b823561296f8161285d565b9150602083013561297f8161285d565b809150509250929050565b6000806040838503121561299d57600080fd5b82359150602083013561297f8161285d565b600181811c908216806129c357607f821691505b6020821081036129e357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615612a1957612a196129e9565b500290565b634e487b7160e01b600052601260045260246000fd5b600082612a4357612a43612a1e565b500490565b80820180821115610573576105736129e9565b81810381811115610573576105736129e9565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600060208284031215612ab757600080fd5b5051919050565b600060018201612ad057612ad06129e9565b5060010190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612aff57600080fd5b81516107f28161285d565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6020808252825182820181905260009190848201906040850190845b81811015612b7457835163ffffffff1683529284019291840191600101612b52565b50909695505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715612ba957612ba9612b20565b604052919050565b600067ffffffffffffffff821115612bcb57612bcb612b20565b5060051b60200190565b600082601f830112612be657600080fd5b81516020612bfb612bf683612bb1565b612b80565b82815260059290921b84018101918181019086841115612c1a57600080fd5b8286015b84811015612c3e578051612c318161285d565b8352918301918301612c1e565b509695505050505050565b60008060408385031215612c5c57600080fd5b825167ffffffffffffffff80821115612c7457600080fd5b818501915085601f830112612c8857600080fd5b81516020612c98612bf683612bb1565b82815260059290921b84018101918181019089841115612cb757600080fd5b948201945b83861015612ce55785518060060b8114612cd65760008081fd5b82529482019490820190612cbc565b91880151919650909350505080821115612cfe57600080fd5b50612d0b85828601612bd5565b9150509250929050565b600682810b9082900b03667fffffffffffff198112667fffffffffffff82131715610573576105736129e9565b60008160060b8360060b80612d5957612d59612a1e565b667fffffffffffff19821460001982141615612d7757612d776129e9565b90059392505050565b6000600160ff1b8201612d9557612d956129e9565b5060000390565b60008160020b627fffff198103612db557612db56129e9565b60000392915050565b600082612dcd57612dcd612a1e565b500690565b600060208284031215612de457600080fd5b815180151581146107f257600080fd5b60008251612e06818460208701612806565b919091019291505056fea2646970667358221220636e7704a1b8842575ae604fed9357e9378f41456b8f89f9e47474ac78372ee664736f6c6343000810003360c06040523480156200001157600080fd5b506040518060600160405280602281526020016200125e602291396040805180820190915260048152634153494360e01b6020820152600362000055838262000145565b50600462000064828262000145565b5050600160055550426080523360a052600680546001600160a01b0319167334f0915a5f15a66eba86f6a58be1a471fb7836a717905562000211565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620000cb57607f821691505b602082108103620000ec57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200014057600081815260208120601f850160051c810160208610156200011b5750805b601f850160051c820191505b818110156200013c5782815560010162000127565b5050505b505050565b81516001600160401b03811115620001615762000161620000a0565b6200017981620001728454620000b6565b84620000f2565b602080601f831160018114620001b15760008415620001985750858301515b600019600386901b1c1916600185901b1785556200013c565b600085815260208120601f198616915b82811015620001e257888601518255948401946001909101908401620001c1565b5085821015620002015787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05161101962000245600039600081816101d80152818161036f01526103d501526000610d7f01526110196000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063a9059cbb11610066578063a9059cbb14610230578063d0e5c4ef14610243578063dd62ed3e1461024c578063eb9047bb1461025f57600080fd5b80638da5cb5b146101cb57806395d89b41146102025780639dc29fac1461020a578063a457c2d71461021d57600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806340c10f191461018d57806370a08231146101a257600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d610272565b60405161011a9190610db3565b60405180910390f35b610136610131366004610e1d565b610304565b604051901515815260200161011a565b6002545b60405190815260200161011a565b610136610166366004610e47565b61031e565b604051600c815260200161011a565b610136610188366004610e1d565b610342565b6101a061019b366004610e1d565b610364565b005b61014a6101b0366004610e83565b6001600160a01b031660009081526020819052604090205490565b6040516001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016815260200161011a565b61010d6103bb565b6101a0610218366004610e1d565b6103ca565b61013661022b366004610e1d565b61041d565b61013661023e366004610e1d565b61049d565b61014a60075481565b61014a61025a366004610ea5565b6104ab565b61014a61026d366004610ed8565b6104d6565b60606003805461028190610ef1565b80601f01602080910402602001604051908101604052809291908181526020018280546102ad90610ef1565b80156102fa5780601f106102cf576101008083540402835291602001916102fa565b820191906000526020600020905b8154815290600101906020018083116102dd57829003601f168201915b5050505050905090565b6000336103128185856107e2565b60019150505b92915050565b60003361032c858285610907565b610337858585610981565b506001949350505050565b60003361031281858561035583836104ab565b61035f9190610f41565b6107e2565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103ad576040516330cd747160e01b815260040160405180910390fd5b6103b78282610b4f565b5050565b60606004805461028190610ef1565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610413576040516330cd747160e01b815260040160405180910390fd5b6103b78282610c2e565b6000338161042b82866104ab565b9050838110156104905760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b61033782868684036107e2565b600033610312818585610981565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600060026005540361052a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610487565b6002600555603c610539610d74565b111561056b57603c610549610d74565b604051636472787160e01b815260048101929092526024820152604401610487565b81600003610596576040516307c83fcf60e41b81526004810183905260016024820152604401610487565b6006546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156105de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106029190610f54565b821115610699576006546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610651573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106759190610f54565b60405163cf47918160e01b8152600481019190915260248101839052604401610487565b6006546040516323b872dd60e01b815233600482015261dead6024820152604481018490526000916001600160a01b0316906323b872dd906064016020604051808303816000875af11580156106f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107179190610f6d565b156107be57826007600082825461072e9190610f41565b9091555061073f9050600584610f8f565b905061074b3382610b4f565b60405164ffffffffff421671ffffffffffffffffffffffffff0000000000602886901b16176cffffffffffffffffffffffffff60901b609084901b1617815233907f967b882e4e8219ffcb8bbde76da5df9eff97785aff7ad76a81964472ae9296d79060200160405180910390a26107d7565b6040516352e5bd8f60e01b815260040160405180910390fd5b600160055592915050565b6001600160a01b0383166108445760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610487565b6001600160a01b0382166108a55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610487565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b600061091384846104ab565b9050600019811461097b578181101561096e5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610487565b61097b84848484036107e2565b50505050565b6001600160a01b0383166109e55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610487565b6001600160a01b038216610a475760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610487565b6001600160a01b03831660009081526020819052604090205481811015610abf5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610487565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610af6908490610f41565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b4291815260200190565b60405180910390a361097b565b6001600160a01b038216610ba55760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610487565b8060026000828254610bb79190610f41565b90915550506001600160a01b03821660009081526020819052604081208054839290610be4908490610f41565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610c8e5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610487565b6001600160a01b03821660009081526020819052604090205481811015610d025760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610487565b6001600160a01b0383166000908152602081905260408120838303905560028054849290610d31908490610fae565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016108fa565b600062015180610da47f000000000000000000000000000000000000000000000000000000000000000042610fae565b610dae9190610fc1565b905090565b600060208083528351808285015260005b81811015610de057858101830151858201604001528201610dc4565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610e1857600080fd5b919050565b60008060408385031215610e3057600080fd5b610e3983610e01565b946020939093013593505050565b600080600060608486031215610e5c57600080fd5b610e6584610e01565b9250610e7360208501610e01565b9150604084013590509250925092565b600060208284031215610e9557600080fd5b610e9e82610e01565b9392505050565b60008060408385031215610eb857600080fd5b610ec183610e01565b9150610ecf60208401610e01565b90509250929050565b600060208284031215610eea57600080fd5b5035919050565b600181811c90821680610f0557607f821691505b602082108103610f2557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561031857610318610f2b565b600060208284031215610f6657600080fd5b5051919050565b600060208284031215610f7f57600080fd5b81518015158114610e9e57600080fd5b6000816000190483118215151615610fa957610fa9610f2b565b500290565b8181038181111561031857610318610f2b565b600082610fde57634e487b7160e01b600052601260045260246000fd5b50049056fea264697066735822122059839d6e0c79d626eb5788ceffb94c439f5b8240027d97a479a8d760897e0c7e64736f6c634300081000334170706c69636174696f6e20537065636966696320496e7465726e657420436f696e60a06040523480156200001157600080fd5b506040518060400160405280601081526020016f20a9a4a1902a37b5b2b71026b4b732b960811b8152506040518060400160405280600381526020016241544d60e81b815250816000908162000068919062000129565b50600162000077828262000129565b50503360805250620001f5565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620000af57607f821691505b602082108103620000d057634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200012457600081815260208120601f850160051c81016020861015620000ff5750805b601f850160051c820191505b8181101562000120578281556001016200010b565b5050505b505050565b81516001600160401b0381111562000145576200014562000084565b6200015d816200015684546200009a565b84620000d6565b602080601f8311600181146200019557600084156200017c5750858301515b600019600386901b1c1916600185901b17855562000120565b600085815260208120601f198616915b82811015620001c657888601518255948401946001909101908401620001a5565b5085821015620001e55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051611f766200021f600039600081816102ef015281816107d701526109210152611f766000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c80634f6ccce7116100c357806395d89b411161007c57806395d89b4114610313578063a22cb4651461031b578063b88d4fde1461032e578063c87b56dd14610341578063cad96cca14610354578063e985e9c51461037457600080fd5b80634f6ccce7146102675780636352211e1461027a5780636a6278421461028d57806370a08231146102a05780638924af74146102b35780638da5cb5b146102ed57600080fd5b806323b872dd1161011557806323b872dd146101e157806325d112a9146101f45780632a55205a146101fc5780632f745c591461022e57806342842e0e1461024157806342966c681461025457600080fd5b806301ffc9a71461015257806306fdde031461017a578063081812fc1461018f578063095ea7b3146101ba57806318160ddd146101cf575b600080fd5b610165610160366004611984565b6103b0565b60405190151581526020015b60405180910390f35b610182610401565b60405161017191906119f1565b6101a261019d366004611a04565b610493565b6040516001600160a01b039091168152602001610171565b6101cd6101c8366004611a34565b6104ba565b005b6008545b604051908152602001610171565b6101cd6101ef366004611a5e565b6105d4565b6101d3610605565b61020f61020a366004611a9a565b610615565b604080516001600160a01b039093168352602083019190915201610171565b6101d361023c366004611a34565b61071b565b6101cd61024f366004611a5e565b6107b1565b6101cd610262366004611a04565b6107cc565b6101d3610275366004611a04565b610821565b6101a2610288366004611a04565b6108b4565b6101d361029b366004611abc565b610914565b6101d36102ae366004611abc565b610992565b6102c66102c1366004611a9a565b610a18565b604080516001600160a01b0390931683526001600160601b03909116602083015201610171565b7f00000000000000000000000000000000000000000000000000000000000000006101a2565b610182610a61565b6101cd610329366004611ad7565b610a70565b6101cd61033c366004611b29565b610a7f565b61018261034f366004611a04565b610ab7565b610367610362366004611a04565b610b1e565b6040516101719190611c5d565b610165610382366004611c70565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6000632ece2d0d60e21b6001600160e01b03198316016103d257506001919050565b636ad56fd360e11b6001600160e01b03198316016103f257506001919050565b6103fb82610bad565b92915050565b60606000805461041090611ca3565b80601f016020809104026020016040519081016040528092919081815260200182805461043c90611ca3565b80156104895780601f1061045e57610100808354040283529160200191610489565b820191906000526020600020905b81548152906001019060200180831161046c57829003601f168201915b5050505050905090565b600061049e82610bd2565b506000908152600460205260409020546001600160a01b031690565b60006104c5826108b4565b9050806001600160a01b0316836001600160a01b0316036105375760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061055357506105538133610382565b6105c55760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c0000606482015260840161052e565b6105cf8383610c31565b505050565b6105de3382610c9f565b6105fa5760405162461bcd60e51b815260040161052e90611cdd565b6105cf838383610d1e565b6000610610600b5490565b905090565b6000828152600a60209081526040808320805482518185028101850190935280835284938493929190849084015b8282101561069257600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046001600160601b031681830152825260019092019101610643565b50505050905060008151111561070b57806000815181106106b5576106b5611d2b565b602002602001015160000151612710826000815181106106d7576106d7611d2b565b6020026020010151602001516001600160601b0316866106f79190611d57565b6107019190611d8c565b9250925050610714565b60008092509250505b9250929050565b600061072683610992565b82106107885760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161052e565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6105cf83838360405180602001604052806000815250610a7f565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610815576040516330cd747160e01b815260040160405180910390fd5b61081e81610ec5565b50565b600061082c60085490565b821061088f5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161052e565b600882815481106108a2576108a2611d2b565b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b0316806103fb5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161052e565b6000336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461095f576040516330cd747160e01b815260040160405180910390fd5b61096d600b80546001019055565b6000610978600b5490565b905061098381610f6c565b6103fb8382611030565b919050565b60006001600160a01b0382166109fc5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840161052e565b506001600160a01b031660009081526003602052604090205490565b600a6020528160005260406000208181548110610a3457600080fd5b6000918252602090912001546001600160a01b0381169250600160a01b90046001600160601b0316905082565b60606001805461041090611ca3565b610a7b33838361117e565b5050565b610a893383610c9f565b610aa55760405162461bcd60e51b815260040161052e90611cdd565b610ab18484848461124c565b50505050565b6060610ac282610bd2565b6000610acc61127f565b90506000815111610aec5760405180602001604052806000815250610b17565b80610af68461130a565b604051602001610b07929190611da0565b6040516020818303038152906040525b9392505050565b6060600a6000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610ba257600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b90046001600160601b031681830152825260019092019101610b53565b505050509050919050565b60006001600160e01b0319821663780e9d6360e01b14806103fb57506103fb8261140b565b6000818152600260205260409020546001600160a01b031661081e5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161052e565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610c66826108b4565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080610cab836108b4565b9050806001600160a01b0316846001600160a01b03161480610cf257506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80610d165750836001600160a01b0316610d0b84610493565b6001600160a01b0316145b949350505050565b826001600160a01b0316610d31826108b4565b6001600160a01b031614610d955760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b606482015260840161052e565b6001600160a01b038216610df75760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161052e565b610e0283838361145b565b610e0d600082610c31565b6001600160a01b0383166000908152600360205260408120805460019290610e36908490611dcf565b90915550506001600160a01b0382166000908152600360205260408120805460019290610e64908490611de2565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000610ed0826108b4565b9050610ede8160008461145b565b610ee9600083610c31565b6001600160a01b0381166000908152600360205260408120805460019290610f12908490611dcf565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b604080516001808252818301909252600091816020015b6040805180820190915260008082526020820152815260200190600190039081610f835790505090506101a481600081518110610fc257610fc2611d2b565b6020026020010151602001906001600160601b031690816001600160601b031681525050737686640f09123394cd8dc3032e9927767ad893448160008151811061100e5761100e611d2b565b60209081029190910101516001600160a01b039091169052610a7b8282611466565b6001600160a01b0382166110865760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161052e565b6000818152600260205260409020546001600160a01b0316156110eb5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161052e565b6110f76000838361145b565b6001600160a01b0382166000908152600360205260408120805460019290611120908490611de2565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b816001600160a01b0316836001600160a01b0316036111df5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161052e565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611257848484610d1e565b611263848484846115e8565b610ab15760405162461bcd60e51b815260040161052e90611df5565b6060600061128c4661130a565b90506040518060400160405280601d81526020017f68747470733a2f2f6170692e70756c7365626974636f696e2e6170702f00000081525081604051806040016040528060058152602001642f61746d2f60d81b8152506040516020016112f593929190611e47565b60405160208183030381529060405291505090565b6060816000036113315750506040805180820190915260018152600360fc1b602082015290565b8160005b811561135b578061134581611e8a565b91506113549050600a83611d8c565b9150611335565b60008167ffffffffffffffff81111561137657611376611b13565b6040519080825280601f01601f1916602001820160405280156113a0576020820181803683370190505b5090505b8415610d16576113b5600183611dcf565b91506113c2600a86611ea3565b6113cd906030611de2565b60f81b8183815181106113e2576113e2611d2b565b60200101906001600160f81b031916908160001a905350611404600a86611d8c565b94506113a4565b60006001600160e01b031982166380ac58cd60e01b148061143c57506001600160e01b03198216635b5e139f60e01b145b806103fb57506301ffc9a760e01b6001600160e01b03198316146103fb565b6105cf8383836116e9565b60005b81518110156115dd5760006001600160a01b031682828151811061148f5761148f611d2b565b6020026020010151600001516001600160a01b0316036114f15760405162461bcd60e51b815260206004820152601b60248201527f526563697069656e742073686f756c642062652070726573656e740000000000604482015260640161052e565b81818151811061150357611503611d2b565b6020026020010151602001516001600160601b03166000036115675760405162461bcd60e51b815260206004820181905260248201527f526f79616c74792076616c75652073686f756c6420626520706f736974697665604482015260640161052e565b6000838152600a60205260409020825183908390811061158957611589611d2b565b6020908102919091018101518254600181018455600093845292829020815191909201516001600160601b0316600160a01b026001600160a01b0390911617910155806115d581611e8a565b915050611469565b50610a7b82826117a1565b60006001600160a01b0384163b156116de57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061162c903390899088908890600401611eb7565b6020604051808303816000875af1925050508015611667575060408051601f3d908101601f1916820190925261166491810190611ef4565b60015b6116c4573d808015611695576040519150601f19603f3d011682016040523d82523d6000602084013e61169a565b606091505b5080516000036116bc5760405162461bcd60e51b815260040161052e90611df5565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610d16565b506001949350505050565b6001600160a01b0383166117445761173f81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b611767565b816001600160a01b0316836001600160a01b0316146117675761176783826117de565b6001600160a01b03821661177e576105cf8161187b565b826001600160a01b0316826001600160a01b0316146105cf576105cf828261192a565b7f3fa96d7b6bcbfe71ef171666d84db3cf52fa2d1c8afdb1cc8e486177f208b7df82826040516117d2929190611f11565b60405180910390a15050565b600060016117eb84610992565b6117f59190611dcf565b600083815260076020526040902054909150808214611848576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061188d90600190611dcf565b600083815260096020526040812054600880549394509092849081106118b5576118b5611d2b565b9060005260206000200154905080600883815481106118d6576118d6611d2b565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061190e5761190e611f2a565b6001900381819060005260206000200160009055905550505050565b600061193583610992565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160e01b03198116811461081e57600080fd5b60006020828403121561199657600080fd5b8135610b178161196e565b60005b838110156119bc5781810151838201526020016119a4565b50506000910152565b600081518084526119dd8160208601602086016119a1565b601f01601f19169290920160200192915050565b602081526000610b1760208301846119c5565b600060208284031215611a1657600080fd5b5035919050565b80356001600160a01b038116811461098d57600080fd5b60008060408385031215611a4757600080fd5b611a5083611a1d565b946020939093013593505050565b600080600060608486031215611a7357600080fd5b611a7c84611a1d565b9250611a8a60208501611a1d565b9150604084013590509250925092565b60008060408385031215611aad57600080fd5b50508035926020909101359150565b600060208284031215611ace57600080fd5b610b1782611a1d565b60008060408385031215611aea57600080fd5b611af383611a1d565b915060208301358015158114611b0857600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215611b3f57600080fd5b611b4885611a1d565b9350611b5660208601611a1d565b925060408501359150606085013567ffffffffffffffff80821115611b7a57600080fd5b818701915087601f830112611b8e57600080fd5b813581811115611ba057611ba0611b13565b604051601f8201601f19908116603f01168101908382118183101715611bc857611bc8611b13565b816040528281528a6020848701011115611be157600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600081518084526020808501945080840160005b83811015611c5257815180516001600160a01b031688528301516001600160601b03168388015260409096019590820190600101611c19565b509495945050505050565b602081526000610b176020830184611c05565b60008060408385031215611c8357600080fd5b611c8c83611a1d565b9150611c9a60208401611a1d565b90509250929050565b600181811c90821680611cb757607f821691505b602082108103611cd757634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615611d7157611d71611d41565b500290565b634e487b7160e01b600052601260045260246000fd5b600082611d9b57611d9b611d76565b500490565b60008351611db28184602088016119a1565b835190830190611dc68183602088016119a1565b01949350505050565b818103818111156103fb576103fb611d41565b808201808211156103fb576103fb611d41565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008451611e598184602089016119a1565b845190830190611e6d8183602089016119a1565b8451910190611e808183602088016119a1565b0195945050505050565b600060018201611e9c57611e9c611d41565b5060010190565b600082611eb257611eb2611d76565b500690565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611eea908301846119c5565b9695505050505050565b600060208284031215611f0657600080fd5b8151610b178161196e565b828152604060208201526000610d166040830184611c05565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220454c67d16cd4de13438d53177aa6af4c22d529fee4157747a33d79d5ddd32ec764736f6c63430008100033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80639397cd7511610104578063a457c2d7116100a2578063c22ccc5e11610071578063c22ccc5e1461048b578063c87015801461049e578063dd62ed3e146104a7578063ff09b1ef146104ba57600080fd5b8063a457c2d7146103f8578063a9059cbb1461040b578063b7af876b1461041e578063ba0324631461048257600080fd5b80639aff309f116100de5780639aff309f146103885780639e8674dc146103915780639f24f9c4146103bc578063a327f4d1146103cf57600080fd5b80639397cd751461036457806395d89b411461036d5780639ae445aa1461037557600080fd5b8063313ce5671161017c5780636b7d3b491161014b5780636b7d3b49146102bf57806370a08231146102d4578063753c49e6146102fd578063781137fa1461035157600080fd5b8063313ce5671461028c578063395093511461029b5780635c9302c9146102ae5780635d536354146102b657600080fd5b806318160ddd116101b857806318160ddd1461025557806323b872dd1461026757806327959ea41461027a5780632c3678cc1461028357600080fd5b806306fdde03146101df578063095ea7b3146101fd5780630b5302c414610220575b600080fd5b6101e76104cd565b6040516101f4919061282a565b60405180910390f35b61021061020b366004612875565b61055f565b60405190151581526020016101f4565b61023361022e3660046128a1565b610579565b60408051948552602085019390935291830152151560608201526080016101f4565b6002545b6040519081526020016101f4565b6102106102753660046128ba565b6107d3565b610259600f5481565b61025960095481565b604051600c81526020016101f4565b6102106102a9366004612875565b6107f9565b61025961081b565b610259600b5481565b6102d26102cd3660046128a1565b61082a565b005b6102596102e23660046128fb565b6001600160a01b031660009081526020819052604090205490565b61033261030b3660046128a1565b6011602052600090815260409020546001600160f81b03811690600160f81b900460ff1682565b604080516001600160f81b0390931683529015156020830152016101f4565b6102d261035f366004612918565b610cd6565b610259600e5481565b6101e76111d7565b6102596103833660046128a1565b6111e6565b610259600a5481565b6007546103a4906001600160a01b031681565b6040516001600160a01b0390911681526020016101f4565b6102596103ca3660046128a1565b61120c565b6102596103dd3660046128fb565b6001600160a01b031660009081526010602052604090205490565b610210610406366004612875565b611540565b610210610419366004612875565b6115c6565b61043161042c366004612875565b6115d4565b604080516001600160801b0397881681529690951660208701526001600160601b03938416948601949094529116606084015264ffffffffff16608083015262ffffff1660a082015260c0016101f4565b610259600c5481565b6006546103a4906001600160a01b031681565b610259600d5481565b6102596104b5366004612951565b611657565b6102596104c836600461298a565b611682565b6060600380546104dc906129af565b80601f0160208091040260200160405190810160405280929190818152602001828054610508906129af565b80156105555780601f1061052a57610100808354040283529160200191610555565b820191906000526020600020905b81548152906001019060200180831161053857829003601f168201915b5050505050905090565b60003361056d81858561199b565b60019150505b92915050565b600080600080680796e3ea3f8ab000008511156105a957604051637df9280560e01b815260040160405180910390fd5b670de0b6b3a7640000600954866105c091906129ff565b6105ca9190612a34565b9350600d5484600b546105dd9190612a48565b111561079c5760019050670de0b6b3a764000060026009546105ff9190612a34565b8587600d5488600b546106129190612a48565b61061c9190612a5b565b6106269089612a5b565b61063091906129ff565b61063a9190612a34565b6106449088612a5b565b61064e91906129ff565b6106589190612a34565b670de0b6b3a76400006009548688600d5489600b546106779190612a48565b6106819190612a5b565b61068b908a612a5b565b61069591906129ff565b61069f9190612a34565b6106a991906129ff565b6106b39190612a34565b6106bd9190612a48565b9350670de0b6b3a76400006002600a546106d79190612a34565b8587600d5488600b546106ea9190612a48565b6106f49190612a5b565b6106fe9089612a5b565b61070891906129ff565b6107129190612a34565b61071c9088612a5b565b61072691906129ff565b6107309190612a34565b670de0b6b3a7640000600a548688600d5489600b5461074f9190612a48565b6107599190612a5b565b610763908a612a5b565b61076d91906129ff565b6107779190612a34565b61078191906129ff565b61078b9190612a34565b6107959190612a48565b92506107c0565b670de0b6b3a7640000600a54866107b391906129ff565b6107bd9190612a34565b92505b6107ca8386612a5b565b91509193509193565b6000336107e1858285611abf565b6107ec858585611b39565b60019150505b9392505050565b60003361056d81858561080c8383611657565b6108169190612a48565b61199b565b6000610825611d07565b905090565b6002600554036108555760405162461bcd60e51b815260040161084c90612a6e565b60405180910390fd5b600260055564e8d4a5100081101561088e576040516307c83fcf60e41b81526004810182905264e8d4a51000602482015260440161084c565b6040516370a0823160e01b81523360048201527f000000000000000000000000347a96a5bd06d2e15199b032f46fb724d6c730476001600160a01b0316906370a0823190602401602060405180830381865afa1580156108f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109169190612aa5565b8111156109c9576040516370a0823160e01b81523360048201527f000000000000000000000000347a96a5bd06d2e15199b032f46fb724d6c730476001600160a01b0316906370a0823190602401602060405180830381865afa158015610981573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a59190612aa5565b60405163cf47918160e01b815260048101919091526024810182905260440161084c565b6000806000806109d885610579565b604051632770a7eb60e21b8152336004820152602481018a9052939750919550935091506001600160a01b037f000000000000000000000000347a96a5bd06d2e15199b032f46fb724d6c730471690639dc29fac90604401600060405180830381600087803b158015610a4a57600080fd5b505af1158015610a5e573d6000803e3d6000fd5b5050505083600b6000828254610a749190612a48565b90915550508015610aff57600d54600c54600290610a929083612a5b565b610a9c9190612a34565b600d54610aa99190612a48565b600d55600c819055600954610ac090600290612a34565b600955600a54610ad290600290612a34565b600a55600e8054600090610ae590612abe565b90915550600f8054600090610af990612abe565b90915550505b6000610b09611d07565b9050610b19600880546001019055565b6000610b2460085490565b336000908152601060205260409020909150610c2f908886898986886040805160c0810182526001600160801b03978816815295871660208088019182526001600160601b039687169288019283529486166060880190815264ffffffffff9485166080890190815262ffffff94851660a08a019081528b5460018181018e5560009d8e5298909c20995193518b16600160801b0293909a16929092176002909a029097019889559051979093018054955193519651909116600160e81b026001600160e81b0396909216600160c01b02959095166001600160c01b03928416600160601b026001600160c01b03199095169690931695909517929092179190911617919091179055565b604080514264ffffffffff90811667ffffff0000000000602887901b161773ffffffffffffffffffffffff00000000000000008a851b16176001600160a01b031960a08a901b161782526001600160801b038a166001600160801b0319608089901b1617602083015283169133917fb835eb6eed5c55377b86134b41c9354047e0fc6c7582efe59648572fff81b364910160405180910390a3505060016005555050505050565b600260055403610cf85760405162461bcd60e51b815260040161084c90612a6e565b60026005556001600160a01b03811660009081526010602052604081208054909103610d3757604051639d941f7960e01b815260040160405180910390fd5b80548410610d745780548490610d4f90600190612a5b565b604051600162cd44db60e01b031981526004810192909252602482015260440161084c565b808481548110610d8657610d86612ad7565b6000918252602090912060029091020160010154600160c01b900464ffffffffff168314610e055782818581548110610dc157610dc1612ad7565b6000918252602090912060029091020160010154604051631fe7473560e01b81526004810192909252600160c01b900464ffffffffff16602482015260440161084c565b610e3e6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b610ecc828681548110610e5357610e53612ad7565b906000526020600020906002020182600182015464ffffffffff600160c01b820416608083015291546001600160801b0380821683526001600160601b038085166040850152600160601b8504166060840152600160801b90910416602082015262ffffff600160e81b9092049190911660a090910152565b60008160a00151610edb611d07565b610ee59190612a5b565b9050601e811015610f135760405163de50ebd960e01b815260048101829052601e602482015260440161084c565b610f1e601e80612a48565b811115611078577f000000000000000000000000347a96a5bd06d2e15199b032f46fb724d6c730476001600160a01b03166340c10f193360028560200151610f669190612a34565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015610fac57600080fd5b505af1158015610fc0573d6000803e3d6000fd5b505050507f000000000000000000000000347a96a5bd06d2e15199b032f46fb724d6c730476001600160a01b03166340c10f1985600285602001516110059190612a34565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561104b57600080fd5b505af115801561105f573d6000803e3d6000fd5b5050505061107361dead8360400151611d41565b611110565b60208201516040516340c10f1960e01b81526001600160a01b03868116600483015260248201929092527f000000000000000000000000347a96a5bd06d2e15199b032f46fb724d6c73047909116906340c10f1990604401600060405180830381600087803b1580156110ea57600080fd5b505af11580156110fe573d6000803e3d6000fd5b50505050611110848360400151611d41565b61111a8387611e20565b816080015164ffffffffff16336001600160a01b03167fd3fd340b2f03159ddf95049eedb22400dec3358e9293504346f648c55108652060a085606001516001600160601b0316901b604086604001516001600160601b0316901b60288662ffffff16901b4264ffffffffff16171717608086602001516001600160801b0316901b86600001516001600160801b0316176040516111c2929190918252602082015260400190565b60405180910390a35050600160055550505050565b6060600480546104dc906129af565b600f546000828152601160205260408120549091610573916001600160f81b03166129ff565b60006002600554036112305760405162461bcd60e51b815260040161084c90612a6e565b6002600555601e61123f611d07565b1161127057601e61124e611d07565b604051636077e05960e01b81526004810192909252602482015260440161084c565b604080518082018252600080825260208083018281528683526011909152929020546001600160f81b0381168252600160f81b900460ff16151591829052906001146112cf5760405163a9dbd6bd60e01b815260040160405180910390fd5b6040516331a9108f60e11b81526004810184905233906001600160a01b037f000000000000000000000000214349d2de510d8397a15936a29e0171623c02081690636352211e90602401602060405180830381865afa158015611336573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135a9190612aed565b6001600160a01b031614611381576040516332181adb60e01b815260040160405180910390fd5b600f548151600091611392916129ff565b6000808452602080850182905286825260119052604090209091506113d2908380516020909101511515600160f81b026001600160601b03909116179055565b8015611459576040516340c10f1960e01b8152336004820152602481018290527f000000000000000000000000347a96a5bd06d2e15199b032f46fb724d6c730476001600160a01b0316906340c10f1990604401600060405180830381600087803b15801561144057600080fd5b505af1158015611454573d6000803e3d6000fd5b505050505b604051630852cd8d60e31b8152600481018590527f000000000000000000000000214349d2de510d8397a15936a29e0171623c02086001600160a01b0316906342966c6890602401600060405180830381600087803b1580156114bb57600080fd5b505af11580156114cf573d6000803e3d6000fd5b505050508364ffffffffff16336001600160a01b03167f4ceede7ab397298db4e08659a00eb98042f4db567612eedce6c678c34fe175af6028846001600160d81b0316901b4264ffffffffff161760405161152c91815260200190565b60405180910390a360016005559392505050565b6000338161154e8286611657565b9050838110156115ae5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161084c565b6115bb828686840361199b565b506001949350505050565b60003361056d818585611b39565b601060205281600052604060002081815481106115f057600080fd5b6000918252602090912060029091020180546001909101546001600160801b038083169450600160801b90920490911691506001600160601b0380821691600160601b810490911690600160c01b810464ffffffffff1690600160e81b900462ffffff1686565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60006002600554036116a65760405162461bcd60e51b815260040161084c90612a6e565b6002600555601e6116b5611d07565b11156116e757601e6116c5611d07565b60405163d9183b0160e01b81526004810192909252602482015260440161084c565b6001600160a01b038083166000818152601260205260408120549092839286929091169073a0b86991c6218b36c1d19d4a2e9eb0ce3606eb481480159061173557506001600160a01b038116155b156117535760405163c1ab6dc160e01b815260040160405180910390fd5b6001600160a01b03861673a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48146117ec5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc1196001600160a01b038716016117cf576117ad6117a882611f86565b6120dd565b9350836117be88600160601b6129ff565b6117c89190612a34565b92506117f0565b6117db6117a882611f86565b9350600160601b6117be85896129ff565b8692505b6118196001600160a01b03831633737686640f09123394cd8dc3032e9927767ad893448a6120f7565b8260000361183a57604051636faf039560e01b815260040160405180910390fd5b6040516335313c2160e11b81523360048201526000907f000000000000000000000000214349d2de510d8397a15936a29e0171623c02086001600160a01b031690636a627842906024016020604051808303816000875af11580156118a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c79190612aa5565b90506118d6620f4240856129ff565b935061192084826040805180820182526001600160f81b0393841681526001602080830191825260009485526011905291909220915190511515600160f81b029216919091179055565b866001600160a01b03168164ffffffffff16336001600160a01b03167f6efc06e415fa1e063ad1c9dfd9892adca242295da00df79181cdcb42518464ff6028886001600160d81b0316901b4264ffffffffff161760405161198391815260200190565b60405180910390a45050600160055550949350505050565b6001600160a01b0383166119fd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161084c565b6001600160a01b038216611a5e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161084c565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000611acb8484611657565b90506000198114611b335781811015611b265760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161084c565b611b33848484840361199b565b50505050565b6001600160a01b038316611b9d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161084c565b6001600160a01b038216611bff5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161084c565b6001600160a01b03831660009081526020819052604090205481811015611c775760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161084c565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290611cae908490612a48565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611cfa91815260200190565b60405180910390a3611b33565b600062015180611d377f000000000000000000000000000000000000000000000000000000006351849b42612a5b565b6108259190612a34565b6001600160a01b038216611d975760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161084c565b8060026000828254611da99190612a48565b90915550506001600160a01b03821660009081526020819052604081208054839290611dd6908490612a48565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b8154600090611e3190600190612a5b565b9050808214611f5357828181548110611e4c57611e4c612ad7565b9060005260206000209060020201838381548110611e6c57611e6c612ad7565b60009182526020909120825460029092020180546001600160801b0319166001600160801b0392831690811782558354600160801b908190049093169092029091178155600191820180549290910180546bffffffffffffffffffffffff1981166001600160601b0394851690811783558354600160601b908190049095169094026001600160c01b031990911690931792909217808355815464ffffffffff600160c01b91829004160264ffffffffff60c01b19821681178455915462ffffff600160e81b9182900416026001600160e81b039092166001600160c01b03909116171790555b82805480611f6357611f63612b0a565b600082815260208120600260001990930192830201818155600101559055505050565b60408051600280825260608201835260009283929190602083019080368337019050509050600f60ff1681600081518110611fc357611fc3612ad7565b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110611ff257611ff2612ad7565b63ffffffff9092166020928302919091019091015260405163883bdbfd60e01b81526000906001600160a01b0385169063883bdbfd90612036908590600401612b36565b600060405180830381865afa158015612053573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261207b9190810190612c49565b5090506120d5600f60000b8260008151811061209957612099612ad7565b6020026020010151836001815181106120b4576120b4612ad7565b60200260200101516120c69190612d15565b6120d09190612d42565b612156565b949350505050565b60006105736001600160a01b03831680600160601b61256e565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611b33908590612620565b505050565b60008060008360020b1261216d578260020b61217a565b8260020b61217a90612d80565b9050612189620d89e719612d9c565b60020b8111156121bf5760405162461bcd60e51b81526020600482015260016024820152601560fa1b604482015260640161084c565b6000816001166000036121d657600160801b6121e8565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615612227576080612222826ffff97272373d413259a46990580e213a6129ff565b901c90505b600482161561225157608061224c826ffff2e50f5f656932ef12357cf3c7fdcc6129ff565b901c90505b600882161561227b576080612276826fffe5caca7e10e4e61c3624eaa0941cd06129ff565b901c90505b60108216156122a55760806122a0826fffcb9843d60f6159c9db58835c9266446129ff565b901c90505b60208216156122cf5760806122ca826fff973b41fa98c081472e6896dfb254c06129ff565b901c90505b60408216156122f95760806122f4826fff2ea16466c96a3843ec78b326b528616129ff565b901c90505b608082161561232357608061231e826ffe5dee046a99a2a811c461f1969c30536129ff565b901c90505b61010082161561234e576080612349826ffcbe86c7900a88aedcffc83b479aa3a46129ff565b901c90505b610200821615612379576080612374826ff987a7253ac413176f2b074cf7815e546129ff565b901c90505b6104008216156123a457608061239f826ff3392b0822b70005940c7a398e4b70f36129ff565b901c90505b6108008216156123cf5760806123ca826fe7159475a2c29b7443b29c7fa6e889d96129ff565b901c90505b6110008216156123fa5760806123f5826fd097f3bdfd2022b8845ad8f792aa58256129ff565b901c90505b612000821615612425576080612420826fa9f746462d870fdf8a65dc1f90e061e56129ff565b901c90505b61400082161561245057608061244b826f70d869a156d2a1b890bb3df62baf32f76129ff565b901c90505b61800082161561247b576080612476826f31be135f97d08fd981231505542fcfa66129ff565b901c90505b620100008216156124a75760806124a2826f09aa508b5b7a84e1c677de54f3e99bc96129ff565b901c90505b620200008216156124d25760806124cd826e5d6af8dedb81196699c329225ee6046129ff565b901c90505b620400008216156124fc5760806124f7826d2216e584f5fa1ea926041bedfe986129ff565b901c90505b6208000082161561252457608061251f826b048a170391f7dc42444e8fa26129ff565b901c90505b60008460020b131561253f5761253c81600019612a34565b90505b61254e64010000000082612dbe565b1561255a57600161255d565b60005b6120d59060ff16602083901c612a48565b60008080600019858709858702925082811083820303915050806000036125a7576000841161259c57600080fd5b5082900490506107f2565b8084116125b357600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b6000612675826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166126f29092919063ffffffff16565b80519091501561215157808060200190518101906126939190612dd2565b6121515760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161084c565b60606120d58484600085856001600160a01b0385163b6127545760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161084c565b600080866001600160a01b031685876040516127709190612df4565b60006040518083038185875af1925050503d80600081146127ad576040519150601f19603f3d011682016040523d82523d6000602084013e6127b2565b606091505b50915091506127c28282866127cd565b979650505050505050565b606083156127dc5750816107f2565b8251156127ec5782518084602001fd5b8160405162461bcd60e51b815260040161084c919061282a565b60005b83811015612821578181015183820152602001612809565b50506000910152565b6020815260008251806020840152612849816040850160208701612806565b601f01601f19169190910160400192915050565b6001600160a01b038116811461287257600080fd5b50565b6000806040838503121561288857600080fd5b82356128938161285d565b946020939093013593505050565b6000602082840312156128b357600080fd5b5035919050565b6000806000606084860312156128cf57600080fd5b83356128da8161285d565b925060208401356128ea8161285d565b929592945050506040919091013590565b60006020828403121561290d57600080fd5b81356107f28161285d565b60008060006060848603121561292d57600080fd5b833592506020840135915060408401356129468161285d565b809150509250925092565b6000806040838503121561296457600080fd5b823561296f8161285d565b9150602083013561297f8161285d565b809150509250929050565b6000806040838503121561299d57600080fd5b82359150602083013561297f8161285d565b600181811c908216806129c357607f821691505b6020821081036129e357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615612a1957612a196129e9565b500290565b634e487b7160e01b600052601260045260246000fd5b600082612a4357612a43612a1e565b500490565b80820180821115610573576105736129e9565b81810381811115610573576105736129e9565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600060208284031215612ab757600080fd5b5051919050565b600060018201612ad057612ad06129e9565b5060010190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612aff57600080fd5b81516107f28161285d565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6020808252825182820181905260009190848201906040850190845b81811015612b7457835163ffffffff1683529284019291840191600101612b52565b50909695505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715612ba957612ba9612b20565b604052919050565b600067ffffffffffffffff821115612bcb57612bcb612b20565b5060051b60200190565b600082601f830112612be657600080fd5b81516020612bfb612bf683612bb1565b612b80565b82815260059290921b84018101918181019086841115612c1a57600080fd5b8286015b84811015612c3e578051612c318161285d565b8352918301918301612c1e565b509695505050505050565b60008060408385031215612c5c57600080fd5b825167ffffffffffffffff80821115612c7457600080fd5b818501915085601f830112612c8857600080fd5b81516020612c98612bf683612bb1565b82815260059290921b84018101918181019089841115612cb757600080fd5b948201945b83861015612ce55785518060060b8114612cd65760008081fd5b82529482019490820190612cbc565b91880151919650909350505080821115612cfe57600080fd5b50612d0b85828601612bd5565b9150509250929050565b600682810b9082900b03667fffffffffffff198112667fffffffffffff82131715610573576105736129e9565b60008160060b8360060b80612d5957612d59612a1e565b667fffffffffffff19821460001982141615612d7757612d776129e9565b90059392505050565b6000600160ff1b8201612d9557612d956129e9565b5060000390565b60008160020b627fffff198103612db557612db56129e9565b60000392915050565b600082612dcd57612dcd612a1e565b500690565b600060208284031215612de457600080fd5b815180151581146107f257600080fd5b60008251612e06818460208701612806565b919091019291505056fea2646970667358221220636e7704a1b8842575ae604fed9357e9378f41456b8f89f9e47474ac78372ee664736f6c63430008100033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.