Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 18 from a total of 18 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw | 13922572 | 1126 days ago | IN | 0 ETH | 0.07725662 | ||||
Withdraw | 13915862 | 1127 days ago | IN | 0 ETH | 0.04373808 | ||||
Withdraw | 13782726 | 1147 days ago | IN | 0 ETH | 0.00999096 | ||||
Withdraw | 13781533 | 1148 days ago | IN | 0 ETH | 0.02263043 | ||||
Stake | 13718982 | 1158 days ago | IN | 0 ETH | 0.0172464 | ||||
Withdraw | 13714179 | 1158 days ago | IN | 0 ETH | 0.03315105 | ||||
Withdraw | 13639069 | 1170 days ago | IN | 0 ETH | 0.02730759 | ||||
Withdraw | 13595448 | 1177 days ago | IN | 0 ETH | 0.01194085 | ||||
Stake | 13491798 | 1193 days ago | IN | 0 ETH | 0.00818432 | ||||
Withdraw | 13461845 | 1198 days ago | IN | 0 ETH | 0.0310971 | ||||
Stake | 13456219 | 1199 days ago | IN | 0 ETH | 0.00922567 | ||||
Stake | 13427464 | 1203 days ago | IN | 0 ETH | 0.0103668 | ||||
Withdraw | 13393430 | 1209 days ago | IN | 0 ETH | 0.02235451 | ||||
Stake | 13249045 | 1231 days ago | IN | 0 ETH | 0.00415365 | ||||
Stake | 13211517 | 1237 days ago | IN | 0 ETH | 0.00750353 | ||||
Stake | 13149656 | 1247 days ago | IN | 0 ETH | 0.01275711 | ||||
Stake | 13100215 | 1254 days ago | IN | 0 ETH | 0.00661615 | ||||
Stake | 13098018 | 1255 days ago | IN | 0 ETH | 0.01566398 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
PendleLiquidityMiningBaseV2
Compiler Version
v0.7.6+commit.7338295f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "../../periphery/WithdrawableV2.sol"; import "../../interfaces/IPendleLiquidityMiningV2.sol"; import "../../interfaces/IPendlePausingManager.sol"; import "../../interfaces/IPendleWhitelist.sol"; import "../../libraries/MathLib.sol"; import "../../libraries/TokenUtilsLib.sol"; /* - stakeToken is the token to be used to stake into this contract to receive rewards - yieldToken is the token generated by stakeToken while it's being staked. For example, Sushi's LP token generates SUSHI(if it's in Onsen program), or Pendle's Aave LP generates aToken - If there is no yieldToken, it should be set to address(0) to save gas */ contract PendleLiquidityMiningBaseV2 is IPendleLiquidityMiningV2, WithdrawableV2, ReentrancyGuard { using Math for uint256; using SafeMath for uint256; using SafeERC20 for IERC20; struct EpochData { uint256 totalStakeUnits; uint256 totalRewards; uint256 lastUpdated; mapping(address => uint256) stakeUnitsForUser; mapping(address => uint256) availableRewardsForUser; } IPendleWhitelist public immutable whitelist; IPendlePausingManager public immutable pausingManager; uint256 public override numberOfEpochs; uint256 public override totalStake; mapping(uint256 => EpochData) internal epochData; mapping(address => uint256) public override balances; mapping(address => uint256) public lastTimeUserStakeUpdated; mapping(address => uint256) public lastEpochClaimed; address public immutable override pendleTokenAddress; address public immutable override stakeToken; address public immutable override yieldToken; uint256 public immutable override startTime; uint256 public immutable override epochDuration; uint256 public immutable override vestingEpochs; uint256 public constant MULTIPLIER = 10**20; // yieldToken-related mapping(address => uint256) public override dueInterests; mapping(address => uint256) public override lastParamL; uint256 public override lastNYield; uint256 public override paramL; modifier hasStarted() { require(_getCurrentEpochId() > 0, "NOT_STARTED"); _; } modifier nonContractOrWhitelisted() { bool isEOA = !Address.isContract(msg.sender) && tx.origin == msg.sender; require(isEOA || whitelist.whitelisted(msg.sender), "CONTRACT_NOT_WHITELISTED"); _; } modifier isUserAllowedToUse() { (bool paused, ) = pausingManager.checkLiqMiningStatus(address(this)); require(!paused, "LIQ_MINING_PAUSED"); require(numberOfEpochs > 0, "NOT_FUNDED"); require(_getCurrentEpochId() > 0, "NOT_STARTED"); _; } constructor( address _governanceManager, address _pausingManager, address _whitelist, address _pendleTokenAddress, address _stakeToken, address _yieldToken, uint256 _startTime, uint256 _epochDuration, uint256 _vestingEpochs ) PermissionsV2(_governanceManager) { require(_startTime > block.timestamp, "INVALID_START_TIME"); TokenUtils.requireERC20(_pendleTokenAddress); TokenUtils.requireERC20(_stakeToken); require(_vestingEpochs > 0, "INVALID_VESTING_EPOCHS"); // yieldToken can be zero address pausingManager = IPendlePausingManager(_pausingManager); whitelist = IPendleWhitelist(_whitelist); pendleTokenAddress = _pendleTokenAddress; stakeToken = _stakeToken; yieldToken = _yieldToken; startTime = _startTime; epochDuration = _epochDuration; vestingEpochs = _vestingEpochs; paramL = 1; } /** @notice set up emergencyMode by pulling all tokens back to this contract & approve spender to spend infinity amount */ function setUpEmergencyMode(address spender, bool) external virtual override { (, bool emergencyMode) = pausingManager.checkLiqMiningStatus(address(this)); require(emergencyMode, "NOT_EMERGENCY"); (address liqMiningEmergencyHandler, , ) = pausingManager.liqMiningEmergencyHandler(); require(msg.sender == liqMiningEmergencyHandler, "NOT_EMERGENCY_HANDLER"); // because we are not staking our tokens anywhere else, we can just approve IERC20(pendleTokenAddress).safeApprove(spender, type(uint256).max); IERC20(stakeToken).safeApprove(spender, type(uint256).max); if (yieldToken != address(0)) IERC20(yieldToken).safeApprove(spender, type(uint256).max); } /** @notice create new epochs & fund rewards for them @dev same logic as the function in V1 */ function fund(uint256[] calldata rewards) external virtual override onlyGovernance { // Once the program is over, it cannot be extended require(_getCurrentEpochId() <= numberOfEpochs, "LAST_EPOCH_OVER"); uint256 nNewEpochs = rewards.length; uint256 totalFunded; // all the funding will be used for new epochs for (uint256 i = 0; i < nNewEpochs; i++) { totalFunded = totalFunded.add(rewards[i]); epochData[numberOfEpochs + i + 1].totalRewards = rewards[i]; } numberOfEpochs = numberOfEpochs.add(nNewEpochs); IERC20(pendleTokenAddress).safeTransferFrom(msg.sender, address(this), totalFunded); emit Funded(rewards, numberOfEpochs); } /** @notice top up rewards of exisiting epochs @dev almost same logic as the function in V1 without the redundant isFunded check */ function topUpRewards(uint256[] calldata epochIds, uint256[] calldata rewards) external virtual override onlyGovernance { require(epochIds.length == rewards.length, "INVALID_ARRAYS"); uint256 curEpoch = _getCurrentEpochId(); uint256 endEpoch = numberOfEpochs; uint256 totalTopUp; for (uint256 i = 0; i < epochIds.length; i++) { require(curEpoch < epochIds[i] && epochIds[i] <= endEpoch, "INVALID_EPOCH_ID"); totalTopUp = totalTopUp.add(rewards[i]); epochData[epochIds[i]].totalRewards = epochData[epochIds[i]].totalRewards.add( rewards[i] ); } IERC20(pendleTokenAddress).safeTransferFrom(msg.sender, address(this), totalTopUp); emit RewardsToppedUp(epochIds, rewards); } /** @notice stake tokens in to receive rewards. It's allowed to stake for others @param forAddr the address to stake for @dev all staking data will be updated for `forAddr`, but msg.sender will be the one transferring tokens in */ function stake(address forAddr, uint256 amount) external virtual override nonReentrant nonContractOrWhitelisted isUserAllowedToUse { require(forAddr != address(0), "ZERO_ADDRESS"); require(amount != 0, "ZERO_AMOUNT"); require(_getCurrentEpochId() <= numberOfEpochs, "INCENTIVES_PERIOD_OVER"); _settleStake(forAddr, msg.sender, amount); emit Staked(forAddr, amount); } /** @notice withdraw tokens from the staking contract. It's allowed to withdraw to an address different from msg.sender @param toAddr the address to receive all tokens @dev all staking data will be updated for msg.sender, but `toAddr` will be the one receiving all tokens */ function withdraw(address toAddr, uint256 amount) external virtual override nonReentrant isUserAllowedToUse { require(amount != 0, "ZERO_AMOUNT"); require(toAddr != address(0), "ZERO_ADDRESS"); _settleWithdraw(msg.sender, toAddr, amount); emit Withdrawn(msg.sender, amount); } /** @notice redeem all available rewards from expired epochs. It's allowed to redeem for others @param user the address whose data will be updated & receive rewards */ function redeemRewards(address user) external virtual override nonReentrant isUserAllowedToUse returns (uint256 rewards) { require(user != address(0), "ZERO_ADDRESS"); rewards = _beforeTransferPendingRewards(user); if (rewards != 0) IERC20(pendleTokenAddress).safeTransfer(user, rewards); } /** @notice redeem all due interests. It's allowed to redeem for others @param user the address whose data will be updated & receive due interests */ function redeemDueInterests(address user) external virtual override nonReentrant isUserAllowedToUse returns (uint256 amountOut) { if (yieldToken == address(0)) return 0; require(user != address(0), "ZERO_ADDRESS"); amountOut = _beforeTransferDueInterests(user); amountOut = _pushYieldToken(user, amountOut); } function updateAndReadEpochData(uint256 epochId, address user) external override nonReentrant isUserAllowedToUse returns ( uint256 totalStakeUnits, uint256 totalRewards, uint256 lastUpdated, uint256 stakeUnitsForUser, uint256 availableRewardsForUser ) { _updatePendingRewards(user); return readEpochData(epochId, user); } function readEpochData(uint256 epochId, address user) public view override returns ( uint256 totalStakeUnits, uint256 totalRewards, uint256 lastUpdated, uint256 stakeUnitsForUser, uint256 availableRewardsForUser ) { totalStakeUnits = epochData[epochId].totalStakeUnits; totalRewards = epochData[epochId].totalRewards; lastUpdated = epochData[epochId].lastUpdated; stakeUnitsForUser = epochData[epochId].stakeUnitsForUser[user]; availableRewardsForUser = epochData[epochId].availableRewardsForUser[user]; } /** @notice update all reward-related data for user @dev to be called before user's stakeToken balance changes @dev same logic as the function in V1 */ function _updatePendingRewards(address user) internal virtual { _updateStakeData(); // user has not staked before, no need to do anything if (lastTimeUserStakeUpdated[user] == 0) { lastTimeUserStakeUpdated[user] = block.timestamp; return; } uint256 _curEpoch = _getCurrentEpochId(); uint256 _endEpoch = Math.min(numberOfEpochs, _curEpoch); // if _curEpoch<=numberOfEpochs => the endEpoch hasn't ended yet (since endEpoch=curEpoch) bool _isEndEpochOver = (_curEpoch > numberOfEpochs); // caching uint256 _balance = balances[user]; uint256 _lastTimeUserStakeUpdated = lastTimeUserStakeUpdated[user]; uint256 _totalStake = totalStake; uint256 _startEpoch = _epochOfTimestamp(_lastTimeUserStakeUpdated); // Go through all epochs until now to update stakeUnitsForUser and availableRewardsForEpoch for (uint256 epochId = _startEpoch; epochId <= _endEpoch; epochId++) { if (epochData[epochId].totalStakeUnits == 0) { // in the extreme case of zero staked tokens for this expiry even now, // => nothing to do from this epoch onwards if (_totalStake == 0) break; // nobody stakes anything in this epoch continue; } // updating stakeUnits for users. The logic of this is similar to _updateStakeDataForExpiry epochData[epochId].stakeUnitsForUser[user] = epochData[epochId] .stakeUnitsForUser[user] .add(_calcUnitsStakeInEpoch(_balance, _lastTimeUserStakeUpdated, epochId)); // all epochs prior to the endEpoch must have ended // if epochId == _endEpoch, we must check if the epoch has ended or not if (epochId == _endEpoch && !_isEndEpochOver) { break; } // Now this epoch has ended,let's distribute its reward to this user // calc the amount of rewards the user is eligible to receive from this epoch uint256 rewardsPerVestingEpoch = _calcAmountRewardsForUserInEpoch(user, epochId); // Now we distribute this rewards over the vestingEpochs starting from epochId + 1 // to epochId + vestingEpochs for (uint256 i = epochId + 1; i <= epochId + vestingEpochs; i++) { epochData[i].availableRewardsForUser[user] = epochData[i] .availableRewardsForUser[user] .add(rewardsPerVestingEpoch); } } lastTimeUserStakeUpdated[user] = block.timestamp; } /** @notice update staking data for the current epoch @dev same logic as the function in V1 */ function _updateStakeData() internal virtual { uint256 _curEpoch = _getCurrentEpochId(); // loop through all epochData in descending order for (uint256 i = Math.min(_curEpoch, numberOfEpochs); i > 0; i--) { uint256 epochEndTime = _endTimeOfEpoch(i); uint256 lastUpdatedForEpoch = epochData[i].lastUpdated; if (lastUpdatedForEpoch == epochEndTime) { break; // its already updated until this epoch, our job here is done } // if the epoch hasn't been fully updated yet, we will update it // just add the amount of units contributed by users since lastUpdatedForEpoch -> now // by calling _calcUnitsStakeInEpoch epochData[i].totalStakeUnits = epochData[i].totalStakeUnits.add( _calcUnitsStakeInEpoch(totalStake, lastUpdatedForEpoch, i) ); // If the epoch has ended, lastUpdated = epochEndTime // If not yet, lastUpdated = block.timestamp (aka now) epochData[i].lastUpdated = Math.min(block.timestamp, epochEndTime); } } /** @notice update all interest-related data for user @dev to be called before user's stakeToken balance changes or when user wants to update his interests @dev same logic as the function in CompoundLiquidityMiningV1 */ function _updateDueInterests(address user) internal virtual { if (yieldToken == address(0)) return; _updateParamL(); if (lastParamL[user] == 0) { lastParamL[user] = paramL; return; } uint256 principal = balances[user]; uint256 interestValuePerStakeToken = paramL.sub(lastParamL[user]); uint256 interestFromStakeToken = principal.mul(interestValuePerStakeToken).div(MULTIPLIER); dueInterests[user] = dueInterests[user].add(interestFromStakeToken); lastParamL[user] = paramL; } /** @notice update paramL, lastNYield & redeem interest from external sources @dev to be called only from _updateDueInterests @dev same logic as the function in V1 */ function _updateParamL() internal virtual { if (yieldToken == address(0) || !_checkNeedUpdateParamL()) return; _redeemExternalInterests(); uint256 currentNYield = IERC20(yieldToken).balanceOf(address(this)); (uint256 firstTerm, uint256 paramR) = _getFirstTermAndParamR(currentNYield); uint256 secondTerm; if (totalStake != 0) secondTerm = paramR.mul(MULTIPLIER).div(totalStake); // Update new states paramL = firstTerm.add(secondTerm); lastNYield = currentNYield; } /** @dev same logic as the function in CompoundLiquidityMining @dev to be called only from _updateParamL */ function _getFirstTermAndParamR(uint256 currentNYield) internal virtual returns (uint256 firstTerm, uint256 paramR) { firstTerm = paramL; paramR = currentNYield.sub(lastNYield); } /** @dev function is empty because by default yieldToken==0 */ function _checkNeedUpdateParamL() internal virtual returns (bool) {} /** @dev function is empty because by default yieldToken==0 */ function _redeemExternalInterests() internal virtual {} /** @notice Calc the amount of rewards that the user can receive now & clear all the pending rewards @dev To be called before any rewards is transferred out @dev same logic as the function in V1 */ function _beforeTransferPendingRewards(address user) internal virtual returns (uint256 amountOut) { _updatePendingRewards(user); uint256 _lastEpoch = Math.min(_getCurrentEpochId(), numberOfEpochs + vestingEpochs); for (uint256 i = lastEpochClaimed[user]; i <= _lastEpoch; i++) { if (epochData[i].availableRewardsForUser[user] > 0) { amountOut = amountOut.add(epochData[i].availableRewardsForUser[user]); epochData[i].availableRewardsForUser[user] = 0; } } lastEpochClaimed[user] = _lastEpoch; emit PendleRewardsSettled(user, amountOut); } /** @notice Calc the amount of interests that the user can receive now & clear all the due interests @dev To be called before any interests is transferred out @dev same logic as the function in V1 */ function _beforeTransferDueInterests(address user) internal virtual returns (uint256 amountOut) { if (yieldToken == address(0)) return 0; _updateDueInterests(user); amountOut = Math.min(dueInterests[user], lastNYield); dueInterests[user] = 0; lastNYield = lastNYield.sub(amountOut); } /** @param user the address whose all stake data will be updated @param payer the address which tokens will be pulled from @param amount amount of tokens to be staked @dev payer is only used to pass to _pullStakeToken */ function _settleStake( address user, address payer, uint256 amount ) internal virtual { _updatePendingRewards(user); _updateDueInterests(user); balances[user] = balances[user].add(amount); totalStake = totalStake.add(amount); _pullStakeToken(payer, amount); } /** @param user the address whose all stake data will be updated @param receiver the address which tokens will be pushed to @param amount amount of tokens to be withdrawn @dev receiver is only used to pass to _pullStakeToken */ function _settleWithdraw( address user, address receiver, uint256 amount ) internal virtual { _updatePendingRewards(user); _updateDueInterests(user); balances[user] = balances[user].sub(amount); totalStake = totalStake.sub(amount); _pushStakeToken(receiver, amount); } function _pullStakeToken(address from, uint256 amount) internal virtual { // For the case that we don't need to stake the stakeToken anywhere else, just pull it // into the current contract IERC20(stakeToken).safeTransferFrom(from, address(this), amount); } function _pushStakeToken(address to, uint256 amount) internal virtual { // For the case that we don't need to stake the stakeToken anywhere else, just transfer out // from the current contract if (amount != 0) IERC20(stakeToken).safeTransfer(to, amount); } function _pushYieldToken(address to, uint256 amount) internal virtual returns (uint256 outAmount) { outAmount = Math.min(amount, IERC20(yieldToken).balanceOf(address(this))); if (outAmount != 0) IERC20(yieldToken).safeTransfer(to, outAmount); } /** @notice returns the stakeUnits in the _epochId(th) epoch of an user if he stake from _startTime to now @dev to calculate durationStakeThisEpoch: user will stake from _startTime -> _endTime, while the epoch last from _startTimeOfEpoch -> _endTimeOfEpoch => the stakeDuration of user will be min(_endTime,_endTimeOfEpoch) - max(_startTime,_startTimeOfEpoch) @dev same logic as in V1 */ function _calcUnitsStakeInEpoch( uint256 _tokenAmount, uint256 _startTime, uint256 _epochId ) internal view returns (uint256 stakeUnitsForUser) { uint256 _endTime = block.timestamp; uint256 _l = Math.max(_startTime, _startTimeOfEpoch(_epochId)); uint256 _r = Math.min(_endTime, _endTimeOfEpoch(_epochId)); uint256 durationStakeThisEpoch = _r.subMax0(_l); return _tokenAmount.mul(durationStakeThisEpoch); } /** @notice calc the amount of rewards the user is eligible to receive from this epoch, but we will return the amount per vestingEpoch instead @dev same logic as in V1 */ function _calcAmountRewardsForUserInEpoch(address user, uint256 epochId) internal view returns (uint256 rewardsPerVestingEpoch) { rewardsPerVestingEpoch = epochData[epochId] .totalRewards .mul(epochData[epochId].stakeUnitsForUser[user]) .div(epochData[epochId].totalStakeUnits) .div(vestingEpochs); } function _startTimeOfEpoch(uint256 t) internal view returns (uint256) { // epoch id starting from 1 return startTime.add((t.sub(1)).mul(epochDuration)); } function _getCurrentEpochId() internal view returns (uint256) { return _epochOfTimestamp(block.timestamp); } function _epochOfTimestamp(uint256 t) internal view returns (uint256) { if (t < startTime) return 0; return (t.sub(startTime)).div(epochDuration).add(1); } // Although the name of this function is endTimeOfEpoch, it's actually the beginning of the next epoch function _endTimeOfEpoch(uint256 t) internal view returns (uint256) { // epoch id starting from 1 return startTime.add(t.mul(epochDuration)); } function _allowedToWithdraw(address _token) internal view override returns (bool allowed) { allowed = _token != pendleTokenAddress && _token != stakeToken && _token != yieldToken; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () internal { _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 make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./PermissionsV2.sol"; abstract contract WithdrawableV2 is PermissionsV2 { using SafeERC20 for IERC20; event EtherWithdraw(uint256 amount, address sendTo); event TokenWithdraw(IERC20 token, uint256 amount, address sendTo); /** * @dev Allows governance to withdraw Ether in a Pendle contract * in case of accidental ETH transfer into the contract. * @param amount The amount of Ether to withdraw. * @param sendTo The recipient address. */ function withdrawEther(uint256 amount, address payable sendTo) external onlyGovernance { (bool success, ) = sendTo.call{value: amount}(""); require(success, "WITHDRAW_FAILED"); emit EtherWithdraw(amount, sendTo); } /** * @dev Allows governance to withdraw all IERC20 compatible tokens in a Pendle * contract in case of accidental token transfer into the contract. * @param token IERC20 The address of the token contract. * @param amount The amount of IERC20 tokens to withdraw. * @param sendTo The recipient address. */ function withdrawToken( IERC20 token, uint256 amount, address sendTo ) external onlyGovernance { require(_allowedToWithdraw(address(token)), "TOKEN_NOT_ALLOWED"); token.safeTransfer(sendTo, amount); emit TokenWithdraw(token, amount, sendTo); } // must be overridden by the sub contracts, so we must consider explicitly // in each and every contract which tokens are allowed to be withdrawn function _allowedToWithdraw(address) internal view virtual returns (bool allowed); }
// SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity 0.7.6; interface IPendleLiquidityMiningV2 { event Funded(uint256[] rewards, uint256 numberOfEpochs); event RewardsToppedUp(uint256[] epochIds, uint256[] rewards); event Staked(address user, uint256 amount); event Withdrawn(address user, uint256 amount); event PendleRewardsSettled(address user, uint256 amount); function fund(uint256[] calldata rewards) external; function topUpRewards(uint256[] calldata epochIds, uint256[] calldata rewards) external; function stake(address forAddr, uint256 amount) external; function withdraw(address toAddr, uint256 amount) external; function redeemRewards(address user) external returns (uint256 rewards); function redeemDueInterests(address user) external returns (uint256 amountOut); function setUpEmergencyMode(address spender, bool) external; function updateAndReadEpochData(uint256 epochId, address user) external returns ( uint256 totalStakeUnits, uint256 totalRewards, uint256 lastUpdated, uint256 stakeUnitsForUser, uint256 availableRewardsForUser ); function balances(address user) external view returns (uint256); function startTime() external view returns (uint256); function epochDuration() external view returns (uint256); function readEpochData(uint256 epochId, address user) external view returns ( uint256 totalStakeUnits, uint256 totalRewards, uint256 lastUpdated, uint256 stakeUnitsForUser, uint256 availableRewardsForUser ); function numberOfEpochs() external view returns (uint256); function vestingEpochs() external view returns (uint256); function stakeToken() external view returns (address); function yieldToken() external view returns (address); function pendleTokenAddress() external view returns (address); function totalStake() external view returns (uint256); function dueInterests(address) external view returns (uint256); function lastParamL(address) external view returns (uint256); function lastNYield() external view returns (uint256); function paramL() external view returns (uint256); }
// SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity 0.7.6; interface IPendlePausingManager { event AddPausingAdmin(address admin); event RemovePausingAdmin(address admin); event PendingForgeEmergencyHandler(address _pendingForgeHandler); event PendingMarketEmergencyHandler(address _pendingMarketHandler); event PendingLiqMiningEmergencyHandler(address _pendingLiqMiningHandler); event ForgeEmergencyHandlerSet(address forgeEmergencyHandler); event MarketEmergencyHandlerSet(address marketEmergencyHandler); event LiqMiningEmergencyHandlerSet(address liqMiningEmergencyHandler); event PausingManagerLocked(); event ForgeHandlerLocked(); event MarketHandlerLocked(); event LiqMiningHandlerLocked(); event SetForgePaused(bytes32 forgeId, bool settingToPaused); event SetForgeAssetPaused(bytes32 forgeId, address underlyingAsset, bool settingToPaused); event SetForgeAssetExpiryPaused( bytes32 forgeId, address underlyingAsset, uint256 expiry, bool settingToPaused ); event SetForgeLocked(bytes32 forgeId); event SetForgeAssetLocked(bytes32 forgeId, address underlyingAsset); event SetForgeAssetExpiryLocked(bytes32 forgeId, address underlyingAsset, uint256 expiry); event SetMarketFactoryPaused(bytes32 marketFactoryId, bool settingToPaused); event SetMarketPaused(bytes32 marketFactoryId, address market, bool settingToPaused); event SetMarketFactoryLocked(bytes32 marketFactoryId); event SetMarketLocked(bytes32 marketFactoryId, address market); event SetLiqMiningPaused(address liqMiningContract, bool settingToPaused); event SetLiqMiningLocked(address liqMiningContract); function forgeEmergencyHandler() external view returns ( address handler, address pendingHandler, uint256 timelockDeadline ); function marketEmergencyHandler() external view returns ( address handler, address pendingHandler, uint256 timelockDeadline ); function liqMiningEmergencyHandler() external view returns ( address handler, address pendingHandler, uint256 timelockDeadline ); function permLocked() external view returns (bool); function permForgeHandlerLocked() external view returns (bool); function permMarketHandlerLocked() external view returns (bool); function permLiqMiningHandlerLocked() external view returns (bool); function isPausingAdmin(address) external view returns (bool); function setPausingAdmin(address admin, bool isAdmin) external; function requestForgeHandlerChange(address _pendingForgeHandler) external; function requestMarketHandlerChange(address _pendingMarketHandler) external; function requestLiqMiningHandlerChange(address _pendingLiqMiningHandler) external; function applyForgeHandlerChange() external; function applyMarketHandlerChange() external; function applyLiqMiningHandlerChange() external; function lockPausingManagerPermanently() external; function lockForgeHandlerPermanently() external; function lockMarketHandlerPermanently() external; function lockLiqMiningHandlerPermanently() external; function setForgePaused(bytes32 forgeId, bool paused) external; function setForgeAssetPaused( bytes32 forgeId, address underlyingAsset, bool paused ) external; function setForgeAssetExpiryPaused( bytes32 forgeId, address underlyingAsset, uint256 expiry, bool paused ) external; function setForgeLocked(bytes32 forgeId) external; function setForgeAssetLocked(bytes32 forgeId, address underlyingAsset) external; function setForgeAssetExpiryLocked( bytes32 forgeId, address underlyingAsset, uint256 expiry ) external; function checkYieldContractStatus( bytes32 forgeId, address underlyingAsset, uint256 expiry ) external returns (bool _paused, bool _locked); function setMarketFactoryPaused(bytes32 marketFactoryId, bool paused) external; function setMarketPaused( bytes32 marketFactoryId, address market, bool paused ) external; function setMarketFactoryLocked(bytes32 marketFactoryId) external; function setMarketLocked(bytes32 marketFactoryId, address market) external; function checkMarketStatus(bytes32 marketFactoryId, address market) external returns (bool _paused, bool _locked); function setLiqMiningPaused(address liqMiningContract, bool settingToPaused) external; function setLiqMiningLocked(address liqMiningContract) external; function checkLiqMiningStatus(address liqMiningContract) external returns (bool _paused, bool _locked); }
// SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity 0.7.6; interface IPendleWhitelist { event AddedToWhiteList(address); event RemovedFromWhiteList(address); function whitelisted(address) external view returns (bool); function addToWhitelist(address[] calldata _addresses) external; function removeFromWhitelist(address[] calldata _addresses) external; function getWhitelist() external view returns (address[] memory list); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.7.0; pragma abicoder v2; import "@openzeppelin/contracts/math/SafeMath.sol"; library Math { using SafeMath for uint256; uint256 internal constant BIG_NUMBER = (uint256(1) << uint256(200)); uint256 internal constant PRECISION_BITS = 40; uint256 internal constant RONE = uint256(1) << PRECISION_BITS; uint256 internal constant PI = (314 * RONE) / 10**2; uint256 internal constant PI_PLUSONE = (414 * RONE) / 10**2; uint256 internal constant PRECISION_POW = 1e2; function checkMultOverflow(uint256 _x, uint256 _y) internal pure returns (bool) { if (_y == 0) return false; return (((_x * _y) / _y) != _x); } /** @notice find the integer part of log2(p/q) => find largest x s.t p >= q * 2^x => find largest x s.t 2^x <= p / q */ function log2Int(uint256 _p, uint256 _q) internal pure returns (uint256) { uint256 res = 0; uint256 remain = _p / _q; while (remain > 0) { res++; remain /= 2; } return res - 1; } /** @notice log2 for a number that it in [1,2) @dev _x is FP, return a FP @dev function is from Kyber. Long modified the condition to be (_x >= one) && (_x < two) to avoid the case where x = 2 may lead to incorrect result */ function log2ForSmallNumber(uint256 _x) internal pure returns (uint256) { uint256 res = 0; uint256 one = (uint256(1) << PRECISION_BITS); uint256 two = 2 * one; uint256 addition = one; require((_x >= one) && (_x < two), "MATH_ERROR"); require(PRECISION_BITS < 125, "MATH_ERROR"); for (uint256 i = PRECISION_BITS; i > 0; i--) { _x = (_x * _x) / one; addition = addition / 2; if (_x >= two) { _x = _x / 2; res += addition; } } return res; } /** @notice log2 of (p/q). returns result in FP form @dev function is from Kyber. @dev _p & _q is FP, return a FP */ function logBase2(uint256 _p, uint256 _q) internal pure returns (uint256) { uint256 n = 0; if (_p > _q) { n = log2Int(_p, _q); } require(n * RONE <= BIG_NUMBER, "MATH_ERROR"); require(!checkMultOverflow(_p, RONE), "MATH_ERROR"); require(!checkMultOverflow(n, RONE), "MATH_ERROR"); require(!checkMultOverflow(uint256(1) << n, _q), "MATH_ERROR"); uint256 y = (_p * RONE) / (_q * (uint256(1) << n)); uint256 log2Small = log2ForSmallNumber(y); assert(log2Small <= BIG_NUMBER); return n * RONE + log2Small; } /** @notice calculate ln(p/q). returned result >= 0 @dev function is from Kyber. @dev _p & _q is FP, return a FP */ function ln(uint256 p, uint256 q) internal pure returns (uint256) { uint256 ln2Numerator = 6931471805599453094172; uint256 ln2Denomerator = 10000000000000000000000; uint256 log2x = logBase2(p, q); require(!checkMultOverflow(ln2Numerator, log2x), "MATH_ERROR"); return (ln2Numerator * log2x) / ln2Denomerator; } /** @notice extract the fractional part of a FP @dev value is a FP, return a FP */ function fpart(uint256 value) internal pure returns (uint256) { return value % RONE; } /** @notice convert a FP to an Int @dev value is a FP, return an Int */ function toInt(uint256 value) internal pure returns (uint256) { return value / RONE; } /** @notice convert an Int to a FP @dev value is an Int, return a FP */ function toFP(uint256 value) internal pure returns (uint256) { return value * RONE; } /** @notice return e^exp in FP form @dev estimation by formula at http://pages.mtu.edu/~shene/COURSES/cs201/NOTES/chap04/exp.html the function is based on exp function of: https://github.com/NovakDistributed/macroverse/blob/master/contracts/RealMath.sol @dev the function is expected to converge quite fast, after about 20 iteration @dev exp is a FP, return a FP */ function rpowe(uint256 exp) internal pure returns (uint256) { uint256 res = 0; uint256 curTerm = RONE; for (uint256 n = 0; ; n++) { res += curTerm; curTerm = rmul(curTerm, rdiv(exp, toFP(n + 1))); if (curTerm == 0) { break; } if (n == 500) { /* testing shows that in the most extreme case, it will take 430 turns to converge. however, it's expected that the numbers will not exceed 2^120 in normal situation the most extreme case is rpow((1<<256)-1,(1<<40)-1) (equal to rpow((2^256-1)/2^40,0.99..9)) */ revert("RPOWE_SLOW_CONVERGE"); } } return res; } /** @notice calculate base^exp with base and exp being FP int @dev to improve accuracy, base^exp = base^(int(exp)+frac(exp)) = base^int(exp) * base^frac @dev base & exp are FP, return a FP */ function rpow(uint256 base, uint256 exp) internal pure returns (uint256) { if (exp == 0) { // Anything to the 0 is 1 return RONE; } if (base == 0) { // 0 to anything except 0 is 0 return 0; } uint256 frac = fpart(exp); // get the fractional part uint256 whole = exp - frac; uint256 wholePow = rpowi(base, toInt(whole)); // whole is a FP, convert to Int uint256 fracPow; // instead of calculating base ^ frac, we will calculate e ^ (frac*ln(base)) if (base < RONE) { /* since the base is smaller than 1.0, ln(base) < 0. Since 1 / (e^(frac*ln(1/base))) = e ^ (frac*ln(base)), we will calculate 1 / (e^(frac*ln(1/base))) instead. */ uint256 newExp = rmul(frac, ln(rdiv(RONE, base), RONE)); fracPow = rdiv(RONE, rpowe(newExp)); } else { /* base is greater than 1, calculate normally */ uint256 newExp = rmul(frac, ln(base, RONE)); fracPow = rpowe(newExp); } return rmul(wholePow, fracPow); } /** @notice return base^exp with base in FP form and exp in Int @dev this function use a technique called: exponentiating by squaring complexity O(log(q)) @dev function is from Kyber. @dev base is a FP, exp is an Int, return a FP */ function rpowi(uint256 base, uint256 exp) internal pure returns (uint256) { uint256 res = exp % 2 != 0 ? base : RONE; for (exp /= 2; exp != 0; exp /= 2) { base = rmul(base, base); if (exp % 2 != 0) { res = rmul(res, base); } } return res; } /** @dev y is an Int, returns an Int @dev babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) @dev from Uniswap */ function sqrt(uint256 y) internal pure returns (uint256 z) { if (y > 3) { z = y; uint256 x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } /** @notice divide 2 FP, return a FP @dev function is from Balancer. @dev x & y are FP, return a FP */ function rdiv(uint256 x, uint256 y) internal pure returns (uint256) { return (y / 2).add(x.mul(RONE)).div(y); } /** @notice multiply 2 FP, return a FP @dev function is from Balancer. @dev x & y are FP, return a FP */ function rmul(uint256 x, uint256 y) internal pure returns (uint256) { return (RONE / 2).add(x.mul(y)).div(RONE); } function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } function subMax0(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a - b : 0; } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; library TokenUtils { function requireERC20(address tokenAddr) internal view { require(IERC20(tokenAddr).totalSupply() > 0, "INVALID_ERC20"); } function requireERC20(IERC20 token) internal view { require(token.totalSupply() > 0, "INVALID_ERC20"); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../core/PendleGovernanceManager.sol"; import "../interfaces/IPermissionsV2.sol"; abstract contract PermissionsV2 is IPermissionsV2 { PendleGovernanceManager public immutable override governanceManager; address internal initializer; constructor(address _governanceManager) { require(_governanceManager != address(0), "ZERO_ADDRESS"); initializer = msg.sender; governanceManager = PendleGovernanceManager(_governanceManager); } modifier initialized() { require(initializer == address(0), "NOT_INITIALIZED"); _; } modifier onlyGovernance() { require(msg.sender == _governance(), "ONLY_GOVERNANCE"); _; } function _governance() internal view returns (address) { return governanceManager.governance(); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // 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. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { 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. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; contract PendleGovernanceManager { address public governance; address public pendingGovernance; event GovernanceClaimed(address newGovernance, address previousGovernance); event TransferGovernancePending(address pendingGovernance); constructor(address _governance) { require(_governance != address(0), "ZERO_ADDRESS"); governance = _governance; } modifier onlyGovernance() { require(msg.sender == governance, "ONLY_GOVERNANCE"); _; } /** * @dev Allows the pendingGovernance address to finalize the change governance process. */ function claimGovernance() external { require(pendingGovernance == msg.sender, "WRONG_GOVERNANCE"); emit GovernanceClaimed(pendingGovernance, governance); governance = pendingGovernance; pendingGovernance = address(0); } /** * @dev Allows the current governance to set the pendingGovernance address. * @param _governance The address to transfer ownership to. */ function transferGovernance(address _governance) external onlyGovernance { require(_governance != address(0), "ZERO_ADDRESS"); pendingGovernance = _governance; emit TransferGovernancePending(pendingGovernance); } }
// SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity 0.7.6; pragma abicoder v2; import "../core/PendleGovernanceManager.sol"; interface IPermissionsV2 { function governanceManager() external returns (PendleGovernanceManager); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_governanceManager","type":"address"},{"internalType":"address","name":"_pausingManager","type":"address"},{"internalType":"address","name":"_whitelist","type":"address"},{"internalType":"address","name":"_pendleTokenAddress","type":"address"},{"internalType":"address","name":"_stakeToken","type":"address"},{"internalType":"address","name":"_yieldToken","type":"address"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_epochDuration","type":"uint256"},{"internalType":"uint256","name":"_vestingEpochs","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"sendTo","type":"address"}],"name":"EtherWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"rewards","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"numberOfEpochs","type":"uint256"}],"name":"Funded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PendleRewardsSettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"epochIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"rewards","type":"uint256[]"}],"name":"RewardsToppedUp","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"sendTo","type":"address"}],"name":"TokenWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"dueInterests","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epochDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"rewards","type":"uint256[]"}],"name":"fund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"governanceManager","outputs":[{"internalType":"contract PendleGovernanceManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastEpochClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastNYield","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastParamL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastTimeUserStakeUpdated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberOfEpochs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paramL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pausingManager","outputs":[{"internalType":"contract IPendlePausingManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendleTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epochId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"readEpochData","outputs":[{"internalType":"uint256","name":"totalStakeUnits","type":"uint256"},{"internalType":"uint256","name":"totalRewards","type":"uint256"},{"internalType":"uint256","name":"lastUpdated","type":"uint256"},{"internalType":"uint256","name":"stakeUnitsForUser","type":"uint256"},{"internalType":"uint256","name":"availableRewardsForUser","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"redeemDueInterests","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"redeemRewards","outputs":[{"internalType":"uint256","name":"rewards","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"name":"setUpEmergencyMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"forAddr","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakeToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"epochIds","type":"uint256[]"},{"internalType":"uint256[]","name":"rewards","type":"uint256[]"}],"name":"topUpRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epochId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"updateAndReadEpochData","outputs":[{"internalType":"uint256","name":"totalStakeUnits","type":"uint256"},{"internalType":"uint256","name":"totalRewards","type":"uint256"},{"internalType":"uint256","name":"lastUpdated","type":"uint256"},{"internalType":"uint256","name":"stakeUnitsForUser","type":"uint256"},{"internalType":"uint256","name":"availableRewardsForUser","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vestingEpochs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelist","outputs":[{"internalType":"contract IPendleWhitelist","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"toAddr","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address payable","name":"sendTo","type":"address"}],"name":"withdrawEther","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"sendTo","type":"address"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yieldToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101a06040523480156200001257600080fd5b50604051620036fe380380620036fe83398181016040526101208110156200003957600080fd5b508051602082015160408301516060840151608085015160a086015160c087015160e088015161010090980151969795969495939492939192909190886001600160a01b038116620000c1576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015290519081900360640190fd5b60008054336001600160a01b031990911617905560601b6001600160601b0319166080526001805542831162000133576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f53544152545f54494d4560701b604482015290519081900360640190fd5b62000149866200020560201b62001e851760201c565b6200015f856200020560201b62001e851760201c565b60008111620001b5576040805162461bcd60e51b815260206004820152601660248201527f494e56414c49445f56455354494e475f45504f43485300000000000000000000604482015290519081900360640190fd5b6001600160601b0319606098891b811660c05296881b871660a05294871b861660e05292861b851661010052941b90921661012052610140929092526101605261018052506001600b55620002b5565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200024157600080fd5b505afa15801562000256573d6000803e3d6000fd5b505050506040513d60208110156200026d57600080fd5b505111620002b2576040805162461bcd60e51b815260206004820152600d60248201526c0494e56414c49445f455243323609c1b604482015290519081900360640190fd5b50565b60805160601c60a05160601c60c05160601c60e05160601c6101005160601c6101205160601c610140516101605161018051613316620003e8600039806113655280612096528061256f5280612a7052508061096852806128c65280612dab5280612e00525080610efb528061288e52806128eb5280612dd1525080610b6c5280610ed75280611b8f5280611bc9528061228f528061232552806123c252806124735280612b515280612ec35280612f1252508061098c5280611b6452806122515280612cd75280612d12525080610dff5280611041528061130652806113895280611b2e528061221452508061069c5280610a245280611158528061151d52806117e5528061198d5280611a475280611c6652508061132f5280611436525080611948528061218852506133166000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806383bbfde111610104578063a81e457c116100a2578063ce56c45411610071578063ce56c45414610598578063d2e6d1c3146105c4578063dd254a6a146105cc578063f3fef3a3146105fa576101da565b8063a81e457c14610530578063adc9772e14610538578063b40310c914610564578063be66c60f14610590576101da565b80639262187b116100de5780639262187b146104d457806393e59dc1146104fa57806396b973c0146105025780639a51d2d114610528576101da565b806383bbfde1146104545780638b0e9f3f146104c45780638f373bf3146104cc576101da565b80634ff0876a1161017c57806370b66cd01161014b57806370b66cd01461035c578063738573f41461041e57806376d5de851461044457806378e979251461044c576101da565b80634ff0876a1461030257806351ed6a301461030a578063541a7ca61461032e5780636304a6bc14610336576101da565b806317368841116101b8578063173688411461027657806327e235e31461027e5780632936ada7146102a45780633ccdbb28146102ca576101da565b806304f917af146101df578063059f8b16146102365780631667663214610250575b600080fd5b61020b600480360360408110156101f557600080fd5b50803590602001356001600160a01b0316610626565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b61023e61080d565b60408051918252519081900360200190f35b61023e6004803603602081101561026657600080fd5b50356001600160a01b031661081a565b61023e61082c565b61023e6004803603602081101561029457600080fd5b50356001600160a01b0316610832565b61023e600480360360208110156102ba57600080fd5b50356001600160a01b0316610844565b610300600480360360608110156102e057600080fd5b506001600160a01b03813581169160208101359160409091013516610856565b005b61023e610966565b61031261098a565b604080516001600160a01b039092168252519081900360200190f35b61023e6109ae565b61023e6004803603602081101561034c57600080fd5b50356001600160a01b03166109b4565b6103006004803603604081101561037257600080fd5b81019060208101813564010000000081111561038d57600080fd5b82018360208201111561039f57600080fd5b803590602001918460208302840111640100000000831117156103c157600080fd5b9193909290916020810190356401000000008111156103df57600080fd5b8201836020820111156103f157600080fd5b8035906020019184602083028401116401000000008311171561041357600080fd5b509092509050610c0d565b61023e6004803603602081101561043457600080fd5b50356001600160a01b0316610ec3565b610312610ed5565b61023e610ef9565b6103006004803603602081101561046a57600080fd5b81019060208101813564010000000081111561048557600080fd5b82018360208201111561049757600080fd5b803590602001918460208302840111640100000000831117156104b957600080fd5b509092509050610f1d565b61023e6110dc565b61023e6110e2565b61023e600480360360208110156104ea57600080fd5b50356001600160a01b03166110e8565b61031261132d565b61023e6004803603602081101561051857600080fd5b50356001600160a01b0316611351565b61023e611363565b610312611387565b6103006004803603604081101561054e57600080fd5b506001600160a01b0381351690602001356113ab565b61020b6004803603604081101561057a57600080fd5b50803590602001356001600160a01b031661179d565b6103126117e3565b610300600480360360408110156105ae57600080fd5b50803590602001356001600160a01b0316611807565b610312611946565b610300600480360360408110156105e257600080fd5b506001600160a01b038135169060200135151561196a565b6103006004803603604081101561061057600080fd5b506001600160a01b038135169060200135611bf8565b600080600080600060026001541415610674576040805162461bcd60e51b815260206004820152601f602482015260008051602061321a833981519152604482015290519081900360640190fd5b600260015560408051636f11e6c160e01b815230600482015281516000926001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692636f11e6c1926024808301939282900301818787803b1580156106df57600080fd5b505af11580156106f3573d6000803e3d6000fd5b505050506040513d604081101561070957600080fd5b505190508015610754576040805162461bcd60e51b815260206004820152601160248201527013125457d35253925391d7d4105554d151607a1b604482015290519081900360640190fd5b600060025411610798576040805162461bcd60e51b815260206004820152600a6024820152691393d517d1955391115160b21b604482015290519081900360640190fd5b60006107a2611f31565b116107e2576040805162461bcd60e51b815260206004820152600b60248201526a1393d517d4d5105495115160aa1b604482015290519081900360640190fd5b6107eb87611f41565b6107f5888861179d565b60018055939c929b5090995097509095509350505050565b68056bc75e2d6310000081565b60096020526000908152604090205481565b60025481565b60056020526000908152604090205481565b60076020526000908152604090205481565b61085e612184565b6001600160a01b0316336001600160a01b0316146108b5576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6108be83612210565b610903576040805162461bcd60e51b81526020600482015260116024820152701513d2d15397d393d517d0531313d5d151607a1b604482015290519081900360640190fd5b6109176001600160a01b03841682846122ca565b604080516001600160a01b0380861682526020820185905283168183015290517f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e69181900360600190a1505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b600b5481565b6000600260015414156109fc576040805162461bcd60e51b815260206004820152601f602482015260008051602061321a833981519152604482015290519081900360640190fd5b600260015560408051636f11e6c160e01b815230600482015281516000926001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692636f11e6c1926024808301939282900301818787803b158015610a6757600080fd5b505af1158015610a7b573d6000803e3d6000fd5b505050506040513d6040811015610a9157600080fd5b505190508015610adc576040805162461bcd60e51b815260206004820152601160248201527013125457d35253925391d7d4105554d151607a1b604482015290519081900360640190fd5b600060025411610b20576040805162461bcd60e51b815260206004820152600a6024820152691393d517d1955391115160b21b604482015290519081900360640190fd5b6000610b2a611f31565b11610b6a576040805162461bcd60e51b815260206004820152600b60248201526a1393d517d4d5105495115160aa1b604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610ba15760009150610c03565b6001600160a01b038316610beb576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015290519081900360640190fd5b610bf483612321565b9150610c0083836123ba565b91505b5060018055919050565b610c15612184565b6001600160a01b0316336001600160a01b031614610c6c576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b828114610cb1576040805162461bcd60e51b815260206004820152600e60248201526d494e56414c49445f41525241595360901b604482015290519081900360640190fd5b6000610cbb611f31565b6002549091506000805b86811015610df157878782818110610cd957fe5b9050602002013584108015610d00575082888883818110610cf657fe5b9050602002013511155b610d44576040805162461bcd60e51b815260206004820152601060248201526f1253959053125117d15413d0d217d25160821b604482015290519081900360640190fd5b610d69868683818110610d5357fe5b905060200201358361249a90919063ffffffff16565b9150610db8868683818110610d7a57fe5b90506020020135600460008b8b86818110610d9157fe5b9050602002013581526020019081526020016000206001015461249a90919063ffffffff16565b600460008a8a85818110610dc857fe5b905060200201358152602001908152602001600020600101819055508080600101915050610cc5565b50610e276001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330846124fb565b7f44ee104780547f0cb2026486d8f9456b9f11497ce52f217ddac1ba7a5a951696878787876040518080602001806020018381038352878782818152602001925060200280828437600083820152601f01601f19169091018481038352858152602090810191508690860280828437600083820152604051601f909101601f19169092018290039850909650505050505050a150505050505050565b60066020526000908152604090205481565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b610f25612184565b6001600160a01b0316336001600160a01b031614610f7c576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b600254610f87611f31565b1115610fcc576040805162461bcd60e51b815260206004820152600f60248201526e2620a9aa2fa2a827a1a42fa7ab22a960891b604482015290519081900360640190fd5b806000805b8281101561102357610fe8858583818110610d5357fe5b9150848482818110610ff657fe5b60025460019085018101600090815260046020908152604090912092029390930135908301555001610fd1565b50600254611031908361249a565b6002556110696001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330846124fb565b7ff05c668e041316911f2707c63743bfaf789a193675ffe04e46d93dbc448e642e848460025460405180806020018381526020018281038252858582818152602001925060200280828437600083820152604051601f909101601f1916909201829003965090945050505050a150505050565b60035481565b600a5481565b600060026001541415611130576040805162461bcd60e51b815260206004820152601f602482015260008051602061321a833981519152604482015290519081900360640190fd5b600260015560408051636f11e6c160e01b815230600482015281516000926001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692636f11e6c1926024808301939282900301818787803b15801561119b57600080fd5b505af11580156111af573d6000803e3d6000fd5b505050506040513d60408110156111c557600080fd5b505190508015611210576040805162461bcd60e51b815260206004820152601160248201527013125457d35253925391d7d4105554d151607a1b604482015290519081900360640190fd5b600060025411611254576040805162461bcd60e51b815260206004820152600a6024820152691393d517d1955391115160b21b604482015290519081900360640190fd5b600061125e611f31565b1161129e576040805162461bcd60e51b815260206004820152600b60248201526a1393d517d4d5105495115160aa1b604482015290519081900360640190fd5b6001600160a01b0383166112e8576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015290519081900360640190fd5b6112f183612555565b91508115610c0357610c036001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001684846122ca565b7f000000000000000000000000000000000000000000000000000000000000000081565b60086020526000908152604090205481565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b600260015414156113f1576040805162461bcd60e51b815260206004820152601f602482015260008051602061321a833981519152604482015290519081900360640190fd5b60026001556000611401336126a1565b15801561140d57503233145b905080806114a9575060408051636c9b2a3f60e11b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163d936547e916024808301926020929190829003018186803b15801561147c57600080fd5b505afa158015611490573d6000803e3d6000fd5b505050506040513d60208110156114a657600080fd5b50515b6114fa576040805162461bcd60e51b815260206004820152601860248201527f434f4e54524143545f4e4f545f57484954454c49535445440000000000000000604482015290519081900360640190fd5b60408051636f11e6c160e01b815230600482015281516000926001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692636f11e6c1926024808301939282900301818787803b15801561156057600080fd5b505af1158015611574573d6000803e3d6000fd5b505050506040513d604081101561158a57600080fd5b5051905080156115d5576040805162461bcd60e51b815260206004820152601160248201527013125457d35253925391d7d4105554d151607a1b604482015290519081900360640190fd5b600060025411611619576040805162461bcd60e51b815260206004820152600a6024820152691393d517d1955391115160b21b604482015290519081900360640190fd5b6000611623611f31565b11611663576040805162461bcd60e51b815260206004820152600b60248201526a1393d517d4d5105495115160aa1b604482015290519081900360640190fd5b6001600160a01b0384166116ad576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015290519081900360640190fd5b826116ed576040805162461bcd60e51b815260206004820152600b60248201526a16915493d7d05353d5539560aa1b604482015290519081900360640190fd5b6002546116f8611f31565b1115611744576040805162461bcd60e51b815260206004820152601660248201527524a721a2a72a24ab22a9afa822a924a7a22fa7ab22a960511b604482015290519081900360640190fd5b61174f8433856126a7565b604080516001600160a01b03861681526020810185905281517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d929181900390910190a15050600180555050565b60009182526004602081815260408085208054600182015460028301546001600160a01b0397909716885260038301855283882054929095019093529420549094919391565b7f000000000000000000000000000000000000000000000000000000000000000081565b61180f612184565b6001600160a01b0316336001600160a01b031614611866576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6040516000906001600160a01b0383169084908381818185875af1925050503d80600081146118b1576040519150601f19603f3d011682016040523d82523d6000602084013e6118b6565b606091505b50509050806118fe576040805162461bcd60e51b815260206004820152600f60248201526e15d2551211149055d7d19052531151608a1b604482015290519081900360640190fd5b604080518481526001600160a01b038416602082015281517fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de929181900390910190a1505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60408051636f11e6c160e01b815230600482015281516000926001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692636f11e6c1926024808301939282900301818787803b1580156119d057600080fd5b505af11580156119e4573d6000803e3d6000fd5b505050506040513d60408110156119fa57600080fd5b5060200151905080611a43576040805162461bcd60e51b815260206004820152600d60248201526c4e4f545f454d455247454e435960981b604482015290519081900360640190fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663f87c24cd6040518163ffffffff1660e01b815260040160606040518083038186803b158015611a9e57600080fd5b505afa158015611ab2573d6000803e3d6000fd5b505050506040513d6060811015611ac857600080fd5b50519050336001600160a01b03821614611b21576040805162461bcd60e51b81526020600482015260156024820152742727aa2fa2a6a2a923a2a721acafa420a7222622a960591b604482015290519081900360640190fd5b611b576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168560001961270f565b611b8d6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168560001961270f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615611bf257611bf26001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168560001961270f565b50505050565b60026001541415611c3e576040805162461bcd60e51b815260206004820152601f602482015260008051602061321a833981519152604482015290519081900360640190fd5b600260015560408051636f11e6c160e01b815230600482015281516000926001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692636f11e6c1926024808301939282900301818787803b158015611ca957600080fd5b505af1158015611cbd573d6000803e3d6000fd5b505050506040513d6040811015611cd357600080fd5b505190508015611d1e576040805162461bcd60e51b815260206004820152601160248201527013125457d35253925391d7d4105554d151607a1b604482015290519081900360640190fd5b600060025411611d62576040805162461bcd60e51b815260206004820152600a6024820152691393d517d1955391115160b21b604482015290519081900360640190fd5b6000611d6c611f31565b11611dac576040805162461bcd60e51b815260206004820152600b60248201526a1393d517d4d5105495115160aa1b604482015290519081900360640190fd5b81611dec576040805162461bcd60e51b815260206004820152600b60248201526a16915493d7d05353d5539560aa1b604482015290519081900360640190fd5b6001600160a01b038316611e36576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015290519081900360640190fd5b611e41338484612822565b604080513381526020810184905281517f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5929181900390910190a150506001805550565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015611ec057600080fd5b505afa158015611ed4573d6000803e3d6000fd5b505050506040513d6020811015611eea57600080fd5b505111611f2e576040805162461bcd60e51b815260206004820152600d60248201526c0494e56414c49445f455243323609c1b604482015290519081900360640190fd5b50565b6000611f3c4261288a565b905090565b611f4961291b565b6001600160a01b038116600090815260066020526040902054611f86576001600160a01b0381166000908152600660205260409020429055611f2e565b6000611f90611f31565b90506000611fa0600254836129cc565b6002546001600160a01b038516600090815260056020908152604080832054600690925282205460035494955092861193909291611fdd8361288a565b9050805b86811161215e5760008181526004602052604090205461200a57826120055761215e565b612156565b6120446120188686846129e2565b60008381526004602090815260408083206001600160a01b038f1684526003019091529020549061249a565b60008281526004602090815260408083206001600160a01b038e1684526003019091529020558681148015612077575085155b156120815761215e565b600061208d8a83612a34565b9050600182015b7f00000000000000000000000000000000000000000000000000000000000000008301811161215357612109826004600084815260200190815260200160002060040160008e6001600160a01b03166001600160a01b031681526020019081526020016000205461249a90919063ffffffff16565b6004600083815260200190815260200160002060040160008d6001600160a01b03166001600160a01b03168152602001908152602001600020819055508080600101915050612094565b50505b600101611fe1565b5050506001600160a01b0386166000908152600660205260409020429055505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635aa6e6756040518163ffffffff1660e01b815260040160206040518083038186803b1580156121df57600080fd5b505afa1580156121f3573d6000803e3d6000fd5b505050506040513d602081101561220957600080fd5b5051905090565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415801561228657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b80156122c457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b92915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261231c908490612a9e565b505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316612359575060006123b5565b61236282612b4f565b6001600160a01b038216600090815260086020526040902054600a5461238891906129cc565b6001600160a01b038316600090815260086020526040812055600a549091506123b19082612c6d565b600a555b919050565b600061245e827f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561242d57600080fd5b505afa158015612441573d6000803e3d6000fd5b505050506040513d602081101561245757600080fd5b50516129cc565b905080156122c4576122c46001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001684836122ca565b6000828201838110156124f4576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611bf2908590612a9e565b600061256082611f41565b600061259761256d611f31565b7f0000000000000000000000000000000000000000000000000000000000000000600254016129cc565b6001600160a01b0384166000908152600760205260409020549091505b8181116126455760008181526004602081815260408084206001600160a01b038916855290920190529020541561263d5760008181526004602081815260408084206001600160a01b0389168552909201905290205461261590849061249a565b60008281526004602081815260408084206001600160a01b038a168552909201905281205592505b6001016125b4565b506001600160a01b0383166000818152600760209081526040918290208490558151928352820184905280517f5891c6cf1c6ad6a35a9ba7097b8c5f9a780d2d6783bb7f9f41ac4ecbdcf4a1269281900390910190a150919050565b3b151590565b6126b083611f41565b6126b983612b4f565b6001600160a01b0383166000908152600560205260409020546126dc908261249a565b6001600160a01b038416600090815260056020526040902055600354612702908261249a565b60035561231c8282612cca565b801580612795575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561276757600080fd5b505afa15801561277b573d6000803e3d6000fd5b505050506040513d602081101561279157600080fd5b5051155b6127d05760405162461bcd60e51b81526004018080602001828103825260368152602001806132ab6036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905261231c908490612a9e565b61282b83611f41565b61283483612b4f565b6001600160a01b0383166000908152600560205260409020546128579082612c6d565b6001600160a01b03841660009081526005602052604090205560035461287d9082612c6d565b60035561231c8282612cff565b60007f00000000000000000000000000000000000000000000000000000000000000008210156128bc575060006123b5565b6122c460016129157f000000000000000000000000000000000000000000000000000000000000000061290f867f0000000000000000000000000000000000000000000000000000000000000000612c6d565b90612d39565b9061249a565b6000612925611f31565b90506000612935826002546129cc565b90505b80156129c857600061294982612da0565b6000838152600460205260409020600201549091508082141561296d5750506129c8565b61299261297d60035483866129e2565b6000858152600460205260409020549061249a565b6000848152600460205260409020556129ab42836129cc565b600084815260046020526040902060020155505060001901612938565b5050565b60008183106129db57816124f4565b5090919050565b600042816129f8856129f386612df6565b612e30565b90506000612a0e83612a0987612da0565b6129cc565b90506000612a1c8284612e40565b9050612a288882612e51565b98975050505050505050565b600081815260046020818152604080842080546001600160a01b038816865260038201845291852054868652939092526001909101546124f4927f00000000000000000000000000000000000000000000000000000000000000009261290f929091839190612e51565b6000612af3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612eaa9092919063ffffffff16565b80519091501561231c57808060200190516020811015612b1257600080fd5b505161231c5760405162461bcd60e51b815260040180806020018281038252602a815260200180613281602a913960400191505060405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316612b8257611f2e565b612b8a612ec1565b6001600160a01b038116600090815260096020526040902054612bc857600b546001600160a01b038216600090815260096020526040902055611f2e565b6001600160a01b0381166000908152600560209081526040808320546009909252822054600b54919291612bfb91612c6d565b90506000612c1668056bc75e2d6310000061290f8585612e51565b6001600160a01b038516600090815260086020526040902054909150612c3c908261249a565b6001600160a01b038516600090815260086020908152604080832093909355600b5460099091529190205550505050565b600082821115612cc4576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6129c86001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168330846124fb565b80156129c8576129c86001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683836122ca565b6000808211612d8f576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381612d9857fe5b049392505050565b60006122c4612dcf837f0000000000000000000000000000000000000000000000000000000000000000612e51565b7f00000000000000000000000000000000000000000000000000000000000000009061249a565b60006122c4612dcf7f0000000000000000000000000000000000000000000000000000000000000000612e2a856001612c6d565b90612e51565b6000818310156129db57816124f4565b600081831015612cc45760006124f4565b600082612e60575060006122c4565b82820282848281612e6d57fe5b04146124f45760405162461bcd60e51b81526004018080602001828103825260218152602001806132606021913960400191505060405180910390fd5b6060612eb98484600085612ffa565b949350505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161580612efc5750612efa613155565b155b15612f0657612ff8565b612f0e612ff8565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015612f7d57600080fd5b505afa158015612f91573d6000803e3d6000fd5b505050506040513d6020811015612fa757600080fd5b50519050600080612fb78361315a565b915091506000600354600014612fe457600354612fe19061290f8468056bc75e2d63100000612e51565b90505b612fee838261249a565b600b55505050600a555b565b60608247101561303b5760405162461bcd60e51b815260040180806020018281038252602681526020018061323a6026913960400191505060405180910390fd5b613044856126a1565b613095576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106130d35780518252601f1990920191602091820191016130b4565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613135576040519150601f19603f3d011682016040523d82523d6000602084013e61313a565b606091505b509150915061314a828286613175565b979650505050505050565b600090565b600b54600a5460009061316e908490612c6d565b9050915091565b606083156131845750816124f4565b8251156131945782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156131de5781810151838201526020016131c6565b50505050905090810190601f16801561320b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe5265656e7472616e637947756172643a207265656e7472616e742063616c6c00416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220b7ff65a99d00b88fbf8cbdd49f747e0267d52a015c1d714233eda623823744e664736f6c634300070600330000000000000000000000005a05a64115bd86f220a26461fde3a011c71424760000000000000000000000004dc6b6374e812e029937129a156eec6344cde8d10000000000000000000000006fa13469428e85e6ac12c84b73a19aef7c53332a000000000000000000000000808507121b80c02388fad14726482e061b8da8270000000000000000000000002c80d72af9ab0bb9d98f607c817c6f512dd647e60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006126d9800000000000000000000000000000000000000000000000000000000000093a800000000000000000000000000000000000000000000000000000000000000005
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806383bbfde111610104578063a81e457c116100a2578063ce56c45411610071578063ce56c45414610598578063d2e6d1c3146105c4578063dd254a6a146105cc578063f3fef3a3146105fa576101da565b8063a81e457c14610530578063adc9772e14610538578063b40310c914610564578063be66c60f14610590576101da565b80639262187b116100de5780639262187b146104d457806393e59dc1146104fa57806396b973c0146105025780639a51d2d114610528576101da565b806383bbfde1146104545780638b0e9f3f146104c45780638f373bf3146104cc576101da565b80634ff0876a1161017c57806370b66cd01161014b57806370b66cd01461035c578063738573f41461041e57806376d5de851461044457806378e979251461044c576101da565b80634ff0876a1461030257806351ed6a301461030a578063541a7ca61461032e5780636304a6bc14610336576101da565b806317368841116101b8578063173688411461027657806327e235e31461027e5780632936ada7146102a45780633ccdbb28146102ca576101da565b806304f917af146101df578063059f8b16146102365780631667663214610250575b600080fd5b61020b600480360360408110156101f557600080fd5b50803590602001356001600160a01b0316610626565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b61023e61080d565b60408051918252519081900360200190f35b61023e6004803603602081101561026657600080fd5b50356001600160a01b031661081a565b61023e61082c565b61023e6004803603602081101561029457600080fd5b50356001600160a01b0316610832565b61023e600480360360208110156102ba57600080fd5b50356001600160a01b0316610844565b610300600480360360608110156102e057600080fd5b506001600160a01b03813581169160208101359160409091013516610856565b005b61023e610966565b61031261098a565b604080516001600160a01b039092168252519081900360200190f35b61023e6109ae565b61023e6004803603602081101561034c57600080fd5b50356001600160a01b03166109b4565b6103006004803603604081101561037257600080fd5b81019060208101813564010000000081111561038d57600080fd5b82018360208201111561039f57600080fd5b803590602001918460208302840111640100000000831117156103c157600080fd5b9193909290916020810190356401000000008111156103df57600080fd5b8201836020820111156103f157600080fd5b8035906020019184602083028401116401000000008311171561041357600080fd5b509092509050610c0d565b61023e6004803603602081101561043457600080fd5b50356001600160a01b0316610ec3565b610312610ed5565b61023e610ef9565b6103006004803603602081101561046a57600080fd5b81019060208101813564010000000081111561048557600080fd5b82018360208201111561049757600080fd5b803590602001918460208302840111640100000000831117156104b957600080fd5b509092509050610f1d565b61023e6110dc565b61023e6110e2565b61023e600480360360208110156104ea57600080fd5b50356001600160a01b03166110e8565b61031261132d565b61023e6004803603602081101561051857600080fd5b50356001600160a01b0316611351565b61023e611363565b610312611387565b6103006004803603604081101561054e57600080fd5b506001600160a01b0381351690602001356113ab565b61020b6004803603604081101561057a57600080fd5b50803590602001356001600160a01b031661179d565b6103126117e3565b610300600480360360408110156105ae57600080fd5b50803590602001356001600160a01b0316611807565b610312611946565b610300600480360360408110156105e257600080fd5b506001600160a01b038135169060200135151561196a565b6103006004803603604081101561061057600080fd5b506001600160a01b038135169060200135611bf8565b600080600080600060026001541415610674576040805162461bcd60e51b815260206004820152601f602482015260008051602061321a833981519152604482015290519081900360640190fd5b600260015560408051636f11e6c160e01b815230600482015281516000926001600160a01b037f0000000000000000000000004dc6b6374e812e029937129a156eec6344cde8d11692636f11e6c1926024808301939282900301818787803b1580156106df57600080fd5b505af11580156106f3573d6000803e3d6000fd5b505050506040513d604081101561070957600080fd5b505190508015610754576040805162461bcd60e51b815260206004820152601160248201527013125457d35253925391d7d4105554d151607a1b604482015290519081900360640190fd5b600060025411610798576040805162461bcd60e51b815260206004820152600a6024820152691393d517d1955391115160b21b604482015290519081900360640190fd5b60006107a2611f31565b116107e2576040805162461bcd60e51b815260206004820152600b60248201526a1393d517d4d5105495115160aa1b604482015290519081900360640190fd5b6107eb87611f41565b6107f5888861179d565b60018055939c929b5090995097509095509350505050565b68056bc75e2d6310000081565b60096020526000908152604090205481565b60025481565b60056020526000908152604090205481565b60076020526000908152604090205481565b61085e612184565b6001600160a01b0316336001600160a01b0316146108b5576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6108be83612210565b610903576040805162461bcd60e51b81526020600482015260116024820152701513d2d15397d393d517d0531313d5d151607a1b604482015290519081900360640190fd5b6109176001600160a01b03841682846122ca565b604080516001600160a01b0380861682526020820185905283168183015290517f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e69181900360600190a1505050565b7f0000000000000000000000000000000000000000000000000000000000093a8081565b7f0000000000000000000000002c80d72af9ab0bb9d98f607c817c6f512dd647e681565b600b5481565b6000600260015414156109fc576040805162461bcd60e51b815260206004820152601f602482015260008051602061321a833981519152604482015290519081900360640190fd5b600260015560408051636f11e6c160e01b815230600482015281516000926001600160a01b037f0000000000000000000000004dc6b6374e812e029937129a156eec6344cde8d11692636f11e6c1926024808301939282900301818787803b158015610a6757600080fd5b505af1158015610a7b573d6000803e3d6000fd5b505050506040513d6040811015610a9157600080fd5b505190508015610adc576040805162461bcd60e51b815260206004820152601160248201527013125457d35253925391d7d4105554d151607a1b604482015290519081900360640190fd5b600060025411610b20576040805162461bcd60e51b815260206004820152600a6024820152691393d517d1955391115160b21b604482015290519081900360640190fd5b6000610b2a611f31565b11610b6a576040805162461bcd60e51b815260206004820152600b60248201526a1393d517d4d5105495115160aa1b604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610ba15760009150610c03565b6001600160a01b038316610beb576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015290519081900360640190fd5b610bf483612321565b9150610c0083836123ba565b91505b5060018055919050565b610c15612184565b6001600160a01b0316336001600160a01b031614610c6c576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b828114610cb1576040805162461bcd60e51b815260206004820152600e60248201526d494e56414c49445f41525241595360901b604482015290519081900360640190fd5b6000610cbb611f31565b6002549091506000805b86811015610df157878782818110610cd957fe5b9050602002013584108015610d00575082888883818110610cf657fe5b9050602002013511155b610d44576040805162461bcd60e51b815260206004820152601060248201526f1253959053125117d15413d0d217d25160821b604482015290519081900360640190fd5b610d69868683818110610d5357fe5b905060200201358361249a90919063ffffffff16565b9150610db8868683818110610d7a57fe5b90506020020135600460008b8b86818110610d9157fe5b9050602002013581526020019081526020016000206001015461249a90919063ffffffff16565b600460008a8a85818110610dc857fe5b905060200201358152602001908152602001600020600101819055508080600101915050610cc5565b50610e276001600160a01b037f000000000000000000000000808507121b80c02388fad14726482e061b8da827163330846124fb565b7f44ee104780547f0cb2026486d8f9456b9f11497ce52f217ddac1ba7a5a951696878787876040518080602001806020018381038352878782818152602001925060200280828437600083820152601f01601f19169091018481038352858152602090810191508690860280828437600083820152604051601f909101601f19169092018290039850909650505050505050a150505050505050565b60066020526000908152604090205481565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000006126d98081565b610f25612184565b6001600160a01b0316336001600160a01b031614610f7c576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b600254610f87611f31565b1115610fcc576040805162461bcd60e51b815260206004820152600f60248201526e2620a9aa2fa2a827a1a42fa7ab22a960891b604482015290519081900360640190fd5b806000805b8281101561102357610fe8858583818110610d5357fe5b9150848482818110610ff657fe5b60025460019085018101600090815260046020908152604090912092029390930135908301555001610fd1565b50600254611031908361249a565b6002556110696001600160a01b037f000000000000000000000000808507121b80c02388fad14726482e061b8da827163330846124fb565b7ff05c668e041316911f2707c63743bfaf789a193675ffe04e46d93dbc448e642e848460025460405180806020018381526020018281038252858582818152602001925060200280828437600083820152604051601f909101601f1916909201829003965090945050505050a150505050565b60035481565b600a5481565b600060026001541415611130576040805162461bcd60e51b815260206004820152601f602482015260008051602061321a833981519152604482015290519081900360640190fd5b600260015560408051636f11e6c160e01b815230600482015281516000926001600160a01b037f0000000000000000000000004dc6b6374e812e029937129a156eec6344cde8d11692636f11e6c1926024808301939282900301818787803b15801561119b57600080fd5b505af11580156111af573d6000803e3d6000fd5b505050506040513d60408110156111c557600080fd5b505190508015611210576040805162461bcd60e51b815260206004820152601160248201527013125457d35253925391d7d4105554d151607a1b604482015290519081900360640190fd5b600060025411611254576040805162461bcd60e51b815260206004820152600a6024820152691393d517d1955391115160b21b604482015290519081900360640190fd5b600061125e611f31565b1161129e576040805162461bcd60e51b815260206004820152600b60248201526a1393d517d4d5105495115160aa1b604482015290519081900360640190fd5b6001600160a01b0383166112e8576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015290519081900360640190fd5b6112f183612555565b91508115610c0357610c036001600160a01b037f000000000000000000000000808507121b80c02388fad14726482e061b8da8271684846122ca565b7f0000000000000000000000006fa13469428e85e6ac12c84b73a19aef7c53332a81565b60086020526000908152604090205481565b7f000000000000000000000000000000000000000000000000000000000000000581565b7f000000000000000000000000808507121b80c02388fad14726482e061b8da82781565b600260015414156113f1576040805162461bcd60e51b815260206004820152601f602482015260008051602061321a833981519152604482015290519081900360640190fd5b60026001556000611401336126a1565b15801561140d57503233145b905080806114a9575060408051636c9b2a3f60e11b815233600482015290516001600160a01b037f0000000000000000000000006fa13469428e85e6ac12c84b73a19aef7c53332a169163d936547e916024808301926020929190829003018186803b15801561147c57600080fd5b505afa158015611490573d6000803e3d6000fd5b505050506040513d60208110156114a657600080fd5b50515b6114fa576040805162461bcd60e51b815260206004820152601860248201527f434f4e54524143545f4e4f545f57484954454c49535445440000000000000000604482015290519081900360640190fd5b60408051636f11e6c160e01b815230600482015281516000926001600160a01b037f0000000000000000000000004dc6b6374e812e029937129a156eec6344cde8d11692636f11e6c1926024808301939282900301818787803b15801561156057600080fd5b505af1158015611574573d6000803e3d6000fd5b505050506040513d604081101561158a57600080fd5b5051905080156115d5576040805162461bcd60e51b815260206004820152601160248201527013125457d35253925391d7d4105554d151607a1b604482015290519081900360640190fd5b600060025411611619576040805162461bcd60e51b815260206004820152600a6024820152691393d517d1955391115160b21b604482015290519081900360640190fd5b6000611623611f31565b11611663576040805162461bcd60e51b815260206004820152600b60248201526a1393d517d4d5105495115160aa1b604482015290519081900360640190fd5b6001600160a01b0384166116ad576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015290519081900360640190fd5b826116ed576040805162461bcd60e51b815260206004820152600b60248201526a16915493d7d05353d5539560aa1b604482015290519081900360640190fd5b6002546116f8611f31565b1115611744576040805162461bcd60e51b815260206004820152601660248201527524a721a2a72a24ab22a9afa822a924a7a22fa7ab22a960511b604482015290519081900360640190fd5b61174f8433856126a7565b604080516001600160a01b03861681526020810185905281517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d929181900390910190a15050600180555050565b60009182526004602081815260408085208054600182015460028301546001600160a01b0397909716885260038301855283882054929095019093529420549094919391565b7f0000000000000000000000004dc6b6374e812e029937129a156eec6344cde8d181565b61180f612184565b6001600160a01b0316336001600160a01b031614611866576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6040516000906001600160a01b0383169084908381818185875af1925050503d80600081146118b1576040519150601f19603f3d011682016040523d82523d6000602084013e6118b6565b606091505b50509050806118fe576040805162461bcd60e51b815260206004820152600f60248201526e15d2551211149055d7d19052531151608a1b604482015290519081900360640190fd5b604080518481526001600160a01b038416602082015281517fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de929181900390910190a1505050565b7f0000000000000000000000005a05a64115bd86f220a26461fde3a011c714247681565b60408051636f11e6c160e01b815230600482015281516000926001600160a01b037f0000000000000000000000004dc6b6374e812e029937129a156eec6344cde8d11692636f11e6c1926024808301939282900301818787803b1580156119d057600080fd5b505af11580156119e4573d6000803e3d6000fd5b505050506040513d60408110156119fa57600080fd5b5060200151905080611a43576040805162461bcd60e51b815260206004820152600d60248201526c4e4f545f454d455247454e435960981b604482015290519081900360640190fd5b60007f0000000000000000000000004dc6b6374e812e029937129a156eec6344cde8d16001600160a01b031663f87c24cd6040518163ffffffff1660e01b815260040160606040518083038186803b158015611a9e57600080fd5b505afa158015611ab2573d6000803e3d6000fd5b505050506040513d6060811015611ac857600080fd5b50519050336001600160a01b03821614611b21576040805162461bcd60e51b81526020600482015260156024820152742727aa2fa2a6a2a923a2a721acafa420a7222622a960591b604482015290519081900360640190fd5b611b576001600160a01b037f000000000000000000000000808507121b80c02388fad14726482e061b8da827168560001961270f565b611b8d6001600160a01b037f0000000000000000000000002c80d72af9ab0bb9d98f607c817c6f512dd647e6168560001961270f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615611bf257611bf26001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168560001961270f565b50505050565b60026001541415611c3e576040805162461bcd60e51b815260206004820152601f602482015260008051602061321a833981519152604482015290519081900360640190fd5b600260015560408051636f11e6c160e01b815230600482015281516000926001600160a01b037f0000000000000000000000004dc6b6374e812e029937129a156eec6344cde8d11692636f11e6c1926024808301939282900301818787803b158015611ca957600080fd5b505af1158015611cbd573d6000803e3d6000fd5b505050506040513d6040811015611cd357600080fd5b505190508015611d1e576040805162461bcd60e51b815260206004820152601160248201527013125457d35253925391d7d4105554d151607a1b604482015290519081900360640190fd5b600060025411611d62576040805162461bcd60e51b815260206004820152600a6024820152691393d517d1955391115160b21b604482015290519081900360640190fd5b6000611d6c611f31565b11611dac576040805162461bcd60e51b815260206004820152600b60248201526a1393d517d4d5105495115160aa1b604482015290519081900360640190fd5b81611dec576040805162461bcd60e51b815260206004820152600b60248201526a16915493d7d05353d5539560aa1b604482015290519081900360640190fd5b6001600160a01b038316611e36576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015290519081900360640190fd5b611e41338484612822565b604080513381526020810184905281517f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5929181900390910190a150506001805550565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015611ec057600080fd5b505afa158015611ed4573d6000803e3d6000fd5b505050506040513d6020811015611eea57600080fd5b505111611f2e576040805162461bcd60e51b815260206004820152600d60248201526c0494e56414c49445f455243323609c1b604482015290519081900360640190fd5b50565b6000611f3c4261288a565b905090565b611f4961291b565b6001600160a01b038116600090815260066020526040902054611f86576001600160a01b0381166000908152600660205260409020429055611f2e565b6000611f90611f31565b90506000611fa0600254836129cc565b6002546001600160a01b038516600090815260056020908152604080832054600690925282205460035494955092861193909291611fdd8361288a565b9050805b86811161215e5760008181526004602052604090205461200a57826120055761215e565b612156565b6120446120188686846129e2565b60008381526004602090815260408083206001600160a01b038f1684526003019091529020549061249a565b60008281526004602090815260408083206001600160a01b038e1684526003019091529020558681148015612077575085155b156120815761215e565b600061208d8a83612a34565b9050600182015b7f00000000000000000000000000000000000000000000000000000000000000058301811161215357612109826004600084815260200190815260200160002060040160008e6001600160a01b03166001600160a01b031681526020019081526020016000205461249a90919063ffffffff16565b6004600083815260200190815260200160002060040160008d6001600160a01b03166001600160a01b03168152602001908152602001600020819055508080600101915050612094565b50505b600101611fe1565b5050506001600160a01b0386166000908152600660205260409020429055505050505050565b60007f0000000000000000000000005a05a64115bd86f220a26461fde3a011c71424766001600160a01b0316635aa6e6756040518163ffffffff1660e01b815260040160206040518083038186803b1580156121df57600080fd5b505afa1580156121f3573d6000803e3d6000fd5b505050506040513d602081101561220957600080fd5b5051905090565b60007f000000000000000000000000808507121b80c02388fad14726482e061b8da8276001600160a01b0316826001600160a01b03161415801561228657507f0000000000000000000000002c80d72af9ab0bb9d98f607c817c6f512dd647e66001600160a01b0316826001600160a01b031614155b80156122c457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b92915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261231c908490612a9e565b505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316612359575060006123b5565b61236282612b4f565b6001600160a01b038216600090815260086020526040902054600a5461238891906129cc565b6001600160a01b038316600090815260086020526040812055600a549091506123b19082612c6d565b600a555b919050565b600061245e827f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561242d57600080fd5b505afa158015612441573d6000803e3d6000fd5b505050506040513d602081101561245757600080fd5b50516129cc565b905080156122c4576122c46001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001684836122ca565b6000828201838110156124f4576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611bf2908590612a9e565b600061256082611f41565b600061259761256d611f31565b7f0000000000000000000000000000000000000000000000000000000000000005600254016129cc565b6001600160a01b0384166000908152600760205260409020549091505b8181116126455760008181526004602081815260408084206001600160a01b038916855290920190529020541561263d5760008181526004602081815260408084206001600160a01b0389168552909201905290205461261590849061249a565b60008281526004602081815260408084206001600160a01b038a168552909201905281205592505b6001016125b4565b506001600160a01b0383166000818152600760209081526040918290208490558151928352820184905280517f5891c6cf1c6ad6a35a9ba7097b8c5f9a780d2d6783bb7f9f41ac4ecbdcf4a1269281900390910190a150919050565b3b151590565b6126b083611f41565b6126b983612b4f565b6001600160a01b0383166000908152600560205260409020546126dc908261249a565b6001600160a01b038416600090815260056020526040902055600354612702908261249a565b60035561231c8282612cca565b801580612795575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561276757600080fd5b505afa15801561277b573d6000803e3d6000fd5b505050506040513d602081101561279157600080fd5b5051155b6127d05760405162461bcd60e51b81526004018080602001828103825260368152602001806132ab6036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905261231c908490612a9e565b61282b83611f41565b61283483612b4f565b6001600160a01b0383166000908152600560205260409020546128579082612c6d565b6001600160a01b03841660009081526005602052604090205560035461287d9082612c6d565b60035561231c8282612cff565b60007f000000000000000000000000000000000000000000000000000000006126d9808210156128bc575060006123b5565b6122c460016129157f0000000000000000000000000000000000000000000000000000000000093a8061290f867f000000000000000000000000000000000000000000000000000000006126d980612c6d565b90612d39565b9061249a565b6000612925611f31565b90506000612935826002546129cc565b90505b80156129c857600061294982612da0565b6000838152600460205260409020600201549091508082141561296d5750506129c8565b61299261297d60035483866129e2565b6000858152600460205260409020549061249a565b6000848152600460205260409020556129ab42836129cc565b600084815260046020526040902060020155505060001901612938565b5050565b60008183106129db57816124f4565b5090919050565b600042816129f8856129f386612df6565b612e30565b90506000612a0e83612a0987612da0565b6129cc565b90506000612a1c8284612e40565b9050612a288882612e51565b98975050505050505050565b600081815260046020818152604080842080546001600160a01b038816865260038201845291852054868652939092526001909101546124f4927f00000000000000000000000000000000000000000000000000000000000000059261290f929091839190612e51565b6000612af3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612eaa9092919063ffffffff16565b80519091501561231c57808060200190516020811015612b1257600080fd5b505161231c5760405162461bcd60e51b815260040180806020018281038252602a815260200180613281602a913960400191505060405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316612b8257611f2e565b612b8a612ec1565b6001600160a01b038116600090815260096020526040902054612bc857600b546001600160a01b038216600090815260096020526040902055611f2e565b6001600160a01b0381166000908152600560209081526040808320546009909252822054600b54919291612bfb91612c6d565b90506000612c1668056bc75e2d6310000061290f8585612e51565b6001600160a01b038516600090815260086020526040902054909150612c3c908261249a565b6001600160a01b038516600090815260086020908152604080832093909355600b5460099091529190205550505050565b600082821115612cc4576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6129c86001600160a01b037f0000000000000000000000002c80d72af9ab0bb9d98f607c817c6f512dd647e6168330846124fb565b80156129c8576129c86001600160a01b037f0000000000000000000000002c80d72af9ab0bb9d98f607c817c6f512dd647e61683836122ca565b6000808211612d8f576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381612d9857fe5b049392505050565b60006122c4612dcf837f0000000000000000000000000000000000000000000000000000000000093a80612e51565b7f000000000000000000000000000000000000000000000000000000006126d9809061249a565b60006122c4612dcf7f0000000000000000000000000000000000000000000000000000000000093a80612e2a856001612c6d565b90612e51565b6000818310156129db57816124f4565b600081831015612cc45760006124f4565b600082612e60575060006122c4565b82820282848281612e6d57fe5b04146124f45760405162461bcd60e51b81526004018080602001828103825260218152602001806132606021913960400191505060405180910390fd5b6060612eb98484600085612ffa565b949350505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161580612efc5750612efa613155565b155b15612f0657612ff8565b612f0e612ff8565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015612f7d57600080fd5b505afa158015612f91573d6000803e3d6000fd5b505050506040513d6020811015612fa757600080fd5b50519050600080612fb78361315a565b915091506000600354600014612fe457600354612fe19061290f8468056bc75e2d63100000612e51565b90505b612fee838261249a565b600b55505050600a555b565b60608247101561303b5760405162461bcd60e51b815260040180806020018281038252602681526020018061323a6026913960400191505060405180910390fd5b613044856126a1565b613095576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106130d35780518252601f1990920191602091820191016130b4565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613135576040519150601f19603f3d011682016040523d82523d6000602084013e61313a565b606091505b509150915061314a828286613175565b979650505050505050565b600090565b600b54600a5460009061316e908490612c6d565b9050915091565b606083156131845750816124f4565b8251156131945782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156131de5781810151838201526020016131c6565b50505050905090810190601f16801561320b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe5265656e7472616e637947756172643a207265656e7472616e742063616c6c00416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220b7ff65a99d00b88fbf8cbdd49f747e0267d52a015c1d714233eda623823744e664736f6c63430007060033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000005a05a64115bd86f220a26461fde3a011c71424760000000000000000000000004dc6b6374e812e029937129a156eec6344cde8d10000000000000000000000006fa13469428e85e6ac12c84b73a19aef7c53332a000000000000000000000000808507121b80c02388fad14726482e061b8da8270000000000000000000000002c80d72af9ab0bb9d98f607c817c6f512dd647e60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006126d9800000000000000000000000000000000000000000000000000000000000093a800000000000000000000000000000000000000000000000000000000000000005
-----Decoded View---------------
Arg [0] : _governanceManager (address): 0x5a05a64115bd86f220a26461fDe3A011c7142476
Arg [1] : _pausingManager (address): 0x4dc6b6374e812E029937129a156Eec6344cDE8D1
Arg [2] : _whitelist (address): 0x6fa13469428e85E6aC12c84B73A19aeF7c53332A
Arg [3] : _pendleTokenAddress (address): 0x808507121B80c02388fAd14726482e061B8da827
Arg [4] : _stakeToken (address): 0x2C80D72af9AB0bb9D98F607C817c6F512dd647e6
Arg [5] : _yieldToken (address): 0x0000000000000000000000000000000000000000
Arg [6] : _startTime (uint256): 1629936000
Arg [7] : _epochDuration (uint256): 604800
Arg [8] : _vestingEpochs (uint256): 5
-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 0000000000000000000000005a05a64115bd86f220a26461fde3a011c7142476
Arg [1] : 0000000000000000000000004dc6b6374e812e029937129a156eec6344cde8d1
Arg [2] : 0000000000000000000000006fa13469428e85e6ac12c84b73a19aef7c53332a
Arg [3] : 000000000000000000000000808507121b80c02388fad14726482e061b8da827
Arg [4] : 0000000000000000000000002c80d72af9ab0bb9d98f607c817c6f512dd647e6
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 000000000000000000000000000000000000000000000000000000006126d980
Arg [7] : 0000000000000000000000000000000000000000000000000000000000093a80
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000005
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $3.72 | 4,282.5035 | $15,930.91 |
Loading...
Loading
[ 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.