Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- DelegateNode
- Optimization enabled
- true
- Compiler version
- v0.8.12+commit.f00d7308
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2024-11-23T11:52:32.606266Z
contracts/eternal/DelegateNode.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import {Set} from "../libs/Set.sol";
import {DelegateNodeStorage} from "../storages/DelegateNodeStorage.sol";
import "../libs/helpers/Errors.sol";
import {IWorkerHub} from "../interfaces/IWorkerHub.sol";
contract DelegateNode is
DelegateNodeStorage,
OwnableUpgradeable,
PausableUpgradeable,
ReentrancyGuardUpgradeable
{
using Set for Set.AddressSet;
using Set for Set.Uint256Set;
uint256 private constant PERCENTAGE_DENOMINATOR = 10_000;
receive() external payable {}
function initialize(
address admin,
address poolAdmin,
address moderator
) external initializer {
__Ownable_init();
__Pausable_init();
__ReentrancyGuard_init();
_nextPoolId = 1;
_admin = admin;
_poolAdmin = poolAdmin;
_moderator = moderator;
_defaultAmountToActive = 25000 * 10 ** 18;
_defaultPoolFee = 0;
_defaultWaitBlock = 28 days;
unstakedReqId = 1;
}
modifier onlyAdmin() {
require(msg.sender == _admin, Errors.ONLY_ADMIN_ALLOWED);
_;
}
modifier onlyPoolAdmin() {
require(msg.sender == _poolAdmin, Errors.ONLY_POOL_ADMIN_ALLOWED);
_;
}
modifier onlyAdminOrModerator() {
require(
msg.sender == _admin || msg.sender == _moderator,
Errors.ONLY_POOL_ADMIN_MODERATOR_ALLOWED
);
_;
}
function pause() external onlyAdminOrModerator whenNotPaused {
_pause();
}
function unpause() external onlyAdminOrModerator whenPaused {
_unpause();
}
function changeAdmin(address newAdm) external onlyAdmin {
require(newAdm != address(0), Errors.INV_ADD);
emit AdminChanged(_admin, newAdm);
_admin = newAdm;
}
function changeModerator(address newModerator) external onlyAdmin {
require(newModerator != address(0), Errors.INV_ADD);
emit ModeratorChanged(_moderator, newModerator);
_moderator = newModerator;
}
function adminUpdateAmountToActive(
uint32 poolId,
uint256 amount
) external onlyAdminOrModerator {
require(poolId > 0 && poolId < _nextPoolId, Errors.INV_POOL_ID);
if (amount == 0) revert ZeroAmountToActiveError();
emit AmountToActiveUpdated(
msg.sender,
poolId,
_pools[poolId].amountToActive,
amount
);
_pools[poolId].amountToActive = amount;
}
function adminSetName(
uint32 poolId,
string memory name
) external onlyAdmin {
require(poolId > 0 && poolId < _nextPoolId, Errors.INV_POOL_ID);
emit PoolNameUpdated(poolId, _pools[poolId].name, name);
_pools[poolId].name = name;
}
function adminSetImage(
uint32 poolId,
string memory image
) external onlyAdmin {
require(poolId > 0 && poolId < _nextPoolId, Errors.INV_POOL_ID);
emit PoolImageUpdated(poolId, _pools[poolId].image, image);
_pools[poolId].image = image;
}
function adminChangeFeePercent(
uint32 poolId,
uint32 feePercent
) external onlyAdmin {
require(poolId > 0 && poolId < _nextPoolId, Errors.INV_POOL_ID);
emit PoolFeePercentUpdated(
poolId,
_pools[poolId].feePercent,
feePercent
);
_pools[poolId].feePercent = feePercent;
}
function addminSetWorkerhubAddress(
address _workerhubAddr
) external onlyAdmin {
require(_workerhubAddr != address(0), Errors.INV_ADD);
workerhubAddress = _workerhubAddr;
}
function adminCreatePool(uint32 amountPool) external onlyAdminOrModerator {
for (uint32 i = 0; i < amountPool; i++) {
PoolInfo storage pool = _pools[_nextPoolId];
pool.status = PoolStatus.INACTIVE;
pool.id = _nextPoolId;
pool.amountToActive = _defaultAmountToActive;
pool.stakedAmount = 0;
pool.feePercent = _defaultPoolFee;
_nextPoolId += 1;
emit CreatePool(_pools[pool.id]);
}
}
function _internalUpdateStakingInfo(
uint32 poolId,
uint256 amount
) internal virtual {
PoolInfo storage pool = _pools[poolId];
pool.stakedAmount += amount;
pool.stakedInfos.push(
StakedInfo({
user: msg.sender,
amount: amount,
blockNumber: block.number
})
);
UserPoolInfo storage userPoolInfo = _userPoolInfo[poolId][msg.sender];
if (
!userPoolInfo.isStaked &&
!stakedUsersOf[poolId].hasValue(msg.sender)
) {
userPoolInfo.isStaked = true;
pool.stakedUsersSet.push(msg.sender);
stakedUsersOf[poolId].insert(msg.sender);
}
userPoolInfo.stakedAmount += amount;
}
function _stake(uint32 _poolId, uint256 _amount) internal {
require(_amount > 0, Errors.INV_ADD);
require(_poolId > 0 && _poolId < _nextPoolId, Errors.INV_POOL_ID);
PoolInfo memory poolInfo = _pools[_poolId];
require(poolInfo.id == _poolId, Errors.INV_POOL_ID);
if (
poolInfo.status != PoolStatus.INACTIVE &&
poolInfo.status != PoolStatus.UNSTAKE_BUFFERING
) {
revert InvalidPoolStatus();
}
_userClaimUnstakedAmount(_poolId, msg.sender);
uint256 remainingStakeAmount = getRemainingStakeForActivation(_poolId);
require(_amount <= remainingStakeAmount, Errors.INV_STAKE_AMOUNT);
if (poolInfo.status == PoolStatus.INACTIVE) {
_internalUpdateStakingInfo(_poolId, _amount);
if (_amount == remainingStakeAmount) {
_pools[_poolId].status = PoolStatus.ACTIVE;
poolUnstakedInfo[_poolId].firstReqTimestamp = 0;
emit ActivePool(_pools[_poolId]);
}
} else if (poolInfo.status == PoolStatus.UNSTAKE_BUFFERING) {
if (block.timestamp > poolUnstakedInfo[_poolId].bufferTimeExpireAt)
revert UnstakeBufferExpire();
_internalUpdateStakingInfo(_poolId, _amount);
poolUnstakedInfo[_poolId].reimbursementAmount += _amount;
if (_amount == remainingStakeAmount) {
_pools[_poolId].status = PoolStatus.ADMIN_WITHDREW;
poolUnstakedInfo[_poolId].firstReqTimestamp = 0;
emit ActivePool(_pools[_poolId]);
}
}
emit Stake(msg.sender, _amount, _pools[_poolId]);
}
function stake(uint32 _poolId) public payable nonReentrant whenNotPaused {
_stake(_poolId, msg.value);
}
function stakeMultiple(
uint32[] calldata _poolIds,
uint256[] calldata _amounts
) external payable nonReentrant whenNotPaused {
require(_poolIds.length == _amounts.length, Errors.INV_ADD);
uint256 totalAmount = 0;
for (uint32 i = 0; i < _amounts.length; i++) {
totalAmount += _amounts[i];
}
require(totalAmount == msg.value, Errors.INV_ADD);
for (uint32 i = 0; i < _poolIds.length; i++) {
uint32 poolId = _poolIds[i];
uint256 amount = _amounts[i];
_stake(poolId, amount);
}
}
function updateMinerAddress(
uint32 poolId,
address minerAddress
) external onlyAdminOrModerator {
require(poolId > 0 && poolId < _nextPoolId, Errors.INV_POOL_ID);
require(minerAddress != address(0), Errors.INV_ADD);
PoolInfo storage poolInfo = _pools[poolId];
require(poolInfo.id == poolId, Errors.INV_POOL_ID);
emit MinerAddressUpdated(poolId, poolInfo.minerAddress, minerAddress);
poolInfo.minerAddress = minerAddress;
}
function safeTransferNative(address _to, uint256 _value) internal {
(bool success, ) = _to.call{value: _value}("");
if (!success) revert FailedTransfer();
}
function adminWithdrawByPoolId(
uint32 poolId,
address to
) external onlyPoolAdmin nonReentrant whenNotPaused returns (bool) {
require(poolId > 0 && poolId < _nextPoolId, Errors.INV_POOL_ID);
require(to != address(0), Errors.INV_ADD);
PoolInfo memory clonedPoolInfo = _pools[poolId];
require(
clonedPoolInfo.status == PoolStatus.ACTIVE,
Errors.INV_ADMIN_WITHDRAW
);
require(
clonedPoolInfo.stakedAmount >= clonedPoolInfo.amountToActive,
Errors.INV_ADMIN_WITHDRAW
);
uint256 staked = clonedPoolInfo.amountToActive;
_pools[poolId].stakedAmount -= staked;
_pools[poolId].status = PoolStatus.ADMIN_WITHDREW;
safeTransferNative(to, staked);
emit AdminWithdrawByPool(to, staked, clonedPoolInfo);
return true;
}
function minerReceiveReward(
uint32 poolId,
uint256 amount
) external payable whenNotPaused {
require(poolId > 0 && poolId < _nextPoolId, Errors.INV_POOL_ID);
require(amount > 0, Errors.INV_ADD);
if (amount != msg.value) revert InvalidTransferedValue();
PoolInfo memory poolInfo = _pools[poolId];
require(poolInfo.id == poolId, Errors.INV_POOL_ID);
require(poolInfo.minerAddress == msg.sender, Errors.INV_ADD);
require(
poolInfo.status == PoolStatus.ADMIN_WITHDREW ||
poolInfo.status == PoolStatus.UNSTAKE_BUFFERING,
Errors.INV_POOL_STATUS
);
uint256 feeAmount = (amount * poolInfo.feePercent) /
PERCENTAGE_DENOMINATOR;
uint256 rewardAmount = amount - feeAmount;
uint256 len = stakedUsersOf[poolId].values.length;
for (uint32 i = 0; i < len; i++) {
address userAddress = stakedUsersOf[poolId].at(i);
uint256 userStakedAmount = _userPoolInfo[poolId][userAddress]
.stakedAmount;
uint256 userReward = (userStakedAmount * rewardAmount) /
poolInfo.amountToActive;
_userPoolInfo[poolId][userAddress].rewardAmount += userReward;
_userInfo[userAddress].totalReward += userReward;
emit UserReceiveRewardFromMiner(userAddress, poolId, userReward);
}
emit MinerReceiveReward(msg.sender, poolId, amount, feeAmount);
}
function userGetRewardAmount(
uint32 poolId,
address caller
) external view returns (uint256) {
require(poolId > 0 && poolId < _nextPoolId, Errors.INV_POOL_ID);
require(caller != address(0), Errors.INV_ADD);
return _userPoolInfo[poolId][caller].rewardAmount;
}
function userClaimRewardOnPool(
uint32 poolId,
uint256 amount
) external nonReentrant whenNotPaused {
require(poolId > 0 && poolId < _nextPoolId, Errors.INV_POOL_ID);
require(
0 < amount &&
amount <= _userPoolInfo[poolId][msg.sender].rewardAmount,
Errors.INV_USER_CLAIM_REWARD_AMOUNT
);
_userPoolInfo[poolId][msg.sender].rewardAmount -= amount;
_userPoolInfo[poolId][msg.sender].claimedAmount += amount;
_userInfo[msg.sender].totalReward -= amount;
_userInfo[msg.sender].totalClaimed += amount;
safeTransferNative(msg.sender, amount);
emit UserClaimReward(msg.sender, poolId, amount);
}
function userClaimFullRewardOnPool(
uint32 poolId
) external nonReentrant whenNotPaused {
require(poolId > 0 && poolId < _nextPoolId, Errors.INV_POOL_ID);
UserPoolInfo storage userPoolInfo = _userPoolInfo[poolId][msg.sender];
uint256 amount = userPoolInfo.rewardAmount;
if (amount == 0) {
revert NoRewardToClaim();
}
userPoolInfo.rewardAmount = 0;
userPoolInfo.claimedAmount += amount;
_userInfo[msg.sender].totalReward -= amount;
_userInfo[msg.sender].totalClaimed += amount;
safeTransferNative(msg.sender, amount);
emit UserClaimReward(msg.sender, poolId, amount);
}
function getWorkerHubUnstakeDelayTime() public view returns (uint40) {
return IWorkerHub(workerhubAddress).unstakeDelayTime();
}
function isAvailableToUnstake(
uint32 _poolId,
address _caller
) public view returns (bool) {
require(_poolId > 0 && _poolId < _nextPoolId, Errors.INV_POOL_ID);
PoolStatus poolStatus = _pools[_poolId].status;
if (
poolStatus != PoolStatus.INACTIVE &&
poolStatus != PoolStatus.ADMIN_WITHDREW &&
poolStatus != PoolStatus.UNSTAKE_BUFFERING &&
poolStatus != PoolStatus.WAIT_ADMIN_RETURNED_FUND
) return false;
if (
!(userUnstakeReqIds[_poolId][_caller].isEmpty() &&
_userPoolInfo[_poolId][_caller].isStaked)
) return false;
return true;
}
function unstake(uint32 _poolId) public nonReentrant whenNotPaused {
require(_poolId > 0 && _poolId < _nextPoolId, Errors.INV_POOL_ID);
PoolStatus poolStatus = _pools[_poolId].status;
if (
poolStatus != PoolStatus.INACTIVE &&
poolStatus != PoolStatus.ADMIN_WITHDREW &&
poolStatus != PoolStatus.UNSTAKE_BUFFERING &&
poolStatus != PoolStatus.WAIT_ADMIN_RETURNED_FUND
) revert InvalidPoolStatus();
uint256 unstakeAmount = _userPoolInfo[_poolId][msg.sender].stakedAmount;
if (unstakeAmount == 0) revert ZeroStakedAmountError();
if (
userWannaUnstakeAmount[_poolId][msg.sender] == unstakeAmount ||
userWannaUnstakeAmount[_poolId][msg.sender] > 0
) revert UnstakeAlreadyCalled();
_userPoolInfo[_poolId][msg.sender].isStaked = false;
uint256 reqId = unstakedReqId++;
uint40 firstUnstakeTimestamp = uint40(
poolUnstakedInfo[_poolId].firstReqTimestamp != 0
? poolUnstakedInfo[_poolId].firstReqTimestamp
: block.timestamp
);
unstakeClaimableTime[reqId] =
firstUnstakeTimestamp +
defaultUnstakeBufferTime +
getWorkerHubUnstakeDelayTime();
unstakedReqInfo[reqId] = UnstakedReqInfo(
_poolId,
msg.sender,
unstakeAmount,
uint40(block.timestamp)
);
stakedUsersOf[_poolId].erase(msg.sender);
bool isFirstUnstake = false;
if (poolStatus == PoolStatus.INACTIVE) {
_userPoolInfo[_poolId][msg.sender].stakedAmount = 0;
userWannaUnstakeAmount[_poolId][msg.sender] = 0;
_pools[_poolId].stakedAmount -= unstakeAmount;
_userInfo[msg.sender].reserve1 += unstakeAmount;
safeTransferNative(msg.sender, unstakeAmount);
} else if (
poolStatus == PoolStatus.ADMIN_WITHDREW ||
poolStatus == PoolStatus.UNSTAKE_BUFFERING ||
poolStatus == PoolStatus.WAIT_ADMIN_RETURNED_FUND
) {
userUnstakeReqIds[_poolId][msg.sender].insert(reqId);
poolUnstakeReqIds[_poolId].insert(reqId);
userWannaUnstakeAmount[_poolId][msg.sender] += unstakeAmount;
if (poolStatus == PoolStatus.ADMIN_WITHDREW) {
_pools[_poolId].status = PoolStatus.UNSTAKE_BUFFERING;
isFirstUnstake = true;
uint40 bufferingTimeExpireAt = uint40(
block.timestamp + defaultUnstakeBufferTime
);
poolUnstakedInfo[_poolId] = PoolUnstakedInfo({
firstReqTimestamp: uint40(block.timestamp),
bufferTimeExpireAt: bufferingTimeExpireAt,
totalUnstakedAmount: poolUnstakedInfo[_poolId]
.totalUnstakedAmount + unstakeAmount,
reimbursementAmount: poolUnstakedInfo[_poolId]
.reimbursementAmount
});
} else {
poolUnstakedInfo[_poolId].totalUnstakedAmount += unstakeAmount;
}
}
emit UserUnstake(
msg.sender,
_poolId,
UserUnstakeEventInfo(
unstakeAmount,
reqId,
_pools[_poolId].status,
uint40(block.timestamp),
isFirstUnstake
)
);
}
function getRestakeableAmount(
uint32 _poolId,
address _caller
) public view returns (uint256) {
uint256 unstakedAmount = userWannaUnstakeAmount[_poolId][_caller];
uint256 remainingStakeAmount = getRemainingStakeForActivation(_poolId);
uint256 restakeableAmount = remainingStakeAmount >= unstakedAmount
? unstakedAmount
: remainingStakeAmount;
return restakeableAmount;
}
function restake(uint32 _poolId) public {
require(_poolId > 0 && _poolId < _nextPoolId, Errors.INV_POOL_ID);
if (_pools[_poolId].status != PoolStatus.UNSTAKE_BUFFERING)
revert InvalidPoolStatus();
if (block.timestamp > poolUnstakedInfo[_poolId].bufferTimeExpireAt)
revert PrematureRestake();
uint256 reqId = userUnstakeReqIds[_poolId][msg.sender].at(0);
if (unstakedReqInfo[reqId].unstaker != msg.sender)
revert("Invalid unstaker");
uint256 unstakedAmount = userWannaUnstakeAmount[_poolId][msg.sender];
if (unstakedAmount == 0) revert("Zero unstake amount");
uint256 remainingStakeAmount = getRemainingStakeForActivation(_poolId);
uint256 restakeableAmount = remainingStakeAmount >= unstakedAmount
? unstakedAmount
: remainingStakeAmount;
if (restakeableAmount == 0) revert("Zero restakeable amount");
userWannaUnstakeAmount[_poolId][msg.sender] -= restakeableAmount;
unstakedReqInfo[reqId].amount -= restakeableAmount;
poolUnstakedInfo[_poolId].totalUnstakedAmount -= restakeableAmount;
if (restakeableAmount == unstakedAmount) {
userUnstakeReqIds[_poolId][msg.sender].erase(reqId);
poolUnstakeReqIds[_poolId].erase(reqId);
}
if (!stakedUsersOf[_poolId].hasValue(msg.sender)) {
stakedUsersOf[_poolId].insert(msg.sender);
}
_userPoolInfo[_poolId][msg.sender].isStaked = true;
_userPoolInfo[_poolId][msg.sender].stakedAmount = restakeableAmount;
if (getRemainingStakeForActivation(_poolId) == 0) {
_pools[_poolId].status = PoolStatus.ADMIN_WITHDREW;
poolUnstakedInfo[_poolId].firstReqTimestamp = 0;
emit ActivePool(_pools[_poolId]);
}
emit UserRestake(
msg.sender,
_poolId,
restakeableAmount,
userWannaUnstakeAmount[_poolId][msg.sender]
);
}
function getRemainingStakeForActivation(
uint32 _poolId
) public view returns (uint256) {
if (_poolId >= _nextPoolId) revert InvalidPoolId();
uint256 amountToActive = _pools[_poolId].amountToActive;
uint256 totalUnstake = poolUnstakedInfo[_poolId].totalUnstakedAmount;
uint256 poolBalance = _pools[_poolId].stakedAmount;
if (
_pools[_poolId].status == PoolStatus.INACTIVE ||
_pools[_poolId].status == PoolStatus.ACTIVE
) {
return amountToActive - (poolBalance - totalUnstake);
} else if (
_pools[_poolId].status == PoolStatus.UNSTAKE_BUFFERING ||
_pools[_poolId].status == PoolStatus.WAIT_ADMIN_RETURNED_FUND
) {
return totalUnstake - poolBalance;
}
return 0;
}
function resolveUnstake(uint32 _poolId) public {
require(_poolId > 0 && _poolId < _nextPoolId, Errors.INV_POOL_ID);
if (block.timestamp < poolUnstakedInfo[_poolId].bufferTimeExpireAt)
revert PrematureResolveUnstake();
if (_pools[_poolId].status != PoolStatus.UNSTAKE_BUFFERING) {
emit ResolveUnstake(msg.sender, _poolId, _pools[_poolId].status);
return;
}
uint256 remainingStakeAmount = getRemainingStakeForActivation(_poolId);
if (remainingStakeAmount == 0) {
_pools[_poolId].status = PoolStatus.ADMIN_WITHDREW;
poolUnstakedInfo[_poolId].firstReqTimestamp = 0;
} else if (remainingStakeAmount > 0) {
_pools[_poolId].status = PoolStatus.WAIT_ADMIN_RETURNED_FUND;
}
emit ResolveUnstake(msg.sender, _poolId, _pools[_poolId].status);
}
function _userClaimUnstakedAmount(
uint32 _poolId,
address _userAddress
) internal {
require(_poolId > 0 && _poolId < _nextPoolId, Errors.INV_POOL_ID);
if (userUnstakeReqIds[_poolId][_userAddress].size() == 0) {
return;
}
uint256 userUnstakeReqId = userUnstakeReqIds[_poolId][_userAddress].at(
0
);
if (
poolUnstakeReqIds[_poolId].hasValue(userUnstakeReqId) &&
userUnstakeReqIds[_poolId][_userAddress].hasValue(userUnstakeReqId)
) {
poolUnstakeReqIds[_poolId].erase(userUnstakeReqId);
userUnstakeReqIds[_poolId][_userAddress].erase(userUnstakeReqId);
}
if (block.timestamp < unstakeClaimableTime[userUnstakeReqId])
revert PrematureClaimUnstake();
uint256 claimableAmount = userWannaUnstakeAmount[_poolId][_userAddress];
if (claimableAmount == 0) return;
_userPoolInfo[_poolId][_userAddress].stakedAmount -= claimableAmount;
userWannaUnstakeAmount[_poolId][_userAddress] = 0;
_pools[_poolId].stakedAmount -= claimableAmount;
_userInfo[_userAddress].reserve1 += claimableAmount;
if (poolUnstakedInfo[_poolId].totalUnstakedAmount != 0) {
poolUnstakedInfo[_poolId].totalUnstakedAmount -= claimableAmount;
}
safeTransferNative(_userAddress, claimableAmount);
emit UserClaimUnstakedAmount(_userAddress, _poolId, claimableAmount);
}
function userClaimUnstakedAmount(
uint32 _poolId,
address _userAddress
) public nonReentrant whenNotPaused {
_userClaimUnstakedAmount(_poolId, _userAddress);
}
function userClaimUnstakedAmount(
uint32 _poolId
) public nonReentrant whenNotPaused {
_userClaimUnstakedAmount(_poolId, msg.sender);
}
function minerRefundPoolBalance(
uint32 _poolId
) external payable whenNotPaused {
require(_poolId > 0 && _poolId < _nextPoolId, Errors.INV_POOL_ID);
if (_pools[_poolId].status != PoolStatus.WAIT_ADMIN_RETURNED_FUND)
revert InvalidPoolStatus();
if (
block.timestamp <
poolUnstakedInfo[_poolId].bufferTimeExpireAt +
getWorkerHubUnstakeDelayTime()
) revert PrematureMinerRefundPool();
address poolMiner = _pools[_poolId].minerAddress;
uint256 refundValue = _pools[_poolId].amountToActive;
if (msg.sender != poolMiner) revert SenderNotPoolMiner();
if (msg.value != refundValue) revert RefundedValueNotEnough();
_pools[_poolId].stakedAmount += msg.value;
_pools[_poolId].status = PoolStatus.INACTIVE;
emit MinerRefundPoolBalance(poolMiner, _poolId, refundValue);
}
function setDefaultUnstakeBufferTime(
uint40 _amountInSecond
) external onlyAdmin {
require(_amountInSecond > 0, Errors.INV_ADD);
emit DefaultUnstakeBufferTimeUpdate(
msg.sender,
defaultUnstakeBufferTime,
_amountInSecond
);
defaultUnstakeBufferTime = _amountInSecond;
}
function getUserUnstakeReqIds(
uint32 _poolId,
address _user
) public view returns (uint256[] memory) {
return userUnstakeReqIds[_poolId][_user].values;
}
function getPoolUnstakeReqIds(
uint32 _poolId
) public view returns (uint256[] memory) {
return (poolUnstakeReqIds[_poolId].values);
}
function getStakedUsersOf(
uint32 _poolId
) public view returns (address[] memory) {
return stakedUsersOf[_poolId].values;
}
}
@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}
@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal onlyInitializing {
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal onlyInitializing {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuardUpgradeable is Initializable {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
contracts/interfaces/IDelegateNode.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
interface IDelegateNode {
enum PoolStatus {
INACTIVE,
ACTIVE,
ADMIN_WITHDREW,
ADMIN_RETURNED_FUND, // DONT USE this
UNSTAKE_BUFFERING, // UNSTAKE_BUFFERING can back to ADMIN_WITHDREW or WAIT_ADMIN_RETURNED_FUND
WAIT_ADMIN_RETURNED_FUND // 21 days, after this 21 days, admin return fund to pool, and pool back to inactive, user claim unstake amount if exist in list unstake
}
struct PoolInfo {
string name;
string image;
PoolStatus status;
uint32 id;
uint256 stakedAmount; // This is the current balance of pool
uint256 amountToActive;
StakedInfo[] stakedInfos;
uint32 feePercent; // feePercent / 10_000; 0.1 <=> 10%
address minerAddress;
address[] stakedUsersSet; // TODO @kelvin update distribute reward DONT USE THIS INFO
}
struct UserPoolInfo {
bool isStaked;
uint256 stakedAmount;
uint256 rewardAmount;
uint256 claimedAmount;
}
struct StakedInfo {
address user;
uint256 amount;
uint256 blockNumber;
}
// struct UnStakedInfo {
// mapping(uint256 => uint256) caps; // claimed block => amount
// uint256[] blocks; // list keys of caps
// }
struct UserInfo {
uint256 totalReward;
uint256 totalClaimed;
uint256 reserve1; //total unstaked amount of user
}
struct UnstakedReqInfo {
uint32 poolId;
address unstaker;
uint256 amount;
uint40 requestTime;
}
struct PoolUnstakedInfo {
uint40 firstReqTimestamp;
uint40 bufferTimeExpireAt;
uint256 totalUnstakedAmount; //The total amount that user WANNA unstake
uint256 reimbursementAmount;
}
struct UserUnstakeEventInfo {
uint256 amount;
uint256 unstakeId;
PoolStatus poolStatus;
uint40 requestTime;
bool isFirstUnstake;
}
// event
event CreatePool(PoolInfo poolInfo);
event Stake(address indexed user, uint256 amount, PoolInfo poolInfo);
event ActivePool(PoolInfo poolInfo);
event DeActivePool(PoolInfo poolInfo);
event UnStake(address user, uint256 amount, uint32 poolId, uint256 claimedBlock);
event ClaimUnStake(address user, uint256 amount, uint32 poolId, uint256 claimedBlock);
event ReStakeUnStakedPool(address user, uint256 unStakedAmount, uint32 oldPoolId, uint32 newPoolId);
event AdminWithdrawByPool(address indexed to, uint256 amount, PoolInfo poolInfo);
event AdminWithdraw(address indexed to, uint256 amount);
event AdminChanged(address indexed oldAdmin, address indexed newAdmin);
event ModeratorChanged(address indexed oldModerator, address indexed newModerator);
event AmountToActiveUpdated(address indexed caller, uint32 indexed poolId, uint256 oldAmount, uint256 newAmount);
event PoolNameUpdated(uint32 indexed poolId, string oldName, string newName);
event PoolImageUpdated(uint32 indexed poolId, string oldImage, string newImage);
event PoolFeePercentUpdated(uint32 indexed poolId, uint32 oldFeePercent, uint32 newFeePercent);
event MinerAddressUpdated(uint32 indexed poolId, address oldAddress, address newAddress);
event DefaultUnstakeBufferTimeUpdate(address indexed caller, uint40 oldTime, uint40 newTime);
event UserClaimReward(address indexed caller, uint32 indexed poolId, uint256 amount);
event UserFullClaimReward(address indexed caller, uint32 indexed poolId, uint256 amount);
event MinerReceiveReward(address indexed miner, uint32 indexed poolId, uint256 amount, uint256 fee);
event UserReceiveRewardFromMiner(address indexed receiver, uint32 indexed poolId, uint256 amount);
event UserUnstake(address indexed caller, uint32 indexed poolId, UserUnstakeEventInfo eventInfo);
event ResolveUnstake(address indexed caller, uint32 indexed poolId, PoolStatus status);
event UserClaimUnstakedAmount(address indexed caller, uint32 indexed poolId, uint256 claimedAmount);
event MinerRefundPoolBalance(address indexed miner, uint32 indexed poolId, uint256 refundedValue);
event UserRestake(address indexed caller, uint32 indexed pooId, uint256 restakedAmount, uint256 remainingUnstakeAmount);
// errors
error FailedTransfer();
error InvalidPoolId();
error InvalidPoolStatus();
error InvalidTransferedValue();
error ZeroAmountToActiveError();
error NoRewardToClaim();
error ZeroStakedAmountError();
error UnstakeBufferExpire();
error UnstakeAlreadyCalled();
error PrematureResolveUnstake();
error PrematureClaimUnstake();
error ZeroClaimableUnstakedAmount();
error PrematureMinerRefundPool();
error SenderNotPoolMiner();
error RefundedValueNotEnough();
error PrematureRestake();
}
contracts/interfaces/IWorkerHub.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
interface IWorkerHub {
function unstakeDelayTime() view external returns(uint40);
}
contracts/libs/Set.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
library Set {
struct AddressSet {
address[] values;
mapping(address => uint256) positions;
}
error AddressSet_ValueNotFound(address value);
error AddressSet_DuplicatedValue(address value);
error AddressSet_IndexOutOfBounds(uint256 index);
function at(AddressSet storage _set, uint256 _index) internal view returns (address){
if (_index >= _set.values.length) revert AddressSet_IndexOutOfBounds(_index);
return _set.values[_index];
}
function insert(AddressSet storage _set, address _value) internal {
if (_set.positions[_value] != 0) revert AddressSet_DuplicatedValue(_value);
_set.values.push(_value);
_set.positions[_value] = _set.values.length;
}
function erase(AddressSet storage _set, address _value) internal {
uint256 p = _set.positions[_value];
if (p == 0) revert AddressSet_ValueNotFound(_value);
unchecked {
_set.values[p - 1] = _set.values[_set.values.length - 1];
_set.positions[_set.values[p - 1]] = p;
}
_set.values.pop();
_set.positions[_value] = 0;
}
function hasValue(AddressSet storage _set, address _value) internal view returns (bool) {
return _set.positions[_value] != 0;
}
function isEmpty(AddressSet storage _set) internal view returns (bool) {
return _set.values.length == 0;
}
function size(AddressSet storage _set) internal view returns (uint256) {
return _set.values.length;
}
struct Uint256Set {
uint256[] values;
mapping(uint256 => uint256) positions;
}
error Uint256Set_ValueNotFound(uint256 value);
error Uint256Set_DuplicatedValue(uint256 value);
error Uint256Set_IndexOutOfBounds(uint256 index);
function at(Uint256Set storage _set, uint256 _index) internal view returns (uint256){
if (_index >= _set.values.length) revert Uint256Set_IndexOutOfBounds(_index);
return _set.values[_index];
}
function insert(Uint256Set storage _set, uint256 _value) internal {
if (_set.positions[_value] != 0) revert Uint256Set_DuplicatedValue(_value);
_set.values.push(_value);
_set.positions[_value] = _set.values.length;
}
function erase(Uint256Set storage _set, uint256 _value) internal {
uint256 p = _set.positions[_value];
if (p == 0) revert Uint256Set_ValueNotFound(_value);
unchecked {
_set.values[p - 1] = _set.values[_set.values.length - 1];
_set.positions[_set.values[p - 1]] = p;
}
_set.values.pop();
_set.positions[_value] = 0;
}
function hasValue(Uint256Set storage _set, uint256 _value) internal view returns (bool) {
return _set.positions[_value] != 0;
}
function isEmpty(Uint256Set storage _set) internal view returns (bool) {
return _set.values.length == 0;
}
function size(Uint256Set storage _set) internal view returns (uint256) {
return _set.values.length;
}
}
contracts/libs/helpers/Errors.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.12;
library Errors {
enum ReturnCode {
SUCCESS,
FAILED
}
string public constant SUCCESS = "0";
address public constant ZERO_ADDR = address(0x0);
// common errors
string public constant INV_ADD = "100";
string public constant ONLY_ADMIN_ALLOWED = "101";
string public constant ONLY_CREATOR = "102";
string public constant ONLY_MODERATOR = "103";
string public constant ONLY_POOL_ADMIN_ALLOWED = "104";
string public constant ONLY_POOL_ADMIN_MODERATOR_ALLOWED = "105";
// validation error
string public constant MISSING_NAME = "200";
string public constant INV_ADD_GAME_CONTRACT = "201";
string public constant INV_GAME_ID = "202";
string public constant INV_DECOMPRESS_SCRIPT = "203";
// transfer fail
string public constant TRANSFER_FAIL = "300";
string public constant INV_POOL_ID = "400";
string public constant INV_STAKE_AMOUNT = "401";
string public constant INV_ADMIN_WITHDRAW = "402";
string public constant INV_USER_CLAIM_REWARD_AMOUNT = "403";
string public constant INV_POOL_STATUS = "404";
}
contracts/storages/DelegateNodeStorage.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import {Set} from "../libs/Set.sol";
import {IDelegateNode} from "../interfaces/IDelegateNode.sol";
abstract contract DelegateNodeStorage is IDelegateNode {
address public _admin;
address public _poolAdmin;
uint32 public _nextPoolId;
uint256 public _defaultAmountToActive; // 25000 EAI
mapping(uint32 => PoolInfo) public _pools;
uint32 public _defaultPoolFee; // 1000 => 10% (0.1)
uint256 public _defaultWaitBlock;
address public _moderator;
mapping(uint32 => mapping(address => UserPoolInfo)) public _userPoolInfo;
mapping(uint32 => Set.AddressSet) internal stakedUsersOf;
mapping(address => UserInfo) public _userInfo;
// Unstake
uint256 public unstakedReqId;
mapping(uint32 => mapping(address => uint256))
public userWannaUnstakeAmount;
mapping(uint32 => mapping(address => Set.Uint256Set))
internal userUnstakeReqIds;
mapping(uint32 => Set.Uint256Set) internal poolUnstakeReqIds;
mapping(uint256 => UnstakedReqInfo) public unstakedReqInfo;
mapping(uint32 => PoolUnstakedInfo) public poolUnstakedInfo;
uint40 public defaultUnstakeBufferTime;
address public workerhubAddress;
mapping(uint256 => uint40) public unstakeClaimableTime;
uint256[91] private __gap;
}
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","storageLayout"],"":["ast"]}},"optimizer":{"runs":200,"enabled":true},"libraries":{}}
Contract ABI
[{"type":"error","name":"AddressSet_DuplicatedValue","inputs":[{"type":"address","name":"value","internalType":"address"}]},{"type":"error","name":"AddressSet_IndexOutOfBounds","inputs":[{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"error","name":"AddressSet_ValueNotFound","inputs":[{"type":"address","name":"value","internalType":"address"}]},{"type":"error","name":"FailedTransfer","inputs":[]},{"type":"error","name":"InvalidPoolId","inputs":[]},{"type":"error","name":"InvalidPoolStatus","inputs":[]},{"type":"error","name":"InvalidTransferedValue","inputs":[]},{"type":"error","name":"NoRewardToClaim","inputs":[]},{"type":"error","name":"PrematureClaimUnstake","inputs":[]},{"type":"error","name":"PrematureMinerRefundPool","inputs":[]},{"type":"error","name":"PrematureResolveUnstake","inputs":[]},{"type":"error","name":"PrematureRestake","inputs":[]},{"type":"error","name":"RefundedValueNotEnough","inputs":[]},{"type":"error","name":"SenderNotPoolMiner","inputs":[]},{"type":"error","name":"Uint256Set_DuplicatedValue","inputs":[{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"error","name":"Uint256Set_IndexOutOfBounds","inputs":[{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"error","name":"Uint256Set_ValueNotFound","inputs":[{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"error","name":"UnstakeAlreadyCalled","inputs":[]},{"type":"error","name":"UnstakeBufferExpire","inputs":[]},{"type":"error","name":"ZeroAmountToActiveError","inputs":[]},{"type":"error","name":"ZeroClaimableUnstakedAmount","inputs":[]},{"type":"error","name":"ZeroStakedAmountError","inputs":[]},{"type":"event","name":"ActivePool","inputs":[{"type":"tuple","name":"poolInfo","internalType":"struct IDelegateNode.PoolInfo","indexed":false,"components":[{"type":"string","name":"name","internalType":"string"},{"type":"string","name":"image","internalType":"string"},{"type":"uint8","name":"status","internalType":"enum IDelegateNode.PoolStatus"},{"type":"uint32","name":"id","internalType":"uint32"},{"type":"uint256","name":"stakedAmount","internalType":"uint256"},{"type":"uint256","name":"amountToActive","internalType":"uint256"},{"type":"tuple[]","name":"stakedInfos","internalType":"struct IDelegateNode.StakedInfo[]","components":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"blockNumber","internalType":"uint256"}]},{"type":"uint32","name":"feePercent","internalType":"uint32"},{"type":"address","name":"minerAddress","internalType":"address"},{"type":"address[]","name":"stakedUsersSet","internalType":"address[]"}]}],"anonymous":false},{"type":"event","name":"AdminChanged","inputs":[{"type":"address","name":"oldAdmin","internalType":"address","indexed":true},{"type":"address","name":"newAdmin","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"AdminWithdraw","inputs":[{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"AdminWithdrawByPool","inputs":[{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"tuple","name":"poolInfo","internalType":"struct IDelegateNode.PoolInfo","indexed":false,"components":[{"type":"string","name":"name","internalType":"string"},{"type":"string","name":"image","internalType":"string"},{"type":"uint8","name":"status","internalType":"enum IDelegateNode.PoolStatus"},{"type":"uint32","name":"id","internalType":"uint32"},{"type":"uint256","name":"stakedAmount","internalType":"uint256"},{"type":"uint256","name":"amountToActive","internalType":"uint256"},{"type":"tuple[]","name":"stakedInfos","internalType":"struct IDelegateNode.StakedInfo[]","components":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"blockNumber","internalType":"uint256"}]},{"type":"uint32","name":"feePercent","internalType":"uint32"},{"type":"address","name":"minerAddress","internalType":"address"},{"type":"address[]","name":"stakedUsersSet","internalType":"address[]"}]}],"anonymous":false},{"type":"event","name":"AmountToActiveUpdated","inputs":[{"type":"address","name":"caller","internalType":"address","indexed":true},{"type":"uint32","name":"poolId","internalType":"uint32","indexed":true},{"type":"uint256","name":"oldAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"newAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"ClaimUnStake","inputs":[{"type":"address","name":"user","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint32","name":"poolId","internalType":"uint32","indexed":false},{"type":"uint256","name":"claimedBlock","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"CreatePool","inputs":[{"type":"tuple","name":"poolInfo","internalType":"struct IDelegateNode.PoolInfo","indexed":false,"components":[{"type":"string","name":"name","internalType":"string"},{"type":"string","name":"image","internalType":"string"},{"type":"uint8","name":"status","internalType":"enum IDelegateNode.PoolStatus"},{"type":"uint32","name":"id","internalType":"uint32"},{"type":"uint256","name":"stakedAmount","internalType":"uint256"},{"type":"uint256","name":"amountToActive","internalType":"uint256"},{"type":"tuple[]","name":"stakedInfos","internalType":"struct IDelegateNode.StakedInfo[]","components":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"blockNumber","internalType":"uint256"}]},{"type":"uint32","name":"feePercent","internalType":"uint32"},{"type":"address","name":"minerAddress","internalType":"address"},{"type":"address[]","name":"stakedUsersSet","internalType":"address[]"}]}],"anonymous":false},{"type":"event","name":"DeActivePool","inputs":[{"type":"tuple","name":"poolInfo","internalType":"struct IDelegateNode.PoolInfo","indexed":false,"components":[{"type":"string","name":"name","internalType":"string"},{"type":"string","name":"image","internalType":"string"},{"type":"uint8","name":"status","internalType":"enum IDelegateNode.PoolStatus"},{"type":"uint32","name":"id","internalType":"uint32"},{"type":"uint256","name":"stakedAmount","internalType":"uint256"},{"type":"uint256","name":"amountToActive","internalType":"uint256"},{"type":"tuple[]","name":"stakedInfos","internalType":"struct IDelegateNode.StakedInfo[]","components":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"blockNumber","internalType":"uint256"}]},{"type":"uint32","name":"feePercent","internalType":"uint32"},{"type":"address","name":"minerAddress","internalType":"address"},{"type":"address[]","name":"stakedUsersSet","internalType":"address[]"}]}],"anonymous":false},{"type":"event","name":"DefaultUnstakeBufferTimeUpdate","inputs":[{"type":"address","name":"caller","internalType":"address","indexed":true},{"type":"uint40","name":"oldTime","internalType":"uint40","indexed":false},{"type":"uint40","name":"newTime","internalType":"uint40","indexed":false}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"MinerAddressUpdated","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32","indexed":true},{"type":"address","name":"oldAddress","internalType":"address","indexed":false},{"type":"address","name":"newAddress","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"MinerReceiveReward","inputs":[{"type":"address","name":"miner","internalType":"address","indexed":true},{"type":"uint32","name":"poolId","internalType":"uint32","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"fee","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"MinerRefundPoolBalance","inputs":[{"type":"address","name":"miner","internalType":"address","indexed":true},{"type":"uint32","name":"poolId","internalType":"uint32","indexed":true},{"type":"uint256","name":"refundedValue","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"ModeratorChanged","inputs":[{"type":"address","name":"oldModerator","internalType":"address","indexed":true},{"type":"address","name":"newModerator","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"PoolFeePercentUpdated","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32","indexed":true},{"type":"uint32","name":"oldFeePercent","internalType":"uint32","indexed":false},{"type":"uint32","name":"newFeePercent","internalType":"uint32","indexed":false}],"anonymous":false},{"type":"event","name":"PoolImageUpdated","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32","indexed":true},{"type":"string","name":"oldImage","internalType":"string","indexed":false},{"type":"string","name":"newImage","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"PoolNameUpdated","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32","indexed":true},{"type":"string","name":"oldName","internalType":"string","indexed":false},{"type":"string","name":"newName","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"ReStakeUnStakedPool","inputs":[{"type":"address","name":"user","internalType":"address","indexed":false},{"type":"uint256","name":"unStakedAmount","internalType":"uint256","indexed":false},{"type":"uint32","name":"oldPoolId","internalType":"uint32","indexed":false},{"type":"uint32","name":"newPoolId","internalType":"uint32","indexed":false}],"anonymous":false},{"type":"event","name":"ResolveUnstake","inputs":[{"type":"address","name":"caller","internalType":"address","indexed":true},{"type":"uint32","name":"poolId","internalType":"uint32","indexed":true},{"type":"uint8","name":"status","internalType":"enum IDelegateNode.PoolStatus","indexed":false}],"anonymous":false},{"type":"event","name":"Stake","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"tuple","name":"poolInfo","internalType":"struct IDelegateNode.PoolInfo","indexed":false,"components":[{"type":"string","name":"name","internalType":"string"},{"type":"string","name":"image","internalType":"string"},{"type":"uint8","name":"status","internalType":"enum IDelegateNode.PoolStatus"},{"type":"uint32","name":"id","internalType":"uint32"},{"type":"uint256","name":"stakedAmount","internalType":"uint256"},{"type":"uint256","name":"amountToActive","internalType":"uint256"},{"type":"tuple[]","name":"stakedInfos","internalType":"struct IDelegateNode.StakedInfo[]","components":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"blockNumber","internalType":"uint256"}]},{"type":"uint32","name":"feePercent","internalType":"uint32"},{"type":"address","name":"minerAddress","internalType":"address"},{"type":"address[]","name":"stakedUsersSet","internalType":"address[]"}]}],"anonymous":false},{"type":"event","name":"UnStake","inputs":[{"type":"address","name":"user","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint32","name":"poolId","internalType":"uint32","indexed":false},{"type":"uint256","name":"claimedBlock","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"UserClaimReward","inputs":[{"type":"address","name":"caller","internalType":"address","indexed":true},{"type":"uint32","name":"poolId","internalType":"uint32","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UserClaimUnstakedAmount","inputs":[{"type":"address","name":"caller","internalType":"address","indexed":true},{"type":"uint32","name":"poolId","internalType":"uint32","indexed":true},{"type":"uint256","name":"claimedAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UserFullClaimReward","inputs":[{"type":"address","name":"caller","internalType":"address","indexed":true},{"type":"uint32","name":"poolId","internalType":"uint32","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UserReceiveRewardFromMiner","inputs":[{"type":"address","name":"receiver","internalType":"address","indexed":true},{"type":"uint32","name":"poolId","internalType":"uint32","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UserRestake","inputs":[{"type":"address","name":"caller","internalType":"address","indexed":true},{"type":"uint32","name":"pooId","internalType":"uint32","indexed":true},{"type":"uint256","name":"restakedAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"remainingUnstakeAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UserUnstake","inputs":[{"type":"address","name":"caller","internalType":"address","indexed":true},{"type":"uint32","name":"poolId","internalType":"uint32","indexed":true},{"type":"tuple","name":"eventInfo","internalType":"struct IDelegateNode.UserUnstakeEventInfo","indexed":false,"components":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"unstakeId","internalType":"uint256"},{"type":"uint8","name":"poolStatus","internalType":"enum IDelegateNode.PoolStatus"},{"type":"uint40","name":"requestTime","internalType":"uint40"},{"type":"bool","name":"isFirstUnstake","internalType":"bool"}]}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"_admin","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_defaultAmountToActive","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"_defaultPoolFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_defaultWaitBlock","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"_moderator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"_nextPoolId","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"_poolAdmin","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"name","internalType":"string"},{"type":"string","name":"image","internalType":"string"},{"type":"uint8","name":"status","internalType":"enum IDelegateNode.PoolStatus"},{"type":"uint32","name":"id","internalType":"uint32"},{"type":"uint256","name":"stakedAmount","internalType":"uint256"},{"type":"uint256","name":"amountToActive","internalType":"uint256"},{"type":"uint32","name":"feePercent","internalType":"uint32"},{"type":"address","name":"minerAddress","internalType":"address"}],"name":"_pools","inputs":[{"type":"uint32","name":"","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"totalReward","internalType":"uint256"},{"type":"uint256","name":"totalClaimed","internalType":"uint256"},{"type":"uint256","name":"reserve1","internalType":"uint256"}],"name":"_userInfo","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"isStaked","internalType":"bool"},{"type":"uint256","name":"stakedAmount","internalType":"uint256"},{"type":"uint256","name":"rewardAmount","internalType":"uint256"},{"type":"uint256","name":"claimedAmount","internalType":"uint256"}],"name":"_userPoolInfo","inputs":[{"type":"uint32","name":"","internalType":"uint32"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addminSetWorkerhubAddress","inputs":[{"type":"address","name":"_workerhubAddr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminChangeFeePercent","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32"},{"type":"uint32","name":"feePercent","internalType":"uint32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminCreatePool","inputs":[{"type":"uint32","name":"amountPool","internalType":"uint32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminSetImage","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32"},{"type":"string","name":"image","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminSetName","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32"},{"type":"string","name":"name","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminUpdateAmountToActive","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"adminWithdrawByPoolId","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"changeAdmin","inputs":[{"type":"address","name":"newAdm","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"changeModerator","inputs":[{"type":"address","name":"newModerator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint40","name":"","internalType":"uint40"}],"name":"defaultUnstakeBufferTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getPoolUnstakeReqIds","inputs":[{"type":"uint32","name":"_poolId","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getRemainingStakeForActivation","inputs":[{"type":"uint32","name":"_poolId","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getRestakeableAmount","inputs":[{"type":"uint32","name":"_poolId","internalType":"uint32"},{"type":"address","name":"_caller","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getStakedUsersOf","inputs":[{"type":"uint32","name":"_poolId","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getUserUnstakeReqIds","inputs":[{"type":"uint32","name":"_poolId","internalType":"uint32"},{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint40","name":"","internalType":"uint40"}],"name":"getWorkerHubUnstakeDelayTime","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"admin","internalType":"address"},{"type":"address","name":"poolAdmin","internalType":"address"},{"type":"address","name":"moderator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isAvailableToUnstake","inputs":[{"type":"uint32","name":"_poolId","internalType":"uint32"},{"type":"address","name":"_caller","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"minerReceiveReward","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"minerRefundPoolBalance","inputs":[{"type":"uint32","name":"_poolId","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint40","name":"firstReqTimestamp","internalType":"uint40"},{"type":"uint40","name":"bufferTimeExpireAt","internalType":"uint40"},{"type":"uint256","name":"totalUnstakedAmount","internalType":"uint256"},{"type":"uint256","name":"reimbursementAmount","internalType":"uint256"}],"name":"poolUnstakedInfo","inputs":[{"type":"uint32","name":"","internalType":"uint32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"resolveUnstake","inputs":[{"type":"uint32","name":"_poolId","internalType":"uint32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"restake","inputs":[{"type":"uint32","name":"_poolId","internalType":"uint32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDefaultUnstakeBufferTime","inputs":[{"type":"uint40","name":"_amountInSecond","internalType":"uint40"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"stake","inputs":[{"type":"uint32","name":"_poolId","internalType":"uint32"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"stakeMultiple","inputs":[{"type":"uint32[]","name":"_poolIds","internalType":"uint32[]"},{"type":"uint256[]","name":"_amounts","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unstake","inputs":[{"type":"uint32","name":"_poolId","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint40","name":"","internalType":"uint40"}],"name":"unstakeClaimableTime","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"unstakedReqId","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"poolId","internalType":"uint32"},{"type":"address","name":"unstaker","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint40","name":"requestTime","internalType":"uint40"}],"name":"unstakedReqInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateMinerAddress","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32"},{"type":"address","name":"minerAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"userClaimFullRewardOnPool","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"userClaimRewardOnPool","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"userClaimUnstakedAmount","inputs":[{"type":"uint32","name":"_poolId","internalType":"uint32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"userClaimUnstakedAmount","inputs":[{"type":"uint32","name":"_poolId","internalType":"uint32"},{"type":"address","name":"_userAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userGetRewardAmount","inputs":[{"type":"uint32","name":"poolId","internalType":"uint32"},{"type":"address","name":"caller","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userWannaUnstakeAmount","inputs":[{"type":"uint32","name":"","internalType":"uint32"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"workerhubAddress","inputs":[]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x608060405234801561001057600080fd5b50615ff380620000216000396000f3fe6080604052600436106103395760003560e01c8063715018a6116101ab578063b9e90367116100f7578063d84db9e811610095578063f1f521c61161006f578063f1f521c614610b1d578063f2fde38b14610b3d578063f8df6b0a14610b5d578063feded81014610b7d57600080fd5b8063d84db9e814610ad7578063ea35e3b114610aea578063f0cdceaa14610afd57600080fd5b8063c787a30f116100d1578063c787a30f14610a5a578063ca6c499114610a7a578063cf2a88b814610a9a578063d10ef14e14610ab057600080fd5b8063b9e9036714610a05578063bb15113214610a25578063c0c53b8b14610a3a57600080fd5b80638da5cb5b11610164578063a14c258f1161013e578063a14c258f1461098a578063ad20de39146109a8578063b055ba55146109c8578063b9ac4cd7146109e557600080fd5b80638da5cb5b1461092c5780638f2839701461094a578063979546bd1461096a57600080fd5b8063715018a6146108995780637a0db672146108ae5780637a92c4f8146108c45780637fcfb7c2146108e4578063809ee57d146108f75780638456cb591461091757600080fd5b8063536f34b3116102855780635f6949171161022357806366fdd38b116101fd57806366fdd38b146107b65780636a1eb5d9146107ea5780636f17d6111461080a5780636fc56f381461086157600080fd5b80635f694917146106f657806363fd3edf1461072357806366575f461461074357600080fd5b80635c975abb1161025f5780635c975abb146106655780635d953c8d146106895780635ed008d5146106a95780635f677a24146106d657600080fd5b8063536f34b31461058657806355c7948e146105a65780635ac473661461063757600080fd5b80631c8f6c08116102f257806342fa2d3c116102cc57806342fa2d3c14610506578063466429211461052657806347270d0f14610546578063521b7af71461056657600080fd5b80631c8f6c08146104945780633e806d11146104a75780633f4ba83a146104f157600080fd5b806301bc45c914610345578063098cc8f914610382578063118e29d1146103f9578063131f2dff1461041b57806317fb77de1461043b57806319d776c41461047457600080fd5b3661034057005b600080fd5b34801561035157600080fd5b50600054610365906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561038e57600080fd5b506103d061039d366004615560565b600f6020526000908152604090208054600182015460029092015464ffffffffff80831693600160281b90930416919084565b6040805164ffffffffff9586168152949093166020850152918301526060820152608001610379565b34801561040557600080fd5b50610419610414366004615560565b610b93565b005b34801561042757600080fd5b50610419610436366004615599565b61102d565b34801561044757600080fd5b5060015461045f90600160a01b900463ffffffff1681565b60405163ffffffff9091168152602001610379565b34801561048057600080fd5b5061041961048f366004615560565b61121a565b6104196104a2366004615560565b61139d565b3480156104b357600080fd5b506104db6104c23660046155cc565b60116020526000908152604090205464ffffffffff1681565b60405164ffffffffff9091168152602001610379565b3480156104fd57600080fd5b506104196115b5565b34801561051257600080fd5b506104196105213660046155e5565b611625565b34801561053257600080fd5b5061041961054136600461560f565b611753565b34801561055257600080fd5b50610419610561366004615640565b611838565b34801561057257600080fd5b50610419610581366004615715565b611967565b34801561059257600080fd5b506104196105a1366004615560565b611a53565b3480156105b257600080fd5b506106016105c13660046155cc565b600e6020526000908152604090208054600182015460029092015463ffffffff821692600160201b9092046001600160a01b0316919064ffffffffff1684565b6040805163ffffffff90951685526001600160a01b0390931660208501529183015264ffffffffff166060820152608001610379565b34801561064357600080fd5b50610657610652366004615560565b611a7b565b604051908152602001610379565b34801561067157600080fd5b5060d25460ff165b6040519015158152602001610379565b34801561069557600080fd5b506104196106a4366004615732565b611bdc565b3480156106b557600080fd5b506106c96106c4366004615599565b611d2c565b604051610379919061575c565b3480156106e257600080fd5b506104196106f1366004615560565b611da8565b34801561070257600080fd5b50610716610711366004615560565b611f21565b60405161037991906157e4565b34801561072f57600080fd5b50600654610365906001600160a01b031681565b34801561074f57600080fd5b5061079461075e366004615599565b6007602090815260009283526040808420909152908252902080546001820154600283015460039093015460ff90921692909184565b6040805194151585526020850193909352918301526060820152608001610379565b3480156107c257600080fd5b506107d66107d1366004615560565b611f94565b60405161037998979695949392919061587c565b3480156107f657600080fd5b5061041961080536600461560f565b6120ff565b34801561081657600080fd5b5061084661082536600461560f565b60096020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610379565b34801561086d57600080fd5b5061065761087c366004615599565b600b60209081526000928352604080842090915290825290205481565b3480156108a557600080fd5b506104196121b6565b3480156108ba57600080fd5b5061065760025481565b3480156108d057600080fd5b506106576108df366004615599565b6121c8565b6104196108f2366004615560565b6122a2565b34801561090357600080fd5b50610419610912366004615560565b6122bc565b34801561092357600080fd5b5061041961296a565b34801561093857600080fd5b5060a0546001600160a01b0316610365565b34801561095657600080fd5b5061041961096536600461560f565b6129d8565b34801561097657600080fd5b50610419610985366004615732565b612abc565b34801561099657600080fd5b506010546104db9064ffffffffff1681565b3480156109b457600080fd5b506104196109c3366004615599565b612cab565b3480156109d457600080fd5b5060045461045f9063ffffffff1681565b3480156109f157600080fd5b50610419610a00366004615640565b612cd0565b348015610a1157600080fd5b50610679610a20366004615599565b612dee565b348015610a3157600080fd5b506104db613311565b348015610a4657600080fd5b50610419610a553660046158f3565b61338f565b348015610a6657600080fd5b50610679610a75366004615599565b613524565b348015610a8657600080fd5b50610657610a95366004615599565b61369a565b348015610aa657600080fd5b5061065760055481565b348015610abc57600080fd5b5060105461036590600160281b90046001600160a01b031681565b610419610ae5366004615732565b6136ec565b610419610af8366004615982565b613d67565b348015610b0957600080fd5b50610419610b18366004615560565b613ecf565b348015610b2957600080fd5b506106c9610b38366004615560565b6140d9565b348015610b4957600080fd5b50610419610b5836600461560f565b614141565b348015610b6957600080fd5b50600154610365906001600160a01b031681565b348015610b8957600080fd5b50610657600a5481565b60008163ffffffff16118015610bbb575060015463ffffffff600160a01b9091048116908216105b6040518060400160405280600381526020016203430360ec1b81525090610bfe5760405162461bcd60e51b8152600401610bf591906159ee565b60405180910390fd5b50600463ffffffff821660009081526003602052604090206002015460ff166005811115610c2e57610c2e615844565b14610c4c57604051633fad04fd60e01b815260040160405180910390fd5b63ffffffff81166000908152600f6020526040902054600160281b900464ffffffffff16421115610c905760405163e3c8a69960e01b815260040160405180910390fd5b63ffffffff8082166000908152600c6020908152604080832033845290915281209091610cc0919083906141b716565b6000818152600e6020526040902054909150600160201b90046001600160a01b03163314610d235760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b2103ab739ba30b5b2b960811b6044820152606401610bf5565b63ffffffff82166000908152600b6020908152604080832033845290915290205480610d875760405162461bcd60e51b815260206004820152601360248201527216995c9bc81d5b9cdd185ad948185b5bdd5b9d606a1b6044820152606401610bf5565b6000610d9284611a7b565b9050600082821015610da45781610da6565b825b905080610df55760405162461bcd60e51b815260206004820152601760248201527f5a65726f2072657374616b6561626c6520616d6f756e740000000000000000006044820152606401610bf5565b63ffffffff85166000908152600b6020908152604080832033845290915281208054839290610e25908490615a17565b90915550506000848152600e602052604081206001018054839290610e4b908490615a17565b909155505063ffffffff85166000908152600f602052604081206001018054839290610e78908490615a17565b909155505080831415610ed45763ffffffff8086166000908152600c602090815260408083203384529091529020610eb291869061420616565b63ffffffff8086166000908152600d60205260409020610ed491869061420616565b63ffffffff8086166000908152600860205260409020610ef69133906142ff16565b610f1c5763ffffffff8086166000908152600860205260409020610f1c91339061432016565b63ffffffff851660009081526007602090815260408083203384529091529020805460ff19166001908117825501819055610f5685611a7b565b610fce5763ffffffff851660009081526003602081815260408084206002808201805460ff19169091179055600f835293819020805464ffffffffff19169055919052517f53298aec8df01cdc1d1539b1e5554f6d3c30740932225bd55f6543ec63b2b33991610fc591615c66565b60405180910390a15b63ffffffff85166000818152600b602090815260408083203380855290835292819020548151868152928301527f12dba112ba20d8135cf49069d4104d01b6390f480a38cf3e5a57c58b95928ea0910160405180910390a35050505050565b6000546001600160a01b031633148061105057506006546001600160a01b031633145b6040518060400160405280600381526020016231303560e81b8152509061108a5760405162461bcd60e51b8152600401610bf591906159ee565b5060008263ffffffff161180156110b3575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b815250906110ed5760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201526001600160a01b03821661112f5760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff808316600081815260036020818152604092839020600281015484518086019095529284526203430360ec1b91840191909152939192610100909104909116146111925760405162461bcd60e51b8152600401610bf591906159ee565b50600681015460408051600160201b9092046001600160a01b0390811683528416602083015263ffffffff8516917f5442836085bfb036899c4fd1524b33460232f78fbd7ef59d0e7673f1ba0e6787910160405180910390a260060180546001600160a01b03909216600160201b02640100000000600160c01b031990921691909117905550565b6000546001600160a01b031633148061123d57506006546001600160a01b031633145b6040518060400160405280600381526020016231303560e81b815250906112775760405162461bcd60e51b8152600401610bf591906159ee565b5060005b8163ffffffff168163ffffffff1610156113995760018054600160a01b9081900463ffffffff908116600090815260036020819052604082206002808201805460ff1981168255885488900487166101000264ffffffffff1990911617905554600480830191909155918101929092555460068201805463ffffffff19169184169190911790558354909392839260149261131a928592910416615c79565b825463ffffffff91821661010093840a9081029083021990911617909255600284015404166000908152600360205260409081902090517f25f55b6539644ded1f3c92d0d564a12d2ebe9dfab7eed8cd0eb2fb5ef5c43cc6925061137e9190615c66565b60405180910390a1508061139181615ca1565b91505061127b565b5050565b6113a56143a8565b60008163ffffffff161180156113cd575060015463ffffffff600160a01b9091048116908216105b6040518060400160405280600381526020016203430360ec1b815250906114075760405162461bcd60e51b8152600401610bf591906159ee565b50600563ffffffff821660009081526003602052604090206002015460ff16600581111561143757611437615844565b1461145557604051633fad04fd60e01b815260040160405180910390fd5b61145d613311565b63ffffffff82166000908152600f602052604090205461148b9190600160281b900464ffffffffff16615cc5565b64ffffffffff164210156114b2576040516378323b2960e11b815260040160405180910390fd5b63ffffffff811660009081526003602052604090206006810154600490910154600160201b9091046001600160a01b0316903382146115045760405163495a456d60e01b815260040160405180910390fd5b803414611524576040516377652a0760e01b815260040160405180910390fd5b63ffffffff83166000908152600360208190526040822001805434929061154c908490615ce5565b909155505063ffffffff8316600081815260036020908152604091829020600201805460ff1916905590518381526001600160a01b038516917f0591182b9ca17de6d0a2d6f9fbd53f1acc078be61937005fed5f81ebdb2bd632910160405180910390a3505050565b6000546001600160a01b03163314806115d857506006546001600160a01b031633145b6040518060400160405280600381526020016231303560e81b815250906116125760405162461bcd60e51b8152600401610bf591906159ee565b5061161b6143ee565b611623614437565b565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b0316331461166b5760405162461bcd60e51b8152600401610bf591906159ee565b5060008263ffffffff16118015611694575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b815250906116ce5760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff82811660008181526003602090815260409182902060060154825190851681529385169084015290917f15c3d4b8f6ffe91c1d4b83c010a7a2de5206159871365154b10babf04afada7f910160405180910390a263ffffffff9182166000908152600360205260409020600601805463ffffffff191691909216179055565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b031633146117995760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201526001600160a01b0382166117db5760405162461bcd60e51b8152600401610bf591906159ee565b506006546040516001600160a01b038084169216907f225c0996a226b195cf3751c09bf4a8ad9c1c8e09e95f39e64cb988039e0829f390600090a3600680546001600160a01b0319166001600160a01b0392909216919091179055565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b0316331461187e5760405162461bcd60e51b8152600401610bf591906159ee565b5060008263ffffffff161180156118a7575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b815250906118e15760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff82166000818152600360205260409081902090517fdf6d844af3be94e6c5d817effd7eec1f590946fa8edaea0b1698c33b57853b6c9161192e916001909101908590615cfd565b60405180910390a263ffffffff821660009081526003602090815260409091208251611962926001909201918401906154ae565b505050565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b031633146119ad5760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b602082015264ffffffffff82166119ed5760405162461bcd60e51b8152600401610bf591906159ee565b506010546040805164ffffffffff9283168152918316602083015233917ff21e158cb1bfbd1786f9b153608f087a9d800fbd08bcc0ab6eca4dc59b30f3c6910160405180910390a26010805464ffffffffff191664ffffffffff92909216919091179055565b611a5b614489565b611a636143a8565b611a6d81336144e5565b611a78600161010455565b50565b60015460009063ffffffff600160a01b909104811690831610611ab15760405163015f4fdd60e31b815260040160405180910390fd5b63ffffffff821660009081526003602081815260408084206004810154600f845291852060010154928490529283015460029093015490939192919060ff166005811115611b0157611b01615844565b1480611b395750600163ffffffff861660009081526003602052604090206002015460ff166005811115611b3757611b37615844565b145b15611b5b57611b488282615a17565b611b529084615a17565b95945050505050565b600463ffffffff861660009081526003602052604090206002015460ff166005811115611b8a57611b8a615844565b1480611bc25750600563ffffffff861660009081526003602052604090206002015460ff166005811115611bc057611bc0615844565b145b15611bd157611b528183615a17565b506000949350505050565b6000546001600160a01b0316331480611bff57506006546001600160a01b031633145b6040518060400160405280600381526020016231303560e81b81525090611c395760405162461bcd60e51b8152600401610bf591906159ee565b5060008263ffffffff16118015611c62575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b81525090611c9c5760405162461bcd60e51b8152600401610bf591906159ee565b5080611cbb5760405163064ec82760e51b815260040160405180910390fd5b63ffffffff821660008181526003602090815260409182902060040154825190815290810184905233917f87ebf7a4970fd064b3d13131e2ab4df542c54866a1221e000856f3e2b0401f32910160405180910390a363ffffffff909116600090815260036020526040902060040155565b63ffffffff82166000908152600c602090815260408083206001600160a01b0385168452825291829020805483518184028101840190945280845260609392830182828015611d9a57602002820191906000526020600020905b815481526020019060010190808311611d86575b505050505090505b92915050565b611db0614489565b611db86143a8565b60008163ffffffff16118015611de0575060015463ffffffff600160a01b9091048116908216105b6040518060400160405280600381526020016203430360ec1b81525090611e1a5760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff811660009081526007602090815260408083203384529091529020600281015480611e5e57604051635aa9184d60e01b815260040160405180910390fd5b6000826002018190555080826003016000828254611e7c9190615ce5565b90915550503360009081526009602052604081208054839290611ea0908490615a17565b90915550503360009081526009602052604081206001018054839290611ec7908490615ce5565b90915550611ed79050338261484d565b60405181815263ffffffff84169033907fc27842383b348601d177a4923a449417b1aaadd15e3556f552a5c63dd3b5fd5f9060200160405180910390a35050611a78600161010455565b63ffffffff8116600090815260086020908152604091829020805483518184028101840190945280845260609392830182828015611f8857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611f6a575b50505050509050919050565b600360205260009081526040902080548190611faf90615a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054611fdb90615a2e565b80156120285780601f10611ffd57610100808354040283529160200191612028565b820191906000526020600020905b81548152906001019060200180831161200b57829003601f168201915b50505050509080600101805461203d90615a2e565b80601f016020809104026020016040519081016040528092919081815260200182805461206990615a2e565b80156120b65780601f1061208b576101008083540402835291602001916120b6565b820191906000526020600020905b81548152906001019060200180831161209957829003601f168201915b505050600284015460038501546004860154600690960154949560ff83169563ffffffff61010090940484169550919350918116906001600160a01b03600160201b9091041688565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b031633146121455760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201526001600160a01b0382166121875760405162461bcd60e51b8152600401610bf591906159ee565b50601080546001600160a01b03909216600160281b0265010000000000600160c81b0319909216919091179055565b6121be6148c1565b611623600061491b565b6000808363ffffffff161180156121f1575060015463ffffffff600160a01b9091048116908416105b6040518060400160405280600381526020016203430360ec1b8152509061222b5760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201526001600160a01b03831661226d5760405162461bcd60e51b8152600401610bf591906159ee565b505063ffffffff821660009081526007602090815260408083206001600160a01b038516845290915290206002015492915050565b6122aa614489565b6122b26143a8565b611a6d813461496d565b6122c4614489565b6122cc6143a8565b60008163ffffffff161180156122f4575060015463ffffffff600160a01b9091048116908216105b6040518060400160405280600381526020016203430360ec1b8152509061232e5760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff811660009081526003602052604081206002015460ff169081600581111561235e5761235e615844565b1415801561237e5750600281600581111561237b5761237b615844565b14155b801561239c5750600481600581111561239957612399615844565b14155b80156123ba575060058160058111156123b7576123b7615844565b14155b156123d857604051633fad04fd60e01b815260040160405180910390fd5b63ffffffff821660009081526007602090815260408083203384529091529020600101548061241a57604051633769617760e01b815260040160405180910390fd5b63ffffffff83166000908152600b60209081526040808320338452909152902054811480612467575063ffffffff83166000908152600b6020908152604080832033845290915290205415155b15612485576040516308aaef9d60e41b815260040160405180910390fd5b63ffffffff831660009081526007602090815260408083203384529091528120805460ff19169055600a805490826124bc83615d22565b9091555063ffffffff85166000908152600f60205260408120549192509064ffffffffff166124eb5742612509565b63ffffffff85166000908152600f602052604090205464ffffffffff165b9050612513613311565b6010546125279064ffffffffff1683615cc5565b6125319190615cc5565b6000838152601160209081526040808320805464ffffffffff95861664ffffffffff1991821617909155815160808101835263ffffffff808c16808352338387018181528487018d8152428b16606087019081528d8b52600e8a52888b209651875493516001600160a01b0316600160201b026001600160c01b0319909416908716179290921786555160018601555160029094018054949099169390941692909217909655845260089092529091206125ee92909190614fde16565b60008085600581111561260357612603615844565b14156126a15763ffffffff8616600081815260076020908152604080832033808552908352818420600101849055848452600b835281842090845282528083208390559282526003908190529181209091018054869290612665908490615a17565b9091555050336000908152600960205260408120600201805486929061268c908490615ce5565b9091555061269c9050338561484d565b6128c2565b60028560058111156126b5576126b5615844565b14806126d2575060048560058111156126d0576126d0615844565b145b806126ee575060058560058111156126ec576126ec615844565b145b156128c25763ffffffff8087166000908152600c60209081526040808320338452909152902061272091859061513216565b63ffffffff8087166000908152600d6020526040902061274291859061513216565b63ffffffff86166000908152600b6020908152604080832033845290915281208054869290612772908490615ce5565b909155506002905085600581111561278c5761278c615844565b1415612894575063ffffffff85166000908152600360205260408120600201805460ff19166004179055601054600191906127ce9064ffffffffff1642615ce5565b905060405180608001604052804264ffffffffff1681526020018264ffffffffff16815260200186600f60008b63ffffffff1663ffffffff168152602001908152602001600020600101546128239190615ce5565b815263ffffffff89166000818152600f602081815260408084206002810180549784019790975294909352908152845183549186015164ffffffffff908116600160281b0269ffffffffffffffffffff199093169116171782558301516001909101556060909101519055506128c2565b63ffffffff86166000908152600f6020526040812060010180548692906128bc908490615ce5565b90915550505b6040805160a081018252858152602080820186905263ffffffff8916600081815260039092529083902060020154909233927fec3d665be5d5336c6abc756ea7575c3fd1c70a51ec5e9379b09cf3ab2b1c14cb92909182019060ff16600581111561292f5761292f615844565b815264ffffffffff42166020820152851515604091820152516129529190615d3d565b60405180910390a35050505050611a78600161010455565b6000546001600160a01b031633148061298d57506006546001600160a01b031633145b6040518060400160405280600381526020016231303560e81b815250906129c75760405162461bcd60e51b8152600401610bf591906159ee565b506129d06143a8565b61162361518e565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b03163314612a1e5760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201526001600160a01b038216612a605760405162461bcd60e51b8152600401610bf591906159ee565b50600080546040516001600160a01b03808516939216917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f91a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b612ac4614489565b612acc6143a8565b60008263ffffffff16118015612af4575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b81525090612b2e5760405162461bcd60e51b8152600401610bf591906159ee565b50806000108015612b62575063ffffffff821660009081526007602090815260408083203384529091529020600201548111155b6040518060400160405280600381526020016234303360e81b81525090612b9c5760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff8216600090815260076020908152604080832033845290915281206002018054839290612bd0908490615a17565b909155505063ffffffff8216600090815260076020908152604080832033845290915281206003018054839290612c08908490615ce5565b90915550503360009081526009602052604081208054839290612c2c908490615a17565b90915550503360009081526009602052604081206001018054839290612c53908490615ce5565b90915550612c639050338261484d565b60405181815263ffffffff83169033907fc27842383b348601d177a4923a449417b1aaadd15e3556f552a5c63dd3b5fd5f9060200160405180910390a3611399600161010455565b612cb3614489565b612cbb6143a8565b612cc582826144e5565b611399600161010455565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b03163314612d165760405162461bcd60e51b8152600401610bf591906159ee565b5060008263ffffffff16118015612d3f575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b81525090612d795760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff82166000818152600360205260409081902090517fca0d97c04979cdd221a9ca3b50be10f120271defb13da02088526baaaf4dc5e891612dc0918590615cfd565b60405180910390a263ffffffff821660009081526003602090815260409091208251611962928401906154ae565b6001546040805180820190915260038152620c4c0d60ea1b60208201526000916001600160a01b03163314612e365760405162461bcd60e51b8152600401610bf591906159ee565b50612e3f614489565b612e476143a8565b60008363ffffffff16118015612e6f575060015463ffffffff600160a01b9091048116908416105b6040518060400160405280600381526020016203430360ec1b81525090612ea95760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201526001600160a01b038316612eeb5760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff831660009081526003602052604080822081516101408101909252805482908290612f1b90615a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054612f4790615a2e565b8015612f945780601f10612f6957610100808354040283529160200191612f94565b820191906000526020600020905b815481529060010190602001808311612f7757829003601f168201915b50505050508152602001600182018054612fad90615a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054612fd990615a2e565b80156130265780601f10612ffb57610100808354040283529160200191613026565b820191906000526020600020905b81548152906001019060200180831161300957829003601f168201915b5050509183525050600282015460209091019060ff16600581111561304d5761304d615844565b600581111561305e5761305e615844565b81526020016002820160019054906101000a900463ffffffff1663ffffffff1663ffffffff168152602001600382015481526020016004820154815260200160058201805480602002602001604051908101604052809291908181526020016000905b82821015613116576000848152602090819020604080516060810182526003860290920180546001600160a01b03168352600180820154848601526002909101549183019190915290835290920191016130c1565b50505090825250600682015463ffffffff8116602080840191909152600160201b9091046001600160a01b031660408084019190915260078401805482518185028101850190935280835260609094019391929091908301828280156131a557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613187575b5050505050815250509050600160058111156131c3576131c3615844565b816040015160058111156131d9576131d9615844565b14604051806040016040528060038152602001621a181960e91b815250906132145760405162461bcd60e51b8152600401610bf591906159ee565b508060a0015181608001511015604051806040016040528060038152602001621a181960e91b8152509061325b5760405162461bcd60e51b8152600401610bf591906159ee565b5060a081015163ffffffff851660009081526003602081905260408220018054839290613289908490615a17565b909155505063ffffffff851660009081526003602052604090206002908101805460ff191690911790556132bd848261484d565b836001600160a01b03167fe8d1cb53b728568e29eb765e9358c52f67ad996c9398e5e00d0597a93f4b8e1f82846040516132f8929190615dd8565b60405180910390a2600192505050611da2600161010455565b6000601060059054906101000a90046001600160a01b03166001600160a01b031663e4fefd656040518163ffffffff1660e01b8152600401602060405180830381865afa158015613366573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061338a9190615ec1565b905090565b606d54610100900460ff16158080156133af5750606d54600160ff909116105b806133c95750303b1580156133c95750606d5460ff166001145b61342c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610bf5565b606d805460ff19166001179055801561344f57606d805461ff0019166101001790555b6134576151cb565b61345f6151fa565b613467615229565b60018054600080546001600160a01b038089166001600160a01b0319928316179092558682166001600160c01b031990931692909217600160a01b178355600680549186169190921617905569054b40b1f852bda000006002556004805463ffffffff191690556224ea00600555600a55801561351e57606d805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6000808363ffffffff1611801561354d575060015463ffffffff600160a01b9091048116908416105b6040518060400160405280600381526020016203430360ec1b815250906135875760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff831660009081526003602052604081206002015460ff16908160058111156135b7576135b7615844565b141580156135d7575060028160058111156135d4576135d4615844565b14155b80156135f5575060048160058111156135f2576135f2615844565b14155b80156136135750600581600581111561361057613610615844565b14155b15613622576000915050611da2565b63ffffffff84166000908152600c602090815260408083206001600160a01b0387168452909152902054158015613682575063ffffffff841660009081526007602090815260408083206001600160a01b038716845290915290205460ff165b613690576000915050611da2565b5060019392505050565b63ffffffff82166000908152600b602090815260408083206001600160a01b0385168452909152812054816136ce85611a7b565b90506000828210156136e057816136e2565b825b9695505050505050565b6136f46143a8565b60008263ffffffff1611801561371c575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b815250906137565760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201528161378f5760405162461bcd60e51b8152600401610bf591906159ee565b503481146137b057604051635aa8a63160e01b815260040160405180910390fd5b63ffffffff8216600090815260036020526040808220815161014081019092528054829082906137df90615a2e565b80601f016020809104026020016040519081016040528092919081815260200182805461380b90615a2e565b80156138585780601f1061382d57610100808354040283529160200191613858565b820191906000526020600020905b81548152906001019060200180831161383b57829003601f168201915b5050505050815260200160018201805461387190615a2e565b80601f016020809104026020016040519081016040528092919081815260200182805461389d90615a2e565b80156138ea5780601f106138bf576101008083540402835291602001916138ea565b820191906000526020600020905b8154815290600101906020018083116138cd57829003601f168201915b5050509183525050600282015460209091019060ff16600581111561391157613911615844565b600581111561392257613922615844565b81526020016002820160019054906101000a900463ffffffff1663ffffffff1663ffffffff168152602001600382015481526020016004820154815260200160058201805480602002602001604051908101604052809291908181526020016000905b828210156139da576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101613985565b50505090825250600682015463ffffffff8116602080840191909152600160201b9091046001600160a01b03166040808401919091526007840180548251818502810185019093528083526060909401939192909190830182828015613a6957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613a4b575b50505050508152505090508263ffffffff16816060015163ffffffff16146040518060400160405280600381526020016203430360ec1b81525090613ac15760405162461bcd60e51b8152600401610bf591906159ee565b5061010081015160408051808201909152600381526203130360ec1b6020820152906001600160a01b03163314613b0b5760405162461bcd60e51b8152600401610bf591906159ee565b50600281604001516005811115613b2457613b24615844565b1480613b455750600481604001516005811115613b4357613b43615844565b145b604051806040016040528060038152602001620d0c0d60ea1b81525090613b7f5760405162461bcd60e51b8152600401610bf591906159ee565b5060006127108260e0015163ffffffff1684613b9b9190615ede565b613ba59190615efd565b90506000613bb38285615a17565b63ffffffff86166000908152600860205260408120549192505b818163ffffffff161015613d1b5763ffffffff87811660009081526008602052604081209091613c0291908085169061525816565b63ffffffff891660009081526007602090815260408083206001600160a01b038516845290915281206001015460a089015192935091613c428784615ede565b613c4c9190615efd565b63ffffffff8b1660009081526007602090815260408083206001600160a01b0388168452909152812060020180549293508392909190613c8d908490615ce5565b90915550506001600160a01b03831660009081526009602052604081208054839290613cba908490615ce5565b909155505060405181815263ffffffff8b16906001600160a01b038516907fc07f0b98346cf06e2f8b833366d4588d66d719783c4caa59e3b83d176dffdc599060200160405180910390a35050508080613d1390615ca1565b915050613bcd565b50604080518681526020810185905263ffffffff88169133917fe133ea34406092819c1aff0fb28ce904a311b4ea77b1be0a3071eb5114848bb0910160405180910390a3505050505050565b613d6f614489565b613d776143a8565b60408051808201909152600381526203130360ec1b6020820152838214613db15760405162461bcd60e51b8152600401610bf591906159ee565b506000805b63ffffffff8116831115613e025783838263ffffffff16818110613ddc57613ddc615f1f565b9050602002013582613dee9190615ce5565b915080613dfa81615ca1565b915050613db6565b5060408051808201909152600381526203130360ec1b6020820152348214613e3d5760405162461bcd60e51b8152600401610bf591906159ee565b5060005b63ffffffff8116851115613ec257600086868363ffffffff16818110613e6957613e69615f1f565b9050602002016020810190613e7e9190615560565b9050600085858463ffffffff16818110613e9a57613e9a615f1f565b905060200201359050613ead828261496d565b50508080613eba90615ca1565b915050613e41565b505061351e600161010455565b60008163ffffffff16118015613ef7575060015463ffffffff600160a01b9091048116908216105b6040518060400160405280600381526020016203430360ec1b81525090613f315760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff81166000908152600f6020526040902054600160281b900464ffffffffff16421015613f765760405163096bc93560e01b815260040160405180910390fd5b600463ffffffff821660009081526003602052604090206002015460ff166005811115613fa557613fa5615844565b146140035763ffffffff81166000818152600360205260409081902060020154905133917fcffaeea967d1f98a5902a8390e76735c572b574041eabaf6cd4834795dc3ae0291613ff89160ff1690615f35565b60405180910390a350565b600061400e82611a7b565b9050806140555763ffffffff821660009081526003602090815260408083206002908101805460ff19169091179055600f9091529020805464ffffffffff1916905561407f565b801561407f5763ffffffff82166000908152600360205260409020600201805460ff191660051790555b63ffffffff82166000818152600360205260409081902060020154905133917fcffaeea967d1f98a5902a8390e76735c572b574041eabaf6cd4834795dc3ae02916140cd9160ff1690615f35565b60405180910390a35050565b63ffffffff81166000908152600d6020908152604091829020805483518184028101840190945280845260609392830182828015611f8857602002820191906000526020600020905b8154815260200190600101908083116141225750505050509050919050565b6141496148c1565b6001600160a01b0381166141ae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610bf5565b611a788161491b565b815460009082106141de57604051638140c4d560e01b815260048101839052602401610bf5565b8260000182815481106141f3576141f3615f1f565b9060005260206000200154905092915050565b60008181526001830160205260409020548061423857604051630802402960e01b815260048101839052602401610bf5565b82548390600019810190811061425057614250615f1f565b906000526020600020015483600001600183038154811061427357614273615f1f565b9060005260206000200181905550808360010160008560000160018503815481106142a0576142a0615f1f565b9060005260206000200154815260200190815260200160002081905550826000018054806142d0576142d0615f43565b600082815260208082208301600019908101839055909201909255928152600193909301909152506040812055565b6001600160a01b031660009081526001919091016020526040902054151590565b6001600160a01b038116600090815260018301602052604090205415614364576040516305e3de8f60e01b81526001600160a01b0382166004820152602401610bf5565b8154600181810184556000848152602080822090930180546001600160a01b039095166001600160a01b031990951685179055845493815293019052604090912055565b60d25460ff16156116235760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610bf5565b60d25460ff166116235760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610bf5565b61443f6143ee565b60d2805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60026101045414156144dd5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610bf5565b600261010455565b60008263ffffffff1611801561450d575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b815250906145475760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff82166000908152600c602090815260408083206001600160a01b038516845290915290205461457a575050565b63ffffffff8083166000908152600c602090815260408083206001600160a01b0386168452909152812090916145b3919083906141b716565b63ffffffff8085166000908152600d602052604090209192506145d9919083906152b016565b8015614616575063ffffffff8084166000908152600c602090815260408083206001600160a01b038716845290915290206146169183906152b016565b156146735763ffffffff8084166000908152600d6020526040902061463d91839061420616565b63ffffffff8084166000908152600c602090815260408083206001600160a01b0387168452909152902061467391839061420616565b60008181526011602052604090205464ffffffffff164210156146a9576040516304fdbaf560e31b815260040160405180910390fd5b63ffffffff83166000908152600b602090815260408083206001600160a01b0386168452909152902054806146de5750505050565b63ffffffff841660009081526007602090815260408083206001600160a01b03871684529091528120600101805483929061471a908490615a17565b909155505063ffffffff84166000818152600b602090815260408083206001600160a01b03881684528252808320839055928252600390819052918120909101805483929061476a908490615a17565b90915550506001600160a01b0383166000908152600960205260408120600201805483929061479a908490615ce5565b909155505063ffffffff84166000908152600f6020526040902060010154156147eb5763ffffffff84166000908152600f6020526040812060010180548392906147e5908490615a17565b90915550505b6147f5838261484d565b8363ffffffff16836001600160a01b03167f0794925e048d82c53c71e6dc062c1b087dfa237144ab91a80487be2d871e90268360405161483791815260200190565b60405180910390a350505050565b600161010455565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461489a576040519150601f19603f3d011682016040523d82523d6000602084013e61489f565b606091505b50509050806119625760405163bfa871c560e01b815260040160405180910390fd5b60a0546001600160a01b031633146116235760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610bf5565b60a080546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60408051808201909152600381526203130360ec1b6020820152816149a55760405162461bcd60e51b8152600401610bf591906159ee565b5060008263ffffffff161180156149ce575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b81525090614a085760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff821660009081526003602052604080822081516101408101909252805482908290614a3890615a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054614a6490615a2e565b8015614ab15780601f10614a8657610100808354040283529160200191614ab1565b820191906000526020600020905b815481529060010190602001808311614a9457829003601f168201915b50505050508152602001600182018054614aca90615a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054614af690615a2e565b8015614b435780601f10614b1857610100808354040283529160200191614b43565b820191906000526020600020905b815481529060010190602001808311614b2657829003601f168201915b5050509183525050600282015460209091019060ff166005811115614b6a57614b6a615844565b6005811115614b7b57614b7b615844565b81526020016002820160019054906101000a900463ffffffff1663ffffffff1663ffffffff168152602001600382015481526020016004820154815260200160058201805480602002602001604051908101604052809291908181526020016000905b82821015614c33576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101614bde565b50505090825250600682015463ffffffff8116602080840191909152600160201b9091046001600160a01b03166040808401919091526007840180548251818502810185019093528083526060909401939192909190830182828015614cc257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311614ca4575b50505050508152505090508263ffffffff16816060015163ffffffff16146040518060400160405280600381526020016203430360ec1b81525090614d1a5760405162461bcd60e51b8152600401610bf591906159ee565b50600081604001516005811115614d3357614d33615844565b14158015614d575750600481604001516005811115614d5457614d54615844565b14155b15614d7557604051633fad04fd60e01b815260040160405180910390fd5b614d7f83336144e5565b6000614d8a84611a7b565b9050808311156040518060400160405280600381526020016234303160e81b81525090614dca5760405162461bcd60e51b8152600401610bf591906159ee565b50600082604001516005811115614de357614de3615844565b1415614e7357614df384846152c8565b80831415614e6e5763ffffffff8416600090815260036020818152604080842060028101805460ff19166001179055600f835293819020805464ffffffffff19169055919052517f53298aec8df01cdc1d1539b1e5554f6d3c30740932225bd55f6543ec63b2b33991614e6591615c66565b60405180910390a15b614f88565b600482604001516005811115614e8b57614e8b615844565b1415614f885763ffffffff84166000908152600f6020526040902054600160281b900464ffffffffff16421115614ed55760405163e5ba5ccd60e01b815260040160405180910390fd5b614edf84846152c8565b63ffffffff84166000908152600f602052604081206002018054859290614f07908490615ce5565b909155505082811415614f885763ffffffff841660009081526003602081815260408084206002808201805460ff19169091179055600f835293819020805464ffffffffff19169055919052517f53298aec8df01cdc1d1539b1e5554f6d3c30740932225bd55f6543ec63b2b33991614f7f91615c66565b60405180910390a15b63ffffffff841660009081526003602052604090819020905133917f867fd4118b670858f0e3b4413b49e93f261d5d021c3907d538a99c534f1be65b91614fd0918791615f59565b60405180910390a250505050565b6001600160a01b038116600090815260018301602052604090205480615022576040516328a32c1960e01b81526001600160a01b0383166004820152602401610bf5565b82548390600019810190811061503a5761503a615f1f565b60009182526020909120015483546001600160a01b03909116908490600019840190811061506a5761506a615f1f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550808360010160008560000160018503815481106150b7576150b7615f1f565b60009182526020808320909101546001600160a01b0316835282019290925260400190205582548390806150ed576150ed615f43565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b03939093168152600193909301909152506040812055565b60008181526001830160205260409020541561516457604051631a36250760e11b815260048101829052602401610bf5565b81546001818101845560008481526020808220909301849055845493815293019052604090912055565b6151966143a8565b60d2805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861446c3390565b606d54610100900460ff166151f25760405162461bcd60e51b8152600401610bf590615f72565b611623615424565b606d54610100900460ff166152215760405162461bcd60e51b8152600401610bf590615f72565b611623615454565b606d54610100900460ff166152505760405162461bcd60e51b8152600401610bf590615f72565b611623615487565b8154600090821061527f57604051637d1d2a8560e01b815260048101839052602401610bf5565b82600001828154811061529457615294615f1f565b6000918252602090912001546001600160a01b03169392505050565b60009081526001919091016020526040902054151590565b63ffffffff8216600090815260036020819052604082209081018054919284926152f3908490615ce5565b909155505060408051606081018252338082526020808301868152438486019081526005870180546001808201835560009283528583209751600390920290970180546001600160a01b0319166001600160a01b039092169190911781559251958301959095555160029091015563ffffffff87168352600781528383209183525220805460ff161580156153a7575063ffffffff80851660009081526008602052604090206153a59133906142ff16565b155b1561540557805460ff19166001908117825560078301805491820181556000908152602080822090920180546001600160a01b0319163390811790915563ffffffff8088168352600890935260409091206154059290919061432016565b828160010160008282546154199190615ce5565b909155505050505050565b606d54610100900460ff1661544b5760405162461bcd60e51b8152600401610bf590615f72565b6116233361491b565b606d54610100900460ff1661547b5760405162461bcd60e51b8152600401610bf590615f72565b60d2805460ff19169055565b606d54610100900460ff166148455760405162461bcd60e51b8152600401610bf590615f72565b8280546154ba90615a2e565b90600052602060002090601f0160209004810192826154dc5760008555615522565b82601f106154f557805160ff1916838001178555615522565b82800160010185558215615522579182015b82811115615522578251825591602001919060010190615507565b5061552e929150615532565b5090565b5b8082111561552e5760008155600101615533565b803563ffffffff8116811461555b57600080fd5b919050565b60006020828403121561557257600080fd5b61557b82615547565b9392505050565b80356001600160a01b038116811461555b57600080fd5b600080604083850312156155ac57600080fd5b6155b583615547565b91506155c360208401615582565b90509250929050565b6000602082840312156155de57600080fd5b5035919050565b600080604083850312156155f857600080fd5b61560183615547565b91506155c360208401615547565b60006020828403121561562157600080fd5b61557b82615582565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561565357600080fd5b61565c83615547565b9150602083013567ffffffffffffffff8082111561567957600080fd5b818501915085601f83011261568d57600080fd5b81358181111561569f5761569f61562a565b604051601f8201601f19908116603f011681019083821181831017156156c7576156c761562a565b816040528281528860208487010111156156e057600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b64ffffffffff81168114611a7857600080fd5b60006020828403121561572757600080fd5b813561557b81615702565b6000806040838503121561574557600080fd5b61574e83615547565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b8181101561579457835183529284019291840191600101615778565b50909695505050505050565b600081518084526020808501945080840160005b838110156157d95781516001600160a01b0316875295820195908201906001016157b4565b509495945050505050565b60208152600061557b60208301846157a0565b6000815180845260005b8181101561581d57602081850181015186830182015201615801565b8181111561582f576000602083870101525b50601f01601f19169290920160200192915050565b634e487b7160e01b600052602160045260246000fd5b6006811061587857634e487b7160e01b600052602160045260246000fd5b9052565b60006101008083526158908184018c6157f7565b905082810360208401526158a4818b6157f7565b9150506158b4604083018961585a565b63ffffffff9687166060830152608082019590955260a0810193909352931660c08201526001600160a01b0390921660e0909201919091529392505050565b60008060006060848603121561590857600080fd5b61591184615582565b925061591f60208501615582565b915061592d60408501615582565b90509250925092565b60008083601f84011261594857600080fd5b50813567ffffffffffffffff81111561596057600080fd5b6020830191508360208260051b850101111561597b57600080fd5b9250929050565b6000806000806040858703121561599857600080fd5b843567ffffffffffffffff808211156159b057600080fd5b6159bc88838901615936565b909650945060208701359150808211156159d557600080fd5b506159e287828801615936565b95989497509550505050565b60208152600061557b60208301846157f7565b634e487b7160e01b600052601160045260246000fd5b600082821015615a2957615a29615a01565b500390565b600181811c90821680615a4257607f821691505b60208210811415615a6357634e487b7160e01b600052602260045260246000fd5b50919050565b8054600090600181811c9080831680615a8357607f831692505b6020808410821415615aa557634e487b7160e01b600052602260045260246000fd5b838852818015615abc5760018114615ad057615afe565b60ff19861689830152604089019650615afe565b876000528160002060005b86811015615af65781548b8201850152908501908301615adb565b8a0183019750505b50505050505092915050565b6000815480845260208085019450836000528060002060005b838110156157d95781546001600160a01b03168752600182810154848901526002830154604089015260609097019660039092019101615b23565b6000815480845260208085019450836000528060002060005b838110156157d95781546001600160a01b031687529582019560019182019101615b77565b6000610140808452615bb081850184615a69565b90508381036020850152615bc78160018501615a69565b90506002830154615bde6040860160ff831661585a565b63ffffffff600882901c8116606087015260038501546080870152600485015460a087015285830360c0870152615c188360058701615b0a565b925060068501549150615c3560e0870182841663ffffffff169052565b5060201c6001600160a01b0316610100850152838103610120850152615c5e8160078501615b5e565b949350505050565b60208152600061557b6020830184615b9c565b600063ffffffff808316818516808303821115615c9857615c98615a01565b01949350505050565b600063ffffffff80831681811415615cbb57615cbb615a01565b6001019392505050565b600064ffffffffff808316818516808303821115615c9857615c98615a01565b60008219821115615cf857615cf8615a01565b500190565b604081526000615d106040830185615a69565b8281036020840152611b5281856157f7565b6000600019821415615d3657615d36615a01565b5060010190565b600060a08201905082518252602083015160208301526040830151615d65604084018261585a565b5064ffffffffff606084015116606083015260808301511515608083015292915050565b600081518084526020808501945080840160005b838110156157d957815180516001600160a01b0316885283810151848901526040908101519088015260609096019590820190600101615d9d565b8281526040602082015260008251610140806040850152615dfd6101808501836157f7565b91506020850151603f1980868503016060870152615e1b84836157f7565b935060408701519150615e31608087018361585a565b606087015163ffffffff811660a08801529150608087015160c087015260a087015160e087015260c08701519150610100818786030181880152615e758584615d89565b945060e08801519250610120615e928189018563ffffffff169052565b908801516001600160a01b03169387019390935291860151858403909201610160860152506136e282826157a0565b600060208284031215615ed357600080fd5b815161557b81615702565b6000816000190483118215151615615ef857615ef8615a01565b500290565b600082615f1a57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b60208101611da2828461585a565b634e487b7160e01b600052603160045260246000fd5b828152604060208201526000615c5e6040830184615b9c565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea26469706673582212204899a4d399bb9039e0335ce9b3dcd199baea89800841a627b06c248ae88573aa64736f6c634300080c0033
Deployed ByteCode
0x6080604052600436106103395760003560e01c8063715018a6116101ab578063b9e90367116100f7578063d84db9e811610095578063f1f521c61161006f578063f1f521c614610b1d578063f2fde38b14610b3d578063f8df6b0a14610b5d578063feded81014610b7d57600080fd5b8063d84db9e814610ad7578063ea35e3b114610aea578063f0cdceaa14610afd57600080fd5b8063c787a30f116100d1578063c787a30f14610a5a578063ca6c499114610a7a578063cf2a88b814610a9a578063d10ef14e14610ab057600080fd5b8063b9e9036714610a05578063bb15113214610a25578063c0c53b8b14610a3a57600080fd5b80638da5cb5b11610164578063a14c258f1161013e578063a14c258f1461098a578063ad20de39146109a8578063b055ba55146109c8578063b9ac4cd7146109e557600080fd5b80638da5cb5b1461092c5780638f2839701461094a578063979546bd1461096a57600080fd5b8063715018a6146108995780637a0db672146108ae5780637a92c4f8146108c45780637fcfb7c2146108e4578063809ee57d146108f75780638456cb591461091757600080fd5b8063536f34b3116102855780635f6949171161022357806366fdd38b116101fd57806366fdd38b146107b65780636a1eb5d9146107ea5780636f17d6111461080a5780636fc56f381461086157600080fd5b80635f694917146106f657806363fd3edf1461072357806366575f461461074357600080fd5b80635c975abb1161025f5780635c975abb146106655780635d953c8d146106895780635ed008d5146106a95780635f677a24146106d657600080fd5b8063536f34b31461058657806355c7948e146105a65780635ac473661461063757600080fd5b80631c8f6c08116102f257806342fa2d3c116102cc57806342fa2d3c14610506578063466429211461052657806347270d0f14610546578063521b7af71461056657600080fd5b80631c8f6c08146104945780633e806d11146104a75780633f4ba83a146104f157600080fd5b806301bc45c914610345578063098cc8f914610382578063118e29d1146103f9578063131f2dff1461041b57806317fb77de1461043b57806319d776c41461047457600080fd5b3661034057005b600080fd5b34801561035157600080fd5b50600054610365906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561038e57600080fd5b506103d061039d366004615560565b600f6020526000908152604090208054600182015460029092015464ffffffffff80831693600160281b90930416919084565b6040805164ffffffffff9586168152949093166020850152918301526060820152608001610379565b34801561040557600080fd5b50610419610414366004615560565b610b93565b005b34801561042757600080fd5b50610419610436366004615599565b61102d565b34801561044757600080fd5b5060015461045f90600160a01b900463ffffffff1681565b60405163ffffffff9091168152602001610379565b34801561048057600080fd5b5061041961048f366004615560565b61121a565b6104196104a2366004615560565b61139d565b3480156104b357600080fd5b506104db6104c23660046155cc565b60116020526000908152604090205464ffffffffff1681565b60405164ffffffffff9091168152602001610379565b3480156104fd57600080fd5b506104196115b5565b34801561051257600080fd5b506104196105213660046155e5565b611625565b34801561053257600080fd5b5061041961054136600461560f565b611753565b34801561055257600080fd5b50610419610561366004615640565b611838565b34801561057257600080fd5b50610419610581366004615715565b611967565b34801561059257600080fd5b506104196105a1366004615560565b611a53565b3480156105b257600080fd5b506106016105c13660046155cc565b600e6020526000908152604090208054600182015460029092015463ffffffff821692600160201b9092046001600160a01b0316919064ffffffffff1684565b6040805163ffffffff90951685526001600160a01b0390931660208501529183015264ffffffffff166060820152608001610379565b34801561064357600080fd5b50610657610652366004615560565b611a7b565b604051908152602001610379565b34801561067157600080fd5b5060d25460ff165b6040519015158152602001610379565b34801561069557600080fd5b506104196106a4366004615732565b611bdc565b3480156106b557600080fd5b506106c96106c4366004615599565b611d2c565b604051610379919061575c565b3480156106e257600080fd5b506104196106f1366004615560565b611da8565b34801561070257600080fd5b50610716610711366004615560565b611f21565b60405161037991906157e4565b34801561072f57600080fd5b50600654610365906001600160a01b031681565b34801561074f57600080fd5b5061079461075e366004615599565b6007602090815260009283526040808420909152908252902080546001820154600283015460039093015460ff90921692909184565b6040805194151585526020850193909352918301526060820152608001610379565b3480156107c257600080fd5b506107d66107d1366004615560565b611f94565b60405161037998979695949392919061587c565b3480156107f657600080fd5b5061041961080536600461560f565b6120ff565b34801561081657600080fd5b5061084661082536600461560f565b60096020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610379565b34801561086d57600080fd5b5061065761087c366004615599565b600b60209081526000928352604080842090915290825290205481565b3480156108a557600080fd5b506104196121b6565b3480156108ba57600080fd5b5061065760025481565b3480156108d057600080fd5b506106576108df366004615599565b6121c8565b6104196108f2366004615560565b6122a2565b34801561090357600080fd5b50610419610912366004615560565b6122bc565b34801561092357600080fd5b5061041961296a565b34801561093857600080fd5b5060a0546001600160a01b0316610365565b34801561095657600080fd5b5061041961096536600461560f565b6129d8565b34801561097657600080fd5b50610419610985366004615732565b612abc565b34801561099657600080fd5b506010546104db9064ffffffffff1681565b3480156109b457600080fd5b506104196109c3366004615599565b612cab565b3480156109d457600080fd5b5060045461045f9063ffffffff1681565b3480156109f157600080fd5b50610419610a00366004615640565b612cd0565b348015610a1157600080fd5b50610679610a20366004615599565b612dee565b348015610a3157600080fd5b506104db613311565b348015610a4657600080fd5b50610419610a553660046158f3565b61338f565b348015610a6657600080fd5b50610679610a75366004615599565b613524565b348015610a8657600080fd5b50610657610a95366004615599565b61369a565b348015610aa657600080fd5b5061065760055481565b348015610abc57600080fd5b5060105461036590600160281b90046001600160a01b031681565b610419610ae5366004615732565b6136ec565b610419610af8366004615982565b613d67565b348015610b0957600080fd5b50610419610b18366004615560565b613ecf565b348015610b2957600080fd5b506106c9610b38366004615560565b6140d9565b348015610b4957600080fd5b50610419610b5836600461560f565b614141565b348015610b6957600080fd5b50600154610365906001600160a01b031681565b348015610b8957600080fd5b50610657600a5481565b60008163ffffffff16118015610bbb575060015463ffffffff600160a01b9091048116908216105b6040518060400160405280600381526020016203430360ec1b81525090610bfe5760405162461bcd60e51b8152600401610bf591906159ee565b60405180910390fd5b50600463ffffffff821660009081526003602052604090206002015460ff166005811115610c2e57610c2e615844565b14610c4c57604051633fad04fd60e01b815260040160405180910390fd5b63ffffffff81166000908152600f6020526040902054600160281b900464ffffffffff16421115610c905760405163e3c8a69960e01b815260040160405180910390fd5b63ffffffff8082166000908152600c6020908152604080832033845290915281209091610cc0919083906141b716565b6000818152600e6020526040902054909150600160201b90046001600160a01b03163314610d235760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b2103ab739ba30b5b2b960811b6044820152606401610bf5565b63ffffffff82166000908152600b6020908152604080832033845290915290205480610d875760405162461bcd60e51b815260206004820152601360248201527216995c9bc81d5b9cdd185ad948185b5bdd5b9d606a1b6044820152606401610bf5565b6000610d9284611a7b565b9050600082821015610da45781610da6565b825b905080610df55760405162461bcd60e51b815260206004820152601760248201527f5a65726f2072657374616b6561626c6520616d6f756e740000000000000000006044820152606401610bf5565b63ffffffff85166000908152600b6020908152604080832033845290915281208054839290610e25908490615a17565b90915550506000848152600e602052604081206001018054839290610e4b908490615a17565b909155505063ffffffff85166000908152600f602052604081206001018054839290610e78908490615a17565b909155505080831415610ed45763ffffffff8086166000908152600c602090815260408083203384529091529020610eb291869061420616565b63ffffffff8086166000908152600d60205260409020610ed491869061420616565b63ffffffff8086166000908152600860205260409020610ef69133906142ff16565b610f1c5763ffffffff8086166000908152600860205260409020610f1c91339061432016565b63ffffffff851660009081526007602090815260408083203384529091529020805460ff19166001908117825501819055610f5685611a7b565b610fce5763ffffffff851660009081526003602081815260408084206002808201805460ff19169091179055600f835293819020805464ffffffffff19169055919052517f53298aec8df01cdc1d1539b1e5554f6d3c30740932225bd55f6543ec63b2b33991610fc591615c66565b60405180910390a15b63ffffffff85166000818152600b602090815260408083203380855290835292819020548151868152928301527f12dba112ba20d8135cf49069d4104d01b6390f480a38cf3e5a57c58b95928ea0910160405180910390a35050505050565b6000546001600160a01b031633148061105057506006546001600160a01b031633145b6040518060400160405280600381526020016231303560e81b8152509061108a5760405162461bcd60e51b8152600401610bf591906159ee565b5060008263ffffffff161180156110b3575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b815250906110ed5760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201526001600160a01b03821661112f5760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff808316600081815260036020818152604092839020600281015484518086019095529284526203430360ec1b91840191909152939192610100909104909116146111925760405162461bcd60e51b8152600401610bf591906159ee565b50600681015460408051600160201b9092046001600160a01b0390811683528416602083015263ffffffff8516917f5442836085bfb036899c4fd1524b33460232f78fbd7ef59d0e7673f1ba0e6787910160405180910390a260060180546001600160a01b03909216600160201b02640100000000600160c01b031990921691909117905550565b6000546001600160a01b031633148061123d57506006546001600160a01b031633145b6040518060400160405280600381526020016231303560e81b815250906112775760405162461bcd60e51b8152600401610bf591906159ee565b5060005b8163ffffffff168163ffffffff1610156113995760018054600160a01b9081900463ffffffff908116600090815260036020819052604082206002808201805460ff1981168255885488900487166101000264ffffffffff1990911617905554600480830191909155918101929092555460068201805463ffffffff19169184169190911790558354909392839260149261131a928592910416615c79565b825463ffffffff91821661010093840a9081029083021990911617909255600284015404166000908152600360205260409081902090517f25f55b6539644ded1f3c92d0d564a12d2ebe9dfab7eed8cd0eb2fb5ef5c43cc6925061137e9190615c66565b60405180910390a1508061139181615ca1565b91505061127b565b5050565b6113a56143a8565b60008163ffffffff161180156113cd575060015463ffffffff600160a01b9091048116908216105b6040518060400160405280600381526020016203430360ec1b815250906114075760405162461bcd60e51b8152600401610bf591906159ee565b50600563ffffffff821660009081526003602052604090206002015460ff16600581111561143757611437615844565b1461145557604051633fad04fd60e01b815260040160405180910390fd5b61145d613311565b63ffffffff82166000908152600f602052604090205461148b9190600160281b900464ffffffffff16615cc5565b64ffffffffff164210156114b2576040516378323b2960e11b815260040160405180910390fd5b63ffffffff811660009081526003602052604090206006810154600490910154600160201b9091046001600160a01b0316903382146115045760405163495a456d60e01b815260040160405180910390fd5b803414611524576040516377652a0760e01b815260040160405180910390fd5b63ffffffff83166000908152600360208190526040822001805434929061154c908490615ce5565b909155505063ffffffff8316600081815260036020908152604091829020600201805460ff1916905590518381526001600160a01b038516917f0591182b9ca17de6d0a2d6f9fbd53f1acc078be61937005fed5f81ebdb2bd632910160405180910390a3505050565b6000546001600160a01b03163314806115d857506006546001600160a01b031633145b6040518060400160405280600381526020016231303560e81b815250906116125760405162461bcd60e51b8152600401610bf591906159ee565b5061161b6143ee565b611623614437565b565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b0316331461166b5760405162461bcd60e51b8152600401610bf591906159ee565b5060008263ffffffff16118015611694575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b815250906116ce5760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff82811660008181526003602090815260409182902060060154825190851681529385169084015290917f15c3d4b8f6ffe91c1d4b83c010a7a2de5206159871365154b10babf04afada7f910160405180910390a263ffffffff9182166000908152600360205260409020600601805463ffffffff191691909216179055565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b031633146117995760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201526001600160a01b0382166117db5760405162461bcd60e51b8152600401610bf591906159ee565b506006546040516001600160a01b038084169216907f225c0996a226b195cf3751c09bf4a8ad9c1c8e09e95f39e64cb988039e0829f390600090a3600680546001600160a01b0319166001600160a01b0392909216919091179055565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b0316331461187e5760405162461bcd60e51b8152600401610bf591906159ee565b5060008263ffffffff161180156118a7575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b815250906118e15760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff82166000818152600360205260409081902090517fdf6d844af3be94e6c5d817effd7eec1f590946fa8edaea0b1698c33b57853b6c9161192e916001909101908590615cfd565b60405180910390a263ffffffff821660009081526003602090815260409091208251611962926001909201918401906154ae565b505050565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b031633146119ad5760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b602082015264ffffffffff82166119ed5760405162461bcd60e51b8152600401610bf591906159ee565b506010546040805164ffffffffff9283168152918316602083015233917ff21e158cb1bfbd1786f9b153608f087a9d800fbd08bcc0ab6eca4dc59b30f3c6910160405180910390a26010805464ffffffffff191664ffffffffff92909216919091179055565b611a5b614489565b611a636143a8565b611a6d81336144e5565b611a78600161010455565b50565b60015460009063ffffffff600160a01b909104811690831610611ab15760405163015f4fdd60e31b815260040160405180910390fd5b63ffffffff821660009081526003602081815260408084206004810154600f845291852060010154928490529283015460029093015490939192919060ff166005811115611b0157611b01615844565b1480611b395750600163ffffffff861660009081526003602052604090206002015460ff166005811115611b3757611b37615844565b145b15611b5b57611b488282615a17565b611b529084615a17565b95945050505050565b600463ffffffff861660009081526003602052604090206002015460ff166005811115611b8a57611b8a615844565b1480611bc25750600563ffffffff861660009081526003602052604090206002015460ff166005811115611bc057611bc0615844565b145b15611bd157611b528183615a17565b506000949350505050565b6000546001600160a01b0316331480611bff57506006546001600160a01b031633145b6040518060400160405280600381526020016231303560e81b81525090611c395760405162461bcd60e51b8152600401610bf591906159ee565b5060008263ffffffff16118015611c62575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b81525090611c9c5760405162461bcd60e51b8152600401610bf591906159ee565b5080611cbb5760405163064ec82760e51b815260040160405180910390fd5b63ffffffff821660008181526003602090815260409182902060040154825190815290810184905233917f87ebf7a4970fd064b3d13131e2ab4df542c54866a1221e000856f3e2b0401f32910160405180910390a363ffffffff909116600090815260036020526040902060040155565b63ffffffff82166000908152600c602090815260408083206001600160a01b0385168452825291829020805483518184028101840190945280845260609392830182828015611d9a57602002820191906000526020600020905b815481526020019060010190808311611d86575b505050505090505b92915050565b611db0614489565b611db86143a8565b60008163ffffffff16118015611de0575060015463ffffffff600160a01b9091048116908216105b6040518060400160405280600381526020016203430360ec1b81525090611e1a5760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff811660009081526007602090815260408083203384529091529020600281015480611e5e57604051635aa9184d60e01b815260040160405180910390fd5b6000826002018190555080826003016000828254611e7c9190615ce5565b90915550503360009081526009602052604081208054839290611ea0908490615a17565b90915550503360009081526009602052604081206001018054839290611ec7908490615ce5565b90915550611ed79050338261484d565b60405181815263ffffffff84169033907fc27842383b348601d177a4923a449417b1aaadd15e3556f552a5c63dd3b5fd5f9060200160405180910390a35050611a78600161010455565b63ffffffff8116600090815260086020908152604091829020805483518184028101840190945280845260609392830182828015611f8857602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611f6a575b50505050509050919050565b600360205260009081526040902080548190611faf90615a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054611fdb90615a2e565b80156120285780601f10611ffd57610100808354040283529160200191612028565b820191906000526020600020905b81548152906001019060200180831161200b57829003601f168201915b50505050509080600101805461203d90615a2e565b80601f016020809104026020016040519081016040528092919081815260200182805461206990615a2e565b80156120b65780601f1061208b576101008083540402835291602001916120b6565b820191906000526020600020905b81548152906001019060200180831161209957829003601f168201915b505050600284015460038501546004860154600690960154949560ff83169563ffffffff61010090940484169550919350918116906001600160a01b03600160201b9091041688565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b031633146121455760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201526001600160a01b0382166121875760405162461bcd60e51b8152600401610bf591906159ee565b50601080546001600160a01b03909216600160281b0265010000000000600160c81b0319909216919091179055565b6121be6148c1565b611623600061491b565b6000808363ffffffff161180156121f1575060015463ffffffff600160a01b9091048116908416105b6040518060400160405280600381526020016203430360ec1b8152509061222b5760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201526001600160a01b03831661226d5760405162461bcd60e51b8152600401610bf591906159ee565b505063ffffffff821660009081526007602090815260408083206001600160a01b038516845290915290206002015492915050565b6122aa614489565b6122b26143a8565b611a6d813461496d565b6122c4614489565b6122cc6143a8565b60008163ffffffff161180156122f4575060015463ffffffff600160a01b9091048116908216105b6040518060400160405280600381526020016203430360ec1b8152509061232e5760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff811660009081526003602052604081206002015460ff169081600581111561235e5761235e615844565b1415801561237e5750600281600581111561237b5761237b615844565b14155b801561239c5750600481600581111561239957612399615844565b14155b80156123ba575060058160058111156123b7576123b7615844565b14155b156123d857604051633fad04fd60e01b815260040160405180910390fd5b63ffffffff821660009081526007602090815260408083203384529091529020600101548061241a57604051633769617760e01b815260040160405180910390fd5b63ffffffff83166000908152600b60209081526040808320338452909152902054811480612467575063ffffffff83166000908152600b6020908152604080832033845290915290205415155b15612485576040516308aaef9d60e41b815260040160405180910390fd5b63ffffffff831660009081526007602090815260408083203384529091528120805460ff19169055600a805490826124bc83615d22565b9091555063ffffffff85166000908152600f60205260408120549192509064ffffffffff166124eb5742612509565b63ffffffff85166000908152600f602052604090205464ffffffffff165b9050612513613311565b6010546125279064ffffffffff1683615cc5565b6125319190615cc5565b6000838152601160209081526040808320805464ffffffffff95861664ffffffffff1991821617909155815160808101835263ffffffff808c16808352338387018181528487018d8152428b16606087019081528d8b52600e8a52888b209651875493516001600160a01b0316600160201b026001600160c01b0319909416908716179290921786555160018601555160029094018054949099169390941692909217909655845260089092529091206125ee92909190614fde16565b60008085600581111561260357612603615844565b14156126a15763ffffffff8616600081815260076020908152604080832033808552908352818420600101849055848452600b835281842090845282528083208390559282526003908190529181209091018054869290612665908490615a17565b9091555050336000908152600960205260408120600201805486929061268c908490615ce5565b9091555061269c9050338561484d565b6128c2565b60028560058111156126b5576126b5615844565b14806126d2575060048560058111156126d0576126d0615844565b145b806126ee575060058560058111156126ec576126ec615844565b145b156128c25763ffffffff8087166000908152600c60209081526040808320338452909152902061272091859061513216565b63ffffffff8087166000908152600d6020526040902061274291859061513216565b63ffffffff86166000908152600b6020908152604080832033845290915281208054869290612772908490615ce5565b909155506002905085600581111561278c5761278c615844565b1415612894575063ffffffff85166000908152600360205260408120600201805460ff19166004179055601054600191906127ce9064ffffffffff1642615ce5565b905060405180608001604052804264ffffffffff1681526020018264ffffffffff16815260200186600f60008b63ffffffff1663ffffffff168152602001908152602001600020600101546128239190615ce5565b815263ffffffff89166000818152600f602081815260408084206002810180549784019790975294909352908152845183549186015164ffffffffff908116600160281b0269ffffffffffffffffffff199093169116171782558301516001909101556060909101519055506128c2565b63ffffffff86166000908152600f6020526040812060010180548692906128bc908490615ce5565b90915550505b6040805160a081018252858152602080820186905263ffffffff8916600081815260039092529083902060020154909233927fec3d665be5d5336c6abc756ea7575c3fd1c70a51ec5e9379b09cf3ab2b1c14cb92909182019060ff16600581111561292f5761292f615844565b815264ffffffffff42166020820152851515604091820152516129529190615d3d565b60405180910390a35050505050611a78600161010455565b6000546001600160a01b031633148061298d57506006546001600160a01b031633145b6040518060400160405280600381526020016231303560e81b815250906129c75760405162461bcd60e51b8152600401610bf591906159ee565b506129d06143a8565b61162361518e565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b03163314612a1e5760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201526001600160a01b038216612a605760405162461bcd60e51b8152600401610bf591906159ee565b50600080546040516001600160a01b03808516939216917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f91a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b612ac4614489565b612acc6143a8565b60008263ffffffff16118015612af4575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b81525090612b2e5760405162461bcd60e51b8152600401610bf591906159ee565b50806000108015612b62575063ffffffff821660009081526007602090815260408083203384529091529020600201548111155b6040518060400160405280600381526020016234303360e81b81525090612b9c5760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff8216600090815260076020908152604080832033845290915281206002018054839290612bd0908490615a17565b909155505063ffffffff8216600090815260076020908152604080832033845290915281206003018054839290612c08908490615ce5565b90915550503360009081526009602052604081208054839290612c2c908490615a17565b90915550503360009081526009602052604081206001018054839290612c53908490615ce5565b90915550612c639050338261484d565b60405181815263ffffffff83169033907fc27842383b348601d177a4923a449417b1aaadd15e3556f552a5c63dd3b5fd5f9060200160405180910390a3611399600161010455565b612cb3614489565b612cbb6143a8565b612cc582826144e5565b611399600161010455565b60005460408051808201909152600381526231303160e81b6020820152906001600160a01b03163314612d165760405162461bcd60e51b8152600401610bf591906159ee565b5060008263ffffffff16118015612d3f575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b81525090612d795760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff82166000818152600360205260409081902090517fca0d97c04979cdd221a9ca3b50be10f120271defb13da02088526baaaf4dc5e891612dc0918590615cfd565b60405180910390a263ffffffff821660009081526003602090815260409091208251611962928401906154ae565b6001546040805180820190915260038152620c4c0d60ea1b60208201526000916001600160a01b03163314612e365760405162461bcd60e51b8152600401610bf591906159ee565b50612e3f614489565b612e476143a8565b60008363ffffffff16118015612e6f575060015463ffffffff600160a01b9091048116908416105b6040518060400160405280600381526020016203430360ec1b81525090612ea95760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201526001600160a01b038316612eeb5760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff831660009081526003602052604080822081516101408101909252805482908290612f1b90615a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054612f4790615a2e565b8015612f945780601f10612f6957610100808354040283529160200191612f94565b820191906000526020600020905b815481529060010190602001808311612f7757829003601f168201915b50505050508152602001600182018054612fad90615a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054612fd990615a2e565b80156130265780601f10612ffb57610100808354040283529160200191613026565b820191906000526020600020905b81548152906001019060200180831161300957829003601f168201915b5050509183525050600282015460209091019060ff16600581111561304d5761304d615844565b600581111561305e5761305e615844565b81526020016002820160019054906101000a900463ffffffff1663ffffffff1663ffffffff168152602001600382015481526020016004820154815260200160058201805480602002602001604051908101604052809291908181526020016000905b82821015613116576000848152602090819020604080516060810182526003860290920180546001600160a01b03168352600180820154848601526002909101549183019190915290835290920191016130c1565b50505090825250600682015463ffffffff8116602080840191909152600160201b9091046001600160a01b031660408084019190915260078401805482518185028101850190935280835260609094019391929091908301828280156131a557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613187575b5050505050815250509050600160058111156131c3576131c3615844565b816040015160058111156131d9576131d9615844565b14604051806040016040528060038152602001621a181960e91b815250906132145760405162461bcd60e51b8152600401610bf591906159ee565b508060a0015181608001511015604051806040016040528060038152602001621a181960e91b8152509061325b5760405162461bcd60e51b8152600401610bf591906159ee565b5060a081015163ffffffff851660009081526003602081905260408220018054839290613289908490615a17565b909155505063ffffffff851660009081526003602052604090206002908101805460ff191690911790556132bd848261484d565b836001600160a01b03167fe8d1cb53b728568e29eb765e9358c52f67ad996c9398e5e00d0597a93f4b8e1f82846040516132f8929190615dd8565b60405180910390a2600192505050611da2600161010455565b6000601060059054906101000a90046001600160a01b03166001600160a01b031663e4fefd656040518163ffffffff1660e01b8152600401602060405180830381865afa158015613366573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061338a9190615ec1565b905090565b606d54610100900460ff16158080156133af5750606d54600160ff909116105b806133c95750303b1580156133c95750606d5460ff166001145b61342c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610bf5565b606d805460ff19166001179055801561344f57606d805461ff0019166101001790555b6134576151cb565b61345f6151fa565b613467615229565b60018054600080546001600160a01b038089166001600160a01b0319928316179092558682166001600160c01b031990931692909217600160a01b178355600680549186169190921617905569054b40b1f852bda000006002556004805463ffffffff191690556224ea00600555600a55801561351e57606d805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6000808363ffffffff1611801561354d575060015463ffffffff600160a01b9091048116908416105b6040518060400160405280600381526020016203430360ec1b815250906135875760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff831660009081526003602052604081206002015460ff16908160058111156135b7576135b7615844565b141580156135d7575060028160058111156135d4576135d4615844565b14155b80156135f5575060048160058111156135f2576135f2615844565b14155b80156136135750600581600581111561361057613610615844565b14155b15613622576000915050611da2565b63ffffffff84166000908152600c602090815260408083206001600160a01b0387168452909152902054158015613682575063ffffffff841660009081526007602090815260408083206001600160a01b038716845290915290205460ff165b613690576000915050611da2565b5060019392505050565b63ffffffff82166000908152600b602090815260408083206001600160a01b0385168452909152812054816136ce85611a7b565b90506000828210156136e057816136e2565b825b9695505050505050565b6136f46143a8565b60008263ffffffff1611801561371c575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b815250906137565760405162461bcd60e51b8152600401610bf591906159ee565b5060408051808201909152600381526203130360ec1b60208201528161378f5760405162461bcd60e51b8152600401610bf591906159ee565b503481146137b057604051635aa8a63160e01b815260040160405180910390fd5b63ffffffff8216600090815260036020526040808220815161014081019092528054829082906137df90615a2e565b80601f016020809104026020016040519081016040528092919081815260200182805461380b90615a2e565b80156138585780601f1061382d57610100808354040283529160200191613858565b820191906000526020600020905b81548152906001019060200180831161383b57829003601f168201915b5050505050815260200160018201805461387190615a2e565b80601f016020809104026020016040519081016040528092919081815260200182805461389d90615a2e565b80156138ea5780601f106138bf576101008083540402835291602001916138ea565b820191906000526020600020905b8154815290600101906020018083116138cd57829003601f168201915b5050509183525050600282015460209091019060ff16600581111561391157613911615844565b600581111561392257613922615844565b81526020016002820160019054906101000a900463ffffffff1663ffffffff1663ffffffff168152602001600382015481526020016004820154815260200160058201805480602002602001604051908101604052809291908181526020016000905b828210156139da576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101613985565b50505090825250600682015463ffffffff8116602080840191909152600160201b9091046001600160a01b03166040808401919091526007840180548251818502810185019093528083526060909401939192909190830182828015613a6957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613a4b575b50505050508152505090508263ffffffff16816060015163ffffffff16146040518060400160405280600381526020016203430360ec1b81525090613ac15760405162461bcd60e51b8152600401610bf591906159ee565b5061010081015160408051808201909152600381526203130360ec1b6020820152906001600160a01b03163314613b0b5760405162461bcd60e51b8152600401610bf591906159ee565b50600281604001516005811115613b2457613b24615844565b1480613b455750600481604001516005811115613b4357613b43615844565b145b604051806040016040528060038152602001620d0c0d60ea1b81525090613b7f5760405162461bcd60e51b8152600401610bf591906159ee565b5060006127108260e0015163ffffffff1684613b9b9190615ede565b613ba59190615efd565b90506000613bb38285615a17565b63ffffffff86166000908152600860205260408120549192505b818163ffffffff161015613d1b5763ffffffff87811660009081526008602052604081209091613c0291908085169061525816565b63ffffffff891660009081526007602090815260408083206001600160a01b038516845290915281206001015460a089015192935091613c428784615ede565b613c4c9190615efd565b63ffffffff8b1660009081526007602090815260408083206001600160a01b0388168452909152812060020180549293508392909190613c8d908490615ce5565b90915550506001600160a01b03831660009081526009602052604081208054839290613cba908490615ce5565b909155505060405181815263ffffffff8b16906001600160a01b038516907fc07f0b98346cf06e2f8b833366d4588d66d719783c4caa59e3b83d176dffdc599060200160405180910390a35050508080613d1390615ca1565b915050613bcd565b50604080518681526020810185905263ffffffff88169133917fe133ea34406092819c1aff0fb28ce904a311b4ea77b1be0a3071eb5114848bb0910160405180910390a3505050505050565b613d6f614489565b613d776143a8565b60408051808201909152600381526203130360ec1b6020820152838214613db15760405162461bcd60e51b8152600401610bf591906159ee565b506000805b63ffffffff8116831115613e025783838263ffffffff16818110613ddc57613ddc615f1f565b9050602002013582613dee9190615ce5565b915080613dfa81615ca1565b915050613db6565b5060408051808201909152600381526203130360ec1b6020820152348214613e3d5760405162461bcd60e51b8152600401610bf591906159ee565b5060005b63ffffffff8116851115613ec257600086868363ffffffff16818110613e6957613e69615f1f565b9050602002016020810190613e7e9190615560565b9050600085858463ffffffff16818110613e9a57613e9a615f1f565b905060200201359050613ead828261496d565b50508080613eba90615ca1565b915050613e41565b505061351e600161010455565b60008163ffffffff16118015613ef7575060015463ffffffff600160a01b9091048116908216105b6040518060400160405280600381526020016203430360ec1b81525090613f315760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff81166000908152600f6020526040902054600160281b900464ffffffffff16421015613f765760405163096bc93560e01b815260040160405180910390fd5b600463ffffffff821660009081526003602052604090206002015460ff166005811115613fa557613fa5615844565b146140035763ffffffff81166000818152600360205260409081902060020154905133917fcffaeea967d1f98a5902a8390e76735c572b574041eabaf6cd4834795dc3ae0291613ff89160ff1690615f35565b60405180910390a350565b600061400e82611a7b565b9050806140555763ffffffff821660009081526003602090815260408083206002908101805460ff19169091179055600f9091529020805464ffffffffff1916905561407f565b801561407f5763ffffffff82166000908152600360205260409020600201805460ff191660051790555b63ffffffff82166000818152600360205260409081902060020154905133917fcffaeea967d1f98a5902a8390e76735c572b574041eabaf6cd4834795dc3ae02916140cd9160ff1690615f35565b60405180910390a35050565b63ffffffff81166000908152600d6020908152604091829020805483518184028101840190945280845260609392830182828015611f8857602002820191906000526020600020905b8154815260200190600101908083116141225750505050509050919050565b6141496148c1565b6001600160a01b0381166141ae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610bf5565b611a788161491b565b815460009082106141de57604051638140c4d560e01b815260048101839052602401610bf5565b8260000182815481106141f3576141f3615f1f565b9060005260206000200154905092915050565b60008181526001830160205260409020548061423857604051630802402960e01b815260048101839052602401610bf5565b82548390600019810190811061425057614250615f1f565b906000526020600020015483600001600183038154811061427357614273615f1f565b9060005260206000200181905550808360010160008560000160018503815481106142a0576142a0615f1f565b9060005260206000200154815260200190815260200160002081905550826000018054806142d0576142d0615f43565b600082815260208082208301600019908101839055909201909255928152600193909301909152506040812055565b6001600160a01b031660009081526001919091016020526040902054151590565b6001600160a01b038116600090815260018301602052604090205415614364576040516305e3de8f60e01b81526001600160a01b0382166004820152602401610bf5565b8154600181810184556000848152602080822090930180546001600160a01b039095166001600160a01b031990951685179055845493815293019052604090912055565b60d25460ff16156116235760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610bf5565b60d25460ff166116235760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610bf5565b61443f6143ee565b60d2805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60026101045414156144dd5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610bf5565b600261010455565b60008263ffffffff1611801561450d575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b815250906145475760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff82166000908152600c602090815260408083206001600160a01b038516845290915290205461457a575050565b63ffffffff8083166000908152600c602090815260408083206001600160a01b0386168452909152812090916145b3919083906141b716565b63ffffffff8085166000908152600d602052604090209192506145d9919083906152b016565b8015614616575063ffffffff8084166000908152600c602090815260408083206001600160a01b038716845290915290206146169183906152b016565b156146735763ffffffff8084166000908152600d6020526040902061463d91839061420616565b63ffffffff8084166000908152600c602090815260408083206001600160a01b0387168452909152902061467391839061420616565b60008181526011602052604090205464ffffffffff164210156146a9576040516304fdbaf560e31b815260040160405180910390fd5b63ffffffff83166000908152600b602090815260408083206001600160a01b0386168452909152902054806146de5750505050565b63ffffffff841660009081526007602090815260408083206001600160a01b03871684529091528120600101805483929061471a908490615a17565b909155505063ffffffff84166000818152600b602090815260408083206001600160a01b03881684528252808320839055928252600390819052918120909101805483929061476a908490615a17565b90915550506001600160a01b0383166000908152600960205260408120600201805483929061479a908490615ce5565b909155505063ffffffff84166000908152600f6020526040902060010154156147eb5763ffffffff84166000908152600f6020526040812060010180548392906147e5908490615a17565b90915550505b6147f5838261484d565b8363ffffffff16836001600160a01b03167f0794925e048d82c53c71e6dc062c1b087dfa237144ab91a80487be2d871e90268360405161483791815260200190565b60405180910390a350505050565b600161010455565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461489a576040519150601f19603f3d011682016040523d82523d6000602084013e61489f565b606091505b50509050806119625760405163bfa871c560e01b815260040160405180910390fd5b60a0546001600160a01b031633146116235760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610bf5565b60a080546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60408051808201909152600381526203130360ec1b6020820152816149a55760405162461bcd60e51b8152600401610bf591906159ee565b5060008263ffffffff161180156149ce575060015463ffffffff600160a01b9091048116908316105b6040518060400160405280600381526020016203430360ec1b81525090614a085760405162461bcd60e51b8152600401610bf591906159ee565b5063ffffffff821660009081526003602052604080822081516101408101909252805482908290614a3890615a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054614a6490615a2e565b8015614ab15780601f10614a8657610100808354040283529160200191614ab1565b820191906000526020600020905b815481529060010190602001808311614a9457829003601f168201915b50505050508152602001600182018054614aca90615a2e565b80601f0160208091040260200160405190810160405280929190818152602001828054614af690615a2e565b8015614b435780601f10614b1857610100808354040283529160200191614b43565b820191906000526020600020905b815481529060010190602001808311614b2657829003601f168201915b5050509183525050600282015460209091019060ff166005811115614b6a57614b6a615844565b6005811115614b7b57614b7b615844565b81526020016002820160019054906101000a900463ffffffff1663ffffffff1663ffffffff168152602001600382015481526020016004820154815260200160058201805480602002602001604051908101604052809291908181526020016000905b82821015614c33576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101614bde565b50505090825250600682015463ffffffff8116602080840191909152600160201b9091046001600160a01b03166040808401919091526007840180548251818502810185019093528083526060909401939192909190830182828015614cc257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311614ca4575b50505050508152505090508263ffffffff16816060015163ffffffff16146040518060400160405280600381526020016203430360ec1b81525090614d1a5760405162461bcd60e51b8152600401610bf591906159ee565b50600081604001516005811115614d3357614d33615844565b14158015614d575750600481604001516005811115614d5457614d54615844565b14155b15614d7557604051633fad04fd60e01b815260040160405180910390fd5b614d7f83336144e5565b6000614d8a84611a7b565b9050808311156040518060400160405280600381526020016234303160e81b81525090614dca5760405162461bcd60e51b8152600401610bf591906159ee565b50600082604001516005811115614de357614de3615844565b1415614e7357614df384846152c8565b80831415614e6e5763ffffffff8416600090815260036020818152604080842060028101805460ff19166001179055600f835293819020805464ffffffffff19169055919052517f53298aec8df01cdc1d1539b1e5554f6d3c30740932225bd55f6543ec63b2b33991614e6591615c66565b60405180910390a15b614f88565b600482604001516005811115614e8b57614e8b615844565b1415614f885763ffffffff84166000908152600f6020526040902054600160281b900464ffffffffff16421115614ed55760405163e5ba5ccd60e01b815260040160405180910390fd5b614edf84846152c8565b63ffffffff84166000908152600f602052604081206002018054859290614f07908490615ce5565b909155505082811415614f885763ffffffff841660009081526003602081815260408084206002808201805460ff19169091179055600f835293819020805464ffffffffff19169055919052517f53298aec8df01cdc1d1539b1e5554f6d3c30740932225bd55f6543ec63b2b33991614f7f91615c66565b60405180910390a15b63ffffffff841660009081526003602052604090819020905133917f867fd4118b670858f0e3b4413b49e93f261d5d021c3907d538a99c534f1be65b91614fd0918791615f59565b60405180910390a250505050565b6001600160a01b038116600090815260018301602052604090205480615022576040516328a32c1960e01b81526001600160a01b0383166004820152602401610bf5565b82548390600019810190811061503a5761503a615f1f565b60009182526020909120015483546001600160a01b03909116908490600019840190811061506a5761506a615f1f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550808360010160008560000160018503815481106150b7576150b7615f1f565b60009182526020808320909101546001600160a01b0316835282019290925260400190205582548390806150ed576150ed615f43565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b03939093168152600193909301909152506040812055565b60008181526001830160205260409020541561516457604051631a36250760e11b815260048101829052602401610bf5565b81546001818101845560008481526020808220909301849055845493815293019052604090912055565b6151966143a8565b60d2805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861446c3390565b606d54610100900460ff166151f25760405162461bcd60e51b8152600401610bf590615f72565b611623615424565b606d54610100900460ff166152215760405162461bcd60e51b8152600401610bf590615f72565b611623615454565b606d54610100900460ff166152505760405162461bcd60e51b8152600401610bf590615f72565b611623615487565b8154600090821061527f57604051637d1d2a8560e01b815260048101839052602401610bf5565b82600001828154811061529457615294615f1f565b6000918252602090912001546001600160a01b03169392505050565b60009081526001919091016020526040902054151590565b63ffffffff8216600090815260036020819052604082209081018054919284926152f3908490615ce5565b909155505060408051606081018252338082526020808301868152438486019081526005870180546001808201835560009283528583209751600390920290970180546001600160a01b0319166001600160a01b039092169190911781559251958301959095555160029091015563ffffffff87168352600781528383209183525220805460ff161580156153a7575063ffffffff80851660009081526008602052604090206153a59133906142ff16565b155b1561540557805460ff19166001908117825560078301805491820181556000908152602080822090920180546001600160a01b0319163390811790915563ffffffff8088168352600890935260409091206154059290919061432016565b828160010160008282546154199190615ce5565b909155505050505050565b606d54610100900460ff1661544b5760405162461bcd60e51b8152600401610bf590615f72565b6116233361491b565b606d54610100900460ff1661547b5760405162461bcd60e51b8152600401610bf590615f72565b60d2805460ff19169055565b606d54610100900460ff166148455760405162461bcd60e51b8152600401610bf590615f72565b8280546154ba90615a2e565b90600052602060002090601f0160209004810192826154dc5760008555615522565b82601f106154f557805160ff1916838001178555615522565b82800160010185558215615522579182015b82811115615522578251825591602001919060010190615507565b5061552e929150615532565b5090565b5b8082111561552e5760008155600101615533565b803563ffffffff8116811461555b57600080fd5b919050565b60006020828403121561557257600080fd5b61557b82615547565b9392505050565b80356001600160a01b038116811461555b57600080fd5b600080604083850312156155ac57600080fd5b6155b583615547565b91506155c360208401615582565b90509250929050565b6000602082840312156155de57600080fd5b5035919050565b600080604083850312156155f857600080fd5b61560183615547565b91506155c360208401615547565b60006020828403121561562157600080fd5b61557b82615582565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561565357600080fd5b61565c83615547565b9150602083013567ffffffffffffffff8082111561567957600080fd5b818501915085601f83011261568d57600080fd5b81358181111561569f5761569f61562a565b604051601f8201601f19908116603f011681019083821181831017156156c7576156c761562a565b816040528281528860208487010111156156e057600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b64ffffffffff81168114611a7857600080fd5b60006020828403121561572757600080fd5b813561557b81615702565b6000806040838503121561574557600080fd5b61574e83615547565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b8181101561579457835183529284019291840191600101615778565b50909695505050505050565b600081518084526020808501945080840160005b838110156157d95781516001600160a01b0316875295820195908201906001016157b4565b509495945050505050565b60208152600061557b60208301846157a0565b6000815180845260005b8181101561581d57602081850181015186830182015201615801565b8181111561582f576000602083870101525b50601f01601f19169290920160200192915050565b634e487b7160e01b600052602160045260246000fd5b6006811061587857634e487b7160e01b600052602160045260246000fd5b9052565b60006101008083526158908184018c6157f7565b905082810360208401526158a4818b6157f7565b9150506158b4604083018961585a565b63ffffffff9687166060830152608082019590955260a0810193909352931660c08201526001600160a01b0390921660e0909201919091529392505050565b60008060006060848603121561590857600080fd5b61591184615582565b925061591f60208501615582565b915061592d60408501615582565b90509250925092565b60008083601f84011261594857600080fd5b50813567ffffffffffffffff81111561596057600080fd5b6020830191508360208260051b850101111561597b57600080fd5b9250929050565b6000806000806040858703121561599857600080fd5b843567ffffffffffffffff808211156159b057600080fd5b6159bc88838901615936565b909650945060208701359150808211156159d557600080fd5b506159e287828801615936565b95989497509550505050565b60208152600061557b60208301846157f7565b634e487b7160e01b600052601160045260246000fd5b600082821015615a2957615a29615a01565b500390565b600181811c90821680615a4257607f821691505b60208210811415615a6357634e487b7160e01b600052602260045260246000fd5b50919050565b8054600090600181811c9080831680615a8357607f831692505b6020808410821415615aa557634e487b7160e01b600052602260045260246000fd5b838852818015615abc5760018114615ad057615afe565b60ff19861689830152604089019650615afe565b876000528160002060005b86811015615af65781548b8201850152908501908301615adb565b8a0183019750505b50505050505092915050565b6000815480845260208085019450836000528060002060005b838110156157d95781546001600160a01b03168752600182810154848901526002830154604089015260609097019660039092019101615b23565b6000815480845260208085019450836000528060002060005b838110156157d95781546001600160a01b031687529582019560019182019101615b77565b6000610140808452615bb081850184615a69565b90508381036020850152615bc78160018501615a69565b90506002830154615bde6040860160ff831661585a565b63ffffffff600882901c8116606087015260038501546080870152600485015460a087015285830360c0870152615c188360058701615b0a565b925060068501549150615c3560e0870182841663ffffffff169052565b5060201c6001600160a01b0316610100850152838103610120850152615c5e8160078501615b5e565b949350505050565b60208152600061557b6020830184615b9c565b600063ffffffff808316818516808303821115615c9857615c98615a01565b01949350505050565b600063ffffffff80831681811415615cbb57615cbb615a01565b6001019392505050565b600064ffffffffff808316818516808303821115615c9857615c98615a01565b60008219821115615cf857615cf8615a01565b500190565b604081526000615d106040830185615a69565b8281036020840152611b5281856157f7565b6000600019821415615d3657615d36615a01565b5060010190565b600060a08201905082518252602083015160208301526040830151615d65604084018261585a565b5064ffffffffff606084015116606083015260808301511515608083015292915050565b600081518084526020808501945080840160005b838110156157d957815180516001600160a01b0316885283810151848901526040908101519088015260609096019590820190600101615d9d565b8281526040602082015260008251610140806040850152615dfd6101808501836157f7565b91506020850151603f1980868503016060870152615e1b84836157f7565b935060408701519150615e31608087018361585a565b606087015163ffffffff811660a08801529150608087015160c087015260a087015160e087015260c08701519150610100818786030181880152615e758584615d89565b945060e08801519250610120615e928189018563ffffffff169052565b908801516001600160a01b03169387019390935291860151858403909201610160860152506136e282826157a0565b600060208284031215615ed357600080fd5b815161557b81615702565b6000816000190483118215151615615ef857615ef8615a01565b500290565b600082615f1a57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b60208101611da2828461585a565b634e487b7160e01b600052603160045260246000fd5b828152604060208201526000615c5e6040830184615b9c565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea26469706673582212204899a4d399bb9039e0335ce9b3dcd199baea89800841a627b06c248ae88573aa64736f6c634300080c0033