ERC-20
Overview
Max Total Supply
4,969,832.314056035464840788 hPAL
Holders
181
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
124.827894506993591596 hPALValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
HolyPaladinToken
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import "./open-zeppelin/ERC20.sol"; import "./open-zeppelin/interfaces/IERC20.sol"; import "./open-zeppelin/libraries/SafeERC20.sol"; import "./open-zeppelin/utils/Math.sol"; import "./utils/Owner.sol"; import "./utils/SmartWalletChecker.sol"; /** @title Holy Paladin Token (hPAL) contract */ /// @author Paladin contract HolyPaladinToken is ERC20("Holy Paladin Token", "hPAL"), Owner { using SafeERC20 for IERC20; /** @notice Seconds in a Week */ uint256 public constant WEEK = 604800; /** @notice Seconds in a Month */ uint256 public constant MONTH = 2628000; /** @notice 1e18 scale */ uint256 public constant UNIT = 1e18; /** @notice Max BPS value (100%) */ uint256 public constant MAX_BPS = 10000; /** @notice Seconds in a Year */ uint256 public constant ONE_YEAR = 31536000; /** @notice Period to wait before unstaking tokens */ uint256 public constant COOLDOWN_PERIOD = 864000; // 10 days /** @notice Duration of the unstaking period After that period, unstaking cooldown is expired */ uint256 public constant UNSTAKE_PERIOD = 172800; // 2 days /** @notice Period to unlock/re-lock tokens without possibility of punishement */ uint256 public constant UNLOCK_DELAY = 1209600; // 2 weeks /** @notice Minimum duration of a Lock */ uint256 public constant MIN_LOCK_DURATION = 7884000; // 3 months /** @notice Maximum duration of a Lock */ uint256 public constant MAX_LOCK_DURATION = 63072000; // 2 years /** @notice Address of the PAL token */ IERC20 public immutable pal; /** @notice Struct of the Lock of an user */ struct UserLock { // Amount of locked balance uint128 amount; // safe because PAL max supply is 10M tokens // Start of the Lock uint48 startTimestamp; // Duration of the Lock uint48 duration; // BlockNumber for the Lock uint32 fromBlock; // because we want to search by block number } /** @notice Array of all user Locks, ordered from oldest to newest */ mapping(address => UserLock[]) public userLocks; /** @notice Struct tracking the total amount locked */ struct TotalLock { // Total locked Supply uint224 total; // BlockNumber for the last update uint32 fromBlock; } /** @notice Current Total locked Supply */ uint256 public currentTotalLocked; /** @notice List of TotalLocks, ordered from oldest to newest */ TotalLock[] public totalLocks; /** @notice User Cooldowns */ mapping(address => uint256) public cooldowns; /** @notice Checkpoints for users votes */ struct Checkpoint { uint32 fromBlock; uint224 votes; } /** @notice Checkpoints for users Delegates */ struct DelegateCheckpoint { uint32 fromBlock; address delegate; } /** @notice mapping tracking the Delegator for each Delegatee */ mapping(address => address) public delegates; /** @notice List of Vote checkpoints for each user */ mapping(address => Checkpoint[]) public checkpoints; /** @notice List of Delegate checkpoints for each user */ mapping(address => DelegateCheckpoint[]) public delegateCheckpoints; /** @notice Ratio (in BPS) of locked balance applied of penalty for each week over lock end */ uint256 public kickRatioPerWeek = 100; /** @notice Ratio of bonus votes applied on user locked balance */ uint256 public constant bonusLockVoteRatio = 0.5e18; /** @notice Allow emergency withdraws */ bool public emergency = false; /** @notice Address of the vault holding the PAL rewards */ address public immutable rewardsVault; /** @notice Struct of Reward State (global or user) */ struct RewardState { // Reward Index uint128 index; // Timestamp last update for reward state uint128 lastUpdate; } /** @notice Global reward state */ RewardState public globalRewards; /** @notice Amount of rewards distributed per second at the start */ uint256 public immutable startDropPerSecond; /** @notice Amount of rewards distributed per second at the end of the decrease duration */ uint256 public endDropPerSecond; /** @notice Current amount of rewards distriubted per second */ uint256 public currentDropPerSecond; /** @notice Timestamp of last update for currentDropPerSecond */ uint256 public lastDropUpdate; /** @notice Duration (in seconds) of the DropPerSecond decrease period */ uint256 public immutable dropDecreaseDuration; /** @notice Timestamp: start of the DropPerSecond decrease period */ uint256 public immutable startDropTimestamp; /** @notice Reward state for each user */ mapping(address => RewardState) public userRewardStates; /** @notice Current amount of rewards claimable for the user */ mapping(address => uint256) public claimableRewards; /** @notice Base reward multiplier for lock */ uint256 public immutable baseLockBonusRatio; /** @notice Minimum reward multiplier for minimum lock duration */ uint256 public immutable minLockBonusRatio; /** @notice Maximum reward multiplier for maximum duration */ uint256 public immutable maxLockBonusRatio; /** @notice Last updated Bonus Ratio for rewards */ mapping(address => uint256) public userCurrentBonusRatio; /** @notice Value by which user Bonus Ratio decrease each second */ mapping(address => uint256) public userBonusRatioDecrease; /** @notice Address of the currect SmartWalletChecker */ address public smartWalletChecker; /** @notice Address of the future SmartWalletChecker */ address public futureSmartWalletChecker; error NoBalance(); error NullAmount(); error IncorrectAmount(); error AddressZero(); error AvailableBalanceTooLow(); error NoLock(); error EmptyLock(); error InvalidBlockNumber(); error InsufficientCooldown(); error UnstakePeriodExpired(); error AmountExceedBalance(); error DurationOverMax(); error DurationUnderMin(); error SmallerAmount(); error SmallerDuration(); error LockNotExpired(); error LockNotKickable(); error CannotSelfKick(); error NotEmergency(); /** @notice Error raised if contract is turned in emergency mode */ error EmergencyBlock(); error ContractNotAllowed(); // Event /** @notice Emitted when an user stake PAL in the contract */ event Stake(address indexed user, uint256 amount); /** @notice Emitted when an user burns hPAL to withdraw PAL */ event Unstake(address indexed user, uint256 amount); /** @notice Emitted when an user triggers the cooldown period */ event Cooldown(address indexed user); /** @notice Emitted when an user creates or update its Lock */ event Lock(address indexed user, uint256 amount, uint256 indexed startTimestamp, uint256 indexed duration, uint256 totalLocked); /** @notice Emitted when an user exits the Lock */ event Unlock(address indexed user, uint256 amount, uint256 totalLocked); /** @notice Emitted when an user is kicked out of the Lock */ event Kick(address indexed user, address indexed kicker, uint256 amount, uint256 penalty, uint256 totalLocked); /** @notice Emitted when an user claim the rewards */ event ClaimRewards(address indexed user, uint256 amount); /** @notice Emitted when the delegate of an address changes */ event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /** @notice Emitted when the votes of a delegate is updated */ event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance); /** @notice Emitted when un user withdraw through the emergency method */ event EmergencyUnstake(address indexed user, uint256 amount); constructor( address _palToken, address _admin, address _rewardsVault, address _smartWalletChecker, uint256 _startDropPerSecond, uint256 _endDropPerSecond, uint256 _dropDecreaseDuration, uint256 _baseLockBonusRatio, uint256 _minLockBonusRatio, uint256 _maxLockBonusRatio ){ require(_palToken != address(0)); require(_admin != address(0)); require(_rewardsVault != address(0)); pal = IERC20(_palToken); _transferOwnership(_admin); // Set the smartWalletChecker (can be address 0 if we don't want a checker at 1st) smartWalletChecker = _smartWalletChecker; totalLocks.push(TotalLock( 0, safe32(block.number) )); // Set the immutable variables rewardsVault = _rewardsVault; // Prevent future underflow require(_startDropPerSecond >= endDropPerSecond); startDropPerSecond = _startDropPerSecond; endDropPerSecond = _endDropPerSecond; currentDropPerSecond = _startDropPerSecond; dropDecreaseDuration = _dropDecreaseDuration; require(_baseLockBonusRatio != 0); require(_minLockBonusRatio >= _baseLockBonusRatio); require(_maxLockBonusRatio >= _minLockBonusRatio); baseLockBonusRatio = _baseLockBonusRatio; minLockBonusRatio = _minLockBonusRatio; maxLockBonusRatio = _maxLockBonusRatio; // Set all update timestamp as contract creation timestamp globalRewards.lastUpdate = safe128(block.timestamp); lastDropUpdate = block.timestamp; // Start the reward distribution & DropPerSecond decrease startDropTimestamp = block.timestamp; } /** * @notice Deposits PAL & mints hPAL tokens * @param amount amount to stake * @return uint256 : amount of hPAL minted */ function stake(uint256 amount) external returns(uint256) { if(emergency) revert EmergencyBlock(); return _stake(msg.sender, amount); } /** * @notice Updates the Cooldown for the caller */ function cooldown() external { if(emergency) revert EmergencyBlock(); if(balanceOf(msg.sender) == 0) revert NoBalance(); // Set the current timestamp as start of the user cooldown cooldowns[msg.sender] = block.timestamp; emit Cooldown(msg.sender); } /** * @notice Burns hPAL & withdraws PAL * @param amount amount ot withdraw * @param receiver address to receive the withdrawn PAL * @return uint256 : amount withdrawn */ function unstake(uint256 amount, address receiver) external returns(uint256) { if(emergency) revert EmergencyBlock(); return _unstake(msg.sender, amount, receiver); } /** * @notice Locks hPAL for a given duration * @param amount amount of the hPAL balance to lock * @param duration duration of the Lock (in seconds) */ function lock(uint256 amount, uint256 duration) external { if(emergency) revert EmergencyBlock(); //Check if caller is allowed _assertNotContract(msg.sender); // Update user rewards before any change on their balance (staked and locked) _updateUserRewards(msg.sender); if(delegates[msg.sender] == address(0)){ // If the user does not deelegate currently, automatically self-delegate _delegate(msg.sender, msg.sender); } _lock(msg.sender, amount, duration, LockAction.LOCK); } /** * @notice Increase the user current Lock duration (& restarts the Lock) * @param duration new duration for the Lock (in seconds) */ function increaseLockDuration(uint256 duration) external { if(emergency) revert EmergencyBlock(); //Check if caller is allowed _assertNotContract(msg.sender); if(userLocks[msg.sender].length == 0) revert NoLock(); // Find the current Lock UserLock storage currentUserLock = userLocks[msg.sender][userLocks[msg.sender].length - 1]; if(currentUserLock.amount == 0) revert EmptyLock(); // Update user rewards before any change on their balance (staked and locked) _updateUserRewards(msg.sender); // Call the _lock method with the current amount, and the new duration _lock(msg.sender, currentUserLock.amount, duration, LockAction.INCREASE_DURATION); } /** * @notice Increase the amount of hPAL locked for the user * @param amount new amount of hPAL to be locked (in total) */ function increaseLock(uint256 amount) external { if(emergency) revert EmergencyBlock(); //Check if caller is allowed _assertNotContract(msg.sender); if(userLocks[msg.sender].length == 0) revert NoLock(); // Find the current Lock UserLock storage currentUserLock = userLocks[msg.sender][userLocks[msg.sender].length - 1]; if(currentUserLock.amount == 0) revert EmptyLock(); // Update user rewards before any change on their balance (staked and locked) _updateUserRewards(msg.sender); // Call the _lock method with the current duration, and the new amount _lock(msg.sender, amount, currentUserLock.duration, LockAction.INCREASE_AMOUNT); } /** * @notice Removes the user Lock after expiration */ function unlock() external { if(emergency) revert EmergencyBlock(); if(userLocks[msg.sender].length == 0) revert NoLock(); // Update user rewards before any change on their balance (staked and locked) _updateUserRewards(msg.sender); _unlock(msg.sender); } /** * @notice Removes an user Lock if too long after expiry, and applies a penalty * @param user address of the user to kick out of a Lock */ function kick(address user) external { if(emergency) revert EmergencyBlock(); if(msg.sender == user) revert CannotSelfKick(); // Update user rewards before any change on their balance (staked and locked) // For both the user and the kicker _updateUserRewards(user); _updateUserRewards(msg.sender); _kick(user, msg.sender); } /** * @notice Staked PAL to get hPAL, and locks it for the given duration * @param amount amount of PAL to stake and lock * @param duration duration of the Lock (in seconds) * @return uint256 : amount of hPAL minted */ function stakeAndLock(uint256 amount, uint256 duration) external returns(uint256) { if(emergency) revert EmergencyBlock(); //Check if caller is allowed _assertNotContract(msg.sender); // Stake the given amount uint256 stakedAmount = _stake(msg.sender, amount); // No need to update user rewards since it's done through the _stake() method if(delegates[msg.sender] == address(0)){ _delegate(msg.sender, msg.sender); } // And then lock it _lock(msg.sender, amount, duration, LockAction.LOCK); return stakedAmount; } /** * @notice Stake more PAL into hPAL & add them to the current user Lock * @param amount amount of PAL to stake and lock * @param duration duration of the Lock (in seconds) * @return uint256 : amount of hPAL minted */ function stakeAndIncreaseLock(uint256 amount, uint256 duration) external returns(uint256) { if(emergency) revert EmergencyBlock(); //Check if caller is allowed _assertNotContract(msg.sender); if(userLocks[msg.sender].length == 0) revert NoLock(); // Find the current Lock uint256 currentUserLockIndex = userLocks[msg.sender].length - 1; uint256 previousLockAmount = userLocks[msg.sender][currentUserLockIndex].amount; if(previousLockAmount == 0) revert EmptyLock(); // Stake the new amount uint256 stakedAmount = _stake(msg.sender, amount); // No need to update user rewards since it's done through the _stake() method if(delegates[msg.sender] == address(0)){ _delegate(msg.sender, msg.sender); } // Then update the lock with the new increased amount if(duration == userLocks[msg.sender][currentUserLockIndex].duration) { _lock(msg.sender, previousLockAmount + amount, duration, LockAction.INCREASE_AMOUNT); } else { _lock(msg.sender, previousLockAmount + amount, duration, LockAction.LOCK); } return stakedAmount; } /** * @notice Delegates the caller voting power to another address * @param delegatee address to delegate to */ function delegate(address delegatee) external virtual { if(emergency) revert EmergencyBlock(); return _delegate(msg.sender, delegatee); } /** * @notice Claim the given amount of rewards for the caller * @param amount amount to claim */ function claim(uint256 amount) external { if(emergency) revert EmergencyBlock(); // Update user rewards before any change on their balance (staked and locked) _updateUserRewards(msg.sender); if(amount == 0) revert IncorrectAmount(); // Cannot claim more than accrued rewards, but we can use a higher amount to claim all the rewards uint256 claimAmount = amount < claimableRewards[msg.sender] ? amount : claimableRewards[msg.sender]; // Nothing to claim if(claimAmount == 0) return; // remove the claimed amount from the claimable mapping for the user, // and transfer the PAL from the rewardsVault to the user unchecked{ claimableRewards[msg.sender] -= claimAmount; } pal.safeTransferFrom(rewardsVault, msg.sender, claimAmount); emit ClaimRewards(msg.sender, claimAmount); } /** * @notice Updates the global Reward State for the contract */ function updateRewardState() external { if(emergency) revert EmergencyBlock(); _updateRewardState(); } /** * @notice Updates the given user Reward State * @param user address of the user to update */ function updateUserRewardState(address user) external { if(emergency) revert EmergencyBlock(); _updateUserRewards(user); } // --------------- /** * @notice Estimates the new Cooldown for the receiver, based on sender & amount of transfer * @param sender address of the sender * @param receiver address fo the receiver * @param amount amount ot transfer * @return uint256 : new cooldown */ function getNewReceiverCooldown(address sender, address receiver, uint256 amount) external view returns(uint256) { return _getNewReceiverCooldown( cooldowns[sender], amount, receiver, balanceOf(receiver) ); } /** * @notice Get the total number of Locks for an user * @param user address of the user * @return uint256 : total number of Locks */ function getUserLockCount(address user) external view returns(uint256) { return userLocks[user].length; } /** * @notice Get the current user Lock * @param user address of the user * @return UserLock : user Lock */ function getUserLock(address user) external view returns(UserLock memory) { //If the contract is blocked (emergency mode) //Or if the user does not have a Lock yet //Return an empty lock if(emergency || userLocks[user].length == 0) return UserLock(0, 0, 0, 0); return userLocks[user][userLocks[user].length - 1]; } /** * @notice Get the user Lock at a given block (returns empty Lock if not existing / block number too old) * @param user address of the user * @param blockNumber block number * @return UserLock : user past Lock */ function getUserPastLock(address user, uint256 blockNumber) external view returns(UserLock memory) { //If the contract is blocked (emergency mode) //Return an empty lock if(emergency) return UserLock(0, 0, 0, 0); return _getPastLock(user, blockNumber); } /** * @notice Get the total count of TotalLock * @return uint256 : total count */ function getTotalLockLength() external view returns(uint256){ return totalLocks.length; } /** * @notice Get the latest TotalLock * @return TotalLock : current TotalLock */ function getCurrentTotalLock() external view returns(TotalLock memory){ if(emergency) return TotalLock(0, 0); //If the contract is blocked (emergency mode), return an empty totalLocked return totalLocks[totalLocks.length - 1]; } /** * @notice Get the TotalLock at a given block * @param blockNumber block number * @return TotalLock : past TotalLock */ function getPastTotalLock(uint256 blockNumber) external view returns(TotalLock memory) { if(blockNumber >= block.number) revert InvalidBlockNumber(); TotalLock memory emptyLock = TotalLock( 0, 0 ); uint256 nbCheckpoints = totalLocks.length; // last checkpoint check if (totalLocks[nbCheckpoints - 1].fromBlock <= blockNumber) { return totalLocks[nbCheckpoints - 1]; } // no checkpoint old enough if (totalLocks[0].fromBlock > blockNumber) { return emptyLock; } uint256 high = nbCheckpoints - 1; // last checkpoint already checked uint256 low; uint256 mid; while (low < high) { mid = Math.average(low, high); if (totalLocks[mid].fromBlock == blockNumber) { return totalLocks[mid]; } if (totalLocks[mid].fromBlock > blockNumber) { high = mid; } else { low = mid + 1; } } return high == 0 ? emptyLock : totalLocks[high - 1]; } /** * @notice Get the user available balance (staked - locked) * @param user address of the user * @return uint256 : available balance */ function availableBalanceOf(address user) external view returns(uint256) { return _availableBalanceOf(user); } /** * @notice Get all user balances * @param user address of the user * @return staked : staked balance * @return locked : locked balance * @return available : available balance (staked - locked) */ function allBalancesOf(address user) external view returns( uint256 staked, uint256 locked, uint256 available ) { uint256 userBalance = balanceOf(user); // If the contract was blocked (emergency mode) or // If the user has no Lock // then available == staked if(emergency || userLocks[user].length == 0) { return( userBalance, 0, userBalance ); } // If a Lock exists // Then return // total staked balance // locked balance // available balance (staked - locked) uint256 lastUserLockIndex = userLocks[user].length - 1; return( userBalance, uint256(userLocks[user][lastUserLockIndex].amount), userBalance - uint256(userLocks[user][lastUserLockIndex].amount) ); } /** * @notice Get the estimated current amount of rewards claimable by the user * @param user address of the user * @return uint256 : estimated amount of rewards to claim */ function estimateClaimableRewards(address user) external view returns(uint256) { // no rewards for address 0x0 // & in case of emergency mode, show 0 if(emergency || user == address(0)) return 0; // If the user rewards where updated on that block, then return the last updated value RewardState memory currentUserRewardState = userRewardStates[user]; if(currentUserRewardState.lastUpdate == block.timestamp) return claimableRewards[user]; // Get the user current claimable amount uint256 estimatedClaimableRewards = claimableRewards[user]; // Get the last updated reward index uint256 currentRewardIndex = currentUserRewardState.index; if(currentUserRewardState.lastUpdate < block.timestamp){ // If needed, update the reward index currentRewardIndex = _getNewIndex(currentDropPerSecond); } (uint256 accruedRewards,) = _getUserAccruedRewards(user, currentUserRewardState, currentRewardIndex); estimatedClaimableRewards += accruedRewards; return estimatedClaimableRewards; } function rewardIndex() external view returns (uint256) { return globalRewards.index; } function lastRewardUpdate() external view returns (uint256) { return globalRewards.lastUpdate; } function userRewardIndex(address user) external view returns (uint256) { return userRewardStates[user].index; } function rewardsLastUpdate(address user) external view returns (uint256) { return userRewardStates[user].lastUpdate; } /** * @notice Current number of vote checkpoints for the user * @param account address of the user * @return uint256 : number of checkpoints */ function numCheckpoints(address account) external view virtual returns (uint256){ return checkpoints[account].length; } /** * @notice Get the user current voting power (with bonus voting power from the Lock) * @param user address of the user * @return uint256 : user current voting power */ function getCurrentVotes(address user) external view returns (uint256) { if(emergency) return 0; //If emergency mode, do not show voting power uint256 nbCheckpoints = checkpoints[user].length; // current votes with delegation uint256 currentVotes = nbCheckpoints == 0 ? 0 : checkpoints[user][nbCheckpoints - 1].votes; // check if user has a lock uint256 nbLocks = userLocks[user].length; if(nbLocks == 0) return currentVotes; // and if there is a lock, and user self-delegate, add the bonus voting power uint256 lockAmount = userLocks[user][nbLocks - 1].amount; uint256 bonusVotes = delegates[user] == user && userLocks[user][nbLocks - 1].duration >= ONE_YEAR ? (lockAmount * bonusLockVoteRatio) / UNIT : 0; return currentVotes + bonusVotes; } /** * @notice Get the user voting power for a given block (with bonus voting power from the Lock) * @param user address of the user * @param blockNumber block number * @return uint256 : user past voting power */ function getPastVotes(address user, uint256 blockNumber) external view returns(uint256) { // votes with delegation for the given block uint256 votes = _getPastVotes(user, blockNumber); // check if user has a lock at that block UserLock memory pastLock = _getPastLock(user, blockNumber); // and if there is a lock, and user self-delegated, add the bonus voting power uint256 bonusVotes = getPastDelegate(user, blockNumber) == user && pastLock.duration >= ONE_YEAR ? (pastLock.amount * bonusLockVoteRatio) / UNIT : 0; return votes + bonusVotes; } /** * @notice Get the user delegate at a given block * @param account address of the user * @param blockNumber block number * @return address : delegate */ function getPastDelegate(address account, uint256 blockNumber) public view returns (address) { if(blockNumber >= block.number) revert InvalidBlockNumber(); // no checkpoints written uint256 nbCheckpoints = delegateCheckpoints[account].length; if (nbCheckpoints == 0) return address(0); // last checkpoint check if (delegateCheckpoints[account][nbCheckpoints - 1].fromBlock <= blockNumber) { return delegateCheckpoints[account][nbCheckpoints - 1].delegate; } // no checkpoint old enough if (delegateCheckpoints[account][0].fromBlock > blockNumber) { return address(0); } uint256 high = nbCheckpoints - 1; // last checkpoint already checked uint256 low; uint256 mid; while (low < high) { mid = Math.average(low, high); if (delegateCheckpoints[account][mid].fromBlock == blockNumber) { return delegateCheckpoints[account][mid].delegate; } if (delegateCheckpoints[account][mid].fromBlock > blockNumber) { high = mid; } else { low = mid + 1; } } return high == 0 ? address(0) : delegateCheckpoints[account][high - 1].delegate; } // ---------------- // Check if caller is not a smart contract // If it is a contract, check if the contract is allowed by SmartWalletChecker // Revert if not allowed function _assertNotContract(address addr) internal { if(addr != tx.origin){ address checker = smartWalletChecker; if(checker != address(0)){ if(SmartWalletChecker(checker).check(addr)){ return; } revert ContractNotAllowed(); } } } // Find the user available balance (staked - locked) => the balance that can be transfered function _availableBalanceOf(address user) internal view returns(uint256) { if(userLocks[user].length == 0) return balanceOf(user); return balanceOf(user) - uint256(userLocks[user][userLocks[user].length - 1].amount); } // Update dropPerSecond value function _updateDropPerSecond() internal returns (uint256){ // If no more need for monthly updates => decrease duration is over if(block.timestamp > startDropTimestamp + dropDecreaseDuration) { // Set the current DropPerSecond as the end value // Plus allows to be updated if the end value is later updated if(currentDropPerSecond != endDropPerSecond) { currentDropPerSecond = endDropPerSecond; lastDropUpdate = block.timestamp; // Here we set the current timestamp isntead of increasing by a number of month, // since we exceeded the dropDecreaseDuration, and the value could be updated // outside a monthly process } return endDropPerSecond; } if(block.timestamp < lastDropUpdate + MONTH) return currentDropPerSecond; // Update it once a month uint256 dropDecreasePerMonth = ((startDropPerSecond - endDropPerSecond) * MONTH) / (dropDecreaseDuration); uint256 nbMonthEllapsed = (block.timestamp - lastDropUpdate) / MONTH; uint256 dropPerSecondDecrease = dropDecreasePerMonth * nbMonthEllapsed; // We calculate the new dropPerSecond value // We don't want to go under the endDropPerSecond uint256 newDropPerSecond = currentDropPerSecond - dropPerSecondDecrease > endDropPerSecond ? currentDropPerSecond - dropPerSecondDecrease : endDropPerSecond; currentDropPerSecond = newDropPerSecond; lastDropUpdate = lastDropUpdate + (nbMonthEllapsed * MONTH); return newDropPerSecond; } function _getNewIndex(uint256 _currentDropPerSecond) internal view returns (uint256){ // Get the current total Supply uint256 currentTotalSupply = totalSupply(); // and the current global Reward State RewardState memory currentRewardState = globalRewards; // DropPerSeond without any multiplier => the base dropPerSecond for stakers // The multiplier for LockedBalance is applied later, accruing more rewards depending on the Lock. uint256 baseDropPerSecond = (_currentDropPerSecond * UNIT) / maxLockBonusRatio; // total base reward (without multiplier) to be distributed since last update uint256 accruedBaseAmount = (block.timestamp - currentRewardState.lastUpdate) * baseDropPerSecond; // calculate the ratio to add to the index uint256 ratio = currentTotalSupply > 0 ? (accruedBaseAmount * UNIT) / currentTotalSupply : 0; return currentRewardState.index + ratio; } // Update global reward state internal function _updateRewardState() internal returns (uint256){ RewardState storage globalRewardState = globalRewards; if(globalRewardState.lastUpdate == block.timestamp) return globalRewardState.index; // Already updated for this block // Update (if needed) & get the current DropPerSecond uint256 _currentDropPerSecond = _updateDropPerSecond(); // Update the index uint256 newIndex = _getNewIndex(_currentDropPerSecond); globalRewardState.index = safe128(newIndex); globalRewardState.lastUpdate = safe128(block.timestamp); return newIndex; } function _getUserAccruedRewards( address user, RewardState memory userRewardState, uint256 currentRewardsIndex ) internal view returns( uint256 accruedRewards, uint256 newBonusRatio ) { // Find the user last index & current balances uint256 userLastIndex = userRewardState.index; uint256 userStakedBalance = _availableBalanceOf(user); uint256 userLockedBalance; if(userLastIndex != currentRewardsIndex){ if(balanceOf(user) != 0){ // calculate the base rewards for the user staked balance // (using avaialable balance to count the locked balance with the multiplier later in this function) uint256 indexDiff = currentRewardsIndex - userLastIndex; uint256 lockingRewards; if(userLocks[user].length != 0){ // and if an user has a lock, calculate the locked rewards uint256 lastUserLockIndex = userLocks[user].length - 1; // using the locked balance, and the lock duration userLockedBalance = uint256(userLocks[user][lastUserLockIndex].amount); // Check that the user's Lock is not empty if(userLockedBalance != 0 && userLocks[user][lastUserLockIndex].duration != 0){ uint256 previousBonusRatio = userCurrentBonusRatio[user]; if(previousBonusRatio > 0){ uint256 userRatioDecrease = userBonusRatioDecrease[user]; // Find the new multiplier for user: // From the last Ratio, where we remove userBonusRatioDecrease for each second since last update uint256 bonusRatioDecrease = (block.timestamp - userRewardState.lastUpdate) * userRatioDecrease; newBonusRatio = bonusRatioDecrease >= previousBonusRatio ? 0 : previousBonusRatio - bonusRatioDecrease; if(bonusRatioDecrease >= previousBonusRatio){ // Since the last update, bonus ratio decrease under 0 // We count the bonusRatioDecrease as the difference between the last Bonus Ratio and 0 bonusRatioDecrease = previousBonusRatio; // In the case this update is made far after the end of the lock, this method would mean // the user could get a multiplier for longer than expected // We count on the Kick logic to avoid that scenario } // and calculate the locking rewards based on the locked balance & // a ratio based on the rpevious one and the newly calculated one uint256 periodBonusRatio = newBonusRatio + ((userRatioDecrease + bonusRatioDecrease) / 2); lockingRewards = ((userLockedBalance * (indexDiff * periodBonusRatio)) / UNIT) / UNIT; } } } // calculate the staking rewards // sum it up with locking rewards, and return it accruedRewards = ((userStakedBalance * indexDiff) / UNIT) + lockingRewards; } } } // Update user reward state internal function _updateUserRewards(address user) internal { // In emergency mode, do not accrue rewards for users anymore if(emergency) return(); // Update the global reward state and get the latest index uint256 newIndex = _updateRewardState(); // Called for minting & burning, but we don't want to update for address 0x0 if(user == address(0)) return; RewardState storage userRewardState = userRewardStates[user]; if(userRewardState.lastUpdate == block.timestamp) return; // Already updated for this block // Update the user claimable rewards (uint256 accruedRewards, uint256 newBonusRatio) = _getUserAccruedRewards(user, userRewardState, newIndex); claimableRewards[user] += accruedRewards; // Store the new Bonus Ratio userCurrentBonusRatio[user] = newBonusRatio; // and set the current timestamp for last update, and the last used index for the user rewards userRewardState.lastUpdate = safe128(block.timestamp); userRewardState.index = safe128(newIndex); } /** @dev Hook called before any transfer */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual override { if(from != address(0)) { //check must be skipped on minting // Only allow the balance that is unlocked to be transfered if(amount > _availableBalanceOf(from)) revert AvailableBalanceTooLow(); } // Update user rewards before any change on their balance (staked and locked) _updateUserRewards(from); uint256 fromCooldown = cooldowns[from]; //If from is address 0x00...0, cooldown is always 0 if(from != to) { // Update user rewards before any change on their balance (staked and locked) _updateUserRewards(to); // => we don't want a self-transfer to double count new claimable rewards // + no need to update the cooldown on a self-transfer cooldowns[to] = _getNewReceiverCooldown(fromCooldown, amount, to, balanceOf(to)); // If from transfer all of its balance, reset the cooldown to 0 if(balanceOf(from) == amount && fromCooldown != 0) { cooldowns[from] = 0; } } } function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual override { // update delegation for the sender & the receiver if they delegate _moveDelegates(delegates[from], delegates[to], amount); } function _getPastLock(address account, uint256 blockNumber) internal view returns(UserLock memory) { if(blockNumber >= block.number) revert InvalidBlockNumber(); UserLock memory emptyLock = UserLock( 0, 0, 0, 0 ); // no checkpoints written uint256 nbCheckpoints = userLocks[account].length; if (nbCheckpoints == 0) return emptyLock; // last checkpoint check if (userLocks[account][nbCheckpoints - 1].fromBlock <= blockNumber) { return userLocks[account][nbCheckpoints - 1]; } // no checkpoint old enough if (userLocks[account][0].fromBlock > blockNumber) { return emptyLock; } uint256 high = nbCheckpoints - 1; // last checkpoint already checked uint256 low; uint256 mid; while (low < high) { mid = Math.average(low, high); if (userLocks[account][mid].fromBlock == blockNumber) { return userLocks[account][mid]; } if (userLocks[account][mid].fromBlock > blockNumber) { high = mid; } else { low = mid + 1; } } return high == 0 ? emptyLock : userLocks[account][high - 1]; } function _getPastVotes(address account, uint256 blockNumber) internal view returns (uint256){ if(blockNumber >= block.number) revert InvalidBlockNumber(); // no checkpoints written uint256 nbCheckpoints = checkpoints[account].length; if (nbCheckpoints == 0) return 0; // last checkpoint check if (checkpoints[account][nbCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nbCheckpoints - 1].votes; } // no checkpoint old enough if (checkpoints[account][0].fromBlock > blockNumber) return 0; uint256 high = nbCheckpoints - 1; // last checkpoint already checked uint256 low; uint256 mid; while (low < high) { mid = Math.average(low, high); if (checkpoints[account][mid].fromBlock == blockNumber) { return checkpoints[account][mid].votes; } if (checkpoints[account][mid].fromBlock > blockNumber) { high = mid; } else { low = mid + 1; } } return high == 0 ? 0 : checkpoints[account][high - 1].votes; } function _moveDelegates(address from, address to, uint256 amount) internal { if (from != to && amount != 0) { if (from != address(0)) { // Calculate the change in voting power, then write a new checkpoint uint256 nbCheckpoints = checkpoints[from].length; uint256 oldVotes = nbCheckpoints == 0 ? 0 : checkpoints[from][nbCheckpoints - 1].votes; uint256 newVotes = oldVotes - amount; _writeCheckpoint(from, newVotes); emit DelegateVotesChanged(from, oldVotes, newVotes); } if (to != address(0)) { // Calculate the change in voting power, then write a new checkpoint uint256 nbCheckpoints = checkpoints[to].length; uint256 oldVotes = nbCheckpoints == 0 ? 0 : checkpoints[to][nbCheckpoints - 1].votes; uint256 newVotes = oldVotes + amount; _writeCheckpoint(to, newVotes); emit DelegateVotesChanged(to, oldVotes, newVotes); } } } function _writeCheckpoint(address delegatee, uint256 newVotes) internal { // write a new checkpoint for an user uint pos = checkpoints[delegatee].length; if (pos > 0 && checkpoints[delegatee][pos - 1].fromBlock == block.number) { checkpoints[delegatee][pos - 1].votes = safe224(newVotes); } else { uint32 blockNumber = safe32(block.number); checkpoints[delegatee].push(Checkpoint(blockNumber, safe224(newVotes))); } } function _writeUserLock( address user, uint256 amount, uint256 startTimestamp, uint256 duration ) internal { uint256 pos = userLocks[user].length; if (pos > 0 && userLocks[user][pos - 1].fromBlock == block.number) { UserLock storage currentUserLock = userLocks[user][pos - 1]; currentUserLock.amount = safe128(amount); currentUserLock.duration = safe48(duration); currentUserLock.startTimestamp = safe48(startTimestamp); } else { userLocks[user].push( UserLock( safe128(amount), safe48(startTimestamp), safe48(duration), safe32(block.number) ) ); } } function _writeTotalLocked(uint256 newTotalLocked) internal { uint256 pos = totalLocks.length; if (pos > 0 && totalLocks[pos - 1].fromBlock == block.number) { totalLocks[pos - 1].total = safe224(newTotalLocked); } else { totalLocks.push(TotalLock( safe224(newTotalLocked), safe32(block.number) )); } } // ----------------- function _stake(address user, uint256 amount) internal returns(uint256) { if(amount == 0) revert NullAmount(); // No need to update user rewards here since the _mint() method will trigger _beforeTokenTransfer() // Same for the Cooldown update, as it will be handled by _beforeTokenTransfer() _mint(user, amount); //We mint hPAL 1:1 with PAL // Pull the PAL into this contract pal.safeTransferFrom(user, address(this), amount); emit Stake(user, amount); return amount; } function _unstake(address user, uint256 amount, address receiver) internal returns(uint256) { if(amount == 0) revert NullAmount(); if(receiver == address(0)) revert AddressZero(); // Check if user in inside the allowed period base on its cooldown uint256 userCooldown = cooldowns[user]; if(block.timestamp <= (userCooldown + COOLDOWN_PERIOD)) revert InsufficientCooldown(); if(block.timestamp - (userCooldown + COOLDOWN_PERIOD) > UNSTAKE_PERIOD) revert UnstakePeriodExpired(); // No need to update user rewards here since the _burn() method will trigger _beforeTokenTransfer() // Can only unstake was is available, need to unlock before uint256 userAvailableBalance = _availableBalanceOf(user); uint256 burnAmount = amount > userAvailableBalance ? userAvailableBalance : amount; if(burnAmount == 0) revert AvailableBalanceTooLow(); // Burn the hPAL 1:1 with PAL _burn(user, burnAmount); // If all the balance is unstaked, cooldown reset is handled by _beforeTokenTransfer() // Then transfer the PAL to the user pal.safeTransfer(receiver, burnAmount); emit Unstake(user, burnAmount); return burnAmount; } // Get the new cooldown for an user receiving hPAL (mint or transfer), // based on receiver cooldown and sender cooldown // Inspired by stkAAVE cooldown system function _getNewReceiverCooldown( uint256 senderCooldown, uint256 amount, address receiver, uint256 receiverBalance ) internal view returns(uint256) { uint256 receiverCooldown = cooldowns[receiver]; // If amount is 0, there is not transfer, no need to change the receiver cooldown if(amount == 0) return receiverCooldown; // If receiver has no cooldown, no need to set a new one if(receiverCooldown == 0) return 0; uint256 minValidCooldown = block.timestamp - (COOLDOWN_PERIOD + UNSTAKE_PERIOD); // If last receiver cooldown is expired, set it back to 0 if(receiverCooldown < minValidCooldown) return 0; // In case the given senderCooldown is 0 (sender has no cooldown, or minting) uint256 _senderCooldown = senderCooldown < minValidCooldown ? block.timestamp : senderCooldown; // If the sender cooldown is better, we keep the receiver cooldown if(_senderCooldown < receiverCooldown) return receiverCooldown; // Default new cooldown, weighted average based on the amount and the previous balance return ((amount * _senderCooldown) + (receiverBalance * receiverCooldown)) / (amount + receiverBalance); } enum LockAction { LOCK, INCREASE_AMOUNT, INCREASE_DURATION } function _lock(address user, uint256 amount, uint256 duration, LockAction action) internal { require(user != address(0)); //Never supposed to happen, but security check if(amount == 0) revert NullAmount(); uint256 userBalance = balanceOf(user); if(amount > userBalance) revert AmountExceedBalance(); if(duration < MIN_LOCK_DURATION) revert DurationUnderMin(); if(duration > MAX_LOCK_DURATION) revert DurationOverMax(); if(userLocks[user].length == 0){ //User 1st Lock userLocks[user].push(UserLock( safe128(amount), safe48(block.timestamp), safe48(duration), safe32(block.number) )); // find the reward multiplier based on the user lock duration uint256 durationRatio = ((duration - MIN_LOCK_DURATION) * UNIT) / (MAX_LOCK_DURATION - MIN_LOCK_DURATION); uint256 userLockBonusRatio = minLockBonusRatio + (((maxLockBonusRatio - minLockBonusRatio) * durationRatio) / UNIT); userCurrentBonusRatio[user] = userLockBonusRatio; userBonusRatioDecrease[user] = (userLockBonusRatio - baseLockBonusRatio) / duration; // Update total locked supply currentTotalLocked += amount; _writeTotalLocked(currentTotalLocked); emit Lock(user, amount, block.timestamp, duration, currentTotalLocked); } else { // Get the current user Lock UserLock memory currentUserLock = userLocks[user][userLocks[user].length - 1]; // Calculate the end of the user current lock uint256 userCurrentLockEnd = currentUserLock.startTimestamp + currentUserLock.duration; uint256 startTimestamp = block.timestamp; if(currentUserLock.amount == 0 || userCurrentLockEnd < block.timestamp) { // User locked, and then unlocked // or user lock expired _writeUserLock(user, amount, startTimestamp, duration); } else { // Update of the current Lock : increase amount or increase duration // or renew with the same parameters, but starting at the current timestamp if(amount < currentUserLock.amount) revert SmallerAmount(); if(duration < currentUserLock.duration) revert SmallerDuration(); // If the method is called with INCREASE_AMOUNT, then we don't change the startTimestamp of the Lock startTimestamp = action == LockAction.INCREASE_AMOUNT ? currentUserLock.startTimestamp : startTimestamp; _writeUserLock(user, amount, startTimestamp, duration); } // If the duration is updated, re-calculate the multiplier for the Lock if(action != LockAction.INCREASE_AMOUNT){ // find the reward multiplier based on the user lock duration uint256 durationRatio = ((duration - MIN_LOCK_DURATION) * UNIT) / (MAX_LOCK_DURATION - MIN_LOCK_DURATION); uint256 userLockBonusRatio = minLockBonusRatio + (((maxLockBonusRatio - minLockBonusRatio) * durationRatio) / UNIT); userCurrentBonusRatio[user] = userLockBonusRatio; userBonusRatioDecrease[user] = (userLockBonusRatio - baseLockBonusRatio) / duration; } // Update total locked supply if(amount != currentUserLock.amount){ if(currentUserLock.amount != 0) currentTotalLocked -= currentUserLock.amount; currentTotalLocked += amount; _writeTotalLocked(currentTotalLocked); } emit Lock(user, amount, startTimestamp, duration, currentTotalLocked); } } function _unlock(address user) internal { require(user != address(0)); //Never supposed to happen, but security check if(userLocks[user].length == 0) revert NoLock(); // Get the user current Lock // And calculate the end of the Lock UserLock memory currentUserLock = userLocks[user][userLocks[user].length - 1]; uint256 userCurrentLockEnd = currentUserLock.startTimestamp + currentUserLock.duration; if(block.timestamp <= userCurrentLockEnd) revert LockNotExpired(); if(currentUserLock.amount == 0) revert EmptyLock(); // Remove amount from total locked supply currentTotalLocked -= currentUserLock.amount; _writeTotalLocked(currentTotalLocked); // Remove the bonus multiplier userCurrentBonusRatio[user] = 0; userBonusRatioDecrease[user] = 0; // Set the user Lock as an empty Lock _writeUserLock(user, 0, block.timestamp, 0); emit Unlock(user, currentUserLock.amount, currentTotalLocked); } function _kick(address user, address kicker) internal { if(user == address(0) || kicker == address(0)) revert AddressZero(); if(userLocks[user].length == 0) revert NoLock(); // Get the user to kick current Lock // and calculate the end of the Lock UserLock memory currentUserLock = userLocks[user][userLocks[user].length - 1]; uint256 userCurrentLockEnd = currentUserLock.startTimestamp + currentUserLock.duration; if(block.timestamp <= userCurrentLockEnd) revert LockNotExpired(); if(currentUserLock.amount == 0) revert EmptyLock(); if(block.timestamp <= userCurrentLockEnd + UNLOCK_DELAY) revert LockNotKickable(); // Remove amount from total locked supply currentTotalLocked -= currentUserLock.amount; _writeTotalLocked(currentTotalLocked); // Set an empty Lock for the user _writeUserLock(user, 0, block.timestamp, 0); // Remove the bonus multiplier userCurrentBonusRatio[user] = 0; userBonusRatioDecrease[user] = 0; // Calculate the penalty for the Lock uint256 nbWeeksOverLockTime = (block.timestamp - userCurrentLockEnd) / WEEK; uint256 penaltyPercent = nbWeeksOverLockTime * kickRatioPerWeek; uint256 penaltyAmount = penaltyPercent >= MAX_BPS ? currentUserLock.amount : (currentUserLock.amount * penaltyPercent) / MAX_BPS; // Send penalties to the kicker _transfer(user, kicker, penaltyAmount); emit Kick(user, kicker, currentUserLock.amount, penaltyAmount, currentTotalLocked); } function _delegate(address delegator, address delegatee) internal { // Move delegation from the old delegate to the given delegate address oldDelegatee = delegates[delegator]; uint256 delegatorBalance = balanceOf(delegator); delegates[delegator] = delegatee; // update the the Delegate chekpoint for the delegatee uint pos = delegateCheckpoints[delegator].length; if (pos > 0 && delegateCheckpoints[delegator][pos - 1].fromBlock == block.number) { delegateCheckpoints[delegator][pos - 1].delegate = delegatee; } else { delegateCheckpoints[delegator].push(DelegateCheckpoint(safe32(block.number), delegatee)); } emit DelegateChanged(delegator, oldDelegatee, delegatee); // and write the checkpoints for Votes _moveDelegates(oldDelegatee, delegatee, delegatorBalance); } /** * @notice Allow to withdraw with override of the lock & cooldown in case of emergency * @param amount amount to withdraw * @param receiver address to receive the withdrawn funds * @return uint256 : amount withdrawn */ function emergencyWithdraw(uint256 amount, address receiver) external returns(uint256) { if(!emergency) revert NotEmergency(); if(amount == 0) revert NullAmount(); if(receiver == address(0)) revert AddressZero(); if(userLocks[msg.sender].length != 0){ // Check if the user has a Lock, and if so, fetch it UserLock storage currentUserLock = userLocks[msg.sender][userLocks[msg.sender].length - 1]; // No need to remove the last Lock if already empty if(currentUserLock.amount != 0 && currentUserLock.duration > 0){ // To remove the Lock and update the total locked currentTotalLocked -= currentUserLock.amount; totalLocks.push(TotalLock( safe224(currentTotalLocked), safe32(block.number) )); userLocks[msg.sender].push(UserLock( safe128(0), safe48(block.timestamp), safe48(0), safe32(block.number) )); // Remove the bonus multiplier userCurrentBonusRatio[msg.sender] = 0; userBonusRatioDecrease[msg.sender] = 0; } } // Get the user hPAL balance, and burn & send the given amount, or the user balance if the amount is bigger uint256 userAvailableBalance = balanceOf(msg.sender); uint256 burnAmount = amount > userAvailableBalance ? userAvailableBalance : amount; _burn(msg.sender, burnAmount); // Transfer the PAL to the user pal.safeTransfer(receiver, burnAmount); emit EmergencyUnstake(msg.sender, burnAmount); return burnAmount; } // Utils error Exceed224Bits(); error Exceed128Bits(); error Exceed48Bits(); error Exceed32Bits(); function safe32(uint n) internal pure returns (uint32) { if(n > type(uint32).max) revert Exceed32Bits(); return uint32(n); } function safe48(uint n) internal pure returns (uint48) { if(n > type(uint48).max) revert Exceed48Bits(); return uint48(n); } function safe128(uint n) internal pure returns (uint128) { if(n > type(uint128).max) revert Exceed128Bits(); return uint128(n); } function safe224(uint n) internal pure returns (uint224) { if(n > type(uint224).max) revert Exceed224Bits(); return uint224(n); } // Admin methods error IncorrectParameters(); error DecreaseDurationNotOver(); /** * @notice Updates the ratio of penalty applied for each week after boost expiry * @param newKickRatioPerWeek new kick ratio (in BPS) */ function setKickRatio(uint256 newKickRatioPerWeek) external onlyOwner { if(newKickRatioPerWeek == 0 || newKickRatioPerWeek > 5000) revert IncorrectParameters(); kickRatioPerWeek = newKickRatioPerWeek; } /** * @notice Triggers the emergency mode on the smart contract (admin method) * @param trigger True to set the emergency mode */ function triggerEmergencyWithdraw(bool trigger) external onlyOwner { emergency = trigger; } /** * @notice Updates the EndDropPerSecond for the rewards distribution (after the 2 year decrease period) (admin method) * @param newEndDropPerSecond new amount of PAL to distribute per second */ function setEndDropPerSecond(uint256 newEndDropPerSecond) external onlyOwner { if(block.timestamp < startDropTimestamp + dropDecreaseDuration) revert DecreaseDurationNotOver(); endDropPerSecond = newEndDropPerSecond; } function commitSmartWalletChecker(address newSmartWalletChecker) external onlyOwner { futureSmartWalletChecker = newSmartWalletChecker; } function applySmartWalletChecker() external onlyOwner { smartWalletChecker = futureSmartWalletChecker; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/IERC20.sol"; import "./interfaces/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 `sender` to `recipient`. * * 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 pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../interfaces/IERC20.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)); } } /** * @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 pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import "../open-zeppelin/utils/Ownable.sol"; /** @title Extend OZ Ownable contract */ /// @author Paladin contract Owner is Ownable { address public pendingOwner; event NewPendingOwner(address indexed previousPendingOwner, address indexed newPendingOwner); error CannotBeOwner(); error CallerNotPendingOwner(); error ZeroAddress(); function transferOwnership(address newOwner) public override virtual onlyOwner { if(newOwner == address(0)) revert ZeroAddress(); if(newOwner == owner()) revert CannotBeOwner(); address oldPendingOwner = pendingOwner; pendingOwner = newOwner; emit NewPendingOwner(oldPendingOwner, newOwner); } function acceptOwnership() public virtual { if(pendingOwner == address(0)) revert ZeroAddress(); if(msg.sender != pendingOwner) revert CallerNotPendingOwner(); address newOwner = pendingOwner; _transferOwnership(pendingOwner); pendingOwner = address(0); emit NewPendingOwner(newOwner, address(0)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; /// @notice Interface of the `SmartWalletChecker` contracts of the protocol interface SmartWalletChecker { function check(address) external view returns (bool); }
// SPDX-License-Identifier: MIT 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 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 (last updated v4.5.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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
{ "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":[{"internalType":"address","name":"_palToken","type":"address"},{"internalType":"address","name":"_admin","type":"address"},{"internalType":"address","name":"_rewardsVault","type":"address"},{"internalType":"address","name":"_smartWalletChecker","type":"address"},{"internalType":"uint256","name":"_startDropPerSecond","type":"uint256"},{"internalType":"uint256","name":"_endDropPerSecond","type":"uint256"},{"internalType":"uint256","name":"_dropDecreaseDuration","type":"uint256"},{"internalType":"uint256","name":"_baseLockBonusRatio","type":"uint256"},{"internalType":"uint256","name":"_minLockBonusRatio","type":"uint256"},{"internalType":"uint256","name":"_maxLockBonusRatio","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AddressZero","type":"error"},{"inputs":[],"name":"AmountExceedBalance","type":"error"},{"inputs":[],"name":"AvailableBalanceTooLow","type":"error"},{"inputs":[],"name":"CallerNotPendingOwner","type":"error"},{"inputs":[],"name":"CannotBeOwner","type":"error"},{"inputs":[],"name":"CannotSelfKick","type":"error"},{"inputs":[],"name":"ContractNotAllowed","type":"error"},{"inputs":[],"name":"DecreaseDurationNotOver","type":"error"},{"inputs":[],"name":"DurationOverMax","type":"error"},{"inputs":[],"name":"DurationUnderMin","type":"error"},{"inputs":[],"name":"EmergencyBlock","type":"error"},{"inputs":[],"name":"EmptyLock","type":"error"},{"inputs":[],"name":"Exceed128Bits","type":"error"},{"inputs":[],"name":"Exceed224Bits","type":"error"},{"inputs":[],"name":"Exceed32Bits","type":"error"},{"inputs":[],"name":"Exceed48Bits","type":"error"},{"inputs":[],"name":"IncorrectAmount","type":"error"},{"inputs":[],"name":"IncorrectParameters","type":"error"},{"inputs":[],"name":"InsufficientCooldown","type":"error"},{"inputs":[],"name":"InvalidBlockNumber","type":"error"},{"inputs":[],"name":"LockNotExpired","type":"error"},{"inputs":[],"name":"LockNotKickable","type":"error"},{"inputs":[],"name":"NoBalance","type":"error"},{"inputs":[],"name":"NoLock","type":"error"},{"inputs":[],"name":"NotEmergency","type":"error"},{"inputs":[],"name":"NullAmount","type":"error"},{"inputs":[],"name":"SmallerAmount","type":"error"},{"inputs":[],"name":"SmallerDuration","type":"error"},{"inputs":[],"name":"UnstakePeriodExpired","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Cooldown","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyUnstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"kicker","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"penalty","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalLocked","type":"uint256"}],"name":"Kick","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"duration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalLocked","type":"uint256"}],"name":"Lock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousPendingOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newPendingOwner","type":"address"}],"name":"NewPendingOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalLocked","type":"uint256"}],"name":"Unlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Unstake","type":"event"},{"inputs":[],"name":"COOLDOWN_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_LOCK_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_LOCK_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MONTH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ONE_YEAR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UNIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UNLOCK_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UNSTAKE_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WEEK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"allBalancesOf","outputs":[{"internalType":"uint256","name":"staked","type":"uint256"},{"internalType":"uint256","name":"locked","type":"uint256"},{"internalType":"uint256","name":"available","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"applySmartWalletChecker","outputs":[],"stateMutability":"nonpayable","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":"user","type":"address"}],"name":"availableBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseLockBonusRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bonusLockVoteRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"checkpoints","outputs":[{"internalType":"uint32","name":"fromBlock","type":"uint32"},{"internalType":"uint224","name":"votes","type":"uint224"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimableRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newSmartWalletChecker","type":"address"}],"name":"commitSmartWalletChecker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cooldown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"cooldowns","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentDropPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentTotalLocked","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":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"delegateCheckpoints","outputs":[{"internalType":"uint32","name":"fromBlock","type":"uint32"},{"internalType":"address","name":"delegate","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dropDecreaseDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergency","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"emergencyWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endDropPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"estimateClaimableRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"futureSmartWalletChecker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentTotalLock","outputs":[{"components":[{"internalType":"uint224","name":"total","type":"uint224"},{"internalType":"uint32","name":"fromBlock","type":"uint32"}],"internalType":"struct HolyPaladinToken.TotalLock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getCurrentVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getNewReceiverCooldown","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPastDelegate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPastTotalLock","outputs":[{"components":[{"internalType":"uint224","name":"total","type":"uint224"},{"internalType":"uint32","name":"fromBlock","type":"uint32"}],"internalType":"struct HolyPaladinToken.TotalLock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPastVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalLockLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserLock","outputs":[{"components":[{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint48","name":"startTimestamp","type":"uint48"},{"internalType":"uint48","name":"duration","type":"uint48"},{"internalType":"uint32","name":"fromBlock","type":"uint32"}],"internalType":"struct HolyPaladinToken.UserLock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserLockCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getUserPastLock","outputs":[{"components":[{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint48","name":"startTimestamp","type":"uint48"},{"internalType":"uint48","name":"duration","type":"uint48"},{"internalType":"uint32","name":"fromBlock","type":"uint32"}],"internalType":"struct HolyPaladinToken.UserLock","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalRewards","outputs":[{"internalType":"uint128","name":"index","type":"uint128"},{"internalType":"uint128","name":"lastUpdate","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"increaseLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"increaseLockDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"kick","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"kickRatioPerWeek","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastDropUpdate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRewardUpdate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxLockBonusRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minLockBonusRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"numCheckpoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pal","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"rewardsLastUpdate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsVault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newEndDropPerSecond","type":"uint256"}],"name":"setEndDropPerSecond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newKickRatioPerWeek","type":"uint256"}],"name":"setKickRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"smartWalletChecker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"stakeAndIncreaseLock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"stakeAndLock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startDropPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startDropTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalLocks","outputs":[{"internalType":"uint224","name":"total","type":"uint224"},{"internalType":"uint32","name":"fromBlock","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","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"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"trigger","type":"bool"}],"name":"triggerEmergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"unstake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateRewardState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"updateUserRewardState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userBonusRatioDecrease","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userCurrentBonusRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userLocks","outputs":[{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint48","name":"startTimestamp","type":"uint48"},{"internalType":"uint48","name":"duration","type":"uint48"},{"internalType":"uint32","name":"fromBlock","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userRewardIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardStates","outputs":[{"internalType":"uint128","name":"index","type":"uint128"},{"internalType":"uint128","name":"lastUpdate","type":"uint128"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101806040526064600e55600f805460ff191690553480156200002157600080fd5b506040516200647a3803806200647a8339810160408190526200004491620003af565b60408051808201825260128152712437b63c902830b630b234b7102a37b5b2b760711b6020808301918252835180850190945260048452631a14105360e21b9084015281519192916200009a91600391620002f6565b508051620000b0906004906020840190620002f6565b505050620000cd620000c76200024960201b60201c565b6200024d565b6001600160a01b038a16620000e157600080fd5b6001600160a01b038916620000f557600080fd5b6001600160a01b0388166200010957600080fd5b6001600160a01b038a1660805262000121896200024d565b601880546001600160a01b0319166001600160a01b0389161790556040805180820190915260008152600990602081016200015c436200029f565b63ffffffff9081169091528254600181018455600093845260209384902083519490930151909116600160e01b026001600160e01b03909316929092179101556001600160a01b03881660a052601154861015620001b957600080fd5b60c08690526011859055601286905560e084905282620001d857600080fd5b82821015620001e657600080fd5b81811015620001f457600080fd5b6101208390526101408290526101608190526200021142620002cb565b601080546001600160801b03928316600160801b02921691909117905550504260138190556101005250620004859650505050505050565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600063ffffffff821115620002c75760405163ef7f0fb160e01b815260040160405180910390fd5b5090565b60006001600160801b03821115620002c757604051633fce143360e01b815260040160405180910390fd5b828054620003049062000448565b90600052602060002090601f01602090048101928262000328576000855562000373565b82601f106200034357805160ff191683800117855562000373565b8280016001018555821562000373579182015b828111156200037357825182559160200191906001019062000356565b50620002c79291505b80821115620002c757600081556001016200037c565b80516001600160a01b0381168114620003aa57600080fd5b919050565b6000806000806000806000806000806101408b8d031215620003d057600080fd5b620003db8b62000392565b9950620003eb60208c0162000392565b9850620003fb60408c0162000392565b97506200040b60608c0162000392565b965060808b0151955060a08b0151945060c08b0151935060e08b015192506101008b015191506101208b015190509295989b9194979a5092959850565b600181811c908216806200045d57607f821691505b602082108114156200047f57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e05161010051610120516101405161016051615f036200057760003960008181610a9601528181612ca5015281816135a901526138e901526000818161082301528181613588015281816135e7015281816138c80152613927015260008181610d4c0152818161362e015261396e015260008181610bc201528181611e1a01526157b7015260008181610ca501528181611df90152818161579601526158220152600081816108a2015261584a01526000818161084a015261195e015260008181610a600152818161183001528181611933015281816147bb0152614a2d0152615f036000f3fe608060405234801561001057600080fd5b50600436106105045760003560e01c80638381e18211610299578063caa6fea411610167578063e30c3978116100d9578063f4359ce511610092578063f4359ce514610da7578063f44c1b7b14610db1578063f6bab08914610dba578063fb27494e14610dda578063fd0e15f614610de2578063fd967f4714610df557600080fd5b8063e30c397814610d23578063e9ee2fa914610d36578063eb24a4ad14610d47578063eff0d62c14610d6e578063f081858314610d81578063f2fde38b14610d9457600080fd5b8063d5999a5c1161012b578063d5999a5c14610c96578063d6f597ee14610ca0578063da90a0c114610cc7578063dc01f60d14610ce7578063dd62ed3e14610d07578063e0d3bbd714610d1a57600080fd5b8063caa6fea414610c32578063cb2bf86614610c3f578063ccf352ad14610c76578063d2253c3114610c7f578063d4cfd62714610c8e57600080fd5b8063a457c2d71161020b578063b369460c116101c4578063b369460c14610b97578063b4b5ea5714610baa578063b6f78e5614610bbd578063bf2bc81914610be4578063c7a21ce114610bf7578063c98ec02814610c0057600080fd5b8063a457c2d714610ad0578063a694fc3a14610ae3578063a69df4b514610af6578063a9059cbb14610afe578063aa33fedb14610b11578063ac6e431614610b6057600080fd5b806396c551751161025d57806396c5517514610a1f5780639b7d02ad14610a325780639bd2a16e14610a5b5780639d8e217714610a825780639fba1ffe14610a91578063a3c2710d14610ab857600080fd5b80638381e182146109d65780638da5cb5b146109e957806393203e67146109fa578063948b6dd414610a0457806395d89b4114610a1757600080fd5b80634ad9a29c116103d65780636fcfff451161034857806378b4330f1161030157806378b4330f1461097157806379b578621461097b57806379ba50971461098557806379ffdf401461098d5780637df14854146109955780638273a411146109a857600080fd5b80636fcfff45146108f457806370a082311461091d578063715018a6146109305780637423031e146109385780637866430e14610956578063787a08a61461096957600080fd5b8063587cde1e1161039a578063587cde1e1461086c57806359ae84ee146108955780635a1417f01461089d5780635c19a95c146108c457806366d587b3146108d75780636e99d52f146108ea57600080fd5b80634ad9a29c146107ac5780634f1bfc9e146107bf578063536b1bc3146107ca57806353a714111461081e5780635579ed011461084557600080fd5b80631c5a09141161047a578063313ce56711610433578063313ce56714610748578063379607f514610757578063395093511461076a5780633a46b1a81461077d57806347b02ba8146107905780634abaabf5146107a357600080fd5b80631c5a0914146106875780632140fb401461069a57806323b872dd146106fc57806325d998bb1461070f57806329c38e89146107225780632f940c701461073557600080fd5b80630e905435116104cc5780630e905435146105e45780631338736f146105f757806314fd87601461060c578063155bcbbd1461064957806316d3bfbb1461067457806318160ddd1461067f57600080fd5b806301320fe21461050957806306fdde031461053c57806308dc98ca14610551578063095ea7b31461058a5780630cdfebfa146105ad575b600080fd5b610529610517366004615bac565b600a6020526000908152604090205481565b6040519081526020015b60405180910390f35b610544610dfe565b6040516105339190615bf3565b61052961055f366004615bac565b6001600160a01b0316600090815260146020526040902054600160801b90046001600160801b031690565b61059d610598366004615c26565b610e90565b6040519015158152602001610533565b6105c06105bb366004615c26565b610eaa565b6040805163ffffffff90931683526001600160e01b03909116602083015201610533565b6105296105f2366004615bac565b610ef0565b61060a610605366004615c50565b610fe8565b005b61061f61061a366004615c72565b611056565b6040805182516001600160e01b0316815260209283015163ffffffff169281019290925201610533565b60195461065c906001600160a01b031681565b6040516001600160a01b039091168152602001610533565b6105296301e1338081565b600254610529565b61060a610695366004615c72565b6112e0565b6106ad6106a8366004615bac565b6113c6565b6040805182516001600160801b0316815260208084015165ffffffffffff9081169183019190915283830151169181019190915260609182015163ffffffff1691810191909152608001610533565b61059d61070a366004615c8b565b6114da565b61052961071d366004615bac565b611500565b61060a610730366004615c72565b61150b565b610529610743366004615cc7565b61156f565b60405160128152602001610533565b61060a610765366004615c72565b611894565b61059d610778366004615c26565b6119bd565b61052961078b366004615c26565b6119df565b61052961079e366004615c8b565b611a81565b61052960125481565b6105296107ba366004615c50565b611ab6565b6105296303c2670081565b6107fe6107d8366004615bac565b6014602052600090815260409020546001600160801b0380821691600160801b90041682565b604080516001600160801b03938416815292909116602083015201610533565b6105297f000000000000000000000000000000000000000000000000000000000000000081565b61065c7f000000000000000000000000000000000000000000000000000000000000000081565b61065c61087a366004615bac565b600b602052600090815260409020546001600160a01b031681565b61060a611c3d565b6105297f000000000000000000000000000000000000000000000000000000000000000081565b61060a6108d2366004615bac565b611c6c565b61060a6108e5366004615c72565b611c9a565b610529620d2f0081565b610529610902366004615bac565b6001600160a01b03166000908152600c602052604090205490565b61052961092b366004615bac565b611d79565b61060a611d94565b6010546107fe906001600160801b0380821691600160801b90041682565b61060a610964366004615c72565b611dca565b61060a611e63565b61052962784ce081565b6105296202a30081565b61060a611ee7565b61061f611f99565b60185461065c906001600160a01b031681565b6109bb6109b6366004615bac565b61202d565b60408051938452602084019290925290820152606001610533565b6105296109e4366004615cc7565b61213e565b6005546001600160a01b031661065c565b6105296212750081565b610529610a12366004615c50565b612170565b6105446121e3565b61060a610a2d366004615bac565b6121f2565b610529610a40366004615bac565b6001600160a01b031660009081526007602052604090205490565b61065c7f000000000000000000000000000000000000000000000000000000000000000081565b610529670de0b6b3a764000081565b6105297f000000000000000000000000000000000000000000000000000000000000000081565b601054600160801b90046001600160801b0316610529565b61059d610ade366004615c26565b61225c565b610529610af1366004615c72565b6122e2565b61060a612313565b61059d610b0c366004615c26565b612376565b610b24610b1f366004615c26565b612384565b604080516001600160801b0395909516855265ffffffffffff9384166020860152919092169083015263ffffffff166060820152608001610533565b610b73610b6e366004615c72565b6123e4565b604080516001600160e01b03909316835263ffffffff909116602083015201610533565b61065c610ba5366004615c26565b61241c565b610529610bb8366004615bac565b6126d9565b6105297f000000000000000000000000000000000000000000000000000000000000000081565b61060a610bf2366004615bac565b61289c565b61052960085481565b610529610c0e366004615bac565b6001600160a01b03166000908152601460205260409020546001600160801b031690565b600f5461059d9060ff1681565b610c52610c4d366004615c26565b6128c9565b6040805163ffffffff90931683526001600160a01b03909116602083015201610533565b610529600e5481565b6105296706f05b59d3b2000081565b61060a61290f565b610529622819a081565b6105297f000000000000000000000000000000000000000000000000000000000000000081565b610529610cd5366004615bac565b60166020526000908152604090205481565b610529610cf5366004615bac565b60156020526000908152604090205481565b610529610d15366004615cf3565b61295d565b61052960135481565b60065461065c906001600160a01b031681565b6010546001600160801b0316610529565b6105297f000000000000000000000000000000000000000000000000000000000000000081565b61060a610d7c366004615d2b565b612988565b61060a610d8f366004615bac565b6129c5565b61060a610da2366004615bac565b612a11565b61052962093a8081565b61052960115481565b610529610dc8366004615bac565b60176020526000908152604090205481565b600954610529565b6106ad610df0366004615c26565b612ae3565b61052961271081565b606060038054610e0d90615d48565b80601f0160208091040260200160405190810160405280929190818152602001828054610e3990615d48565b8015610e865780601f10610e5b57610100808354040283529160200191610e86565b820191906000526020600020905b815481529060010190602001808311610e6957829003601f168201915b5050505050905090565b600033610e9e818585612b46565b60019150505b92915050565b600c6020528160005260406000208181548110610ec657600080fd5b60009182526020909120015463ffffffff81169250600160201b90046001600160e01b0316905082565b600f5460009060ff1680610f0b57506001600160a01b038216155b15610f1857506000919050565b6001600160a01b0382166000908152601460209081526040918290208251808401909352546001600160801b038082168452600160801b90910416908201819052421415610f7d5750506001600160a01b031660009081526015602052604090205490565b6001600160a01b03831660009081526015602090815260409091205482519183015190916001600160801b03908116914291161015610fc457610fc1601254612c6a565b90505b6000610fd1868584612d50565b509050610fde8184615d99565b9695505050505050565b600f5460ff161561100c57604051637bef0aeb60e01b815260040160405180910390fd5b61101533612f92565b61101e33613040565b336000908152600b60205260409020546001600160a01b0316611045576110453333613174565b6110523383836000613376565b5050565b604080518082019091526000808252602082015243821061108a57604051631391e11b60e21b815260040160405180910390fd5b6040805180820190915260008082526020820152600980549084906110b0600184615db1565b815481106110c0576110c0615dc8565b600091825260209091200154600160e01b900463ffffffff161161113b5760096110eb600183615db1565b815481106110fb576110fb615dc8565b6000918252602091829020604080518082019091529101546001600160e01b0381168252600160e01b900463ffffffff1691810191909152949350505050565b83600960008154811061115057611150615dc8565b600091825260209091200154600160e01b900463ffffffff161115611176575092915050565b6000611183600183615db1565b90506000805b828210156112735761119b8284613a7c565b905086600982815481106111b1576111b1615dc8565b600091825260209091200154600160e01b900463ffffffff16141561122657600981815481106111e3576111e3615dc8565b6000918252602091829020604080518082019091529101546001600160e01b0381168252600160e01b900463ffffffff1691810191909152979650505050505050565b866009828154811061123a5761123a615dc8565b600091825260209091200154600160e01b900463ffffffff16111561126157809250611189565b61126c816001615d99565b9150611189565b82156112d3576009611286600185615db1565b8154811061129657611296615dc8565b6000918252602091829020604080518082019091529101546001600160e01b0381168252600160e01b900463ffffffff16918101919091526112d5565b845b979650505050505050565b600f5460ff161561130457604051637bef0aeb60e01b815260040160405180910390fd5b61130d33612f92565b3360009081526007602052604090205461133a5760405163ba112c9360e01b815260040160405180910390fd5b336000908152600760205260408120805461135790600190615db1565b8154811061136757611367615dc8565b600091825260209091200180549091506001600160801b031661139d576040516329409fa960e21b815260040160405180910390fd5b6113a633613040565b80546110529033908490600160b01b900465ffffffffffff166001613376565b604080516080810182526000808252602082018190529181018290526060810191909152600f5460ff168061141157506001600160a01b038216600090815260076020526040902054155b1561143f57505060408051608081018252600080825260208201819052918101829052606081019190915290565b6001600160a01b0382166000908152600760205260409020805461146590600190615db1565b8154811061147557611475615dc8565b60009182526020918290206040805160808101825292909101546001600160801b0381168352600160801b810465ffffffffffff90811694840194909452600160b01b810490931690820152600160e01b90910463ffffffff16606082015292915050565b6000336114e8858285613a97565b6114f3858585613b11565b60019150505b9392505050565b6000610ea482613cf0565b6005546001600160a01b0316331461153e5760405162461bcd60e51b815260040161153590615dde565b60405180910390fd5b80158061154c575061138881115b1561156a5760405163c4718a2d60e01b815260040160405180910390fd5b600e55565b600f5460009060ff16611595576040516303ca9f4d60e11b815260040160405180910390fd5b826115b357604051630e5a744960e41b815260040160405180910390fd5b6001600160a01b0382166115da57604051639fabe1c160e01b815260040160405180910390fd5b33600090815260076020526040902054156117f957336000908152600760205260408120805461160c90600190615db1565b8154811061161c5761161c615dc8565b600091825260209091200180549091506001600160801b03161580159061165257508054600160b01b900465ffffffffffff1615155b156117f7578054600880546001600160801b0390921691600090611677908490615db1565b9250508190555060096040518060400160405280611696600854613d74565b6001600160e01b031681526020016116ad43613da2565b63ffffffff908116909152825460018101845560009384526020808520845194820151909316600160e01b026001600160e01b039094169390931791015533825260079052604080822081516080810190925291819061170c90613dc9565b6001600160801b0316815260200161172342613df3565b65ffffffffffff16815260200161173a6000613df3565b65ffffffffffff16815260200161175043613da2565b63ffffffff908116909152825460018101845560009384526020808520845192018054858301516040808801516060909801516001600160801b039096166001600160b01b031990931692909217600160801b65ffffffffffff92831602176001600160b01b0316600160b01b91909716026001600160e01b031695909517600160e01b939094169290920292909217905533835260168152818320839055601790528120555b505b600061180433611d79565b905060008185116118155784611817565b815b90506118233382613e1c565b6118576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168583613f82565b60405181815233907f571394674ec9d9e81517060110f8f894ce912af2b2febc091bee0cdea68adf009060200160405180910390a2949350505050565b600f5460ff16156118b857604051637bef0aeb60e01b815260040160405180910390fd5b6118c133613040565b806118df576040516334b2073960e11b815260040160405180910390fd5b33600090815260156020526040812054821061190a573360009081526015602052604090205461190c565b815b905080611917575050565b33600081815260156020526040902080548390039055611984907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316907f00000000000000000000000000000000000000000000000000000000000000009084613fe5565b60405181815233907f1f89f96333d3133000ee447473151fa9606543368f02271c9d95ae14f13bcc679060200160405180910390a25050565b600033610e9e8185856119d0838361295d565b6119da9190615d99565b612b46565b6000806119ec848461401d565b905060006119fa85856142e4565b90506000856001600160a01b0316611a12878761241c565b6001600160a01b0316148015611a3857506301e13380826040015165ffffffffffff1610155b611a43576000611a75565b8151670de0b6b3a764000090611a6b906706f05b59d3b20000906001600160801b0316615e13565b611a759190615e32565b9050610fde8184615d99565b6001600160a01b0383166000908152600a6020526040812054611aae908385611aa981611d79565b6146c7565b949350505050565b600f5460009060ff1615611add57604051637bef0aeb60e01b815260040160405180910390fd5b611ae633612f92565b33600090815260076020526040902054611b135760405163ba112c9360e01b815260040160405180910390fd5b33600090815260076020526040812054611b2f90600190615db1565b3360009081526007602052604081208054929350909183908110611b5557611b55615dc8565b6000918252602090912001546001600160801b0316905080611b8a576040516329409fa960e21b815260040160405180910390fd5b6000611b963387614784565b336000908152600b60205260409020549091506001600160a01b0316611bc057611bc03333613174565b336000908152600760205260409020805484908110611be157611be1615dc8565b600091825260209091200154600160b01b900465ffffffffffff16851415611c1e57611c1933611c118885615d99565b876001613376565b611c34565b611c3433611c2c8885615d99565b876000613376565b95945050505050565b600f5460ff1615611c6157604051637bef0aeb60e01b815260040160405180910390fd5b611c6961482c565b50565b600f5460ff1615611c9057604051637bef0aeb60e01b815260040160405180910390fd5b611c693382613174565b600f5460ff1615611cbe57604051637bef0aeb60e01b815260040160405180910390fd5b611cc733612f92565b33600090815260076020526040902054611cf45760405163ba112c9360e01b815260040160405180910390fd5b3360009081526007602052604081208054611d1190600190615db1565b81548110611d2157611d21615dc8565b600091825260209091200180549091506001600160801b0316611d57576040516329409fa960e21b815260040160405180910390fd5b611d6033613040565b80546110529033906001600160801b0316846002613376565b6001600160a01b031660009081526020819052604090205490565b6005546001600160a01b03163314611dbe5760405162461bcd60e51b815260040161153590615dde565b611dc860006148c0565b565b6005546001600160a01b03163314611df45760405162461bcd60e51b815260040161153590615dde565b611e3e7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000615d99565b421015611e5e576040516347b8e9f360e11b815260040160405180910390fd5b601155565b600f5460ff1615611e8757604051637bef0aeb60e01b815260040160405180910390fd5b611e9033611d79565b611ead57604051636165515360e11b815260040160405180910390fd5b336000818152600a6020526040808220429055517ff52f50426b32362d3e6bb8cb36b7074756b224622def6352a59eac7f66ebe6e89190a2565b6006546001600160a01b0316611f105760405163d92e233d60e01b815260040160405180910390fd5b6006546001600160a01b03163314611f3b576040516305e05b4b60e31b815260040160405180910390fd5b6006546001600160a01b0316611f50816148c0565b600680546001600160a01b03191690556040516000906001600160a01b038316907fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b908390a350565b6040805180820190915260008082526020820152600f5460ff1615611fd05750604080518082019091526000808252602082015290565b60098054611fe090600190615db1565b81548110611ff057611ff0615dc8565b6000918252602091829020604080518082019091529101546001600160e01b0381168252600160e01b900463ffffffff1691810191909152919050565b60008060008061203c85611d79565b600f5490915060ff168061206657506001600160a01b038516600090815260076020526040902054155b1561207957925060009150829050612137565b6001600160a01b03851660009081526007602052604081205461209e90600190615db1565b6001600160a01b038716600090815260076020526040902080549192508391839081106120cd576120cd615dc8565b60009182526020808320909101546001600160a01b038a1683526007909152604090912080546001600160801b03909216918490811061210f5761210f615dc8565b60009182526020909120015461212e906001600160801b031685615db1565b94509450945050505b9193909250565b600f5460009060ff161561216557604051637bef0aeb60e01b815260040160405180910390fd5b6114f9338484614912565b600f5460009060ff161561219757604051637bef0aeb60e01b815260040160405180910390fd5b6121a033612f92565b60006121ac3385614784565b336000908152600b60205260409020549091506001600160a01b03166121d6576121d63333613174565b6114f93385856000613376565b606060048054610e0d90615d48565b600f5460ff161561221657604051637bef0aeb60e01b815260040160405180910390fd5b336001600160a01b0382161415612240576040516339e65b2b60e21b815260040160405180910390fd5b61224981613040565b61225233613040565b611c698133614aa1565b6000338161226a828661295d565b9050838110156122ca5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401611535565b6122d78286868403612b46565b506001949350505050565b600f5460009060ff161561230957604051637bef0aeb60e01b815260040160405180910390fd5b610ea43383614784565b600f5460ff161561233757604051637bef0aeb60e01b815260040160405180910390fd5b336000908152600760205260409020546123645760405163ba112c9360e01b815260040160405180910390fd5b61236d33613040565b611dc833614d74565b600033610e9e818585613b11565b600760205281600052604060002081815481106123a057600080fd5b6000918252602090912001546001600160801b038116925065ffffffffffff600160801b820481169250600160b01b8204169063ffffffff600160e01b9091041684565b600981815481106123f457600080fd5b6000918252602090912001546001600160e01b0381169150600160e01b900463ffffffff1682565b600043821061243e57604051631391e11b60e21b815260040160405180910390fd5b6001600160a01b0383166000908152600d602052604090205480612466576000915050610ea4565b6001600160a01b0384166000908152600d60205260409020839061248b600184615db1565b8154811061249b5761249b615dc8565b60009182526020909120015463ffffffff161161250a576001600160a01b0384166000908152600d602052604090206124d5600183615db1565b815481106124e5576124e5615dc8565b600091825260209091200154600160201b90046001600160a01b03169150610ea49050565b6001600160a01b0384166000908152600d60205260408120805485929061253357612533615dc8565b60009182526020909120015463ffffffff161115612555576000915050610ea4565b6000612562600183615db1565b90506000805b828210156126725761257a8284613a7c565b6001600160a01b0388166000908152600d6020526040902080549192508791839081106125a9576125a9615dc8565b60009182526020909120015463ffffffff161415612613576001600160a01b0387166000908152600d602052604090208054829081106125eb576125eb615dc8565b600091825260209091200154600160201b90046001600160a01b03169450610ea49350505050565b6001600160a01b0387166000908152600d6020526040902080548791908390811061264057612640615dc8565b60009182526020909120015463ffffffff16111561266057809250612568565b61266b816001615d99565b9150612568565b82156126cc576001600160a01b0387166000908152600d6020526040902061269b600185615db1565b815481106126ab576126ab615dc8565b600091825260209091200154600160201b90046001600160a01b03166112d5565b6000979650505050505050565b600f5460009060ff16156126ef57506000919050565b6001600160a01b0382166000908152600c6020526040812054908115612763576001600160a01b0384166000908152600c60205260409020612732600184615db1565b8154811061274257612742615dc8565b600091825260209091200154600160201b90046001600160e01b0316612766565b60005b6001600160a01b0385166000908152600760205260409020546001600160e01b039190911691508061279a57509392505050565b6001600160a01b03851660009081526007602052604081206127bd600184615db1565b815481106127cd576127cd615dc8565b60009182526020808320909101546001600160a01b03808a16808552600b90935260408420546001600160801b0390921694501614801561286057506001600160a01b03871660009081526007602052604090206301e1338090612832600186615db1565b8154811061284257612842615dc8565b600091825260209091200154600160b01b900465ffffffffffff1610155b61286b576000612890565b670de0b6b3a76400006128866706f05b59d3b2000084615e13565b6128909190615e32565b90506112d58185615d99565b600f5460ff16156128c057604051637bef0aeb60e01b815260040160405180910390fd5b611c6981613040565b600d60205281600052604060002081815481106128e557600080fd5b60009182526020909120015463ffffffff81169250600160201b90046001600160a01b0316905082565b6005546001600160a01b031633146129395760405162461bcd60e51b815260040161153590615dde565b601954601880546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6005546001600160a01b031633146129b25760405162461bcd60e51b815260040161153590615dde565b600f805460ff1916911515919091179055565b6005546001600160a01b031633146129ef5760405162461bcd60e51b815260040161153590615dde565b601980546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b03163314612a3b5760405162461bcd60e51b815260040161153590615dde565b6001600160a01b038116612a625760405163d92e233d60e01b815260040160405180910390fd5b6005546001600160a01b0382811691161415612a915760405163d5e889bf60e01b815260040160405180910390fd5b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b90600090a35050565b604080516080810182526000808252602082018190529181018290526060810191909152600f5460ff1615612b3c5750604080516080810182526000808252602082018190529181018290526060810191909152610ea4565b6114f983836142e4565b6001600160a01b038316612ba85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401611535565b6001600160a01b038216612c095760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401611535565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600080612c7660025490565b604080518082019091526010546001600160801b038082168352600160801b90910416602082015290915060007f0000000000000000000000000000000000000000000000000000000000000000612cd6670de0b6b3a764000087615e13565b612ce09190615e32565b905060008183602001516001600160801b031642612cfe9190615db1565b612d089190615e13565b90506000808511612d1a576000612d37565b84612d2d670de0b6b3a764000084615e13565b612d379190615e32565b84519091506112d59082906001600160801b0316615d99565b815160009081906001600160801b031681612d6a87613cf0565b90506000858314612f8757612d7e88611d79565b15612f87576000612d8f8488615db1565b6001600160a01b038a166000908152600760205260408120549192509015612f5a576001600160a01b038a16600090815260076020526040812054612dd690600190615db1565b6001600160a01b038c16600090815260076020526040902080549192509082908110612e0457612e04615dc8565b6000918252602090912001546001600160801b031693508315801590612e6d57506001600160a01b038b166000908152600760205260409020805482908110612e4f57612e4f615dc8565b600091825260209091200154600160b01b900465ffffffffffff1615155b15612f58576001600160a01b038b166000908152601660205260409020548015612f56576001600160a01b038c166000908152601760209081526040822054908d01519091908290612ec8906001600160801b031642615db1565b612ed29190615e13565b905082811015612eeb57612ee68184615db1565b612eee565b60005b9950828110612efa5750815b60006002612f088385615d99565b612f129190615e32565b612f1c908c615d99565b9050670de0b6b3a764000080612f32838a615e13565b612f3c908b615e13565b612f469190615e32565b612f509190615e32565b95505050505b505b505b80670de0b6b3a7640000612f6e8487615e13565b612f789190615e32565b612f829190615d99565b965050505b505050935093915050565b6001600160a01b0381163214611c69576018546001600160a01b0316801561105257604051631846d2f560e31b81526001600160a01b03838116600483015282169063c23697a890602401602060405180830381865afa158015612ffa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061301e9190615e54565b15613027575050565b6040516311970e2d60e31b815260040160405180910390fd5b600f5460ff161561304e5750565b600061305861482c565b90506001600160a01b03821661306c575050565b6001600160a01b038216600090815260146020526040902080546001600160801b03600160801b909104164214156130a357505050565b6040805180820190915281546001600160801b038082168352600160801b90910416602082015260009081906130db90869086612d50565b6001600160a01b038716600090815260156020526040812080549395509193508492613108908490615d99565b90915550506001600160a01b038516600090815260166020526040902081905561313142613dc9565b83546001600160801b03918216600160801b02911617835561315284613dc9565b83546001600160801b0319166001600160801b03919091161790925550505050565b6001600160a01b038083166000908152600b60205260408120549091169061319b84611d79565b6001600160a01b038581166000908152600b6020908152604080832080546001600160a01b03191694891694909417909355600d90522054909150801580159061322957506001600160a01b0385166000908152600d602052604090204390613205600184615db1565b8154811061321557613215615dc8565b60009182526020909120015463ffffffff16145b15613299576001600160a01b0385166000908152600d602052604090208490613253600184615db1565b8154811061326357613263615dc8565b9060005260206000200160000160046101000a8154816001600160a01b0302191690836001600160a01b0316021790555061331a565b6001600160a01b0385166000908152600d602052604090819020815180830190925290806132c643613da2565b63ffffffff90811682526001600160a01b038089166020938401528454600181018655600095865294839020845195018054949093015116600160201b026001600160c01b03199093169316929092171790555b836001600160a01b0316836001600160a01b0316866001600160a01b03167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a461336f838584614f71565b5050505050565b6001600160a01b03841661338957600080fd5b826133a757604051630e5a744960e41b815260040160405180910390fd5b60006133b285611d79565b9050808411156133d557604051635d124e8b60e11b815260040160405180910390fd5b62784ce08310156133f9576040516322a68c6b60e21b815260040160405180910390fd5b6303c2670083111561341e57604051634490d10d60e01b815260040160405180910390fd5b6001600160a01b0385166000908152600760205260409020546136f3576001600160a01b03851660009081526007602052604090819020815160808101909252908061346987613dc9565b6001600160801b0316815260200161348042613df3565b65ffffffffffff16815260200161349686613df3565b65ffffffffffff1681526020016134ac43613da2565b63ffffffff9081169091528254600181018455600093845260208085208451920180549185015160408601516060909601516001600160801b039094166001600160b01b031990931692909217600160801b65ffffffffffff93841602176001600160b01b0316600160b01b92909516919091026001600160e01b031693909317600160e01b919092160217905561354b62784ce06303c26700615db1565b670de0b6b3a764000061356162784ce087615db1565b61356b9190615e13565b6135759190615e32565b90506000670de0b6b3a7640000826135cd7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000615db1565b6135d79190615e13565b6135e19190615e32565b61360b907f0000000000000000000000000000000000000000000000000000000000000000615d99565b6001600160a01b03881660009081526016602052604090208190559050846136537f000000000000000000000000000000000000000000000000000000000000000083615db1565b61365d9190615e32565b6001600160a01b0388166000908152601760205260408120919091556008805488929061368b908490615d99565b909155505060085461369c9061517d565b8442886001600160a01b03167f2b943276e5d747f6f7dd46d3b880d8874cb8d6b9b88ca1903990a2738e7dc7a1896008546040516136e4929190918252602082015260400190565b60405180910390a4505061336f565b6001600160a01b0385166000908152600760205260408120805461371990600190615db1565b8154811061372957613729615dc8565b600091825260208083206040805160808101825291909301546001600160801b038116825265ffffffffffff600160801b82048116938301849052600160b01b82041693820184905263ffffffff600160e01b90910416606082015293506137919190615e71565b825165ffffffffffff91909116915042906001600160801b031615806137b657504282105b156137cc576137c78888838961528c565b61385f565b82516001600160801b03168710156137f757604051630c2ec51360e11b815260040160405180910390fd5b826040015165ffffffffffff168610156138245760405163e282748360e01b815260040160405180910390fd5b600185600281111561383857613838615e9b565b146138435780613851565b826020015165ffffffffffff165b905061385f8888838961528c565b600185600281111561387357613873615e9b565b146139b957600061388b62784ce06303c26700615db1565b670de0b6b3a76400006138a162784ce08a615db1565b6138ab9190615e13565b6138b59190615e32565b90506000670de0b6b3a76400008261390d7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000615db1565b6139179190615e13565b6139219190615e32565b61394b907f0000000000000000000000000000000000000000000000000000000000000000615d99565b6001600160a01b038b1660009081526016602052604090208190559050876139937f000000000000000000000000000000000000000000000000000000000000000083615db1565b61399d9190615e32565b6001600160a01b038b1660009081526017602052604090205550505b82516001600160801b03168714613a225782516001600160801b0316156139ff5782600001516001600160801b0316600860008282546139f99190615db1565b90915550505b8660086000828254613a119190615d99565b9091555050600854613a229061517d565b8581896001600160a01b03167f2b943276e5d747f6f7dd46d3b880d8874cb8d6b9b88ca1903990a2738e7dc7a18a600854604051613a6a929190918252602082015260400190565b60405180910390a45050505050505050565b6000613a8b6002848418615e32565b6114f990848416615d99565b6000613aa3848461295d565b90506000198114613b0b5781811015613afe5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401611535565b613b0b8484848403612b46565b50505050565b6001600160a01b038316613b755760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401611535565b6001600160a01b038216613bd75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401611535565b613be28383836154cc565b6001600160a01b03831660009081526020819052604090205481811015613c5a5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401611535565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290613c91908490615d99565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051613cdd91815260200190565b60405180910390a3613b0b848484615598565b6001600160a01b038116600090815260076020526040812054613d1657610ea482611d79565b6001600160a01b03821660009081526007602052604090208054613d3c90600190615db1565b81548110613d4c57613d4c615dc8565b6000918252602090912001546001600160801b0316613d6a83611d79565b610ea49190615db1565b60006001600160e01b03821115613d9e576040516345ae522960e11b815260040160405180910390fd5b5090565b600063ffffffff821115613d9e5760405163ef7f0fb160e01b815260040160405180910390fd5b60006001600160801b03821115613d9e57604051633fce143360e01b815260040160405180910390fd5b600065ffffffffffff821115613d9e5760405163c9d6204760e01b815260040160405180910390fd5b6001600160a01b038216613e7c5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401611535565b613e88826000836154cc565b6001600160a01b03821660009081526020819052604090205481811015613efc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401611535565b6001600160a01b0383166000908152602081905260408120838303905560028054849290613f2b908490615db1565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3613f7d83600084615598565b505050565b6040516001600160a01b038316602482015260448101829052613f7d90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526155ca565b6040516001600160a01b0380851660248301528316604482015260648101829052613b0b9085906323b872dd60e01b90608401613fae565b600043821061403f57604051631391e11b60e21b815260040160405180910390fd5b6001600160a01b0383166000908152600c602052604090205480614067576000915050610ea4565b6001600160a01b0384166000908152600c60205260409020839061408c600184615db1565b8154811061409c5761409c615dc8565b60009182526020909120015463ffffffff161161410b576001600160a01b0384166000908152600c602052604090206140d6600183615db1565b815481106140e6576140e6615dc8565b600091825260209091200154600160201b90046001600160e01b03169150610ea49050565b6001600160a01b0384166000908152600c60205260408120805485929061413457614134615dc8565b60009182526020909120015463ffffffff161115614156576000915050610ea4565b6000614163600183615db1565b90506000805b828210156142735761417b8284613a7c565b6001600160a01b0388166000908152600c6020526040902080549192508791839081106141aa576141aa615dc8565b60009182526020909120015463ffffffff161415614214576001600160a01b0387166000908152600c602052604090208054829081106141ec576141ec615dc8565b600091825260209091200154600160201b90046001600160e01b03169450610ea49350505050565b6001600160a01b0387166000908152600c6020526040902080548791908390811061424157614241615dc8565b60009182526020909120015463ffffffff16111561426157809250614169565b61426c816001615d99565b9150614169565b82156142cd576001600160a01b0387166000908152600c6020526040902061429c600185615db1565b815481106142ac576142ac615dc8565b600091825260209091200154600160201b90046001600160e01b03166142d0565b60005b6001600160e01b0316979650505050505050565b60408051608081018252600080825260208201819052918101829052606081019190915243821061432857604051631391e11b60e21b815260040160405180910390fd5b6040805160808101825260008082526020808301829052828401829052606083018290526001600160a01b03871682526007905291909120548061436e57509050610ea4565b6001600160a01b03851660009081526007602052604090208490614393600184615db1565b815481106143a3576143a3615dc8565b600091825260209091200154600160e01b900463ffffffff161161445d576001600160a01b03851660009081526007602052604090206143e4600183615db1565b815481106143f4576143f4615dc8565b60009182526020918290206040805160808101825292909101546001600160801b0381168352600160801b810465ffffffffffff90811694840194909452600160b01b810490931690820152600160e01b90910463ffffffff1660608201529250610ea4915050565b6001600160a01b0385166000908152600760205260408120805486929061448657614486615dc8565b600091825260209091200154600160e01b900463ffffffff1611156144ad57509050610ea4565b60006144ba600183615db1565b90506000805b8282101561461c576144d28284613a7c565b6001600160a01b0389166000908152600760205260409020805491925088918390811061450157614501615dc8565b600091825260209091200154600160e01b900463ffffffff1614156145b6576001600160a01b038816600090815260076020526040902080548290811061454a5761454a615dc8565b60009182526020918290206040805160808101825292909101546001600160801b0381168352600160801b810465ffffffffffff90811694840194909452600160b01b810490931690820152600160e01b90910463ffffffff1660608201529550610ea4945050505050565b6001600160a01b03881660009081526007602052604090208054889190839081106145e3576145e3615dc8565b600091825260209091200154600160e01b900463ffffffff16111561460a578092506144c0565b614615816001615d99565b91506144c0565b82156146b9576001600160a01b0388166000908152600760205260409020614645600185615db1565b8154811061465557614655615dc8565b60009182526020918290206040805160808101825292909101546001600160801b0381168352600160801b810465ffffffffffff90811694840194909452600160b01b810490931690820152600160e01b90910463ffffffff1660608201526146bb565b845b98975050505050505050565b6001600160a01b0382166000908152600a6020526040812054846146ec579050611aae565b806146fb576000915050611aae565b600061470d6202a300620d2f00615d99565b6147179042615db1565b90508082101561472c57600092505050611aae565b600081881061473b578761473d565b425b90508281101561475257829350505050611aae565b61475c8588615d99565b6147668487615e13565b614770838a615e13565b61477a9190615d99565b6146bb9190615e32565b6000816147a457604051630e5a744960e41b815260040160405180910390fd5b6147ae838361569c565b6147e36001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016843085613fe5565b826001600160a01b03167febedb8b3c678666e7f36970bc8f57abf6d8fa2e828c0da91ea5b75bf68ed101a8360405161481e91815260200190565b60405180910390a250919050565b60108054600091906001600160801b03600160801b9091041642141561485b57546001600160801b0316919050565b600061486561578f565b9050600061487282612c6a565b905061487d81613dc9565b83546001600160801b0319166001600160801b03919091161783556148a142613dc9565b83546001600160801b03918216600160801b0291161790925550919050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008261493257604051630e5a744960e41b815260040160405180910390fd5b6001600160a01b03821661495957604051639fabe1c160e01b815260040160405180910390fd5b6001600160a01b0384166000908152600a602052604090205461497f620d2f0082615d99565b421161499e5760405163034e628160e31b815260040160405180910390fd5b6202a3006149af620d2f0083615d99565b6149b99042615db1565b11156149d857604051630698ebd160e01b815260040160405180910390fd5b60006149e386613cf0565b905060008186116149f457856149f6565b815b905080614a1657604051630757247760e01b815260040160405180910390fd5b614a208782613e1c565b614a546001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168683613f82565b866001600160a01b03167f85082129d87b2fe11527cb1b3b7a520aeb5aa6913f88a3d8757fe40d1db02fdd82604051614a8f91815260200190565b60405180910390a29695505050505050565b6001600160a01b0382161580614abe57506001600160a01b038116155b15614adc57604051639fabe1c160e01b815260040160405180910390fd5b6001600160a01b038216600090815260076020526040902054614b125760405163ba112c9360e01b815260040160405180910390fd5b6001600160a01b03821660009081526007602052604081208054614b3890600190615db1565b81548110614b4857614b48615dc8565b600091825260208083206040805160808101825291909301546001600160801b038116825265ffffffffffff600160801b82048116938301849052600160b01b82041693820184905263ffffffff600160e01b9091041660608201529350614bb09190615e71565b65ffffffffffff169050804211614bda5760405163342ad40160e11b815260040160405180910390fd5b81516001600160801b0316614c02576040516329409fa960e21b815260040160405180910390fd5b614c0f6212750082615d99565b4211614c2e57604051630807174160e01b815260040160405180910390fd5b81600001516001600160801b031660086000828254614c4d9190615db1565b9091555050600854614c5e9061517d565b614c6c84600042600061528c565b6001600160a01b03841660009081526016602090815260408083208390556017909152812081905562093a80614ca28342615db1565b614cac9190615e32565b90506000600e5482614cbe9190615e13565b90506000612710821015614cf557845161271090614ce69084906001600160801b0316615e13565b614cf09190615e32565b614d01565b84516001600160801b03165b9050614d0e878783613b11565b8451600854604080516001600160801b039093168352602083018490528201526001600160a01b0380881691908916907f33bb5b368706c907ea437845bca126e379fa73a6ff7501cb509ec7f3fd983d529060600160405180910390a350505050505050565b6001600160a01b038116614d8757600080fd5b6001600160a01b038116600090815260076020526040902054614dbd5760405163ba112c9360e01b815260040160405180910390fd5b6001600160a01b03811660009081526007602052604081208054614de390600190615db1565b81548110614df357614df3615dc8565b600091825260208083206040805160808101825291909301546001600160801b038116825265ffffffffffff600160801b82048116938301849052600160b01b82041693820184905263ffffffff600160e01b9091041660608201529350614e5b9190615e71565b65ffffffffffff169050804211614e855760405163342ad40160e11b815260040160405180910390fd5b81516001600160801b0316614ead576040516329409fa960e21b815260040160405180910390fd5b81600001516001600160801b031660086000828254614ecc9190615db1565b9091555050600854614edd9061517d565b6001600160a01b038316600090815260166020908152604080832083905560179091528120819055614f12908490428161528c565b81516008546040516001600160a01b038616927ff7870c5b224cbc19873599e46ccfc7103934650509b1af0c3ce90138377c200492614f64926001600160801b03929092168252602082015260400190565b60405180910390a2505050565b816001600160a01b0316836001600160a01b031614158015614f9257508015155b15613f7d576001600160a01b03831615615088576001600160a01b0383166000908152600c602052604081205490811561501a576001600160a01b0385166000908152600c60205260409020614fe9600184615db1565b81548110614ff957614ff9615dc8565b600091825260209091200154600160201b90046001600160e01b031661501d565b60005b6001600160e01b0316905060006150348483615db1565b90506150408682615911565b60408051838152602081018390526001600160a01b038816917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a25050505b6001600160a01b03821615613f7d576001600160a01b0382166000908152600c602052604081205490811561510b576001600160a01b0384166000908152600c602052604090206150da600184615db1565b815481106150ea576150ea615dc8565b600091825260209091200154600160201b90046001600160e01b031661510e565b60005b6001600160e01b0316905060006151258483615d99565b90506151318582615911565b60408051838152602081018390526001600160a01b038716917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a2505050505050565b60095480158015906151c35750436009615198600184615db1565b815481106151a8576151a8615dc8565b600091825260209091200154600160e01b900463ffffffff16145b1561521b576151d182613d74565b60096151de600184615db1565b815481106151ee576151ee615dc8565b600091825260209091200180546001600160e01b0319166001600160e01b03929092169190911790555050565b6009604051806040016040528061523185613d74565b6001600160e01b0316815260200161524843613da2565b63ffffffff9081169091528254600181018455600093845260209384902083519490930151909116600160e01b026001600160e01b03909316929092179101555050565b6001600160a01b03841660009081526007602052604090205480158015906152ff57506001600160a01b038516600090815260076020526040902043906152d4600184615db1565b815481106152e4576152e4615dc8565b600091825260209091200154600160e01b900463ffffffff16145b156153c6576001600160a01b0385166000908152600760205260408120615327600184615db1565b8154811061533757615337615dc8565b90600052602060002001905061534c85613dc9565b81546001600160801b0319166001600160801b039190911617815561537083613df3565b815465ffffffffffff91909116600160b01b0265ffffffffffff60b01b1990911617815561539d84613df3565b815465ffffffffffff91909116600160801b0265ffffffffffff60801b1990911617905561336f565b6001600160a01b0385166000908152600760205260409081902081516080810190925290806153f487613dc9565b6001600160801b0316815260200161540b86613df3565b65ffffffffffff16815260200161542185613df3565b65ffffffffffff16815260200161543743613da2565b63ffffffff90811690915282546001810184556000938452602093849020835191018054948401516040850151606090950151909316600160e01b026001600160e01b0365ffffffffffff958616600160b01b02166001600160b01b0395909416600160801b026001600160b01b03199096166001600160801b03909316929092179490941792909216171790555050505050565b6001600160a01b03831615615504576154e483613cf0565b81111561550457604051630757247760e01b815260040160405180910390fd5b61550d83613040565b6001600160a01b038084166000818152600a602052604090205491841614613b0b5761553883613040565b615547818385611aa987611d79565b6001600160a01b0384166000908152600a60205260409020558161556a85611d79565b14801561557657508015155b15613b0b575050506001600160a01b03166000908152600a6020526040812055565b6001600160a01b038084166000908152600b6020526040808220548584168352912054613f7d92918216911683614f71565b600061561f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316615a8c9092919063ffffffff16565b805190915015613f7d578080602001905181019061563d9190615e54565b613f7d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611535565b6001600160a01b0382166156f25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401611535565b6156fe600083836154cc565b80600260008282546157109190615d99565b90915550506001600160a01b0382166000908152602081905260408120805483929061573d908490615d99565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a361105260008383615598565b60006157db7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000615d99565b4211156157ff57601154601254146157f857601154601255426013555b5060115490565b622819a06013546158109190615d99565b42101561581e575060125490565b60007f0000000000000000000000000000000000000000000000000000000000000000622819a06011547f00000000000000000000000000000000000000000000000000000000000000006158739190615db1565b61587d9190615e13565b6158879190615e32565b90506000622819a06013544261589d9190615db1565b6158a79190615e32565b905060006158b58284615e13565b90506000601154826012546158ca9190615db1565b116158d7576011546158e5565b816012546158e59190615db1565b601281905590506158f9622819a084615e13565b6013546159069190615d99565b601355949350505050565b6001600160a01b0382166000908152600c6020526040902054801580159061597d57506001600160a01b0383166000908152600c602052604090204390615959600184615db1565b8154811061596957615969615dc8565b60009182526020909120015463ffffffff16145b156159f45761598b82613d74565b6001600160a01b0384166000908152600c602052604090206159ae600184615db1565b815481106159be576159be615dc8565b9060005260206000200160000160046101000a8154816001600160e01b0302191690836001600160e01b03160217905550505050565b60006159ff43613da2565b9050600c6000856001600160a01b03166001600160a01b0316815260200190815260200160002060405180604001604052808363ffffffff168152602001615a4686613d74565b6001600160e01b039081169091528254600181018455600093845260209384902083519490930151909116600160201b0263ffffffff9093169290921791015550505050565b6060611aae8484600085856001600160a01b0385163b615aee5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611535565b600080866001600160a01b03168587604051615b0a9190615eb1565b60006040518083038185875af1925050503d8060008114615b47576040519150601f19603f3d011682016040523d82523d6000602084013e615b4c565b606091505b50915091506112d582828660608315615b665750816114f9565b825115615b765782518084602001fd5b8160405162461bcd60e51b81526004016115359190615bf3565b80356001600160a01b0381168114615ba757600080fd5b919050565b600060208284031215615bbe57600080fd5b6114f982615b90565b60005b83811015615be2578181015183820152602001615bca565b83811115613b0b5750506000910152565b6020815260008251806020840152615c12816040850160208701615bc7565b601f01601f19169190910160400192915050565b60008060408385031215615c3957600080fd5b615c4283615b90565b946020939093013593505050565b60008060408385031215615c6357600080fd5b50508035926020909101359150565b600060208284031215615c8457600080fd5b5035919050565b600080600060608486031215615ca057600080fd5b615ca984615b90565b9250615cb760208501615b90565b9150604084013590509250925092565b60008060408385031215615cda57600080fd5b82359150615cea60208401615b90565b90509250929050565b60008060408385031215615d0657600080fd5b615d0f83615b90565b9150615cea60208401615b90565b8015158114611c6957600080fd5b600060208284031215615d3d57600080fd5b81356114f981615d1d565b600181811c90821680615d5c57607f821691505b60208210811415615d7d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115615dac57615dac615d83565b500190565b600082821015615dc357615dc3615d83565b500390565b634e487b7160e01b600052603260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000816000190483118215151615615e2d57615e2d615d83565b500290565b600082615e4f57634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215615e6657600080fd5b81516114f981615d1d565b600065ffffffffffff808316818516808303821115615e9257615e92615d83565b01949350505050565b634e487b7160e01b600052602160045260246000fd5b60008251615ec3818460208701615bc7565b919091019291505056fea26469706673582212205de99ce3beadd2782787751938837129c8fe7093f0c433b272e3349fc02079f364736f6c634300080a0033000000000000000000000000ab846fb6c81370327e784ae7cbb6d6a6af6ff4bf0000000000000000000000000792dcb7080466e4bbc678bdb873fe7d969832b8000000000000000000000000d684e3cf1d06af87dc003532062c6ea4a9593b89000000000000000000000000fbc87eac3f8cddea97e2e20eb703c0eb81ce0ccd00000000000000000000000000000000000000000000000000872fdd8883387c00000000000000000000000000000000000000000000000000288e5c0f5a90f20000000000000000000000000000000000000000000000000000000003c267000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000000053444835ec580000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106105045760003560e01c80638381e18211610299578063caa6fea411610167578063e30c3978116100d9578063f4359ce511610092578063f4359ce514610da7578063f44c1b7b14610db1578063f6bab08914610dba578063fb27494e14610dda578063fd0e15f614610de2578063fd967f4714610df557600080fd5b8063e30c397814610d23578063e9ee2fa914610d36578063eb24a4ad14610d47578063eff0d62c14610d6e578063f081858314610d81578063f2fde38b14610d9457600080fd5b8063d5999a5c1161012b578063d5999a5c14610c96578063d6f597ee14610ca0578063da90a0c114610cc7578063dc01f60d14610ce7578063dd62ed3e14610d07578063e0d3bbd714610d1a57600080fd5b8063caa6fea414610c32578063cb2bf86614610c3f578063ccf352ad14610c76578063d2253c3114610c7f578063d4cfd62714610c8e57600080fd5b8063a457c2d71161020b578063b369460c116101c4578063b369460c14610b97578063b4b5ea5714610baa578063b6f78e5614610bbd578063bf2bc81914610be4578063c7a21ce114610bf7578063c98ec02814610c0057600080fd5b8063a457c2d714610ad0578063a694fc3a14610ae3578063a69df4b514610af6578063a9059cbb14610afe578063aa33fedb14610b11578063ac6e431614610b6057600080fd5b806396c551751161025d57806396c5517514610a1f5780639b7d02ad14610a325780639bd2a16e14610a5b5780639d8e217714610a825780639fba1ffe14610a91578063a3c2710d14610ab857600080fd5b80638381e182146109d65780638da5cb5b146109e957806393203e67146109fa578063948b6dd414610a0457806395d89b4114610a1757600080fd5b80634ad9a29c116103d65780636fcfff451161034857806378b4330f1161030157806378b4330f1461097157806379b578621461097b57806379ba50971461098557806379ffdf401461098d5780637df14854146109955780638273a411146109a857600080fd5b80636fcfff45146108f457806370a082311461091d578063715018a6146109305780637423031e146109385780637866430e14610956578063787a08a61461096957600080fd5b8063587cde1e1161039a578063587cde1e1461086c57806359ae84ee146108955780635a1417f01461089d5780635c19a95c146108c457806366d587b3146108d75780636e99d52f146108ea57600080fd5b80634ad9a29c146107ac5780634f1bfc9e146107bf578063536b1bc3146107ca57806353a714111461081e5780635579ed011461084557600080fd5b80631c5a09141161047a578063313ce56711610433578063313ce56714610748578063379607f514610757578063395093511461076a5780633a46b1a81461077d57806347b02ba8146107905780634abaabf5146107a357600080fd5b80631c5a0914146106875780632140fb401461069a57806323b872dd146106fc57806325d998bb1461070f57806329c38e89146107225780632f940c701461073557600080fd5b80630e905435116104cc5780630e905435146105e45780631338736f146105f757806314fd87601461060c578063155bcbbd1461064957806316d3bfbb1461067457806318160ddd1461067f57600080fd5b806301320fe21461050957806306fdde031461053c57806308dc98ca14610551578063095ea7b31461058a5780630cdfebfa146105ad575b600080fd5b610529610517366004615bac565b600a6020526000908152604090205481565b6040519081526020015b60405180910390f35b610544610dfe565b6040516105339190615bf3565b61052961055f366004615bac565b6001600160a01b0316600090815260146020526040902054600160801b90046001600160801b031690565b61059d610598366004615c26565b610e90565b6040519015158152602001610533565b6105c06105bb366004615c26565b610eaa565b6040805163ffffffff90931683526001600160e01b03909116602083015201610533565b6105296105f2366004615bac565b610ef0565b61060a610605366004615c50565b610fe8565b005b61061f61061a366004615c72565b611056565b6040805182516001600160e01b0316815260209283015163ffffffff169281019290925201610533565b60195461065c906001600160a01b031681565b6040516001600160a01b039091168152602001610533565b6105296301e1338081565b600254610529565b61060a610695366004615c72565b6112e0565b6106ad6106a8366004615bac565b6113c6565b6040805182516001600160801b0316815260208084015165ffffffffffff9081169183019190915283830151169181019190915260609182015163ffffffff1691810191909152608001610533565b61059d61070a366004615c8b565b6114da565b61052961071d366004615bac565b611500565b61060a610730366004615c72565b61150b565b610529610743366004615cc7565b61156f565b60405160128152602001610533565b61060a610765366004615c72565b611894565b61059d610778366004615c26565b6119bd565b61052961078b366004615c26565b6119df565b61052961079e366004615c8b565b611a81565b61052960125481565b6105296107ba366004615c50565b611ab6565b6105296303c2670081565b6107fe6107d8366004615bac565b6014602052600090815260409020546001600160801b0380821691600160801b90041682565b604080516001600160801b03938416815292909116602083015201610533565b6105297f0000000000000000000000000000000000000000000000001bc16d674ec8000081565b61065c7f000000000000000000000000d684e3cf1d06af87dc003532062c6ea4a9593b8981565b61065c61087a366004615bac565b600b602052600090815260409020546001600160a01b031681565b61060a611c3d565b6105297f00000000000000000000000000000000000000000000000000872fdd8883387c81565b61060a6108d2366004615bac565b611c6c565b61060a6108e5366004615c72565b611c9a565b610529620d2f0081565b610529610902366004615bac565b6001600160a01b03166000908152600c602052604090205490565b61052961092b366004615bac565b611d79565b61060a611d94565b6010546107fe906001600160801b0380821691600160801b90041682565b61060a610964366004615c72565b611dca565b61060a611e63565b61052962784ce081565b6105296202a30081565b61060a611ee7565b61061f611f99565b60185461065c906001600160a01b031681565b6109bb6109b6366004615bac565b61202d565b60408051938452602084019290925290820152606001610533565b6105296109e4366004615cc7565b61213e565b6005546001600160a01b031661065c565b6105296212750081565b610529610a12366004615c50565b612170565b6105446121e3565b61060a610a2d366004615bac565b6121f2565b610529610a40366004615bac565b6001600160a01b031660009081526007602052604090205490565b61065c7f000000000000000000000000ab846fb6c81370327e784ae7cbb6d6a6af6ff4bf81565b610529670de0b6b3a764000081565b6105297f00000000000000000000000000000000000000000000000053444835ec58000081565b601054600160801b90046001600160801b0316610529565b61059d610ade366004615c26565b61225c565b610529610af1366004615c72565b6122e2565b61060a612313565b61059d610b0c366004615c26565b612376565b610b24610b1f366004615c26565b612384565b604080516001600160801b0395909516855265ffffffffffff9384166020860152919092169083015263ffffffff166060820152608001610533565b610b73610b6e366004615c72565b6123e4565b604080516001600160e01b03909316835263ffffffff909116602083015201610533565b61065c610ba5366004615c26565b61241c565b610529610bb8366004615bac565b6126d9565b6105297f000000000000000000000000000000000000000000000000000000006272311481565b61060a610bf2366004615bac565b61289c565b61052960085481565b610529610c0e366004615bac565b6001600160a01b03166000908152601460205260409020546001600160801b031690565b600f5461059d9060ff1681565b610c52610c4d366004615c26565b6128c9565b6040805163ffffffff90931683526001600160a01b03909116602083015201610533565b610529600e5481565b6105296706f05b59d3b2000081565b61060a61290f565b610529622819a081565b6105297f0000000000000000000000000000000000000000000000000000000003c2670081565b610529610cd5366004615bac565b60166020526000908152604090205481565b610529610cf5366004615bac565b60156020526000908152604090205481565b610529610d15366004615cf3565b61295d565b61052960135481565b60065461065c906001600160a01b031681565b6010546001600160801b0316610529565b6105297f0000000000000000000000000000000000000000000000000de0b6b3a764000081565b61060a610d7c366004615d2b565b612988565b61060a610d8f366004615bac565b6129c5565b61060a610da2366004615bac565b612a11565b61052962093a8081565b61052960115481565b610529610dc8366004615bac565b60176020526000908152604090205481565b600954610529565b6106ad610df0366004615c26565b612ae3565b61052961271081565b606060038054610e0d90615d48565b80601f0160208091040260200160405190810160405280929190818152602001828054610e3990615d48565b8015610e865780601f10610e5b57610100808354040283529160200191610e86565b820191906000526020600020905b815481529060010190602001808311610e6957829003601f168201915b5050505050905090565b600033610e9e818585612b46565b60019150505b92915050565b600c6020528160005260406000208181548110610ec657600080fd5b60009182526020909120015463ffffffff81169250600160201b90046001600160e01b0316905082565b600f5460009060ff1680610f0b57506001600160a01b038216155b15610f1857506000919050565b6001600160a01b0382166000908152601460209081526040918290208251808401909352546001600160801b038082168452600160801b90910416908201819052421415610f7d5750506001600160a01b031660009081526015602052604090205490565b6001600160a01b03831660009081526015602090815260409091205482519183015190916001600160801b03908116914291161015610fc457610fc1601254612c6a565b90505b6000610fd1868584612d50565b509050610fde8184615d99565b9695505050505050565b600f5460ff161561100c57604051637bef0aeb60e01b815260040160405180910390fd5b61101533612f92565b61101e33613040565b336000908152600b60205260409020546001600160a01b0316611045576110453333613174565b6110523383836000613376565b5050565b604080518082019091526000808252602082015243821061108a57604051631391e11b60e21b815260040160405180910390fd5b6040805180820190915260008082526020820152600980549084906110b0600184615db1565b815481106110c0576110c0615dc8565b600091825260209091200154600160e01b900463ffffffff161161113b5760096110eb600183615db1565b815481106110fb576110fb615dc8565b6000918252602091829020604080518082019091529101546001600160e01b0381168252600160e01b900463ffffffff1691810191909152949350505050565b83600960008154811061115057611150615dc8565b600091825260209091200154600160e01b900463ffffffff161115611176575092915050565b6000611183600183615db1565b90506000805b828210156112735761119b8284613a7c565b905086600982815481106111b1576111b1615dc8565b600091825260209091200154600160e01b900463ffffffff16141561122657600981815481106111e3576111e3615dc8565b6000918252602091829020604080518082019091529101546001600160e01b0381168252600160e01b900463ffffffff1691810191909152979650505050505050565b866009828154811061123a5761123a615dc8565b600091825260209091200154600160e01b900463ffffffff16111561126157809250611189565b61126c816001615d99565b9150611189565b82156112d3576009611286600185615db1565b8154811061129657611296615dc8565b6000918252602091829020604080518082019091529101546001600160e01b0381168252600160e01b900463ffffffff16918101919091526112d5565b845b979650505050505050565b600f5460ff161561130457604051637bef0aeb60e01b815260040160405180910390fd5b61130d33612f92565b3360009081526007602052604090205461133a5760405163ba112c9360e01b815260040160405180910390fd5b336000908152600760205260408120805461135790600190615db1565b8154811061136757611367615dc8565b600091825260209091200180549091506001600160801b031661139d576040516329409fa960e21b815260040160405180910390fd5b6113a633613040565b80546110529033908490600160b01b900465ffffffffffff166001613376565b604080516080810182526000808252602082018190529181018290526060810191909152600f5460ff168061141157506001600160a01b038216600090815260076020526040902054155b1561143f57505060408051608081018252600080825260208201819052918101829052606081019190915290565b6001600160a01b0382166000908152600760205260409020805461146590600190615db1565b8154811061147557611475615dc8565b60009182526020918290206040805160808101825292909101546001600160801b0381168352600160801b810465ffffffffffff90811694840194909452600160b01b810490931690820152600160e01b90910463ffffffff16606082015292915050565b6000336114e8858285613a97565b6114f3858585613b11565b60019150505b9392505050565b6000610ea482613cf0565b6005546001600160a01b0316331461153e5760405162461bcd60e51b815260040161153590615dde565b60405180910390fd5b80158061154c575061138881115b1561156a5760405163c4718a2d60e01b815260040160405180910390fd5b600e55565b600f5460009060ff16611595576040516303ca9f4d60e11b815260040160405180910390fd5b826115b357604051630e5a744960e41b815260040160405180910390fd5b6001600160a01b0382166115da57604051639fabe1c160e01b815260040160405180910390fd5b33600090815260076020526040902054156117f957336000908152600760205260408120805461160c90600190615db1565b8154811061161c5761161c615dc8565b600091825260209091200180549091506001600160801b03161580159061165257508054600160b01b900465ffffffffffff1615155b156117f7578054600880546001600160801b0390921691600090611677908490615db1565b9250508190555060096040518060400160405280611696600854613d74565b6001600160e01b031681526020016116ad43613da2565b63ffffffff908116909152825460018101845560009384526020808520845194820151909316600160e01b026001600160e01b039094169390931791015533825260079052604080822081516080810190925291819061170c90613dc9565b6001600160801b0316815260200161172342613df3565b65ffffffffffff16815260200161173a6000613df3565b65ffffffffffff16815260200161175043613da2565b63ffffffff908116909152825460018101845560009384526020808520845192018054858301516040808801516060909801516001600160801b039096166001600160b01b031990931692909217600160801b65ffffffffffff92831602176001600160b01b0316600160b01b91909716026001600160e01b031695909517600160e01b939094169290920292909217905533835260168152818320839055601790528120555b505b600061180433611d79565b905060008185116118155784611817565b815b90506118233382613e1c565b6118576001600160a01b037f000000000000000000000000ab846fb6c81370327e784ae7cbb6d6a6af6ff4bf168583613f82565b60405181815233907f571394674ec9d9e81517060110f8f894ce912af2b2febc091bee0cdea68adf009060200160405180910390a2949350505050565b600f5460ff16156118b857604051637bef0aeb60e01b815260040160405180910390fd5b6118c133613040565b806118df576040516334b2073960e11b815260040160405180910390fd5b33600090815260156020526040812054821061190a573360009081526015602052604090205461190c565b815b905080611917575050565b33600081815260156020526040902080548390039055611984907f000000000000000000000000ab846fb6c81370327e784ae7cbb6d6a6af6ff4bf6001600160a01b0316907f000000000000000000000000d684e3cf1d06af87dc003532062c6ea4a9593b899084613fe5565b60405181815233907f1f89f96333d3133000ee447473151fa9606543368f02271c9d95ae14f13bcc679060200160405180910390a25050565b600033610e9e8185856119d0838361295d565b6119da9190615d99565b612b46565b6000806119ec848461401d565b905060006119fa85856142e4565b90506000856001600160a01b0316611a12878761241c565b6001600160a01b0316148015611a3857506301e13380826040015165ffffffffffff1610155b611a43576000611a75565b8151670de0b6b3a764000090611a6b906706f05b59d3b20000906001600160801b0316615e13565b611a759190615e32565b9050610fde8184615d99565b6001600160a01b0383166000908152600a6020526040812054611aae908385611aa981611d79565b6146c7565b949350505050565b600f5460009060ff1615611add57604051637bef0aeb60e01b815260040160405180910390fd5b611ae633612f92565b33600090815260076020526040902054611b135760405163ba112c9360e01b815260040160405180910390fd5b33600090815260076020526040812054611b2f90600190615db1565b3360009081526007602052604081208054929350909183908110611b5557611b55615dc8565b6000918252602090912001546001600160801b0316905080611b8a576040516329409fa960e21b815260040160405180910390fd5b6000611b963387614784565b336000908152600b60205260409020549091506001600160a01b0316611bc057611bc03333613174565b336000908152600760205260409020805484908110611be157611be1615dc8565b600091825260209091200154600160b01b900465ffffffffffff16851415611c1e57611c1933611c118885615d99565b876001613376565b611c34565b611c3433611c2c8885615d99565b876000613376565b95945050505050565b600f5460ff1615611c6157604051637bef0aeb60e01b815260040160405180910390fd5b611c6961482c565b50565b600f5460ff1615611c9057604051637bef0aeb60e01b815260040160405180910390fd5b611c693382613174565b600f5460ff1615611cbe57604051637bef0aeb60e01b815260040160405180910390fd5b611cc733612f92565b33600090815260076020526040902054611cf45760405163ba112c9360e01b815260040160405180910390fd5b3360009081526007602052604081208054611d1190600190615db1565b81548110611d2157611d21615dc8565b600091825260209091200180549091506001600160801b0316611d57576040516329409fa960e21b815260040160405180910390fd5b611d6033613040565b80546110529033906001600160801b0316846002613376565b6001600160a01b031660009081526020819052604090205490565b6005546001600160a01b03163314611dbe5760405162461bcd60e51b815260040161153590615dde565b611dc860006148c0565b565b6005546001600160a01b03163314611df45760405162461bcd60e51b815260040161153590615dde565b611e3e7f0000000000000000000000000000000000000000000000000000000003c267007f0000000000000000000000000000000000000000000000000000000062723114615d99565b421015611e5e576040516347b8e9f360e11b815260040160405180910390fd5b601155565b600f5460ff1615611e8757604051637bef0aeb60e01b815260040160405180910390fd5b611e9033611d79565b611ead57604051636165515360e11b815260040160405180910390fd5b336000818152600a6020526040808220429055517ff52f50426b32362d3e6bb8cb36b7074756b224622def6352a59eac7f66ebe6e89190a2565b6006546001600160a01b0316611f105760405163d92e233d60e01b815260040160405180910390fd5b6006546001600160a01b03163314611f3b576040516305e05b4b60e31b815260040160405180910390fd5b6006546001600160a01b0316611f50816148c0565b600680546001600160a01b03191690556040516000906001600160a01b038316907fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b908390a350565b6040805180820190915260008082526020820152600f5460ff1615611fd05750604080518082019091526000808252602082015290565b60098054611fe090600190615db1565b81548110611ff057611ff0615dc8565b6000918252602091829020604080518082019091529101546001600160e01b0381168252600160e01b900463ffffffff1691810191909152919050565b60008060008061203c85611d79565b600f5490915060ff168061206657506001600160a01b038516600090815260076020526040902054155b1561207957925060009150829050612137565b6001600160a01b03851660009081526007602052604081205461209e90600190615db1565b6001600160a01b038716600090815260076020526040902080549192508391839081106120cd576120cd615dc8565b60009182526020808320909101546001600160a01b038a1683526007909152604090912080546001600160801b03909216918490811061210f5761210f615dc8565b60009182526020909120015461212e906001600160801b031685615db1565b94509450945050505b9193909250565b600f5460009060ff161561216557604051637bef0aeb60e01b815260040160405180910390fd5b6114f9338484614912565b600f5460009060ff161561219757604051637bef0aeb60e01b815260040160405180910390fd5b6121a033612f92565b60006121ac3385614784565b336000908152600b60205260409020549091506001600160a01b03166121d6576121d63333613174565b6114f93385856000613376565b606060048054610e0d90615d48565b600f5460ff161561221657604051637bef0aeb60e01b815260040160405180910390fd5b336001600160a01b0382161415612240576040516339e65b2b60e21b815260040160405180910390fd5b61224981613040565b61225233613040565b611c698133614aa1565b6000338161226a828661295d565b9050838110156122ca5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401611535565b6122d78286868403612b46565b506001949350505050565b600f5460009060ff161561230957604051637bef0aeb60e01b815260040160405180910390fd5b610ea43383614784565b600f5460ff161561233757604051637bef0aeb60e01b815260040160405180910390fd5b336000908152600760205260409020546123645760405163ba112c9360e01b815260040160405180910390fd5b61236d33613040565b611dc833614d74565b600033610e9e818585613b11565b600760205281600052604060002081815481106123a057600080fd5b6000918252602090912001546001600160801b038116925065ffffffffffff600160801b820481169250600160b01b8204169063ffffffff600160e01b9091041684565b600981815481106123f457600080fd5b6000918252602090912001546001600160e01b0381169150600160e01b900463ffffffff1682565b600043821061243e57604051631391e11b60e21b815260040160405180910390fd5b6001600160a01b0383166000908152600d602052604090205480612466576000915050610ea4565b6001600160a01b0384166000908152600d60205260409020839061248b600184615db1565b8154811061249b5761249b615dc8565b60009182526020909120015463ffffffff161161250a576001600160a01b0384166000908152600d602052604090206124d5600183615db1565b815481106124e5576124e5615dc8565b600091825260209091200154600160201b90046001600160a01b03169150610ea49050565b6001600160a01b0384166000908152600d60205260408120805485929061253357612533615dc8565b60009182526020909120015463ffffffff161115612555576000915050610ea4565b6000612562600183615db1565b90506000805b828210156126725761257a8284613a7c565b6001600160a01b0388166000908152600d6020526040902080549192508791839081106125a9576125a9615dc8565b60009182526020909120015463ffffffff161415612613576001600160a01b0387166000908152600d602052604090208054829081106125eb576125eb615dc8565b600091825260209091200154600160201b90046001600160a01b03169450610ea49350505050565b6001600160a01b0387166000908152600d6020526040902080548791908390811061264057612640615dc8565b60009182526020909120015463ffffffff16111561266057809250612568565b61266b816001615d99565b9150612568565b82156126cc576001600160a01b0387166000908152600d6020526040902061269b600185615db1565b815481106126ab576126ab615dc8565b600091825260209091200154600160201b90046001600160a01b03166112d5565b6000979650505050505050565b600f5460009060ff16156126ef57506000919050565b6001600160a01b0382166000908152600c6020526040812054908115612763576001600160a01b0384166000908152600c60205260409020612732600184615db1565b8154811061274257612742615dc8565b600091825260209091200154600160201b90046001600160e01b0316612766565b60005b6001600160a01b0385166000908152600760205260409020546001600160e01b039190911691508061279a57509392505050565b6001600160a01b03851660009081526007602052604081206127bd600184615db1565b815481106127cd576127cd615dc8565b60009182526020808320909101546001600160a01b03808a16808552600b90935260408420546001600160801b0390921694501614801561286057506001600160a01b03871660009081526007602052604090206301e1338090612832600186615db1565b8154811061284257612842615dc8565b600091825260209091200154600160b01b900465ffffffffffff1610155b61286b576000612890565b670de0b6b3a76400006128866706f05b59d3b2000084615e13565b6128909190615e32565b90506112d58185615d99565b600f5460ff16156128c057604051637bef0aeb60e01b815260040160405180910390fd5b611c6981613040565b600d60205281600052604060002081815481106128e557600080fd5b60009182526020909120015463ffffffff81169250600160201b90046001600160a01b0316905082565b6005546001600160a01b031633146129395760405162461bcd60e51b815260040161153590615dde565b601954601880546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6005546001600160a01b031633146129b25760405162461bcd60e51b815260040161153590615dde565b600f805460ff1916911515919091179055565b6005546001600160a01b031633146129ef5760405162461bcd60e51b815260040161153590615dde565b601980546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b03163314612a3b5760405162461bcd60e51b815260040161153590615dde565b6001600160a01b038116612a625760405163d92e233d60e01b815260040160405180910390fd5b6005546001600160a01b0382811691161415612a915760405163d5e889bf60e01b815260040160405180910390fd5b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b90600090a35050565b604080516080810182526000808252602082018190529181018290526060810191909152600f5460ff1615612b3c5750604080516080810182526000808252602082018190529181018290526060810191909152610ea4565b6114f983836142e4565b6001600160a01b038316612ba85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401611535565b6001600160a01b038216612c095760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401611535565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600080612c7660025490565b604080518082019091526010546001600160801b038082168352600160801b90910416602082015290915060007f00000000000000000000000000000000000000000000000053444835ec580000612cd6670de0b6b3a764000087615e13565b612ce09190615e32565b905060008183602001516001600160801b031642612cfe9190615db1565b612d089190615e13565b90506000808511612d1a576000612d37565b84612d2d670de0b6b3a764000084615e13565b612d379190615e32565b84519091506112d59082906001600160801b0316615d99565b815160009081906001600160801b031681612d6a87613cf0565b90506000858314612f8757612d7e88611d79565b15612f87576000612d8f8488615db1565b6001600160a01b038a166000908152600760205260408120549192509015612f5a576001600160a01b038a16600090815260076020526040812054612dd690600190615db1565b6001600160a01b038c16600090815260076020526040902080549192509082908110612e0457612e04615dc8565b6000918252602090912001546001600160801b031693508315801590612e6d57506001600160a01b038b166000908152600760205260409020805482908110612e4f57612e4f615dc8565b600091825260209091200154600160b01b900465ffffffffffff1615155b15612f58576001600160a01b038b166000908152601660205260409020548015612f56576001600160a01b038c166000908152601760209081526040822054908d01519091908290612ec8906001600160801b031642615db1565b612ed29190615e13565b905082811015612eeb57612ee68184615db1565b612eee565b60005b9950828110612efa5750815b60006002612f088385615d99565b612f129190615e32565b612f1c908c615d99565b9050670de0b6b3a764000080612f32838a615e13565b612f3c908b615e13565b612f469190615e32565b612f509190615e32565b95505050505b505b505b80670de0b6b3a7640000612f6e8487615e13565b612f789190615e32565b612f829190615d99565b965050505b505050935093915050565b6001600160a01b0381163214611c69576018546001600160a01b0316801561105257604051631846d2f560e31b81526001600160a01b03838116600483015282169063c23697a890602401602060405180830381865afa158015612ffa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061301e9190615e54565b15613027575050565b6040516311970e2d60e31b815260040160405180910390fd5b600f5460ff161561304e5750565b600061305861482c565b90506001600160a01b03821661306c575050565b6001600160a01b038216600090815260146020526040902080546001600160801b03600160801b909104164214156130a357505050565b6040805180820190915281546001600160801b038082168352600160801b90910416602082015260009081906130db90869086612d50565b6001600160a01b038716600090815260156020526040812080549395509193508492613108908490615d99565b90915550506001600160a01b038516600090815260166020526040902081905561313142613dc9565b83546001600160801b03918216600160801b02911617835561315284613dc9565b83546001600160801b0319166001600160801b03919091161790925550505050565b6001600160a01b038083166000908152600b60205260408120549091169061319b84611d79565b6001600160a01b038581166000908152600b6020908152604080832080546001600160a01b03191694891694909417909355600d90522054909150801580159061322957506001600160a01b0385166000908152600d602052604090204390613205600184615db1565b8154811061321557613215615dc8565b60009182526020909120015463ffffffff16145b15613299576001600160a01b0385166000908152600d602052604090208490613253600184615db1565b8154811061326357613263615dc8565b9060005260206000200160000160046101000a8154816001600160a01b0302191690836001600160a01b0316021790555061331a565b6001600160a01b0385166000908152600d602052604090819020815180830190925290806132c643613da2565b63ffffffff90811682526001600160a01b038089166020938401528454600181018655600095865294839020845195018054949093015116600160201b026001600160c01b03199093169316929092171790555b836001600160a01b0316836001600160a01b0316866001600160a01b03167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a461336f838584614f71565b5050505050565b6001600160a01b03841661338957600080fd5b826133a757604051630e5a744960e41b815260040160405180910390fd5b60006133b285611d79565b9050808411156133d557604051635d124e8b60e11b815260040160405180910390fd5b62784ce08310156133f9576040516322a68c6b60e21b815260040160405180910390fd5b6303c2670083111561341e57604051634490d10d60e01b815260040160405180910390fd5b6001600160a01b0385166000908152600760205260409020546136f3576001600160a01b03851660009081526007602052604090819020815160808101909252908061346987613dc9565b6001600160801b0316815260200161348042613df3565b65ffffffffffff16815260200161349686613df3565b65ffffffffffff1681526020016134ac43613da2565b63ffffffff9081169091528254600181018455600093845260208085208451920180549185015160408601516060909601516001600160801b039094166001600160b01b031990931692909217600160801b65ffffffffffff93841602176001600160b01b0316600160b01b92909516919091026001600160e01b031693909317600160e01b919092160217905561354b62784ce06303c26700615db1565b670de0b6b3a764000061356162784ce087615db1565b61356b9190615e13565b6135759190615e32565b90506000670de0b6b3a7640000826135cd7f0000000000000000000000000000000000000000000000001bc16d674ec800007f00000000000000000000000000000000000000000000000053444835ec580000615db1565b6135d79190615e13565b6135e19190615e32565b61360b907f0000000000000000000000000000000000000000000000001bc16d674ec80000615d99565b6001600160a01b03881660009081526016602052604090208190559050846136537f0000000000000000000000000000000000000000000000000de0b6b3a764000083615db1565b61365d9190615e32565b6001600160a01b0388166000908152601760205260408120919091556008805488929061368b908490615d99565b909155505060085461369c9061517d565b8442886001600160a01b03167f2b943276e5d747f6f7dd46d3b880d8874cb8d6b9b88ca1903990a2738e7dc7a1896008546040516136e4929190918252602082015260400190565b60405180910390a4505061336f565b6001600160a01b0385166000908152600760205260408120805461371990600190615db1565b8154811061372957613729615dc8565b600091825260208083206040805160808101825291909301546001600160801b038116825265ffffffffffff600160801b82048116938301849052600160b01b82041693820184905263ffffffff600160e01b90910416606082015293506137919190615e71565b825165ffffffffffff91909116915042906001600160801b031615806137b657504282105b156137cc576137c78888838961528c565b61385f565b82516001600160801b03168710156137f757604051630c2ec51360e11b815260040160405180910390fd5b826040015165ffffffffffff168610156138245760405163e282748360e01b815260040160405180910390fd5b600185600281111561383857613838615e9b565b146138435780613851565b826020015165ffffffffffff165b905061385f8888838961528c565b600185600281111561387357613873615e9b565b146139b957600061388b62784ce06303c26700615db1565b670de0b6b3a76400006138a162784ce08a615db1565b6138ab9190615e13565b6138b59190615e32565b90506000670de0b6b3a76400008261390d7f0000000000000000000000000000000000000000000000001bc16d674ec800007f00000000000000000000000000000000000000000000000053444835ec580000615db1565b6139179190615e13565b6139219190615e32565b61394b907f0000000000000000000000000000000000000000000000001bc16d674ec80000615d99565b6001600160a01b038b1660009081526016602052604090208190559050876139937f0000000000000000000000000000000000000000000000000de0b6b3a764000083615db1565b61399d9190615e32565b6001600160a01b038b1660009081526017602052604090205550505b82516001600160801b03168714613a225782516001600160801b0316156139ff5782600001516001600160801b0316600860008282546139f99190615db1565b90915550505b8660086000828254613a119190615d99565b9091555050600854613a229061517d565b8581896001600160a01b03167f2b943276e5d747f6f7dd46d3b880d8874cb8d6b9b88ca1903990a2738e7dc7a18a600854604051613a6a929190918252602082015260400190565b60405180910390a45050505050505050565b6000613a8b6002848418615e32565b6114f990848416615d99565b6000613aa3848461295d565b90506000198114613b0b5781811015613afe5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401611535565b613b0b8484848403612b46565b50505050565b6001600160a01b038316613b755760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401611535565b6001600160a01b038216613bd75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401611535565b613be28383836154cc565b6001600160a01b03831660009081526020819052604090205481811015613c5a5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401611535565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290613c91908490615d99565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051613cdd91815260200190565b60405180910390a3613b0b848484615598565b6001600160a01b038116600090815260076020526040812054613d1657610ea482611d79565b6001600160a01b03821660009081526007602052604090208054613d3c90600190615db1565b81548110613d4c57613d4c615dc8565b6000918252602090912001546001600160801b0316613d6a83611d79565b610ea49190615db1565b60006001600160e01b03821115613d9e576040516345ae522960e11b815260040160405180910390fd5b5090565b600063ffffffff821115613d9e5760405163ef7f0fb160e01b815260040160405180910390fd5b60006001600160801b03821115613d9e57604051633fce143360e01b815260040160405180910390fd5b600065ffffffffffff821115613d9e5760405163c9d6204760e01b815260040160405180910390fd5b6001600160a01b038216613e7c5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401611535565b613e88826000836154cc565b6001600160a01b03821660009081526020819052604090205481811015613efc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401611535565b6001600160a01b0383166000908152602081905260408120838303905560028054849290613f2b908490615db1565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3613f7d83600084615598565b505050565b6040516001600160a01b038316602482015260448101829052613f7d90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526155ca565b6040516001600160a01b0380851660248301528316604482015260648101829052613b0b9085906323b872dd60e01b90608401613fae565b600043821061403f57604051631391e11b60e21b815260040160405180910390fd5b6001600160a01b0383166000908152600c602052604090205480614067576000915050610ea4565b6001600160a01b0384166000908152600c60205260409020839061408c600184615db1565b8154811061409c5761409c615dc8565b60009182526020909120015463ffffffff161161410b576001600160a01b0384166000908152600c602052604090206140d6600183615db1565b815481106140e6576140e6615dc8565b600091825260209091200154600160201b90046001600160e01b03169150610ea49050565b6001600160a01b0384166000908152600c60205260408120805485929061413457614134615dc8565b60009182526020909120015463ffffffff161115614156576000915050610ea4565b6000614163600183615db1565b90506000805b828210156142735761417b8284613a7c565b6001600160a01b0388166000908152600c6020526040902080549192508791839081106141aa576141aa615dc8565b60009182526020909120015463ffffffff161415614214576001600160a01b0387166000908152600c602052604090208054829081106141ec576141ec615dc8565b600091825260209091200154600160201b90046001600160e01b03169450610ea49350505050565b6001600160a01b0387166000908152600c6020526040902080548791908390811061424157614241615dc8565b60009182526020909120015463ffffffff16111561426157809250614169565b61426c816001615d99565b9150614169565b82156142cd576001600160a01b0387166000908152600c6020526040902061429c600185615db1565b815481106142ac576142ac615dc8565b600091825260209091200154600160201b90046001600160e01b03166142d0565b60005b6001600160e01b0316979650505050505050565b60408051608081018252600080825260208201819052918101829052606081019190915243821061432857604051631391e11b60e21b815260040160405180910390fd5b6040805160808101825260008082526020808301829052828401829052606083018290526001600160a01b03871682526007905291909120548061436e57509050610ea4565b6001600160a01b03851660009081526007602052604090208490614393600184615db1565b815481106143a3576143a3615dc8565b600091825260209091200154600160e01b900463ffffffff161161445d576001600160a01b03851660009081526007602052604090206143e4600183615db1565b815481106143f4576143f4615dc8565b60009182526020918290206040805160808101825292909101546001600160801b0381168352600160801b810465ffffffffffff90811694840194909452600160b01b810490931690820152600160e01b90910463ffffffff1660608201529250610ea4915050565b6001600160a01b0385166000908152600760205260408120805486929061448657614486615dc8565b600091825260209091200154600160e01b900463ffffffff1611156144ad57509050610ea4565b60006144ba600183615db1565b90506000805b8282101561461c576144d28284613a7c565b6001600160a01b0389166000908152600760205260409020805491925088918390811061450157614501615dc8565b600091825260209091200154600160e01b900463ffffffff1614156145b6576001600160a01b038816600090815260076020526040902080548290811061454a5761454a615dc8565b60009182526020918290206040805160808101825292909101546001600160801b0381168352600160801b810465ffffffffffff90811694840194909452600160b01b810490931690820152600160e01b90910463ffffffff1660608201529550610ea4945050505050565b6001600160a01b03881660009081526007602052604090208054889190839081106145e3576145e3615dc8565b600091825260209091200154600160e01b900463ffffffff16111561460a578092506144c0565b614615816001615d99565b91506144c0565b82156146b9576001600160a01b0388166000908152600760205260409020614645600185615db1565b8154811061465557614655615dc8565b60009182526020918290206040805160808101825292909101546001600160801b0381168352600160801b810465ffffffffffff90811694840194909452600160b01b810490931690820152600160e01b90910463ffffffff1660608201526146bb565b845b98975050505050505050565b6001600160a01b0382166000908152600a6020526040812054846146ec579050611aae565b806146fb576000915050611aae565b600061470d6202a300620d2f00615d99565b6147179042615db1565b90508082101561472c57600092505050611aae565b600081881061473b578761473d565b425b90508281101561475257829350505050611aae565b61475c8588615d99565b6147668487615e13565b614770838a615e13565b61477a9190615d99565b6146bb9190615e32565b6000816147a457604051630e5a744960e41b815260040160405180910390fd5b6147ae838361569c565b6147e36001600160a01b037f000000000000000000000000ab846fb6c81370327e784ae7cbb6d6a6af6ff4bf16843085613fe5565b826001600160a01b03167febedb8b3c678666e7f36970bc8f57abf6d8fa2e828c0da91ea5b75bf68ed101a8360405161481e91815260200190565b60405180910390a250919050565b60108054600091906001600160801b03600160801b9091041642141561485b57546001600160801b0316919050565b600061486561578f565b9050600061487282612c6a565b905061487d81613dc9565b83546001600160801b0319166001600160801b03919091161783556148a142613dc9565b83546001600160801b03918216600160801b0291161790925550919050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008261493257604051630e5a744960e41b815260040160405180910390fd5b6001600160a01b03821661495957604051639fabe1c160e01b815260040160405180910390fd5b6001600160a01b0384166000908152600a602052604090205461497f620d2f0082615d99565b421161499e5760405163034e628160e31b815260040160405180910390fd5b6202a3006149af620d2f0083615d99565b6149b99042615db1565b11156149d857604051630698ebd160e01b815260040160405180910390fd5b60006149e386613cf0565b905060008186116149f457856149f6565b815b905080614a1657604051630757247760e01b815260040160405180910390fd5b614a208782613e1c565b614a546001600160a01b037f000000000000000000000000ab846fb6c81370327e784ae7cbb6d6a6af6ff4bf168683613f82565b866001600160a01b03167f85082129d87b2fe11527cb1b3b7a520aeb5aa6913f88a3d8757fe40d1db02fdd82604051614a8f91815260200190565b60405180910390a29695505050505050565b6001600160a01b0382161580614abe57506001600160a01b038116155b15614adc57604051639fabe1c160e01b815260040160405180910390fd5b6001600160a01b038216600090815260076020526040902054614b125760405163ba112c9360e01b815260040160405180910390fd5b6001600160a01b03821660009081526007602052604081208054614b3890600190615db1565b81548110614b4857614b48615dc8565b600091825260208083206040805160808101825291909301546001600160801b038116825265ffffffffffff600160801b82048116938301849052600160b01b82041693820184905263ffffffff600160e01b9091041660608201529350614bb09190615e71565b65ffffffffffff169050804211614bda5760405163342ad40160e11b815260040160405180910390fd5b81516001600160801b0316614c02576040516329409fa960e21b815260040160405180910390fd5b614c0f6212750082615d99565b4211614c2e57604051630807174160e01b815260040160405180910390fd5b81600001516001600160801b031660086000828254614c4d9190615db1565b9091555050600854614c5e9061517d565b614c6c84600042600061528c565b6001600160a01b03841660009081526016602090815260408083208390556017909152812081905562093a80614ca28342615db1565b614cac9190615e32565b90506000600e5482614cbe9190615e13565b90506000612710821015614cf557845161271090614ce69084906001600160801b0316615e13565b614cf09190615e32565b614d01565b84516001600160801b03165b9050614d0e878783613b11565b8451600854604080516001600160801b039093168352602083018490528201526001600160a01b0380881691908916907f33bb5b368706c907ea437845bca126e379fa73a6ff7501cb509ec7f3fd983d529060600160405180910390a350505050505050565b6001600160a01b038116614d8757600080fd5b6001600160a01b038116600090815260076020526040902054614dbd5760405163ba112c9360e01b815260040160405180910390fd5b6001600160a01b03811660009081526007602052604081208054614de390600190615db1565b81548110614df357614df3615dc8565b600091825260208083206040805160808101825291909301546001600160801b038116825265ffffffffffff600160801b82048116938301849052600160b01b82041693820184905263ffffffff600160e01b9091041660608201529350614e5b9190615e71565b65ffffffffffff169050804211614e855760405163342ad40160e11b815260040160405180910390fd5b81516001600160801b0316614ead576040516329409fa960e21b815260040160405180910390fd5b81600001516001600160801b031660086000828254614ecc9190615db1565b9091555050600854614edd9061517d565b6001600160a01b038316600090815260166020908152604080832083905560179091528120819055614f12908490428161528c565b81516008546040516001600160a01b038616927ff7870c5b224cbc19873599e46ccfc7103934650509b1af0c3ce90138377c200492614f64926001600160801b03929092168252602082015260400190565b60405180910390a2505050565b816001600160a01b0316836001600160a01b031614158015614f9257508015155b15613f7d576001600160a01b03831615615088576001600160a01b0383166000908152600c602052604081205490811561501a576001600160a01b0385166000908152600c60205260409020614fe9600184615db1565b81548110614ff957614ff9615dc8565b600091825260209091200154600160201b90046001600160e01b031661501d565b60005b6001600160e01b0316905060006150348483615db1565b90506150408682615911565b60408051838152602081018390526001600160a01b038816917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a25050505b6001600160a01b03821615613f7d576001600160a01b0382166000908152600c602052604081205490811561510b576001600160a01b0384166000908152600c602052604090206150da600184615db1565b815481106150ea576150ea615dc8565b600091825260209091200154600160201b90046001600160e01b031661510e565b60005b6001600160e01b0316905060006151258483615d99565b90506151318582615911565b60408051838152602081018390526001600160a01b038716917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a2505050505050565b60095480158015906151c35750436009615198600184615db1565b815481106151a8576151a8615dc8565b600091825260209091200154600160e01b900463ffffffff16145b1561521b576151d182613d74565b60096151de600184615db1565b815481106151ee576151ee615dc8565b600091825260209091200180546001600160e01b0319166001600160e01b03929092169190911790555050565b6009604051806040016040528061523185613d74565b6001600160e01b0316815260200161524843613da2565b63ffffffff9081169091528254600181018455600093845260209384902083519490930151909116600160e01b026001600160e01b03909316929092179101555050565b6001600160a01b03841660009081526007602052604090205480158015906152ff57506001600160a01b038516600090815260076020526040902043906152d4600184615db1565b815481106152e4576152e4615dc8565b600091825260209091200154600160e01b900463ffffffff16145b156153c6576001600160a01b0385166000908152600760205260408120615327600184615db1565b8154811061533757615337615dc8565b90600052602060002001905061534c85613dc9565b81546001600160801b0319166001600160801b039190911617815561537083613df3565b815465ffffffffffff91909116600160b01b0265ffffffffffff60b01b1990911617815561539d84613df3565b815465ffffffffffff91909116600160801b0265ffffffffffff60801b1990911617905561336f565b6001600160a01b0385166000908152600760205260409081902081516080810190925290806153f487613dc9565b6001600160801b0316815260200161540b86613df3565b65ffffffffffff16815260200161542185613df3565b65ffffffffffff16815260200161543743613da2565b63ffffffff90811690915282546001810184556000938452602093849020835191018054948401516040850151606090950151909316600160e01b026001600160e01b0365ffffffffffff958616600160b01b02166001600160b01b0395909416600160801b026001600160b01b03199096166001600160801b03909316929092179490941792909216171790555050505050565b6001600160a01b03831615615504576154e483613cf0565b81111561550457604051630757247760e01b815260040160405180910390fd5b61550d83613040565b6001600160a01b038084166000818152600a602052604090205491841614613b0b5761553883613040565b615547818385611aa987611d79565b6001600160a01b0384166000908152600a60205260409020558161556a85611d79565b14801561557657508015155b15613b0b575050506001600160a01b03166000908152600a6020526040812055565b6001600160a01b038084166000908152600b6020526040808220548584168352912054613f7d92918216911683614f71565b600061561f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316615a8c9092919063ffffffff16565b805190915015613f7d578080602001905181019061563d9190615e54565b613f7d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611535565b6001600160a01b0382166156f25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401611535565b6156fe600083836154cc565b80600260008282546157109190615d99565b90915550506001600160a01b0382166000908152602081905260408120805483929061573d908490615d99565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a361105260008383615598565b60006157db7f0000000000000000000000000000000000000000000000000000000003c267007f0000000000000000000000000000000000000000000000000000000062723114615d99565b4211156157ff57601154601254146157f857601154601255426013555b5060115490565b622819a06013546158109190615d99565b42101561581e575060125490565b60007f0000000000000000000000000000000000000000000000000000000003c26700622819a06011547f00000000000000000000000000000000000000000000000000872fdd8883387c6158739190615db1565b61587d9190615e13565b6158879190615e32565b90506000622819a06013544261589d9190615db1565b6158a79190615e32565b905060006158b58284615e13565b90506000601154826012546158ca9190615db1565b116158d7576011546158e5565b816012546158e59190615db1565b601281905590506158f9622819a084615e13565b6013546159069190615d99565b601355949350505050565b6001600160a01b0382166000908152600c6020526040902054801580159061597d57506001600160a01b0383166000908152600c602052604090204390615959600184615db1565b8154811061596957615969615dc8565b60009182526020909120015463ffffffff16145b156159f45761598b82613d74565b6001600160a01b0384166000908152600c602052604090206159ae600184615db1565b815481106159be576159be615dc8565b9060005260206000200160000160046101000a8154816001600160e01b0302191690836001600160e01b03160217905550505050565b60006159ff43613da2565b9050600c6000856001600160a01b03166001600160a01b0316815260200190815260200160002060405180604001604052808363ffffffff168152602001615a4686613d74565b6001600160e01b039081169091528254600181018455600093845260209384902083519490930151909116600160201b0263ffffffff9093169290921791015550505050565b6060611aae8484600085856001600160a01b0385163b615aee5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611535565b600080866001600160a01b03168587604051615b0a9190615eb1565b60006040518083038185875af1925050503d8060008114615b47576040519150601f19603f3d011682016040523d82523d6000602084013e615b4c565b606091505b50915091506112d582828660608315615b665750816114f9565b825115615b765782518084602001fd5b8160405162461bcd60e51b81526004016115359190615bf3565b80356001600160a01b0381168114615ba757600080fd5b919050565b600060208284031215615bbe57600080fd5b6114f982615b90565b60005b83811015615be2578181015183820152602001615bca565b83811115613b0b5750506000910152565b6020815260008251806020840152615c12816040850160208701615bc7565b601f01601f19169190910160400192915050565b60008060408385031215615c3957600080fd5b615c4283615b90565b946020939093013593505050565b60008060408385031215615c6357600080fd5b50508035926020909101359150565b600060208284031215615c8457600080fd5b5035919050565b600080600060608486031215615ca057600080fd5b615ca984615b90565b9250615cb760208501615b90565b9150604084013590509250925092565b60008060408385031215615cda57600080fd5b82359150615cea60208401615b90565b90509250929050565b60008060408385031215615d0657600080fd5b615d0f83615b90565b9150615cea60208401615b90565b8015158114611c6957600080fd5b600060208284031215615d3d57600080fd5b81356114f981615d1d565b600181811c90821680615d5c57607f821691505b60208210811415615d7d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115615dac57615dac615d83565b500190565b600082821015615dc357615dc3615d83565b500390565b634e487b7160e01b600052603260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000816000190483118215151615615e2d57615e2d615d83565b500290565b600082615e4f57634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215615e6657600080fd5b81516114f981615d1d565b600065ffffffffffff808316818516808303821115615e9257615e92615d83565b01949350505050565b634e487b7160e01b600052602160045260246000fd5b60008251615ec3818460208701615bc7565b919091019291505056fea26469706673582212205de99ce3beadd2782787751938837129c8fe7093f0c433b272e3349fc02079f364736f6c634300080a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ab846fb6c81370327e784ae7cbb6d6a6af6ff4bf0000000000000000000000000792dcb7080466e4bbc678bdb873fe7d969832b8000000000000000000000000d684e3cf1d06af87dc003532062c6ea4a9593b89000000000000000000000000fbc87eac3f8cddea97e2e20eb703c0eb81ce0ccd00000000000000000000000000000000000000000000000000872fdd8883387c00000000000000000000000000000000000000000000000000288e5c0f5a90f20000000000000000000000000000000000000000000000000000000003c267000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000000053444835ec580000
-----Decoded View---------------
Arg [0] : _palToken (address): 0xAB846Fb6C81370327e784Ae7CbB6d6a6af6Ff4BF
Arg [1] : _admin (address): 0x0792dCb7080466e4Bbc678Bdb873FE7D969832B8
Arg [2] : _rewardsVault (address): 0xd684E3Cf1D06aF87dc003532062c6Ea4a9593b89
Arg [3] : _smartWalletChecker (address): 0xfBc87eaC3f8cDDEa97E2E20eB703C0EB81ce0Ccd
Arg [4] : _startDropPerSecond (uint256): 38051750380517500
Arg [5] : _endDropPerSecond (uint256): 11415525114155250
Arg [6] : _dropDecreaseDuration (uint256): 63072000
Arg [7] : _baseLockBonusRatio (uint256): 1000000000000000000
Arg [8] : _minLockBonusRatio (uint256): 2000000000000000000
Arg [9] : _maxLockBonusRatio (uint256): 6000000000000000000
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 000000000000000000000000ab846fb6c81370327e784ae7cbb6d6a6af6ff4bf
Arg [1] : 0000000000000000000000000792dcb7080466e4bbc678bdb873fe7d969832b8
Arg [2] : 000000000000000000000000d684e3cf1d06af87dc003532062c6ea4a9593b89
Arg [3] : 000000000000000000000000fbc87eac3f8cddea97e2e20eb703c0eb81ce0ccd
Arg [4] : 00000000000000000000000000000000000000000000000000872fdd8883387c
Arg [5] : 00000000000000000000000000000000000000000000000000288e5c0f5a90f2
Arg [6] : 0000000000000000000000000000000000000000000000000000000003c26700
Arg [7] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Arg [8] : 0000000000000000000000000000000000000000000000001bc16d674ec80000
Arg [9] : 00000000000000000000000000000000000000000000000053444835ec580000
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.