Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- TokenFlexiblePool
- Optimization enabled
- true
- Compiler version
- v0.8.19+commit.7dd6d404
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2023-07-15T16:03:37.575905Z
Constructor Arguments
0x000000000000000000000000f36763b909b0dfb578123f9764b0bbcaaef9a412000000000000000000000000180f4bd2563b95564c0142e269e70c6a84a2ab00000000000000000000000000180f4bd2563b95564c0142e269e70c6a84a2ab00
Arg [0] (address) : 0xf36763b909b0dfb578123f9764b0bbcaaef9a412
Arg [1] (address) : 0x180f4bd2563b95564c0142e269e70c6a84a2ab00
Arg [2] (address) : 0x180f4bd2563b95564c0142e269e70c6a84a2ab00
contracts/pool/TokenFlexiblePool.sol
// SPDX-License-Identifier: GPLv3
pragma solidity 0.8.19;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "./interfaces/ITokenPool.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract TokenFlexiblePool is Ownable, Pausable, ReentrancyGuard {
using SafeERC20 for IERC20;
struct UserInfo {
uint256 shares; // number of shares for a user
uint256 lastDepositedTime; // keeps track of deposited time for potential penalty
uint256 bbcAtLastUserAction; // keeps track of bbc deposited at the last user action
uint256 lastUserActionTime; // keeps track of the last user action time
}
IERC20 public immutable token; // Staking token
IERC20 public immutable bbc; // Earning token
ITokenPool public immutable bbcPool; //BBC pool
mapping(address => UserInfo) public userInfo;
mapping(address => uint256) public userRewardDebt;
mapping(address => uint256) public userRewardPending;
uint256 public totalShares;
uint256 public totalStakedAmount;
uint256 public feeDebt;
address public admin;
address public treasury;
uint256 private bbcPerShare;
bool public staking = true;
uint256 public constant MAX_PERFORMANCE_FEE = 2000; // 20%
uint256 public constant MAX_WITHDRAW_FEE = 500; // 5%
uint256 public constant MAX_WITHDRAW_FEE_PERIOD = 1 weeks; // 1 week
uint256 public constant MAX_WITHDRAW_AMOUNT_BOOSTER = 10010; // 1.001
uint256 public constant MIN_WITHDRAW_AMOUNT_BOOSTER = 10000; // 1
//When call bbcpool.withdrawByAmount function,there will be a loss of precision, so need to withdraw more.
uint256 public withdrawAmountBooster = 10001; // 1.0001
uint256 public performanceFee = 200; // 2%
uint256 public withdrawFee = 10; // 0.1%
uint256 public withdrawFeePeriod = 72 hours; // 3 days
event DepositBBC(
address indexed sender,
uint256 amount,
uint256 shares,
uint256 lastDepositedTime
);
event WithdrawShares(
address indexed sender,
uint256 amount,
uint256 shares
);
event ChargePerformanceFee(
address indexed sender,
uint256 amount,
uint256 shares
);
event ChargeWithdrawFee(address indexed sender, uint256 amount);
event Pause();
event Unpause();
event NewAdmin(address admin);
event NewTreasury(address treasury);
event NewPerformanceFee(uint256 performanceFee);
event NewWithdrawFee(uint256 withdrawFee);
event NewWithdrawFeePeriod(uint256 withdrawFeePeriod);
event NewWithdrawAmountBooster(uint256 withdrawAmountBooster);
event Harvest(address account, uint256 harvestAmount);
/**
* @notice Constructor
* @param _bbcPool: BBCPool contract
* @param _admin: address of the admin
* @param _treasury: address of the treasury (collects fees)
*/
constructor(ITokenPool _bbcPool, address _admin, address _treasury) {
require(address(_bbcPool) != address(0), "invalid _bbcPool");
require(_admin != address(0), "invalid _admin");
require(_treasury != address(0), "invalid _treasury");
token = IERC20(_bbcPool.token());
bbc = IERC20(_bbcPool.bbc());
bbcPool = _bbcPool;
admin = _admin;
treasury = _treasury;
// Infinite approve
token.safeIncreaseAllowance(address(_bbcPool), type(uint256).max);
}
/**
* @notice Checks if the msg.sender is the admin address
*/
modifier onlyAdmin() {
require(msg.sender == admin, "admin: wut?");
_;
}
function payFee(uint256 _fee) internal {
uint256 fee = feeDebt + _fee;
if (fee > 0) {
uint256 feePayable = bbc.balanceOf(address(this));
if (fee > feePayable) fee = feePayable;
if (fee > 0) {
bbc.safeTransfer(treasury, fee);
}
feeDebt = feeDebt + _fee - fee;
}
}
/**
* @notice Deposits funds into the BBC Flexible Pool.
* @dev Only possible when contract not paused.
* @param _amount: number of tokens to deposit (in BBC)
*/
function deposit(uint256 _amount) public whenNotPaused nonReentrant {
require(staking, "Not allowed to stake");
UserInfo storage user = userInfo[msg.sender];
//charge performanceFee
bool chargeFeeFromDeposite;
uint256 currentPerformanceFee;
uint256 performanceFeeShares;
if (user.shares > 0) {
if (isPureBBCPool()) {
uint256 totalAmount = (user.shares * balanceOf()) / totalShares;
uint256 earnAmount = totalAmount - user.bbcAtLastUserAction;
currentPerformanceFee = (earnAmount * performanceFee) / 10000;
if (currentPerformanceFee > 0) {
performanceFeeShares =
(currentPerformanceFee * totalShares) /
balanceOf();
user.shares -= performanceFeeShares;
totalShares -= performanceFeeShares;
if (_amount >= currentPerformanceFee) {
chargeFeeFromDeposite = true;
} else {
uint256 withdrawAmount = currentPerformanceFee;
//There will be a loss of precision when call withdrawByAmount, so need to withdraw more.
withdrawAmount =
(withdrawAmount * withdrawAmountBooster) /
10000;
bbcPool.withdrawByAmount(withdrawAmount);
currentPerformanceFee = available() >=
currentPerformanceFee
? currentPerformanceFee
: available();
token.safeTransfer(treasury, currentPerformanceFee);
emit ChargePerformanceFee(
msg.sender,
currentPerformanceFee,
performanceFeeShares
);
}
}
} else {
uint256 claimedAmount = bbcPool.claim();
bbcPerShare += (claimedAmount * 1 ether) / totalShares;
uint256 earnAmount = (bbcPerShare * user.shares) /
1 ether -
userRewardDebt[msg.sender];
if (user.shares > 0) {
userRewardPending[msg.sender] += earnAmount;
}
if (earnAmount > 0) {
currentPerformanceFee =
(earnAmount * performanceFee) /
10000;
payFee(currentPerformanceFee);
emit ChargePerformanceFee(
msg.sender,
currentPerformanceFee,
performanceFeeShares
);
// bbc.safeTransfer(msg.sender, earnAmount - currentPerformanceFee);
userRewardPending[msg.sender] -= currentPerformanceFee;
}
}
}
uint256 pool = balanceOf();
token.safeTransferFrom(msg.sender, address(this), _amount);
if (chargeFeeFromDeposite) {
token.safeTransfer(treasury, currentPerformanceFee);
emit ChargePerformanceFee(
msg.sender,
currentPerformanceFee,
performanceFeeShares
);
pool -= currentPerformanceFee;
}
uint256 currentShares;
if (totalShares != 0) {
currentShares = (_amount * totalShares) / pool;
} else {
currentShares = _amount;
}
user.shares += currentShares;
user.lastDepositedTime = block.timestamp;
totalShares += currentShares;
_earn();
if (!isPureBBCPool()) {
totalStakedAmount += _amount;
userRewardDebt[msg.sender] = (bbcPerShare * user.shares) / 1 ether;
}
user.bbcAtLastUserAction = (user.shares * balanceOf()) / totalShares;
user.lastUserActionTime = block.timestamp;
emit DepositBBC(msg.sender, _amount, currentShares, block.timestamp);
}
/**
* @notice Withdraws funds from the BBC Flexible Pool
* @param _shares: Number of shares to withdraw
*/
function withdraw(uint256 _shares) public nonReentrant {
UserInfo storage user = userInfo[msg.sender];
require(_shares > 0, "Nothing to withdraw");
require(_shares <= user.shares, "Withdraw amount exceeds balance");
//charge performanceFee
uint256 currentPerformanceFee;
uint256 performanceFeeShares;
bool _isBBCPool = isPureBBCPool();
if (_isBBCPool) {
uint256 totalAmount = (user.shares * balanceOf()) / totalShares;
uint256 earnAmount = totalAmount - user.bbcAtLastUserAction;
if (earnAmount > 0) {
currentPerformanceFee = (earnAmount * performanceFee) / 10000;
performanceFeeShares =
(currentPerformanceFee * totalShares) /
balanceOf();
user.shares -= performanceFeeShares;
totalShares -= performanceFeeShares;
}
} else {
uint256 claimedAmount = bbcPool.claim();
bbcPerShare += (claimedAmount * 1 ether) / totalShares;
uint256 earnAmount = (bbcPerShare * user.shares) /
1 ether -
userRewardDebt[msg.sender];
if (user.shares > 0) {
userRewardPending[msg.sender] += earnAmount;
}
if (earnAmount > 0) {
currentPerformanceFee = (earnAmount * performanceFee) / 10000;
payFee(currentPerformanceFee);
emit ChargePerformanceFee(
msg.sender,
currentPerformanceFee,
performanceFeeShares
);
// bbc.safeTransfer(msg.sender, earnAmount - currentPerformanceFee);
userRewardPending[msg.sender] -= currentPerformanceFee;
}
}
//Update withdraw shares
if (_shares > user.shares) {
_shares = user.shares;
}
//The current pool balance should not include currentPerformanceFee.
uint256 currentAmount = (_shares *
(balanceOf() - (_isBBCPool ? currentPerformanceFee : 0))) /
totalShares;
if (!isPureBBCPool()) totalStakedAmount -= currentAmount;
uint256 withdrawAmount = currentAmount +
(_isBBCPool ? currentPerformanceFee : 0);
if (staking) {
//There will be a loss of precision when call withdrawByAmount, so need to withdraw more.
withdrawAmount = (withdrawAmount * withdrawAmountBooster) / 10000;
bbcPool.withdrawByAmount(withdrawAmount);
}
uint256 currentWithdrawFee;
if (block.timestamp < user.lastDepositedTime + withdrawFeePeriod) {
currentWithdrawFee = (currentAmount * withdrawFee) / 10000;
currentAmount -= currentWithdrawFee;
}
if (_isBBCPool) {
//Combine two fees to reduce gas
uint256 totalFee = currentPerformanceFee + currentWithdrawFee;
if (totalFee > 0) {
totalFee = available() >= totalFee ? totalFee : available();
token.safeTransfer(treasury, totalFee);
if (currentPerformanceFee > 0) {
emit ChargePerformanceFee(
msg.sender,
currentPerformanceFee,
performanceFeeShares
);
}
if (currentWithdrawFee > 0) {
emit ChargeWithdrawFee(msg.sender, currentWithdrawFee);
}
}
} else {
if (currentWithdrawFee > 0) {
token.safeTransfer(treasury, currentWithdrawFee);
emit ChargeWithdrawFee(msg.sender, currentWithdrawFee);
}
}
currentAmount = available() >= currentAmount
? currentAmount
: available();
user.shares -= _shares;
totalShares -= _shares;
if (!_isBBCPool) {
userRewardDebt[msg.sender] = (bbcPerShare * user.shares) / 1 ether;
}
user.lastUserActionTime = block.timestamp;
if (user.shares > 0) {
user.bbcAtLastUserAction =
(user.shares * balanceOf()) /
totalShares;
} else {
user.bbcAtLastUserAction = 0;
uint256 pendingAmount = userRewardPending[msg.sender];
userRewardPending[msg.sender] = 0;
bbc.safeTransfer(msg.sender, pendingAmount);
}
token.safeTransfer(msg.sender, currentAmount);
emit WithdrawShares(msg.sender, currentAmount, _shares);
}
/**
* @notice Withdraws all funds for a user
*/
function withdrawAll() public nonReentrant {
withdraw(userInfo[msg.sender].shares);
}
function claim() public nonReentrant {
if (!isPureBBCPool()) {
UserInfo storage user = userInfo[msg.sender];
if (user.shares > 0) {
uint256 claimedAmount = bbcPool.claim();
bbcPerShare += (claimedAmount * 1 ether) / totalShares;
uint256 earnAmount = userRewardPending[msg.sender] +
(bbcPerShare * user.shares) /
1 ether -
userRewardDebt[msg.sender];
uint256 currentPerformanceFee = (earnAmount * performanceFee) /
10000;
payFee(currentPerformanceFee);
emit ChargePerformanceFee(
msg.sender,
currentPerformanceFee,
performanceFee
);
bbc.safeTransfer(
msg.sender,
earnAmount - currentPerformanceFee
);
userRewardPending[msg.sender] = 0;
userRewardDebt[msg.sender] =
(bbcPerShare * user.shares) /
1 ether;
emit Harvest(msg.sender, earnAmount);
}
}
}
/**
* @notice Sets admin address
* @dev Only callable by the contract owner.
*/
function setAdmin(address _admin) public onlyOwner {
require(_admin != address(0), "Cannot be zero address");
admin = _admin;
emit NewAdmin(admin);
}
/**
* @notice Sets treasury address
* @dev Only callable by the contract owner.
*/
function setTreasury(address _treasury) public onlyOwner {
require(_treasury != address(0), "Cannot be zero address");
treasury = _treasury;
emit NewTreasury(treasury);
}
/**
* @notice Sets performance fee
* @dev Only callable by the contract admin.
*/
function setPerformanceFee(uint256 _performanceFee) public onlyAdmin {
require(
_performanceFee <= MAX_PERFORMANCE_FEE,
"performanceFee cannot be more than MAX_PERFORMANCE_FEE"
);
performanceFee = _performanceFee;
emit NewPerformanceFee(performanceFee);
}
/**
* @notice Sets withdraw fee
* @dev Only callable by the contract admin.
*/
function setWithdrawFee(uint256 _withdrawFee) public onlyAdmin {
require(
_withdrawFee <= MAX_WITHDRAW_FEE,
"withdrawFee cannot be more than MAX_WITHDRAW_FEE"
);
withdrawFee = _withdrawFee;
emit NewWithdrawFee(withdrawFee);
}
/**
* @notice Sets withdraw fee period
* @dev Only callable by the contract admin.
*/
function setWithdrawFeePeriod(uint256 _withdrawFeePeriod) public onlyAdmin {
require(
_withdrawFeePeriod <= MAX_WITHDRAW_FEE_PERIOD,
"withdrawFeePeriod cannot be more than MAX_WITHDRAW_FEE_PERIOD"
);
withdrawFeePeriod = _withdrawFeePeriod;
emit NewWithdrawFeePeriod(withdrawFeePeriod);
}
/**
* @notice Sets withdraw amount booster
* @dev Only callable by the contract admin.
*/
function setWithdrawAmountBooster(
uint256 _withdrawAmountBooster
) public onlyAdmin {
require(
_withdrawAmountBooster >= MIN_WITHDRAW_AMOUNT_BOOSTER,
"withdrawAmountBooster cannot be less than MIN_WITHDRAW_AMOUNT_BOOSTER"
);
require(
_withdrawAmountBooster <= MAX_WITHDRAW_AMOUNT_BOOSTER,
"withdrawAmountBooster cannot be more than MAX_WITHDRAW_AMOUNT_BOOSTER"
);
withdrawAmountBooster = _withdrawAmountBooster;
emit NewWithdrawAmountBooster(withdrawAmountBooster);
}
/**
* @notice Withdraws from BBC Pool without caring about rewards.
* @dev EMERGENCY ONLY. Only callable by the contract admin.
*/
function emergencyWithdraw() public onlyAdmin {
require(staking, "No staking bbc");
staking = false;
bbcPool.withdrawAll();
}
/**
* @notice Withdraw unexpected tokens sent to the BBC Flexible Pool
*/
function inCaseTokensGetStuck(address _token) public onlyAdmin {
require(
_token != address(token),
"Token cannot be same as deposit token"
);
uint256 amount = IERC20(_token).balanceOf(address(this));
IERC20(_token).safeTransfer(msg.sender, amount);
}
/**
* @notice Triggers stopped state
* @dev Only possible when contract not paused.
*/
function pause() public onlyAdmin whenNotPaused {
_pause();
emit Pause();
}
/**
* @notice Returns to normal state
* @dev Only possible when contract is paused.
*/
function unpause() public onlyAdmin whenPaused {
_unpause();
emit Unpause();
}
/**
* @notice Calculates the price per share
*/
function getPricePerFullShare() public view returns (uint256) {
return totalShares == 0 ? 1e18 : (balanceOf() * 1e18) / totalShares;
}
/**
* @notice Custom logic for how much the pool to be borrowed
* @dev The contract puts 100% of the tokens to work.
*/
function available() public view returns (uint256) {
return token.balanceOf(address(this));
}
function getProfit(address _user) public view returns (uint256) {
UserInfo storage user = userInfo[_user];
if (user.shares == 0) return 0;
if (isPureBBCPool())
return
(getPricePerFullShare() * user.shares) /
1e18 -
user.bbcAtLastUserAction;
return
(bbcPool.getProfit(address(this)) * user.shares) /
totalShares +
userRewardPending[_user] +
(bbcPerShare * user.shares) /
1 ether -
userRewardDebt[_user];
}
/**
* @notice Calculates the total underlying tokens
* @dev It includes tokens held by the contract and held in BBCPool
*/
function balanceOf() public view returns (uint256) {
if (isPureBBCPool()) {
(uint256 shares, , , , , , , , ) = bbcPool.userInfo(address(this));
uint256 pricePerFullShare = bbcPool.getPricePerFullShare();
return
token.balanceOf(address(this)) +
(shares * pricePerFullShare) /
1e18;
}
return totalStakedAmount;
}
function isPureBBCPool() internal view returns (bool) {
return address(bbc) == address(token);
}
/**
* @notice Deposits tokens into BBCPool to earn staking rewards
*/
function _earn() internal {
uint256 bal = available();
if (bal > 0) {
bbcPool.deposit(bal, 0);
}
}
}
@openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
@openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev 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 anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
@openzeppelin/contracts/security/Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
@openzeppelin/contracts/security/ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
@openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [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://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
contracts/pool/interfaces/ITokenPool.sol
// SPDX-License-Identifier: GPLv3
pragma solidity 0.8.19;
interface ITokenPool {
struct UserInfo {
uint256 shares; // number of shares for a user.
uint256 lastDepositedTime; // keep track of deposited time for potential penalty.
uint256 cakeAtLastUserAction; // keep track of cake deposited at the last user action.
uint256 lastUserActionTime; // keep track of the last user action time.
uint256 lockStartTime; // lock start time.
uint256 lockEndTime; // lock end time.
uint256 userBoostedShare; // boost share, in order to give the user higher reward. The user only enjoys the reward, so the principal needs to be recorded as a debt.
bool locked; //lock status.
uint256 lockedAmount; // amount deposited during lock period.
}
function userInfo(
address user
)
external
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256,
uint256,
bool,
uint256
);
function BOOST_WEIGHT() external view returns (uint256);
function totalLockedAmount() external view returns (uint256);
function totalShares() external view returns (uint256);
function getPricePerFullShare() external view returns (uint256);
function deposit(uint256 _amount, uint256 _lockDuration) external;
function withdrawByAmount(uint256 _amount) external;
function withdraw(uint256 _shares) external;
function withdrawAll() external;
function claim() external returns (uint256);
function getProfit(address _account) external view returns (uint256);
function token() external view returns (address);
function bbc() external view returns (address);
}
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"]}},"optimizer":{"runs":200,"enabled":true},"libraries":{}}
Contract ABI
[{"type":"constructor","inputs":[{"type":"address","name":"_bbcPool","internalType":"contract ITokenPool"},{"type":"address","name":"_admin","internalType":"address"},{"type":"address","name":"_treasury","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_PERFORMANCE_FEE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_WITHDRAW_AMOUNT_BOOSTER","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_WITHDRAW_FEE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_WITHDRAW_FEE_PERIOD","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MIN_WITHDRAW_AMOUNT_BOOSTER","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"admin","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"available","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"bbc","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ITokenPool"}],"name":"bbcPool","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claim","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyWithdraw","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"feeDebt","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getPricePerFullShare","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getProfit","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"inCaseTokensGetStuck","inputs":[{"type":"address","name":"_token","internalType":"address"}]},{"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":"uint256","name":"","internalType":"uint256"}],"name":"performanceFee","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAdmin","inputs":[{"type":"address","name":"_admin","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPerformanceFee","inputs":[{"type":"uint256","name":"_performanceFee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTreasury","inputs":[{"type":"address","name":"_treasury","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWithdrawAmountBooster","inputs":[{"type":"uint256","name":"_withdrawAmountBooster","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWithdrawFee","inputs":[{"type":"uint256","name":"_withdrawFee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWithdrawFeePeriod","inputs":[{"type":"uint256","name":"_withdrawFeePeriod","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"staking","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"token","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalShares","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalStakedAmount","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"treasury","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"shares","internalType":"uint256"},{"type":"uint256","name":"lastDepositedTime","internalType":"uint256"},{"type":"uint256","name":"bbcAtLastUserAction","internalType":"uint256"},{"type":"uint256","name":"lastUserActionTime","internalType":"uint256"}],"name":"userInfo","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userRewardDebt","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userRewardPending","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"_shares","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawAll","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdrawAmountBooster","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdrawFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdrawFeePeriod","inputs":[]},{"type":"event","name":"ChargePerformanceFee","inputs":[{"type":"address","name":"sender","indexed":true},{"type":"uint256","name":"amount","indexed":false},{"type":"uint256","name":"shares","indexed":false}],"anonymous":false},{"type":"event","name":"ChargeWithdrawFee","inputs":[{"type":"address","name":"sender","indexed":true},{"type":"uint256","name":"amount","indexed":false}],"anonymous":false},{"type":"event","name":"DepositBBC","inputs":[{"type":"address","name":"sender","indexed":true},{"type":"uint256","name":"amount","indexed":false},{"type":"uint256","name":"shares","indexed":false},{"type":"uint256","name":"lastDepositedTime","indexed":false}],"anonymous":false},{"type":"event","name":"Harvest","inputs":[{"type":"address","name":"account","indexed":false},{"type":"uint256","name":"harvestAmount","indexed":false}],"anonymous":false},{"type":"event","name":"NewAdmin","inputs":[{"type":"address","name":"admin","indexed":false}],"anonymous":false},{"type":"event","name":"NewPerformanceFee","inputs":[{"type":"uint256","name":"performanceFee","indexed":false}],"anonymous":false},{"type":"event","name":"NewTreasury","inputs":[{"type":"address","name":"treasury","indexed":false}],"anonymous":false},{"type":"event","name":"NewWithdrawAmountBooster","inputs":[{"type":"uint256","name":"withdrawAmountBooster","indexed":false}],"anonymous":false},{"type":"event","name":"NewWithdrawFee","inputs":[{"type":"uint256","name":"withdrawFee","indexed":false}],"anonymous":false},{"type":"event","name":"NewWithdrawFeePeriod","inputs":[{"type":"uint256","name":"withdrawFeePeriod","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","indexed":true},{"type":"address","name":"newOwner","indexed":true}],"anonymous":false},{"type":"event","name":"Pause","inputs":[],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","indexed":false}],"anonymous":false},{"type":"event","name":"Unpause","inputs":[],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","indexed":false}],"anonymous":false},{"type":"event","name":"WithdrawShares","inputs":[{"type":"address","name":"sender","indexed":true},{"type":"uint256","name":"amount","indexed":false},{"type":"uint256","name":"shares","indexed":false}],"anonymous":false}]
Contract Creation Code
0x60e0604052600b805460ff19166001179055612711600c5560c8600d55600a600e556203f480600f553480156200003557600080fd5b50604051620034d5380380620034d5833981016040819052620000589162000658565b62000063336200028f565b6000805460ff60a01b19169055600180556001600160a01b038316620000c35760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a590817d89898d41bdbdb60821b60448201526064015b60405180910390fd5b6001600160a01b0382166200010c5760405162461bcd60e51b815260206004820152600e60248201526d34b73b30b634b2102fb0b236b4b760911b6044820152606401620000ba565b6001600160a01b038116620001585760405162461bcd60e51b8152602060048201526011602482015270696e76616c6964205f747265617375727960781b6044820152606401620000ba565b826001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000197573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001bd9190620006ac565b6001600160a01b03166080816001600160a01b031681525050826001600160a01b031663b44045866040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000215573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200023b9190620006ac565b6001600160a01b0390811660a05283811660c052600880546001600160a01b0319908116858416179091556009805490911683831617905560805162000286911684600019620002df565b505050620007b2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa15801562000331573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003579190620006d3565b620003639190620006ed565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b17909152919250620003bf91869190620003c516565b50505050565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65649082015260009062000414906001600160a01b0385169084906200049b565b80519091501562000496578080602001905181019062000435919062000715565b620004965760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401620000ba565b505050565b6060620004ac8484600085620004b4565b949350505050565b606082471015620005175760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401620000ba565b600080866001600160a01b031685876040516200053591906200075f565b60006040518083038185875af1925050503d806000811462000574576040519150601f19603f3d011682016040523d82523d6000602084013e62000579565b606091505b5090925090506200058d8783838762000598565b979650505050505050565b606083156200060c57825160000362000604576001600160a01b0385163b620006045760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620000ba565b5081620004ac565b620004ac8383815115620006235781518083602001fd5b8060405162461bcd60e51b8152600401620000ba91906200077d565b6001600160a01b03811681146200065557600080fd5b50565b6000806000606084860312156200066e57600080fd5b83516200067b816200063f565b60208501519093506200068e816200063f565b6040850151909250620006a1816200063f565b809150509250925092565b600060208284031215620006bf57600080fd5b8151620006cc816200063f565b9392505050565b600060208284031215620006e657600080fd5b5051919050565b808201808211156200070f57634e487b7160e01b600052601160045260246000fd5b92915050565b6000602082840312156200072857600080fd5b81518015158114620006cc57600080fd5b60005b83811015620007565781810151838201526020016200073c565b50506000910152565b600082516200077381846020870162000739565b9190910192915050565b60208152600082518060208401526200079e81604085016020870162000739565b601f01601f19169190910160400192915050565b60805160a05160c051612c446200089160003960008181610452015281816107f601528181610a6101528181610f220152818161130b0152818161138d0152818161193f01528181611a3401528181611ec201528181611fe8015261271701526000818161047901528181610d4c015281816110a60152818161232901528181612387015261241f01526000818161057101528181610b5701528181610c0901528181610d8a01528181610e7c01528181611441015281816119d501528181611bef01528181611c2e0152818161207501526122ff0152612c446000f3fe608060405234801561001057600080fd5b50600436106102695760003560e01c80638456cb5911610151578063c600e1dc116100c3578063df10b4e611610087578063df10b4e614610521578063e941fa781461052a578063f0f4426014610533578063f2fde38b14610546578063f851a44014610559578063fc0c546a1461056c57600080fd5b8063c600e1dc146104ca578063d4b0de2f146104dd578063db2e21bc146104e6578063dee838b1146104ee578063def68a9c1461050e57600080fd5b80638dd31366116101155780638dd313661461043a57806390406df41461044d578063b440458614610474578063b6ac642a1461049b578063b6b55f25146104ae578063bdca9165146104c157600080fd5b80638456cb5914610407578063853828b61461040f57806387788782146104175780638a180eea146104205780638da5cb5b1461042957600080fd5b80634cf088d9116101ea578063704b6c02116101ae578063704b6c02146103c057806370897b23146103d3578063715018a6146103e6578063722713f7146103ee57806377c7b8fc146103f657806382dba642146103fe57600080fd5b80634cf088d9146103555780634e71d92d14610372578063567e98f91461037a5780635c975abb1461038357806361d027b31461039557600080fd5b80632f0c7a11116102315780632f0c7a11146103135780633a98ef391461031c5780633f4ba83a1461032557806348a0d7541461032d5780634bf6f9e71461033557600080fd5b806314c9253e1461026e5780631959a0021461028a5780631efac1b8146102e15780632cfc5f01146102f65780632e1a7d4d14610300575b600080fd5b610277600c5481565b6040519081526020015b60405180910390f35b6102c16102983660046129e0565b600260208190526000918252604090912080546001820154928201546003909201549092919084565b604080519485526020850193909352918301526060820152608001610281565b6102f46102ef366004612a09565b610593565b005b61027762093a8081565b6102f461030e366004612a09565b61067b565b61027760075481565b61027760055481565b6102f4610dff565b610277610e64565b6102776103433660046129e0565b60036020526000908152604090205481565b600b546103629060ff1681565b6040519015158152602001610281565b6102f4610ef4565b61027760065481565b600054600160a01b900460ff16610362565b6009546103a8906001600160a01b031681565b6040516001600160a01b039091168152602001610281565b6102f46103ce3660046129e0565b61115d565b6102f46103e1366004612a09565b611202565b6102f46112d2565b6102776112e4565b6102776114cc565b61027761271081565b6102f461150c565b6102f4611571565b610277600d5481565b61027761271a81565b6000546001600160a01b03166103a8565b6102f4610448366004612a09565b611592565b6103a87f000000000000000000000000000000000000000000000000000000000000000081565b6103a87f000000000000000000000000000000000000000000000000000000000000000081565b6102f46104a9366004612a09565b6116fd565b6102f46104bc366004612a09565b6117c7565b6102776107d081565b6102776104d83660046129e0565b611dd5565b6102776101f481565b6102f4611f57565b6102776104fc3660046129e0565b60046020526000908152604090205481565b6102f461051c3660046129e0565b612049565b610277600f5481565b610277600e5481565b6102f46105413660046129e0565b612187565b6102f46105543660046129e0565b61222c565b6008546103a8906001600160a01b031681565b6103a87f000000000000000000000000000000000000000000000000000000000000000081565b6008546001600160a01b031633146105c65760405162461bcd60e51b81526004016105bd90612a22565b60405180910390fd5b62093a8081111561063f5760405162461bcd60e51b815260206004820152603d60248201527f7769746864726177466565506572696f642063616e6e6f74206265206d6f726560448201527f207468616e204d41585f57495448445241575f4645455f504552494f4400000060648201526084016105bd565b600f8190556040518181527fb89ddaddb7435be26824cb48d2d0186c9525a2e1ec057abcb502704cdc0686cc906020015b60405180910390a150565b6106836122a2565b336000908152600260205260409020816106d55760405162461bcd60e51b81526020600482015260136024820152724e6f7468696e6720746f20776974686472617760681b60448201526064016105bd565b80548211156107265760405162461bcd60e51b815260206004820152601f60248201527f576974686472617720616d6f756e7420657863656564732062616c616e63650060448201526064016105bd565b60008060006107336122fb565b905080156107f25760006005546107486112e4565b86546107549190612a5d565b61075e9190612a7a565b905060008560020154826107729190612a9c565b905080156107eb57612710600d548261078b9190612a5d565b6107959190612a7a565b945061079f6112e4565b6005546107ac9087612a5d565b6107b69190612a7a565b9350838660000160008282546107cc9190612a9c565b9250508190555083600560008282546107e59190612a9c565b90915550505b5050610998565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634e71d92d6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610854573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108789190612aaf565b60055490915061089082670de0b6b3a7640000612a5d565b61089a9190612a7a565b600a60008282546108ab9190612ac8565b9091555050336000908152600360205260408120548654600a54670de0b6b3a7640000916108d891612a5d565b6108e29190612a7a565b6108ec9190612a9c565b86549091501561091b573360009081526004602052604081208054839290610915908490612ac8565b90915550505b801561099557612710600d54826109329190612a5d565b61093c9190612a7a565b945061094785612357565b60408051868152602081018690523391600080516020612bef833981519152910160405180910390a2336000908152600460205260408120805487929061098f908490612a9c565b90915550505b50505b83548511156109a657835494505b6000600554826109b75760006109b9565b845b6109c16112e4565b6109cb9190612a9c565b6109d59088612a5d565b6109df9190612a7a565b90506109e96122fb565b610a055780600660008282546109ff9190612a9c565b90915550505b600082610a13576000610a15565b845b610a1f9083612ac8565b600b5490915060ff1615610ac657612710600c5482610a3e9190612a5d565b610a489190612a7a565b604051635521e9bf60e01b8152600481018290529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635521e9bf90602401600060405180830381600087803b158015610aad57600080fd5b505af1158015610ac1573d6000803e3d6000fd5b505050505b6000600f548760010154610ada9190612ac8565b421015610b0b57612710600e5484610af29190612a5d565b610afc9190612a7a565b9050610b088184612a9c565b92505b8315610bf2576000610b1d8288612ac8565b90508015610bec5780610b2e610e64565b1015610b4157610b3c610e64565b610b43565b805b600954909150610b80906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911683612469565b8615610bb05760408051888152602081018890523391600080516020612bef833981519152910160405180910390a25b8115610bec5760405182815233907ff4451cbaeb1fedd1db1eed585be4980b066afa1fa1c2a59f361ca67191e9695a9060200160405180910390a25b50610c68565b8015610c6857600954610c32906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911683612469565b60405181815233907ff4451cbaeb1fedd1db1eed585be4980b066afa1fa1c2a59f361ca67191e9695a9060200160405180910390a25b82610c71610e64565b1015610c8457610c7f610e64565b610c86565b825b925087876000016000828254610c9c9190612a9c565b925050819055508760056000828254610cb59190612a9c565b90915550849050610cf3578654600a54670de0b6b3a764000091610cd891612a5d565b610ce29190612a7a565b336000908152600360205260409020555b426003880155865415610d2b57600554610d0b6112e4565b8854610d179190612a5d565b610d219190612a7a565b6002880155610d7d565b600060028801819055338082526004602052604082208054929055610d7b907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169083612469565b505b610db16001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163385612469565b60408051848152602081018a905233917fb605f60b5ff13848ba5a9234329676801d97e41362092b50014cad41fb2b7bfc910160405180910390a250505050505050610dfc60018055565b50565b6008546001600160a01b03163314610e295760405162461bcd60e51b81526004016105bd90612a22565b610e316124d1565b610e39612521565b6040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610ecb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eef9190612aaf565b905090565b610efc6122a2565b610f046122fb565b611152573360009081526002602052604090208054156111505760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634e71d92d6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa49190612aaf565b600554909150610fbc82670de0b6b3a7640000612a5d565b610fc69190612a7a565b600a6000828254610fd79190612ac8565b9091555050336000908152600360205260408120548354600a54670de0b6b3a76400009161100491612a5d565b61100e9190612a7a565b336000908152600460205260409020546110289190612ac8565b6110329190612a9c565b90506000612710600d54836110479190612a5d565b6110519190612a7a565b905061105c81612357565b600d546040513391600080516020612bef8339815191529161108691858252602082015260400190565b60405180910390a26110cd3361109c8385612a9c565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169190612469565b336000908152600460205260408120558354600a54670de0b6b3a7640000916110f591612a5d565b6110ff9190612a7a565b336000818152600360209081526040918290209390935580519182529181018490527fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba910160405180910390a15050505b505b61115b60018055565b565b611165612576565b6001600160a01b0381166111b45760405162461bcd60e51b815260206004820152601660248201527543616e6e6f74206265207a65726f206164647265737360501b60448201526064016105bd565b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c90602001610670565b6008546001600160a01b0316331461122c5760405162461bcd60e51b81526004016105bd90612a22565b6107d081111561129d5760405162461bcd60e51b815260206004820152603660248201527f706572666f726d616e63654665652063616e6e6f74206265206d6f7265207468604482015275616e204d41585f504552464f524d414e43455f46454560501b60648201526084016105bd565b600d8190556040518181527fefeafcf03e479a9566d7ef321b4816de0ba19cfa3cd0fae2f8c5f4a0afb342c490602001610670565b6112da612576565b61115b60006125d0565b60006112ee6122fb565b156114c557604051630cacd00160e11b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690631959a0029060240161012060405180830381865afa15801561135b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137f9190612af0565b5050505050505050905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166377c7b8fc6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140d9190612aaf565b9050670de0b6b3a76400006114228284612a5d565b61142c9190612a7a565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611490573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b49190612aaf565b6114be9190612ac8565b9250505090565b5060065490565b60006005546000146114ff576005546114e36112e4565b6114f590670de0b6b3a7640000612a5d565b610eef9190612a7a565b50670de0b6b3a764000090565b6008546001600160a01b031633146115365760405162461bcd60e51b81526004016105bd90612a22565b61153e612620565b61154661266d565b6040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6115796122a2565b336000908152600260205260409020546111529061067b565b6008546001600160a01b031633146115bc5760405162461bcd60e51b81526004016105bd90612a22565b6127108110156116425760405162461bcd60e51b815260206004820152604560248201527f7769746864726177416d6f756e74426f6f737465722063616e6e6f742062652060448201527f6c657373207468616e204d494e5f57495448445241575f414d4f554e545f424f60648201526427a9aa22a960d91b608482015260a4016105bd565b61271a8111156116c85760405162461bcd60e51b815260206004820152604560248201527f7769746864726177416d6f756e74426f6f737465722063616e6e6f742062652060448201527f6d6f7265207468616e204d41585f57495448445241575f414d4f554e545f424f60648201526427a9aa22a960d91b608482015260a4016105bd565b600c8190556040518181527f6029d76ffeb0d7684607fa1164412e907a5fcb0849976856b2f98f0ae49fb45790602001610670565b6008546001600160a01b031633146117275760405162461bcd60e51b81526004016105bd90612a22565b6101f48111156117925760405162461bcd60e51b815260206004820152603060248201527f77697468647261774665652063616e6e6f74206265206d6f7265207468616e2060448201526f4d41585f57495448445241575f46454560801b60648201526084016105bd565b600e8190556040518181527fd5fe46099fa396290a7f57e36c3c3c8774e2562c18ed5d1dcc0fa75071e03f1d90602001610670565b6117cf612620565b6117d76122a2565b600b5460ff166118205760405162461bcd60e51b81526020600482015260146024820152734e6f7420616c6c6f77656420746f207374616b6560601b60448201526064016105bd565b33600090815260026020526040812080549091908190819015611bd6576118456122fb565b15611a305760006005546118576112e4565b86546118639190612a5d565b61186d9190612a7a565b905060008560020154826118819190612a9c565b9050612710600d54826118949190612a5d565b61189e9190612a7a565b93508315611a29576118ae6112e4565b6005546118bb9086612a5d565b6118c59190612a7a565b9250828660000160008282546118db9190612a9c565b9250508190555082600560008282546118f49190612a9c565b90915550508387106119095760019450611a29565b600c5484906127109061191c9083612a5d565b6119269190612a7a565b604051635521e9bf60e01b8152600481018290529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635521e9bf90602401600060405180830381600087803b15801561198b57600080fd5b505af115801561199f573d6000803e3d6000fd5b50505050846119ac610e64565b10156119bf576119ba610e64565b6119c1565b845b6009549095506119fe906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911687612469565b60408051868152602081018690523391600080516020612bef833981519152910160405180910390a2505b5050611bd6565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634e71d92d6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611a92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab69190612aaf565b600554909150611ace82670de0b6b3a7640000612a5d565b611ad89190612a7a565b600a6000828254611ae99190612ac8565b9091555050336000908152600360205260408120548654600a54670de0b6b3a764000091611b1691612a5d565b611b209190612a7a565b611b2a9190612a9c565b865490915015611b59573360009081526004602052604081208054839290611b53908490612ac8565b90915550505b8015611bd357612710600d5482611b709190612a5d565b611b7a9190612a7a565b9350611b8584612357565b60408051858152602081018590523391600080516020612bef833981519152910160405180910390a23360009081526004602052604081208054869290611bcd908490612a9c565b90915550505b50505b6000611be06112e4565b9050611c176001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163330896126b0565b8315611c8d57600954611c57906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911685612469565b60408051848152602081018490523391600080516020612bef833981519152910160405180910390a2611c8a8382612a9c565b90505b6000600554600014611cb9578160055488611ca89190612a5d565b611cb29190612a7a565b9050611cbc565b50855b80866000016000828254611cd09190612ac8565b909155505042600187015560058054829190600090611cf0908490612ac8565b90915550611cfe90506126e8565b611d066122fb565b611d54578660066000828254611d1c9190612ac8565b90915550508554600a54670de0b6b3a764000091611d3991612a5d565b611d439190612a7a565b336000908152600360205260409020555b600554611d5f6112e4565b8754611d6b9190612a5d565b611d759190612a7a565b6002870155426003870181905560408051898152602081018490529081019190915233907ffe27466970a725dca4ea770cabb48c64bd971497150d85072f292a281e5aa82e9060600160405180910390a2505050505050610dfc60018055565b6001600160a01b038116600090815260026020526040812080548203611dfe5750600092915050565b611e066122fb565b15611e495760028101548154670de0b6b3a764000090611e246114cc565b611e2e9190612a5d565b611e389190612a7a565b611e429190612a9c565b9392505050565b6001600160a01b0383166000908152600360205260409020548154600a54670de0b6b3a764000091611e7a91612a5d565b611e849190612a7a565b6001600160a01b038086166000908152600460208190526040918290205460055487549351633180387760e21b8152309381019390935290939092917f00000000000000000000000000000000000000000000000000000000000000009091169063c600e1dc90602401602060405180830381865afa158015611f0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2f9190612aaf565b611f399190612a5d565b611f439190612a7a565b611f4d9190612ac8565b611e389190612ac8565b6008546001600160a01b03163314611f815760405162461bcd60e51b81526004016105bd90612a22565b600b5460ff16611fc45760405162461bcd60e51b815260206004820152600e60248201526d4e6f207374616b696e672062626360901b60448201526064016105bd565b600b805460ff191690556040805163429c145b60e11b815290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163853828b691600480830192600092919082900301818387803b15801561202f57600080fd5b505af1158015612043573d6000803e3d6000fd5b50505050565b6008546001600160a01b031633146120735760405162461bcd60e51b81526004016105bd90612a22565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b0316036121025760405162461bcd60e51b815260206004820152602560248201527f546f6b656e2063616e6e6f742062652073616d65206173206465706f736974206044820152643a37b5b2b760d91b60648201526084016105bd565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015612149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216d9190612aaf565b90506121836001600160a01b0383163383612469565b5050565b61218f612576565b6001600160a01b0381166121de5760405162461bcd60e51b815260206004820152601660248201527543616e6e6f74206265207a65726f206164647265737360501b60448201526064016105bd565b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527fafa147634b29e2c7bd53ce194256b9f41cfb9ba3036f2b822fdd1d965beea08690602001610670565b612234612576565b6001600160a01b0381166122995760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105bd565b610dfc816125d0565b6002600154036122f45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105bd565b6002600155565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614905090565b6000816007546123679190612ac8565b90508015612183576040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156123d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123fa9190612aaf565b905080821115612408578091505b811561244857600954612448906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911684612469565b81836007546124579190612ac8565b6124619190612a9c565b600755505050565b6040516001600160a01b0383166024820152604481018290526124cc90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261277e565b505050565b600054600160a01b900460ff1661115b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016105bd565b6125296124d1565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000546001600160a01b0316331461115b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105bd565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600054600160a01b900460ff161561115b5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016105bd565b612675612620565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125593390565b6040516001600160a01b03808516602483015283166044820152606481018290526120439085906323b872dd60e01b90608401612495565b60006126f2610e64565b90508015610dfc57604051631c57762b60e31b815260048101829052600060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e2bbb15890604401600060405180830381600087803b15801561276357600080fd5b505af1158015612777573d6000803e3d6000fd5b5050505050565b60006127d3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166128509092919063ffffffff16565b8051909150156124cc57808060200190518101906127f19190612b60565b6124cc5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105bd565b606061285f8484600085612867565b949350505050565b6060824710156128c85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105bd565b600080866001600160a01b031685876040516128e49190612b9f565b60006040518083038185875af1925050503d8060008114612921576040519150601f19603f3d011682016040523d82523d6000602084013e612926565b606091505b509150915061293787838387612942565b979650505050505050565b606083156129b15782516000036129aa576001600160a01b0385163b6129aa5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105bd565b508161285f565b61285f83838151156129c65781518083602001fd5b8060405162461bcd60e51b81526004016105bd9190612bbb565b6000602082840312156129f257600080fd5b81356001600160a01b0381168114611e4257600080fd5b600060208284031215612a1b57600080fd5b5035919050565b6020808252600b908201526a61646d696e3a207775743f60a81b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417612a7457612a74612a47565b92915050565b600082612a9757634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115612a7457612a74612a47565b600060208284031215612ac157600080fd5b5051919050565b80820180821115612a7457612a74612a47565b80518015158114612aeb57600080fd5b919050565b60008060008060008060008060006101208a8c031215612b0f57600080fd5b8951985060208a0151975060408a0151965060608a0151955060808a0151945060a08a0151935060c08a01519250612b4960e08b01612adb565b91506101008a015190509295985092959850929598565b600060208284031215612b7257600080fd5b611e4282612adb565b60005b83811015612b96578181015183820152602001612b7e565b50506000910152565b60008251612bb1818460208701612b7b565b9190910192915050565b6020815260008251806020840152612bda816040850160208701612b7b565b601f01601f1916919091016040019291505056feba099d38a7da8262f6dc89809a028ddb51ce1f8fe4d9c7554ef909078f6e10c9a2646970667358221220872712b1015d7a91a9674826549982c95bc727d6c063c192809e6c056a4d661a64736f6c63430008130033000000000000000000000000f36763b909b0dfb578123f9764b0bbcaaef9a412000000000000000000000000180f4bd2563b95564c0142e269e70c6a84a2ab00000000000000000000000000180f4bd2563b95564c0142e269e70c6a84a2ab00
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106102695760003560e01c80638456cb5911610151578063c600e1dc116100c3578063df10b4e611610087578063df10b4e614610521578063e941fa781461052a578063f0f4426014610533578063f2fde38b14610546578063f851a44014610559578063fc0c546a1461056c57600080fd5b8063c600e1dc146104ca578063d4b0de2f146104dd578063db2e21bc146104e6578063dee838b1146104ee578063def68a9c1461050e57600080fd5b80638dd31366116101155780638dd313661461043a57806390406df41461044d578063b440458614610474578063b6ac642a1461049b578063b6b55f25146104ae578063bdca9165146104c157600080fd5b80638456cb5914610407578063853828b61461040f57806387788782146104175780638a180eea146104205780638da5cb5b1461042957600080fd5b80634cf088d9116101ea578063704b6c02116101ae578063704b6c02146103c057806370897b23146103d3578063715018a6146103e6578063722713f7146103ee57806377c7b8fc146103f657806382dba642146103fe57600080fd5b80634cf088d9146103555780634e71d92d14610372578063567e98f91461037a5780635c975abb1461038357806361d027b31461039557600080fd5b80632f0c7a11116102315780632f0c7a11146103135780633a98ef391461031c5780633f4ba83a1461032557806348a0d7541461032d5780634bf6f9e71461033557600080fd5b806314c9253e1461026e5780631959a0021461028a5780631efac1b8146102e15780632cfc5f01146102f65780632e1a7d4d14610300575b600080fd5b610277600c5481565b6040519081526020015b60405180910390f35b6102c16102983660046129e0565b600260208190526000918252604090912080546001820154928201546003909201549092919084565b604080519485526020850193909352918301526060820152608001610281565b6102f46102ef366004612a09565b610593565b005b61027762093a8081565b6102f461030e366004612a09565b61067b565b61027760075481565b61027760055481565b6102f4610dff565b610277610e64565b6102776103433660046129e0565b60036020526000908152604090205481565b600b546103629060ff1681565b6040519015158152602001610281565b6102f4610ef4565b61027760065481565b600054600160a01b900460ff16610362565b6009546103a8906001600160a01b031681565b6040516001600160a01b039091168152602001610281565b6102f46103ce3660046129e0565b61115d565b6102f46103e1366004612a09565b611202565b6102f46112d2565b6102776112e4565b6102776114cc565b61027761271081565b6102f461150c565b6102f4611571565b610277600d5481565b61027761271a81565b6000546001600160a01b03166103a8565b6102f4610448366004612a09565b611592565b6103a87f000000000000000000000000f36763b909b0dfb578123f9764b0bbcaaef9a41281565b6103a87f00000000000000000000000059dbcf904f4a2e749d79894fe6ed8f765d278f1281565b6102f46104a9366004612a09565b6116fd565b6102f46104bc366004612a09565b6117c7565b6102776107d081565b6102776104d83660046129e0565b611dd5565b6102776101f481565b6102f4611f57565b6102776104fc3660046129e0565b60046020526000908152604090205481565b6102f461051c3660046129e0565b612049565b610277600f5481565b610277600e5481565b6102f46105413660046129e0565b612187565b6102f46105543660046129e0565b61222c565b6008546103a8906001600160a01b031681565b6103a87f00000000000000000000000026704baa1d057abaac3fe25106603145b7de13b581565b6008546001600160a01b031633146105c65760405162461bcd60e51b81526004016105bd90612a22565b60405180910390fd5b62093a8081111561063f5760405162461bcd60e51b815260206004820152603d60248201527f7769746864726177466565506572696f642063616e6e6f74206265206d6f726560448201527f207468616e204d41585f57495448445241575f4645455f504552494f4400000060648201526084016105bd565b600f8190556040518181527fb89ddaddb7435be26824cb48d2d0186c9525a2e1ec057abcb502704cdc0686cc906020015b60405180910390a150565b6106836122a2565b336000908152600260205260409020816106d55760405162461bcd60e51b81526020600482015260136024820152724e6f7468696e6720746f20776974686472617760681b60448201526064016105bd565b80548211156107265760405162461bcd60e51b815260206004820152601f60248201527f576974686472617720616d6f756e7420657863656564732062616c616e63650060448201526064016105bd565b60008060006107336122fb565b905080156107f25760006005546107486112e4565b86546107549190612a5d565b61075e9190612a7a565b905060008560020154826107729190612a9c565b905080156107eb57612710600d548261078b9190612a5d565b6107959190612a7a565b945061079f6112e4565b6005546107ac9087612a5d565b6107b69190612a7a565b9350838660000160008282546107cc9190612a9c565b9250508190555083600560008282546107e59190612a9c565b90915550505b5050610998565b60007f000000000000000000000000f36763b909b0dfb578123f9764b0bbcaaef9a4126001600160a01b0316634e71d92d6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610854573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108789190612aaf565b60055490915061089082670de0b6b3a7640000612a5d565b61089a9190612a7a565b600a60008282546108ab9190612ac8565b9091555050336000908152600360205260408120548654600a54670de0b6b3a7640000916108d891612a5d565b6108e29190612a7a565b6108ec9190612a9c565b86549091501561091b573360009081526004602052604081208054839290610915908490612ac8565b90915550505b801561099557612710600d54826109329190612a5d565b61093c9190612a7a565b945061094785612357565b60408051868152602081018690523391600080516020612bef833981519152910160405180910390a2336000908152600460205260408120805487929061098f908490612a9c565b90915550505b50505b83548511156109a657835494505b6000600554826109b75760006109b9565b845b6109c16112e4565b6109cb9190612a9c565b6109d59088612a5d565b6109df9190612a7a565b90506109e96122fb565b610a055780600660008282546109ff9190612a9c565b90915550505b600082610a13576000610a15565b845b610a1f9083612ac8565b600b5490915060ff1615610ac657612710600c5482610a3e9190612a5d565b610a489190612a7a565b604051635521e9bf60e01b8152600481018290529091507f000000000000000000000000f36763b909b0dfb578123f9764b0bbcaaef9a4126001600160a01b031690635521e9bf90602401600060405180830381600087803b158015610aad57600080fd5b505af1158015610ac1573d6000803e3d6000fd5b505050505b6000600f548760010154610ada9190612ac8565b421015610b0b57612710600e5484610af29190612a5d565b610afc9190612a7a565b9050610b088184612a9c565b92505b8315610bf2576000610b1d8288612ac8565b90508015610bec5780610b2e610e64565b1015610b4157610b3c610e64565b610b43565b805b600954909150610b80906001600160a01b037f00000000000000000000000026704baa1d057abaac3fe25106603145b7de13b58116911683612469565b8615610bb05760408051888152602081018890523391600080516020612bef833981519152910160405180910390a25b8115610bec5760405182815233907ff4451cbaeb1fedd1db1eed585be4980b066afa1fa1c2a59f361ca67191e9695a9060200160405180910390a25b50610c68565b8015610c6857600954610c32906001600160a01b037f00000000000000000000000026704baa1d057abaac3fe25106603145b7de13b58116911683612469565b60405181815233907ff4451cbaeb1fedd1db1eed585be4980b066afa1fa1c2a59f361ca67191e9695a9060200160405180910390a25b82610c71610e64565b1015610c8457610c7f610e64565b610c86565b825b925087876000016000828254610c9c9190612a9c565b925050819055508760056000828254610cb59190612a9c565b90915550849050610cf3578654600a54670de0b6b3a764000091610cd891612a5d565b610ce29190612a7a565b336000908152600360205260409020555b426003880155865415610d2b57600554610d0b6112e4565b8854610d179190612a5d565b610d219190612a7a565b6002880155610d7d565b600060028801819055338082526004602052604082208054929055610d7b907f00000000000000000000000059dbcf904f4a2e749d79894fe6ed8f765d278f126001600160a01b03169083612469565b505b610db16001600160a01b037f00000000000000000000000026704baa1d057abaac3fe25106603145b7de13b5163385612469565b60408051848152602081018a905233917fb605f60b5ff13848ba5a9234329676801d97e41362092b50014cad41fb2b7bfc910160405180910390a250505050505050610dfc60018055565b50565b6008546001600160a01b03163314610e295760405162461bcd60e51b81526004016105bd90612a22565b610e316124d1565b610e39612521565b6040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000026704baa1d057abaac3fe25106603145b7de13b56001600160a01b0316906370a0823190602401602060405180830381865afa158015610ecb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eef9190612aaf565b905090565b610efc6122a2565b610f046122fb565b611152573360009081526002602052604090208054156111505760007f000000000000000000000000f36763b909b0dfb578123f9764b0bbcaaef9a4126001600160a01b0316634e71d92d6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa49190612aaf565b600554909150610fbc82670de0b6b3a7640000612a5d565b610fc69190612a7a565b600a6000828254610fd79190612ac8565b9091555050336000908152600360205260408120548354600a54670de0b6b3a76400009161100491612a5d565b61100e9190612a7a565b336000908152600460205260409020546110289190612ac8565b6110329190612a9c565b90506000612710600d54836110479190612a5d565b6110519190612a7a565b905061105c81612357565b600d546040513391600080516020612bef8339815191529161108691858252602082015260400190565b60405180910390a26110cd3361109c8385612a9c565b6001600160a01b037f00000000000000000000000059dbcf904f4a2e749d79894fe6ed8f765d278f12169190612469565b336000908152600460205260408120558354600a54670de0b6b3a7640000916110f591612a5d565b6110ff9190612a7a565b336000818152600360209081526040918290209390935580519182529181018490527fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba910160405180910390a15050505b505b61115b60018055565b565b611165612576565b6001600160a01b0381166111b45760405162461bcd60e51b815260206004820152601660248201527543616e6e6f74206265207a65726f206164647265737360501b60448201526064016105bd565b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c90602001610670565b6008546001600160a01b0316331461122c5760405162461bcd60e51b81526004016105bd90612a22565b6107d081111561129d5760405162461bcd60e51b815260206004820152603660248201527f706572666f726d616e63654665652063616e6e6f74206265206d6f7265207468604482015275616e204d41585f504552464f524d414e43455f46454560501b60648201526084016105bd565b600d8190556040518181527fefeafcf03e479a9566d7ef321b4816de0ba19cfa3cd0fae2f8c5f4a0afb342c490602001610670565b6112da612576565b61115b60006125d0565b60006112ee6122fb565b156114c557604051630cacd00160e11b81523060048201526000907f000000000000000000000000f36763b909b0dfb578123f9764b0bbcaaef9a4126001600160a01b031690631959a0029060240161012060405180830381865afa15801561135b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137f9190612af0565b5050505050505050905060007f000000000000000000000000f36763b909b0dfb578123f9764b0bbcaaef9a4126001600160a01b03166377c7b8fc6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140d9190612aaf565b9050670de0b6b3a76400006114228284612a5d565b61142c9190612a7a565b6040516370a0823160e01b81523060048201527f00000000000000000000000026704baa1d057abaac3fe25106603145b7de13b56001600160a01b0316906370a0823190602401602060405180830381865afa158015611490573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b49190612aaf565b6114be9190612ac8565b9250505090565b5060065490565b60006005546000146114ff576005546114e36112e4565b6114f590670de0b6b3a7640000612a5d565b610eef9190612a7a565b50670de0b6b3a764000090565b6008546001600160a01b031633146115365760405162461bcd60e51b81526004016105bd90612a22565b61153e612620565b61154661266d565b6040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6115796122a2565b336000908152600260205260409020546111529061067b565b6008546001600160a01b031633146115bc5760405162461bcd60e51b81526004016105bd90612a22565b6127108110156116425760405162461bcd60e51b815260206004820152604560248201527f7769746864726177416d6f756e74426f6f737465722063616e6e6f742062652060448201527f6c657373207468616e204d494e5f57495448445241575f414d4f554e545f424f60648201526427a9aa22a960d91b608482015260a4016105bd565b61271a8111156116c85760405162461bcd60e51b815260206004820152604560248201527f7769746864726177416d6f756e74426f6f737465722063616e6e6f742062652060448201527f6d6f7265207468616e204d41585f57495448445241575f414d4f554e545f424f60648201526427a9aa22a960d91b608482015260a4016105bd565b600c8190556040518181527f6029d76ffeb0d7684607fa1164412e907a5fcb0849976856b2f98f0ae49fb45790602001610670565b6008546001600160a01b031633146117275760405162461bcd60e51b81526004016105bd90612a22565b6101f48111156117925760405162461bcd60e51b815260206004820152603060248201527f77697468647261774665652063616e6e6f74206265206d6f7265207468616e2060448201526f4d41585f57495448445241575f46454560801b60648201526084016105bd565b600e8190556040518181527fd5fe46099fa396290a7f57e36c3c3c8774e2562c18ed5d1dcc0fa75071e03f1d90602001610670565b6117cf612620565b6117d76122a2565b600b5460ff166118205760405162461bcd60e51b81526020600482015260146024820152734e6f7420616c6c6f77656420746f207374616b6560601b60448201526064016105bd565b33600090815260026020526040812080549091908190819015611bd6576118456122fb565b15611a305760006005546118576112e4565b86546118639190612a5d565b61186d9190612a7a565b905060008560020154826118819190612a9c565b9050612710600d54826118949190612a5d565b61189e9190612a7a565b93508315611a29576118ae6112e4565b6005546118bb9086612a5d565b6118c59190612a7a565b9250828660000160008282546118db9190612a9c565b9250508190555082600560008282546118f49190612a9c565b90915550508387106119095760019450611a29565b600c5484906127109061191c9083612a5d565b6119269190612a7a565b604051635521e9bf60e01b8152600481018290529091507f000000000000000000000000f36763b909b0dfb578123f9764b0bbcaaef9a4126001600160a01b031690635521e9bf90602401600060405180830381600087803b15801561198b57600080fd5b505af115801561199f573d6000803e3d6000fd5b50505050846119ac610e64565b10156119bf576119ba610e64565b6119c1565b845b6009549095506119fe906001600160a01b037f00000000000000000000000026704baa1d057abaac3fe25106603145b7de13b58116911687612469565b60408051868152602081018690523391600080516020612bef833981519152910160405180910390a2505b5050611bd6565b60007f000000000000000000000000f36763b909b0dfb578123f9764b0bbcaaef9a4126001600160a01b0316634e71d92d6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611a92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab69190612aaf565b600554909150611ace82670de0b6b3a7640000612a5d565b611ad89190612a7a565b600a6000828254611ae99190612ac8565b9091555050336000908152600360205260408120548654600a54670de0b6b3a764000091611b1691612a5d565b611b209190612a7a565b611b2a9190612a9c565b865490915015611b59573360009081526004602052604081208054839290611b53908490612ac8565b90915550505b8015611bd357612710600d5482611b709190612a5d565b611b7a9190612a7a565b9350611b8584612357565b60408051858152602081018590523391600080516020612bef833981519152910160405180910390a23360009081526004602052604081208054869290611bcd908490612a9c565b90915550505b50505b6000611be06112e4565b9050611c176001600160a01b037f00000000000000000000000026704baa1d057abaac3fe25106603145b7de13b5163330896126b0565b8315611c8d57600954611c57906001600160a01b037f00000000000000000000000026704baa1d057abaac3fe25106603145b7de13b58116911685612469565b60408051848152602081018490523391600080516020612bef833981519152910160405180910390a2611c8a8382612a9c565b90505b6000600554600014611cb9578160055488611ca89190612a5d565b611cb29190612a7a565b9050611cbc565b50855b80866000016000828254611cd09190612ac8565b909155505042600187015560058054829190600090611cf0908490612ac8565b90915550611cfe90506126e8565b611d066122fb565b611d54578660066000828254611d1c9190612ac8565b90915550508554600a54670de0b6b3a764000091611d3991612a5d565b611d439190612a7a565b336000908152600360205260409020555b600554611d5f6112e4565b8754611d6b9190612a5d565b611d759190612a7a565b6002870155426003870181905560408051898152602081018490529081019190915233907ffe27466970a725dca4ea770cabb48c64bd971497150d85072f292a281e5aa82e9060600160405180910390a2505050505050610dfc60018055565b6001600160a01b038116600090815260026020526040812080548203611dfe5750600092915050565b611e066122fb565b15611e495760028101548154670de0b6b3a764000090611e246114cc565b611e2e9190612a5d565b611e389190612a7a565b611e429190612a9c565b9392505050565b6001600160a01b0383166000908152600360205260409020548154600a54670de0b6b3a764000091611e7a91612a5d565b611e849190612a7a565b6001600160a01b038086166000908152600460208190526040918290205460055487549351633180387760e21b8152309381019390935290939092917f000000000000000000000000f36763b909b0dfb578123f9764b0bbcaaef9a4129091169063c600e1dc90602401602060405180830381865afa158015611f0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2f9190612aaf565b611f399190612a5d565b611f439190612a7a565b611f4d9190612ac8565b611e389190612ac8565b6008546001600160a01b03163314611f815760405162461bcd60e51b81526004016105bd90612a22565b600b5460ff16611fc45760405162461bcd60e51b815260206004820152600e60248201526d4e6f207374616b696e672062626360901b60448201526064016105bd565b600b805460ff191690556040805163429c145b60e11b815290516001600160a01b037f000000000000000000000000f36763b909b0dfb578123f9764b0bbcaaef9a412169163853828b691600480830192600092919082900301818387803b15801561202f57600080fd5b505af1158015612043573d6000803e3d6000fd5b50505050565b6008546001600160a01b031633146120735760405162461bcd60e51b81526004016105bd90612a22565b7f00000000000000000000000026704baa1d057abaac3fe25106603145b7de13b56001600160a01b0316816001600160a01b0316036121025760405162461bcd60e51b815260206004820152602560248201527f546f6b656e2063616e6e6f742062652073616d65206173206465706f736974206044820152643a37b5b2b760d91b60648201526084016105bd565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015612149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216d9190612aaf565b90506121836001600160a01b0383163383612469565b5050565b61218f612576565b6001600160a01b0381166121de5760405162461bcd60e51b815260206004820152601660248201527543616e6e6f74206265207a65726f206164647265737360501b60448201526064016105bd565b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527fafa147634b29e2c7bd53ce194256b9f41cfb9ba3036f2b822fdd1d965beea08690602001610670565b612234612576565b6001600160a01b0381166122995760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105bd565b610dfc816125d0565b6002600154036122f45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105bd565b6002600155565b60007f00000000000000000000000026704baa1d057abaac3fe25106603145b7de13b56001600160a01b03167f00000000000000000000000059dbcf904f4a2e749d79894fe6ed8f765d278f126001600160a01b031614905090565b6000816007546123679190612ac8565b90508015612183576040516370a0823160e01b81523060048201526000907f00000000000000000000000059dbcf904f4a2e749d79894fe6ed8f765d278f126001600160a01b0316906370a0823190602401602060405180830381865afa1580156123d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123fa9190612aaf565b905080821115612408578091505b811561244857600954612448906001600160a01b037f00000000000000000000000059dbcf904f4a2e749d79894fe6ed8f765d278f128116911684612469565b81836007546124579190612ac8565b6124619190612a9c565b600755505050565b6040516001600160a01b0383166024820152604481018290526124cc90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261277e565b505050565b600054600160a01b900460ff1661115b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016105bd565b6125296124d1565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000546001600160a01b0316331461115b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105bd565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600054600160a01b900460ff161561115b5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016105bd565b612675612620565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125593390565b6040516001600160a01b03808516602483015283166044820152606481018290526120439085906323b872dd60e01b90608401612495565b60006126f2610e64565b90508015610dfc57604051631c57762b60e31b815260048101829052600060248201527f000000000000000000000000f36763b909b0dfb578123f9764b0bbcaaef9a4126001600160a01b03169063e2bbb15890604401600060405180830381600087803b15801561276357600080fd5b505af1158015612777573d6000803e3d6000fd5b5050505050565b60006127d3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166128509092919063ffffffff16565b8051909150156124cc57808060200190518101906127f19190612b60565b6124cc5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105bd565b606061285f8484600085612867565b949350505050565b6060824710156128c85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105bd565b600080866001600160a01b031685876040516128e49190612b9f565b60006040518083038185875af1925050503d8060008114612921576040519150601f19603f3d011682016040523d82523d6000602084013e612926565b606091505b509150915061293787838387612942565b979650505050505050565b606083156129b15782516000036129aa576001600160a01b0385163b6129aa5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105bd565b508161285f565b61285f83838151156129c65781518083602001fd5b8060405162461bcd60e51b81526004016105bd9190612bbb565b6000602082840312156129f257600080fd5b81356001600160a01b0381168114611e4257600080fd5b600060208284031215612a1b57600080fd5b5035919050565b6020808252600b908201526a61646d696e3a207775743f60a81b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417612a7457612a74612a47565b92915050565b600082612a9757634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115612a7457612a74612a47565b600060208284031215612ac157600080fd5b5051919050565b80820180821115612a7457612a74612a47565b80518015158114612aeb57600080fd5b919050565b60008060008060008060008060006101208a8c031215612b0f57600080fd5b8951985060208a0151975060408a0151965060608a0151955060808a0151945060a08a0151935060c08a01519250612b4960e08b01612adb565b91506101008a015190509295985092959850929598565b600060208284031215612b7257600080fd5b611e4282612adb565b60005b83811015612b96578181015183820152602001612b7e565b50506000910152565b60008251612bb1818460208701612b7b565b9190910192915050565b6020815260008251806020840152612bda816040850160208701612b7b565b601f01601f1916919091016040019291505056feba099d38a7da8262f6dc89809a028ddb51ce1f8fe4d9c7554ef909078f6e10c9a2646970667358221220872712b1015d7a91a9674826549982c95bc727d6c063c192809e6c056a4d661a64736f6c63430008130033