Contract Address Details

0x182CD0C6F1FaEc0aED2eA83cd0e160c8Bd4cb063

MiniChefV2 Last Balance Update: Block #17925675
Created by 0xfbb3a8ā€“34e1f6 at 0x5c782eā€“782325

Balance

0 Fuse

Fetching tokens...

Contract name:
MiniChefV2




Optimization enabled
true
Compiler version
v0.6.12+commit.27d51765




Optimization runs
200
EVM Version
default




Verified at
2021-12-13 14:17:24.696736Z

Constructor Arguments

00000000000000000000000090708b20ccc1eb95a4fa7c8b18fd2c22a0ff9e78

Arg [0] (address) : 0x90708b20ccc1eb95a4fa7c8b18fd2c22a0ff9e78

              

Contract source code

/**
*Submitted for verification at moonriver.moonscan.io on 2021-10-27
*/
// File @boringcrypto/boring-solidity/contracts/libraries/BoringMath.sol@v1.0.4
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// a library for performing overflow-safe math, updated with awesomeness from of DappHub (https://github.com/dapphub/ds-math)
library BoringMath {
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {require((c = a + b) >= b, "BoringMath: Add Overflow");}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {require((c = a - b) <= a, "BoringMath: Underflow");}
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {require(b == 0 || (c = a * b)/b == a, "BoringMath: Mul Overflow");}
function to128(uint256 a) internal pure returns (uint128 c) {
require(a <= uint128(-1), "BoringMath: uint128 Overflow");
c = uint128(a);
}
function to64(uint256 a) internal pure returns (uint64 c) {
require(a <= uint64(-1), "BoringMath: uint64 Overflow");
c = uint64(a);
}
function to32(uint256 a) internal pure returns (uint32 c) {
require(a <= uint32(-1), "BoringMath: uint32 Overflow");
c = uint32(a);
}
}
library BoringMath128 {
function add(uint128 a, uint128 b) internal pure returns (uint128 c) {require((c = a + b) >= b, "BoringMath: Add Overflow");}
function sub(uint128 a, uint128 b) internal pure returns (uint128 c) {require((c = a - b) <= a, "BoringMath: Underflow");}
}
library BoringMath64 {
function add(uint64 a, uint64 b) internal pure returns (uint64 c) {require((c = a + b) >= b, "BoringMath: Add Overflow");}
function sub(uint64 a, uint64 b) internal pure returns (uint64 c) {require((c = a - b) <= a, "BoringMath: Underflow");}
}
library BoringMath32 {
function add(uint32 a, uint32 b) internal pure returns (uint32 c) {require((c = a + b) >= b, "BoringMath: Add Overflow");}
function sub(uint32 a, uint32 b) internal pure returns (uint32 c) {require((c = a - b) <= a, "BoringMath: Underflow");}
}
// File @boringcrypto/boring-solidity/contracts/interfaces/IERC20.sol@v1.0.4
pragma solidity 0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
// EIP 2612
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
}
// File @boringcrypto/boring-solidity/contracts/libraries/BoringERC20.sol@v1.0.4
pragma solidity 0.6.12;
library BoringERC20 {
function safeSymbol(IERC20 token) internal view returns(string memory) {
(bool success, bytes memory data) = address(token).staticcall(abi.encodeWithSelector(0x95d89b41));
return success && data.length > 0 ? abi.decode(data, (string)) : "???";
}
function safeName(IERC20 token) internal view returns(string memory) {
(bool success, bytes memory data) = address(token).staticcall(abi.encodeWithSelector(0x06fdde03));
return success && data.length > 0 ? abi.decode(data, (string)) : "???";
}
function safeDecimals(IERC20 token) internal view returns (uint8) {
(bool success, bytes memory data) = address(token).staticcall(abi.encodeWithSelector(0x313ce567));
return success && data.length == 32 ? abi.decode(data, (uint8)) : 18;
}
function safeTransfer(IERC20 token, address to, uint256 amount) internal {
(bool success, bytes memory data) = address(token).call(abi.encodeWithSelector(0xa9059cbb, to, amount));
require(success && (data.length == 0 || abi.decode(data, (bool))), "BoringERC20: Transfer failed");
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 amount) internal {
(bool success, bytes memory data) = address(token).call(abi.encodeWithSelector(0x23b872dd, from, to, amount));
require(success && (data.length == 0 || abi.decode(data, (bool))), "BoringERC20: TransferFrom failed");
}
}
// File @boringcrypto/boring-solidity/contracts/BoringBatchable.sol@v1.0.4
// Audit on 5-Jan-2021 by Keno and BoringCrypto
// P1 - P3: OK
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// solhint-disable avoid-low-level-calls
// T1 - T4: OK
contract BaseBoringBatchable {
function _getRevertMsg(bytes memory _returnData) internal pure returns (string memory) {
// If the _res length is less than 68, then the transaction failed silently (without a revert message)
if (_returnData.length < 68) return "Transaction reverted silently";
assembly {
// Slice the sighash.
_returnData := add(_returnData, 0x04)
}
return abi.decode(_returnData, (string)); // All that remains is the revert string
}
// F3 - F9: OK
// F1: External is ok here because this is the batch function, adding it to a batch makes no sense
// F2: Calls in the batch may be payable, delegatecall operates in the same context, so each call in the batch has access to msg.value
// C1 - C21: OK
// C3: The length of the loop is fully under user control, so can't be exploited
// C7: Delegatecall is only used on the same contract, so it's safe
function batch(bytes[] calldata calls, bool revertOnFail) external payable returns(bool[] memory successes, bytes[] memory results) {
// Interactions
successes = new bool[](calls.length);
results = new bytes[](calls.length);
for (uint256 i = 0; i < calls.length; i++) {
(bool success, bytes memory result) = address(this).delegatecall(calls[i]);
require(success || !revertOnFail, _getRevertMsg(result));
successes[i] = success;
results[i] = result;
}
}
}
// T1 - T4: OK
contract BoringBatchable is BaseBoringBatchable {
// F1 - F9: OK
// F6: Parameters can be used front-run the permit and the user's permit will fail (due to nonce or other revert)
// if part of a batch this could be used to grief once as the second call would not need the permit
// C1 - C21: OK
function permitToken(IERC20 token, address from, address to, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
// Interactions
// X1 - X5
token.permit(from, to, amount, deadline, v, r, s);
}
}
// File @boringcrypto/boring-solidity/contracts/BoringOwnable.sol@v1.0.4
// Audit on 5-Jan-2021 by Keno and BoringCrypto
// P1 - P3: OK
pragma solidity 0.6.12;
// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol + Claimable.sol
// Edited by BoringCrypto
// T1 - T4: OK
contract BoringOwnableData {
// V1 - V5: OK
address public owner;
// V1 - V5: OK
address public pendingOwner;
}
// T1 - T4: OK
contract BoringOwnable is BoringOwnableData {
// E1: OK
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () public {
owner = msg.sender;
emit OwnershipTransferred(address(0), msg.sender);
}
// F1 - F9: OK
// C1 - C21: OK
function transferOwnership(address newOwner, bool direct, bool renounce) public onlyOwner {
if (direct) {
// Checks
require(newOwner != address(0) || renounce, "Ownable: zero address");
// Effects
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
pendingOwner = address(0);
} else {
// Effects
pendingOwner = newOwner;
}
}
// F1 - F9: OK
// C1 - C21: OK
function claimOwnership() public {
address _pendingOwner = pendingOwner;
// Checks
require(msg.sender == _pendingOwner, "Ownable: caller != pending owner");
// Effects
emit OwnershipTransferred(owner, _pendingOwner);
owner = _pendingOwner;
pendingOwner = address(0);
}
// M1 - M5: OK
// C1 - C21: OK
modifier onlyOwner() {
require(msg.sender == owner, "Ownable: caller is not the owner");
_;
}
}
// File contracts/libraries/SignedSafeMath.sol
pragma solidity 0.6.12;
library SignedSafeMath {
int256 constant private _INT256_MIN = -2**255;
/**
* @dev Returns the multiplication of two signed integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(int256 a, int256 b) internal pure returns (int256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
require(!(a == -1 && b == _INT256_MIN), "SignedSafeMath: multiplication overflow");
int256 c = a * b;
require(c / a == b, "SignedSafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two signed integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(int256 a, int256 b) internal pure returns (int256) {
require(b != 0, "SignedSafeMath: division by zero");
require(!(b == -1 && a == _INT256_MIN), "SignedSafeMath: division overflow");
int256 c = a / b;
return c;
}
/**
* @dev Returns the subtraction of two signed integers, reverting on
* overflow.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(int256 a, int256 b) internal pure returns (int256) {
int256 c = a - b;
require((b >= 0 && c <= a) || (b < 0 && c > a), "SignedSafeMath: subtraction overflow");
return c;
}
/**
* @dev Returns the addition of two signed integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(int256 a, int256 b) internal pure returns (int256) {
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a), "SignedSafeMath: addition overflow");
return c;
}
function toUInt256(int256 a) internal pure returns (uint256) {
require(a >= 0, "Integer < 0");
return uint256(a);
}
}
// File contracts/interfaces/IRewarder.sol
pragma solidity 0.6.12;
interface IRewarder {
using BoringERC20 for IERC20;
function onSushiReward(uint256 pid, address user, address recipient, uint256 sushiAmount, uint256 newLpAmount) external;
function pendingTokens(uint256 pid, address user, uint256 sushiAmount) external view returns (IERC20[] memory, uint256[] memory);
}
// File contracts/interfaces/IMasterChef.sol
pragma solidity 0.6.12;
interface IMasterChef {
using BoringERC20 for IERC20;
struct UserInfo {
uint256 amount; // How many LP tokens the user has provided.
uint256 rewardDebt; // Reward debt. See explanation below.
}
struct PoolInfo {
IERC20 lpToken; // Address of LP token contract.
uint256 allocPoint; // How many allocation points assigned to this pool. SUSHI to distribute per block.
uint256 lastRewardBlock; // Last block number that SUSHI distribution occurs.
uint256 accSushiPerShare; // Accumulated SUSHI per share, times 1e12. See below.
}
function poolInfo(uint256 pid) external view returns (IMasterChef.PoolInfo memory);
function totalAllocPoint() external view returns (uint256);
function deposit(uint256 _pid, uint256 _amount) external;
}
// File contracts/MiniChefV2.sol
pragma solidity 0.6.12;
interface IMigratorChef {
// Take the current LP token address and return the new LP token address.
// Migrator should have full access to the caller's LP token.
function migrate(IERC20 token) external returns (IERC20);
}
/// @notice The (older) MasterChef contract gives out a constant number of SUSHI tokens per block.
/// It is the only address with minting rights for SUSHI.
/// The idea for this MasterChef V2 (MCV2) contract is therefore to be the owner of a dummy token
/// that is deposited into the MasterChef V1 (MCV1) contract.
/// The allocation point for this pool on MCV1 is the total allocation point for all pools that receive double incentives.
contract MiniChefV2 is BoringOwnable, BoringBatchable {
using BoringMath for uint256;
using BoringMath128 for uint128;
using BoringERC20 for IERC20;
using SignedSafeMath for int256;
/// @notice Info of each MCV2 user.
/// `amount` LP token amount the user has provided.
/// `rewardDebt` The amount of SUSHI entitled to the user.
struct UserInfo {
uint256 amount;
int256 rewardDebt;
}
/// @notice Info of each MCV2 pool.
/// `allocPoint` The amount of allocation points assigned to the pool.
/// Also known as the amount of SUSHI to distribute per block.
struct PoolInfo {
uint128 accSushiPerShare;
uint64 lastRewardTime;
uint64 allocPoint;
}
/// @notice Address of SUSHI contract.
IERC20 public immutable SUSHI;
// @notice The migrator contract. It has a lot of power. Can only be set through governance (owner).
IMigratorChef public migrator;
/// @notice Info of each MCV2 pool.
PoolInfo[] public poolInfo;
/// @notice Address of the LP token for each MCV2 pool.
IERC20[] public lpToken;
/// @notice Address of each `IRewarder` contract in MCV2.
IRewarder[] public rewarder;
/// @notice Info of each user that stakes LP tokens.
mapping (uint256 => mapping (address => UserInfo)) public userInfo;
/// @dev Tokens added
mapping (address => bool) public addedTokens;
/// @dev Total allocation points. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint;
uint256 public sushiPerSecond;
uint256 private constant ACC_SUSHI_PRECISION = 1e12;
event Deposit(address indexed user, uint256 indexed pid, uint256 amount, address indexed to);
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount, address indexed to);
event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount, address indexed to);
event Harvest(address indexed user, uint256 indexed pid, uint256 amount);
event LogPoolAddition(uint256 indexed pid, uint256 allocPoint, IERC20 indexed lpToken, IRewarder indexed rewarder);
event LogSetPool(uint256 indexed pid, uint256 allocPoint, IRewarder indexed rewarder, bool overwrite);
event LogUpdatePool(uint256 indexed pid, uint64 lastRewardTime, uint256 lpSupply, uint256 accSushiPerShare);
event LogSushiPerSecond(uint256 sushiPerSecond);
/// @param _sushi The SUSHI token contract address.
constructor(IERC20 _sushi) public {
SUSHI = _sushi;
}
/// @notice Returns the number of MCV2 pools.
function poolLength() public view returns (uint256 pools) {
pools = poolInfo.length;
}
/// @notice Add a new LP to the pool. Can only be called by the owner.
/// DO NOT add the same LP token more than once. Rewards will be messed up if you do.
/// @param allocPoint AP of the new pool.
/// @param _lpToken Address of the LP ERC-20 token.
/// @param _rewarder Address of the rewarder delegate.
function add(uint256 allocPoint, IERC20 _lpToken, IRewarder _rewarder) public onlyOwner {
require(addedTokens[address(_lpToken)] == false, "Token already added");
totalAllocPoint = totalAllocPoint.add(allocPoint);
lpToken.push(_lpToken);
rewarder.push(_rewarder);
poolInfo.push(PoolInfo({
allocPoint: allocPoint.to64(),
lastRewardTime: block.timestamp.to64(),
accSushiPerShare: 0
}));
addedTokens[address(_lpToken)] = true;
emit LogPoolAddition(lpToken.length.sub(1), allocPoint, _lpToken, _rewarder);
}
/// @notice Update the given pool's SUSHI allocation point and `IRewarder` contract. Can only be called by the owner.
/// @param _pid The index of the pool. See `poolInfo`.
/// @param _allocPoint New AP of the pool.
/// @param _rewarder Address of the rewarder delegate.
/// @param overwrite True if _rewarder should be `set`. Otherwise `_rewarder` is ignored.
function set(uint256 _pid, uint256 _allocPoint, IRewarder _rewarder, bool overwrite) public onlyOwner {
totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint);
poolInfo[_pid].allocPoint = _allocPoint.to64();
if (overwrite) { rewarder[_pid] = _rewarder; }
emit LogSetPool(_pid, _allocPoint, overwrite ? _rewarder : rewarder[_pid], overwrite);
}
/// @notice Sets the sushi per second to be distributed. Can only be called by the owner.
/// @param _sushiPerSecond The amount of Sushi to be distributed per second.
function setSushiPerSecond(uint256 _sushiPerSecond) public onlyOwner {
sushiPerSecond = _sushiPerSecond;
emit LogSushiPerSecond(_sushiPerSecond);
}
/// @notice Set the `migrator` contract. Can only be called by the owner.
/// @param _migrator The contract address to set.
function setMigrator(IMigratorChef _migrator) public onlyOwner {
migrator = _migrator;
}
/// @notice Migrate LP token to another LP contract through the `migrator` contract.
/// @param _pid The index of the pool. See `poolInfo`.
function migrate(uint256 _pid) public {
require(address(migrator) != address(0), "MasterChefV2: no migrator set");
IERC20 _lpToken = lpToken[_pid];
uint256 bal = _lpToken.balanceOf(address(this));
_lpToken.approve(address(migrator), bal);
IERC20 newLpToken = migrator.migrate(_lpToken);
require(bal == newLpToken.balanceOf(address(this)), "MasterChefV2: migrated balance must match");
require(addedTokens[address(newLpToken)] == false, "Token already added");
addedTokens[address(newLpToken)] = true;
addedTokens[address(_lpToken)] = false;
lpToken[_pid] = newLpToken;
}
/// @notice View function to see pending SUSHI on frontend.
/// @param _pid The index of the pool. See `poolInfo`.
/// @param _user Address of user.
/// @return pending SUSHI reward for a given user.
function pendingSushi(uint256 _pid, address _user) external view returns (uint256 pending) {
PoolInfo memory pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accSushiPerShare = pool.accSushiPerShare;
uint256 lpSupply = lpToken[_pid].balanceOf(address(this));
if (block.timestamp > pool.lastRewardTime && lpSupply != 0) {
uint256 time = block.timestamp.sub(pool.lastRewardTime);
uint256 sushiReward = time.mul(sushiPerSecond).mul(pool.allocPoint) / totalAllocPoint;
accSushiPerShare = accSushiPerShare.add(sushiReward.mul(ACC_SUSHI_PRECISION) / lpSupply);
}
pending = int256(user.amount.mul(accSushiPerShare) / ACC_SUSHI_PRECISION).sub(user.rewardDebt).toUInt256();
}
/// @notice Update reward variables for all pools. Be careful of gas spending!
/// @param pids Pool IDs of all to be updated. Make sure to update all active pools.
function massUpdatePools(uint256[] calldata pids) external {
uint256 len = pids.length;
for (uint256 i = 0; i < len; ++i) {
updatePool(pids[i]);
}
}
/// @notice Update reward variables of the given pool.
/// @param pid The index of the pool. See `poolInfo`.
/// @return pool Returns the pool that was updated.
function updatePool(uint256 pid) public returns (PoolInfo memory pool) {
pool = poolInfo[pid];
if (block.timestamp > pool.lastRewardTime) {
uint256 lpSupply = lpToken[pid].balanceOf(address(this));
if (lpSupply > 0) {
uint256 time = block.timestamp.sub(pool.lastRewardTime);
uint256 sushiReward = time.mul(sushiPerSecond).mul(pool.allocPoint) / totalAllocPoint;
pool.accSushiPerShare = pool.accSushiPerShare.add((sushiReward.mul(ACC_SUSHI_PRECISION) / lpSupply).to128());
}
pool.lastRewardTime = block.timestamp.to64();
poolInfo[pid] = pool;
emit LogUpdatePool(pid, pool.lastRewardTime, lpSupply, pool.accSushiPerShare);
}
}
/// @notice Deposit LP tokens to MCV2 for SUSHI allocation.
/// @param pid The index of the pool. See `poolInfo`.
/// @param amount LP token amount to deposit.
/// @param to The receiver of `amount` deposit benefit.
function deposit(uint256 pid, uint256 amount, address to) public {
PoolInfo memory pool = updatePool(pid);
UserInfo storage user = userInfo[pid][to];
// Effects
user.amount = user.amount.add(amount);
user.rewardDebt = user.rewardDebt.add(int256(amount.mul(pool.accSushiPerShare) / ACC_SUSHI_PRECISION));
// Interactions
IRewarder _rewarder = rewarder[pid];
if (address(_rewarder) != address(0)) {
_rewarder.onSushiReward(pid, to, to, 0, user.amount);
}
lpToken[pid].safeTransferFrom(msg.sender, address(this), amount);
emit Deposit(msg.sender, pid, amount, to);
}
/// @notice Withdraw LP tokens from MCV2.
/// @param pid The index of the pool. See `poolInfo`.
/// @param amount LP token amount to withdraw.
/// @param to Receiver of the LP tokens.
function withdraw(uint256 pid, uint256 amount, address to) public {
PoolInfo memory pool = updatePool(pid);
UserInfo storage user = userInfo[pid][msg.sender];
// Effects
user.rewardDebt = user.rewardDebt.sub(int256(amount.mul(pool.accSushiPerShare) / ACC_SUSHI_PRECISION));
user.amount = user.amount.sub(amount);
// Interactions
IRewarder _rewarder = rewarder[pid];
if (address(_rewarder) != address(0)) {
_rewarder.onSushiReward(pid, msg.sender, to, 0, user.amount);
}
lpToken[pid].safeTransfer(to, amount);
emit Withdraw(msg.sender, pid, amount, to);
}
/// @notice Harvest proceeds for transaction sender to `to`.
/// @param pid The index of the pool. See `poolInfo`.
/// @param to Receiver of SUSHI rewards.
function harvest(uint256 pid, address to) public {
PoolInfo memory pool = updatePool(pid);
UserInfo storage user = userInfo[pid][msg.sender];
int256 accumulatedSushi = int256(user.amount.mul(pool.accSushiPerShare) / ACC_SUSHI_PRECISION);
uint256 _pendingSushi = accumulatedSushi.sub(user.rewardDebt).toUInt256();
// Effects
user.rewardDebt = accumulatedSushi;
// Interactions
if (_pendingSushi != 0) {
SUSHI.safeTransfer(to, _pendingSushi);
}
IRewarder _rewarder = rewarder[pid];
if (address(_rewarder) != address(0)) {
_rewarder.onSushiReward( pid, msg.sender, to, _pendingSushi, user.amount);
}
emit Harvest(msg.sender, pid, _pendingSushi);
}
/// @notice Withdraw LP tokens from MCV2 and harvest proceeds for transaction sender to `to`.
/// @param pid The index of the pool. See `poolInfo`.
/// @param amount LP token amount to withdraw.
/// @param to Receiver of the LP tokens and SUSHI rewards.
function withdrawAndHarvest(uint256 pid, uint256 amount, address to) public {
PoolInfo memory pool = updatePool(pid);
UserInfo storage user = userInfo[pid][msg.sender];
int256 accumulatedSushi = int256(user.amount.mul(pool.accSushiPerShare) / ACC_SUSHI_PRECISION);
uint256 _pendingSushi = accumulatedSushi.sub(user.rewardDebt).toUInt256();
// Effects
user.rewardDebt = accumulatedSushi.sub(int256(amount.mul(pool.accSushiPerShare) / ACC_SUSHI_PRECISION));
user.amount = user.amount.sub(amount);
// Interactions
SUSHI.safeTransfer(to, _pendingSushi);
IRewarder _rewarder = rewarder[pid];
if (address(_rewarder) != address(0)) {
_rewarder.onSushiReward(pid, msg.sender, to, _pendingSushi, user.amount);
}
lpToken[pid].safeTransfer(to, amount);
emit Withdraw(msg.sender, pid, amount, to);
emit Harvest(msg.sender, pid, _pendingSushi);
}
/// @notice Withdraw without caring about rewards. EMERGENCY ONLY.
/// @param pid The index of the pool. See `poolInfo`.
/// @param to Receiver of the LP tokens.
function emergencyWithdraw(uint256 pid, address to) public {
UserInfo storage user = userInfo[pid][msg.sender];
uint256 amount = user.amount;
user.amount = 0;
user.rewardDebt = 0;
IRewarder _rewarder = rewarder[pid];
if (address(_rewarder) != address(0)) {
_rewarder.onSushiReward(pid, msg.sender, to, 0, 0);
}
// Note: transfer can fail or succeed if `amount` is zero.
lpToken[pid].safeTransfer(to, amount);
emit EmergencyWithdraw(msg.sender, pid, amount, to);
}
}

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_sushi","internalType":"contract IERC20"}]},{"type":"event","name":"Deposit","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"address","name":"to","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"EmergencyWithdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"address","name":"to","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Harvest","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"LogPoolAddition","inputs":[{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"allocPoint","internalType":"uint256","indexed":false},{"type":"address","name":"lpToken","internalType":"contract IERC20","indexed":true},{"type":"address","name":"rewarder","internalType":"contract IRewarder","indexed":true}],"anonymous":false},{"type":"event","name":"LogSetPool","inputs":[{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"allocPoint","internalType":"uint256","indexed":false},{"type":"address","name":"rewarder","internalType":"contract IRewarder","indexed":true},{"type":"bool","name":"overwrite","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"LogSushiPerSecond","inputs":[{"type":"uint256","name":"sushiPerSecond","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"LogUpdatePool","inputs":[{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint64","name":"lastRewardTime","internalType":"uint64","indexed":false},{"type":"uint256","name":"lpSupply","internalType":"uint256","indexed":false},{"type":"uint256","name":"accSushiPerShare","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"address","name":"to","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"SUSHI","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"add","inputs":[{"type":"uint256","name":"allocPoint","internalType":"uint256"},{"type":"address","name":"_lpToken","internalType":"contract IERC20"},{"type":"address","name":"_rewarder","internalType":"contract IRewarder"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"addedTokens","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"bool[]","name":"successes","internalType":"bool[]"},{"type":"bytes[]","name":"results","internalType":"bytes[]"}],"name":"batch","inputs":[{"type":"bytes[]","name":"calls","internalType":"bytes[]"},{"type":"bool","name":"revertOnFail","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claimOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyWithdraw","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"harvest","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"lpToken","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"massUpdatePools","inputs":[{"type":"uint256[]","name":"pids","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"migrate","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IMigratorChef"}],"name":"migrator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pendingOwner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"pending","internalType":"uint256"}],"name":"pendingSushi","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"permitToken","inputs":[{"type":"address","name":"token","internalType":"contract IERC20"},{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint128","name":"accSushiPerShare","internalType":"uint128"},{"type":"uint64","name":"lastRewardTime","internalType":"uint64"},{"type":"uint64","name":"allocPoint","internalType":"uint64"}],"name":"poolInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"pools","internalType":"uint256"}],"name":"poolLength","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IRewarder"}],"name":"rewarder","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"set","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_allocPoint","internalType":"uint256"},{"type":"address","name":"_rewarder","internalType":"contract IRewarder"},{"type":"bool","name":"overwrite","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMigrator","inputs":[{"type":"address","name":"_migrator","internalType":"contract IMigratorChef"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSushiPerSecond","inputs":[{"type":"uint256","name":"_sushiPerSecond","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"sushiPerSecond","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalAllocPoint","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"},{"type":"bool","name":"direct","internalType":"bool"},{"type":"bool","name":"renounce","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"tuple","name":"pool","internalType":"struct MiniChefV2.PoolInfo","components":[{"type":"uint128","name":"accSushiPerShare","internalType":"uint128"},{"type":"uint64","name":"lastRewardTime","internalType":"uint64"},{"type":"uint64","name":"allocPoint","internalType":"uint64"}]}],"name":"updatePool","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"int256","name":"rewardDebt","internalType":"int256"}],"name":"userInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawAndHarvest","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"}]}]
            

Deployed ByteCode

0x6080604052600436106101c25760003560e01c806379d12ffb116100f75780639baf58c311610095578063c346253d11610064578063c346253d146104f6578063d1abb90714610516578063d2423b5114610536578063e30c397814610557576101c2565b80639baf58c31461048c578063a06e408b146104ac578063ab560e10146104c1578063ab7de098146104d6576101c2565b806388bba42f116100d157806388bba42f146104095780638da5cb5b146104295780638dbdbe6d1461043e57806393f1a40b1461045e576101c2565b806379d12ffb146103a75780637c516e94146103d45780637cd07e47146103f4576101c2565b806323cf3118116101645780634e71e0c81161013e5780634e71e0c81461031857806351eb05a61461032d57806357a5b58c1461035a57806378ed5d1f1461037a576101c2565b806323cf3118146102b85780632f940c70146102d8578063454b0608146102f8576101c2565b80631526fe27116101a05780631526fe271461023457806317caf6f11461026357806318fccc7614610278578063195426ec14610298576101c2565b8063078dfbe7146101c7578063081e3eda146101e95780630ad58d2f14610214575b600080fd5b3480156101d357600080fd5b506101e76101e23660046122a8565b61056c565b005b3480156101f557600080fd5b506101fe61065b565b60405161020b9190612b4a565b60405180910390f35b34801561022057600080fd5b506101e761022f366004612568565b610661565b34801561024057600080fd5b5061025461024f3660046124d3565b6107f1565b60405161020b93929190612b20565b34801561026f57600080fd5b506101fe610833565b34801561028457600080fd5b506101e7610293366004612503565b610839565b3480156102a457600080fd5b506101fe6102b3366004612503565b6109d3565b3480156102c457600080fd5b506101e76102d336600461228c565b610bd3565b3480156102e457600080fd5b506101e76102f3366004612503565b610c1f565b34801561030457600080fd5b506101e76103133660046124d3565b610d40565b34801561032457600080fd5b506101e761105e565b34801561033957600080fd5b5061034d6103483660046124d3565b6110eb565b60405161020b9190612ae7565b34801561036657600080fd5b506101e761037536600461233b565b61136f565b34801561038657600080fd5b5061039a6103953660046124d3565b6113a5565b60405161020b9190612636565b3480156103b357600080fd5b506103c76103c236600461228c565b6113cc565b60405161020b9190612762565b3480156103e057600080fd5b506101e76103ef3660046123b2565b6113e1565b34801561040057600080fd5b5061039a611455565b34801561041557600080fd5b506101e7610424366004612595565b611464565b34801561043557600080fd5b5061039a6115d1565b34801561044a57600080fd5b506101e7610459366004612568565b6115e0565b34801561046a57600080fd5b5061047e610479366004612503565b61176b565b60405161020b929190612b92565b34801561049857600080fd5b506101e76104a73660046124d3565b61178f565b3480156104b857600080fd5b506101fe6117f9565b3480156104cd57600080fd5b5061039a6117ff565b3480156104e257600080fd5b506101e76104f1366004612532565b611823565b34801561050257600080fd5b5061039a6105113660046124d3565b611a49565b34801561052257600080fd5b506101e7610531366004612568565b611a56565b6105496105443660046122f2565b611c89565b60405161020b9291906126c8565b34801561056357600080fd5b5061039a611e19565b6000546001600160a01b0316331461059f5760405162461bcd60e51b815260040161059690612932565b60405180910390fd5b811561063a576001600160a01b0383161515806105b95750805b6105d55760405162461bcd60e51b81526004016105969061284c565b600080546040516001600160a01b03808716939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0385166001600160a01b031991821617909155600180549091169055610656565b600180546001600160a01b0319166001600160a01b0385161790555b505050565b60035490565b610669612224565b610672846110eb565b600085815260066020908152604080832033845290915290208151919250906106c49064e8d4a51000906106b09087906001600160801b0316611e28565b816106b757fe5b6001840154919004611e65565b600182015580546106d59085611eb2565b81556005805460009190879081106106e957fe5b6000918252602090912001546001600160a01b03169050801561076f5781546040516345fb1ba160e11b81526001600160a01b03831691638bf637429161073c918a9133918a9160009190600401612b53565b600060405180830381600087803b15801561075657600080fd5b505af115801561076a573d6000803e3d6000fd5b505050505b61079d84866004898154811061078157fe5b6000918252602090912001546001600160a01b03169190611ed5565b836001600160a01b031686336001600160a01b03167f8166bf25f8a2b7ed3c85049207da4358d16edbed977d23fa2ee6f0dde3ec2132886040516107e19190612b4a565b60405180910390a4505050505050565b600381815481106107fe57fe5b6000918252602090912001546001600160801b03811691506001600160401b03600160801b8204811691600160c01b90041683565b60085481565b610841612224565b61084a836110eb565b6000848152600660209081526040808320338452909152812082518154939450909264e8d4a510009161088691906001600160801b0316611e28565b8161088d57fe5b04905060006108b16108ac846001015484611e6590919063ffffffff16565b611fc3565b60018401839055905080156108f4576108f46001600160a01b037f00000000000000000000000090708b20ccc1eb95a4fa7c8b18fd2c22a0ff9e78168683611ed5565b60006005878154811061090357fe5b6000918252602090912001546001600160a01b0316905080156109885783546040516345fb1ba160e11b81526001600160a01b03831691638bf6374291610955918b9133918c91899190600401612b53565b600060405180830381600087803b15801561096f57600080fd5b505af1158015610983573d6000803e3d6000fd5b505050505b86336001600160a01b03167f71bab65ced2e5750775a0613be067df48ef06cf92a496ebf7663ae0660924954846040516109c29190612b4a565b60405180910390a350505050505050565b60006109dd612224565b600384815481106109ea57fe5b600091825260208083206040805160608101825291909301546001600160801b0380821683526001600160401b03600160801b8304811684860152600160c01b90920490911682850152888552600683528385206001600160a01b0389168652909252918320825160048054949650919492169288908110610a6857fe5b6000918252602090912001546040516370a0823160e01b81526001600160a01b03909116906370a0823190610aa1903090600401612636565b60206040518083038186803b158015610ab957600080fd5b505afa158015610acd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af191906124eb565b905083602001516001600160401b031642118015610b0e57508015155b15610b9a576000610b3585602001516001600160401b031642611eb290919063ffffffff16565b90506000600854610b6887604001516001600160401b0316610b6260095486611e2890919063ffffffff16565b90611e28565b81610b6f57fe5b049050610b9583610b858364e8d4a51000611e28565b81610b8c57fe5b86919004611fe9565b935050505b60018301548354610bc8916108ac9164e8d4a5100090610bba9087611e28565b81610bc157fe5b0490611e65565b979650505050505050565b6000546001600160a01b03163314610bfd5760405162461bcd60e51b815260040161059690612932565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526006602090815260408083203384529091528120805482825560018201839055600580549293919286908110610c5657fe5b6000918252602090912001546001600160a01b031690508015610cdb576040516345fb1ba160e11b81526001600160a01b03821690638bf6374290610ca8908890339089906000908190600401612b53565b600060405180830381600087803b158015610cc257600080fd5b505af1158015610cd6573d6000803e3d6000fd5b505050505b610ced84836004888154811061078157fe5b836001600160a01b031685336001600160a01b03167f2cac5e20e1541d836381527a43f651851e302817b71dc8e810284e69210c1c6b85604051610d319190612b4a565b60405180910390a45050505050565b6002546001600160a01b0316610d685760405162461bcd60e51b815260040161059690612a00565b600060048281548110610d7757fe5b60009182526020822001546040516370a0823160e01b81526001600160a01b03909116925082906370a0823190610db2903090600401612636565b60206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906124eb565b60025460405163095ea7b360e01b81529192506001600160a01b038085169263095ea7b392610e3792169085906004016126af565b602060405180830381600087803b158015610e5157600080fd5b505af1158015610e65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e89919061237a565b5060025460405163ce5494bb60e01b81526000916001600160a01b03169063ce5494bb90610ebb908690600401612636565b602060405180830381600087803b158015610ed557600080fd5b505af1158015610ee9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0d9190612396565b6040516370a0823160e01b81529091506001600160a01b038216906370a0823190610f3c903090600401612636565b60206040518083038186803b158015610f5457600080fd5b505afa158015610f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8c91906124eb565b8214610faa5760405162461bcd60e51b81526004016105969061287b565b6001600160a01b03811660009081526007602052604090205460ff1615610fe35760405162461bcd60e51b81526004016105969061299c565b6001600160a01b03808216600090815260076020526040808220805460ff199081166001179091559286168252902080549091169055600480548291908690811061102a57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555050505050565b6001546001600160a01b03163381146110895760405162461bcd60e51b815260040161059690612967565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b039092166001600160a01b0319928316179055600180549091169055565b6110f3612224565b6003828154811061110057fe5b60009182526020918290206040805160608101825292909101546001600160801b03811683526001600160401b03600160801b82048116948401859052600160c01b9091041690820152915042111561136a5760006004838154811061116257fe5b6000918252602090912001546040516370a0823160e01b81526001600160a01b03909116906370a082319061119b903090600401612636565b60206040518083038186803b1580156111b357600080fd5b505afa1580156111c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111eb91906124eb565b9050801561128e57600061121583602001516001600160401b031642611eb290919063ffffffff16565b9050600060085461124285604001516001600160401b0316610b6260095486611e2890919063ffffffff16565b8161124957fe5b04905061128061126f846112628464e8d4a51000611e28565b8161126957fe5b0461200c565b85516001600160801b031690612035565b6001600160801b0316845250505b61129742612064565b6001600160401b0316602083015260038054839190859081106112b657fe5b6000918252602091829020835191018054848401516040958601516001600160801b03199092166001600160801b039094169390931767ffffffffffffffff60801b1916600160801b6001600160401b0394851602176001600160c01b0316600160c01b93909116929092029190911790558301518351915185927f0fc9545022a542541ad085d091fb09a2ab36fee366a4576ab63714ea907ad353926113609290918691612ba0565b60405180910390a2505b919050565b8060005b8181101561139f5761139684848381811061138a57fe5b905060200201356110eb565b50600101611373565b50505050565b600481815481106113b257fe5b6000918252602090912001546001600160a01b0316905081565b60076020526000908152604090205460ff1681565b60405163d505accf60e01b81526001600160a01b0389169063d505accf90611419908a908a908a908a908a908a908a9060040161266e565b600060405180830381600087803b15801561143357600080fd5b505af1158015611447573d6000803e3d6000fd5b505050505050505050505050565b6002546001600160a01b031681565b6000546001600160a01b0316331461148e5760405162461bcd60e51b815260040161059690612932565b6114cd836114c7600387815481106114a257fe5b60009182526020909120015460085490600160c01b90046001600160401b0316611eb2565b90611fe9565b6008556114d983612064565b600385815481106114e657fe5b9060005260206000200160000160186101000a8154816001600160401b0302191690836001600160401b03160217905550801561155a57816005858154811061152b57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b80611586576005848154811061156c57fe5b6000918252602090912001546001600160a01b0316611588565b815b6001600160a01b0316847f95895a6ab1df54420d241b55243258a33e61b2194db66c1179ec521aae8e186585846040516115c3929190612b82565b60405180910390a350505050565b6000546001600160a01b031681565b6115e8612224565b6115f1846110eb565b60008581526006602090815260408083206001600160a01b038716845290915290208054919250906116239085611fe9565b8155815161165a9064e8d4a51000906116469087906001600160801b0316611e28565b8161164d57fe5b600184015491900461208d565b816001018190555060006005868154811061167157fe5b6000918252602090912001546001600160a01b0316905080156116f75781546040516345fb1ba160e11b81526001600160a01b03831691638bf63742916116c4918a918991829160009190600401612b53565b600060405180830381600087803b1580156116de57600080fd5b505af11580156116f2573d6000803e3d6000fd5b505050505b61172733308760048a8154811061170a57fe5b6000918252602090912001546001600160a01b03169291906120d3565b836001600160a01b031686336001600160a01b03167f02d7e648dd130fc184d383e55bb126ac4c9c60e8f94bf05acdf557ba2d540b47886040516107e19190612b4a565b60066020908152600092835260408084209091529082529020805460019091015482565b6000546001600160a01b031633146117b95760405162461bcd60e51b815260040161059690612932565b60098190556040517fc6ce5eff3291fb2c1517b943daa5067ea76c83816bbf674307fbc7fea3b311d0906117ee908390612b4a565b60405180910390a150565b60095481565b7f00000000000000000000000090708b20ccc1eb95a4fa7c8b18fd2c22a0ff9e7881565b6000546001600160a01b0316331461184d5760405162461bcd60e51b815260040161059690612932565b6001600160a01b03821660009081526007602052604090205460ff16156118865760405162461bcd60e51b81526004016105969061299c565b6008546118939084611fe9565b6008556004805460018181019092557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b038086166001600160a01b03199283161790925560058054938401815560009081527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db090930180549285169290911691909117905560408051606081019091529081526003906020810161194042612064565b6001600160401b0316815260200161195786612064565b6001600160401b0390811690915282546001818101855560009485526020808620855193018054828701516040978801518716600160c01b026001600160c01b0391909716600160801b0267ffffffffffffffff60801b196001600160801b039097166001600160801b031990931692909217959095161793909316939093179091556001600160a01b03808716808652600790935292909320805460ff191684179055600454918416929091611a0d91611eb2565b7f81ee0f8c5c46e2cb41984886f77a84181724abb86c32a5f6de539b07509d45e586604051611a3c9190612b4a565b60405180910390a4505050565b600581815481106113b257fe5b611a5e612224565b611a67846110eb565b6000858152600660209081526040808320338452909152812082518154939450909264e8d4a5100091611aa391906001600160801b0316611e28565b81611aaa57fe5b0490506000611ac96108ac846001015484611e6590919063ffffffff16565b9050611b0464e8d4a51000611af486600001516001600160801b031689611e2890919063ffffffff16565b81611afb57fe5b84919004611e65565b60018401558254611b159087611eb2565b8355611b4b6001600160a01b037f00000000000000000000000090708b20ccc1eb95a4fa7c8b18fd2c22a0ff9e78168683611ed5565b600060058881548110611b5a57fe5b6000918252602090912001546001600160a01b031690508015611bdf5783546040516345fb1ba160e11b81526001600160a01b03831691638bf6374291611bac918c9133918c91899190600401612b53565b600060405180830381600087803b158015611bc657600080fd5b505af1158015611bda573d6000803e3d6000fd5b505050505b611bf1868860048b8154811061078157fe5b856001600160a01b031688336001600160a01b03167f8166bf25f8a2b7ed3c85049207da4358d16edbed977d23fa2ee6f0dde3ec21328a604051611c359190612b4a565b60405180910390a487336001600160a01b03167f71bab65ced2e5750775a0613be067df48ef06cf92a496ebf7663ae066092495484604051611c779190612b4a565b60405180910390a35050505050505050565b606080836001600160401b0381118015611ca257600080fd5b50604051908082528060200260200182016040528015611ccc578160200160208202803683370190505b509150836001600160401b0381118015611ce557600080fd5b50604051908082528060200260200182016040528015611d1957816020015b6060815260200190600190039081611d045790505b50905060005b84811015611e10576000606030888885818110611d3857fe5b9050602002810190611d4a9190612bca565b604051611d5892919061260a565b600060405180830381855af49150503d8060008114611d93576040519150601f19603f3d011682016040523d82523d6000602084013e611d98565b606091505b50915091508180611da7575085155b611db0826121c4565b90611dce5760405162461bcd60e51b8152600401610596919061276d565b5081858481518110611ddc57fe5b60200260200101901515908115158152505080848481518110611dfb57fe5b60209081029190910101525050600101611d1f565b50935093915050565b6001546001600160a01b031681565b6000811580611e4357505080820282828281611e4057fe5b04145b611e5f5760405162461bcd60e51b815260040161059690612ab0565b92915050565b6000818303818312801590611e7a5750838113155b80611e8f5750600083128015611e8f57508381135b611eab5760405162461bcd60e51b815260040161059690612a37565b9392505050565b80820382811115611e5f5760405162461bcd60e51b815260040161059690612780565b60006060846001600160a01b031663a9059cbb8585604051602401611efb9291906126af565b6040516020818303038152906040529060e01b6020820180516001600160e01b038381831617835250505050604051611f34919061261a565b6000604051808303816000865af19150503d8060008114611f71576040519150601f19603f3d011682016040523d82523d6000602084013e611f76565b606091505b5091509150818015611fa0575080511580611fa0575080806020019051810190611fa0919061237a565b611fbc5760405162461bcd60e51b8152600401610596906127d4565b5050505050565b600080821215611fe55760405162461bcd60e51b8152600401610596906127af565b5090565b81810181811015611e5f5760405162461bcd60e51b8152600401610596906128fb565b60006001600160801b03821115611fe55760405162461bcd60e51b8152600401610596906128c4565b8181016001600160801b038083169082161015611e5f5760405162461bcd60e51b8152600401610596906128fb565b60006001600160401b03821115611fe55760405162461bcd60e51b8152600401610596906129c9565b60008282018183128015906120a25750838112155b806120b757506000831280156120b757508381125b611eab5760405162461bcd60e51b81526004016105969061280b565b60006060856001600160a01b03166323b872dd8686866040516024016120fb9392919061264a565b6040516020818303038152906040529060e01b6020820180516001600160e01b038381831617835250505050604051612134919061261a565b6000604051808303816000865af19150503d8060008114612171576040519150601f19603f3d011682016040523d82523d6000602084013e612176565b606091505b50915091508180156121a05750805115806121a05750808060200190518101906121a0919061237a565b6121bc5760405162461bcd60e51b815260040161059690612a7b565b505050505050565b606060448251101561220a575060408051808201909152601d81527f5472616e73616374696f6e2072657665727465642073696c656e746c79000000602082015261136a565b60048201915081806020019051810190611e5f9190612439565b604080516060810182526000808252602082018190529181019190915290565b60008083601f840112612255578182fd5b5081356001600160401b0381111561226b578182fd5b602083019150836020808302850101111561228557600080fd5b9250929050565b60006020828403121561229d578081fd5b8135611eab81612c3a565b6000806000606084860312156122bc578182fd5b83356122c781612c3a565b925060208401356122d781612c52565b915060408401356122e781612c52565b809150509250925092565b600080600060408486031215612306578283fd5b83356001600160401b0381111561231b578384fd5b61232786828701612244565b90945092505060208401356122e781612c52565b6000806020838503121561234d578182fd5b82356001600160401b03811115612362578283fd5b61236e85828601612244565b90969095509350505050565b60006020828403121561238b578081fd5b8151611eab81612c52565b6000602082840312156123a7578081fd5b8151611eab81612c3a565b600080600080600080600080610100898b0312156123ce578384fd5b88356123d981612c3a565b975060208901356123e981612c3a565b965060408901356123f981612c3a565b9550606089013594506080890135935060a089013560ff8116811461241c578384fd5b979a969950949793969295929450505060c08201359160e0013590565b60006020828403121561244a578081fd5b81516001600160401b0380821115612460578283fd5b818401915084601f830112612473578283fd5b815181811115612481578384fd5b604051601f8201601f1916810160200183811182821017156124a1578586fd5b6040528181528382016020018710156124b8578485fd5b6124c9826020830160208701612c0e565b9695505050505050565b6000602082840312156124e4578081fd5b5035919050565b6000602082840312156124fc578081fd5b5051919050565b60008060408385031215612515578182fd5b82359150602083013561252781612c3a565b809150509250929050565b600080600060608486031215612546578081fd5b83359250602084013561255881612c3a565b915060408401356122e781612c3a565b60008060006060848603121561257c578081fd5b833592506020840135915060408401356122e781612c3a565b600080600080608085870312156125aa578182fd5b843593506020850135925060408501356125c381612c3a565b915060608501356125d381612c52565b939692955090935050565b600081518084526125f6816020860160208601612c0e565b601f01601f19169290920160200192915050565b6000828483379101908152919050565b6000825161262c818460208701612c0e565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0397881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6001600160a01b03929092168252602082015260400190565b604080825283519082018190526000906020906060840190828701845b828110156127035781511515845292840192908401906001016126e5565b5050508381038285015280855161271a8184612b4a565b91508192508381028201848801865b838110156127535785830385526127418383516125de565b94870194925090860190600101612729565b50909998505050505050505050565b901515815260200190565b600060208252611eab60208301846125de565b602080825260159082015274426f72696e674d6174683a20556e646572666c6f7760581b604082015260600190565b6020808252600b908201526a0496e7465676572203c20360ac1b604082015260600190565b6020808252601c908201527f426f72696e6745524332303a205472616e73666572206661696c656400000000604082015260600190565b60208082526021908201527f5369676e6564536166654d6174683a206164646974696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252601590820152744f776e61626c653a207a65726f206164647265737360581b604082015260600190565b60208082526029908201527f4d61737465724368656656323a206d696772617465642062616c616e6365206d6040820152680eae6e840dac2e8c6d60bb1b606082015260800190565b6020808252601c908201527f426f72696e674d6174683a2075696e74313238204f766572666c6f7700000000604082015260600190565b60208082526018908201527f426f72696e674d6174683a20416464204f766572666c6f770000000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e6572604082015260600190565b602080825260139082015272151bdad95b88185b1c9958591e481859191959606a1b604082015260600190565b6020808252601b908201527f426f72696e674d6174683a2075696e743634204f766572666c6f770000000000604082015260600190565b6020808252601d908201527f4d61737465724368656656323a206e6f206d69677261746f7220736574000000604082015260600190565b60208082526024908201527f5369676e6564536166654d6174683a207375627472616374696f6e206f766572604082015263666c6f7760e01b606082015260800190565b6020808252818101527f426f72696e6745524332303a205472616e7366657246726f6d206661696c6564604082015260600190565b60208082526018908201527f426f72696e674d6174683a204d756c204f766572666c6f770000000000000000604082015260600190565b81516001600160801b031681526020808301516001600160401b0390811691830191909152604092830151169181019190915260600190565b6001600160801b039390931683526001600160401b03918216602084015216604082015260600190565b90815260200190565b9485526001600160a01b0393841660208601529190921660408401526060830191909152608082015260a00190565b9182521515602082015260400190565b918252602082015260400190565b6001600160401b0393909316835260208301919091526001600160801b0316604082015260600190565b6000808335601e19843603018112612be0578283fd5b8301803591506001600160401b03821115612bf9578283fd5b60200191503681900382131561228557600080fd5b60005b83811015612c29578181015183820152602001612c11565b8381111561139f5750506000910152565b6001600160a01b0381168114612c4f57600080fd5b50565b8015158114612c4f57600080fdfea2646970667358221220ceb5947e061c3af6548088dd34c23a1f5b7998883288ff5a511073284adf060164736f6c634300060c0033