More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 44 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Get Reward | 3195497 | 12 hrs ago | IN | 0 S | 0.00178773 | ||||
Early Unlock | 3195035 | 12 hrs ago | IN | 0 S | 0.00341108 | ||||
Create Lock | 3195005 | 12 hrs ago | IN | 0 S | 0.00241016 | ||||
Early Unvest | 3194848 | 12 hrs ago | IN | 0 S | 0.00447344 | ||||
Create Lock | 3126097 | 23 hrs ago | IN | 0 S | 0.00349967 | ||||
Create Lock | 3085702 | 31 hrs ago | IN | 0 S | 0.00265161 | ||||
Increase Lock Am... | 3083419 | 31 hrs ago | IN | 0 S | 0.00229352 | ||||
Get Reward | 3082275 | 31 hrs ago | IN | 0 S | 0.00159963 | ||||
Increase Lock Am... | 3081531 | 31 hrs ago | IN | 0 S | 0.00249652 | ||||
Create Lock | 3030239 | 42 hrs ago | IN | 0 S | 0.00313356 | ||||
Get Reward | 3000920 | 46 hrs ago | IN | 0 S | 0.00193519 | ||||
Early Unvest | 2981265 | 2 days ago | IN | 0 S | 0.00415283 | ||||
Create Lock | 2915417 | 2 days ago | IN | 0 S | 0.00364799 | ||||
Create Lock | 2891728 | 2 days ago | IN | 0 S | 0.00369359 | ||||
Create Lock | 2847263 | 3 days ago | IN | 0 S | 0.00050663 | ||||
Create Lock | 2785635 | 3 days ago | IN | 0 S | 0.00047505 | ||||
Create Lock | 2776609 | 3 days ago | IN | 0 S | 0.00047514 | ||||
Create Lock | 2770889 | 3 days ago | IN | 0 S | 0.00050609 | ||||
Increase Lock Am... | 2753255 | 3 days ago | IN | 0 S | 0.00040172 | ||||
Create Lock | 2750851 | 3 days ago | IN | 0 S | 0.00047514 | ||||
Create Lock | 2749199 | 3 days ago | IN | 0 S | 0.00047506 | ||||
Get Reward | 2729956 | 3 days ago | IN | 0 S | 0.00031216 | ||||
Increase Lock Am... | 2725200 | 3 days ago | IN | 0 S | 0.00050342 | ||||
Increase Lock Am... | 2724838 | 3 days ago | IN | 0 S | 0.00054311 | ||||
Create Lock | 2720504 | 3 days ago | IN | 0 S | 0.00047505 |
Loading...
Loading
Contract Name:
LockboxSonic
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 1000 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.20; import {IGauge} from "./interfaces/IGauge.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {IERC20} from "./ERC20/IERC20.sol"; import {ERC20} from "./ERC20/ERC20NonTransferable.sol"; import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import {AccessControlEnumerable} from "@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol"; contract LockboxSonic is ERC20, ReentrancyGuard, AccessControlEnumerable { error ZeroAmount(); error InvalidTokenOrAddress(); error Paused(); error NotPaused(); error UnderTimeLock(); error InvalidLockDuration(); error NoLock(); error NoVest(); error NotAllowed(); error Expired(); struct Reward { uint rewardRate; uint periodFinish; uint lastUpdateTime; uint rewardPerTokenStored; } struct UserInfo { bool isLocked; bool isVested; uint lockedFor; uint vestedFor; uint lockedAmount; uint vestedAmount; } bytes32 internal constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE"); address public immutable stakingToken; address public immutable gauge; address public immutable beets; address public immutable multisig; address public immutable treasury; address public rewardVester; uint internal constant MINLOCK = 4 * 7 * 86400; uint internal constant MAXLOCK = 26 * 7 * 86400; uint internal constant MAXVEST = 6 * 7 * 86400; uint internal constant DURATION = 7 days; uint internal constant PRECISION = 10 ** 18; uint internal constant PENALTYDIV = 1000; // 60% penalty, 40% to lockers, 10% to treasury uint internal constant EARLYPENALTY = 600; // Used to calculate lockerRetained based on pre-calculated penalty amount. 40% of Total amount = 83.33% of the 60% penalty amount // As it does not return a whole number, we have allowed it to be marginally over the 40% by rounding up to 83.4% uint internal constant LOCKRETAINED = 834; uint internal unsyncedBeets; uint public lastBeetsHarvest; bool public paused; bool public sonicMigration; address[] internal rewards; mapping(address token => Reward) internal _rewardData; mapping(address token => bool) public isReward; mapping(address user => mapping(address token => uint rewardPerToken)) public userRewardPerTokenStored; mapping(address user => mapping(address token => uint reward)) public storedRewardsPerUser; mapping(address user => UserInfo) public userInfo; event LockCreated(address indexed from, uint amount, uint lockEnd); event LockAmountIncreased(address indexed from, uint amount); event LockExtended(address indexed user, uint amount); event LockTransfered(address indexed from, address indexed to, uint amount); event UnlockedEarly(address indexed user, uint received, uint retained); event LockWithdrawn(address indexed user, uint amount); event LockBroken(address indexed user, uint lockAmount); event VestCreated(address indexed user, uint amount, uint vestEnd); event AddedToVest(address indexed user, uint amount); event EarlyUnvest(address indexed user, uint amountReceived, uint amountRetained); event VestWithdrawn(address indexed user, uint amount); event VestBroken(address indexed user, uint vestAmount); event NotifyReward(address indexed from, address indexed reward, uint amount); event ClaimRewards(address indexed from, address indexed reward, uint amount); event EmergencyWithdraw(uint amount); event RewardVesterSet(address indexed newVester); event WasPaused(uint amount); event UnPaused(uint amount); event ShutDown(bool state); constructor( address[3] memory _operators, address _admin, address _treasury, address _stakingtoken, address _gauge, address _rewardVester, address _beets, string memory _name, string memory _symbol ) ERC20(_name, _symbol) ReentrancyGuard() { _grantRole(DEFAULT_ADMIN_ROLE, _admin); _grantRole(OPERATOR_ROLE, _admin); _grantRole(OPERATOR_ROLE, _operators[0]); _grantRole(OPERATOR_ROLE, _operators[1]); _grantRole(OPERATOR_ROLE, _operators[2]); multisig = _admin; treasury = _treasury; stakingToken = _stakingtoken; gauge = _gauge; rewardVester = _rewardVester; beets = _beets; rewards.push(_beets); isReward[_beets] = true; IERC20(stakingToken).approve(_gauge, type(uint).max); } modifier updateReward(address account) { _updateReward(account); _; } /// @dev compiled with via-ir, caching is less efficient function _updateReward(address account) internal { for (uint i; i < rewards.length; i++) { _rewardData[rewards[i]].rewardPerTokenStored = rewardPerToken( rewards[i] ); _rewardData[rewards[i]].lastUpdateTime = lastTimeRewardApplicable( rewards[i] ); if (account != address(0)) { storedRewardsPerUser[account][rewards[i]] = earned( rewards[i], account ); userRewardPerTokenStored[account][rewards[i]] = _rewardData[ rewards[i] ].rewardPerTokenStored; } } } // Returns current reward list function rewardsList() external view returns (address[] memory _rewards) { _rewards = rewards; } function rewardsListLength() external view returns (uint _length) { _length = rewards.length; } /// @notice returns the last time the reward was modified or periodFinish if the reward has ended function lastTimeRewardApplicable(address token) public view returns (uint) { return Math.min(_getTimestamp(), _rewardData[token].periodFinish); } // Returns struct with all stored info regarding a reward token. function rewardData(address token) external view returns (Reward memory data) { data = _rewardData[token]; } // Returns depositor's accrued rewards function earned(address token,address account) public view returns (uint _reward) { uint userRewardRate = _getUserRewardRate(); _reward = (((balanceOf(account) * (rewardPerToken(token) - userRewardPerTokenStored[account][token])) / PRECISION) * userRewardRate) / 100 + storedRewardsPerUser[account][token]; } /// @notice claims all pending locked and non locked rewards for depositor function getReward() public nonReentrant updateReward(msg.sender) { address user = msg.sender; UserInfo storage account = userInfo[user]; for (uint i; i < rewards.length; i++) { uint reward = storedRewardsPerUser[user][rewards[i]]; if (reward > 0) { storedRewardsPerUser[user][rewards[i]] = 0; if(rewards[i] == address(this)){ if(!account.isLocked && !account.isVested){_unlockReward(reward); } else { // If reward is locked LP receipt, sort if amt is assinged to vest or lock. if (!account.isLocked && account.isVested) { // Only Vested account.vestedAmount += reward; } else if (account.isLocked && !account.isVested) { // Only locked account.lockedAmount += reward; } else if (account.isLocked && account.isVested) { if (account.lockedFor >= account.vestedFor) { account.lockedAmount += reward; } else { account.vestedAmount += reward; } } _mint(user, reward); } } else { _safeTransfer(rewards[i], user, reward); } emit ClaimRewards(user, rewards[i], reward); } } } // Returns rewardToken amount function rewardPerToken(address token) public view returns (uint) { if (totalSupply() == 0) { return _rewardData[token].rewardPerTokenStored; } return _rewardData[token].rewardPerTokenStored + ((lastTimeRewardApplicable(token) - _rewardData[token].lastUpdateTime) * _rewardData[token].rewardRate * PRECISION) / totalSupply(); } function _getUserRewardRate() internal view returns (uint) { address user = msg.sender; UserInfo memory account = userInfo[user]; uint baseRate = 70; uint additionalRate; uint timeLeft; if(account.vestedAmount < account.lockedAmount){ timeLeft = lockLeft(user); } else {timeLeft = vestLeft(user);} if (timeLeft > 5 * MINLOCK) { additionalRate = 30; // 5 to 6 months: 100% } else if (timeLeft > 4 * MINLOCK) { additionalRate = 24; // 4 to 5 months: 94% } else if (timeLeft > 3 * MINLOCK) { additionalRate = 18; // 3 to 4 months: 88% } else if (timeLeft > 2 * MINLOCK) { additionalRate = 12; // 2 to 3 months: 82% } else if (timeLeft > MINLOCK) { additionalRate = 6; // 1 to 2 months: 76% } return baseRate + additionalRate; } /// @notice User created Lock. 1-6M duration range. function createLock(uint amount, uint duration) external nonReentrant updateReward(msg.sender){ if(paused){revert Paused();} if(amount == 0) {revert ZeroAmount();} address user = msg.sender; UserInfo storage account = userInfo[user]; if(account.isLocked){revert UnderTimeLock();} // Check if already locked. uint timestamp = _getTimestamp(); uint unlockTime = timestamp + duration; if(unlockTime <= timestamp + MINLOCK){unlockTime = timestamp + MINLOCK;} if(unlockTime >= timestamp + MAXLOCK){unlockTime = timestamp + MAXLOCK;} account.isLocked = true; account.lockedFor = unlockTime; _safeTransferFrom(stakingToken, user, address(this), amount); IGauge(gauge).deposit(amount); _mint(user, amount); account.lockedAmount += amount; emit LockCreated(user, amount, unlockTime); } // Adds an amount to an active lock. function increaseLockAmount(uint amount) external nonReentrant updateReward(msg.sender) { if(paused){revert Paused();} if(amount == 0) {revert ZeroAmount();} address user = msg.sender; UserInfo storage account = userInfo[user]; if(!account.isLocked){revert NoLock();} if(_getTimestamp() >= account.lockedFor){revert Expired();} _safeTransferFrom(stakingToken, user, address(this), amount); IGauge(gauge).deposit(amount); _mint(user, amount); account.lockedAmount += amount; emit LockAmountIncreased(user, amount); } // Extends duration of an ongoing lock function extendLock(uint duration) external nonReentrant { if(paused){revert Paused();} address user = msg.sender; UserInfo storage account = userInfo[user]; if(!account.isLocked){revert NoLock();} uint timestamp = _getTimestamp(); uint unlockTime = timestamp + duration; if(unlockTime <= account.lockedFor){revert InvalidLockDuration();} // Can only increase lock duration if(unlockTime < timestamp + MINLOCK){revert InvalidLockDuration();} // Below 1M min if(unlockTime >= timestamp + MAXLOCK){unlockTime = timestamp + MAXLOCK;} // 26 weeks max lock account.lockedFor = unlockTime; emit LockExtended(user, unlockTime); } function withdrawLock() public nonReentrant updateReward(msg.sender){ address user = msg.sender; UserInfo storage account = userInfo[user]; if(!account.isLocked){revert NoLock();} if(_getTimestamp() < account.lockedFor){revert UnderTimeLock();} account.isLocked = false; uint userLockBal = account.lockedAmount; account.lockedFor = 0; account.lockedAmount = 0; _burn(user, userLockBal); uint gaugeBal = _gaugeBalance(); if(gaugeBal >= userLockBal){ IGauge(gauge).withdraw(userLockBal); } _safeTransfer(stakingToken, user, userLockBal); emit LockWithdrawn(user, userLockBal); } // Allows locker to exit full or partial position with a 40% penalty. function earlyUnlock(uint amount) external nonReentrant updateReward(msg.sender) updateReward(treasury){ address user = msg.sender; UserInfo storage account = userInfo[user]; if(!account.isLocked){revert NoLock();} if(_getTimestamp() >= account.lockedFor){revert Expired();} if(amount == 0) {revert ZeroAmount();} if(amount > account.lockedAmount){amount = account.lockedAmount;} account.lockedAmount -= amount; if(account.lockedAmount == 0){account.isLocked = false; account.lockedFor = 0;} UserInfo storage protocol = userInfo[treasury]; uint earlyPenalty = amount * EARLYPENALTY / PENALTYDIV; uint userReceived = amount - earlyPenalty; uint lockerRetained = earlyPenalty * LOCKRETAINED / PENALTYDIV; uint treasuryRetained = earlyPenalty - lockerRetained; _burn(user, amount); _mint(treasury, treasuryRetained); if(!protocol.isLocked){ protocol.isLocked = true; protocol.lockedFor = block.timestamp + MAXLOCK; protocol.lockedAmount += treasuryRetained; } else { protocol.lockedAmount += treasuryRetained; } _distroEarlyPenalty(lockerRetained); uint gaugeBal = _gaugeBalance(); if(gaugeBal >= userReceived){ IGauge(gauge).withdraw(userReceived); } _safeTransfer(stakingToken, user, userReceived); emit UnlockedEarly(user, userReceived, lockerRetained + treasuryRetained); } // Partial or complete transfer of a lock to new or existing lock. If receiver is locked, lockedFor must >= msg.sender's // If receiver isn't locked, creates one with the same lockedFor as msg.sender function transferLock(address receiver, uint amount) external nonReentrant updateReward(msg.sender) updateReward(receiver){ address user = msg.sender; if(receiver == user){revert InvalidTokenOrAddress();} UserInfo storage senderAccount = userInfo[user]; if(!senderAccount.isLocked){revert NoLock();} if(_getTimestamp() >= senderAccount.lockedFor){revert Expired();} if(amount == 0){revert NotAllowed();} if(amount > senderAccount.lockedAmount){amount = senderAccount.lockedAmount;} UserInfo storage receiverAccount = userInfo[receiver]; if(receiverAccount.isLocked){ if(receiverAccount.lockedFor < senderAccount.lockedFor){revert NotAllowed();} // Can't transfer to shorter lock. } if(!receiverAccount.isLocked){ receiverAccount.isLocked = true; receiverAccount.lockedFor = senderAccount.lockedFor; emit LockCreated(receiver, amount, receiverAccount.lockedFor); } senderAccount.lockedAmount -= amount; if(senderAccount.lockedAmount == 0){ senderAccount.isLocked = false; senderAccount.lockedFor = 0; } _burn(user, amount); _mint(receiver, amount); receiverAccount.lockedAmount += amount; emit LockTransfered(user, receiver, amount); } // Creates vestLock when calling earlyClaim in RewardVester contract. function createVest(address user, uint amount) external nonReentrant updateReward(user){ if(msg.sender != rewardVester){revert NotAllowed();} uint timestamp = _getTimestamp(); UserInfo storage account = userInfo[user]; if(account.isVested){ if(timestamp >= account.vestedFor){revert Expired();} } if(!account.isVested){ uint unlockTime = timestamp + MAXVEST; account.isVested = true; account.vestedFor = unlockTime; emit VestCreated(user, amount, unlockTime); } else { emit AddedToVest(user, amount); } _safeTransferFrom(stakingToken, rewardVester, address(this), amount); account.vestedAmount += amount; IGauge(gauge).deposit(amount); _mint(user, amount); } function withdrawVest() public nonReentrant updateReward(msg.sender) { address user = msg.sender; UserInfo storage account = userInfo[user]; if(!account.isVested){revert NoVest();} if(_getTimestamp() < account.vestedFor){revert UnderTimeLock();} uint amount = account.vestedAmount; account.vestedAmount = 0; account.vestedFor = 0; account.isVested = false; _burn(user, amount); uint gaugeBal = _gaugeBalance(); if(gaugeBal >= amount){ IGauge(gauge).withdraw(amount); } _safeTransfer(stakingToken, user, amount); emit VestWithdrawn(user, amount); } function earlyUnvest(uint amount) external nonReentrant updateReward(msg.sender) updateReward(treasury){ address user = msg.sender; UserInfo storage account = userInfo[user]; if(!account.isVested){revert NoVest();} if(_getTimestamp() >= account.vestedFor){revert Expired();} if(amount == 0) {revert ZeroAmount();} if(amount > account.vestedAmount){amount = account.vestedAmount;} account.vestedAmount -= amount; if(account.vestedAmount == 0){account.isVested = false;} uint earlyPenalty = amount * EARLYPENALTY / PENALTYDIV; uint userReceived = amount - earlyPenalty; uint lockerRetained = earlyPenalty * LOCKRETAINED / PENALTYDIV; uint treasuryRetained = earlyPenalty - lockerRetained; UserInfo storage protocol = userInfo[treasury]; _burn(user, amount); _mint(treasury, treasuryRetained); if(!protocol.isLocked){ protocol.isLocked = true; protocol.lockedFor = block.timestamp + MAXLOCK; protocol.lockedAmount += treasuryRetained; } else { protocol.lockedAmount += treasuryRetained; } _distroEarlyPenalty(lockerRetained); uint gaugeBal = _gaugeBalance(); if(gaugeBal >= userReceived){ IGauge(gauge).withdraw(userReceived); } _safeTransfer(stakingToken, user, userReceived); emit UnlockedEarly(user, userReceived, lockerRetained + treasuryRetained); } /// @notice Transfers vested amount into a new or existing non expired but longer lock function vestToLock(uint amount, uint duration) external nonReentrant{ address user = msg.sender; UserInfo storage account = userInfo[user]; if(!account.isVested){revert NoVest();} if(amount == 0) {revert ZeroAmount();} if(amount > account.vestedAmount){amount = account.vestedAmount;} uint timestamp = _getTimestamp(); if(timestamp >= account.vestedFor){revert Expired();} account.vestedAmount -= amount; if(!account.isLocked){ uint unlockTime = timestamp + duration; if(unlockTime <= account.vestedFor){revert InvalidLockDuration();} // Lock shorter than vest if(unlockTime <= timestamp + MINLOCK){unlockTime = timestamp + MINLOCK;} if(unlockTime >= timestamp + MAXLOCK){unlockTime = timestamp + MAXLOCK;} account.isLocked = true; account.lockedFor = unlockTime; account.lockedAmount += amount; emit LockCreated(user, amount, unlockTime); } else { if(account.vestedFor >= account.lockedFor){revert InvalidLockDuration();} // Lock shorter than vest if(timestamp >= account.lockedFor){revert Expired();} account.lockedAmount += amount; emit LockAmountIncreased(user, amount); } if(account.vestedAmount == 0){account.isVested = false; account.vestedFor = 0;} } // Our protocol is slated to migrate from Fantom Opera to sonic. This function enables lockers to jailBreak if // fMoney Staker is paused in order to bridge their fBUX and lock on Sonic. function breakerOfLocks() external { address user = msg.sender; UserInfo storage account = userInfo[user]; if(!paused){revert NotPaused();} if(!sonicMigration){revert NotAllowed();} if(account.isLocked){ account.lockedFor = 0; emit LockBroken(user, account.lockedAmount); withdrawLock(); } if(account.isVested){ account.vestedFor = 0; emit VestBroken(user, account.vestedAmount); withdrawVest(); } } // Returns, in seconds, how much time is left on a lock. function lockLeft(address user) public view returns(uint){ UserInfo memory account = userInfo[user]; uint timestamp = _getTimestamp(); uint lockEnd = account.lockedFor; if(lockEnd == 0){return 0;} if(timestamp >= lockEnd){return 0;} return lockEnd - timestamp; } // Returns, in seconds, how much time is left on a vest. function vestLeft(address user) public view returns(uint){ UserInfo memory account = userInfo[user]; uint timestamp = _getTimestamp(); uint vestEnd = account.vestedFor; if(vestEnd == 0){return 0;} if(timestamp >= vestEnd){return 0;} return vestEnd - timestamp; } // Returns reward duration function left(address token) public view returns (uint) { uint timestamp = _getTimestamp(); if (timestamp >= _rewardData[token].periodFinish) return 0; uint _remaining = _rewardData[token].periodFinish - timestamp; return _remaining * _rewardData[token].rewardRate; } /// @notice Tops up reward pool for a token function notifyRewardAmount(address token, uint amount) external updateReward(address(0)) onlyRole(DEFAULT_ADMIN_ROLE) { if (amount == 0) {revert ZeroAmount();} if (!isReward[token]) { rewards.push(token); isReward[token] = true; } uint timestamp = _getTimestamp(); address thisContract = address(this); uint periodFinish = _rewardData[token].periodFinish; _rewardData[token].rewardPerTokenStored = rewardPerToken(token); // Check actual amount transferred for compatibility with fee on transfer tokens. uint balanceBefore = _balanceOf(token, thisContract); _safeTransferFrom(token, msg.sender, thisContract, amount); uint balanceAfter = _balanceOf(token, thisContract); amount = balanceAfter - balanceBefore; if (timestamp >= periodFinish) { _rewardData[token].rewardRate = amount / DURATION; } else { uint remaining = periodFinish - timestamp; uint _left = remaining * _rewardData[token].rewardRate; _rewardData[token].rewardRate = (amount + _left) / DURATION; } _rewardData[token].lastUpdateTime = timestamp; _rewardData[token].periodFinish = timestamp + DURATION; emit NotifyReward(msg.sender, token, amount); } // Harvests beets rewards & adds amount to reward pool function harvestBeets() external nonReentrant updateReward(address(0)) { uint timestamp = _getTimestamp(); address thisContract = address(this); if(timestamp < lastBeetsHarvest + 5 days){revert UnderTimeLock();} lastBeetsHarvest = timestamp; uint beetsBalance = _balanceOf(beets, thisContract); IGauge(gauge).claim_rewards(); uint beetsBalanceAfter = _balanceOf(beets, thisContract); uint _unsyncedBeets = beetsBalanceAfter - beetsBalance; _unsyncedBeets += unsyncedBeets; if(_unsyncedBeets == 0){revert ZeroAmount();} unsyncedBeets = 0; _rewardData[beets].rewardPerTokenStored = rewardPerToken(beets); if (timestamp >= _rewardData[beets].periodFinish) { _rewardData[beets].rewardRate = _unsyncedBeets / DURATION; } else { uint remaining = _rewardData[beets].periodFinish - timestamp; uint _left = remaining * _rewardData[beets].rewardRate; _rewardData[beets].rewardRate = (_unsyncedBeets + _left) / DURATION; } _rewardData[beets].lastUpdateTime = timestamp; _rewardData[beets].periodFinish = timestamp + DURATION; emit NotifyReward(msg.sender, beets, _unsyncedBeets); } /// @notice Distributes penalty from early unlocks as locked rewards to Lockers. function _distroEarlyPenalty(uint amount) internal updateReward(address(0)) { address lockReceipt = address(this); if (!isReward[lockReceipt]) { rewards.push(lockReceipt); isReward[lockReceipt] = true; } uint timestamp = _getTimestamp(); _rewardData[lockReceipt].rewardPerTokenStored = rewardPerToken(lockReceipt); if (timestamp >= _rewardData[lockReceipt].periodFinish) { _rewardData[lockReceipt].rewardRate = amount / DURATION; } else { uint remaining = _rewardData[lockReceipt].periodFinish - timestamp; uint _left = remaining * _rewardData[lockReceipt].rewardRate; _rewardData[lockReceipt].rewardRate = (amount + _left) / DURATION; } _rewardData[lockReceipt].lastUpdateTime = timestamp; _rewardData[lockReceipt].periodFinish = timestamp + DURATION; emit NotifyReward(msg.sender, lockReceipt, amount); } //If user has exited lock or vest, getReward calls this func to unlock pending locked Reward and send to user. function _unlockReward(uint amount) internal{ uint gaugeBal = _gaugeBalance(); if(gaugeBal >= amount){ IGauge(gauge).withdraw(amount); } _safeTransfer(stakingToken, msg.sender, amount); } /// @notice Emergency withdraw from chef to staking contract & pause deposits. function emergencyWithdrawFromGauge() external onlyRole(OPERATOR_ROLE){ if(paused){revert Paused();} uint gaugeBal = IGauge(gauge).balanceOf(address(this)); IGauge(gauge).withdraw(gaugeBal); paused = true; uint stakingBal = _balanceOf(stakingToken, address(this)); emit EmergencyWithdraw(stakingBal); } // Unpauses deposits and stakes LP in chef if there's balance in the contract function unpause() external onlyRole(OPERATOR_ROLE){ if(!paused){revert NotPaused();} paused = false; uint stakingBal = _balanceOf(stakingToken, address(this)); if(stakingBal != 0){IGauge(gauge).deposit(stakingBal);} emit UnPaused(stakingBal); } // Recovers token mistakenly sent to the contract if not a protected token. function recoverTokens(address token, address to, uint amount) external onlyRole(DEFAULT_ADMIN_ROLE) { if(token == stakingToken || isReward[token] || token == gauge){revert InvalidTokenOrAddress();} _safeTransfer(token, to, amount); } //To cover a migration/shutdown, rewards can be sent to multisig. function recoverRewards(address token, uint amount) external onlyRole(OPERATOR_ROLE){ if(!paused){revert NotPaused();} if(token == stakingToken){revert InvalidTokenOrAddress();} _safeTransfer(token, multisig, amount); } // To cover a pool migration/contract shutdown, this // admin gated function enables users to dissolve locks if the staker has been emergency withdrawn and is paused. function setShutdown(bool state) external onlyRole(DEFAULT_ADMIN_ROLE){ if(!paused){revert NotPaused();} sonicMigration = state; emit ShutDown(state); } // In the event of a rewardVester change. function setRewardVester(address vester) external onlyRole(DEFAULT_ADMIN_ROLE){ if(vester == address(0)){revert InvalidTokenOrAddress();} rewardVester = vester; emit RewardVesterSet(vester); } // Approval refresh for contract longevity function renewApprovals() external onlyRole(OPERATOR_ROLE){ IERC20(stakingToken).approve(gauge, 0); IERC20(stakingToken).approve(gauge, type(uint).max); } // Returns contract's stakingToken amount deposited in chef & rewardDebt function _gaugeBalance() internal view returns(uint lpAmount){ return IGauge(gauge).balanceOf(address(this)); } function _getTimestamp() internal view returns (uint){ return block.timestamp; } // Internal update function, adds or removes reward shares for a depositor. function _update(address from, address to, uint value) internal override { // if burn or mint if (from == address(0) || to == address(0)) { super._update(from, to, value); } else { _updateReward(from); _updateReward(to); super._update(from, to, value); } } // ERC20 handling function _safeTransfer(address token, address to, uint value) internal { (bool success, bytes memory data) = token.call( abi.encodeCall(IERC20.transfer, (to, value)) ); require(success && (data.length == 0 || abi.decode(data, (bool)))); } function _safeTransferFrom(address token, address from, address to, uint value) internal { (bool success, bytes memory data) = token.call( abi.encodeCall(IERC20.transferFrom, (from, to, value)) ); require(success && (data.length == 0 || abi.decode(data, (bool)))); } function _balanceOf(address token, address account) internal view returns (uint) { (bool success, bytes memory data) = token.staticcall( abi.encodeCall(IERC20.balanceOf, (account)) ); require(success && data.length >= 32); return abi.decode(data, (uint)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "./IAccessControl.sol"; import {Context} from "../utils/Context.sol"; import {ERC165} from "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } mapping(bytes32 role => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with an {AccessControlUnauthorizedAccount} error including the required role. */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual returns (bool) { return _roles[role].hasRole[account]; } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` * is missing `role`. */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert AccessControlUnauthorizedAccount(account, role); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address callerConfirmation) public virtual { if (callerConfirmation != _msgSender()) { revert AccessControlBadConfirmation(); } _revokeRole(role, callerConfirmation); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual returns (bool) { if (!hasRole(role, account)) { _roles[role].hasRole[account] = true; emit RoleGranted(role, account, _msgSender()); return true; } else { return false; } } /** * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { if (hasRole(role, account)) { _roles[role].hasRole[account] = false; emit RoleRevoked(role, account, _msgSender()); return true; } else { return false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol) pragma solidity ^0.8.20; import {IAccessControlEnumerable} from "./IAccessControlEnumerable.sol"; import {AccessControl} from "../AccessControl.sol"; import {EnumerableSet} from "../../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 role => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {AccessControl-_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override returns (bool) { bool granted = super._grantRole(role, account); if (granted) { _roleMembers[role].add(account); } return granted; } /** * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) { bool revoked = super._revokeRole(role, account); if (revoked) { _roleMembers[role].remove(account); } return revoked; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol) pragma solidity ^0.8.20; import {IAccessControl} from "../IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol) pragma solidity ^0.8.20; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev The `account` is missing a role. */ error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); /** * @dev The caller of a function is not the expected one. * * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}. */ error AccessControlBadConfirmation(); /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. */ function renounceRole(bytes32 role, address callerConfirmation) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @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 towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.20; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position is the index of the value in the `values` array plus 1. // Position 0 is used to mean a value is not in the set. mapping(bytes32 value => uint256) _positions; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._positions[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We cache the value's position to prevent multiple reads from the same storage slot uint256 position = set._positions[value]; if (position != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 valueIndex = position - 1; uint256 lastIndex = set._values.length - 1; if (valueIndex != lastIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the lastValue to the index where the value to delete is set._values[valueIndex] = lastValue; // Update the tracked position of the lastValue (that was just moved) set._positions[lastValue] = position; } // Delete the slot where the moved value was stored set._values.pop(); // Delete the tracked position for the deleted slot delete set._positions[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._positions[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity 0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity 0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol) pragma solidity 0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC20Metadata} from "./IERC20Metadata.sol"; import {Context} from "./Context.sol"; import {IERC20Errors} from "./draft-IERC6093.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. */ abstract contract ERC20 is IERC20, IERC20Metadata, IERC20Errors { error TransferDenied(); mapping(address account => uint256) private _balances; mapping(address account => mapping(address spender => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `value`. */ function transfer(address to, uint256 value) public virtual returns (bool) { revert TransferDenied(); } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public virtual returns (bool) { address owner = msg.sender; _approve(owner, spender, value); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `value`. * - the caller must have allowance for ``from``'s tokens of at least * `value`. */ function transferFrom(address from, address to, uint256 value) public virtual returns (bool) { revert TransferDenied(); } /** * @dev Moves a `value` amount of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _transfer(address from, address to, uint256 value) internal { if (from == address(0)) { revert ERC20InvalidSender(address(0)); } if (to == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(from, to, value); } /** * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding * this function. * * Emits a {Transfer} event. */ function _update(address from, address to, uint256 value) internal virtual { if (from == address(0)) { // Overflow check required: The rest of the code assumes that totalSupply never overflows _totalSupply += value; } else { uint256 fromBalance = _balances[from]; if (fromBalance < value) { revert ERC20InsufficientBalance(from, fromBalance, value); } unchecked { // Overflow not possible: value <= fromBalance <= totalSupply. _balances[from] = fromBalance - value; } } if (to == address(0)) { unchecked { // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply. _totalSupply -= value; } } else { unchecked { // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256. _balances[to] += value; } } emit Transfer(from, to, value); } /** * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0). * Relies on the `_update` mechanism * * Emits a {Transfer} event with `from` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _mint(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(address(0), account, value); } /** * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply. * Relies on the `_update` mechanism. * * Emits a {Transfer} event with `to` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead */ function _burn(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidSender(address(0)); } _update(account, address(0), value); } /** * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address owner, address spender, uint256 value) internal { _approve(owner, spender, value, true); } /** * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event. * * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any * `Approval` event during `transferFrom` operations. * * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to * true using the following override: * ``` * function _approve(address owner, address spender, uint256 value, bool) internal virtual override { * super._approve(owner, spender, value, true); * } * ``` * * Requirements are the same as {_approve}. */ function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual { if (owner == address(0)) { revert ERC20InvalidApprover(address(0)); } if (spender == address(0)) { revert ERC20InvalidSpender(address(0)); } _allowances[owner][spender] = value; if (emitEvent) { emit Approval(owner, spender, value); } } /** * @dev Updates `owner` s allowance for `spender` based on spent `value`. * * Does not update the allowance value in case of infinite allowance. * Revert if not enough allowance is available. * * Does not emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 value) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { if (currentAllowance < value) { revert ERC20InsufficientAllowance(spender, currentAllowance, value); } unchecked { _approve(owner, spender, currentAllowance - value, false); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity 0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity 0.8.20; import {IERC20} from "./IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.20; interface IGauge { function deposit(uint amount) external; function withdraw(uint amount) external; function claim_rewards() external; function balanceOf(address user) external view returns (uint); }
{ "optimizer": { "enabled": true, "runs": 1000 }, "evmVersion": "shanghai", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address[3]","name":"_operators","type":"address[3]"},{"internalType":"address","name":"_admin","type":"address"},{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"address","name":"_stakingtoken","type":"address"},{"internalType":"address","name":"_gauge","type":"address"},{"internalType":"address","name":"_rewardVester","type":"address"},{"internalType":"address","name":"_beets","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[],"name":"Expired","type":"error"},{"inputs":[],"name":"InvalidLockDuration","type":"error"},{"inputs":[],"name":"InvalidTokenOrAddress","type":"error"},{"inputs":[],"name":"NoLock","type":"error"},{"inputs":[],"name":"NoVest","type":"error"},{"inputs":[],"name":"NotAllowed","type":"error"},{"inputs":[],"name":"NotPaused","type":"error"},{"inputs":[],"name":"Paused","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"TransferDenied","type":"error"},{"inputs":[],"name":"UnderTimeLock","type":"error"},{"inputs":[],"name":"ZeroAmount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AddedToVest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"reward","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"},{"indexed":false,"internalType":"uint256","name":"amountReceived","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountRetained","type":"uint256"}],"name":"EarlyUnvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LockAmountIncreased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"lockAmount","type":"uint256"}],"name":"LockBroken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockEnd","type":"uint256"}],"name":"LockCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LockExtended","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":"amount","type":"uint256"}],"name":"LockTransfered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LockWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"reward","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NotifyReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newVester","type":"address"}],"name":"RewardVesterSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"state","type":"bool"}],"name":"ShutDown","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UnPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"received","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"retained","type":"uint256"}],"name":"UnlockedEarly","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"vestAmount","type":"uint256"}],"name":"VestBroken","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":"vestEnd","type":"uint256"}],"name":"VestCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"VestWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WasPaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beets","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"breakerOfLocks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"createLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"createVest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"earlyUnlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"earlyUnvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"_reward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyWithdrawFromGauge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"extendLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gauge","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"harvestBeets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"increaseLockAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"isReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastBeetsHarvest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"left","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"lockLeft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"multisig","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recoverRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recoverTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renewApprovals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"rewardData","outputs":[{"components":[{"internalType":"uint256","name":"rewardRate","type":"uint256"},{"internalType":"uint256","name":"periodFinish","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTime","type":"uint256"},{"internalType":"uint256","name":"rewardPerTokenStored","type":"uint256"}],"internalType":"struct LockboxSonic.Reward","name":"data","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardVester","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsList","outputs":[{"internalType":"address[]","name":"_rewards","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsListLength","outputs":[{"internalType":"uint256","name":"_length","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vester","type":"address"}],"name":"setRewardVester","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"state","type":"bool"}],"name":"setShutdown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sonicMigration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"token","type":"address"}],"name":"storedRewardsPerUser","outputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userInfo","outputs":[{"internalType":"bool","name":"isLocked","type":"bool"},{"internalType":"bool","name":"isVested","type":"bool"},{"internalType":"uint256","name":"lockedFor","type":"uint256"},{"internalType":"uint256","name":"vestedFor","type":"uint256"},{"internalType":"uint256","name":"lockedAmount","type":"uint256"},{"internalType":"uint256","name":"vestedAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"token","type":"address"}],"name":"userRewardPerTokenStored","outputs":[{"internalType":"uint256","name":"rewardPerToken","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"vestLeft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"vestToLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawVest","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
61012060405234801562000011575f80fd5b506040516200520f3803806200520f833981016040819052620000349162000445565b8181600362000044838262000600565b50600462000053828262000600565b5050600160055550620000675f89620001ee565b50620000825f80516020620051ef83398151915289620001ee565b50620000a45f80516020620051ef8339815191528a5f5b6020020151620001ee565b50620000c15f80516020620051ef8339815191528a600162000099565b50620000de5f80516020620051ef8339815191528a600262000099565b506001600160a01b0388811660e05287811661010052868116608081905286821660a0819052600880546001600160a01b03199081168986161790915592861660c0819052600c805460018181019092557fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c701805490951682179094555f908152600e602052604090819020805460ff1916909417909355915163095ea7b360e01b815260048101929092525f1960248301529063095ea7b3906044016020604051808303815f875af1158015620001b8573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001de9190620006c8565b50505050505050505050620006e9565b5f80620001fc848462000229565b9050801562000220575f8481526007602052604090206200021e9084620002d8565b505b90505b92915050565b5f8281526006602090815260408083206001600160a01b038516845290915281205460ff16620002d0575f8381526006602090815260408083206001600160a01b03861684529091529020805460ff19166001179055620002873390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600162000223565b505f62000223565b5f62000220836001600160a01b0384165f818152600183016020526040812054620002d057508154600181810184555f84815260208082209093018490558454848252828601909352604090209190915562000223565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b03811182821017156200036857620003686200032f565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200039957620003996200032f565b604052919050565b80516001600160a01b0381168114620003b8575f80fd5b919050565b5f82601f830112620003cd575f80fd5b81516001600160401b03811115620003e957620003e96200032f565b6020620003ff601f8301601f191682016200036e565b828152858284870101111562000413575f80fd5b5f5b838110156200043257858101830151828201840152820162000415565b505f928101909101919091529392505050565b5f805f805f805f805f6101608a8c0312156200045f575f80fd5b8a601f8b01126200046e575f80fd5b6200047862000343565b8060608c018d8111156200048a575f80fd5b8c5b81811015620004af57620004a081620003a1565b8452602093840193016200048c565b50819b50620004be81620003a1565b9a50505050620004d160808b01620003a1565b9650620004e160a08b01620003a1565b9550620004f160c08b01620003a1565b94506200050160e08b01620003a1565b9350620005126101008b01620003a1565b6101208b01519093506001600160401b038082111562000530575f80fd5b6200053e8d838e01620003bd565b93506101408c015191508082111562000555575f80fd5b50620005648c828d01620003bd565b9150509295985092959850929598565b600181811c908216806200058957607f821691505b602082108103620005a857634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620005fb575f81815260208120601f850160051c81016020861015620005d65750805b601f850160051c820191505b81811015620005f757828155600101620005e2565b5050505b505050565b81516001600160401b038111156200061c576200061c6200032f565b62000634816200062d845462000574565b84620005ae565b602080601f8311600181146200066a575f8415620006525750858301515b5f19600386901b1c1916600185901b178555620005f7565b5f85815260208120601f198616915b828110156200069a5788860151825594840194600190910190840162000679565b5085821015620006b857878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215620006d9575f80fd5b8151801515811462000220575f80fd5b60805160a05160c05160e0516101005161497f620008705f395f81816106dd015281816110a20152818161118e0152818161121c01528181612f3e0152818161307a01526130b901525f81816105e80152610af801525f818161078e01528181610ced01528181610d8801528181610df501528181610e2301528181610e7901528181610eb601528181610efc01528181610f5c01528181610f970152610fe101525f818161084601528181610d16015281816112d20152818161144f015281816114ff015281816116010152818161168b01528181611ab601528181611c3a01528181611ffe01528181612144015281816129c501528181612e640152818161316f0152818161350b01528181613e060152613ecf01525f818161073f01528181610aa2015281816113370152818161147d0152818161152e015281816116fe01528181611a7301528181611bfd01528181612063015281816120e70152818161298801528181612ec9015281816131d4015281816134ad0152613f34015261497f5ff3fe608060405234801561000f575f80fd5b506004361061039e575f3560e01c80635f3e849f116101ea578063a217fddf11610114578063d547741f116100a9578063eb6979fc11610079578063eb6979fc1461091d578063f122977714610930578063f321e89414610943578063f8f21e5d14610956575f80fd5b8063d547741f146108c2578063d8551267146108d5578063dd62ed3e146108dd578063e688639614610915575f80fd5b8063b52c05fe116100e4578063b52c05fe14610876578063b66503cf14610889578063c1819eb61461089c578063ca15c873146108af575f80fd5b8063a217fddf14610827578063a38e21051461082e578063a6f19c8414610841578063a9059cbb14610868575f80fd5b80638003b6141161018a5780639010d07c1161015a5780639010d07c146107c157806391d14854146107d457806395d89b411461080c57806399bcc05214610814575f80fd5b80638003b614146107745780638519359d146107895780638957d63d146107b05780638eae26a7146107b8575f80fd5b8063638634ee116101c5578063638634ee146106ff57806370a082311461071257806372f702f31461073a5780637f3f292f14610761575f80fd5b80635f3e849f146106b25780636058120e146106c557806361d027b3146106d8575f80fd5b806336925259116102cb578063403f44471161026b57806348e5d9f81161023b57806348e5d9f8146106355780634d5ce0381461067b5780635c388ca61461069d5780635c975abb146106a5575f80fd5b8063403f4447146105bd57806344ee3a1c146105d05780634783c35b146105e35780634885c9df14610622575f80fd5b80633ca068b6116102a65780633ca068b61461057b5780633ce0b0a2146105a55780633d18b912146105ad5780633f4ba83a146105b5575f80fd5b806336925259146105375780633accd091146105615780633c44ea8414610573575f80fd5b8063211dc32d116103415780632f2ff15d116103115780632f2ff15d146104ef578063313ce5671461050257806336085c511461051157806336568abe14610524575f80fd5b8063211dc32d1461049f57806323b872dd146104b2578063248a9ca3146104c557806324a8b10c146104e7575f80fd5b806311e22f221161037c57806311e22f22146103f2578063142972a71461040757806318160ddd1461041a5780631959a0021461042c575f80fd5b806301ffc9a7146103a257806306fdde03146103ca578063095ea7b3146103df575b5f80fd5b6103b56103b0366004614607565b610969565b60405190151581526020015b60405180910390f35b6103d26109ac565b6040516103c19190614650565b6103b56103ed36600461469d565b610a3c565b61040561040036600461469d565b610a53565b005b6104056104153660046146c5565b610b22565b6002545b6040519081526020016103c1565b61047061043a3660046146c5565b60116020525f90815260409020805460018201546002830154600384015460049094015460ff8085169561010090950416939086565b6040805196151587529415156020870152938501929092526060840152608083015260a082015260c0016103c1565b61041e6104ad3660046146de565b610baa565b6103b56104c036600461470f565b610c69565b61041e6104d3366004614748565b5f9081526006602052604090206001015490565b610405610c9c565b6104056104fd36600461475f565b611064565b604051601281526020016103c1565b61040561051f366004614748565b61108e565b61040561053236600461475f565b6113c2565b61041e6105453660046146de565b601060209081525f928352604080842090915290825290205481565b600b546103b590610100900460ff1681565b61040561140e565b61041e6105893660046146de565b600f60209081525f928352604080842090915290825290205481565b61040561159c565b610405611763565b610405611a16565b6104056105cb366004614748565b611b4e565b6104056105de366004614748565b611d06565b61060a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016103c1565b61041e6106303660046146c5565b611e37565b6106486106433660046146c5565b611ed8565b6040516103c191908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b6103b56106893660046146c5565b600e6020525f908152604090205460ff1681565b610405611f4c565b600b546103b59060ff1681565b6104056106c036600461470f565b6120db565b6104056106d3366004614780565b6121a1565b61060a7f000000000000000000000000000000000000000000000000000000000000000081565b61041e61070d3660046146c5565b612412565b61041e6107203660046146c5565b6001600160a01b03165f9081526020819052604090205490565b61060a7f000000000000000000000000000000000000000000000000000000000000000081565b60085461060a906001600160a01b031681565b61077c612437565b6040516103c191906147a0565b61060a7f000000000000000000000000000000000000000000000000000000000000000081565b610405612496565b61041e600a5481565b61060a6107cf366004614780565b6125aa565b6103b56107e236600461475f565b5f9182526006602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6103d26125c8565b61041e6108223660046146c5565b6125d7565b61041e5f81565b61040561083c36600461469d565b61264d565b61060a7f000000000000000000000000000000000000000000000000000000000000000081565b6103b56104c036600461469d565b610405610884366004614780565b612896565b61040561089736600461469d565b612a99565b6104056108aa3660046147f9565b612cfa565b61041e6108bd366004614748565b612d70565b6104056108d036600461475f565b612d86565b610405612daa565b61041e6108eb3660046146de565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b600c5461041e565b61040561092b366004614748565b612f2a565b61041e61093e3660046146c5565b613230565b61041e6109513660046146c5565b6132e1565b61040561096436600461469d565b613359565b5f6001600160e01b031982167f5a05180f0000000000000000000000000000000000000000000000000000000014806109a657506109a682613574565b92915050565b6060600380546109bb90614814565b80601f01602080910402602001604051908101604052809291908181526020018280546109e790614814565b8015610a325780601f10610a0957610100808354040283529160200191610a32565b820191905f5260205f20905b815481529060010190602001808311610a1557829003601f168201915b5050505050905090565b5f33610a498185856135da565b5060019392505050565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929610a7d816135e7565b600b5460ff16610aa057604051636cd6020160e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031603610af257604051632317b1f960e11b815260040160405180910390fd5b610b1d837f0000000000000000000000000000000000000000000000000000000000000000846135f1565b505050565b5f610b2c816135e7565b6001600160a01b038216610b5357604051632317b1f960e11b815260040160405180910390fd5b6008805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040517f92d0852e15f12bc074cd3be0c09a9265716169c8e9dfa63784ca6f4a74a633e1905f90a25050565b5f80610bb46136da565b6001600160a01b038085165f818152601060209081526040808320948a1680845294825280832054938352600f82528083209483529390529190912054919250906064908390670de0b6b3a764000090610c0d89613230565b610c179190614860565b6001600160a01b0388165f90815260208190526040902054610c399190614873565b610c43919061488a565b610c4d9190614873565b610c57919061488a565b610c6191906148a9565b949350505050565b5f6040517f80571c0000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ca4613805565b5f610cae81613848565b600a5442903090610cc290620697806148a9565b821015610ce25760405163cba1549360e01b815260040160405180910390fd5b600a8290555f610d127f000000000000000000000000000000000000000000000000000000000000000083613a62565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e6f1daf26040518163ffffffff1660e01b81526004015f604051808303815f87803b158015610d6c575f80fd5b505af1158015610d7e573d5f803e3d5ffd5b505050505f610dad7f000000000000000000000000000000000000000000000000000000000000000084613a62565b90505f610dba8383614860565b905060095481610dca91906148a9565b9050805f03610dec57604051631f2a200560e01b815260040160405180910390fd5b5f600955610e197f0000000000000000000000000000000000000000000000000000000000000000613230565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165f908152600d602052604090206003810191909155600101548510610eac57610e6f62093a808261488a565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165f908152600d6020526040902055610f8d565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165f908152600d6020526040812060010154610ef2908790614860565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165f908152600d602052604081205491925090610f389083614873565b905062093a80610f4882856148a9565b610f52919061488a565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165f908152600d602052604090205550505b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165f908152600d60205260409020600201859055610fd762093a80866148a9565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165f818152600d60205260409081902060010192909255905133907ff70d5c697de7ea828df48e5c4573cb2194c659f1901f70110c52b066dcf508269061104a9085815260200190565b60405180910390a35050505050506110626001600555565b565b5f8281526006602052604090206001015461107e816135e7565b6110888383613b24565b50505050565b611096613805565b336110a081613848565b7f00000000000000000000000000000000000000000000000000000000000000006110ca81613848565b335f818152601160205260409020805460ff166110fa5760405163ba112c9360e01b815260040160405180910390fd5b6001810154421061111e57604051630407b05b60e31b815260040160405180910390fd5b845f0361113e57604051631f2a200560e01b815260040160405180910390fd5b806003015485111561115257806003015494505b84816003015f8282546111659190614860565b909155505060038101545f0361118457805460ff191681555f60018201555b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165f908152601160205260408120906103e86111cb61025889614873565b6111d5919061488a565b90505f6111e28289614860565b90505f6103e86111f461034285614873565b6111fe919061488a565b90505f61120b8285614860565b9050611217878b613b57565b6112417f000000000000000000000000000000000000000000000000000000000000000082613ba9565b845460ff1661128857845460ff1916600117855561126262eff100426148a9565b856001018190555080856003015f82825461127d91906148a9565b909155506112a19050565b80856003015f82825461129b91906148a9565b90915550505b6112aa82613bf6565b5f6112b3613def565b905083811061133257604051632e1a7d4d60e01b8152600481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d906024015f604051808303815f87803b15801561131b575f80fd5b505af115801561132d573d5f803e3d5ffd5b505050505b61135d7f000000000000000000000000000000000000000000000000000000000000000089866135f1565b6001600160a01b0388167fd0c4ec39c284dcd3dde61d2b12cfd30c61cea001d0b25ab78eb79aca7e09510b8561139385876148a9565b6040805192835260208301919091520160405180910390a2505050505050505050506113bf6001600555565b50565b6001600160a01b0381163314611404576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b1d8282613e7c565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929611438816135e7565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301525f60248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303815f875af11580156114c3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114e791906148bc565b5060405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301525f1960248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303815f875af1158015611574573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061159891906148bc565b5050565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9296115c6816135e7565b600b5460ff16156115ea576040516313d0ff5960e31b815260040160405180910390fd5b6040516370a0823160e01b81523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561164e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061167291906148d7565b604051632e1a7d4d60e01b8152600481018290529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d906024015f604051808303815f87803b1580156116d4575f80fd5b505af11580156116e6573d5f803e3d5ffd5b5050600b805460ff19166001179055505f90506117237f000000000000000000000000000000000000000000000000000000000000000030613a62565b90507f99d7f8b71cfb9126984f7a5eed3a40e64a8959e9b0e442221546fb04ec6a489c8160405161175691815260200190565b60405180910390a1505050565b61176b613805565b3361177581613848565b335f818152601160205260408120905b600c54811015611a08576001600160a01b0383165f908152601060205260408120600c8054839190859081106117bd576117bd6148ee565b5f9182526020808320909101546001600160a01b03168352820192909252604001902054905080156119f5576001600160a01b0384165f908152601060205260408120600c805483919086908110611817576118176148ee565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055600c805430919084908110611852576118526148ee565b5f918252602090912001546001600160a01b03160361196357825460ff1615801561188457508254610100900460ff16155b156118975761189281613ea7565b611994565b825460ff161580156118af57508254610100900460ff165b156118d25780836004015f8282546118c791906148a9565b909155506119599050565b825460ff1680156118ea57508254610100900460ff16155b156119025780836003015f8282546118c791906148a9565b825460ff16801561191957508254610100900460ff165b156119595782600201548360010154106119405780836003015f8282546118c791906148a9565b80836004015f82825461195391906148a9565b90915550505b6118928482613ba9565b611994600c8381548110611979576119796148ee565b5f918252602090912001546001600160a01b031685836135f1565b600c82815481106119a7576119a76148ee565b5f91825260209182902001546040518381526001600160a01b0391821692918716917f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc9910160405180910390a35b5080611a0081614902565b915050611785565b505050506110626001600555565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929611a40816135e7565b600b5460ff16611a6357604051636cd6020160e01b815260040160405180910390fd5b600b805460ff191690555f611a987f000000000000000000000000000000000000000000000000000000000000000030613a62565b90508015611b165760405163b6b55f2560e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b6b55f25906024015f604051808303815f87803b158015611aff575f80fd5b505af1158015611b11573d5f803e3d5ffd5b505050505b6040518181527fb96cc4c95dd57612feeeaed56e65b2fd6ba67b101d0592527f05756fafcab4b4906020015b60405180910390a15050565b611b56613805565b33611b6081613848565b600b5460ff1615611b84576040516313d0ff5960e31b815260040160405180910390fd5b815f03611ba457604051631f2a200560e01b815260040160405180910390fd5b335f818152601160205260409020805460ff16611bd45760405163ba112c9360e01b815260040160405180910390fd5b60018101544210611bf857604051630407b05b60e31b815260040160405180910390fd5b611c247f0000000000000000000000000000000000000000000000000000000000000000833087613f5a565b60405163b6b55f2560e01b8152600481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b6b55f25906024015f604051808303815f87803b158015611c83575f80fd5b505af1158015611c95573d5f803e3d5ffd5b50505050611ca38285613ba9565b83816003015f828254611cb691906148a9565b90915550506040518481526001600160a01b038316907fea61c3b66d1b521d412995113fb2d02e1f83da97103751ff25a4e0689f3e937e9060200160405180910390a25050506113bf6001600555565b611d0e613805565b600b5460ff1615611d32576040516313d0ff5960e31b815260040160405180910390fd5b335f818152601160205260409020805460ff16611d625760405163ba112c9360e01b815260040160405180910390fd5b425f611d6e85836148a9565b905082600101548111611d9457604051630f962f3d60e31b815260040160405180910390fd5b611da16224ea00836148a9565b811015611dc157604051630f962f3d60e31b815260040160405180910390fd5b611dce62eff100836148a9565b8110611de457611de162eff100836148a9565b90505b600183018190556040518181526001600160a01b038516907fe5d4b5c97a45cd2c590e17dd6dc2c0b1935d6c56701144a267f57b1a9f6779f49060200160405180910390a2505050506113bf6001600555565b6001600160a01b0381165f908152601160209081526040808320815160c081018352815460ff80821615158352610100909104161515938101939093526001810154918301919091526002810154606083018190526003820154608084015260049091015460a08301524290808403611eb457505f949350505050565b808210611ec557505f949350505050565b611ecf8282614860565b95945050505050565b611eff60405180608001604052805f81526020015f81526020015f81526020015f81525090565b506001600160a01b03165f908152600d6020908152604091829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b611f54613805565b33611f5e81613848565b335f818152601160205260409020805460ff16611f8e5760405163ba112c9360e01b815260040160405180910390fd5b6001810154421015611fb35760405163cba1549360e01b815260040160405180910390fd5b805460ff191681556003810180545f60018401819055909155611fd68382613b57565b5f611fdf613def565b905081811061205e57604051632e1a7d4d60e01b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d906024015f604051808303815f87803b158015612047575f80fd5b505af1158015612059573d5f803e3d5ffd5b505050505b6120897f000000000000000000000000000000000000000000000000000000000000000085846135f1565b836001600160a01b03167fb34e14e48464e0328f36e8e73e48bc8f543c7c1eca2f3443f4b4590fcfeb1c39836040516120c491815260200190565b60405180910390a250505050506110626001600555565b5f6120e5816135e7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b0316148061213c57506001600160a01b0384165f908152600e602052604090205460ff165b8061217857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b0316145b1561219657604051632317b1f960e11b815260040160405180910390fd5b6110888484846135f1565b6121a9613805565b335f8181526011602052604090208054610100900460ff166121de5760405163f325c79960e01b815260040160405180910390fd5b835f036121fe57604051631f2a200560e01b815260040160405180910390fd5b806004015484111561221257806004015493505b60028101544290811061223857604051630407b05b60e31b815260040160405180910390fd5b84826004015f82825461224b9190614860565b9091555050815460ff16612347575f61226485836148a9565b90508260020154811161228a57604051630f962f3d60e31b815260040160405180910390fd5b6122976224ea00836148a9565b81116122ad576122aa6224ea00836148a9565b90505b6122ba62eff100836148a9565b81106122d0576122cd62eff100836148a9565b90505b825460ff19166001908117845583018190556003830180548791905f906122f89084906148a9565b909155505060408051878152602081018390526001600160a01b038616917f167357c41e38a45e1950f61b1f5accf902c878d83f1685f7f72fb666203ce047910160405180910390a2506123ea565b816001015482600201541061236f57604051630f962f3d60e31b815260040160405180910390fd5b8160010154811061239357604051630407b05b60e31b815260040160405180910390fd5b84826003015f8282546123a691906148a9565b90915550506040518581526001600160a01b038416907fea61c3b66d1b521d412995113fb2d02e1f83da97103751ff25a4e0689f3e937e9060200160405180910390a25b81600401545f0361240557815461ff00191682555f60028301555b5050506115986001600555565b5f6109a6426001600160a01b0384165f908152600d602052604090206001015461404c565b6060600c805480602002602001604051908101604052809291908181526020018280548015610a3257602002820191905f5260205f20905b81546001600160a01b0316815260019091019060200180831161246f575050505050905090565b335f818152601160205260409020600b5460ff166124c757604051636cd6020160e01b815260040160405180910390fd5b600b54610100900460ff166124ef57604051631eb49d6d60e11b815260040160405180910390fd5b805460ff161561254a575f600182015560038101546040519081526001600160a01b038316907fb3a7e01844a6519be50efb73ea6455ec51d74e362c2323a1d336bc5bb6ea0dca9060200160405180910390a261254a611f4c565b8054610100900460ff1615611598575f600282015560048101546040519081526001600160a01b038316907f4394b091f9fe1428e51031c7c52eae2b29e37180b6d1fafc46954ce892e730119060200160405180910390a2611598612daa565b5f8281526007602052604081206125c19083614061565b9392505050565b6060600480546109bb90614814565b6001600160a01b0381165f908152600d60205260408120600101544290811061260257505f92915050565b6001600160a01b0383165f908152600d6020526040812060010154612628908390614860565b6001600160a01b0385165f908152600d6020526040902054909150610c619082614873565b612655613805565b3361265f81613848565b8261266981613848565b336001600160a01b03851681900361269457604051632317b1f960e11b815260040160405180910390fd5b6001600160a01b0381165f908152601160205260409020805460ff166126cd5760405163ba112c9360e01b815260040160405180910390fd5b600181015442106126f157604051630407b05b60e31b815260040160405180910390fd5b845f0361271157604051631eb49d6d60e11b815260040160405180910390fd5b806003015485111561272557806003015494505b6001600160a01b0386165f908152601160205260409020805460ff161561276f5781600101548160010154101561276f57604051631eb49d6d60e11b815260040160405180910390fd5b805460ff166127da57805460ff191660019081178255828101549082018190556040516001600160a01b038916917f167357c41e38a45e1950f61b1f5accf902c878d83f1685f7f72fb666203ce047916127d1918a8252602082015260400190565b60405180910390a25b85826003015f8282546127ed9190614860565b909155505060038201545f0361280c57815460ff191682555f60018301555b6128168387613b57565b6128208787613ba9565b85816003015f82825461283391906148a9565b92505081905550866001600160a01b0316836001600160a01b03167f210fe3b7301440ad2fb7fc1f612b0c5926f6ee31413f07582747ba8c3a37332b8860405161287f91815260200190565b60405180910390a350505050506115986001600555565b61289e613805565b336128a881613848565b600b5460ff16156128cc576040516313d0ff5960e31b815260040160405180910390fd5b825f036128ec57604051631f2a200560e01b815260040160405180910390fd5b335f818152601160205260409020805460ff161561291d5760405163cba1549360e01b815260040160405180910390fd5b425f61292986836148a9565b90506129386224ea00836148a9565b811161294e5761294b6224ea00836148a9565b90505b61295b62eff100836148a9565b81106129715761296e62eff100836148a9565b90505b825460ff19166001908117845583018190556129af7f000000000000000000000000000000000000000000000000000000000000000085308a613f5a565b60405163b6b55f2560e01b8152600481018890527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b6b55f25906024015f604051808303815f87803b158015612a0e575f80fd5b505af1158015612a20573d5f803e3d5ffd5b50505050612a2e8488613ba9565b86836003015f828254612a4191906148a9565b909155505060408051888152602081018390526001600160a01b038616917f167357c41e38a45e1950f61b1f5accf902c878d83f1685f7f72fb666203ce047910160405180910390a250505050506115986001600555565b5f612aa381613848565b5f612aad816135e7565b825f03612acd57604051631f2a200560e01b815260040160405180910390fd5b6001600160a01b0384165f908152600e602052604090205460ff16612b5c57600c805460018082019092557fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c701805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387169081179091555f908152600e60205260409020805460ff191690911790555b6001600160a01b0384165f908152600d602052604090206001015442903090612b8487613230565b6001600160a01b0388165f908152600d6020526040812060030191909155612bac8884613a62565b9050612bba8833858a613f5a565b5f612bc58985613a62565b9050612bd18282614860565b9750828510612c0457612be762093a808961488a565b6001600160a01b038a165f908152600d6020526040902055612c6a565b5f612c0f8685614860565b6001600160a01b038b165f908152600d602052604081205491925090612c359083614873565b905062093a80612c45828c6148a9565b612c4f919061488a565b6001600160a01b038c165f908152600d602052604090205550505b6001600160a01b0389165f908152600d60205260409020600201859055612c9462093a80866148a9565b6001600160a01b038a165f818152600d60205260409081902060010192909255905133907ff70d5c697de7ea828df48e5c4573cb2194c659f1901f70110c52b066dcf5082690612ce7908c815260200190565b60405180910390a3505050505050505050565b5f612d04816135e7565b600b5460ff16612d2757604051636cd6020160e01b815260040160405180910390fd5b600b80548315156101000261ff00199091161790556040517f02fad22840218f133846b0f05b4ae9e8601d5164b1f1b0f55b6347d56a68ec2890611b4290841515815260200190565b5f8181526007602052604081206109a69061406c565b5f82815260066020526040902060010154612da0816135e7565b6110888383613e7c565b612db2613805565b33612dbc81613848565b335f8181526011602052604090208054610100900460ff16612df15760405163f325c79960e01b815260040160405180910390fd5b6002810154421015612e165760405163cba1549360e01b815260040160405180910390fd5b6004810180545f918290556002830191909155815461ff0019168255612e3c8382613b57565b5f612e45613def565b9050818110612ec457604051632e1a7d4d60e01b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d906024015f604051808303815f87803b158015612ead575f80fd5b505af1158015612ebf573d5f803e3d5ffd5b505050505b612eef7f000000000000000000000000000000000000000000000000000000000000000085846135f1565b836001600160a01b03167fe0e1773eaedce8d3cc03f7a3a1f50d8307c2be64ecd82c50248dd0bb52bf228c836040516120c491815260200190565b612f32613805565b33612f3c81613848565b7f0000000000000000000000000000000000000000000000000000000000000000612f6681613848565b335f8181526011602052604090208054610100900460ff16612f9b5760405163f325c79960e01b815260040160405180910390fd5b60028101544210612fbf57604051630407b05b60e31b815260040160405180910390fd5b845f03612fdf57604051631f2a200560e01b815260040160405180910390fd5b8060040154851115612ff357806004015494505b84816004015f8282546130069190614860565b909155505060048101545f0361302057805461ff00191681555b5f6103e861303061025888614873565b61303a919061488a565b90505f6130478288614860565b90505f6103e861305961034285614873565b613063919061488a565b90505f6130708285614860565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165f9081526011602052604090209091506130b4878b613b57565b6130de7f000000000000000000000000000000000000000000000000000000000000000083613ba9565b805460ff1661312557805460ff191660011781556130ff62eff100426148a9565b816001018190555081816003015f82825461311a91906148a9565b9091555061313e9050565b81816003015f82825461313891906148a9565b90915550505b61314783613bf6565b5f613150613def565b90508481106131cf57604051632e1a7d4d60e01b8152600481018690527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d906024015f604051808303815f87803b1580156131b8575f80fd5b505af11580156131ca573d5f803e3d5ffd5b505050505b6131fa7f000000000000000000000000000000000000000000000000000000000000000089876135f1565b6001600160a01b0388167fd0c4ec39c284dcd3dde61d2b12cfd30c61cea001d0b25ab78eb79aca7e09510b8661139386886148a9565b5f61323a60025490565b5f0361325e57506001600160a01b03165f908152600d602052604090206003015490565b6002546001600160a01b0383165f908152600d602052604090208054600290910154670de0b6b3a7640000919061329486612412565b61329e9190614860565b6132a89190614873565b6132b29190614873565b6132bc919061488a565b6001600160a01b0383165f908152600d60205260409020600301546109a691906148a9565b6001600160a01b0381165f908152601160209081526040808320815160c081018352815460ff8082161515835261010090910416151593810193909352600181015491830182905260028101546060840152600381015460808401526004015460a08301524290808403611eb457505f949350505050565b613361613805565b8161336b81613848565b6008546001600160a01b0316331461339657604051631eb49d6d60e11b815260040160405180910390fd5b6001600160a01b0383165f9081526011602052604090208054429190610100900460ff16156133e357806002015482106133e357604051630407b05b60e31b815260040160405180910390fd5b8054610100900460ff16613460575f6133ff62375f00846148a9565b825461ff0019166101001783556002830181905560408051878152602081018390529192506001600160a01b038816917f941051f5740326e2299731cca609f60c53e8302c775962e529bb902465620ddc910160405180910390a2506134a4565b846001600160a01b03167fb8433e84e1a72e3681dd915e7c43117b4065b48971321cfce4ef3aaa13a665088560405161349b91815260200190565b60405180910390a25b6008546134dd907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b03163087613f5a565b83816004015f8282546134f091906148a9565b909155505060405163b6b55f2560e01b8152600481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b6b55f25906024015f604051808303815f87803b158015613554575f80fd5b505af1158015613566573d5f803e3d5ffd5b505050506124058585613ba9565b5f6001600160e01b031982167f7965db0b0000000000000000000000000000000000000000000000000000000014806109a657507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146109a6565b610b1d8383836001614075565b6113bf813361416b565b6040516001600160a01b038381166024830152604482018390525f91829186169060640160408051601f198184030181529181526020820180516001600160e01b03167fa9059cbb0000000000000000000000000000000000000000000000000000000017905251613663919061491a565b5f604051808303815f865af19150503d805f811461369c576040519150601f19603f3d011682016040523d82523d5f602084013e6136a1565b606091505b50915091508180156136cb5750805115806136cb5750808060200190518101906136cb91906148bc565b6136d3575f80fd5b5050505050565b335f818152601160209081526040808320815160c081018352815460ff80821615158352610100909104161515938101939093526001810154918301919091526002810154606083015260038101546080830181905260049091015460a0830181905292939260469185918291111561375d57613756856132e1565b9050613769565b61376685611e37565b90505b6137776224ea006005614873565b81111561378757601e91506137f1565b6137956224ea006004614873565b8111156137a557601891506137f1565b6137b36224ea006003614873565b8111156137c357601291506137f1565b6137d16224ea006002614873565b8111156137e157600c91506137f1565b6224ea008111156137f157600691505b6137fb82846148a9565b9550505050505090565b600260055403613841576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600555565b5f5b600c5481101561159857613883600c828154811061386a5761386a6148ee565b5f918252602090912001546001600160a01b0316613230565b600d5f600c8481548110613899576138996148ee565b5f9182526020808320909101546001600160a01b03168352820192909252604001902060030155600c80546138f29190839081106138d9576138d96148ee565b5f918252602090912001546001600160a01b0316612412565b600d5f600c8481548110613908576139086148ee565b5f9182526020808320909101546001600160a01b039081168452908301939093526040909101902060020191909155821615613a505761396e600c8281548110613954576139546148ee565b5f918252602090912001546001600160a01b031683610baa565b6001600160a01b0383165f908152601060205260408120600c80549192918590811061399c5761399c6148ee565b5f9182526020808320909101546001600160a01b03168352820192909252604001812091909155600c8054600d929190849081106139dc576139dc6148ee565b5f9182526020808320909101546001600160a01b0390811684528382019490945260409283018220600301549386168252600f9052908120600c805491929185908110613a2b57613a2b6148ee565b5f9182526020808320909101546001600160a01b031683528201929092526040019020555b80613a5a81614902565b91505061384a565b6040516001600160a01b0382811660248301525f91829182919086169060440160408051601f198184030181529181526020820180516001600160e01b03166370a0823160e01b17905251613ab7919061491a565b5f60405180830381855afa9150503d805f8114613aef576040519150601f19603f3d011682016040523d82523d5f602084013e613af4565b606091505b5091509150818015613b0857506020815110155b613b10575f80fd5b80806020019051810190611ecf91906148d7565b5f80613b3084846141d8565b905080156125c1575f848152600760205260409020613b4f9084614283565b509392505050565b6001600160a01b038216613b9e576040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081525f60048201526024015b60405180910390fd5b611598825f83614297565b6001600160a01b038216613beb576040517fec442f050000000000000000000000000000000000000000000000000000000081525f6004820152602401613b95565b6115985f8383614297565b5f613c0081613848565b305f818152600e602052604090205460ff16613c8657600c805460018082019092557fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c701805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091555f908152600e60205260409020805460ff191690911790555b42613c9082613230565b6001600160a01b0383165f908152600d602052604090206003810191909155600101548110613ce357613cc662093a808561488a565b6001600160a01b0383165f908152600d6020526040902055613d64565b6001600160a01b0382165f908152600d6020526040812060010154613d09908390614860565b6001600160a01b0384165f908152600d602052604081205491925090613d2f9083614873565b905062093a80613d3f82886148a9565b613d49919061488a565b6001600160a01b0385165f908152600d602052604090205550505b6001600160a01b0382165f908152600d60205260409020600201819055613d8e62093a80826148a9565b6001600160a01b0383165f818152600d60205260409081902060010192909255905133907ff70d5c697de7ea828df48e5c4573cb2194c659f1901f70110c52b066dcf5082690613de19088815260200190565b60405180910390a350505050565b6040516370a0823160e01b81523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015613e53573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613e7791906148d7565b905090565b5f80613e8884846142e1565b905080156125c1575f848152600760205260409020613b4f9084614366565b5f613eb0613def565b9050818110613f2f57604051632e1a7d4d60e01b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d906024015f604051808303815f87803b158015613f18575f80fd5b505af1158015613f2a573d5f803e3d5ffd5b505050505b6115987f000000000000000000000000000000000000000000000000000000000000000033846135f1565b6040516001600160a01b0384811660248301528381166044830152606482018390525f91829187169060840160408051601f198184030181529181526020820180516001600160e01b03167f23b872dd0000000000000000000000000000000000000000000000000000000017905251613fd4919061491a565b5f604051808303815f865af19150503d805f811461400d576040519150601f19603f3d011682016040523d82523d5f602084013e614012565b606091505b509150915081801561403c57508051158061403c57508080602001905181019061403c91906148bc565b614044575f80fd5b505050505050565b5f81831061405a57816125c1565b5090919050565b5f6125c1838361437a565b5f6109a6825490565b6001600160a01b0384166140b7576040517fe602df050000000000000000000000000000000000000000000000000000000081525f6004820152602401613b95565b6001600160a01b0383166140f9576040517f94280d620000000000000000000000000000000000000000000000000000000081525f6004820152602401613b95565b6001600160a01b038085165f908152600160209081526040808320938716835292905220829055801561108857826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051613de191815260200190565b5f8281526006602090815260408083206001600160a01b038516845290915290205460ff16611598576040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526001600160a01b038216600482015260248101839052604401613b95565b5f8281526006602090815260408083206001600160a01b038516845290915281205460ff1661427c575f8381526006602090815260408083206001600160a01b03861684529091529020805460ff191660011790556142343390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016109a6565b505f6109a6565b5f6125c1836001600160a01b0384166143a0565b6001600160a01b03831615806142b457506001600160a01b038216155b156142c457610b1d8383836143e5565b6142cd83613848565b6142d682613848565b610b1d8383836143e5565b5f8281526006602090815260408083206001600160a01b038516845290915281205460ff161561427c575f8381526006602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016109a6565b5f6125c1836001600160a01b038416614524565b5f825f01828154811061438f5761438f6148ee565b905f5260205f200154905092915050565b5f81815260018301602052604081205461427c57508154600181810184555f8481526020808220909301849055845484825282860190935260409020919091556109a6565b6001600160a01b03831661440f578060025f82825461440491906148a9565b909155506144989050565b6001600160a01b0383165f908152602081905260409020548181101561447a576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401613b95565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166144b4576002805482900390556144d2565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161451791815260200190565b60405180910390a3505050565b5f81815260018301602052604081205480156145fe575f614546600183614860565b85549091505f9061455990600190614860565b90508082146145b8575f865f018281548110614577576145776148ee565b905f5260205f200154905080875f018481548110614597576145976148ee565b5f918252602080832090910192909255918252600188019052604090208390555b85548690806145c9576145c9614935565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f9055600193505050506109a6565b5f9150506109a6565b5f60208284031215614617575f80fd5b81356001600160e01b0319811681146125c1575f80fd5b5f5b83811015614648578181015183820152602001614630565b50505f910152565b602081525f825180602084015261466e81604085016020870161462e565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114614698575f80fd5b919050565b5f80604083850312156146ae575f80fd5b6146b783614682565b946020939093013593505050565b5f602082840312156146d5575f80fd5b6125c182614682565b5f80604083850312156146ef575f80fd5b6146f883614682565b915061470660208401614682565b90509250929050565b5f805f60608486031215614721575f80fd5b61472a84614682565b925061473860208501614682565b9150604084013590509250925092565b5f60208284031215614758575f80fd5b5035919050565b5f8060408385031215614770575f80fd5b8235915061470660208401614682565b5f8060408385031215614791575f80fd5b50508035926020909101359150565b602080825282518282018190525f9190848201906040850190845b818110156147e05783516001600160a01b0316835292840192918401916001016147bb565b50909695505050505050565b80151581146113bf575f80fd5b5f60208284031215614809575f80fd5b81356125c1816147ec565b600181811c9082168061482857607f821691505b60208210810361484657634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b818103818111156109a6576109a661484c565b80820281158282048414176109a6576109a661484c565b5f826148a457634e487b7160e01b5f52601260045260245ffd5b500490565b808201808211156109a6576109a661484c565b5f602082840312156148cc575f80fd5b81516125c1816147ec565b5f602082840312156148e7575f80fd5b5051919050565b634e487b7160e01b5f52603260045260245ffd5b5f600182016149135761491361484c565b5060010190565b5f825161492b81846020870161462e565b9190910192915050565b634e487b7160e01b5f52603160045260245ffdfea264697066735822122095fae0a9ab5f799a7b38a21570c671a96a5d80ab62ee4f98595ffd1b8dc214a964736f6c6343000814003397667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9290000000000000000000000003c173f1baf9f97bf244796c0179952a6a2e9c2480000000000000000000000000190933669d250406efcf18b351b954ea88d5bfd000000000000000000000000e63af583149eece38c75746db699bc6d6983aca9000000000000000000000000edfa5163b3517c375a978b1557d9d90ba823213f000000000000000000000000179b816a930376b89627fd3016b2a0086487a79e0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d09057000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f000000000000000000000000b6b02aef2b0edfe786abed486d38de95a36f53bb0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000164c6f636b656420664d6f6e6579206f6e20536f6e696300000000000000000000000000000000000000000000000000000000000000000000000000000000000e4c6f636b6564664d6f6e65794c50000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061039e575f3560e01c80635f3e849f116101ea578063a217fddf11610114578063d547741f116100a9578063eb6979fc11610079578063eb6979fc1461091d578063f122977714610930578063f321e89414610943578063f8f21e5d14610956575f80fd5b8063d547741f146108c2578063d8551267146108d5578063dd62ed3e146108dd578063e688639614610915575f80fd5b8063b52c05fe116100e4578063b52c05fe14610876578063b66503cf14610889578063c1819eb61461089c578063ca15c873146108af575f80fd5b8063a217fddf14610827578063a38e21051461082e578063a6f19c8414610841578063a9059cbb14610868575f80fd5b80638003b6141161018a5780639010d07c1161015a5780639010d07c146107c157806391d14854146107d457806395d89b411461080c57806399bcc05214610814575f80fd5b80638003b614146107745780638519359d146107895780638957d63d146107b05780638eae26a7146107b8575f80fd5b8063638634ee116101c5578063638634ee146106ff57806370a082311461071257806372f702f31461073a5780637f3f292f14610761575f80fd5b80635f3e849f146106b25780636058120e146106c557806361d027b3146106d8575f80fd5b806336925259116102cb578063403f44471161026b57806348e5d9f81161023b57806348e5d9f8146106355780634d5ce0381461067b5780635c388ca61461069d5780635c975abb146106a5575f80fd5b8063403f4447146105bd57806344ee3a1c146105d05780634783c35b146105e35780634885c9df14610622575f80fd5b80633ca068b6116102a65780633ca068b61461057b5780633ce0b0a2146105a55780633d18b912146105ad5780633f4ba83a146105b5575f80fd5b806336925259146105375780633accd091146105615780633c44ea8414610573575f80fd5b8063211dc32d116103415780632f2ff15d116103115780632f2ff15d146104ef578063313ce5671461050257806336085c511461051157806336568abe14610524575f80fd5b8063211dc32d1461049f57806323b872dd146104b2578063248a9ca3146104c557806324a8b10c146104e7575f80fd5b806311e22f221161037c57806311e22f22146103f2578063142972a71461040757806318160ddd1461041a5780631959a0021461042c575f80fd5b806301ffc9a7146103a257806306fdde03146103ca578063095ea7b3146103df575b5f80fd5b6103b56103b0366004614607565b610969565b60405190151581526020015b60405180910390f35b6103d26109ac565b6040516103c19190614650565b6103b56103ed36600461469d565b610a3c565b61040561040036600461469d565b610a53565b005b6104056104153660046146c5565b610b22565b6002545b6040519081526020016103c1565b61047061043a3660046146c5565b60116020525f90815260409020805460018201546002830154600384015460049094015460ff8085169561010090950416939086565b6040805196151587529415156020870152938501929092526060840152608083015260a082015260c0016103c1565b61041e6104ad3660046146de565b610baa565b6103b56104c036600461470f565b610c69565b61041e6104d3366004614748565b5f9081526006602052604090206001015490565b610405610c9c565b6104056104fd36600461475f565b611064565b604051601281526020016103c1565b61040561051f366004614748565b61108e565b61040561053236600461475f565b6113c2565b61041e6105453660046146de565b601060209081525f928352604080842090915290825290205481565b600b546103b590610100900460ff1681565b61040561140e565b61041e6105893660046146de565b600f60209081525f928352604080842090915290825290205481565b61040561159c565b610405611763565b610405611a16565b6104056105cb366004614748565b611b4e565b6104056105de366004614748565b611d06565b61060a7f000000000000000000000000edfa5163b3517c375a978b1557d9d90ba823213f81565b6040516001600160a01b0390911681526020016103c1565b61041e6106303660046146c5565b611e37565b6106486106433660046146c5565b611ed8565b6040516103c191908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b6103b56106893660046146c5565b600e6020525f908152604090205460ff1681565b610405611f4c565b600b546103b59060ff1681565b6104056106c036600461470f565b6120db565b6104056106d3366004614780565b6121a1565b61060a7f000000000000000000000000179b816a930376b89627fd3016b2a0086487a79e81565b61041e61070d3660046146c5565b612412565b61041e6107203660046146c5565b6001600160a01b03165f9081526020819052604090205490565b61060a7f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d0905781565b60085461060a906001600160a01b031681565b61077c612437565b6040516103c191906147a0565b61060a7f0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f081565b610405612496565b61041e600a5481565b61060a6107cf366004614780565b6125aa565b6103b56107e236600461475f565b5f9182526006602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6103d26125c8565b61041e6108223660046146c5565b6125d7565b61041e5f81565b61040561083c36600461469d565b61264d565b61060a7f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f81565b6103b56104c036600461469d565b610405610884366004614780565b612896565b61040561089736600461469d565b612a99565b6104056108aa3660046147f9565b612cfa565b61041e6108bd366004614748565b612d70565b6104056108d036600461475f565b612d86565b610405612daa565b61041e6108eb3660046146de565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b600c5461041e565b61040561092b366004614748565b612f2a565b61041e61093e3660046146c5565b613230565b61041e6109513660046146c5565b6132e1565b61040561096436600461469d565b613359565b5f6001600160e01b031982167f5a05180f0000000000000000000000000000000000000000000000000000000014806109a657506109a682613574565b92915050565b6060600380546109bb90614814565b80601f01602080910402602001604051908101604052809291908181526020018280546109e790614814565b8015610a325780601f10610a0957610100808354040283529160200191610a32565b820191905f5260205f20905b815481529060010190602001808311610a1557829003601f168201915b5050505050905090565b5f33610a498185856135da565b5060019392505050565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929610a7d816135e7565b600b5460ff16610aa057604051636cd6020160e01b815260040160405180910390fd5b7f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d090576001600160a01b0316836001600160a01b031603610af257604051632317b1f960e11b815260040160405180910390fd5b610b1d837f000000000000000000000000edfa5163b3517c375a978b1557d9d90ba823213f846135f1565b505050565b5f610b2c816135e7565b6001600160a01b038216610b5357604051632317b1f960e11b815260040160405180910390fd5b6008805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040517f92d0852e15f12bc074cd3be0c09a9265716169c8e9dfa63784ca6f4a74a633e1905f90a25050565b5f80610bb46136da565b6001600160a01b038085165f818152601060209081526040808320948a1680845294825280832054938352600f82528083209483529390529190912054919250906064908390670de0b6b3a764000090610c0d89613230565b610c179190614860565b6001600160a01b0388165f90815260208190526040902054610c399190614873565b610c43919061488a565b610c4d9190614873565b610c57919061488a565b610c6191906148a9565b949350505050565b5f6040517f80571c0000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ca4613805565b5f610cae81613848565b600a5442903090610cc290620697806148a9565b821015610ce25760405163cba1549360e01b815260040160405180910390fd5b600a8290555f610d127f0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f083613a62565b90507f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b031663e6f1daf26040518163ffffffff1660e01b81526004015f604051808303815f87803b158015610d6c575f80fd5b505af1158015610d7e573d5f803e3d5ffd5b505050505f610dad7f0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f084613a62565b90505f610dba8383614860565b905060095481610dca91906148a9565b9050805f03610dec57604051631f2a200560e01b815260040160405180910390fd5b5f600955610e197f0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f0613230565b6001600160a01b037f0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f0165f908152600d602052604090206003810191909155600101548510610eac57610e6f62093a808261488a565b6001600160a01b037f0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f0165f908152600d6020526040902055610f8d565b6001600160a01b037f0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f0165f908152600d6020526040812060010154610ef2908790614860565b6001600160a01b037f0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f0165f908152600d602052604081205491925090610f389083614873565b905062093a80610f4882856148a9565b610f52919061488a565b6001600160a01b037f0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f0165f908152600d602052604090205550505b6001600160a01b037f0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f0165f908152600d60205260409020600201859055610fd762093a80866148a9565b6001600160a01b037f0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f0165f818152600d60205260409081902060010192909255905133907ff70d5c697de7ea828df48e5c4573cb2194c659f1901f70110c52b066dcf508269061104a9085815260200190565b60405180910390a35050505050506110626001600555565b565b5f8281526006602052604090206001015461107e816135e7565b6110888383613b24565b50505050565b611096613805565b336110a081613848565b7f000000000000000000000000179b816a930376b89627fd3016b2a0086487a79e6110ca81613848565b335f818152601160205260409020805460ff166110fa5760405163ba112c9360e01b815260040160405180910390fd5b6001810154421061111e57604051630407b05b60e31b815260040160405180910390fd5b845f0361113e57604051631f2a200560e01b815260040160405180910390fd5b806003015485111561115257806003015494505b84816003015f8282546111659190614860565b909155505060038101545f0361118457805460ff191681555f60018201555b6001600160a01b037f000000000000000000000000179b816a930376b89627fd3016b2a0086487a79e165f908152601160205260408120906103e86111cb61025889614873565b6111d5919061488a565b90505f6111e28289614860565b90505f6103e86111f461034285614873565b6111fe919061488a565b90505f61120b8285614860565b9050611217878b613b57565b6112417f000000000000000000000000179b816a930376b89627fd3016b2a0086487a79e82613ba9565b845460ff1661128857845460ff1916600117855561126262eff100426148a9565b856001018190555080856003015f82825461127d91906148a9565b909155506112a19050565b80856003015f82825461129b91906148a9565b90915550505b6112aa82613bf6565b5f6112b3613def565b905083811061133257604051632e1a7d4d60e01b8152600481018590527f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b031690632e1a7d4d906024015f604051808303815f87803b15801561131b575f80fd5b505af115801561132d573d5f803e3d5ffd5b505050505b61135d7f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d0905789866135f1565b6001600160a01b0388167fd0c4ec39c284dcd3dde61d2b12cfd30c61cea001d0b25ab78eb79aca7e09510b8561139385876148a9565b6040805192835260208301919091520160405180910390a2505050505050505050506113bf6001600555565b50565b6001600160a01b0381163314611404576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b1d8282613e7c565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929611438816135e7565b60405163095ea7b360e01b81526001600160a01b037f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f811660048301525f60248301527f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d09057169063095ea7b3906044016020604051808303815f875af11580156114c3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114e791906148bc565b5060405163095ea7b360e01b81526001600160a01b037f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f811660048301525f1960248301527f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d09057169063095ea7b3906044016020604051808303815f875af1158015611574573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061159891906148bc565b5050565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9296115c6816135e7565b600b5460ff16156115ea576040516313d0ff5960e31b815260040160405180910390fd5b6040516370a0823160e01b81523060048201525f907f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b0316906370a0823190602401602060405180830381865afa15801561164e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061167291906148d7565b604051632e1a7d4d60e01b8152600481018290529091507f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b031690632e1a7d4d906024015f604051808303815f87803b1580156116d4575f80fd5b505af11580156116e6573d5f803e3d5ffd5b5050600b805460ff19166001179055505f90506117237f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d0905730613a62565b90507f99d7f8b71cfb9126984f7a5eed3a40e64a8959e9b0e442221546fb04ec6a489c8160405161175691815260200190565b60405180910390a1505050565b61176b613805565b3361177581613848565b335f818152601160205260408120905b600c54811015611a08576001600160a01b0383165f908152601060205260408120600c8054839190859081106117bd576117bd6148ee565b5f9182526020808320909101546001600160a01b03168352820192909252604001902054905080156119f5576001600160a01b0384165f908152601060205260408120600c805483919086908110611817576118176148ee565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055600c805430919084908110611852576118526148ee565b5f918252602090912001546001600160a01b03160361196357825460ff1615801561188457508254610100900460ff16155b156118975761189281613ea7565b611994565b825460ff161580156118af57508254610100900460ff165b156118d25780836004015f8282546118c791906148a9565b909155506119599050565b825460ff1680156118ea57508254610100900460ff16155b156119025780836003015f8282546118c791906148a9565b825460ff16801561191957508254610100900460ff165b156119595782600201548360010154106119405780836003015f8282546118c791906148a9565b80836004015f82825461195391906148a9565b90915550505b6118928482613ba9565b611994600c8381548110611979576119796148ee565b5f918252602090912001546001600160a01b031685836135f1565b600c82815481106119a7576119a76148ee565b5f91825260209182902001546040518381526001600160a01b0391821692918716917f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc9910160405180910390a35b5080611a0081614902565b915050611785565b505050506110626001600555565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929611a40816135e7565b600b5460ff16611a6357604051636cd6020160e01b815260040160405180910390fd5b600b805460ff191690555f611a987f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d0905730613a62565b90508015611b165760405163b6b55f2560e01b8152600481018290527f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b03169063b6b55f25906024015f604051808303815f87803b158015611aff575f80fd5b505af1158015611b11573d5f803e3d5ffd5b505050505b6040518181527fb96cc4c95dd57612feeeaed56e65b2fd6ba67b101d0592527f05756fafcab4b4906020015b60405180910390a15050565b611b56613805565b33611b6081613848565b600b5460ff1615611b84576040516313d0ff5960e31b815260040160405180910390fd5b815f03611ba457604051631f2a200560e01b815260040160405180910390fd5b335f818152601160205260409020805460ff16611bd45760405163ba112c9360e01b815260040160405180910390fd5b60018101544210611bf857604051630407b05b60e31b815260040160405180910390fd5b611c247f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d09057833087613f5a565b60405163b6b55f2560e01b8152600481018590527f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b03169063b6b55f25906024015f604051808303815f87803b158015611c83575f80fd5b505af1158015611c95573d5f803e3d5ffd5b50505050611ca38285613ba9565b83816003015f828254611cb691906148a9565b90915550506040518481526001600160a01b038316907fea61c3b66d1b521d412995113fb2d02e1f83da97103751ff25a4e0689f3e937e9060200160405180910390a25050506113bf6001600555565b611d0e613805565b600b5460ff1615611d32576040516313d0ff5960e31b815260040160405180910390fd5b335f818152601160205260409020805460ff16611d625760405163ba112c9360e01b815260040160405180910390fd5b425f611d6e85836148a9565b905082600101548111611d9457604051630f962f3d60e31b815260040160405180910390fd5b611da16224ea00836148a9565b811015611dc157604051630f962f3d60e31b815260040160405180910390fd5b611dce62eff100836148a9565b8110611de457611de162eff100836148a9565b90505b600183018190556040518181526001600160a01b038516907fe5d4b5c97a45cd2c590e17dd6dc2c0b1935d6c56701144a267f57b1a9f6779f49060200160405180910390a2505050506113bf6001600555565b6001600160a01b0381165f908152601160209081526040808320815160c081018352815460ff80821615158352610100909104161515938101939093526001810154918301919091526002810154606083018190526003820154608084015260049091015460a08301524290808403611eb457505f949350505050565b808210611ec557505f949350505050565b611ecf8282614860565b95945050505050565b611eff60405180608001604052805f81526020015f81526020015f81526020015f81525090565b506001600160a01b03165f908152600d6020908152604091829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b611f54613805565b33611f5e81613848565b335f818152601160205260409020805460ff16611f8e5760405163ba112c9360e01b815260040160405180910390fd5b6001810154421015611fb35760405163cba1549360e01b815260040160405180910390fd5b805460ff191681556003810180545f60018401819055909155611fd68382613b57565b5f611fdf613def565b905081811061205e57604051632e1a7d4d60e01b8152600481018390527f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b031690632e1a7d4d906024015f604051808303815f87803b158015612047575f80fd5b505af1158015612059573d5f803e3d5ffd5b505050505b6120897f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d0905785846135f1565b836001600160a01b03167fb34e14e48464e0328f36e8e73e48bc8f543c7c1eca2f3443f4b4590fcfeb1c39836040516120c491815260200190565b60405180910390a250505050506110626001600555565b5f6120e5816135e7565b7f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d090576001600160a01b0316846001600160a01b0316148061213c57506001600160a01b0384165f908152600e602052604090205460ff165b8061217857507f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b0316846001600160a01b0316145b1561219657604051632317b1f960e11b815260040160405180910390fd5b6110888484846135f1565b6121a9613805565b335f8181526011602052604090208054610100900460ff166121de5760405163f325c79960e01b815260040160405180910390fd5b835f036121fe57604051631f2a200560e01b815260040160405180910390fd5b806004015484111561221257806004015493505b60028101544290811061223857604051630407b05b60e31b815260040160405180910390fd5b84826004015f82825461224b9190614860565b9091555050815460ff16612347575f61226485836148a9565b90508260020154811161228a57604051630f962f3d60e31b815260040160405180910390fd5b6122976224ea00836148a9565b81116122ad576122aa6224ea00836148a9565b90505b6122ba62eff100836148a9565b81106122d0576122cd62eff100836148a9565b90505b825460ff19166001908117845583018190556003830180548791905f906122f89084906148a9565b909155505060408051878152602081018390526001600160a01b038616917f167357c41e38a45e1950f61b1f5accf902c878d83f1685f7f72fb666203ce047910160405180910390a2506123ea565b816001015482600201541061236f57604051630f962f3d60e31b815260040160405180910390fd5b8160010154811061239357604051630407b05b60e31b815260040160405180910390fd5b84826003015f8282546123a691906148a9565b90915550506040518581526001600160a01b038416907fea61c3b66d1b521d412995113fb2d02e1f83da97103751ff25a4e0689f3e937e9060200160405180910390a25b81600401545f0361240557815461ff00191682555f60028301555b5050506115986001600555565b5f6109a6426001600160a01b0384165f908152600d602052604090206001015461404c565b6060600c805480602002602001604051908101604052809291908181526020018280548015610a3257602002820191905f5260205f20905b81546001600160a01b0316815260019091019060200180831161246f575050505050905090565b335f818152601160205260409020600b5460ff166124c757604051636cd6020160e01b815260040160405180910390fd5b600b54610100900460ff166124ef57604051631eb49d6d60e11b815260040160405180910390fd5b805460ff161561254a575f600182015560038101546040519081526001600160a01b038316907fb3a7e01844a6519be50efb73ea6455ec51d74e362c2323a1d336bc5bb6ea0dca9060200160405180910390a261254a611f4c565b8054610100900460ff1615611598575f600282015560048101546040519081526001600160a01b038316907f4394b091f9fe1428e51031c7c52eae2b29e37180b6d1fafc46954ce892e730119060200160405180910390a2611598612daa565b5f8281526007602052604081206125c19083614061565b9392505050565b6060600480546109bb90614814565b6001600160a01b0381165f908152600d60205260408120600101544290811061260257505f92915050565b6001600160a01b0383165f908152600d6020526040812060010154612628908390614860565b6001600160a01b0385165f908152600d6020526040902054909150610c619082614873565b612655613805565b3361265f81613848565b8261266981613848565b336001600160a01b03851681900361269457604051632317b1f960e11b815260040160405180910390fd5b6001600160a01b0381165f908152601160205260409020805460ff166126cd5760405163ba112c9360e01b815260040160405180910390fd5b600181015442106126f157604051630407b05b60e31b815260040160405180910390fd5b845f0361271157604051631eb49d6d60e11b815260040160405180910390fd5b806003015485111561272557806003015494505b6001600160a01b0386165f908152601160205260409020805460ff161561276f5781600101548160010154101561276f57604051631eb49d6d60e11b815260040160405180910390fd5b805460ff166127da57805460ff191660019081178255828101549082018190556040516001600160a01b038916917f167357c41e38a45e1950f61b1f5accf902c878d83f1685f7f72fb666203ce047916127d1918a8252602082015260400190565b60405180910390a25b85826003015f8282546127ed9190614860565b909155505060038201545f0361280c57815460ff191682555f60018301555b6128168387613b57565b6128208787613ba9565b85816003015f82825461283391906148a9565b92505081905550866001600160a01b0316836001600160a01b03167f210fe3b7301440ad2fb7fc1f612b0c5926f6ee31413f07582747ba8c3a37332b8860405161287f91815260200190565b60405180910390a350505050506115986001600555565b61289e613805565b336128a881613848565b600b5460ff16156128cc576040516313d0ff5960e31b815260040160405180910390fd5b825f036128ec57604051631f2a200560e01b815260040160405180910390fd5b335f818152601160205260409020805460ff161561291d5760405163cba1549360e01b815260040160405180910390fd5b425f61292986836148a9565b90506129386224ea00836148a9565b811161294e5761294b6224ea00836148a9565b90505b61295b62eff100836148a9565b81106129715761296e62eff100836148a9565b90505b825460ff19166001908117845583018190556129af7f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d0905785308a613f5a565b60405163b6b55f2560e01b8152600481018890527f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b03169063b6b55f25906024015f604051808303815f87803b158015612a0e575f80fd5b505af1158015612a20573d5f803e3d5ffd5b50505050612a2e8488613ba9565b86836003015f828254612a4191906148a9565b909155505060408051888152602081018390526001600160a01b038616917f167357c41e38a45e1950f61b1f5accf902c878d83f1685f7f72fb666203ce047910160405180910390a250505050506115986001600555565b5f612aa381613848565b5f612aad816135e7565b825f03612acd57604051631f2a200560e01b815260040160405180910390fd5b6001600160a01b0384165f908152600e602052604090205460ff16612b5c57600c805460018082019092557fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c701805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387169081179091555f908152600e60205260409020805460ff191690911790555b6001600160a01b0384165f908152600d602052604090206001015442903090612b8487613230565b6001600160a01b0388165f908152600d6020526040812060030191909155612bac8884613a62565b9050612bba8833858a613f5a565b5f612bc58985613a62565b9050612bd18282614860565b9750828510612c0457612be762093a808961488a565b6001600160a01b038a165f908152600d6020526040902055612c6a565b5f612c0f8685614860565b6001600160a01b038b165f908152600d602052604081205491925090612c359083614873565b905062093a80612c45828c6148a9565b612c4f919061488a565b6001600160a01b038c165f908152600d602052604090205550505b6001600160a01b0389165f908152600d60205260409020600201859055612c9462093a80866148a9565b6001600160a01b038a165f818152600d60205260409081902060010192909255905133907ff70d5c697de7ea828df48e5c4573cb2194c659f1901f70110c52b066dcf5082690612ce7908c815260200190565b60405180910390a3505050505050505050565b5f612d04816135e7565b600b5460ff16612d2757604051636cd6020160e01b815260040160405180910390fd5b600b80548315156101000261ff00199091161790556040517f02fad22840218f133846b0f05b4ae9e8601d5164b1f1b0f55b6347d56a68ec2890611b4290841515815260200190565b5f8181526007602052604081206109a69061406c565b5f82815260066020526040902060010154612da0816135e7565b6110888383613e7c565b612db2613805565b33612dbc81613848565b335f8181526011602052604090208054610100900460ff16612df15760405163f325c79960e01b815260040160405180910390fd5b6002810154421015612e165760405163cba1549360e01b815260040160405180910390fd5b6004810180545f918290556002830191909155815461ff0019168255612e3c8382613b57565b5f612e45613def565b9050818110612ec457604051632e1a7d4d60e01b8152600481018390527f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b031690632e1a7d4d906024015f604051808303815f87803b158015612ead575f80fd5b505af1158015612ebf573d5f803e3d5ffd5b505050505b612eef7f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d0905785846135f1565b836001600160a01b03167fe0e1773eaedce8d3cc03f7a3a1f50d8307c2be64ecd82c50248dd0bb52bf228c836040516120c491815260200190565b612f32613805565b33612f3c81613848565b7f000000000000000000000000179b816a930376b89627fd3016b2a0086487a79e612f6681613848565b335f8181526011602052604090208054610100900460ff16612f9b5760405163f325c79960e01b815260040160405180910390fd5b60028101544210612fbf57604051630407b05b60e31b815260040160405180910390fd5b845f03612fdf57604051631f2a200560e01b815260040160405180910390fd5b8060040154851115612ff357806004015494505b84816004015f8282546130069190614860565b909155505060048101545f0361302057805461ff00191681555b5f6103e861303061025888614873565b61303a919061488a565b90505f6130478288614860565b90505f6103e861305961034285614873565b613063919061488a565b90505f6130708285614860565b6001600160a01b037f000000000000000000000000179b816a930376b89627fd3016b2a0086487a79e165f9081526011602052604090209091506130b4878b613b57565b6130de7f000000000000000000000000179b816a930376b89627fd3016b2a0086487a79e83613ba9565b805460ff1661312557805460ff191660011781556130ff62eff100426148a9565b816001018190555081816003015f82825461311a91906148a9565b9091555061313e9050565b81816003015f82825461313891906148a9565b90915550505b61314783613bf6565b5f613150613def565b90508481106131cf57604051632e1a7d4d60e01b8152600481018690527f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b031690632e1a7d4d906024015f604051808303815f87803b1580156131b8575f80fd5b505af11580156131ca573d5f803e3d5ffd5b505050505b6131fa7f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d0905789876135f1565b6001600160a01b0388167fd0c4ec39c284dcd3dde61d2b12cfd30c61cea001d0b25ab78eb79aca7e09510b8661139386886148a9565b5f61323a60025490565b5f0361325e57506001600160a01b03165f908152600d602052604090206003015490565b6002546001600160a01b0383165f908152600d602052604090208054600290910154670de0b6b3a7640000919061329486612412565b61329e9190614860565b6132a89190614873565b6132b29190614873565b6132bc919061488a565b6001600160a01b0383165f908152600d60205260409020600301546109a691906148a9565b6001600160a01b0381165f908152601160209081526040808320815160c081018352815460ff8082161515835261010090910416151593810193909352600181015491830182905260028101546060840152600381015460808401526004015460a08301524290808403611eb457505f949350505050565b613361613805565b8161336b81613848565b6008546001600160a01b0316331461339657604051631eb49d6d60e11b815260040160405180910390fd5b6001600160a01b0383165f9081526011602052604090208054429190610100900460ff16156133e357806002015482106133e357604051630407b05b60e31b815260040160405180910390fd5b8054610100900460ff16613460575f6133ff62375f00846148a9565b825461ff0019166101001783556002830181905560408051878152602081018390529192506001600160a01b038816917f941051f5740326e2299731cca609f60c53e8302c775962e529bb902465620ddc910160405180910390a2506134a4565b846001600160a01b03167fb8433e84e1a72e3681dd915e7c43117b4065b48971321cfce4ef3aaa13a665088560405161349b91815260200190565b60405180910390a25b6008546134dd907f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d09057906001600160a01b03163087613f5a565b83816004015f8282546134f091906148a9565b909155505060405163b6b55f2560e01b8152600481018590527f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b03169063b6b55f25906024015f604051808303815f87803b158015613554575f80fd5b505af1158015613566573d5f803e3d5ffd5b505050506124058585613ba9565b5f6001600160e01b031982167f7965db0b0000000000000000000000000000000000000000000000000000000014806109a657507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146109a6565b610b1d8383836001614075565b6113bf813361416b565b6040516001600160a01b038381166024830152604482018390525f91829186169060640160408051601f198184030181529181526020820180516001600160e01b03167fa9059cbb0000000000000000000000000000000000000000000000000000000017905251613663919061491a565b5f604051808303815f865af19150503d805f811461369c576040519150601f19603f3d011682016040523d82523d5f602084013e6136a1565b606091505b50915091508180156136cb5750805115806136cb5750808060200190518101906136cb91906148bc565b6136d3575f80fd5b5050505050565b335f818152601160209081526040808320815160c081018352815460ff80821615158352610100909104161515938101939093526001810154918301919091526002810154606083015260038101546080830181905260049091015460a0830181905292939260469185918291111561375d57613756856132e1565b9050613769565b61376685611e37565b90505b6137776224ea006005614873565b81111561378757601e91506137f1565b6137956224ea006004614873565b8111156137a557601891506137f1565b6137b36224ea006003614873565b8111156137c357601291506137f1565b6137d16224ea006002614873565b8111156137e157600c91506137f1565b6224ea008111156137f157600691505b6137fb82846148a9565b9550505050505090565b600260055403613841576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600555565b5f5b600c5481101561159857613883600c828154811061386a5761386a6148ee565b5f918252602090912001546001600160a01b0316613230565b600d5f600c8481548110613899576138996148ee565b5f9182526020808320909101546001600160a01b03168352820192909252604001902060030155600c80546138f29190839081106138d9576138d96148ee565b5f918252602090912001546001600160a01b0316612412565b600d5f600c8481548110613908576139086148ee565b5f9182526020808320909101546001600160a01b039081168452908301939093526040909101902060020191909155821615613a505761396e600c8281548110613954576139546148ee565b5f918252602090912001546001600160a01b031683610baa565b6001600160a01b0383165f908152601060205260408120600c80549192918590811061399c5761399c6148ee565b5f9182526020808320909101546001600160a01b03168352820192909252604001812091909155600c8054600d929190849081106139dc576139dc6148ee565b5f9182526020808320909101546001600160a01b0390811684528382019490945260409283018220600301549386168252600f9052908120600c805491929185908110613a2b57613a2b6148ee565b5f9182526020808320909101546001600160a01b031683528201929092526040019020555b80613a5a81614902565b91505061384a565b6040516001600160a01b0382811660248301525f91829182919086169060440160408051601f198184030181529181526020820180516001600160e01b03166370a0823160e01b17905251613ab7919061491a565b5f60405180830381855afa9150503d805f8114613aef576040519150601f19603f3d011682016040523d82523d5f602084013e613af4565b606091505b5091509150818015613b0857506020815110155b613b10575f80fd5b80806020019051810190611ecf91906148d7565b5f80613b3084846141d8565b905080156125c1575f848152600760205260409020613b4f9084614283565b509392505050565b6001600160a01b038216613b9e576040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081525f60048201526024015b60405180910390fd5b611598825f83614297565b6001600160a01b038216613beb576040517fec442f050000000000000000000000000000000000000000000000000000000081525f6004820152602401613b95565b6115985f8383614297565b5f613c0081613848565b305f818152600e602052604090205460ff16613c8657600c805460018082019092557fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c701805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091555f908152600e60205260409020805460ff191690911790555b42613c9082613230565b6001600160a01b0383165f908152600d602052604090206003810191909155600101548110613ce357613cc662093a808561488a565b6001600160a01b0383165f908152600d6020526040902055613d64565b6001600160a01b0382165f908152600d6020526040812060010154613d09908390614860565b6001600160a01b0384165f908152600d602052604081205491925090613d2f9083614873565b905062093a80613d3f82886148a9565b613d49919061488a565b6001600160a01b0385165f908152600d602052604090205550505b6001600160a01b0382165f908152600d60205260409020600201819055613d8e62093a80826148a9565b6001600160a01b0383165f818152600d60205260409081902060010192909255905133907ff70d5c697de7ea828df48e5c4573cb2194c659f1901f70110c52b066dcf5082690613de19088815260200190565b60405180910390a350505050565b6040516370a0823160e01b81523060048201525f907f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b0316906370a0823190602401602060405180830381865afa158015613e53573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613e7791906148d7565b905090565b5f80613e8884846142e1565b905080156125c1575f848152600760205260409020613b4f9084614366565b5f613eb0613def565b9050818110613f2f57604051632e1a7d4d60e01b8152600481018390527f000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f6001600160a01b031690632e1a7d4d906024015f604051808303815f87803b158015613f18575f80fd5b505af1158015613f2a573d5f803e3d5ffd5b505050505b6115987f0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d0905733846135f1565b6040516001600160a01b0384811660248301528381166044830152606482018390525f91829187169060840160408051601f198184030181529181526020820180516001600160e01b03167f23b872dd0000000000000000000000000000000000000000000000000000000017905251613fd4919061491a565b5f604051808303815f865af19150503d805f811461400d576040519150601f19603f3d011682016040523d82523d5f602084013e614012565b606091505b509150915081801561403c57508051158061403c57508080602001905181019061403c91906148bc565b614044575f80fd5b505050505050565b5f81831061405a57816125c1565b5090919050565b5f6125c1838361437a565b5f6109a6825490565b6001600160a01b0384166140b7576040517fe602df050000000000000000000000000000000000000000000000000000000081525f6004820152602401613b95565b6001600160a01b0383166140f9576040517f94280d620000000000000000000000000000000000000000000000000000000081525f6004820152602401613b95565b6001600160a01b038085165f908152600160209081526040808320938716835292905220829055801561108857826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051613de191815260200190565b5f8281526006602090815260408083206001600160a01b038516845290915290205460ff16611598576040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526001600160a01b038216600482015260248101839052604401613b95565b5f8281526006602090815260408083206001600160a01b038516845290915281205460ff1661427c575f8381526006602090815260408083206001600160a01b03861684529091529020805460ff191660011790556142343390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016109a6565b505f6109a6565b5f6125c1836001600160a01b0384166143a0565b6001600160a01b03831615806142b457506001600160a01b038216155b156142c457610b1d8383836143e5565b6142cd83613848565b6142d682613848565b610b1d8383836143e5565b5f8281526006602090815260408083206001600160a01b038516845290915281205460ff161561427c575f8381526006602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016109a6565b5f6125c1836001600160a01b038416614524565b5f825f01828154811061438f5761438f6148ee565b905f5260205f200154905092915050565b5f81815260018301602052604081205461427c57508154600181810184555f8481526020808220909301849055845484825282860190935260409020919091556109a6565b6001600160a01b03831661440f578060025f82825461440491906148a9565b909155506144989050565b6001600160a01b0383165f908152602081905260409020548181101561447a576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401613b95565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b0382166144b4576002805482900390556144d2565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161451791815260200190565b60405180910390a3505050565b5f81815260018301602052604081205480156145fe575f614546600183614860565b85549091505f9061455990600190614860565b90508082146145b8575f865f018281548110614577576145776148ee565b905f5260205f200154905080875f018481548110614597576145976148ee565b5f918252602080832090910192909255918252600188019052604090208390555b85548690806145c9576145c9614935565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f9055600193505050506109a6565b5f9150506109a6565b5f60208284031215614617575f80fd5b81356001600160e01b0319811681146125c1575f80fd5b5f5b83811015614648578181015183820152602001614630565b50505f910152565b602081525f825180602084015261466e81604085016020870161462e565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114614698575f80fd5b919050565b5f80604083850312156146ae575f80fd5b6146b783614682565b946020939093013593505050565b5f602082840312156146d5575f80fd5b6125c182614682565b5f80604083850312156146ef575f80fd5b6146f883614682565b915061470660208401614682565b90509250929050565b5f805f60608486031215614721575f80fd5b61472a84614682565b925061473860208501614682565b9150604084013590509250925092565b5f60208284031215614758575f80fd5b5035919050565b5f8060408385031215614770575f80fd5b8235915061470660208401614682565b5f8060408385031215614791575f80fd5b50508035926020909101359150565b602080825282518282018190525f9190848201906040850190845b818110156147e05783516001600160a01b0316835292840192918401916001016147bb565b50909695505050505050565b80151581146113bf575f80fd5b5f60208284031215614809575f80fd5b81356125c1816147ec565b600181811c9082168061482857607f821691505b60208210810361484657634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b818103818111156109a6576109a661484c565b80820281158282048414176109a6576109a661484c565b5f826148a457634e487b7160e01b5f52601260045260245ffd5b500490565b808201808211156109a6576109a661484c565b5f602082840312156148cc575f80fd5b81516125c1816147ec565b5f602082840312156148e7575f80fd5b5051919050565b634e487b7160e01b5f52603260045260245ffd5b5f600182016149135761491361484c565b5060010190565b5f825161492b81846020870161462e565b9190910192915050565b634e487b7160e01b5f52603160045260245ffdfea264697066735822122095fae0a9ab5f799a7b38a21570c671a96a5d80ab62ee4f98595ffd1b8dc214a964736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003c173f1baf9f97bf244796c0179952a6a2e9c2480000000000000000000000000190933669d250406efcf18b351b954ea88d5bfd000000000000000000000000e63af583149eece38c75746db699bc6d6983aca9000000000000000000000000edfa5163b3517c375a978b1557d9d90ba823213f000000000000000000000000179b816a930376b89627fd3016b2a0086487a79e0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d09057000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f000000000000000000000000b6b02aef2b0edfe786abed486d38de95a36f53bb0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f0000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000164c6f636b656420664d6f6e6579206f6e20536f6e696300000000000000000000000000000000000000000000000000000000000000000000000000000000000e4c6f636b6564664d6f6e65794c50000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _operators (address[3]): 0x3C173F1BAF9F97bf244796c0179952a6a2e9C248,0x0190933669d250406efcf18b351b954Ea88D5bfD,0xe63Af583149eeCe38C75746dB699BC6D6983acA9
Arg [1] : _admin (address): 0xEDFa5163b3517c375a978B1557D9D90ba823213F
Arg [2] : _treasury (address): 0x179B816a930376b89627FD3016B2A0086487a79E
Arg [3] : _stakingtoken (address): 0x3ec8254006658E11f9aB5EAf92d64f8528D09057
Arg [4] : _gauge (address): 0x748e5c88b586172692500f3415678C87842f8d3f
Arg [5] : _rewardVester (address): 0xB6B02aef2B0eDFe786aBEd486D38DE95a36f53bB
Arg [6] : _beets (address): 0x2D0E0814E62D80056181F5cd932274405966e4f0
Arg [7] : _name (string): Locked fMoney on Sonic
Arg [8] : _symbol (string): LockedfMoneyLP
-----Encoded View---------------
15 Constructor Arguments found :
Arg [0] : 0000000000000000000000003c173f1baf9f97bf244796c0179952a6a2e9c248
Arg [1] : 0000000000000000000000000190933669d250406efcf18b351b954ea88d5bfd
Arg [2] : 000000000000000000000000e63af583149eece38c75746db699bc6d6983aca9
Arg [3] : 000000000000000000000000edfa5163b3517c375a978b1557d9d90ba823213f
Arg [4] : 000000000000000000000000179b816a930376b89627fd3016b2a0086487a79e
Arg [5] : 0000000000000000000000003ec8254006658e11f9ab5eaf92d64f8528d09057
Arg [6] : 000000000000000000000000748e5c88b586172692500f3415678c87842f8d3f
Arg [7] : 000000000000000000000000b6b02aef2b0edfe786abed486d38de95a36f53bb
Arg [8] : 0000000000000000000000002d0e0814e62d80056181f5cd932274405966e4f0
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [10] : 00000000000000000000000000000000000000000000000000000000000001a0
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000016
Arg [12] : 4c6f636b656420664d6f6e6579206f6e20536f6e696300000000000000000000
Arg [13] : 000000000000000000000000000000000000000000000000000000000000000e
Arg [14] : 4c6f636b6564664d6f6e65794c50000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.