Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xc6EF91Cd...658b33a67 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
StakingRewards
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.18;
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import "./Utils/StakingConstants.sol";
import "solmate/src/utils/FixedPointMathLib.sol";
/**
* @title Lodestar Finance Staking Contract
* @author Lodestar Finance
*/
contract StakingRewards is
StakingConstants,
Initializable,
ReentrancyGuardUpgradeable,
PausableUpgradeable,
Ownable2StepUpgradeable,
ERC20Upgradeable
{
using SafeERC20Upgradeable for IERC20Upgradeable;
using FixedPointMathLib for uint256;
/**
* @notice initializer function
* @param _LODE LODE token address
* @param _WETH WETH address
* @param _esLODE esLODE address
* @param _routerContract Router address
* @dev can only be called once
*/
function initialize(address _LODE, address _WETH, address _esLODE, address _routerContract) public initializer {
__Context_init();
__Ownable2Step_init();
__Pausable_init();
__ReentrancyGuard_init();
__ERC20_init("Staking LODE", "stLODE");
LODE = IERC20Upgradeable(_LODE);
WETH = IERC20Upgradeable(_WETH);
esLODE = IERC20Upgradeable(_esLODE);
routerContract = _routerContract;
stLODE3M = 1400000000000000000;
stLODE6M = 2000000000000000000;
relockStLODE3M = 50000000000000000;
relockStLODE6M = 100000000000000000;
lastRewardSecond = uint32(block.timestamp);
}
/**
* @notice Stake LODE with or without a lock time to earn rewards
* @param amount the amount the user wishes to stake (denom. in wei)
* @param lockTime the desired lock time. Must be 10 seconds, 90 days (in seconds) or 180 days (in seconds)
*/
function stakeLODE(uint256 amount, uint256 lockTime) external whenNotPaused nonReentrant {
require(amount != 0, "StakingRewards: Invalid stake amount");
require(
lockTime == 10 seconds || lockTime == 90 days || lockTime == 180 days,
"StakingRewards: Invalid lock time"
);
uint256 currentLockTime = stakers[msg.sender].lockTime;
uint256 startTime = stakers[msg.sender].startTime;
uint256 cutoffTime = startTime + ((currentLockTime * 80) / 100);
if (currentLockTime != 0) {
require(lockTime == currentLockTime, "StakingRewards: Cannot add stake with different lock time");
}
if (currentLockTime != 10 seconds && currentLockTime != 0) {
require(block.timestamp < cutoffTime, "StakingRewards: Staking period expired");
}
stakeLODEInternal(amount, lockTime);
}
function stakeLODEInternal(uint256 amount, uint256 lockTime) internal {
require(LODE.transferFrom(msg.sender, address(this), amount), "StakingRewards: Transfer failed");
uint256 mintAmount = amount;
uint256 relockAdjustment;
uint256 threeMonthProduct;
uint256 sixMonthProduct;
uint256 preDivisionValue;
uint256 threeMonthCount = stakers[msg.sender].threeMonthRelockCount;
uint256 sixMonthCount = stakers[msg.sender].sixMonthRelockCount;
if (lockTime == 10 seconds) {
stakers[msg.sender].startTime = block.timestamp;
}
if (lockTime == 90 days) {
mintAmount = FixedPointMathLib.mulDivDown(amount, stLODE3M, FixedPointMathLib.WAD);
threeMonthProduct = FixedPointMathLib.mulDivDown(threeMonthCount, relockStLODE3M, FixedPointMathLib.WAD);
sixMonthProduct = FixedPointMathLib.mulDivDown(sixMonthCount, relockStLODE6M, FixedPointMathLib.WAD);
preDivisionValue = FixedPointMathLib.mulDivDown(
amount,
(threeMonthProduct + sixMonthProduct),
FixedPointMathLib.WAD
);
relockAdjustment = FixedPointMathLib.mulDivDown(preDivisionValue, FixedPointMathLib.WAD, BASE);
mintAmount += relockAdjustment;
stakers[msg.sender].relockStLODEAmount += relockAdjustment;
totalRelockStLODE += relockAdjustment;
} else if (lockTime == 180 days) {
mintAmount = FixedPointMathLib.mulDivDown(amount, stLODE6M, FixedPointMathLib.WAD);
threeMonthProduct = FixedPointMathLib.mulDivDown(threeMonthCount, relockStLODE3M, FixedPointMathLib.WAD);
sixMonthProduct = FixedPointMathLib.mulDivDown(sixMonthCount, relockStLODE6M, FixedPointMathLib.WAD);
preDivisionValue = FixedPointMathLib.mulDivDown(
amount,
(threeMonthProduct + sixMonthProduct),
FixedPointMathLib.WAD
);
relockAdjustment = FixedPointMathLib.mulDivDown(preDivisionValue, FixedPointMathLib.WAD, BASE);
mintAmount += relockAdjustment;
stakers[msg.sender].relockStLODEAmount += relockAdjustment;
totalRelockStLODE += relockAdjustment; // Scale the mint amount for 6 months lock time
}
if (stakers[msg.sender].lodeAmount == 0) {
stakers[msg.sender].startTime = block.timestamp;
stakers[msg.sender].lockTime = lockTime;
}
stakers[msg.sender].lodeAmount += amount; // Update LODE staked amount
stakers[msg.sender].stLODEAmount += mintAmount; // Update stLODE minted amount
totalStaked += amount;
UserInfo storage user = userInfo[msg.sender];
uint256 _prev = totalSupply();
updateShares();
unchecked {
user.amount += uint96(mintAmount);
shares += uint96(mintAmount);
}
user.wethRewardsDebt =
user.wethRewardsDebt +
int128(uint128(_calculateRewardDebt(accWethPerShare, uint96(mintAmount))));
_mint(address(this), mintAmount);
unchecked {
if (_prev + mintAmount != totalSupply()) revert DEPOSIT_ERROR();
}
// Adjust voting power
if (lockTime != 10 seconds) {
votingContract.mint(msg.sender, mintAmount);
}
emit StakedLODE(msg.sender, amount, lockTime);
}
/**
* @notice Stake esLODE tokens to earn rewards
* @param amount the amount the user wishes to stake (denom. in wei)
*/
function stakeEsLODE(uint256 amount) external whenNotPaused nonReentrant {
require(esLODE.balanceOf(msg.sender) >= amount, "StakingRewards: Insufficient balance");
require(amount > 0, "StakingRewards: Invalid amount");
EsLODEStake[] memory userStakes = esLODEStakes[msg.sender];
require(userStakes.length <= 10, "StakingRewards: Max Number of esLODE Stakes reached");
stakeEsLODEInternal(amount);
}
function stakeEsLODEInternal(uint256 amount) internal {
require(esLODE.transferFrom(msg.sender, address(this), amount), "StakingRewards: Transfer failed");
stakers[msg.sender].nextStakeId += 1;
esLODEStakes[msg.sender].push(
EsLODEStake({baseAmount: amount, amount: amount, startTimestamp: block.timestamp, alreadyConverted: 0})
);
stakers[msg.sender].totalEsLODEStakedByUser += amount; // Update total EsLODE staked by user
stakers[msg.sender].stLODEAmount += amount;
totalEsLODEStaked += amount;
totalStaked += amount;
UserInfo storage user = userInfo[msg.sender];
uint256 _prev = totalSupply();
updateShares();
unchecked {
user.amount += uint96(amount);
shares += uint96(amount);
}
user.wethRewardsDebt =
user.wethRewardsDebt +
int128(uint128(_calculateRewardDebt(accWethPerShare, uint96(amount))));
_mint(address(this), amount);
unchecked {
if (_prev + amount != totalSupply()) revert DEPOSIT_ERROR();
}
//Adjust voting power
votingContract.mint(msg.sender, amount);
emit StakedEsLODE(msg.sender, amount);
}
/**
* @notice Unstake LODE
* @param amount The amount the user wishes to unstake
*/
function unstakeLODE(uint256 amount) external nonReentrant {
require(stakers[msg.sender].lodeAmount >= amount && amount != 0, "StakingRewards: Invalid unstake amount");
require(
stakers[msg.sender].startTime + stakers[msg.sender].lockTime <= block.timestamp,
"StakingRewards: Tokens are still locked"
);
unstakeLODEInternal(amount);
}
function unstakeLODEInternal(uint256 amount) internal {
updateShares();
uint256 convertedAmount = _harvest();
uint256 totalUnstake = amount + convertedAmount;
uint256 stakedBalance = stakers[msg.sender].lodeAmount;
uint256 stLODEBalance = stakers[msg.sender].stLODEAmount;
uint256 relockStLODEBalance = stakers[msg.sender].relockStLODEAmount;
uint256 esLODEBalance = stakers[msg.sender].totalEsLODEStakedByUser;
uint256 stLODEReduction;
uint256 lockTimePriorToUpdate = stakers[msg.sender].lockTime;
stakers[msg.sender].stLODEAmount -= relockStLODEBalance;
totalRelockStLODE -= relockStLODEBalance;
//if user is withdrawing their entire staked balance, otherwise calculate appropriate stLODE reduction
//and reset user's staking info such that their remaining balance is seen as being unlocked now
if (totalUnstake == stakedBalance && esLODEBalance == 0) {
//if user is unstaking entire balance and has no esLODE staked
stakers[msg.sender].lockTime = 0;
stakers[msg.sender].startTime = 0;
stLODEReduction = stLODEBalance;
stakers[msg.sender].stLODEAmount = 0;
stakers[msg.sender].threeMonthRelockCount = 0;
stakers[msg.sender].sixMonthRelockCount = 0;
stakers[msg.sender].relockStLODEAmount = 0;
} else {
uint256 newStakedBalance = stakedBalance - totalUnstake;
uint256 newStLODEBalance = newStakedBalance + esLODEBalance;
stLODEReduction = stLODEBalance - newStLODEBalance;
require(stLODEReduction <= stLODEBalance, "StakingRewards: Invalid unstake amount");
stakers[msg.sender].stLODEAmount = newStLODEBalance;
stakers[msg.sender].lockTime = 10 seconds;
stakers[msg.sender].startTime = block.timestamp;
stakers[msg.sender].threeMonthRelockCount = 0;
stakers[msg.sender].sixMonthRelockCount = 0;
stakers[msg.sender].relockStLODEAmount = 0;
}
stakers[msg.sender].lodeAmount -= totalUnstake;
totalStaked -= totalUnstake;
UserInfo storage user = userInfo[msg.sender];
uint256 rewardsAdjustment;
if (user.amount < stLODEReduction && stakers[msg.sender].totalEsLODEStakedByUser == 0) {
rewardsAdjustment = user.amount;
} else if (user.amount < stLODEReduction && stakers[msg.sender].totalEsLODEStakedByUser != 0) {
rewardsAdjustment = user.amount - stakers[msg.sender].totalEsLODEStakedByUser;
} else {
rewardsAdjustment = stLODEReduction;
}
if (user.amount < rewardsAdjustment || rewardsAdjustment == 0) revert WITHDRAW_ERROR();
unchecked {
user.amount -= uint96(rewardsAdjustment);
shares -= uint96(rewardsAdjustment);
}
user.wethRewardsDebt =
user.wethRewardsDebt -
int128(uint128(_calculateRewardDebt(accWethPerShare, uint96(rewardsAdjustment))));
_burn(address(this), rewardsAdjustment);
//Adjust voting power
//normalize to total esLODE staked if user has any, otherwise burn to 0
uint256 currentVotingPower = votingContract.getRawVotingPower(msg.sender);
if (
(lockTimePriorToUpdate != 0 && currentVotingPower != 0) ||
(lockTimePriorToUpdate != 10 seconds && currentVotingPower != 0)
) {
if (stakers[msg.sender].totalEsLODEStakedByUser != 0 && currentVotingPower != 0) {
if (currentVotingPower > stakers[msg.sender].totalEsLODEStakedByUser) {
uint256 burnAmount = currentVotingPower - stakers[msg.sender].totalEsLODEStakedByUser;
votingContract.burn(msg.sender, burnAmount);
} else {
//this shouldn't ever happen, but allow for it just in case
uint256 mintAmount = stakers[msg.sender].totalEsLODEStakedByUser - currentVotingPower;
if (mintAmount != 0) {
votingContract.mint(msg.sender, mintAmount);
}
}
} else if (stakers[msg.sender].totalEsLODEStakedByUser == 0 && currentVotingPower != 0) {
votingContract.burn(msg.sender, currentVotingPower);
}
}
LODE.transfer(msg.sender, totalUnstake);
emit UnstakedLODE(msg.sender, totalUnstake);
}
/**
* @notice Converts vested esLODE to LODE and updates user reward shares accordingly accounting for current lock time and relocks
*/
function convertEsLODEToLODE() public returns (uint256) {
//since this is also called on unstake and harvesting, we exit out of this function if user has no esLODE staked.
if (stakers[msg.sender].totalEsLODEStakedByUser == 0) {
return 0;
}
uint256 lockTime = stakers[msg.sender].lockTime;
uint256 threeMonthCount = stakers[msg.sender].threeMonthRelockCount;
uint256 sixMonthCount = stakers[msg.sender].sixMonthRelockCount;
uint256 totalDays = 365 days;
uint256 amountToTransfer;
uint256 stLODEAdjustment;
uint256 conversionAmount;
uint256 innerOperation;
uint256 result;
EsLODEStake[] memory userStakes = esLODEStakes[msg.sender];
for (uint256 i = 0; i < userStakes.length; i++) {
uint256 timeDiff = (block.timestamp - userStakes[i].startTimestamp);
uint256 alreadyConverted = userStakes[i].alreadyConverted;
if (timeDiff >= totalDays) {
conversionAmount = userStakes[i].amount;
amountToTransfer += conversionAmount;
esLODEStakes[msg.sender][i].alreadyConverted += conversionAmount;
esLODEStakes[msg.sender][i].amount = 0;
if (lockTime == 90 days) {
innerOperation =
(stLODE3M - 1e18) +
FixedPointMathLib.mulDivDown(threeMonthCount, relockStLODE3M, FixedPointMathLib.WAD) +
FixedPointMathLib.mulDivDown(sixMonthCount, relockStLODE6M, FixedPointMathLib.WAD);
result = FixedPointMathLib.mulDivDown(conversionAmount, innerOperation, BASE);
stLODEAdjustment += result;
} else if (lockTime == 180 days) {
innerOperation =
(stLODE6M - 1e18) +
FixedPointMathLib.mulDivDown(threeMonthCount, relockStLODE3M, FixedPointMathLib.WAD) +
FixedPointMathLib.mulDivDown(sixMonthCount, relockStLODE6M, FixedPointMathLib.WAD);
stLODEAdjustment += FixedPointMathLib.mulDivDown(conversionAmount, innerOperation, BASE);
}
} else if (timeDiff < totalDays) {
uint256 conversionRatioMantissa = FixedPointMathLib.mulDivDown(timeDiff, BASE, totalDays);
conversionAmount = (FixedPointMathLib.mulDivDown(
userStakes[i].baseAmount,
conversionRatioMantissa,
BASE
) - alreadyConverted);
amountToTransfer += conversionAmount;
esLODEStakes[msg.sender][i].alreadyConverted += conversionAmount;
esLODEStakes[msg.sender][i].amount -= conversionAmount;
if (lockTime == 90 days) {
innerOperation =
(stLODE3M - 1e18) +
FixedPointMathLib.mulDivDown(threeMonthCount, relockStLODE3M, FixedPointMathLib.WAD) +
FixedPointMathLib.mulDivDown(sixMonthCount, relockStLODE6M, FixedPointMathLib.WAD);
stLODEAdjustment += FixedPointMathLib.mulDivDown(conversionAmount, innerOperation, BASE);
} else if (lockTime == 180 days) {
innerOperation =
(stLODE6M - 1e18) +
FixedPointMathLib.mulDivDown(threeMonthCount, relockStLODE3M, FixedPointMathLib.WAD) +
FixedPointMathLib.mulDivDown(sixMonthCount, relockStLODE6M, FixedPointMathLib.WAD);
stLODEAdjustment += FixedPointMathLib.mulDivDown(conversionAmount, innerOperation, BASE);
}
}
}
//if the user has never staked LODE we need to update their state accordingly prior to any further actions
if (stakers[msg.sender].lodeAmount == 0 && stakers[msg.sender].lockTime == 0) {
stakers[msg.sender].lockTime = 10 seconds;
stakers[msg.sender].startTime = block.timestamp;
}
stakers[msg.sender].lodeAmount += amountToTransfer;
stakers[msg.sender].totalEsLODEStakedByUser -= amountToTransfer;
totalEsLODEStaked -= amountToTransfer;
if (stLODEAdjustment != 0) {
stakers[msg.sender].stLODEAmount += stLODEAdjustment;
UserInfo storage userRewards = userInfo[msg.sender];
uint256 _prev = totalSupply();
updateShares();
unchecked {
userRewards.amount += uint96(stLODEAdjustment);
shares += uint96(stLODEAdjustment);
}
userRewards.wethRewardsDebt =
userRewards.wethRewardsDebt +
int128(uint128(_calculateRewardDebt(accWethPerShare, uint96(stLODEAdjustment))));
_mint(address(this), stLODEAdjustment);
unchecked {
if (_prev + stLODEAdjustment != totalSupply()) revert DEPOSIT_ERROR();
}
}
//Adjust voting power if user is locking LODE
if (stakers[msg.sender].lockTime == 10 seconds || stakers[msg.sender].lockTime == 0) {
//if user is unlocked, we need to burn their converted amount of voting power
votingContract.burn(msg.sender, conversionAmount);
} else {
uint256 currentVotingPower = votingContract.getRawVotingPower(msg.sender);
if (stakers[msg.sender].stLODEAmount > currentVotingPower) {
uint256 votingAdjustment = stakers[msg.sender].stLODEAmount - currentVotingPower;
votingContract.mint(msg.sender, votingAdjustment);
} else if (stakers[msg.sender].stLODEAmount < currentVotingPower) {
uint256 votingAdjustment = currentVotingPower - stakers[msg.sender].stLODEAmount;
votingContract.burn(msg.sender, votingAdjustment);
}
}
esLODE.transfer(address(0), amountToTransfer);
emit esLODEConverted(msg.sender, conversionAmount);
return conversionAmount;
}
/**
* @notice Withdraw esLODE in an emergency without converting or claiming rewards
* @dev can only be called by the end user as part of an emergency withdrawal when locks are lifted
*/
function withdrawEsLODE() internal {
require(locksLifted, "StakingRewards: esLODE Withdrawals Not Permitted");
StakingInfo storage account = stakers[msg.sender];
uint256 totalEsLODE = account.totalEsLODEStakedByUser;
totalStaked -= totalEsLODE;
totalEsLODEStaked -= totalEsLODE;
stakers[msg.sender].totalEsLODEStakedByUser = 0;
stakers[msg.sender].stLODEAmount -= totalEsLODE;
require(
esLODE.balanceOf(address(this)) >= totalEsLODE,
"StakingRewards: WithdrawEsLODE: Withdraw amount exceeds contract balance"
);
uint256 rewardsAdjustment = totalEsLODE;
UserInfo storage user = userInfo[msg.sender];
if (user.amount < rewardsAdjustment || rewardsAdjustment == 0) revert WITHDRAW_ERROR();
unchecked {
user.amount -= uint96(rewardsAdjustment);
shares -= uint96(rewardsAdjustment);
}
user.wethRewardsDebt =
user.wethRewardsDebt -
int128(uint128(_calculateRewardDebt(accWethPerShare, uint96(rewardsAdjustment))));
_burn(address(this), totalEsLODE);
//Adjust voting power
votingContract.burn(msg.sender, totalEsLODE);
esLODE.safeTransfer(msg.sender, totalEsLODE);
emit UnstakedEsLODE(msg.sender, totalEsLODE);
}
/**
* @notice Withdraw staked esLODE (if applicable) and LODE in an emergency without claiming rewards or converting
* @dev can only be called by the end user when the locks are lifted
*/
function emergencyStakerWithdrawal() external nonReentrant {
require(locksLifted, "StakingRewards: Locks not lifted");
updateShares();
if (stakers[msg.sender].totalEsLODEStakedByUser != 0) {
withdrawEsLODE();
}
if (stakers[msg.sender].lodeAmount == 0) {
return;
}
StakingInfo storage info = stakers[msg.sender];
UserInfo storage user = userInfo[msg.sender];
uint256 transferAmount = info.lodeAmount;
uint256 burnAmount = info.stLODEAmount;
uint256 relockStLODE = info.relockStLODEAmount;
require(
LODE.balanceOf(address(this)) >= transferAmount,
"StakingRewards: Transfer amount exceeds contract balance."
);
//update staking state
stakers[msg.sender].lodeAmount = 0;
stakers[msg.sender].stLODEAmount = 0;
stakers[msg.sender].startTime = 0;
stakers[msg.sender].lockTime = 0;
stakers[msg.sender].relockStLODEAmount = 0;
stakers[msg.sender].threeMonthRelockCount = 0;
stakers[msg.sender].sixMonthRelockCount = 0;
totalStaked -= transferAmount;
totalRelockStLODE -= relockStLODE;
//update rewards state
//user should have no esLODE staked at this point so we clear out the user's rewards here
uint256 rewardsAdjustment = user.amount;
if (user.amount < rewardsAdjustment || rewardsAdjustment == 0) revert WITHDRAW_ERROR();
unchecked {
user.amount -= uint96(rewardsAdjustment);
shares -= uint96(rewardsAdjustment);
}
user.wethRewardsDebt =
user.wethRewardsDebt -
int128(uint128(_calculateRewardDebt(accWethPerShare, uint96(rewardsAdjustment))));
//update stLODE
_burn(address(this), burnAmount);
//update voting state, should have no esLODE staked here so we burn any remaining voting power
uint256 currentVotingPower = votingContract.getRawVotingPower(msg.sender);
votingContract.burn(msg.sender, currentVotingPower);
//transfer user's staked LODE balance to them
LODE.transfer(msg.sender, transferAmount);
emit UnstakedLODE(msg.sender, transferAmount);
}
/**
* @notice Relock tokens for boosted rewards
* @param lockTime the lock time to relock the staked position for, same input options as staking function
*/
function relock(uint256 lockTime) external whenNotPaused nonReentrant {
require(lockTime == 90 days || lockTime == 180 days, "StakingRewards: Invalid lock time");
//make sure user state is fresh
convertEsLODEToLODE();
updateShares();
StakingInfo storage info = stakers[msg.sender];
require(info.lockTime != 10 seconds, "StakingRewards: Cannot relock if unlocked");
//remove current relock stLODE from total (to be re-adjusted below)
uint256 currentRelockStLODE = info.relockStLODEAmount;
totalRelockStLODE -= currentRelockStLODE;
//sanity checks
require(info.lodeAmount > 0, "StakingRewards: No stake found");
require(
info.startTime + FixedPointMathLib.mulDivDown(info.lockTime, 80, 100) <= block.timestamp,
"StakingRewards: Lock time not expired"
);
uint256 relockStLODEAmount;
uint256 stLODEAdjustment;
uint256 rewardsAdjustment;
uint256 totalEsLODEStakedByUser = info.totalEsLODEStakedByUser;
//we need to account for changes in lock time to make sure the user is receiving the correct boost
if (info.lockTime != lockTime) {
//this means the user must currently be locked for 3 months and is increasing to 6 months.
//this means their boost on their staked LODE balance increases from 140% to 200%
if (lockTime == 180 days) {
//calculate new relock information and stLODE balances
stakers[msg.sender].sixMonthRelockCount += 1;
uint256 threeMonthCount = stakers[msg.sender].threeMonthRelockCount;
uint256 sixMonthCount = stakers[msg.sender].sixMonthRelockCount;
uint256 relockMultiplier = 1e18 +
FixedPointMathLib.mulDivDown(threeMonthCount, relockStLODE3M, 1) +
FixedPointMathLib.mulDivDown(sixMonthCount, relockStLODE6M, 1);
relockStLODEAmount =
FixedPointMathLib.mulDivDown(info.lodeAmount, relockMultiplier, BASE) -
info.lodeAmount;
uint256 newStLODEBalance = FixedPointMathLib.mulDivDown(info.lodeAmount, stLODE6M, 1e18);
newStLODEBalance += relockStLODEAmount + stakers[msg.sender].totalEsLODEStakedByUser;
stLODEAdjustment = newStLODEBalance - info.stLODEAmount;
//update user's state
stakers[msg.sender].lockTime = lockTime;
stakers[msg.sender].startTime = block.timestamp;
stakers[msg.sender].stLODEAmount = newStLODEBalance;
stakers[msg.sender].relockStLODEAmount = relockStLODEAmount;
totalRelockStLODE += relockStLODEAmount;
UserInfo storage user = userInfo[msg.sender];
rewardsAdjustment = stakers[msg.sender].stLODEAmount - user.amount;
uint256 _prev = totalSupply();
unchecked {
user.amount += uint96(rewardsAdjustment);
shares += uint96(rewardsAdjustment);
}
user.wethRewardsDebt =
user.wethRewardsDebt +
int128(uint128(_calculateRewardDebt(accWethPerShare, uint96(rewardsAdjustment))));
_mint(address(this), rewardsAdjustment);
//Adjust voting power
uint256 currentVotingPower = votingContract.getRawVotingPower(msg.sender);
votingContract.burn(msg.sender, currentVotingPower);
votingContract.mint(msg.sender, stakers[msg.sender].stLODEAmount);
unchecked {
if (_prev + rewardsAdjustment != totalSupply()) revert DEPOSIT_ERROR();
}
} else {
//the lock time must be going from 6 months to 3 months,
//which means we need to decrease their boost to 140% from 200%
//calculate new relock multiplier and stLODE balances
stakers[msg.sender].threeMonthRelockCount += 1;
uint256 threeMonthCount = stakers[msg.sender].threeMonthRelockCount;
uint256 sixMonthCount = stakers[msg.sender].sixMonthRelockCount;
uint256 relockMultiplier = 1e18 +
FixedPointMathLib.mulDivDown(threeMonthCount, relockStLODE3M, 1) +
FixedPointMathLib.mulDivDown(sixMonthCount, relockStLODE6M, 1);
relockStLODEAmount =
FixedPointMathLib.mulDivDown(info.lodeAmount, relockMultiplier, BASE) -
info.lodeAmount;
uint256 newStLODEBalance = FixedPointMathLib.mulDivDown(info.lodeAmount, stLODE3M, 1e18);
newStLODEBalance += relockStLODEAmount + stakers[msg.sender].totalEsLODEStakedByUser;
stLODEAdjustment = info.stLODEAmount - newStLODEBalance;
//update user's state
stakers[msg.sender].lockTime = lockTime;
stakers[msg.sender].startTime = block.timestamp;
stakers[msg.sender].stLODEAmount = newStLODEBalance;
stakers[msg.sender].relockStLODEAmount = relockStLODEAmount;
totalRelockStLODE += relockStLODEAmount;
UserInfo storage user = userInfo[msg.sender];
rewardsAdjustment = user.amount - stakers[msg.sender].stLODEAmount;
if (user.amount < rewardsAdjustment || rewardsAdjustment == 0) revert WITHDRAW_ERROR();
unchecked {
user.amount -= uint96(rewardsAdjustment);
shares -= uint96(rewardsAdjustment);
}
user.wethRewardsDebt =
user.wethRewardsDebt -
int128(uint128(_calculateRewardDebt(accWethPerShare, uint96(rewardsAdjustment))));
//Adjust voting power
uint256 currentVotingPower = votingContract.getRawVotingPower(msg.sender);
votingContract.burn(msg.sender, currentVotingPower);
votingContract.mint(msg.sender, stakers[msg.sender].stLODEAmount);
_burn(address(this), rewardsAdjustment);
}
} else {
//if lock time is the same as previous lock, we do similar calculations
if (lockTime == 180 days) {
//calculate new relock multiplier and stLODE balances
//we only need to add the new relock stLODE to state and rewards as base stLODE stays the same
stakers[msg.sender].sixMonthRelockCount += 1;
uint256 threeMonthCount = stakers[msg.sender].threeMonthRelockCount;
uint256 sixMonthCount = stakers[msg.sender].sixMonthRelockCount;
uint256 innerCalculation = 1e18 +
FixedPointMathLib.mulDivDown(threeMonthCount, relockStLODE3M, 1) +
FixedPointMathLib.mulDivDown(sixMonthCount, relockStLODE6M, 1);
relockStLODEAmount =
FixedPointMathLib.mulDivDown(info.lodeAmount, innerCalculation, BASE) -
info.lodeAmount;
uint256 newStLODEBalance = FixedPointMathLib.mulDivDown(info.lodeAmount, stLODE6M, 1e18);
newStLODEBalance += relockStLODEAmount;
//update user's state
stakers[msg.sender].lockTime = lockTime;
stakers[msg.sender].startTime = block.timestamp;
stakers[msg.sender].stLODEAmount = newStLODEBalance + totalEsLODEStakedByUser;
stakers[msg.sender].relockStLODEAmount = relockStLODEAmount;
totalRelockStLODE += relockStLODEAmount;
UserInfo storage user = userInfo[msg.sender];
rewardsAdjustment = stakers[msg.sender].stLODEAmount - user.amount;
uint256 _prev = totalSupply();
unchecked {
user.amount += uint96(rewardsAdjustment);
shares += uint96(rewardsAdjustment);
}
user.wethRewardsDebt =
user.wethRewardsDebt +
int128(uint128(_calculateRewardDebt(accWethPerShare, uint96(rewardsAdjustment))));
//Adjust voting power
uint256 currentVotingPower = votingContract.getRawVotingPower(msg.sender);
votingContract.burn(msg.sender, currentVotingPower);
votingContract.mint(msg.sender, stakers[msg.sender].stLODEAmount);
_mint(address(this), rewardsAdjustment);
unchecked {
if (_prev + rewardsAdjustment != totalSupply()) revert DEPOSIT_ERROR();
}
} else {
//calculate new relock multiplier and stLODE balances
//we only need to add the new relock stLODE to state and rewards as base stLODE stays the same
stakers[msg.sender].threeMonthRelockCount += 1;
uint256 threeMonthCount = stakers[msg.sender].threeMonthRelockCount;
uint256 sixMonthCount = stakers[msg.sender].sixMonthRelockCount;
uint256 innerCalculation = 1e18 +
FixedPointMathLib.mulDivDown(threeMonthCount, relockStLODE3M, 1) +
FixedPointMathLib.mulDivDown(sixMonthCount, relockStLODE6M, 1);
relockStLODEAmount =
FixedPointMathLib.mulDivDown(info.lodeAmount, innerCalculation, BASE) -
info.lodeAmount;
uint256 newStLODEBalance = FixedPointMathLib.mulDivDown(info.lodeAmount, stLODE3M, 1e18);
newStLODEBalance += relockStLODEAmount;
//update user's state
stakers[msg.sender].lockTime = lockTime;
stakers[msg.sender].startTime = block.timestamp;
stakers[msg.sender].stLODEAmount = newStLODEBalance + totalEsLODEStakedByUser;
stakers[msg.sender].relockStLODEAmount = relockStLODEAmount;
totalRelockStLODE += relockStLODEAmount;
UserInfo storage user = userInfo[msg.sender];
rewardsAdjustment = stakers[msg.sender].stLODEAmount - user.amount;
uint256 _prev = totalSupply();
unchecked {
user.amount += uint96(rewardsAdjustment);
shares += uint96(rewardsAdjustment);
}
user.wethRewardsDebt =
user.wethRewardsDebt +
int128(uint128(_calculateRewardDebt(accWethPerShare, uint96(rewardsAdjustment))));
//Adjust voting power
uint256 currentVotingPower = votingContract.getRawVotingPower(msg.sender);
votingContract.burn(msg.sender, currentVotingPower);
votingContract.mint(msg.sender, stakers[msg.sender].stLODEAmount);
_mint(address(this), rewardsAdjustment);
unchecked {
if (_prev + rewardsAdjustment != totalSupply()) revert DEPOSIT_ERROR();
}
}
}
emit Relocked(msg.sender, lockTime);
}
/**
* @notice Update the staking rewards information to be current
* @dev Called before all reward state changing functions
*/
function updateShares() public {
// if block.timestamp <= lastRewardSecond, already updated.
if (block.timestamp <= lastRewardSecond) {
return;
}
// if pool has no supply
if (shares == 0) {
lastRewardSecond = uint32(block.timestamp);
return;
}
unchecked {
accWethPerShare += rewardPerShare(wethPerSecond);
}
lastRewardSecond = uint32(block.timestamp);
}
/**
* @notice Function for a user to claim their pending rewards
* @dev Reverts on transfer failure via SafeERC20
*/
function claimRewards() external nonReentrant {
uint256 stakedLODE = stakers[msg.sender].lodeAmount;
uint256 stakedEsLODE = stakers[msg.sender].totalEsLODEStakedByUser;
if (stakedLODE == 0 && stakedEsLODE == 0) {
revert("StakingRewards: No staked balance");
}
_harvest();
}
function _harvest() private returns (uint256) {
updateShares();
uint256 convertedAmount = convertEsLODEToLODE();
UserInfo storage user = userInfo[msg.sender];
uint256 wethPending = _calculatePending(user.wethRewardsDebt, accWethPerShare, user.amount);
user.wethRewardsDebt = int128(uint128(_calculateRewardDebt(accWethPerShare, user.amount)));
WETH.safeTransfer(msg.sender, wethPending);
emit RewardsClaimed(msg.sender, wethPending);
return convertedAmount;
}
/**
* @notice Function to calculate a user's rewards per share
* @param _rewardRatePerSecond The current reward rate determined by the updateWeeklyRewards function
*/
function rewardPerShare(uint256 _rewardRatePerSecond) public view returns (uint128) {
unchecked {
return
uint128(
FixedPointMathLib.mulDivDown(
FixedPointMathLib.mulDivDown((block.timestamp - lastRewardSecond), _rewardRatePerSecond, 1),
MUL_CONSTANT,
shares
)
);
}
}
/**
* @notice Function to calculate a user's pending rewards to be ingested by FE
* @param _user The staker's address
*/
function pendingRewards(address _user) external view returns (uint256 _pendingweth) {
uint256 _wethPS = accWethPerShare;
if (block.timestamp > lastRewardSecond && shares != 0) {
_wethPS += rewardPerShare(wethPerSecond);
}
UserInfo memory user = userInfo[_user];
_pendingweth = _calculatePending(user.wethRewardsDebt, _wethPS, user.amount);
}
function _calculatePending(
int128 _rewardDebt,
uint256 _accPerShare, // Stay 256;
uint96 _amount
) internal pure returns (uint128) {
if (_rewardDebt < 0) {
return uint128(_calculateRewardDebt(_accPerShare, _amount)) + uint128(-_rewardDebt);
} else {
if (int128(uint128(_calculateRewardDebt(_accPerShare, _amount))) < _rewardDebt) {
return 0;
}
return uint128(_calculateRewardDebt(_accPerShare, _amount)) - uint128(_rewardDebt);
}
}
function _calculateRewardDebt(uint256 _accWethPerShare, uint96 _amount) internal pure returns (uint256) {
unchecked {
return FixedPointMathLib.mulDivDown(_amount, _accWethPerShare, MUL_CONSTANT);
}
}
function setStartTime(uint32 _startTime) internal {
lastRewardSecond = _startTime;
}
function setEmission(uint256 _wethPerSecond) internal {
wethPerSecond = _wethPerSecond;
}
/**
* @notice Function to calculate the current WETH/second rewards rate
* @param rewardsAmount The current weekly rewards amount (denom. in wei)
*/
function calculateWethPerSecond(uint256 rewardsAmount) public pure returns (uint256 _wethPerSecond) {
uint256 periodDuration = 7 days;
_wethPerSecond = rewardsAmount / periodDuration;
}
/**
* @notice Permissioned function to update weekly rewards
* @param _weeklyRewards The amount of incoming weekly rewards
* @dev Can only be called by the router contract
*/
function updateWeeklyRewards(uint256 _weeklyRewards) external {
require(msg.sender == routerContract, "StakingRewards: Unauthorized");
updateShares();
weeklyRewards = _weeklyRewards;
lastUpdateTimestamp = block.timestamp;
setStartTime(uint32(block.timestamp));
uint256 _wethPerSecond = calculateWethPerSecond(_weeklyRewards);
setEmission(_wethPerSecond);
emit WeeklyRewardsUpdated(_weeklyRewards);
}
/**
* @notice Function used to return current user's staked LODE amount
* @param _address The staker's address
* @return Returns the user's currently staked LODE amount
*/
function getStLODEAmount(address _address) public view returns (uint256) {
return stakers[_address].stLODEAmount;
}
/**
* @notice Function used to return curren user's staked LODE lockTime
* @param _address The staker's address
* @return Returns the user's currently staked LODE lockTime
*/
function getStLodeLockTime(address _address) public view returns (uint256) {
return stakers[_address].lockTime;
}
/* **ADMIN FUNCTIONS** */
/**
* @notice Pause function for staking operations
* @dev Can only be called by contract owner
*/
function _pauseStaking() external onlyOwner {
_pause();
emit StakingPaused();
}
/**
* @notice Unause function for staking operations
* @dev Can only be called by contract owner
*/
function _unpauseStaking() external onlyOwner {
_unpause();
emit StakingUnpaused();
}
/**
* @notice Admin function to update the router contract
* @dev Can only be called by contract owner
*/
function _updateRouterContract(address _routerContract) external onlyOwner {
require(_routerContract != address(0), "StakingRewards: Invalid Router Contract");
routerContract = _routerContract;
emit RouterContractUpdated(_routerContract);
}
/**
* @notice Admin function to update the voting power contract
* @dev Can only be called by contract owner
*/
function _updateVotingContract(address _votingContract) external onlyOwner {
require(_votingContract != address(0), "StakingRewards: Invalid Voting Contract");
votingContract = IVotingPower(_votingContract);
emit VotingContractUpdated(address(votingContract));
}
/**
* @notice Admin function to withdraw esLODE backing LODE in an emergency scenario
* @dev Can only be called by contract owner, and can only withdraw LODE that is not staked by users.
*/
function _emergencyWithdraw() external onlyOwner {
uint256 contractLODEBalance = LODE.balanceOf(address(this));
uint256 LODEDelta = contractLODEBalance - (totalStaked - totalEsLODEStaked);
LODE.transfer(owner(), LODEDelta);
emit EmergencyWithdrawal(LODEDelta);
}
/**
* @notice Admin function to allow stakers to unstake their tokens immediately
* @param state true = locks are lifted. defaults to false (locks are not lifted)
* @dev Can only be called by contract owner.
*/
function _liftLocks(bool state) external onlyOwner {
locksLifted = state;
emit LocksLifted(locksLifted, block.timestamp);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.0;
import "./OwnableUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {
function __Ownable2Step_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable2Step_init_unchained() internal onlyInitializing {
}
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
_transferOwnership(sender);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal onlyInitializing {
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal onlyInitializing {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuardUpgradeable is Initializable {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20Upgradeable.sol";
import "./extensions/IERC20MetadataUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC20_init_unchained(name_, symbol_);
}
function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[45] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20PermitUpgradeable {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
import "../extensions/IERC20PermitUpgradeable.sol";
import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {
using AddressUpgradeable for address;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20Upgradeable 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(IERC20Upgradeable token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20PermitUpgradeable token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20Upgradeable 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");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {
// 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 cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.18;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IERC20Extended is IERC20 {
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
}
interface ICERC20 is IERC20 {
// CToken
/**
* @notice Get the underlying balance of the `owner`
* @dev This also accrues interest in a transaction
* @param owner The address of the account to query
* @return The amount of underlying owned by `owner`
*/
function balanceOfUnderlying(address owner) external returns (uint256);
/**
* @notice Returns the current per-block borrow interest rate for this cToken
* @return The borrow interest rate per block, scaled by 1e18
*/
function borrowRatePerBlock() external view returns (uint256);
/**
* @notice Returns the current per-block supply interest rate for this cToken
* @return The supply interest rate per block, scaled by 1e18
*/
function supplyRatePerBlock() external view returns (uint256);
/**
* @notice Accrue interest then return the up-to-date exchange rate
* @return Calculated exchange rate scaled by 1e18
*/
function exchangeRateCurrent() external returns (uint256);
// Cerc20
function mint(uint256 mintAmount) external returns (uint256);
function redeem(uint256 redeemTokens) external returns (uint256);
function underlying() external view returns (address);
function liquidateBorrow(address borrower, uint256 repayAmount, address cTokenCollateral) external;
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function approve(address spender, uint256 amount) external returns (bool);
function totalReserves() external returns (uint);
function _reduceReserves(uint reduceAmount) external returns (uint);
}
interface SushiRouterInterface {
function WETH() external returns (address);
function swapExactETHForTokensSupportingFeeOnTransferTokens(
fixed swapAmountETH,
uint256 amountOutMin,
address[] memory path,
address to,
uint256 deadline
) external;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] memory path,
address to,
uint256 deadline
) external;
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] memory path,
address to,
uint256 deadline
) external;
}
interface PriceOracleProxyETHInterface {
function getUnderlyingPrice(address lToken) external returns (uint256);
struct AggregatorInfo {
address source;
uint8 base;
}
function aggregators(address lToken) external returns (AggregatorInfo memory);
}
interface IPlutusDepositor {
function redeem(uint256 amount) external;
function redeemAll() external;
}
interface IGLPRouter {
function unstakeAndRedeemGlpETH(
uint256 _glpAmount,
uint256 _minOut,
address payable _receiver
) external returns (uint256);
function unstakeAndRedeemGlp(
address tokenOut,
uint256 glpAmount,
uint256 minOut,
address receiver
) external returns (uint256);
}
interface IWETH is IERC20 {
function deposit() external payable;
function withdraw(uint256 amount) external;
}
interface ICETH is ICERC20 {
function liquidateBorrow(address borrower, ICERC20 cTokenCollateral) external payable;
}
interface StakingRewardsInterface {
function updateWeeklyRewards(uint256 newRewards) external;
}
interface IVotingPower {
function mint(address _to, uint256 _amount) external;
function burn(address _from, uint256 _amount) external;
function getVotes(address user) external returns (uint256);
function getRawVotingPower(address _user) external view returns (uint256);
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.18;
import {IERC20Extended, IWETH, IVotingPower} from "../Interfaces/Interfaces.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
abstract contract StakingConstants {
struct EsLODEStake {
uint256 baseAmount;
uint256 amount;
uint256 startTimestamp;
uint256 alreadyConverted;
}
struct StakingInfo {
uint256 lodeAmount;
uint256 stLODEAmount;
uint256 startTime;
uint256 lockTime;
uint256 relockStLODEAmount;
uint256 nextStakeId;
uint256 totalEsLODEStakedByUser;
uint256 threeMonthRelockCount;
uint256 sixMonthRelockCount;
}
mapping(address => EsLODEStake[]) public esLODEStakes;
mapping(address => StakingInfo) public stakers;
IERC20Upgradeable public LODE;
IERC20Upgradeable public WETH;
IERC20Upgradeable public esLODE;
uint256 public weeklyRewards;
uint256 public lastUpdateTimestamp;
uint256 public totalStaked;
uint256 public totalEsLODEStaked;
uint256 public totalRelockStLODE;
uint256 public stLODE3M;
uint256 public stLODE6M;
uint256 public relockStLODE3M;
uint256 public relockStLODE6M;
address public routerContract;
IVotingPower public votingContract;
uint256 public constant BASE = 1e18;
uint256 public constant MUL_CONSTANT = 1e14;
bool public withdrawEsLODEAllowed;
bool public locksLifted;
struct UserInfo {
uint96 amount; // Staking tokens the user has provided
int128 wethRewardsDebt;
}
uint256 public wethPerSecond;
uint128 public accWethPerShare;
uint96 public shares; // total staked,TODO:WAS PRIVATE PRIOR TO TESTING
uint32 public lastRewardSecond;
mapping(address => UserInfo) public userInfo;
error DEPOSIT_ERROR();
error WITHDRAW_ERROR();
error UNAUTHORIZED();
event StakedLODE(address indexed user, uint256 amount, uint256 lockTime);
event StakedEsLODE(address indexed user, uint256 amount);
event UnstakedLODE(address indexed user, uint256 amount);
event UnstakedEsLODE(address indexed user, uint256 amount);
event esLODEConverted(address indexed user, uint256 amount);
event RewardsClaimed(address indexed user, uint256 reward);
event StakingLockedCanceled();
event WeeklyRewardsUpdated(uint256 newRewards);
event StakingRatesUpdated(uint256 stLODE3M, uint256 stLODE6M, uint256 vstLODE3M, uint256 vstLODE6M);
event StakingPaused();
event StakingUnpaused();
event RouterContractUpdated(address newRouterContract);
event VotingContractUpdated(address newVotingContract);
event esLODEUnlocked(bool state, uint256 timestamp);
event Relocked(address user, uint256 lockTime);
event EmergencyWithdrawal(uint256 amount);
event LocksLifted(bool state, uint256 timestamp);
}
//following initial deployment begin new storage contracts below starting with V1// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Arithmetic library with operations for fixed-point numbers.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol)
/// @author Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol)
library FixedPointMathLib {
/*//////////////////////////////////////////////////////////////
SIMPLIFIED FIXED POINT OPERATIONS
//////////////////////////////////////////////////////////////*/
uint256 internal constant MAX_UINT256 = 2**256 - 1;
uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s.
function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down.
}
function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up.
}
function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down.
}
function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up.
}
/*//////////////////////////////////////////////////////////////
LOW LEVEL FIXED POINT OPERATIONS
//////////////////////////////////////////////////////////////*/
function mulDivDown(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y))
if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) {
revert(0, 0)
}
// Divide x * y by the denominator.
z := div(mul(x, y), denominator)
}
}
function mulDivUp(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y))
if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) {
revert(0, 0)
}
// If x * y modulo the denominator is strictly greater than 0,
// 1 is added to round up the division of x * y by the denominator.
z := add(gt(mod(mul(x, y), denominator), 0), div(mul(x, y), denominator))
}
}
function rpow(
uint256 x,
uint256 n,
uint256 scalar
) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
switch x
case 0 {
switch n
case 0 {
// 0 ** 0 = 1
z := scalar
}
default {
// 0 ** n = 0
z := 0
}
}
default {
switch mod(n, 2)
case 0 {
// If n is even, store scalar in z for now.
z := scalar
}
default {
// If n is odd, store x in z for now.
z := x
}
// Shifting right by 1 is like dividing by 2.
let half := shr(1, scalar)
for {
// Shift n right by 1 before looping to halve it.
n := shr(1, n)
} n {
// Shift n right by 1 each iteration to halve it.
n := shr(1, n)
} {
// Revert immediately if x ** 2 would overflow.
// Equivalent to iszero(eq(div(xx, x), x)) here.
if shr(128, x) {
revert(0, 0)
}
// Store x squared.
let xx := mul(x, x)
// Round to the nearest number.
let xxRound := add(xx, half)
// Revert if xx + half overflowed.
if lt(xxRound, xx) {
revert(0, 0)
}
// Set x to scaled xxRound.
x := div(xxRound, scalar)
// If n is even:
if mod(n, 2) {
// Compute z * x.
let zx := mul(z, x)
// If z * x overflowed:
if iszero(eq(div(zx, x), z)) {
// Revert if x is non-zero.
if iszero(iszero(x)) {
revert(0, 0)
}
}
// Round to the nearest number.
let zxRound := add(zx, half)
// Revert if zx + half overflowed.
if lt(zxRound, zx) {
revert(0, 0)
}
// Return properly scaled zxRound.
z := div(zxRound, scalar)
}
}
}
}
}
/*//////////////////////////////////////////////////////////////
GENERAL NUMBER UTILITIES
//////////////////////////////////////////////////////////////*/
function sqrt(uint256 x) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
let y := x // We start y at x, which will help us make our initial estimate.
z := 181 // The "correct" value is 1, but this saves a multiplication later.
// This segment is to get a reasonable initial estimate for the Babylonian method. With a bad
// start, the correct # of bits increases ~linearly each iteration instead of ~quadratically.
// We check y >= 2^(k + 8) but shift right by k bits
// each branch to ensure that if x >= 256, then y >= 256.
if iszero(lt(y, 0x10000000000000000000000000000000000)) {
y := shr(128, y)
z := shl(64, z)
}
if iszero(lt(y, 0x1000000000000000000)) {
y := shr(64, y)
z := shl(32, z)
}
if iszero(lt(y, 0x10000000000)) {
y := shr(32, y)
z := shl(16, z)
}
if iszero(lt(y, 0x1000000)) {
y := shr(16, y)
z := shl(8, z)
}
// Goal was to get z*z*y within a small factor of x. More iterations could
// get y in a tighter range. Currently, we will have y in [256, 256*2^16).
// We ensured y >= 256 so that the relative difference between y and y+1 is small.
// That's not possible if x < 256 but we can just verify those cases exhaustively.
// Now, z*z*y <= x < z*z*(y+1), and y <= 2^(16+8), and either y >= 256, or x < 256.
// Correctness can be checked exhaustively for x < 256, so we assume y >= 256.
// Then z*sqrt(y) is within sqrt(257)/sqrt(256) of sqrt(x), or about 20bps.
// For s in the range [1/256, 256], the estimate f(s) = (181/1024) * (s+1) is in the range
// (1/2.84 * sqrt(s), 2.84 * sqrt(s)), with largest error when s = 1 and when s = 256 or 1/256.
// Since y is in [256, 256*2^16), let a = y/65536, so that a is in [1/256, 256). Then we can estimate
// sqrt(y) using sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2^18.
// There is no overflow risk here since y < 2^136 after the first branch above.
z := shr(18, mul(z, add(y, 65536))) // A mul() is saved from starting z at 181.
// Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough.
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
// If x+1 is a perfect square, the Babylonian method cycles between
// floor(sqrt(x)) and ceil(sqrt(x)). This statement ensures we return floor.
// See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division
// Since the ceil is rare, we save gas on the assignment and repeat division in the rare case.
// If you don't care whether the floor or ceil square root is returned, you can remove this statement.
z := sub(z, lt(div(x, z), z))
}
}
function unsafeMod(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Mod x by y. Note this will return
// 0 instead of reverting if y is zero.
z := mod(x, y)
}
}
function unsafeDiv(uint256 x, uint256 y) internal pure returns (uint256 r) {
/// @solidity memory-safe-assembly
assembly {
// Divide x by y. Note this will return
// 0 instead of reverting if y is zero.
r := div(x, y)
}
}
function unsafeDivUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Add 1 to x * y if x % y > 0. Note this will
// return 0 instead of reverting if y is zero.
z := add(gt(mod(x, y), 0), div(x, y))
}
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"name":"DEPOSIT_ERROR","type":"error"},{"inputs":[],"name":"UNAUTHORIZED","type":"error"},{"inputs":[],"name":"WITHDRAW_ERROR","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"state","type":"bool"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"LocksLifted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"lockTime","type":"uint256"}],"name":"Relocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRouterContract","type":"address"}],"name":"RouterContractUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"StakedEsLODE","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockTime","type":"uint256"}],"name":"StakedLODE","type":"event"},{"anonymous":false,"inputs":[],"name":"StakingLockedCanceled","type":"event"},{"anonymous":false,"inputs":[],"name":"StakingPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"stLODE3M","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stLODE6M","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vstLODE3M","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vstLODE6M","type":"uint256"}],"name":"StakingRatesUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"StakingUnpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UnstakedEsLODE","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UnstakedLODE","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newVotingContract","type":"address"}],"name":"VotingContractUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newRewards","type":"uint256"}],"name":"WeeklyRewardsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"esLODEConverted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"state","type":"bool"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"esLODEUnlocked","type":"event"},{"inputs":[],"name":"BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LODE","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MUL_CONSTANT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"state","type":"bool"}],"name":"_liftLocks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"_pauseStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"_unpauseStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_routerContract","type":"address"}],"name":"_updateRouterContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_votingContract","type":"address"}],"name":"_updateVotingContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"accWethPerShare","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"rewardsAmount","type":"uint256"}],"name":"calculateWethPerSecond","outputs":[{"internalType":"uint256","name":"_wethPerSecond","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"convertEsLODEToLODE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyStakerWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"esLODE","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"esLODEStakes","outputs":[{"internalType":"uint256","name":"baseAmount","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"alreadyConverted","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getStLODEAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getStLodeLockTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_LODE","type":"address"},{"internalType":"address","name":"_WETH","type":"address"},{"internalType":"address","name":"_esLODE","type":"address"},{"internalType":"address","name":"_routerContract","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastRewardSecond","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"locksLifted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"pendingRewards","outputs":[{"internalType":"uint256","name":"_pendingweth","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockTime","type":"uint256"}],"name":"relock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"relockStLODE3M","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"relockStLODE6M","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardRatePerSecond","type":"uint256"}],"name":"rewardPerShare","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"routerContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"shares","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stLODE3M","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stLODE6M","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stakeEsLODE","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockTime","type":"uint256"}],"name":"stakeLODE","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakers","outputs":[{"internalType":"uint256","name":"lodeAmount","type":"uint256"},{"internalType":"uint256","name":"stLODEAmount","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"lockTime","type":"uint256"},{"internalType":"uint256","name":"relockStLODEAmount","type":"uint256"},{"internalType":"uint256","name":"nextStakeId","type":"uint256"},{"internalType":"uint256","name":"totalEsLODEStakedByUser","type":"uint256"},{"internalType":"uint256","name":"threeMonthRelockCount","type":"uint256"},{"internalType":"uint256","name":"sixMonthRelockCount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalEsLODEStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRelockStLODE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unstakeLODE","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_weeklyRewards","type":"uint256"}],"name":"updateWeeklyRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint96","name":"amount","type":"uint96"},{"internalType":"int128","name":"wethRewardsDebt","type":"int128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"votingContract","outputs":[{"internalType":"contract IVotingPower","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weeklyRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wethPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawEsLODEAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x608060405234801561001057600080fd5b50615e9280620000216000396000f3fe608060405234801561001057600080fd5b50600436106103c55760003560e01c80638b4aaa53116101ff578063cc79540c1161011a578063ec342ad0116100ad578063f70c1ad81161007c578063f70c1ad81461090b578063f711c7eb1461091e578063f8c8765e14610927578063fcc92fdf1461093a57600080fd5b8063ec342ad0146108d8578063ec9e7bba146108e7578063ee8be1e0146108ef578063f2fde38b146108f857600080fd5b8063d346243d116100e9578063d346243d14610898578063dd62ed3e146108ab578063e30c3978146108be578063e779c72f146108cf57600080fd5b8063cc79540c1461084b578063cdd8d69c1461085f578063d1627a1514610872578063d18b63251461088557600080fd5b8063a11d138a11610192578063ac8ad8ba11610161578063ac8ad8ba14610814578063ad5c46481461081c578063c05ffb981461082f578063c1fc006a1461083857600080fd5b8063a11d138a146107d2578063a457c2d7146107db578063a9059cbb146107ee578063a98d38f01461080157600080fd5b80639168ae72116101ce5780639168ae721461071857806395d89b41146107b857806398e28c3e146107c0578063a1135db7146107c957600080fd5b80638b4aaa53146106d35780638be4fb4c146106e05780638da5cb5b146106f35780638e3f174e1461070457600080fd5b8063372500ab116102ef578063640a9cee1161028257806379ba50971161025157806379ba50971461068e5780637bff973514610696578063817b1cd2146106c25780638705a427146106cb57600080fd5b8063640a9cee1461062857806370a0823114610653578063715018a61461067d578063773f91bb1461068557600080fd5b80634f72d846116102be5780634f72d846146105cb57806350b6f4d1146105de578063598972b31461060a5780635c975abb1461061d57600080fd5b8063372500ab1461055057806337958454146105585780633885c6721461058557806339509351146105b857600080fd5b806318160ddd1161036757806323b872dd1161033657806323b872dd146105135780632a41006814610526578063313ce5671461052e57806331d7a2621461053d57600080fd5b806318160ddd146104985780631959a002146104a15780631d5ce4e7146104f85780632247e2d11461050b57600080fd5b8063095ea7b3116103a3578063095ea7b3146104415780630a476966146104645780630c4580db1461047a57806314bcec9f1461048f57600080fd5b806303314efa146103ca578063048174531461040157806306fdde031461042c575b600080fd5b6011546103e490600160801b90046001600160601b031681565b6040516001600160601b0390911681526020015b60405180910390f35b600254610414906001600160a01b031681565b6040516001600160a01b0390911681526020016103f8565b61043461094d565b6040516103f89190615899565b61045461044f3660046158e8565b6109e0565b60405190151581526020016103f8565b61046c6109fa565b6040519081526020016103f8565b61048d610488366004615912565b6113e1565b005b61046c60065481565b6101105461046c565b6104d66104af36600461592b565b6012602052600090815260409020546001600160601b03811690600160601b9004600f0b82565b604080516001600160601b039093168352600f9190910b6020830152016103f8565b61046c610506366004615912565b611621565b61048d611638565b610454610521366004615946565b61178b565b61048d6117af565b604051601281526020016103f8565b61046c61054b36600461592b565b61184a565b61048d61190d565b61046c61056636600461592b565b6001600160a01b03166000908152600160208190526040909120015490565b6105986105933660046158e8565b6119a6565b6040805194855260208501939093529183015260608201526080016103f8565b6104546105c63660046158e8565b6119ec565b600e54610414906001600160a01b031681565b6011546105f590600160e01b900463ffffffff1681565b60405163ffffffff90911681526020016103f8565b61048d61061836600461592b565b611a0e565b60785460ff16610454565b60115461063b906001600160801b031681565b6040516001600160801b0390911681526020016103f8565b61046c61066136600461592b565b6001600160a01b0316600090815261010e602052604090205490565b61048d611ad1565b61046c600d5481565b61048d611ae3565b61046c6106a436600461592b565b6001600160a01b031660009081526001602052604090206003015490565b61046c60075481565b61048d611b5a565b61046c655af3107a400081565b61048d6106ee366004615990565b611b95565b60aa546001600160a01b0316610414565b600f5461045490600160a81b900460ff1681565b61077461072636600461592b565b60016020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154908060050154908060060154908060070154908060080154905089565b60408051998a5260208a0198909852968801959095526060870193909352608086019190915260a085015260c084015260e0830152610100820152610120016103f8565b610434611bfa565b61046c600c5481565b61046c60105481565b61046c600b5481565b6104546107e93660046158e8565b611c0a565b6104546107fc3660046158e8565b611c85565b61048d61080f366004615912565b611c93565b61048d612d0c565b600354610414906001600160a01b031681565b61046c60085481565b600f54610414906001600160a01b031681565b600f5461045490600160a01b900460ff1681565b61063b61086d366004615912565b613189565b61048d61088036600461592b565b6131ce565b61048d6108933660046159ad565b61328a565b61048d6108a6366004615912565b613478565b61046c6108b93660046159cf565b613554565b60dc546001600160a01b0316610414565b61046c600a5481565b61046c670de0b6b3a764000081565b61048d613580565b61046c60055481565b61048d61090636600461592b565b6135bb565b600454610414906001600160a01b031681565b61046c60095481565b61048d610935366004615a02565b61362c565b61048d610948366004615912565b61383b565b6060610111805461095d90615a56565b80601f016020809104026020016040519081016040528092919081815260200182805461098990615a56565b80156109d65780601f106109ab576101008083540402835291602001916109d6565b820191906000526020600020905b8154815290600101906020018083116109b957829003601f168201915b5050505050905090565b6000336109ee818585613913565b60019150505b92915050565b336000908152600160205260408120600601548103610a195750600090565b3360009081526001602090815260408083206003810154600782015460089092015485855283862080548551818802810188019096528086529296939591946301e13380949384938493849384938493919291849084015b82821015610acb578382906000526020600020906004020160405180608001604052908160008201548152602001600182015481526020016002820154815260200160038201548152505081526020019060010190610a71565b50505050905060005b8151811015610efe576000828281518110610af157610af1615a90565b60200260200101516040015142610b089190615abc565b90506000838381518110610b1e57610b1e615a90565b6020026020010151606001519050898210610ce857838381518110610b4557610b45615a90565b60200260200101516020015196508689610b5f9190615acf565b3360009081526020819052604090208054919a50889185908110610b8557610b85615a90565b90600052602060002090600402016003016000828254610ba59190615acf565b9091555050336000908152602081905260408120805485908110610bcb57610bcb615a90565b9060005260206000209060040201600101819055508c6276a70003610c6657610bff8b600d54670de0b6b3a7640000613a39565b610c148d600c54670de0b6b3a7640000613a39565b670de0b6b3a7640000600a54610c2a9190615abc565b610c349190615acf565b610c3e9190615acf565b9550610c538787670de0b6b3a7640000613a39565b9450610c5f8589615acf565b9750610ee9565b8c62ed4e0003610ce357610c858b600d54670de0b6b3a7640000613a39565b610c9a8d600c54670de0b6b3a7640000613a39565b670de0b6b3a7640000600b54610cb09190615abc565b610cba9190615acf565b610cc49190615acf565b9550610cd98787670de0b6b3a7640000613a39565b610c5f9089615acf565b610ee9565b89821015610ee9576000610d0583670de0b6b3a76400008d613a39565b905081610d38868681518110610d1d57610d1d615a90565b60200260200101516000015183670de0b6b3a7640000613a39565b610d429190615abc565b9750610d4e888b615acf565b3360009081526020819052604090208054919b50899186908110610d7457610d74615a90565b90600052602060002090600402016003016000828254610d949190615acf565b9091555050336000908152602081905260409020805489919086908110610dbd57610dbd615a90565b90600052602060002090600402016001016000828254610ddd9190615abc565b90915550506276a7008e9003610e6757610e028c600d54670de0b6b3a7640000613a39565b610e178e600c54670de0b6b3a7640000613a39565b670de0b6b3a7640000600a54610e2d9190615abc565b610e379190615acf565b610e419190615acf565b9650610e568888670de0b6b3a7640000613a39565b610e60908a615acf565b9850610ee7565b8d62ed4e0003610ee757610e868c600d54670de0b6b3a7640000613a39565b610e9b8e600c54670de0b6b3a7640000613a39565b670de0b6b3a7640000600b54610eb19190615abc565b610ebb9190615acf565b610ec59190615acf565b9650610eda8888670de0b6b3a7640000613a39565b610ee4908a615acf565b98505b505b50508080610ef690615ae2565b915050610ad4565b5033600090815260016020526040902054158015610f2c575033600090815260016020526040902060030154155b15610f4f57336000908152600160205260409020600a6003820155426002909101555b3360009081526001602052604081208054889290610f6e908490615acf565b90915550503360009081526001602052604081206006018054889290610f95908490615abc565b925050819055508560086000828254610fae9190615abc565b909155505084156110d3573360009081526001602081905260408220018054879290610fdb908490615acf565b909155505033600090815260126020526040812090610ffa6101105490565b90506110046117af565b81546001600160601b031981166001600160601b039182168901821617835560118054600160801b600160e01b03198116600160801b80830485168c01909416909302928317909155611065916001600160801b0391821691161788613a57565b825461107b9190600160601b9004600f0b615afb565b82546001600160801b0391909116600160601b02600160601b600160e01b03199091161782556110ab3088613a73565b61011054878201146110d05760405163fd9eaf9160e01b815260040160405180910390fd5b50505b33600090815260016020526040902060030154600a1480611104575033600090815260016020526040902060030154155b1561117257600f54604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac9061113b9033908890600401615b28565b600060405180830381600087803b15801561115557600080fd5b505af1158015611169573d6000803e3d6000fd5b50505050611327565b600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa1580156111bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111df9190615b41565b3360009081526001602081905260409091200154909150811015611286573360009081526001602081905260408220015461121b908390615abc565b600f546040516340c10f1960e01b81529192506001600160a01b0316906340c10f199061124e9033908590600401615b28565b600060405180830381600087803b15801561126857600080fd5b505af115801561127c573d6000803e3d6000fd5b5050505050611325565b336000908152600160208190526040909120015481111561132557336000908152600160208190526040822001546112be9083615abc565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac906112f19033908590600401615b28565b600060405180830381600087803b15801561130b57600080fd5b505af115801561131f573d6000803e3d6000fd5b50505050505b505b6004805460405163a9059cbb60e01b81526001600160a01b039091169163a9059cbb91611359916000918b9101615b28565b6020604051808303816000875af1158015611378573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139c9190615b5a565b5060405184815233907fe1375507ddaa0f1744e5bfd94ab5275f8e13165c1018644571b16120c71f12b39060200160405180910390a250919998505050505050505050565b6113e9613b36565b6113f1613b7c565b600480546040516370a0823160e01b8152339281019290925282916001600160a01b03909116906370a0823190602401602060405180830381865afa15801561143e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114629190615b41565b10156114c15760405162461bcd60e51b8152602060048201526024808201527f5374616b696e67526577617264733a20496e73756666696369656e742062616c604482015263616e636560e01b60648201526084015b60405180910390fd5b600081116115115760405162461bcd60e51b815260206004820152601e60248201527f5374616b696e67526577617264733a20496e76616c696420616d6f756e74000060448201526064016114b8565b3360009081526020818152604080832080548251818502810185019093528083529192909190849084015b8282101561159657838290600052602060002090600402016040518060800160405290816000820154815260200160018201548152602001600282015481526020016003820154815250508152602001906001019061153c565b505050509050600a8151111561160a5760405162461bcd60e51b815260206004820152603360248201527f5374616b696e67526577617264733a204d6178204e756d626572206f662065736044820152721313d1114814dd185ad95cc81c995858da1959606a1b60648201526084016114b8565b61161382613bd5565b5061161e6001601455565b50565b600062093a806116318184615b77565b9392505050565b611640613f34565b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad9190615b41565b905060006008546007546116c19190615abc565b6116cb9083615abc565b6002549091506001600160a01b031663a9059cbb6116f160aa546001600160a01b031690565b836040518363ffffffff1660e01b815260040161170f929190615b28565b6020604051808303816000875af115801561172e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117529190615b5a565b506040518181527fcbba13897c2ac3f7fdb11e857b1a5a5c47f51e3fbeffa74d430f2b06177b45c0906020015b60405180910390a15050565b600033611799858285613f8e565b6117a4858585614008565b506001949350505050565b601154600160e01b900463ffffffff1642116117c757565b601154600160801b90046001600160601b031660000361180057601180546001600160e01b0316600160e01b4263ffffffff1602179055565b61180b601054613189565b601180546001600160801b03808216939093019092166bffffffffffffffffffffffff60801b90921691909117600160e01b4263ffffffff1602179055565b6011546000906001600160801b03811690600160e01b900463ffffffff16421180156118875750601154600160801b90046001600160601b031615155b156118ad57611897601054613189565b6118aa906001600160801b031682615acf565b90505b6001600160a01b0383166000908152601260209081526040918290208251808401909352546001600160601b038116808452600160601b909104600f0b9183018290526118fc919084906141b5565b6001600160801b0316949350505050565b611915613b7c565b336000908152600160205260409020805460069091015481158015611938575080155b1561198f5760405162461bcd60e51b815260206004820152602160248201527f5374616b696e67526577617264733a204e6f207374616b65642062616c616e636044820152606560f81b60648201526084016114b8565b61199761421a565b5050506119a46001601455565b565b600060205281600052604060002081815481106119c257600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919450925084565b6000336109ee8185856119ff8383613554565b611a099190615acf565b613913565b611a16613f34565b6001600160a01b038116611a7c5760405162461bcd60e51b815260206004820152602760248201527f5374616b696e67526577617264733a20496e76616c696420566f74696e6720436044820152661bdb9d1c9858dd60ca1b60648201526084016114b8565b600f80546001600160a01b0319166001600160a01b0383169081179091556040519081527f264f54b893dc3babe9fb9ac8e7abcc6c1397da0903359d5fed6245242ab3ef0b906020015b60405180910390a150565b611ad9613f34565b6119a46000614310565b60dc5433906001600160a01b03168114611b515760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084016114b8565b61161e81614310565b611b62613f34565b611b6a614329565b6040517f26d1807b479eaba249c1214b82e4b65bbb0cc73ee8a17901324b1ef1b5904e4990600090a1565b611b9d613f34565b600f805460ff60a81b1916600160a81b831515810291909117918290556040805160ff9290930491909116151582524260208301527f14c3df6284104b2273782186e309aea3ea6967e8c3958ea4361a709247e46dca9101611ac6565b6060610112805461095d90615a56565b60003381611c188286613554565b905083811015611c785760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016114b8565b6117a48286868403613913565b6000336109ee818585614008565b611c9b613b36565b611ca3613b7c565b806276a7001480611cb657508062ed4e00145b611cd25760405162461bcd60e51b81526004016114b890615b99565b611cda6109fa565b50611ce36117af565b3360009081526001602052604090206003810154600a03611d585760405162461bcd60e51b815260206004820152602960248201527f5374616b696e67526577617264733a2043616e6e6f742072656c6f636b206966604482015268081d5b9b1bd8dad95960ba1b60648201526084016114b8565b6000816004015490508060096000828254611d739190615abc565b90915550508154611dc65760405162461bcd60e51b815260206004820152601e60248201527f5374616b696e67526577617264733a204e6f207374616b6520666f756e64000060448201526064016114b8565b42611dd8836003015460506064613a39565b8360020154611de79190615acf565b1115611e435760405162461bcd60e51b815260206004820152602560248201527f5374616b696e67526577617264733a204c6f636b2074696d65206e6f742065786044820152641c1a5c995960da1b60648201526084016114b8565b60008060008085600601549050868660030154146125bd578662ed4e0003612215573360009081526001602081905260408220600801805491929091611e8a908490615acf565b909155505033600090815260016020819052604082206007810154600890910154600d54919390929091611ec091849190613a39565b611ece84600c546001613a39565b611ee090670de0b6b3a7640000615acf565b611eea9190615acf565b8954909150611f028183670de0b6b3a7640000613a39565b611f0c9190615abc565b96506000611f298a60000154600b54670de0b6b3a7640000613a39565b33600090815260016020526040902060060154909150611f499089615acf565b611f539082615acf565b9050896001015481611f659190615abc565b3360009081526001602081905260408220600381018f90554260028201559081018490556004018a9055600980549299508a92909190611fa6908490615acf565b909155505033600090815260126020908152604080832080546001938490529190932090910154611fe0916001600160601b031690615abc565b96506000611fee6101105490565b82546001600160601b031981166001600160601b039182168b01821617845560118054600160801b600160e01b03198116600160801b80830485168e01909416909302928317909155919250612052916001600160801b0390811691161789613a57565b82546120689190600160601b9004600f0b615afb565b82546001600160801b0391909116600160601b02600160601b600160e01b03199091161782556120983089613a73565b600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa1580156120e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121059190615b41565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac906121389033908590600401615b28565b600060405180830381600087803b15801561215257600080fd5b505af1158015612166573d6000803e3d6000fd5b5050600f5433600081815260016020819052604091829020015490516340c10f1960e01b81526001600160a01b0390931694506340c10f1993506121ac92600401615b28565b600060405180830381600087803b1580156121c657600080fd5b505af11580156121da573d6000803e3d6000fd5b505050506121e86101105490565b898301146122095760405163fd9eaf9160e01b815260040160405180910390fd5b50505050505050612cc3565b336000908152600160208190526040822060070180549192909161223a908490615acf565b909155505033600090815260016020819052604082206007810154600890910154600d5491939092909161227091849190613a39565b61227e84600c546001613a39565b61229090670de0b6b3a7640000615acf565b61229a9190615acf565b89549091506122b28183670de0b6b3a7640000613a39565b6122bc9190615abc565b965060006122d98a60000154600a54670de0b6b3a7640000613a39565b336000908152600160205260409020600601549091506122f99089615acf565b6123039082615acf565b9050808a600101546123159190615abc565b3360009081526001602081905260408220600381018f90554260028201559081018490556004018a9055600980549299508a92909190612356908490615acf565b909155505033600090815260126020908152604080832060019283905292200154815461238c91906001600160601b0316615abc565b81549097506001600160601b03168711806123a5575086155b156123c357604051639b54028b60e01b815260040160405180910390fd5b80546001600160601b031981166001600160601b03918216899003821617825560118054600160801b600160e01b03198116600160801b80830485168c9003909416909302928317909155612426916001600160801b0391821691161788613a57565b815461243c9190600160601b9004600f0b615bda565b81546001600160801b0391909116600160601b02600160601b600160e01b0319909116178155600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa1580156124ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124cf9190615b41565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac906125029033908590600401615b28565b600060405180830381600087803b15801561251c57600080fd5b505af1158015612530573d6000803e3d6000fd5b5050600f5433600081815260016020819052604091829020015490516340c10f1960e01b81526001600160a01b0390931694506340c10f19935061257692600401615b28565b600060405180830381600087803b15801561259057600080fd5b505af11580156125a4573d6000803e3d6000fd5b505050506125b23089614383565b505050505050612cc3565b8662ed4e00036129335733600090815260016020819052604082206008018054919290916125ec908490615acf565b909155505033600090815260016020819052604082206007810154600890910154600d5491939092909161262291849190613a39565b61263084600c546001613a39565b61264290670de0b6b3a7640000615acf565b61264c9190615acf565b89549091506126648183670de0b6b3a7640000613a39565b61266e9190615abc565b9650600061268b8a60000154600b54670de0b6b3a7640000613a39565b90506126978882615acf565b336000908152600160205260409020600381018d90554260029091015590506126c08582615acf565b3360009081526001602081905260408220908101929092556004909101899055600980548a92906126f2908490615acf565b90915550503360009081526012602090815260408083208054600193849052919093209091015461272c916001600160601b031690615abc565b9650600061273a6101105490565b82546001600160601b031981166001600160601b039182168b01821617845560118054600160801b600160e01b03198116600160801b80830485168e0190941690930292831790915591925061279e916001600160801b0390811691161789613a57565b82546127b49190600160601b9004600f0b615afb565b82546001600160801b0391909116600160601b02600160601b600160e01b0319909116178255600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa158015612823573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128479190615b41565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac9061287a9033908590600401615b28565b600060405180830381600087803b15801561289457600080fd5b505af11580156128a8573d6000803e3d6000fd5b5050600f5433600081815260016020819052604091829020015490516340c10f1960e01b81526001600160a01b0390931694506340c10f1993506128ee92600401615b28565b600060405180830381600087803b15801561290857600080fd5b505af115801561291c573d6000803e3d6000fd5b5050505061292a308a613a73565b610110546121e8565b3360009081526001602081905260408220600701805491929091612958908490615acf565b909155505033600090815260016020819052604082206007810154600890910154600d5491939092909161298e91849190613a39565b61299c84600c546001613a39565b6129ae90670de0b6b3a7640000615acf565b6129b89190615acf565b89549091506129d08183670de0b6b3a7640000613a39565b6129da9190615abc565b965060006129f78a60000154600a54670de0b6b3a7640000613a39565b9050612a038882615acf565b336000908152600160205260409020600381018d9055426002909101559050612a2c8582615acf565b3360009081526001602081905260408220908101929092556004909101899055600980548a9290612a5e908490615acf565b909155505033600090815260126020908152604080832080546001938490529190932090910154612a98916001600160601b031690615abc565b96506000612aa66101105490565b82546001600160601b031981166001600160601b039182168b01821617845560118054600160801b600160e01b03198116600160801b80830485168e01909416909302928317909155919250612b0a916001600160801b0390811691161789613a57565b8254612b209190600160601b9004600f0b615afb565b82546001600160801b0391909116600160601b02600160601b600160e01b0319909116178255600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa158015612b8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bb39190615b41565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac90612be69033908590600401615b28565b600060405180830381600087803b158015612c0057600080fd5b505af1158015612c14573d6000803e3d6000fd5b5050600f5433600081815260016020819052604091829020015490516340c10f1960e01b81526001600160a01b0390931694506340c10f199350612c5a92600401615b28565b600060405180830381600087803b158015612c7457600080fd5b505af1158015612c88573d6000803e3d6000fd5b50505050612c96308a613a73565b6101105489830114612cbb5760405163fd9eaf9160e01b815260040160405180910390fd5b505050505050505b7fe2d155d9d74decc198a9a9b4f5bddb24ee0842ee745c9ce57e3573b971e50d9d3388604051612cf4929190615b28565b60405180910390a150505050505061161e6001601455565b612d14613b7c565b600f54600160a81b900460ff16612d6d5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e67526577617264733a204c6f636b73206e6f74206c696674656460448201526064016114b8565b612d756117af565b3360009081526001602052604090206006015415612d9557612d956144b7565b336000908152600160205260409020541561317f5733600090815260016020818152604080842060129092529283902081549282015460048084015460025496516370a0823160e01b815230928101929092529395929493919284916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612e23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e479190615b41565b1015612ebb5760405162461bcd60e51b815260206004820152603960248201527f5374616b696e67526577617264733a205472616e7366657220616d6f756e742060448201527f6578636565647320636f6e74726163742062616c616e63652e0000000000000060648201526084016114b8565b3360009081526001602081905260408220828155908101829055600281018290556003810182905560048101829055600780820183905560089091018290558054859290612f0a908490615abc565b925050819055508060096000828254612f239190615abc565b909155505083546001600160601b031680612f5157604051639b54028b60e01b815260040160405180910390fd5b84546001600160601b031981166001600160601b03918216839003821617865560118054600160801b600160e01b03198116600160801b8083048516869003909416909302928317909155612fb4916001600160801b0391821691161782613a57565b8554612fca9190600160601b9004600f0b615bda565b85546001600160801b0391909116600160601b02600160601b600160e01b0319909116178555612ffa3084614383565b600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa158015613043573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130679190615b41565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac9061309a9033908590600401615b28565b600060405180830381600087803b1580156130b457600080fd5b505af11580156130c8573d6000803e3d6000fd5b505060025460405163a9059cbb60e01b81526001600160a01b03909116925063a9059cbb91506130fe9033908990600401615b28565b6020604051808303816000875af115801561311d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131419190615b5a565b5060405185815233907fce00afe876f254314a01ee2aa97291e9ab04ae26503790c1201f2f3856ccf4509060200160405180910390a2505050505050505b6119a46001601455565b6011546000906109f4906131ae90600160e01b900463ffffffff164203846001613a39565b601154655af3107a400090600160801b90046001600160601b0316613a39565b6131d6613f34565b6001600160a01b03811661323c5760405162461bcd60e51b815260206004820152602760248201527f5374616b696e67526577617264733a20496e76616c696420526f7574657220436044820152661bdb9d1c9858dd60ca1b60648201526084016114b8565b600e80546001600160a01b0319166001600160a01b0383169081179091556040519081527fe101485f5fbb64a12336091ab3a4684b5409d8006eb3b943154baa120d0c920e90602001611ac6565b613292613b36565b61329a613b7c565b816000036132f65760405162461bcd60e51b8152602060048201526024808201527f5374616b696e67526577617264733a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b60648201526084016114b8565b80600a14806133075750806276a700145b8061331457508062ed4e00145b6133305760405162461bcd60e51b81526004016114b890615b99565b336000908152600160205260408120600381015460029091015490916064613359846050615c07565b6133639190615b77565b61336d9083615acf565b905082156133ea578284146133ea5760405162461bcd60e51b815260206004820152603960248201527f5374616b696e67526577617264733a2043616e6e6f7420616464207374616b6560448201527f207769746820646966666572656e74206c6f636b2074696d650000000000000060648201526084016114b8565b82600a141580156133fa57508215155b1561345d5780421061345d5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e67526577617264733a205374616b696e6720706572696f6420656044820152651e1c1a5c995960d21b60648201526084016114b8565b613467858561483b565b5050506134746001601455565b5050565b600e546001600160a01b031633146134d25760405162461bcd60e51b815260206004820152601c60248201527f5374616b696e67526577617264733a20556e617574686f72697a65640000000060448201526064016114b8565b6134da6117af565b600581905542600681905561350e906011805463ffffffff909216600160e01b026001600160e01b03909216919091179055565b600061351982611621565b905061352481601055565b6040518281527f69288b878ff828dfd4ecfc8b963e6321896643806d373ee3d3d23605b0aa222d9060200161177f565b6001600160a01b03918216600090815261010f6020908152604080832093909416825291909152205490565b613588613f34565b613590614d1b565b6040517fa75958c26fdcd449db08b7c754dcddd7a15b023665ee9dbd2ef62d8e1befaa4a90600090a1565b6135c3613f34565b60dc80546001600160a01b0383166001600160a01b031990911681179091556135f460aa546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b601354610100900460ff161580801561364c5750601354600160ff909116105b806136665750303b158015613666575060135460ff166001145b6136c95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016114b8565b6013805460ff1916600117905580156136ec576013805461ff0019166101001790555b6136f4614d54565b6136fc614d7b565b613704614daa565b61370c614dd9565b6137586040518060400160405280600c81526020016b5374616b696e67204c4f444560a01b8152506040518060400160405280600681526020016573744c4f444560d01b815250614e08565b600280546001600160a01b03199081166001600160a01b0388811691909117909255600380548216878416179055600480548216868416179055600e805490911691841691909117905567136dcc951d8c0000600a55671bc16d674ec80000600b5566b1a2bc2ec50000600c5567016345785d8a0000600d55601180546001600160e01b0316600160e01b4263ffffffff16021790558015613834576013805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b613843613b7c565b33600090815260016020526040902054811180159061386157508015155b61387d5760405162461bcd60e51b81526004016114b890615c1e565b336000908152600160205260409020600381015460029091015442916138a291615acf565b11156139005760405162461bcd60e51b815260206004820152602760248201527f5374616b696e67526577617264733a20546f6b656e7320617265207374696c6c604482015266081b1bd8dad95960ca1b60648201526084016114b8565b61390981614e39565b61161e6001601455565b6001600160a01b0383166139755760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016114b8565b6001600160a01b0382166139d65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016114b8565b6001600160a01b03838116600081815261010f602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6000826000190484118302158202613a5057600080fd5b5091020490565b6000611631826001600160601b031684655af3107a4000613a39565b6001600160a01b038216613ac95760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016114b8565b806101106000828254613adc9190615acf565b90915550506001600160a01b038216600081815261010e60209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b60785460ff16156119a45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016114b8565b600260145403613bce5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016114b8565b6002601455565b600480546040516323b872dd60e01b81523392810192909252306024830152604482018390526001600160a01b0316906323b872dd906064016020604051808303816000875af1158015613c2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c519190615b5a565b613c9d5760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e67526577617264733a205472616e73666572206661696c65640060448201526064016114b8565b3360009081526001602081905260408220600501805491929091613cc2908490615acf565b9091555050336000818152602081815260408083208151608081018352868152808401878152428285019081526060830187815284546001818101875595895287892094516004909102909401938455915183850155516002830155516003909101559383529290529081206006018054839290613d41908490615acf565b90915550503360009081526001602081905260408220018054839290613d68908490615acf565b925050819055508060086000828254613d819190615acf565b925050819055508060076000828254613d9a9190615acf565b909155505033600090815260126020526040812090613db96101105490565b9050613dc36117af565b81546001600160601b031981166001600160601b039182168501821617835560118054600160801b600160e01b03198116600160801b80830485168801909416909302928317909155613e24916001600160801b0391821691161784613a57565b8254613e3a9190600160601b9004600f0b615afb565b82546001600160801b0391909116600160601b02600160601b600160e01b0319909116178255613e6a3084613a73565b6101105483820114613e8f5760405163fd9eaf9160e01b815260040160405180910390fd5b600f546040516340c10f1960e01b81526001600160a01b03909116906340c10f1990613ec19033908790600401615b28565b600060405180830381600087803b158015613edb57600080fd5b505af1158015613eef573d6000803e3d6000fd5b50506040518581523392507fca064170e0c7d063fe46ac8b9c372f80f81820b4f4ae7df4727e1c72f39b0110915060200160405180910390a2505050565b6001601455565b60aa546001600160a01b031633146119a45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016114b8565b6000613f9a8484613554565b905060001981146140025781811015613ff55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016114b8565b6140028484848403613913565b50505050565b6001600160a01b03831661406c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016114b8565b6001600160a01b0382166140ce5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016114b8565b6001600160a01b038316600090815261010e6020526040902054818110156141475760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016114b8565b6001600160a01b03808516600081815261010e602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906141a89086815260200190565b60405180910390a3614002565b60008084600f0b12156141e6576141cb84615c64565b6141d58484613a57565b6141df9190615c8a565b9050611631565b83600f0b6141f48484613a57565b600f0b121561420557506000611631565b836142108484613a57565b6141df9190615cb1565b60006142246117af565b600061422e6109fa565b3360009081526012602052604081208054601154939450909261426e91600160601b8104600f0b916001600160801b0316906001600160601b03166141b5565b60115483546001600160801b03928316935061429692909116906001600160601b0316613a57565b82546001600160801b0391909116600160601b02600160601b600160e01b03199091161782556003546142d3906001600160a01b03163383615453565b60405181815233907ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe9060200160405180910390a2509092915050565b60dc80546001600160a01b031916905561161e816154a9565b614331613b36565b6078805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586143663390565b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382166143e35760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016114b8565b6001600160a01b038216600090815261010e6020526040902054818110156144585760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016114b8565b6001600160a01b038316600081815261010e60209081526040808320868603905561011080548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101613a2c565b505050565b600f54600160a81b900460ff166145295760405162461bcd60e51b815260206004820152603060248201527f5374616b696e67526577617264733a2065734c4f44452057697468647261776160448201526f1b1cc8139bdd0814195c9b5a5d1d195960821b60648201526084016114b8565b33600090815260016020526040812060068101546007805492939192839290614553908490615abc565b92505081905550806008600082825461456c9190615abc565b909155505033600090815260016020819052604082206006810183905501805483929061459a908490615abc565b9091555050600480546040516370a0823160e01b8152309281019290925282916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156145ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146109190615b41565b10156146955760405162461bcd60e51b815260206004820152604860248201527f5374616b696e67526577617264733a20576974686472617745734c4f44453a2060448201527f576974686472617720616d6f756e74206578636565647320636f6e74726163746064820152672062616c616e636560c01b608482015260a4016114b8565b33600090815260126020526040902080548291906001600160601b03168211806146bd575081155b156146db57604051639b54028b60e01b815260040160405180910390fd5b80546001600160601b031981166001600160601b03918216849003821617825560118054600160801b600160e01b03198116600160801b808304851687900390941690930292831790915561473e916001600160801b0391821691161783613a57565b81546147549190600160601b9004600f0b615bda565b81546001600160801b0391909116600160601b02600160601b600160e01b03199091161781556147843084614383565b600f54604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac906147b69033908790600401615b28565b600060405180830381600087803b1580156147d057600080fd5b505af11580156147e4573d6000803e3d6000fd5b505060045461480092506001600160a01b031690503385615453565b60405183815233907fb012517faa2041f69b1a9ab96e1af671dcdec36f162b88d95ad8da58e4ca6fa89060200160405180910390a250505050565b6002546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015614892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906148b69190615b5a565b6149025760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e67526577617264733a205472616e73666572206661696c65640060448201526064016114b8565b3360009081526001602052604081206007810154600890910154849291829182918291600a88900361494557336000908152600160205260409020426002909101555b876276a70003614a1c5761496489600a54670de0b6b3a7640000613a39565b965061497b82600c54670de0b6b3a7640000613a39565b945061499281600d54670de0b6b3a7640000613a39565b93506149b0896149a28688615acf565b670de0b6b3a7640000613a39565b92506149c583670de0b6b3a764000080613a39565b95506149d18688615acf565b336000908152600160205260408120600401805492995088929091906149f8908490615acf565b925050819055508560096000828254614a119190615acf565b90915550614ae09050565b8762ed4e0003614ae057614a3b89600b54670de0b6b3a7640000613a39565b9650614a5282600c54670de0b6b3a7640000613a39565b9450614a6981600d54670de0b6b3a7640000613a39565b9350614a79896149a28688615acf565b9250614a8e83670de0b6b3a764000080613a39565b9550614a9a8688615acf565b33600090815260016020526040812060040180549299508892909190614ac1908490615acf565b925050819055508560096000828254614ada9190615acf565b90915550505b336000908152600160205260408120549003614b12573360009081526001602052604090204260028201556003018890555b33600090815260016020526040812080548b9290614b31908490615acf565b90915550503360009081526001602081905260408220018054899290614b58908490615acf565b925050819055508860076000828254614b719190615acf565b909155505033600090815260126020526040812090614b906101105490565b9050614b9a6117af565b81546001600160601b031981166001600160601b039182168b01821617835560118054600160801b600160e01b03198116600160801b80830485168e01909416909302928317909155614bfb916001600160801b039182169116178a613a57565b8254614c119190600160601b9004600f0b615afb565b82546001600160801b0391909116600160601b02600160601b600160e01b0319909116178255614c41308a613a73565b6101105489820114614c665760405163fd9eaf9160e01b815260040160405180910390fd5b89600a14614cd357600f546040516340c10f1960e01b81526001600160a01b03909116906340c10f1990614ca09033908d90600401615b28565b600060405180830381600087803b158015614cba57600080fd5b505af1158015614cce573d6000803e3d6000fd5b505050505b604080518c8152602081018c905233917fe6e1319b9f186d813a7881721807ad8ddc52846c1b781e04d9169309b6ae4b6b910160405180910390a25050505050505050505050565b614d236154fb565b6078805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33614366565b601354610100900460ff166119a45760405162461bcd60e51b81526004016114b890615cd1565b601354610100900460ff16614da25760405162461bcd60e51b81526004016114b890615cd1565b6119a4615544565b601354610100900460ff16614dd15760405162461bcd60e51b81526004016114b890615cd1565b6119a4615574565b601354610100900460ff16614e005760405162461bcd60e51b81526004016114b890615cd1565b6119a46155a7565b601354610100900460ff16614e2f5760405162461bcd60e51b81526004016114b890615cd1565b61347482826155ce565b614e416117af565b6000614e4b61421a565b90506000614e598284615acf565b336000908152600160208190526040822080549181018054600483015460068401546003909401549697509395909491849083614e968389615abc565b925050819055508360096000828254614eaf9190615abc565b90915550508686148015614ec1575082155b15614f055733600090815260016020819052604082206003810183905560028101839055908101829055600781018290556008810182905560040155849150614f88565b6000614f118888615abc565b90506000614f1f8583615acf565b9050614f2b8188615abc565b935086841115614f4d5760405162461bcd60e51b81526004016114b890615c1e565b336000908152600160208190526040822090810192909255600a60038301554260028301556007820181905560088201819055600490910155505b3360009081526001602052604081208054899290614fa7908490615abc565b925050819055508660076000828254614fc09190615abc565b909155505033600090815260126020526040812080549091906001600160601b031684118015615000575033600090815260016020526040902060060154155b15615016575080546001600160601b0316615077565b81546001600160601b03168411801561504057503360009081526001602052604090206006015415155b156150745733600090815260016020526040902060060154825461506d91906001600160601b0316615abc565b9050615077565b50825b81546001600160601b031681118061508d575080155b156150ab57604051639b54028b60e01b815260040160405180910390fd5b81546001600160601b031981166001600160601b03918216839003821617835560118054600160801b600160e01b03198116600160801b808304851686900390941690930292831790915561510e916001600160801b0391821691161782613a57565b82546151249190600160601b9004600f0b615bda565b82546001600160801b0391909116600160601b02600160601b600160e01b03199091161782556151543082614383565b600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa15801561519d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906151c19190615b41565b905083158015906151d157508015155b806151e7575083600a141580156151e757508015155b1561539a57336000908152600160205260409020600601541580159061520c57508015155b1561531157336000908152600160205260409020600601548111156152b357336000908152600160205260408120600601546152489083615abc565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac9061527b9033908590600401615b28565b600060405180830381600087803b15801561529557600080fd5b505af11580156152a9573d6000803e3d6000fd5b505050505061539a565b336000908152600160205260408120600601546152d1908390615abc565b9050801561530b57600f546040516340c10f1960e01b81526001600160a01b03909116906340c10f199061527b9033908590600401615b28565b5061539a565b3360009081526001602052604090206006015415801561533057508015155b1561539a57600f54604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac906153679033908590600401615b28565b600060405180830381600087803b15801561538157600080fd5b505af1158015615395573d6000803e3d6000fd5b505050505b60025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906153cc9033908e90600401615b28565b6020604051808303816000875af11580156153eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061540f9190615b5a565b506040518a815233907fce00afe876f254314a01ee2aa97291e9ab04ae26503790c1201f2f3856ccf4509060200160405180910390a2505050505050505050505050565b6144b28363a9059cbb60e01b8484604051602401615472929190615b28565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152615610565b60aa80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60785460ff166119a45760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016114b8565b601354610100900460ff1661556b5760405162461bcd60e51b81526004016114b890615cd1565b6119a433614310565b601354610100900460ff1661559b5760405162461bcd60e51b81526004016114b890615cd1565b6078805460ff19169055565b601354610100900460ff16613f2d5760405162461bcd60e51b81526004016114b890615cd1565b601354610100900460ff166155f55760405162461bcd60e51b81526004016114b890615cd1565b6101116156028382615d80565b506101126144b28282615d80565b6000615665826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166156e59092919063ffffffff16565b90508051600014806156865750808060200190518101906156869190615b5a565b6144b25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016114b8565b60606156f484846000856156fc565b949350505050565b60608247101561575d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016114b8565b600080866001600160a01b031685876040516157799190615e40565b60006040518083038185875af1925050503d80600081146157b6576040519150601f19603f3d011682016040523d82523d6000602084013e6157bb565b606091505b50915091506157cc878383876157d7565b979650505050505050565b6060831561584657825160000361583f576001600160a01b0385163b61583f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016114b8565b50816156f4565b6156f4838381511561585b5781518083602001fd5b8060405162461bcd60e51b81526004016114b89190615899565b60005b83811015615890578181015183820152602001615878565b50506000910152565b60208152600082518060208401526158b8816040850160208701615875565b601f01601f19169190910160400192915050565b80356001600160a01b03811681146158e357600080fd5b919050565b600080604083850312156158fb57600080fd5b615904836158cc565b946020939093013593505050565b60006020828403121561592457600080fd5b5035919050565b60006020828403121561593d57600080fd5b611631826158cc565b60008060006060848603121561595b57600080fd5b615964846158cc565b9250615972602085016158cc565b9150604084013590509250925092565b801515811461161e57600080fd5b6000602082840312156159a257600080fd5b813561163181615982565b600080604083850312156159c057600080fd5b50508035926020909101359150565b600080604083850312156159e257600080fd5b6159eb836158cc565b91506159f9602084016158cc565b90509250929050565b60008060008060808587031215615a1857600080fd5b615a21856158cc565b9350615a2f602086016158cc565b9250615a3d604086016158cc565b9150615a4b606086016158cc565b905092959194509250565b600181811c90821680615a6a57607f821691505b602082108103615a8a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b818103818111156109f4576109f4615aa6565b808201808211156109f4576109f4615aa6565b600060018201615af457615af4615aa6565b5060010190565b600f81810b9083900b0160016001607f1b03811360016001607f1b0319821217156109f4576109f4615aa6565b6001600160a01b03929092168252602082015260400190565b600060208284031215615b5357600080fd5b5051919050565b600060208284031215615b6c57600080fd5b815161163181615982565b600082615b9457634e487b7160e01b600052601260045260246000fd5b500490565b60208082526021908201527f5374616b696e67526577617264733a20496e76616c6964206c6f636b2074696d6040820152606560f81b606082015260800190565b600f82810b9082900b0360016001607f1b0319811260016001607f1b03821317156109f4576109f4615aa6565b80820281158282048414176109f4576109f4615aa6565b60208082526026908201527f5374616b696e67526577617264733a20496e76616c696420756e7374616b6520604082015265185b5bdd5b9d60d21b606082015260800190565b600081600f0b60016001607f1b03198103615c8157615c81615aa6565b60000392915050565b6001600160801b03818116838216019080821115615caa57615caa615aa6565b5092915050565b6001600160801b03828116828216039080821115615caa57615caa615aa6565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b601f8211156144b257600081815260208120601f850160051c81016020861015615d595750805b601f850160051c820191505b81811015615d7857828155600101615d65565b505050505050565b815167ffffffffffffffff811115615d9a57615d9a615d1c565b615dae81615da88454615a56565b84615d32565b602080601f831160018114615de35760008415615dcb5750858301515b600019600386901b1c1916600185901b178555615d78565b600085815260208120601f198616915b82811015615e1257888601518255948401946001909101908401615df3565b5085821015615e305787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251615e52818460208701615875565b919091019291505056fea26469706673582212200b4a54eaeb76da741acca93983dd649c766056d405d1ddee36c6ccc86d54cda464736f6c63430008120033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103c55760003560e01c80638b4aaa53116101ff578063cc79540c1161011a578063ec342ad0116100ad578063f70c1ad81161007c578063f70c1ad81461090b578063f711c7eb1461091e578063f8c8765e14610927578063fcc92fdf1461093a57600080fd5b8063ec342ad0146108d8578063ec9e7bba146108e7578063ee8be1e0146108ef578063f2fde38b146108f857600080fd5b8063d346243d116100e9578063d346243d14610898578063dd62ed3e146108ab578063e30c3978146108be578063e779c72f146108cf57600080fd5b8063cc79540c1461084b578063cdd8d69c1461085f578063d1627a1514610872578063d18b63251461088557600080fd5b8063a11d138a11610192578063ac8ad8ba11610161578063ac8ad8ba14610814578063ad5c46481461081c578063c05ffb981461082f578063c1fc006a1461083857600080fd5b8063a11d138a146107d2578063a457c2d7146107db578063a9059cbb146107ee578063a98d38f01461080157600080fd5b80639168ae72116101ce5780639168ae721461071857806395d89b41146107b857806398e28c3e146107c0578063a1135db7146107c957600080fd5b80638b4aaa53146106d35780638be4fb4c146106e05780638da5cb5b146106f35780638e3f174e1461070457600080fd5b8063372500ab116102ef578063640a9cee1161028257806379ba50971161025157806379ba50971461068e5780637bff973514610696578063817b1cd2146106c25780638705a427146106cb57600080fd5b8063640a9cee1461062857806370a0823114610653578063715018a61461067d578063773f91bb1461068557600080fd5b80634f72d846116102be5780634f72d846146105cb57806350b6f4d1146105de578063598972b31461060a5780635c975abb1461061d57600080fd5b8063372500ab1461055057806337958454146105585780633885c6721461058557806339509351146105b857600080fd5b806318160ddd1161036757806323b872dd1161033657806323b872dd146105135780632a41006814610526578063313ce5671461052e57806331d7a2621461053d57600080fd5b806318160ddd146104985780631959a002146104a15780631d5ce4e7146104f85780632247e2d11461050b57600080fd5b8063095ea7b3116103a3578063095ea7b3146104415780630a476966146104645780630c4580db1461047a57806314bcec9f1461048f57600080fd5b806303314efa146103ca578063048174531461040157806306fdde031461042c575b600080fd5b6011546103e490600160801b90046001600160601b031681565b6040516001600160601b0390911681526020015b60405180910390f35b600254610414906001600160a01b031681565b6040516001600160a01b0390911681526020016103f8565b61043461094d565b6040516103f89190615899565b61045461044f3660046158e8565b6109e0565b60405190151581526020016103f8565b61046c6109fa565b6040519081526020016103f8565b61048d610488366004615912565b6113e1565b005b61046c60065481565b6101105461046c565b6104d66104af36600461592b565b6012602052600090815260409020546001600160601b03811690600160601b9004600f0b82565b604080516001600160601b039093168352600f9190910b6020830152016103f8565b61046c610506366004615912565b611621565b61048d611638565b610454610521366004615946565b61178b565b61048d6117af565b604051601281526020016103f8565b61046c61054b36600461592b565b61184a565b61048d61190d565b61046c61056636600461592b565b6001600160a01b03166000908152600160208190526040909120015490565b6105986105933660046158e8565b6119a6565b6040805194855260208501939093529183015260608201526080016103f8565b6104546105c63660046158e8565b6119ec565b600e54610414906001600160a01b031681565b6011546105f590600160e01b900463ffffffff1681565b60405163ffffffff90911681526020016103f8565b61048d61061836600461592b565b611a0e565b60785460ff16610454565b60115461063b906001600160801b031681565b6040516001600160801b0390911681526020016103f8565b61046c61066136600461592b565b6001600160a01b0316600090815261010e602052604090205490565b61048d611ad1565b61046c600d5481565b61048d611ae3565b61046c6106a436600461592b565b6001600160a01b031660009081526001602052604090206003015490565b61046c60075481565b61048d611b5a565b61046c655af3107a400081565b61048d6106ee366004615990565b611b95565b60aa546001600160a01b0316610414565b600f5461045490600160a81b900460ff1681565b61077461072636600461592b565b60016020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154908060050154908060060154908060070154908060080154905089565b60408051998a5260208a0198909852968801959095526060870193909352608086019190915260a085015260c084015260e0830152610100820152610120016103f8565b610434611bfa565b61046c600c5481565b61046c60105481565b61046c600b5481565b6104546107e93660046158e8565b611c0a565b6104546107fc3660046158e8565b611c85565b61048d61080f366004615912565b611c93565b61048d612d0c565b600354610414906001600160a01b031681565b61046c60085481565b600f54610414906001600160a01b031681565b600f5461045490600160a01b900460ff1681565b61063b61086d366004615912565b613189565b61048d61088036600461592b565b6131ce565b61048d6108933660046159ad565b61328a565b61048d6108a6366004615912565b613478565b61046c6108b93660046159cf565b613554565b60dc546001600160a01b0316610414565b61046c600a5481565b61046c670de0b6b3a764000081565b61048d613580565b61046c60055481565b61048d61090636600461592b565b6135bb565b600454610414906001600160a01b031681565b61046c60095481565b61048d610935366004615a02565b61362c565b61048d610948366004615912565b61383b565b6060610111805461095d90615a56565b80601f016020809104026020016040519081016040528092919081815260200182805461098990615a56565b80156109d65780601f106109ab576101008083540402835291602001916109d6565b820191906000526020600020905b8154815290600101906020018083116109b957829003601f168201915b5050505050905090565b6000336109ee818585613913565b60019150505b92915050565b336000908152600160205260408120600601548103610a195750600090565b3360009081526001602090815260408083206003810154600782015460089092015485855283862080548551818802810188019096528086529296939591946301e13380949384938493849384938493919291849084015b82821015610acb578382906000526020600020906004020160405180608001604052908160008201548152602001600182015481526020016002820154815260200160038201548152505081526020019060010190610a71565b50505050905060005b8151811015610efe576000828281518110610af157610af1615a90565b60200260200101516040015142610b089190615abc565b90506000838381518110610b1e57610b1e615a90565b6020026020010151606001519050898210610ce857838381518110610b4557610b45615a90565b60200260200101516020015196508689610b5f9190615acf565b3360009081526020819052604090208054919a50889185908110610b8557610b85615a90565b90600052602060002090600402016003016000828254610ba59190615acf565b9091555050336000908152602081905260408120805485908110610bcb57610bcb615a90565b9060005260206000209060040201600101819055508c6276a70003610c6657610bff8b600d54670de0b6b3a7640000613a39565b610c148d600c54670de0b6b3a7640000613a39565b670de0b6b3a7640000600a54610c2a9190615abc565b610c349190615acf565b610c3e9190615acf565b9550610c538787670de0b6b3a7640000613a39565b9450610c5f8589615acf565b9750610ee9565b8c62ed4e0003610ce357610c858b600d54670de0b6b3a7640000613a39565b610c9a8d600c54670de0b6b3a7640000613a39565b670de0b6b3a7640000600b54610cb09190615abc565b610cba9190615acf565b610cc49190615acf565b9550610cd98787670de0b6b3a7640000613a39565b610c5f9089615acf565b610ee9565b89821015610ee9576000610d0583670de0b6b3a76400008d613a39565b905081610d38868681518110610d1d57610d1d615a90565b60200260200101516000015183670de0b6b3a7640000613a39565b610d429190615abc565b9750610d4e888b615acf565b3360009081526020819052604090208054919b50899186908110610d7457610d74615a90565b90600052602060002090600402016003016000828254610d949190615acf565b9091555050336000908152602081905260409020805489919086908110610dbd57610dbd615a90565b90600052602060002090600402016001016000828254610ddd9190615abc565b90915550506276a7008e9003610e6757610e028c600d54670de0b6b3a7640000613a39565b610e178e600c54670de0b6b3a7640000613a39565b670de0b6b3a7640000600a54610e2d9190615abc565b610e379190615acf565b610e419190615acf565b9650610e568888670de0b6b3a7640000613a39565b610e60908a615acf565b9850610ee7565b8d62ed4e0003610ee757610e868c600d54670de0b6b3a7640000613a39565b610e9b8e600c54670de0b6b3a7640000613a39565b670de0b6b3a7640000600b54610eb19190615abc565b610ebb9190615acf565b610ec59190615acf565b9650610eda8888670de0b6b3a7640000613a39565b610ee4908a615acf565b98505b505b50508080610ef690615ae2565b915050610ad4565b5033600090815260016020526040902054158015610f2c575033600090815260016020526040902060030154155b15610f4f57336000908152600160205260409020600a6003820155426002909101555b3360009081526001602052604081208054889290610f6e908490615acf565b90915550503360009081526001602052604081206006018054889290610f95908490615abc565b925050819055508560086000828254610fae9190615abc565b909155505084156110d3573360009081526001602081905260408220018054879290610fdb908490615acf565b909155505033600090815260126020526040812090610ffa6101105490565b90506110046117af565b81546001600160601b031981166001600160601b039182168901821617835560118054600160801b600160e01b03198116600160801b80830485168c01909416909302928317909155611065916001600160801b0391821691161788613a57565b825461107b9190600160601b9004600f0b615afb565b82546001600160801b0391909116600160601b02600160601b600160e01b03199091161782556110ab3088613a73565b61011054878201146110d05760405163fd9eaf9160e01b815260040160405180910390fd5b50505b33600090815260016020526040902060030154600a1480611104575033600090815260016020526040902060030154155b1561117257600f54604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac9061113b9033908890600401615b28565b600060405180830381600087803b15801561115557600080fd5b505af1158015611169573d6000803e3d6000fd5b50505050611327565b600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa1580156111bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111df9190615b41565b3360009081526001602081905260409091200154909150811015611286573360009081526001602081905260408220015461121b908390615abc565b600f546040516340c10f1960e01b81529192506001600160a01b0316906340c10f199061124e9033908590600401615b28565b600060405180830381600087803b15801561126857600080fd5b505af115801561127c573d6000803e3d6000fd5b5050505050611325565b336000908152600160208190526040909120015481111561132557336000908152600160208190526040822001546112be9083615abc565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac906112f19033908590600401615b28565b600060405180830381600087803b15801561130b57600080fd5b505af115801561131f573d6000803e3d6000fd5b50505050505b505b6004805460405163a9059cbb60e01b81526001600160a01b039091169163a9059cbb91611359916000918b9101615b28565b6020604051808303816000875af1158015611378573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139c9190615b5a565b5060405184815233907fe1375507ddaa0f1744e5bfd94ab5275f8e13165c1018644571b16120c71f12b39060200160405180910390a250919998505050505050505050565b6113e9613b36565b6113f1613b7c565b600480546040516370a0823160e01b8152339281019290925282916001600160a01b03909116906370a0823190602401602060405180830381865afa15801561143e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114629190615b41565b10156114c15760405162461bcd60e51b8152602060048201526024808201527f5374616b696e67526577617264733a20496e73756666696369656e742062616c604482015263616e636560e01b60648201526084015b60405180910390fd5b600081116115115760405162461bcd60e51b815260206004820152601e60248201527f5374616b696e67526577617264733a20496e76616c696420616d6f756e74000060448201526064016114b8565b3360009081526020818152604080832080548251818502810185019093528083529192909190849084015b8282101561159657838290600052602060002090600402016040518060800160405290816000820154815260200160018201548152602001600282015481526020016003820154815250508152602001906001019061153c565b505050509050600a8151111561160a5760405162461bcd60e51b815260206004820152603360248201527f5374616b696e67526577617264733a204d6178204e756d626572206f662065736044820152721313d1114814dd185ad95cc81c995858da1959606a1b60648201526084016114b8565b61161382613bd5565b5061161e6001601455565b50565b600062093a806116318184615b77565b9392505050565b611640613f34565b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad9190615b41565b905060006008546007546116c19190615abc565b6116cb9083615abc565b6002549091506001600160a01b031663a9059cbb6116f160aa546001600160a01b031690565b836040518363ffffffff1660e01b815260040161170f929190615b28565b6020604051808303816000875af115801561172e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117529190615b5a565b506040518181527fcbba13897c2ac3f7fdb11e857b1a5a5c47f51e3fbeffa74d430f2b06177b45c0906020015b60405180910390a15050565b600033611799858285613f8e565b6117a4858585614008565b506001949350505050565b601154600160e01b900463ffffffff1642116117c757565b601154600160801b90046001600160601b031660000361180057601180546001600160e01b0316600160e01b4263ffffffff1602179055565b61180b601054613189565b601180546001600160801b03808216939093019092166bffffffffffffffffffffffff60801b90921691909117600160e01b4263ffffffff1602179055565b6011546000906001600160801b03811690600160e01b900463ffffffff16421180156118875750601154600160801b90046001600160601b031615155b156118ad57611897601054613189565b6118aa906001600160801b031682615acf565b90505b6001600160a01b0383166000908152601260209081526040918290208251808401909352546001600160601b038116808452600160601b909104600f0b9183018290526118fc919084906141b5565b6001600160801b0316949350505050565b611915613b7c565b336000908152600160205260409020805460069091015481158015611938575080155b1561198f5760405162461bcd60e51b815260206004820152602160248201527f5374616b696e67526577617264733a204e6f207374616b65642062616c616e636044820152606560f81b60648201526084016114b8565b61199761421a565b5050506119a46001601455565b565b600060205281600052604060002081815481106119c257600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919450925084565b6000336109ee8185856119ff8383613554565b611a099190615acf565b613913565b611a16613f34565b6001600160a01b038116611a7c5760405162461bcd60e51b815260206004820152602760248201527f5374616b696e67526577617264733a20496e76616c696420566f74696e6720436044820152661bdb9d1c9858dd60ca1b60648201526084016114b8565b600f80546001600160a01b0319166001600160a01b0383169081179091556040519081527f264f54b893dc3babe9fb9ac8e7abcc6c1397da0903359d5fed6245242ab3ef0b906020015b60405180910390a150565b611ad9613f34565b6119a46000614310565b60dc5433906001600160a01b03168114611b515760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084016114b8565b61161e81614310565b611b62613f34565b611b6a614329565b6040517f26d1807b479eaba249c1214b82e4b65bbb0cc73ee8a17901324b1ef1b5904e4990600090a1565b611b9d613f34565b600f805460ff60a81b1916600160a81b831515810291909117918290556040805160ff9290930491909116151582524260208301527f14c3df6284104b2273782186e309aea3ea6967e8c3958ea4361a709247e46dca9101611ac6565b6060610112805461095d90615a56565b60003381611c188286613554565b905083811015611c785760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016114b8565b6117a48286868403613913565b6000336109ee818585614008565b611c9b613b36565b611ca3613b7c565b806276a7001480611cb657508062ed4e00145b611cd25760405162461bcd60e51b81526004016114b890615b99565b611cda6109fa565b50611ce36117af565b3360009081526001602052604090206003810154600a03611d585760405162461bcd60e51b815260206004820152602960248201527f5374616b696e67526577617264733a2043616e6e6f742072656c6f636b206966604482015268081d5b9b1bd8dad95960ba1b60648201526084016114b8565b6000816004015490508060096000828254611d739190615abc565b90915550508154611dc65760405162461bcd60e51b815260206004820152601e60248201527f5374616b696e67526577617264733a204e6f207374616b6520666f756e64000060448201526064016114b8565b42611dd8836003015460506064613a39565b8360020154611de79190615acf565b1115611e435760405162461bcd60e51b815260206004820152602560248201527f5374616b696e67526577617264733a204c6f636b2074696d65206e6f742065786044820152641c1a5c995960da1b60648201526084016114b8565b60008060008085600601549050868660030154146125bd578662ed4e0003612215573360009081526001602081905260408220600801805491929091611e8a908490615acf565b909155505033600090815260016020819052604082206007810154600890910154600d54919390929091611ec091849190613a39565b611ece84600c546001613a39565b611ee090670de0b6b3a7640000615acf565b611eea9190615acf565b8954909150611f028183670de0b6b3a7640000613a39565b611f0c9190615abc565b96506000611f298a60000154600b54670de0b6b3a7640000613a39565b33600090815260016020526040902060060154909150611f499089615acf565b611f539082615acf565b9050896001015481611f659190615abc565b3360009081526001602081905260408220600381018f90554260028201559081018490556004018a9055600980549299508a92909190611fa6908490615acf565b909155505033600090815260126020908152604080832080546001938490529190932090910154611fe0916001600160601b031690615abc565b96506000611fee6101105490565b82546001600160601b031981166001600160601b039182168b01821617845560118054600160801b600160e01b03198116600160801b80830485168e01909416909302928317909155919250612052916001600160801b0390811691161789613a57565b82546120689190600160601b9004600f0b615afb565b82546001600160801b0391909116600160601b02600160601b600160e01b03199091161782556120983089613a73565b600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa1580156120e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121059190615b41565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac906121389033908590600401615b28565b600060405180830381600087803b15801561215257600080fd5b505af1158015612166573d6000803e3d6000fd5b5050600f5433600081815260016020819052604091829020015490516340c10f1960e01b81526001600160a01b0390931694506340c10f1993506121ac92600401615b28565b600060405180830381600087803b1580156121c657600080fd5b505af11580156121da573d6000803e3d6000fd5b505050506121e86101105490565b898301146122095760405163fd9eaf9160e01b815260040160405180910390fd5b50505050505050612cc3565b336000908152600160208190526040822060070180549192909161223a908490615acf565b909155505033600090815260016020819052604082206007810154600890910154600d5491939092909161227091849190613a39565b61227e84600c546001613a39565b61229090670de0b6b3a7640000615acf565b61229a9190615acf565b89549091506122b28183670de0b6b3a7640000613a39565b6122bc9190615abc565b965060006122d98a60000154600a54670de0b6b3a7640000613a39565b336000908152600160205260409020600601549091506122f99089615acf565b6123039082615acf565b9050808a600101546123159190615abc565b3360009081526001602081905260408220600381018f90554260028201559081018490556004018a9055600980549299508a92909190612356908490615acf565b909155505033600090815260126020908152604080832060019283905292200154815461238c91906001600160601b0316615abc565b81549097506001600160601b03168711806123a5575086155b156123c357604051639b54028b60e01b815260040160405180910390fd5b80546001600160601b031981166001600160601b03918216899003821617825560118054600160801b600160e01b03198116600160801b80830485168c9003909416909302928317909155612426916001600160801b0391821691161788613a57565b815461243c9190600160601b9004600f0b615bda565b81546001600160801b0391909116600160601b02600160601b600160e01b0319909116178155600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa1580156124ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124cf9190615b41565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac906125029033908590600401615b28565b600060405180830381600087803b15801561251c57600080fd5b505af1158015612530573d6000803e3d6000fd5b5050600f5433600081815260016020819052604091829020015490516340c10f1960e01b81526001600160a01b0390931694506340c10f19935061257692600401615b28565b600060405180830381600087803b15801561259057600080fd5b505af11580156125a4573d6000803e3d6000fd5b505050506125b23089614383565b505050505050612cc3565b8662ed4e00036129335733600090815260016020819052604082206008018054919290916125ec908490615acf565b909155505033600090815260016020819052604082206007810154600890910154600d5491939092909161262291849190613a39565b61263084600c546001613a39565b61264290670de0b6b3a7640000615acf565b61264c9190615acf565b89549091506126648183670de0b6b3a7640000613a39565b61266e9190615abc565b9650600061268b8a60000154600b54670de0b6b3a7640000613a39565b90506126978882615acf565b336000908152600160205260409020600381018d90554260029091015590506126c08582615acf565b3360009081526001602081905260408220908101929092556004909101899055600980548a92906126f2908490615acf565b90915550503360009081526012602090815260408083208054600193849052919093209091015461272c916001600160601b031690615abc565b9650600061273a6101105490565b82546001600160601b031981166001600160601b039182168b01821617845560118054600160801b600160e01b03198116600160801b80830485168e0190941690930292831790915591925061279e916001600160801b0390811691161789613a57565b82546127b49190600160601b9004600f0b615afb565b82546001600160801b0391909116600160601b02600160601b600160e01b0319909116178255600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa158015612823573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128479190615b41565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac9061287a9033908590600401615b28565b600060405180830381600087803b15801561289457600080fd5b505af11580156128a8573d6000803e3d6000fd5b5050600f5433600081815260016020819052604091829020015490516340c10f1960e01b81526001600160a01b0390931694506340c10f1993506128ee92600401615b28565b600060405180830381600087803b15801561290857600080fd5b505af115801561291c573d6000803e3d6000fd5b5050505061292a308a613a73565b610110546121e8565b3360009081526001602081905260408220600701805491929091612958908490615acf565b909155505033600090815260016020819052604082206007810154600890910154600d5491939092909161298e91849190613a39565b61299c84600c546001613a39565b6129ae90670de0b6b3a7640000615acf565b6129b89190615acf565b89549091506129d08183670de0b6b3a7640000613a39565b6129da9190615abc565b965060006129f78a60000154600a54670de0b6b3a7640000613a39565b9050612a038882615acf565b336000908152600160205260409020600381018d9055426002909101559050612a2c8582615acf565b3360009081526001602081905260408220908101929092556004909101899055600980548a9290612a5e908490615acf565b909155505033600090815260126020908152604080832080546001938490529190932090910154612a98916001600160601b031690615abc565b96506000612aa66101105490565b82546001600160601b031981166001600160601b039182168b01821617845560118054600160801b600160e01b03198116600160801b80830485168e01909416909302928317909155919250612b0a916001600160801b0390811691161789613a57565b8254612b209190600160601b9004600f0b615afb565b82546001600160801b0391909116600160601b02600160601b600160e01b0319909116178255600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa158015612b8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bb39190615b41565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac90612be69033908590600401615b28565b600060405180830381600087803b158015612c0057600080fd5b505af1158015612c14573d6000803e3d6000fd5b5050600f5433600081815260016020819052604091829020015490516340c10f1960e01b81526001600160a01b0390931694506340c10f199350612c5a92600401615b28565b600060405180830381600087803b158015612c7457600080fd5b505af1158015612c88573d6000803e3d6000fd5b50505050612c96308a613a73565b6101105489830114612cbb5760405163fd9eaf9160e01b815260040160405180910390fd5b505050505050505b7fe2d155d9d74decc198a9a9b4f5bddb24ee0842ee745c9ce57e3573b971e50d9d3388604051612cf4929190615b28565b60405180910390a150505050505061161e6001601455565b612d14613b7c565b600f54600160a81b900460ff16612d6d5760405162461bcd60e51b815260206004820181905260248201527f5374616b696e67526577617264733a204c6f636b73206e6f74206c696674656460448201526064016114b8565b612d756117af565b3360009081526001602052604090206006015415612d9557612d956144b7565b336000908152600160205260409020541561317f5733600090815260016020818152604080842060129092529283902081549282015460048084015460025496516370a0823160e01b815230928101929092529395929493919284916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612e23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e479190615b41565b1015612ebb5760405162461bcd60e51b815260206004820152603960248201527f5374616b696e67526577617264733a205472616e7366657220616d6f756e742060448201527f6578636565647320636f6e74726163742062616c616e63652e0000000000000060648201526084016114b8565b3360009081526001602081905260408220828155908101829055600281018290556003810182905560048101829055600780820183905560089091018290558054859290612f0a908490615abc565b925050819055508060096000828254612f239190615abc565b909155505083546001600160601b031680612f5157604051639b54028b60e01b815260040160405180910390fd5b84546001600160601b031981166001600160601b03918216839003821617865560118054600160801b600160e01b03198116600160801b8083048516869003909416909302928317909155612fb4916001600160801b0391821691161782613a57565b8554612fca9190600160601b9004600f0b615bda565b85546001600160801b0391909116600160601b02600160601b600160e01b0319909116178555612ffa3084614383565b600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa158015613043573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130679190615b41565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac9061309a9033908590600401615b28565b600060405180830381600087803b1580156130b457600080fd5b505af11580156130c8573d6000803e3d6000fd5b505060025460405163a9059cbb60e01b81526001600160a01b03909116925063a9059cbb91506130fe9033908990600401615b28565b6020604051808303816000875af115801561311d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131419190615b5a565b5060405185815233907fce00afe876f254314a01ee2aa97291e9ab04ae26503790c1201f2f3856ccf4509060200160405180910390a2505050505050505b6119a46001601455565b6011546000906109f4906131ae90600160e01b900463ffffffff164203846001613a39565b601154655af3107a400090600160801b90046001600160601b0316613a39565b6131d6613f34565b6001600160a01b03811661323c5760405162461bcd60e51b815260206004820152602760248201527f5374616b696e67526577617264733a20496e76616c696420526f7574657220436044820152661bdb9d1c9858dd60ca1b60648201526084016114b8565b600e80546001600160a01b0319166001600160a01b0383169081179091556040519081527fe101485f5fbb64a12336091ab3a4684b5409d8006eb3b943154baa120d0c920e90602001611ac6565b613292613b36565b61329a613b7c565b816000036132f65760405162461bcd60e51b8152602060048201526024808201527f5374616b696e67526577617264733a20496e76616c6964207374616b6520616d6044820152631bdd5b9d60e21b60648201526084016114b8565b80600a14806133075750806276a700145b8061331457508062ed4e00145b6133305760405162461bcd60e51b81526004016114b890615b99565b336000908152600160205260408120600381015460029091015490916064613359846050615c07565b6133639190615b77565b61336d9083615acf565b905082156133ea578284146133ea5760405162461bcd60e51b815260206004820152603960248201527f5374616b696e67526577617264733a2043616e6e6f7420616464207374616b6560448201527f207769746820646966666572656e74206c6f636b2074696d650000000000000060648201526084016114b8565b82600a141580156133fa57508215155b1561345d5780421061345d5760405162461bcd60e51b815260206004820152602660248201527f5374616b696e67526577617264733a205374616b696e6720706572696f6420656044820152651e1c1a5c995960d21b60648201526084016114b8565b613467858561483b565b5050506134746001601455565b5050565b600e546001600160a01b031633146134d25760405162461bcd60e51b815260206004820152601c60248201527f5374616b696e67526577617264733a20556e617574686f72697a65640000000060448201526064016114b8565b6134da6117af565b600581905542600681905561350e906011805463ffffffff909216600160e01b026001600160e01b03909216919091179055565b600061351982611621565b905061352481601055565b6040518281527f69288b878ff828dfd4ecfc8b963e6321896643806d373ee3d3d23605b0aa222d9060200161177f565b6001600160a01b03918216600090815261010f6020908152604080832093909416825291909152205490565b613588613f34565b613590614d1b565b6040517fa75958c26fdcd449db08b7c754dcddd7a15b023665ee9dbd2ef62d8e1befaa4a90600090a1565b6135c3613f34565b60dc80546001600160a01b0383166001600160a01b031990911681179091556135f460aa546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b601354610100900460ff161580801561364c5750601354600160ff909116105b806136665750303b158015613666575060135460ff166001145b6136c95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016114b8565b6013805460ff1916600117905580156136ec576013805461ff0019166101001790555b6136f4614d54565b6136fc614d7b565b613704614daa565b61370c614dd9565b6137586040518060400160405280600c81526020016b5374616b696e67204c4f444560a01b8152506040518060400160405280600681526020016573744c4f444560d01b815250614e08565b600280546001600160a01b03199081166001600160a01b0388811691909117909255600380548216878416179055600480548216868416179055600e805490911691841691909117905567136dcc951d8c0000600a55671bc16d674ec80000600b5566b1a2bc2ec50000600c5567016345785d8a0000600d55601180546001600160e01b0316600160e01b4263ffffffff16021790558015613834576013805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b613843613b7c565b33600090815260016020526040902054811180159061386157508015155b61387d5760405162461bcd60e51b81526004016114b890615c1e565b336000908152600160205260409020600381015460029091015442916138a291615acf565b11156139005760405162461bcd60e51b815260206004820152602760248201527f5374616b696e67526577617264733a20546f6b656e7320617265207374696c6c604482015266081b1bd8dad95960ca1b60648201526084016114b8565b61390981614e39565b61161e6001601455565b6001600160a01b0383166139755760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016114b8565b6001600160a01b0382166139d65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016114b8565b6001600160a01b03838116600081815261010f602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6000826000190484118302158202613a5057600080fd5b5091020490565b6000611631826001600160601b031684655af3107a4000613a39565b6001600160a01b038216613ac95760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016114b8565b806101106000828254613adc9190615acf565b90915550506001600160a01b038216600081815261010e60209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b60785460ff16156119a45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016114b8565b600260145403613bce5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016114b8565b6002601455565b600480546040516323b872dd60e01b81523392810192909252306024830152604482018390526001600160a01b0316906323b872dd906064016020604051808303816000875af1158015613c2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c519190615b5a565b613c9d5760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e67526577617264733a205472616e73666572206661696c65640060448201526064016114b8565b3360009081526001602081905260408220600501805491929091613cc2908490615acf565b9091555050336000818152602081815260408083208151608081018352868152808401878152428285019081526060830187815284546001818101875595895287892094516004909102909401938455915183850155516002830155516003909101559383529290529081206006018054839290613d41908490615acf565b90915550503360009081526001602081905260408220018054839290613d68908490615acf565b925050819055508060086000828254613d819190615acf565b925050819055508060076000828254613d9a9190615acf565b909155505033600090815260126020526040812090613db96101105490565b9050613dc36117af565b81546001600160601b031981166001600160601b039182168501821617835560118054600160801b600160e01b03198116600160801b80830485168801909416909302928317909155613e24916001600160801b0391821691161784613a57565b8254613e3a9190600160601b9004600f0b615afb565b82546001600160801b0391909116600160601b02600160601b600160e01b0319909116178255613e6a3084613a73565b6101105483820114613e8f5760405163fd9eaf9160e01b815260040160405180910390fd5b600f546040516340c10f1960e01b81526001600160a01b03909116906340c10f1990613ec19033908790600401615b28565b600060405180830381600087803b158015613edb57600080fd5b505af1158015613eef573d6000803e3d6000fd5b50506040518581523392507fca064170e0c7d063fe46ac8b9c372f80f81820b4f4ae7df4727e1c72f39b0110915060200160405180910390a2505050565b6001601455565b60aa546001600160a01b031633146119a45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016114b8565b6000613f9a8484613554565b905060001981146140025781811015613ff55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016114b8565b6140028484848403613913565b50505050565b6001600160a01b03831661406c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016114b8565b6001600160a01b0382166140ce5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016114b8565b6001600160a01b038316600090815261010e6020526040902054818110156141475760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016114b8565b6001600160a01b03808516600081815261010e602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906141a89086815260200190565b60405180910390a3614002565b60008084600f0b12156141e6576141cb84615c64565b6141d58484613a57565b6141df9190615c8a565b9050611631565b83600f0b6141f48484613a57565b600f0b121561420557506000611631565b836142108484613a57565b6141df9190615cb1565b60006142246117af565b600061422e6109fa565b3360009081526012602052604081208054601154939450909261426e91600160601b8104600f0b916001600160801b0316906001600160601b03166141b5565b60115483546001600160801b03928316935061429692909116906001600160601b0316613a57565b82546001600160801b0391909116600160601b02600160601b600160e01b03199091161782556003546142d3906001600160a01b03163383615453565b60405181815233907ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe9060200160405180910390a2509092915050565b60dc80546001600160a01b031916905561161e816154a9565b614331613b36565b6078805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586143663390565b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382166143e35760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016114b8565b6001600160a01b038216600090815261010e6020526040902054818110156144585760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016114b8565b6001600160a01b038316600081815261010e60209081526040808320868603905561011080548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101613a2c565b505050565b600f54600160a81b900460ff166145295760405162461bcd60e51b815260206004820152603060248201527f5374616b696e67526577617264733a2065734c4f44452057697468647261776160448201526f1b1cc8139bdd0814195c9b5a5d1d195960821b60648201526084016114b8565b33600090815260016020526040812060068101546007805492939192839290614553908490615abc565b92505081905550806008600082825461456c9190615abc565b909155505033600090815260016020819052604082206006810183905501805483929061459a908490615abc565b9091555050600480546040516370a0823160e01b8152309281019290925282916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156145ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146109190615b41565b10156146955760405162461bcd60e51b815260206004820152604860248201527f5374616b696e67526577617264733a20576974686472617745734c4f44453a2060448201527f576974686472617720616d6f756e74206578636565647320636f6e74726163746064820152672062616c616e636560c01b608482015260a4016114b8565b33600090815260126020526040902080548291906001600160601b03168211806146bd575081155b156146db57604051639b54028b60e01b815260040160405180910390fd5b80546001600160601b031981166001600160601b03918216849003821617825560118054600160801b600160e01b03198116600160801b808304851687900390941690930292831790915561473e916001600160801b0391821691161783613a57565b81546147549190600160601b9004600f0b615bda565b81546001600160801b0391909116600160601b02600160601b600160e01b03199091161781556147843084614383565b600f54604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac906147b69033908790600401615b28565b600060405180830381600087803b1580156147d057600080fd5b505af11580156147e4573d6000803e3d6000fd5b505060045461480092506001600160a01b031690503385615453565b60405183815233907fb012517faa2041f69b1a9ab96e1af671dcdec36f162b88d95ad8da58e4ca6fa89060200160405180910390a250505050565b6002546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015614892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906148b69190615b5a565b6149025760405162461bcd60e51b815260206004820152601f60248201527f5374616b696e67526577617264733a205472616e73666572206661696c65640060448201526064016114b8565b3360009081526001602052604081206007810154600890910154849291829182918291600a88900361494557336000908152600160205260409020426002909101555b876276a70003614a1c5761496489600a54670de0b6b3a7640000613a39565b965061497b82600c54670de0b6b3a7640000613a39565b945061499281600d54670de0b6b3a7640000613a39565b93506149b0896149a28688615acf565b670de0b6b3a7640000613a39565b92506149c583670de0b6b3a764000080613a39565b95506149d18688615acf565b336000908152600160205260408120600401805492995088929091906149f8908490615acf565b925050819055508560096000828254614a119190615acf565b90915550614ae09050565b8762ed4e0003614ae057614a3b89600b54670de0b6b3a7640000613a39565b9650614a5282600c54670de0b6b3a7640000613a39565b9450614a6981600d54670de0b6b3a7640000613a39565b9350614a79896149a28688615acf565b9250614a8e83670de0b6b3a764000080613a39565b9550614a9a8688615acf565b33600090815260016020526040812060040180549299508892909190614ac1908490615acf565b925050819055508560096000828254614ada9190615acf565b90915550505b336000908152600160205260408120549003614b12573360009081526001602052604090204260028201556003018890555b33600090815260016020526040812080548b9290614b31908490615acf565b90915550503360009081526001602081905260408220018054899290614b58908490615acf565b925050819055508860076000828254614b719190615acf565b909155505033600090815260126020526040812090614b906101105490565b9050614b9a6117af565b81546001600160601b031981166001600160601b039182168b01821617835560118054600160801b600160e01b03198116600160801b80830485168e01909416909302928317909155614bfb916001600160801b039182169116178a613a57565b8254614c119190600160601b9004600f0b615afb565b82546001600160801b0391909116600160601b02600160601b600160e01b0319909116178255614c41308a613a73565b6101105489820114614c665760405163fd9eaf9160e01b815260040160405180910390fd5b89600a14614cd357600f546040516340c10f1960e01b81526001600160a01b03909116906340c10f1990614ca09033908d90600401615b28565b600060405180830381600087803b158015614cba57600080fd5b505af1158015614cce573d6000803e3d6000fd5b505050505b604080518c8152602081018c905233917fe6e1319b9f186d813a7881721807ad8ddc52846c1b781e04d9169309b6ae4b6b910160405180910390a25050505050505050505050565b614d236154fb565b6078805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33614366565b601354610100900460ff166119a45760405162461bcd60e51b81526004016114b890615cd1565b601354610100900460ff16614da25760405162461bcd60e51b81526004016114b890615cd1565b6119a4615544565b601354610100900460ff16614dd15760405162461bcd60e51b81526004016114b890615cd1565b6119a4615574565b601354610100900460ff16614e005760405162461bcd60e51b81526004016114b890615cd1565b6119a46155a7565b601354610100900460ff16614e2f5760405162461bcd60e51b81526004016114b890615cd1565b61347482826155ce565b614e416117af565b6000614e4b61421a565b90506000614e598284615acf565b336000908152600160208190526040822080549181018054600483015460068401546003909401549697509395909491849083614e968389615abc565b925050819055508360096000828254614eaf9190615abc565b90915550508686148015614ec1575082155b15614f055733600090815260016020819052604082206003810183905560028101839055908101829055600781018290556008810182905560040155849150614f88565b6000614f118888615abc565b90506000614f1f8583615acf565b9050614f2b8188615abc565b935086841115614f4d5760405162461bcd60e51b81526004016114b890615c1e565b336000908152600160208190526040822090810192909255600a60038301554260028301556007820181905560088201819055600490910155505b3360009081526001602052604081208054899290614fa7908490615abc565b925050819055508660076000828254614fc09190615abc565b909155505033600090815260126020526040812080549091906001600160601b031684118015615000575033600090815260016020526040902060060154155b15615016575080546001600160601b0316615077565b81546001600160601b03168411801561504057503360009081526001602052604090206006015415155b156150745733600090815260016020526040902060060154825461506d91906001600160601b0316615abc565b9050615077565b50825b81546001600160601b031681118061508d575080155b156150ab57604051639b54028b60e01b815260040160405180910390fd5b81546001600160601b031981166001600160601b03918216839003821617835560118054600160801b600160e01b03198116600160801b808304851686900390941690930292831790915561510e916001600160801b0391821691161782613a57565b82546151249190600160601b9004600f0b615bda565b82546001600160801b0391909116600160601b02600160601b600160e01b03199091161782556151543082614383565b600f546040516313e359e160e31b81523360048201526000916001600160a01b031690639f1acf0890602401602060405180830381865afa15801561519d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906151c19190615b41565b905083158015906151d157508015155b806151e7575083600a141580156151e757508015155b1561539a57336000908152600160205260409020600601541580159061520c57508015155b1561531157336000908152600160205260409020600601548111156152b357336000908152600160205260408120600601546152489083615abc565b600f54604051632770a7eb60e21b81529192506001600160a01b031690639dc29fac9061527b9033908590600401615b28565b600060405180830381600087803b15801561529557600080fd5b505af11580156152a9573d6000803e3d6000fd5b505050505061539a565b336000908152600160205260408120600601546152d1908390615abc565b9050801561530b57600f546040516340c10f1960e01b81526001600160a01b03909116906340c10f199061527b9033908590600401615b28565b5061539a565b3360009081526001602052604090206006015415801561533057508015155b1561539a57600f54604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac906153679033908590600401615b28565b600060405180830381600087803b15801561538157600080fd5b505af1158015615395573d6000803e3d6000fd5b505050505b60025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906153cc9033908e90600401615b28565b6020604051808303816000875af11580156153eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061540f9190615b5a565b506040518a815233907fce00afe876f254314a01ee2aa97291e9ab04ae26503790c1201f2f3856ccf4509060200160405180910390a2505050505050505050505050565b6144b28363a9059cbb60e01b8484604051602401615472929190615b28565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152615610565b60aa80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60785460ff166119a45760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016114b8565b601354610100900460ff1661556b5760405162461bcd60e51b81526004016114b890615cd1565b6119a433614310565b601354610100900460ff1661559b5760405162461bcd60e51b81526004016114b890615cd1565b6078805460ff19169055565b601354610100900460ff16613f2d5760405162461bcd60e51b81526004016114b890615cd1565b601354610100900460ff166155f55760405162461bcd60e51b81526004016114b890615cd1565b6101116156028382615d80565b506101126144b28282615d80565b6000615665826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166156e59092919063ffffffff16565b90508051600014806156865750808060200190518101906156869190615b5a565b6144b25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016114b8565b60606156f484846000856156fc565b949350505050565b60608247101561575d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016114b8565b600080866001600160a01b031685876040516157799190615e40565b60006040518083038185875af1925050503d80600081146157b6576040519150601f19603f3d011682016040523d82523d6000602084013e6157bb565b606091505b50915091506157cc878383876157d7565b979650505050505050565b6060831561584657825160000361583f576001600160a01b0385163b61583f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016114b8565b50816156f4565b6156f4838381511561585b5781518083602001fd5b8060405162461bcd60e51b81526004016114b89190615899565b60005b83811015615890578181015183820152602001615878565b50506000910152565b60208152600082518060208401526158b8816040850160208701615875565b601f01601f19169190910160400192915050565b80356001600160a01b03811681146158e357600080fd5b919050565b600080604083850312156158fb57600080fd5b615904836158cc565b946020939093013593505050565b60006020828403121561592457600080fd5b5035919050565b60006020828403121561593d57600080fd5b611631826158cc565b60008060006060848603121561595b57600080fd5b615964846158cc565b9250615972602085016158cc565b9150604084013590509250925092565b801515811461161e57600080fd5b6000602082840312156159a257600080fd5b813561163181615982565b600080604083850312156159c057600080fd5b50508035926020909101359150565b600080604083850312156159e257600080fd5b6159eb836158cc565b91506159f9602084016158cc565b90509250929050565b60008060008060808587031215615a1857600080fd5b615a21856158cc565b9350615a2f602086016158cc565b9250615a3d604086016158cc565b9150615a4b606086016158cc565b905092959194509250565b600181811c90821680615a6a57607f821691505b602082108103615a8a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b818103818111156109f4576109f4615aa6565b808201808211156109f4576109f4615aa6565b600060018201615af457615af4615aa6565b5060010190565b600f81810b9083900b0160016001607f1b03811360016001607f1b0319821217156109f4576109f4615aa6565b6001600160a01b03929092168252602082015260400190565b600060208284031215615b5357600080fd5b5051919050565b600060208284031215615b6c57600080fd5b815161163181615982565b600082615b9457634e487b7160e01b600052601260045260246000fd5b500490565b60208082526021908201527f5374616b696e67526577617264733a20496e76616c6964206c6f636b2074696d6040820152606560f81b606082015260800190565b600f82810b9082900b0360016001607f1b0319811260016001607f1b03821317156109f4576109f4615aa6565b80820281158282048414176109f4576109f4615aa6565b60208082526026908201527f5374616b696e67526577617264733a20496e76616c696420756e7374616b6520604082015265185b5bdd5b9d60d21b606082015260800190565b600081600f0b60016001607f1b03198103615c8157615c81615aa6565b60000392915050565b6001600160801b03818116838216019080821115615caa57615caa615aa6565b5092915050565b6001600160801b03828116828216039080821115615caa57615caa615aa6565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b601f8211156144b257600081815260208120601f850160051c81016020861015615d595750805b601f850160051c820191505b81811015615d7857828155600101615d65565b505050505050565b815167ffffffffffffffff811115615d9a57615d9a615d1c565b615dae81615da88454615a56565b84615d32565b602080601f831160018114615de35760008415615dcb5750858301515b600019600386901b1c1916600185901b178555615d78565b600085815260208120601f198616915b82811015615e1257888601518255948401946001909101908401615df3565b5085821015615e305787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251615e52818460208701615875565b919091019291505056fea26469706673582212200b4a54eaeb76da741acca93983dd649c766056d405d1ddee36c6ccc86d54cda464736f6c63430008120033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.