Source Code
Latest 25 from a total of 2,633 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Emergency Withdr... | 42775628 | 166 days ago | IN | 0 S | 0.002799 | ||||
| Emergency Withdr... | 42722296 | 166 days ago | IN | 0 S | 0.002799 | ||||
| Emergency Withdr... | 42569399 | 167 days ago | IN | 0 S | 0.00354337 | ||||
| Emergency Withdr... | 20959716 | 282 days ago | IN | 0 S | 0.00400065 | ||||
| Claim All Farm R... | 20959671 | 282 days ago | IN | 0 S | 0.0013638 | ||||
| Claim Gauge Rewa... | 20255961 | 286 days ago | IN | 0 S | 0.00129435 | ||||
| Emergency Withdr... | 20255615 | 286 days ago | IN | 0 S | 0.00249455 | ||||
| Emergency Withdr... | 20255545 | 286 days ago | IN | 0 S | 0.00352895 | ||||
| Emergency Withdr... | 20085919 | 287 days ago | IN | 0 S | 0.00257395 | ||||
| Claim All Farm R... | 19241627 | 291 days ago | IN | 0 S | 0.0013638 | ||||
| Emergency Withdr... | 19241063 | 291 days ago | IN | 0 S | 0.0030124 | ||||
| Emergency Withdr... | 17439050 | 300 days ago | IN | 0 S | 0.00299274 | ||||
| Emergency Withdr... | 17336882 | 300 days ago | IN | 0 S | 0.0030124 | ||||
| Emergency Withdr... | 17333300 | 300 days ago | IN | 0 S | 0.0030124 | ||||
| Emergency Withdr... | 17330720 | 300 days ago | IN | 0 S | 0.00308545 | ||||
| Withdraw | 17328726 | 300 days ago | IN | 0 S | 0.005809 | ||||
| Withdraw | 17328695 | 300 days ago | IN | 0 S | 0.00784228 | ||||
| Collect Claim Fe... | 17325088 | 300 days ago | IN | 0 S | 0.00140446 | ||||
| Claim Gauge Rewa... | 17323046 | 300 days ago | IN | 0 S | 0.00154007 | ||||
| Collect Claim Fe... | 17322794 | 300 days ago | IN | 0 S | 0.0013638 | ||||
| Claim All Farm R... | 17322426 | 300 days ago | IN | 0 S | 0.0013638 | ||||
| Claim Gauge Rewa... | 17322328 | 300 days ago | IN | 0 S | 0.00149451 | ||||
| Claim Gauge Rewa... | 17250711 | 301 days ago | IN | 0 S | 0.0015525 | ||||
| Emergency Withdr... | 17250270 | 301 days ago | IN | 0 S | 0.00308874 | ||||
| Withdraw | 17195812 | 301 days ago | IN | 3 S | 0.0060934 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 17026884 | 302 days ago | 0.03147254 S | ||||
| 17023832 | 302 days ago | 0.01566825 S | ||||
| 17023653 | 302 days ago | 0.22752405 S | ||||
| 17022894 | 302 days ago | 3.40560999 S | ||||
| 17022727 | 302 days ago | 2.87195832 S | ||||
| 17022589 | 302 days ago | 0.01671039 S | ||||
| 17022314 | 302 days ago | 0.06784099 S | ||||
| 17021503 | 302 days ago | 0.7216033 S | ||||
| 17020690 | 302 days ago | 0.09661425 S | ||||
| 17019207 | 302 days ago | 0.0008149 S | ||||
| 17018757 | 302 days ago | 0.32841916 S | ||||
| 17018658 | 302 days ago | 0.28112882 S | ||||
| 17018574 | 302 days ago | 0.06015756 S | ||||
| 17018052 | 302 days ago | 18,073.08780051 S | ||||
| 17018014 | 302 days ago | 3.92845847 S | ||||
| 17017771 | 302 days ago | 0.10462658 S | ||||
| 17017630 | 302 days ago | 0.66502971 S | ||||
| 17017608 | 302 days ago | 9.3086633 S | ||||
| 17017302 | 302 days ago | 6.425815 S | ||||
| 17017267 | 302 days ago | 3.73302493 S | ||||
| 17017195 | 302 days ago | 0.11123257 S | ||||
| 17017182 | 302 days ago | 0.18631658 S | ||||
| 17017092 | 302 days ago | 0.52718826 S | ||||
| 17016739 | 302 days ago | 0.41048092 S | ||||
| 17016668 | 302 days ago | 2.74580476 S |
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
ShareRewardPool
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "../interfaces/IBasisAsset.sol";
import "../lib/SafeMath.sol";
import "../interfaces/IOracle.sol";
import "../interfaces/farming/IERC4626.sol";
import "../interfaces/farming/IShadowGauge.sol";
import "../interfaces/farming/IShadowVoter.sol";
import "../interfaces/farming/IX33.sol";
contract ShareRewardPool is ReentrancyGuard {
using SafeERC20 for IERC20;
using SafeMath for uint256;
enum GaugeDex {
NONE,
SHADOW
}
// governance
address public operator;
// Info of each user.
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
}
struct GaugeInfo {
bool isGauge; // If this is a gauge
address gauge; // The gauge
GaugeDex gaugeDex; // Dex of the gauge
}
// Info of each pool.
struct PoolInfo {
IERC20 token; // Address of LP token contract.
uint256 depFee; // deposit fee that is applied to created pool.
uint256 allocPoint; // How many allocation points assigned to this pool. XQUANTs to distribute per block.
uint256 lastRewardTime; // Last time that XQUANTs distribution occurs.
uint256 accXquantPerShare; // Accumulated XQUANTs per share, times 1e18. See below.
bool isStarted; // if lastRewardTime has passed
GaugeInfo gaugeInfo; // Gauge info (does this pool have a gauge and where is it)
uint256 poolXquantPerSec; // rewards per second for pool (acts as allocPoint)
}
IERC20 public xquant;
IOracle public xquantOracle;
bool public claimGaugeRewardsOnUpdatePool;
bool public claimFeeEnabled;
bool public mustConvertXShadow;
uint256 public claimFee;
uint256 public minClaimThreshold;
IShadowVoter public shadowVoter;
address public constant XSHADOW_TOKEN =
0x5050bc082FF4A74Fb6B0B04385dEfdDB114b2424;
address public constant X33_TOKEN =
0x3333111A391cC08fa51353E9195526A70b333333;
address public constant X33_WRAPPER =
0x9710E10A8f6FbA8C391606fee18614885684548d;
address public bribesSafe;
// Whitelist for fee exemption
mapping(address => bool) public feeWhitelist;
// Info of each pool.
PoolInfo[] public poolInfo;
// Info of each user that stakes LP tokens.
mapping(uint256 => mapping(address => UserInfo)) public userInfo;
// Pending rewards for each user in each pool (pending rewards accrued since last deposit/withdrawal)
mapping(uint256 => mapping(address => uint256)) public pendingRewards;
// Total allocation points. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint;
// The time when XQUANT mining starts.
uint256 public poolStartTime;
// The time when XQUANT mining ends.
uint256 public poolEndTime;
uint256 public sharePerSecond;
uint256 public runningTime;
event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
event EmergencyWithdraw(
address indexed user,
uint256 indexed pid,
uint256 amount
);
event RewardPaid(address indexed user, uint256 amount);
constructor(
address _xquant,
address _bribesSafe,
uint256 _poolStartTime,
address _shadowVoter,
address _xquantOracle
) {
require(
block.timestamp < _poolStartTime,
"pool cant be started in the past"
);
if (_xquant != address(0)) xquant = IERC20(_xquant);
if (_bribesSafe != address(0)) bribesSafe = _bribesSafe;
claimFeeEnabled = true;
claimFee = 50;
minClaimThreshold = 1e12;
mustConvertXShadow = true;
claimGaugeRewardsOnUpdatePool = true;
totalAllocPoint = 0;
sharePerSecond = 0;
runningTime = 365 days;
poolStartTime = _poolStartTime;
poolEndTime = _poolStartTime + runningTime;
operator = msg.sender;
shadowVoter = IShadowVoter(_shadowVoter);
xquantOracle = IOracle(_xquantOracle);
bribesSafe = _bribesSafe;
// create all the pools
add(0.0006 ether, 0, IERC20(0xa774bf15419499d1e9B227188eCa366ff55Af4bE), false, 0); // QUANT-scUSD Liquidity Pair Contract
add(0.0004 ether, 0, IERC20(0xe17077DaEC614D918c38D5378710730223822A29), false, 0); // XQUANT-OS Liquidity Pair Contract
}
modifier onlyOperator() {
require(
operator == msg.sender,
"ShareRewardPool: caller is not the operator"
);
_;
}
function poolLength() external view returns (uint256) {
return poolInfo.length;
}
function checkPoolDuplicate(IERC20 _token) internal view {
uint256 length = poolInfo.length;
for (uint256 pid = 0; pid < length; ++pid) {
require(
poolInfo[pid].token != _token,
"ShareRewardPool: existing pool?"
);
}
}
// Add new lp to the pool. Can only be called by operator.
function add(
uint256 _allocPoint,
uint256 _depFee,
IERC20 _token,
bool _withUpdate,
uint256 _lastRewardTime
) public onlyOperator {
checkPoolDuplicate(_token);
require(_depFee == 0, "Deposit fee must be 0"); // deposit fee cant be more than 2%;
if (_withUpdate) {
massUpdatePools();
}
if (block.timestamp < poolStartTime) {
// chef is sleeping
if (_lastRewardTime == 0) {
_lastRewardTime = poolStartTime;
} else {
if (_lastRewardTime < poolStartTime) {
_lastRewardTime = poolStartTime;
}
}
} else {
// chef is cooking
if (_lastRewardTime == 0 || _lastRewardTime < block.timestamp) {
_lastRewardTime = block.timestamp;
}
}
bool _isStarted = (_lastRewardTime <= poolStartTime) ||
(_lastRewardTime <= block.timestamp);
poolInfo.push(
PoolInfo({
token: _token,
depFee: _depFee,
allocPoint: _allocPoint,
poolXquantPerSec: _allocPoint,
lastRewardTime: _lastRewardTime,
accXquantPerShare: 0,
isStarted: _isStarted,
gaugeInfo: GaugeInfo(false, address(0), GaugeDex.NONE)
})
);
// enableGauge(poolInfo.length - 1);
if (_isStarted) {
totalAllocPoint = totalAllocPoint.add(_allocPoint);
sharePerSecond = sharePerSecond.add(_allocPoint);
}
}
// Update the given pool's XQUANT allocation point. Can only be called by the operator.
function set(
uint256 _pid,
uint256 _allocPoint,
uint256 _depFee
) public onlyOperator {
massUpdatePools();
PoolInfo storage pool = poolInfo[_pid];
require(_depFee == 0, "Deposit fee must be 0");
pool.depFee = _depFee;
if (pool.isStarted) {
totalAllocPoint = totalAllocPoint.sub(pool.allocPoint).add(
_allocPoint
);
sharePerSecond = sharePerSecond.sub(pool.poolXquantPerSec).add(
_allocPoint
);
}
pool.allocPoint = _allocPoint;
pool.poolXquantPerSec = _allocPoint;
}
function bulkSet(
uint256[] calldata _pids,
uint256[] calldata _allocPoints,
uint256[] calldata _depFees
) external onlyOperator {
require(
_pids.length == _allocPoints.length &&
_pids.length == _depFees.length,
"XQuantRewardPool: invalid length"
);
for (uint256 i = 0; i < _pids.length; i++) {
set(_pids[i], _allocPoints[i], _depFees[i]);
}
}
// Return accumulate rewards over the given _from to _to block.
function getGeneratedReward(
uint256 _fromTime,
uint256 _toTime
) public view returns (uint256) {
if (_fromTime >= _toTime) return 0;
if (_toTime >= poolEndTime) {
if (_fromTime >= poolEndTime) return 0;
if (_fromTime <= poolStartTime)
return poolEndTime.sub(poolStartTime).mul(sharePerSecond);
return poolEndTime.sub(_fromTime).mul(sharePerSecond);
} else {
if (_toTime <= poolStartTime) return 0;
if (_fromTime <= poolStartTime)
return _toTime.sub(poolStartTime).mul(sharePerSecond);
return _toTime.sub(_fromTime).mul(sharePerSecond);
}
}
// View function to see pending XQUANTs on frontend.
function pendingShare(
uint256 _pid,
address _user
) public view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accXquantPerShare = pool.accXquantPerShare;
uint256 tokenSupply = pool.gaugeInfo.isGauge
? IShadowGauge(pool.gaugeInfo.gauge).balanceOf(address(this))
: pool.token.balanceOf(address(this));
if (block.timestamp > pool.lastRewardTime && tokenSupply != 0) {
uint256 _generatedReward = getGeneratedReward(
pool.lastRewardTime,
block.timestamp
);
uint256 _xquantReward = _generatedReward.mul(pool.allocPoint).div(
totalAllocPoint
);
accXquantPerShare = accXquantPerShare.add(
_xquantReward.mul(1e18).div(tokenSupply)
);
}
return
user.amount.mul(accXquantPerShare).div(1e18).sub(user.rewardDebt);
}
// View function to see pending XQUANTs on frontend and any other pending rewards accumulated.
function pendingShareAndPendingRewards(
uint256 _pid,
address _user
) external view returns (uint256) {
uint256 _pendingShare = pendingShare(_pid, _user);
return _pendingShare.add(pendingRewards[_pid][_user]);
}
function massUpdatePools() public {
uint256 length = poolInfo.length;
for (uint256 pid = 0; pid < length; ++pid) {
updatePool(pid);
updatePoolWithGaugeDeposit(pid);
}
}
// massUpdatePoolsInRange
function massUpdatePoolsInRange(uint256 _fromPid, uint256 _toPid) public {
require(_fromPid <= _toPid, "XQuantRewardPool: invalid range");
for (uint256 pid = _fromPid; pid <= _toPid; ++pid) {
updatePool(pid);
updatePoolWithGaugeDeposit(pid);
}
}
// Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) private {
//updatePoolWithGaugeDeposit(_pid);
PoolInfo storage pool = poolInfo[_pid];
if (block.timestamp <= pool.lastRewardTime) {
return;
}
uint256 tokenSupply = pool.gaugeInfo.isGauge
? IShadowGauge(pool.gaugeInfo.gauge).balanceOf(address(this))
: pool.token.balanceOf(address(this));
if (tokenSupply == 0) {
pool.lastRewardTime = block.timestamp;
return;
}
if (!pool.isStarted) {
pool.isStarted = true;
totalAllocPoint = totalAllocPoint.add(pool.allocPoint);
sharePerSecond = sharePerSecond.add(pool.poolXquantPerSec);
}
if (totalAllocPoint > 0) {
uint256 _generatedReward = getGeneratedReward(
pool.lastRewardTime,
block.timestamp
);
uint256 _xquantReward = _generatedReward.mul(pool.allocPoint).div(
totalAllocPoint
);
pool.accXquantPerShare = pool.accXquantPerShare.add(
_xquantReward.mul(1e18).div(tokenSupply)
);
}
pool.lastRewardTime = block.timestamp;
if (claimGaugeRewardsOnUpdatePool) {
claimGaugeRewards(_pid);
}
}
// Deposit LP tokens to earn rewards
function updatePoolWithGaugeDeposit(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
address gauge = pool.gaugeInfo.gauge;
uint256 balance = pool.token.balanceOf(address(this));
// Do nothing if this pool doesn't have a gauge
if (pool.gaugeInfo.isGauge) {
// Do nothing if the LP token in the MC is empty
if (balance > 0) {
// Approve to the gauge
if (pool.token.allowance(address(this), gauge) < balance) {
pool.token.approve(gauge, type(uint256).max);
}
// Deposit the LP in the gauge
IShadowGauge(pool.gaugeInfo.gauge).deposit(balance);
}
}
}
// Claim rewards to treasury
function claimGaugeRewards(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (pool.gaugeInfo.isGauge) {
require(
pool.gaugeInfo.gaugeDex == GaugeDex.SHADOW,
"Only Shadow gauge supported"
);
_claimShadowRewards(_pid);
}
}
function claimAllFarmRewards() public onlyOperator {
uint256 length = poolInfo.length;
for (uint256 pid = 0; pid < length; ++pid) {
claimGaugeRewards(pid);
}
}
function _claimShadowRewards(uint256 _pid) internal {
PoolInfo storage pool = poolInfo[_pid];
address[] memory gaugeRewardTokens = IShadowGauge(pool.gaugeInfo.gauge)
.rewardsList();
IShadowGauge(pool.gaugeInfo.gauge).getReward(
address(this),
gaugeRewardTokens
);
for (uint256 i = 0; i < gaugeRewardTokens.length; i++) {
IERC20 rewardToken = IERC20(gaugeRewardTokens[i]);
uint256 rewardAmount = rewardToken.balanceOf(address(this));
if (rewardAmount > 0) {
if (address(rewardToken) == XSHADOW_TOKEN) {
if (mustConvertXShadow) {
_convertXShadow(rewardAmount);
}
} else {
rewardToken.safeTransfer(bribesSafe, rewardAmount);
}
}
}
}
function _convertXShadow(uint256 _amount) internal {
IERC20(XSHADOW_TOKEN).approve(X33_WRAPPER, _amount); // approve xshadow to X33_WRAPPER
bool canMint = IX33(X33_TOKEN).isUnlocked();
if (canMint) {
uint256 x33ReceivedAmount = IERC4626(X33_WRAPPER).deposit(
_amount,
address(this)
); // mint x33
IERC20(X33_TOKEN).safeTransfer(bribesSafe, x33ReceivedAmount); // send x33 to bribesSafe
}
}
function convertXShadowManual(
uint256 _amount,
bool _auto
) public onlyOperator {
IERC20(XSHADOW_TOKEN).approve(X33_WRAPPER, _amount); // approve xshadow to X33_WRAPPER
bool canMint = IX33(X33_TOKEN).isUnlocked();
if (canMint) {
if (_auto) {
uint256 x33ReceivedAmount = IERC4626(X33_WRAPPER).deposit(
_amount,
address(this)
); // mint x33
IERC20(X33_TOKEN).safeTransfer(bribesSafe, x33ReceivedAmount); // send x33 to bribesSafe
} else {
IERC4626(X33_WRAPPER).deposit(_amount, address(this)); // mint x33
IERC20(X33_TOKEN).safeTransfer(bribesSafe, _amount); // send x33 to bribesSafe
}
}
}
// Add a gauge to a pool
function enableGauge(uint256 _pid, GaugeDex _gaugeDex) public onlyOperator {
require(_gaugeDex == GaugeDex.SHADOW, "Only Shadow gauge supported");
_enableGaugeShadow(_pid);
}
function _enableGaugeShadow(uint256 _pid) internal {
address gauge = shadowVoter.gaugeForPool(address(poolInfo[_pid].token));
if (gauge != address(0)) {
poolInfo[_pid].gaugeInfo = GaugeInfo(true, gauge, GaugeDex.SHADOW);
}
}
// Withdraw LP from the gauge
function withdrawFromGauge(uint256 _pid, uint256 _amount) internal {
PoolInfo storage pool = poolInfo[_pid];
// Do nothing if this pool doesn't have a gauge
if (pool.gaugeInfo.isGauge) {
// Withdraw from the gauge
IShadowGauge(pool.gaugeInfo.gauge).withdraw(_amount);
}
}
// Deposit LP tokens.
function deposit(uint256 _pid, uint256 _amount) public nonReentrant {
address _sender = msg.sender;
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_sender];
updatePool(_pid);
if (user.amount > 0) {
uint256 _pending = user
.amount
.mul(pool.accXquantPerShare)
.div(1e18)
.sub(user.rewardDebt);
if (_pending > 0) {
// accrue pending rewards to be claimed later
pendingRewards[_pid][_sender] = pendingRewards[_pid][_sender]
.add(_pending);
}
}
if (_amount > 0) {
pool.token.safeTransferFrom(_sender, address(this), _amount);
uint256 depositDebt = _amount.mul(pool.depFee).div(10000);
user.amount = user.amount.add(_amount.sub(depositDebt));
pool.token.safeTransfer(bribesSafe, depositDebt);
}
updatePoolWithGaugeDeposit(_pid);
user.rewardDebt = user.amount.mul(pool.accXquantPerShare).div(1e18);
emit Deposit(_sender, _pid, _amount);
}
// Withdraw LP tokens.
function withdraw(
uint256 _pid,
uint256 _amount
) public payable nonReentrant {
address _sender = msg.sender;
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(_pid);
updatePoolWithGaugeDeposit(_pid);
uint256 _pending = user
.amount
.mul(pool.accXquantPerShare)
.div(1e18)
.sub(user.rewardDebt);
if (_pending > 0) {
// accrue pending rewards to be claimed later
pendingRewards[_pid][_sender] = pendingRewards[_pid][_sender].add(
_pending
);
}
if (_amount > 0) {
user.amount = user.amount.sub(_amount);
withdrawFromGauge(_pid, _amount);
pool.token.safeTransfer(_sender, _amount);
}
user.rewardDebt = user.amount.mul(pool.accXquantPerShare).div(1e18);
emit Withdraw(_sender, _pid, _amount);
}
function harvest(uint256 _pid) public payable nonReentrant {
address _sender = msg.sender;
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_sender];
// Ensure rewards are updated
updatePool(_pid);
updatePoolWithGaugeDeposit(_pid);
// Calculate the latest pending rewards
uint256 _pending = user
.amount
.mul(pool.accXquantPerShare)
.div(1e18)
.sub(user.rewardDebt);
uint256 _accumulatedPending = pendingRewards[_pid][_sender];
uint256 _rewardsToClaim = _pending.add(_accumulatedPending);
// Ensure that the user is claiming an amount above the minimum threshold
require(
_rewardsToClaim >= minClaimThreshold,
"Claim amount below minimum threshold"
);
if (_rewardsToClaim > 0) {
pendingRewards[_pid][_sender] = 0;
uint256 amountSonicToPay = 0;
if (claimFeeEnabled && !isWhitelisted(_sender)) {
uint256 currentXQUANTPriceInSonic = xquantOracle.twap(
address(xquant),
1e18
);
amountSonicToPay = (
currentXQUANTPriceInSonic.mul(_rewardsToClaim).div(1e18)
).mul(claimFee).div(1000);
require(
msg.value >= amountSonicToPay,
"insufficient S for claim fee"
);
} else {
require(msg.value == 0, "ShareRewardPool: invalid msg.value");
}
safeXquantTransfer(_sender, _rewardsToClaim);
emit RewardPaid(_sender, _rewardsToClaim);
// Refund any excess S if claimFeeEnabled is enabled and user is not whitelisted
if (
claimFeeEnabled &&
!isWhitelisted(_sender) &&
msg.value > amountSonicToPay
) {
uint256 refundAmount = msg.value - amountSonicToPay;
(bool success, ) = _sender.call{value: refundAmount}("");
require(success, "Refund failed");
}
}
// Update the user's reward debt
user.rewardDebt = user.amount.mul(pool.accXquantPerShare).div(1e18);
}
function harvestAll() public payable nonReentrant {
address _sender = msg.sender;
uint256 length = poolInfo.length;
uint256 totalUserRewardsToClaim = 0;
for (uint256 pid = 0; pid < length; ++pid) {
PoolInfo storage pool = poolInfo[pid];
UserInfo storage user = userInfo[pid][_sender];
// Ensure rewards are updated
updatePool(pid);
updatePoolWithGaugeDeposit(pid);
// Calculate the latest pending rewards
uint256 _pending = user
.amount
.mul(pool.accXquantPerShare)
.div(1e18)
.sub(user.rewardDebt);
uint256 _accumulatedPending = pendingRewards[pid][_sender];
uint256 _rewardsToClaim = _pending.add(_accumulatedPending);
if (_rewardsToClaim > 0) {
pendingRewards[pid][_sender] = 0;
totalUserRewardsToClaim = totalUserRewardsToClaim.add(
_rewardsToClaim
);
}
// Update the user's reward debt
user.rewardDebt = user.amount.mul(pool.accXquantPerShare).div(1e18);
}
// Ensure that the user is claiming an amount above the minimum threshold
require(
totalUserRewardsToClaim >= minClaimThreshold,
"Claim amount below minimum threshold"
);
if (totalUserRewardsToClaim > 0) {
uint256 amountSonicToPay = 0;
if (claimFeeEnabled && !isWhitelisted(_sender)) {
uint256 currentXQUANTPriceInSonic = xquantOracle.twap(
address(xquant),
1e18
);
amountSonicToPay = (
currentXQUANTPriceInSonic.mul(totalUserRewardsToClaim).div(
1e18
)
).mul(claimFee).div(1000);
require(
msg.value >= amountSonicToPay,
"insufficient S for claim fee"
);
} else {
require(msg.value == 0, "ShareRewardPool: invalid msg.value");
}
safeXquantTransfer(_sender, totalUserRewardsToClaim);
emit RewardPaid(_sender, totalUserRewardsToClaim);
// Refund any excess S if claimFeeEnabled is enabled and user is not whitelisted
if (
claimFeeEnabled &&
!isWhitelisted(_sender) &&
msg.value > amountSonicToPay
) {
uint256 refundAmount = msg.value - amountSonicToPay;
(bool success, ) = _sender.call{value: refundAmount}("");
require(success, "Refund failed");
}
}
}
// Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw(uint256 _pid) public nonReentrant {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
uint256 _amount = user.amount;
withdrawFromGauge(_pid, _amount);
pendingRewards[_pid][msg.sender] = 0;
user.amount = 0;
user.rewardDebt = 0;
pool.token.safeTransfer(msg.sender, _amount);
emit EmergencyWithdraw(msg.sender, _pid, _amount);
}
// Safe xquant transfer function, just in case if rounding error causes pool to not have enough XQUANTs.
function safeXquantTransfer(address _to, uint256 _amount) internal {
uint256 _xquantBal = xquant.balanceOf(address(this));
if (_xquantBal > 0) {
if (_amount > _xquantBal) {
xquant.safeTransfer(_to, _xquantBal);
} else {
xquant.safeTransfer(_to, _amount);
}
}
}
function setOperator(address _operator) external onlyOperator {
operator = _operator;
}
function setBribesSafe(address _bribesSafe) public onlyOperator {
bribesSafe = _bribesSafe;
}
function setClaimFee(uint256 _claimFee) external onlyOperator {
require(_claimFee <= 150, "ShareRewardPool: fee too high"); // max 15%
claimFee = _claimFee;
}
function setMustConvertXShadow(
bool _mustConvertXShadow
) external onlyOperator {
mustConvertXShadow = _mustConvertXShadow;
}
function setXQuantOracle(IOracle _xquantOracle) external onlyOperator {
xquantOracle = _xquantOracle;
}
function setClaimFeeEnabled(bool _enabled) external onlyOperator {
claimFeeEnabled = _enabled;
}
function setMinClaimThreshold(
uint256 _minClaimThreshold
) external onlyOperator {
require(
_minClaimThreshold >= 0,
"ShareRewardPool: invalid min claim threshold"
);
require(
_minClaimThreshold <= 1e18,
"ShareRewardPool: invalid max claim threshold"
);
minClaimThreshold = _minClaimThreshold;
}
function setClaimGaugeRewardsOnUpdatePool(
bool _claimGaugeRewardsOnUpdatePool
) external onlyOperator {
claimGaugeRewardsOnUpdatePool = _claimGaugeRewardsOnUpdatePool;
}
function governanceRecoverUnsupported(
IERC20 _token,
uint256 amount,
address to
) external onlyOperator {
uint256 length = poolInfo.length;
for (uint256 pid = 0; pid < length; ++pid) {
PoolInfo storage pool = poolInfo[pid];
require(
_token != pool.token,
"ShareRewardPool: Token cannot be pool token"
);
}
_token.safeTransfer(to, amount);
}
/**
* @notice Collects the Sonic.
*/
function collectClaimFee() public onlyOperator {
(bool sent, ) = bribesSafe.call{value: address(this).balance}("");
require(sent, "failed to send S");
}
/**
* @notice Checks if an address is whitelisted for fee exemption
* @param _address Address to check
* @return True if the address is whitelisted, false otherwise
*/
function isWhitelisted(address _address) public view returns (bool) {
return feeWhitelist[_address];
}
/**
* @notice Adds or removes an address from the fee exemption whitelist
* @param _address Address to update
* @param _status Whitelist status to set
*/
function setWhitelistStatus(
address _address,
bool _status
) external onlyOperator {
require(_address != address(0), "ShareRewardPool: invalid address");
feeWhitelist[_address] = _status;
}
/**
* @notice Calculates the amount of Sonic required to pay the claim fee for a pool
* @param _pid Pool ID
* @param _user Address of the user to calculate fee for
* @return The amount of Sonic required as fee
*/
function calculateClaimFeeAmount(
uint256 _pid,
address _user
) public view returns (uint256) {
// Whitelisted users don't pay fees
if (isWhitelisted(_user)) return 0;
uint256 _pending = pendingShare(_pid, _user);
uint256 _accumulatedPending = pendingRewards[_pid][_user];
uint256 _rewardsToClaim = _pending.add(_accumulatedPending);
// No fee if disabled or rewards below threshold
if (!claimFeeEnabled || _rewardsToClaim < minClaimThreshold) return 0;
// Calculate fee based on XQUANT price in Sonic
uint256 currentXQUANTPriceInSonic = xquantOracle.twap(
address(xquant),
1e18
);
return
(currentXQUANTPriceInSonic.mul(_rewardsToClaim).div(1e18))
.mul(claimFee)
.div(1000);
}
/**
* @notice Calculates the total claim fee for a user across all pools
* @param _user Address of the user
* @return Total fee amount in Sonic
*/
function calculateTotalClaimFeeAmount(
address _user
) public view returns (uint256) {
// Whitelisted users don't pay fees
if (isWhitelisted(_user)) return 0;
uint256 totalRewards = 0;
// Add up rewards from all pools
for (uint256 pid = 0; pid < poolInfo.length; pid++) {
uint256 _pending = pendingShare(pid, _user);
uint256 _accumulatedPending = pendingRewards[pid][_user];
totalRewards = totalRewards.add(_pending).add(_accumulatedPending);
}
// No fee if disabled or rewards below threshold
if (!claimFeeEnabled || totalRewards < minClaimThreshold) return 0;
// Calculate fee based on XQUANT price in Sonic
uint256 currentXQUANTPriceInSonic = xquantOracle.twap(
address(xquant),
1e18
);
return
(currentXQUANTPriceInSonic.mul(totalRewards).div(1e18))
.mul(claimFee)
.div(1000);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reininitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 1;
if (isTopLevelCall) {
$._initializing = true;
}
_;
if (isTopLevelCall) {
$._initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 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 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4626.sol)
pragma solidity ^0.8.20;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
/**
* @dev Interface of the ERC-4626 "Tokenized Vault Standard", as defined in
* https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].
*/
interface IERC4626 is IERC20, IERC20Metadata {
event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);
event Withdraw(
address indexed sender,
address indexed receiver,
address indexed owner,
uint256 assets,
uint256 shares
);
/**
* @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.
*
* - MUST be an ERC-20 token contract.
* - MUST NOT revert.
*/
function asset() external view returns (address assetTokenAddress);
/**
* @dev Returns the total amount of the underlying asset that is “managed” by Vault.
*
* - SHOULD include any compounding that occurs from yield.
* - MUST be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT revert.
*/
function totalAssets() external view returns (uint256 totalManagedAssets);
/**
* @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal
* scenario where all the conditions are met.
*
* - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT show any variations depending on the caller.
* - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
* - MUST NOT revert.
*
* NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
* “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
* from.
*/
function convertToShares(uint256 assets) external view returns (uint256 shares);
/**
* @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal
* scenario where all the conditions are met.
*
* - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT show any variations depending on the caller.
* - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
* - MUST NOT revert.
*
* NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
* “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
* from.
*/
function convertToAssets(uint256 shares) external view returns (uint256 assets);
/**
* @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,
* through a deposit call.
*
* - MUST return a limited value if receiver is subject to some deposit limit.
* - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.
* - MUST NOT revert.
*/
function maxDeposit(address receiver) external view returns (uint256 maxAssets);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given
* current on-chain conditions.
*
* - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit
* call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called
* in the same transaction.
* - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the
* deposit would be accepted, regardless if the user has enough tokens approved, etc.
* - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by depositing.
*/
function previewDeposit(uint256 assets) external view returns (uint256 shares);
/**
* @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.
*
* - MUST emit the Deposit event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* deposit execution, and are accounted for during deposit.
* - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not
* approving enough underlying tokens to the Vault contract, etc).
*
* NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
*/
function deposit(uint256 assets, address receiver) external returns (uint256 shares);
/**
* @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.
* - MUST return a limited value if receiver is subject to some mint limit.
* - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.
* - MUST NOT revert.
*/
function maxMint(address receiver) external view returns (uint256 maxShares);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given
* current on-chain conditions.
*
* - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call
* in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the
* same transaction.
* - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint
* would be accepted, regardless if the user has enough tokens approved, etc.
* - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by minting.
*/
function previewMint(uint256 shares) external view returns (uint256 assets);
/**
* @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.
*
* - MUST emit the Deposit event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint
* execution, and are accounted for during mint.
* - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not
* approving enough underlying tokens to the Vault contract, etc).
*
* NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
*/
function mint(uint256 shares, address receiver) external returns (uint256 assets);
/**
* @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the
* Vault, through a withdraw call.
*
* - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
* - MUST NOT revert.
*/
function maxWithdraw(address owner) external view returns (uint256 maxAssets);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,
* given current on-chain conditions.
*
* - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw
* call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if
* called
* in the same transaction.
* - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though
* the withdrawal would be accepted, regardless if the user has enough shares, etc.
* - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by depositing.
*/
function previewWithdraw(uint256 assets) external view returns (uint256 shares);
/**
* @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.
*
* - MUST emit the Withdraw event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* withdraw execution, and are accounted for during withdraw.
* - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner
* not having enough shares, etc).
*
* Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
* Those methods should be performed separately.
*/
function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);
/**
* @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,
* through a redeem call.
*
* - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
* - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.
* - MUST NOT revert.
*/
function maxRedeem(address owner) external view returns (uint256 maxShares);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,
* given current on-chain conditions.
*
* - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call
* in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the
* same transaction.
* - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the
* redemption would be accepted, regardless if the user has enough shares, etc.
* - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by redeeming.
*/
function previewRedeem(uint256 shares) external view returns (uint256 assets);
/**
* @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.
*
* - MUST emit the Withdraw event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* redeem execution, and are accounted for during redeem.
* - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner
* not having enough shares, etc).
*
* NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
* Those methods should be performed separately.
*/
function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.26;
interface IShadowGauge {
error ZERO_AMOUNT();
error CANT_NOTIFY_STAKE();
error REWARD_TOO_HIGH();
error NOT_GREATER_THAN_REMAINING(uint256 amount, uint256 remaining);
error TOKEN_ERROR(address token);
error NOT_WHITELISTED();
error NOT_AUTHORIZED();
event Deposit(address indexed from, uint256 amount);
event Withdraw(address indexed from, uint256 amount);
event NotifyReward(
address indexed from,
address indexed reward,
uint256 amount
);
event ClaimRewards(
address indexed from,
address indexed reward,
uint256 amount
);
event RewardWhitelisted(address indexed reward, bool whitelisted);
/// @notice Get the amount of stakingToken deposited by an account
function balanceOf(address) external view returns (uint256);
/// @notice returns an array with all the addresses of the rewards
/// @return _rewards array of addresses for rewards
function rewardsList() external view returns (address[] memory _rewards);
/// @notice number of different rewards the gauge has facilitated that are 'active'
/// @return _length the number of individual rewards
function rewardsListLength() external view returns (uint256 _length);
/// @notice returns the last time the reward was modified or periodFinish if the reward has ended
/// @param token address of the token
/// @return ltra last time reward applicable
function lastTimeRewardApplicable(
address token
) external view returns (uint256 ltra);
/// @notice displays the data struct of rewards for a token
/// @param token the address of the token
/// @return data rewards struct
function rewardData(
address token
) external view returns (Reward memory data);
/// @notice calculates the amount of tokens earned for an address
/// @param token address of the token to check
/// @param account address to check
/// @return _reward amount of token claimable
function earned(
address token,
address account
) external view returns (uint256 _reward);
/// @notice claims rewards (shadow + any external LP Incentives)
/// @param account the address to claim for
/// @param tokens an array of the tokens to claim
function getReward(address account, address[] calldata tokens) external;
/// @notice claims all rewards and instant exits xshadow into shadow
function getRewardAndExit(
address account,
address[] calldata tokens
) external;
/// @notice calculates the token amounts earned per lp token
/// @param token address of the token to check
/// @return rpt reward per token
function rewardPerToken(address token) external view returns (uint256 rpt);
/// @notice deposit all LP tokens from msg.sender's wallet to the gauge
function depositAll() external;
/// @param recipient the address of who to deposit on behalf of
/// @param amount the amount of LP tokens to withdraw
function depositFor(address recipient, uint256 amount) external;
/// @notice deposit LP tokens to the gauge
/// @param amount the amount of LP tokens to withdraw
function deposit(uint256 amount) external;
/// @notice withdraws all fungible LP tokens from legacy gauges
function withdrawAll() external;
/// @notice withdraws fungible LP tokens from legacy gauges
/// @param amount the amount of LP tokens to withdraw
function withdraw(uint256 amount) external;
/// @notice calculates how many tokens are left to be distributed
/// @dev reduces per second
/// @param token the address of the token
function left(address token) external view returns (uint256);
/// @notice add a reward to the whitelist
/// @param _reward address of the reward
function whitelistReward(address _reward) external;
/// @notice remove rewards from the whitelist
/// @param _reward address of the reward
function removeRewardWhitelist(address _reward) external;
/**
* @notice amount must be greater than left() for the token, this is to prevent griefing attacks
* @notice notifying rewards is completely permissionless
* @notice if nobody registers for a newly added reward for the period it will remain in the contract indefinitely
*/
function notifyRewardAmount(address token, uint256 amount) external;
struct Reward {
/// @dev tokens per second
uint256 rewardRate;
/// @dev 7 days after start
uint256 periodFinish;
uint256 lastUpdateTime;
uint256 rewardPerTokenStored;
}
/// @notice checks if a reward is whitelisted
/// @param reward the address of the reward
/// @return true if the reward is whitelisted, false otherwise
function isWhitelisted(address reward) external view returns (bool);
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.26;
pragma abicoder v2;
interface IShadowVoter {
error ACTIVE_GAUGE(address gauge);
error GAUGE_INACTIVE(address gauge);
error ALREADY_WHITELISTED(address token);
error NOT_AUTHORIZED(address caller);
error NOT_WHITELISTED();
error NOT_POOL();
error NOT_INIT();
error LENGTH_MISMATCH();
error NO_GAUGE();
error ALREADY_DISTRIBUTED(address gauge, uint256 period);
error ZERO_VOTE(address pool);
error RATIO_TOO_HIGH(uint256 _xRatio);
error VOTE_UNSUCCESSFUL();
event GaugeCreated(
address indexed gauge,
address creator,
address feeDistributor,
address indexed pool
);
event GaugeKilled(address indexed gauge);
event GaugeRevived(address indexed gauge);
event Voted(address indexed owner, uint256 weight, address indexed pool);
event Abstained(address indexed owner, uint256 weight);
event Deposit(
address indexed lp,
address indexed gauge,
address indexed owner,
uint256 amount
);
event Withdraw(
address indexed lp,
address indexed gauge,
address indexed owner,
uint256 amount
);
event NotifyReward(
address indexed sender,
address indexed reward,
uint256 amount
);
event DistributeReward(
address indexed sender,
address indexed gauge,
uint256 amount
);
event EmissionsRatio(
address indexed caller,
uint256 oldRatio,
uint256 newRatio
);
event NewGovernor(address indexed sender, address indexed governor);
event Whitelisted(address indexed whitelister, address indexed token);
event WhitelistRevoked(
address indexed forbidder,
address indexed token,
bool status
);
event MainTickSpacingChanged(
address indexed token0,
address indexed token1,
int24 indexed newMainTickSpacing
);
event Poke(address indexed user);
function initialize(
address _shadow,
address _legacyFactory,
address _gauges,
address _feeDistributorFactory,
address _minter,
address _msig,
address _xShadow,
address _clFactory,
address _clGaugeFactory,
address _nfpManager,
address _feeRecipientFactory,
address _voteModule,
address _launcherPlugin
) external;
/// @notice denominator basis
function BASIS() external view returns (uint256);
/// @notice ratio of xShadow emissions globally
function xRatio() external view returns (uint256);
/// @notice xShadow contract address
function xShadow() external view returns (address);
/// @notice legacy factory address (uni-v2/stableswap)
function legacyFactory() external view returns (address);
/// @notice concentrated liquidity factory
function clFactory() external view returns (address);
/// @notice gauge factory for CL
function clGaugeFactory() external view returns (address);
/// @notice legacy fee recipient factory
function feeRecipientFactory() external view returns (address);
/// @notice peripheral NFPManager contract
function nfpManager() external view returns (address);
/// @notice returns the address of the current governor
/// @return _governor address of the governor
function governor() external view returns (address _governor);
/// @notice the address of the vote module
/// @return _voteModule the vote module contract address
function voteModule() external view returns (address _voteModule);
/// @notice address of the central access Hub
function accessHub() external view returns (address);
/// @notice the address of the shadow launcher plugin to enable third party launchers
/// @return _launcherPlugin the address of the plugin
function launcherPlugin() external view returns (address _launcherPlugin);
/// @notice distributes emissions from the minter to the voter
/// @param amount the amount of tokens to notify
function notifyRewardAmount(uint256 amount) external;
/// @notice distributes the emissions for a specific gauge
/// @param _gauge the gauge address
function distribute(address _gauge) external;
/// @notice returns the address of the gauge factory
/// @param _gaugeFactory gauge factory address
function gaugeFactory() external view returns (address _gaugeFactory);
/// @notice returns the address of the feeDistributor factory
/// @return _feeDistributorFactory feeDist factory address
function feeDistributorFactory()
external
view
returns (address _feeDistributorFactory);
/// @notice returns the address of the minter contract
/// @return _minter address of the minter
function minter() external view returns (address _minter);
/// @notice check if the gauge is active for governance use
/// @param _gauge address of the gauge
/// @return _trueOrFalse if the gauge is alive
function isAlive(address _gauge) external view returns (bool _trueOrFalse);
/// @notice allows the token to be paired with other whitelisted assets to participate in governance
/// @param _token the address of the token
function whitelist(address _token) external;
/// @notice effectively disqualifies a token from governance
/// @param _token the address of the token
function revokeWhitelist(address _token) external;
/// @notice returns if the address is a gauge
/// @param gauge address of the gauge
/// @return _trueOrFalse boolean if the address is a gauge
function isGauge(address gauge) external view returns (bool _trueOrFalse);
/// @notice disable a gauge from governance
/// @param _gauge address of the gauge
function killGauge(address _gauge) external;
/// @notice re-activate a dead gauge
/// @param _gauge address of the gauge
function reviveGauge(address _gauge) external;
/// @notice re-cast a tokenID's votes
/// @param owner address of the owner
function poke(address owner) external;
/// @notice sets the main tickspacing of a token pairing
/// @param tokenA address of tokenA
/// @param tokenB address of tokenB
/// @param tickSpacing the main tickspacing to set to
function setMainTickSpacing(
address tokenA,
address tokenB,
int24 tickSpacing
) external;
/// @notice returns if the address is a fee distributor
/// @param _feeDistributor address of the feeDist
/// @return _trueOrFalse if the address is a fee distributor
function isFeeDistributor(
address _feeDistributor
) external view returns (bool _trueOrFalse);
/// @notice returns the address of the emission's token
/// @return _shadow emissions token contract address
function shadow() external view returns (address _shadow);
/// @notice returns the address of the pool's gauge, if any
/// @param _pool pool address
/// @return _gauge gauge address
function gaugeForPool(address _pool) external view returns (address _gauge);
/// @notice returns the address of the pool's feeDistributor, if any
/// @param _gauge address of the gauge
/// @return _feeDistributor address of the pool's feedist
function feeDistributorForGauge(
address _gauge
) external view returns (address _feeDistributor);
/// @notice returns the new toPool that was redirected fromPool
/// @param fromPool address of the original pool
/// @return toPool the address of the redirected pool
function poolRedirect(
address fromPool
) external view returns (address toPool);
/// @notice returns the gauge address of a CL pool
/// @param tokenA address of token A in the pair
/// @param tokenB address of token B in the pair
/// @param tickSpacing tickspacing of the pool
/// @return gauge address of the gauge
function gaugeForClPool(
address tokenA,
address tokenB,
int24 tickSpacing
) external view returns (address gauge);
/// @notice returns the array of all tickspacings for the tokenA/tokenB combination
/// @param tokenA address of token A in the pair
/// @param tokenB address of token B in the pair
/// @return _ts array of all the tickspacings
function tickSpacingsForPair(
address tokenA,
address tokenB
) external view returns (int24[] memory _ts);
/// @notice returns the main tickspacing used in the gauge/governance process
/// @param tokenA address of token A in the pair
/// @param tokenB address of token B in the pair
/// @return _ts the main tickspacing
function mainTickSpacingForPair(
address tokenA,
address tokenB
) external view returns (int24 _ts);
/// @notice returns the block.timestamp divided by 1 week in seconds
/// @return period the period used for gauges
function getPeriod() external view returns (uint256 period);
/// @notice cast a vote to direct emissions to gauges and earn incentives
/// @param owner address of the owner
/// @param _pools the list of pools to vote on
/// @param _weights an arbitrary weight per pool which will be normalized to 100% regardless of numerical inputs
function vote(
address owner,
address[] calldata _pools,
uint256[] calldata _weights
) external;
/// @notice reset the vote of an address
/// @param owner address of the owner
function reset(address owner) external;
/// @notice set the governor address
/// @param _governor the new governor address
function setGovernor(address _governor) external;
/// @notice recover stuck emissions
/// @param _gauge the gauge address
/// @param _period the period
function stuckEmissionsRecovery(address _gauge, uint256 _period) external;
/// @notice whitelists extra rewards for a gauge
/// @param _gauge the gauge to whitelist rewards to
/// @param _reward the reward to whitelist
function whitelistGaugeRewards(address _gauge, address _reward) external;
/// @notice removes a reward from the gauge whitelist
/// @param _gauge the gauge to remove the whitelist from
/// @param _reward the reward to remove from the whitelist
function removeGaugeRewardWhitelist(
address _gauge,
address _reward
) external;
/// @notice creates a legacy gauge for the pool
/// @param _pool pool's address
/// @return _gauge address of the new gauge
function createGauge(address _pool) external returns (address _gauge);
/// @notice create a concentrated liquidity gauge
/// @param tokenA the address of tokenA
/// @param tokenB the address of tokenB
/// @param tickSpacing the tickspacing of the pool
/// @return _clGauge address of the new gauge
function createCLGauge(
address tokenA,
address tokenB,
int24 tickSpacing
) external returns (address _clGauge);
/// @notice claim concentrated liquidity gauge rewards for specific NFP token ids
/// @param _gauges array of gauges
/// @param _tokens two dimensional array for the tokens to claim
/// @param _nfpTokenIds two dimensional array for the NFPs
function claimClGaugeRewards(
address[] calldata _gauges,
address[][] calldata _tokens,
uint256[][] calldata _nfpTokenIds
) external;
/// @notice claim arbitrary rewards from specific feeDists
/// @param owner address of the owner
/// @param _feeDistributors address of the feeDists
/// @param _tokens two dimensional array for the tokens to claim
function claimIncentives(
address owner,
address[] calldata _feeDistributors,
address[][] calldata _tokens
) external;
/// @notice claim arbitrary rewards from specific gauges
/// @param _gauges address of the gauges
/// @param _tokens two dimensional array for the tokens to claim
function claimRewards(
address[] calldata _gauges,
address[][] calldata _tokens
) external;
/// @notice claim arbitrary rewards from specific legacy gauges, and exit to shadow
/// @param _gauges address of the gauges
/// @param _tokens two dimensional array for the tokens to claim
function claimLegacyRewardsAndExit(
address[] calldata _gauges,
address[][] calldata _tokens
) external;
/// @notice distribute emissions to a gauge for a specific period
/// @param _gauge address of the gauge
/// @param _period value of the period
function distributeForPeriod(address _gauge, uint256 _period) external;
/// @notice attempt distribution of emissions to all gauges
function distributeAll() external;
/// @notice distribute emissions to gauges by index
/// @param startIndex start of the loop
/// @param endIndex end of the loop
function batchDistributeByIndex(
uint256 startIndex,
uint256 endIndex
) external;
/// @notice returns the votes cast for a tokenID
/// @param owner address of the owner
/// @return votes an array of votes casted
/// @return weights an array of the weights casted per pool
function getVotes(
address owner,
uint256 period
) external view returns (address[] memory votes, uint256[] memory weights);
/// @notice returns an array of all the gauges
/// @return _gauges the array of gauges
function getAllGauges() external view returns (address[] memory _gauges);
/// @notice returns an array of all the feeDists
/// @return _feeDistributors the array of feeDists
function getAllFeeDistributors()
external
view
returns (address[] memory _feeDistributors);
/// @notice sets the xShadowRatio default
function setGlobalRatio(uint256 _xRatio) external;
/// @notice whether the token is whitelisted in governance
function isWhitelisted(address _token) external view returns (bool _tf);
/// @notice function for removing malicious or stuffed tokens
function removeFeeDistributorReward(
address _feeDist,
address _token
) external;
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.24;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IX33 is IERC20 {
/// @dev parameters passed to the aggregator swap
struct AggregatorParams {
address aggregator; // address of the whitelisted aggregator
address tokenIn; // token to swap from
uint256 amountIn; // amount of tokenIn to swap
uint256 minAmountOut; // minimum amount of tokenOut to receive
bytes callData; // encoded swap calldata
}
/**
* Error strings
*/
error ZERO();
error NOT_ENOUGH();
error NOT_CONFORMED_TO_SCALE(uint256);
error NOT_ACCESSHUB(address);
error LOCKED();
error REBASE_IN_PROGRESS();
error AGGREGATOR_REVERTED(bytes);
error AMOUNT_OUT_TOO_LOW(uint256);
error AGGREGATOR_NOT_WHITELISTED(address);
error FORBIDDEN_TOKEN(address);
event Entered(address indexed user, uint256 amount, uint256 ratioAtDeposit);
event Exited(address indexed user, uint256 _outAmount, uint256 ratioAtWithdrawal);
event NewOperator(address _oldOperator, address _newOperator);
event Compounded(uint256 oldRatio, uint256 newRatio, uint256 amount);
event SwappedBribe(address indexed operator, address indexed tokenIn, uint256 amountIn, uint256 amountOut);
event Rebased(uint256 oldRatio, uint256 newRatio, uint256 amount);
/// @notice Event emitted when an aggregator's whitelist status changes
event AggregatorWhitelistUpdated(address aggregator, bool status);
event Unlocked(uint256 _ts);
event UpdatedIndex(uint256 _index);
event ClaimedIncentives(address[] feeDistributors, address[][] tokens);
/// @notice submits the optimized votes for the epoch
function submitVotes(address[] calldata _pools, uint256[] calldata _weights) external;
/// @notice swap function using aggregators to process rewards into SHADOW
function swapIncentiveViaAggregator(AggregatorParams calldata _params) external;
/// @notice claims the rebase accrued to x33
function claimRebase() external;
/// @notice compounds any existing SHADOW within the contract
function compound() external;
/// @notice direct claim
function claimIncentives(address[] calldata _feeDistributors, address[][] calldata _tokens) external;
/// @notice rescue stuck tokens
function rescue(address _token, uint256 _amount) external;
/// @notice allows the operator to unlock the contract for the current period
function unlock() external;
/// @notice add or remove an aggregator from the whitelist (timelocked)
/// @param _aggregator address of the aggregator to update
/// @param _status new whitelist status
function whitelistAggregator(address _aggregator, bool _status) external;
/// @notice transfers the operator via accesshub
function transferOperator(address _newOperator) external;
/// @notice simple getPeriod call
function getPeriod() external view returns (uint256 period);
/// @notice if the contract is unlocked for deposits
function isUnlocked() external view returns (bool);
/// @notice determines whether the cooldown is active
function isCooldownActive() external view returns (bool);
/// @notice address of the current operator
function operator() external view returns (address);
/// @notice accessHub address
function accessHub() external view returns (address);
/// @notice returns the ratio of xShadow per X33 token
function ratio() external view returns (uint256 _ratio);
/// @notice the most recent active period the contract has interacted in
function activePeriod() external view returns (uint256);
/// @notice whether the periods are unlocked
function periodUnlockStatus(uint256 _period) external view returns (bool unlocked);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IBasisAsset {
function mint(address recipient, uint256 amount) external returns (bool);
function burn(uint256 amount) external;
function burnFrom(address from, uint256 amount) external;
function isOperator() external returns (bool);
function operator() external view returns (address);
function transferOperator(address newOperator_) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IOracle {
function update() external;
function consult(address _token, uint256 _amountIn) external view returns (uint256 amountOut);
function twap(address _token, uint256 _amountIn) external view returns (uint256 _amountOut);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_xquant","type":"address"},{"internalType":"address","name":"_bribesSafe","type":"address"},{"internalType":"uint256","name":"_poolStartTime","type":"uint256"},{"internalType":"address","name":"_shadowVoter","type":"address"},{"internalType":"address","name":"_xquantOracle","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"X33_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"X33_WRAPPER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"XSHADOW_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint256","name":"_depFee","type":"uint256"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"},{"internalType":"uint256","name":"_lastRewardTime","type":"uint256"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"bribesSafe","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_pids","type":"uint256[]"},{"internalType":"uint256[]","name":"_allocPoints","type":"uint256[]"},{"internalType":"uint256[]","name":"_depFees","type":"uint256[]"}],"name":"bulkSet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"calculateClaimFeeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"calculateTotalClaimFeeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAllFarmRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimFeeEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"claimGaugeRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimGaugeRewardsOnUpdatePool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collectClaimFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_auto","type":"bool"}],"name":"convertXShadowManual","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"enum ShareRewardPool.GaugeDex","name":"_gaugeDex","type":"uint8"}],"name":"enableGauge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feeWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromTime","type":"uint256"},{"internalType":"uint256","name":"_toTime","type":"uint256"}],"name":"getGeneratedReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"governanceRecoverUnsupported","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"harvest","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"harvestAll","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromPid","type":"uint256"},{"internalType":"uint256","name":"_toPid","type":"uint256"}],"name":"massUpdatePoolsInRange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minClaimThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mustConvertXShadow","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"pendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingShareAndPendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"depFee","type":"uint256"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardTime","type":"uint256"},{"internalType":"uint256","name":"accXquantPerShare","type":"uint256"},{"internalType":"bool","name":"isStarted","type":"bool"},{"components":[{"internalType":"bool","name":"isGauge","type":"bool"},{"internalType":"address","name":"gauge","type":"address"},{"internalType":"enum ShareRewardPool.GaugeDex","name":"gaugeDex","type":"uint8"}],"internalType":"struct ShareRewardPool.GaugeInfo","name":"gaugeInfo","type":"tuple"},{"internalType":"uint256","name":"poolXquantPerSec","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"runningTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint256","name":"_depFee","type":"uint256"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_bribesSafe","type":"address"}],"name":"setBribesSafe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_claimFee","type":"uint256"}],"name":"setClaimFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setClaimFeeEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_claimGaugeRewardsOnUpdatePool","type":"bool"}],"name":"setClaimGaugeRewardsOnUpdatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minClaimThreshold","type":"uint256"}],"name":"setMinClaimThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_mustConvertXShadow","type":"bool"}],"name":"setMustConvertXShadow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setWhitelistStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IOracle","name":"_xquantOracle","type":"address"}],"name":"setXQuantOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shadowVoter","outputs":[{"internalType":"contract IShadowVoter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sharePerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePoolWithGaugeDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"xquant","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xquantOracle","outputs":[{"internalType":"contract IOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b5060405161553538038061553583398101604081905261002f91611187565b60016000554283116100885760405162461bcd60e51b815260206004820181905260248201527f706f6f6c2063616e74206265207374617274656420696e20746865207061737460448201526064015b60405180910390fd5b6001600160a01b038516156100b357600280546001600160a01b0319166001600160a01b0387161790555b6001600160a01b038416156100de57600780546001600160a01b0319166001600160a01b0386161790555b60038054603260045564e8d4a5100060055562ffffff60a01b19166201010160a01b1790556000600c819055600f556301e133806010819055600d84905561012690846111fc565b600e5560018054336001600160a01b0319918216179091556006805482166001600160a01b038581169190911790915560038054831684831617905560078054909216908616179055610198660221b262dd8000600073a774bf15419499d1e9b227188eca366ff55af4be81806101cb565b6101c166016bcc41e90000600073e17077daec614d918c38d5378710730223822a2981806101cb565b5050505050611454565b6001546001600160a01b031633146102395760405162461bcd60e51b815260206004820152602b60248201527f5368617265526577617264506f6f6c3a2063616c6c6572206973206e6f74207460448201526a34329037b832b930ba37b960a91b606482015260840161007f565b6102428361049a565b83156102905760405162461bcd60e51b815260206004820152601560248201527f4465706f73697420666565206d75737420626520300000000000000000000000604482015260640161007f565b811561029e5761029e610539565b600d544210156102cd57806000036102b95750600d546102e1565b600d548110156102c85750600d545b6102e1565b8015806102d957504281105b156102e15750425b6000600d54821115806102f45750428211155b90506009604051806101000160405280866001600160a01b03168152602001878152602001888152602001848152602001600081526020018315158152602001604051806060016040528060001515815260200160006001600160a01b031681526020016000600181111561036b5761036b61120f565b905281526020908101899052825460018181018555600094855293829020835160089092020180546001600160a01b039283166001600160a01b031990911617815583830151818601556040808501516002830155606085015160038301556080850151600483015560a085015160058301805491151560ff1990921691909117905560c085015180516006840180549683015190951661010002610100600160a81b0319911515919091166001600160a81b03199096169590951794909417808455908401519495919491839160ff60a81b191690600160a81b9084908111156104585761045861120f565b0217905550505060e082015181600701555050801561049257600c5461047e9087610565565b600c55600f5461048e9087610565565b600f555b505050505050565b60095460005b8181101561053457826001600160a01b0316600982815481106104c5576104c5611225565b60009182526020909120600890910201546001600160a01b03160361052c5760405162461bcd60e51b815260206004820152601f60248201527f5368617265526577617264506f6f6c3a206578697374696e6720706f6f6c3f00604482015260640161007f565b6001016104a0565b505050565b60095460005b8181101561056157610550816105cd565b610559816107e1565b60010161053f565b5050565b60008061057283856111fc565b9050838110156105c45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161007f565b90505b92915050565b6000600982815481106105e2576105e2611225565b9060005260206000209060080201905080600301544211610601575050565b600681015460009060ff166106805781546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610657573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067b919061123b565b6106f2565b60068201546040516370a0823160e01b81523060048201526101009091046001600160a01b0316906370a0823190602401602060405180830381865afa1580156106ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f2919061123b565b90508060000361070757504260039091015550565b600582015460ff1661074b5760058201805460ff191660011790556002820154600c5461073391610565565b600c556007820154600f5461074791610565565b600f555b600c54156107be5760006107698360030154426109f660201b60201c565b90506000610790600c5461078a866002015485610aa560201b90919060201c565b90610b27565b90506107b66107ab8461078a84670de0b6b3a7640000610aa5565b600486015490610565565b600485015550505b4260038381019190915554600160a01b900460ff16156105345761053483610b6f565b6000600982815481106107f6576107f6611225565b60009182526020822060089190910201600681015481546040516370a0823160e01b81523060048201529294506101009091046001600160a01b0390811693929116906370a0823190602401602060405180830381865afa15801561085f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610883919061123b565b600684015490915060ff16156109f05780156109f0578254604051636eb1769f60e11b81523060048201526001600160a01b0384811660248301528392169063dd62ed3e90604401602060405180830381865afa1580156108e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090c919061123b565b101561098b57825460405163095ea7b360e01b81526001600160a01b03848116600483015260001960248301529091169063095ea7b3906044016020604051808303816000875af1158015610965573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109899190611254565b505b600683015460405163b6b55f2560e01b8152600481018390526101009091046001600160a01b03169063b6b55f2590602401600060405180830381600087803b1580156109d757600080fd5b505af11580156109eb573d6000803e3d6000fd5b505050505b50505050565b6000818310610a07575060006105c7565b600e548210610a6457600e548310610a21575060006105c7565b600d548311610a4f57600f54600d54600e54610a489291610a429190610c1c565b90610aa5565b90506105c7565b600f54600e54610a489190610a429086610c1c565b600d548211610a75575060006105c7565b600d548311610a9457600f54600d54610a489190610a42908590610c1c565b600f54610a4890610a428486610c1c565b600082600003610ab7575060006105c7565b6000610ac38385611276565b905082610ad0858361128d565b146105c45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161007f565b60006105c483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610c6460201b60201c565b600060098281548110610b8457610b84611225565b60009182526020909120600890910201600681015490915060ff16156105615760016006820154600160a81b900460ff166001811115610bc657610bc661120f565b14610c135760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c7920536861646f7720676175676520737570706f727465640000000000604482015260640161007f565b61056182610c9b565b60006105c483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610eb860201b60201c565b60008183610c855760405162461bcd60e51b815260040161007f91906112af565b506000610c92848661128d565b95945050505050565b600060098281548110610cb057610cb0611225565b9060005260206000209060080201905060008160060160000160019054906101000a90046001600160a01b03166001600160a01b0316638003b6146040518163ffffffff1660e01b8152600401600060405180830381865afa158015610d1a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d429190810190611313565b60068301546040516331279d3d60e01b815291925061010090046001600160a01b0316906331279d3d90610d7c90309085906004016113e2565b600060405180830381600087803b158015610d9657600080fd5b505af1158015610daa573d6000803e3d6000fd5b5050505060005b81518110156109f0576000828281518110610dce57610dce611225565b60209081029190910101516040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610e23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e47919061123b565b90508015610eae57735050bc082ff4a74fb6b0b04385defddb114b2423196001600160a01b03831601610e9457600354600160b01b900460ff1615610e8f57610e8f81610ee9565b610eae565b600754610eae906001600160a01b038481169116836110a4565b5050600101610db1565b60008184841115610edc5760405162461bcd60e51b815260040161007f91906112af565b506000610c928486611441565b60405163095ea7b360e01b8152739710e10a8f6fba8c391606fee18614885684548d600482015260248101829052735050bc082ff4a74fb6b0b04385defddb114b24249063095ea7b3906044016020604051808303816000875af1158015610f55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f799190611254565b506000733333111a391cc08fa51353e9195526a70b3333336001600160a01b0316638380edb76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff29190611254565b9050801561056157604051636e553f6560e01b815260048101839052306024820152600090739710e10a8f6fba8c391606fee18614885684548d90636e553f65906044016020604051808303816000875af1158015611055573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611079919061123b565b60075490915061053490733333111a391cc08fa51353e9195526a70b333333906001600160a01b0316835b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663a9059cbb60e01b179091526105349185916110fa16565b600080602060008451602086016000885af18061111d576040513d6000823e3d81fd5b50506000513d91508115611135578060011415611142565b6001600160a01b0384163b155b156109f057604051635274afe760e01b81526001600160a01b038516600482015260240161007f565b80516001600160a01b038116811461118257600080fd5b919050565b600080600080600060a0868803121561119f57600080fd5b6111a88661116b565b94506111b66020870161116b565b604087015190945092506111cc6060870161116b565b91506111da6080870161116b565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b808201808211156105c7576105c76111e6565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60006020828403121561124d57600080fd5b5051919050565b60006020828403121561126657600080fd5b815180151581146105c457600080fd5b80820281158282048414176105c7576105c76111e6565b6000826112aa57634e487b7160e01b600052601260045260246000fd5b500490565b602081526000825180602084015260005b818110156112dd57602081860181015160408684010152016112c0565b506000604082850101526040601f19601f83011684010191505092915050565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561132557600080fd5b81516001600160401b0381111561133b57600080fd5b8201601f8101841361134c57600080fd5b80516001600160401b03811115611365576113656112fd565b604051600582901b90603f8201601f191681016001600160401b0381118282101715611393576113936112fd565b6040529182526020818401810192908101878411156113b157600080fd5b6020850194505b838510156113d7576113c98561116b565b8152602094850194016113b8565b509695505050505050565b6001600160a01b0383168152604060208083018290528351918301829052600091908401906060840190835b818110156114355783516001600160a01b031683526020938401939092019160010161140e565b50909695505050505050565b818103818111156105c7576105c76111e6565b6140d2806114636000396000f3fe60806040526004361061034f5760003560e01c80636e271dd5116101c6578063ced8a5d7116100f7578063ddc6326211610095578063e2bbb1581161006f578063e2bbb158146109d4578063e40dd119146109f4578063f4ef981d14610a14578063fddc298c14610a3457600080fd5b8063ddc6326214610981578063de89c76c14610994578063e10abfc4146109b457600080fd5b8063d18df53c116100d1578063d18df53c146108d9578063d2efde0914610911578063d408f65714610931578063da1165221461096157600080fd5b8063ced8a5d714610879578063cf4b55cb14610899578063d02ade94146108b957600080fd5b806399d32fc411610164578063b17fae431161013e578063b17fae43146107f9578063b3ab15fb14610819578063b947a88d14610839578063ce862f171461085957600080fd5b806399d32fc4146107ae578063a44a7432146107c4578063ade406d9146107e457600080fd5b806393f1a40b116101a057806393f1a40b146106fb578063943f013d1461074f578063952f49641461076557806396f38bdb1461078657600080fd5b80636e271dd5146106bd5780638ed955b9146106d357806390c5ed6a146106db57600080fd5b80633afb24f1116102a0578063570ca7351161023e57806361e79f021161021857806361e79f0214610647578063630b5ba11461066857806363eb04161461067d5780636b2681c51461069d57600080fd5b8063570ca735146105fb5780635752933a1461061b5780635f96dc111461063157600080fd5b806351637ba91161027a57806351637ba9146105735780635312ea8e1461059357806354575af4146105b3578063549c278a146105d357600080fd5b80633afb24f11461051f57806343b0e8df14610540578063441a3e701461056057600080fd5b8063231f0c6a1161030d5780633202f6c1116102e75780633202f6c1146104a45780633695dad1146104c45780633aa158ee146104da5780633af32abf146104ef57600080fd5b8063231f0c6a146104445780632df95ed7146104645780632e75ab501461048457600080fd5b8062c6b39114610354578063081e3eda146103995780630ac8c832146103b85780630c424284146103d85780631526fe27146103fa57806317caf6f11461042e575b600080fd5b34801561036057600080fd5b5061037c735050bc082ff4a74fb6b0b04385defddb114b242481565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156103a557600080fd5b506009545b604051908152602001610390565b3480156103c457600080fd5b5060035461037c906001600160a01b031681565b3480156103e457600080fd5b506103f86103f33660046139be565b610a54565b005b34801561040657600080fd5b5061041a6104153660046139f7565b610b08565b604051610390989796959493929190613a26565b34801561043a57600080fd5b506103aa600c5481565b34801561045057600080fd5b506103aa61045f366004613ab0565b610bc6565b34801561047057600080fd5b506103f861047f3660046139f7565b610c8b565b34801561049057600080fd5b506103f861049f3660046139f7565b610ea0565b3480156104b057600080fd5b5060065461037c906001600160a01b031681565b3480156104d057600080fd5b506103aa60055481565b3480156104e657600080fd5b506103f8610f20565b3480156104fb57600080fd5b5061050f61050a366004613ad2565b610f6d565b6040519015158152602001610390565b34801561052b57600080fd5b5060035461050f90600160a01b900460ff1681565b34801561054c57600080fd5b506103f861055b366004613aef565b610f8b565b6103f861056e366004613ab0565b611091565b34801561057f57600080fd5b506103f861058e3660046139f7565b611277565b34801561059f57600080fd5b506103f86105ae3660046139f7565b611313565b3480156105bf57600080fd5b506103f86105ce366004613b1b565b6113ea565b3480156105df57600080fd5b5061037c733333111a391cc08fa51353e9195526a70b33333381565b34801561060757600080fd5b5060015461037c906001600160a01b031681565b34801561062757600080fd5b506103aa600f5481565b34801561063d57600080fd5b506103aa600d5481565b34801561065357600080fd5b5060035461050f90600160b01b900460ff1681565b34801561067457600080fd5b506103f86114d9565b34801561068957600080fd5b506103f8610698366004613b5d565b611501565b3480156106a957600080fd5b506103aa6106b8366004613b7a565b611549565b3480156106c957600080fd5b506103aa600e5481565b6103f861158f565b3480156106e757600080fd5b506103f86106f6366004613b9f565b611972565b34801561070757600080fd5b5061073a610716366004613b7a565b600a6020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610390565b34801561075b57600080fd5b506103aa60105481565b34801561077157600080fd5b5060035461050f90600160a81b900460ff1681565b34801561079257600080fd5b5061037c739710e10a8f6fba8c391606fee18614885684548d81565b3480156107ba57600080fd5b506103aa60045481565b3480156107d057600080fd5b506103f86107df366004613bf1565b611bf5565b3480156107f057600080fd5b506103f8611e92565b34801561080557600080fd5b506103aa610814366004613ad2565b611f52565b34801561082557600080fd5b506103f8610834366004613ad2565b61209d565b34801561084557600080fd5b506103f8610854366004613ab0565b6120e9565b34801561086557600080fd5b506103f8610874366004613c16565b612164565b34801561088557600080fd5b506103f8610894366004613ad2565b6121f8565b3480156108a557600080fd5b506103aa6108b4366004613b7a565b612244565b3480156108c557600080fd5b506103f86108d43660046139f7565b612429565b3480156108e557600080fd5b506103aa6108f4366004613b7a565b600b60209081526000928352604080842090915290825290205481565b34801561091d57600080fd5b5060025461037c906001600160a01b031681565b34801561093d57600080fd5b5061050f61094c366004613ad2565b60086020526000908152604090205460ff1681565b34801561096d57600080fd5b506103f861097c366004613b5d565b6124d6565b6103f861098f3660046139f7565b61251e565b3480156109a057600080fd5b5060075461037c906001600160a01b031681565b3480156109c057600080fd5b506103f86109cf366004613b5d565b6128d1565b3480156109e057600080fd5b506103f86109ef366004613ab0565b612919565b348015610a0057600080fd5b506103f8610a0f366004613ad2565b612af4565b348015610a2057600080fd5b506103aa610a2f366004613b7a565b612b40565b348015610a4057600080fd5b506103f8610a4f366004613c8b565b612c72565b6001546001600160a01b03163314610a875760405162461bcd60e51b8152600401610a7e90613d31565b60405180910390fd5b6001600160a01b038216610add5760405162461bcd60e51b815260206004820181905260248201527f5368617265526577617264506f6f6c3a20696e76616c696420616464726573736044820152606401610a7e565b6001600160a01b03919091166000908152600860205260409020805460ff1916911515919091179055565b60098181548110610b1857600080fd5b6000918252602091829020600890910201805460018083015460028401546003850154600486015460058701546040805160608101825260068a01805460ff8181161515845261010082046001600160a01b039081169e85019e909e529c909a169c50969a95999498939792861696949590949391850192600160a81b9092041690811115610ba957610ba9613a10565b6001811115610bba57610bba613a10565b90525060079091015488565b6000818310610bd757506000610c85565b600e548210610c3f57600e548310610bf157506000610c85565b600d548311610c2457610c1d600f54610c17600d54600e54612d6590919063ffffffff16565b90612dae565b9050610c85565b610c1d600f54610c1785600e54612d6590919063ffffffff16565b600d548211610c5057506000610c85565b600d548311610c7457610c1d600f54610c17600d5485612d6590919063ffffffff16565b600f54610c1d90610c178486612d65565b92915050565b600060098281548110610ca057610ca0613d7c565b60009182526020822060089190910201600681015481546040516370a0823160e01b81523060048201529294506101009091046001600160a01b0390811693929116906370a0823190602401602060405180830381865afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190613d92565b600684015490915060ff1615610e9a578015610e9a578254604051636eb1769f60e11b81523060048201526001600160a01b0384811660248301528392169063dd62ed3e90604401602060405180830381865afa158015610d92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db69190613d92565b1015610e3557825460405163095ea7b360e01b81526001600160a01b03848116600483015260001960248301529091169063095ea7b3906044016020604051808303816000875af1158015610e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e339190613dab565b505b600683015460405163b6b55f2560e01b8152600481018390526101009091046001600160a01b03169063b6b55f2590602401600060405180830381600087803b158015610e8157600080fd5b505af1158015610e95573d6000803e3d6000fd5b505050505b50505050565b6001546001600160a01b03163314610eca5760405162461bcd60e51b8152600401610a7e90613d31565b6096811115610f1b5760405162461bcd60e51b815260206004820152601d60248201527f5368617265526577617264506f6f6c3a2066656520746f6f20686967680000006044820152606401610a7e565b600455565b6001546001600160a01b03163314610f4a5760405162461bcd60e51b8152600401610a7e90613d31565b60095460005b81811015610f6957610f6181612429565b600101610f50565b5050565b6001600160a01b031660009081526008602052604090205460ff1690565b6001546001600160a01b03163314610fb55760405162461bcd60e51b8152600401610a7e90613d31565b610fbd6114d9565b600060098481548110610fd257610fd2613d7c565b906000526020600020906008020190508160001461102a5760405162461bcd60e51b815260206004820152601560248201527404465706f73697420666565206d757374206265203605c1b6044820152606401610a7e565b60018101829055600581015460ff161561107f576110618361105b8360020154600c54612d6590919063ffffffff16565b90612e30565b600c556007810154600f5461107b91859161105b91612d65565b600f555b60028101839055600701919091555050565b611099612e8f565b60003390506000600984815481106110b3576110b3613d7c565b60009182526020808320878452600a825260408085206001600160a01b0388168652909252922080546008909202909201925084111561112a5760405162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b6044820152606401610a7e565b61113385612eb9565b61113c85610c8b565b60006111798260010154611173670de0b6b3a764000061116d87600401548760000154612dae90919063ffffffff16565b906130c1565b90612d65565b905080156111d2576000868152600b602090815260408083206001600160a01b03881684529091529020546111ae9082612e30565b6000878152600b602090815260408083206001600160a01b03891684529091529020555b84156112065781546111e49086612d65565b82556111f08686613103565b8254611206906001600160a01b03168587613198565b6004830154825461122491670de0b6b3a76400009161116d91612dae565b600183015560405185815286906001600160a01b038616907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a350505050610f696001600055565b6001546001600160a01b031633146112a15760405162461bcd60e51b8152600401610a7e90613d31565b670de0b6b3a764000081111561130e5760405162461bcd60e51b815260206004820152602c60248201527f5368617265526577617264506f6f6c3a20696e76616c6964206d617820636c6160448201526b1a5b481d1a1c995cda1bdb1960a21b6064820152608401610a7e565b600555565b61131b612e8f565b60006009828154811061133057611330613d7c565b60009182526020808320858452600a8252604080852033865290925292208054600890920290920192506113648482613103565b6000848152600b602090815260408083203380855292528220829055818455600184019190915583546113a3916001600160a01b039091169083613198565b604051818152849033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959060200160405180910390a35050506113e76001600055565b50565b6001546001600160a01b031633146114145760405162461bcd60e51b8152600401610a7e90613d31565b60095460005b818110156114c45760006009828154811061143757611437613d7c565b6000918252602090912060089091020180549091506001600160a01b03908116908716036114bb5760405162461bcd60e51b815260206004820152602b60248201527f5368617265526577617264506f6f6c3a20546f6b656e2063616e6e6f7420626560448201526a103837b7b6103a37b5b2b760a91b6064820152608401610a7e565b5060010161141a565b50610e9a6001600160a01b0385168385613198565b60095460005b81811015610f69576114f081612eb9565b6114f981610c8b565b6001016114df565b6001546001600160a01b0316331461152b5760405162461bcd60e51b8152600401610a7e90613d31565b60038054911515600160a01b0260ff60a01b19909216919091179055565b6000806115568484612244565b6000858152600b602090815260408083206001600160a01b0388168452909152902054909150611587908290612e30565b949350505050565b611597612e8f565b60095433906000805b828110156116cb576000600982815481106115bd576115bd613d7c565b60009182526020808320858452600a825260408085206001600160a01b038b1686529092529220600890910290910191506115f783612eb9565b61160083610c8b565b60006116318260010154611173670de0b6b3a764000061116d87600401548760000154612dae90919063ffffffff16565b6000858152600b602090815260408083206001600160a01b038c1684529091528120549192506116618383612e30565b90508015611699576000868152600b602090815260408083206001600160a01b038d1684529091528120556116968782612e30565b96505b600485015484546116b791670de0b6b3a76400009161116d91612dae565b6001948501555050509190910190506115a0565b506005548110156116ee5760405162461bcd60e51b8152600401610a7e90613dc8565b801561196357600354600090600160a81b900460ff168015611716575061171484610f6d565b155b1561182357600354600254604051630d01142560e31b81526001600160a01b039182166004820152670de0b6b3a764000060248201526000929190911690636808a12890604401602060405180830381865afa15801561177a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179e9190613d92565b90506117cb6103e861116d600454610c17670de0b6b3a764000061116d8988612dae90919063ffffffff16565b91508134101561181d5760405162461bcd60e51b815260206004820152601c60248201527f696e73756666696369656e74205320666f7220636c61696d20666565000000006044820152606401610a7e565b50611841565b34156118415760405162461bcd60e51b8152600401610a7e90613e0c565b61184b84836131f7565b836001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e04868360405161188691815260200190565b60405180910390a2600354600160a81b900460ff1680156118ad57506118ab84610f6d565b155b80156118b857508034115b156119615760006118c98234613e64565b90506000856001600160a01b03168260405160006040518083038185875af1925050503d8060008114611918576040519150601f19603f3d011682016040523d82523d6000602084013e61191d565b606091505b505090508061195e5760405162461bcd60e51b815260206004820152600d60248201526c1499599d5b990819985a5b1959609a1b6044820152606401610a7e565b50505b505b5050506119706001600055565b565b6001546001600160a01b0316331461199c5760405162461bcd60e51b8152600401610a7e90613d31565b6119a5836132a2565b83156119eb5760405162461bcd60e51b815260206004820152601560248201527404465706f73697420666565206d757374206265203605c1b6044820152606401610a7e565b81156119f9576119f96114d9565b600d54421015611a285780600003611a145750600d54611a3c565b600d54811015611a235750600d545b611a3c565b801580611a3457504281105b15611a3c5750425b6000600d5482111580611a4f5750428211155b90506009604051806101000160405280866001600160a01b03168152602001878152602001888152602001848152602001600081526020018315158152602001604051806060016040528060001515815260200160006001600160a01b0316815260200160006001811115611ac657611ac6613a10565b905281526020908101899052825460018181018555600094855293829020835160089092020180546001600160a01b039283166001600160a01b031990911617815583830151818601556040808501516002830155606085015160038301556080850151600483015560a085015160058301805491151560ff1990921691909117905560c085015180516006840180549683015190951661010002610100600160a81b0319911515919091166001600160a81b03199096169590951794909417808455908401519495919491839160ff60a81b191690600160a81b908490811115611bb357611bb3613a10565b0217905550505060e0820151816007015550508015611bed57600c54611bd99087612e30565b600c55600f54611be99087612e30565b600f555b505050505050565b6001546001600160a01b03163314611c1f5760405162461bcd60e51b8152600401610a7e90613d31565b60405163095ea7b360e01b8152739710e10a8f6fba8c391606fee18614885684548d600482015260248101839052735050bc082ff4a74fb6b0b04385defddb114b24249063095ea7b3906044016020604051808303816000875af1158015611c8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611caf9190613dab565b506000733333111a391cc08fa51353e9195526a70b3333336001600160a01b0316638380edb76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d289190613dab565b90508015611e8d578115611de457604051636e553f6560e01b815260048101849052306024820152600090739710e10a8f6fba8c391606fee18614885684548d90636e553f65906044016020604051808303816000875af1158015611d91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611db59190613d92565b600754909150610e9a90733333111a391cc08fa51353e9195526a70b333333906001600160a01b031683613198565b604051636e553f6560e01b815260048101849052306024820152739710e10a8f6fba8c391606fee18614885684548d90636e553f65906044016020604051808303816000875af1158015611e3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e609190613d92565b50600754611e8d90733333111a391cc08fa51353e9195526a70b333333906001600160a01b031685613198565b505050565b6001546001600160a01b03163314611ebc5760405162461bcd60e51b8152600401610a7e90613d31565b6007546040516000916001600160a01b03169047908381818185875af1925050503d8060008114611f09576040519150601f19603f3d011682016040523d82523d6000602084013e611f0e565b606091505b50509050806113e75760405162461bcd60e51b815260206004820152601060248201526f6661696c656420746f2073656e64205360801b6044820152606401610a7e565b6000611f5d82610f6d565b15611f6a57506000919050565b6000805b600954811015611fc4576000611f848286612244565b6000838152600b602090815260408083206001600160a01b038a168452909152902054909150611fb88161105b8685612e30565b93505050600101611f6e565b50600354600160a81b900460ff161580611fdf575060055481105b15611fed5750600092915050565b600354600254604051630d01142560e31b81526001600160a01b039182166004820152670de0b6b3a764000060248201526000929190911690636808a12890604401602060405180830381865afa15801561204c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120709190613d92565b90506115876103e861116d600454610c17670de0b6b3a764000061116d8888612dae90919063ffffffff16565b6001546001600160a01b031633146120c75760405162461bcd60e51b8152600401610a7e90613d31565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b808211156121395760405162461bcd60e51b815260206004820152601f60248201527f585175616e74526577617264506f6f6c3a20696e76616c69642072616e6765006044820152606401610a7e565b815b818111611e8d5761214b81612eb9565b61215481610c8b565b61215d81613e77565b905061213b565b6001546001600160a01b0316331461218e5760405162461bcd60e51b8152600401610a7e90613d31565b60018160018111156121a2576121a2613a10565b146121ef5760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c7920536861646f7720676175676520737570706f7274656400000000006044820152606401610a7e565b610f698261333c565b6001546001600160a01b031633146122225760405162461bcd60e51b8152600401610a7e90613d31565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000806009848154811061225a5761225a613d7c565b60009182526020808320878452600a825260408085206001600160a01b0389168652909252908320600892909202016004810154600682015491945091929060ff166123105783546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156122e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230b9190613d92565b612382565b60068401546040516370a0823160e01b81523060048201526101009091046001600160a01b0316906370a0823190602401602060405180830381865afa15801561235e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123829190613d92565b905083600301544211801561239657508015155b156123f35760006123ab856003015442610bc6565b905060006123cc600c5461116d886002015485612dae90919063ffffffff16565b90506123ee6123e78461116d84670de0b6b3a7640000612dae565b8590612e30565b935050505b61241e8360010154611173670de0b6b3a764000061116d868860000154612dae90919063ffffffff16565b979650505050505050565b60006009828154811061243e5761243e613d7c565b60009182526020909120600890910201600681015490915060ff1615610f695760016006820154600160a81b900460ff16600181111561248057612480613a10565b146124cd5760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c7920536861646f7720676175676520737570706f7274656400000000006044820152606401610a7e565b610f69826134ad565b6001546001600160a01b031633146125005760405162461bcd60e51b8152600401610a7e90613d31565b60038054911515600160b01b0260ff60b01b19909216919091179055565b612526612e8f565b600033905060006009838154811061254057612540613d7c565b60009182526020808320868452600a825260408085206001600160a01b038816865290925292206008909102909101915061257a84612eb9565b61258384610c8b565b60006125b48260010154611173670de0b6b3a764000061116d87600401548760000154612dae90919063ffffffff16565b6000868152600b602090815260408083206001600160a01b03891684529091528120549192506125e48383612e30565b90506005548110156126085760405162461bcd60e51b8152600401610a7e90613dc8565b801561289f576000878152600b602090815260408083206001600160a01b038a1684529091528120819055600354600160a81b900460ff168015612652575061265087610f6d565b155b1561275f57600354600254604051630d01142560e31b81526001600160a01b039182166004820152670de0b6b3a764000060248201526000929190911690636808a12890604401602060405180830381865afa1580156126b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126da9190613d92565b90506127076103e861116d600454610c17670de0b6b3a764000061116d8988612dae90919063ffffffff16565b9150813410156127595760405162461bcd60e51b815260206004820152601c60248201527f696e73756666696369656e74205320666f7220636c61696d20666565000000006044820152606401610a7e565b5061277d565b341561277d5760405162461bcd60e51b8152600401610a7e90613e0c565b61278787836131f7565b866001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486836040516127c291815260200190565b60405180910390a2600354600160a81b900460ff1680156127e957506127e787610f6d565b155b80156127f457508034115b1561289d5760006128058234613e64565b90506000886001600160a01b03168260405160006040518083038185875af1925050503d8060008114612854576040519150601f19603f3d011682016040523d82523d6000602084013e612859565b606091505b505090508061289a5760405162461bcd60e51b815260206004820152600d60248201526c1499599d5b990819985a5b1959609a1b6044820152606401610a7e565b50505b505b600485015484546128bd91670de0b6b3a76400009161116d91612dae565b600194850155505050600055506113e79050565b6001546001600160a01b031633146128fb5760405162461bcd60e51b8152600401610a7e90613d31565b60038054911515600160a81b0260ff60a81b19909216919091179055565b612921612e8f565b600033905060006009848154811061293b5761293b613d7c565b60009182526020808320878452600a825260408085206001600160a01b038816865290925292206008909102909101915061297585612eb9565b805415612a085760006129ad8260010154611173670de0b6b3a764000061116d87600401548760000154612dae90919063ffffffff16565b90508015612a06576000868152600b602090815260408083206001600160a01b03881684529091529020546129e29082612e30565b6000878152600b602090815260408083206001600160a01b03891684529091529020555b505b8315612a7b578154612a25906001600160a01b03168430876136ca565b6000612a4461271061116d856001015488612dae90919063ffffffff16565b9050612a5b612a538683612d65565b835490612e30565b82556007548354612a79916001600160a01b03918216911683613198565b505b612a8485610c8b565b60048201548154612aa291670de0b6b3a76400009161116d91612dae565b600182015560405184815285906001600160a01b038516907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159060200160405180910390a3505050610f696001600055565b6001546001600160a01b03163314612b1e5760405162461bcd60e51b8152600401610a7e90613d31565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000612b4b82610f6d565b15612b5857506000610c85565b6000612b648484612244565b6000858152600b602090815260408083206001600160a01b0388168452909152812054919250612b948383612e30565b600354909150600160a81b900460ff161580612bb1575060055481105b15612bc25760009350505050610c85565b600354600254604051630d01142560e31b81526001600160a01b039182166004820152670de0b6b3a764000060248201526000929190911690636808a12890604401602060405180830381865afa158015612c21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c459190613d92565b905061241e6103e861116d600454610c17670de0b6b3a764000061116d8888612dae90919063ffffffff16565b6001546001600160a01b03163314612c9c5760405162461bcd60e51b8152600401610a7e90613d31565b8483148015612caa57508481145b612cf65760405162461bcd60e51b815260206004820181905260248201527f585175616e74526577617264506f6f6c3a20696e76616c6964206c656e6774686044820152606401610a7e565b60005b85811015612d5c57612d54878783818110612d1657612d16613d7c565b90506020020135868684818110612d2f57612d2f613d7c565b90506020020135858585818110612d4857612d48613d7c565b90506020020135610f8b565b600101612cf9565b50505050505050565b6000612da783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613703565b9392505050565b600082600003612dc057506000610c85565b6000612dcc8385613e90565b905082612dd98583613ea7565b14612da75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610a7e565b600080612e3d8385613ec9565b905083811015612da75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610a7e565b600260005403612eb257604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b600060098281548110612ece57612ece613d7c565b9060005260206000209060080201905080600301544211612eed575050565b600681015460009060ff16612f6c5781546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015612f43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f679190613d92565b612fde565b60068201546040516370a0823160e01b81523060048201526101009091046001600160a01b0316906370a0823190602401602060405180830381865afa158015612fba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fde9190613d92565b905080600003612ff357504260039091015550565b600582015460ff166130375760058201805460ff191660011790556002820154600c5461301f91612e30565b600c556007820154600f5461303391612e30565b600f555b600c541561309e57600061304f836003015442610bc6565b90506000613070600c5461116d866002015485612dae90919063ffffffff16565b905061309661308b8461116d84670de0b6b3a7640000612dae565b600486015490612e30565b600485015550505b4260038381019190915554600160a01b900460ff1615611e8d57611e8d83612429565b6000612da783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061373d565b60006009838154811061311857613118613d7c565b60009182526020909120600890910201600681015490915060ff1615611e8d576006810154604051632e1a7d4d60e01b8152600481018490526101009091046001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561318457600080fd5b505af1158015612d5c573d6000803e3d6000fd5b6040516001600160a01b03838116602483015260448201839052611e8d91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b03838183161783525050505061376b565b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015613240573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132649190613d92565b90508015611e8d578082111561328b57600254611e8d906001600160a01b03168483613198565b600254611e8d906001600160a01b03168484613198565b60095460005b81811015611e8d57826001600160a01b0316600982815481106132cd576132cd613d7c565b60009182526020909120600890910201546001600160a01b0316036133345760405162461bcd60e51b815260206004820152601f60248201527f5368617265526577617264506f6f6c3a206578697374696e6720706f6f6c3f006044820152606401610a7e565b6001016132a8565b600654600980546000926001600160a01b031691632045be90918590811061336657613366613d7c565b600091825260209091206008909102015460405160e083901b6001600160e01b03191681526001600160a01b039091166004820152602401602060405180830381865afa1580156133bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133df9190613eec565b90506001600160a01b03811615610f69576040805160608101825260018082526001600160a01b038416602083015290918201908152506009838154811061342957613429613d7c565b6000918252602091829020835160066008909302909101919091018054928401516001600160a01b031661010002610100600160a81b0319921515929092166001600160a81b03199093169290921717808255604083015190829060ff60a81b1916600160a81b8360018111156134a2576134a2613a10565b021790555050505050565b6000600982815481106134c2576134c2613d7c565b9060005260206000209060080201905060008160060160000160019054906101000a90046001600160a01b03166001600160a01b0316638003b6146040518163ffffffff1660e01b8152600401600060405180830381865afa15801561352c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526135549190810190613f1f565b60068301546040516331279d3d60e01b815291925061010090046001600160a01b0316906331279d3d9061358e9030908590600401613fef565b600060405180830381600087803b1580156135a857600080fd5b505af11580156135bc573d6000803e3d6000fd5b5050505060005b8151811015610e9a5760008282815181106135e0576135e0613d7c565b60209081029190910101516040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a0823190602401602060405180830381865afa158015613635573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136599190613d92565b905080156136c057735050bc082ff4a74fb6b0b04385defddb114b2423196001600160a01b038316016136a657600354600160b01b900460ff16156136a1576136a1816137dc565b6136c0565b6007546136c0906001600160a01b03848116911683613198565b50506001016135c3565b6040516001600160a01b038481166024830152838116604483015260648201839052610e9a9186918216906323b872dd906084016131c5565b600081848411156137275760405162461bcd60e51b8152600401610a7e919061404e565b5060006137348486613e64565b95945050505050565b6000818361375e5760405162461bcd60e51b8152600401610a7e919061404e565b5060006137348486613ea7565b600080602060008451602086016000885af18061378e576040513d6000823e3d81fd5b50506000513d915081156137a65780600114156137b3565b6001600160a01b0384163b155b15610e9a57604051635274afe760e01b81526001600160a01b0385166004820152602401610a7e565b60405163095ea7b360e01b8152739710e10a8f6fba8c391606fee18614885684548d600482015260248101829052735050bc082ff4a74fb6b0b04385defddb114b24249063095ea7b3906044016020604051808303816000875af1158015613848573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061386c9190613dab565b506000733333111a391cc08fa51353e9195526a70b3333336001600160a01b0316638380edb76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156138c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138e59190613dab565b90508015610f6957604051636e553f6560e01b815260048101839052306024820152600090739710e10a8f6fba8c391606fee18614885684548d90636e553f65906044016020604051808303816000875af1158015613948573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061396c9190613d92565b600754909150611e8d90733333111a391cc08fa51353e9195526a70b333333906001600160a01b031683613198565b6001600160a01b03811681146113e757600080fd5b80151581146113e757600080fd5b600080604083850312156139d157600080fd5b82356139dc8161399b565b915060208301356139ec816139b0565b809150509250929050565b600060208284031215613a0957600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b03898116825260208083018a905260408084018a9052606084018990526080840188905286151560a08501528551151560c08501529085015190911660e083015283015161014082019060028110613a9557634e487b7160e01b600052602160045260246000fd5b61010083015261012090910191909152979650505050505050565b60008060408385031215613ac357600080fd5b50508035926020909101359150565b600060208284031215613ae457600080fd5b8135612da78161399b565b600080600060608486031215613b0457600080fd5b505081359360208301359350604090920135919050565b600080600060608486031215613b3057600080fd5b8335613b3b8161399b565b9250602084013591506040840135613b528161399b565b809150509250925092565b600060208284031215613b6f57600080fd5b8135612da7816139b0565b60008060408385031215613b8d57600080fd5b8235915060208301356139ec8161399b565b600080600080600060a08688031215613bb757600080fd5b85359450602086013593506040860135613bd08161399b565b92506060860135613be0816139b0565b949793965091946080013592915050565b60008060408385031215613c0457600080fd5b8235915060208301356139ec816139b0565b60008060408385031215613c2957600080fd5b823591506020830135600281106139ec57600080fd5b60008083601f840112613c5157600080fd5b50813567ffffffffffffffff811115613c6957600080fd5b6020830191508360208260051b8501011115613c8457600080fd5b9250929050565b60008060008060008060608789031215613ca457600080fd5b863567ffffffffffffffff811115613cbb57600080fd5b613cc789828a01613c3f565b909750955050602087013567ffffffffffffffff811115613ce757600080fd5b613cf389828a01613c3f565b909550935050604087013567ffffffffffffffff811115613d1357600080fd5b613d1f89828a01613c3f565b979a9699509497509295939492505050565b6020808252602b908201527f5368617265526577617264506f6f6c3a2063616c6c6572206973206e6f74207460408201526a34329037b832b930ba37b960a91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215613da457600080fd5b5051919050565b600060208284031215613dbd57600080fd5b8151612da7816139b0565b60208082526024908201527f436c61696d20616d6f756e742062656c6f77206d696e696d756d2074687265736040820152631a1bdb1960e21b606082015260800190565b60208082526022908201527f5368617265526577617264506f6f6c3a20696e76616c6964206d73672e76616c604082015261756560f01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b81810381811115610c8557610c85613e4e565b600060018201613e8957613e89613e4e565b5060010190565b8082028115828204841417610c8557610c85613e4e565b600082613ec457634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115610c8557610c85613e4e565b8051613ee78161399b565b919050565b600060208284031215613efe57600080fd5b8151612da78161399b565b634e487b7160e01b600052604160045260246000fd5b600060208284031215613f3157600080fd5b815167ffffffffffffffff811115613f4857600080fd5b8201601f81018413613f5957600080fd5b805167ffffffffffffffff811115613f7357613f73613f09565b8060051b604051601f19603f830116810181811067ffffffffffffffff82111715613fa057613fa0613f09565b604052918252602081840181019290810187841115613fbe57600080fd5b6020850194505b83851015613fe457613fd685613edc565b815260209485019401613fc5565b509695505050505050565b6001600160a01b0383168152604060208083018290528351918301829052600091908401906060840190835b818110156140425783516001600160a01b031683526020938401939092019160010161401b565b50909695505050505050565b602081526000825180602084015260005b8181101561407c576020818601810151604086840101520161405f565b506000604082850101526040601f19601f8301168401019150509291505056fea2646970667358221220a16b5de9870fa6a6e45890ca8349681b54d9fdb612af8513972db0a645ee381c64736f6c634300081a00330000000000000000000000004e583383c8389f469af337f932b14d276cbe0611000000000000000000000000a8dd0362db7a7fefe71025401eb7ae6f11b60c020000000000000000000000000000000000000000000000000000000067e889800000000000000000000000009f59398d0a397b2eeb8a6123a6c7295cb0b0062d000000000000000000000000b8095ee03a33a965039cafd8648bb508be9aa0ed
Deployed Bytecode
0x60806040526004361061034f5760003560e01c80636e271dd5116101c6578063ced8a5d7116100f7578063ddc6326211610095578063e2bbb1581161006f578063e2bbb158146109d4578063e40dd119146109f4578063f4ef981d14610a14578063fddc298c14610a3457600080fd5b8063ddc6326214610981578063de89c76c14610994578063e10abfc4146109b457600080fd5b8063d18df53c116100d1578063d18df53c146108d9578063d2efde0914610911578063d408f65714610931578063da1165221461096157600080fd5b8063ced8a5d714610879578063cf4b55cb14610899578063d02ade94146108b957600080fd5b806399d32fc411610164578063b17fae431161013e578063b17fae43146107f9578063b3ab15fb14610819578063b947a88d14610839578063ce862f171461085957600080fd5b806399d32fc4146107ae578063a44a7432146107c4578063ade406d9146107e457600080fd5b806393f1a40b116101a057806393f1a40b146106fb578063943f013d1461074f578063952f49641461076557806396f38bdb1461078657600080fd5b80636e271dd5146106bd5780638ed955b9146106d357806390c5ed6a146106db57600080fd5b80633afb24f1116102a0578063570ca7351161023e57806361e79f021161021857806361e79f0214610647578063630b5ba11461066857806363eb04161461067d5780636b2681c51461069d57600080fd5b8063570ca735146105fb5780635752933a1461061b5780635f96dc111461063157600080fd5b806351637ba91161027a57806351637ba9146105735780635312ea8e1461059357806354575af4146105b3578063549c278a146105d357600080fd5b80633afb24f11461051f57806343b0e8df14610540578063441a3e701461056057600080fd5b8063231f0c6a1161030d5780633202f6c1116102e75780633202f6c1146104a45780633695dad1146104c45780633aa158ee146104da5780633af32abf146104ef57600080fd5b8063231f0c6a146104445780632df95ed7146104645780632e75ab501461048457600080fd5b8062c6b39114610354578063081e3eda146103995780630ac8c832146103b85780630c424284146103d85780631526fe27146103fa57806317caf6f11461042e575b600080fd5b34801561036057600080fd5b5061037c735050bc082ff4a74fb6b0b04385defddb114b242481565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156103a557600080fd5b506009545b604051908152602001610390565b3480156103c457600080fd5b5060035461037c906001600160a01b031681565b3480156103e457600080fd5b506103f86103f33660046139be565b610a54565b005b34801561040657600080fd5b5061041a6104153660046139f7565b610b08565b604051610390989796959493929190613a26565b34801561043a57600080fd5b506103aa600c5481565b34801561045057600080fd5b506103aa61045f366004613ab0565b610bc6565b34801561047057600080fd5b506103f861047f3660046139f7565b610c8b565b34801561049057600080fd5b506103f861049f3660046139f7565b610ea0565b3480156104b057600080fd5b5060065461037c906001600160a01b031681565b3480156104d057600080fd5b506103aa60055481565b3480156104e657600080fd5b506103f8610f20565b3480156104fb57600080fd5b5061050f61050a366004613ad2565b610f6d565b6040519015158152602001610390565b34801561052b57600080fd5b5060035461050f90600160a01b900460ff1681565b34801561054c57600080fd5b506103f861055b366004613aef565b610f8b565b6103f861056e366004613ab0565b611091565b34801561057f57600080fd5b506103f861058e3660046139f7565b611277565b34801561059f57600080fd5b506103f86105ae3660046139f7565b611313565b3480156105bf57600080fd5b506103f86105ce366004613b1b565b6113ea565b3480156105df57600080fd5b5061037c733333111a391cc08fa51353e9195526a70b33333381565b34801561060757600080fd5b5060015461037c906001600160a01b031681565b34801561062757600080fd5b506103aa600f5481565b34801561063d57600080fd5b506103aa600d5481565b34801561065357600080fd5b5060035461050f90600160b01b900460ff1681565b34801561067457600080fd5b506103f86114d9565b34801561068957600080fd5b506103f8610698366004613b5d565b611501565b3480156106a957600080fd5b506103aa6106b8366004613b7a565b611549565b3480156106c957600080fd5b506103aa600e5481565b6103f861158f565b3480156106e757600080fd5b506103f86106f6366004613b9f565b611972565b34801561070757600080fd5b5061073a610716366004613b7a565b600a6020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610390565b34801561075b57600080fd5b506103aa60105481565b34801561077157600080fd5b5060035461050f90600160a81b900460ff1681565b34801561079257600080fd5b5061037c739710e10a8f6fba8c391606fee18614885684548d81565b3480156107ba57600080fd5b506103aa60045481565b3480156107d057600080fd5b506103f86107df366004613bf1565b611bf5565b3480156107f057600080fd5b506103f8611e92565b34801561080557600080fd5b506103aa610814366004613ad2565b611f52565b34801561082557600080fd5b506103f8610834366004613ad2565b61209d565b34801561084557600080fd5b506103f8610854366004613ab0565b6120e9565b34801561086557600080fd5b506103f8610874366004613c16565b612164565b34801561088557600080fd5b506103f8610894366004613ad2565b6121f8565b3480156108a557600080fd5b506103aa6108b4366004613b7a565b612244565b3480156108c557600080fd5b506103f86108d43660046139f7565b612429565b3480156108e557600080fd5b506103aa6108f4366004613b7a565b600b60209081526000928352604080842090915290825290205481565b34801561091d57600080fd5b5060025461037c906001600160a01b031681565b34801561093d57600080fd5b5061050f61094c366004613ad2565b60086020526000908152604090205460ff1681565b34801561096d57600080fd5b506103f861097c366004613b5d565b6124d6565b6103f861098f3660046139f7565b61251e565b3480156109a057600080fd5b5060075461037c906001600160a01b031681565b3480156109c057600080fd5b506103f86109cf366004613b5d565b6128d1565b3480156109e057600080fd5b506103f86109ef366004613ab0565b612919565b348015610a0057600080fd5b506103f8610a0f366004613ad2565b612af4565b348015610a2057600080fd5b506103aa610a2f366004613b7a565b612b40565b348015610a4057600080fd5b506103f8610a4f366004613c8b565b612c72565b6001546001600160a01b03163314610a875760405162461bcd60e51b8152600401610a7e90613d31565b60405180910390fd5b6001600160a01b038216610add5760405162461bcd60e51b815260206004820181905260248201527f5368617265526577617264506f6f6c3a20696e76616c696420616464726573736044820152606401610a7e565b6001600160a01b03919091166000908152600860205260409020805460ff1916911515919091179055565b60098181548110610b1857600080fd5b6000918252602091829020600890910201805460018083015460028401546003850154600486015460058701546040805160608101825260068a01805460ff8181161515845261010082046001600160a01b039081169e85019e909e529c909a169c50969a95999498939792861696949590949391850192600160a81b9092041690811115610ba957610ba9613a10565b6001811115610bba57610bba613a10565b90525060079091015488565b6000818310610bd757506000610c85565b600e548210610c3f57600e548310610bf157506000610c85565b600d548311610c2457610c1d600f54610c17600d54600e54612d6590919063ffffffff16565b90612dae565b9050610c85565b610c1d600f54610c1785600e54612d6590919063ffffffff16565b600d548211610c5057506000610c85565b600d548311610c7457610c1d600f54610c17600d5485612d6590919063ffffffff16565b600f54610c1d90610c178486612d65565b92915050565b600060098281548110610ca057610ca0613d7c565b60009182526020822060089190910201600681015481546040516370a0823160e01b81523060048201529294506101009091046001600160a01b0390811693929116906370a0823190602401602060405180830381865afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190613d92565b600684015490915060ff1615610e9a578015610e9a578254604051636eb1769f60e11b81523060048201526001600160a01b0384811660248301528392169063dd62ed3e90604401602060405180830381865afa158015610d92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db69190613d92565b1015610e3557825460405163095ea7b360e01b81526001600160a01b03848116600483015260001960248301529091169063095ea7b3906044016020604051808303816000875af1158015610e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e339190613dab565b505b600683015460405163b6b55f2560e01b8152600481018390526101009091046001600160a01b03169063b6b55f2590602401600060405180830381600087803b158015610e8157600080fd5b505af1158015610e95573d6000803e3d6000fd5b505050505b50505050565b6001546001600160a01b03163314610eca5760405162461bcd60e51b8152600401610a7e90613d31565b6096811115610f1b5760405162461bcd60e51b815260206004820152601d60248201527f5368617265526577617264506f6f6c3a2066656520746f6f20686967680000006044820152606401610a7e565b600455565b6001546001600160a01b03163314610f4a5760405162461bcd60e51b8152600401610a7e90613d31565b60095460005b81811015610f6957610f6181612429565b600101610f50565b5050565b6001600160a01b031660009081526008602052604090205460ff1690565b6001546001600160a01b03163314610fb55760405162461bcd60e51b8152600401610a7e90613d31565b610fbd6114d9565b600060098481548110610fd257610fd2613d7c565b906000526020600020906008020190508160001461102a5760405162461bcd60e51b815260206004820152601560248201527404465706f73697420666565206d757374206265203605c1b6044820152606401610a7e565b60018101829055600581015460ff161561107f576110618361105b8360020154600c54612d6590919063ffffffff16565b90612e30565b600c556007810154600f5461107b91859161105b91612d65565b600f555b60028101839055600701919091555050565b611099612e8f565b60003390506000600984815481106110b3576110b3613d7c565b60009182526020808320878452600a825260408085206001600160a01b0388168652909252922080546008909202909201925084111561112a5760405162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b6044820152606401610a7e565b61113385612eb9565b61113c85610c8b565b60006111798260010154611173670de0b6b3a764000061116d87600401548760000154612dae90919063ffffffff16565b906130c1565b90612d65565b905080156111d2576000868152600b602090815260408083206001600160a01b03881684529091529020546111ae9082612e30565b6000878152600b602090815260408083206001600160a01b03891684529091529020555b84156112065781546111e49086612d65565b82556111f08686613103565b8254611206906001600160a01b03168587613198565b6004830154825461122491670de0b6b3a76400009161116d91612dae565b600183015560405185815286906001600160a01b038616907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a350505050610f696001600055565b6001546001600160a01b031633146112a15760405162461bcd60e51b8152600401610a7e90613d31565b670de0b6b3a764000081111561130e5760405162461bcd60e51b815260206004820152602c60248201527f5368617265526577617264506f6f6c3a20696e76616c6964206d617820636c6160448201526b1a5b481d1a1c995cda1bdb1960a21b6064820152608401610a7e565b600555565b61131b612e8f565b60006009828154811061133057611330613d7c565b60009182526020808320858452600a8252604080852033865290925292208054600890920290920192506113648482613103565b6000848152600b602090815260408083203380855292528220829055818455600184019190915583546113a3916001600160a01b039091169083613198565b604051818152849033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959060200160405180910390a35050506113e76001600055565b50565b6001546001600160a01b031633146114145760405162461bcd60e51b8152600401610a7e90613d31565b60095460005b818110156114c45760006009828154811061143757611437613d7c565b6000918252602090912060089091020180549091506001600160a01b03908116908716036114bb5760405162461bcd60e51b815260206004820152602b60248201527f5368617265526577617264506f6f6c3a20546f6b656e2063616e6e6f7420626560448201526a103837b7b6103a37b5b2b760a91b6064820152608401610a7e565b5060010161141a565b50610e9a6001600160a01b0385168385613198565b60095460005b81811015610f69576114f081612eb9565b6114f981610c8b565b6001016114df565b6001546001600160a01b0316331461152b5760405162461bcd60e51b8152600401610a7e90613d31565b60038054911515600160a01b0260ff60a01b19909216919091179055565b6000806115568484612244565b6000858152600b602090815260408083206001600160a01b0388168452909152902054909150611587908290612e30565b949350505050565b611597612e8f565b60095433906000805b828110156116cb576000600982815481106115bd576115bd613d7c565b60009182526020808320858452600a825260408085206001600160a01b038b1686529092529220600890910290910191506115f783612eb9565b61160083610c8b565b60006116318260010154611173670de0b6b3a764000061116d87600401548760000154612dae90919063ffffffff16565b6000858152600b602090815260408083206001600160a01b038c1684529091528120549192506116618383612e30565b90508015611699576000868152600b602090815260408083206001600160a01b038d1684529091528120556116968782612e30565b96505b600485015484546116b791670de0b6b3a76400009161116d91612dae565b6001948501555050509190910190506115a0565b506005548110156116ee5760405162461bcd60e51b8152600401610a7e90613dc8565b801561196357600354600090600160a81b900460ff168015611716575061171484610f6d565b155b1561182357600354600254604051630d01142560e31b81526001600160a01b039182166004820152670de0b6b3a764000060248201526000929190911690636808a12890604401602060405180830381865afa15801561177a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179e9190613d92565b90506117cb6103e861116d600454610c17670de0b6b3a764000061116d8988612dae90919063ffffffff16565b91508134101561181d5760405162461bcd60e51b815260206004820152601c60248201527f696e73756666696369656e74205320666f7220636c61696d20666565000000006044820152606401610a7e565b50611841565b34156118415760405162461bcd60e51b8152600401610a7e90613e0c565b61184b84836131f7565b836001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e04868360405161188691815260200190565b60405180910390a2600354600160a81b900460ff1680156118ad57506118ab84610f6d565b155b80156118b857508034115b156119615760006118c98234613e64565b90506000856001600160a01b03168260405160006040518083038185875af1925050503d8060008114611918576040519150601f19603f3d011682016040523d82523d6000602084013e61191d565b606091505b505090508061195e5760405162461bcd60e51b815260206004820152600d60248201526c1499599d5b990819985a5b1959609a1b6044820152606401610a7e565b50505b505b5050506119706001600055565b565b6001546001600160a01b0316331461199c5760405162461bcd60e51b8152600401610a7e90613d31565b6119a5836132a2565b83156119eb5760405162461bcd60e51b815260206004820152601560248201527404465706f73697420666565206d757374206265203605c1b6044820152606401610a7e565b81156119f9576119f96114d9565b600d54421015611a285780600003611a145750600d54611a3c565b600d54811015611a235750600d545b611a3c565b801580611a3457504281105b15611a3c5750425b6000600d5482111580611a4f5750428211155b90506009604051806101000160405280866001600160a01b03168152602001878152602001888152602001848152602001600081526020018315158152602001604051806060016040528060001515815260200160006001600160a01b0316815260200160006001811115611ac657611ac6613a10565b905281526020908101899052825460018181018555600094855293829020835160089092020180546001600160a01b039283166001600160a01b031990911617815583830151818601556040808501516002830155606085015160038301556080850151600483015560a085015160058301805491151560ff1990921691909117905560c085015180516006840180549683015190951661010002610100600160a81b0319911515919091166001600160a81b03199096169590951794909417808455908401519495919491839160ff60a81b191690600160a81b908490811115611bb357611bb3613a10565b0217905550505060e0820151816007015550508015611bed57600c54611bd99087612e30565b600c55600f54611be99087612e30565b600f555b505050505050565b6001546001600160a01b03163314611c1f5760405162461bcd60e51b8152600401610a7e90613d31565b60405163095ea7b360e01b8152739710e10a8f6fba8c391606fee18614885684548d600482015260248101839052735050bc082ff4a74fb6b0b04385defddb114b24249063095ea7b3906044016020604051808303816000875af1158015611c8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611caf9190613dab565b506000733333111a391cc08fa51353e9195526a70b3333336001600160a01b0316638380edb76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d289190613dab565b90508015611e8d578115611de457604051636e553f6560e01b815260048101849052306024820152600090739710e10a8f6fba8c391606fee18614885684548d90636e553f65906044016020604051808303816000875af1158015611d91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611db59190613d92565b600754909150610e9a90733333111a391cc08fa51353e9195526a70b333333906001600160a01b031683613198565b604051636e553f6560e01b815260048101849052306024820152739710e10a8f6fba8c391606fee18614885684548d90636e553f65906044016020604051808303816000875af1158015611e3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e609190613d92565b50600754611e8d90733333111a391cc08fa51353e9195526a70b333333906001600160a01b031685613198565b505050565b6001546001600160a01b03163314611ebc5760405162461bcd60e51b8152600401610a7e90613d31565b6007546040516000916001600160a01b03169047908381818185875af1925050503d8060008114611f09576040519150601f19603f3d011682016040523d82523d6000602084013e611f0e565b606091505b50509050806113e75760405162461bcd60e51b815260206004820152601060248201526f6661696c656420746f2073656e64205360801b6044820152606401610a7e565b6000611f5d82610f6d565b15611f6a57506000919050565b6000805b600954811015611fc4576000611f848286612244565b6000838152600b602090815260408083206001600160a01b038a168452909152902054909150611fb88161105b8685612e30565b93505050600101611f6e565b50600354600160a81b900460ff161580611fdf575060055481105b15611fed5750600092915050565b600354600254604051630d01142560e31b81526001600160a01b039182166004820152670de0b6b3a764000060248201526000929190911690636808a12890604401602060405180830381865afa15801561204c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120709190613d92565b90506115876103e861116d600454610c17670de0b6b3a764000061116d8888612dae90919063ffffffff16565b6001546001600160a01b031633146120c75760405162461bcd60e51b8152600401610a7e90613d31565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b808211156121395760405162461bcd60e51b815260206004820152601f60248201527f585175616e74526577617264506f6f6c3a20696e76616c69642072616e6765006044820152606401610a7e565b815b818111611e8d5761214b81612eb9565b61215481610c8b565b61215d81613e77565b905061213b565b6001546001600160a01b0316331461218e5760405162461bcd60e51b8152600401610a7e90613d31565b60018160018111156121a2576121a2613a10565b146121ef5760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c7920536861646f7720676175676520737570706f7274656400000000006044820152606401610a7e565b610f698261333c565b6001546001600160a01b031633146122225760405162461bcd60e51b8152600401610a7e90613d31565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000806009848154811061225a5761225a613d7c565b60009182526020808320878452600a825260408085206001600160a01b0389168652909252908320600892909202016004810154600682015491945091929060ff166123105783546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156122e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230b9190613d92565b612382565b60068401546040516370a0823160e01b81523060048201526101009091046001600160a01b0316906370a0823190602401602060405180830381865afa15801561235e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123829190613d92565b905083600301544211801561239657508015155b156123f35760006123ab856003015442610bc6565b905060006123cc600c5461116d886002015485612dae90919063ffffffff16565b90506123ee6123e78461116d84670de0b6b3a7640000612dae565b8590612e30565b935050505b61241e8360010154611173670de0b6b3a764000061116d868860000154612dae90919063ffffffff16565b979650505050505050565b60006009828154811061243e5761243e613d7c565b60009182526020909120600890910201600681015490915060ff1615610f695760016006820154600160a81b900460ff16600181111561248057612480613a10565b146124cd5760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c7920536861646f7720676175676520737570706f7274656400000000006044820152606401610a7e565b610f69826134ad565b6001546001600160a01b031633146125005760405162461bcd60e51b8152600401610a7e90613d31565b60038054911515600160b01b0260ff60b01b19909216919091179055565b612526612e8f565b600033905060006009838154811061254057612540613d7c565b60009182526020808320868452600a825260408085206001600160a01b038816865290925292206008909102909101915061257a84612eb9565b61258384610c8b565b60006125b48260010154611173670de0b6b3a764000061116d87600401548760000154612dae90919063ffffffff16565b6000868152600b602090815260408083206001600160a01b03891684529091528120549192506125e48383612e30565b90506005548110156126085760405162461bcd60e51b8152600401610a7e90613dc8565b801561289f576000878152600b602090815260408083206001600160a01b038a1684529091528120819055600354600160a81b900460ff168015612652575061265087610f6d565b155b1561275f57600354600254604051630d01142560e31b81526001600160a01b039182166004820152670de0b6b3a764000060248201526000929190911690636808a12890604401602060405180830381865afa1580156126b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126da9190613d92565b90506127076103e861116d600454610c17670de0b6b3a764000061116d8988612dae90919063ffffffff16565b9150813410156127595760405162461bcd60e51b815260206004820152601c60248201527f696e73756666696369656e74205320666f7220636c61696d20666565000000006044820152606401610a7e565b5061277d565b341561277d5760405162461bcd60e51b8152600401610a7e90613e0c565b61278787836131f7565b866001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486836040516127c291815260200190565b60405180910390a2600354600160a81b900460ff1680156127e957506127e787610f6d565b155b80156127f457508034115b1561289d5760006128058234613e64565b90506000886001600160a01b03168260405160006040518083038185875af1925050503d8060008114612854576040519150601f19603f3d011682016040523d82523d6000602084013e612859565b606091505b505090508061289a5760405162461bcd60e51b815260206004820152600d60248201526c1499599d5b990819985a5b1959609a1b6044820152606401610a7e565b50505b505b600485015484546128bd91670de0b6b3a76400009161116d91612dae565b600194850155505050600055506113e79050565b6001546001600160a01b031633146128fb5760405162461bcd60e51b8152600401610a7e90613d31565b60038054911515600160a81b0260ff60a81b19909216919091179055565b612921612e8f565b600033905060006009848154811061293b5761293b613d7c565b60009182526020808320878452600a825260408085206001600160a01b038816865290925292206008909102909101915061297585612eb9565b805415612a085760006129ad8260010154611173670de0b6b3a764000061116d87600401548760000154612dae90919063ffffffff16565b90508015612a06576000868152600b602090815260408083206001600160a01b03881684529091529020546129e29082612e30565b6000878152600b602090815260408083206001600160a01b03891684529091529020555b505b8315612a7b578154612a25906001600160a01b03168430876136ca565b6000612a4461271061116d856001015488612dae90919063ffffffff16565b9050612a5b612a538683612d65565b835490612e30565b82556007548354612a79916001600160a01b03918216911683613198565b505b612a8485610c8b565b60048201548154612aa291670de0b6b3a76400009161116d91612dae565b600182015560405184815285906001600160a01b038516907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159060200160405180910390a3505050610f696001600055565b6001546001600160a01b03163314612b1e5760405162461bcd60e51b8152600401610a7e90613d31565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000612b4b82610f6d565b15612b5857506000610c85565b6000612b648484612244565b6000858152600b602090815260408083206001600160a01b0388168452909152812054919250612b948383612e30565b600354909150600160a81b900460ff161580612bb1575060055481105b15612bc25760009350505050610c85565b600354600254604051630d01142560e31b81526001600160a01b039182166004820152670de0b6b3a764000060248201526000929190911690636808a12890604401602060405180830381865afa158015612c21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c459190613d92565b905061241e6103e861116d600454610c17670de0b6b3a764000061116d8888612dae90919063ffffffff16565b6001546001600160a01b03163314612c9c5760405162461bcd60e51b8152600401610a7e90613d31565b8483148015612caa57508481145b612cf65760405162461bcd60e51b815260206004820181905260248201527f585175616e74526577617264506f6f6c3a20696e76616c6964206c656e6774686044820152606401610a7e565b60005b85811015612d5c57612d54878783818110612d1657612d16613d7c565b90506020020135868684818110612d2f57612d2f613d7c565b90506020020135858585818110612d4857612d48613d7c565b90506020020135610f8b565b600101612cf9565b50505050505050565b6000612da783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613703565b9392505050565b600082600003612dc057506000610c85565b6000612dcc8385613e90565b905082612dd98583613ea7565b14612da75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610a7e565b600080612e3d8385613ec9565b905083811015612da75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610a7e565b600260005403612eb257604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b600060098281548110612ece57612ece613d7c565b9060005260206000209060080201905080600301544211612eed575050565b600681015460009060ff16612f6c5781546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015612f43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f679190613d92565b612fde565b60068201546040516370a0823160e01b81523060048201526101009091046001600160a01b0316906370a0823190602401602060405180830381865afa158015612fba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fde9190613d92565b905080600003612ff357504260039091015550565b600582015460ff166130375760058201805460ff191660011790556002820154600c5461301f91612e30565b600c556007820154600f5461303391612e30565b600f555b600c541561309e57600061304f836003015442610bc6565b90506000613070600c5461116d866002015485612dae90919063ffffffff16565b905061309661308b8461116d84670de0b6b3a7640000612dae565b600486015490612e30565b600485015550505b4260038381019190915554600160a01b900460ff1615611e8d57611e8d83612429565b6000612da783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061373d565b60006009838154811061311857613118613d7c565b60009182526020909120600890910201600681015490915060ff1615611e8d576006810154604051632e1a7d4d60e01b8152600481018490526101009091046001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561318457600080fd5b505af1158015612d5c573d6000803e3d6000fd5b6040516001600160a01b03838116602483015260448201839052611e8d91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b03838183161783525050505061376b565b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015613240573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132649190613d92565b90508015611e8d578082111561328b57600254611e8d906001600160a01b03168483613198565b600254611e8d906001600160a01b03168484613198565b60095460005b81811015611e8d57826001600160a01b0316600982815481106132cd576132cd613d7c565b60009182526020909120600890910201546001600160a01b0316036133345760405162461bcd60e51b815260206004820152601f60248201527f5368617265526577617264506f6f6c3a206578697374696e6720706f6f6c3f006044820152606401610a7e565b6001016132a8565b600654600980546000926001600160a01b031691632045be90918590811061336657613366613d7c565b600091825260209091206008909102015460405160e083901b6001600160e01b03191681526001600160a01b039091166004820152602401602060405180830381865afa1580156133bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133df9190613eec565b90506001600160a01b03811615610f69576040805160608101825260018082526001600160a01b038416602083015290918201908152506009838154811061342957613429613d7c565b6000918252602091829020835160066008909302909101919091018054928401516001600160a01b031661010002610100600160a81b0319921515929092166001600160a81b03199093169290921717808255604083015190829060ff60a81b1916600160a81b8360018111156134a2576134a2613a10565b021790555050505050565b6000600982815481106134c2576134c2613d7c565b9060005260206000209060080201905060008160060160000160019054906101000a90046001600160a01b03166001600160a01b0316638003b6146040518163ffffffff1660e01b8152600401600060405180830381865afa15801561352c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526135549190810190613f1f565b60068301546040516331279d3d60e01b815291925061010090046001600160a01b0316906331279d3d9061358e9030908590600401613fef565b600060405180830381600087803b1580156135a857600080fd5b505af11580156135bc573d6000803e3d6000fd5b5050505060005b8151811015610e9a5760008282815181106135e0576135e0613d7c565b60209081029190910101516040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a0823190602401602060405180830381865afa158015613635573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136599190613d92565b905080156136c057735050bc082ff4a74fb6b0b04385defddb114b2423196001600160a01b038316016136a657600354600160b01b900460ff16156136a1576136a1816137dc565b6136c0565b6007546136c0906001600160a01b03848116911683613198565b50506001016135c3565b6040516001600160a01b038481166024830152838116604483015260648201839052610e9a9186918216906323b872dd906084016131c5565b600081848411156137275760405162461bcd60e51b8152600401610a7e919061404e565b5060006137348486613e64565b95945050505050565b6000818361375e5760405162461bcd60e51b8152600401610a7e919061404e565b5060006137348486613ea7565b600080602060008451602086016000885af18061378e576040513d6000823e3d81fd5b50506000513d915081156137a65780600114156137b3565b6001600160a01b0384163b155b15610e9a57604051635274afe760e01b81526001600160a01b0385166004820152602401610a7e565b60405163095ea7b360e01b8152739710e10a8f6fba8c391606fee18614885684548d600482015260248101829052735050bc082ff4a74fb6b0b04385defddb114b24249063095ea7b3906044016020604051808303816000875af1158015613848573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061386c9190613dab565b506000733333111a391cc08fa51353e9195526a70b3333336001600160a01b0316638380edb76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156138c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138e59190613dab565b90508015610f6957604051636e553f6560e01b815260048101839052306024820152600090739710e10a8f6fba8c391606fee18614885684548d90636e553f65906044016020604051808303816000875af1158015613948573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061396c9190613d92565b600754909150611e8d90733333111a391cc08fa51353e9195526a70b333333906001600160a01b031683613198565b6001600160a01b03811681146113e757600080fd5b80151581146113e757600080fd5b600080604083850312156139d157600080fd5b82356139dc8161399b565b915060208301356139ec816139b0565b809150509250929050565b600060208284031215613a0957600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b03898116825260208083018a905260408084018a9052606084018990526080840188905286151560a08501528551151560c08501529085015190911660e083015283015161014082019060028110613a9557634e487b7160e01b600052602160045260246000fd5b61010083015261012090910191909152979650505050505050565b60008060408385031215613ac357600080fd5b50508035926020909101359150565b600060208284031215613ae457600080fd5b8135612da78161399b565b600080600060608486031215613b0457600080fd5b505081359360208301359350604090920135919050565b600080600060608486031215613b3057600080fd5b8335613b3b8161399b565b9250602084013591506040840135613b528161399b565b809150509250925092565b600060208284031215613b6f57600080fd5b8135612da7816139b0565b60008060408385031215613b8d57600080fd5b8235915060208301356139ec8161399b565b600080600080600060a08688031215613bb757600080fd5b85359450602086013593506040860135613bd08161399b565b92506060860135613be0816139b0565b949793965091946080013592915050565b60008060408385031215613c0457600080fd5b8235915060208301356139ec816139b0565b60008060408385031215613c2957600080fd5b823591506020830135600281106139ec57600080fd5b60008083601f840112613c5157600080fd5b50813567ffffffffffffffff811115613c6957600080fd5b6020830191508360208260051b8501011115613c8457600080fd5b9250929050565b60008060008060008060608789031215613ca457600080fd5b863567ffffffffffffffff811115613cbb57600080fd5b613cc789828a01613c3f565b909750955050602087013567ffffffffffffffff811115613ce757600080fd5b613cf389828a01613c3f565b909550935050604087013567ffffffffffffffff811115613d1357600080fd5b613d1f89828a01613c3f565b979a9699509497509295939492505050565b6020808252602b908201527f5368617265526577617264506f6f6c3a2063616c6c6572206973206e6f74207460408201526a34329037b832b930ba37b960a91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215613da457600080fd5b5051919050565b600060208284031215613dbd57600080fd5b8151612da7816139b0565b60208082526024908201527f436c61696d20616d6f756e742062656c6f77206d696e696d756d2074687265736040820152631a1bdb1960e21b606082015260800190565b60208082526022908201527f5368617265526577617264506f6f6c3a20696e76616c6964206d73672e76616c604082015261756560f01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b81810381811115610c8557610c85613e4e565b600060018201613e8957613e89613e4e565b5060010190565b8082028115828204841417610c8557610c85613e4e565b600082613ec457634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115610c8557610c85613e4e565b8051613ee78161399b565b919050565b600060208284031215613efe57600080fd5b8151612da78161399b565b634e487b7160e01b600052604160045260246000fd5b600060208284031215613f3157600080fd5b815167ffffffffffffffff811115613f4857600080fd5b8201601f81018413613f5957600080fd5b805167ffffffffffffffff811115613f7357613f73613f09565b8060051b604051601f19603f830116810181811067ffffffffffffffff82111715613fa057613fa0613f09565b604052918252602081840181019290810187841115613fbe57600080fd5b6020850194505b83851015613fe457613fd685613edc565b815260209485019401613fc5565b509695505050505050565b6001600160a01b0383168152604060208083018290528351918301829052600091908401906060840190835b818110156140425783516001600160a01b031683526020938401939092019160010161401b565b50909695505050505050565b602081526000825180602084015260005b8181101561407c576020818601810151604086840101520161405f565b506000604082850101526040601f19601f8301168401019150509291505056fea2646970667358221220a16b5de9870fa6a6e45890ca8349681b54d9fdb612af8513972db0a645ee381c64736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004e583383c8389f469af337f932b14d276cbe0611000000000000000000000000a8dd0362db7a7fefe71025401eb7ae6f11b60c020000000000000000000000000000000000000000000000000000000067e889800000000000000000000000009f59398d0a397b2eeb8a6123a6c7295cb0b0062d000000000000000000000000b8095ee03a33a965039cafd8648bb508be9aa0ed
-----Decoded View---------------
Arg [0] : _xquant (address): 0x4E583383c8389f469aF337f932B14d276CBe0611
Arg [1] : _bribesSafe (address): 0xA8dD0362DB7a7FeFE71025401eB7Ae6f11B60c02
Arg [2] : _poolStartTime (uint256): 1743292800
Arg [3] : _shadowVoter (address): 0x9F59398D0a397b2EEB8a6123a6c7295cB0b0062D
Arg [4] : _xquantOracle (address): 0xb8095eE03A33a965039CAFD8648bB508BE9aa0eD
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000004e583383c8389f469af337f932b14d276cbe0611
Arg [1] : 000000000000000000000000a8dd0362db7a7fefe71025401eb7ae6f11b60c02
Arg [2] : 0000000000000000000000000000000000000000000000000000000067e88980
Arg [3] : 0000000000000000000000009f59398d0a397b2eeb8a6123a6c7295cb0b0062d
Arg [4] : 000000000000000000000000b8095ee03a33a965039cafd8648bb508be9aa0ed
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$2.72
Net Worth in S
Token Allocations
S
100.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| SONIC | 100.00% | $0.068133 | 39.9625 | $2.72 |
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.