Contract 0xcb30A66e72Ed90D1b34f78fc0655895FC28bB6CF

 

Contract Overview

Impermax: SushiSwap Staked LP Factory
Balance:
0 MATIC

MATIC Value:
$0.00

Token:
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xdc9b88222bdc43fe759f8d6f88b484f247caacc21500150bd03f4a1542b46b41Create Staked LP...247093742022-02-08 21:08:17296 days 15 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.115342820419 30.96111606
0x8820fd7228e5a026b4f847a960990381e1480841f850bd5e7f505aca0d7e1fdbCreate Staked LP...224549232021-12-12 23:49:29354 days 12 hrs ago0x5ec869c1cb378bb77bc55bb56129399f6828c8c5 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.17881963248
0x998d0b936e79537bdd98652c45b344bba6fbe65889c80cc75779508708be4e69Create Staked LP...224539652021-12-12 23:10:09354 days 13 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.1117622730
0xc402bee56876e5868b6353e9743ef6b18e0f62697d23fa2a732ce1b84e5673daCreate Staked LP...218675162021-11-27 16:52:39369 days 19 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.1117622730
0x6da3ad03753d550cd97b89a21baef3182bba91b9ab4fd312cca6a014f923a1fdCreate Staked LP...214427652021-11-16 15:39:36380 days 21 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.21607372258
0x3417bb276f7f7505f20af6eafd21f76139406d5f48e17ac9f05a54a151e5d9fcCreate Staked LP...209798912021-11-04 17:28:49392 days 19 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.1117622730
0x6c95c49b3e421214f6824e55c279b5462f6625a2caa50b2ce908e03b6ccf456eCreate Staked LP...194356492021-09-23 22:31:41434 days 14 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.11857590432
0x1bbb746ac6b1a8d37feb652967009cf6091c0f5b4555460ca48575459dcc718aCreate Staked LP...194354922021-09-23 22:26:15434 days 14 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.11921308832
0xa32f8f0923f966af2c1fe7034f4c1a6f9f5a0045c63e54e1bd074a6304e48cf2Create Staked LP...194352972021-09-23 22:18:33434 days 14 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.13038931535
0x25f95609543e855be383706147a703e1cba9a42bfc6f184604315dff22f37b15Create Staked LP...194352642021-09-23 22:16:21434 days 14 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.11548767931
0x3aca015212a8b74cd39c40fbcdd79ca8ffc151bc262391292e57467a9207d93dCreate Staked LP...194351752021-09-23 22:13:13434 days 14 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.08940981624
0x840d9d7cfa2be63f92cde74a0e608cc8b14dcd4bf46bff584d08ea1fa8eca610Create Staked LP...194350832021-09-23 22:10:05434 days 14 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.10431145228
0x70f8df11e397e5da35b73303e5b50a4ee5bb1a322ede760a863eb90460544959Create Staked LP...194349432021-09-23 22:05:13434 days 14 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.11548767931
0x13cf2996e40261c207a686e9f0d25d9a932c57b42574ac0bf59074ed01fba8bfCreate Staked LP...188621032021-09-07 22:37:12450 days 14 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.17589792347
0xa54b10b83fafe38e424ba6219b2f630bcb1835a86f4ac2ac8c4c93e7376e4c40Create Staked LP...187126682021-09-03 20:05:39454 days 16 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Impermax: SushiSwap Staked LP Factory0 MATIC0.0261800637
0xa611bd63f19802e51c289a1c79fae09190714cc1d3032f487cf9c630768b4e190x60806040187123052021-09-03 19:50:05454 days 16 hrs ago0x9fc5341db9a9cdf8337b4bd286d4cfc03b20ad35 IN  Create: StakedLPTokenFactory02120 MATIC0.0197227155
[ Download CSV Export 
Latest 15 internal transactions
Parent Txn Hash Block From To Value
0xdc9b88222bdc43fe759f8d6f88b484f247caacc21500150bd03f4a1542b46b41247093742022-02-08 21:08:17296 days 15 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0x8820fd7228e5a026b4f847a960990381e1480841f850bd5e7f505aca0d7e1fdb224549232021-12-12 23:49:29354 days 12 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0x998d0b936e79537bdd98652c45b344bba6fbe65889c80cc75779508708be4e69224539652021-12-12 23:10:09354 days 13 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0xc402bee56876e5868b6353e9743ef6b18e0f62697d23fa2a732ce1b84e5673da218675162021-11-27 16:52:39369 days 19 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0x6da3ad03753d550cd97b89a21baef3182bba91b9ab4fd312cca6a014f923a1fd214427652021-11-16 15:39:36380 days 21 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0x3417bb276f7f7505f20af6eafd21f76139406d5f48e17ac9f05a54a151e5d9fc209798912021-11-04 17:28:49392 days 19 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0x6c95c49b3e421214f6824e55c279b5462f6625a2caa50b2ce908e03b6ccf456e194356492021-09-23 22:31:41434 days 14 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0x1bbb746ac6b1a8d37feb652967009cf6091c0f5b4555460ca48575459dcc718a194354922021-09-23 22:26:15434 days 14 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0xa32f8f0923f966af2c1fe7034f4c1a6f9f5a0045c63e54e1bd074a6304e48cf2194352972021-09-23 22:18:33434 days 14 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0x25f95609543e855be383706147a703e1cba9a42bfc6f184604315dff22f37b15194352642021-09-23 22:16:21434 days 14 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0x3aca015212a8b74cd39c40fbcdd79ca8ffc151bc262391292e57467a9207d93d194351752021-09-23 22:13:13434 days 14 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0x840d9d7cfa2be63f92cde74a0e608cc8b14dcd4bf46bff584d08ea1fa8eca610194350832021-09-23 22:10:05434 days 14 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0x70f8df11e397e5da35b73303e5b50a4ee5bb1a322ede760a863eb90460544959194349432021-09-23 22:05:13434 days 14 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0x13cf2996e40261c207a686e9f0d25d9a932c57b42574ac0bf59074ed01fba8bf188621032021-09-07 22:37:12450 days 14 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
0xa54b10b83fafe38e424ba6219b2f630bcb1835a86f4ac2ac8c4c93e7376e4c40187126682021-09-03 20:05:39454 days 16 hrs ago Impermax: SushiSwap Staked LP Factory  Contract Creation0 MATIC
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakedLPTokenFactory0212

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at polygonscan.com on 2021-09-10
*/

// File: contracts\libraries\SafeMath.sol

pragma solidity =0.5.16;

// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, errorMessage);

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot underflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction underflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot underflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, errorMessage);

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers.
     * Reverts on division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers.
     * Reverts with custom message on division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

// File: contracts\ImpermaxERC20.sol

pragma solidity =0.5.16;


// This contract is basically UniswapV2ERC20 with small modifications
// src: https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol

contract ImpermaxERC20 {
	using SafeMath for uint;
	
	string public name;
	string public symbol;
	uint8 public decimals = 18;
	uint public totalSupply;
	mapping(address => uint) public balanceOf;
	mapping(address => mapping(address => uint)) public allowance;
	
	bytes32 public DOMAIN_SEPARATOR;
	mapping(address => uint) public nonces;
	
	event Transfer(address indexed from, address indexed to, uint value);
	event Approval(address indexed owner, address indexed spender, uint value);

	constructor() public {}	
	
	function _setName(string memory _name, string memory _symbol) internal {
		name = _name;
		symbol = _symbol;
		uint chainId;
		assembly {
			chainId := chainid
		}
		DOMAIN_SEPARATOR = keccak256(
			abi.encode(
				keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
				keccak256(bytes(_name)),
				keccak256(bytes("1")),
				chainId,
				address(this)
			)
		);
	}

	function _mint(address to, uint value) internal {
		totalSupply = totalSupply.add(value);
		balanceOf[to] = balanceOf[to].add(value);
		emit Transfer(address(0), to, value);
	}

	function _burn(address from, uint value) internal {
		balanceOf[from] = balanceOf[from].sub(value);
		totalSupply = totalSupply.sub(value);
		emit Transfer(from, address(0), value);
	}

	function _approve(address owner, address spender, uint value) private {
		allowance[owner][spender] = value;
		emit Approval(owner, spender, value);
	}

	function _transfer(address from, address to, uint value) internal {
		balanceOf[from] = balanceOf[from].sub(value, "Impermax: TRANSFER_TOO_HIGH");
		balanceOf[to] = balanceOf[to].add(value);
		emit Transfer(from, to, value);
	}

	function approve(address spender, uint value) external returns (bool) {
		_approve(msg.sender, spender, value);
		return true;
	}

	function transfer(address to, uint value) external returns (bool) {
		_transfer(msg.sender, to, value);
		return true;
	}

	function transferFrom(address from, address to, uint value) external returns (bool) {
		if (allowance[from][msg.sender] != uint(-1)) {
			allowance[from][msg.sender] = allowance[from][msg.sender].sub(value, "Impermax: TRANSFER_NOT_ALLOWED");
		}
		_transfer(from, to, value);
		return true;
	}
	
	function _checkSignature(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s, bytes32 typehash) internal {
		require(deadline >= block.timestamp, "Impermax: EXPIRED");
		bytes32 digest = keccak256(
			abi.encodePacked(
				'\x19\x01',
				DOMAIN_SEPARATOR,
				keccak256(abi.encode(typehash, owner, spender, value, nonces[owner]++, deadline))
			)
		);
		address recoveredAddress = ecrecover(digest, v, r, s);
		require(recoveredAddress != address(0) && recoveredAddress == owner, "Impermax: INVALID_SIGNATURE");	
	}

	// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
	bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
	function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
		_checkSignature(owner, spender, value, deadline, v, r, s, PERMIT_TYPEHASH);
		_approve(owner, spender, value);
	}
}

// File: contracts\interfaces\IERC20.sol

pragma solidity >=0.5.0;

interface IERC20 {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);
}

// File: contracts\interfaces\IPoolToken.sol

pragma solidity >=0.5.0;

interface IPoolToken {

	/*** Impermax ERC20 ***/
	
	event Transfer(address indexed from, address indexed to, uint value);
	event Approval(address indexed owner, address indexed spender, uint value);
	
	function name() external pure returns (string memory);
	function symbol() external pure returns (string memory);
	function decimals() external pure returns (uint8);
	function totalSupply() external view returns (uint);
	function balanceOf(address owner) external view returns (uint);
	function allowance(address owner, address spender) external view returns (uint);
	function approve(address spender, uint value) external returns (bool);
	function transfer(address to, uint value) external returns (bool);
	function transferFrom(address from, address to, uint value) external returns (bool);
	
	function DOMAIN_SEPARATOR() external view returns (bytes32);
	function PERMIT_TYPEHASH() external pure returns (bytes32);
	function nonces(address owner) external view returns (uint);
	function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
	
	/*** Pool Token ***/
	
	event Mint(address indexed sender, address indexed minter, uint mintAmount, uint mintTokens);
	event Redeem(address indexed sender, address indexed redeemer, uint redeemAmount, uint redeemTokens);
	event Sync(uint totalBalance);
	
	function underlying() external view returns (address);
	function factory() external view returns (address);
	function totalBalance() external view returns (uint);
	function MINIMUM_LIQUIDITY() external pure returns (uint);

	function exchangeRate() external returns (uint);
	function mint(address minter) external returns (uint mintTokens);
	function redeem(address redeemer) external returns (uint redeemAmount);
	function skim(address to) external;
	function sync() external;
	
	function _setFactory() external;
}

// File: contracts\PoolToken.sol

pragma solidity =0.5.16;





contract PoolToken is IPoolToken, ImpermaxERC20 {
   	uint internal constant initialExchangeRate = 1e18;
	address public underlying;
	address public factory;
	uint public totalBalance;
	uint public constant MINIMUM_LIQUIDITY = 1000;
	
	event Mint(address indexed sender, address indexed minter, uint mintAmount, uint mintTokens);
	event Redeem(address indexed sender, address indexed redeemer, uint redeemAmount, uint redeemTokens);
	event Sync(uint totalBalance);
	
	/*** Initialize ***/
	
	// called once by the factory
	function _setFactory() external {
		require(factory == address(0), "Impermax: FACTORY_ALREADY_SET");
		factory = msg.sender;
	}
	
	/*** PoolToken ***/
	
	function _update() internal {
		totalBalance = IERC20(underlying).balanceOf(address(this));
		emit Sync(totalBalance);
	}

	function exchangeRate() public returns (uint) 
	{
		uint _totalSupply = totalSupply; // gas savings
		uint _totalBalance = totalBalance; // gas savings
		if (_totalSupply == 0 || _totalBalance == 0) return initialExchangeRate;
		return _totalBalance.mul(1e18).div(_totalSupply);
	}
	
	// this low-level function should be called from another contract
	function mint(address minter) external nonReentrant update returns (uint mintTokens) {
		uint balance = IERC20(underlying).balanceOf(address(this));
		uint mintAmount = balance.sub(totalBalance);
		mintTokens = mintAmount.mul(1e18).div(exchangeRate());

		if(totalSupply == 0) {
			// permanently lock the first MINIMUM_LIQUIDITY tokens
			mintTokens = mintTokens.sub(MINIMUM_LIQUIDITY);
			_mint(address(0), MINIMUM_LIQUIDITY);
		}
		require(mintTokens > 0, "Impermax: MINT_AMOUNT_ZERO");
		_mint(minter, mintTokens);
		emit Mint(msg.sender, minter, mintAmount, mintTokens);
	}

	// this low-level function should be called from another contract
	function redeem(address redeemer) external nonReentrant update returns (uint redeemAmount) {
		uint redeemTokens = balanceOf[address(this)];
		redeemAmount = redeemTokens.mul(exchangeRate()).div(1e18);

		require(redeemAmount > 0, "Impermax: REDEEM_AMOUNT_ZERO");
		require(redeemAmount <= totalBalance, "Impermax: INSUFFICIENT_CASH");
		_burn(address(this), redeemTokens);
		_safeTransfer(redeemer, redeemAmount);
		emit Redeem(msg.sender, redeemer, redeemAmount, redeemTokens);		
	}

	// force real balance to match totalBalance
	function skim(address to) external nonReentrant {
		_safeTransfer(to, IERC20(underlying).balanceOf(address(this)).sub(totalBalance));
	}

	// force totalBalance to match real balance
	function sync() external nonReentrant update {}
	
	/*** Utilities ***/
	
	// same safe transfer function used by UniSwapV2 (with fixed underlying)
	bytes4 private constant SELECTOR = bytes4(keccak256(bytes("transfer(address,uint256)")));
	function _safeTransfer(address to, uint amount) internal {
		(bool success, bytes memory data) = underlying.call(abi.encodeWithSelector(SELECTOR, to, amount));
		require(success && (data.length == 0 || abi.decode(data, (bool))), "Impermax: TRANSFER_FAILED");
	}
	
	// prevents a contract from calling itself, directly or indirectly.
	bool internal _notEntered = true;
	modifier nonReentrant() {
		require(_notEntered, "Impermax: REENTERED");
		_notEntered = false;
		_;
		_notEntered = true;
	}
	
	// update totalBalance with current balance
	modifier update() {
		_;
		_update();
	}
}

// File: contracts\interfaces\IStakingRewards.sol

pragma solidity >=0.5.0;

interface IStakingRewards {
    function rewardsToken() external view returns (address);
    function stakingToken() external view returns (address);
    function balanceOf(address account) external view returns (uint256);
    function earned(address account) external view returns (uint256);

    function stake(uint256 amount) external;
    function withdraw(uint256 amount) external;
    function getReward() external;
}

// File: contracts\interfaces\IStakedLPToken02.sol

pragma solidity >=0.5.0;

interface IStakedLPToken02 {

	/*** Impermax ERC20 ***/
	
	event Transfer(address indexed from, address indexed to, uint value);
	event Approval(address indexed owner, address indexed spender, uint value);
	
	function name() external pure returns (string memory);
	function symbol() external pure returns (string memory);
	function decimals() external pure returns (uint8);
	function totalSupply() external view returns (uint);
	function balanceOf(address owner) external view returns (uint);
	function allowance(address owner, address spender) external view returns (uint);
	function approve(address spender, uint value) external returns (bool);
	function transfer(address to, uint value) external returns (bool);
	function transferFrom(address from, address to, uint value) external returns (bool);
	
	function DOMAIN_SEPARATOR() external view returns (bytes32);
	function PERMIT_TYPEHASH() external pure returns (bytes32);
	function nonces(address owner) external view returns (uint);
	function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
	
	/*** Pool Token ***/
	
	event Mint(address indexed sender, address indexed minter, uint mintAmount, uint mintTokens);
	event Redeem(address indexed sender, address indexed redeemer, uint redeemAmount, uint redeemTokens);
	event Sync(uint totalBalance);
	
	function underlying() external view returns (address);
	function factory() external view returns (address);
	function totalBalance() external view returns (uint);
	function MINIMUM_LIQUIDITY() external pure returns (uint);

	function exchangeRate() external returns (uint);
	function mint(address minter) external returns (uint mintTokens);
	function redeem(address redeemer) external returns (uint redeemAmount);
	function skim(address to) external;
	function sync() external;
	
	function _setFactory() external;
	
	/*** StakedLPToken ***/
	
	event Reinvest(address indexed caller, uint256 reward, uint256 bounty);
	
	function isStakedLPToken() external pure returns (bool);
	function stakedLPTokenType() external pure returns (string memory);
	function pid() external view returns (uint256);
	function token0() external view returns (address);
	function token1() external view returns (address);
	function router() external view returns (address);
	function masterChef() external view returns (address);
	function rewardsToken() external view returns (address);
	function WETH() external view returns (address);
	function REINVEST_BOUNTY() external pure returns (uint256);
	
	function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
	function price0CumulativeLast() external view returns (uint256);
	function price1CumulativeLast() external view returns (uint256);

	function _initialize(
		uint256 _pid,
		address _underlying,
		address _token0,
		address _token1,
		address _router,
		address _masterChef,
		address _rewardsToken,
		address _WETH
	) external;

	function getReward() external returns (uint256);
	function reinvest() external;
}

// File: contracts\interfaces\IMasterChef0212.sol

pragma solidity >=0.5.0;

// For:
// SushiSwap
// ApeSwap

interface IMasterChef0212 {
	function lpToken(uint256) external view returns (address);
	function userInfo(uint256, address) external view returns (
		uint256 amount,
		uint256 rewardDebt
	);
	function rewarder(uint256) external view returns (address);

	function deposit(uint256 _pid, uint256 _amount, address _to) external;
	function withdraw(uint256 _pid, uint256 _amount, address _to) external;
	function harvest(uint256 _pid, address _to) external;
}

// File: contracts\interfaces\IRewarder.sol

pragma solidity >=0.5.0;

interface IRewarder {
	function pendingTokens(uint256 pid, address user, uint256 sushiAmount) external view returns (address[] memory, uint256[] memory);
}

// File: contracts\interfaces\IUniswapV2Router01.sol

pragma solidity >=0.5.0;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

// File: contracts\interfaces\IUniswapV2Pair.sol

pragma solidity >=0.5.0;

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);
	
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);

    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
}

// File: contracts\libraries\SafeToken.sol

pragma solidity 0.5.16;

interface ERC20Interface {
    function balanceOf(address user) external view returns (uint256);
}

library SafeToken {
    function myBalance(address token) internal view returns (uint256) {
        return ERC20Interface(token).balanceOf(address(this));
    }

    function balanceOf(address token, address user) internal view returns (uint256) {
        return ERC20Interface(token).balanceOf(user);
    }

    function safeApprove(address token, address to, uint256 value) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeApprove");
    }

    function safeTransfer(address token, address to, uint256 value) internal {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeTransfer");
    }

    function safeTransferFrom(address token, address from, address to, uint256 value) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeTransferFrom");
    }

    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call.value(value)(new bytes(0));
        require(success, "!safeTransferETH");
    }
}

// File: contracts\libraries\Math.sol

pragma solidity =0.5.16;

// a library for performing various math operations
// forked from: https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/libraries/Math.sol

library Math {
    function min(uint x, uint y) internal pure returns (uint z) {
        z = x < y ? x : y;
    }

    // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
    function sqrt(uint y) internal pure returns (uint z) {
        if (y > 3) {
            z = y;
            uint x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
    }
}

// File: contracts\StakedLPToken0212.sol

pragma solidity =0.5.16;











contract StakedLPToken0212 is IStakedLPToken02, IUniswapV2Pair, PoolToken {
	using SafeToken for address;
	
	bool public constant isStakedLPToken = true;
	string public constant stakedLPTokenType = "0212";
	
	uint256 public pid;
	address public token0;
	address public token1;
	address public router;
	address public masterChef;
	address public rewardsToken;
	address public WETH;
	uint256 public constant REINVEST_BOUNTY = 0.02e18;

	event Reinvest(address indexed caller, uint256 reward, uint256 bounty);
		
	function _initialize(
		uint256 _pid,
		address _underlying,
		address _token0,
		address _token1,
		address _router,
		address _masterChef,
		address _rewardsToken,
		address _WETH
	) external {
		require(factory == address(0), "StakedLPToken: FACTORY_ALREADY_SET"); // sufficient check
		factory = msg.sender;
		_setName("Staked Uniswap V2", "STKD-UNI-V2");
		pid = _pid;
		underlying = _underlying;
		token0 = _token0;
		token1 = _token1;
		router = _router;
		masterChef = _masterChef;
		rewardsToken = _rewardsToken;
		WETH = _WETH;
		_rewardsToken.safeApprove(address(_router), uint256(-1));
		_WETH.safeApprove(address(_router), uint256(-1));
		_underlying.safeApprove(address(_masterChef), uint256(-1));
	}
	
	/*** PoolToken Overrides ***/
	
	function _update() internal {
		(uint256 _totalBalance,) = IMasterChef0212(masterChef).userInfo(pid, address(this));
		totalBalance = _totalBalance;
		emit Sync(_totalBalance);
	}
	
	// this low-level function should be called from another contract
	function mint(address minter) external nonReentrant update returns (uint mintTokens) {
		uint mintAmount = underlying.myBalance();
		// handle pools with deposit fees by checking balance before and after deposit
		(uint256 _totalBalanceBefore,) = IMasterChef0212(masterChef).userInfo(pid, address(this));
		IMasterChef0212(masterChef).deposit(pid, mintAmount, address(this));
		(uint256 _totalBalanceAfter,) = IMasterChef0212(masterChef).userInfo(pid, address(this));
		mintTokens = _totalBalanceAfter.sub(_totalBalanceBefore).mul(1e18).div(exchangeRate());

		if(totalSupply == 0) {
			// permanently lock the first MINIMUM_LIQUIDITY tokens
			mintTokens = mintTokens.sub(MINIMUM_LIQUIDITY);
			_mint(address(0), MINIMUM_LIQUIDITY);
		}
		require(mintTokens > 0, "StakedLPToken: MINT_AMOUNT_ZERO");
		_mint(minter, mintTokens);
		emit Mint(msg.sender, minter, mintAmount, mintTokens);
	}

	// this low-level function should be called from another contract
	function redeem(address redeemer) external nonReentrant update returns (uint redeemAmount) {
		uint redeemTokens = balanceOf[address(this)];
		redeemAmount = redeemTokens.mul(exchangeRate()).div(1e18);

		require(redeemAmount > 0, "StakedLPToken: REDEEM_AMOUNT_ZERO");
		require(redeemAmount <= totalBalance, "StakedLPToken: INSUFFICIENT_CASH");
		_burn(address(this), redeemTokens);
		IMasterChef0212(masterChef).withdraw(pid, redeemAmount, address(this));
		_safeTransfer(redeemer, redeemAmount);
		emit Redeem(msg.sender, redeemer, redeemAmount, redeemTokens);		
	}
	
	/*** Reinvest ***/
	
	function _optimalDepositA(uint256 amountA, uint256 reserveA) internal pure returns (uint256) {
		uint256 a = uint256(1997).mul(reserveA);
		uint256 b = amountA.mul(1000).mul(reserveA).mul(3988);
		uint256 c = Math.sqrt(a.mul(a).add(b));
		return c.sub(a).div(1994);
	}
	
	function approveRouter(address token, uint256 amount) internal {
		if (IERC20(token).allowance(address(this), router) >= amount) return;
		token.safeApprove(address(router), uint256(-1));
	}
	
	function swapExactTokensForTokens(address tokenIn, address tokenOut, uint256 amount) internal {
		address[] memory path = new address[](2);
		path[0] = address(tokenIn);
		path[1] = address(tokenOut);
		approveRouter(tokenIn, amount);
		IUniswapV2Router01(router).swapExactTokensForTokens(amount, 0, path, address(this), now);
	}
	
	function addLiquidity(address tokenA, address tokenB, uint256 amountA, uint256 amountB) internal returns (uint256 liquidity) {
		approveRouter(tokenA, amountA);
		approveRouter(tokenB, amountB);
		(,,liquidity) = IUniswapV2Router01(router).addLiquidity(tokenA, tokenB, amountA, amountB, 0, 0, address(this), now);
	}
	
	function _getReward() internal returns (uint256) {
		address rewarder = IMasterChef0212(masterChef).rewarder(pid);
		if (rewarder != address(0)) {
			(address[] memory rewardTokens, uint256[] memory rewardAmounts) = IRewarder(rewarder).pendingTokens(pid, address(this), 0);
			IMasterChef0212(masterChef).harvest(pid, address(this));
			for (uint i = 0; i < rewardTokens.length; i++) {
				if (rewardAmounts[i] > 0) {
					swapExactTokensForTokens(rewardTokens[i], rewardsToken, rewardTokens[i].myBalance());
				}
			}
		} else {
			IMasterChef0212(masterChef).harvest(pid, address(this));
		}
		return rewardsToken.myBalance();
	}
	
	function getReward() external nonReentrant returns (uint256) {
		require(msg.sender == tx.origin);
		return _getReward();
	}

	function reinvest() external nonReentrant update {
		require(msg.sender == tx.origin);
		// 1. Withdraw all the rewards.		
		uint256 reward = _getReward();
		if (reward == 0) return;
		// 2. Send the reward bounty to the caller.
		uint256 bounty = reward.mul(REINVEST_BOUNTY) / 1e18;
		rewardsToken.safeTransfer(msg.sender, bounty);
		// 3. Convert all the remaining rewards to token0 or token1.
		address tokenA;
		address tokenB;
		if (token0 == rewardsToken || token1 == rewardsToken) {
			(tokenA, tokenB) = token0 == rewardsToken ? (token0, token1) : (token1, token0);
		}
		else {
			swapExactTokensForTokens(rewardsToken, WETH, reward.sub(bounty));
			if (token0 == WETH || token1 == WETH) { 
				(tokenA, tokenB) = token0 == WETH ? (token0, token1) : (token1, token0);
			}
			else {
				swapExactTokensForTokens(WETH, token0, WETH.myBalance());
				(tokenA, tokenB) = (token0, token1);
			}
		}
		// 4. Convert tokenA to LP Token underlyings.
		uint256 totalAmountA = tokenA.myBalance();
		assert(totalAmountA > 0);
		(uint256 r0, uint256 r1,) = IUniswapV2Pair(underlying).getReserves();
		uint256 reserveA = tokenA == token0 ? r0 : r1;
		uint256 swapAmount = _optimalDepositA(totalAmountA, reserveA);
		swapExactTokensForTokens(tokenA, tokenB, swapAmount);
		uint256 liquidity = addLiquidity(tokenA, tokenB, totalAmountA.sub(swapAmount), tokenB.myBalance());
		// 5. Stake the LP Tokens. 
		IMasterChef0212(masterChef).deposit(pid, liquidity, address(this));
		emit Reinvest(msg.sender, reward, bounty);
	}
	
	/*** Mirrored From uniswapV2Pair ***/

	function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) {
		(reserve0, reserve1, blockTimestampLast) = IUniswapV2Pair(underlying).getReserves();
		// if no token has been minted yet mirror uniswap getReserves
		if (totalSupply == 0) return (reserve0, reserve1, blockTimestampLast);
		// else, return the underlying reserves of this contract
		uint256 _totalBalance = totalBalance;
		uint256 _totalSupply = IUniswapV2Pair(underlying).totalSupply();
		reserve0 = safe112(_totalBalance.mul(reserve0).div(_totalSupply));
		reserve1 = safe112(_totalBalance.mul(reserve1).div(_totalSupply));
		require(reserve0 > 100 && reserve1 > 100, "StakedLPToken: INSUFFICIENT_RESERVES");
	}
	function price0CumulativeLast() external view returns (uint256) {
		return IUniswapV2Pair(underlying).price0CumulativeLast();
	}
	function price1CumulativeLast() external view returns (uint256) {
		return IUniswapV2Pair(underlying).price1CumulativeLast();
	}

	/*** Utilities ***/
	
	function safe112(uint n) internal pure returns (uint112) {
		require(n < 2**112, "StakedLPToken: SAFE112");
		return uint112(n);
	}
}

// File: contracts\interfaces\IStakedLPTokenFactory02.sol

pragma solidity >=0.5.0;

interface IStakedLPTokenFactory02 {
	
	event StakedLPTokenCreated(address indexed token0, address indexed token1, uint256 indexed pid, address stakedLPToken, uint);

	function router() external view returns (address);
	function masterChef() external view returns (address);
	function rewardsToken() external view returns (address);
	function WETH() external view returns (address);
	function getStakedLPToken(uint) external view returns (address);
	function allStakedLPToken(uint) external view returns (address);
	function allStakedLPTokenLength() external view returns (uint);
	
	function createStakedLPToken(uint256 pid) external returns (address stakedLPToken);
	
}

// File: contracts\StakedLPTokenFactory0212.sol

pragma solidity =0.5.16;






contract StakedLPTokenFactory0212 is IStakedLPTokenFactory02 {
	address public router;
	address public masterChef;
	address public rewardsToken;
	address public WETH;

	mapping(uint256 => address) public getStakedLPToken;
	address[] public allStakedLPToken;

	event StakedLPTokenCreated(address indexed token0, address indexed token1, uint256 indexed pid, address stakedLPToken, uint);

	constructor(address _router, address _masterChef, address _rewardsToken) public {
		router = _router;
		masterChef = _masterChef;
		rewardsToken = _rewardsToken;
		WETH = IUniswapV2Router01(_router).WETH();
	}

	function allStakedLPTokenLength() external view returns (uint) {
		return allStakedLPToken.length;
	}

	function createStakedLPToken(uint256 pid) external returns (address stakedLPToken) {
		require(getStakedLPToken[pid] == address(0), "StakedLPTokenFactory: PID_EXISTS");
		address pair = IMasterChef0212(masterChef).lpToken(pid);
		address token0 = IUniswapV2Pair(pair).token0();
		address token1 = IUniswapV2Pair(pair).token1();
		bytes memory bytecode = type(StakedLPToken0212).creationCode;
		assembly {
			stakedLPToken := create2(0, add(bytecode, 32), mload(bytecode), pid)
		}
		StakedLPToken0212(stakedLPToken)._initialize(pid, pair, token0, token1, router, masterChef, rewardsToken, WETH);
		getStakedLPToken[pid] = stakedLPToken;
		allStakedLPToken.push(stakedLPToken);
		emit StakedLPTokenCreated(token0, token1, pid, stakedLPToken, allStakedLPToken.length);
	}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_masterChef","type":"address"},{"internalType":"address","name":"_rewardsToken","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0","type":"address"},{"indexed":true,"internalType":"address","name":"token1","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"address","name":"stakedLPToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"StakedLPTokenCreated","type":"event"},{"constant":true,"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allStakedLPToken","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"allStakedLPTokenLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"createStakedLPToken","outputs":[{"internalType":"address","name":"stakedLPToken","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getStakedLPToken","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"masterChef","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506040516146133803806146138339818101604052606081101561003357600080fd5b508051602080830151604093840151600080546001600160a01b038087166001600160a01b0319928316811790935560018054828716908416179055600280549185169190921617905585516315ab88c960e31b81529551949592949193909263ad5c46489260048083019392829003018186803b1580156100b457600080fd5b505afa1580156100c8573d6000803e3d6000fd5b505050506040513d60208110156100de57600080fd5b5051600380546001600160a01b039092166001600160a01b0319909216919091179055505050614500806101136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063ad5c46481161005b578063ad5c464814610112578063c09902741461011a578063d1af0c7d14610137578063f887ea401461013f57610088565b8063575a86b21461008d57806370b3dc25146100be5780638ad8e368146100db578063940e0a6e146100f8575b600080fd5b610095610147565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610095600480360360208110156100d457600080fd5b5035610163565b610095600480360360208110156100f157600080fd5b503561018b565b6101006101bf565b60408051918252519081900360200190f35b6100956101c5565b6100956004803603602081101561013057600080fd5b50356101e1565b61009561061c565b610095610638565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60046020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6005818154811061019857fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60055490565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b60008181526004602052604081205473ffffffffffffffffffffffffffffffffffffffff161561027257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f5374616b65644c50546f6b656e466163746f72793a205049445f455849535453604482015290519081900360640190fd5b600154604080517f78ed5d1f00000000000000000000000000000000000000000000000000000000815260048101859052905160009273ffffffffffffffffffffffffffffffffffffffff16916378ed5d1f916024808301926020929190829003018186803b1580156102e457600080fd5b505afa1580156102f8573d6000803e3d6000fd5b505050506040513d602081101561030e57600080fd5b5051604080517f0dfe1681000000000000000000000000000000000000000000000000000000008152905191925060009173ffffffffffffffffffffffffffffffffffffffff841691630dfe1681916004808301926020929190829003018186803b15801561037c57600080fd5b505afa158015610390573d6000803e3d6000fd5b505050506040513d60208110156103a657600080fd5b5051604080517fd21220a7000000000000000000000000000000000000000000000000000000008152905191925060009173ffffffffffffffffffffffffffffffffffffffff85169163d21220a7916004808301926020929190829003018186803b15801561041457600080fd5b505afa158015610428573d6000803e3d6000fd5b505050506040513d602081101561043e57600080fd5b505160405190915060609061045560208201610654565b6020820181038252601f19601f820116604052509050858151602083016000f560008054600154600254600354604080517fe9d60d9f000000000000000000000000000000000000000000000000000000008152600481018e905273ffffffffffffffffffffffffffffffffffffffff8c811660248301528b811660448301528a81166064830152958616608482015293851660a485015291841660c4840152831660e4830152519398509088169263e9d60d9f926101048084019391929182900301818387803b15801561052957600080fd5b505af115801561053d573d6000803e3d6000fd5b5050506000878152600460209081526040808320805473ffffffffffffffffffffffffffffffffffffffff808c167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316811790935560058054600181018255968190527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db090960180549092168317909155935482519182529281019290925280518a9450868416938816927f0a6f208b96fdd7a6d70ee93ea0fb94bed632180bfa94564c9a5166b9d3ffe88b92908290030190a450505050919050565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b613e6a806106628339019056fe60806040526002805460ff19908116601217909155600b80549091166001179055613e3b8061002f6000396000f3fe608060405234801561001057600080fd5b50600436106102ad5760003560e01c806370a082311161017b578063d1af0c7d116100d8578063e9d60d9f1161008c578063f887ea4011610071578063f887ea4014610746578063fdb5a03e1461074e578063fff6cae914610756576102ad565b8063e9d60d9f146106d2578063f10684541461073e576102ad565b8063d505accf116100bd578063d505accf14610631578063dd62ed3e1461068f578063e8bea167146106ca576102ad565b8063d1af0c7d14610621578063d21220a714610629576102ad565b8063ad5c46481161012f578063ba9a7a5611610114578063ba9a7a56146105de578063bc25cf77146105e6578063c45a015514610619576102ad565b8063ad5c4648146105ce578063ad7a672f146105d6576102ad565b806395a2251f1161016057806395a2251f1461055a57806395d89b411461058d578063a9059cbb14610595576102ad565b806370a08231146104f45780637ecebe0014610527576102ad565b80633644e515116102295780635909c0d5116101dd5780636a627842116101c25780636a627842146104b15780636c2a3bc5146104e45780636f307dc3146104ec576102ad565b80635909c0d5146104a15780635a3d5493146104a9576102ad565b80633d18b9121161020e5780633d18b912146104875780634a5d316c1461048f578063575a86b214610499576102ad565b80633644e515146104775780633ba0b9a91461047f576102ad565b80630dfe16811161028057806323b872dd1161026557806323b872dd1461040e57806330adf81f14610451578063313ce56714610459576102ad565b80630dfe1681146103c357806318160ddd146103f4576102ad565b806306fdde03146102b25780630902f1ac1461032f578063095ea7b31461036e5780630a641063146103bb575b600080fd5b6102ba61075e565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102f45781810151838201526020016102dc565b50505050905090810190601f1680156103215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61033761080a565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b6103a76004803603604081101561038457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610a50565b604080519115158252519081900360200190f35b6103a7610a67565b6103cb610a6c565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6103fc610a88565b60408051918252519081900360200190f35b6103a76004803603606081101561042457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610a8e565b6103fc610ba2565b610461610bc6565b6040805160ff9092168252519081900360200190f35b6103fc610bcf565b6103fc610bd5565b6103fc610c25565b610497610d05565b005b6103cb610db6565b6103fc610dd2565b6103fc610e6e565b6103fc600480360360208110156104c757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610ed9565b6103fc6112f3565b6103cb6112fe565b6103fc6004803603602081101561050a57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661131a565b6103fc6004803603602081101561053d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661132c565b6103fc6004803603602081101561057057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661133e565b6102ba6115e7565b6103a7600480360360408110156105ab57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561165f565b6103cb61166c565b6103fc611688565b6103fc61168e565b610497600480360360208110156105fc57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611694565b6103cb611817565b6103cb611833565b6103cb61184f565b610497600480360360e081101561064757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c0013561186b565b6103fc600480360360408110156106a557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166118af565b6102ba6118cc565b61049760048036036101008110156106e957600080fd5b5080359073ffffffffffffffffffffffffffffffffffffffff602082013581169160408101358216916060820135811691608081013582169160a082013581169160c081013582169160e09091013516611905565b6103fc611b6d565b6103cb611b73565b610497611b8f565b61049761210d565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156108025780601f106107d757610100808354040283529160200191610802565b820191906000526020600020905b8154815290600101906020018083116107e557829003601f168201915b505050505081565b6000806000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561087757600080fd5b505afa15801561088b573d6000803e3d6000fd5b505050506040513d60608110156108a157600080fd5b50805160208201516040909201516003549195509193509091506108c457610a4b565b600a54600854604080517f18160ddd000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916318160ddd916004808301926020929190829003018186803b15801561093257600080fd5b505afa158015610946573d6000803e3d6000fd5b505050506040513d602081101561095c57600080fd5b5051905061099861099382610987856dffffffffffffffffffffffffffff8a1663ffffffff6121ae16565b9063ffffffff61222816565b61226a565b94506109c161099382610987856dffffffffffffffffffffffffffff891663ffffffff6121ae16565b93506064856dffffffffffffffffffffffffffff161180156109f357506064846dffffffffffffffffffffffffffff16115b610a48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d2d6024913960400191505060405180910390fd5b50505b909192565b6000610a5d3384846122f1565b5060015b92915050565b600181565b600d5473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526005602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610b8d57604080518082018252601e81527f496d7065726d61783a205452414e534645525f4e4f545f414c4c4f574544000060208083019190915273ffffffffffffffffffffffffffffffffffffffff87166000908152600582528381203382529091529190912054610b5b91849063ffffffff61236016565b73ffffffffffffffffffffffffffffffffffffffff851660009081526005602090815260408083203384529091529020555b610b98848484612411565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60025460ff1681565b60065481565b600354600a5460009190811580610bea575080155b15610c0157670de0b6b3a764000092505050610c22565b610c1d8261098783670de0b6b3a764000063ffffffff6121ae16565b925050505b90565b600b5460009060ff16610c9957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f496d7065726d61783a205245454e544552454400000000000000000000000000604482015290519081900360640190fd5b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055333214610ccd57600080fd5b610cd561252a565b9050600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590565b60095473ffffffffffffffffffffffffffffffffffffffff1615610d8a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f496d7065726d61783a20464143544f52595f414c52454144595f534554000000604482015290519081900360640190fd5b600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001633179055565b60105473ffffffffffffffffffffffffffffffffffffffff1681565b600854604080517f5909c0d5000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff1691635909c0d5916004808301926020929190829003018186803b158015610e3d57600080fd5b505afa158015610e51573d6000803e3d6000fd5b505050506040513d6020811015610e6757600080fd5b5051905090565b600854604080517f5a3d5493000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff1691635a3d5493916004808301926020929190829003018186803b158015610e3d57600080fd5b600b5460009060ff16610f4d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f496d7065726d61783a205245454e544552454400000000000000000000000000604482015290519081900360640190fd5b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600854600090610f9a9073ffffffffffffffffffffffffffffffffffffffff166129d9565b601054600c54604080517f93f1a40b0000000000000000000000000000000000000000000000000000000081526004810192909252306024830152805193945060009373ffffffffffffffffffffffffffffffffffffffff909316926393f1a40b926044808201939291829003018186803b15801561101857600080fd5b505afa15801561102c573d6000803e3d6000fd5b505050506040513d604081101561104257600080fd5b5051601054600c54604080517f8dbdbe6d0000000000000000000000000000000000000000000000000000000081526004810192909252602482018690523060448301525192935073ffffffffffffffffffffffffffffffffffffffff90911691638dbdbe6d9160648082019260009290919082900301818387803b1580156110ca57600080fd5b505af11580156110de573d6000803e3d6000fd5b5050601054600c54604080517f93f1a40b000000000000000000000000000000000000000000000000000000008152600481019290925230602483015280516000955073ffffffffffffffffffffffffffffffffffffffff90931693506393f1a40b92604480840193829003018186803b15801561115b57600080fd5b505afa15801561116f573d6000803e3d6000fd5b505050506040513d604081101561118557600080fd5b505190506111bc611194610bd5565b610987670de0b6b3a76400006111b0858763ffffffff612a7b16565b9063ffffffff6121ae16565b9350600354600014156111ea576111db846103e863ffffffff612a7b16565b93506111ea60006103e8612abd565b6000841161125957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5374616b65644c50546f6b656e3a204d494e545f414d4f554e545f5a45524f00604482015290519081900360640190fd5b6112638585612abd565b6040805184815260208101869052815173ffffffffffffffffffffffffffffffffffffffff88169233927f2f00e3cdd69a77be7ed215ec7b2a36784dd158f921fca79ac29deffa353fe6ee929081900390910190a35050506112c3612b6e565b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055919050565b66470de4df82000081565b60085473ffffffffffffffffffffffffffffffffffffffff1681565b60046020526000908152604090205481565b60076020526000908152604090205481565b600b5460009060ff166113b257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f496d7065726d61783a205245454e544552454400000000000000000000000000604482015290519081900360640190fd5b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690553060009081526004602052604090205461140e670de0b6b3a7640000610987611401610bd5565b849063ffffffff6121ae16565b915060008211611469576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d516021913960400191505060405180910390fd5b600a548211156114da57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f5374616b65644c50546f6b656e3a20494e53554646494349454e545f43415348604482015290519081900360640190fd5b6114e43082612c52565b601054600c54604080517f0ad58d2f0000000000000000000000000000000000000000000000000000000081526004810192909252602482018590523060448301525173ffffffffffffffffffffffffffffffffffffffff90921691630ad58d2f9160648082019260009290919082900301818387803b15801561156757600080fd5b505af115801561157b573d6000803e3d6000fd5b505050506115898383612d16565b6040805183815260208101839052815173ffffffffffffffffffffffffffffffffffffffff86169233927f3f693fff038bb8a046aa76d9516190ac7444f7d69cf952c4cbdc086fdef2d6fc929081900390910190a3506112c3612b6e565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156108025780601f106107d757610100808354040283529160200191610802565b6000610a5d338484612411565b60125473ffffffffffffffffffffffffffffffffffffffff1681565b600a5481565b6103e881565b600b5460ff1661170557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f496d7065726d61783a205245454e544552454400000000000000000000000000604482015290519081900360640190fd5b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600a54600854604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290516117e99385936117e493919273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b1580156117ac57600080fd5b505afa1580156117c0573d6000803e3d6000fd5b505050506040513d60208110156117d657600080fd5b50519063ffffffff612a7b16565b612d16565b50600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b60095473ffffffffffffffffffffffffffffffffffffffff1681565b60115473ffffffffffffffffffffffffffffffffffffffff1681565b600e5473ffffffffffffffffffffffffffffffffffffffff1681565b61189b878787878787877f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9612f22565b6118a68787876122f1565b50505050505050565b600560209081526000928352604080842090915290825290205481565b6040518060400160405280600481526020017f303231320000000000000000000000000000000000000000000000000000000081525081565b60095473ffffffffffffffffffffffffffffffffffffffff1615611974576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613de56022913960400191505060405180910390fd5b600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001633179055604080518082018252601181527f5374616b656420556e69737761702056320000000000000000000000000000006020808301919091528251808401909352600b83527f53544b442d554e492d563200000000000000000000000000000000000000000090830152611a0f916131c5565b600c889055600880547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff8a811691909117909255600d80548216898416179055600e80548216888416179055600f8054821687841617905560108054821686841617905560118054821685841690811790915560128054909216928416929092179055611ad590857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6132a9565b611b1c73ffffffffffffffffffffffffffffffffffffffff8216857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff63ffffffff6132a916565b611b6373ffffffffffffffffffffffffffffffffffffffff8816847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff63ffffffff6132a916565b5050505050505050565b600c5481565b600f5473ffffffffffffffffffffffffffffffffffffffff1681565b600b5460ff16611c0057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f496d7065726d61783a205245454e544552454400000000000000000000000000604482015290519081900360640190fd5b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055333214611c3457600080fd5b6000611c3e61252a565b905080611c4b57506120d8565b6000670de0b6b3a7640000611c6d8366470de4df82000063ffffffff6121ae16565b81611c7457fe5b6011549190049150611ca39073ffffffffffffffffffffffffffffffffffffffff16338363ffffffff61348616565b601154600d54600091829173ffffffffffffffffffffffffffffffffffffffff90811691161480611cf15750601154600e5473ffffffffffffffffffffffffffffffffffffffff9081169116145b15611d6b57601154600d5473ffffffffffffffffffffffffffffffffffffffff908116911614611d4057600e54600d5473ffffffffffffffffffffffffffffffffffffffff9182169116611d61565b600d54600e5473ffffffffffffffffffffffffffffffffffffffff91821691165b9092509050611e8c565b601154601254611da49173ffffffffffffffffffffffffffffffffffffffff9081169116611d9f878763ffffffff612a7b16565b61365c565b601254600d5473ffffffffffffffffffffffffffffffffffffffff90811691161480611ded5750601254600e5473ffffffffffffffffffffffffffffffffffffffff9081169116145b15611e3c57601254600d5473ffffffffffffffffffffffffffffffffffffffff908116911614611d4057600e54600d5473ffffffffffffffffffffffffffffffffffffffff9182169116611d61565b601254600d54611e699173ffffffffffffffffffffffffffffffffffffffff9081169116611d9f826129d9565b5050600d54600e5473ffffffffffffffffffffffffffffffffffffffff91821691165b6000611ead8373ffffffffffffffffffffffffffffffffffffffff166129d9565b905060008111611eb957fe5b600080600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015611f2457600080fd5b505afa158015611f38573d6000803e3d6000fd5b505050506040513d6060811015611f4e57600080fd5b508051602090910151600d546dffffffffffffffffffffffffffff92831694509116915060009073ffffffffffffffffffffffffffffffffffffffff878116911614611f9a5781611f9c565b825b90506000611faa85836138d9565b9050611fb787878361365c565b6000611ff28888611fce898663ffffffff612a7b16565b611fed8b73ffffffffffffffffffffffffffffffffffffffff166129d9565b61395a565b601054600c54604080517f8dbdbe6d0000000000000000000000000000000000000000000000000000000081526004810192909252602482018490523060448301525192935073ffffffffffffffffffffffffffffffffffffffff90911691638dbdbe6d9160648082019260009290919082900301818387803b15801561207857600080fd5b505af115801561208c573d6000803e3d6000fd5b5050604080518d8152602081018d905281513394507fc003f45bc224d116b6d079100d4ab57a5b9633244c47a5a92a176c5b79a85f2893509081900390910190a2505050505050505050505b6120e0612b6e565b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b600b5460ff1661217e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f496d7065726d61783a205245454e544552454400000000000000000000000000604482015290519081900360640190fd5b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556120e0612b6e565b6000826121bd57506000610a61565b828202828482816121ca57fe5b0414612221576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613dc46021913960400191505060405180910390fd5b9392505050565b600061222183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613a50565b60006e01000000000000000000000000000082106122e957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f5374616b65644c50546f6b656e3a205341464531313200000000000000000000604482015290519081900360640190fd5b50805b919050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260056020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60008184841115612409576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123ce5781810151838201526020016123b6565b50505050905090810190601f1680156123fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b604080518082018252601b81527f496d7065726d61783a205452414e534645525f544f4f5f48494748000000000060208083019190915273ffffffffffffffffffffffffffffffffffffffff861660009081526004909152919091205461247f91839063ffffffff61236016565b73ffffffffffffffffffffffffffffffffffffffff80851660009081526004602052604080822093909355908416815220546124c1908263ffffffff613acf16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526004602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b601054600c54604080517fc346253d000000000000000000000000000000000000000000000000000000008152600481019290925251600092839273ffffffffffffffffffffffffffffffffffffffff9091169163c346253d91602480820192602092909190829003018186803b1580156125a457600080fd5b505afa1580156125b8573d6000803e3d6000fd5b505050506040513d60208110156125ce57600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff81161561291c57600c54604080517fd63b3c4900000000000000000000000000000000000000000000000000000000815260048101929092523060248301526000604483018190529051606092839273ffffffffffffffffffffffffffffffffffffffff86169263d63b3c49926064808201939291829003018186803b15801561267057600080fd5b505afa158015612684573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160409081528110156126cb57600080fd5b81019080805160405193929190846401000000008211156126eb57600080fd5b90830190602082018581111561270057600080fd5b825186602082028301116401000000008211171561271d57600080fd5b82525081516020918201928201910280838360005b8381101561274a578181015183820152602001612732565b505050509050016040526020018051604051939291908464010000000082111561277357600080fd5b90830190602082018581111561278857600080fd5b82518660208202830111640100000000821117156127a557600080fd5b82525081516020918201928201910280838360005b838110156127d25781810151838201526020016127ba565b50505050919091016040818152601054600c547f18fccc760000000000000000000000000000000000000000000000000000000084526004840152306024840152905197995095975073ffffffffffffffffffffffffffffffffffffffff909516956318fccc76956044808201965060009550919350839003019050818387803b15801561285f57600080fd5b505af1158015612873573d6000803e3d6000fd5b506000925050505b825181101561291457600082828151811061289257fe5b6020026020010151111561290c5761290c8382815181106128af57fe5b6020026020010151601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611d9f8685815181106128e957fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff166129d9565b60010161287b565b5050506129b1565b601054600c54604080517f18fccc7600000000000000000000000000000000000000000000000000000000815260048101929092523060248301525173ffffffffffffffffffffffffffffffffffffffff909216916318fccc769160448082019260009290919082900301818387803b15801561299857600080fd5b505af11580156129ac573d6000803e3d6000fd5b505050505b6011546129d39073ffffffffffffffffffffffffffffffffffffffff166129d9565b91505090565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009173ffffffffffffffffffffffffffffffffffffffff8416916370a0823191602480820192602092909190829003018186803b158015612a4957600080fd5b505afa158015612a5d573d6000803e3d6000fd5b505050506040513d6020811015612a7357600080fd5b505192915050565b600061222183836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f7700815250612360565b600354612ad0908263ffffffff613acf16565b60035573ffffffffffffffffffffffffffffffffffffffff8216600090815260046020526040902054612b09908263ffffffff613acf16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526004602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b601054600c54604080517f93f1a40b0000000000000000000000000000000000000000000000000000000081526004810192909252306024830152805160009373ffffffffffffffffffffffffffffffffffffffff16926393f1a40b926044808301939192829003018186803b158015612be757600080fd5b505afa158015612bfb573d6000803e3d6000fd5b505050506040513d6040811015612c1157600080fd5b5051600a8190556040805182815290519192507f8a0df8ef054fae2c3d2d19a7b322e864870cc9fd3cb07fb9526309c596244bf4919081900360200190a150565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260046020526040902054612c88908263ffffffff612a7b16565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260046020526040902055600354612cc1908263ffffffff612a7b16565b60035560408051828152905160009173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600854604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff86811660248301526044808301879052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009560609594169382918083835b60208310612e1c57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101612ddf565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612e7e576040519150601f19603f3d011682016040523d82523d6000602084013e612e83565b606091505b5091509150818015612eb1575080511580612eb15750808060200190516020811015612eae57600080fd5b50515b612f1c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f496d7065726d61783a205452414e534645525f4641494c454400000000000000604482015290519081900360640190fd5b50505050565b42851015612f9157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496d7065726d61783a2045585049524544000000000000000000000000000000604482015290519081900360640190fd5b60065473ffffffffffffffffffffffffffffffffffffffff808a1660008181526007602090815260408083208054600180820190925582518085018a905280840196909652958e166060860152608085018d905260a085019590955260c08085018c90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff8a166101828501526101a284018990526101c28401889052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa1580156130d3573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81161580159061314e57508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b6131b957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496d7065726d61783a20494e56414c49445f5349474e41545552450000000000604482015290519081900360640190fd5b50505050505050505050565b81516131d8906000906020850190613c94565b5080516131ec906001906020840190613c94565b506040514690806052613d7282396040805191829003605201822086516020978801208383018352600184527f310000000000000000000000000000000000000000000000000000000000000093880193909352815180880191909152808201929092527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606083015260808201939093523060a0808301919091528351808303909101815260c090910190925250805192019190912060065550565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000178152925182516000946060949389169392918291908083835b6020831061337f57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613342565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146133e1576040519150601f19603f3d011682016040523d82523d6000602084013e6133e6565b606091505b5091509150818015613414575080511580613414575080806020019051602081101561341157600080fd5b50515b61347f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f2173616665417070726f76650000000000000000000000000000000000000000604482015290519081900360640190fd5b5050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000178152925182516000946060949389169392918291908083835b6020831061355c57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161351f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146135be576040519150601f19603f3d011682016040523d82523d6000602084013e6135c3565b606091505b50915091508180156135f15750805115806135f157508080602001905160208110156135ee57600080fd5b50515b61347f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f21736166655472616e7366657200000000000000000000000000000000000000604482015290519081900360640190fd5b6040805160028082526060808301845292602083019080388339019050509050838160008151811061368a57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505082816001815181106136d257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506137168483613b43565b600f546040517f38ed1739000000000000000000000000000000000000000000000000000000008152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a4870152875173ffffffffffffffffffffffffffffffffffffffff909716966338ed1739968a968a9594939092909160c40190602080880191028083838b5b838110156137c25781810151838201526020016137aa565b505050509050019650505050505050600060405180830381600087803b1580156137eb57600080fd5b505af11580156137ff573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052602081101561384657600080fd5b810190808051604051939291908464010000000082111561386657600080fd5b90830190602082018581111561387b57600080fd5b825186602082028301116401000000008211171561389857600080fd5b82525081516020918201928201910280838360005b838110156138c55781810151838201526020016138ad565b505050509050016040525050505050505050565b6000806138ee6107cd8463ffffffff6121ae16565b9050600061390c610f946111b08681896103e863ffffffff6121ae16565b9050600061393861393383613927868063ffffffff6121ae16565b9063ffffffff613acf16565b613c43565b90506139506107ca610987838663ffffffff612a7b16565b9695505050505050565b60006139668584613b43565b6139708483613b43565b600f54604080517fe8e3370000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff88811660048301528781166024830152604482018790526064820186905260006084830181905260a483018190523060c48401524260e4840152925193169263e8e337009261010480840193606093929083900390910190829087803b158015613a1857600080fd5b505af1158015613a2c573d6000803e3d6000fd5b505050506040513d6060811015613a4257600080fd5b506040015195945050505050565b60008183613ab9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482018181528351602484015283519092839260449091019190850190808383600083156123ce5781810151838201526020016123b6565b506000838581613ac557fe5b0495945050505050565b60008282018381101561222157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600f54604080517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff92831660248201529051839285169163dd62ed3e916044808301926020929190829003018186803b158015613bbc57600080fd5b505afa158015613bd0573d6000803e3d6000fd5b505050506040513d6020811015613be657600080fd5b505110613bf257613c3f565b600f54613c3f9073ffffffffffffffffffffffffffffffffffffffff84811691167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff63ffffffff6132a916565b5050565b60006003821115613c86575080600160028204015b81811015613c8057809150600281828581613c6f57fe5b040181613c7857fe5b049050613c58565b506122ec565b81156122ec57506001919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613cd557805160ff1916838001178555613d02565b82800160010185558215613d02579182015b82811115613d02578251825591602001919060010190613ce7565b50613d0e929150613d12565b5090565b610c2291905b80821115613d0e5760008155600101613d1856fe5374616b65644c50546f6b656e3a20494e53554646494349454e545f52455345525645535374616b65644c50546f6b656e3a2052454445454d5f414d4f554e545f5a45524f454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775374616b65644c50546f6b656e3a20464143544f52595f414c52454144595f534554a265627a7a723158200d61ed3794a0d905b4b4aaf4b5f422402e738c436c92923d12763ab9dd4b50e664736f6c63430005100032a265627a7a72315820d9906a64e3c8c4b3294f0f6afc6febcdf00b220b10c34da1dd12b064b5befdcf64736f6c634300051000320000000000000000000000001b02da8cb0d097eb8d57a175b88c7d8b479975060000000000000000000000000769fd68dfb93167989c6f7254cd0d766fb2841f0000000000000000000000000b3f868e0be5597d5db7feb59e1cadbb0fdda50a

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000001b02da8cb0d097eb8d57a175b88c7d8b479975060000000000000000000000000769fd68dfb93167989c6f7254cd0d766fb2841f0000000000000000000000000b3f868e0be5597d5db7feb59e1cadbb0fdda50a

-----Decoded View---------------
Arg [0] : _router (address): 0x1b02da8cb0d097eb8d57a175b88c7d8b47997506
Arg [1] : _masterChef (address): 0x0769fd68dfb93167989c6f7254cd0d766fb2841f
Arg [2] : _rewardsToken (address): 0x0b3f868e0be5597d5db7feb59e1cadbb0fdda50a

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000001b02da8cb0d097eb8d57a175b88c7d8b47997506
Arg [1] : 0000000000000000000000000769fd68dfb93167989c6f7254cd0d766fb2841f
Arg [2] : 0000000000000000000000000b3f868e0be5597d5db7feb59e1cadbb0fdda50a


Deployed ByteCode Sourcemap

37300:1511:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;37300:1511:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;37390:25;;;:::i;:::-;;;;;;;;;;;;;;;;;;;37475:51;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;37475:51:0;;:::i;37530:33::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;37530:33:0;;:::i;37918:103::-;;;:::i;:::-;;;;;;;;;;;;;;;;37450:19;;;:::i;38026:782::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;38026:782:0;;:::i;37419:27::-;;;:::i;37365:21::-;;;:::i;37390:25::-;;;;;;:::o;37475:51::-;;;;;;;;;;;;;;;:::o;37530:33::-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;37530:33:0;:::o;37918:103::-;37993:16;:23;37918:103;:::o;37450:19::-;;;;;;:::o;38026:782::-;38086:21;38122;;;:16;:21;;;;;;:35;:21;:35;38114:80;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;38230:10;;38214:40;;;;;;;;;;;;;;38199:12;;38230:10;;;38214:35;;:40;;;;;;;;;;;;;;38230:10;38214:40;;;5:2:-1;;;;30:1;27;20:12;5:2;38214:40:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;38214:40:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;38214:40:0;38276:29;;;;;;;;38214:40;;-1:-1:-1;38259:14:0;;38276:27;;;;;;:29;;;;;38214:40;;38276:29;;;;;;;:27;:29;;;5:2:-1;;;;30:1;27;20:12;5:2;38276:29:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;38276:29:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;38276:29:0;38327;;;;;;;;38276;;-1:-1:-1;38310:14:0;;38327:27;;;;;;:29;;;;;38276;;38327;;;;;;;:27;:29;;;5:2:-1;;;;30:1;27;20:12;5:2;38327:29:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;38327:29:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;38327:29:0;38385:36;;38327:29;;-1:-1:-1;38361:21:0;;38385:36;38327:29;38385:36;;;:::i;:::-;41:4:-1;34:5;30:16;25:3;21:26;14:5;7:41;87:2;83:7;78:2;73:3;69:12;65:26;61:2;54:38;38385:36:0;38361:60;;38505:3;38494:8;38488:15;38483:2;38473:8;38469:17;38466:1;38458:51;38590:6;;;;38598:10;38610:12;;38624:4;;38518:111;;;;;;;;;;;;:44;:111;;;;;;;;;;;;;;;;;;;;;38590:6;;;38518:111;;;;38598:10;;;38518:111;;;;38610:12;;;38518:111;;;;38624:4;;38518:111;;;;;38441:68;;-1:-1:-1;38518:44:0;;;;;;:111;;;;;38590:6;;38518:111;;;;;;38590:6;38518:44;:111;;;5:2:-1;;;;30:1;27;20:12;5:2;38518:111:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;;38634:21:0;;;;:16;:21;;;;;;;;:37;;;;;;;;;;;;;;;38676:16;27:10:-1;;38634:37:0;23:18:-1;;45:23;;38676:36:0;;;;;;;;;;;;;;;;;;38779:23;;38722:81;;;;;;;;;;;;;;38651:3;;-1:-1:-1;38722:81:0;;;;;;;;;;;;;;;;38026:782;;;;;;;:::o;37419:27::-;;;;;;:::o;37365:21::-;;;;;;:::o;37300:1511::-;;;;;;;;:::o

Swarm Source

bzzr://d9906a64e3c8c4b3294f0f6afc6febcdf00b220b10c34da1dd12b064b5befdcf
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.