Source Code
Latest 25 from a total of 351 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Withdraw | 357551520 | 116 days ago | IN | 0 ETH | 0.00000137 | ||||
| Withdraw_request | 350594476 | 136 days ago | IN | 0.0001 ETH | 0.00000137 | ||||
| Withdraw | 332904321 | 188 days ago | IN | 0 ETH | 0.00000132 | ||||
| Withdraw | 276618091 | 352 days ago | IN | 0 ETH | 0.0000017 | ||||
| Withdraw_request | 276167976 | 353 days ago | IN | 0.0001 ETH | 0.00000333 | ||||
| Withdraw | 275958688 | 353 days ago | IN | 0 ETH | 0.0000033 | ||||
| Withdraw | 275938239 | 353 days ago | IN | 0 ETH | 0.00000131 | ||||
| Withdraw_request | 275937567 | 353 days ago | IN | 0.0001 ETH | 0.00000195 | ||||
| Withdraw | 275936564 | 353 days ago | IN | 0 ETH | 0.00000171 | ||||
| Withdraw_request | 275935222 | 354 days ago | IN | 0.0001 ETH | 0.00000168 | ||||
| Withdraw_request | 275906200 | 354 days ago | IN | 0.0001 ETH | 0.00000186 | ||||
| Withdraw | 273857972 | 360 days ago | IN | 0 ETH | 0.00000239 | ||||
| Withdraw_request | 273856363 | 360 days ago | IN | 0.0001 ETH | 0.00000233 | ||||
| Withdraw | 271824527 | 365 days ago | IN | 0 ETH | 0.0000047 | ||||
| Withdraw_request | 271821623 | 365 days ago | IN | 0.0001 ETH | 0.00001775 | ||||
| Withdraw | 271277112 | 367 days ago | IN | 0 ETH | 0.00000144 | ||||
| Withdraw_request | 270954767 | 368 days ago | IN | 0.0001 ETH | 0.0000018 | ||||
| Stake | 254940647 | 415 days ago | IN | 0.0001 ETH | 0.00000306 | ||||
| Withdraw | 254065096 | 417 days ago | IN | 0 ETH | 0.00000202 | ||||
| Stake | 247706088 | 436 days ago | IN | 0.0001 ETH | 0.00008067 | ||||
| Stake | 245872653 | 441 days ago | IN | 0.0001 ETH | 0.00000292 | ||||
| Withdraw | 233567509 | 477 days ago | IN | 0 ETH | 0.00000281 | ||||
| Withdraw_request | 232350130 | 480 days ago | IN | 0.0001 ETH | 0.00000152 | ||||
| Withdraw | 228677085 | 491 days ago | IN | 0 ETH | 0.00000341 | ||||
| Withdraw_request | 227668072 | 494 days ago | IN | 0.0001 ETH | 0.00000178 |
Latest 20 internal transactions
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 188198068 | 609 days ago | 0.02 ETH | ||||
| 188197879 | 609 days ago | 0.003 ETH | ||||
| 165213620 | 678 days ago | 0.0001 ETH | ||||
| 134655733 | 773 days ago | 0.0001 ETH | ||||
| 134654885 | 773 days ago | 0.0001 ETH | ||||
| 132731950 | 779 days ago | 0.0001 ETH | ||||
| 132182273 | 781 days ago | 0.0001 ETH | ||||
| 110622130 | 848 days ago | 0.0001 ETH | ||||
| 109949387 | 851 days ago | 0.0001 ETH | ||||
| 107622158 | 858 days ago | 0.0001 ETH | ||||
| 107272297 | 859 days ago | 0.0001 ETH | ||||
| 107267634 | 859 days ago | 0.0001 ETH | ||||
| 107267575 | 859 days ago | 0.0001 ETH | ||||
| 106632422 | 860 days ago | 0.0001 ETH | ||||
| 105955383 | 862 days ago | 0.0001 ETH | ||||
| 105606992 | 864 days ago | 0.0001 ETH | ||||
| 104414071 | 867 days ago | 0.0001 ETH | ||||
| 104184077 | 868 days ago | 0.0001 ETH | ||||
| 103143454 | 871 days ago | 0.0001 ETH | ||||
| 103102250 | 871 days ago | 0.0001 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
RiskOnPool
Compiler Version
v0.8.13+commit.abaa5c0e
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import "IERC20.sol";
import "SafeERC20.sol";
import "ISharplabs.sol";
import "ContractGuard.sol";
import "ReentrancyGuard.sol";
import "Operator.sol";
import "Blacklistable.sol";
import "Pausable.sol";
import "IGLPRouter.sol";
import "ITreasury.sol";
import "IRewardTracker.sol";
import "IGlpManager.sol";
import "Abs.sol";
import "SafeCast.sol";
import "ShareWrapper.sol";
contract RiskOnPool is ShareWrapper, ContractGuard, ReentrancyGuard, Operator, Blacklistable, Pausable {
using SafeERC20 for IERC20;
using Address for address;
using Abs for int256;
using SafeCast for uint256;
/* ========== DATA STRUCTURES ========== */
struct Memberseat {
int256 rewardEarned;
uint256 lastSnapshotIndex;
uint256 epochTimerStart;
}
struct BoardroomSnapshot {
int256 rewardReceived;
int256 rewardPerShare;
uint256 time;
}
struct StakeInfo {
uint256 amount;
uint256 requestTimestamp;
uint256 requestEpoch;
}
struct WithdrawInfo {
uint256 amount;
uint256 requestTimestamp;
uint256 requestEpoch;
}
/* ========== STATE VARIABLES ========== */
// reward
uint256 public totalWithdrawRequest;
address public token;
address public treasury;
uint256 public gasthreshold;
uint256 public minimumRequest;
mapping(address => Memberseat) public members;
BoardroomSnapshot[] public boardroomHistory;
mapping(address => StakeInfo) public stakeRequest;
mapping(address => WithdrawInfo) public withdrawRequest;
mapping (address => address) public pendingReceivers;
mapping (address => address[]) public pendingSenders;
uint256 public withdrawLockupEpochs;
uint256 public userExitEpochs;
uint256 public glpInFee;
uint256 public glpOutFee;
uint256 public capacity;
// flags
bool public initialized;
address public glpRouter = 0xB95DB5B167D75e6d04227CfFFA61069348d271F5;
address public rewardRouter = 0xA906F338CB21815cBc4Bc87ace9e68c87eF8d8F1;
address public glpManager = 0x3963FfC9dff443c2A94f21b129D429891E32ec18;
address public rewardTracker = 0x1aDDD80E6039594eE970E5872D247bf0414C8903;
/* ========== EVENTS ========== */
event Initialized(address indexed executor, uint256 at);
event Staked(address indexed user, uint256 amount);
event WithdrawRequest(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event Redeemed(address indexed user, uint256 amount);
event StakedByGov(uint256 indexed atEpoch, uint256 amount, uint256 time);
event StakedETHByGov(uint256 indexed atEpoch, uint256 amount, uint256 time);
event WithdrawnByGov(uint256 indexed atEpoch, uint256 amount, uint256 time);
event RewardPaid(address indexed user, int256 reward);
event RewardAdded(uint256 indexed atEpoch, uint256 period, uint256 totalStakedAmount, int256 reward);
event Exit(address indexed user, uint256 amount);
event StakeRequestIgnored(address indexed ignored, uint256 atEpoch);
event WithdrawRequestIgnored(address indexed ignored, uint256 atEpoch);
event HandledStakeRequest(uint256 indexed atEpoch, address[] _address);
event HandledWithdrawRequest(uint256 indexed atEpoch, address[] _address);
event HandledReward(uint256 indexed atEpoch, uint256 time);
event CapacityUpdated(uint256 indexed atEpoch, uint256 _capacity);
event GlpFeeUpdated(uint256 indexed atEpoch, uint256 _glpInFee, uint256 _glpOutFee);
event WithdrawLockupEpochsUpdated(uint256 indexed atEpoch, uint256 _withdrawLockupEpochs);
event UserExitEpochsUpdated(uint256 indexed atEpoch, uint256 _userExitEpochs);
event FeeUpdated(uint256 indexed atEpoch, uint256 _fee);
event FeeToUpdated(uint256 indexed atEpoch, address _feeTo);
event RouterUpdated(uint256 indexed atEpoch, address _glpRouter, address _rewardRouter);
event GlpManagerUpdated(uint256 indexed atEpoch, address _glpManager);
event RewardTrackerUpdated(uint256 indexed atEpoch, address _rewardTracker);
event TreasuryUpdated(uint256 indexed atEpoch, address _treasury);
event GasthresholdUpdated(uint256 indexed atEpoch, uint256 _gasthreshold);
event MinimumRequestUpdated(uint256 indexed atEpoch, uint256 _minimumRequest);
event SignalledTransfer(address indexed sender, address receiver);
event AcceptedTransfer(address indexed receiver, address sender);
/* ========== Modifiers =============== */
modifier onlyTreasury() {
require(treasury == msg.sender, "caller is not the treasury");
_;
}
modifier memberExists() {
require(balance_staked(msg.sender) > 0, "The member does not exist");
_;
}
modifier notInitialized() {
require(!initialized, "already initialized");
_;
}
receive() payable external {}
/* ========== GOVERNANCE ========== */
function initialize (
address _token,
address _share,
uint256 _fee,
address _feeTo,
uint256 _glpInFee,
uint256 _glpOutFee,
uint256 _gasthreshold,
uint256 _minimumRequset,
address _treasury
) public notInitialized {
require(_token != address(0), "token address can not be zero address");
require(_share != address(0), "share address can not be zero address");
require(_feeTo != address(0), "feeTo address can not be zero address");
require(_treasury != address(0), "treasury address can not be zero address");
token = _token;
share = _share;
fee = _fee;
feeTo = _feeTo;
glpInFee = _glpInFee;
glpOutFee = _glpOutFee;
gasthreshold = _gasthreshold;
minimumRequest = _minimumRequset;
treasury = _treasury;
BoardroomSnapshot memory genesisSnapshot = BoardroomSnapshot({time: block.number, rewardReceived: 0, rewardPerShare: 0});
boardroomHistory.push(genesisSnapshot);
withdrawLockupEpochs = 2; // Lock for 2 epochs (48h) before release withdraw
userExitEpochs = 4;
capacity = 1e12;
initialized = true;
emit Initialized(msg.sender, block.number);
}
/* ========== CONFIG ========== */
function pause() external onlyTreasury {
super._pause();
}
function unpause() external onlyTreasury {
super._unpause();
}
function setLockUp(uint256 _withdrawLockupEpochs) external onlyOperator {
withdrawLockupEpochs = _withdrawLockupEpochs;
emit WithdrawLockupEpochsUpdated(epoch(), _withdrawLockupEpochs);
}
function setExitEpochs(uint256 _userExitEpochs) external onlyOperator {
require(_userExitEpochs > 0, "userExitEpochs must be greater than zero");
userExitEpochs = _userExitEpochs;
emit UserExitEpochsUpdated(epoch(), _userExitEpochs);
}
function setFee(uint256 _fee) external onlyOperator {
require(_fee <= 500, "fee: out of range");
fee = _fee;
emit FeeUpdated(epoch(), _fee);
}
function setFeeTo(address _feeTo) external onlyOperator {
require(_feeTo != address(0), "feeTo can not be zero address");
feeTo = _feeTo;
emit FeeToUpdated(epoch(), _feeTo);
}
function setCapacity(uint256 _capacity) external onlyTreasury {
capacity = _capacity;
emit CapacityUpdated(epoch(), _capacity);
}
function setGlpFee(uint256 _glpInFee, uint256 _glpOutFee) external onlyTreasury {
require(_glpInFee <= 500, "glpInFee: out of range");
require(_glpOutFee <= 500, "glpOutFee: out of range");
glpInFee = _glpInFee;
glpOutFee = _glpOutFee;
emit GlpFeeUpdated(epoch(), _glpInFee, _glpOutFee);
}
function setRouter(address _glpRouter, address _rewardRouter) external onlyOperator {
require(_glpRouter != address(0), "glpRouter address can not be zero address");
require(_rewardRouter != address(0), "rewardRouter address can not be zero address");
glpRouter = _glpRouter;
rewardRouter = _rewardRouter;
emit RouterUpdated(epoch(), _glpRouter, _rewardRouter);
}
function setGlpManager(address _glpManager) external onlyOperator {
require(_glpManager != address(0), "glpManager address can not be zero address");
glpManager = _glpManager;
emit GlpManagerUpdated(epoch(), _glpManager);
}
function setRewardTracker(address _rewardTracker) external onlyOperator {
require(_rewardTracker != address(0), "rewardTracker address can not be zero address");
rewardTracker = _rewardTracker;
emit RewardTrackerUpdated(epoch(), _rewardTracker);
}
function setTreasury(address _treasury) external onlyOperator {
require(_treasury != address(0), "treasury address can not be zero address");
treasury = _treasury;
emit TreasuryUpdated(epoch(), _treasury);
}
function setGasThreshold(uint256 _gasthreshold) external onlyOperator {
gasthreshold = _gasthreshold;
emit GasthresholdUpdated(epoch(), _gasthreshold);
}
function setMinimumRequest(uint256 _minimumRequest) external onlyOperator {
minimumRequest = _minimumRequest;
emit MinimumRequestUpdated(epoch(), _minimumRequest);
}
/* ========== VIEW FUNCTIONS ========== */
// =========== Snapshot getters
function latestSnapshotIndex() public view returns (uint256) {
return boardroomHistory.length - 1;
}
function getLatestSnapshot() internal view returns (BoardroomSnapshot memory) {
return boardroomHistory[latestSnapshotIndex()];
}
function getLastSnapshotIndexOf(address member) public view returns (uint256) {
return members[member].lastSnapshotIndex;
}
function getLastSnapshotOf(address member) internal view returns (BoardroomSnapshot memory) {
return boardroomHistory[getLastSnapshotIndexOf(member)];
}
function canWithdraw(address member) external view returns (bool) {
return members[member].epochTimerStart + withdrawLockupEpochs <= epoch();
}
function epoch() public view returns (uint256) {
return ITreasury(treasury).epoch();
}
function nextEpochPoint() public view returns (uint256) {
return ITreasury(treasury).nextEpochPoint();
}
// =========== Member getters
function rewardPerShare() public view returns (int256) {
return getLatestSnapshot().rewardPerShare;
}
// calculate earned reward of specified user
function earned(address member) public view returns (int256) {
int256 latestRPS = getLatestSnapshot().rewardPerShare;
int256 storedRPS = getLastSnapshotOf(member).rewardPerShare;
return balance_staked(member).toInt256() * (latestRPS - storedRPS) / 1e18 + members[member].rewardEarned;
}
// required usd collateral in the contract
function getRequiredCollateral() public view returns (uint256) {
if (_totalSupply.reward >= 0) {
return _totalSupply.wait + _totalSupply.staked + _totalSupply.withdrawable + _totalSupply.reward.abs();
} else {
return _totalSupply.wait + _totalSupply.staked + _totalSupply.withdrawable - _totalSupply.reward.abs();
}
}
// glp price
function getGLPPrice(bool _maximum) public view returns (uint256) {
return IGlpManager(glpManager).getPrice(_maximum);
}
// staked glp amount
function getStakedGLP() public view returns (uint256) {
return IRewardTracker(rewardTracker).balanceOf(address(this));
}
// staked glp usd value
function getStakedGLPUSDValue(bool _maximum) public view returns (uint256) {
return getGLPPrice(_maximum) * getStakedGLP() / 1e42;
}
/* ========== MUTATIVE FUNCTIONS ========== */
function stake(uint256 _amount) public payable override onlyOneBlock notBlacklisted(msg.sender) whenNotPaused {
require(_amount >= minimumRequest, "stake amount too low");
require(_totalSupply.staked + _totalSupply.wait + _amount <= capacity, "stake no capacity");
require(msg.value >= gasthreshold, "need more gas to handle request");
if (fee > 0) {
uint tax = _amount * fee / 10000;
_amount = _amount - tax;
IERC20(share).safeTransferFrom(msg.sender, feeTo, tax);
}
if (glpInFee > 0) {
uint _glpInFee = _amount * glpInFee / 10000;
_amount = _amount - _glpInFee;
IERC20(share).safeTransferFrom(msg.sender, address(this), _glpInFee);
}
super.stake(_amount);
stakeRequest[msg.sender].amount += _amount;
stakeRequest[msg.sender].requestTimestamp = block.timestamp;
stakeRequest[msg.sender].requestEpoch = epoch();
ISharplabs(token).mint(msg.sender, _amount * 1e12);
emit Staked(msg.sender, _amount);
}
function withdraw_request(uint256 _amount) external payable memberExists notBlacklisted(msg.sender) whenNotPaused {
require(_amount != 0, "withdraw request cannot be equal to 0");
require(_amount + withdrawRequest[msg.sender].amount <= _balances[msg.sender].staked, "withdraw amount exceeds the staked balance");
require(members[msg.sender].epochTimerStart + withdrawLockupEpochs <= epoch(), "still in withdraw lockup");
require(msg.value >= gasthreshold, "need more gas to handle request");
withdrawRequest[msg.sender].amount += _amount;
withdrawRequest[msg.sender].requestTimestamp = block.timestamp;
withdrawRequest[msg.sender].requestEpoch = epoch();
totalWithdrawRequest += _amount;
emit WithdrawRequest(msg.sender, _amount);
}
function withdraw(uint256 amount) public override onlyOneBlock notBlacklisted(msg.sender) whenNotPaused {
require(amount != 0, "cannot withdraw 0");
super.withdraw(amount);
try ISharplabs(token).burn(msg.sender, amount * 1e12) {
} catch {}
emit Withdrawn(msg.sender, amount);
}
function redeem() external onlyOneBlock notBlacklisted(msg.sender) whenNotPaused {
uint256 _epoch = epoch();
require(_epoch == stakeRequest[msg.sender].requestEpoch, "can not redeem");
uint amount = balance_wait(msg.sender);
_balances[msg.sender].wait -= amount;
_totalSupply.wait -= amount;
IERC20(share).safeTransfer(msg.sender, amount);
try ISharplabs(token).burn(msg.sender, amount * 1e12) {
} catch {}
delete stakeRequest[msg.sender];
emit Redeemed(msg.sender, amount);
}
function exit() onlyOneBlock external notBlacklisted(msg.sender) whenNotPaused {
require(_balances[msg.sender].staked > 0, "no staked balance");
require(nextEpochPoint() + ITreasury(treasury).period() * userExitEpochs <= block.timestamp, "cannot exit");
uint amount = _balances[msg.sender].staked;
uint _glpAmount = amount * 1e42 / getGLPPrice(false);
uint amountOut = IGLPRouter(glpRouter).unstakeAndRedeemGlp(share, _glpAmount, 0, address(this));
require(amountOut <= amount, "withdraw overflow");
if (amount - amountOut > 0) {
uint diff = amount - amountOut;
try ISharplabs(token).burn(msg.sender, diff * 1e12) {
} catch {}
}
updateReward(msg.sender);
_totalSupply.reward -= members[msg.sender].rewardEarned;
members[msg.sender].rewardEarned = 0; // rewards will be cleared
_balances[msg.sender].staked -= amount;
_balances[msg.sender].withdrawable += amountOut;
_totalSupply.staked -= amount;
_totalSupply.withdrawable += amountOut;
totalWithdrawRequest -= withdrawRequest[msg.sender].amount;
delete withdrawRequest[msg.sender];
emit Exit(msg.sender, amount);
}
function handleStakeRequest(address[] memory _address) external onlyTreasury {
uint256 _epoch = epoch();
for (uint i = 0; i < _address.length; i++) {
address user = _address[i];
uint amount = stakeRequest[user].amount;
if (stakeRequest[user].requestEpoch == _epoch) { // check latest epoch
emit StakeRequestIgnored(user, _epoch);
continue;
}
if (stakeRequest[user].requestTimestamp == 0) {
continue;
}
updateReward(user);
_balances[user].wait -= amount;
_balances[user].staked += amount;
_totalSupply.wait -= amount;
_totalSupply.staked += amount;
members[user].epochTimerStart = _epoch - 1; // reset timer
delete stakeRequest[user];
}
emit HandledStakeRequest(_epoch, _address);
}
function handleWithdrawRequest(address[] memory _address) external onlyTreasury {
uint256 _epoch = epoch();
for (uint i = 0; i < _address.length; i++) {
address user = _address[i];
uint amount = withdrawRequest[user].amount;
uint amountReceived = amount; // user real received amount
if (withdrawRequest[user].requestEpoch == _epoch) { // check latest epoch
emit WithdrawRequestIgnored(user, _epoch);
continue;
}
if (withdrawRequest[user].requestTimestamp == 0) {
continue;
}
claimReward(user);
if (glpOutFee > 0) {
uint _glpOutFee = amount * glpOutFee / 10000;
try ISharplabs(token).burn(user, _glpOutFee * 1e12) {
} catch {}
amountReceived = amount - _glpOutFee;
}
_balances[user].staked -= amount;
_balances[user].withdrawable += amountReceived;
_totalSupply.staked -= amount;
_totalSupply.withdrawable += amountReceived;
totalWithdrawRequest -= amount;
members[user].epochTimerStart = _epoch - 1; // reset timer
delete withdrawRequest[user];
}
emit HandledWithdrawRequest(_epoch, _address);
}
function removeWithdrawRequest(address[] memory _address) external onlyTreasury {
for (uint i = 0; i < _address.length; i++) {
address user = _address[i];
uint amount = withdrawRequest[user].amount;
totalWithdrawRequest -= amount;
delete withdrawRequest[user];
}
}
function updateReward(address member) internal {
if (member != address(0)) {
Memberseat memory seat = members[member];
seat.rewardEarned = earned(member);
seat.lastSnapshotIndex = latestSnapshotIndex();
members[member] = seat;
}
}
function claimReward(address member) internal returns (int) {
updateReward(member);
int256 reward = members[member].rewardEarned;
members[member].rewardEarned = 0;
_balances[member].reward += reward;
emit RewardPaid(member, reward);
return reward;
}
function stakeByGov(address _token, uint256 _amount, uint256 _minUsdg, uint256 _minGlp) external onlyTreasury returns (uint256) {
IERC20(_token).safeApprove(glpManager, 0);
IERC20(_token).safeApprove(glpManager, _amount);
uint256 glpAmount = IGLPRouter(glpRouter).mintAndStakeGlp(_token, _amount, _minUsdg, _minGlp);
emit StakedByGov(epoch(), _amount, block.timestamp);
return glpAmount;
}
function stakeETHByGov(uint256 amount, uint256 _minUsdg, uint256 _minGlp) external onlyTreasury returns (uint256) {
require(amount <= address(this).balance, "not enough funds");
uint256 glpAmount = IGLPRouter(glpRouter).mintAndStakeGlpETH{value: amount}(_minUsdg, _minGlp);
emit StakedETHByGov(epoch(), amount, block.timestamp);
return glpAmount;
}
function withdrawByGov(address _tokenOut, uint256 _glpAmount, uint256 _minOut, address _receiver) external onlyTreasury returns (uint256) {
uint256 glpAmount = IGLPRouter(glpRouter).unstakeAndRedeemGlp(_tokenOut, _glpAmount, _minOut, _receiver);
emit WithdrawnByGov(epoch(), _minOut, block.timestamp);
return glpAmount;
}
function handleRewards(
bool _shouldClaimGmx,
bool _shouldStakeGmx,
bool _shouldClaimEsGmx,
bool _shouldStakeEsGmx,
bool _shouldStakeMultiplierPoints,
bool _shouldClaimWeth,
bool _shouldConvertWethToEth
) external onlyTreasury {
uint256 _epoch = epoch();
IGLPRouter(rewardRouter).handleRewards(
_shouldClaimGmx,
_shouldStakeGmx,
_shouldClaimEsGmx,
_shouldStakeEsGmx,
_shouldStakeMultiplierPoints,
_shouldClaimWeth,
_shouldConvertWethToEth);
emit HandledReward(_epoch, block.timestamp);
}
function allocateReward(int256 amount) external onlyOneBlock onlyTreasury {
require(total_supply_staked() > 0, "rewards cannot be allocated when totalSupply is 0");
// Create & add new snapshot
int256 prevRPS = getLatestSnapshot().rewardPerShare;
int256 nextRPS = prevRPS + amount * 1e18 / total_supply_staked().toInt256();
BoardroomSnapshot memory newSnapshot = BoardroomSnapshot({time: block.number, rewardReceived: amount, rewardPerShare: nextRPS});
boardroomHistory.push(newSnapshot);
_totalSupply.reward += amount;
emit RewardAdded(epoch(), ITreasury(treasury).period(), total_supply_staked(), amount);
}
function signalTransfer(address _receiver) external nonReentrant {
require(stakeRequest[msg.sender].amount == 0, "Pool: sender has stakeRequest");
require(withdrawRequest[msg.sender].amount == 0, "Pool: sender has withdrawRequest");
_validateReceiver(_receiver);
pendingReceivers[msg.sender] = _receiver;
pendingSenders[_receiver].push(msg.sender);
emit SignalledTransfer(msg.sender, _receiver);
}
function acceptTransfer(address _sender) external nonReentrant {
require(stakeRequest[_sender].amount == 0, "Pool: sender has stakeRequest");
require(withdrawRequest[_sender].amount == 0, "Pool: sender has withdrawRequest");
address receiver = msg.sender;
require(pendingReceivers[_sender] == receiver, "Pool: transfer not signalled");
delete pendingReceivers[_sender];
delete pendingSenders[receiver];
_validateReceiver(receiver);
uint256 wait_balance = balance_wait(_sender);
if (wait_balance > 0) {
_balances[_sender].wait -= wait_balance;
_balances[receiver].wait += wait_balance;
}
uint256 staked_balance = balance_staked(_sender);
if (staked_balance > 0) {
_balances[_sender].staked -= staked_balance;
_balances[receiver].staked += staked_balance;
}
uint256 withdraw_balance = balance_withdraw(_sender);
if (withdraw_balance > 0) {
_balances[_sender].withdrawable -= withdraw_balance;
_balances[receiver].withdrawable += withdraw_balance;
}
int256 reward_balance = balance_reward(_sender);
if (reward_balance != 0) {
_balances[_sender].reward -= reward_balance;
_balances[receiver].reward += reward_balance;
}
uint256 share_balance = IERC20(token).balanceOf(_sender);
if (share_balance > 0) {
ISharplabs(token).burn(_sender, share_balance);
ISharplabs(token).mint(receiver, share_balance);
}
members[receiver].rewardEarned = members[_sender].rewardEarned;
members[receiver].lastSnapshotIndex = members[_sender].lastSnapshotIndex;
members[receiver].epochTimerStart = members[_sender].epochTimerStart;
delete members[_sender];
emit AcceptedTransfer(receiver, _sender);
}
function _validateReceiver(address _receiver) private view {
require(balance_wait(_receiver) == 0, "invalid receiver: receiver wait balance is not equal to zero");
require(balance_staked(_receiver) == 0, "invalid receiver: receiver staked balance is not equal to zero");
require(balance_withdraw(_receiver) == 0, "invalid receiver: receiver withdraw balance is not equal to zero");
require(balance_reward(_receiver) == 0, "invalid receiver: receiver reward balance is not equal to zero");
require(members[_receiver].rewardEarned == 0, "invalid receiver: receiver rewardEarned is not equal to zero");
}
function treasuryWithdrawFunds(address _token, uint256 amount, address to) external onlyTreasury {
require(to != address(0), "to address can not be zero address");
IERC20(_token).safeTransfer(to, amount);
}
function treasuryWithdrawFundsETH(uint256 amount, address to) external nonReentrant onlyTreasury {
require(to != address(0), "to address can not be zero address");
Address.sendValue(payable(to), amount);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
pragma solidity 0.8.13;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `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);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import "IERC20.sol";
import "Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* 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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return 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
pragma solidity 0.8.13;
interface ISharplabs {
function mint(address to, uint256 amount) external ;
function burn(address to, uint256 amount) external ;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
contract ContractGuard {
mapping(uint256 => mapping(address => bool)) private _status;
function checkSameOriginReentranted() internal view returns (bool) {
return _status[block.number][tx.origin];
}
function checkSameSenderReentranted() internal view returns (bool) {
return _status[block.number][msg.sender];
}
modifier onlyOneBlock() {
require(!checkSameOriginReentranted(), "ContractGuard: one block, one function");
require(!checkSameSenderReentranted(), "ContractGuard: one block, one function");
_status[block.number][tx.origin] = true;
_status[block.number][msg.sender] = true;
_;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity 0.8.13;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_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;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import "Context.sol";
import "Ownable.sol";
contract Operator is Context, Ownable {
address private _operator;
event OperatorTransferred(address indexed previousOperator, address indexed newOperator);
constructor() {
_operator = _msgSender();
emit OperatorTransferred(address(0), _operator);
}
function operator() public view returns (address) {
return _operator;
}
modifier onlyOperator() {
require(_operator == msg.sender, "operator: caller is not the operator");
_;
}
function isOperator() public view returns (bool) {
return _msgSender() == _operator;
}
function transferOperator(address newOperator_) public onlyOwner {
_transferOperator(newOperator_);
}
function _transferOperator(address newOperator_) internal {
require(newOperator_ != address(0), "operator: zero address given for new operator");
emit OperatorTransferred(address(0), newOperator_);
_operator = newOperator_;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import "Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}/**
* SPDX-License-Identifier: MIT
*
* Copyright (c) 2018-2020 CENTRE SECZ
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
pragma solidity 0.8.13;
import "Ownable.sol";
abstract contract Blacklistable is Ownable {
address internal _blacklister;
mapping(address => bool) internal _blacklisted;
event Blacklisted(address indexed account);
event UnBlacklisted(address indexed account);
event BlacklisterChanged(address indexed newBlacklister);
/**
* @notice Throw if called by any account other than the blacklister
*/
modifier onlyBlacklister() {
require(msg.sender == _blacklister, "caller is not the blacklister");
_;
}
/**
* @notice Throw if argument account is blacklisted
* @param account The address to check
*/
modifier notBlacklisted(address account) {
require(!_blacklisted[account], "account is blacklisted");
_;
}
/**
* @notice Blacklister address
* @return Address
*/
function blacklister() external view returns (address) {
return _blacklister;
}
/**
* @notice Check whether a given account is blacklisted
* @param account The address to check
*/
function isBlacklisted(address account) external view returns (bool) {
return _blacklisted[account];
}
/**
* @notice Add an account to blacklist
* @param account The address to blacklist
*/
function blacklist(address account) external onlyBlacklister {
_blacklisted[account] = true;
emit Blacklisted(account);
}
/**
* @notice Remove an account from blacklist
* @param account The address to remove from the blacklist
*/
function unBlacklist(address account) external onlyBlacklister {
_blacklisted[account] = false;
emit UnBlacklisted(account);
}
/**
* @notice Change the blacklister
* @param newBlacklister new blacklister's address
*/
function updateBlacklister(address newBlacklister) external onlyOwner {
require(
newBlacklister != address(0),
"new blacklister is the zero address"
);
_blacklister = newBlacklister;
emit BlacklisterChanged(_blacklister);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity 0.8.13;
import "Context.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 Pausable is Context {
/**
* @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 internal _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_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());
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
interface IGLPRouter {
function mintAndStakeGlp(
address _token,
uint256 _amount,
uint256 _minUsdg,
uint256 _minGlp
) external returns (uint256);
function mintAndStakeGlpETH(
uint256 _minUsdg,
uint256 _minGlp
) external payable returns (uint256);
function unstakeAndRedeemGlp(
address _tokenOut,
uint256 _glpAmount,
uint256 _minOut,
address _receiver
) external returns (uint256);
function handleRewards(
bool _shouldClaimGmx,
bool _shouldStakeGmx,
bool _shouldClaimEsGmx,
bool _shouldStakeEsGmx,
bool _shouldStakeMultiplierPoints,
bool _shouldClaimWeth,
bool _shouldConvertWethToEth
) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
interface ITreasury {
function isOperator() external returns (bool);
function operator() external view returns (address);
function transferOperator(address newOperator_) external;
function period() external view returns (uint256);
function epoch() external view returns (uint256);
function nextEpochPoint() external view returns (uint256);
function initialize(address token, address share, address oracle, address boardroom, uint256 start_time) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
interface IRewardTracker {
function balanceOf(address _account) external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
interface IGlpManager {
function getPrice(bool) external view returns (uint);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
library Abs {
function abs(int256 x) internal pure returns (uint256) {
if (x < 0) {
return uint256(-x);
} else {
return uint256(x);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.
pragma solidity 0.8.13;
/**
* @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such an operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*
* Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
* all math on `uint256` and `int256` and then downcasting.
*/
library SafeCast {
/**
* @dev Returns the downcasted uint248 from uint256, reverting on
* overflow (when the input is greater than largest uint248).
*
* Counterpart to Solidity's `uint248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*
* _Available since v4.7._
*/
function toUint248(uint256 value) internal pure returns (uint248) {
require(value <= type(uint248).max, "SafeCast: value doesn't fit in 248 bits");
return uint248(value);
}
/**
* @dev Returns the downcasted uint240 from uint256, reverting on
* overflow (when the input is greater than largest uint240).
*
* Counterpart to Solidity's `uint240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*
* _Available since v4.7._
*/
function toUint240(uint256 value) internal pure returns (uint240) {
require(value <= type(uint240).max, "SafeCast: value doesn't fit in 240 bits");
return uint240(value);
}
/**
* @dev Returns the downcasted uint232 from uint256, reverting on
* overflow (when the input is greater than largest uint232).
*
* Counterpart to Solidity's `uint232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*
* _Available since v4.7._
*/
function toUint232(uint256 value) internal pure returns (uint232) {
require(value <= type(uint232).max, "SafeCast: value doesn't fit in 232 bits");
return uint232(value);
}
/**
* @dev Returns the downcasted uint224 from uint256, reverting on
* overflow (when the input is greater than largest uint224).
*
* Counterpart to Solidity's `uint224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*
* _Available since v4.2._
*/
function toUint224(uint256 value) internal pure returns (uint224) {
require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits");
return uint224(value);
}
/**
* @dev Returns the downcasted uint216 from uint256, reverting on
* overflow (when the input is greater than largest uint216).
*
* Counterpart to Solidity's `uint216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*
* _Available since v4.7._
*/
function toUint216(uint256 value) internal pure returns (uint216) {
require(value <= type(uint216).max, "SafeCast: value doesn't fit in 216 bits");
return uint216(value);
}
/**
* @dev Returns the downcasted uint208 from uint256, reverting on
* overflow (when the input is greater than largest uint208).
*
* Counterpart to Solidity's `uint208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*
* _Available since v4.7._
*/
function toUint208(uint256 value) internal pure returns (uint208) {
require(value <= type(uint208).max, "SafeCast: value doesn't fit in 208 bits");
return uint208(value);
}
/**
* @dev Returns the downcasted uint200 from uint256, reverting on
* overflow (when the input is greater than largest uint200).
*
* Counterpart to Solidity's `uint200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*
* _Available since v4.7._
*/
function toUint200(uint256 value) internal pure returns (uint200) {
require(value <= type(uint200).max, "SafeCast: value doesn't fit in 200 bits");
return uint200(value);
}
/**
* @dev Returns the downcasted uint192 from uint256, reverting on
* overflow (when the input is greater than largest uint192).
*
* Counterpart to Solidity's `uint192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*
* _Available since v4.7._
*/
function toUint192(uint256 value) internal pure returns (uint192) {
require(value <= type(uint192).max, "SafeCast: value doesn't fit in 192 bits");
return uint192(value);
}
/**
* @dev Returns the downcasted uint184 from uint256, reverting on
* overflow (when the input is greater than largest uint184).
*
* Counterpart to Solidity's `uint184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*
* _Available since v4.7._
*/
function toUint184(uint256 value) internal pure returns (uint184) {
require(value <= type(uint184).max, "SafeCast: value doesn't fit in 184 bits");
return uint184(value);
}
/**
* @dev Returns the downcasted uint176 from uint256, reverting on
* overflow (when the input is greater than largest uint176).
*
* Counterpart to Solidity's `uint176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*
* _Available since v4.7._
*/
function toUint176(uint256 value) internal pure returns (uint176) {
require(value <= type(uint176).max, "SafeCast: value doesn't fit in 176 bits");
return uint176(value);
}
/**
* @dev Returns the downcasted uint168 from uint256, reverting on
* overflow (when the input is greater than largest uint168).
*
* Counterpart to Solidity's `uint168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*
* _Available since v4.7._
*/
function toUint168(uint256 value) internal pure returns (uint168) {
require(value <= type(uint168).max, "SafeCast: value doesn't fit in 168 bits");
return uint168(value);
}
/**
* @dev Returns the downcasted uint160 from uint256, reverting on
* overflow (when the input is greater than largest uint160).
*
* Counterpart to Solidity's `uint160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*
* _Available since v4.7._
*/
function toUint160(uint256 value) internal pure returns (uint160) {
require(value <= type(uint160).max, "SafeCast: value doesn't fit in 160 bits");
return uint160(value);
}
/**
* @dev Returns the downcasted uint152 from uint256, reverting on
* overflow (when the input is greater than largest uint152).
*
* Counterpart to Solidity's `uint152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*
* _Available since v4.7._
*/
function toUint152(uint256 value) internal pure returns (uint152) {
require(value <= type(uint152).max, "SafeCast: value doesn't fit in 152 bits");
return uint152(value);
}
/**
* @dev Returns the downcasted uint144 from uint256, reverting on
* overflow (when the input is greater than largest uint144).
*
* Counterpart to Solidity's `uint144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*
* _Available since v4.7._
*/
function toUint144(uint256 value) internal pure returns (uint144) {
require(value <= type(uint144).max, "SafeCast: value doesn't fit in 144 bits");
return uint144(value);
}
/**
* @dev Returns the downcasted uint136 from uint256, reverting on
* overflow (when the input is greater than largest uint136).
*
* Counterpart to Solidity's `uint136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*
* _Available since v4.7._
*/
function toUint136(uint256 value) internal pure returns (uint136) {
require(value <= type(uint136).max, "SafeCast: value doesn't fit in 136 bits");
return uint136(value);
}
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*
* _Available since v2.5._
*/
function toUint128(uint256 value) internal pure returns (uint128) {
require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits");
return uint128(value);
}
/**
* @dev Returns the downcasted uint120 from uint256, reverting on
* overflow (when the input is greater than largest uint120).
*
* Counterpart to Solidity's `uint120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*
* _Available since v4.7._
*/
function toUint120(uint256 value) internal pure returns (uint120) {
require(value <= type(uint120).max, "SafeCast: value doesn't fit in 120 bits");
return uint120(value);
}
/**
* @dev Returns the downcasted uint112 from uint256, reverting on
* overflow (when the input is greater than largest uint112).
*
* Counterpart to Solidity's `uint112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*
* _Available since v4.7._
*/
function toUint112(uint256 value) internal pure returns (uint112) {
require(value <= type(uint112).max, "SafeCast: value doesn't fit in 112 bits");
return uint112(value);
}
/**
* @dev Returns the downcasted uint104 from uint256, reverting on
* overflow (when the input is greater than largest uint104).
*
* Counterpart to Solidity's `uint104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*
* _Available since v4.7._
*/
function toUint104(uint256 value) internal pure returns (uint104) {
require(value <= type(uint104).max, "SafeCast: value doesn't fit in 104 bits");
return uint104(value);
}
/**
* @dev Returns the downcasted uint96 from uint256, reverting on
* overflow (when the input is greater than largest uint96).
*
* Counterpart to Solidity's `uint96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*
* _Available since v4.2._
*/
function toUint96(uint256 value) internal pure returns (uint96) {
require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits");
return uint96(value);
}
/**
* @dev Returns the downcasted uint88 from uint256, reverting on
* overflow (when the input is greater than largest uint88).
*
* Counterpart to Solidity's `uint88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*
* _Available since v4.7._
*/
function toUint88(uint256 value) internal pure returns (uint88) {
require(value <= type(uint88).max, "SafeCast: value doesn't fit in 88 bits");
return uint88(value);
}
/**
* @dev Returns the downcasted uint80 from uint256, reverting on
* overflow (when the input is greater than largest uint80).
*
* Counterpart to Solidity's `uint80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*
* _Available since v4.7._
*/
function toUint80(uint256 value) internal pure returns (uint80) {
require(value <= type(uint80).max, "SafeCast: value doesn't fit in 80 bits");
return uint80(value);
}
/**
* @dev Returns the downcasted uint72 from uint256, reverting on
* overflow (when the input is greater than largest uint72).
*
* Counterpart to Solidity's `uint72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*
* _Available since v4.7._
*/
function toUint72(uint256 value) internal pure returns (uint72) {
require(value <= type(uint72).max, "SafeCast: value doesn't fit in 72 bits");
return uint72(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*
* _Available since v2.5._
*/
function toUint64(uint256 value) internal pure returns (uint64) {
require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits");
return uint64(value);
}
/**
* @dev Returns the downcasted uint56 from uint256, reverting on
* overflow (when the input is greater than largest uint56).
*
* Counterpart to Solidity's `uint56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*
* _Available since v4.7._
*/
function toUint56(uint256 value) internal pure returns (uint56) {
require(value <= type(uint56).max, "SafeCast: value doesn't fit in 56 bits");
return uint56(value);
}
/**
* @dev Returns the downcasted uint48 from uint256, reverting on
* overflow (when the input is greater than largest uint48).
*
* Counterpart to Solidity's `uint48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*
* _Available since v4.7._
*/
function toUint48(uint256 value) internal pure returns (uint48) {
require(value <= type(uint48).max, "SafeCast: value doesn't fit in 48 bits");
return uint48(value);
}
/**
* @dev Returns the downcasted uint40 from uint256, reverting on
* overflow (when the input is greater than largest uint40).
*
* Counterpart to Solidity's `uint40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*
* _Available since v4.7._
*/
function toUint40(uint256 value) internal pure returns (uint40) {
require(value <= type(uint40).max, "SafeCast: value doesn't fit in 40 bits");
return uint40(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*
* _Available since v2.5._
*/
function toUint32(uint256 value) internal pure returns (uint32) {
require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits");
return uint32(value);
}
/**
* @dev Returns the downcasted uint24 from uint256, reverting on
* overflow (when the input is greater than largest uint24).
*
* Counterpart to Solidity's `uint24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*
* _Available since v4.7._
*/
function toUint24(uint256 value) internal pure returns (uint24) {
require(value <= type(uint24).max, "SafeCast: value doesn't fit in 24 bits");
return uint24(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*
* _Available since v2.5._
*/
function toUint16(uint256 value) internal pure returns (uint16) {
require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits");
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*
* _Available since v2.5._
*/
function toUint8(uint256 value) internal pure returns (uint8) {
require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits");
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*
* _Available since v3.0._
*/
function toUint256(int256 value) internal pure returns (uint256) {
require(value >= 0, "SafeCast: value must be positive");
return uint256(value);
}
/**
* @dev Returns the downcasted int248 from int256, reverting on
* overflow (when the input is less than smallest int248 or
* greater than largest int248).
*
* Counterpart to Solidity's `int248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*
* _Available since v4.7._
*/
function toInt248(int256 value) internal pure returns (int248 downcasted) {
downcasted = int248(value);
require(downcasted == value, "SafeCast: value doesn't fit in 248 bits");
}
/**
* @dev Returns the downcasted int240 from int256, reverting on
* overflow (when the input is less than smallest int240 or
* greater than largest int240).
*
* Counterpart to Solidity's `int240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*
* _Available since v4.7._
*/
function toInt240(int256 value) internal pure returns (int240 downcasted) {
downcasted = int240(value);
require(downcasted == value, "SafeCast: value doesn't fit in 240 bits");
}
/**
* @dev Returns the downcasted int232 from int256, reverting on
* overflow (when the input is less than smallest int232 or
* greater than largest int232).
*
* Counterpart to Solidity's `int232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*
* _Available since v4.7._
*/
function toInt232(int256 value) internal pure returns (int232 downcasted) {
downcasted = int232(value);
require(downcasted == value, "SafeCast: value doesn't fit in 232 bits");
}
/**
* @dev Returns the downcasted int224 from int256, reverting on
* overflow (when the input is less than smallest int224 or
* greater than largest int224).
*
* Counterpart to Solidity's `int224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*
* _Available since v4.7._
*/
function toInt224(int256 value) internal pure returns (int224 downcasted) {
downcasted = int224(value);
require(downcasted == value, "SafeCast: value doesn't fit in 224 bits");
}
/**
* @dev Returns the downcasted int216 from int256, reverting on
* overflow (when the input is less than smallest int216 or
* greater than largest int216).
*
* Counterpart to Solidity's `int216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*
* _Available since v4.7._
*/
function toInt216(int256 value) internal pure returns (int216 downcasted) {
downcasted = int216(value);
require(downcasted == value, "SafeCast: value doesn't fit in 216 bits");
}
/**
* @dev Returns the downcasted int208 from int256, reverting on
* overflow (when the input is less than smallest int208 or
* greater than largest int208).
*
* Counterpart to Solidity's `int208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*
* _Available since v4.7._
*/
function toInt208(int256 value) internal pure returns (int208 downcasted) {
downcasted = int208(value);
require(downcasted == value, "SafeCast: value doesn't fit in 208 bits");
}
/**
* @dev Returns the downcasted int200 from int256, reverting on
* overflow (when the input is less than smallest int200 or
* greater than largest int200).
*
* Counterpart to Solidity's `int200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*
* _Available since v4.7._
*/
function toInt200(int256 value) internal pure returns (int200 downcasted) {
downcasted = int200(value);
require(downcasted == value, "SafeCast: value doesn't fit in 200 bits");
}
/**
* @dev Returns the downcasted int192 from int256, reverting on
* overflow (when the input is less than smallest int192 or
* greater than largest int192).
*
* Counterpart to Solidity's `int192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*
* _Available since v4.7._
*/
function toInt192(int256 value) internal pure returns (int192 downcasted) {
downcasted = int192(value);
require(downcasted == value, "SafeCast: value doesn't fit in 192 bits");
}
/**
* @dev Returns the downcasted int184 from int256, reverting on
* overflow (when the input is less than smallest int184 or
* greater than largest int184).
*
* Counterpart to Solidity's `int184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*
* _Available since v4.7._
*/
function toInt184(int256 value) internal pure returns (int184 downcasted) {
downcasted = int184(value);
require(downcasted == value, "SafeCast: value doesn't fit in 184 bits");
}
/**
* @dev Returns the downcasted int176 from int256, reverting on
* overflow (when the input is less than smallest int176 or
* greater than largest int176).
*
* Counterpart to Solidity's `int176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*
* _Available since v4.7._
*/
function toInt176(int256 value) internal pure returns (int176 downcasted) {
downcasted = int176(value);
require(downcasted == value, "SafeCast: value doesn't fit in 176 bits");
}
/**
* @dev Returns the downcasted int168 from int256, reverting on
* overflow (when the input is less than smallest int168 or
* greater than largest int168).
*
* Counterpart to Solidity's `int168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*
* _Available since v4.7._
*/
function toInt168(int256 value) internal pure returns (int168 downcasted) {
downcasted = int168(value);
require(downcasted == value, "SafeCast: value doesn't fit in 168 bits");
}
/**
* @dev Returns the downcasted int160 from int256, reverting on
* overflow (when the input is less than smallest int160 or
* greater than largest int160).
*
* Counterpart to Solidity's `int160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*
* _Available since v4.7._
*/
function toInt160(int256 value) internal pure returns (int160 downcasted) {
downcasted = int160(value);
require(downcasted == value, "SafeCast: value doesn't fit in 160 bits");
}
/**
* @dev Returns the downcasted int152 from int256, reverting on
* overflow (when the input is less than smallest int152 or
* greater than largest int152).
*
* Counterpart to Solidity's `int152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*
* _Available since v4.7._
*/
function toInt152(int256 value) internal pure returns (int152 downcasted) {
downcasted = int152(value);
require(downcasted == value, "SafeCast: value doesn't fit in 152 bits");
}
/**
* @dev Returns the downcasted int144 from int256, reverting on
* overflow (when the input is less than smallest int144 or
* greater than largest int144).
*
* Counterpart to Solidity's `int144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*
* _Available since v4.7._
*/
function toInt144(int256 value) internal pure returns (int144 downcasted) {
downcasted = int144(value);
require(downcasted == value, "SafeCast: value doesn't fit in 144 bits");
}
/**
* @dev Returns the downcasted int136 from int256, reverting on
* overflow (when the input is less than smallest int136 or
* greater than largest int136).
*
* Counterpart to Solidity's `int136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*
* _Available since v4.7._
*/
function toInt136(int256 value) internal pure returns (int136 downcasted) {
downcasted = int136(value);
require(downcasted == value, "SafeCast: value doesn't fit in 136 bits");
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*
* _Available since v3.1._
*/
function toInt128(int256 value) internal pure returns (int128 downcasted) {
downcasted = int128(value);
require(downcasted == value, "SafeCast: value doesn't fit in 128 bits");
}
/**
* @dev Returns the downcasted int120 from int256, reverting on
* overflow (when the input is less than smallest int120 or
* greater than largest int120).
*
* Counterpart to Solidity's `int120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*
* _Available since v4.7._
*/
function toInt120(int256 value) internal pure returns (int120 downcasted) {
downcasted = int120(value);
require(downcasted == value, "SafeCast: value doesn't fit in 120 bits");
}
/**
* @dev Returns the downcasted int112 from int256, reverting on
* overflow (when the input is less than smallest int112 or
* greater than largest int112).
*
* Counterpart to Solidity's `int112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*
* _Available since v4.7._
*/
function toInt112(int256 value) internal pure returns (int112 downcasted) {
downcasted = int112(value);
require(downcasted == value, "SafeCast: value doesn't fit in 112 bits");
}
/**
* @dev Returns the downcasted int104 from int256, reverting on
* overflow (when the input is less than smallest int104 or
* greater than largest int104).
*
* Counterpart to Solidity's `int104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*
* _Available since v4.7._
*/
function toInt104(int256 value) internal pure returns (int104 downcasted) {
downcasted = int104(value);
require(downcasted == value, "SafeCast: value doesn't fit in 104 bits");
}
/**
* @dev Returns the downcasted int96 from int256, reverting on
* overflow (when the input is less than smallest int96 or
* greater than largest int96).
*
* Counterpart to Solidity's `int96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*
* _Available since v4.7._
*/
function toInt96(int256 value) internal pure returns (int96 downcasted) {
downcasted = int96(value);
require(downcasted == value, "SafeCast: value doesn't fit in 96 bits");
}
/**
* @dev Returns the downcasted int88 from int256, reverting on
* overflow (when the input is less than smallest int88 or
* greater than largest int88).
*
* Counterpart to Solidity's `int88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*
* _Available since v4.7._
*/
function toInt88(int256 value) internal pure returns (int88 downcasted) {
downcasted = int88(value);
require(downcasted == value, "SafeCast: value doesn't fit in 88 bits");
}
/**
* @dev Returns the downcasted int80 from int256, reverting on
* overflow (when the input is less than smallest int80 or
* greater than largest int80).
*
* Counterpart to Solidity's `int80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*
* _Available since v4.7._
*/
function toInt80(int256 value) internal pure returns (int80 downcasted) {
downcasted = int80(value);
require(downcasted == value, "SafeCast: value doesn't fit in 80 bits");
}
/**
* @dev Returns the downcasted int72 from int256, reverting on
* overflow (when the input is less than smallest int72 or
* greater than largest int72).
*
* Counterpart to Solidity's `int72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*
* _Available since v4.7._
*/
function toInt72(int256 value) internal pure returns (int72 downcasted) {
downcasted = int72(value);
require(downcasted == value, "SafeCast: value doesn't fit in 72 bits");
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*
* _Available since v3.1._
*/
function toInt64(int256 value) internal pure returns (int64 downcasted) {
downcasted = int64(value);
require(downcasted == value, "SafeCast: value doesn't fit in 64 bits");
}
/**
* @dev Returns the downcasted int56 from int256, reverting on
* overflow (when the input is less than smallest int56 or
* greater than largest int56).
*
* Counterpart to Solidity's `int56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*
* _Available since v4.7._
*/
function toInt56(int256 value) internal pure returns (int56 downcasted) {
downcasted = int56(value);
require(downcasted == value, "SafeCast: value doesn't fit in 56 bits");
}
/**
* @dev Returns the downcasted int48 from int256, reverting on
* overflow (when the input is less than smallest int48 or
* greater than largest int48).
*
* Counterpart to Solidity's `int48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*
* _Available since v4.7._
*/
function toInt48(int256 value) internal pure returns (int48 downcasted) {
downcasted = int48(value);
require(downcasted == value, "SafeCast: value doesn't fit in 48 bits");
}
/**
* @dev Returns the downcasted int40 from int256, reverting on
* overflow (when the input is less than smallest int40 or
* greater than largest int40).
*
* Counterpart to Solidity's `int40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*
* _Available since v4.7._
*/
function toInt40(int256 value) internal pure returns (int40 downcasted) {
downcasted = int40(value);
require(downcasted == value, "SafeCast: value doesn't fit in 40 bits");
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*
* _Available since v3.1._
*/
function toInt32(int256 value) internal pure returns (int32 downcasted) {
downcasted = int32(value);
require(downcasted == value, "SafeCast: value doesn't fit in 32 bits");
}
/**
* @dev Returns the downcasted int24 from int256, reverting on
* overflow (when the input is less than smallest int24 or
* greater than largest int24).
*
* Counterpart to Solidity's `int24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*
* _Available since v4.7._
*/
function toInt24(int256 value) internal pure returns (int24 downcasted) {
downcasted = int24(value);
require(downcasted == value, "SafeCast: value doesn't fit in 24 bits");
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*
* _Available since v3.1._
*/
function toInt16(int256 value) internal pure returns (int16 downcasted) {
downcasted = int16(value);
require(downcasted == value, "SafeCast: value doesn't fit in 16 bits");
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*
* _Available since v3.1._
*/
function toInt8(int256 value) internal pure returns (int8 downcasted) {
downcasted = int8(value);
require(downcasted == value, "SafeCast: value doesn't fit in 8 bits");
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*
* _Available since v3.0._
*/
function toInt256(uint256 value) internal pure returns (int256) {
// Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256");
return int256(value);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import "IERC20.sol";
import "SafeERC20.sol";
import "Abs.sol";
contract ShareWrapper {
using SafeERC20 for IERC20;
using Abs for int256;
address public share;
uint256 public fee;
address public feeTo;
struct TotalSupply {
uint256 wait;
uint256 staked;
uint256 withdrawable;
int256 reward;
}
struct Balances {
uint256 wait;
uint256 staked;
uint256 withdrawable;
int256 reward;
}
mapping(address => Balances) internal _balances;
TotalSupply internal _totalSupply;
function total_supply_wait() public view returns (uint256) {
return _totalSupply.wait;
}
function total_supply_staked() public view returns (uint256) {
return _totalSupply.staked;
}
function total_supply_withdraw() public view returns (uint256) {
return _totalSupply.withdrawable;
}
function total_supply_reward() public view returns (int256) {
return _totalSupply.reward;
}
function balance_wait(address account) public view returns (uint256) {
return _balances[account].wait;
}
function balance_staked(address account) public view returns (uint256) {
return _balances[account].staked;
}
function balance_withdraw(address account) public view returns (uint256) {
return _balances[account].withdrawable;
}
function balance_reward(address account) public view returns (int256) {
return _balances[account].reward;
}
function stake(uint256 amount) public payable virtual {
_totalSupply.wait += amount;
_balances[msg.sender].wait += amount;
IERC20(share).safeTransferFrom(msg.sender, address(this), amount);
}
function withdraw(uint256 amount) public virtual {
require(_balances[msg.sender].withdrawable >= amount, "withdraw request greater than withdrawable amount");
_totalSupply.withdrawable -= amount;
_balances[msg.sender].withdrawable -= amount;
int _reward = balance_reward(msg.sender);
if (_reward > 0) {
_balances[msg.sender].reward = 0;
_totalSupply.reward -= _reward;
IERC20(share).safeTransfer(msg.sender, amount + _reward.abs());
} else if (_reward < 0) {
_balances[msg.sender].reward = 0;
_totalSupply.reward -= _reward;
IERC20(share).safeTransfer(msg.sender, amount - _reward.abs());
} else {
IERC20(share).safeTransfer(msg.sender, amount);
}
}
}{
"evmVersion": "istanbul",
"optimizer": {
"enabled": true,
"runs": 200
},
"libraries": {
"RiskOnPool.sol": {}
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"AcceptedTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"Blacklisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newBlacklister","type":"address"}],"name":"BlacklisterChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_capacity","type":"uint256"}],"name":"CapacityUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Exit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"address","name":"_feeTo","type":"address"}],"name":"FeeToUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"FeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_gasthreshold","type":"uint256"}],"name":"GasthresholdUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_glpInFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_glpOutFee","type":"uint256"}],"name":"GlpFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"address","name":"_glpManager","type":"address"}],"name":"GlpManagerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"HandledReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"_address","type":"address[]"}],"name":"HandledStakeRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"_address","type":"address[]"}],"name":"HandledWithdrawRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"executor","type":"address"},{"indexed":false,"internalType":"uint256","name":"at","type":"uint256"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_minimumRequest","type":"uint256"}],"name":"MinimumRequestUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOperator","type":"address"},{"indexed":true,"internalType":"address","name":"newOperator","type":"address"}],"name":"OperatorTransferred","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":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Redeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"period","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalStakedAmount","type":"uint256"},{"indexed":false,"internalType":"int256","name":"reward","type":"int256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"int256","name":"reward","type":"int256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"address","name":"_rewardTracker","type":"address"}],"name":"RewardTrackerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"address","name":"_glpRouter","type":"address"},{"indexed":false,"internalType":"address","name":"_rewardRouter","type":"address"}],"name":"RouterUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"}],"name":"SignalledTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"ignored","type":"address"},{"indexed":false,"internalType":"uint256","name":"atEpoch","type":"uint256"}],"name":"StakeRequestIgnored","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"StakedByGov","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"StakedETHByGov","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"address","name":"_treasury","type":"address"}],"name":"TreasuryUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"UnBlacklisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_userExitEpochs","type":"uint256"}],"name":"UserExitEpochsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_withdrawLockupEpochs","type":"uint256"}],"name":"WithdrawLockupEpochsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"ignored","type":"address"},{"indexed":false,"internalType":"uint256","name":"atEpoch","type":"uint256"}],"name":"WithdrawRequestIgnored","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"atEpoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"WithdrawnByGov","type":"event"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"}],"name":"acceptTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"amount","type":"int256"}],"name":"allocateReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balance_reward","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balance_staked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balance_wait","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balance_withdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"blacklist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"blacklister","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"boardroomHistory","outputs":[{"internalType":"int256","name":"rewardReceived","type":"int256"},{"internalType":"int256","name":"rewardPerShare","type":"int256"},{"internalType":"uint256","name":"time","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"member","type":"address"}],"name":"canWithdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"capacity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"member","type":"address"}],"name":"earned","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeTo","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gasthreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_maximum","type":"bool"}],"name":"getGLPPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"member","type":"address"}],"name":"getLastSnapshotIndexOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRequiredCollateral","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakedGLP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_maximum","type":"bool"}],"name":"getStakedGLPUSDValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"glpInFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"glpManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"glpOutFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"glpRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_shouldClaimGmx","type":"bool"},{"internalType":"bool","name":"_shouldStakeGmx","type":"bool"},{"internalType":"bool","name":"_shouldClaimEsGmx","type":"bool"},{"internalType":"bool","name":"_shouldStakeEsGmx","type":"bool"},{"internalType":"bool","name":"_shouldStakeMultiplierPoints","type":"bool"},{"internalType":"bool","name":"_shouldClaimWeth","type":"bool"},{"internalType":"bool","name":"_shouldConvertWethToEth","type":"bool"}],"name":"handleRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_address","type":"address[]"}],"name":"handleStakeRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_address","type":"address[]"}],"name":"handleWithdrawRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_share","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"address","name":"_feeTo","type":"address"},{"internalType":"uint256","name":"_glpInFee","type":"uint256"},{"internalType":"uint256","name":"_glpOutFee","type":"uint256"},{"internalType":"uint256","name":"_gasthreshold","type":"uint256"},{"internalType":"uint256","name":"_minimumRequset","type":"uint256"},{"internalType":"address","name":"_treasury","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isBlacklisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestSnapshotIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"members","outputs":[{"internalType":"int256","name":"rewardEarned","type":"int256"},{"internalType":"uint256","name":"lastSnapshotIndex","type":"uint256"},{"internalType":"uint256","name":"epochTimerStart","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumRequest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextEpochPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"pendingReceivers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"pendingSenders","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_address","type":"address[]"}],"name":"removeWithdrawRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerShare","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardTracker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_capacity","type":"uint256"}],"name":"setCapacity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_userExitEpochs","type":"uint256"}],"name":"setExitEpochs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeTo","type":"address"}],"name":"setFeeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gasthreshold","type":"uint256"}],"name":"setGasThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_glpInFee","type":"uint256"},{"internalType":"uint256","name":"_glpOutFee","type":"uint256"}],"name":"setGlpFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_glpManager","type":"address"}],"name":"setGlpManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_withdrawLockupEpochs","type":"uint256"}],"name":"setLockUp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minimumRequest","type":"uint256"}],"name":"setMinimumRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardTracker","type":"address"}],"name":"setRewardTracker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_glpRouter","type":"address"},{"internalType":"address","name":"_rewardRouter","type":"address"}],"name":"setRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"share","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"signalTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_minUsdg","type":"uint256"},{"internalType":"uint256","name":"_minGlp","type":"uint256"}],"name":"stakeByGov","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"_minUsdg","type":"uint256"},{"internalType":"uint256","name":"_minGlp","type":"uint256"}],"name":"stakeETHByGov","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakeRequest","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"requestTimestamp","type":"uint256"},{"internalType":"uint256","name":"requestEpoch","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalWithdrawRequest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"total_supply_reward","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"total_supply_staked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"total_supply_wait","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"total_supply_withdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOperator_","type":"address"}],"name":"transferOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"treasuryWithdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"treasuryWithdrawFundsETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"unBlacklist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newBlacklister","type":"address"}],"name":"updateBlacklister","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"userExitEpochs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint256","name":"_glpAmount","type":"uint256"},{"internalType":"uint256","name":"_minOut","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"withdrawByGov","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawLockupEpochs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"withdrawRequest","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"requestTimestamp","type":"uint256"},{"internalType":"uint256","name":"requestEpoch","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw_request","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
6080604052601f805474b95db5b167d75e6d04227cfffa61069348d271f500610100600160a81b0319909116179055602080546001600160a01b031990811673a906f338cb21815cbc4bc87ace9e68c87ef8d8f117909155602180548216733963ffc9dff443c2a94f21b129d429891e32ec1817905560228054909116731addd80e6039594ee970e5872d247bf0414c8903179055348015620000a157600080fd5b506001600955620000b23362000102565b600b80546001600160a01b031916339081179091556040516000907f74da04524d50c64947f5dd5381ef1a4dca5cba8ed1d816243f9e48aa0b5617ed908290a3600e805460ff1916905562000154565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b615f6480620001646000396000f3fe6080604052600436106104c35760003560e01c80638ab4d57511610276578063d0d1cc751161014f578063f2eb6f58116100c1578063f47f9f5311610085578063f47f9f5314610ed5578063f5d6e57b14610f0b578063f9f92be414610f2b578063fa6db1bc14610f4b578063fc0c546a14610f6b578063fe575a8714610f8b57600080fd5b8063f2eb6f5814610e35578063f2fde38b14610e55578063f320d28b14610e75578063f45adcb614610e95578063f46901ed14610eb557600080fd5b8063e9fad8ee11610113578063e9fad8ee14610d8a578063eabba14514610d9f578063eef3a36a14610dbf578063ef9aacfd14610dd5578063f0f4426014610df5578063f2293bb014610e1557600080fd5b8063d0d1cc7514610ce4578063d84bcb0c14610cf9578063ddca3f4314610d19578063e016e44b14610d2f578063e1b9db8914610d5457600080fd5b8063afcd33a7116101e8578063bf9a3ad0116101ac578063bf9a3ad014610c2f578063bfb1162014610c4f578063c58e384314610c6f578063c5967c2614610c8f578063cb3b3ab314610ca4578063cf35ab9414610cc457600080fd5b8063afcd33a714610b8d578063b3041a3714610bc7578063bbbd0db914610be7578063bd10243014610bfc578063be040fb014610c1a57600080fd5b80639ecac8471161023a5780639ecac84714610aef578063a449beff14610b05578063a694fc3a14610b25578063a8d5fd6514610b38578063ab3294dd14610b58578063ad38bf2214610b6d57600080fd5b80638ab4d57514610a675780638ab775e214610a7c5780638da5cb5b14610a9c578063900cf0cf14610aba57806391915ef814610acf57600080fd5b80633f9e3f04116103a857806362d45f8f1161031a5780636df92e03116102de5780636df92e03146109ae578063714b4658146109c4578063715018a6146109fd5780638456cb5914610a1257806385b5b4c014610a2757806389e57bcc14610a4757600080fd5b806362d45f8f146108f5578063655603a41461092e57806369fe0e2d1461094e5780636b5abd2d1461096e5780636bcb411a1461098e57600080fd5b806349211cf81161036c57806349211cf814610849578063570ca735146108695780635a3bb989146108875780635c975abb146108a75780635cfc1a51146108bf57806361d027b3146108d557600080fd5b80633f9e3f04146107c957806341d68b8f146107de5780634456eda2146107fe578063446a2ec81461081e578063485742911461083357600080fd5b80631e0ed754116104415780632c9dec98116104055780632c9dec981461072c5780632e1a7d4d1461073f57806330468f4b1461075f57806330b700021461077f57806334c15f581461079f5780633f4ba83a146107b457600080fd5b80631e0ed7541461068e5780631e85cd65146106a45780632012119d146106ba578063232d3c9d146106f657806329605e771461070c57600080fd5b806314cbc46a1161048857806314cbc46a146105d3578063158ef93e1461060f57806315b3d2f51461063957806319262d301461064e5780631a8952661461066e57600080fd5b80628cc262146104cf578063017e7e581461050257806308ae4b0c1461053a5780630a60f0c81461059157806314212be3146105b157600080fd5b366104ca57005b600080fd5b3480156104db57600080fd5b506104ef6104ea36600461568f565b610fc4565b6040519081526020015b60405180910390f35b34801561050e57600080fd5b50600254610522906001600160a01b031681565b6040516001600160a01b0390911681526020016104f9565b34801561054657600080fd5b5061057661055536600461568f565b60146020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016104f9565b34801561059d57600080fd5b506104ef6105ac3660046156bf565b61104d565b3480156105bd57600080fd5b506105d16105cc3660046156dc565b6110c2565b005b3480156105df57600080fd5b506105766105ee36600461568f565b60176020526000908152604090208054600182015460029092015490919083565b34801561061b57600080fd5b50601f546106299060ff1681565b60405190151581526020016104f9565b34801561064557600080fd5b506006546104ef565b34801561065a57600080fd5b5061062961066936600461568f565b6113ca565b34801561067a57600080fd5b506105d161068936600461568f565b611405565b34801561069a57600080fd5b506104ef600f5481565b3480156106b057600080fd5b506104ef601a5481565b3480156106c657600080fd5b506105766106d536600461568f565b60166020526000908152604090208054600182015460029092015490919083565b34801561070257600080fd5b506104ef60125481565b34801561071857600080fd5b506105d161072736600461568f565b6114a8565b6105d161073a366004615761565b6114de565b34801561074b57600080fd5b506105d161075a366004615761565b6117c7565b34801561076b57600080fd5b506105d161077a366004615761565b6119a0565b34801561078b57600080fd5b506105d161079a36600461577a565b611cae565b3480156107ab57600080fd5b506104ef611db6565b3480156107c057600080fd5b506105d1611e2f565b3480156107d557600080fd5b506104ef611e63565b3480156107ea57600080fd5b506105d16107f9366004615810565b611e75565b34801561080a57600080fd5b50600b546001600160a01b03163314610629565b34801561082a57600080fd5b506104ef611ff9565b34801561083f57600080fd5b506104ef601c5481565b34801561085557600080fd5b506105d161086436600461568f565b61200c565b34801561087557600080fd5b50600b546001600160a01b0316610522565b34801561089357600080fd5b50602054610522906001600160a01b031681565b3480156108b357600080fd5b50600e5460ff16610629565b3480156108cb57600080fd5b506104ef601e5481565b3480156108e157600080fd5b50601154610522906001600160a01b031681565b34801561090157600080fd5b506104ef61091036600461568f565b6001600160a01b031660009081526003602052604090206002015490565b34801561093a57600080fd5b506105d161094936600461568f565b612102565b34801561095a57600080fd5b506105d1610969366004615761565b612656565b34801561097a57600080fd5b506105d1610989366004615859565b612703565b34801561099a57600080fd5b50602254610522906001600160a01b031681565b3480156109ba57600080fd5b506104ef601d5481565b3480156109d057600080fd5b506104ef6109df36600461568f565b6001600160a01b031660009081526014602052604090206001015490565b348015610a0957600080fd5b506105d161292c565b348015610a1e57600080fd5b506105d1612960565b348015610a3357600080fd5b506104ef610a4236600461591e565b612992565b348015610a5357600080fd5b506104ef610a62366004615957565b612acb565b348015610a7357600080fd5b506104ef612bc3565b348015610a8857600080fd5b506105d1610a97366004615761565b612c30565b348015610aa857600080fd5b50600a546001600160a01b0316610522565b348015610ac657600080fd5b506104ef612c97565b348015610adb57600080fd5b506105d1610aea366004615761565b612ce1565b348015610afb57600080fd5b506104ef601b5481565b348015610b1157600080fd5b506105d1610b20366004615859565b612d48565b6105d1610b33366004615761565b612e0e565b348015610b4457600080fd5b50600054610522906001600160a01b031681565b348015610b6457600080fd5b506005546104ef565b348015610b7957600080fd5b506105d1610b8836600461568f565b6131a0565b348015610b9957600080fd5b506104ef610ba836600461568f565b6001600160a01b03166000908152600360208190526040909120015490565b348015610bd357600080fd5b506105d1610be2366004615859565b613276565b348015610bf357600080fd5b506004546104ef565b348015610c0857600080fd5b50600c546001600160a01b0316610522565b348015610c2657600080fd5b506105d1613570565b348015610c3b57600080fd5b506105d1610c4a36600461599d565b6137dc565b348015610c5b57600080fd5b506105d1610c6a3660046159d9565b613845565b348015610c7b57600080fd5b50610576610c8a366004615761565b6138b1565b348015610c9b57600080fd5b506104ef6138e4565b348015610cb057600080fd5b506105d1610cbf366004615761565b61392e565b348015610cd057600080fd5b506104ef610cdf3660046159fc565b613995565b348015610cf057600080fd5b506007546104ef565b348015610d0557600080fd5b506105d1610d14366004615761565b613acd565b348015610d2557600080fd5b506104ef60015481565b348015610d3b57600080fd5b50601f546105229061010090046001600160a01b031681565b348015610d6057600080fd5b50610522610d6f36600461568f565b6018602052600090815260409020546001600160a01b031681565b348015610d9657600080fd5b506105d1613b34565b348015610dab57600080fd5b506104ef610dba36600461568f565b614020565b348015610dcb57600080fd5b506104ef60135481565b348015610de157600080fd5b506105d1610df036600461568f565b61403e565b348015610e0157600080fd5b506105d1610e1036600461568f565b614197565b348015610e2157600080fd5b506105d1610e3036600461568f565b614243565b348015610e4157600080fd5b506105d1610e50366004615761565b614335565b348015610e6157600080fd5b506105d1610e7036600461568f565b6143fd565b348015610e8157600080fd5b506104ef610e903660046156bf565b614495565b348015610ea157600080fd5b50610522610eb0366004615a28565b6144cf565b348015610ec157600080fd5b506105d1610ed036600461568f565b614507565b348015610ee157600080fd5b506104ef610ef036600461568f565b6001600160a01b031660009081526003602052604090205490565b348015610f1757600080fd5b506105d1610f26366004615a52565b6145e3565b348015610f3757600080fd5b506105d1610f4636600461568f565b6146f2565b348015610f5757600080fd5b50602154610522906001600160a01b031681565b348015610f7757600080fd5b50601054610522906001600160a01b031681565b348015610f9757600080fd5b50610629610fa636600461568f565b6001600160a01b03166000908152600d602052604090205460ff1690565b600080610fcf614798565b6020015190506000610fe084614812565b6020908101516001600160a01b03861660009081526014909252604090912054909150670de0b6b3a76400006110168385615a8a565b61102761102288614020565b6148a8565b6110319190615ac9565b61103b9190615b64565b6110459190615b92565b949350505050565b60215460405163e245b5af60e01b815282151560048201526000916001600160a01b03169063e245b5af90602401602060405180830381865afa158015611098573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110bc9190615bd3565b92915050565b601f5460ff16156111105760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b60448201526064015b60405180910390fd5b6001600160a01b0389166111745760405162461bcd60e51b815260206004820152602560248201527f746f6b656e20616464726573732063616e206e6f74206265207a65726f206164604482015264647265737360d81b6064820152608401611107565b6001600160a01b0388166111d85760405162461bcd60e51b815260206004820152602560248201527f736861726520616464726573732063616e206e6f74206265207a65726f206164604482015264647265737360d81b6064820152608401611107565b6001600160a01b03861661123c5760405162461bcd60e51b815260206004820152602560248201527f666565546f20616464726573732063616e206e6f74206265207a65726f206164604482015264647265737360d81b6064820152608401611107565b6001600160a01b0381166112625760405162461bcd60e51b815260040161110790615bec565b601080546001600160a01b03199081166001600160a01b038c8116919091179092556000805482168b841617815560018a81556002805484168b8616178155601c8a9055601d8990556012889055601387905560118054909416948616949094179092556040805160608101825282815260208082018481524383850181815260158054808a018255975284517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47560039098029788015591517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47687015590517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47790950194909455601a959095556004601b5564e8d4a51000601e55601f805460ff191690941790935551908152909133917f25ff68dd81b34665b5ba7e553ee5511bf6812e12adb4a7e2c0d9e26b3099ce79910160405180910390a250505050505050505050565b60006113d4612c97565b601a546001600160a01b0384166000908152601460205260409020600201546113fd9190615c34565b111592915050565b600c546001600160a01b0316331461145f5760405162461bcd60e51b815260206004820152601d60248201527f63616c6c6572206973206e6f742074686520626c61636b6c69737465720000006044820152606401611107565b6001600160a01b0381166000818152600d6020526040808220805460ff19169055517f117e3210bb9aa7d9baff172026820255c6f6c30ba8999d1c2fd88e2848137c4e9190a250565b600a546001600160a01b031633146114d25760405162461bcd60e51b815260040161110790615c4c565b6114db81614916565b50565b60006114e933614020565b116115365760405162461bcd60e51b815260206004820152601960248201527f546865206d656d62657220646f6573206e6f74206578697374000000000000006044820152606401611107565b336000818152600d602052604090205460ff16156115665760405162461bcd60e51b815260040161110790615c81565b61156e6149da565b816000036115cc5760405162461bcd60e51b815260206004820152602560248201527f776974686472617720726571756573742063616e6e6f7420626520657175616c604482015264020746f20360dc1b6064820152608401611107565b336000908152600360209081526040808320600101546017909252909120546115f59084615c34565b11156116565760405162461bcd60e51b815260206004820152602a60248201527f776974686472617720616d6f756e74206578636565647320746865207374616b60448201526965642062616c616e636560b01b6064820152608401611107565b61165e612c97565b601a543360009081526014602052604090206002015461167e9190615c34565b11156116cc5760405162461bcd60e51b815260206004820152601860248201527f7374696c6c20696e207769746864726177206c6f636b757000000000000000006044820152606401611107565b60125434101561171e5760405162461bcd60e51b815260206004820152601f60248201527f6e656564206d6f72652067617320746f2068616e646c652072657175657374006044820152606401611107565b336000908152601760205260408120805484929061173d908490615c34565b909155505033600090815260176020526040902042600190910155611760612c97565b33600090815260176020526040812060020191909155600f8054849290611788908490615c34565b909155505060405182815233907f17040713250ec5f668a1c39e7939900e78558350dbaff0ebef34268dfa8ea4ac906020015b60405180910390a25050565b43600090815260086020908152604080832032845290915290205460ff16156118025760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832033845290915290205460ff161561183d5760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832032845282528083208054600160ff1991821681179092553380865283862080549092169092179055600d9092529091205460ff16156118a05760405162461bcd60e51b815260040161110790615c81565b6118a86149da565b816000036118ec5760405162461bcd60e51b8152602060048201526011602482015270063616e6e6f74207769746864726177203607c1b6044820152606401611107565b6118f582614a20565b6010546001600160a01b0316639dc29fac336119168564e8d4a51000615cf7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561195c57600080fd5b505af192505050801561196d575060015b5060405182815233907f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5906020016117bb565b43600090815260086020908152604080832032845290915290205460ff16156119db5760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832033845290915290205460ff1615611a165760405162461bcd60e51b815260040161110790615cb1565b4360009081526008602090815260408083203284529091528082208054600160ff19918216811790925533808552929093208054909316179091556011546001600160a01b031614611a7a5760405162461bcd60e51b815260040161110790615d16565b6000611a8560055490565b11611aec5760405162461bcd60e51b815260206004820152603160248201527f726577617264732063616e6e6f7420626520616c6c6f6361746564207768656e604482015270020746f74616c537570706c79206973203607c1b6064820152608401611107565b6000611af6614798565b6020015190506000611b0a61102260055490565b611b1c84670de0b6b3a7640000615ac9565b611b269190615b64565b611b309083615b92565b60408051606081018252858152602081018381524392820192835260158054600181018255600091825283517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47560039092029182015591517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47683015592517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47790910155600780549394509092869290611bea908490615b92565b90915550611bf89050612c97565b6011546040805163ef78d4fd60e01b815290517f01028dd4750c207f52d9ed11198b98d345c8b3000be65704a473188b65a22430926001600160a01b03169163ef78d4fd9160048083019260209291908290030181865afa158015611c61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c859190615bd3565b60055460408051928352602083019190915281018790526060015b60405180910390a250505050565b6011546001600160a01b03163314611cd85760405162461bcd60e51b815260040161110790615d16565b6000611ce2612c97565b60205460405163185b800160e11b81528a15156004820152891515602482015288151560448201528715156064820152861515608482015285151560a482015284151560c48201529192506001600160a01b0316906330b700029060e401600060405180830381600087803b158015611d5a57600080fd5b505af1158015611d6e573d6000803e3d6000fd5b50505050807f07bed104aa0bdd4ab1d9cf2baf20a7d120a791b537cdeea0b559c5e70752166642604051611da491815260200190565b60405180910390a25050505050505050565b60008060046003015412611dfc57600754611dd090614bb3565b600654600554600454611de39190615c34565b611ded9190615c34565b611df79190615c34565b905090565b600754611e0890614bb3565b600654600554600454611e1b9190615c34565b611e259190615c34565b611df79190615d4d565b6011546001600160a01b03163314611e595760405162461bcd60e51b815260040161110790615d16565b611e61614bcb565b565b601554600090611df790600190615d4d565b600b546001600160a01b03163314611e9f5760405162461bcd60e51b815260040161110790615d64565b6001600160a01b038216611f075760405162461bcd60e51b815260206004820152602960248201527f676c70526f7574657220616464726573732063616e206e6f74206265207a65726044820152686f206164647265737360b81b6064820152608401611107565b6001600160a01b038116611f725760405162461bcd60e51b815260206004820152602c60248201527f726577617264526f7574657220616464726573732063616e206e6f742062652060448201526b7a65726f206164647265737360a01b6064820152608401611107565b601f8054610100600160a81b0319166101006001600160a01b038581169190910291909117909155602080546001600160a01b031916918316919091179055611fb9612c97565b604080516001600160a01b038086168252841660208201527feb132a1d6e894221645af2a8ae643aa3133ac93ac6a5861acb5c1912abe4d1f691016117bb565b6000612003614798565b60200151905090565b600b546001600160a01b031633146120365760405162461bcd60e51b815260040161110790615d64565b6001600160a01b03811661209f5760405162461bcd60e51b815260206004820152602a60248201527f676c704d616e6167657220616464726573732063616e206e6f74206265207a65604482015269726f206164647265737360b01b6064820152608401611107565b602180546001600160a01b0319166001600160a01b0383161790556120c2612c97565b6040516001600160a01b03831681527f63d3374d59c92e8cbc4e3d2b475f744aab3e2e58d6f2ddf03f1d57b5f999e7c1906020015b60405180910390a250565b61210a614c1d565b6001600160a01b038116600090815260166020526040902054156121705760405162461bcd60e51b815260206004820152601d60248201527f506f6f6c3a2073656e64657220686173207374616b65526571756573740000006044820152606401611107565b6001600160a01b038116600090815260176020526040902054156121d65760405162461bcd60e51b815260206004820181905260248201527f506f6f6c3a2073656e64657220686173207769746864726177526571756573746044820152606401611107565b6001600160a01b0381811660009081526018602052604090205433911681146122415760405162461bcd60e51b815260206004820152601c60248201527f506f6f6c3a207472616e73666572206e6f74207369676e616c6c6564000000006044820152606401611107565b6001600160a01b03808316600090815260186020908152604080832080546001600160a01b03191690559284168252601990529081206122809161564a565b61228981614c76565b6001600160a01b0382166000908152600360205260409020548015612303576001600160a01b038316600090815260036020526040812080548392906122d0908490615d4d565b90915550506001600160a01b038216600090815260036020526040812080548392906122fd908490615c34565b90915550505b600061230e84614020565b90508015612377576001600160a01b03841660009081526003602052604081206001018054839290612341908490615d4d565b90915550506001600160a01b03831660009081526003602052604081206001018054839290612371908490615c34565b90915550505b6001600160a01b03841660009081526003602052604090206002015480156123fa576001600160a01b038516600090815260036020526040812060020180548392906123c4908490615d4d565b90915550506001600160a01b038416600090815260036020526040812060020180548392906123f4908490615c34565b90915550505b6001600160a01b03851660009081526003602081905260409091200154801561247e576001600160a01b03861660009081526003602081905260408220018054839290612448908490615a8a565b90915550506001600160a01b03851660009081526003602081905260408220018054839290612478908490615b92565b90915550505b6010546040516370a0823160e01b81526001600160a01b03888116600483015260009216906370a0823190602401602060405180830381865afa1580156124c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ed9190615bd3565b905080156125c257601054604051632770a7eb60e21b81526001600160a01b0389811660048301526024820184905290911690639dc29fac90604401600060405180830381600087803b15801561254357600080fd5b505af1158015612557573d6000803e3d6000fd5b50506010546040516340c10f1960e01b81526001600160a01b038a811660048301526024820186905290911692506340c10f199150604401600060405180830381600087803b1580156125a957600080fd5b505af11580156125bd573d6000803e3d6000fd5b505050505b6001600160a01b0387811660008181526014602090815260408083208054958c1680855282852096875560018083018054918901919091556002808401805491909901558686529185905590849055929094559251918252917fe7569f2b2aaa79a3c4946a7d0a3452fa12046ae9f78d7ed4b7d4871eed7cc2cd910160405180910390a25050505050506114db6001600955565b600b546001600160a01b031633146126805760405162461bcd60e51b815260040161110790615d64565b6101f48111156126c65760405162461bcd60e51b81526020600482015260116024820152706665653a206f7574206f662072616e676560781b6044820152606401611107565b60018190556126d3612c97565b6040518281527f528d9479e9f9889a87a3c30c7f7ba537e5e59c4c85a37733b16e57c62df61302906020016120f7565b6011546001600160a01b0316331461272d5760405162461bcd60e51b815260040161110790615d16565b6000612737612c97565b905060005b82518110156128fb57600083828151811061275957612759615da8565b6020908102919091018101516001600160a01b0381166000908152601690925260409091208054600290910154919250908490036127db57816001600160a01b03167f5f990b332f38535955993c04fe357f73b556a11631fecbe353f5c6e0ff116bdb856040516127cc91815260200190565b60405180910390a250506128e9565b6001600160a01b03821660009081526016602052604081206001015490036128045750506128e9565b61280d82614f2b565b6001600160a01b03821660009081526003602052604081208054839290612835908490615d4d565b90915550506001600160a01b03821660009081526003602052604081206001018054839290612865908490615c34565b90915550506004805482919060009061287f908490615d4d565b909155505060058054829190600090612899908490615c34565b909155506128aa9050600185615d4d565b6001600160a01b039092166000908152601460209081526040808320600290810195909555601690915281208181556001810182905590920191909155505b806128f381615dbe565b91505061273c565b50807f65b1dcd319fc8a4b2ddb8918c6358c2b3ebbbbf27c2204f329405fd2ef682755836040516117bb9190615dd7565b600a546001600160a01b031633146129565760405162461bcd60e51b815260040161110790615c4c565b611e616000614fc6565b6011546001600160a01b0316331461298a5760405162461bcd60e51b815260040161110790615d16565b611e61615018565b6011546000906001600160a01b031633146129bf5760405162461bcd60e51b815260040161110790615d16565b6021546129da906001600160a01b0387811691166000615055565b6021546129f4906001600160a01b03878116911686615055565b601f5460405163364e231160e01b81526001600160a01b0387811660048301526024820187905260448201869052606482018590526000926101009004169063364e2311906084016020604051808303816000875af1158015612a5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a7f9190615bd3565b9050612a89612c97565b604080518781524260208201527ff660ec8bb3613cefbef56487f01cf74b6df0ee24932910bff6960af1ebd7fb5f91015b60405180910390a295945050505050565b6011546000906001600160a01b03163314612af85760405162461bcd60e51b815260040161110790615d16565b601f546040516303cea95560e21b81526001600160a01b0387811660048301526024820187905260448201869052848116606483015260009261010090041690630f3aa554906084016020604051808303816000875af1158015612b60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b849190615bd3565b9050612b8e612c97565b604080518681524260208201527fff0c8137cc5716ccb955c00c549b390b0fd88d17963e8d5cff2dbcd52f75bd6b9101612aba565b6022546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612c0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df79190615bd3565b600b546001600160a01b03163314612c5a5760405162461bcd60e51b815260040161110790615d64565b601a819055612c67612c97565b6040518281527ffbb1a1496a0c6846a70f52324fa97489b5dd4f345cec03011530b92cb8efd02f906020016120f7565b6011546040805163900cf0cf60e01b815290516000926001600160a01b03169163900cf0cf9160048083019260209291908290030181865afa158015612c0c573d6000803e3d6000fd5b6011546001600160a01b03163314612d0b5760405162461bcd60e51b815260040161110790615d16565b601e819055612d18612c97565b6040518281527fbe7f9e13de886daecad6ce97a1f9723e1f5a143d2e447587e282275a819c27ad906020016120f7565b6011546001600160a01b03163314612d725760405162461bcd60e51b815260040161110790615d16565b60005b8151811015612e0a576000828281518110612d9257612d92615da8565b6020908102919091018101516001600160a01b038116600090815260179092526040822054600f805492945090928392612dcd908490615d4d565b9091555050506001600160a01b03166000908152601760205260408120818155600181018290556002015580612e0281615dbe565b915050612d75565b5050565b43600090815260086020908152604080832032845290915290205460ff1615612e495760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832033845290915290205460ff1615612e845760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832032845282528083208054600160ff1991821681179092553380865283862080549092169092179055600d9092529091205460ff1615612ee75760405162461bcd60e51b815260040161110790615c81565b612eef6149da565b601354821015612f385760405162461bcd60e51b81526020600482015260146024820152737374616b6520616d6f756e7420746f6f206c6f7760601b6044820152606401611107565b601e546004546005548491612f4c91615c34565b612f569190615c34565b1115612f985760405162461bcd60e51b81526020600482015260116024820152707374616b65206e6f20636170616369747960781b6044820152606401611107565b601254341015612fea5760405162461bcd60e51b815260206004820152601f60248201527f6e656564206d6f72652067617320746f2068616e646c652072657175657374006044820152606401611107565b6001541561303f576000612710600154846130059190615cf7565b61300f9190615e24565b905061301b8184615d4d565b60025460005491945061303d916001600160a01b03908116913391168461519d565b505b601c541561308d576000612710601c548461305a9190615cf7565b6130649190615e24565b90506130708184615d4d565b60005490935061308b906001600160a01b031633308461519d565b505b613096826151db565b33600090815260166020526040812080548492906130b5908490615c34565b9091555050336000908152601660205260409020426001909101556130d8612c97565b336000818152601660205260409020600201919091556010546001600160a01b0316906340c10f19906131108564e8d4a51000615cf7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561315657600080fd5b505af115801561316a573d6000803e3d6000fd5b50506040518481523392507f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d91506020016117bb565b600a546001600160a01b031633146131ca5760405162461bcd60e51b815260040161110790615c4c565b6001600160a01b03811661322c5760405162461bcd60e51b815260206004820152602360248201527f6e657720626c61636b6c697374657220697320746865207a65726f206164647260448201526265737360e81b6064820152608401611107565b600c80546001600160a01b0319166001600160a01b0383169081179091556040517fc67398012c111ce95ecb7429b933096c977380ee6c421175a71a4a4c6c88c06e90600090a250565b6011546001600160a01b031633146132a05760405162461bcd60e51b815260040161110790615d16565b60006132aa612c97565b905060005b825181101561353f5760008382815181106132cc576132cc615da8565b6020908102919091018101516001600160a01b038116600090815260179092526040909120805460029091015491925090819085900361335157826001600160a01b03167f59ffb535f3d904d6d7a0c5a03d4c9bb5c905ae89801ab878ff57d921a49866a78660405161334191815260200190565b60405180910390a250505061352d565b6001600160a01b038316600090815260176020526040812060010154900361337b5750505061352d565b61338483615231565b50601d5415613434576000612710601d54846133a09190615cf7565b6133aa9190615e24565b6010549091506001600160a01b0316639dc29fac856133ce8464e8d4a51000615cf7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561341457600080fd5b505af1925050508015613425575060015b506134308184615d4d565b9150505b6001600160a01b0383166000908152600360205260408120600101805484929061345f908490615d4d565b90915550506001600160a01b0383166000908152600360205260408120600201805483929061348f908490615c34565b9091555050600580548391906000906134a9908490615d4d565b9091555050600680548291906000906134c3908490615c34565b9250508190555081600f60008282546134dc9190615d4d565b909155506134ed9050600186615d4d565b6001600160a01b03909316600090815260146020908152604080832060029081019690965560179091528120818155600181018290559093019290925550505b8061353781615dbe565b9150506132af565b50807f0d96234ba460608ab8827ba1d3e6a094cac6317b890fe4cd9a289760eeac00c7836040516117bb9190615dd7565b43600090815260086020908152604080832032845290915290205460ff16156135ab5760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832033845290915290205460ff16156135e65760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832032845282528083208054600160ff1991821681179092553380865283862080549092169092179055600d9092529091205460ff16156136495760405162461bcd60e51b815260040161110790615c81565b6136516149da565b600061365b612c97565b3360009081526016602052604090206002015490915081146136b05760405162461bcd60e51b815260206004820152600e60248201526d63616e206e6f742072656465656d60901b6044820152606401611107565b3360009081526003602052604081208054918291906136cf8380615d4d565b9091555050600480548291906000906136e9908490615d4d565b9091555050600054613705906001600160a01b031633836152c3565b6010546001600160a01b0316639dc29fac336137268464e8d4a51000615cf7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561376c57600080fd5b505af192505050801561377d575060015b50336000818152601660205260408082208281556001810183905560020191909155517f4896181ff8f4543cc00db9fe9b6fb7e6f032b7eb772c72ab1ec1b4d2e03b9369906137cf9084815260200190565b60405180910390a2505050565b6011546001600160a01b031633146138065760405162461bcd60e51b815260040161110790615d16565b6001600160a01b03811661382c5760405162461bcd60e51b815260040161110790615e38565b6138406001600160a01b03841682846152c3565b505050565b61384d614c1d565b6011546001600160a01b031633146138775760405162461bcd60e51b815260040161110790615d16565b6001600160a01b03811661389d5760405162461bcd60e51b815260040161110790615e38565b6138a781836152f3565b612e0a6001600955565b601581815481106138c157600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b601154604080516362cb3e1360e11b815290516000926001600160a01b03169163c5967c269160048083019260209291908290030181865afa158015612c0c573d6000803e3d6000fd5b600b546001600160a01b031633146139585760405162461bcd60e51b815260040161110790615d64565b6012819055613965612c97565b6040518281527f192287b9a4b21cf33b103bb4f9e7927e5bc8368ba1af75a03650308129716dea906020016120f7565b6011546000906001600160a01b031633146139c25760405162461bcd60e51b815260040161110790615d16565b47841115613a055760405162461bcd60e51b815260206004820152601060248201526f6e6f7420656e6f7567682066756e647360801b6044820152606401611107565b601f546040516353a8aa0360e01b8152600481018590526024810184905260009161010090046001600160a01b0316906353a8aa0390879060440160206040518083038185885af1158015613a5e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190613a839190615bd3565b9050613a8d612c97565b604080518781524260208201527ff1e1ba0bbee3eed08dfe4ba8e0c186d7f941adb8109672dba371a92dc9f1a9ab910160405180910390a2949350505050565b600b546001600160a01b03163314613af75760405162461bcd60e51b815260040161110790615d64565b6013819055613b04612c97565b6040518281527f8fe5128f1f86155b6ef779c2bf93f17d425cd3e3cfa79c8ecb817887a836aba6906020016120f7565b43600090815260086020908152604080832032845290915290205460ff1615613b6f5760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832033845290915290205460ff1615613baa5760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832032845282528083208054600160ff1991821681179092553380865283862080549092169092179055600d9092529091205460ff1615613c0d5760405162461bcd60e51b815260040161110790615c81565b613c156149da565b33600090815260036020526040902060010154613c685760405162461bcd60e51b81526020600482015260116024820152706e6f207374616b65642062616c616e636560781b6044820152606401611107565b601b546011546040805163ef78d4fd60e01b815290514293926001600160a01b03169163ef78d4fd9160048083019260209291908290030181865afa158015613cb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cd99190615bd3565b613ce39190615cf7565b613ceb6138e4565b613cf59190615c34565b1115613d315760405162461bcd60e51b815260206004820152600b60248201526a18d85b9b9bdd08195e1a5d60aa1b6044820152606401611107565b3360009081526003602052604081206001015490613d4e8161104d565b613d6a83710b7abc627050305adf14a3d9e40000000000615cf7565b613d749190615e24565b601f54600080546040516303cea95560e21b81526001600160a01b039182166004820152602481018590526044810183905230606482015293945090926101009092041690630f3aa554906084016020604051808303816000875af1158015613de1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e059190615bd3565b905082811115613e4b5760405162461bcd60e51b81526020600482015260116024820152707769746864726177206f766572666c6f7760781b6044820152606401611107565b6000613e578285615d4d565b1115613ee7576000613e698285615d4d565b6010549091506001600160a01b0316639dc29fac33613e8d8464e8d4a51000615cf7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015613ed357600080fd5b505af1925050508015613ee4575060015b50505b613ef033614f2b565b336000908152601460205260408120546007805491929091613f13908490615a8a565b9091555050336000908152601460209081526040808320839055600390915281206001018054859290613f47908490615d4d565b90915550503360009081526003602052604081206002018054839290613f6e908490615c34565b909155505060058054849190600090613f88908490615d4d565b909155505060068054829190600090613fa2908490615c34565b909155505033600090815260176020526040812054600f805491929091613fca908490615d4d565b9091555050336000818152601760205260408082208281556001810183905560020191909155517f22d324652c93739755cf4581508b60875ebdd78c20c0cff5cf8e23452b29963190611ca09086815260200190565b6001600160a01b031660009081526003602052604090206001015490565b614046614c1d565b33600090815260166020526040902054156140a35760405162461bcd60e51b815260206004820152601d60248201527f506f6f6c3a2073656e64657220686173207374616b65526571756573740000006044820152606401611107565b33600090815260176020526040902054156141005760405162461bcd60e51b815260206004820181905260248201527f506f6f6c3a2073656e64657220686173207769746864726177526571756573746044820152606401611107565b61410981614c76565b33600081815260186020908152604080832080546001600160a01b0387166001600160a01b031991821681179092558185526019845282852080546001810182559086529484902090940180549094168517909355519182527f289bc9c56b03614822f5cc4bfde20491bda444c6e38aeed390e2e0802760f983910160405180910390a26114db6001600955565b600b546001600160a01b031633146141c15760405162461bcd60e51b815260040161110790615d64565b6001600160a01b0381166141e75760405162461bcd60e51b815260040161110790615bec565b601180546001600160a01b0319166001600160a01b03831617905561420a612c97565b6040516001600160a01b03831681527fed4c186f01f2ae06c493a4cb750cb7ff39276f1ddd6095f2ded978d854f35566906020016120f7565b600b546001600160a01b0316331461426d5760405162461bcd60e51b815260040161110790615d64565b6001600160a01b0381166142d95760405162461bcd60e51b815260206004820152602d60248201527f726577617264547261636b657220616464726573732063616e206e6f7420626560448201526c207a65726f206164647265737360981b6064820152608401611107565b602280546001600160a01b0319166001600160a01b0383161790556142fc612c97565b6040516001600160a01b03831681527fa69d3015d1a4a32890f55a19cdb487318ef0efae432049508eaa1a6299f6681e906020016120f7565b600b546001600160a01b0316331461435f5760405162461bcd60e51b815260040161110790615d64565b600081116143c05760405162461bcd60e51b815260206004820152602860248201527f757365724578697445706f636873206d7573742062652067726561746572207460448201526768616e207a65726f60c01b6064820152608401611107565b601b8190556143cd612c97565b6040518281527f94e48a5fc75223ab6878e82a74ddb71e7b9531a38196bffa80f6c24c8189c8bb906020016120f7565b600a546001600160a01b031633146144275760405162461bcd60e51b815260040161110790615c4c565b6001600160a01b03811661448c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401611107565b6114db81614fc6565b6000710b7abc627050305adf14a3d9e400000000006144b2612bc3565b6144bb8461104d565b6144c59190615cf7565b6110bc9190615e24565b601960205281600052604060002081815481106144eb57600080fd5b6000918252602090912001546001600160a01b03169150829050565b600b546001600160a01b031633146145315760405162461bcd60e51b815260040161110790615d64565b6001600160a01b0381166145875760405162461bcd60e51b815260206004820152601d60248201527f666565546f2063616e206e6f74206265207a65726f20616464726573730000006044820152606401611107565b600280546001600160a01b0319166001600160a01b0383161790556145aa612c97565b6040516001600160a01b03831681527f9cd35b5fb344721aa5c6e0131be8bb60428e3c5f87ceb720ad48c5e45d1c3680906020016120f7565b6011546001600160a01b0316331461460d5760405162461bcd60e51b815260040161110790615d16565b6101f48211156146585760405162461bcd60e51b8152602060048201526016602482015275676c70496e4665653a206f7574206f662072616e676560501b6044820152606401611107565b6101f48111156146aa5760405162461bcd60e51b815260206004820152601760248201527f676c704f75744665653a206f7574206f662072616e67650000000000000000006044820152606401611107565b601c829055601d8190556146bc612c97565b60408051848152602081018490527fbc3c09f0d8b232228fc13cfd54186189df86128e362310d343ec24424af28a9891016117bb565b600c546001600160a01b0316331461474c5760405162461bcd60e51b815260206004820152601d60248201527f63616c6c6572206973206e6f742074686520626c61636b6c69737465720000006044820152606401611107565b6001600160a01b0381166000818152600d6020526040808220805460ff19166001179055517fffa4e6181777692565cf28528fc88fd1516ea86b56da075235fa575af6a4b8559190a250565b6147bc60405180606001604052806000815260200160008152602001600081525090565b60156147c6611e63565b815481106147d6576147d6615da8565b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b61483660405180606001604052806000815260200160008152602001600081525090565b601561485a836001600160a01b031660009081526014602052604090206001015490565b8154811061486a5761486a615da8565b906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250509050919050565b60006001600160ff1b038211156149125760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401611107565b5090565b6001600160a01b0381166149825760405162461bcd60e51b815260206004820152602d60248201527f6f70657261746f723a207a65726f206164647265737320676976656e20666f7260448201526c103732bb9037b832b930ba37b960991b6064820152608401611107565b6040516001600160a01b038216906000907f74da04524d50c64947f5dd5381ef1a4dca5cba8ed1d816243f9e48aa0b5617ed908290a3600b80546001600160a01b0319166001600160a01b0392909216919091179055565b600e5460ff1615611e615760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401611107565b33600090815260036020526040902060020154811115614a9c5760405162461bcd60e51b815260206004820152603160248201527f776974686472617720726571756573742067726561746572207468616e2077696044820152701d1a191c985dd8589b1948185b5bdd5b9d607a1b6064820152608401611107565b8060046002016000828254614ab19190615d4d565b90915550503360009081526003602052604081206002018054839290614ad8908490615d4d565b90915550503360009081526003602081905260408220015490811315614b4f5733600090815260036020819052604082200181905560078054839290614b1f908490615a8a565b90915550612e0a905033614b3283614bb3565b614b3c9085615c34565b6000546001600160a01b031691906152c3565b6000811215614b9c5733600090815260036020819052604082200181905560078054839290614b7f908490615a8a565b90915550612e0a905033614b9283614bb3565b614b3c9085615d4d565b600054612e0a906001600160a01b031633846152c3565b600080821215614912576110bc82615e7a565b919050565b614bd361540c565b600e805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600260095403614c6f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611107565b6002600955565b6001600160a01b03811660009081526003602052604090205415614d025760405162461bcd60e51b815260206004820152603c60248201527f696e76616c69642072656365697665723a20726563656976657220776169742060448201527f62616c616e6365206973206e6f7420657175616c20746f207a65726f000000006064820152608401611107565b614d0b81614020565b15614d7e5760405162461bcd60e51b815260206004820152603e60248201527f696e76616c69642072656365697665723a207265636569766572207374616b6560448201527f642062616c616e6365206973206e6f7420657175616c20746f207a65726f00006064820152608401611107565b6001600160a01b03811660009081526003602052604090206002015415614e0f576040805162461bcd60e51b81526020600482015260248101919091527f696e76616c69642072656365697665723a20726563656976657220776974686460448201527f7261772062616c616e6365206973206e6f7420657175616c20746f207a65726f6064820152608401611107565b6001600160a01b0381166000908152600360208190526040909120015415614e9f5760405162461bcd60e51b815260206004820152603e60248201527f696e76616c69642072656365697665723a20726563656976657220726577617260448201527f642062616c616e6365206973206e6f7420657175616c20746f207a65726f00006064820152608401611107565b6001600160a01b038116600090815260146020526040902054156114db5760405162461bcd60e51b815260206004820152603c60248201527f696e76616c69642072656365697665723a20726563656976657220726577617260448201527f644561726e6564206973206e6f7420657175616c20746f207a65726f000000006064820152608401611107565b6001600160a01b038116156114db576001600160a01b0381166000908152601460209081526040918290208251606081018452815481526001820154928101929092526002015491810191909152614f8282610fc4565b8152614f8c611e63565b60208083019182526001600160a01b0384166000908152601490915260409081902083518155915160018301559091015160029091015550565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6150206149da565b600e805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258614c003390565b8015806150cf5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156150a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906150cd9190615bd3565b155b61513a5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401611107565b6040516001600160a01b03831660248201526044810182905261384090849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152615455565b6040516001600160a01b03808516602483015283166044820152606481018290526151d59085906323b872dd60e01b90608401615166565b50505050565b80600460000160008282546151f09190615c34565b90915550503360009081526003602052604081208054839290615214908490615c34565b90915550506000546114db906001600160a01b031633308461519d565b600061523c82614f2b565b6001600160a01b038216600090815260146020908152604080832080549084905560039283905290832090910180549192839261527a908490615b92565b90915550506040518181526001600160a01b038416907f6323c674f8ad5f04d52cf1559f96e3363e3a99871080dd7ca30f25af4d451a7c9060200160405180910390a292915050565b6040516001600160a01b03831660248201526044810182905261384090849063a9059cbb60e01b90606401615166565b804710156153435760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401611107565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114615390576040519150601f19603f3d011682016040523d82523d6000602084013e615395565b606091505b50509050806138405760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401611107565b600e5460ff16611e615760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401611107565b60006154aa826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166155279092919063ffffffff16565b80519091501561384057808060200190518101906154c89190615e96565b6138405760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611107565b6060611045848460008585600080866001600160a01b0316858760405161554e9190615edf565b60006040518083038185875af1925050503d806000811461558b576040519150601f19603f3d011682016040523d82523d6000602084013e615590565b606091505b50915091506155a1878383876155ac565b979650505050505050565b6060831561561b578251600003615614576001600160a01b0385163b6156145760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611107565b5081611045565b61104583838151156156305781518083602001fd5b8060405162461bcd60e51b81526004016111079190615efb565b50805460008255906000526020600020908101906114db91905b808211156149125760008155600101615664565b80356001600160a01b0381168114614bc657600080fd5b6000602082840312156156a157600080fd5b6156aa82615678565b9392505050565b80151581146114db57600080fd5b6000602082840312156156d157600080fd5b81356156aa816156b1565b60008060008060008060008060006101208a8c0312156156fb57600080fd5b6157048a615678565b985061571260208b01615678565b975060408a0135965061572760608b01615678565b955060808a0135945060a08a0135935060c08a0135925060e08a013591506157526101008b01615678565b90509295985092959850929598565b60006020828403121561577357600080fd5b5035919050565b600080600080600080600060e0888a03121561579557600080fd5b87356157a0816156b1565b965060208801356157b0816156b1565b955060408801356157c0816156b1565b945060608801356157d0816156b1565b935060808801356157e0816156b1565b925060a08801356157f0816156b1565b915060c0880135615800816156b1565b8091505092959891949750929550565b6000806040838503121561582357600080fd5b61582c83615678565b915061583a60208401615678565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561586c57600080fd5b823567ffffffffffffffff8082111561588457600080fd5b818501915085601f83011261589857600080fd5b8135818111156158aa576158aa615843565b8060051b604051601f19603f830116810181811085821117156158cf576158cf615843565b6040529182528482019250838101850191888311156158ed57600080fd5b938501935b828510156159125761590385615678565b845293850193928501926158f2565b98975050505050505050565b6000806000806080858703121561593457600080fd5b61593d85615678565b966020860135965060408601359560600135945092505050565b6000806000806080858703121561596d57600080fd5b61597685615678565b9350602085013592506040850135915061599260608601615678565b905092959194509250565b6000806000606084860312156159b257600080fd5b6159bb84615678565b9250602084013591506159d060408501615678565b90509250925092565b600080604083850312156159ec57600080fd5b8235915061583a60208401615678565b600080600060608486031215615a1157600080fd5b505081359360208301359350604090920135919050565b60008060408385031215615a3b57600080fd5b615a4483615678565b946020939093013593505050565b60008060408385031215615a6557600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b60008083128015600160ff1b850184121615615aa857615aa8615a74565b6001600160ff1b0384018313811615615ac357615ac3615a74565b50500390565b60006001600160ff1b0381841382841380821686840486111615615aef57615aef615a74565b600160ff1b6000871282811687830589121615615b0e57615b0e615a74565b60008712925087820587128484161615615b2a57615b2a615a74565b87850587128184161615615b4057615b40615a74565b505050929093029392505050565b634e487b7160e01b600052601260045260246000fd5b600082615b7357615b73615b4e565b600160ff1b821460001984141615615b8d57615b8d615a74565b500590565b600080821280156001600160ff1b0384900385131615615bb457615bb4615a74565b600160ff1b8390038412811615615bcd57615bcd615a74565b50500190565b600060208284031215615be557600080fd5b5051919050565b60208082526028908201527f747265617375727920616464726573732063616e206e6f74206265207a65726f604082015267206164647265737360c01b606082015260800190565b60008219821115615c4757615c47615a74565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601690820152751858d8dbdd5b9d081a5cc8189b1858dadb1a5cdd195960521b604082015260600190565b60208082526026908201527f436f6e747261637447756172643a206f6e6520626c6f636b2c206f6e652066756040820152653731ba34b7b760d11b606082015260800190565b6000816000190483118215151615615d1157615d11615a74565b500290565b6020808252601a908201527f63616c6c6572206973206e6f7420746865207472656173757279000000000000604082015260600190565b600082821015615d5f57615d5f615a74565b500390565b60208082526024908201527f6f70657261746f723a2063616c6c6572206973206e6f7420746865206f70657260408201526330ba37b960e11b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600060018201615dd057615dd0615a74565b5060010190565b6020808252825182820181905260009190848201906040850190845b81811015615e185783516001600160a01b031683529284019291840191600101615df3565b50909695505050505050565b600082615e3357615e33615b4e565b500490565b60208082526022908201527f746f20616464726573732063616e206e6f74206265207a65726f206164647265604082015261737360f01b606082015260800190565b6000600160ff1b8201615e8f57615e8f615a74565b5060000390565b600060208284031215615ea857600080fd5b81516156aa816156b1565b60005b83811015615ece578181015183820152602001615eb6565b838111156151d55750506000910152565b60008251615ef1818460208701615eb3565b9190910192915050565b6020815260008251806020840152615f1a816040850160208701615eb3565b601f01601f1916919091016040019291505056fea26469706673582212200b46a014fee325afd37a8e48cba170934b0f8490e932c941576c80264eb74d7164736f6c634300080d0033
Deployed Bytecode
0x6080604052600436106104c35760003560e01c80638ab4d57511610276578063d0d1cc751161014f578063f2eb6f58116100c1578063f47f9f5311610085578063f47f9f5314610ed5578063f5d6e57b14610f0b578063f9f92be414610f2b578063fa6db1bc14610f4b578063fc0c546a14610f6b578063fe575a8714610f8b57600080fd5b8063f2eb6f5814610e35578063f2fde38b14610e55578063f320d28b14610e75578063f45adcb614610e95578063f46901ed14610eb557600080fd5b8063e9fad8ee11610113578063e9fad8ee14610d8a578063eabba14514610d9f578063eef3a36a14610dbf578063ef9aacfd14610dd5578063f0f4426014610df5578063f2293bb014610e1557600080fd5b8063d0d1cc7514610ce4578063d84bcb0c14610cf9578063ddca3f4314610d19578063e016e44b14610d2f578063e1b9db8914610d5457600080fd5b8063afcd33a7116101e8578063bf9a3ad0116101ac578063bf9a3ad014610c2f578063bfb1162014610c4f578063c58e384314610c6f578063c5967c2614610c8f578063cb3b3ab314610ca4578063cf35ab9414610cc457600080fd5b8063afcd33a714610b8d578063b3041a3714610bc7578063bbbd0db914610be7578063bd10243014610bfc578063be040fb014610c1a57600080fd5b80639ecac8471161023a5780639ecac84714610aef578063a449beff14610b05578063a694fc3a14610b25578063a8d5fd6514610b38578063ab3294dd14610b58578063ad38bf2214610b6d57600080fd5b80638ab4d57514610a675780638ab775e214610a7c5780638da5cb5b14610a9c578063900cf0cf14610aba57806391915ef814610acf57600080fd5b80633f9e3f04116103a857806362d45f8f1161031a5780636df92e03116102de5780636df92e03146109ae578063714b4658146109c4578063715018a6146109fd5780638456cb5914610a1257806385b5b4c014610a2757806389e57bcc14610a4757600080fd5b806362d45f8f146108f5578063655603a41461092e57806369fe0e2d1461094e5780636b5abd2d1461096e5780636bcb411a1461098e57600080fd5b806349211cf81161036c57806349211cf814610849578063570ca735146108695780635a3bb989146108875780635c975abb146108a75780635cfc1a51146108bf57806361d027b3146108d557600080fd5b80633f9e3f04146107c957806341d68b8f146107de5780634456eda2146107fe578063446a2ec81461081e578063485742911461083357600080fd5b80631e0ed754116104415780632c9dec98116104055780632c9dec981461072c5780632e1a7d4d1461073f57806330468f4b1461075f57806330b700021461077f57806334c15f581461079f5780633f4ba83a146107b457600080fd5b80631e0ed7541461068e5780631e85cd65146106a45780632012119d146106ba578063232d3c9d146106f657806329605e771461070c57600080fd5b806314cbc46a1161048857806314cbc46a146105d3578063158ef93e1461060f57806315b3d2f51461063957806319262d301461064e5780631a8952661461066e57600080fd5b80628cc262146104cf578063017e7e581461050257806308ae4b0c1461053a5780630a60f0c81461059157806314212be3146105b157600080fd5b366104ca57005b600080fd5b3480156104db57600080fd5b506104ef6104ea36600461568f565b610fc4565b6040519081526020015b60405180910390f35b34801561050e57600080fd5b50600254610522906001600160a01b031681565b6040516001600160a01b0390911681526020016104f9565b34801561054657600080fd5b5061057661055536600461568f565b60146020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016104f9565b34801561059d57600080fd5b506104ef6105ac3660046156bf565b61104d565b3480156105bd57600080fd5b506105d16105cc3660046156dc565b6110c2565b005b3480156105df57600080fd5b506105766105ee36600461568f565b60176020526000908152604090208054600182015460029092015490919083565b34801561061b57600080fd5b50601f546106299060ff1681565b60405190151581526020016104f9565b34801561064557600080fd5b506006546104ef565b34801561065a57600080fd5b5061062961066936600461568f565b6113ca565b34801561067a57600080fd5b506105d161068936600461568f565b611405565b34801561069a57600080fd5b506104ef600f5481565b3480156106b057600080fd5b506104ef601a5481565b3480156106c657600080fd5b506105766106d536600461568f565b60166020526000908152604090208054600182015460029092015490919083565b34801561070257600080fd5b506104ef60125481565b34801561071857600080fd5b506105d161072736600461568f565b6114a8565b6105d161073a366004615761565b6114de565b34801561074b57600080fd5b506105d161075a366004615761565b6117c7565b34801561076b57600080fd5b506105d161077a366004615761565b6119a0565b34801561078b57600080fd5b506105d161079a36600461577a565b611cae565b3480156107ab57600080fd5b506104ef611db6565b3480156107c057600080fd5b506105d1611e2f565b3480156107d557600080fd5b506104ef611e63565b3480156107ea57600080fd5b506105d16107f9366004615810565b611e75565b34801561080a57600080fd5b50600b546001600160a01b03163314610629565b34801561082a57600080fd5b506104ef611ff9565b34801561083f57600080fd5b506104ef601c5481565b34801561085557600080fd5b506105d161086436600461568f565b61200c565b34801561087557600080fd5b50600b546001600160a01b0316610522565b34801561089357600080fd5b50602054610522906001600160a01b031681565b3480156108b357600080fd5b50600e5460ff16610629565b3480156108cb57600080fd5b506104ef601e5481565b3480156108e157600080fd5b50601154610522906001600160a01b031681565b34801561090157600080fd5b506104ef61091036600461568f565b6001600160a01b031660009081526003602052604090206002015490565b34801561093a57600080fd5b506105d161094936600461568f565b612102565b34801561095a57600080fd5b506105d1610969366004615761565b612656565b34801561097a57600080fd5b506105d1610989366004615859565b612703565b34801561099a57600080fd5b50602254610522906001600160a01b031681565b3480156109ba57600080fd5b506104ef601d5481565b3480156109d057600080fd5b506104ef6109df36600461568f565b6001600160a01b031660009081526014602052604090206001015490565b348015610a0957600080fd5b506105d161292c565b348015610a1e57600080fd5b506105d1612960565b348015610a3357600080fd5b506104ef610a4236600461591e565b612992565b348015610a5357600080fd5b506104ef610a62366004615957565b612acb565b348015610a7357600080fd5b506104ef612bc3565b348015610a8857600080fd5b506105d1610a97366004615761565b612c30565b348015610aa857600080fd5b50600a546001600160a01b0316610522565b348015610ac657600080fd5b506104ef612c97565b348015610adb57600080fd5b506105d1610aea366004615761565b612ce1565b348015610afb57600080fd5b506104ef601b5481565b348015610b1157600080fd5b506105d1610b20366004615859565b612d48565b6105d1610b33366004615761565b612e0e565b348015610b4457600080fd5b50600054610522906001600160a01b031681565b348015610b6457600080fd5b506005546104ef565b348015610b7957600080fd5b506105d1610b8836600461568f565b6131a0565b348015610b9957600080fd5b506104ef610ba836600461568f565b6001600160a01b03166000908152600360208190526040909120015490565b348015610bd357600080fd5b506105d1610be2366004615859565b613276565b348015610bf357600080fd5b506004546104ef565b348015610c0857600080fd5b50600c546001600160a01b0316610522565b348015610c2657600080fd5b506105d1613570565b348015610c3b57600080fd5b506105d1610c4a36600461599d565b6137dc565b348015610c5b57600080fd5b506105d1610c6a3660046159d9565b613845565b348015610c7b57600080fd5b50610576610c8a366004615761565b6138b1565b348015610c9b57600080fd5b506104ef6138e4565b348015610cb057600080fd5b506105d1610cbf366004615761565b61392e565b348015610cd057600080fd5b506104ef610cdf3660046159fc565b613995565b348015610cf057600080fd5b506007546104ef565b348015610d0557600080fd5b506105d1610d14366004615761565b613acd565b348015610d2557600080fd5b506104ef60015481565b348015610d3b57600080fd5b50601f546105229061010090046001600160a01b031681565b348015610d6057600080fd5b50610522610d6f36600461568f565b6018602052600090815260409020546001600160a01b031681565b348015610d9657600080fd5b506105d1613b34565b348015610dab57600080fd5b506104ef610dba36600461568f565b614020565b348015610dcb57600080fd5b506104ef60135481565b348015610de157600080fd5b506105d1610df036600461568f565b61403e565b348015610e0157600080fd5b506105d1610e1036600461568f565b614197565b348015610e2157600080fd5b506105d1610e3036600461568f565b614243565b348015610e4157600080fd5b506105d1610e50366004615761565b614335565b348015610e6157600080fd5b506105d1610e7036600461568f565b6143fd565b348015610e8157600080fd5b506104ef610e903660046156bf565b614495565b348015610ea157600080fd5b50610522610eb0366004615a28565b6144cf565b348015610ec157600080fd5b506105d1610ed036600461568f565b614507565b348015610ee157600080fd5b506104ef610ef036600461568f565b6001600160a01b031660009081526003602052604090205490565b348015610f1757600080fd5b506105d1610f26366004615a52565b6145e3565b348015610f3757600080fd5b506105d1610f4636600461568f565b6146f2565b348015610f5757600080fd5b50602154610522906001600160a01b031681565b348015610f7757600080fd5b50601054610522906001600160a01b031681565b348015610f9757600080fd5b50610629610fa636600461568f565b6001600160a01b03166000908152600d602052604090205460ff1690565b600080610fcf614798565b6020015190506000610fe084614812565b6020908101516001600160a01b03861660009081526014909252604090912054909150670de0b6b3a76400006110168385615a8a565b61102761102288614020565b6148a8565b6110319190615ac9565b61103b9190615b64565b6110459190615b92565b949350505050565b60215460405163e245b5af60e01b815282151560048201526000916001600160a01b03169063e245b5af90602401602060405180830381865afa158015611098573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110bc9190615bd3565b92915050565b601f5460ff16156111105760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b60448201526064015b60405180910390fd5b6001600160a01b0389166111745760405162461bcd60e51b815260206004820152602560248201527f746f6b656e20616464726573732063616e206e6f74206265207a65726f206164604482015264647265737360d81b6064820152608401611107565b6001600160a01b0388166111d85760405162461bcd60e51b815260206004820152602560248201527f736861726520616464726573732063616e206e6f74206265207a65726f206164604482015264647265737360d81b6064820152608401611107565b6001600160a01b03861661123c5760405162461bcd60e51b815260206004820152602560248201527f666565546f20616464726573732063616e206e6f74206265207a65726f206164604482015264647265737360d81b6064820152608401611107565b6001600160a01b0381166112625760405162461bcd60e51b815260040161110790615bec565b601080546001600160a01b03199081166001600160a01b038c8116919091179092556000805482168b841617815560018a81556002805484168b8616178155601c8a9055601d8990556012889055601387905560118054909416948616949094179092556040805160608101825282815260208082018481524383850181815260158054808a018255975284517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47560039098029788015591517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47687015590517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47790950194909455601a959095556004601b5564e8d4a51000601e55601f805460ff191690941790935551908152909133917f25ff68dd81b34665b5ba7e553ee5511bf6812e12adb4a7e2c0d9e26b3099ce79910160405180910390a250505050505050505050565b60006113d4612c97565b601a546001600160a01b0384166000908152601460205260409020600201546113fd9190615c34565b111592915050565b600c546001600160a01b0316331461145f5760405162461bcd60e51b815260206004820152601d60248201527f63616c6c6572206973206e6f742074686520626c61636b6c69737465720000006044820152606401611107565b6001600160a01b0381166000818152600d6020526040808220805460ff19169055517f117e3210bb9aa7d9baff172026820255c6f6c30ba8999d1c2fd88e2848137c4e9190a250565b600a546001600160a01b031633146114d25760405162461bcd60e51b815260040161110790615c4c565b6114db81614916565b50565b60006114e933614020565b116115365760405162461bcd60e51b815260206004820152601960248201527f546865206d656d62657220646f6573206e6f74206578697374000000000000006044820152606401611107565b336000818152600d602052604090205460ff16156115665760405162461bcd60e51b815260040161110790615c81565b61156e6149da565b816000036115cc5760405162461bcd60e51b815260206004820152602560248201527f776974686472617720726571756573742063616e6e6f7420626520657175616c604482015264020746f20360dc1b6064820152608401611107565b336000908152600360209081526040808320600101546017909252909120546115f59084615c34565b11156116565760405162461bcd60e51b815260206004820152602a60248201527f776974686472617720616d6f756e74206578636565647320746865207374616b60448201526965642062616c616e636560b01b6064820152608401611107565b61165e612c97565b601a543360009081526014602052604090206002015461167e9190615c34565b11156116cc5760405162461bcd60e51b815260206004820152601860248201527f7374696c6c20696e207769746864726177206c6f636b757000000000000000006044820152606401611107565b60125434101561171e5760405162461bcd60e51b815260206004820152601f60248201527f6e656564206d6f72652067617320746f2068616e646c652072657175657374006044820152606401611107565b336000908152601760205260408120805484929061173d908490615c34565b909155505033600090815260176020526040902042600190910155611760612c97565b33600090815260176020526040812060020191909155600f8054849290611788908490615c34565b909155505060405182815233907f17040713250ec5f668a1c39e7939900e78558350dbaff0ebef34268dfa8ea4ac906020015b60405180910390a25050565b43600090815260086020908152604080832032845290915290205460ff16156118025760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832033845290915290205460ff161561183d5760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832032845282528083208054600160ff1991821681179092553380865283862080549092169092179055600d9092529091205460ff16156118a05760405162461bcd60e51b815260040161110790615c81565b6118a86149da565b816000036118ec5760405162461bcd60e51b8152602060048201526011602482015270063616e6e6f74207769746864726177203607c1b6044820152606401611107565b6118f582614a20565b6010546001600160a01b0316639dc29fac336119168564e8d4a51000615cf7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561195c57600080fd5b505af192505050801561196d575060015b5060405182815233907f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5906020016117bb565b43600090815260086020908152604080832032845290915290205460ff16156119db5760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832033845290915290205460ff1615611a165760405162461bcd60e51b815260040161110790615cb1565b4360009081526008602090815260408083203284529091528082208054600160ff19918216811790925533808552929093208054909316179091556011546001600160a01b031614611a7a5760405162461bcd60e51b815260040161110790615d16565b6000611a8560055490565b11611aec5760405162461bcd60e51b815260206004820152603160248201527f726577617264732063616e6e6f7420626520616c6c6f6361746564207768656e604482015270020746f74616c537570706c79206973203607c1b6064820152608401611107565b6000611af6614798565b6020015190506000611b0a61102260055490565b611b1c84670de0b6b3a7640000615ac9565b611b269190615b64565b611b309083615b92565b60408051606081018252858152602081018381524392820192835260158054600181018255600091825283517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47560039092029182015591517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47683015592517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47790910155600780549394509092869290611bea908490615b92565b90915550611bf89050612c97565b6011546040805163ef78d4fd60e01b815290517f01028dd4750c207f52d9ed11198b98d345c8b3000be65704a473188b65a22430926001600160a01b03169163ef78d4fd9160048083019260209291908290030181865afa158015611c61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c859190615bd3565b60055460408051928352602083019190915281018790526060015b60405180910390a250505050565b6011546001600160a01b03163314611cd85760405162461bcd60e51b815260040161110790615d16565b6000611ce2612c97565b60205460405163185b800160e11b81528a15156004820152891515602482015288151560448201528715156064820152861515608482015285151560a482015284151560c48201529192506001600160a01b0316906330b700029060e401600060405180830381600087803b158015611d5a57600080fd5b505af1158015611d6e573d6000803e3d6000fd5b50505050807f07bed104aa0bdd4ab1d9cf2baf20a7d120a791b537cdeea0b559c5e70752166642604051611da491815260200190565b60405180910390a25050505050505050565b60008060046003015412611dfc57600754611dd090614bb3565b600654600554600454611de39190615c34565b611ded9190615c34565b611df79190615c34565b905090565b600754611e0890614bb3565b600654600554600454611e1b9190615c34565b611e259190615c34565b611df79190615d4d565b6011546001600160a01b03163314611e595760405162461bcd60e51b815260040161110790615d16565b611e61614bcb565b565b601554600090611df790600190615d4d565b600b546001600160a01b03163314611e9f5760405162461bcd60e51b815260040161110790615d64565b6001600160a01b038216611f075760405162461bcd60e51b815260206004820152602960248201527f676c70526f7574657220616464726573732063616e206e6f74206265207a65726044820152686f206164647265737360b81b6064820152608401611107565b6001600160a01b038116611f725760405162461bcd60e51b815260206004820152602c60248201527f726577617264526f7574657220616464726573732063616e206e6f742062652060448201526b7a65726f206164647265737360a01b6064820152608401611107565b601f8054610100600160a81b0319166101006001600160a01b038581169190910291909117909155602080546001600160a01b031916918316919091179055611fb9612c97565b604080516001600160a01b038086168252841660208201527feb132a1d6e894221645af2a8ae643aa3133ac93ac6a5861acb5c1912abe4d1f691016117bb565b6000612003614798565b60200151905090565b600b546001600160a01b031633146120365760405162461bcd60e51b815260040161110790615d64565b6001600160a01b03811661209f5760405162461bcd60e51b815260206004820152602a60248201527f676c704d616e6167657220616464726573732063616e206e6f74206265207a65604482015269726f206164647265737360b01b6064820152608401611107565b602180546001600160a01b0319166001600160a01b0383161790556120c2612c97565b6040516001600160a01b03831681527f63d3374d59c92e8cbc4e3d2b475f744aab3e2e58d6f2ddf03f1d57b5f999e7c1906020015b60405180910390a250565b61210a614c1d565b6001600160a01b038116600090815260166020526040902054156121705760405162461bcd60e51b815260206004820152601d60248201527f506f6f6c3a2073656e64657220686173207374616b65526571756573740000006044820152606401611107565b6001600160a01b038116600090815260176020526040902054156121d65760405162461bcd60e51b815260206004820181905260248201527f506f6f6c3a2073656e64657220686173207769746864726177526571756573746044820152606401611107565b6001600160a01b0381811660009081526018602052604090205433911681146122415760405162461bcd60e51b815260206004820152601c60248201527f506f6f6c3a207472616e73666572206e6f74207369676e616c6c6564000000006044820152606401611107565b6001600160a01b03808316600090815260186020908152604080832080546001600160a01b03191690559284168252601990529081206122809161564a565b61228981614c76565b6001600160a01b0382166000908152600360205260409020548015612303576001600160a01b038316600090815260036020526040812080548392906122d0908490615d4d565b90915550506001600160a01b038216600090815260036020526040812080548392906122fd908490615c34565b90915550505b600061230e84614020565b90508015612377576001600160a01b03841660009081526003602052604081206001018054839290612341908490615d4d565b90915550506001600160a01b03831660009081526003602052604081206001018054839290612371908490615c34565b90915550505b6001600160a01b03841660009081526003602052604090206002015480156123fa576001600160a01b038516600090815260036020526040812060020180548392906123c4908490615d4d565b90915550506001600160a01b038416600090815260036020526040812060020180548392906123f4908490615c34565b90915550505b6001600160a01b03851660009081526003602081905260409091200154801561247e576001600160a01b03861660009081526003602081905260408220018054839290612448908490615a8a565b90915550506001600160a01b03851660009081526003602081905260408220018054839290612478908490615b92565b90915550505b6010546040516370a0823160e01b81526001600160a01b03888116600483015260009216906370a0823190602401602060405180830381865afa1580156124c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ed9190615bd3565b905080156125c257601054604051632770a7eb60e21b81526001600160a01b0389811660048301526024820184905290911690639dc29fac90604401600060405180830381600087803b15801561254357600080fd5b505af1158015612557573d6000803e3d6000fd5b50506010546040516340c10f1960e01b81526001600160a01b038a811660048301526024820186905290911692506340c10f199150604401600060405180830381600087803b1580156125a957600080fd5b505af11580156125bd573d6000803e3d6000fd5b505050505b6001600160a01b0387811660008181526014602090815260408083208054958c1680855282852096875560018083018054918901919091556002808401805491909901558686529185905590849055929094559251918252917fe7569f2b2aaa79a3c4946a7d0a3452fa12046ae9f78d7ed4b7d4871eed7cc2cd910160405180910390a25050505050506114db6001600955565b600b546001600160a01b031633146126805760405162461bcd60e51b815260040161110790615d64565b6101f48111156126c65760405162461bcd60e51b81526020600482015260116024820152706665653a206f7574206f662072616e676560781b6044820152606401611107565b60018190556126d3612c97565b6040518281527f528d9479e9f9889a87a3c30c7f7ba537e5e59c4c85a37733b16e57c62df61302906020016120f7565b6011546001600160a01b0316331461272d5760405162461bcd60e51b815260040161110790615d16565b6000612737612c97565b905060005b82518110156128fb57600083828151811061275957612759615da8565b6020908102919091018101516001600160a01b0381166000908152601690925260409091208054600290910154919250908490036127db57816001600160a01b03167f5f990b332f38535955993c04fe357f73b556a11631fecbe353f5c6e0ff116bdb856040516127cc91815260200190565b60405180910390a250506128e9565b6001600160a01b03821660009081526016602052604081206001015490036128045750506128e9565b61280d82614f2b565b6001600160a01b03821660009081526003602052604081208054839290612835908490615d4d565b90915550506001600160a01b03821660009081526003602052604081206001018054839290612865908490615c34565b90915550506004805482919060009061287f908490615d4d565b909155505060058054829190600090612899908490615c34565b909155506128aa9050600185615d4d565b6001600160a01b039092166000908152601460209081526040808320600290810195909555601690915281208181556001810182905590920191909155505b806128f381615dbe565b91505061273c565b50807f65b1dcd319fc8a4b2ddb8918c6358c2b3ebbbbf27c2204f329405fd2ef682755836040516117bb9190615dd7565b600a546001600160a01b031633146129565760405162461bcd60e51b815260040161110790615c4c565b611e616000614fc6565b6011546001600160a01b0316331461298a5760405162461bcd60e51b815260040161110790615d16565b611e61615018565b6011546000906001600160a01b031633146129bf5760405162461bcd60e51b815260040161110790615d16565b6021546129da906001600160a01b0387811691166000615055565b6021546129f4906001600160a01b03878116911686615055565b601f5460405163364e231160e01b81526001600160a01b0387811660048301526024820187905260448201869052606482018590526000926101009004169063364e2311906084016020604051808303816000875af1158015612a5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a7f9190615bd3565b9050612a89612c97565b604080518781524260208201527ff660ec8bb3613cefbef56487f01cf74b6df0ee24932910bff6960af1ebd7fb5f91015b60405180910390a295945050505050565b6011546000906001600160a01b03163314612af85760405162461bcd60e51b815260040161110790615d16565b601f546040516303cea95560e21b81526001600160a01b0387811660048301526024820187905260448201869052848116606483015260009261010090041690630f3aa554906084016020604051808303816000875af1158015612b60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b849190615bd3565b9050612b8e612c97565b604080518681524260208201527fff0c8137cc5716ccb955c00c549b390b0fd88d17963e8d5cff2dbcd52f75bd6b9101612aba565b6022546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612c0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df79190615bd3565b600b546001600160a01b03163314612c5a5760405162461bcd60e51b815260040161110790615d64565b601a819055612c67612c97565b6040518281527ffbb1a1496a0c6846a70f52324fa97489b5dd4f345cec03011530b92cb8efd02f906020016120f7565b6011546040805163900cf0cf60e01b815290516000926001600160a01b03169163900cf0cf9160048083019260209291908290030181865afa158015612c0c573d6000803e3d6000fd5b6011546001600160a01b03163314612d0b5760405162461bcd60e51b815260040161110790615d16565b601e819055612d18612c97565b6040518281527fbe7f9e13de886daecad6ce97a1f9723e1f5a143d2e447587e282275a819c27ad906020016120f7565b6011546001600160a01b03163314612d725760405162461bcd60e51b815260040161110790615d16565b60005b8151811015612e0a576000828281518110612d9257612d92615da8565b6020908102919091018101516001600160a01b038116600090815260179092526040822054600f805492945090928392612dcd908490615d4d565b9091555050506001600160a01b03166000908152601760205260408120818155600181018290556002015580612e0281615dbe565b915050612d75565b5050565b43600090815260086020908152604080832032845290915290205460ff1615612e495760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832033845290915290205460ff1615612e845760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832032845282528083208054600160ff1991821681179092553380865283862080549092169092179055600d9092529091205460ff1615612ee75760405162461bcd60e51b815260040161110790615c81565b612eef6149da565b601354821015612f385760405162461bcd60e51b81526020600482015260146024820152737374616b6520616d6f756e7420746f6f206c6f7760601b6044820152606401611107565b601e546004546005548491612f4c91615c34565b612f569190615c34565b1115612f985760405162461bcd60e51b81526020600482015260116024820152707374616b65206e6f20636170616369747960781b6044820152606401611107565b601254341015612fea5760405162461bcd60e51b815260206004820152601f60248201527f6e656564206d6f72652067617320746f2068616e646c652072657175657374006044820152606401611107565b6001541561303f576000612710600154846130059190615cf7565b61300f9190615e24565b905061301b8184615d4d565b60025460005491945061303d916001600160a01b03908116913391168461519d565b505b601c541561308d576000612710601c548461305a9190615cf7565b6130649190615e24565b90506130708184615d4d565b60005490935061308b906001600160a01b031633308461519d565b505b613096826151db565b33600090815260166020526040812080548492906130b5908490615c34565b9091555050336000908152601660205260409020426001909101556130d8612c97565b336000818152601660205260409020600201919091556010546001600160a01b0316906340c10f19906131108564e8d4a51000615cf7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561315657600080fd5b505af115801561316a573d6000803e3d6000fd5b50506040518481523392507f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d91506020016117bb565b600a546001600160a01b031633146131ca5760405162461bcd60e51b815260040161110790615c4c565b6001600160a01b03811661322c5760405162461bcd60e51b815260206004820152602360248201527f6e657720626c61636b6c697374657220697320746865207a65726f206164647260448201526265737360e81b6064820152608401611107565b600c80546001600160a01b0319166001600160a01b0383169081179091556040517fc67398012c111ce95ecb7429b933096c977380ee6c421175a71a4a4c6c88c06e90600090a250565b6011546001600160a01b031633146132a05760405162461bcd60e51b815260040161110790615d16565b60006132aa612c97565b905060005b825181101561353f5760008382815181106132cc576132cc615da8565b6020908102919091018101516001600160a01b038116600090815260179092526040909120805460029091015491925090819085900361335157826001600160a01b03167f59ffb535f3d904d6d7a0c5a03d4c9bb5c905ae89801ab878ff57d921a49866a78660405161334191815260200190565b60405180910390a250505061352d565b6001600160a01b038316600090815260176020526040812060010154900361337b5750505061352d565b61338483615231565b50601d5415613434576000612710601d54846133a09190615cf7565b6133aa9190615e24565b6010549091506001600160a01b0316639dc29fac856133ce8464e8d4a51000615cf7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561341457600080fd5b505af1925050508015613425575060015b506134308184615d4d565b9150505b6001600160a01b0383166000908152600360205260408120600101805484929061345f908490615d4d565b90915550506001600160a01b0383166000908152600360205260408120600201805483929061348f908490615c34565b9091555050600580548391906000906134a9908490615d4d565b9091555050600680548291906000906134c3908490615c34565b9250508190555081600f60008282546134dc9190615d4d565b909155506134ed9050600186615d4d565b6001600160a01b03909316600090815260146020908152604080832060029081019690965560179091528120818155600181018290559093019290925550505b8061353781615dbe565b9150506132af565b50807f0d96234ba460608ab8827ba1d3e6a094cac6317b890fe4cd9a289760eeac00c7836040516117bb9190615dd7565b43600090815260086020908152604080832032845290915290205460ff16156135ab5760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832033845290915290205460ff16156135e65760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832032845282528083208054600160ff1991821681179092553380865283862080549092169092179055600d9092529091205460ff16156136495760405162461bcd60e51b815260040161110790615c81565b6136516149da565b600061365b612c97565b3360009081526016602052604090206002015490915081146136b05760405162461bcd60e51b815260206004820152600e60248201526d63616e206e6f742072656465656d60901b6044820152606401611107565b3360009081526003602052604081208054918291906136cf8380615d4d565b9091555050600480548291906000906136e9908490615d4d565b9091555050600054613705906001600160a01b031633836152c3565b6010546001600160a01b0316639dc29fac336137268464e8d4a51000615cf7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561376c57600080fd5b505af192505050801561377d575060015b50336000818152601660205260408082208281556001810183905560020191909155517f4896181ff8f4543cc00db9fe9b6fb7e6f032b7eb772c72ab1ec1b4d2e03b9369906137cf9084815260200190565b60405180910390a2505050565b6011546001600160a01b031633146138065760405162461bcd60e51b815260040161110790615d16565b6001600160a01b03811661382c5760405162461bcd60e51b815260040161110790615e38565b6138406001600160a01b03841682846152c3565b505050565b61384d614c1d565b6011546001600160a01b031633146138775760405162461bcd60e51b815260040161110790615d16565b6001600160a01b03811661389d5760405162461bcd60e51b815260040161110790615e38565b6138a781836152f3565b612e0a6001600955565b601581815481106138c157600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b601154604080516362cb3e1360e11b815290516000926001600160a01b03169163c5967c269160048083019260209291908290030181865afa158015612c0c573d6000803e3d6000fd5b600b546001600160a01b031633146139585760405162461bcd60e51b815260040161110790615d64565b6012819055613965612c97565b6040518281527f192287b9a4b21cf33b103bb4f9e7927e5bc8368ba1af75a03650308129716dea906020016120f7565b6011546000906001600160a01b031633146139c25760405162461bcd60e51b815260040161110790615d16565b47841115613a055760405162461bcd60e51b815260206004820152601060248201526f6e6f7420656e6f7567682066756e647360801b6044820152606401611107565b601f546040516353a8aa0360e01b8152600481018590526024810184905260009161010090046001600160a01b0316906353a8aa0390879060440160206040518083038185885af1158015613a5e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190613a839190615bd3565b9050613a8d612c97565b604080518781524260208201527ff1e1ba0bbee3eed08dfe4ba8e0c186d7f941adb8109672dba371a92dc9f1a9ab910160405180910390a2949350505050565b600b546001600160a01b03163314613af75760405162461bcd60e51b815260040161110790615d64565b6013819055613b04612c97565b6040518281527f8fe5128f1f86155b6ef779c2bf93f17d425cd3e3cfa79c8ecb817887a836aba6906020016120f7565b43600090815260086020908152604080832032845290915290205460ff1615613b6f5760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832033845290915290205460ff1615613baa5760405162461bcd60e51b815260040161110790615cb1565b43600090815260086020908152604080832032845282528083208054600160ff1991821681179092553380865283862080549092169092179055600d9092529091205460ff1615613c0d5760405162461bcd60e51b815260040161110790615c81565b613c156149da565b33600090815260036020526040902060010154613c685760405162461bcd60e51b81526020600482015260116024820152706e6f207374616b65642062616c616e636560781b6044820152606401611107565b601b546011546040805163ef78d4fd60e01b815290514293926001600160a01b03169163ef78d4fd9160048083019260209291908290030181865afa158015613cb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cd99190615bd3565b613ce39190615cf7565b613ceb6138e4565b613cf59190615c34565b1115613d315760405162461bcd60e51b815260206004820152600b60248201526a18d85b9b9bdd08195e1a5d60aa1b6044820152606401611107565b3360009081526003602052604081206001015490613d4e8161104d565b613d6a83710b7abc627050305adf14a3d9e40000000000615cf7565b613d749190615e24565b601f54600080546040516303cea95560e21b81526001600160a01b039182166004820152602481018590526044810183905230606482015293945090926101009092041690630f3aa554906084016020604051808303816000875af1158015613de1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e059190615bd3565b905082811115613e4b5760405162461bcd60e51b81526020600482015260116024820152707769746864726177206f766572666c6f7760781b6044820152606401611107565b6000613e578285615d4d565b1115613ee7576000613e698285615d4d565b6010549091506001600160a01b0316639dc29fac33613e8d8464e8d4a51000615cf7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015613ed357600080fd5b505af1925050508015613ee4575060015b50505b613ef033614f2b565b336000908152601460205260408120546007805491929091613f13908490615a8a565b9091555050336000908152601460209081526040808320839055600390915281206001018054859290613f47908490615d4d565b90915550503360009081526003602052604081206002018054839290613f6e908490615c34565b909155505060058054849190600090613f88908490615d4d565b909155505060068054829190600090613fa2908490615c34565b909155505033600090815260176020526040812054600f805491929091613fca908490615d4d565b9091555050336000818152601760205260408082208281556001810183905560020191909155517f22d324652c93739755cf4581508b60875ebdd78c20c0cff5cf8e23452b29963190611ca09086815260200190565b6001600160a01b031660009081526003602052604090206001015490565b614046614c1d565b33600090815260166020526040902054156140a35760405162461bcd60e51b815260206004820152601d60248201527f506f6f6c3a2073656e64657220686173207374616b65526571756573740000006044820152606401611107565b33600090815260176020526040902054156141005760405162461bcd60e51b815260206004820181905260248201527f506f6f6c3a2073656e64657220686173207769746864726177526571756573746044820152606401611107565b61410981614c76565b33600081815260186020908152604080832080546001600160a01b0387166001600160a01b031991821681179092558185526019845282852080546001810182559086529484902090940180549094168517909355519182527f289bc9c56b03614822f5cc4bfde20491bda444c6e38aeed390e2e0802760f983910160405180910390a26114db6001600955565b600b546001600160a01b031633146141c15760405162461bcd60e51b815260040161110790615d64565b6001600160a01b0381166141e75760405162461bcd60e51b815260040161110790615bec565b601180546001600160a01b0319166001600160a01b03831617905561420a612c97565b6040516001600160a01b03831681527fed4c186f01f2ae06c493a4cb750cb7ff39276f1ddd6095f2ded978d854f35566906020016120f7565b600b546001600160a01b0316331461426d5760405162461bcd60e51b815260040161110790615d64565b6001600160a01b0381166142d95760405162461bcd60e51b815260206004820152602d60248201527f726577617264547261636b657220616464726573732063616e206e6f7420626560448201526c207a65726f206164647265737360981b6064820152608401611107565b602280546001600160a01b0319166001600160a01b0383161790556142fc612c97565b6040516001600160a01b03831681527fa69d3015d1a4a32890f55a19cdb487318ef0efae432049508eaa1a6299f6681e906020016120f7565b600b546001600160a01b0316331461435f5760405162461bcd60e51b815260040161110790615d64565b600081116143c05760405162461bcd60e51b815260206004820152602860248201527f757365724578697445706f636873206d7573742062652067726561746572207460448201526768616e207a65726f60c01b6064820152608401611107565b601b8190556143cd612c97565b6040518281527f94e48a5fc75223ab6878e82a74ddb71e7b9531a38196bffa80f6c24c8189c8bb906020016120f7565b600a546001600160a01b031633146144275760405162461bcd60e51b815260040161110790615c4c565b6001600160a01b03811661448c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401611107565b6114db81614fc6565b6000710b7abc627050305adf14a3d9e400000000006144b2612bc3565b6144bb8461104d565b6144c59190615cf7565b6110bc9190615e24565b601960205281600052604060002081815481106144eb57600080fd5b6000918252602090912001546001600160a01b03169150829050565b600b546001600160a01b031633146145315760405162461bcd60e51b815260040161110790615d64565b6001600160a01b0381166145875760405162461bcd60e51b815260206004820152601d60248201527f666565546f2063616e206e6f74206265207a65726f20616464726573730000006044820152606401611107565b600280546001600160a01b0319166001600160a01b0383161790556145aa612c97565b6040516001600160a01b03831681527f9cd35b5fb344721aa5c6e0131be8bb60428e3c5f87ceb720ad48c5e45d1c3680906020016120f7565b6011546001600160a01b0316331461460d5760405162461bcd60e51b815260040161110790615d16565b6101f48211156146585760405162461bcd60e51b8152602060048201526016602482015275676c70496e4665653a206f7574206f662072616e676560501b6044820152606401611107565b6101f48111156146aa5760405162461bcd60e51b815260206004820152601760248201527f676c704f75744665653a206f7574206f662072616e67650000000000000000006044820152606401611107565b601c829055601d8190556146bc612c97565b60408051848152602081018490527fbc3c09f0d8b232228fc13cfd54186189df86128e362310d343ec24424af28a9891016117bb565b600c546001600160a01b0316331461474c5760405162461bcd60e51b815260206004820152601d60248201527f63616c6c6572206973206e6f742074686520626c61636b6c69737465720000006044820152606401611107565b6001600160a01b0381166000818152600d6020526040808220805460ff19166001179055517fffa4e6181777692565cf28528fc88fd1516ea86b56da075235fa575af6a4b8559190a250565b6147bc60405180606001604052806000815260200160008152602001600081525090565b60156147c6611e63565b815481106147d6576147d6615da8565b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b61483660405180606001604052806000815260200160008152602001600081525090565b601561485a836001600160a01b031660009081526014602052604090206001015490565b8154811061486a5761486a615da8565b906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250509050919050565b60006001600160ff1b038211156149125760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401611107565b5090565b6001600160a01b0381166149825760405162461bcd60e51b815260206004820152602d60248201527f6f70657261746f723a207a65726f206164647265737320676976656e20666f7260448201526c103732bb9037b832b930ba37b960991b6064820152608401611107565b6040516001600160a01b038216906000907f74da04524d50c64947f5dd5381ef1a4dca5cba8ed1d816243f9e48aa0b5617ed908290a3600b80546001600160a01b0319166001600160a01b0392909216919091179055565b600e5460ff1615611e615760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401611107565b33600090815260036020526040902060020154811115614a9c5760405162461bcd60e51b815260206004820152603160248201527f776974686472617720726571756573742067726561746572207468616e2077696044820152701d1a191c985dd8589b1948185b5bdd5b9d607a1b6064820152608401611107565b8060046002016000828254614ab19190615d4d565b90915550503360009081526003602052604081206002018054839290614ad8908490615d4d565b90915550503360009081526003602081905260408220015490811315614b4f5733600090815260036020819052604082200181905560078054839290614b1f908490615a8a565b90915550612e0a905033614b3283614bb3565b614b3c9085615c34565b6000546001600160a01b031691906152c3565b6000811215614b9c5733600090815260036020819052604082200181905560078054839290614b7f908490615a8a565b90915550612e0a905033614b9283614bb3565b614b3c9085615d4d565b600054612e0a906001600160a01b031633846152c3565b600080821215614912576110bc82615e7a565b919050565b614bd361540c565b600e805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600260095403614c6f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611107565b6002600955565b6001600160a01b03811660009081526003602052604090205415614d025760405162461bcd60e51b815260206004820152603c60248201527f696e76616c69642072656365697665723a20726563656976657220776169742060448201527f62616c616e6365206973206e6f7420657175616c20746f207a65726f000000006064820152608401611107565b614d0b81614020565b15614d7e5760405162461bcd60e51b815260206004820152603e60248201527f696e76616c69642072656365697665723a207265636569766572207374616b6560448201527f642062616c616e6365206973206e6f7420657175616c20746f207a65726f00006064820152608401611107565b6001600160a01b03811660009081526003602052604090206002015415614e0f576040805162461bcd60e51b81526020600482015260248101919091527f696e76616c69642072656365697665723a20726563656976657220776974686460448201527f7261772062616c616e6365206973206e6f7420657175616c20746f207a65726f6064820152608401611107565b6001600160a01b0381166000908152600360208190526040909120015415614e9f5760405162461bcd60e51b815260206004820152603e60248201527f696e76616c69642072656365697665723a20726563656976657220726577617260448201527f642062616c616e6365206973206e6f7420657175616c20746f207a65726f00006064820152608401611107565b6001600160a01b038116600090815260146020526040902054156114db5760405162461bcd60e51b815260206004820152603c60248201527f696e76616c69642072656365697665723a20726563656976657220726577617260448201527f644561726e6564206973206e6f7420657175616c20746f207a65726f000000006064820152608401611107565b6001600160a01b038116156114db576001600160a01b0381166000908152601460209081526040918290208251606081018452815481526001820154928101929092526002015491810191909152614f8282610fc4565b8152614f8c611e63565b60208083019182526001600160a01b0384166000908152601490915260409081902083518155915160018301559091015160029091015550565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6150206149da565b600e805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258614c003390565b8015806150cf5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156150a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906150cd9190615bd3565b155b61513a5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401611107565b6040516001600160a01b03831660248201526044810182905261384090849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152615455565b6040516001600160a01b03808516602483015283166044820152606481018290526151d59085906323b872dd60e01b90608401615166565b50505050565b80600460000160008282546151f09190615c34565b90915550503360009081526003602052604081208054839290615214908490615c34565b90915550506000546114db906001600160a01b031633308461519d565b600061523c82614f2b565b6001600160a01b038216600090815260146020908152604080832080549084905560039283905290832090910180549192839261527a908490615b92565b90915550506040518181526001600160a01b038416907f6323c674f8ad5f04d52cf1559f96e3363e3a99871080dd7ca30f25af4d451a7c9060200160405180910390a292915050565b6040516001600160a01b03831660248201526044810182905261384090849063a9059cbb60e01b90606401615166565b804710156153435760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401611107565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114615390576040519150601f19603f3d011682016040523d82523d6000602084013e615395565b606091505b50509050806138405760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401611107565b600e5460ff16611e615760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401611107565b60006154aa826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166155279092919063ffffffff16565b80519091501561384057808060200190518101906154c89190615e96565b6138405760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611107565b6060611045848460008585600080866001600160a01b0316858760405161554e9190615edf565b60006040518083038185875af1925050503d806000811461558b576040519150601f19603f3d011682016040523d82523d6000602084013e615590565b606091505b50915091506155a1878383876155ac565b979650505050505050565b6060831561561b578251600003615614576001600160a01b0385163b6156145760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611107565b5081611045565b61104583838151156156305781518083602001fd5b8060405162461bcd60e51b81526004016111079190615efb565b50805460008255906000526020600020908101906114db91905b808211156149125760008155600101615664565b80356001600160a01b0381168114614bc657600080fd5b6000602082840312156156a157600080fd5b6156aa82615678565b9392505050565b80151581146114db57600080fd5b6000602082840312156156d157600080fd5b81356156aa816156b1565b60008060008060008060008060006101208a8c0312156156fb57600080fd5b6157048a615678565b985061571260208b01615678565b975060408a0135965061572760608b01615678565b955060808a0135945060a08a0135935060c08a0135925060e08a013591506157526101008b01615678565b90509295985092959850929598565b60006020828403121561577357600080fd5b5035919050565b600080600080600080600060e0888a03121561579557600080fd5b87356157a0816156b1565b965060208801356157b0816156b1565b955060408801356157c0816156b1565b945060608801356157d0816156b1565b935060808801356157e0816156b1565b925060a08801356157f0816156b1565b915060c0880135615800816156b1565b8091505092959891949750929550565b6000806040838503121561582357600080fd5b61582c83615678565b915061583a60208401615678565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561586c57600080fd5b823567ffffffffffffffff8082111561588457600080fd5b818501915085601f83011261589857600080fd5b8135818111156158aa576158aa615843565b8060051b604051601f19603f830116810181811085821117156158cf576158cf615843565b6040529182528482019250838101850191888311156158ed57600080fd5b938501935b828510156159125761590385615678565b845293850193928501926158f2565b98975050505050505050565b6000806000806080858703121561593457600080fd5b61593d85615678565b966020860135965060408601359560600135945092505050565b6000806000806080858703121561596d57600080fd5b61597685615678565b9350602085013592506040850135915061599260608601615678565b905092959194509250565b6000806000606084860312156159b257600080fd5b6159bb84615678565b9250602084013591506159d060408501615678565b90509250925092565b600080604083850312156159ec57600080fd5b8235915061583a60208401615678565b600080600060608486031215615a1157600080fd5b505081359360208301359350604090920135919050565b60008060408385031215615a3b57600080fd5b615a4483615678565b946020939093013593505050565b60008060408385031215615a6557600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b60008083128015600160ff1b850184121615615aa857615aa8615a74565b6001600160ff1b0384018313811615615ac357615ac3615a74565b50500390565b60006001600160ff1b0381841382841380821686840486111615615aef57615aef615a74565b600160ff1b6000871282811687830589121615615b0e57615b0e615a74565b60008712925087820587128484161615615b2a57615b2a615a74565b87850587128184161615615b4057615b40615a74565b505050929093029392505050565b634e487b7160e01b600052601260045260246000fd5b600082615b7357615b73615b4e565b600160ff1b821460001984141615615b8d57615b8d615a74565b500590565b600080821280156001600160ff1b0384900385131615615bb457615bb4615a74565b600160ff1b8390038412811615615bcd57615bcd615a74565b50500190565b600060208284031215615be557600080fd5b5051919050565b60208082526028908201527f747265617375727920616464726573732063616e206e6f74206265207a65726f604082015267206164647265737360c01b606082015260800190565b60008219821115615c4757615c47615a74565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601690820152751858d8dbdd5b9d081a5cc8189b1858dadb1a5cdd195960521b604082015260600190565b60208082526026908201527f436f6e747261637447756172643a206f6e6520626c6f636b2c206f6e652066756040820152653731ba34b7b760d11b606082015260800190565b6000816000190483118215151615615d1157615d11615a74565b500290565b6020808252601a908201527f63616c6c6572206973206e6f7420746865207472656173757279000000000000604082015260600190565b600082821015615d5f57615d5f615a74565b500390565b60208082526024908201527f6f70657261746f723a2063616c6c6572206973206e6f7420746865206f70657260408201526330ba37b960e11b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600060018201615dd057615dd0615a74565b5060010190565b6020808252825182820181905260009190848201906040850190845b81811015615e185783516001600160a01b031683529284019291840191600101615df3565b50909695505050505050565b600082615e3357615e33615b4e565b500490565b60208082526022908201527f746f20616464726573732063616e206e6f74206265207a65726f206164647265604082015261737360f01b606082015260800190565b6000600160ff1b8201615e8f57615e8f615a74565b5060000390565b600060208284031215615ea857600080fd5b81516156aa816156b1565b60005b83811015615ece578181015183820152602001615eb6565b838111156151d55750506000910152565b60008251615ef1818460208701615eb3565b9190910192915050565b6020815260008251806020840152615f1a816040850160208701615eb3565b601f01601f1916919091016040019291505056fea26469706673582212200b46a014fee325afd37a8e48cba170934b0f8490e932c941576c80264eb74d7164736f6c634300080d0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.