Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 8 from a total of 8 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set B Labs | 10822319 | 1979 days ago | IN | 0 ETH | 0.00368212 | ||||
| Set Reserves Add... | 10822316 | 1979 days ago | IN | 0 ETH | 0.00368495 | ||||
| New B Pool | 10815881 | 1980 days ago | IN | 0 ETH | 0.40241706 | ||||
| New B Pool | 10815829 | 1980 days ago | IN | 0 ETH | 0.46042313 | ||||
| New B Pool | 10815733 | 1980 days ago | IN | 0 ETH | 0.42054396 | ||||
| New B Pool | 10815527 | 1980 days ago | IN | 0 ETH | 0.47492464 | ||||
| New B Pool | 10815441 | 1980 days ago | IN | 0 ETH | 0.50392768 | ||||
| New B Pool | 10815298 | 1980 days ago | IN | 0 ETH | 0.40241706 |
Latest 11 internal transactions
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| - | 10923170 | 1964 days ago | Contract Creation | 0 ETH | |||
| - | 10878029 | 1970 days ago | Contract Creation | 0 ETH | |||
| - | 10877533 | 1971 days ago | Contract Creation | 0 ETH | |||
| - | 10877457 | 1971 days ago | Contract Creation | 0 ETH | |||
| - | 10828303 | 1978 days ago | Contract Creation | 0 ETH | |||
| - | 10815881 | 1980 days ago | Contract Creation | 0 ETH | |||
| - | 10815829 | 1980 days ago | Contract Creation | 0 ETH | |||
| - | 10815733 | 1980 days ago | Contract Creation | 0 ETH | |||
| - | 10815527 | 1980 days ago | Contract Creation | 0 ETH | |||
| - | 10815441 | 1980 days ago | Contract Creation | 0 ETH | |||
| - | 10815298 | 1980 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BFactory
Compiler Version
v0.5.12+commit.7709ece9
Contract Source Code (Solidity Multiple files format)
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is disstributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity 0.5.12;
// Builds new BPools, logging their addresses and providing `isBPool(address) -> (bool)`
import "./BPool.sol";
contract BFactory is BBronze {
event LOG_NEW_POOL(
address indexed caller,
address indexed pool
);
event LOG_BLABS(
address indexed caller,
address indexed blabs
);
event LOG_RESERVES_ADDRESS(
address indexed caller,
address indexed reservesAddress
);
event LOG_ALLOW_NON_ADMIN_POOL(
address indexed caller,
bool allow
);
mapping(address=>bool) private _isBPool;
function isBPool(address b)
external view returns (bool)
{
return _isBPool[b];
}
function newBPool()
external
returns (BPool)
{
if (!_allowNonAdminPool) {
require(msg.sender == _blabs);
}
BPool bpool = new BPool();
_isBPool[address(bpool)] = true;
emit LOG_NEW_POOL(msg.sender, address(bpool));
bpool.setController(msg.sender);
return bpool;
}
address private _blabs;
address private _reservesAddress;
bool private _allowNonAdminPool;
constructor() public {
_blabs = msg.sender;
_reservesAddress = msg.sender;
_allowNonAdminPool = false;
}
function getAllowNonAdminPool()
external view
returns (bool)
{
return _allowNonAdminPool;
}
function setAllowNonAdminPool(bool b)
external
{
require(msg.sender == _blabs, "ERR_NOT_BLABS");
emit LOG_ALLOW_NON_ADMIN_POOL(msg.sender, b);
_allowNonAdminPool = b;
}
function getBLabs()
external view
returns (address)
{
return _blabs;
}
function setBLabs(address b)
external
{
require(msg.sender == _blabs);
emit LOG_BLABS(msg.sender, b);
_blabs = b;
}
function getReservesAddress()
external view
returns (address)
{
return _reservesAddress;
}
function setReservesAddress(address a)
external
{
require(msg.sender == _blabs);
emit LOG_RESERVES_ADDRESS(msg.sender, a);
_reservesAddress = a;
}
function collect(BPool pool)
external
{
require(msg.sender == _blabs);
uint collected = IERC20(pool).balanceOf(address(this));
bool xfer = pool.transfer(_blabs, collected);
require(xfer);
}
function collectTokenReserves(BPool pool)
external
{
require(msg.sender == _blabs);
require(_isBPool[address(pool)]);
pool.drainTotalReserves(_reservesAddress);
}
}
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity 0.5.12;
contract BColor {
function getColor()
external view
returns (bytes32);
}
contract BBronze is BColor {
function getColor()
external view
returns (bytes32) {
return bytes32("BRONZE");
}
}
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity 0.5.12;
import "./BColor.sol";
contract BConst is BBronze {
uint public constant BONE = 10**18;
uint public constant MIN_BOUND_TOKENS = 2;
uint public constant MAX_BOUND_TOKENS = 8;
uint public constant MIN_FEE = BONE / 10**6;
uint public constant MAX_FEE = BONE / 10;
uint public constant EXIT_FEE = 0;
uint public constant DEFAULT_RESERVES_RATIO = BONE / 5;
uint public constant MIN_WEIGHT = BONE;
uint public constant MAX_WEIGHT = BONE * 50;
uint public constant MAX_TOTAL_WEIGHT = BONE * 50;
uint public constant MIN_BALANCE = BONE / 10**12;
uint public constant INIT_POOL_SUPPLY = BONE * 100;
uint public constant MIN_BPOW_BASE = 1 wei;
uint public constant MAX_BPOW_BASE = (2 * BONE) - 1 wei;
uint public constant BPOW_PRECISION = BONE / 10**10;
uint public constant MAX_IN_RATIO = BONE / 2;
uint public constant MAX_OUT_RATIO = (BONE / 3) + 1 wei;
}
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity 0.5.12;
import "./BNum.sol";
contract BMath is BBronze, BConst, BNum {
/**********************************************************************************************
// calcSpotPrice //
// sP = spotPrice //
// bI = tokenBalanceIn ( bI / wI ) 1 //
// bO = tokenBalanceOut sP = ----------- * ---------- //
// wI = tokenWeightIn ( bO / wO ) ( 1 - sF ) //
// wO = tokenWeightOut //
// sF = swapFee //
**********************************************************************************************/
function calcSpotPrice(
uint tokenBalanceIn,
uint tokenWeightIn,
uint tokenBalanceOut,
uint tokenWeightOut,
uint swapFee
)
public pure
returns (uint spotPrice)
{
uint numer = bdiv(tokenBalanceIn, tokenWeightIn);
uint denom = bdiv(tokenBalanceOut, tokenWeightOut);
uint ratio = bdiv(numer, denom);
uint scale = bdiv(BONE, bsub(BONE, swapFee));
return (spotPrice = bmul(ratio, scale));
}
/**********************************************************************************************
// calcOutGivenIn //
// aO = tokenAmountOut //
// bO = tokenBalanceOut //
// bI = tokenBalanceIn / / bI \ (wI / wO) \ //
// aI = tokenAmountIn aO = bO * | 1 - | -------------------------- | ^ | //
// wI = tokenWeightIn \ \ ( bI + ( aI * ( 1 - sF )) / / //
// wO = tokenWeightOut //
// sF = swapFee //
**********************************************************************************************/
function calcOutGivenIn(
uint tokenBalanceIn,
uint tokenWeightIn,
uint tokenBalanceOut,
uint tokenWeightOut,
uint tokenAmountIn,
uint swapFee
)
public pure
returns (uint tokenAmountOut)
{
uint weightRatio = bdiv(tokenWeightIn, tokenWeightOut);
uint adjustedIn = bsub(BONE, swapFee);
adjustedIn = bmul(tokenAmountIn, adjustedIn);
uint y = bdiv(tokenBalanceIn, badd(tokenBalanceIn, adjustedIn));
uint foo = bpow(y, weightRatio);
uint bar = bsub(BONE, foo);
tokenAmountOut = bmul(tokenBalanceOut, bar);
return tokenAmountOut;
}
/**********************************************************************************************
// calcInGivenOut //
// aI = tokenAmountIn //
// bO = tokenBalanceOut / / bO \ (wO / wI) \ //
// bI = tokenBalanceIn bI * | | ------------ | ^ - 1 | //
// aO = tokenAmountOut aI = \ \ ( bO - aO ) / / //
// wI = tokenWeightIn -------------------------------------------- //
// wO = tokenWeightOut ( 1 - sF ) //
// sF = swapFee //
**********************************************************************************************/
function calcInGivenOut(
uint tokenBalanceIn,
uint tokenWeightIn,
uint tokenBalanceOut,
uint tokenWeightOut,
uint tokenAmountOut,
uint swapFee
)
public pure
returns (uint tokenAmountIn)
{
uint weightRatio = bdiv(tokenWeightOut, tokenWeightIn);
uint diff = bsub(tokenBalanceOut, tokenAmountOut);
uint y = bdiv(tokenBalanceOut, diff);
uint foo = bpow(y, weightRatio);
foo = bsub(foo, BONE);
tokenAmountIn = bsub(BONE, swapFee);
tokenAmountIn = bdiv(bmul(tokenBalanceIn, foo), tokenAmountIn);
return tokenAmountIn;
}
/**********************************************************************************************
// calcPoolOutGivenSingleIn //
// pAo = poolAmountOut / \ //
// tAi = tokenAmountIn /// / // wI \ \\ \ wI \ //
// wI = tokenWeightIn //| tAi *| 1 - || 1 - -- | * sF || + tBi \ -- \ //
// tW = totalWeight pAo=|| \ \ \\ tW / // | ^ tW | * pS - pS //
// tBi = tokenBalanceIn \\ ------------------------------------- / / //
// pS = poolSupply \\ tBi / / //
// sF = swapFee \ / //
**********************************************************************************************/
function calcPoolOutGivenSingleIn(
uint tokenBalanceIn,
uint tokenWeightIn,
uint poolSupply,
uint totalWeight,
uint tokenAmountIn,
uint swapFee,
uint reservesRatio
)
public pure
returns (uint poolAmountOut, uint reserves)
{
// Charge the trading fee for the proportion of tokenAi
/// which is implicitly traded to the other pool tokens.
// That proportion is (1- weightTokenIn)
// tokenAiAfterFee = tAi * (1 - (1-weightTi) * poolFee);
uint normalizedWeight = bdiv(tokenWeightIn, totalWeight);
// Exact fee portion of `tokenAmountIn`, i.e. (1- Wt)
uint zaz = bmul(bsub(BONE, normalizedWeight), swapFee);
uint tokenAmountInAfterFee = bmul(tokenAmountIn, bsub(BONE, zaz));
reserves = calcReserves(tokenAmountIn, tokenAmountInAfterFee, reservesRatio);
uint newTokenBalanceIn = badd(tokenBalanceIn, tokenAmountInAfterFee);
uint tokenInRatio = bdiv(newTokenBalanceIn, tokenBalanceIn);
// uint newPoolSupply = (ratioTi ^ weightTi) * poolSupply;
uint poolRatio = bpow(tokenInRatio, normalizedWeight);
uint newPoolSupply = bmul(poolRatio, poolSupply);
poolAmountOut = bsub(newPoolSupply, poolSupply);
return (poolAmountOut, reserves);
}
/**********************************************************************************************
// calcSingleInGivenPoolOut //
// tAi = tokenAmountIn //(pS + pAo)\ / 1 \\ //
// pS = poolSupply || --------- | ^ | --------- || * bI - bI //
// pAo = poolAmountOut \\ pS / \(wI / tW)// //
// bI = balanceIn tAi = -------------------------------------------- //
// wI = weightIn / wI \ //
// tW = totalWeight | 1 - ---- | * sF //
// sF = swapFee \ tW / //
**********************************************************************************************/
function calcSingleInGivenPoolOut(
uint tokenBalanceIn,
uint tokenWeightIn,
uint poolSupply,
uint totalWeight,
uint poolAmountOut,
uint swapFee
)
public pure
returns (uint tokenAmountIn)
{
uint normalizedWeight = bdiv(tokenWeightIn, totalWeight);
uint newPoolSupply = badd(poolSupply, poolAmountOut);
uint poolRatio = bdiv(newPoolSupply, poolSupply);
//uint newBalTi = poolRatio^(1/weightTi) * balTi;
uint boo = bdiv(BONE, normalizedWeight);
uint tokenInRatio = bpow(poolRatio, boo);
uint newTokenBalanceIn = bmul(tokenInRatio, tokenBalanceIn);
uint tokenAmountInAfterFee = bsub(newTokenBalanceIn, tokenBalanceIn);
// Do reverse order of fees charged in joinswap_ExternAmountIn, this way
// ``` pAo == joinswap_ExternAmountIn(Ti, joinswap_PoolAmountOut(pAo, Ti)) ```
//uint tAi = tAiAfterFee / (1 - (1-weightTi) * swapFee) ;
uint zar = bmul(bsub(BONE, normalizedWeight), swapFee);
tokenAmountIn = bdiv(tokenAmountInAfterFee, bsub(BONE, zar));
return tokenAmountIn;
}
/**********************************************************************************************
// calcSingleOutGivenPoolIn //
// tAo = tokenAmountOut / / \\ //
// bO = tokenBalanceOut / // pS - (pAi * (1 - eF)) \ / 1 \ \\ //
// pAi = poolAmountIn | bO - || ----------------------- | ^ | --------- | * b0 || //
// ps = poolSupply \ \\ pS / \(wO / tW)/ // //
// wI = tokenWeightIn tAo = \ \ // //
// tW = totalWeight / / wO \ \ //
// sF = swapFee * | 1 - | 1 - ---- | * sF | //
// eF = exitFee \ \ tW / / //
**********************************************************************************************/
function calcSingleOutGivenPoolIn(
uint tokenBalanceOut,
uint tokenWeightOut,
uint poolSupply,
uint totalWeight,
uint poolAmountIn,
uint swapFee
)
public pure
returns (uint tokenAmountOut)
{
uint normalizedWeight = bdiv(tokenWeightOut, totalWeight);
// charge exit fee on the pool token side
// pAiAfterExitFee = pAi*(1-exitFee)
uint poolAmountInAfterExitFee = bmul(poolAmountIn, bsub(BONE, EXIT_FEE));
uint newPoolSupply = bsub(poolSupply, poolAmountInAfterExitFee);
uint poolRatio = bdiv(newPoolSupply, poolSupply);
// newBalTo = poolRatio^(1/weightTo) * balTo;
uint tokenOutRatio = bpow(poolRatio, bdiv(BONE, normalizedWeight));
uint newTokenBalanceOut = bmul(tokenOutRatio, tokenBalanceOut);
uint tokenAmountOutBeforeSwapFee = bsub(tokenBalanceOut, newTokenBalanceOut);
// charge swap fee on the output token side
//uint tAo = tAoBeforeSwapFee * (1 - (1-weightTo) * swapFee)
uint zaz = bmul(bsub(BONE, normalizedWeight), swapFee);
tokenAmountOut = bmul(tokenAmountOutBeforeSwapFee, bsub(BONE, zaz));
return tokenAmountOut;
}
/**********************************************************************************************
// calcPoolInGivenSingleOut //
// pAi = poolAmountIn // / tAo \\ / wO \ \ //
// bO = tokenBalanceOut // | bO - -------------------------- |\ | ---- | \ //
// tAo = tokenAmountOut pS - || \ 1 - ((1 - (tO / tW)) * sF)/ | ^ \ tW / * pS | //
// ps = poolSupply \\ -----------------------------------/ / //
// wO = tokenWeightOut pAi = \\ bO / / //
// tW = totalWeight ------------------------------------------------------------- //
// sF = swapFee ( 1 - eF ) //
// eF = exitFee //
**********************************************************************************************/
function calcPoolInGivenSingleOut(
uint tokenBalanceOut,
uint tokenWeightOut,
uint poolSupply,
uint totalWeight,
uint tokenAmountOut,
uint swapFee,
uint reservesRatio
)
public pure
returns (uint poolAmountIn, uint reserves)
{
// charge swap fee on the output token side
uint normalizedWeight = bdiv(tokenWeightOut, totalWeight);
uint zar = bmul(bsub(BONE, normalizedWeight), swapFee);
uint tokenAmountOutBeforeSwapFee = bdiv(tokenAmountOut, bsub(BONE, zar));
reserves = calcReserves(tokenAmountOutBeforeSwapFee, tokenAmountOut, reservesRatio);
uint newTokenBalanceOut = bsub(tokenBalanceOut, tokenAmountOutBeforeSwapFee);
uint tokenOutRatio = bdiv(newTokenBalanceOut, tokenBalanceOut);
//uint newPoolSupply = (ratioTo ^ weightTo) * poolSupply;
uint poolRatio = bpow(tokenOutRatio, normalizedWeight);
uint newPoolSupply = bmul(poolRatio, poolSupply);
uint poolAmountInAfterExitFee = bsub(poolSupply, newPoolSupply);
// charge exit fee on the pool token side
// pAi = pAiAfterExitFee/(1-exitFee)
poolAmountIn = bdiv(poolAmountInAfterExitFee, bsub(BONE, EXIT_FEE));
return (poolAmountIn, reserves);
}
// `swapFeeAndReserves = amountWithFee - amountWithoutFee` is the swap fee in balancer.
// We divide `swapFeeAndReserves` into halves, `actualSwapFee` and `reserves`.
// `reserves` goes to the admin and `actualSwapFee` still goes to the liquidity
// providers.
function calcReserves(uint amountWithFee, uint amountWithoutFee, uint reservesRatio)
internal pure
returns (uint reserves)
{
require(amountWithFee >= amountWithoutFee);
require(reservesRatio <= BONE);
uint swapFeeAndReserves = bsub(amountWithFee, amountWithoutFee);
reserves = bmul(swapFeeAndReserves, reservesRatio);
require(swapFeeAndReserves >= reserves);
}
}
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity 0.5.12;
import "./BConst.sol";
contract BNum is BConst {
function btoi(uint a)
internal pure
returns (uint)
{
return a / BONE;
}
function bfloor(uint a)
internal pure
returns (uint)
{
return btoi(a) * BONE;
}
function badd(uint a, uint b)
internal pure
returns (uint)
{
uint c = a + b;
require(c >= a);
return c;
}
function bsub(uint a, uint b)
internal pure
returns (uint)
{
(uint c, bool flag) = bsubSign(a, b);
require(!flag);
return c;
}
function bsubSign(uint a, uint b)
internal pure
returns (uint, bool)
{
if (a >= b) {
return (a - b, false);
} else {
return (b - a, true);
}
}
function bmul(uint a, uint b)
internal pure
returns (uint)
{
uint c0 = a * b;
require(a == 0 || c0 / a == b);
uint c1 = c0 + (BONE / 2);
require(c1 >= c0);
uint c2 = c1 / BONE;
return c2;
}
function bdiv(uint a, uint b)
internal pure
returns (uint)
{
require(b != 0);
uint c0 = a * BONE;
require(a == 0 || c0 / a == BONE); // bmul overflow
uint c1 = c0 + (b / 2);
require(c1 >= c0); // badd require
uint c2 = c1 / b;
return c2;
}
// DSMath.wpow
function bpowi(uint a, uint n)
internal pure
returns (uint)
{
uint z = n % 2 != 0 ? a : BONE;
for (n /= 2; n != 0; n /= 2) {
a = bmul(a, a);
if (n % 2 != 0) {
z = bmul(z, a);
}
}
return z;
}
// Compute b^(e.w) by splitting it into (b^e)*(b^0.w).
// Use `bpowi` for `b^e` and `bpowK` for k iterations
// of approximation of b^0.w
function bpow(uint base, uint exp)
internal pure
returns (uint)
{
require(base >= MIN_BPOW_BASE);
require(base <= MAX_BPOW_BASE);
uint whole = bfloor(exp);
uint remain = bsub(exp, whole);
uint wholePow = bpowi(base, btoi(whole));
if (remain == 0) {
return wholePow;
}
uint partialResult = bpowApprox(base, remain, BPOW_PRECISION);
return bmul(wholePow, partialResult);
}
function bpowApprox(uint base, uint exp, uint precision)
internal pure
returns (uint)
{
// term 0:
uint a = exp;
(uint x, bool xneg) = bsubSign(base, BONE);
uint term = BONE;
uint sum = term;
bool negative = false;
// term(k) = numer / denom
// = (product(a - i - 1, i=1-->k) * x^k) / (k!)
// each iteration, multiply previous term by (a-(k-1)) * x / k
// continue until term is less than precision
for (uint i = 1; term >= precision; i++) {
uint bigK = i * BONE;
(uint c, bool cneg) = bsubSign(a, bsub(bigK, BONE));
term = bmul(term, bmul(c, x));
term = bdiv(term, bigK);
if (term == 0) break;
if (xneg) negative = !negative;
if (cneg) negative = !negative;
if (negative) {
sum = bsub(sum, term);
} else {
sum = badd(sum, term);
}
}
return sum;
}
}
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity 0.5.12;
import "./BToken.sol";
import "./BMath.sol";
contract BPool is BBronze, BToken, BMath {
struct Record {
bool bound; // is token bound to pool
uint index; // private
uint denorm; // denormalized weight
uint balance;
}
event LOG_SWAP(
address indexed caller,
address indexed tokenIn,
address indexed tokenOut,
uint256 tokenAmountIn,
uint256 tokenAmountOut
);
event LOG_JOIN(
address indexed caller,
address indexed tokenIn,
uint256 tokenAmountIn
);
event LOG_EXIT(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_DRAIN_RESERVES(
address indexed caller,
address indexed tokenOut,
uint256 tokenAmountOut
);
event LOG_CALL(
bytes4 indexed sig,
address indexed caller,
bytes data
) anonymous;
modifier _logs_() {
emit LOG_CALL(msg.sig, msg.sender, msg.data);
_;
}
modifier _lock_() {
require(!_mutex);
_mutex = true;
_;
_mutex = false;
}
modifier _viewlock_() {
require(!_mutex);
_;
}
bool private _mutex;
address private _factory; // BFactory address to push token exitFee to
address private _controller; // has CONTROL role
bool private _publicSwap; // true if PUBLIC can call SWAP functions
// `setSwapFee` and `finalize` require CONTROL
// `finalize` sets `PUBLIC can SWAP`, `PUBLIC can JOIN`
uint private _swapFee;
uint private _reservesRatio;
bool private _finalized;
address[] private _tokens;
mapping(address=>Record) private _records;
mapping(address=>uint) public totalReserves;
uint private _totalWeight;
constructor() public {
_controller = msg.sender;
_factory = msg.sender;
_swapFee = MIN_FEE;
_reservesRatio = DEFAULT_RESERVES_RATIO;
_publicSwap = false;
_finalized = false;
}
function isPublicSwap()
external view
returns (bool)
{
return _publicSwap;
}
function isFinalized()
external view
returns (bool)
{
return _finalized;
}
function isBound(address t)
external view
returns (bool)
{
return _records[t].bound;
}
function getNumTokens()
external view
returns (uint)
{
return _tokens.length;
}
function getCurrentTokens()
external view _viewlock_
returns (address[] memory tokens)
{
return _tokens;
}
function getFinalTokens()
external view
_viewlock_
returns (address[] memory tokens)
{
require(_finalized);
return _tokens;
}
function getDenormalizedWeight(address token)
external view
_viewlock_
returns (uint)
{
require(_records[token].bound);
return _records[token].denorm;
}
function getTotalDenormalizedWeight()
external view
_viewlock_
returns (uint)
{
return _totalWeight;
}
function getNormalizedWeight(address token)
external view
_viewlock_
returns (uint)
{
require(_records[token].bound);
uint denorm = _records[token].denorm;
return bdiv(denorm, _totalWeight);
}
function getBalance(address token)
external view
_viewlock_
returns (uint)
{
require(_records[token].bound);
return _records[token].balance;
}
function getSwapFee()
external view
_viewlock_
returns (uint)
{
return _swapFee;
}
function getReservesRatio()
external view
_viewlock_
returns (uint)
{
return _reservesRatio;
}
function getController()
external view
_viewlock_
returns (address)
{
return _controller;
}
function setSwapFee(uint swapFee)
external
_logs_
_lock_
{
require(!_finalized);
require(msg.sender == _controller);
require(swapFee >= MIN_FEE);
require(swapFee <= MAX_FEE);
_swapFee = swapFee;
}
function setReservesRatio(uint reservesRatio)
external
_logs_
_lock_
{
require(!_finalized);
require(msg.sender == _controller);
require(reservesRatio <= BONE);
_reservesRatio = reservesRatio;
}
function setController(address manager)
external
_logs_
_lock_
{
require(msg.sender == _controller);
_controller = manager;
}
function setPublicSwap(bool public_)
external
_logs_
_lock_
{
require(!_finalized);
require(msg.sender == _controller);
_publicSwap = public_;
}
function finalize()
external
_logs_
_lock_
{
require(msg.sender == _controller);
require(!_finalized);
require(_tokens.length >= MIN_BOUND_TOKENS);
_finalized = true;
_publicSwap = true;
_mintPoolShare(INIT_POOL_SUPPLY);
_pushPoolShare(msg.sender, INIT_POOL_SUPPLY);
}
function bind(address token, uint balance, uint denorm)
external
_logs_
// _lock_ Bind does not lock because it jumps to `rebind`, which does
{
require(msg.sender == _controller);
require(!_records[token].bound);
require(!_finalized);
require(_tokens.length < MAX_BOUND_TOKENS);
_records[token] = Record({
bound: true,
index: _tokens.length,
denorm: 0, // balance and denorm will be validated
balance: 0 // and set by `rebind`
});
_tokens.push(token);
rebind(token, balance, denorm);
}
function rebind(address token, uint balance, uint denorm)
public
_logs_
_lock_
{
require(msg.sender == _controller);
require(_records[token].bound);
require(!_finalized);
require(denorm >= MIN_WEIGHT);
require(denorm <= MAX_WEIGHT);
require(balance >= MIN_BALANCE);
// Adjust the denorm and totalWeight
uint oldWeight = _records[token].denorm;
if (denorm > oldWeight) {
_totalWeight = badd(_totalWeight, bsub(denorm, oldWeight));
require(_totalWeight <= MAX_TOTAL_WEIGHT);
} else if (denorm < oldWeight) {
_totalWeight = bsub(_totalWeight, bsub(oldWeight, denorm));
}
_records[token].denorm = denorm;
// Adjust the balance record and actual token balance
uint oldBalance = _records[token].balance;
_records[token].balance = balance;
if (balance > oldBalance) {
_pullUnderlying(token, msg.sender, bsub(balance, oldBalance));
} else if (balance < oldBalance) {
// In this case liquidity is being withdrawn, so charge EXIT_FEE
uint tokenBalanceWithdrawn = bsub(oldBalance, balance);
uint tokenExitFee = bmul(tokenBalanceWithdrawn, EXIT_FEE);
_pushUnderlying(token, msg.sender, bsub(tokenBalanceWithdrawn, tokenExitFee));
_pushUnderlying(token, _factory, tokenExitFee);
}
}
function unbind(address token)
external
_logs_
_lock_
{
require(msg.sender == _controller);
require(_records[token].bound);
require(!_finalized);
uint tokenBalance = _records[token].balance;
uint tokenExitFee = bmul(tokenBalance, EXIT_FEE);
_totalWeight = bsub(_totalWeight, _records[token].denorm);
// Swap the token-to-unbind with the last token,
// then delete the last token
uint index = _records[token].index;
uint last = _tokens.length - 1;
_tokens[index] = _tokens[last];
_records[_tokens[index]].index = index;
_tokens.pop();
_records[token] = Record({
bound: false,
index: 0,
denorm: 0,
balance: 0
});
_pushUnderlying(token, msg.sender, bsub(tokenBalance, tokenExitFee));
_pushUnderlying(token, _factory, tokenExitFee);
}
// Absorb any tokens that have been sent to this contract into the pool
function gulp(address token)
external
_logs_
_lock_
{
require(_records[token].bound);
_records[token].balance = IERC20(token).balanceOf(address(this));
}
function seize(address token, uint amount)
external
_logs_
_lock_
{
require(msg.sender == _controller);
require(!_records[token].bound);
uint bal = IERC20(token).balanceOf(address(this));
require(amount <= bal);
_pushUnderlying(token, msg.sender, amount);
}
function getSpotPrice(address tokenIn, address tokenOut)
external view
_viewlock_
returns (uint spotPrice)
{
require(_records[tokenIn].bound);
require(_records[tokenOut].bound);
Record storage inRecord = _records[tokenIn];
Record storage outRecord = _records[tokenOut];
return calcSpotPrice(inRecord.balance, inRecord.denorm, outRecord.balance, outRecord.denorm, _swapFee);
}
function getSpotPriceSansFee(address tokenIn, address tokenOut)
external view
_viewlock_
returns (uint spotPrice)
{
require(_records[tokenIn].bound);
require(_records[tokenOut].bound);
Record storage inRecord = _records[tokenIn];
Record storage outRecord = _records[tokenOut];
return calcSpotPrice(inRecord.balance, inRecord.denorm, outRecord.balance, outRecord.denorm, 0);
}
function joinPool(uint poolAmountOut, uint[] calldata maxAmountsIn)
external
_logs_
_lock_
{
require(_finalized);
uint poolTotal = totalSupply();
uint ratio = bdiv(poolAmountOut, poolTotal);
require(ratio != 0);
for (uint i = 0; i < _tokens.length; i++) {
address t = _tokens[i];
uint bal = _records[t].balance;
uint tokenAmountIn = bmul(ratio, bal);
require(tokenAmountIn != 0);
require(tokenAmountIn <= maxAmountsIn[i]);
_records[t].balance = badd(_records[t].balance, tokenAmountIn);
emit LOG_JOIN(msg.sender, t, tokenAmountIn);
_pullUnderlying(t, msg.sender, tokenAmountIn);
}
_mintPoolShare(poolAmountOut);
_pushPoolShare(msg.sender, poolAmountOut);
}
function exitPool(uint poolAmountIn, uint[] calldata minAmountsOut)
external
_logs_
_lock_
{
require(_finalized);
uint poolTotal = totalSupply();
uint exitFee = bmul(poolAmountIn, EXIT_FEE);
uint pAiAfterExitFee = bsub(poolAmountIn, exitFee);
uint ratio = bdiv(pAiAfterExitFee, poolTotal);
require(ratio != 0);
_pullPoolShare(msg.sender, poolAmountIn);
_pushPoolShare(_factory, exitFee);
_burnPoolShare(pAiAfterExitFee);
for (uint i = 0; i < _tokens.length; i++) {
address t = _tokens[i];
uint bal = _records[t].balance;
uint tokenAmountOut = bmul(ratio, bal);
require(tokenAmountOut != 0);
require(tokenAmountOut >= minAmountsOut[i]);
_records[t].balance = bsub(_records[t].balance, tokenAmountOut);
emit LOG_EXIT(msg.sender, t, tokenAmountOut);
_pushUnderlying(t, msg.sender, tokenAmountOut);
}
}
function swapExactAmountIn(
address tokenIn,
uint tokenAmountIn,
address tokenOut,
uint minAmountOut,
uint maxPrice
)
external
_logs_
_lock_
returns (uint tokenAmountOut, uint spotPriceAfter)
{
require(_records[tokenIn].bound);
require(_records[tokenOut].bound);
require(_publicSwap);
Record storage inRecord = _records[address(tokenIn)];
Record storage outRecord = _records[address(tokenOut)];
require(tokenAmountIn <= bmul(inRecord.balance, MAX_IN_RATIO));
uint spotPriceBefore = calcSpotPrice(
inRecord.balance,
inRecord.denorm,
outRecord.balance,
outRecord.denorm,
_swapFee
);
require(spotPriceBefore <= maxPrice);
tokenAmountOut = calcOutGivenIn(
inRecord.balance,
inRecord.denorm,
outRecord.balance,
outRecord.denorm,
tokenAmountIn,
_swapFee
);
require(tokenAmountOut >= minAmountOut);
uint tokenAmountOutZeroFee = calcOutGivenIn(
inRecord.balance,
inRecord.denorm,
outRecord.balance,
outRecord.denorm,
tokenAmountIn,
0
);
uint reserves = calcReserves(
tokenAmountOutZeroFee,
tokenAmountOut,
_reservesRatio
);
inRecord.balance = badd(inRecord.balance, tokenAmountIn);
// Subtract `reserves`.
outRecord.balance = bsub(bsub(outRecord.balance, tokenAmountOut), reserves);
spotPriceAfter = calcSpotPrice(
inRecord.balance,
inRecord.denorm,
outRecord.balance,
outRecord.denorm,
_swapFee
);
require(spotPriceAfter >= spotPriceBefore);
require(spotPriceAfter <= maxPrice);
require(spotPriceBefore <= bdiv(tokenAmountIn, tokenAmountOut));
emit LOG_SWAP(msg.sender, tokenIn, tokenOut, tokenAmountIn, tokenAmountOut);
totalReserves[address(tokenOut)] = badd(totalReserves[address(tokenOut)], reserves);
_pullUnderlying(tokenIn, msg.sender, tokenAmountIn);
_pushUnderlying(tokenOut, msg.sender, tokenAmountOut);
return (tokenAmountOut, spotPriceAfter);
}
function swapExactAmountOut(
address tokenIn,
uint maxAmountIn,
address tokenOut,
uint tokenAmountOut,
uint maxPrice
)
external
_logs_
_lock_
returns (uint tokenAmountIn, uint spotPriceAfter)
{
require(_records[tokenIn].bound);
require(_records[tokenOut].bound);
require(_publicSwap);
Record storage inRecord = _records[address(tokenIn)];
Record storage outRecord = _records[address(tokenOut)];
require(tokenAmountOut <= bmul(outRecord.balance, MAX_OUT_RATIO));
uint spotPriceBefore = calcSpotPrice(
inRecord.balance,
inRecord.denorm,
outRecord.balance,
outRecord.denorm,
_swapFee
);
require(spotPriceBefore <= maxPrice);
tokenAmountIn = calcInGivenOut(
inRecord.balance,
inRecord.denorm,
outRecord.balance,
outRecord.denorm,
tokenAmountOut,
_swapFee
);
require(tokenAmountIn <= maxAmountIn);
uint tokenAmountInZeroFee = calcInGivenOut(
inRecord.balance,
inRecord.denorm,
outRecord.balance,
outRecord.denorm,
tokenAmountOut,
0
);
uint reserves = calcReserves(
tokenAmountIn,
tokenAmountInZeroFee,
_reservesRatio
);
// Subtract `reserves` which is reserved for admin.
inRecord.balance = bsub(badd(inRecord.balance, tokenAmountIn), reserves);
outRecord.balance = bsub(outRecord.balance, tokenAmountOut);
spotPriceAfter = calcSpotPrice(
inRecord.balance,
inRecord.denorm,
outRecord.balance,
outRecord.denorm,
_swapFee
);
require(spotPriceAfter >= spotPriceBefore);
require(spotPriceAfter <= maxPrice);
require(spotPriceBefore <= bdiv(tokenAmountIn, tokenAmountOut));
emit LOG_SWAP(msg.sender, tokenIn, tokenOut, tokenAmountIn, tokenAmountOut);
totalReserves[address(tokenIn)] = badd(totalReserves[address(tokenIn)], reserves);
_pullUnderlying(tokenIn, msg.sender, tokenAmountIn);
_pushUnderlying(tokenOut, msg.sender, tokenAmountOut);
return (tokenAmountIn, spotPriceAfter);
}
function joinswapExternAmountIn(address tokenIn, uint tokenAmountIn, uint minPoolAmountOut)
external
_logs_
_lock_
returns (uint poolAmountOut)
{
require(_finalized);
require(_records[tokenIn].bound);
require(tokenAmountIn <= bmul(_records[tokenIn].balance, MAX_IN_RATIO));
Record storage inRecord = _records[tokenIn];
uint reserves;
(poolAmountOut, reserves) = calcPoolOutGivenSingleIn(
inRecord.balance,
inRecord.denorm,
_totalSupply,
_totalWeight,
tokenAmountIn,
_swapFee,
_reservesRatio
);
require(poolAmountOut >= minPoolAmountOut);
inRecord.balance = bsub(badd(inRecord.balance, tokenAmountIn), reserves);
emit LOG_JOIN(msg.sender, tokenIn, tokenAmountIn);
totalReserves[address(tokenIn)] = badd(totalReserves[address(tokenIn)], reserves);
_mintPoolShare(poolAmountOut);
_pushPoolShare(msg.sender, poolAmountOut);
_pullUnderlying(tokenIn, msg.sender, tokenAmountIn);
return poolAmountOut;
}
function joinswapPoolAmountOut(address tokenIn, uint poolAmountOut, uint maxAmountIn)
external
_logs_
_lock_
returns (uint tokenAmountIn)
{
require(_finalized);
require(_records[tokenIn].bound);
Record storage inRecord = _records[tokenIn];
tokenAmountIn = calcSingleInGivenPoolOut(
inRecord.balance,
inRecord.denorm,
_totalSupply,
_totalWeight,
poolAmountOut,
_swapFee
);
require(tokenAmountIn != 0);
require(tokenAmountIn <= maxAmountIn);
require(tokenAmountIn <= bmul(_records[tokenIn].balance, MAX_IN_RATIO));
uint tokenAmountInZeroFee = calcSingleInGivenPoolOut(
inRecord.balance,
inRecord.denorm,
_totalSupply,
_totalWeight,
poolAmountOut,
0
);
uint reserves = calcReserves(
tokenAmountIn,
tokenAmountInZeroFee,
_reservesRatio
);
inRecord.balance = bsub(badd(inRecord.balance, tokenAmountIn), reserves);
emit LOG_JOIN(msg.sender, tokenIn, tokenAmountIn);
totalReserves[address(tokenIn)] = badd(totalReserves[address(tokenIn)], reserves);
_mintPoolShare(poolAmountOut);
_pushPoolShare(msg.sender, poolAmountOut);
_pullUnderlying(tokenIn, msg.sender, tokenAmountIn);
return tokenAmountIn;
}
function exitswapPoolAmountIn(address tokenOut, uint poolAmountIn, uint minAmountOut)
external
_logs_
_lock_
returns (uint tokenAmountOut)
{
require(_finalized);
require(_records[tokenOut].bound);
Record storage outRecord = _records[tokenOut];
tokenAmountOut = calcSingleOutGivenPoolIn(
outRecord.balance,
outRecord.denorm,
_totalSupply,
_totalWeight,
poolAmountIn,
_swapFee
);
require(tokenAmountOut >= minAmountOut);
require(tokenAmountOut <= bmul(_records[tokenOut].balance, MAX_OUT_RATIO));
uint tokenAmountOutZeroFee = calcSingleOutGivenPoolIn(
outRecord.balance,
outRecord.denorm,
_totalSupply,
_totalWeight,
poolAmountIn,
0
);
uint reserves = calcReserves(
tokenAmountOutZeroFee,
tokenAmountOut,
_reservesRatio
);
outRecord.balance = bsub(bsub(outRecord.balance, tokenAmountOut), reserves);
uint exitFee = bmul(poolAmountIn, EXIT_FEE);
emit LOG_EXIT(msg.sender, tokenOut, tokenAmountOut);
totalReserves[address(tokenOut)] = badd(totalReserves[address(tokenOut)], reserves);
_pullPoolShare(msg.sender, poolAmountIn);
_burnPoolShare(bsub(poolAmountIn, exitFee));
_pushPoolShare(_factory, exitFee);
_pushUnderlying(tokenOut, msg.sender, tokenAmountOut);
return tokenAmountOut;
}
function exitswapExternAmountOut(address tokenOut, uint tokenAmountOut, uint maxPoolAmountIn)
external
_logs_
_lock_
returns (uint poolAmountIn)
{
require(_finalized);
require(_records[tokenOut].bound);
require(tokenAmountOut <= bmul(_records[tokenOut].balance, MAX_OUT_RATIO));
Record storage outRecord = _records[tokenOut];
uint reserves;
(poolAmountIn, reserves) = calcPoolInGivenSingleOut(
outRecord.balance,
outRecord.denorm,
_totalSupply,
_totalWeight,
tokenAmountOut,
_swapFee,
_reservesRatio
);
require(poolAmountIn != 0);
require(poolAmountIn <= maxPoolAmountIn);
outRecord.balance = bsub(bsub(outRecord.balance, tokenAmountOut), reserves);
uint exitFee = bmul(poolAmountIn, EXIT_FEE);
emit LOG_EXIT(msg.sender, tokenOut, tokenAmountOut);
totalReserves[address(tokenOut)] = badd(totalReserves[address(tokenOut)], reserves);
_pullPoolShare(msg.sender, poolAmountIn);
_burnPoolShare(bsub(poolAmountIn, exitFee));
_pushPoolShare(_factory, exitFee);
_pushUnderlying(tokenOut, msg.sender, tokenAmountOut);
return poolAmountIn;
}
function drainTotalReserves(address reservesAddress)
external
_logs_
_lock_
{
require(msg.sender == _factory);
for (uint i = 0; i < _tokens.length; i++) {
address t = _tokens[i];
uint tokenAmountOut = totalReserves[t];
totalReserves[t] = 0;
emit LOG_DRAIN_RESERVES(reservesAddress, t, tokenAmountOut);
_pushUnderlying(t, reservesAddress, tokenAmountOut);
}
}
// ==
// 'Underlying' token-manipulation functions make external calls but are NOT locked
// You must `_lock_` or otherwise ensure reentry-safety
function _pullUnderlying(address erc20, address from, uint amount)
internal
{
bool xfer = IERC20(erc20).transferFrom(from, address(this), amount);
require(xfer);
}
function _pushUnderlying(address erc20, address to, uint amount)
internal
{
bool xfer = IERC20(erc20).transfer(to, amount);
require(xfer);
}
function _pullPoolShare(address from, uint amount)
internal
{
_pull(from, amount);
}
function _pushPoolShare(address to, uint amount)
internal
{
_push(to, amount);
}
function _mintPoolShare(uint amount)
internal
{
_mint(amount);
}
function _burnPoolShare(uint amount)
internal
{
_burn(amount);
}
}
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity 0.5.12;
import "./BNum.sol";
// Highly opinionated token implementation
interface IERC20 {
event Approval(address indexed src, address indexed dst, uint amt);
event Transfer(address indexed src, address indexed dst, uint amt);
function totalSupply() external view returns (uint);
function balanceOf(address whom) external view returns (uint);
function allowance(address src, address dst) external view returns (uint);
function approve(address dst, uint amt) external returns (bool);
function transfer(address dst, uint amt) external returns (bool);
function transferFrom(
address src, address dst, uint amt
) external returns (bool);
}
contract BTokenBase is BNum {
mapping(address => uint) internal _balance;
mapping(address => mapping(address=>uint)) internal _allowance;
uint internal _totalSupply;
event Approval(address indexed src, address indexed dst, uint amt);
event Transfer(address indexed src, address indexed dst, uint amt);
function _mint(uint amt) internal {
_balance[address(this)] = badd(_balance[address(this)], amt);
_totalSupply = badd(_totalSupply, amt);
emit Transfer(address(0), address(this), amt);
}
function _burn(uint amt) internal {
require(_balance[address(this)] >= amt);
_balance[address(this)] = bsub(_balance[address(this)], amt);
_totalSupply = bsub(_totalSupply, amt);
emit Transfer(address(this), address(0), amt);
}
function _move(address src, address dst, uint amt) internal {
require(_balance[src] >= amt);
_balance[src] = bsub(_balance[src], amt);
_balance[dst] = badd(_balance[dst], amt);
emit Transfer(src, dst, amt);
}
function _push(address to, uint amt) internal {
_move(address(this), to, amt);
}
function _pull(address from, uint amt) internal {
_move(from, address(this), amt);
}
}
contract BToken is BTokenBase, IERC20 {
string private _name = "Cream Pool Token";
string private _symbol = "CRPT";
uint8 private _decimals = 18;
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns(uint8) {
return _decimals;
}
function allowance(address src, address dst) external view returns (uint) {
return _allowance[src][dst];
}
function balanceOf(address whom) external view returns (uint) {
return _balance[whom];
}
function totalSupply() public view returns (uint) {
return _totalSupply;
}
function approve(address dst, uint amt) external returns (bool) {
_allowance[msg.sender][dst] = amt;
emit Approval(msg.sender, dst, amt);
return true;
}
function increaseApproval(address dst, uint amt) external returns (bool) {
_allowance[msg.sender][dst] = badd(_allowance[msg.sender][dst], amt);
emit Approval(msg.sender, dst, _allowance[msg.sender][dst]);
return true;
}
function decreaseApproval(address dst, uint amt) external returns (bool) {
uint oldValue = _allowance[msg.sender][dst];
if (amt > oldValue) {
_allowance[msg.sender][dst] = 0;
} else {
_allowance[msg.sender][dst] = bsub(oldValue, amt);
}
emit Approval(msg.sender, dst, _allowance[msg.sender][dst]);
return true;
}
function transfer(address dst, uint amt) external returns (bool) {
_move(msg.sender, dst, amt);
return true;
}
function transferFrom(address src, address dst, uint amt) external returns (bool) {
require(msg.sender == src || amt <= _allowance[src][msg.sender]);
_move(src, dst, amt);
if (msg.sender != src && _allowance[src][msg.sender] != uint256(-1)) {
_allowance[src][msg.sender] = bsub(_allowance[src][msg.sender], amt);
emit Approval(msg.sender, dst, _allowance[src][msg.sender]);
}
return true;
}
}
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"bool","name":"allow","type":"bool"}],"name":"LOG_ALLOW_NON_ADMIN_POOL","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"blabs","type":"address"}],"name":"LOG_BLABS","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"LOG_NEW_POOL","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"reservesAddress","type":"address"}],"name":"LOG_RESERVES_ADDRESS","type":"event"},{"constant":false,"inputs":[{"internalType":"contract BPool","name":"pool","type":"address"}],"name":"collect","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract BPool","name":"pool","type":"address"}],"name":"collectTokenReserves","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getAllowNonAdminPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getBLabs","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getColor","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getReservesAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"b","type":"address"}],"name":"isBPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"newBPool","outputs":[{"internalType":"contract BPool","name":"","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bool","name":"b","type":"bool"}],"name":"setAllowNonAdminPool","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"b","type":"address"}],"name":"setBLabs","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"a","type":"address"}],"name":"setReservesAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b50600180546001600160a01b0319908116339081179092556002805460ff60a01b199216909217169055614b0e806100496000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c8063c124b18411610071578063c124b18414610142578063c2bb6dc214610168578063c6ce34fb146101a2578063d556c5dc146101c8578063db90def3146101d0578063e5a23849146101ef576100a9565b806306ec16f8146100ae5780632ad415bd146100d657806336ffb167146100fa5780638318f24a146101025780639a86139b14610128575b600080fd5b6100d4600480360360208110156100c457600080fd5b50356001600160a01b03166101f7565b005b6100de61031c565b604080516001600160a01b039092168252519081900360200190f35b6100de61032b565b6100d46004803603602081101561011857600080fd5b50356001600160a01b031661033a565b6101306103a9565b60408051918252519081900360200190f35b6100d46004803603602081101561015857600080fd5b50356001600160a01b03166103b6565b61018e6004803603602081101561017e57600080fd5b50356001600160a01b031661045b565b604080519115158252519081900360200190f35b6100d4600480360360208110156101b857600080fd5b50356001600160a01b0316610479565b6100de6104e8565b6100d4600480360360208110156101e657600080fd5b503515156105f2565b61018e610697565b6001546001600160a01b0316331461020e57600080fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b15801561025857600080fd5b505afa15801561026c573d6000803e3d6000fd5b505050506040513d602081101561028257600080fd5b50516001546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905290519293506000929185169163a9059cbb9160448082019260209290919082900301818787803b1580156102df57600080fd5b505af11580156102f3573d6000803e3d6000fd5b505050506040513d602081101561030957600080fd5b505190508061031757600080fd5b505050565b6002546001600160a01b031690565b6001546001600160a01b031690565b6001546001600160a01b0316331461035157600080fd5b6040516001600160a01b0382169033907fe33f2276fe6ea8141b3855e68646ebcf09ec2df8768afe2a7bf153c9b10c273b90600090a3600280546001600160a01b0319166001600160a01b0392909216919091179055565b6542524f4e5a4560d01b90565b6001546001600160a01b031633146103cd57600080fd5b6001600160a01b03811660009081526020819052604090205460ff166103f257600080fd5b6002546040805163577756b360e11b81526001600160a01b03928316600482015290519183169163aeeead669160248082019260009290919082900301818387803b15801561044057600080fd5b505af1158015610454573d6000803e3d6000fd5b5050505050565b6001600160a01b031660009081526020819052604090205460ff1690565b6001546001600160a01b0316331461049057600080fd5b6040516001600160a01b0382169033907ff586fa6ee1fc42f5b727f3b214ccbd0b6d7e698c45d49ba32f224fbb8670155d90600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b600254600090600160a01b900460ff16610513576001546001600160a01b0316331461051357600080fd5b6000604051610521906106a7565b604051809103906000f08015801561053d573d6000803e3d6000fd5b506001600160a01b038116600081815260208190526040808220805460ff1916600117905551929350909133917f8ccec77b0cb63ac2cafd0f5de8cdfadab91ce656d262240ba8a6343bccc5f94591a3604080516392eefe9b60e01b815233600482015290516001600160a01b038316916392eefe9b91602480830192600092919082900301818387803b1580156105d457600080fd5b505af11580156105e8573d6000803e3d6000fd5b5092935050505090565b6001546001600160a01b03163314610641576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b604080518215158152905133917f3f7cb0f9d9d6328953db4b2e4654f86a01cb45ec1e39aa6665763281ddca54a7919081900360200190a260028054911515600160a01b0260ff60a01b19909216919091179055565b600254600160a01b900460ff1690565b614425806106b58339019056fe60c0604052601060808190527f437265616d20506f6f6c20546f6b656e0000000000000000000000000000000060a0908152620000409160039190620000fe565b506040805180820190915260048082527f43525054000000000000000000000000000000000000000000000000000000006020909201918252620000859181620000fe565b506005805460ff19166012179055348015620000a057600080fd5b50600680546005805462010000600160b01b031916336201000081029190911790915564e8d4a510006007556702c68af0bb1400006008556001600160a01b03199091161760ff60a01b191690556009805460ff19169055620001a3565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200014157805160ff191683800117855562000171565b8280016001018555821562000171579182015b828111156200017157825182559160200191906001019062000154565b506200017f92915062000183565b5090565b620001a091905b808211156200017f57600081556001016200018a565b90565b61427280620001b36000396000f3fe608060405234801561001057600080fd5b506004361061039d5760003560e01c806392eefe9b116101eb578063bc694ea211610110578063dd62ed3e116100a8578063dd62ed3e14610c51578063e4a28a52146104fd578063e4e1e53814610c7f578063eb9253c014610cb1578063ec09302114610cdd578063f1b8a9b714610ce5578063f8b2cb4f14610d0b578063f8d6aed414610d31578063fde924f714610d6c5761039d565b8063bc694ea214610b7f578063be3bbd2e14610b87578063c36596a614610571578063c6580d1214610bdf578063cc77828d14610be7578063cd2ed8fb14610bef578063cf5e7bd314610bf7578063d4cadf6814610c1d578063d73dd62314610c255761039d565b8063a9059cbb11610183578063a9059cbb14610a40578063aeeead6614610a6c578063b02f0b7314610a92578063b0e0d13614610b07578063b4a8e10114610b0f578063b7b800a414610b2c578063ba019dab14610b34578063ba9530a614610b3c578063bc063e1a14610b775761039d565b806392eefe9b1461098f578063936c3477146109b55780639381cd2b146109bd57806393c88d14146109c5578063948d8ce6146109cd57806395d89b41146109f3578063992e2a92146109fb5780639a86139b14610a03578063a221ee4914610a0b5761039d565b806346ab38f1116102d15780636d0800bc116102695780636d0800bc1461084a57806370a082311461087057806376c7a3c7146108965780637c5e9ea41461089e5780638201aa3f146108de578063867378c51461091e57806389298012146109265780638c28cbe8146109615780638d4e4083146109875761039d565b806346ab38f1146106a957806349b59552146106db5780634bb278f3146106fa5780634d2fd81d146107025780634f69c0d41461070a5780635c1bbaf71461077f5780635db34277146107ba57806366188463146107ec5780636d06dfa0146108185761039d565b8063189d00ca11610344578063189d00ca14610569578063218b53821461057157806321abba011461057957806323b872dd146105ba5780632f37b624146105f05780633018205f14610616578063313ce5671461063a57806334e19907146106585780633fdddaa2146106775761039d565b8063024eb2e3146103a257806302c96748146103fc57806306fdde0314610440578063095ea7b3146104bd57806309a3bbe4146104fd5780631446a7ff1461050557806315e84af91461053357806318160ddd14610561575b600080fd5b6103e3600480360360e08110156103b857600080fd5b5080359060208101359060408101359060608101359060808101359060a08101359060c00135610d74565b6040805192835260208301919091528051918290030190f35b61042e6004803603606081101561041257600080fd5b506001600160a01b038135169060208101359060400135610e43565b60408051918252519081900360200190f35b610448611093565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561048257818101518382015260200161046a565b50505050905090810190601f1680156104af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104e9600480360360408110156104d357600080fd5b506001600160a01b038135169060200135611129565b604080519115158252519081900360200190f35b61042e61117e565b61042e6004803603604081101561051b57600080fd5b506001600160a01b038135811691602001351661118b565b61042e6004803603604081101561054957600080fd5b506001600160a01b038135811691602001351661123a565b61042e6112e0565b61042e6112e6565b61042e6112fa565b6103e3600480360360e081101561058f57600080fd5b5080359060208101359060408101359060608101359060808101359060a08101359060c00135611306565b6104e9600480360360608110156105d057600080fd5b506001600160a01b038135811691602081013590911690604001356113b3565b6104e96004803603602081101561060657600080fd5b50356001600160a01b03166114cd565b61061e6114eb565b604080516001600160a01b039092168252519081900360200190f35b610642611513565b6040805160ff9092168252519081900360200190f35b6106756004803603602081101561066e57600080fd5b503561151c565b005b6106756004803603606081101561068d57600080fd5b506001600160a01b0381351690602081013590604001356115ff565b61042e600480360360608110156106bf57600080fd5b506001600160a01b03813516906020810135906040013561183b565b610675600480360360208110156106f157600080fd5b50351515611a8f565b610675611b64565b61042e611c74565b6106756004803603604081101561072057600080fd5b81359190810190604081016020820135600160201b81111561074157600080fd5b82018360208201111561075357600080fd5b803590602001918460208302840111600160201b8311171561077457600080fd5b509092509050611c93565b61042e600480360360c081101561079557600080fd5b5080359060208101359060408101359060608101359060808101359060a00135611e5d565b61042e600480360360608110156107d057600080fd5b506001600160a01b038135169060208101359060400135611f10565b6104e96004803603604081101561080257600080fd5b506001600160a01b038135169060200135612117565b61042e6004803603606081101561082e57600080fd5b506001600160a01b0381351690602081013590604001356121ef565b61042e6004803603602081101561086057600080fd5b50356001600160a01b0316612407565b61042e6004803603602081101561088657600080fd5b50356001600160a01b0316612419565b61042e612434565b6103e3600480360360a08110156108b457600080fd5b506001600160a01b0381358116916020810135916040820135169060608101359060800135612446565b6103e3600480360360a08110156108f457600080fd5b506001600160a01b038135811691602081013591604082013516906060810135906080013561273b565b61042e612a15565b61042e600480360360c081101561093c57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135612a29565b6106756004803603602081101561097757600080fd5b50356001600160a01b0316612ad9565b6104e9612c1f565b610675600480360360208110156109a557600080fd5b50356001600160a01b0316612c28565b61042e612cf3565b61042e612d12565b61042e612d1f565b61042e600480360360208110156109e357600080fd5b50356001600160a01b0316612d2f565b610448612d8b565b61042e612dec565b61042e612df8565b61042e600480360360a0811015610a2157600080fd5b5080359060208101359060408101359060608101359060800135612e05565b6104e960048036036040811015610a5657600080fd5b506001600160a01b038135169060200135612e6a565b61067560048036036020811015610a8257600080fd5b50356001600160a01b0316612e80565b61067560048036036040811015610aa857600080fd5b81359190810190604081016020820135600160201b811115610ac957600080fd5b820183602082011115610adb57600080fd5b803590602001918460208302840111600160201b83111715610afc57600080fd5b509092509050612fc6565b61042e6131dd565b61067560048036036020811015610b2557600080fd5b50356131e2565b61042e6132b3565b61042e6132b8565b61042e600480360360c0811015610b5257600080fd5b5080359060208101359060408101359060608101359060808101359060a001356132bd565b61042e61333e565b61042e61334e565b610b8f61335a565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610bcb578181015183820152602001610bb3565b505050509050019250505060405180910390f35b61042e6133e0565b610b8f6133e5565b61042e6133fd565b61067560048036036020811015610c0d57600080fd5b50356001600160a01b0316613403565b61042e61369f565b6104e960048036036040811015610c3b57600080fd5b506001600160a01b0381351690602001356136be565b61042e60048036036040811015610c6757600080fd5b506001600160a01b038135811691602001351661373f565b61067560048036036060811015610c9557600080fd5b506001600160a01b03813516906020810135906040013561376a565b61067560048036036040811015610cc757600080fd5b506001600160a01b0381351690602001356138d9565b61042e613a3d565b61042e60048036036020811015610cfb57600080fd5b50356001600160a01b0316613a4d565b61042e60048036036020811015610d2157600080fd5b50356001600160a01b0316613abb565b61042e600480360360c0811015610d4757600080fd5b5080359060208101359060408101359060608101359060808101359060a00135613b17565b6104e9613b9a565b6000806000610d838988613baa565b90506000610da2610d9c670de0b6b3a764000084613c10565b87613c36565b90506000610dc188610dbc670de0b6b3a764000085613c10565b613baa565b9050610dce818988613c82565b93506000610ddc8d83613c10565b90506000610dea828f613baa565b90506000610df88287613ccd565b90506000610e06828f613c36565b90506000610e148f83613c10565b9050610e2d81610dbc670de0b6b3a76400006000613c10565b9950505050505050505097509795505050505050565b6000336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615610ebb57600080fd5b6005805461ff00191661010017905560095460ff16610ed957600080fd5b6001600160a01b0384166000908152600b602052604090205460ff16610efe57600080fd5b6001600160a01b0384166000908152600b60205260409020600390810154610f3391670de0b6b3a76400005b04600101613c36565b831115610f3f57600080fd5b6000600b6000866001600160a01b03166001600160a01b0316815260200190815260200160002090506000610f8982600301548360020154600254600d5489600754600854610d74565b909350905082610f9857600080fd5b83831115610fa557600080fd5b610fbc610fb6836003015487613c10565b82613c10565b60038301556000610fcd8482613c36565b6040805188815290519192506001600160a01b0389169133916000805160206141fe833981519152919081900360200190a36001600160a01b0387166000908152600c60205260409020546110229083613d5a565b6001600160a01b0388166000908152600c60205260409020556110453385613d6c565b6110576110528583613c10565b613d7a565b600554611073906201000090046001600160a01b031682613d86565b61107e873388613d90565b5050506005805461ff00191690559392505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561111f5780601f106110f45761010080835404028352916020019161111f565b820191906000526020600020905b81548152906001019060200180831161110257829003601f168201915b5050505050905090565b3360008181526001602090815260408083206001600160a01b0387168085529083528184208690558151868152915193949093909260008051602061421e833981519152928290030190a35060015b92915050565b6802b5e3af16b188000081565b600554600090610100900460ff16156111a357600080fd5b6001600160a01b0383166000908152600b602052604090205460ff166111c857600080fd5b6001600160a01b0382166000908152600b602052604090205460ff166111ed57600080fd5b6001600160a01b038084166000908152600b602052604080822092851682528120600380840154600280860154928401549084015493946112319492939290612e05565b95945050505050565b600554600090610100900460ff161561125257600080fd5b6001600160a01b0383166000908152600b602052604090205460ff1661127757600080fd5b6001600160a01b0382166000908152600b602052604090205460ff1661129c57600080fd5b6001600160a01b038084166000908152600b602052604080822092851682529020600380830154600280850154928401549084015460075461123194929190612e05565b60025490565b6402540be400670de0b6b3a76400005b0481565b670de0b6b3a764000081565b60008060006113158988613baa565b9050600061132e610d9c670de0b6b3a764000084613c10565b9050600061134d88611348670de0b6b3a764000085613c10565b613c36565b905061135a888288613c82565b935060006113688d83613d5a565b90506000611376828f613baa565b905060006113848287613ccd565b90506000611392828f613c36565b905061139e818f613c10565b98505050505050505097509795505050505050565b6000336001600160a01b03851614806113ef57506001600160a01b03841660009081526001602090815260408083203384529091529020548211155b6113f857600080fd5b611403848484613e21565b336001600160a01b0385161480159061144157506001600160a01b038416600090815260016020908152604080832033845290915290205460001914155b156114c3576001600160a01b03841660009081526001602090815260408083203384529091529020546114749083613c10565b6001600160a01b038581166000908152600160209081526040808320338085529083529281902085905580519485525192871693919260008051602061421e8339815191529281900390910190a35b5060019392505050565b6001600160a01b03166000908152600b602052604090205460ff1690565b600554600090610100900460ff161561150357600080fd5b506006546001600160a01b031690565b60055460ff1690565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561159257600080fd5b6005805461ff00191661010017905560095460ff16156115b157600080fd5b6006546001600160a01b031633146115c857600080fd5b64e8d4a510008110156115da57600080fd5b67016345785d8a00008111156115ef57600080fd5b6007556005805461ff0019169055565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561167557600080fd5b6005805461ff001916610100179055600654336001600160a01b039091161461169d57600080fd5b6001600160a01b0383166000908152600b602052604090205460ff166116c257600080fd5b60095460ff16156116d257600080fd5b670de0b6b3a76400008110156116e757600080fd5b6802b5e3af16b18800008111156116fd57600080fd5b620f424082101561170d57600080fd5b6001600160a01b0383166000908152600b60205260409020600201548082111561176557611746600d546117418484613c10565b613d5a565b600d8190556802b5e3af16b1880000101561176057600080fd5b611786565b8082101561178657611782600d5461177d8385613c10565b613c10565b600d555b6001600160a01b0384166000908152600b6020526040902060028101839055600301805490849055808411156117cf576117ca85336117c58785613c10565b613ee0565b611829565b808410156118295760006117e38286613c10565b905060006117f2826000613c36565b905061180887336118038585613c10565b613d90565b6005546118269088906201000090046001600160a01b031683613d90565b50505b50506005805461ff0019169055505050565b6000336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156118b357600080fd5b6005805461ff00191661010017905560095460ff166118d157600080fd5b6001600160a01b0384166000908152600b602052604090205460ff166118f657600080fd5b6001600160a01b0384166000908152600b6020526040902060038101546002808301549054600d5460075461193094939291908990612a29565b91508282101561193f57600080fd5b6001600160a01b0385166000908152600b6020526040902060039081015461196f91670de0b6b3a7640000610f2a565b82111561197b57600080fd5b600061199882600301548360020154600254600d54896000612a29565b905060006119a98285600854613c82565b90506119bc610fb6846003015486613c10565b600384015560006119cd8782613c36565b6040805187815290519192506001600160a01b038a169133916000805160206141fe833981519152919081900360200190a36001600160a01b0388166000908152600c6020526040902054611a229083613d5a565b6001600160a01b0389166000908152600c6020526040902055611a453388613d6c565b611a526110528883613c10565b600554611a6e906201000090046001600160a01b031682613d86565b611a79883387613d90565b505050506005805461ff00191690559392505050565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611b0557600080fd5b6005805461ff00191661010017905560095460ff1615611b2457600080fd5b6006546001600160a01b03163314611b3b57600080fd5b60068054911515600160a01b0260ff60a01b199092169190911790556005805461ff0019169055565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611bda57600080fd5b6005805461ff001916610100179055600654336001600160a01b0390911614611c0257600080fd5b60095460ff1615611c1257600080fd5b600a5460021115611c2257600080fd5b6009805460ff191660011790556006805460ff60a01b1916600160a01b179055611c5468056bc75e2d63100000613f39565b611c673368056bc75e2d63100000613d86565b6005805461ff0019169055565b600554600090610100900460ff1615611c8c57600080fd5b5060085490565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611d0957600080fd5b6005805461ff00191661010017905560095460ff16611d2757600080fd5b6000611d316112e0565b90506000611d3f8583613baa565b905080611d4b57600080fd5b60005b600a54811015611e49576000600a8281548110611d6757fe5b60009182526020808320909101546001600160a01b0316808352600b909152604082206003015490925090611d9c8583613c36565b905080611da857600080fd5b878785818110611db457fe5b90506020020135811115611dc757600080fd5b6001600160a01b0383166000908152600b6020526040902060030154611ded9082613d5a565b6001600160a01b0384166000818152600b60209081526040918290206003019390935580518481529051919233926000805160206141be8339815191529281900390910190a3611e3e833383613ee0565b505050600101611d4e565b50611e5385613f39565b6118293386613d86565b600080611e6a8786613baa565b90506000611e788786613d5a565b90506000611e868289613baa565b90506000611e9c670de0b6b3a764000085613baa565b90506000611eaa8383613ccd565b90506000611eb8828e613c36565b90506000611ec6828f613c10565b90506000611ee5611edf670de0b6b3a76400008a613c10565b8b613c36565b9050611efd82610dbc670de0b6b3a764000084613c10565b9f9e505050505050505050505050505050565b6000336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611f8857600080fd5b6005805461ff00191661010017905560095460ff16611fa657600080fd5b6001600160a01b0384166000908152600b602052604090205460ff16611fcb57600080fd5b6001600160a01b0384166000908152600b6020526040902060030154611ffd906002670de0b6b3a76400005b04613c36565b83111561200957600080fd5b6000600b6000866001600160a01b03166001600160a01b031681526020019081526020016000209050600061205382600301548360020154600254600d5489600754600854611306565b90935090508383101561206557600080fd5b612076610fb6836003015487613d5a565b60038301556040805186815290516001600160a01b0388169133916000805160206141be8339815191529181900360200190a36001600160a01b0386166000908152600c60205260409020546120cc9082613d5a565b6001600160a01b0387166000908152600c60205260409020556120ee83613f39565b6120f83384613d86565b612103863387613ee0565b50506005805461ff00191690559392505050565b3360009081526001602090815260408083206001600160a01b03861684529091528120548083111561216c573360009081526001602090815260408083206001600160a01b038816845290915281205561219b565b6121768184613c10565b3360009081526001602090815260408083206001600160a01b03891684529091529020555b3360008181526001602090815260408083206001600160a01b03891680855290835292819020548151908152905192939260008051602061421e833981519152929181900390910190a35060019392505050565b6000336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561226757600080fd5b6005805461ff00191661010017905560095460ff1661228557600080fd5b6001600160a01b0384166000908152600b602052604090205460ff166122aa57600080fd5b6001600160a01b0384166000908152600b6020526040902060038101546002808301549054600d546007546122e494939291908990611e5d565b9150816122f057600080fd5b828211156122fd57600080fd5b6001600160a01b0385166000908152600b602052604090206003015461232d906002670de0b6b3a7640000611ff7565b82111561233957600080fd5b600061235682600301548360020154600254600d54896000611e5d565b905060006123678483600854613c82565b905061237a610fb6846003015486613d5a565b60038401556040805185815290516001600160a01b0389169133916000805160206141be8339815191529181900360200190a36001600160a01b0387166000908152600c60205260409020546123d09082613d5a565b6001600160a01b0388166000908152600c60205260409020556123f286613f39565b6123fc3387613d86565b61107e873386613ee0565b600c6020526000908152604090205481565b6001600160a01b031660009081526020819052604090205490565b620f4240670de0b6b3a76400006112f6565b60408051602080825236908201819052600092839233926001600160e01b03198535169285929081908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156124ad57600080fd5b6005805461ff0019166101001790556001600160a01b0387166000908152600b602052604090205460ff166124e157600080fd5b6001600160a01b0385166000908152600b602052604090205460ff1661250657600080fd5b600654600160a01b900460ff1661251c57600080fd5b6001600160a01b038088166000908152600b60205260408082209288168252902060038082015461255591670de0b6b3a7640000610f2a565b86111561256157600080fd5b60006125828360030154846002015484600301548560020154600754612e05565b90508581111561259157600080fd5b6125b183600301548460020154846003015485600201548b600754613b17565b9450888511156125c057600080fd5b60006125e184600301548560020154856003015486600201548c6000613b17565b905060006125f28783600854613c82565b9050612605610fb6866003015489613d5a565b856003018190555061261b84600301548a613c10565b60038086018290558601546002808801549087015460075461263e949190612e05565b95508286101561264d57600080fd5b8786111561265a57600080fd5b612664878a613baa565b83111561267057600080fd5b896001600160a01b03168c6001600160a01b0316336001600160a01b03167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d433788a8d604051808381526020018281526020019250505060405180910390a46001600160a01b038c166000908152600c60205260409020546126f09082613d5a565b6001600160a01b038d166000908152600c60205260409020556127148c3389613ee0565b61271f8a338b613d90565b50505050506005805461ff001916905590969095509350505050565b60408051602080825236908201819052600092839233926001600160e01b03198535169285929081908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156127a257600080fd5b6005805461ff0019166101001790556001600160a01b0387166000908152600b602052604090205460ff166127d657600080fd5b6001600160a01b0385166000908152600b602052604090205460ff166127fb57600080fd5b600654600160a01b900460ff1661281157600080fd5b6001600160a01b038088166000908152600b602052604080822092881682529020600382015461284b906002670de0b6b3a7640000611ff7565b88111561285757600080fd5b60006128788360030154846002015484600301548560020154600754612e05565b90508581111561288757600080fd5b6128a783600301548460020154846003015485600201548d6007546132bd565b9450868510156128b657600080fd5b60006128d784600301548560020154856003015486600201548e60006132bd565b905060006128e88288600854613c82565b90506128f885600301548c613d5a565b8560030181905550612911610fb6856003015489613c10565b600380860182905586015460028088015490870154600754612934949190612e05565b95508286101561294357600080fd5b8786111561295057600080fd5b61295a8b88613baa565b83111561296657600080fd5b896001600160a01b03168c6001600160a01b0316336001600160a01b03167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d433788e8b604051808381526020018281526020019250505060405180910390a46001600160a01b038a166000908152600c60205260409020546129e69082613d5a565b6001600160a01b038b166000908152600c6020526040902055612a0a8c338d613ee0565b61271f8a3389613d90565b64e8d4a51000670de0b6b3a76400006112f6565b600080612a368786613baa565b90506000612a5185611348670de0b6b3a76400006000613c10565b90506000612a5f8883613c10565b90506000612a6d828a613baa565b90506000612a8c82612a87670de0b6b3a764000088613baa565b613ccd565b90506000612a9a828e613c36565b90506000612aa88e83613c10565b90506000612ac1611edf670de0b6b3a76400008a613c10565b9050611efd82611348670de0b6b3a764000084613c10565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612b4f57600080fd5b6005805461ff0019166101001790556001600160a01b0381166000908152600b602052604090205460ff16612b8357600080fd5b604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b158015612bc957600080fd5b505afa158015612bdd573d6000803e3d6000fd5b505050506040513d6020811015612bf357600080fd5b50516001600160a01b039091166000908152600b60205260409020600301556005805461ff0019169055565b60095460ff1690565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612c9e57600080fd5b6005805461ff001916610100179055600654336001600160a01b0390911614612cc657600080fd5b600680546001600160a01b0319166001600160a01b03929092169190911790556005805461ff0019169055565b600554600090610100900460ff1615612d0b57600080fd5b50600d5490565b68056bc75e2d6310000081565b6005670de0b6b3a76400006112f6565b600554600090610100900460ff1615612d4757600080fd5b6001600160a01b0382166000908152600b602052604090205460ff16612d6c57600080fd5b506001600160a01b03166000908152600b602052604090206002015490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561111f5780601f106110f45761010080835404028352916020019161111f565b6704a03ce68d21555681565b6542524f4e5a4560d01b90565b600080612e128787613baa565b90506000612e208686613baa565b90506000612e2e8383613baa565b90506000612e50670de0b6b3a7640000610dbc670de0b6b3a764000089613c10565b9050612e5c8282613c36565b9a9950505050505050505050565b6000612e77338484613e21565b50600192915050565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612ef657600080fd5b6005805461010061ff001990911617908190556201000090046001600160a01b03163314612f2357600080fd5b60005b600a54811015612fb7576000600a8281548110612f3f57fe5b60009182526020808320909101546001600160a01b03908116808452600c835260408085208054959055805185815290519195508593928816927f261074971f6b45f02124a88c43d5c95e174626f867c87684fb60dbbe35ec2cd292918290030190a3612fad828583613d90565b5050600101612f26565b50506005805461ff0019169055565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561303c57600080fd5b6005805461ff00191661010017905560095460ff1661305a57600080fd5b60006130646112e0565b90506000613073856000613c36565b905060006130818683613c10565b9050600061308f8285613baa565b90508061309b57600080fd5b6130a53388613d6c565b6005546130c1906201000090046001600160a01b031684613d86565b6130ca82613d7a565b60005b600a548110156131c8576000600a82815481106130e657fe5b60009182526020808320909101546001600160a01b0316808352600b90915260408220600301549092509061311b8583613c36565b90508061312757600080fd5b89898581811061313357fe5b9050602002013581101561314657600080fd5b6001600160a01b0383166000908152600b602052604090206003015461316c9082613c10565b6001600160a01b0384166000818152600b60209081526040918290206003019390935580518481529051919233926000805160206141fe8339815191529281900390910190a36131bd833383613d90565b5050506001016130cd565b50506005805461ff0019169055505050505050565b600881565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561325857600080fd5b6005805461ff00191661010017905560095460ff161561327757600080fd5b6006546001600160a01b0316331461328e57600080fd5b670de0b6b3a76400008111156132a357600080fd5b6008556005805461ff0019169055565b600281565b600181565b6000806132ca8786613baa565b905060006132e0670de0b6b3a764000085613c10565b90506132ec8582613c36565b905060006132fe8a610dbc8c85613d5a565b9050600061330c8285613ccd565b90506000613322670de0b6b3a764000083613c10565b905061332e8a82613c36565b9c9b505050505050505050505050565b600a670de0b6b3a76400006112f6565b671bc16d674ec7ffff81565b600554606090610100900460ff161561337257600080fd5b60095460ff1661338157600080fd5b600a80548060200260200160405190810160405280929190818152602001828054801561111f57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116133b9575050505050905090565b600081565b600554606090610100900460ff161561338157600080fd5b600a5490565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561347957600080fd5b6005805461ff001916610100179055600654336001600160a01b03909116146134a157600080fd5b6001600160a01b0381166000908152600b602052604090205460ff166134c657600080fd5b60095460ff16156134d657600080fd5b6001600160a01b0381166000908152600b6020526040812060030154906134fd8282613c36565b600d546001600160a01b0385166000908152600b602052604090206002015491925061352891613c10565b600d556001600160a01b0383166000908152600b6020526040902060010154600a8054600019810191908290811061355c57fe5b600091825260209091200154600a80546001600160a01b03909216918490811061358257fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081600b6000600a85815481106135c257fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902060010155600a8054806135f557fe5b60008281526020808220600019908401810180546001600160a01b031916905590920190925560408051608081018252838152808301848152818301858152606083018681526001600160a01b038c168752600b909552929094209051815460ff1916901515178155925160018401555160028301555160039091015561368185336118038787613c10565b6005546118299086906201000090046001600160a01b031685613d90565b600554600090610100900460ff16156136b757600080fd5b5060075490565b3360009081526001602090815260408083206001600160a01b03861684529091528120546136ec9083613d5a565b3360008181526001602090815260408083206001600160a01b03891680855290835292819020859055805194855251919360008051602061421e833981519152929081900390910190a350600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a26006546001600160a01b031633146137e257600080fd5b6001600160a01b0383166000908152600b602052604090205460ff161561380857600080fd5b60095460ff161561381857600080fd5b600a5460081161382757600080fd5b604080516080810182526001808252600a805460208085019182526000858701818152606087018281526001600160a01b038c16808452600b9094529782209651875460ff1916901515178755925186860155915160028601559451600390940193909355805491820181559091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b03191690911790556138d48383836115ff565b505050565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561394f57600080fd5b6005805461ff001916610100179055600654336001600160a01b039091161461397757600080fd5b6001600160a01b0382166000908152600b602052604090205460ff161561399d57600080fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b038516916370a0823191602480820192602092909190829003018186803b1580156139e757600080fd5b505afa1580156139fb573d6000803e3d6000fd5b505050506040513d6020811015613a1157600080fd5b5051905080821115613a2257600080fd5b613a2d833384613d90565b50506005805461ff001916905550565b6002670de0b6b3a76400006112f6565b600554600090610100900460ff1615613a6557600080fd5b6001600160a01b0382166000908152600b602052604090205460ff16613a8a57600080fd5b6001600160a01b0382166000908152600b6020526040902060020154600d54613ab4908290613baa565b9392505050565b600554600090610100900460ff1615613ad357600080fd5b6001600160a01b0382166000908152600b602052604090205460ff16613af857600080fd5b506001600160a01b03166000908152600b602052604090206003015490565b600080613b248588613baa565b90506000613b328786613c10565b90506000613b408883613baa565b90506000613b4e8285613ccd565b9050613b6281670de0b6b3a7640000613c10565b9050613b76670de0b6b3a764000087613c10565b9450613b8b613b858c83613c36565b86613baa565b9b9a5050505050505050505050565b600654600160a01b900460ff1690565b600081613bb657600080fd5b670de0b6b3a76400008302831580613bde5750670de0b6b3a7640000848281613bdb57fe5b04145b613be757600080fd5b60028304810181811015613bfa57600080fd5b6000848281613c0557fe5b049695505050505050565b6000806000613c1f8585613f42565b915091508015613c2e57600080fd5b509392505050565b6000828202831580613c50575082848281613c4d57fe5b04145b613c5957600080fd5b6706f05b59d3b20000810181811015613c7157600080fd5b6000670de0b6b3a764000082613c05565b600082841015613c9157600080fd5b670de0b6b3a7640000821115613ca657600080fd5b6000613cb28585613c10565b9050613cbe8184613c36565b915081811015613c2e57600080fd5b60006001831015613cdd57600080fd5b671bc16d674ec7ffff831115613cf257600080fd5b6000613cfd83613f67565b90506000613d0b8483613c10565b90506000613d2186613d1c85613f82565b613f90565b905081613d32579250611178915050565b6000613d4387846305f5e100613fe7565b9050613d4f8282613c36565b979650505050505050565b600082820183811015613ab457600080fd5b613d7682826140c5565b5050565b613d83816140d0565b50565b613d76828261414f565b6040805163a9059cbb60e01b81526001600160a01b03848116600483015260248201849052915160009286169163a9059cbb91604480830192602092919082900301818787803b158015613de357600080fd5b505af1158015613df7573d6000803e3d6000fd5b505050506040513d6020811015613e0d57600080fd5b5051905080613e1b57600080fd5b50505050565b6001600160a01b038316600090815260208190526040902054811115613e4657600080fd5b6001600160a01b038316600090815260208190526040902054613e699082613c10565b6001600160a01b038085166000908152602081905260408082209390935590841681522054613e989082613d5a565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716926000805160206141de83398151915292918290030190a3505050565b604080516323b872dd60e01b81526001600160a01b0384811660048301523060248301526044820184905291516000928616916323b872dd91606480830192602092919082900301818787803b158015613de357600080fd5b613d838161415a565b600080828410613f585750508082036000613f60565b505081810360015b9250929050565b6000670de0b6b3a7640000613f7b83613f82565b0292915050565b670de0b6b3a7640000900490565b60008060028306613fa957670de0b6b3a7640000613fab565b835b90506002830492505b8215613ab457613fc48485613c36565b93506002830615613fdc57613fd98185613c36565b90505b600283049250613fb4565b6000828180613ffe87670de0b6b3a7640000613f42565b9092509050670de0b6b3a764000080600060015b8884106140b6576000670de0b6b3a7640000820290506000806140468a61404185670de0b6b3a7640000613c10565b613f42565b9150915061405887611348848c613c36565b96506140648784613baa565b965086614073575050506140b6565b871561407d579315935b8015614087579315935b841561409e576140978688613c10565b95506140ab565b6140a88688613d5a565b95505b505050600101614012565b50909998505050505050505050565b613d76823083613e21565b306000908152602081905260409020548111156140ec57600080fd5b306000908152602081905260409020546141069082613c10565b306000908152602081905260409020556002546141239082613c10565b60025560408051828152905160009130916000805160206141de8339815191529181900360200190a350565b613d76308383613e21565b306000908152602081905260409020546141749082613d5a565b306000908152602081905260409020556002546141919082613d5a565b60025560408051828152905130916000916000805160206141de8339815191529181900360200190a35056fe63982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39addf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efe74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a265627a7a72315820993ab7d9193add493b90f3fbc114d124f2515ee3286bb646c67d794789a25cb064736f6c634300050c0032a265627a7a72315820cb0369d6143ed4b10593b35c8ff05cad309100d432356dce6ff76e24df7c567c64736f6c634300050c0032
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063c124b18411610071578063c124b18414610142578063c2bb6dc214610168578063c6ce34fb146101a2578063d556c5dc146101c8578063db90def3146101d0578063e5a23849146101ef576100a9565b806306ec16f8146100ae5780632ad415bd146100d657806336ffb167146100fa5780638318f24a146101025780639a86139b14610128575b600080fd5b6100d4600480360360208110156100c457600080fd5b50356001600160a01b03166101f7565b005b6100de61031c565b604080516001600160a01b039092168252519081900360200190f35b6100de61032b565b6100d46004803603602081101561011857600080fd5b50356001600160a01b031661033a565b6101306103a9565b60408051918252519081900360200190f35b6100d46004803603602081101561015857600080fd5b50356001600160a01b03166103b6565b61018e6004803603602081101561017e57600080fd5b50356001600160a01b031661045b565b604080519115158252519081900360200190f35b6100d4600480360360208110156101b857600080fd5b50356001600160a01b0316610479565b6100de6104e8565b6100d4600480360360208110156101e657600080fd5b503515156105f2565b61018e610697565b6001546001600160a01b0316331461020e57600080fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b15801561025857600080fd5b505afa15801561026c573d6000803e3d6000fd5b505050506040513d602081101561028257600080fd5b50516001546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905290519293506000929185169163a9059cbb9160448082019260209290919082900301818787803b1580156102df57600080fd5b505af11580156102f3573d6000803e3d6000fd5b505050506040513d602081101561030957600080fd5b505190508061031757600080fd5b505050565b6002546001600160a01b031690565b6001546001600160a01b031690565b6001546001600160a01b0316331461035157600080fd5b6040516001600160a01b0382169033907fe33f2276fe6ea8141b3855e68646ebcf09ec2df8768afe2a7bf153c9b10c273b90600090a3600280546001600160a01b0319166001600160a01b0392909216919091179055565b6542524f4e5a4560d01b90565b6001546001600160a01b031633146103cd57600080fd5b6001600160a01b03811660009081526020819052604090205460ff166103f257600080fd5b6002546040805163577756b360e11b81526001600160a01b03928316600482015290519183169163aeeead669160248082019260009290919082900301818387803b15801561044057600080fd5b505af1158015610454573d6000803e3d6000fd5b5050505050565b6001600160a01b031660009081526020819052604090205460ff1690565b6001546001600160a01b0316331461049057600080fd5b6040516001600160a01b0382169033907ff586fa6ee1fc42f5b727f3b214ccbd0b6d7e698c45d49ba32f224fbb8670155d90600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b600254600090600160a01b900460ff16610513576001546001600160a01b0316331461051357600080fd5b6000604051610521906106a7565b604051809103906000f08015801561053d573d6000803e3d6000fd5b506001600160a01b038116600081815260208190526040808220805460ff1916600117905551929350909133917f8ccec77b0cb63ac2cafd0f5de8cdfadab91ce656d262240ba8a6343bccc5f94591a3604080516392eefe9b60e01b815233600482015290516001600160a01b038316916392eefe9b91602480830192600092919082900301818387803b1580156105d457600080fd5b505af11580156105e8573d6000803e3d6000fd5b5092935050505090565b6001546001600160a01b03163314610641576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b604080518215158152905133917f3f7cb0f9d9d6328953db4b2e4654f86a01cb45ec1e39aa6665763281ddca54a7919081900360200190a260028054911515600160a01b0260ff60a01b19909216919091179055565b600254600160a01b900460ff1690565b614425806106b58339019056fe60c0604052601060808190527f437265616d20506f6f6c20546f6b656e0000000000000000000000000000000060a0908152620000409160039190620000fe565b506040805180820190915260048082527f43525054000000000000000000000000000000000000000000000000000000006020909201918252620000859181620000fe565b506005805460ff19166012179055348015620000a057600080fd5b50600680546005805462010000600160b01b031916336201000081029190911790915564e8d4a510006007556702c68af0bb1400006008556001600160a01b03199091161760ff60a01b191690556009805460ff19169055620001a3565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200014157805160ff191683800117855562000171565b8280016001018555821562000171579182015b828111156200017157825182559160200191906001019062000154565b506200017f92915062000183565b5090565b620001a091905b808211156200017f57600081556001016200018a565b90565b61427280620001b36000396000f3fe608060405234801561001057600080fd5b506004361061039d5760003560e01c806392eefe9b116101eb578063bc694ea211610110578063dd62ed3e116100a8578063dd62ed3e14610c51578063e4a28a52146104fd578063e4e1e53814610c7f578063eb9253c014610cb1578063ec09302114610cdd578063f1b8a9b714610ce5578063f8b2cb4f14610d0b578063f8d6aed414610d31578063fde924f714610d6c5761039d565b8063bc694ea214610b7f578063be3bbd2e14610b87578063c36596a614610571578063c6580d1214610bdf578063cc77828d14610be7578063cd2ed8fb14610bef578063cf5e7bd314610bf7578063d4cadf6814610c1d578063d73dd62314610c255761039d565b8063a9059cbb11610183578063a9059cbb14610a40578063aeeead6614610a6c578063b02f0b7314610a92578063b0e0d13614610b07578063b4a8e10114610b0f578063b7b800a414610b2c578063ba019dab14610b34578063ba9530a614610b3c578063bc063e1a14610b775761039d565b806392eefe9b1461098f578063936c3477146109b55780639381cd2b146109bd57806393c88d14146109c5578063948d8ce6146109cd57806395d89b41146109f3578063992e2a92146109fb5780639a86139b14610a03578063a221ee4914610a0b5761039d565b806346ab38f1116102d15780636d0800bc116102695780636d0800bc1461084a57806370a082311461087057806376c7a3c7146108965780637c5e9ea41461089e5780638201aa3f146108de578063867378c51461091e57806389298012146109265780638c28cbe8146109615780638d4e4083146109875761039d565b806346ab38f1146106a957806349b59552146106db5780634bb278f3146106fa5780634d2fd81d146107025780634f69c0d41461070a5780635c1bbaf71461077f5780635db34277146107ba57806366188463146107ec5780636d06dfa0146108185761039d565b8063189d00ca11610344578063189d00ca14610569578063218b53821461057157806321abba011461057957806323b872dd146105ba5780632f37b624146105f05780633018205f14610616578063313ce5671461063a57806334e19907146106585780633fdddaa2146106775761039d565b8063024eb2e3146103a257806302c96748146103fc57806306fdde0314610440578063095ea7b3146104bd57806309a3bbe4146104fd5780631446a7ff1461050557806315e84af91461053357806318160ddd14610561575b600080fd5b6103e3600480360360e08110156103b857600080fd5b5080359060208101359060408101359060608101359060808101359060a08101359060c00135610d74565b6040805192835260208301919091528051918290030190f35b61042e6004803603606081101561041257600080fd5b506001600160a01b038135169060208101359060400135610e43565b60408051918252519081900360200190f35b610448611093565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561048257818101518382015260200161046a565b50505050905090810190601f1680156104af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104e9600480360360408110156104d357600080fd5b506001600160a01b038135169060200135611129565b604080519115158252519081900360200190f35b61042e61117e565b61042e6004803603604081101561051b57600080fd5b506001600160a01b038135811691602001351661118b565b61042e6004803603604081101561054957600080fd5b506001600160a01b038135811691602001351661123a565b61042e6112e0565b61042e6112e6565b61042e6112fa565b6103e3600480360360e081101561058f57600080fd5b5080359060208101359060408101359060608101359060808101359060a08101359060c00135611306565b6104e9600480360360608110156105d057600080fd5b506001600160a01b038135811691602081013590911690604001356113b3565b6104e96004803603602081101561060657600080fd5b50356001600160a01b03166114cd565b61061e6114eb565b604080516001600160a01b039092168252519081900360200190f35b610642611513565b6040805160ff9092168252519081900360200190f35b6106756004803603602081101561066e57600080fd5b503561151c565b005b6106756004803603606081101561068d57600080fd5b506001600160a01b0381351690602081013590604001356115ff565b61042e600480360360608110156106bf57600080fd5b506001600160a01b03813516906020810135906040013561183b565b610675600480360360208110156106f157600080fd5b50351515611a8f565b610675611b64565b61042e611c74565b6106756004803603604081101561072057600080fd5b81359190810190604081016020820135600160201b81111561074157600080fd5b82018360208201111561075357600080fd5b803590602001918460208302840111600160201b8311171561077457600080fd5b509092509050611c93565b61042e600480360360c081101561079557600080fd5b5080359060208101359060408101359060608101359060808101359060a00135611e5d565b61042e600480360360608110156107d057600080fd5b506001600160a01b038135169060208101359060400135611f10565b6104e96004803603604081101561080257600080fd5b506001600160a01b038135169060200135612117565b61042e6004803603606081101561082e57600080fd5b506001600160a01b0381351690602081013590604001356121ef565b61042e6004803603602081101561086057600080fd5b50356001600160a01b0316612407565b61042e6004803603602081101561088657600080fd5b50356001600160a01b0316612419565b61042e612434565b6103e3600480360360a08110156108b457600080fd5b506001600160a01b0381358116916020810135916040820135169060608101359060800135612446565b6103e3600480360360a08110156108f457600080fd5b506001600160a01b038135811691602081013591604082013516906060810135906080013561273b565b61042e612a15565b61042e600480360360c081101561093c57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135612a29565b6106756004803603602081101561097757600080fd5b50356001600160a01b0316612ad9565b6104e9612c1f565b610675600480360360208110156109a557600080fd5b50356001600160a01b0316612c28565b61042e612cf3565b61042e612d12565b61042e612d1f565b61042e600480360360208110156109e357600080fd5b50356001600160a01b0316612d2f565b610448612d8b565b61042e612dec565b61042e612df8565b61042e600480360360a0811015610a2157600080fd5b5080359060208101359060408101359060608101359060800135612e05565b6104e960048036036040811015610a5657600080fd5b506001600160a01b038135169060200135612e6a565b61067560048036036020811015610a8257600080fd5b50356001600160a01b0316612e80565b61067560048036036040811015610aa857600080fd5b81359190810190604081016020820135600160201b811115610ac957600080fd5b820183602082011115610adb57600080fd5b803590602001918460208302840111600160201b83111715610afc57600080fd5b509092509050612fc6565b61042e6131dd565b61067560048036036020811015610b2557600080fd5b50356131e2565b61042e6132b3565b61042e6132b8565b61042e600480360360c0811015610b5257600080fd5b5080359060208101359060408101359060608101359060808101359060a001356132bd565b61042e61333e565b61042e61334e565b610b8f61335a565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610bcb578181015183820152602001610bb3565b505050509050019250505060405180910390f35b61042e6133e0565b610b8f6133e5565b61042e6133fd565b61067560048036036020811015610c0d57600080fd5b50356001600160a01b0316613403565b61042e61369f565b6104e960048036036040811015610c3b57600080fd5b506001600160a01b0381351690602001356136be565b61042e60048036036040811015610c6757600080fd5b506001600160a01b038135811691602001351661373f565b61067560048036036060811015610c9557600080fd5b506001600160a01b03813516906020810135906040013561376a565b61067560048036036040811015610cc757600080fd5b506001600160a01b0381351690602001356138d9565b61042e613a3d565b61042e60048036036020811015610cfb57600080fd5b50356001600160a01b0316613a4d565b61042e60048036036020811015610d2157600080fd5b50356001600160a01b0316613abb565b61042e600480360360c0811015610d4757600080fd5b5080359060208101359060408101359060608101359060808101359060a00135613b17565b6104e9613b9a565b6000806000610d838988613baa565b90506000610da2610d9c670de0b6b3a764000084613c10565b87613c36565b90506000610dc188610dbc670de0b6b3a764000085613c10565b613baa565b9050610dce818988613c82565b93506000610ddc8d83613c10565b90506000610dea828f613baa565b90506000610df88287613ccd565b90506000610e06828f613c36565b90506000610e148f83613c10565b9050610e2d81610dbc670de0b6b3a76400006000613c10565b9950505050505050505097509795505050505050565b6000336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615610ebb57600080fd5b6005805461ff00191661010017905560095460ff16610ed957600080fd5b6001600160a01b0384166000908152600b602052604090205460ff16610efe57600080fd5b6001600160a01b0384166000908152600b60205260409020600390810154610f3391670de0b6b3a76400005b04600101613c36565b831115610f3f57600080fd5b6000600b6000866001600160a01b03166001600160a01b0316815260200190815260200160002090506000610f8982600301548360020154600254600d5489600754600854610d74565b909350905082610f9857600080fd5b83831115610fa557600080fd5b610fbc610fb6836003015487613c10565b82613c10565b60038301556000610fcd8482613c36565b6040805188815290519192506001600160a01b0389169133916000805160206141fe833981519152919081900360200190a36001600160a01b0387166000908152600c60205260409020546110229083613d5a565b6001600160a01b0388166000908152600c60205260409020556110453385613d6c565b6110576110528583613c10565b613d7a565b600554611073906201000090046001600160a01b031682613d86565b61107e873388613d90565b5050506005805461ff00191690559392505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561111f5780601f106110f45761010080835404028352916020019161111f565b820191906000526020600020905b81548152906001019060200180831161110257829003601f168201915b5050505050905090565b3360008181526001602090815260408083206001600160a01b0387168085529083528184208690558151868152915193949093909260008051602061421e833981519152928290030190a35060015b92915050565b6802b5e3af16b188000081565b600554600090610100900460ff16156111a357600080fd5b6001600160a01b0383166000908152600b602052604090205460ff166111c857600080fd5b6001600160a01b0382166000908152600b602052604090205460ff166111ed57600080fd5b6001600160a01b038084166000908152600b602052604080822092851682528120600380840154600280860154928401549084015493946112319492939290612e05565b95945050505050565b600554600090610100900460ff161561125257600080fd5b6001600160a01b0383166000908152600b602052604090205460ff1661127757600080fd5b6001600160a01b0382166000908152600b602052604090205460ff1661129c57600080fd5b6001600160a01b038084166000908152600b602052604080822092851682529020600380830154600280850154928401549084015460075461123194929190612e05565b60025490565b6402540be400670de0b6b3a76400005b0481565b670de0b6b3a764000081565b60008060006113158988613baa565b9050600061132e610d9c670de0b6b3a764000084613c10565b9050600061134d88611348670de0b6b3a764000085613c10565b613c36565b905061135a888288613c82565b935060006113688d83613d5a565b90506000611376828f613baa565b905060006113848287613ccd565b90506000611392828f613c36565b905061139e818f613c10565b98505050505050505097509795505050505050565b6000336001600160a01b03851614806113ef57506001600160a01b03841660009081526001602090815260408083203384529091529020548211155b6113f857600080fd5b611403848484613e21565b336001600160a01b0385161480159061144157506001600160a01b038416600090815260016020908152604080832033845290915290205460001914155b156114c3576001600160a01b03841660009081526001602090815260408083203384529091529020546114749083613c10565b6001600160a01b038581166000908152600160209081526040808320338085529083529281902085905580519485525192871693919260008051602061421e8339815191529281900390910190a35b5060019392505050565b6001600160a01b03166000908152600b602052604090205460ff1690565b600554600090610100900460ff161561150357600080fd5b506006546001600160a01b031690565b60055460ff1690565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561159257600080fd5b6005805461ff00191661010017905560095460ff16156115b157600080fd5b6006546001600160a01b031633146115c857600080fd5b64e8d4a510008110156115da57600080fd5b67016345785d8a00008111156115ef57600080fd5b6007556005805461ff0019169055565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561167557600080fd5b6005805461ff001916610100179055600654336001600160a01b039091161461169d57600080fd5b6001600160a01b0383166000908152600b602052604090205460ff166116c257600080fd5b60095460ff16156116d257600080fd5b670de0b6b3a76400008110156116e757600080fd5b6802b5e3af16b18800008111156116fd57600080fd5b620f424082101561170d57600080fd5b6001600160a01b0383166000908152600b60205260409020600201548082111561176557611746600d546117418484613c10565b613d5a565b600d8190556802b5e3af16b1880000101561176057600080fd5b611786565b8082101561178657611782600d5461177d8385613c10565b613c10565b600d555b6001600160a01b0384166000908152600b6020526040902060028101839055600301805490849055808411156117cf576117ca85336117c58785613c10565b613ee0565b611829565b808410156118295760006117e38286613c10565b905060006117f2826000613c36565b905061180887336118038585613c10565b613d90565b6005546118269088906201000090046001600160a01b031683613d90565b50505b50506005805461ff0019169055505050565b6000336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156118b357600080fd5b6005805461ff00191661010017905560095460ff166118d157600080fd5b6001600160a01b0384166000908152600b602052604090205460ff166118f657600080fd5b6001600160a01b0384166000908152600b6020526040902060038101546002808301549054600d5460075461193094939291908990612a29565b91508282101561193f57600080fd5b6001600160a01b0385166000908152600b6020526040902060039081015461196f91670de0b6b3a7640000610f2a565b82111561197b57600080fd5b600061199882600301548360020154600254600d54896000612a29565b905060006119a98285600854613c82565b90506119bc610fb6846003015486613c10565b600384015560006119cd8782613c36565b6040805187815290519192506001600160a01b038a169133916000805160206141fe833981519152919081900360200190a36001600160a01b0388166000908152600c6020526040902054611a229083613d5a565b6001600160a01b0389166000908152600c6020526040902055611a453388613d6c565b611a526110528883613c10565b600554611a6e906201000090046001600160a01b031682613d86565b611a79883387613d90565b505050506005805461ff00191690559392505050565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611b0557600080fd5b6005805461ff00191661010017905560095460ff1615611b2457600080fd5b6006546001600160a01b03163314611b3b57600080fd5b60068054911515600160a01b0260ff60a01b199092169190911790556005805461ff0019169055565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611bda57600080fd5b6005805461ff001916610100179055600654336001600160a01b0390911614611c0257600080fd5b60095460ff1615611c1257600080fd5b600a5460021115611c2257600080fd5b6009805460ff191660011790556006805460ff60a01b1916600160a01b179055611c5468056bc75e2d63100000613f39565b611c673368056bc75e2d63100000613d86565b6005805461ff0019169055565b600554600090610100900460ff1615611c8c57600080fd5b5060085490565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611d0957600080fd5b6005805461ff00191661010017905560095460ff16611d2757600080fd5b6000611d316112e0565b90506000611d3f8583613baa565b905080611d4b57600080fd5b60005b600a54811015611e49576000600a8281548110611d6757fe5b60009182526020808320909101546001600160a01b0316808352600b909152604082206003015490925090611d9c8583613c36565b905080611da857600080fd5b878785818110611db457fe5b90506020020135811115611dc757600080fd5b6001600160a01b0383166000908152600b6020526040902060030154611ded9082613d5a565b6001600160a01b0384166000818152600b60209081526040918290206003019390935580518481529051919233926000805160206141be8339815191529281900390910190a3611e3e833383613ee0565b505050600101611d4e565b50611e5385613f39565b6118293386613d86565b600080611e6a8786613baa565b90506000611e788786613d5a565b90506000611e868289613baa565b90506000611e9c670de0b6b3a764000085613baa565b90506000611eaa8383613ccd565b90506000611eb8828e613c36565b90506000611ec6828f613c10565b90506000611ee5611edf670de0b6b3a76400008a613c10565b8b613c36565b9050611efd82610dbc670de0b6b3a764000084613c10565b9f9e505050505050505050505050505050565b6000336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611f8857600080fd5b6005805461ff00191661010017905560095460ff16611fa657600080fd5b6001600160a01b0384166000908152600b602052604090205460ff16611fcb57600080fd5b6001600160a01b0384166000908152600b6020526040902060030154611ffd906002670de0b6b3a76400005b04613c36565b83111561200957600080fd5b6000600b6000866001600160a01b03166001600160a01b031681526020019081526020016000209050600061205382600301548360020154600254600d5489600754600854611306565b90935090508383101561206557600080fd5b612076610fb6836003015487613d5a565b60038301556040805186815290516001600160a01b0388169133916000805160206141be8339815191529181900360200190a36001600160a01b0386166000908152600c60205260409020546120cc9082613d5a565b6001600160a01b0387166000908152600c60205260409020556120ee83613f39565b6120f83384613d86565b612103863387613ee0565b50506005805461ff00191690559392505050565b3360009081526001602090815260408083206001600160a01b03861684529091528120548083111561216c573360009081526001602090815260408083206001600160a01b038816845290915281205561219b565b6121768184613c10565b3360009081526001602090815260408083206001600160a01b03891684529091529020555b3360008181526001602090815260408083206001600160a01b03891680855290835292819020548151908152905192939260008051602061421e833981519152929181900390910190a35060019392505050565b6000336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561226757600080fd5b6005805461ff00191661010017905560095460ff1661228557600080fd5b6001600160a01b0384166000908152600b602052604090205460ff166122aa57600080fd5b6001600160a01b0384166000908152600b6020526040902060038101546002808301549054600d546007546122e494939291908990611e5d565b9150816122f057600080fd5b828211156122fd57600080fd5b6001600160a01b0385166000908152600b602052604090206003015461232d906002670de0b6b3a7640000611ff7565b82111561233957600080fd5b600061235682600301548360020154600254600d54896000611e5d565b905060006123678483600854613c82565b905061237a610fb6846003015486613d5a565b60038401556040805185815290516001600160a01b0389169133916000805160206141be8339815191529181900360200190a36001600160a01b0387166000908152600c60205260409020546123d09082613d5a565b6001600160a01b0388166000908152600c60205260409020556123f286613f39565b6123fc3387613d86565b61107e873386613ee0565b600c6020526000908152604090205481565b6001600160a01b031660009081526020819052604090205490565b620f4240670de0b6b3a76400006112f6565b60408051602080825236908201819052600092839233926001600160e01b03198535169285929081908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156124ad57600080fd5b6005805461ff0019166101001790556001600160a01b0387166000908152600b602052604090205460ff166124e157600080fd5b6001600160a01b0385166000908152600b602052604090205460ff1661250657600080fd5b600654600160a01b900460ff1661251c57600080fd5b6001600160a01b038088166000908152600b60205260408082209288168252902060038082015461255591670de0b6b3a7640000610f2a565b86111561256157600080fd5b60006125828360030154846002015484600301548560020154600754612e05565b90508581111561259157600080fd5b6125b183600301548460020154846003015485600201548b600754613b17565b9450888511156125c057600080fd5b60006125e184600301548560020154856003015486600201548c6000613b17565b905060006125f28783600854613c82565b9050612605610fb6866003015489613d5a565b856003018190555061261b84600301548a613c10565b60038086018290558601546002808801549087015460075461263e949190612e05565b95508286101561264d57600080fd5b8786111561265a57600080fd5b612664878a613baa565b83111561267057600080fd5b896001600160a01b03168c6001600160a01b0316336001600160a01b03167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d433788a8d604051808381526020018281526020019250505060405180910390a46001600160a01b038c166000908152600c60205260409020546126f09082613d5a565b6001600160a01b038d166000908152600c60205260409020556127148c3389613ee0565b61271f8a338b613d90565b50505050506005805461ff001916905590969095509350505050565b60408051602080825236908201819052600092839233926001600160e01b03198535169285929081908101848480828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156127a257600080fd5b6005805461ff0019166101001790556001600160a01b0387166000908152600b602052604090205460ff166127d657600080fd5b6001600160a01b0385166000908152600b602052604090205460ff166127fb57600080fd5b600654600160a01b900460ff1661281157600080fd5b6001600160a01b038088166000908152600b602052604080822092881682529020600382015461284b906002670de0b6b3a7640000611ff7565b88111561285757600080fd5b60006128788360030154846002015484600301548560020154600754612e05565b90508581111561288757600080fd5b6128a783600301548460020154846003015485600201548d6007546132bd565b9450868510156128b657600080fd5b60006128d784600301548560020154856003015486600201548e60006132bd565b905060006128e88288600854613c82565b90506128f885600301548c613d5a565b8560030181905550612911610fb6856003015489613c10565b600380860182905586015460028088015490870154600754612934949190612e05565b95508286101561294357600080fd5b8786111561295057600080fd5b61295a8b88613baa565b83111561296657600080fd5b896001600160a01b03168c6001600160a01b0316336001600160a01b03167f908fb5ee8f16c6bc9bc3690973819f32a4d4b10188134543c88706e0e1d433788e8b604051808381526020018281526020019250505060405180910390a46001600160a01b038a166000908152600c60205260409020546129e69082613d5a565b6001600160a01b038b166000908152600c6020526040902055612a0a8c338d613ee0565b61271f8a3389613d90565b64e8d4a51000670de0b6b3a76400006112f6565b600080612a368786613baa565b90506000612a5185611348670de0b6b3a76400006000613c10565b90506000612a5f8883613c10565b90506000612a6d828a613baa565b90506000612a8c82612a87670de0b6b3a764000088613baa565b613ccd565b90506000612a9a828e613c36565b90506000612aa88e83613c10565b90506000612ac1611edf670de0b6b3a76400008a613c10565b9050611efd82611348670de0b6b3a764000084613c10565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612b4f57600080fd5b6005805461ff0019166101001790556001600160a01b0381166000908152600b602052604090205460ff16612b8357600080fd5b604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b158015612bc957600080fd5b505afa158015612bdd573d6000803e3d6000fd5b505050506040513d6020811015612bf357600080fd5b50516001600160a01b039091166000908152600b60205260409020600301556005805461ff0019169055565b60095460ff1690565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612c9e57600080fd5b6005805461ff001916610100179055600654336001600160a01b0390911614612cc657600080fd5b600680546001600160a01b0319166001600160a01b03929092169190911790556005805461ff0019169055565b600554600090610100900460ff1615612d0b57600080fd5b50600d5490565b68056bc75e2d6310000081565b6005670de0b6b3a76400006112f6565b600554600090610100900460ff1615612d4757600080fd5b6001600160a01b0382166000908152600b602052604090205460ff16612d6c57600080fd5b506001600160a01b03166000908152600b602052604090206002015490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561111f5780601f106110f45761010080835404028352916020019161111f565b6704a03ce68d21555681565b6542524f4e5a4560d01b90565b600080612e128787613baa565b90506000612e208686613baa565b90506000612e2e8383613baa565b90506000612e50670de0b6b3a7640000610dbc670de0b6b3a764000089613c10565b9050612e5c8282613c36565b9a9950505050505050505050565b6000612e77338484613e21565b50600192915050565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612ef657600080fd5b6005805461010061ff001990911617908190556201000090046001600160a01b03163314612f2357600080fd5b60005b600a54811015612fb7576000600a8281548110612f3f57fe5b60009182526020808320909101546001600160a01b03908116808452600c835260408085208054959055805185815290519195508593928816927f261074971f6b45f02124a88c43d5c95e174626f867c87684fb60dbbe35ec2cd292918290030190a3612fad828583613d90565b5050600101612f26565b50506005805461ff0019169055565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561303c57600080fd5b6005805461ff00191661010017905560095460ff1661305a57600080fd5b60006130646112e0565b90506000613073856000613c36565b905060006130818683613c10565b9050600061308f8285613baa565b90508061309b57600080fd5b6130a53388613d6c565b6005546130c1906201000090046001600160a01b031684613d86565b6130ca82613d7a565b60005b600a548110156131c8576000600a82815481106130e657fe5b60009182526020808320909101546001600160a01b0316808352600b90915260408220600301549092509061311b8583613c36565b90508061312757600080fd5b89898581811061313357fe5b9050602002013581101561314657600080fd5b6001600160a01b0383166000908152600b602052604090206003015461316c9082613c10565b6001600160a01b0384166000818152600b60209081526040918290206003019390935580518481529051919233926000805160206141fe8339815191529281900390910190a36131bd833383613d90565b5050506001016130cd565b50506005805461ff0019169055505050505050565b600881565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561325857600080fd5b6005805461ff00191661010017905560095460ff161561327757600080fd5b6006546001600160a01b0316331461328e57600080fd5b670de0b6b3a76400008111156132a357600080fd5b6008556005805461ff0019169055565b600281565b600181565b6000806132ca8786613baa565b905060006132e0670de0b6b3a764000085613c10565b90506132ec8582613c36565b905060006132fe8a610dbc8c85613d5a565b9050600061330c8285613ccd565b90506000613322670de0b6b3a764000083613c10565b905061332e8a82613c36565b9c9b505050505050505050505050565b600a670de0b6b3a76400006112f6565b671bc16d674ec7ffff81565b600554606090610100900460ff161561337257600080fd5b60095460ff1661338157600080fd5b600a80548060200260200160405190810160405280929190818152602001828054801561111f57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116133b9575050505050905090565b600081565b600554606090610100900460ff161561338157600080fd5b600a5490565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561347957600080fd5b6005805461ff001916610100179055600654336001600160a01b03909116146134a157600080fd5b6001600160a01b0381166000908152600b602052604090205460ff166134c657600080fd5b60095460ff16156134d657600080fd5b6001600160a01b0381166000908152600b6020526040812060030154906134fd8282613c36565b600d546001600160a01b0385166000908152600b602052604090206002015491925061352891613c10565b600d556001600160a01b0383166000908152600b6020526040902060010154600a8054600019810191908290811061355c57fe5b600091825260209091200154600a80546001600160a01b03909216918490811061358257fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081600b6000600a85815481106135c257fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902060010155600a8054806135f557fe5b60008281526020808220600019908401810180546001600160a01b031916905590920190925560408051608081018252838152808301848152818301858152606083018681526001600160a01b038c168752600b909552929094209051815460ff1916901515178155925160018401555160028301555160039091015561368185336118038787613c10565b6005546118299086906201000090046001600160a01b031685613d90565b600554600090610100900460ff16156136b757600080fd5b5060075490565b3360009081526001602090815260408083206001600160a01b03861684529091528120546136ec9083613d5a565b3360008181526001602090815260408083206001600160a01b03891680855290835292819020859055805194855251919360008051602061421e833981519152929081900390910190a350600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a26006546001600160a01b031633146137e257600080fd5b6001600160a01b0383166000908152600b602052604090205460ff161561380857600080fd5b60095460ff161561381857600080fd5b600a5460081161382757600080fd5b604080516080810182526001808252600a805460208085019182526000858701818152606087018281526001600160a01b038c16808452600b9094529782209651875460ff1916901515178755925186860155915160028601559451600390940193909355805491820181559091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b03191690911790556138d48383836115ff565b505050565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561394f57600080fd5b6005805461ff001916610100179055600654336001600160a01b039091161461397757600080fd5b6001600160a01b0382166000908152600b602052604090205460ff161561399d57600080fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b038516916370a0823191602480820192602092909190829003018186803b1580156139e757600080fd5b505afa1580156139fb573d6000803e3d6000fd5b505050506040513d6020811015613a1157600080fd5b5051905080821115613a2257600080fd5b613a2d833384613d90565b50506005805461ff001916905550565b6002670de0b6b3a76400006112f6565b600554600090610100900460ff1615613a6557600080fd5b6001600160a01b0382166000908152600b602052604090205460ff16613a8a57600080fd5b6001600160a01b0382166000908152600b6020526040902060020154600d54613ab4908290613baa565b9392505050565b600554600090610100900460ff1615613ad357600080fd5b6001600160a01b0382166000908152600b602052604090205460ff16613af857600080fd5b506001600160a01b03166000908152600b602052604090206003015490565b600080613b248588613baa565b90506000613b328786613c10565b90506000613b408883613baa565b90506000613b4e8285613ccd565b9050613b6281670de0b6b3a7640000613c10565b9050613b76670de0b6b3a764000087613c10565b9450613b8b613b858c83613c36565b86613baa565b9b9a5050505050505050505050565b600654600160a01b900460ff1690565b600081613bb657600080fd5b670de0b6b3a76400008302831580613bde5750670de0b6b3a7640000848281613bdb57fe5b04145b613be757600080fd5b60028304810181811015613bfa57600080fd5b6000848281613c0557fe5b049695505050505050565b6000806000613c1f8585613f42565b915091508015613c2e57600080fd5b509392505050565b6000828202831580613c50575082848281613c4d57fe5b04145b613c5957600080fd5b6706f05b59d3b20000810181811015613c7157600080fd5b6000670de0b6b3a764000082613c05565b600082841015613c9157600080fd5b670de0b6b3a7640000821115613ca657600080fd5b6000613cb28585613c10565b9050613cbe8184613c36565b915081811015613c2e57600080fd5b60006001831015613cdd57600080fd5b671bc16d674ec7ffff831115613cf257600080fd5b6000613cfd83613f67565b90506000613d0b8483613c10565b90506000613d2186613d1c85613f82565b613f90565b905081613d32579250611178915050565b6000613d4387846305f5e100613fe7565b9050613d4f8282613c36565b979650505050505050565b600082820183811015613ab457600080fd5b613d7682826140c5565b5050565b613d83816140d0565b50565b613d76828261414f565b6040805163a9059cbb60e01b81526001600160a01b03848116600483015260248201849052915160009286169163a9059cbb91604480830192602092919082900301818787803b158015613de357600080fd5b505af1158015613df7573d6000803e3d6000fd5b505050506040513d6020811015613e0d57600080fd5b5051905080613e1b57600080fd5b50505050565b6001600160a01b038316600090815260208190526040902054811115613e4657600080fd5b6001600160a01b038316600090815260208190526040902054613e699082613c10565b6001600160a01b038085166000908152602081905260408082209390935590841681522054613e989082613d5a565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716926000805160206141de83398151915292918290030190a3505050565b604080516323b872dd60e01b81526001600160a01b0384811660048301523060248301526044820184905291516000928616916323b872dd91606480830192602092919082900301818787803b158015613de357600080fd5b613d838161415a565b600080828410613f585750508082036000613f60565b505081810360015b9250929050565b6000670de0b6b3a7640000613f7b83613f82565b0292915050565b670de0b6b3a7640000900490565b60008060028306613fa957670de0b6b3a7640000613fab565b835b90506002830492505b8215613ab457613fc48485613c36565b93506002830615613fdc57613fd98185613c36565b90505b600283049250613fb4565b6000828180613ffe87670de0b6b3a7640000613f42565b9092509050670de0b6b3a764000080600060015b8884106140b6576000670de0b6b3a7640000820290506000806140468a61404185670de0b6b3a7640000613c10565b613f42565b9150915061405887611348848c613c36565b96506140648784613baa565b965086614073575050506140b6565b871561407d579315935b8015614087579315935b841561409e576140978688613c10565b95506140ab565b6140a88688613d5a565b95505b505050600101614012565b50909998505050505050505050565b613d76823083613e21565b306000908152602081905260409020548111156140ec57600080fd5b306000908152602081905260409020546141069082613c10565b306000908152602081905260409020556002546141239082613c10565b60025560408051828152905160009130916000805160206141de8339815191529181900360200190a350565b613d76308383613e21565b306000908152602081905260409020546141749082613d5a565b306000908152602081905260409020556002546141919082613d5a565b60025560408051828152905130916000916000805160206141de8339815191529181900360200190a35056fe63982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39addf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efe74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a265627a7a72315820993ab7d9193add493b90f3fbc114d124f2515ee3286bb646c67d794789a25cb064736f6c634300050c0032a265627a7a72315820cb0369d6143ed4b10593b35c8ff05cad309100d432356dce6ff76e24df7c567c64736f6c634300050c0032
Deployed Bytecode Sourcemap
782:2565:2:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;782:2565:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2899:238;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2899:238:2;-1:-1:-1;;;;;2899:238:2;;:::i;:::-;;2579:122;;;:::i;:::-;;;;-1:-1:-1;;;;;2579:122:2;;;;;;;;;;;;;;2310:102;;;:::i;2707:186::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2707:186:2;-1:-1:-1;;;;;2707:186:2;;:::i;795:117:0:-;;;:::i;:::-;;;;;;;;;;;;;;;;3143:202:2;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3143:202:2;-1:-1:-1;;;;;3143:202:2;;:::i;1254:104::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1254:104:2;-1:-1:-1;;;;;1254:104:2;;:::i;:::-;;;;;;;;;;;;;;;;;;2418:155;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2418:155:2;-1:-1:-1;;;;;2418:155:2;;:::i;1364:354::-;;;:::i;2096:208::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2096:208:2;;;;:::i;1967:123::-;;;:::i;2899:238::-;2982:6;;-1:-1:-1;;;;;2982:6:2;2968:10;:20;2960:29;;;;;;3016:37;;;-1:-1:-1;;;3016:37:2;;3047:4;3016:37;;;;;;2999:14;;-1:-1:-1;;;;;3016:22:2;;;;;:37;;;;;;;;;;;;;;;:22;:37;;;5:2:-1;;;;30:1;27;20:12;5:2;3016:37:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3016:37:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3016:37:2;3089:6;;3075:32;;;-1:-1:-1;;;3075:32:2;;-1:-1:-1;;;;;3089:6:2;;;3075:32;;;;;;;;;;;;3016:37;;-1:-1:-1;3063:9:2;;3075:13;;;;;;:32;;;;;3016:37;;3075:32;;;;;;;;3063:9;3075:13;:32;;;5:2:-1;;;;30:1;27;20:12;5:2;3075:32:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3075:32:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3075:32:2;;-1:-1:-1;3075:32:2;3117:13;;;;;;2899:238;;;:::o;2579:122::-;2678:16;;-1:-1:-1;;;;;2678:16:2;2579:122;:::o;2310:102::-;2399:6;;-1:-1:-1;;;;;2399:6:2;2310:102;:::o;2707:186::-;2799:6;;-1:-1:-1;;;;;2799:6:2;2785:10;:20;2777:29;;;;;;2821:35;;-1:-1:-1;;;;;2821:35:2;;;2842:10;;2821:35;;;;;2866:16;:20;;-1:-1:-1;;;;;;2866:20:2;-1:-1:-1;;;;;2866:20:2;;;;;;;;;;2707:186::o;795:117:0:-;-1:-1:-1;;;795:117:0;:::o;3143:202:2:-;3238:6;;-1:-1:-1;;;;;3238:6:2;3224:10;:20;3216:29;;;;;;-1:-1:-1;;;;;3263:23:2;;:8;:23;;;;;;;;;;;;;3255:32;;;;;;3321:16;;3297:41;;;-1:-1:-1;;;3297:41:2;;-1:-1:-1;;;;;3321:16:2;;;3297:41;;;;;;:23;;;;;;:41;;;;;3321:16;;3297:41;;;;;;;;3321:16;3297:23;:41;;;5:2:-1;;;;30:1;27;20:12;5:2;3297:41:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3297:41:2;;;;3143:202;:::o;1254:104::-;-1:-1:-1;;;;;1340:11:2;1313:4;1340:11;;;;;;;;;;;;;;1254:104::o;2418:155::-;2500:6;;-1:-1:-1;;;;;2500:6:2;2486:10;:20;2478:29;;;;;;2522:24;;-1:-1:-1;;;;;2522:24:2;;;2532:10;;2522:24;;;;;2556:6;:10;;-1:-1:-1;;;;;;2556:10:2;-1:-1:-1;;;;;2556:10:2;;;;;;;;;;2418:155::o;1364:354::-;1444:18;;1418:5;;-1:-1:-1;;;1444:18:2;;;;1439:79;;1500:6;;-1:-1:-1;;;;;1500:6:2;1486:10;:20;1478:29;;;;;;1527:11;1541;;;;;:::i;:::-;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;;;;;1562:24:2;;:8;:24;;;;;;;;;;;:31;;-1:-1:-1;;1562:31:2;1589:4;1562:31;;;1608:40;1527:25;;-1:-1:-1;1562:24:2;;1621:10;;1608:40;;;1658:31;;;-1:-1:-1;;;1658:31:2;;1678:10;1658:31;;;;;;-1:-1:-1;;;;;1658:19:2;;;;;:31;;;;;-1:-1:-1;;1658:31:2;;;;;;;-1:-1:-1;1658:19:2;:31;;;5:2:-1;;;;30:1;27;20:12;5:2;1658:31:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;1706:5:2;;-1:-1:-1;;;;1364:354:2;:::o;2096:208::-;2187:6;;-1:-1:-1;;;;;2187:6:2;2173:10;:20;2165:46;;;;;-1:-1:-1;;;2165:46:2;;;;;;;;;;;;-1:-1:-1;;;2165:46:2;;;;;;;;;;;;;;;2226:39;;;;;;;;;;2251:10;;2226:39;;;;;;;;;;2275:18;:22;;;;;-1:-1:-1;;;2275:22:2;-1:-1:-1;;;;2275:22:2;;;;;;;;;2096:208::o;1967:123::-;2065:18;;-1:-1:-1;;;2065:18:2;;;;;1967:123::o;782:2565::-;;;;;;;;:::o
Swarm Source
bzzr://cb0369d6143ed4b10593b35c8ff05cad309100d432356dce6ff76e24df7c567c
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.