ETH Price: $3,208.97 (-3.39%)

Contract

0xBB92270716C8c424849F17cCc12F4F24AD4064D6
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Liquidate127167412021-06-27 14:58:401301 days ago1624805920IN
0xBB922707...4AD4064D6
0 ETH0.0007602210.1
Liquidate127166252021-06-27 14:35:001301 days ago1624804500IN
0xBB922707...4AD4064D6
0 ETH0.0008374610
Liquidate127166002021-06-27 14:27:541301 days ago1624804074IN
0xBB922707...4AD4064D6
0 ETH0.0007521410
Liquidate127165982021-06-27 14:27:031301 days ago1624804023IN
0xBB922707...4AD4064D6
0 ETH0.0007522210
Liquidate127127052021-06-26 23:52:111302 days ago1624751531IN
0xBB922707...4AD4064D6
0 ETH0.000678278.1
Liquidate127126752021-06-26 23:44:091302 days ago1624751049IN
0xBB922707...4AD4064D6
0 ETH0.000585327
Liquidate127088242021-06-26 9:16:261303 days ago1624698986IN
0xBB922707...4AD4064D6
0 ETH0.001361818.1
Liquidate127034812021-06-25 13:17:161303 days ago1624627036IN
0xBB922707...4AD4064D6
0 ETH0.0019555626
Liquidate127033592021-06-25 12:47:581304 days ago1624625278IN
0xBB922707...4AD4064D6
0 ETH0.0159689626
Liquidate127032192021-06-25 12:17:411304 days ago1624623461IN
0xBB922707...4AD4064D6
0 ETH0.0023333731
Liquidate126850852021-06-22 16:28:151306 days ago1624379295IN
0xBB922707...4AD4064D6
0 ETH0.06795792119
Liquidate126850592021-06-22 16:19:051306 days ago1624378745IN
0xBB922707...4AD4064D6
0 ETH0.05289308131
Liquidate126842042021-06-22 13:12:131306 days ago1624367533IN
0xBB922707...4AD4064D6
0 ETH0.09926342237
Liquidate126790302021-06-21 17:37:371307 days ago1624297057IN
0xBB922707...4AD4064D6
0 ETH0.0290198651
Liquidate126788862021-06-21 17:09:531307 days ago1624295393IN
0xBB922707...4AD4064D6
0 ETH0.0278395550
Liquidate126788822021-06-21 17:08:551307 days ago1624295335IN
0xBB922707...4AD4064D6
0 ETH0.0210868550
Liquidate126772722021-06-21 11:13:431308 days ago1624274023IN
0xBB922707...4AD4064D6
0 ETH0.0287890268
Liquidate126771442021-06-21 10:41:491308 days ago1624272109IN
0xBB922707...4AD4064D6
0 ETH0.0028622338
Liquidate126770482021-06-21 10:18:011308 days ago1624270681IN
0xBB922707...4AD4064D6
0 ETH0.0031638642
Liquidate126716492021-06-20 14:09:311308 days ago1624198171IN
0xBB922707...4AD4064D6
0 ETH0.0068905417.2
Liquidate126715402021-06-20 13:41:361308 days ago1624196496IN
0xBB922707...4AD4064D6
0 ETH0.0101631525
Liquidate126715342021-06-20 13:40:021308 days ago1624196402IN
0xBB922707...4AD4064D6
0 ETH0.0019583726
Liquidate126400912021-06-15 16:27:221313 days ago1623774442IN
0xBB922707...4AD4064D6
0 ETH0.0021099128
Liquidate126399002021-06-15 15:42:151313 days ago1623771735IN
0xBB922707...4AD4064D6
0 ETH0.0021771826
Liquidate126398902021-06-15 15:39:301313 days ago1623771570IN
0xBB922707...4AD4064D6
0 ETH0.0022596630
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
126850852021-06-22 16:28:151306 days ago1624379295
0xBB922707...4AD4064D6
0.52970738 ETH
126850592021-06-22 16:19:051306 days ago1624378745
0xBB922707...4AD4064D6
1.05373847 ETH
126850592021-06-22 16:19:051306 days ago1624378745
0xBB922707...4AD4064D6
1.05373847 ETH
126842042021-06-22 13:12:131306 days ago1624367533
0xBB922707...4AD4064D6
0.65483621 ETH
126842042021-06-22 13:12:131306 days ago1624367533
0xBB922707...4AD4064D6
0.65483621 ETH
126790302021-06-21 17:37:371307 days ago1624297057
0xBB922707...4AD4064D6
0.42393149 ETH
126788862021-06-21 17:09:531307 days ago1624295393
0xBB922707...4AD4064D6
0.37797788 ETH
126788822021-06-21 17:08:551307 days ago1624295335
0xBB922707...4AD4064D6
0.15213806 ETH
126788822021-06-21 17:08:551307 days ago1624295335
0xBB922707...4AD4064D6
0.15213806 ETH
126772722021-06-21 11:13:431308 days ago1624274023
0xBB922707...4AD4064D6
0.0209237 ETH
126772722021-06-21 11:13:431308 days ago1624274023
0xBB922707...4AD4064D6
0.0209237 ETH
126716492021-06-20 14:09:311308 days ago1624198171
0xBB922707...4AD4064D6
0.08575037 ETH
126716492021-06-20 14:09:311308 days ago1624198171
0xBB922707...4AD4064D6
0.08575037 ETH
126715402021-06-20 13:41:361308 days ago1624196496
0xBB922707...4AD4064D6
0.1146623 ETH
126715402021-06-20 13:41:361308 days ago1624196496
0xBB922707...4AD4064D6
0.1146623 ETH
126215842021-06-12 19:45:061316 days ago1623527106
0xBB922707...4AD4064D6
0.02550877 ETH
126215842021-06-12 19:45:061316 days ago1623527106
0xBB922707...4AD4064D6
0.02550877 ETH
126215342021-06-12 19:34:201316 days ago1623526460
0xBB922707...4AD4064D6
0.11212266 ETH
126211022021-06-12 17:57:511316 days ago1623520671
0xBB922707...4AD4064D6
0.01442068 ETH
126211022021-06-12 17:57:511316 days ago1623520671
0xBB922707...4AD4064D6
0.01442068 ETH
126209912021-06-12 17:30:191316 days ago1623519019
0xBB922707...4AD4064D6
0.0113516 ETH
126209912021-06-12 17:30:191316 days ago1623519019
0xBB922707...4AD4064D6
0.0113516 ETH
125154602021-05-27 8:54:471333 days ago1622105687
0xBB922707...4AD4064D6
0.03776418 ETH
124964382021-05-24 10:22:131336 days ago1621851733
0xBB922707...4AD4064D6
0.01415265 ETH
124964382021-05-24 10:22:131336 days ago1621851733
0xBB922707...4AD4064D6
0.01415265 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CapitalFreeLiquidate

Compiler Version
v0.6.6+commit.6c089d02

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion
File 1 of 11 : CapitalFreeLiquidate.sol
pragma solidity =0.6.6;
pragma experimental ABIEncoderV2;

import "./interfaces/ICapitalFreeLiquidate.sol";
import "./interfaces/IBorrowable.sol";
import "./interfaces/ICollateral.sol";
import "./interfaces/IImpermaxCallee.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/IWETH.sol";
import "./interfaces/IUniswapV2Pair.sol";
import "./libraries/SafeMath.sol";
import "./libraries/TransferHelper.sol";
import "./libraries/UniswapV2Library.sol";

// This assumes that the borrower has enough collateral to repay
// The chance that this is not true is low and the check isn't worth the additional gas cost
// The check should be done off chain, and the caller should use the right liquidateAmount parameter
// Another problem is the slippage, so it may be convenient to liquidate large amounts in multiple rounds

// TODO: bot to liquidate both sides at the same time?

contract CapitalFreeLiquidate is ICapitalFreeLiquidate, IImpermaxCallee {
	using SafeMath for uint;

	address public immutable override factory;
	address public immutable override bDeployer;
	address public immutable override cDeployer;
	address public immutable override WETH;
	
	address public override to;

	constructor(address _factory, address _bDeployer, address _cDeployer, address _WETH, address _to) public {
		factory = _factory;
		bDeployer = _bDeployer;
		cDeployer = _cDeployer;
		WETH = _WETH;
		to = _to;
	}

	receive() external payable {
		assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract
	}
	
	function _burn(
		address uniswapV2Pair, 
		uint collateralAmount
	) internal virtual returns (uint amount0, uint amount1) {
		TransferHelper.safeTransfer(uniswapV2Pair, uniswapV2Pair, collateralAmount);
		(amount0, amount1) = IUniswapV2Pair(uniswapV2Pair).burn(address(this));
	}
	
	function _swap(
		address uniswapV2Pair, 
		address tokenIn, 
		uint amountIn, 
		uint amountOut, 
		uint8 index
	) internal virtual {
		TransferHelper.safeTransfer(tokenIn, uniswapV2Pair, amountIn);
		(uint amount0Out, uint amount1Out) = index == 1 ? (uint(0), amountOut) : (amountOut, uint(0));
		IUniswapV2Pair(uniswapV2Pair).swap(amount0Out, amount1Out, address(this), new bytes(0));
	}
	
	function _liquidateAmount(
		address borrowable,
		uint amountMax,
		address borrower
	) internal virtual returns (uint amount) {
		IBorrowable(borrowable).accrueInterest();
		uint borrowedAmount = IBorrowable(borrowable).borrowBalance(borrower);
		amount = amountMax < borrowedAmount ? amountMax : borrowedAmount;
	}
	
	function _getBorrowablePrice(
		address uniswapV2Pair,
		address collateral,
		uint8 index,
		uint swapAmount
	) internal virtual returns (uint price) {
		(uint price0, uint price1) = ICollateral(collateral).getPrices();
		price = index == 0 ? price0 : price1;
		(uint reserve0, uint reserve1,) = IUniswapV2Pair(uniswapV2Pair).getReserves();
		uint reserve = index == 0 ? reserve0 : reserve1;
		// Account for LP appreciation after swap
		price = price.mul(reserve).div(reserve.add(swapAmount * 3 / 1000));
	}
	
	function _getExpectedCollateralAmount(
		address uniswapV2Pair,
		address collateral,
		uint8 toLiquidateIndex,
		uint liquidateAmount
	) internal virtual returns (uint collateralAmount) {
		uint price = _getBorrowablePrice(uniswapV2Pair, collateral, toLiquidateIndex, liquidateAmount);
		uint liquidationIncentive = ICollateral(collateral).liquidationIncentive();
		collateralAmount = liquidateAmount.mul(liquidationIncentive).div(1e18).mul(price).div(1e18).sub(1);
	}
	
	function _simulateBurn(
		address uniswapV2Pair,
		uint collateralAmount
	) internal virtual view returns (uint amount0, uint amount1, uint reserve0, uint reserve1) {
		uint totalSupply = IUniswapV2Pair(uniswapV2Pair).totalSupply();
		(uint reserve0Old, uint reserve1Old,) = IUniswapV2Pair(uniswapV2Pair).getReserves();
		amount0 = collateralAmount.mul(reserve0Old).div(totalSupply);
		amount1 = collateralAmount.mul(reserve1Old).div(totalSupply);
		reserve0 = reserve0Old.sub(amount0);
		reserve1 = reserve1Old.sub(amount1);
	}

	function _getLiquidateProfit(
		address uniswapV2Pair,
		uint8 toLiquidateIndex,
		uint8 takeProfitIndex,
		uint liquidateAmount,
		uint collateralAmount
	) internal virtual view returns (uint profit, uint amountIn, uint amountOut) {
		(uint amount0, uint amount1, uint reserve0, uint reserve1) = _simulateBurn(uniswapV2Pair, collateralAmount);
		(uint reserveIn, uint reserveOut) = toLiquidateIndex == 1 ? (reserve0, reserve1) : (reserve1, reserve0);
		uint amountOutBalance = toLiquidateIndex == 1 ? amount1 : amount0;
		if (takeProfitIndex == toLiquidateIndex) {
			// Swap all
			amountIn = toLiquidateIndex == 1 ? amount0 : amount1;
			amountOut = UniswapV2Library.getAmountOut(amountIn, reserveIn, reserveOut);
			profit = amountOutBalance.add(amountOut).sub(liquidateAmount, "CapitalFreeLiquidate: NEGATIVE_PROFIT_1");
		}
		else {
			// Swap only necessary
			amountOut = liquidateAmount.sub(amountOutBalance);
			amountIn = UniswapV2Library.getAmountIn(amountOut, reserveIn, reserveOut);
			uint amountInBalance = toLiquidateIndex == 1 ? amount0 : amount1;
			profit = amountInBalance.sub(amountIn, "CapitalFreeLiquidate: NEGATIVE_PROFIT_2");
		}
	}
	
	function _getTokenInTokenOut(
		address uniswapV2Pair,
		uint8 index
	) internal virtual view returns (address tokenIn, address tokenOut) {
		address token0 = IUniswapV2Pair(uniswapV2Pair).token0();
		address token1 = IUniswapV2Pair(uniswapV2Pair).token1();
		(tokenIn, tokenOut) = index == 1 ? (token0, token1) : (token1, token0);
	}
	
	function liquidate(
		address uniswapV2Pair,
		uint8 toLiquidateIndex,
		uint8 takeProfitIndex,
		address borrower,
		uint liquidateAmountMax,
		uint profitMin
	) external virtual override returns (uint profit) {
		address collateral = getCollateral(uniswapV2Pair);		
		address borrowable = getBorrowable(uniswapV2Pair, toLiquidateIndex);
		uint liquidateAmount = _liquidateAmount(borrowable, liquidateAmountMax, borrower);
		uint collateralAmount = _getExpectedCollateralAmount(uniswapV2Pair, collateral, toLiquidateIndex, liquidateAmount);
		uint amountIn;
		uint amountOut;
		(profit, amountIn, amountOut) = 
			_getLiquidateProfit(uniswapV2Pair, toLiquidateIndex, takeProfitIndex, liquidateAmount, collateralAmount);
		require(profit >= profitMin, "CapitalFreeLiquidator: INSUFFICIENT_PROFIT");
		bytes memory data = abi.encode(CalleeData({
			uniswapV2Pair: uniswapV2Pair,
			collateral: collateral,
			borrowable: borrowable,
			toLiquidateIndex: toLiquidateIndex,
			takeProfitIndex: takeProfitIndex,
			borrower: borrower,
			amountIn: amountIn,
			amountOut: amountOut,
			liquidateAmount: liquidateAmount
		}));
		ICollateral(collateral).flashRedeem(address(this), collateralAmount, data);
	}
	
	function liquidateCallback(
		address uniswapV2Pair,
		address collateral,
		address borrowable,
		uint8 toLiquidateIndex,
		uint8 takeProfitIndex,
		address borrower,
		uint amountIn,
		uint amountOut,
		uint liquidateAmount,
		uint collateralAmount
	) internal virtual {
		_burn(uniswapV2Pair, collateralAmount);
		(address tokenIn, address tokenOut) = _getTokenInTokenOut(uniswapV2Pair, toLiquidateIndex);
		_swap(uniswapV2Pair, tokenIn, amountIn, amountOut, toLiquidateIndex);
		TransferHelper.safeTransfer(tokenOut, borrowable, liquidateAmount);
		uint seizeTokens = IBorrowable(borrowable).liquidate(borrower, address(this));
		TransferHelper.safeTransfer(collateral, collateral, seizeTokens);
		if (toLiquidateIndex == takeProfitIndex) skim(tokenOut);
		else skim(tokenIn);
	}
	
	struct CalleeData {
		address uniswapV2Pair;
		address collateral;
		address borrowable;
		uint8 toLiquidateIndex;
		uint8 takeProfitIndex;
		address borrower;
		uint amountIn;
		uint amountOut;
		uint liquidateAmount;
	}
	
	function impermaxRedeem(address sender, uint redeemAmount, bytes calldata data) external virtual override {
		sender;
		// no security check needed
		CalleeData memory calleeData = abi.decode(data, (CalleeData));
		liquidateCallback(
			calleeData.uniswapV2Pair,
			calleeData.collateral,
			calleeData.borrowable,
			calleeData.toLiquidateIndex,
			calleeData.takeProfitIndex,
			calleeData.borrower,
			calleeData.amountIn,
			calleeData.amountOut,
			calleeData.liquidateAmount,
			redeemAmount
		);
	}

	function impermaxBorrow(address sender, address borrower, uint borrowAmount, bytes calldata data) external virtual override { sender; borrower; borrowAmount; data; }
	
	function skim(address token) public virtual override {
		uint balance = IERC20(token).balanceOf(address(this));
		if (token == WETH) {		
			IWETH(WETH).withdraw(balance);
			TransferHelper.safeTransferETH(to, balance);
		}
		else TransferHelper.safeTransfer(token, to, balance);
	}
	
	/*** UTILITIES ***/
	
	function getBorrowable(address uniswapV2Pair, uint8 index) public virtual override view returns (address borrowable) {
		require(index < 2, "CapitalFreeLiquidator: INDEX_TOO_HIGH");
		borrowable = address(uint(keccak256(abi.encodePacked(
			hex"ff",
			bDeployer,
			keccak256(abi.encodePacked(factory, uniswapV2Pair, index)),
			hex"605ba1db56496978613939baf0ae31dccceea3f5ca53dfaa76512bc880d7bb8f" // Borrowable bytecode keccak256
		))));
	}
	function getCollateral(address uniswapV2Pair) public virtual override view returns (address collateral) {
		collateral = address(uint(keccak256(abi.encodePacked(
			hex"ff",
			cDeployer,
			keccak256(abi.encodePacked(factory, uniswapV2Pair)),
			hex"4b8788d8761647e6330407671d3c6c80afaed3d047800dba0e0e3befde047767" // Collateral bytecode keccak256
		))));
	}
	function getLendingPool(address uniswapV2Pair) public virtual override view returns (address collateral, address borrowableA, address borrowableB) {
		collateral = getCollateral(uniswapV2Pair);
		borrowableA = getBorrowable(uniswapV2Pair, 0);
		borrowableB = getBorrowable(uniswapV2Pair, 1);
	}
}

File 2 of 11 : IBorrowable.sol
pragma solidity >=0.5.0;

interface IBorrowable {

	/*** 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;
	
	/*** Borrowable ***/

	event BorrowApproval(address indexed owner, address indexed spender, uint value);
	event Borrow(address indexed sender, address indexed borrower, address indexed receiver, uint borrowAmount, uint repayAmount, uint accountBorrowsPrior, uint accountBorrows, uint totalBorrows);
	event Liquidate(address indexed sender, address indexed borrower, address indexed liquidator, uint seizeTokens, uint repayAmount, uint accountBorrowsPrior, uint accountBorrows, uint totalBorrows);
	
	function BORROW_FEE() external pure returns (uint);
	function collateral() external view returns (address);
	function reserveFactor() external view returns (uint);
	function exchangeRateLast() external view returns (uint);
	function borrowIndex() external view returns (uint);
	function totalBorrows() external view returns (uint);
	function borrowAllowance(address owner, address spender) external view returns (uint);
	function borrowBalance(address borrower) external view returns (uint);	
	function borrowTracker() external view returns (address);
	
	function BORROW_PERMIT_TYPEHASH() external pure returns (bytes32);
	function borrowApprove(address spender, uint256 value) external returns (bool);
	function borrowPermit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
	function borrow(address borrower, address receiver, uint borrowAmount, bytes calldata data) external;
	function liquidate(address borrower, address liquidator) external returns (uint seizeTokens);
	function trackBorrow(address borrower) external;
	
	/*** Borrowable Interest Rate Model ***/

	event AccrueInterest(uint interestAccumulated, uint borrowIndex, uint totalBorrows);
	event CalculateKink(uint kinkRate);
	event CalculateBorrowRate(uint borrowRate);
	
	function KINK_BORROW_RATE_MAX() external pure returns (uint);
	function KINK_BORROW_RATE_MIN() external pure returns (uint);
	function KINK_MULTIPLIER() external pure returns (uint);
	function borrowRate() external view returns (uint);
	function kinkBorrowRate() external view returns (uint);
	function kinkUtilizationRate() external view returns (uint);
	function adjustSpeed() external view returns (uint);
	function rateUpdateTimestamp() external view returns (uint32);
	function accrualTimestamp() external view returns (uint32);
	
	function accrueInterest() external;
	
	/*** Borrowable Setter ***/

	event NewReserveFactor(uint newReserveFactor);
	event NewKinkUtilizationRate(uint newKinkUtilizationRate);
	event NewAdjustSpeed(uint newAdjustSpeed);
	event NewBorrowTracker(address newBorrowTracker);

	function RESERVE_FACTOR_MAX() external pure returns (uint);
	function KINK_UR_MIN() external pure returns (uint);
	function KINK_UR_MAX() external pure returns (uint);
	function ADJUST_SPEED_MIN() external pure returns (uint);
	function ADJUST_SPEED_MAX() external pure returns (uint);
	
	function _initialize (
		string calldata _name, 
		string calldata _symbol,
		address _underlying, 
		address _collateral
	) external;
	function _setReserveFactor(uint newReserveFactor) external;
	function _setKinkUtilizationRate(uint newKinkUtilizationRate) external;
	function _setAdjustSpeed(uint newAdjustSpeed) external;
	function _setBorrowTracker(address newBorrowTracker) external;
}

File 3 of 11 : ICapitalFreeLiquidate.sol
pragma solidity >=0.5.0;

interface ICapitalFreeLiquidate {
	function factory() external pure returns (address);
	function bDeployer() external pure returns (address);
	function cDeployer() external pure returns (address);
	function WETH() external pure returns (address);
	
	function to() external pure returns (address);
	
	function liquidate(
		address uniswapV2Pair,
		uint8 toLiquidateIndex,
		uint8 takeProfitIndex,
		address borrower,
		uint liquidateAmountMax,
		uint profitMin
	) external returns (uint profit);
	
	function skim(address token) external;
	
	function getBorrowable(address uniswapV2Pair, uint8 index) external view returns (address borrowable);
	function getCollateral(address uniswapV2Pair) external view returns (address collateral);
	function getLendingPool(address uniswapV2Pair) external view returns (address collateral, address borrowableA, address borrowableB);
}

File 4 of 11 : ICollateral.sol
pragma solidity >=0.5.0;

interface ICollateral {

	/*** 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;
	
	/*** Collateral ***/
	
	function borrowable0() external view returns (address);
	function borrowable1() external view returns (address);
	function simpleUniswapOracle() external view returns (address);
	function safetyMarginSqrt() external view returns (uint);
	function liquidationIncentive() external view returns (uint);
	
	function getPrices() external returns (uint price0, uint price1);
	function tokensUnlocked(address from, uint value) external returns (bool);
	function accountLiquidityAmounts(address account, uint amount0, uint amount1) external returns (uint liquidity, uint shortfall);
	function accountLiquidity(address account) external returns (uint liquidity, uint shortfall);
	function canBorrow(address account, address borrowable, uint accountBorrows) external returns (bool);
	function seize(address liquidator, address borrower, uint repayAmount) external returns (uint seizeTokens);
	function flashRedeem(address redeemer, uint redeemAmount, bytes calldata data) external;
	
	/*** Collateral Setter ***/
	
	event NewSafetyMargin(uint newSafetyMarginSqrt);
	event NewLiquidationIncentive(uint newLiquidationIncentive);

	function SAFETY_MARGIN_SQRT_MIN() external pure returns (uint);
	function SAFETY_MARGIN_SQRT_MAX() external pure returns (uint);
	function LIQUIDATION_INCENTIVE_MIN() external pure returns (uint);
	function LIQUIDATION_INCENTIVE_MAX() external pure returns (uint);
	
	function _initialize (
		string calldata _name, 
		string calldata _symbol,
		address _underlying, 
		address _borrowable0, 
		address _borrowable1
	) external;
	function _setSafetyMarginSqrt(uint newSafetyMarginSqrt) external;
	function _setLiquidationIncentive(uint newLiquidationIncentive) external;
}

File 5 of 11 : 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 6 of 11 : IImpermaxCallee.sol
pragma solidity >=0.5.0;

interface IImpermaxCallee {
    function impermaxBorrow(address sender, address borrower, uint borrowAmount, bytes calldata data) external;
    function impermaxRedeem(address sender, uint redeemAmount, bytes calldata data) external;
}

File 7 of 11 : 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 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;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    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);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

File 8 of 11 : IWETH.sol
pragma solidity >=0.5.0;

interface IWETH {
    function deposit() external payable;
    function transfer(address to, uint value) external returns (bool);
    function withdraw(uint) external;
}

File 9 of 11 : SafeMath.sol
pragma solidity =0.6.6;

// 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 10 of 11 : TransferHelper.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity =0.6.6;

// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
    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))),
            'TransferHelper::safeApprove: approve failed'
        );
    }

    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))),
            'TransferHelper::safeTransfer: transfer failed'
        );
    }

    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))),
            'TransferHelper::transferFrom: transferFrom failed'
        );
    }

    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{value: value}(new bytes(0));
        require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
    }
}

File 11 of 11 : UniswapV2Library.sol
pragma solidity >=0.5.0;

import "../interfaces/IUniswapV2Pair.sol";

import "./SafeMath.sol";

library UniswapV2Library {
    using SafeMath for uint;

    // returns sorted token addresses, used to handle return values from pairs sorted in this order
    function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
        require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
        (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
    }

    // calculates the CREATE2 address for a pair without making any external calls
    function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
        (address token0, address token1) = sortTokens(tokenA, tokenB);
        pair = address(uint(keccak256(abi.encodePacked(
                hex'ff',
                factory,
                keccak256(abi.encodePacked(token0, token1)),
                hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
            ))));
    }

    // fetches and sorts the reserves for a pair
    function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
        (address token0,) = sortTokens(tokenA, tokenB);
        (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
        (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
    }

    // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
    function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
        require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
        require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        amountB = amountA.mul(reserveB) / reserveA;
    }

    // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
        require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        uint amountInWithFee = amountIn.mul(997);
        uint numerator = amountInWithFee.mul(reserveOut);
        uint denominator = reserveIn.mul(1000).add(amountInWithFee);
        amountOut = numerator / denominator;
    }

    // given an output amount of an asset and pair reserves, returns a required input amount of the other asset
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
        require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        uint numerator = reserveIn.mul(amountOut).mul(1000);
        uint denominator = reserveOut.sub(amountOut).mul(997);
        amountIn = (numerator / denominator).add(1);
    }

    // performs chained getAmountOut calculations on any number of pairs
    function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[0] = amountIn;
        for (uint i; i < path.length - 1; i++) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
            amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
        }
    }

    // performs chained getAmountIn calculations on any number of pairs
    function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[amounts.length - 1] = amountOut;
        for (uint i = path.length - 1; i > 0; i--) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
            amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
        }
    }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 999999
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_bDeployer","type":"address"},{"internalType":"address","name":"_cDeployer","type":"address"},{"internalType":"address","name":"_WETH","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bDeployer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cDeployer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"uniswapV2Pair","type":"address"},{"internalType":"uint8","name":"index","type":"uint8"}],"name":"getBorrowable","outputs":[{"internalType":"address","name":"borrowable","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"uniswapV2Pair","type":"address"}],"name":"getCollateral","outputs":[{"internalType":"address","name":"collateral","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"uniswapV2Pair","type":"address"}],"name":"getLendingPool","outputs":[{"internalType":"address","name":"collateral","type":"address"},{"internalType":"address","name":"borrowableA","type":"address"},{"internalType":"address","name":"borrowableB","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"borrowAmount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"impermaxBorrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"redeemAmount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"impermaxRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"uniswapV2Pair","type":"address"},{"internalType":"uint8","name":"toLiquidateIndex","type":"uint8"},{"internalType":"uint8","name":"takeProfitIndex","type":"uint8"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"liquidateAmountMax","type":"uint256"},{"internalType":"uint256","name":"profitMin","type":"uint256"}],"name":"liquidate","outputs":[{"internalType":"uint256","name":"profit","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"skim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"to","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6101006040523480156200001257600080fd5b506040516200264038038062002640833981016040819052620000359162000085565b606094851b6001600160601b031990811660805293851b841660a05291841b831660c05290921b1660e052600080546001600160a01b0319166001600160a01b039092169190911790556200011d565b600080600080600060a086880312156200009d578081fd5b8551620000aa8162000104565b6020870151909550620000bd8162000104565b6040870151909450620000d08162000104565b6060870151909350620000e38162000104565b6080870151909250620000f68162000104565b809150509295509295909350565b6001600160a01b03811681146200011a57600080fd5b50565b60805160601c60a05160601c60c05160601c60e05160601c6124bf620001816000398060e8528061041052806104db528061056a5250806102df528061030c52508061085552806108b852508061032d528061062552806108d952506124bf6000f3fe6080604052600436106100cb5760003560e01c8063ad5c464811610074578063cfa1f4451161004e578063cfa1f4451461022f578063db5a26901461025c578063ef974e9c1461027157610111565b8063ad5c4648146101e5578063bc25cf77146101fa578063c45a01551461021a57610111565b8063876d9d9e116100a5578063876d9d9e146101855780639b56d6c9146101a5578063acb86cbb146101c557610111565b80630572bf5f14610116578063131519811461014e5780637a4660d51461017057610111565b36610111573373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461010f57fe5b005b600080fd5b34801561012257600080fd5b5061013661013136600461198b565b610291565b60405161014593929190611f32565b60405180910390f35b34801561015a57600080fd5b506101636102c1565b6040516101459190611eb5565b34801561017c57600080fd5b506101636102dd565b34801561019157600080fd5b5061010f6101a03660046119c3565b610301565b3480156101b157600080fd5b506101636101c036600461198b565b610308565b3480156101d157600080fd5b5061010f6101e0366004611a34565b6103c1565b3480156101f157600080fd5b5061016361040e565b34801561020657600080fd5b5061010f61021536600461198b565b610432565b34801561022657600080fd5b50610163610623565b34801561023b57600080fd5b5061024f61024a366004611ac3565b610647565b604051610145919061235f565b34801561026857600080fd5b50610163610853565b34801561027d57600080fd5b5061016361028c366004611a8e565b610877565b600080600061029f84610308565b92506102ac846000610877565b91506102b9846001610877565b929491935050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b5050505050565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008360405160200161035e929190611cf6565b60405160208183030381529060405280519060200120604051602001610385929190611db3565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012092915050565b6103c96118dc565b6103d582840184611b4e565b9050610301816000015182602001518360400151846060015185608001518660a001518760c001518860e001518961010001518d610970565b7f000000000000000000000000000000000000000000000000000000000000000081565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190610487903090600401611eb5565b60206040518083038186803b15801561049f57600080fd5b505afa1580156104b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d79190611c50565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156105fa576040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690632e1a7d4d9061059f90849060040161235f565b600060405180830381600087803b1580156105b957600080fd5b505af11580156105cd573d6000803e3d6000fd5b50506000546105f5925073ffffffffffffffffffffffffffffffffffffffff16905082610a8f565b61061f565b60005461061f90839073ffffffffffffffffffffffffffffffffffffffff1683610b48565b5050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008061065388610308565b905060006106618989610877565b90506000610670828789610c6b565b905060006106808b858c85610d8c565b90506000806106928d8d8d8787610e75565b91985092509050878710156106dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d39061225d565b60405180910390fd5b60606040518061012001604052808f73ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018e60ff1681526020018d60ff1681526020018c73ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018681525060405160200161078c91906122ba565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f19f3400d000000000000000000000000000000000000000000000000000000008252915073ffffffffffffffffffffffffffffffffffffffff8816906319f3400d9061081090309088908690600401611ed6565b600060405180830381600087803b15801561082a57600080fd5b505af115801561083e573d6000803e3d6000fd5b50505050505050505050509695505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600060028260ff16106108b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d390611f9b565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000848460405160200161090c93929190611d30565b60405160208183030381529060405280519060200120604051602001610933929190611e34565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101209392505050565b61097a8a82610fad565b50506000806109898c8a611069565b9150915061099a8c8388888d611192565b6109a5818b86610b48565b6040517f86b9d81f00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8c16906386b9d81f906109fc908b903090600401611f0b565b602060405180830381600087803b158015610a1657600080fd5b505af1158015610a2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4e9190611c50565b9050610a5b8c8d83610b48565b8860ff168a60ff161415610a7757610a7282610432565b610a80565b610a8083610432565b50505050505050505050505050565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff8416908390604051610ac69190611d97565b60006040518083038185875af1925050503d8060008114610b03576040519150601f19603f3d011682016040523d82523d6000602084013e610b08565b606091505b5050905080610b43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d39061208c565b505050565b600060608473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401610b7b929190611f62565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610bc99190611d97565b6000604051808303816000865af19150503d8060008114610c06576040519150601f19603f3d011682016040523d82523d6000602084013e610c0b565b606091505b5091509150818015610c35575080511580610c35575080806020019051810190610c359190611b2e565b610301576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d3906121a3565b60008373ffffffffffffffffffffffffffffffffffffffff1663a6afed956040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610cb557600080fd5b505af1158015610cc9573d6000803e3d6000fd5b50506040517f4d73e9ba0000000000000000000000000000000000000000000000000000000081526000925073ffffffffffffffffffffffffffffffffffffffff87169150634d73e9ba90610d22908690600401611eb5565b60206040518083038186803b158015610d3a57600080fd5b505afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d729190611c50565b9050808410610d815780610d83565b835b95945050505050565b600080610d9b8686868661125c565b905060008573ffffffffffffffffffffffffffffffffffffffff16638c765e946040518163ffffffff1660e01b815260040160206040518083038186803b158015610de557600080fd5b505afa158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d9190611c50565b9050610e6a6001610e5e670de0b6b3a7640000610e4686610e5283838c8a63ffffffff6113e816565b9063ffffffff61144516565b9063ffffffff6113e816565b9063ffffffff61148716565b979650505050505050565b6000806000806000806000610e8a8c896114c9565b93509350935093506000808c60ff16600114610ea7578284610eaa565b83835b9150915060008d60ff16600114610ec15786610ec3565b855b90508d60ff168d60ff161415610f36578d60ff16600114610ee45785610ee6565b865b9850610ef3898484611646565b9750610f2f8c60405180606001604052806027815260200161246360279139610f22848c63ffffffff61172c16565b919063ffffffff61176b16565b9950610f9b565b610f468c8263ffffffff61148716565b9750610f538884846117b1565b985060008e60ff16600114610f685786610f6a565b875b9050610f978a60405180606001604052806027815260200161243c6027913983919063ffffffff61176b16565b9a50505b50505050505050955095509592505050565b600080610fbb848585610b48565b6040517f89afcb4400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516906389afcb449061100d903090600401611eb5565b6040805180830381600087803b15801561102657600080fd5b505af115801561103a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105e9190611c68565b909590945092505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156110b457600080fd5b505afa1580156110c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ec91906119a7565b905060008573ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561113657600080fd5b505afa15801561114a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116e91906119a7565b90508460ff16600114611182578082611185565b81815b9097909650945050505050565b61119d848685610b48565b6000808260ff166001146111b3578360006111b7565b6000845b604080516000815260208101918290527f022c0d9f00000000000000000000000000000000000000000000000000000000909152919350915073ffffffffffffffffffffffffffffffffffffffff88169063022c0d9f906112219085908590309060248101612368565b600060405180830381600087803b15801561123b57600080fd5b505af115801561124f573d6000803e3d6000fd5b5050505050505050505050565b60008060008573ffffffffffffffffffffffffffffffffffffffff1663bd9a548b6040518163ffffffff1660e01b81526004016040805180830381600087803b1580156112a857600080fd5b505af11580156112bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e09190611c68565b915091508460ff166000146112f557806112f7565b815b92506000808873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561134257600080fd5b505afa158015611356573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137a9190611bfc565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915060008760ff166000146113b257816113b4565b825b90506113da6113ca826103e860038b020461172c565b610e46888463ffffffff6113e816565b9a9950505050505050505050565b6000826113f75750600061143f565b8282028284828161140457fe5b041461143c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d390612146565b90505b92915050565b600061143c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061188b565b600061143c83836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f770081525061176b565b60008060008060008673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561151757600080fd5b505afa15801561152b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154f9190611c50565b90506000808873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561159a57600080fd5b505afa1580156115ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d29190611bfc565b506dffffffffffffffffffffffffffff91821693501690506115fe83610e468a8563ffffffff6113e816565b965061161483610e468a8463ffffffff6113e816565b9550611626828863ffffffff61148716565b9450611638818763ffffffff61148716565b935050505092959194509250565b6000808411611681576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d390612200565b6000831180156116915750600082115b6116c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d3906120e9565b60006116db856103e563ffffffff6113e816565b905060006116ef828563ffffffff6113e816565b9050600061171583611709886103e863ffffffff6113e816565b9063ffffffff61172c16565b905080828161172057fe5b04979650505050505050565b60008282018381101561143c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d390611ff8565b600081848411156117a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d39190611f88565b505050900390565b60008084116117ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d39061202f565b6000831180156117fc5750600082115b611832576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d3906120e9565b600061184a6103e8610e52868863ffffffff6113e816565b905060006118646103e5610e52868963ffffffff61148716565b9050611881600182848161187457fe5b049063ffffffff61172c16565b9695505050505050565b600081836118c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d39190611f88565b5060008385816118d257fe5b0495945050505050565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081019190915290565b803561143f816123fa565b60008083601f840112611944578182fd5b50813567ffffffffffffffff81111561195b578182fd5b60208301915083602082850101111561197357600080fd5b9250929050565b803560ff8116811461143f57600080fd5b60006020828403121561199c578081fd5b813561143c816123fa565b6000602082840312156119b8578081fd5b815161143c816123fa565b6000806000806000608086880312156119da578081fd5b85356119e5816123fa565b945060208601356119f5816123fa565b935060408601359250606086013567ffffffffffffffff811115611a17578182fd5b611a2388828901611933565b969995985093965092949392505050565b60008060008060608587031215611a49578384fd5b8435611a54816123fa565b935060208501359250604085013567ffffffffffffffff811115611a76578283fd5b611a8287828801611933565b95989497509550505050565b60008060408385031215611aa0578182fd5b8235611aab816123fa565b9150611aba846020850161197a565b90509250929050565b60008060008060008060c08789031215611adb578081fd5b8635611ae6816123fa565b9550611af5886020890161197a565b9450611b04886040890161197a565b93506060870135611b14816123fa565b9598949750929560808101359460a0909101359350915050565b600060208284031215611b3f578081fd5b8151801515811461143c578182fd5b6000610120808385031215611b61578182fd5b611b6a816123a3565b611b748585611928565b8152611b838560208601611928565b6020820152611b958560408601611928565b6040820152611ba7856060860161197a565b6060820152611bb9856080860161197a565b6080820152611bcb8560a08601611928565b60a082015260c084013560c082015260e084013560e082015261010091508184013582820152809250505092915050565b600080600060608486031215611c10578283fd5b8351611c1b8161241f565b6020850151909350611c2c8161241f565b604085015190925063ffffffff81168114611c45578182fd5b809150509250925092565b600060208284031215611c61578081fd5b5051919050565b60008060408385031215611c7a578182fd5b505080516020909101519092909150565b73ffffffffffffffffffffffffffffffffffffffff169052565b60008151808452611cbd8160208601602086016123ca565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60ff169052565b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606093841b811682529190921b16601482015260280190565b606093841b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000090811682529290931b909116601483015260f81b7fff0000000000000000000000000000000000000000000000000000000000000016602882015260290190565b60008251611da98184602087016123ca565b9190910192915050565b7fff00000000000000000000000000000000000000000000000000000000000000815260609290921b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016600183015260158201527f4b8788d8761647e6330407671d3c6c80afaed3d047800dba0e0e3befde047767603582015260550190565b7fff00000000000000000000000000000000000000000000000000000000000000815260609290921b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016600183015260158201527f605ba1db56496978613939baf0ae31dccceea3f5ca53dfaa76512bc880d7bb8f603582015260550190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b600073ffffffffffffffffffffffffffffffffffffffff8516825283602083015260606040830152610d836060830184611ca5565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff93841681529183166020830152909116604082015260600190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b60006020825261143c6020830184611ca5565b60208082526025908201527f4361706974616c467265654c697175696461746f723a20494e4445585f544f4f60408201527f5f48494748000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252602c908201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4f60408201527f55545055545f414d4f554e540000000000000000000000000000000000000000606082015260800190565b60208082526034908201527f5472616e7366657248656c7065723a3a736166655472616e736665724554483a60408201527f20455448207472616e73666572206661696c6564000000000000000000000000606082015260800190565b60208082526028908201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4c60408201527f4951554944495459000000000000000000000000000000000000000000000000606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602d908201527f5472616e7366657248656c7065723a3a736166655472616e736665723a20747260408201527f616e73666572206661696c656400000000000000000000000000000000000000606082015260800190565b6020808252602b908201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4960408201527f4e5055545f414d4f554e54000000000000000000000000000000000000000000606082015260800190565b6020808252602a908201527f4361706974616c467265654c697175696461746f723a20494e5355464649434960408201527f454e545f50524f46495400000000000000000000000000000000000000000000606082015260800190565b815173ffffffffffffffffffffffffffffffffffffffff1681526020808301516101208301916122ec90840182611c8b565b5060408301516122ff6040840182611c8b565b5060608301516123126060840182611cef565b5060808301516123256080840182611cef565b5060a083015161233860a0840182611c8b565b5060c083015160c083015260e083015160e083015261010080840151818401525092915050565b90815260200190565b600085825284602083015273ffffffffffffffffffffffffffffffffffffffff84166040830152608060608301526118816080830184611ca5565b60405181810167ffffffffffffffff811182821017156123c257600080fd5b604052919050565b60005b838110156123e55781810151838201526020016123cd565b838111156123f4576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461241c57600080fd5b50565b6dffffffffffffffffffffffffffff8116811461241c57600080fdfe4361706974616c467265654c69717569646174653a204e454741544956455f50524f4649545f324361706974616c467265654c69717569646174653a204e454741544956455f50524f4649545f31a2646970667358221220f99e6e622f949fe6d839200510b88ca0e850ec4bd4382530800edc83335ba82a64736f6c634300060600330000000000000000000000008c3736e2fe63cc2cd89ee228d9dbcab6ce5b767b00000000000000000000000031864bc58a47a4fc8782b4135873788e876de9eb000000000000000000000000c12e00de204d58ead5b5ce9054e94aee7747fb6c000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000004723c223f502a4cf8f6480ab6eca5d8856732515

Deployed Bytecode

0x6080604052600436106100cb5760003560e01c8063ad5c464811610074578063cfa1f4451161004e578063cfa1f4451461022f578063db5a26901461025c578063ef974e9c1461027157610111565b8063ad5c4648146101e5578063bc25cf77146101fa578063c45a01551461021a57610111565b8063876d9d9e116100a5578063876d9d9e146101855780639b56d6c9146101a5578063acb86cbb146101c557610111565b80630572bf5f14610116578063131519811461014e5780637a4660d51461017057610111565b36610111573373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2161461010f57fe5b005b600080fd5b34801561012257600080fd5b5061013661013136600461198b565b610291565b60405161014593929190611f32565b60405180910390f35b34801561015a57600080fd5b506101636102c1565b6040516101459190611eb5565b34801561017c57600080fd5b506101636102dd565b34801561019157600080fd5b5061010f6101a03660046119c3565b610301565b3480156101b157600080fd5b506101636101c036600461198b565b610308565b3480156101d157600080fd5b5061010f6101e0366004611a34565b6103c1565b3480156101f157600080fd5b5061016361040e565b34801561020657600080fd5b5061010f61021536600461198b565b610432565b34801561022657600080fd5b50610163610623565b34801561023b57600080fd5b5061024f61024a366004611ac3565b610647565b604051610145919061235f565b34801561026857600080fd5b50610163610853565b34801561027d57600080fd5b5061016361028c366004611a8e565b610877565b600080600061029f84610308565b92506102ac846000610877565b91506102b9846001610877565b929491935050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b7f000000000000000000000000c12e00de204d58ead5b5ce9054e94aee7747fb6c81565b5050505050565b60007f000000000000000000000000c12e00de204d58ead5b5ce9054e94aee7747fb6c7f0000000000000000000000008c3736e2fe63cc2cd89ee228d9dbcab6ce5b767b8360405160200161035e929190611cf6565b60405160208183030381529060405280519060200120604051602001610385929190611db3565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012092915050565b6103c96118dc565b6103d582840184611b4e565b9050610301816000015182602001518360400151846060015185608001518660a001518760c001518860e001518961010001518d610970565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190610487903090600401611eb5565b60206040518083038186803b15801561049f57600080fd5b505afa1580156104b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d79190611c50565b90507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156105fa576040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21690632e1a7d4d9061059f90849060040161235f565b600060405180830381600087803b1580156105b957600080fd5b505af11580156105cd573d6000803e3d6000fd5b50506000546105f5925073ffffffffffffffffffffffffffffffffffffffff16905082610a8f565b61061f565b60005461061f90839073ffffffffffffffffffffffffffffffffffffffff1683610b48565b5050565b7f0000000000000000000000008c3736e2fe63cc2cd89ee228d9dbcab6ce5b767b81565b60008061065388610308565b905060006106618989610877565b90506000610670828789610c6b565b905060006106808b858c85610d8c565b90506000806106928d8d8d8787610e75565b91985092509050878710156106dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d39061225d565b60405180910390fd5b60606040518061012001604052808f73ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018e60ff1681526020018d60ff1681526020018c73ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018681525060405160200161078c91906122ba565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f19f3400d000000000000000000000000000000000000000000000000000000008252915073ffffffffffffffffffffffffffffffffffffffff8816906319f3400d9061081090309088908690600401611ed6565b600060405180830381600087803b15801561082a57600080fd5b505af115801561083e573d6000803e3d6000fd5b50505050505050505050509695505050505050565b7f00000000000000000000000031864bc58a47a4fc8782b4135873788e876de9eb81565b600060028260ff16106108b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d390611f9b565b7f00000000000000000000000031864bc58a47a4fc8782b4135873788e876de9eb7f0000000000000000000000008c3736e2fe63cc2cd89ee228d9dbcab6ce5b767b848460405160200161090c93929190611d30565b60405160208183030381529060405280519060200120604051602001610933929190611e34565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101209392505050565b61097a8a82610fad565b50506000806109898c8a611069565b9150915061099a8c8388888d611192565b6109a5818b86610b48565b6040517f86b9d81f00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8c16906386b9d81f906109fc908b903090600401611f0b565b602060405180830381600087803b158015610a1657600080fd5b505af1158015610a2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4e9190611c50565b9050610a5b8c8d83610b48565b8860ff168a60ff161415610a7757610a7282610432565b610a80565b610a8083610432565b50505050505050505050505050565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff8416908390604051610ac69190611d97565b60006040518083038185875af1925050503d8060008114610b03576040519150601f19603f3d011682016040523d82523d6000602084013e610b08565b606091505b5050905080610b43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d39061208c565b505050565b600060608473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401610b7b929190611f62565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610bc99190611d97565b6000604051808303816000865af19150503d8060008114610c06576040519150601f19603f3d011682016040523d82523d6000602084013e610c0b565b606091505b5091509150818015610c35575080511580610c35575080806020019051810190610c359190611b2e565b610301576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d3906121a3565b60008373ffffffffffffffffffffffffffffffffffffffff1663a6afed956040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610cb557600080fd5b505af1158015610cc9573d6000803e3d6000fd5b50506040517f4d73e9ba0000000000000000000000000000000000000000000000000000000081526000925073ffffffffffffffffffffffffffffffffffffffff87169150634d73e9ba90610d22908690600401611eb5565b60206040518083038186803b158015610d3a57600080fd5b505afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d729190611c50565b9050808410610d815780610d83565b835b95945050505050565b600080610d9b8686868661125c565b905060008573ffffffffffffffffffffffffffffffffffffffff16638c765e946040518163ffffffff1660e01b815260040160206040518083038186803b158015610de557600080fd5b505afa158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d9190611c50565b9050610e6a6001610e5e670de0b6b3a7640000610e4686610e5283838c8a63ffffffff6113e816565b9063ffffffff61144516565b9063ffffffff6113e816565b9063ffffffff61148716565b979650505050505050565b6000806000806000806000610e8a8c896114c9565b93509350935093506000808c60ff16600114610ea7578284610eaa565b83835b9150915060008d60ff16600114610ec15786610ec3565b855b90508d60ff168d60ff161415610f36578d60ff16600114610ee45785610ee6565b865b9850610ef3898484611646565b9750610f2f8c60405180606001604052806027815260200161246360279139610f22848c63ffffffff61172c16565b919063ffffffff61176b16565b9950610f9b565b610f468c8263ffffffff61148716565b9750610f538884846117b1565b985060008e60ff16600114610f685786610f6a565b875b9050610f978a60405180606001604052806027815260200161243c6027913983919063ffffffff61176b16565b9a50505b50505050505050955095509592505050565b600080610fbb848585610b48565b6040517f89afcb4400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516906389afcb449061100d903090600401611eb5565b6040805180830381600087803b15801561102657600080fd5b505af115801561103a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105e9190611c68565b909590945092505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156110b457600080fd5b505afa1580156110c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ec91906119a7565b905060008573ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561113657600080fd5b505afa15801561114a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116e91906119a7565b90508460ff16600114611182578082611185565b81815b9097909650945050505050565b61119d848685610b48565b6000808260ff166001146111b3578360006111b7565b6000845b604080516000815260208101918290527f022c0d9f00000000000000000000000000000000000000000000000000000000909152919350915073ffffffffffffffffffffffffffffffffffffffff88169063022c0d9f906112219085908590309060248101612368565b600060405180830381600087803b15801561123b57600080fd5b505af115801561124f573d6000803e3d6000fd5b5050505050505050505050565b60008060008573ffffffffffffffffffffffffffffffffffffffff1663bd9a548b6040518163ffffffff1660e01b81526004016040805180830381600087803b1580156112a857600080fd5b505af11580156112bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e09190611c68565b915091508460ff166000146112f557806112f7565b815b92506000808873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561134257600080fd5b505afa158015611356573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137a9190611bfc565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915060008760ff166000146113b257816113b4565b825b90506113da6113ca826103e860038b020461172c565b610e46888463ffffffff6113e816565b9a9950505050505050505050565b6000826113f75750600061143f565b8282028284828161140457fe5b041461143c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d390612146565b90505b92915050565b600061143c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061188b565b600061143c83836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f770081525061176b565b60008060008060008673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561151757600080fd5b505afa15801561152b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154f9190611c50565b90506000808873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561159a57600080fd5b505afa1580156115ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d29190611bfc565b506dffffffffffffffffffffffffffff91821693501690506115fe83610e468a8563ffffffff6113e816565b965061161483610e468a8463ffffffff6113e816565b9550611626828863ffffffff61148716565b9450611638818763ffffffff61148716565b935050505092959194509250565b6000808411611681576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d390612200565b6000831180156116915750600082115b6116c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d3906120e9565b60006116db856103e563ffffffff6113e816565b905060006116ef828563ffffffff6113e816565b9050600061171583611709886103e863ffffffff6113e816565b9063ffffffff61172c16565b905080828161172057fe5b04979650505050505050565b60008282018381101561143c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d390611ff8565b600081848411156117a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d39190611f88565b505050900390565b60008084116117ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d39061202f565b6000831180156117fc5750600082115b611832576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d3906120e9565b600061184a6103e8610e52868863ffffffff6113e816565b905060006118646103e5610e52868963ffffffff61148716565b9050611881600182848161187457fe5b049063ffffffff61172c16565b9695505050505050565b600081836118c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d39190611f88565b5060008385816118d257fe5b0495945050505050565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081019190915290565b803561143f816123fa565b60008083601f840112611944578182fd5b50813567ffffffffffffffff81111561195b578182fd5b60208301915083602082850101111561197357600080fd5b9250929050565b803560ff8116811461143f57600080fd5b60006020828403121561199c578081fd5b813561143c816123fa565b6000602082840312156119b8578081fd5b815161143c816123fa565b6000806000806000608086880312156119da578081fd5b85356119e5816123fa565b945060208601356119f5816123fa565b935060408601359250606086013567ffffffffffffffff811115611a17578182fd5b611a2388828901611933565b969995985093965092949392505050565b60008060008060608587031215611a49578384fd5b8435611a54816123fa565b935060208501359250604085013567ffffffffffffffff811115611a76578283fd5b611a8287828801611933565b95989497509550505050565b60008060408385031215611aa0578182fd5b8235611aab816123fa565b9150611aba846020850161197a565b90509250929050565b60008060008060008060c08789031215611adb578081fd5b8635611ae6816123fa565b9550611af5886020890161197a565b9450611b04886040890161197a565b93506060870135611b14816123fa565b9598949750929560808101359460a0909101359350915050565b600060208284031215611b3f578081fd5b8151801515811461143c578182fd5b6000610120808385031215611b61578182fd5b611b6a816123a3565b611b748585611928565b8152611b838560208601611928565b6020820152611b958560408601611928565b6040820152611ba7856060860161197a565b6060820152611bb9856080860161197a565b6080820152611bcb8560a08601611928565b60a082015260c084013560c082015260e084013560e082015261010091508184013582820152809250505092915050565b600080600060608486031215611c10578283fd5b8351611c1b8161241f565b6020850151909350611c2c8161241f565b604085015190925063ffffffff81168114611c45578182fd5b809150509250925092565b600060208284031215611c61578081fd5b5051919050565b60008060408385031215611c7a578182fd5b505080516020909101519092909150565b73ffffffffffffffffffffffffffffffffffffffff169052565b60008151808452611cbd8160208601602086016123ca565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60ff169052565b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606093841b811682529190921b16601482015260280190565b606093841b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000090811682529290931b909116601483015260f81b7fff0000000000000000000000000000000000000000000000000000000000000016602882015260290190565b60008251611da98184602087016123ca565b9190910192915050565b7fff00000000000000000000000000000000000000000000000000000000000000815260609290921b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016600183015260158201527f4b8788d8761647e6330407671d3c6c80afaed3d047800dba0e0e3befde047767603582015260550190565b7fff00000000000000000000000000000000000000000000000000000000000000815260609290921b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016600183015260158201527f605ba1db56496978613939baf0ae31dccceea3f5ca53dfaa76512bc880d7bb8f603582015260550190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b600073ffffffffffffffffffffffffffffffffffffffff8516825283602083015260606040830152610d836060830184611ca5565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff93841681529183166020830152909116604082015260600190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b60006020825261143c6020830184611ca5565b60208082526025908201527f4361706974616c467265654c697175696461746f723a20494e4445585f544f4f60408201527f5f48494748000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252602c908201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4f60408201527f55545055545f414d4f554e540000000000000000000000000000000000000000606082015260800190565b60208082526034908201527f5472616e7366657248656c7065723a3a736166655472616e736665724554483a60408201527f20455448207472616e73666572206661696c6564000000000000000000000000606082015260800190565b60208082526028908201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4c60408201527f4951554944495459000000000000000000000000000000000000000000000000606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602d908201527f5472616e7366657248656c7065723a3a736166655472616e736665723a20747260408201527f616e73666572206661696c656400000000000000000000000000000000000000606082015260800190565b6020808252602b908201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4960408201527f4e5055545f414d4f554e54000000000000000000000000000000000000000000606082015260800190565b6020808252602a908201527f4361706974616c467265654c697175696461746f723a20494e5355464649434960408201527f454e545f50524f46495400000000000000000000000000000000000000000000606082015260800190565b815173ffffffffffffffffffffffffffffffffffffffff1681526020808301516101208301916122ec90840182611c8b565b5060408301516122ff6040840182611c8b565b5060608301516123126060840182611cef565b5060808301516123256080840182611cef565b5060a083015161233860a0840182611c8b565b5060c083015160c083015260e083015160e083015261010080840151818401525092915050565b90815260200190565b600085825284602083015273ffffffffffffffffffffffffffffffffffffffff84166040830152608060608301526118816080830184611ca5565b60405181810167ffffffffffffffff811182821017156123c257600080fd5b604052919050565b60005b838110156123e55781810151838201526020016123cd565b838111156123f4576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461241c57600080fd5b50565b6dffffffffffffffffffffffffffff8116811461241c57600080fdfe4361706974616c467265654c69717569646174653a204e454741544956455f50524f4649545f324361706974616c467265654c69717569646174653a204e454741544956455f50524f4649545f31a2646970667358221220f99e6e622f949fe6d839200510b88ca0e850ec4bd4382530800edc83335ba82a64736f6c63430006060033

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

0000000000000000000000008c3736e2fe63cc2cd89ee228d9dbcab6ce5b767b00000000000000000000000031864bc58a47a4fc8782b4135873788e876de9eb000000000000000000000000c12e00de204d58ead5b5ce9054e94aee7747fb6c000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000004723c223f502a4cf8f6480ab6eca5d8856732515

-----Decoded View---------------
Arg [0] : _factory (address): 0x8C3736e2FE63cc2cD89Ee228D9dBcAb6CE5B767B
Arg [1] : _bDeployer (address): 0x31864bc58A47A4Fc8782B4135873788E876dE9eB
Arg [2] : _cDeployer (address): 0xC12E00DE204d58eAd5B5cE9054E94aeE7747fB6C
Arg [3] : _WETH (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [4] : _to (address): 0x4723c223F502A4cf8F6480aB6ecA5d8856732515

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000008c3736e2fe63cc2cd89ee228d9dbcab6ce5b767b
Arg [1] : 00000000000000000000000031864bc58a47a4fc8782b4135873788e876de9eb
Arg [2] : 000000000000000000000000c12e00de204d58ead5b5ce9054e94aee7747fb6c
Arg [3] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [4] : 0000000000000000000000004723c223f502a4cf8f6480ab6eca5d8856732515


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.