Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 1 from a total of 1 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Become Implement... | 21494077 | 439 days ago | IN | 0 ETH | 0.00023822 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
SophonFarming
Compiler Version
v0.8.26+commit.8a97fa7a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.26;
import "contracts/token/ERC20/utils/SafeERC20.sol";
import "contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "contracts/utils/math/Math.sol";
import "contracts/farm/interfaces/IWeth.sol";
import "contracts/farm/interfaces/IstETH.sol";
import "contracts/farm/interfaces/IwstETH.sol";
import "contracts/farm/interfaces/IsDAI.sol";
import "contracts/farm/interfaces/IeETHLiquidityPool.sol";
import "contracts/farm/interfaces/IweETH.sol";
import "contracts/proxies/Upgradeable2Step.sol";
import "contracts/farm/SophonFarmingState.sol";
import "contracts/interfaces/uniswap/IUniswapV2Router02.sol";
/**
* @title Sophon Farming Contract
* @author Sophon
*/
contract SophonFarming is Upgradeable2Step, SophonFarmingState {
using SafeERC20 for IERC20;
/// @notice Emitted when a new pool is added
event Add(address indexed lpToken, uint256 indexed pid, uint256 allocPoint);
/// @notice Emitted when a pool is updated
event Set(address indexed lpToken, uint256 indexed pid, uint256 allocPoint);
/// @notice Emitted when a user deposits to a pool
event Deposit(address indexed user, uint256 indexed pid, uint256 depositAmount, uint256 boostAmount);
/// @notice Emitted when a user withdraws from a pool
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
/// @notice Emitted when a whitelisted admin transfers points from one user to another
event TransferPoints(address indexed sender, address indexed receiver, uint256 indexed pid, uint256 amount);
/// @notice Emitted when a user increases the boost of an existing deposit
event IncreaseBoost(address indexed user, uint256 indexed pid, uint256 boostAmount);
/// @notice Emitted when all pool funds are bridged to Sophon blockchain
event BridgePool(address indexed user, uint256 indexed pid, uint256 amount);
/// @notice Emitted when the the revertFailedBridge function is called
event RevertFailedBridge(uint256 indexed pid);
/// @notice Emitted when the the updatePool function is called
event PoolUpdated(uint256 indexed pid);
/// @notice Emitted when setPointsPerBlock is called
event SetPointsPerBlock(uint256 oldValue, uint256 newValue);
error ZeroAddress();
error PoolExists();
error PoolDoesNotExist();
error AlreadyInitialized();
error NotFound(address lpToken);
error FarmingIsStarted();
error FarmingIsEnded();
error TransferNotAllowed();
error TransferTooHigh(uint256 maxAllowed);
error InvalidEndBlock();
error InvalidDeposit();
error InvalidBooster();
error InvalidPointsPerBlock();
error InvalidTransfer();
error WithdrawNotAllowed();
error WithdrawTooHigh(uint256 maxAllowed);
error WithdrawIsZero();
error NothingInPool();
error NoEthSent();
error BoostTooHigh(uint256 maxAllowed);
error BoostIsZero();
error BridgeInvalid();
address public immutable dai;
address public immutable sDAI;
address public immutable weth;
address public immutable stETH;
address public immutable wstETH;
address public immutable eETH;
address public immutable eETHLiquidityPool;
address public immutable weETH;
uint256 public immutable CHAINID;
uint256 internal constant PEPE_PID = 9;
address internal constant PENDLE_EXCEPTION = 0x065347C1Dd7A23Aa043e3844B4D0746ff7715246;
/**
* @notice Construct SophonFarming
* @param tokens_ Immutable token addresses
* @dev 0:dai, 1:sDAI, 2:weth, 3:stETH, 4:wstETH, 5:eETH, 6:eETHLiquidityPool, 7:weETH
*/
constructor(address[8] memory tokens_, uint256 _CHAINID) {
for (uint256 i = 0; i < tokens_.length; i++) {
require(tokens_[i] != address(0), "cannot be zero");
}
dai = tokens_[0];
sDAI = tokens_[1];
weth = tokens_[2];
stETH = tokens_[3];
wstETH = tokens_[4];
eETH = tokens_[5];
eETHLiquidityPool = tokens_[6];
weETH = tokens_[7];
CHAINID = _CHAINID;
}
/**
* @notice Allows direct deposits of ETH for deposit to the wstETH pool
*/
receive() external payable {
if (msg.sender == weth) {
return;
}
depositEth(0, PredefinedPool.wstETH);
}
/**
* @notice Initialize the farm
* @param wstEthAllocPoint_ wstEth alloc points
* @param weEthAllocPoint_ weEth alloc points
* @param sDAIAllocPoint_ sdai alloc points
* @param _pointsPerBlock points per block
* @param _initialPoolStartBlock start block
* @param _boosterMultiplier booster multiplier
*/
function initialize(uint256 wstEthAllocPoint_, uint256 weEthAllocPoint_, uint256 sDAIAllocPoint_, uint256 _pointsPerBlock, uint256 _initialPoolStartBlock, uint256 _boosterMultiplier) public virtual onlyOwner {
if (_initialized) {
revert AlreadyInitialized();
}
if (_pointsPerBlock < 1e18 || _pointsPerBlock > 1_000e18) {
revert InvalidPointsPerBlock();
}
pointsPerBlock = _pointsPerBlock;
if (_boosterMultiplier < 1e18 || _boosterMultiplier > 10e18) {
revert InvalidBooster();
}
boosterMultiplier = _boosterMultiplier;
poolExists[dai] = true;
poolExists[weth] = true;
poolExists[stETH] = true;
poolExists[eETH] = true;
_initialized = true;
// sDAI
typeToId[PredefinedPool.sDAI] = add(sDAIAllocPoint_, sDAI, "sDAI", _initialPoolStartBlock, 0);
IERC20(dai).approve(sDAI, type(uint256).max);
// wstETH
typeToId[PredefinedPool.wstETH] = add(wstEthAllocPoint_, wstETH, "wstETH", _initialPoolStartBlock, 0);
IERC20(stETH).approve(wstETH, type(uint256).max);
// weETH
typeToId[PredefinedPool.weETH] = add(weEthAllocPoint_, weETH, "weETH", _initialPoolStartBlock, 0);
IERC20(eETH).approve(weETH, type(uint256).max);
}
/**
* @notice Adds a new pool to the farm. Can only be called by the owner.
* @param _allocPoint alloc point for new pool
* @param _lpToken lpToken address
* @param _description description of new pool
* @param _poolStartBlock block at which points start to accrue for the pool
* @param _newPointsPerBlock update global points per block; 0 means no update
* @return uint256 The pid of the newly created asset
*/
function add(uint256 _allocPoint, address _lpToken, string memory _description, uint256 _poolStartBlock, uint256 _newPointsPerBlock) public onlyOwner returns (uint256) {
if (_lpToken == address(0)) {
revert ZeroAddress();
}
if (poolExists[_lpToken]) {
revert PoolExists();
}
if (isFarmingEnded()) {
revert FarmingIsEnded();
}
if (_newPointsPerBlock != 0) {
setPointsPerBlock(_newPointsPerBlock);
} else {
massUpdatePools();
}
uint256 lastRewardBlock =
getBlockNumber() > _poolStartBlock ? getBlockNumber() : _poolStartBlock;
totalAllocPoint = totalAllocPoint + _allocPoint;
poolExists[_lpToken] = true;
uint256 pid = poolInfo.length;
poolInfo.push(
PoolInfo({
lpToken: IERC20(_lpToken),
l2Farm: address(0),
amount: 0,
boostAmount: 0,
depositAmount: 0,
allocPoint: _allocPoint,
lastRewardBlock: lastRewardBlock,
accPointsPerShare: 0,
totalRewards: 0,
description: _description
})
);
emit Add(_lpToken, pid, _allocPoint);
return pid;
}
/**
* @notice Updates the given pool's allocation point. Can only be called by the owner.
* @param _pid The pid to update
* @param _allocPoint The new alloc point to set for the pool
* @param _poolStartBlock block at which points start to accrue for the pool; 0 means no update
* @param _newPointsPerBlock update global points per block; 0 means no update
*/
function set(uint256 _pid, uint256 _allocPoint, uint256 _poolStartBlock, uint256 _newPointsPerBlock) external onlyOwner {
if (isFarmingEnded()) {
revert FarmingIsEnded();
}
if (_newPointsPerBlock != 0) {
setPointsPerBlock(_newPointsPerBlock);
} else {
massUpdatePools();
}
PoolInfo storage pool = poolInfo[_pid];
address lpToken = address(pool.lpToken);
if (lpToken == address(0) || !poolExists[lpToken]) {
revert PoolDoesNotExist();
}
totalAllocPoint = totalAllocPoint - pool.allocPoint + _allocPoint;
pool.allocPoint = _allocPoint;
// pool starting block is updated if farming hasn't started and _poolStartBlock is non-zero
if (_poolStartBlock != 0 && getBlockNumber() < pool.lastRewardBlock) {
pool.lastRewardBlock =
getBlockNumber() > _poolStartBlock ? getBlockNumber() : _poolStartBlock;
}
emit Set(lpToken, _pid, _allocPoint);
}
/**
* @notice Returns the number of pools in the farm
* @return uint256 number of pools
*/
function poolLength() external view returns (uint256) {
return poolInfo.length;
}
/**
* @notice Checks if farming is ended
* @return bool True if farming is ended
*/
function isFarmingEnded() public view returns (bool) {
uint256 _endBlock = endBlock;
return _endBlock != 0 && getBlockNumber() > _endBlock;
}
/**
* @notice Checks if the withdrawal period is ended
* @return bool True if withdrawal period is ended
*/
function isWithdrawPeriodEnded() public view returns (bool) {
uint256 _endBlockForWithdrawals = endBlockForWithdrawals;
return _endBlockForWithdrawals != 0 && getBlockNumber() > _endBlockForWithdrawals;
}
/**
* @notice Updates the bridge contract
*/
function setBridge(address _bridge) external onlyOwner {
if (_bridge == address(0)) {
revert ZeroAddress();
}
bridge = IBridgehub(_bridge);
}
/**
* @notice Updates the L2 Farm for the pool
* @param _pid the pid
* @param _l2Farm the l2Farm address
*/
function setL2FarmForPool(uint256 _pid, address _l2Farm) external onlyOwner {
if (_l2Farm == address(0)) {
revert ZeroAddress();
}
PoolInfo storage pool = poolInfo[_pid];
if (address(pool.lpToken) == address(0)) {
revert PoolDoesNotExist();
}
pool.l2Farm = _l2Farm;
}
/**
* @notice Set the end block of the farm
* @param _endBlock the end block
* @param _withdrawalBlocks the last block that withdrawals are allowed
*/
function setEndBlock(uint256 _endBlock, uint256 _withdrawalBlocks) external onlyOwner {
if (isFarmingEnded()) {
revert FarmingIsEnded();
}
uint256 _endBlockForWithdrawals;
if (_endBlock != 0) {
if (getBlockNumber() > _endBlock) {
revert InvalidEndBlock();
}
_endBlockForWithdrawals = _endBlock + _withdrawalBlocks;
} else {
// withdrawal blocks needs an endBlock
_endBlockForWithdrawals = 0;
}
massUpdatePools();
endBlock = _endBlock;
endBlockForWithdrawals = _endBlockForWithdrawals;
}
/**
* @notice Set points per block
* @param _pointsPerBlock points per block to set
*/
function setPointsPerBlock(uint256 _pointsPerBlock) virtual public onlyOwner {
if (isFarmingEnded()) {
revert FarmingIsEnded();
}
if (_pointsPerBlock < 1e18 || _pointsPerBlock > 1_000e18) {
revert InvalidPointsPerBlock();
}
massUpdatePools();
emit SetPointsPerBlock(pointsPerBlock, _pointsPerBlock);
pointsPerBlock = _pointsPerBlock;
}
/**
* @notice Set booster multiplier
* @param _boosterMultiplier booster multiplier to set
*/
function setBoosterMultiplier(uint256 _boosterMultiplier) virtual external onlyOwner {
if (_boosterMultiplier < 1e18 || _boosterMultiplier > 10e18) {
revert InvalidBooster();
}
if (isFarmingEnded()) {
revert FarmingIsEnded();
}
massUpdatePools();
boosterMultiplier = _boosterMultiplier;
}
/**
* @notice Returns the block multiplier
* @param _from from block
* @param _to to block
* @return uint256 The block multiplier
*/
function _getBlockMultiplier(uint256 _from, uint256 _to) internal view returns (uint256) {
uint256 _endBlock = endBlock;
if (_endBlock != 0) {
_to = Math.min(_to, _endBlock);
}
if (_to > _from) {
return (_to - _from) * 1e18;
} else {
return 0;
}
}
/**
* @notice Adds or removes users from the whitelist
* @param _userAdmin an admin user who can transfer points for users
* @param _users list of users
* @param _isInWhitelist to add or remove
*/
function setUsersWhitelisted(address _userAdmin, address[] memory _users, bool _isInWhitelist) external onlyOwner {
mapping(address user => bool inWhitelist) storage whitelist_ = whitelist[_userAdmin];
for(uint i = 0; i < _users.length; i++) {
whitelist_[_users[i]] = _isInWhitelist;
}
}
/**
* @notice Returns pending points for user in a pool
* @param _pid pid of the pool
* @param _user user in the pool
* @return uint256 pendings points
*/
function _pendingPoints(uint256 _pid, address _user) internal view returns (uint256) {
UserInfo storage user = userInfo[_pid][_user];
(uint256 accPointsPerShare, ) = _settlePool(_pid);
return user.amount *
accPointsPerShare /
1e18 +
user.rewardSettled -
user.rewardDebt;
}
/**
* @notice Returns accPointsPerShare and totalRewards to date for the pool
* @param _pid pid of the pool
* @return accPointsPerShare
* @return totalRewards
*/
function _settlePool(uint256 _pid) internal view returns (uint256 accPointsPerShare, uint256 totalRewards) {
PoolInfo storage pool = poolInfo[_pid];
accPointsPerShare = pool.accPointsPerShare;
totalRewards = pool.totalRewards;
uint256 lpSupply = pool.amount;
if (getBlockNumber() > pool.lastRewardBlock && lpSupply != 0) {
uint256 blockMultiplier = _getBlockMultiplier(pool.lastRewardBlock, getBlockNumber());
uint256 pointReward =
blockMultiplier *
pointsPerBlock *
pool.allocPoint /
totalAllocPoint;
totalRewards = totalRewards + pointReward / 1e18;
accPointsPerShare = pointReward /
lpSupply +
accPointsPerShare;
}
}
/**
* @notice Returns pending points for user in a pool
* @param _pid pid of the pool
* @param _user user in the pool
* @return uint256 pendings points
*/
function pendingPoints(uint256 _pid, address _user) external view returns (uint256) {
return _pendingPoints(_pid, _user);
}
/**
* @notice Update accounting of all pools
*/
function massUpdatePools() public {
uint256 length = poolInfo.length;
for(uint256 pid = 0; pid < length; ++pid) {
updatePool(pid);
}
}
/**
* @notice Updating accounting of a single pool
* @param _pid pid to update
*/
function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (getBlockNumber() <= pool.lastRewardBlock) {
return;
}
uint256 lpSupply = pool.amount;
uint256 _pointsPerBlock = pointsPerBlock;
uint256 _allocPoint = pool.allocPoint;
if (lpSupply == 0 || _pointsPerBlock == 0 || _allocPoint == 0) {
pool.lastRewardBlock = getBlockNumber();
return;
}
uint256 blockMultiplier = _getBlockMultiplier(pool.lastRewardBlock, getBlockNumber());
uint256 pointReward =
blockMultiplier *
_pointsPerBlock *
_allocPoint /
totalAllocPoint;
pool.totalRewards = pool.totalRewards + pointReward / 1e18;
pool.accPointsPerShare = pointReward /
lpSupply +
pool.accPointsPerShare;
pool.lastRewardBlock = getBlockNumber();
emit PoolUpdated(_pid);
}
/**
* @notice Deposit assets to SophonFarming
* @param _pid pid of the pool
* @param _amount amount of the deposit
* @param _boostAmount amount to boost
*/
function deposit(uint256 _pid, uint256 _amount, uint256 _boostAmount) external {
poolInfo[_pid].lpToken.safeTransferFrom(
msg.sender,
address(this),
_amount
);
_deposit(_pid, _amount, _boostAmount);
}
/**
* @notice Deposit DAI to SophonFarming
* @param _amount amount of the deposit
* @param _boostAmount amount to boost
*/
function depositDai(uint256 _amount, uint256 _boostAmount) external {
IERC20(dai).safeTransferFrom(
msg.sender,
address(this),
_amount
);
_depositPredefinedAsset(_amount, _amount, _boostAmount, PredefinedPool.sDAI);
}
/**
* @notice Deposit stETH to SophonFarming
* @param _amount amount of the deposit
* @param _boostAmount amount to boost
*/
function depositStEth(uint256 _amount, uint256 _boostAmount) external {
uint256 beforeBalance = IERC20(stETH).balanceOf(address(this));
IERC20(stETH).safeTransferFrom(
msg.sender,
address(this),
_amount
);
uint256 _finalAmount = IERC20(stETH).balanceOf(address(this)) - beforeBalance;
_depositPredefinedAsset(_finalAmount, _amount, _boostAmount, PredefinedPool.wstETH);
}
/**
* @notice Deposit eETH to SophonFarming
* @param _amount amount of the deposit
* @param _boostAmount amount to boost
*/
function depositeEth(uint256 _amount, uint256 _boostAmount) external {
uint256 beforeBalance = IERC20(eETH).balanceOf(address(this));
IERC20(eETH).safeTransferFrom(
msg.sender,
address(this),
_amount
);
uint256 _finalAmount = IERC20(eETH).balanceOf(address(this)) - beforeBalance;
_depositPredefinedAsset(_finalAmount, _amount, _boostAmount, PredefinedPool.weETH);
}
/**
* @notice Deposit ETH to SophonFarming when specifying a pool
* @param _boostAmount amount to boost
* @param _predefinedPool specific pool type to deposit to
*/
function depositEth(uint256 _boostAmount, PredefinedPool _predefinedPool) public payable {
if (msg.value == 0) {
revert NoEthSent();
}
uint256 _finalAmount = msg.value;
if (_predefinedPool == PredefinedPool.wstETH) {
_finalAmount = _ethTOstEth(_finalAmount);
} else if (_predefinedPool == PredefinedPool.weETH) {
_finalAmount = _ethTOeEth(_finalAmount);
} else {
revert InvalidDeposit();
}
_depositPredefinedAsset(_finalAmount, msg.value, _boostAmount, _predefinedPool);
}
/**
* @notice Deposit WETH to SophonFarming when specifying a pool
* @param _amount amount of the deposit
* @param _boostAmount amount to boost
* @param _predefinedPool specific pool type to deposit to
*/
function depositWeth(uint256 _amount, uint256 _boostAmount, PredefinedPool _predefinedPool) external {
IERC20(weth).safeTransferFrom(
msg.sender,
address(this),
_amount
);
uint256 _finalAmount = _wethTOEth(_amount);
if (_predefinedPool == PredefinedPool.wstETH) {
_finalAmount = _ethTOstEth(_finalAmount);
} else if (_predefinedPool == PredefinedPool.weETH) {
_finalAmount = _ethTOeEth(_finalAmount);
} else {
revert InvalidDeposit();
}
_depositPredefinedAsset(_finalAmount, _amount, _boostAmount, _predefinedPool);
}
/**
* @notice Deposit a predefined asset to SophonFarming
* @param _amount amount of the deposit
* @param _initalAmount amount of the deposit prior to conversions
* @param _boostAmount amount to boost
* @param _predefinedPool specific pool type to deposit to
*/
function _depositPredefinedAsset(uint256 _amount, uint256 _initalAmount, uint256 _boostAmount, PredefinedPool _predefinedPool) internal {
uint256 _finalAmount;
if (_predefinedPool == PredefinedPool.sDAI) {
_finalAmount = _daiTOsDai(_amount);
} else if (_predefinedPool == PredefinedPool.wstETH) {
_finalAmount = _stEthTOwstEth(_amount);
} else if (_predefinedPool == PredefinedPool.weETH) {
_finalAmount = _eethTOweEth(_amount);
} else {
revert InvalidDeposit();
}
// adjust boostAmount for the new asset
_boostAmount = _boostAmount * _finalAmount / _initalAmount;
_deposit(typeToId[_predefinedPool], _finalAmount, _boostAmount);
}
/**
* @notice Deposit an asset to SophonFarming
* @param _pid pid of the deposit
* @param _depositAmount amount of the deposit
* @param _boostAmount amount to boost
*/
function _deposit(uint256 _pid, uint256 _depositAmount, uint256 _boostAmount) internal {
if (isFarmingEnded()) {
revert FarmingIsEnded();
}
if (_depositAmount == 0) {
revert InvalidDeposit();
}
if (_boostAmount > _depositAmount) {
revert BoostTooHigh(_depositAmount);
}
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
uint256 userAmount = user.amount;
user.rewardSettled =
userAmount *
pool.accPointsPerShare /
1e18 +
user.rewardSettled -
user.rewardDebt;
// booster purchase proceeds
heldProceeds[_pid] = heldProceeds[_pid] + _boostAmount;
// deposit amount is reduced by amount of the deposit to boost
_depositAmount = _depositAmount - _boostAmount;
// set deposit amount
user.depositAmount = user.depositAmount + _depositAmount;
pool.depositAmount = pool.depositAmount + _depositAmount;
// apply the boost multiplier
_boostAmount = _boostAmount * boosterMultiplier / 1e18;
user.boostAmount = user.boostAmount + _boostAmount;
pool.boostAmount = pool.boostAmount + _boostAmount;
// userAmount is increased by remaining deposit amount + full boosted amount
userAmount = userAmount + _depositAmount + _boostAmount;
user.amount = userAmount;
pool.amount = pool.amount + _depositAmount + _boostAmount;
user.rewardDebt = userAmount *
pool.accPointsPerShare /
1e18;
emit Deposit(msg.sender, _pid, _depositAmount, _boostAmount);
}
/**
* @notice Increase boost from existing deposits
* @param _pid pid to pool
* @param _boostAmount amount to boost
*/
function increaseBoost(uint256 _pid, uint256 _boostAmount) external {
if (isFarmingEnded()) {
revert FarmingIsEnded();
}
if (_boostAmount == 0) {
revert BoostIsZero();
}
uint256 maxAdditionalBoost = getMaxAdditionalBoost(msg.sender, _pid);
if (_boostAmount > maxAdditionalBoost) {
revert BoostTooHigh(maxAdditionalBoost);
}
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
uint256 userAmount = user.amount;
user.rewardSettled =
userAmount *
pool.accPointsPerShare /
1e18 +
user.rewardSettled -
user.rewardDebt;
// booster purchase proceeds
heldProceeds[_pid] = heldProceeds[_pid] + _boostAmount;
// user's remaining deposit is reduced by amount of the deposit to boost
user.depositAmount = user.depositAmount - _boostAmount;
pool.depositAmount = pool.depositAmount - _boostAmount;
// apply the multiplier
uint256 finalBoostAmount = _boostAmount * boosterMultiplier / 1e18;
user.boostAmount = user.boostAmount + finalBoostAmount;
pool.boostAmount = pool.boostAmount + finalBoostAmount;
// user amount is increased by the full boosted amount - deposit amount used to boost
userAmount = userAmount + finalBoostAmount - _boostAmount;
user.amount = userAmount;
pool.amount = pool.amount + finalBoostAmount - _boostAmount;
user.rewardDebt = userAmount *
pool.accPointsPerShare /
1e18;
emit IncreaseBoost(msg.sender, _pid, finalBoostAmount);
}
/**
* @notice Returns max additional boost amount allowed to boost current deposits
* @dev total allowed boost is 100% of total deposit
* @param _user user in pool
* @param _pid pid of pool
* @return uint256 max additional boost
*/
function getMaxAdditionalBoost(address _user, uint256 _pid) public view returns (uint256) {
return userInfo[_pid][_user].depositAmount;
}
/**
* @notice Withdraw an asset to SophonFarming
* @param _pid pid of the withdraw
* @param _withdrawAmount amount of the withdraw
*/
function withdraw(uint256 _pid, uint256 _withdrawAmount) external {
if (isWithdrawPeriodEnded() && msg.sender != PENDLE_EXCEPTION) {
revert WithdrawNotAllowed();
}
if (_withdrawAmount == 0) {
revert WithdrawIsZero();
}
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
uint256 userDepositAmount = user.depositAmount;
if (_withdrawAmount == type(uint256).max) {
_withdrawAmount = userDepositAmount;
} else if (_withdrawAmount > userDepositAmount) {
revert WithdrawTooHigh(userDepositAmount);
}
uint256 userAmount = user.amount;
user.rewardSettled =
userAmount *
pool.accPointsPerShare /
1e18 +
user.rewardSettled -
user.rewardDebt;
user.depositAmount = userDepositAmount - _withdrawAmount;
pool.depositAmount = pool.depositAmount - _withdrawAmount;
userAmount = userAmount - _withdrawAmount;
user.amount = userAmount;
pool.amount = pool.amount - _withdrawAmount;
user.rewardDebt = userAmount *
pool.accPointsPerShare /
1e18;
pool.lpToken.safeTransfer(msg.sender, _withdrawAmount);
emit Withdraw(msg.sender, _pid, _withdrawAmount);
}
/**
* @notice Permissionless function to allow anyone to bridge during the correct period
* @param _pid pid to bridge
* @param _mintValue _mintValue SOPH gas price
*/
function bridgePool(uint256 _pid, uint256 _mintValue, address _sophToken) external payable {
// USDC exception
if (_pid == 7) {
revert Unauthorized();
}
_bridgePool(_pid, _mintValue, _sophToken, address(bridge.sharedBridge()));
}
function _bridgePool(uint256 _pid, uint256 _mintValue, address _sophToken, address sharedBridge) internal {
if (!isFarmingEnded() || !isWithdrawPeriodEnded() || isBridged[_pid]) {
revert Unauthorized();
}
updatePool(_pid);
PoolInfo storage pool = poolInfo[_pid];
if (pool.depositAmount == 0 || address(bridge) == address(0) || pool.l2Farm == address(0)) {
revert BridgeInvalid();
}
uint256 depositAmount = IERC20(pool.lpToken).balanceOf(address(this));
if (_pid == PEPE_PID) {
UserInfo storage user = userInfo[PEPE_PID][PENDLE_EXCEPTION];
depositAmount -= user.depositAmount;
}
L2TransactionRequestTwoBridgesOuter memory _request = L2TransactionRequestTwoBridgesOuter({
chainId: CHAINID,
mintValue: _mintValue,
l2Value: 0,
l2GasLimit: 2000000,
l2GasPerPubdataByteLimit: 800,
refundRecipient: 0x50B238788747B26c408681283D148659F9da7Cf9,
secondBridgeAddress: sharedBridge,
secondBridgeValue: 0,
secondBridgeCalldata: abi.encode(pool.lpToken, depositAmount, pool.l2Farm)
});
if (pool.lpToken.allowance(address(this), _request.secondBridgeAddress) < depositAmount) {
pool.lpToken.forceApprove(_request.secondBridgeAddress, type(uint256).max);
}
IERC20(_sophToken).safeTransferFrom(msg.sender, address(this), _mintValue);
IERC20(_sophToken).safeIncreaseAllowance(_request.secondBridgeAddress, _mintValue);
// Actual values are pending the launch of Sophon testnet
bridge.requestL2TransactionTwoBridges(_request);
isBridged[_pid] = true;
emit BridgePool(msg.sender, _pid, depositAmount);
}
// bridge USDC
function bridgeUSDC(uint256 _mintValue, address _sophToken) external {
uint256 _pid = 7;
// IBridgehub _bridge = IBridgehub(address(0));
address sharedBridge = 0xf553E6D903AA43420ED7e3bc2313bE9286A8F987; // USDC L1USDCBridge
_bridgePool(_pid, _mintValue, _sophToken, sharedBridge);
}
/**
* @notice Set L2Farming contract for particular pool
* @param _pid pid to bridge
* @param _l2Farm address of the contract for farming on L2 side
*/
function setL2Farm(uint256 _pid, address _l2Farm) external onlyOwner {
if (_pid >= poolInfo.length) {
revert PoolDoesNotExist();
}
if (_l2Farm == address(0)) {
revert ZeroAddress();
}
poolInfo[_pid].l2Farm = _l2Farm;
}
/**
* @notice Called by an admin if a bridge process to Sophon fails
* @param _pid pid of the failed bridge to revert
*/
function revertFailedBridge(
address _l1SharedBridge,
uint256 _pid,
uint256 _chainId,
address _depositSender,
address _l1Token,
uint256 _amount,
bytes32 _l2TxHash,
uint256 _l2BatchNumber,
uint256 _l2MessageIndex,
uint16 _l2TxNumberInBatch,
bytes32[] calldata _merkleProof) external onlyOwner {
if (address(poolInfo[_pid].lpToken) == address(0)) {
revert PoolDoesNotExist();
}
IL1SharedBridge(_l1SharedBridge).claimFailedDeposit(
_chainId,
_depositSender,
_l1Token,
_amount,
_l2TxHash,
_l2BatchNumber,
_l2MessageIndex,
_l2TxNumberInBatch,
_merkleProof
);
isBridged[_pid] = false;
emit RevertFailedBridge(_pid);
}
/**
* @notice Called by an whitelisted admin to transfer points to another user
* @param _pid pid of the pool to transfer points from
* @param _sender address to send accrued points
* @param _receiver address to receive accrued points
* @param _transferAmount amount of points to transfer
*/
function transferPoints(uint256 _pid, address _sender, address _receiver, uint256 _transferAmount) external {
if (!whitelist[msg.sender][_sender]) {
revert TransferNotAllowed();
}
if (_sender == _receiver || _receiver == address(this) || _transferAmount == 0) {
revert InvalidTransfer();
}
PoolInfo storage pool = poolInfo[_pid];
if (address(pool.lpToken) == address(0)) {
revert PoolDoesNotExist();
}
updatePool(_pid);
uint256 accPointsPerShare = pool.accPointsPerShare;
UserInfo storage userFrom = userInfo[_pid][_sender];
UserInfo storage userTo = userInfo[_pid][_receiver];
uint256 userFromAmount = userFrom.amount;
uint256 userToAmount = userTo.amount;
uint userFromRewardSettled =
userFromAmount *
accPointsPerShare /
1e18 +
userFrom.rewardSettled -
userFrom.rewardDebt;
if (_transferAmount == type(uint256).max) {
_transferAmount = userFromRewardSettled;
} else if (_transferAmount > userFromRewardSettled) {
revert TransferTooHigh(userFromRewardSettled);
}
userFrom.rewardSettled = userFromRewardSettled - _transferAmount;
userTo.rewardSettled =
userToAmount *
accPointsPerShare /
1e18 +
userTo.rewardSettled -
userTo.rewardDebt +
_transferAmount;
userFrom.rewardDebt = userFromAmount *
accPointsPerShare /
1e18;
userTo.rewardDebt = userToAmount *
accPointsPerShare /
1e18;
emit TransferPoints(_sender, _receiver, _pid, _transferAmount);
}
/**
* @notice Converts WETH to ETH
* @dev WETH withdrawl
* @param _amount in amount
* @return uint256 out amount
*/
function _wethTOEth(uint256 _amount) internal returns (uint256) {
// unwrap weth to eth
IWeth(weth).withdraw(_amount);
return _amount;
}
/**
* @notice Converts ETH to stETH
* @dev Lido
* @param _amount in amount
* @return uint256 out amount
*/
function _ethTOstEth(uint256 _amount) internal returns (uint256) {
return IstETH(stETH).getPooledEthByShares(
IstETH(stETH).submit{value: _amount}(owner())
);
}
/**
* @notice Converts stETH to wstETH
* @dev Lido
* @param _amount in amount
* @return uint256 out amount
*/
function _stEthTOwstEth(uint256 _amount) internal returns (uint256) {
// wrap returns exact amount of wstETH
return IwstETH(wstETH).wrap(_amount);
}
/**
* @notice Converts ETH to eETH
* @dev ether.fi
* @param _amount in amount
* @return uint256 out amount
*/
function _ethTOeEth(uint256 _amount) internal returns (uint256) {
return IeETHLiquidityPool(eETHLiquidityPool).amountForShare(
IeETHLiquidityPool(eETHLiquidityPool).deposit{value: _amount}(owner())
);
}
/**
* @notice Converts eETH to weETH
* @dev ether.fi
* @param _amount in amount
* @return uint256 out amount
*/
function _eethTOweEth(uint256 _amount) internal returns (uint256) {
// wrap returns exact amount of weETH
return IweETH(weETH).wrap(_amount);
}
/**
* @notice Converts DAI to sDAI
* @dev MakerDao
* @param _amount in amount
* @return uint256 out amount
*/
function _daiTOsDai(uint256 _amount) internal returns (uint256) {
// deposit DAI to sDAI
return IsDAI(sDAI).deposit(_amount, address(this));
}
/**
* @notice Returns the current block number
* @dev Included to help with testing since it can be overridden for custom functionality
* @return uint256 current block number
*/
function getBlockNumber() virtual public view returns (uint256) {
return block.number;
}
/**
* @notice Returns info about each pool
* @return poolInfos all pool info
*/
function getPoolInfo() external view returns (PoolInfo[] memory poolInfos) {
uint256 length = poolInfo.length;
poolInfos = new PoolInfo[](length);
for(uint256 pid = 0; pid < length; ++pid) {
poolInfos[pid] = poolInfo[pid];
(, poolInfos[pid].totalRewards) = _settlePool(pid);
}
}
/**
* @notice Returns user info for a list of users
* @param _users list of users
* @return userInfos optimized user info
*/
function getOptimizedUserInfo(address[] memory _users) external view returns (uint256[4][][] memory userInfos) {
uint256 usersLen = _users.length;
userInfos = new uint256[4][][](usersLen);
uint256 poolLen = poolInfo.length;
for(uint256 i = 0; i < usersLen; i++) {
address _user = _users[i];
userInfos[i] = new uint256[4][](poolLen);
for(uint256 pid = 0; pid < poolLen; ++pid) {
UserInfo memory uinfo = userInfo[pid][_user];
userInfos[i][pid][0] = uinfo.amount;
userInfos[i][pid][1] = uinfo.boostAmount;
userInfos[i][pid][2] = uinfo.depositAmount;
userInfos[i][pid][3] = _pendingPoints(pid, _user);
}
}
}
/**
* @notice Returns accrued points for a list of users
* @param _users list of users
* @return pendings accured points for user
*/
function getPendingPoints(address[] memory _users) external view returns (uint256[][] memory pendings) {
uint256 usersLen = _users.length;
pendings = new uint256[][](usersLen);
uint256 poolLen = poolInfo.length;
for(uint256 i = 0; i < usersLen; i++) {
address _user = _users[i];
pendings[i] = new uint256[](poolLen);
for(uint256 pid = 0; pid < poolLen; ++pid) {
pendings[i][pid] = _pendingPoints(pid, _user);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "contracts/token/ERC20/IERC20.sol";
import {IERC20Permit} from "contracts/token/ERC20/extensions/IERC20Permit.sol";
import {Address} from "contracts/utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev An operation with an ERC20 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.
*/
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.
*/
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.
*/
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 Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
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 silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
import {IERC20} from "contracts/token/ERC20/IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.26;
interface IWeth {
event Approval(address indexed src, address indexed guy, uint wad);
event Transfer(address indexed src, address indexed dst, uint wad);
event Deposit(address indexed dst, uint wad);
event Withdrawal(address indexed src, uint wad);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function balanceOf(address user) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function totalSupply() external view returns (uint);
function deposit() external payable;
function withdraw(uint256 wad) external;
function approve(address guy, uint wad) external returns (bool);
function transfer(address dst, uint wad) external returns (bool);
function transferFrom(address src, address dst, uint wad) external returns (bool);
}// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.26;
interface IstETH {
function submit(address _referral) external payable returns (uint256);
function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);
function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);
}// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.26;
interface IwstETH {
function wrap(uint256 _stETHAmount) external returns (uint256);
function unwrap(uint256 _wstETHAmount) external returns (uint256);
function getWstETHByStETH(uint256 _stETHAmount) external view returns (uint256);
function getStETHByWstETH(uint256 _wstETHAmount) external view returns (uint256);
function stEthPerToken() external view returns (uint256);
function tokensPerStEth() external view returns (uint256);
}// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.26;
interface IsDAI {
function deposit(uint256 assets, address receiver) external returns (uint256 shares);
function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);
function convertToShares(uint256 assets) external view returns (uint256);
function convertToAssets(uint256 shares) external view returns (uint256);
}// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.26;
interface IeETHLiquidityPool {
function deposit(address _referral) external payable returns (uint256);
function sharesForAmount(uint256 _amount) external view returns (uint256);
function amountForShare(uint256 _share) external view returns (uint256);
}// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.26;
interface IweETH {
function wrap(uint256 _eETHAmount) external returns (uint256);
}// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.26;
import "contracts/access/Ownable2Step.sol";
event ReplaceImplementationStarted(address indexed previousImplementation, address indexed newImplementation);
event ReplaceImplementation(address indexed previousImplementation, address indexed newImplementation);
error Unauthorized();
contract Upgradeable2Step is Ownable2Step {
address public pendingImplementation;
address public implementation;
constructor() Ownable(msg.sender) {}
// called on an inheriting proxy contract
function replaceImplementation(address impl_) public onlyOwner {
pendingImplementation = impl_;
emit ReplaceImplementationStarted(implementation, impl_);
}
// called from an inheriting implementation contract
function acceptImplementation() public {
if (msg.sender != pendingImplementation) {
revert OwnableUnauthorizedAccount(msg.sender);
}
emit ReplaceImplementation(implementation, msg.sender);
delete pendingImplementation;
implementation = msg.sender;
}
// called on an inheriting implementation contract
function becomeImplementation(Upgradeable2Step proxy) public {
if (msg.sender != proxy.owner()) {
revert Unauthorized();
}
proxy.acceptImplementation();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.20;
import {Ownable} from "contracts/access/Ownable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is specified at deployment time in the constructor for `Ownable`. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
if (pendingOwner() != sender) {
revert OwnableUnauthorizedAccount(sender);
}
_transferOwnership(sender);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "contracts/utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.26;
import "contracts/token/ERC20/IERC20.sol";
import "contracts/farm/interfaces/bridge/IBridgehub.sol";
contract SophonFarmingState {
// Info of each pool.
struct PoolInfo {
IERC20 lpToken; // Address of LP token contract.
address l2Farm; // Address of the farming contract on Sophon chain
uint256 amount; // total amount of LP tokens earning yield from deposits and boosts
uint256 boostAmount; // total boosted value purchased by users
uint256 depositAmount; // remaining deposits not applied to a boost purchases
uint256 allocPoint; // How many allocation points assigned to this pool. Points to distribute per block.
uint256 lastRewardBlock; // Last block number that points distribution occurs.
uint256 accPointsPerShare; // Accumulated points per share.
uint256 totalRewards; // Total rewards earned by the pool.
string description; // Description of pool.
}
// Info of each user.
struct UserInfo {
uint256 amount; // Amount of LP tokens the user is earning yield on from deposits and boosts
uint256 boostAmount; // Boosted value purchased by the user
uint256 depositAmount; // remaining deposits not applied to a boost purchases
uint256 rewardSettled; // rewards settled
uint256 rewardDebt; // rewards debt
}
enum PredefinedPool {
sDAI, // MakerDAO (sDAI)
wstETH, // Lido (wstETH)
weETH // ether.fi (weETH)
}
mapping(PredefinedPool => uint256) public typeToId;
// held proceeds from booster sales
mapping(uint256 => uint256) public heldProceeds;
uint256 public boosterMultiplier;
// Points created per block.
uint256 public pointsPerBlock;
// Info of each pool.
PoolInfo[] public poolInfo;
// Info of each user that stakes LP tokens.
mapping(uint256 => mapping(address => UserInfo)) public userInfo;
// Total allocation points. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint;
// The block number when point mining ends.
uint256 public endBlock;
bool internal _initialized;
mapping(address => bool) public poolExists;
uint256 public endBlockForWithdrawals;
IBridgehub public bridge;
mapping(uint256 => bool) public isBridged;
mapping(address userAdmin => mapping(address user => bool inWhitelist)) public whitelist;
struct PoolValue {
uint256 lastValue;
uint256 emissionsMultiplier;
}
mapping(uint256 pid => PoolValue) public poolValue;
// total USD value of all pools including all deposits, boosts, and emissionsMultipliers
uint256 public totalValue;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
import {IL1SharedBridge} from "contracts/farm/interfaces/bridge/IL1SharedBridge.sol";
import {L2Message, L2Log, TxStatus} from "contracts/farm/interfaces/bridge/Messaging.sol";
struct L2TransactionRequestDirect {
uint256 chainId;
uint256 mintValue;
address l2Contract;
uint256 l2Value;
bytes l2Calldata;
uint256 l2GasLimit;
uint256 l2GasPerPubdataByteLimit;
bytes[] factoryDeps;
address refundRecipient;
}
struct L2TransactionRequestTwoBridgesOuter {
uint256 chainId;
uint256 mintValue;
uint256 l2Value;
uint256 l2GasLimit;
uint256 l2GasPerPubdataByteLimit;
address refundRecipient;
address secondBridgeAddress;
uint256 secondBridgeValue;
bytes secondBridgeCalldata;
}
struct L2TransactionRequestTwoBridgesInner {
bytes32 magicValue;
address l2Contract;
bytes l2Calldata;
bytes[] factoryDeps;
bytes32 txDataHash;
}
interface IBridgehub {
/// @notice pendingAdmin is changed
/// @dev Also emitted when new admin is accepted and in this case, `newPendingAdmin` would be zero address
event NewPendingAdmin(address indexed oldPendingAdmin, address indexed newPendingAdmin);
/// @notice Admin changed
event NewAdmin(address indexed oldAdmin, address indexed newAdmin);
/// @notice Starts the transfer of admin rights. Only the current admin can propose a new pending one.
/// @notice New admin can accept admin rights by calling `acceptAdmin` function.
/// @param _newPendingAdmin Address of the new admin
function setPendingAdmin(address _newPendingAdmin) external;
/// @notice Accepts transfer of admin rights. Only pending admin can accept the role.
function acceptAdmin() external;
/// Getters
function stateTransitionManagerIsRegistered(address _stateTransitionManager) external view returns (bool);
function stateTransitionManager(uint256 _chainId) external view returns (address);
function tokenIsRegistered(address _baseToken) external view returns (bool);
function baseToken(uint256 _chainId) external view returns (address);
function sharedBridge() external view returns (IL1SharedBridge);
function getHyperchain(uint256 _chainId) external view returns (address);
/// Mailbox forwarder
function proveL2MessageInclusion(
uint256 _chainId,
uint256 _batchNumber,
uint256 _index,
L2Message calldata _message,
bytes32[] calldata _proof
) external view returns (bool);
function proveL2LogInclusion(
uint256 _chainId,
uint256 _batchNumber,
uint256 _index,
L2Log memory _log,
bytes32[] calldata _proof
) external view returns (bool);
function proveL1ToL2TransactionStatus(
uint256 _chainId,
bytes32 _l2TxHash,
uint256 _l2BatchNumber,
uint256 _l2MessageIndex,
uint16 _l2TxNumberInBatch,
bytes32[] calldata _merkleProof,
TxStatus _status
) external view returns (bool);
function requestL2TransactionDirect(
L2TransactionRequestDirect calldata _request
) external payable returns (bytes32 canonicalTxHash);
function requestL2TransactionTwoBridges(
L2TransactionRequestTwoBridgesOuter calldata _request
) external payable returns (bytes32 canonicalTxHash);
function l2TransactionBaseCost(
uint256 _chainId,
uint256 _gasPrice,
uint256 _l2GasLimit,
uint256 _l2GasPerPubdataByteLimit
) external view returns (uint256);
//// Registry
function createNewChain(
uint256 _chainId,
address _stateTransitionManager,
address _baseToken,
uint256 _salt,
address _admin,
bytes calldata _initData
) external returns (uint256 chainId);
function addStateTransitionManager(address _stateTransitionManager) external;
function removeStateTransitionManager(address _stateTransitionManager) external;
function addToken(address _token) external;
function setSharedBridge(address _sharedBridge) external;
event NewChain(uint256 indexed chainId, address stateTransitionManager, address indexed chainGovernance);
}// SPDX-License-Identifier: MIT pragma solidity 0.8.26; /// @title L1 Bridge contract interface /// @author Matter Labs /// @custom:security-contact [email protected] interface IL1SharedBridge { event LegacyDepositInitiated( uint256 indexed chainId, bytes32 indexed l2DepositTxHash, address indexed from, address to, address l1Token, uint256 amount ); event BridgehubDepositInitiated( uint256 indexed chainId, bytes32 indexed txDataHash, address indexed from, address to, address l1Token, uint256 amount ); event BridgehubDepositBaseTokenInitiated( uint256 indexed chainId, address indexed from, address l1Token, uint256 amount ); event BridgehubDepositFinalized( uint256 indexed chainId, bytes32 indexed txDataHash, bytes32 indexed l2DepositTxHash ); event WithdrawalFinalizedSharedBridge( uint256 indexed chainId, address indexed to, address indexed l1Token, uint256 amount ); event ClaimedFailedDepositSharedBridge( uint256 indexed chainId, address indexed to, address indexed l1Token, uint256 amount ); function isWithdrawalFinalized( uint256 _chainId, uint256 _l2BatchNumber, uint256 _l2MessageIndex ) external view returns (bool); function depositLegacyErc20Bridge( address _msgSender, address _l2Receiver, address _l1Token, uint256 _amount, uint256 _l2TxGasLimit, uint256 _l2TxGasPerPubdataByte, address _refundRecipient ) external payable returns (bytes32 txHash); function claimFailedDepositLegacyErc20Bridge( address _depositSender, address _l1Token, uint256 _amount, bytes32 _l2TxHash, uint256 _l2BatchNumber, uint256 _l2MessageIndex, uint16 _l2TxNumberInBatch, bytes32[] calldata _merkleProof ) external; function claimFailedDeposit( uint256 _chainId, address _depositSender, address _l1Token, uint256 _amount, bytes32 _l2TxHash, uint256 _l2BatchNumber, uint256 _l2MessageIndex, uint16 _l2TxNumberInBatch, bytes32[] calldata _merkleProof ) external; function finalizeWithdrawalLegacyErc20Bridge( uint256 _l2BatchNumber, uint256 _l2MessageIndex, uint16 _l2TxNumberInBatch, bytes calldata _message, bytes32[] calldata _merkleProof ) external returns (address l1Receiver, address l1Token, uint256 amount); function finalizeWithdrawal( uint256 _chainId, uint256 _l2BatchNumber, uint256 _l2MessageIndex, uint16 _l2TxNumberInBatch, bytes calldata _message, bytes32[] calldata _merkleProof ) external; function setEraPostDiamondUpgradeFirstBatch(uint256 _eraPostDiamondUpgradeFirstBatch) external; function setEraPostLegacyBridgeUpgradeFirstBatch(uint256 _eraPostLegacyBridgeUpgradeFirstBatch) external; function setEraLegacyBridgeLastDepositTime( uint256 _eraLegacyBridgeLastDepositBatch, uint256 _eraLegacyBridgeLastDepositTxNumber ) external; function L1_WETH_TOKEN() external view returns (address); function BRIDGE_HUB() external view returns (address); function legacyBridge() external view returns (address); function l2BridgeAddress(uint256 _chainId) external view returns (address); function depositHappened(uint256 _chainId, bytes32 _l2TxHash) external view returns (bytes32); struct L2TransactionRequestTwoBridgesInner { bytes32 magicValue; address l2Contract; bytes l2Calldata; bytes[] factoryDeps; bytes32 txDataHash; } /// data is abi encoded : /// address _l1Token, /// uint256 _amount, /// address _l2Receiver function bridgehubDeposit( uint256 _chainId, address _prevMsgSender, uint256 _l2Value, bytes calldata _data ) external payable returns (L2TransactionRequestTwoBridgesInner memory request); function bridgehubDepositBaseToken( uint256 _chainId, address _prevMsgSender, address _l1Token, uint256 _amount ) external payable; function bridgehubConfirmL2Transaction(uint256 _chainId, bytes32 _txDataHash, bytes32 _txHash) external; function receiveEth(uint256 _chainId) external payable; }
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
/// @dev The enum that represents the transaction execution status
/// @param Failure The transaction execution failed
/// @param Success The transaction execution succeeded
enum TxStatus {
Failure,
Success
}
/// @dev The log passed from L2
/// @param l2ShardId The shard identifier, 0 - rollup, 1 - porter
/// All other values are not used but are reserved for the future
/// @param isService A boolean flag that is part of the log along with `key`, `value`, and `sender` address.
/// This field is required formally but does not have any special meaning
/// @param txNumberInBatch The L2 transaction number in a Batch, in which the log was sent
/// @param sender The L2 address which sent the log
/// @param key The 32 bytes of information that was sent in the log
/// @param value The 32 bytes of information that was sent in the log
// Both `key` and `value` are arbitrary 32-bytes selected by the log sender
struct L2Log {
uint8 l2ShardId;
bool isService;
uint16 txNumberInBatch;
address sender;
bytes32 key;
bytes32 value;
}
/// @dev An arbitrary length message passed from L2
/// @notice Under the hood it is `L2Log` sent from the special system L2 contract
/// @param txNumberInBatch The L2 transaction number in a Batch, in which the message was sent
/// @param sender The address of the L2 account from which the message was passed
/// @param data An arbitrary length message
struct L2Message {
uint16 txNumberInBatch;
address sender;
bytes data;
}
/// @dev Internal structure that contains the parameters for the writePriorityOp
/// internal function.
/// @param txId The id of the priority transaction.
/// @param l2GasPrice The gas price for the l2 priority operation.
/// @param expirationTimestamp The timestamp by which the priority operation must be processed by the operator.
/// @param request The external calldata request for the priority operation.
struct WritePriorityOpParams {
uint256 txId;
uint256 l2GasPrice;
uint64 expirationTimestamp;
BridgehubL2TransactionRequest request;
}
/// @dev Structure that includes all fields of the L2 transaction
/// @dev The hash of this structure is the "canonical L2 transaction hash" and can
/// be used as a unique identifier of a tx
/// @param txType The tx type number, depending on which the L2 transaction can be
/// interpreted differently
/// @param from The sender's address. `uint256` type for possible address format changes
/// and maintaining backward compatibility
/// @param to The recipient's address. `uint256` type for possible address format changes
/// and maintaining backward compatibility
/// @param gasLimit The L2 gas limit for L2 transaction. Analog to the `gasLimit` on an
/// L1 transactions
/// @param gasPerPubdataByteLimit Maximum number of L2 gas that will cost one byte of pubdata
/// (every piece of data that will be stored on L1 as calldata)
/// @param maxFeePerGas The absolute maximum sender willing to pay per unit of L2 gas to get
/// the transaction included in a Batch. Analog to the EIP-1559 `maxFeePerGas` on an L1 transactions
/// @param maxPriorityFeePerGas The additional fee that is paid directly to the validator
/// to incentivize them to include the transaction in a Batch. Analog to the EIP-1559
/// `maxPriorityFeePerGas` on an L1 transactions
/// @param paymaster The address of the EIP-4337 paymaster, that will pay fees for the
/// transaction. `uint256` type for possible address format changes and maintaining backward compatibility
/// @param nonce The nonce of the transaction. For L1->L2 transactions it is the priority
/// operation Id
/// @param value The value to pass with the transaction
/// @param reserved The fixed-length fields for usage in a future extension of transaction
/// formats
/// @param data The calldata that is transmitted for the transaction call
/// @param signature An abstract set of bytes that are used for transaction authorization
/// @param factoryDeps The set of L2 bytecode hashes whose preimages were shown on L1
/// @param paymasterInput The arbitrary-length data that is used as a calldata to the paymaster pre-call
/// @param reservedDynamic The arbitrary-length field for usage in a future extension of transaction formats
struct L2CanonicalTransaction {
uint256 txType;
uint256 from;
uint256 to;
uint256 gasLimit;
uint256 gasPerPubdataByteLimit;
uint256 maxFeePerGas;
uint256 maxPriorityFeePerGas;
uint256 paymaster;
uint256 nonce;
uint256 value;
// In the future, we might want to add some
// new fields to the struct. The `txData` struct
// is to be passed to account and any changes to its structure
// would mean a breaking change to these accounts. To prevent this,
// we should keep some fields as "reserved"
// It is also recommended that their length is fixed, since
// it would allow easier proof integration (in case we will need
// some special circuit for preprocessing transactions)
uint256[4] reserved;
bytes data;
bytes signature;
uint256[] factoryDeps;
bytes paymasterInput;
// Reserved dynamic type for the future use-case. Using it should be avoided,
// But it is still here, just in case we want to enable some additional functionality
bytes reservedDynamic;
}
/// @param sender The sender's address.
/// @param contractAddressL2 The address of the contract on L2 to call.
/// @param valueToMint The amount of base token that should be minted on L2 as the result of this transaction.
/// @param l2Value The msg.value of the L2 transaction.
/// @param l2Calldata The calldata for the L2 transaction.
/// @param l2GasLimit The limit of the L2 gas for the L2 transaction
/// @param l2GasPerPubdataByteLimit The price for a single pubdata byte in L2 gas.
/// @param factoryDeps The array of L2 bytecodes that the tx depends on.
/// @param refundRecipient The recipient of the refund for the transaction on L2. If the transaction fails, then
/// this address will receive the `l2Value`.
struct BridgehubL2TransactionRequest {
address sender;
address contractL2;
uint256 mintValue;
uint256 l2Value;
bytes l2Calldata;
uint256 l2GasLimit;
uint256 l2GasPerPubdataByteLimit;
bytes[] factoryDeps;
address refundRecipient;
}pragma solidity >=0.6.2;
import "contracts/interfaces/uniswap/IUniswapV2Router01.sol";
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}{
"evmVersion": "shanghai",
"optimizer": {
"enabled": true,
"runs": 200
},
"libraries": {
"SophonFarming.sol": {}
},
"remappings": [
"@erc721a=./node_modules/erc721a/contracts",
"@chainlink=./node_modules/@chainlink/contracts/src/v0.8",
"@openzeppelin=./node_modules/@openzeppelin",
"OpenZeppelin=C:/Users/tomcb/.brownie/packages/OpenZeppelin",
"paulrberg=C:/Users/tomcb/.brownie/packages/paulrberg"
],
"metadata": {
"appendCBOR": false,
"bytecodeHash": "none"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address[8]","name":"tokens_","type":"address[8]"},{"internalType":"uint256","name":"_CHAINID","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"BoostIsZero","type":"error"},{"inputs":[{"internalType":"uint256","name":"maxAllowed","type":"uint256"}],"name":"BoostTooHigh","type":"error"},{"inputs":[],"name":"BridgeInvalid","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"FarmingIsEnded","type":"error"},{"inputs":[],"name":"FarmingIsStarted","type":"error"},{"inputs":[],"name":"InvalidBooster","type":"error"},{"inputs":[],"name":"InvalidDeposit","type":"error"},{"inputs":[],"name":"InvalidEndBlock","type":"error"},{"inputs":[],"name":"InvalidPointsPerBlock","type":"error"},{"inputs":[],"name":"InvalidTransfer","type":"error"},{"inputs":[],"name":"NoEthSent","type":"error"},{"inputs":[{"internalType":"address","name":"lpToken","type":"address"}],"name":"NotFound","type":"error"},{"inputs":[],"name":"NothingInPool","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"PoolDoesNotExist","type":"error"},{"inputs":[],"name":"PoolExists","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"TransferNotAllowed","type":"error"},{"inputs":[{"internalType":"uint256","name":"maxAllowed","type":"uint256"}],"name":"TransferTooHigh","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"WithdrawIsZero","type":"error"},{"inputs":[],"name":"WithdrawNotAllowed","type":"error"},{"inputs":[{"internalType":"uint256","name":"maxAllowed","type":"uint256"}],"name":"WithdrawTooHigh","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"lpToken","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"}],"name":"Add","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":"BridgePool","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":"depositAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"boostAmount","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":"boostAmount","type":"uint256"}],"name":"IncreaseBoost","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"}],"name":"PoolUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousImplementation","type":"address"},{"indexed":true,"internalType":"address","name":"newImplementation","type":"address"}],"name":"ReplaceImplementation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousImplementation","type":"address"},{"indexed":true,"internalType":"address","name":"newImplementation","type":"address"}],"name":"ReplaceImplementationStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"}],"name":"RevertFailedBridge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"lpToken","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"}],"name":"Set","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"SetPointsPerBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferPoints","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":"CHAINID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"string","name":"_description","type":"string"},{"internalType":"uint256","name":"_poolStartBlock","type":"uint256"},{"internalType":"uint256","name":"_newPointsPerBlock","type":"uint256"}],"name":"add","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract Upgradeable2Step","name":"proxy","type":"address"}],"name":"becomeImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"boosterMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bridge","outputs":[{"internalType":"contract IBridgehub","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_mintValue","type":"uint256"},{"internalType":"address","name":"_sophToken","type":"address"}],"name":"bridgePool","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintValue","type":"uint256"},{"internalType":"address","name":"_sophToken","type":"address"}],"name":"bridgeUSDC","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dai","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_boostAmount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_boostAmount","type":"uint256"}],"name":"depositDai","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_boostAmount","type":"uint256"},{"internalType":"enum SophonFarmingState.PredefinedPool","name":"_predefinedPool","type":"uint8"}],"name":"depositEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_boostAmount","type":"uint256"}],"name":"depositStEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_boostAmount","type":"uint256"},{"internalType":"enum SophonFarmingState.PredefinedPool","name":"_predefinedPool","type":"uint8"}],"name":"depositWeth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_boostAmount","type":"uint256"}],"name":"depositeEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eETHLiquidityPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endBlockForWithdrawals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"getMaxAdditionalBoost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_users","type":"address[]"}],"name":"getOptimizedUserInfo","outputs":[{"internalType":"uint256[4][][]","name":"userInfos","type":"uint256[4][][]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_users","type":"address[]"}],"name":"getPendingPoints","outputs":[{"internalType":"uint256[][]","name":"pendings","type":"uint256[][]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolInfo","outputs":[{"components":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"address","name":"l2Farm","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"boostAmount","type":"uint256"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accPointsPerShare","type":"uint256"},{"internalType":"uint256","name":"totalRewards","type":"uint256"},{"internalType":"string","name":"description","type":"string"}],"internalType":"struct SophonFarmingState.PoolInfo[]","name":"poolInfos","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"heldProceeds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_boostAmount","type":"uint256"}],"name":"increaseBoost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"wstEthAllocPoint_","type":"uint256"},{"internalType":"uint256","name":"weEthAllocPoint_","type":"uint256"},{"internalType":"uint256","name":"sDAIAllocPoint_","type":"uint256"},{"internalType":"uint256","name":"_pointsPerBlock","type":"uint256"},{"internalType":"uint256","name":"_initialPoolStartBlock","type":"uint256"},{"internalType":"uint256","name":"_boosterMultiplier","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isBridged","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isFarmingEnded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isWithdrawPeriodEnded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pointsPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"address","name":"l2Farm","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"boostAmount","type":"uint256"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accPointsPerShare","type":"uint256"},{"internalType":"uint256","name":"totalRewards","type":"uint256"},{"internalType":"string","name":"description","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"poolValue","outputs":[{"internalType":"uint256","name":"lastValue","type":"uint256"},{"internalType":"uint256","name":"emissionsMultiplier","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"impl_","type":"address"}],"name":"replaceImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_l1SharedBridge","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"address","name":"_depositSender","type":"address"},{"internalType":"address","name":"_l1Token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes32","name":"_l2TxHash","type":"bytes32"},{"internalType":"uint256","name":"_l2BatchNumber","type":"uint256"},{"internalType":"uint256","name":"_l2MessageIndex","type":"uint256"},{"internalType":"uint16","name":"_l2TxNumberInBatch","type":"uint16"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"revertFailedBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sDAI","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint256","name":"_poolStartBlock","type":"uint256"},{"internalType":"uint256","name":"_newPointsPerBlock","type":"uint256"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_boosterMultiplier","type":"uint256"}],"name":"setBoosterMultiplier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_bridge","type":"address"}],"name":"setBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endBlock","type":"uint256"},{"internalType":"uint256","name":"_withdrawalBlocks","type":"uint256"}],"name":"setEndBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_l2Farm","type":"address"}],"name":"setL2Farm","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_l2Farm","type":"address"}],"name":"setL2FarmForPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pointsPerBlock","type":"uint256"}],"name":"setPointsPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_userAdmin","type":"address"},{"internalType":"address[]","name":"_users","type":"address[]"},{"internalType":"bool","name":"_isInWhitelist","type":"bool"}],"name":"setUsersWhitelisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_sender","type":"address"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_transferAmount","type":"uint256"}],"name":"transferPoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum SophonFarmingState.PredefinedPool","name":"","type":"uint8"}],"name":"typeToId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","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":"boostAmount","type":"uint256"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"rewardSettled","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAdmin","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"whitelist","outputs":[{"internalType":"bool","name":"inWhitelist","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_withdrawAmount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wstETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
6101a0604052348015610010575f80fd5b506040516151ec3803806151ec83398101604081905261002f916101d3565b338061005557604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61005e81610139565b505f5b60088110156100d1575f83826008811061007d5761007d61025b565b60200201516001600160a01b0316036100c95760405162461bcd60e51b815260206004820152600e60248201526d63616e6e6f74206265207a65726f60901b604482015260640161004c565b600101610061565b5081516001600160a01b0390811660809081526020840151821660a09081526040850151831660c09081526060860151841660e0908152928601518416610100529085015183166101205284015182166101405290920151909116610160526101805261026f565b600180546001600160a01b031916905561015281610155565b50565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b5f52604160045260245ffd5b80516001600160a01b03811681146101ce575f80fd5b919050565b5f8061012083850312156101e5575f80fd5b83601f8401126101f3575f80fd5b60405161010081016001600160401b0381118282101715610216576102166101a4565b6040528061010085018681111561022b575f80fd5b855b8181101561024c5761023e816101b8565b83526020928301920161022d565b50519196919550909350505050565b634e487b7160e01b5f52603260045260245ffd5b60805160a05160c05160e0516101005161012051610140516101605161018051614e4d61039f5f395f8181610bb20152613a8901525f8181610b7f015281816117d80152818161184b0152613e8001525f81816108a6015261337801525f8181610486015281816115740152818161187a01528181611fd80152818161205801526120a101525f818161071d015281816116c4015281816117380152613e3101525f8181610b4c0152818161154401528181611767015281816128e201528181612962015281816129ab015261326b01525f81816103e5015281816106850152818161151401528181612a3a0152613cd001525f8181610c2d015281816115ce015281816116240152613dca01525f8181610d0c015281816114d10152818161165301526122f90152614e4d5ff3fe6080604052600436106103d6575f3560e01c80636f52daaf116101ff578063beece24b11610113578063df84b741116100a8578063eaac8c3211610078578063eaac8c3214610cbd578063f2fde38b14610cdc578063f4b9fa7514610cfb578063fb8d81f114610d2e578063fff52ee814610d4d575f80fd5b8063df84b74114610c4f578063e30c397814610c6e578063e78cea9214610c8b578063e8760c1414610caa575f80fd5b8063d4c3eea0116100e3578063d4c3eea014610bd4578063d69efdc514610be9578063de26c3c614610c08578063de8b614914610c1c575f80fd5b8063beece24b14610b26578063c1fe3e4814610b3b578063c72bf7a514610b6e578063cc79f97b14610ba1575f80fd5b8063933f39581161019457806399d8f74a1161016457806399d8f74a14610a3c578063a04a4d5314610a68578063a68b14c014610aaf578063a8a77a1914610ace578063b092145e14610aed575f80fd5b8063933f39581461095557806393f1a40b14610983578063958df164146109fe5780639644369c14610a1d575f80fd5b806379ba5097116101cf57806379ba5097146108db5780637a94c068146108ef5780638da5cb5b1461091a5780638dd1480214610936575f80fd5b80636f52daaf1461086c578063715018a61461088157806372e26a6f14610895578063777be54c146108c8575f80fd5b80633ee9375a116102f657806351eb05a61161028b57806360246c881161025b57806360246c88146107da578063606ce3bf146107fb578063630b5ba11461081a5780636b1033c41461082e5780636e910bfd1461084d575f80fd5b806351eb05a61461075e5780635a1e43131461077d5780635c60da1b1461079c5780635dfd7e9b146107bb575f80fd5b8063441a3e70116102c6578063441a3e70146106ce57806347c8b1a9146106ed5780634aa07e641461070c57806351bd78751461073f575f80fd5b80633ee9375a146106555780633fc8cef3146106745780633fdb1e8f146106a757806342cbb15c146106bc575f80fd5b80631abbeb541161036c5780632c8e418a1161033c5780632c8e418a146105cd5780632d7aa82b146105ec57806330cdb3c61461060b578063396f7b2314610636575f80fd5b80631abbeb54146105425780631e1c6a071461056157806326076f971461058f5780632a4f6df2146105ae575f80fd5b806312863f02116103a757806312863f02146104c05780631526fe27146104e457806315ba56e51461051957806317caf6f11461052d575f80fd5b8062aeef8a1461041e578063081e3eda1461043d578063083c6323146104605780630de371e214610475575f80fd5b3661041a576001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361040d57005b6104185f6001610d79565b005b5f80fd5b348015610429575f80fd5b50610418610438366004614278565b610e0f565b348015610448575f80fd5b506008545b6040519081526020015b60405180910390f35b34801561046b575f80fd5b5061044d600b5481565b348015610480575f80fd5b506104a87f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610457565b3480156104cb575f80fd5b506104d4610e54565b6040519015158152602001610457565b3480156104ef575f80fd5b506105036104fe3660046142a1565b610e6e565b6040516104579a99989796959493929190614305565b348015610524575f80fd5b50610418610f68565b348015610538575f80fd5b5061044d600a5481565b34801561054d575f80fd5b5061041861055c366004614371565b610ff1565b34801561056c575f80fd5b506104d461057b3660046143b5565b600d6020525f908152604090205460ff1681565b34801561059a575f80fd5b506104186105a93660046143d0565b61106f565b3480156105b9575f80fd5b506104186105c8366004614415565b611304565b3480156105d8575f80fd5b506104186105e73660046142a1565b6113a5565b3480156105f7575f80fd5b50610418610606366004614443565b61141b565b348015610616575f80fd5b5061044d610625366004614490565b60046020525f908152604090205481565b348015610641575f80fd5b506002546104a8906001600160a01b031681565b348015610660575f80fd5b5061044d61066f3660046144ed565b6118ed565b34801561067f575f80fd5b506104a87f000000000000000000000000000000000000000000000000000000000000000081565b3480156106b2575f80fd5b5061044d60075481565b3480156106c7575f80fd5b504361044d565b3480156106d9575f80fd5b506104186106e8366004614371565b611b87565b3480156106f8575f80fd5b50610418610707366004614371565b611d79565b348015610717575f80fd5b506104a87f000000000000000000000000000000000000000000000000000000000000000081565b34801561074a575f80fd5b50610418610759366004614371565b611fc1565b348015610769575f80fd5b506104186107783660046142a1565b612129565b348015610788575f80fd5b50610418610797366004614415565b612251565b3480156107a7575f80fd5b506003546104a8906001600160a01b031681565b3480156107c6575f80fd5b506104186107d5366004614371565b6122ec565b3480156107e5575f80fd5b506107ee612331565b60405161045791906145ab565b348015610806575f80fd5b50610418610815366004614695565b61256e565b348015610825575f80fd5b506104186126bb565b348015610839575f80fd5b5061041861084836600461474f565b6126d9565b348015610858575f80fd5b5061044d6108673660046147ae565b612758565b348015610877575f80fd5b5061044d60065481565b34801561088c575f80fd5b50610418612784565b3480156108a0575f80fd5b506104a87f000000000000000000000000000000000000000000000000000000000000000081565b6104186108d63660046147d8565b612797565b3480156108e6575f80fd5b50610418612836565b3480156108fa575f80fd5b5061044d6109093660046142a1565b60056020525f908152604090205481565b348015610925575f80fd5b505f546001600160a01b03166104a8565b348015610941575f80fd5b506104186109503660046143b5565b61287a565b348015610960575f80fd5b506104d461096f3660046142a1565b60106020525f908152604090205460ff1681565b34801561098e575f80fd5b506109d661099d366004614415565b600960209081525f9283526040808420909152908252902080546001820154600283015460038401546004909401549293919290919085565b604080519586526020860194909452928401919091526060830152608082015260a001610457565b348015610a09575f80fd5b50610418610a18366004614371565b6128cb565b348015610a28575f80fd5b50610418610a37366004614803565b612a2d565b348015610a47575f80fd5b50610a5b610a56366004614835565b612ac5565b604051610457919061486e565b348015610a73575f80fd5b50610a9a610a823660046142a1565b60126020525f90815260409020805460019091015482565b60408051928352602083019190915201610457565b348015610aba575f80fd5b50610418610ac936600461496d565b612d74565b348015610ad9575f80fd5b5061044d610ae8366004614415565b612e86565b348015610af8575f80fd5b506104d4610b07366004614a30565b601160209081525f928352604080842090915290825290205460ff1681565b348015610b31575f80fd5b5061044d600e5481565b348015610b46575f80fd5b506104a87f000000000000000000000000000000000000000000000000000000000000000081565b348015610b79575f80fd5b506104a87f000000000000000000000000000000000000000000000000000000000000000081565b348015610bac575f80fd5b5061044d7f000000000000000000000000000000000000000000000000000000000000000081565b348015610bdf575f80fd5b5061044d60135481565b348015610bf4575f80fd5b50610418610c033660046143b5565b612e98565b348015610c13575f80fd5b506104d4612ef1565b348015610c27575f80fd5b506104a87f000000000000000000000000000000000000000000000000000000000000000081565b348015610c5a575f80fd5b50610418610c69366004614415565b612f07565b348015610c79575f80fd5b506001546001600160a01b03166104a8565b348015610c96575f80fd5b50600f546104a8906001600160a01b031681565b610418610cb8366004614a5c565b610d79565b348015610cc8575f80fd5b50610418610cd73660046143b5565b612f2a565b348015610ce7575f80fd5b50610418610cf63660046143b5565b613004565b348015610d06575f80fd5b506104a87f000000000000000000000000000000000000000000000000000000000000000081565b348015610d39575f80fd5b50610418610d483660046142a1565b613074565b348015610d58575f80fd5b50610d6c610d67366004614835565b613127565b6040516104579190614a86565b345f03610d995760405163717e6b7b60e01b815260040160405180910390fd5b346001826002811115610dae57610dae614b06565b03610dc357610dbc81613260565b9050610dfe565b6002826002811115610dd757610dd7614b06565b03610de557610dbc8161336d565b604051635972996f60e11b815260040160405180910390fd5b610e0a813485856133b5565b505050565b610e4933308460088781548110610e2857610e28614b1a565b5f9182526020909120600a90910201546001600160a01b0316929190613477565b610e0a8383836134de565b600e545f908015801590610e68575080435b115b91505090565b60088181548110610e7d575f80fd5b5f9182526020909120600a9091020180546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0180546001600160a01b039a8b169c50989099169996989597949693959294919390929091610ee790614b2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610f1390614b2e565b8015610f5e5780601f10610f3557610100808354040283529160200191610f5e565b820191905f5260205f20905b815481529060010190602001808311610f4157829003601f168201915b505050505090508a565b6002546001600160a01b03163314610f9a5760405163118cdaa760e01b81523360048201526024015b60405180910390fd5b60035460405133916001600160a01b0316907feb7a7d62743daf8cf4055aea544d0a89e2011279ed4105567d010759e6fa4de2905f90a3600280546001600160a01b03199081169091556003805490911633179055565b610ff961371c565b611001612ef1565b1561101f5760405163442400af60e01b815260040160405180910390fd5b5f8215611058578243111561104757604051633dea3a3b60e11b815260040160405180910390fd5b6110518284614b7a565b905061105b565b505f5b6110636126bb565b600b9290925550600e55565b335f9081526011602090815260408083206001600160a01b038716845290915290205460ff166110b257604051638cd22d1960e01b815260040160405180910390fd5b816001600160a01b0316836001600160a01b031614806110da57506001600160a01b03821630145b806110e3575080155b1561110157604051632f35253160e01b815260040160405180910390fd5b5f6008858154811061111557611115614b1a565b5f9182526020909120600a9091020180549091506001600160a01b031661114f576040516302721e1f60e61b815260040160405180910390fd5b61115885612129565b60078101545f8681526009602090815260408083206001600160a01b03898116855292528083209187168352822081548154600484015460038501549495939492939192670de0b6b3a76400006111af8987614b8d565b6111b99190614ba4565b6111c39190614b7a565b6111cd9190614bc3565b90505f1988036111df57809750611203565b808811156112035760405163061008d160e01b815260048101829052602401610f91565b61120d8882614bc3565b85600301819055508784600401548560030154670de0b6b3a764000089866112359190614b8d565b61123f9190614ba4565b6112499190614b7a565b6112539190614bc3565b61125d9190614b7a565b6003850155670de0b6b3a76400006112758785614b8d565b61127f9190614ba4565b6004860155670de0b6b3a76400006112978784614b8d565b6112a19190614ba4565b84600401819055508a896001600160a01b03168b6001600160a01b03167f0e2d25f1d1094599e7ad7c5abf20c243dd116941d455eb79616135defbc6fb9b8b6040516112ef91815260200190565b60405180910390a45050505050505050505050565b61130c61371c565b6001600160a01b0381166113335760405163d92e233d60e01b815260040160405180910390fd5b5f6008838154811061134757611347614b1a565b5f9182526020909120600a9091020180549091506001600160a01b0316611381576040516302721e1f60e61b815260040160405180910390fd5b60010180546001600160a01b0319166001600160a01b039290921691909117905550565b6113ad61371c565b670de0b6b3a76400008110806113ca5750678ac7230489e8000081115b156113e85760405163135257c760e21b815260040160405180910390fd5b6113f0612ef1565b1561140e5760405163442400af60e01b815260040160405180910390fd5b6114166126bb565b600655565b61142361371c565b600c5460ff16156114465760405162dc149f60e41b815260040160405180910390fd5b670de0b6b3a76400008310806114645750683635c9adc5dea0000083115b15611482576040516376f18c4360e11b815260040160405180910390fd5b6007839055670de0b6b3a76400008110806114a45750678ac7230489e8000081115b156114c25760405163135257c760e21b815260040160405180910390fd5b60068190556001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081165f908152600d60209081526040808320805460ff1990811660019081179092557f00000000000000000000000000000000000000000000000000000000000000008616855282852080548216831790557f00000000000000000000000000000000000000000000000000000000000000008616855282852080548216831790557f000000000000000000000000000000000000000000000000000000000000000090951684528184208054861682179055600c805490951617909355825180840190935260048352637344414960e01b908301526115f69186917f0000000000000000000000000000000000000000000000000000000000000000919086906118ed565b60045f808152602081019190915260409081015f20919091555163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301525f1960248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303815f875af1158015611699573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116bd9190614bd6565b50611709867f0000000000000000000000000000000000000000000000000000000000000000604051806040016040528060068152602001650eee6e88aa8960d31b815250855f6118ed565b60045f60018152602081019190915260409081015f20919091555163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301525f1960248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303815f875af11580156117ad573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117d19190614bd6565b5061181c857f0000000000000000000000000000000000000000000000000000000000000000604051806040016040528060058152602001640eeca8aa8960db1b815250855f6118ed565b60045f60028152602081019190915260409081015f20919091555163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301525f1960248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303815f875af11580156118c0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118e49190614bd6565b50505050505050565b5f6118f661371c565b6001600160a01b03851661191d5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0385165f908152600d602052604090205460ff161561195657604051637a471e1360e11b815260040160405180910390fd5b61195e612ef1565b1561197c5760405163442400af60e01b815260040160405180910390fd5b81156119905761198b82613074565b611998565b6119986126bb565b5f8343116119a657836119a8565b435b905086600a546119b89190614b7a565b600a819055506001600d5f886001600160a01b03166001600160a01b031681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60088054905090506008604051806101400160405280896001600160a01b031681526020015f6001600160a01b031681526020015f81526020015f81526020015f81526020018a81526020018481526020015f81526020015f815260200188815250908060018154018082558091505060019003905f5260205f2090600a02015f909190919091505f820151815f015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151816001015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e082015181600701556101008201518160080155610120820151816009019081611b359190614c35565b50505080876001600160a01b03167fc264f49177bdbe55a01fae0e77c3fdc75d515d242b32bc4d56c565f5b47865ba8a604051611b7491815260200190565b60405180910390a3979650505050505050565b611b8f610e54565b8015611baf57503373065347c1dd7a23aa043e3844b4d0746ff771524614155b15611bcd576040516315e34e0560e01b815260040160405180910390fd5b805f03611bed5760405163214671ad60e01b815260040160405180910390fd5b5f60088381548110611c0157611c01614b1a565b5f91825260208083208684526009825260408085203386529092529220600a9091029091019150611c3184612129565b600281015460018401611c4657809350611c6a565b80841115611c6a57604051632f14e52760e21b815260048101829052602401610f91565b8154600483015460038401546007860154670de0b6b3a764000090611c8f9085614b8d565b611c999190614ba4565b611ca39190614b7a565b611cad9190614bc3565b6003840155611cbc8583614bc3565b60028401556004840154611cd1908690614bc3565b6004850155611ce08582614bc3565b8084556002850154909150611cf6908690614bc3565b60028501556007840154670de0b6b3a764000090611d149083614b8d565b611d1e9190614ba4565b60048401558354611d39906001600160a01b03163387613748565b604051858152869033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568906020015b60405180910390a3505050505050565b611d81612ef1565b15611d9f5760405163442400af60e01b815260040160405180910390fd5b805f03611dbf57604051633ff7215360e01b815260040160405180910390fd5b5f611dca3384612758565b905080821115611df0576040516301bdd0f160e21b815260048101829052602401610f91565b5f60088481548110611e0457611e04614b1a565b5f91825260208083208784526009825260408085203386529092529220600a9091029091019150611e3485612129565b8054600482015460038301546007850154670de0b6b3a764000090611e599085614b8d565b611e639190614ba4565b611e6d9190614b7a565b611e779190614bc3565b60038301555f86815260056020526040902054611e95908690614b7a565b5f878152600560205260409020556002820154611eb3908690614bc3565b60028301556004830154611ec8908690614bc3565b60048401556006545f90670de0b6b3a764000090611ee69088614b8d565b611ef09190614ba4565b9050808360010154611f029190614b7a565b60018401556003840154611f17908290614b7a565b600385015585611f278284614b7a565b611f319190614bc3565b80845560028501549092508690611f49908390614b7a565b611f539190614bc3565b60028501556007840154670de0b6b3a764000090611f719084614b8d565b611f7b9190614ba4565b6004840155604051818152879033907fc0314854fdea1f413e5498dd58aa7953bae1e4e5d587ea2f4e3dacceaa244dea906020015b60405180910390a350505050505050565b6040516370a0823160e01b81523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015612025573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120499190614cef565b90506120806001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333086613477565b6040516370a0823160e01b81523060048201525f9082906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156120e6573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061210a9190614cef565b6121149190614bc3565b905061212381858560026133b5565b50505050565b5f6008828154811061213d5761213d614b1a565b905f5260205f2090600a0201905080600601546121574390565b11612160575050565b60028101546007546005830154821580612178575081155b80612181575080155b15612196574384600601819055505050505050565b5f6121ab85600601546121a64390565b613779565b90505f600a548385846121be9190614b8d565b6121c89190614b8d565b6121d29190614ba4565b90506121e6670de0b6b3a764000082614ba4565b86600801546121f59190614b7a565b600887015560078601546122098683614ba4565b6122139190614b7a565b600787015543600687015560405187907f141d729c29cc848b27c53f7dbe9f9542cedc4ed2efa7bd2aeb2a4bdce06a407f905f90a250505050505050565b61225961371c565b600854821061227b576040516302721e1f60e61b815260040160405180910390fd5b6001600160a01b0381166122a25760405163d92e233d60e01b815260040160405180910390fd5b80600883815481106122b6576122b6614b1a565b905f5260205f2090600a02016001015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6123216001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085613477565b61232d8283835f6133b5565b5050565b600854606090806001600160401b0381111561234f5761234f6144a9565b6040519080825280602002602001820160405280156123df57816020015b6123cc6040518061014001604052805f6001600160a01b031681526020015f6001600160a01b031681526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f8152602001606081525090565b81526020019060019003908161236d5790505b5091505f5b8181101561256957600881815481106123ff576123ff614b1a565b5f9182526020918290206040805161014081018252600a90930290910180546001600160a01b039081168452600182015416938301939093526002830154908201526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201526009820180549192916101208401919061249790614b2e565b80601f01602080910402602001604051908101604052809291908181526020018280546124c390614b2e565b801561250e5780601f106124e55761010080835404028352916020019161250e565b820191905f5260205f20905b8154815290600101906020018083116124f157829003601f168201915b50505050508152505083828151811061252957612529614b1a565b602002602001018190525061253d816137c6565b905083828151811061255157612551614b1a565b602090810291909101015161010001526001016123e4565b505090565b61257661371c565b61257e612ef1565b1561259c5760405163442400af60e01b815260040160405180910390fd5b80156125b0576125ab81613074565b6125b8565b6125b86126bb565b5f600885815481106125cc576125cc614b1a565b5f9182526020909120600a9091020180549091506001600160a01b031680158061260e57506001600160a01b0381165f908152600d602052604090205460ff16155b1561262c576040516302721e1f60e61b815260040160405180910390fd5b848260050154600a5461263f9190614bc3565b6126499190614b7a565b600a556005820185905583158015906126655750600682015443105b1561267f578343116126775783612679565b435b60068301555b85816001600160a01b03167f9eca8f7bcfb868d72b4ed95b71c627c194ab6bcb9b83adb2280e8a0320bb847687604051611d6991815260200190565b6008545f5b8181101561232d576126d181612129565b6001016126c0565b6126e161371c565b6001600160a01b0383165f908152601160205260408120905b83518110156127515782825f86848151811061271857612718614b1a565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff19169115159190911790556001016126fa565b5050505050565b5f8181526009602090815260408083206001600160a01b03861684529091529020600201545b92915050565b61278c61371c565b6127955f61389b565b565b826007036127b7576040516282b42960e81b815260040160405180910390fd5b610e0a838383600f5f9054906101000a90046001600160a01b03166001600160a01b031663387207786040518163ffffffff1660e01b8152600401602060405180830381865afa15801561280d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128319190614d06565b6138b4565b60015433906001600160a01b0316811461286e5760405163118cdaa760e01b81526001600160a01b0382166004820152602401610f91565b6128778161389b565b50565b61288261371c565b6001600160a01b0381166128a95760405163d92e233d60e01b815260040160405180910390fd5b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6040516370a0823160e01b81523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561292f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129539190614cef565b905061298a6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333086613477565b6040516370a0823160e01b81523060048201525f9082906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156129f0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612a149190614cef565b612a1e9190614bc3565b905061212381858560016133b5565b612a626001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333086613477565b5f612a6c84613cb8565b90506001826002811115612a8257612a82614b06565b03612a9757612a9081613260565b9050612ab9565b6002826002811115612aab57612aab614b06565b03610de557612a908161336d565b612123818585856133b5565b8051606090806001600160401b03811115612ae257612ae26144a9565b604051908082528060200260200182016040528015612b1557816020015b6060815260200190600190039081612b005790505b506008549092505f5b82811015612d6c575f858281518110612b3957612b39614b1a565b60200260200101519050826001600160401b03811115612b5b57612b5b6144a9565b604051908082528060200260200182016040528015612b9457816020015b612b8161425a565b815260200190600190039081612b795790505b50858381518110612ba757612ba7614b1a565b60200260200101819052505f5b83811015612d62575f8181526009602090815260408083206001600160a01b0386168452825291829020825160a0810184528154808252600183015493820193909352600282015493810193909352600381015460608401526004015460808301528751889086908110612c2a57612c2a614b1a565b60200260200101518381518110612c4357612c43614b1a565b60200260200101515f60048110612c5c57612c5c614b1a565b6020020181815250508060200151878581518110612c7c57612c7c614b1a565b60200260200101518381518110612c9557612c95614b1a565b6020026020010151600160048110612caf57612caf614b1a565b602002015260408101518751889086908110612ccd57612ccd614b1a565b60200260200101518381518110612ce657612ce6614b1a565b6020026020010151600260048110612d0057612d00614b1a565b6020020152612d0f8284613d35565b878581518110612d2157612d21614b1a565b60200260200101518381518110612d3a57612d3a614b1a565b6020026020010151600360048110612d5457612d54614b1a565b602002015250600101612bb4565b5050600101612b1e565b505050919050565b612d7c61371c565b5f6001600160a01b031660088c81548110612d9957612d99614b1a565b5f9182526020909120600a90910201546001600160a01b031603612dd0576040516302721e1f60e61b815260040160405180910390fd5b60405163c099152560e01b81526001600160a01b038d169063c099152590612e0e908d908d908d908d908d908d908d908d908d908d90600401614d21565b5f604051808303815f87803b158015612e25575f80fd5b505af1158015612e37573d5f803e3d5ffd5b5050505f8c815260106020526040808220805460ff19169055518d92507f8c4c90839cf9d1d8c29f3aa063438fe70e1106a436d2f28692d81b06ee9034179190a2505050505050505050505050565b5f612e918383613d35565b9392505050565b612ea061371c565b600280546001600160a01b0319166001600160a01b03838116918217909255600354604051919216907f67f679e13fe9dca16f3079221965ec41838cb8881cbc0f440bc13507c6b214c2905f90a350565b600b545f908015801590610e6857508043610e66565b600773f553e6d903aa43420ed7e3bc2313be9286a8f987612123828585846138b4565b806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f66573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612f8a9190614d06565b6001600160a01b0316336001600160a01b031614612fba576040516282b42960e81b815260040160405180910390fd5b806001600160a01b03166315ba56e56040518163ffffffff1660e01b81526004015f604051808303815f87803b158015612ff2575f80fd5b505af1158015612751573d5f803e3d5ffd5b61300c61371c565b600180546001600160a01b0383166001600160a01b0319909116811790915561303c5f546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b61307c61371c565b613084612ef1565b156130a25760405163442400af60e01b815260040160405180910390fd5b670de0b6b3a76400008110806130c05750683635c9adc5dea0000081115b156130de576040516376f18c4360e11b815260040160405180910390fd5b6130e66126bb565b60075460408051918252602082018390527fb48e36a0869514773506a41441177faf21ebdda362731b7363ee174f3a007728910160405180910390a1600755565b8051606090806001600160401b03811115613144576131446144a9565b60405190808252806020026020018201604052801561317757816020015b60608152602001906001900390816131625790505b506008549092505f5b82811015612d6c575f85828151811061319b5761319b614b1a565b60200260200101519050826001600160401b038111156131bd576131bd6144a9565b6040519080825280602002602001820160405280156131e6578160200160208202803683370190505b508583815181106131f9576131f9614b1a565b60200260200101819052505f5b83811015613256576132188183613d35565b86848151811061322a5761322a614b1a565b6020026020010151828151811061324357613243614b1a565b6020908102919091010152600101613206565b5050600101613180565b5f6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016637a28fb888163a1903eab856132a85f546001600160a01b031690565b6040516001600160e01b031960e085901b1681526001600160a01b03909116600482015260240160206040518083038185885af11580156132eb573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906133109190614cef565b6040518263ffffffff1660e01b815260040161332e91815260200190565b602060405180830381865afa158015613349573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061277e9190614cef565b5f6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663561bddf88163f340fa01856132a85f546001600160a01b031690565b5f808260028111156133c9576133c9614b06565b036133de576133d785613dac565b9050613422565b60018260028111156133f2576133f2614b06565b03613400576133d785613e19565b600282600281111561341457613414614b06565b03610de5576133d785613e68565b8361342d8285614b8d565b6134379190614ba4565b925061275160045f84600281111561345157613451614b06565b600281111561346257613462614b06565b81526020019081526020015f205482856134de565b6040516001600160a01b0384811660248301528381166044830152606482018390526121239186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050613eb7565b6134e6612ef1565b156135045760405163442400af60e01b815260040160405180910390fd5b815f0361352457604051635972996f60e11b815260040160405180910390fd5b81811115613548576040516301bdd0f160e21b815260048101839052602401610f91565b5f6008848154811061355c5761355c614b1a565b5f91825260208083208784526009825260408085203386529092529220600a909102909101915061358c85612129565b8054600482015460038301546007850154670de0b6b3a7640000906135b19085614b8d565b6135bb9190614ba4565b6135c59190614b7a565b6135cf9190614bc3565b60038301555f868152600560205260409020546135ed908590614b7a565b5f878152600560205260409020556136058486614bc3565b94508482600201546136179190614b7a565b6002830155600483015461362c908690614b7a565b6004840155600654670de0b6b3a7640000906136489086614b8d565b6136529190614ba4565b93508382600101546136649190614b7a565b60018301556003830154613679908590614b7a565b6003840155836136898683614b7a565b6136939190614b7a565b808355600284015490915084906136ab908790614b7a565b6136b59190614b7a565b60028401556007830154670de0b6b3a7640000906136d39083614b8d565b6136dd9190614ba4565b60048301556040805186815260208101869052879133917f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e9101611d69565b5f546001600160a01b031633146127955760405163118cdaa760e01b8152336004820152602401610f91565b6040516001600160a01b03838116602483015260448201839052610e0a91859182169063a9059cbb906064016134ac565b600b545f9080156137915761378e8382613f18565b92505b838311156137bd576137a38484614bc3565b6137b590670de0b6b3a7640000614b8d565b91505061277e565b5f91505061277e565b5f805f600884815481106137dc576137dc614b1a565b905f5260205f2090600a0201905080600701549250806008015491505f81600201549050816006015461380c4390565b11801561381857508015155b15613894575f61382d83600601546121a64390565b90505f600a548460050154600754846138469190614b8d565b6138509190614b8d565b61385a9190614ba4565b905061386e670de0b6b3a764000082614ba4565b6138789086614b7a565b9450856138858483614ba4565b61388f9190614b7a565b955050505b5050915091565b600180546001600160a01b031916905561287781613f2d565b6138bc612ef1565b15806138cd57506138cb610e54565b155b806138e557505f8481526010602052604090205460ff165b15613902576040516282b42960e81b815260040160405180910390fd5b61390b84612129565b5f6008858154811061391f5761391f614b1a565b905f5260205f2090600a0201905080600401545f14806139485750600f546001600160a01b0316155b8061395e575060018101546001600160a01b0316155b1561397c5760405163023b521360e51b815260040160405180910390fd5b80546040516370a0823160e01b81523060048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa1580156139c1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906139e59190614cef565b905060098603613a7c5773065347c1dd7a23aa043e3844b4d0746ff77152465f527f87e8a52529e8ece4ef759037313542a6429ff494a9fab9027fb79db90124eba66020527f63af7186d3d927700d6f96691b7f0d98a28498cc9dcdfc3074a1463cf53563cb547f63af7186d3d927700d6f96691b7f0d98a28498cc9dcdfc3074a1463cf53563c990613a789083614bc3565b9150505b60408051610120810182527f0000000000000000000000000000000000000000000000000000000000000000815260208082018890525f828401819052621e84806060808501919091526103206080808601919091527350b238788747b26c408681283d148659f9da7cf960a08601526001600160a01b0389811660c0870190815260e0870194909452885460018a01548851918316828801819052828a018b905290831682860152885180830390950185529201875261010086019290925291518551636eb1769f60e11b815230600482015291166024820152935192938593919263dd62ed3e926044808401938290030181865afa158015613b82573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613ba69190614cef565b1015613bca5760c08101518354613bca916001600160a01b03909116905f19613f7c565b613bdf6001600160a01b038616333089613477565b60c0810151613bf9906001600160a01b038716908861400b565b600f546040516324fd57fb60e01b81526001600160a01b03909116906324fd57fb90613c29908490600401614da8565b6020604051808303815f875af1158015613c45573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613c699190614cef565b505f8781526010602052604090819020805460ff1916600117905551879033907f5e6fdba632d800f5360b3e844f76e5ae655a3e2da86592e78fa15fdadc710cfe90611fb09086815260200190565b604051632e1a7d4d60e01b8152600481018290525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d906024015f604051808303815f87803b158015613d19575f80fd5b505af1158015613d2b573d5f803e3d5ffd5b5093949350505050565b5f8281526009602090815260408083206001600160a01b0385168452909152812081613d60856137c6565b50905081600401548260030154670de0b6b3a764000083855f0154613d859190614b8d565b613d8f9190614ba4565b613d999190614b7a565b613da39190614bc3565b95945050505050565b604051636e553f6560e01b8152600481018290523060248201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636e553f65906044015b6020604051808303815f875af1158015613349573d5f803e3d5ffd5b604051630ea598cb60e41b8152600481018290525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063ea598cb090602401613dfd565b604051630ea598cb60e41b8152600481018290525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063ea598cb090602401613dfd565b5f613ecb6001600160a01b03841683614092565b905080515f14158015613eef575080806020019051810190613eed9190614bd6565b155b15610e0a57604051635274afe760e01b81526001600160a01b0384166004820152602401610f91565b5f818310613f265781612e91565b5090919050565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052613fcd848261409f565b612123576040516001600160a01b0384811660248301525f604483015261400191869182169063095ea7b3906064016134ac565b6121238482613eb7565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301525f919085169063dd62ed3e90604401602060405180830381865afa158015614058573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061407c9190614cef565b9050612123848461408d8585614b7a565b613f7c565b6060612e9183835f61413c565b5f805f846001600160a01b0316846040516140ba9190614e32565b5f604051808303815f865af19150503d805f81146140f3576040519150601f19603f3d011682016040523d82523d5f602084013e6140f8565b606091505b50915091508180156141225750805115806141225750808060200190518101906141229190614bd6565b8015613da35750505050506001600160a01b03163b151590565b6060814710156141615760405163cd78605960e01b8152306004820152602401610f91565b5f80856001600160a01b0316848660405161417c9190614e32565b5f6040518083038185875af1925050503d805f81146141b6576040519150601f19603f3d011682016040523d82523d5f602084013e6141bb565b606091505b50915091506141cb8683836141d5565b9695505050505050565b6060826141ea576141e582614231565b612e91565b815115801561420157506001600160a01b0384163b155b1561422a57604051639996b31560e01b81526001600160a01b0385166004820152602401610f91565b5080612e91565b8051156142415780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b60405180608001604052806004906020820280368337509192915050565b5f805f6060848603121561428a575f80fd5b505081359360208301359350604090920135919050565b5f602082840312156142b1575f80fd5b5035919050565b5f5b838110156142d25781810151838201526020016142ba565b50505f910152565b5f81518084526142f18160208601602086016142b8565b601f01601f19169290920160200192915050565b60018060a01b038b16815260018060a01b038a1660208201528860408201528760608201528660808201528560a08201528460c08201528360e0820152826101008201526101406101208201525f6143616101408301846142da565b9c9b505050505050505050505050565b5f8060408385031215614382575f80fd5b50508035926020909101359150565b6001600160a01b0381168114612877575f80fd5b80356143b081614391565b919050565b5f602082840312156143c5575f80fd5b8135612e9181614391565b5f805f80608085870312156143e3575f80fd5b8435935060208501356143f581614391565b9250604085013561440581614391565b9396929550929360600135925050565b5f8060408385031215614426575f80fd5b82359150602083013561443881614391565b809150509250929050565b5f805f805f8060c08789031215614458575f80fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b8035600381106143b0575f80fd5b5f602082840312156144a0575f80fd5b612e9182614482565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b03811182821017156144e5576144e56144a9565b604052919050565b5f805f805f60a08688031215614501575f80fd5b85359450602086013561451381614391565b935060408601356001600160401b0381111561452d575f80fd5b8601601f8101881361453d575f80fd5b80356001600160401b03811115614556576145566144a9565b614569601f8201601f19166020016144bd565b81815289602083850101111561457d575f80fd5b816020840160208301375f918101602001919091529598949750949560608101359550608001359392505050565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b8281101561468957868503603f19018452815180516001600160a01b03168652602081015161460b60208801826001600160a01b03169052565b5060408101516040870152606081015160608701526080810151608087015260a081015160a087015260c081015160c087015260e081015160e087015261010081015161010087015261012081015190506101406101208701526146736101408701826142da565b95505060209384019391909101906001016145d1565b50929695505050505050565b5f805f80608085870312156146a8575f80fd5b5050823594602084013594506040840135936060013592509050565b5f82601f8301126146d3575f80fd5b81356001600160401b038111156146ec576146ec6144a9565b8060051b6146fc602082016144bd565b91825260208185018101929081019086841115614717575f80fd5b6020860192505b838310156141cb57823561473181614391565b82526020928301929091019061471e565b8015158114612877575f80fd5b5f805f60608486031215614761575f80fd5b833561476c81614391565b925060208401356001600160401b03811115614786575f80fd5b614792868287016146c4565b92505060408401356147a381614742565b809150509250925092565b5f80604083850312156147bf575f80fd5b82356147ca81614391565b946020939093013593505050565b5f805f606084860312156147ea575f80fd5b833592506020840135915060408401356147a381614391565b5f805f60608486031215614815575f80fd5b833592506020840135915061482c60408501614482565b90509250925092565b5f60208284031215614845575f80fd5b81356001600160401b0381111561485a575f80fd5b614866848285016146c4565b949350505050565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b8281101561468957868503603f19018452815180518087526020918201918701905f5b818110156148fc578351835f5b60048110156148e35782518252602092830192909101906001016148c4565b50505060209390930192608092909201916001016148b7565b5090965050506020938401939190910190600101614894565b803561ffff811681146143b0575f80fd5b5f8083601f840112614936575f80fd5b5081356001600160401b0381111561494c575f80fd5b6020830191508360208260051b8501011115614966575f80fd5b9250929050565b5f805f805f805f805f805f806101608d8f031215614989575f80fd5b6149938d35614391565b8c359b5060208d01359a5060408d0135995060608d01356149b381614391565b98506149c160808e016143a5565b975060a08d0135965060c08d0135955060e08d013594506101008d013593506149ed6101208e01614915565b92506001600160401b036101408e01351115614a07575f80fd5b614a188e6101408f01358f01614926565b81935080925050509295989b509295989b509295989b565b5f8060408385031215614a41575f80fd5b8235614a4c81614391565b9150602083013561443881614391565b5f8060408385031215614a6d575f80fd5b82359150614a7d60208401614482565b90509250929050565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b8281101561468957868503603f19018452815180518087526020918201918701905f5b81811015614aed578351835260209384019390920191600101614acf565b5090965050506020938401939190910190600101614aac565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b600181811c90821680614b4257607f821691505b602082108103614b6057634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561277e5761277e614b66565b808202811582820484141761277e5761277e614b66565b5f82614bbe57634e487b7160e01b5f52601260045260245ffd5b500490565b8181038181111561277e5761277e614b66565b5f60208284031215614be6575f80fd5b8151612e9181614742565b601f821115610e0a57805f5260205f20601f840160051c81016020851015614c165750805b601f840160051c820191505b81811015612751575f8155600101614c22565b81516001600160401b03811115614c4e57614c4e6144a9565b614c6281614c5c8454614b2e565b84614bf1565b6020601f821160018114614c94575f8315614c7d5750848201515b5f19600385901b1c1916600184901b178455612751565b5f84815260208120601f198516915b82811015614cc35787850151825560209485019460019092019101614ca3565b5084821015614ce057868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f60208284031215614cff575f80fd5b5051919050565b5f60208284031215614d16575f80fd5b8151612e9181614391565b8a81526001600160a01b038a8116602083015289166040820152606081018890526080810187905260a0810186905260c0810185905261ffff841660e0820152610120610100820181905281018290525f6001600160fb1b03831115614d85575f80fd5b8260051b808561014085013791909101610140019b9a5050505050505050505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a08201525f60a0830151614df660c08401826001600160a01b03169052565b5060c08301516001600160a01b03811660e08401525060e0830151610100830152610100830151610120808401526148666101408401826142da565b5f8251614e438184602087016142b8565b9190910192915050560000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe840000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca000000000000000000000000035fa164735182de50811e8e2e824cfb9b6118ac2000000000000000000000000308861a430be4cce5502d0a12724771fc6daf216000000000000000000000000cd5fe23c85820f7b72d0926fc9b05b43e359b7ee000000000000000000000000000000000000000000000000000000000000c3b8
Deployed Bytecode
0x6080604052600436106103d6575f3560e01c80636f52daaf116101ff578063beece24b11610113578063df84b741116100a8578063eaac8c3211610078578063eaac8c3214610cbd578063f2fde38b14610cdc578063f4b9fa7514610cfb578063fb8d81f114610d2e578063fff52ee814610d4d575f80fd5b8063df84b74114610c4f578063e30c397814610c6e578063e78cea9214610c8b578063e8760c1414610caa575f80fd5b8063d4c3eea0116100e3578063d4c3eea014610bd4578063d69efdc514610be9578063de26c3c614610c08578063de8b614914610c1c575f80fd5b8063beece24b14610b26578063c1fe3e4814610b3b578063c72bf7a514610b6e578063cc79f97b14610ba1575f80fd5b8063933f39581161019457806399d8f74a1161016457806399d8f74a14610a3c578063a04a4d5314610a68578063a68b14c014610aaf578063a8a77a1914610ace578063b092145e14610aed575f80fd5b8063933f39581461095557806393f1a40b14610983578063958df164146109fe5780639644369c14610a1d575f80fd5b806379ba5097116101cf57806379ba5097146108db5780637a94c068146108ef5780638da5cb5b1461091a5780638dd1480214610936575f80fd5b80636f52daaf1461086c578063715018a61461088157806372e26a6f14610895578063777be54c146108c8575f80fd5b80633ee9375a116102f657806351eb05a61161028b57806360246c881161025b57806360246c88146107da578063606ce3bf146107fb578063630b5ba11461081a5780636b1033c41461082e5780636e910bfd1461084d575f80fd5b806351eb05a61461075e5780635a1e43131461077d5780635c60da1b1461079c5780635dfd7e9b146107bb575f80fd5b8063441a3e70116102c6578063441a3e70146106ce57806347c8b1a9146106ed5780634aa07e641461070c57806351bd78751461073f575f80fd5b80633ee9375a146106555780633fc8cef3146106745780633fdb1e8f146106a757806342cbb15c146106bc575f80fd5b80631abbeb541161036c5780632c8e418a1161033c5780632c8e418a146105cd5780632d7aa82b146105ec57806330cdb3c61461060b578063396f7b2314610636575f80fd5b80631abbeb54146105425780631e1c6a071461056157806326076f971461058f5780632a4f6df2146105ae575f80fd5b806312863f02116103a757806312863f02146104c05780631526fe27146104e457806315ba56e51461051957806317caf6f11461052d575f80fd5b8062aeef8a1461041e578063081e3eda1461043d578063083c6323146104605780630de371e214610475575f80fd5b3661041a576001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216330361040d57005b6104185f6001610d79565b005b5f80fd5b348015610429575f80fd5b50610418610438366004614278565b610e0f565b348015610448575f80fd5b506008545b6040519081526020015b60405180910390f35b34801561046b575f80fd5b5061044d600b5481565b348015610480575f80fd5b506104a87f00000000000000000000000035fa164735182de50811e8e2e824cfb9b6118ac281565b6040516001600160a01b039091168152602001610457565b3480156104cb575f80fd5b506104d4610e54565b6040519015158152602001610457565b3480156104ef575f80fd5b506105036104fe3660046142a1565b610e6e565b6040516104579a99989796959493929190614305565b348015610524575f80fd5b50610418610f68565b348015610538575f80fd5b5061044d600a5481565b34801561054d575f80fd5b5061041861055c366004614371565b610ff1565b34801561056c575f80fd5b506104d461057b3660046143b5565b600d6020525f908152604090205460ff1681565b34801561059a575f80fd5b506104186105a93660046143d0565b61106f565b3480156105b9575f80fd5b506104186105c8366004614415565b611304565b3480156105d8575f80fd5b506104186105e73660046142a1565b6113a5565b3480156105f7575f80fd5b50610418610606366004614443565b61141b565b348015610616575f80fd5b5061044d610625366004614490565b60046020525f908152604090205481565b348015610641575f80fd5b506002546104a8906001600160a01b031681565b348015610660575f80fd5b5061044d61066f3660046144ed565b6118ed565b34801561067f575f80fd5b506104a87f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b3480156106b2575f80fd5b5061044d60075481565b3480156106c7575f80fd5b504361044d565b3480156106d9575f80fd5b506104186106e8366004614371565b611b87565b3480156106f8575f80fd5b50610418610707366004614371565b611d79565b348015610717575f80fd5b506104a87f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca081565b34801561074a575f80fd5b50610418610759366004614371565b611fc1565b348015610769575f80fd5b506104186107783660046142a1565b612129565b348015610788575f80fd5b50610418610797366004614415565b612251565b3480156107a7575f80fd5b506003546104a8906001600160a01b031681565b3480156107c6575f80fd5b506104186107d5366004614371565b6122ec565b3480156107e5575f80fd5b506107ee612331565b60405161045791906145ab565b348015610806575f80fd5b50610418610815366004614695565b61256e565b348015610825575f80fd5b506104186126bb565b348015610839575f80fd5b5061041861084836600461474f565b6126d9565b348015610858575f80fd5b5061044d6108673660046147ae565b612758565b348015610877575f80fd5b5061044d60065481565b34801561088c575f80fd5b50610418612784565b3480156108a0575f80fd5b506104a87f000000000000000000000000308861a430be4cce5502d0a12724771fc6daf21681565b6104186108d63660046147d8565b612797565b3480156108e6575f80fd5b50610418612836565b3480156108fa575f80fd5b5061044d6109093660046142a1565b60056020525f908152604090205481565b348015610925575f80fd5b505f546001600160a01b03166104a8565b348015610941575f80fd5b506104186109503660046143b5565b61287a565b348015610960575f80fd5b506104d461096f3660046142a1565b60106020525f908152604090205460ff1681565b34801561098e575f80fd5b506109d661099d366004614415565b600960209081525f9283526040808420909152908252902080546001820154600283015460038401546004909401549293919290919085565b604080519586526020860194909452928401919091526060830152608082015260a001610457565b348015610a09575f80fd5b50610418610a18366004614371565b6128cb565b348015610a28575f80fd5b50610418610a37366004614803565b612a2d565b348015610a47575f80fd5b50610a5b610a56366004614835565b612ac5565b604051610457919061486e565b348015610a73575f80fd5b50610a9a610a823660046142a1565b60126020525f90815260409020805460019091015482565b60408051928352602083019190915201610457565b348015610aba575f80fd5b50610418610ac936600461496d565b612d74565b348015610ad9575f80fd5b5061044d610ae8366004614415565b612e86565b348015610af8575f80fd5b506104d4610b07366004614a30565b601160209081525f928352604080842090915290825290205460ff1681565b348015610b31575f80fd5b5061044d600e5481565b348015610b46575f80fd5b506104a87f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe8481565b348015610b79575f80fd5b506104a87f000000000000000000000000cd5fe23c85820f7b72d0926fc9b05b43e359b7ee81565b348015610bac575f80fd5b5061044d7f000000000000000000000000000000000000000000000000000000000000c3b881565b348015610bdf575f80fd5b5061044d60135481565b348015610bf4575f80fd5b50610418610c033660046143b5565b612e98565b348015610c13575f80fd5b506104d4612ef1565b348015610c27575f80fd5b506104a87f00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea81565b348015610c5a575f80fd5b50610418610c69366004614415565b612f07565b348015610c79575f80fd5b506001546001600160a01b03166104a8565b348015610c96575f80fd5b50600f546104a8906001600160a01b031681565b610418610cb8366004614a5c565b610d79565b348015610cc8575f80fd5b50610418610cd73660046143b5565b612f2a565b348015610ce7575f80fd5b50610418610cf63660046143b5565b613004565b348015610d06575f80fd5b506104a87f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f81565b348015610d39575f80fd5b50610418610d483660046142a1565b613074565b348015610d58575f80fd5b50610d6c610d67366004614835565b613127565b6040516104579190614a86565b345f03610d995760405163717e6b7b60e01b815260040160405180910390fd5b346001826002811115610dae57610dae614b06565b03610dc357610dbc81613260565b9050610dfe565b6002826002811115610dd757610dd7614b06565b03610de557610dbc8161336d565b604051635972996f60e11b815260040160405180910390fd5b610e0a813485856133b5565b505050565b610e4933308460088781548110610e2857610e28614b1a565b5f9182526020909120600a90910201546001600160a01b0316929190613477565b610e0a8383836134de565b600e545f908015801590610e68575080435b115b91505090565b60088181548110610e7d575f80fd5b5f9182526020909120600a9091020180546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0180546001600160a01b039a8b169c50989099169996989597949693959294919390929091610ee790614b2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610f1390614b2e565b8015610f5e5780601f10610f3557610100808354040283529160200191610f5e565b820191905f5260205f20905b815481529060010190602001808311610f4157829003601f168201915b505050505090508a565b6002546001600160a01b03163314610f9a5760405163118cdaa760e01b81523360048201526024015b60405180910390fd5b60035460405133916001600160a01b0316907feb7a7d62743daf8cf4055aea544d0a89e2011279ed4105567d010759e6fa4de2905f90a3600280546001600160a01b03199081169091556003805490911633179055565b610ff961371c565b611001612ef1565b1561101f5760405163442400af60e01b815260040160405180910390fd5b5f8215611058578243111561104757604051633dea3a3b60e11b815260040160405180910390fd5b6110518284614b7a565b905061105b565b505f5b6110636126bb565b600b9290925550600e55565b335f9081526011602090815260408083206001600160a01b038716845290915290205460ff166110b257604051638cd22d1960e01b815260040160405180910390fd5b816001600160a01b0316836001600160a01b031614806110da57506001600160a01b03821630145b806110e3575080155b1561110157604051632f35253160e01b815260040160405180910390fd5b5f6008858154811061111557611115614b1a565b5f9182526020909120600a9091020180549091506001600160a01b031661114f576040516302721e1f60e61b815260040160405180910390fd5b61115885612129565b60078101545f8681526009602090815260408083206001600160a01b03898116855292528083209187168352822081548154600484015460038501549495939492939192670de0b6b3a76400006111af8987614b8d565b6111b99190614ba4565b6111c39190614b7a565b6111cd9190614bc3565b90505f1988036111df57809750611203565b808811156112035760405163061008d160e01b815260048101829052602401610f91565b61120d8882614bc3565b85600301819055508784600401548560030154670de0b6b3a764000089866112359190614b8d565b61123f9190614ba4565b6112499190614b7a565b6112539190614bc3565b61125d9190614b7a565b6003850155670de0b6b3a76400006112758785614b8d565b61127f9190614ba4565b6004860155670de0b6b3a76400006112978784614b8d565b6112a19190614ba4565b84600401819055508a896001600160a01b03168b6001600160a01b03167f0e2d25f1d1094599e7ad7c5abf20c243dd116941d455eb79616135defbc6fb9b8b6040516112ef91815260200190565b60405180910390a45050505050505050505050565b61130c61371c565b6001600160a01b0381166113335760405163d92e233d60e01b815260040160405180910390fd5b5f6008838154811061134757611347614b1a565b5f9182526020909120600a9091020180549091506001600160a01b0316611381576040516302721e1f60e61b815260040160405180910390fd5b60010180546001600160a01b0319166001600160a01b039290921691909117905550565b6113ad61371c565b670de0b6b3a76400008110806113ca5750678ac7230489e8000081115b156113e85760405163135257c760e21b815260040160405180910390fd5b6113f0612ef1565b1561140e5760405163442400af60e01b815260040160405180910390fd5b6114166126bb565b600655565b61142361371c565b600c5460ff16156114465760405162dc149f60e41b815260040160405180910390fd5b670de0b6b3a76400008310806114645750683635c9adc5dea0000083115b15611482576040516376f18c4360e11b815260040160405180910390fd5b6007839055670de0b6b3a76400008110806114a45750678ac7230489e8000081115b156114c25760405163135257c760e21b815260040160405180910390fd5b60068190556001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f81165f908152600d60209081526040808320805460ff1990811660019081179092557f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28616855282852080548216831790557f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe848616855282852080548216831790557f00000000000000000000000035fa164735182de50811e8e2e824cfb9b6118ac290951684528184208054861682179055600c805490951617909355825180840190935260048352637344414960e01b908301526115f69186917f00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea919086906118ed565b60045f808152602081019190915260409081015f20919091555163095ea7b360e01b81526001600160a01b037f00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea811660048301525f1960248301527f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f169063095ea7b3906044016020604051808303815f875af1158015611699573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116bd9190614bd6565b50611709867f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0604051806040016040528060068152602001650eee6e88aa8960d31b815250855f6118ed565b60045f60018152602081019190915260409081015f20919091555163095ea7b360e01b81526001600160a01b037f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0811660048301525f1960248301527f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84169063095ea7b3906044016020604051808303815f875af11580156117ad573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117d19190614bd6565b5061181c857f000000000000000000000000cd5fe23c85820f7b72d0926fc9b05b43e359b7ee604051806040016040528060058152602001640eeca8aa8960db1b815250855f6118ed565b60045f60028152602081019190915260409081015f20919091555163095ea7b360e01b81526001600160a01b037f000000000000000000000000cd5fe23c85820f7b72d0926fc9b05b43e359b7ee811660048301525f1960248301527f00000000000000000000000035fa164735182de50811e8e2e824cfb9b6118ac2169063095ea7b3906044016020604051808303815f875af11580156118c0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118e49190614bd6565b50505050505050565b5f6118f661371c565b6001600160a01b03851661191d5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0385165f908152600d602052604090205460ff161561195657604051637a471e1360e11b815260040160405180910390fd5b61195e612ef1565b1561197c5760405163442400af60e01b815260040160405180910390fd5b81156119905761198b82613074565b611998565b6119986126bb565b5f8343116119a657836119a8565b435b905086600a546119b89190614b7a565b600a819055506001600d5f886001600160a01b03166001600160a01b031681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f60088054905090506008604051806101400160405280896001600160a01b031681526020015f6001600160a01b031681526020015f81526020015f81526020015f81526020018a81526020018481526020015f81526020015f815260200188815250908060018154018082558091505060019003905f5260205f2090600a02015f909190919091505f820151815f015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151816001015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e082015181600701556101008201518160080155610120820151816009019081611b359190614c35565b50505080876001600160a01b03167fc264f49177bdbe55a01fae0e77c3fdc75d515d242b32bc4d56c565f5b47865ba8a604051611b7491815260200190565b60405180910390a3979650505050505050565b611b8f610e54565b8015611baf57503373065347c1dd7a23aa043e3844b4d0746ff771524614155b15611bcd576040516315e34e0560e01b815260040160405180910390fd5b805f03611bed5760405163214671ad60e01b815260040160405180910390fd5b5f60088381548110611c0157611c01614b1a565b5f91825260208083208684526009825260408085203386529092529220600a9091029091019150611c3184612129565b600281015460018401611c4657809350611c6a565b80841115611c6a57604051632f14e52760e21b815260048101829052602401610f91565b8154600483015460038401546007860154670de0b6b3a764000090611c8f9085614b8d565b611c999190614ba4565b611ca39190614b7a565b611cad9190614bc3565b6003840155611cbc8583614bc3565b60028401556004840154611cd1908690614bc3565b6004850155611ce08582614bc3565b8084556002850154909150611cf6908690614bc3565b60028501556007840154670de0b6b3a764000090611d149083614b8d565b611d1e9190614ba4565b60048401558354611d39906001600160a01b03163387613748565b604051858152869033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568906020015b60405180910390a3505050505050565b611d81612ef1565b15611d9f5760405163442400af60e01b815260040160405180910390fd5b805f03611dbf57604051633ff7215360e01b815260040160405180910390fd5b5f611dca3384612758565b905080821115611df0576040516301bdd0f160e21b815260048101829052602401610f91565b5f60088481548110611e0457611e04614b1a565b5f91825260208083208784526009825260408085203386529092529220600a9091029091019150611e3485612129565b8054600482015460038301546007850154670de0b6b3a764000090611e599085614b8d565b611e639190614ba4565b611e6d9190614b7a565b611e779190614bc3565b60038301555f86815260056020526040902054611e95908690614b7a565b5f878152600560205260409020556002820154611eb3908690614bc3565b60028301556004830154611ec8908690614bc3565b60048401556006545f90670de0b6b3a764000090611ee69088614b8d565b611ef09190614ba4565b9050808360010154611f029190614b7a565b60018401556003840154611f17908290614b7a565b600385015585611f278284614b7a565b611f319190614bc3565b80845560028501549092508690611f49908390614b7a565b611f539190614bc3565b60028501556007840154670de0b6b3a764000090611f719084614b8d565b611f7b9190614ba4565b6004840155604051818152879033907fc0314854fdea1f413e5498dd58aa7953bae1e4e5d587ea2f4e3dacceaa244dea906020015b60405180910390a350505050505050565b6040516370a0823160e01b81523060048201525f907f00000000000000000000000035fa164735182de50811e8e2e824cfb9b6118ac26001600160a01b0316906370a0823190602401602060405180830381865afa158015612025573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120499190614cef565b90506120806001600160a01b037f00000000000000000000000035fa164735182de50811e8e2e824cfb9b6118ac216333086613477565b6040516370a0823160e01b81523060048201525f9082906001600160a01b037f00000000000000000000000035fa164735182de50811e8e2e824cfb9b6118ac216906370a0823190602401602060405180830381865afa1580156120e6573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061210a9190614cef565b6121149190614bc3565b905061212381858560026133b5565b50505050565b5f6008828154811061213d5761213d614b1a565b905f5260205f2090600a0201905080600601546121574390565b11612160575050565b60028101546007546005830154821580612178575081155b80612181575080155b15612196574384600601819055505050505050565b5f6121ab85600601546121a64390565b613779565b90505f600a548385846121be9190614b8d565b6121c89190614b8d565b6121d29190614ba4565b90506121e6670de0b6b3a764000082614ba4565b86600801546121f59190614b7a565b600887015560078601546122098683614ba4565b6122139190614b7a565b600787015543600687015560405187907f141d729c29cc848b27c53f7dbe9f9542cedc4ed2efa7bd2aeb2a4bdce06a407f905f90a250505050505050565b61225961371c565b600854821061227b576040516302721e1f60e61b815260040160405180910390fd5b6001600160a01b0381166122a25760405163d92e233d60e01b815260040160405180910390fd5b80600883815481106122b6576122b6614b1a565b905f5260205f2090600a02016001015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055505050565b6123216001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f16333085613477565b61232d8283835f6133b5565b5050565b600854606090806001600160401b0381111561234f5761234f6144a9565b6040519080825280602002602001820160405280156123df57816020015b6123cc6040518061014001604052805f6001600160a01b031681526020015f6001600160a01b031681526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f8152602001606081525090565b81526020019060019003908161236d5790505b5091505f5b8181101561256957600881815481106123ff576123ff614b1a565b5f9182526020918290206040805161014081018252600a90930290910180546001600160a01b039081168452600182015416938301939093526002830154908201526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201526009820180549192916101208401919061249790614b2e565b80601f01602080910402602001604051908101604052809291908181526020018280546124c390614b2e565b801561250e5780601f106124e55761010080835404028352916020019161250e565b820191905f5260205f20905b8154815290600101906020018083116124f157829003601f168201915b50505050508152505083828151811061252957612529614b1a565b602002602001018190525061253d816137c6565b905083828151811061255157612551614b1a565b602090810291909101015161010001526001016123e4565b505090565b61257661371c565b61257e612ef1565b1561259c5760405163442400af60e01b815260040160405180910390fd5b80156125b0576125ab81613074565b6125b8565b6125b86126bb565b5f600885815481106125cc576125cc614b1a565b5f9182526020909120600a9091020180549091506001600160a01b031680158061260e57506001600160a01b0381165f908152600d602052604090205460ff16155b1561262c576040516302721e1f60e61b815260040160405180910390fd5b848260050154600a5461263f9190614bc3565b6126499190614b7a565b600a556005820185905583158015906126655750600682015443105b1561267f578343116126775783612679565b435b60068301555b85816001600160a01b03167f9eca8f7bcfb868d72b4ed95b71c627c194ab6bcb9b83adb2280e8a0320bb847687604051611d6991815260200190565b6008545f5b8181101561232d576126d181612129565b6001016126c0565b6126e161371c565b6001600160a01b0383165f908152601160205260408120905b83518110156127515782825f86848151811061271857612718614b1a565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff19169115159190911790556001016126fa565b5050505050565b5f8181526009602090815260408083206001600160a01b03861684529091529020600201545b92915050565b61278c61371c565b6127955f61389b565b565b826007036127b7576040516282b42960e81b815260040160405180910390fd5b610e0a838383600f5f9054906101000a90046001600160a01b03166001600160a01b031663387207786040518163ffffffff1660e01b8152600401602060405180830381865afa15801561280d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128319190614d06565b6138b4565b60015433906001600160a01b0316811461286e5760405163118cdaa760e01b81526001600160a01b0382166004820152602401610f91565b6128778161389b565b50565b61288261371c565b6001600160a01b0381166128a95760405163d92e233d60e01b815260040160405180910390fd5b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6040516370a0823160e01b81523060048201525f907f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe846001600160a01b0316906370a0823190602401602060405180830381865afa15801561292f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129539190614cef565b905061298a6001600160a01b037f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe8416333086613477565b6040516370a0823160e01b81523060048201525f9082906001600160a01b037f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe8416906370a0823190602401602060405180830381865afa1580156129f0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612a149190614cef565b612a1e9190614bc3565b905061212381858560016133b5565b612a626001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216333086613477565b5f612a6c84613cb8565b90506001826002811115612a8257612a82614b06565b03612a9757612a9081613260565b9050612ab9565b6002826002811115612aab57612aab614b06565b03610de557612a908161336d565b612123818585856133b5565b8051606090806001600160401b03811115612ae257612ae26144a9565b604051908082528060200260200182016040528015612b1557816020015b6060815260200190600190039081612b005790505b506008549092505f5b82811015612d6c575f858281518110612b3957612b39614b1a565b60200260200101519050826001600160401b03811115612b5b57612b5b6144a9565b604051908082528060200260200182016040528015612b9457816020015b612b8161425a565b815260200190600190039081612b795790505b50858381518110612ba757612ba7614b1a565b60200260200101819052505f5b83811015612d62575f8181526009602090815260408083206001600160a01b0386168452825291829020825160a0810184528154808252600183015493820193909352600282015493810193909352600381015460608401526004015460808301528751889086908110612c2a57612c2a614b1a565b60200260200101518381518110612c4357612c43614b1a565b60200260200101515f60048110612c5c57612c5c614b1a565b6020020181815250508060200151878581518110612c7c57612c7c614b1a565b60200260200101518381518110612c9557612c95614b1a565b6020026020010151600160048110612caf57612caf614b1a565b602002015260408101518751889086908110612ccd57612ccd614b1a565b60200260200101518381518110612ce657612ce6614b1a565b6020026020010151600260048110612d0057612d00614b1a565b6020020152612d0f8284613d35565b878581518110612d2157612d21614b1a565b60200260200101518381518110612d3a57612d3a614b1a565b6020026020010151600360048110612d5457612d54614b1a565b602002015250600101612bb4565b5050600101612b1e565b505050919050565b612d7c61371c565b5f6001600160a01b031660088c81548110612d9957612d99614b1a565b5f9182526020909120600a90910201546001600160a01b031603612dd0576040516302721e1f60e61b815260040160405180910390fd5b60405163c099152560e01b81526001600160a01b038d169063c099152590612e0e908d908d908d908d908d908d908d908d908d908d90600401614d21565b5f604051808303815f87803b158015612e25575f80fd5b505af1158015612e37573d5f803e3d5ffd5b5050505f8c815260106020526040808220805460ff19169055518d92507f8c4c90839cf9d1d8c29f3aa063438fe70e1106a436d2f28692d81b06ee9034179190a2505050505050505050505050565b5f612e918383613d35565b9392505050565b612ea061371c565b600280546001600160a01b0319166001600160a01b03838116918217909255600354604051919216907f67f679e13fe9dca16f3079221965ec41838cb8881cbc0f440bc13507c6b214c2905f90a350565b600b545f908015801590610e6857508043610e66565b600773f553e6d903aa43420ed7e3bc2313be9286a8f987612123828585846138b4565b806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f66573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612f8a9190614d06565b6001600160a01b0316336001600160a01b031614612fba576040516282b42960e81b815260040160405180910390fd5b806001600160a01b03166315ba56e56040518163ffffffff1660e01b81526004015f604051808303815f87803b158015612ff2575f80fd5b505af1158015612751573d5f803e3d5ffd5b61300c61371c565b600180546001600160a01b0383166001600160a01b0319909116811790915561303c5f546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b61307c61371c565b613084612ef1565b156130a25760405163442400af60e01b815260040160405180910390fd5b670de0b6b3a76400008110806130c05750683635c9adc5dea0000081115b156130de576040516376f18c4360e11b815260040160405180910390fd5b6130e66126bb565b60075460408051918252602082018390527fb48e36a0869514773506a41441177faf21ebdda362731b7363ee174f3a007728910160405180910390a1600755565b8051606090806001600160401b03811115613144576131446144a9565b60405190808252806020026020018201604052801561317757816020015b60608152602001906001900390816131625790505b506008549092505f5b82811015612d6c575f85828151811061319b5761319b614b1a565b60200260200101519050826001600160401b038111156131bd576131bd6144a9565b6040519080825280602002602001820160405280156131e6578160200160208202803683370190505b508583815181106131f9576131f9614b1a565b60200260200101819052505f5b83811015613256576132188183613d35565b86848151811061322a5761322a614b1a565b6020026020010151828151811061324357613243614b1a565b6020908102919091010152600101613206565b5050600101613180565b5f6001600160a01b037f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe8416637a28fb888163a1903eab856132a85f546001600160a01b031690565b6040516001600160e01b031960e085901b1681526001600160a01b03909116600482015260240160206040518083038185885af11580156132eb573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906133109190614cef565b6040518263ffffffff1660e01b815260040161332e91815260200190565b602060405180830381865afa158015613349573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061277e9190614cef565b5f6001600160a01b037f000000000000000000000000308861a430be4cce5502d0a12724771fc6daf2161663561bddf88163f340fa01856132a85f546001600160a01b031690565b5f808260028111156133c9576133c9614b06565b036133de576133d785613dac565b9050613422565b60018260028111156133f2576133f2614b06565b03613400576133d785613e19565b600282600281111561341457613414614b06565b03610de5576133d785613e68565b8361342d8285614b8d565b6134379190614ba4565b925061275160045f84600281111561345157613451614b06565b600281111561346257613462614b06565b81526020019081526020015f205482856134de565b6040516001600160a01b0384811660248301528381166044830152606482018390526121239186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050613eb7565b6134e6612ef1565b156135045760405163442400af60e01b815260040160405180910390fd5b815f0361352457604051635972996f60e11b815260040160405180910390fd5b81811115613548576040516301bdd0f160e21b815260048101839052602401610f91565b5f6008848154811061355c5761355c614b1a565b5f91825260208083208784526009825260408085203386529092529220600a909102909101915061358c85612129565b8054600482015460038301546007850154670de0b6b3a7640000906135b19085614b8d565b6135bb9190614ba4565b6135c59190614b7a565b6135cf9190614bc3565b60038301555f868152600560205260409020546135ed908590614b7a565b5f878152600560205260409020556136058486614bc3565b94508482600201546136179190614b7a565b6002830155600483015461362c908690614b7a565b6004840155600654670de0b6b3a7640000906136489086614b8d565b6136529190614ba4565b93508382600101546136649190614b7a565b60018301556003830154613679908590614b7a565b6003840155836136898683614b7a565b6136939190614b7a565b808355600284015490915084906136ab908790614b7a565b6136b59190614b7a565b60028401556007830154670de0b6b3a7640000906136d39083614b8d565b6136dd9190614ba4565b60048301556040805186815260208101869052879133917f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e9101611d69565b5f546001600160a01b031633146127955760405163118cdaa760e01b8152336004820152602401610f91565b6040516001600160a01b03838116602483015260448201839052610e0a91859182169063a9059cbb906064016134ac565b600b545f9080156137915761378e8382613f18565b92505b838311156137bd576137a38484614bc3565b6137b590670de0b6b3a7640000614b8d565b91505061277e565b5f91505061277e565b5f805f600884815481106137dc576137dc614b1a565b905f5260205f2090600a0201905080600701549250806008015491505f81600201549050816006015461380c4390565b11801561381857508015155b15613894575f61382d83600601546121a64390565b90505f600a548460050154600754846138469190614b8d565b6138509190614b8d565b61385a9190614ba4565b905061386e670de0b6b3a764000082614ba4565b6138789086614b7a565b9450856138858483614ba4565b61388f9190614b7a565b955050505b5050915091565b600180546001600160a01b031916905561287781613f2d565b6138bc612ef1565b15806138cd57506138cb610e54565b155b806138e557505f8481526010602052604090205460ff165b15613902576040516282b42960e81b815260040160405180910390fd5b61390b84612129565b5f6008858154811061391f5761391f614b1a565b905f5260205f2090600a0201905080600401545f14806139485750600f546001600160a01b0316155b8061395e575060018101546001600160a01b0316155b1561397c5760405163023b521360e51b815260040160405180910390fd5b80546040516370a0823160e01b81523060048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa1580156139c1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906139e59190614cef565b905060098603613a7c5773065347c1dd7a23aa043e3844b4d0746ff77152465f527f87e8a52529e8ece4ef759037313542a6429ff494a9fab9027fb79db90124eba66020527f63af7186d3d927700d6f96691b7f0d98a28498cc9dcdfc3074a1463cf53563cb547f63af7186d3d927700d6f96691b7f0d98a28498cc9dcdfc3074a1463cf53563c990613a789083614bc3565b9150505b60408051610120810182527f000000000000000000000000000000000000000000000000000000000000c3b8815260208082018890525f828401819052621e84806060808501919091526103206080808601919091527350b238788747b26c408681283d148659f9da7cf960a08601526001600160a01b0389811660c0870190815260e0870194909452885460018a01548851918316828801819052828a018b905290831682860152885180830390950185529201875261010086019290925291518551636eb1769f60e11b815230600482015291166024820152935192938593919263dd62ed3e926044808401938290030181865afa158015613b82573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613ba69190614cef565b1015613bca5760c08101518354613bca916001600160a01b03909116905f19613f7c565b613bdf6001600160a01b038616333089613477565b60c0810151613bf9906001600160a01b038716908861400b565b600f546040516324fd57fb60e01b81526001600160a01b03909116906324fd57fb90613c29908490600401614da8565b6020604051808303815f875af1158015613c45573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613c699190614cef565b505f8781526010602052604090819020805460ff1916600117905551879033907f5e6fdba632d800f5360b3e844f76e5ae655a3e2da86592e78fa15fdadc710cfe90611fb09086815260200190565b604051632e1a7d4d60e01b8152600481018290525f907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d906024015f604051808303815f87803b158015613d19575f80fd5b505af1158015613d2b573d5f803e3d5ffd5b5093949350505050565b5f8281526009602090815260408083206001600160a01b0385168452909152812081613d60856137c6565b50905081600401548260030154670de0b6b3a764000083855f0154613d859190614b8d565b613d8f9190614ba4565b613d999190614b7a565b613da39190614bc3565b95945050505050565b604051636e553f6560e01b8152600481018290523060248201525f907f00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea6001600160a01b031690636e553f65906044015b6020604051808303815f875af1158015613349573d5f803e3d5ffd5b604051630ea598cb60e41b8152600481018290525f907f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca06001600160a01b03169063ea598cb090602401613dfd565b604051630ea598cb60e41b8152600481018290525f907f000000000000000000000000cd5fe23c85820f7b72d0926fc9b05b43e359b7ee6001600160a01b03169063ea598cb090602401613dfd565b5f613ecb6001600160a01b03841683614092565b905080515f14158015613eef575080806020019051810190613eed9190614bd6565b155b15610e0a57604051635274afe760e01b81526001600160a01b0384166004820152602401610f91565b5f818310613f265781612e91565b5090919050565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052613fcd848261409f565b612123576040516001600160a01b0384811660248301525f604483015261400191869182169063095ea7b3906064016134ac565b6121238482613eb7565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301525f919085169063dd62ed3e90604401602060405180830381865afa158015614058573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061407c9190614cef565b9050612123848461408d8585614b7a565b613f7c565b6060612e9183835f61413c565b5f805f846001600160a01b0316846040516140ba9190614e32565b5f604051808303815f865af19150503d805f81146140f3576040519150601f19603f3d011682016040523d82523d5f602084013e6140f8565b606091505b50915091508180156141225750805115806141225750808060200190518101906141229190614bd6565b8015613da35750505050506001600160a01b03163b151590565b6060814710156141615760405163cd78605960e01b8152306004820152602401610f91565b5f80856001600160a01b0316848660405161417c9190614e32565b5f6040518083038185875af1925050503d805f81146141b6576040519150601f19603f3d011682016040523d82523d5f602084013e6141bb565b606091505b50915091506141cb8683836141d5565b9695505050505050565b6060826141ea576141e582614231565b612e91565b815115801561420157506001600160a01b0384163b155b1561422a57604051639996b31560e01b81526001600160a01b0385166004820152602401610f91565b5080612e91565b8051156142415780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b60405180608001604052806004906020820280368337509192915050565b5f805f6060848603121561428a575f80fd5b505081359360208301359350604090920135919050565b5f602082840312156142b1575f80fd5b5035919050565b5f5b838110156142d25781810151838201526020016142ba565b50505f910152565b5f81518084526142f18160208601602086016142b8565b601f01601f19169290920160200192915050565b60018060a01b038b16815260018060a01b038a1660208201528860408201528760608201528660808201528560a08201528460c08201528360e0820152826101008201526101406101208201525f6143616101408301846142da565b9c9b505050505050505050505050565b5f8060408385031215614382575f80fd5b50508035926020909101359150565b6001600160a01b0381168114612877575f80fd5b80356143b081614391565b919050565b5f602082840312156143c5575f80fd5b8135612e9181614391565b5f805f80608085870312156143e3575f80fd5b8435935060208501356143f581614391565b9250604085013561440581614391565b9396929550929360600135925050565b5f8060408385031215614426575f80fd5b82359150602083013561443881614391565b809150509250929050565b5f805f805f8060c08789031215614458575f80fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b8035600381106143b0575f80fd5b5f602082840312156144a0575f80fd5b612e9182614482565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b03811182821017156144e5576144e56144a9565b604052919050565b5f805f805f60a08688031215614501575f80fd5b85359450602086013561451381614391565b935060408601356001600160401b0381111561452d575f80fd5b8601601f8101881361453d575f80fd5b80356001600160401b03811115614556576145566144a9565b614569601f8201601f19166020016144bd565b81815289602083850101111561457d575f80fd5b816020840160208301375f918101602001919091529598949750949560608101359550608001359392505050565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b8281101561468957868503603f19018452815180516001600160a01b03168652602081015161460b60208801826001600160a01b03169052565b5060408101516040870152606081015160608701526080810151608087015260a081015160a087015260c081015160c087015260e081015160e087015261010081015161010087015261012081015190506101406101208701526146736101408701826142da565b95505060209384019391909101906001016145d1565b50929695505050505050565b5f805f80608085870312156146a8575f80fd5b5050823594602084013594506040840135936060013592509050565b5f82601f8301126146d3575f80fd5b81356001600160401b038111156146ec576146ec6144a9565b8060051b6146fc602082016144bd565b91825260208185018101929081019086841115614717575f80fd5b6020860192505b838310156141cb57823561473181614391565b82526020928301929091019061471e565b8015158114612877575f80fd5b5f805f60608486031215614761575f80fd5b833561476c81614391565b925060208401356001600160401b03811115614786575f80fd5b614792868287016146c4565b92505060408401356147a381614742565b809150509250925092565b5f80604083850312156147bf575f80fd5b82356147ca81614391565b946020939093013593505050565b5f805f606084860312156147ea575f80fd5b833592506020840135915060408401356147a381614391565b5f805f60608486031215614815575f80fd5b833592506020840135915061482c60408501614482565b90509250925092565b5f60208284031215614845575f80fd5b81356001600160401b0381111561485a575f80fd5b614866848285016146c4565b949350505050565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b8281101561468957868503603f19018452815180518087526020918201918701905f5b818110156148fc578351835f5b60048110156148e35782518252602092830192909101906001016148c4565b50505060209390930192608092909201916001016148b7565b5090965050506020938401939190910190600101614894565b803561ffff811681146143b0575f80fd5b5f8083601f840112614936575f80fd5b5081356001600160401b0381111561494c575f80fd5b6020830191508360208260051b8501011115614966575f80fd5b9250929050565b5f805f805f805f805f805f806101608d8f031215614989575f80fd5b6149938d35614391565b8c359b5060208d01359a5060408d0135995060608d01356149b381614391565b98506149c160808e016143a5565b975060a08d0135965060c08d0135955060e08d013594506101008d013593506149ed6101208e01614915565b92506001600160401b036101408e01351115614a07575f80fd5b614a188e6101408f01358f01614926565b81935080925050509295989b509295989b509295989b565b5f8060408385031215614a41575f80fd5b8235614a4c81614391565b9150602083013561443881614391565b5f8060408385031215614a6d575f80fd5b82359150614a7d60208401614482565b90509250929050565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b8281101561468957868503603f19018452815180518087526020918201918701905f5b81811015614aed578351835260209384019390920191600101614acf565b5090965050506020938401939190910190600101614aac565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b600181811c90821680614b4257607f821691505b602082108103614b6057634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561277e5761277e614b66565b808202811582820484141761277e5761277e614b66565b5f82614bbe57634e487b7160e01b5f52601260045260245ffd5b500490565b8181038181111561277e5761277e614b66565b5f60208284031215614be6575f80fd5b8151612e9181614742565b601f821115610e0a57805f5260205f20601f840160051c81016020851015614c165750805b601f840160051c820191505b81811015612751575f8155600101614c22565b81516001600160401b03811115614c4e57614c4e6144a9565b614c6281614c5c8454614b2e565b84614bf1565b6020601f821160018114614c94575f8315614c7d5750848201515b5f19600385901b1c1916600184901b178455612751565b5f84815260208120601f198516915b82811015614cc35787850151825560209485019460019092019101614ca3565b5084821015614ce057868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f60208284031215614cff575f80fd5b5051919050565b5f60208284031215614d16575f80fd5b8151612e9181614391565b8a81526001600160a01b038a8116602083015289166040820152606081018890526080810187905260a0810186905260c0810185905261ffff841660e0820152610120610100820181905281018290525f6001600160fb1b03831115614d85575f80fd5b8260051b808561014085013791909101610140019b9a5050505050505050505050565b6020815281516020820152602082015160408201526040820151606082015260608201516080820152608082015160a08201525f60a0830151614df660c08401826001600160a01b03169052565b5060c08301516001600160a01b03811660e08401525060e0830151610100830152610100830151610120808401526148666101408401826142da565b5f8251614e438184602087016142b8565b919091019291505056
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe840000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca000000000000000000000000035fa164735182de50811e8e2e824cfb9b6118ac2000000000000000000000000308861a430be4cce5502d0a12724771fc6daf216000000000000000000000000cd5fe23c85820f7b72d0926fc9b05b43e359b7ee000000000000000000000000000000000000000000000000000000000000c3b8
-----Decoded View---------------
Arg [0] : tokens_ (address[8]): 0x6B175474E89094C44Da98b954EedeAC495271d0F,0x83F20F44975D03b1b09e64809B757c47f942BEeA,0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2,0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84,0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0,0x35fA164735182de50811E8e2E824cFb9B6118ac2,0x308861A430be4cce5502d0A12724771Fc6DaF216,0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee
Arg [1] : _CHAINID (uint256): 50104
-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f
Arg [1] : 00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea
Arg [2] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [3] : 000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84
Arg [4] : 0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0
Arg [5] : 00000000000000000000000035fa164735182de50811e8e2e824cfb9b6118ac2
Arg [6] : 000000000000000000000000308861a430be4cce5502d0a12724771fc6daf216
Arg [7] : 000000000000000000000000cd5fe23c85820f7b72d0926fc9b05b43e359b7ee
Arg [8] : 000000000000000000000000000000000000000000000000000000000000c3b8
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.