ETH Price: $3,250.34 (+3.00%)
Gas: 1.28 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
XMath

Compiler Version
v0.5.17+commit.d19bba13

Optimization Enabled:
Yes with 200 runs

Other Settings:
istanbul EvmVersion, None license
/**
 *Submitted for verification at Etherscan.io on 2021-03-13
*/

// File: contracts/lib/XNum.sol

pragma solidity 0.5.17;

library XNum {
    uint256 public constant BONE = 10**18;
    uint256 public constant MIN_BPOW_BASE = 1 wei;
    uint256 public constant MAX_BPOW_BASE = (2 * BONE) - 1 wei;
    uint256 public constant BPOW_PRECISION = BONE / 10**10;

    function btoi(uint256 a) internal pure returns (uint256) {
        return a / BONE;
    }

    function bfloor(uint256 a) internal pure returns (uint256) {
        return btoi(a) * BONE;
    }

    function badd(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "ERR_ADD_OVERFLOW");
        return c;
    }

    function bsub(uint256 a, uint256 b) internal pure returns (uint256) {
        (uint256 c, bool flag) = bsubSign(a, b);
        require(!flag, "ERR_SUB_UNDERFLOW");
        return c;
    }

    function bsubSign(uint256 a, uint256 b)
        internal
        pure
        returns (uint256, bool)
    {
        if (a >= b) {
            return (a - b, false);
        } else {
            return (b - a, true);
        }
    }

    function bmul(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c0 = a * b;
        require(a == 0 || c0 / a == b, "ERR_MUL_OVERFLOW");
        uint256 c1 = c0 + (BONE / 2);
        require(c1 >= c0, "ERR_MUL_OVERFLOW");
        uint256 c2 = c1 / BONE;
        return c2;
    }

    function bdiv(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0, "ERR_DIV_ZERO");
        uint256 c0 = a * BONE;
        require(a == 0 || c0 / a == BONE, "ERR_DIV_INTERNAL"); // bmul overflow
        uint256 c1 = c0 + (b / 2);
        require(c1 >= c0, "ERR_DIV_INTERNAL"); //  badd require
        uint256 c2 = c1 / b;
        return c2;
    }

    // DSMath.wpow
    function bpowi(uint256 a, uint256 n) internal pure returns (uint256) {
        uint256 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(uint256 base, uint256 exp) internal pure returns (uint256) {
        require(base >= MIN_BPOW_BASE, "ERR_BPOW_BASE_TOO_LOW");
        require(base <= MAX_BPOW_BASE, "ERR_BPOW_BASE_TOO_HIGH");

        uint256 whole = bfloor(exp);
        uint256 remain = bsub(exp, whole);

        uint256 wholePow = bpowi(base, btoi(whole));

        if (remain == 0) {
            return wholePow;
        }

        uint256 partialResult = bpowApprox(base, remain, BPOW_PRECISION);
        return bmul(wholePow, partialResult);
    }

    function bpowApprox(
        uint256 base,
        uint256 exp,
        uint256 precision
    ) internal pure returns (uint256) {
        // term 0:
        uint256 a = exp;
        (uint256 x, bool xneg) = bsubSign(base, BONE);
        uint256 term = BONE;
        uint256 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 (uint256 i = 1; term >= precision; i++) {
            uint256 bigK = i * BONE;
            (uint256 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;
    }
}

// File: contracts/lib/XMath.sol

// 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.17;


library XMath {
    using XNum for uint256;

    uint256 public constant BONE = 10**18;
    uint256 public constant EXIT_ZERO_FEE = 0;

    /**********************************************************************************************
    // calcSpotPrice                                                                             //
    // sP = spotPrice                                                                            //
    // bI = tokenBalanceIn                ( bI / wI )         1                                  //
    // bO = tokenBalanceOut         sP =  -----------  *  ----------                             //
    // wI = tokenWeightIn                 ( bO / wO )     ( 1 - sF )                             //
    // wO = tokenWeightOut                                                                       //
    // sF = swapFee                                                                              //
    **********************************************************************************************/
    function calcSpotPrice(
        uint256 tokenBalanceIn,
        uint256 tokenWeightIn,
        uint256 tokenBalanceOut,
        uint256 tokenWeightOut,
        uint256 swapFee
    ) public pure returns (uint256 spotPrice) {
        uint256 numer = tokenBalanceIn.bdiv(tokenWeightIn);
        uint256 denom = tokenBalanceOut.bdiv(tokenWeightOut);
        uint256 ratio = numer.bdiv(denom);
        uint256 scale = BONE.bdiv(BONE.bsub(swapFee));
        return (spotPrice = ratio.bmul(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(
        uint256 tokenBalanceIn,
        uint256 tokenWeightIn,
        uint256 tokenBalanceOut,
        uint256 tokenWeightOut,
        uint256 tokenAmountIn,
        uint256 swapFee
    ) public pure returns (uint256 tokenAmountOut) {
        uint256 weightRatio;
        if (tokenWeightIn == tokenWeightOut) {
            weightRatio = 1 * BONE;
        } else if (tokenWeightIn >> 1 == tokenWeightOut) {
            weightRatio = 2 * BONE;
        } else {
            weightRatio = tokenWeightIn.bdiv(tokenWeightOut);
        }
        uint256 adjustedIn = BONE.bsub(swapFee);
        adjustedIn = tokenAmountIn.bmul(adjustedIn);
        uint256 y = tokenBalanceIn.bdiv(tokenBalanceIn.badd(adjustedIn));
        uint256 foo;
        if (tokenWeightIn == tokenWeightOut) {
            foo = y;
        } else if (tokenWeightIn >> 1 == tokenWeightOut) {
            foo = y.bmul(y);
        } else {
            foo = y.bpow(weightRatio);
        }
        uint256 bar = BONE.bsub(foo);
        tokenAmountOut = tokenBalanceOut.bmul(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(
        uint256 tokenBalanceIn,
        uint256 tokenWeightIn,
        uint256 tokenBalanceOut,
        uint256 tokenWeightOut,
        uint256 tokenAmountOut,
        uint256 swapFee
    ) public pure returns (uint256 tokenAmountIn) {
        uint256 weightRatio;
        if (tokenWeightOut == tokenWeightIn) {
            weightRatio = 1 * BONE;
        } else if (tokenWeightOut >> 1 == tokenWeightIn) {
            weightRatio = 2 * BONE;
        } else {
            weightRatio = tokenWeightOut.bdiv(tokenWeightIn);
        }
        uint256 diff = tokenBalanceOut.bsub(tokenAmountOut);
        uint256 y = tokenBalanceOut.bdiv(diff);
        uint256 foo;
        if (tokenWeightOut == tokenWeightIn) {
            foo = y;
        } else if (tokenWeightOut >> 1 == tokenWeightIn) {
            foo = y.bmul(y);
        } else {
            foo = y.bpow(weightRatio);
        }
        foo = foo.bsub(BONE);
        tokenAmountIn = BONE.bsub(swapFee);
        tokenAmountIn = tokenBalanceIn.bmul(foo).bdiv(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(
        uint256 tokenBalanceIn,
        uint256 tokenWeightIn,
        uint256 poolSupply,
        uint256 totalWeight,
        uint256 tokenAmountIn,
        uint256 swapFee
    ) public pure returns (uint256 poolAmountOut) {
        // 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);
        uint256 normalizedWeight = tokenWeightIn.bdiv(totalWeight);
        uint256 zaz = BONE.bsub(normalizedWeight).bmul(swapFee);
        uint256 tokenAmountInAfterFee = tokenAmountIn.bmul(BONE.bsub(zaz));

        uint256 newTokenBalanceIn = tokenBalanceIn.badd(tokenAmountInAfterFee);
        uint256 tokenInRatio = newTokenBalanceIn.bdiv(tokenBalanceIn);

        // uint newPoolSupply = (ratioTi ^ weightTi) * poolSupply;
        uint256 poolRatio = tokenInRatio.bpow(normalizedWeight);
        uint256 newPoolSupply = poolRatio.bmul(poolSupply);
        poolAmountOut = newPoolSupply.bsub(poolSupply);
        return poolAmountOut;
    }

    /**********************************************************************************************
    // 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(
        uint256 tokenBalanceOut,
        uint256 tokenWeightOut,
        uint256 poolSupply,
        uint256 totalWeight,
        uint256 poolAmountIn,
        uint256 swapFee
    ) public pure returns (uint256 tokenAmountOut) {
        uint256 normalizedWeight = tokenWeightOut.bdiv(totalWeight);
        // charge exit fee on the pool token side
        // pAiAfterExitFee = pAi*(1-exitFee)
        uint256 poolAmountInAfterExitFee =
            poolAmountIn.bmul(BONE.bsub(EXIT_ZERO_FEE));
        uint256 newPoolSupply = poolSupply.bsub(poolAmountInAfterExitFee);
        uint256 poolRatio = newPoolSupply.bdiv(poolSupply);

        // newBalTo = poolRatio^(1/weightTo) * balTo;
        uint256 tokenOutRatio = poolRatio.bpow(BONE.bdiv(normalizedWeight));
        uint256 newTokenBalanceOut = tokenOutRatio.bmul(tokenBalanceOut);

        uint256 tokenAmountOutBeforeSwapFee =
            tokenBalanceOut.bsub(newTokenBalanceOut);

        // charge swap fee on the output token side
        //uint tAo = tAoBeforeSwapFee * (1 - (1-weightTo) * swapFee)
        uint256 zaz = BONE.bsub(normalizedWeight).bmul(swapFee);
        tokenAmountOut = tokenAmountOutBeforeSwapFee.bmul(BONE.bsub(zaz));
        return tokenAmountOut;
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"BONE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"EXIT_ZERO_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenBalanceIn","type":"uint256"},{"internalType":"uint256","name":"tokenWeightIn","type":"uint256"},{"internalType":"uint256","name":"tokenBalanceOut","type":"uint256"},{"internalType":"uint256","name":"tokenWeightOut","type":"uint256"},{"internalType":"uint256","name":"tokenAmountOut","type":"uint256"},{"internalType":"uint256","name":"swapFee","type":"uint256"}],"name":"calcInGivenOut","outputs":[{"internalType":"uint256","name":"tokenAmountIn","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenBalanceIn","type":"uint256"},{"internalType":"uint256","name":"tokenWeightIn","type":"uint256"},{"internalType":"uint256","name":"tokenBalanceOut","type":"uint256"},{"internalType":"uint256","name":"tokenWeightOut","type":"uint256"},{"internalType":"uint256","name":"tokenAmountIn","type":"uint256"},{"internalType":"uint256","name":"swapFee","type":"uint256"}],"name":"calcOutGivenIn","outputs":[{"internalType":"uint256","name":"tokenAmountOut","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenBalanceIn","type":"uint256"},{"internalType":"uint256","name":"tokenWeightIn","type":"uint256"},{"internalType":"uint256","name":"poolSupply","type":"uint256"},{"internalType":"uint256","name":"totalWeight","type":"uint256"},{"internalType":"uint256","name":"tokenAmountIn","type":"uint256"},{"internalType":"uint256","name":"swapFee","type":"uint256"}],"name":"calcPoolOutGivenSingleIn","outputs":[{"internalType":"uint256","name":"poolAmountOut","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenBalanceOut","type":"uint256"},{"internalType":"uint256","name":"tokenWeightOut","type":"uint256"},{"internalType":"uint256","name":"poolSupply","type":"uint256"},{"internalType":"uint256","name":"totalWeight","type":"uint256"},{"internalType":"uint256","name":"poolAmountIn","type":"uint256"},{"internalType":"uint256","name":"swapFee","type":"uint256"}],"name":"calcSingleOutGivenPoolIn","outputs":[{"internalType":"uint256","name":"tokenAmountOut","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"tokenBalanceIn","type":"uint256"},{"internalType":"uint256","name":"tokenWeightIn","type":"uint256"},{"internalType":"uint256","name":"tokenBalanceOut","type":"uint256"},{"internalType":"uint256","name":"tokenWeightOut","type":"uint256"},{"internalType":"uint256","name":"swapFee","type":"uint256"}],"name":"calcSpotPrice","outputs":[{"internalType":"uint256","name":"spotPrice","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"}]

610bf5610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c8063a221ee4911610065578063a221ee491461011c578063ba9530a614610151578063c36596a61461018c578063f8d6aed41461019457610087565b806311b42b1e1461008c5780638656b653146100a657806389298012146100e1575b600080fd5b6100946101cf565b60408051918252519081900360200190f35b610094600480360360c08110156100bc57600080fd5b5080359060208101359060408101359060608101359060808101359060a001356101d4565b610094600480360360c08110156100f757600080fd5b5080359060208101359060408101359060608101359060808101359060a001356102b3565b610094600480360360a081101561013257600080fd5b50803590602081013590604081013590606081013590608001356103cb565b610094600480360360c081101561016757600080fd5b5080359060208101359060408101359060608101359060808101359060a0013561045a565b610094610577565b610094600480360360c08110156101aa57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135610583565b600081565b6000806101e7878663ffffffff61069d16565b9050600061021384610207670de0b6b3a76400008563ffffffff6107b216565b9063ffffffff61081416565b9050600061023f610232670de0b6b3a76400008463ffffffff6107b216565b879063ffffffff61081416565b905060006102538b8363ffffffff6108d616565b90506000610267828d63ffffffff61069d16565b9050600061027b828763ffffffff61092a16565b9050600061028f828d63ffffffff61081416565b90506102a1818d63ffffffff6107b216565b9e9d5050505050505050505050505050565b6000806102c6878663ffffffff61069d16565b905060006102f26102e5670de0b6b3a76400008363ffffffff6107b216565b869063ffffffff61081416565b90506000610306888363ffffffff6107b216565b9050600061031a828a63ffffffff61069d16565b90506000610346610339670de0b6b3a76400008763ffffffff61069d16565b839063ffffffff61092a16565b9050600061035a828e63ffffffff61081416565b9050600061036e8e8363ffffffff6107b216565b9050600061038e8a610207670de0b6b3a76400008b63ffffffff6107b216565b90506103b86103ab670de0b6b3a76400008363ffffffff6107b216565b839063ffffffff61081416565b9f9e505050505050505050505050505050565b6000806103de878763ffffffff61069d16565b905060006103f2868663ffffffff61069d16565b90506000610406838363ffffffff61069d16565b9050600061043a610425670de0b6b3a76400008863ffffffff6107b216565b670de0b6b3a76400009063ffffffff61069d16565b905061044c828263ffffffff61081416565b9a9950505050505050505050565b600080848714156104745750670de0b6b3a76400006104a2565b84600188901c141561048f5750671bc16d674ec800006104a2565b61049f878663ffffffff61069d16565b90505b60006104bc670de0b6b3a76400008563ffffffff6107b216565b90506104ce858263ffffffff61081416565b905060006104f26104e58b8463ffffffff6108d616565b8b9063ffffffff61069d16565b90506000878a141561050557508061053b565b8760018b901c141561052857610521828063ffffffff61081416565b905061053b565b610538828563ffffffff61092a16565b90505b6000610555670de0b6b3a76400008363ffffffff6107b216565b90506105678a8263ffffffff61081416565b9c9b505050505050505050505050565b670de0b6b3a764000081565b6000808685141561059d5750670de0b6b3a76400006105cb565b86600186901c14156105b85750671bc16d674ec800006105cb565b6105c8858863ffffffff61069d16565b90505b60006105dd878663ffffffff6107b216565b905060006105f1888363ffffffff61069d16565b905060008988141561060457508061063a565b89600189901c141561062757610620828063ffffffff61081416565b905061063a565b610637828563ffffffff61092a16565b90505b61065281670de0b6b3a764000063ffffffff6107b216565b905061066c670de0b6b3a76400008763ffffffff6107b216565b945061068e856106828d8463ffffffff61081416565b9063ffffffff61069d16565b9b9a5050505050505050505050565b6000816106e0576040805162461bcd60e51b815260206004820152600c60248201526b4552525f4449565f5a45524f60a01b604482015290519081900360640190fd5b670de0b6b3a764000083028315806107085750670de0b6b3a764000084828161070557fe5b04145b61074c576040805162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015290519081900360640190fd5b6002830481018181101561079a576040805162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015290519081900360640190fd5b60008482816107a557fe5b0493505050505b92915050565b60008060006107c18585610a38565b91509150801561080c576040805162461bcd60e51b81526020600482015260116024820152704552525f5355425f554e444552464c4f5760781b604482015290519081900360640190fd5b509392505050565b600082820283158061082e57508284828161082b57fe5b04145b610872576040805162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015290519081900360640190fd5b6706f05b59d3b200008101818110156108c5576040805162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015290519081900360640190fd5b6000670de0b6b3a7640000826107a5565b600082820183811015610923576040805162461bcd60e51b815260206004820152601060248201526f4552525f4144445f4f564552464c4f5760801b604482015290519081900360640190fd5b9392505050565b6000600183101561097a576040805162461bcd60e51b81526020600482015260156024820152744552525f42504f575f424153455f544f4f5f4c4f5760581b604482015290519081900360640190fd5b671bc16d674ec7ffff8311156109d0576040805162461bcd60e51b815260206004820152601660248201527508aa4a4be84a09eaebe8482a68abea89e9ebe90928e960531b604482015290519081900360640190fd5b60006109db83610a5d565b905060006109e984836107b2565b905060006109ff866109fa85610a78565b610a86565b905081610a105792506107ac915050565b6000610a2187846305f5e100610add565b9050610a2d8282610814565b979650505050505050565b600080828410610a4e5750508082036000610a56565b505081810360015b9250929050565b6000670de0b6b3a7640000610a7183610a78565b0292915050565b670de0b6b3a7640000900490565b60008060028306610a9f57670de0b6b3a7640000610aa1565b835b90506002830492505b821561092357610aba8485610814565b93506002830615610ad257610acf8185610814565b90505b600283049250610aaa565b6000828180610af487670de0b6b3a7640000610a38565b9092509050670de0b6b3a764000080600060015b888410610bb1576000670de0b6b3a764000082029050600080610b3c8a610b3785670de0b6b3a76400006107b2565b610a38565b91509150610b5387610b4e848c610814565b610814565b9650610b5f878461069d565b965086610b6e57505050610bb1565b8715610b78579315935b8015610b82579315935b8415610b9957610b9286886107b2565b9550610ba6565b610ba386886108d6565b95505b505050600101610b08565b5090999850505050505050505056fea265627a7a72315820c5e8ec304c6258c65f2d2a5060fdf9618db8d027e8ca585dfb166299c36bb06564736f6c63430005110032

Deployed Bytecode

0x734f8d1c6dabbb379134272cb1273638cc98212a4430146080604052600436106100875760003560e01c8063a221ee4911610065578063a221ee491461011c578063ba9530a614610151578063c36596a61461018c578063f8d6aed41461019457610087565b806311b42b1e1461008c5780638656b653146100a657806389298012146100e1575b600080fd5b6100946101cf565b60408051918252519081900360200190f35b610094600480360360c08110156100bc57600080fd5b5080359060208101359060408101359060608101359060808101359060a001356101d4565b610094600480360360c08110156100f757600080fd5b5080359060208101359060408101359060608101359060808101359060a001356102b3565b610094600480360360a081101561013257600080fd5b50803590602081013590604081013590606081013590608001356103cb565b610094600480360360c081101561016757600080fd5b5080359060208101359060408101359060608101359060808101359060a0013561045a565b610094610577565b610094600480360360c08110156101aa57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135610583565b600081565b6000806101e7878663ffffffff61069d16565b9050600061021384610207670de0b6b3a76400008563ffffffff6107b216565b9063ffffffff61081416565b9050600061023f610232670de0b6b3a76400008463ffffffff6107b216565b879063ffffffff61081416565b905060006102538b8363ffffffff6108d616565b90506000610267828d63ffffffff61069d16565b9050600061027b828763ffffffff61092a16565b9050600061028f828d63ffffffff61081416565b90506102a1818d63ffffffff6107b216565b9e9d5050505050505050505050505050565b6000806102c6878663ffffffff61069d16565b905060006102f26102e5670de0b6b3a76400008363ffffffff6107b216565b869063ffffffff61081416565b90506000610306888363ffffffff6107b216565b9050600061031a828a63ffffffff61069d16565b90506000610346610339670de0b6b3a76400008763ffffffff61069d16565b839063ffffffff61092a16565b9050600061035a828e63ffffffff61081416565b9050600061036e8e8363ffffffff6107b216565b9050600061038e8a610207670de0b6b3a76400008b63ffffffff6107b216565b90506103b86103ab670de0b6b3a76400008363ffffffff6107b216565b839063ffffffff61081416565b9f9e505050505050505050505050505050565b6000806103de878763ffffffff61069d16565b905060006103f2868663ffffffff61069d16565b90506000610406838363ffffffff61069d16565b9050600061043a610425670de0b6b3a76400008863ffffffff6107b216565b670de0b6b3a76400009063ffffffff61069d16565b905061044c828263ffffffff61081416565b9a9950505050505050505050565b600080848714156104745750670de0b6b3a76400006104a2565b84600188901c141561048f5750671bc16d674ec800006104a2565b61049f878663ffffffff61069d16565b90505b60006104bc670de0b6b3a76400008563ffffffff6107b216565b90506104ce858263ffffffff61081416565b905060006104f26104e58b8463ffffffff6108d616565b8b9063ffffffff61069d16565b90506000878a141561050557508061053b565b8760018b901c141561052857610521828063ffffffff61081416565b905061053b565b610538828563ffffffff61092a16565b90505b6000610555670de0b6b3a76400008363ffffffff6107b216565b90506105678a8263ffffffff61081416565b9c9b505050505050505050505050565b670de0b6b3a764000081565b6000808685141561059d5750670de0b6b3a76400006105cb565b86600186901c14156105b85750671bc16d674ec800006105cb565b6105c8858863ffffffff61069d16565b90505b60006105dd878663ffffffff6107b216565b905060006105f1888363ffffffff61069d16565b905060008988141561060457508061063a565b89600189901c141561062757610620828063ffffffff61081416565b905061063a565b610637828563ffffffff61092a16565b90505b61065281670de0b6b3a764000063ffffffff6107b216565b905061066c670de0b6b3a76400008763ffffffff6107b216565b945061068e856106828d8463ffffffff61081416565b9063ffffffff61069d16565b9b9a5050505050505050505050565b6000816106e0576040805162461bcd60e51b815260206004820152600c60248201526b4552525f4449565f5a45524f60a01b604482015290519081900360640190fd5b670de0b6b3a764000083028315806107085750670de0b6b3a764000084828161070557fe5b04145b61074c576040805162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015290519081900360640190fd5b6002830481018181101561079a576040805162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015290519081900360640190fd5b60008482816107a557fe5b0493505050505b92915050565b60008060006107c18585610a38565b91509150801561080c576040805162461bcd60e51b81526020600482015260116024820152704552525f5355425f554e444552464c4f5760781b604482015290519081900360640190fd5b509392505050565b600082820283158061082e57508284828161082b57fe5b04145b610872576040805162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015290519081900360640190fd5b6706f05b59d3b200008101818110156108c5576040805162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015290519081900360640190fd5b6000670de0b6b3a7640000826107a5565b600082820183811015610923576040805162461bcd60e51b815260206004820152601060248201526f4552525f4144445f4f564552464c4f5760801b604482015290519081900360640190fd5b9392505050565b6000600183101561097a576040805162461bcd60e51b81526020600482015260156024820152744552525f42504f575f424153455f544f4f5f4c4f5760581b604482015290519081900360640190fd5b671bc16d674ec7ffff8311156109d0576040805162461bcd60e51b815260206004820152601660248201527508aa4a4be84a09eaebe8482a68abea89e9ebe90928e960531b604482015290519081900360640190fd5b60006109db83610a5d565b905060006109e984836107b2565b905060006109ff866109fa85610a78565b610a86565b905081610a105792506107ac915050565b6000610a2187846305f5e100610add565b9050610a2d8282610814565b979650505050505050565b600080828410610a4e5750508082036000610a56565b505081810360015b9250929050565b6000670de0b6b3a7640000610a7183610a78565b0292915050565b670de0b6b3a7640000900490565b60008060028306610a9f57670de0b6b3a7640000610aa1565b835b90506002830492505b821561092357610aba8485610814565b93506002830615610ad257610acf8185610814565b90505b600283049250610aaa565b6000828180610af487670de0b6b3a7640000610a38565b9092509050670de0b6b3a764000080600060015b888410610bb1576000670de0b6b3a764000082029050600080610b3c8a610b3785670de0b6b3a76400006107b2565b610a38565b91509150610b5387610b4e848c610814565b610814565b9650610b5f878461069d565b965086610b6e57505050610bb1565b8715610b78579315935b8015610b82579315935b8415610b9957610b9286886107b2565b9550610ba6565b610ba386886108d6565b95505b505050600101610b08565b5090999850505050505050505056fea265627a7a72315820c5e8ec304c6258c65f2d2a5060fdf9618db8d027e8ca585dfb166299c36bb06564736f6c63430005110032

Deployed Bytecode Sourcemap

4724:10461:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4820:41;;;:::i;:::-;;;;;;;;;;;;;;;;11592:1175;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;11592:1175:0;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;13886:1296::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;13886:1296:0;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;5779:509::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;5779:509:0;;;;;;;;;;;;;;;;;;;;;;:::i;7306:1132::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;7306:1132:0;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;4776:37::-;;;:::i;9456:1118::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;9456:1118:0;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;4820:41::-;4860:1;4820:41;:::o;11592:1175::-;11836:21;;12145:31;:13;12164:11;12145:31;:18;:31;:::i;:::-;12118:58;-1:-1:-1;12187:11:0;12201:41;12234:7;12201:27;4807:6;12118:58;12201:27;:9;:27;:::i;:::-;:32;:41;:32;:41;:::i;:::-;12187:55;-1:-1:-1;12253:29:0;12285:34;12304:14;4807:6;12187:55;12304:14;:9;:14;:::i;:::-;12285:13;;:34;:18;:34;:::i;:::-;12253:66;-1:-1:-1;12332:25:0;12360:42;:14;12253:66;12360:42;:19;:42;:::i;:::-;12332:70;-1:-1:-1;12413:20:0;12436:38;12332:70;12459:14;12436:38;:22;:38;:::i;:::-;12413:61;-1:-1:-1;12555:17:0;12575:35;12413:61;12593:16;12575:35;:17;:35;:::i;:::-;12555:55;-1:-1:-1;12621:21:0;12645:26;12555:55;12660:10;12645:26;:14;:26;:::i;:::-;12621:50;-1:-1:-1;12698:30:0;12621:50;12717:10;12698:30;:18;:30;:::i;:::-;12682:46;11592:1175;-1:-1:-1;;;;;;;;;;;;;;11592:1175:0:o;13886:1296::-;14131:22;;14193:32;:14;14213:11;14193:32;:19;:32;:::i;:::-;14166:59;-1:-1:-1;14333:32:0;14381:43;14399:24;4807:6;14333:32;14399:24;:9;:24;:::i;:::-;14381:12;;:43;:17;:43;:::i;:::-;14333:91;-1:-1:-1;14435:21:0;14459:41;:10;14333:91;14459:41;:15;:41;:::i;:::-;14435:65;-1:-1:-1;14511:17:0;14531:30;14435:65;14550:10;14531:30;:18;:30;:::i;:::-;14511:50;-1:-1:-1;14629:21:0;14653:43;14668:27;4807:6;14678:16;14668:27;:9;:27;:::i;:::-;14653:9;;:43;:14;:43;:::i;:::-;14629:67;-1:-1:-1;14707:26:0;14736:35;14629:67;14755:15;14736:35;:18;:35;:::i;:::-;14707:64;-1:-1:-1;14784:35:0;14835:40;:15;14707:64;14835:40;:20;:40;:::i;:::-;14784:91;-1:-1:-1;15011:11:0;15025:41;15058:7;15025:27;4807:6;15035:16;15025:27;:9;:27;:::i;:41::-;15011:55;-1:-1:-1;15094:48:0;15127:14;4807:6;15011:55;15127:14;:9;:14;:::i;:::-;15094:27;;:48;:32;:48;:::i;:::-;15077:65;13886:1296;-1:-1:-1;;;;;;;;;;;;;;;13886:1296:0:o;5779:509::-;5988:17;;6034:34;:14;6054:13;6034:34;:19;:34;:::i;:::-;6018:50;-1:-1:-1;6079:13:0;6095:36;:15;6116:14;6095:36;:20;:36;:::i;:::-;6079:52;-1:-1:-1;6142:13:0;6158:17;:5;6079:52;6158:17;:10;:17;:::i;:::-;6142:33;-1:-1:-1;6186:13:0;6202:29;6212:18;4807:6;6222:7;6212:18;:9;:18;:::i;:::-;4807:6;;6202:29;:9;:29;:::i;:::-;6186:45;-1:-1:-1;6262:17:0;:5;6186:45;6262:17;:10;:17;:::i;:::-;6250:29;5779:509;-1:-1:-1;;;;;;;;;;5779:509:0:o;7306:1132::-;7548:22;7583:19;7634:14;7617:13;:31;7613:264;;;-1:-1:-1;4807:6:0;7613:264;;;7731:14;7726:1;7709:13;:18;;:36;7705:172;;;-1:-1:-1;7776:8:0;7705:172;;;7831:34;:13;7850:14;7831:34;:18;:34;:::i;:::-;7817:48;;7705:172;7887:18;7908;4807:6;7918:7;7908:18;:9;:18;:::i;:::-;7887:39;-1:-1:-1;7950:30:0;:13;7887:39;7950:30;:18;:30;:::i;:::-;7937:43;-1:-1:-1;7991:9:0;8003:52;8023:31;:14;7937:43;8023:31;:19;:31;:::i;:::-;8003:14;;:52;:19;:52;:::i;:::-;7991:64;;8066:11;8109:14;8092:13;:31;8088:219;;;-1:-1:-1;8146:1:0;8088:219;;;8191:14;8186:1;8169:13;:18;;:36;8165:142;;;8228:9;8235:1;;8228:9;:6;:9;:::i;:::-;8222:15;;8165:142;;;8276:19;:1;8283:11;8276:19;:6;:19;:::i;:::-;8270:25;;8165:142;8317:11;8331:14;4807:6;8341:3;8331:14;:9;:14;:::i;:::-;8317:28;-1:-1:-1;8373:25:0;:15;8317:28;8373:25;:20;:25;:::i;:::-;8356:42;7306:1132;-1:-1:-1;;;;;;;;;;;;7306:1132:0:o;4776:37::-;4807:6;4776:37;:::o;9456:1118::-;9699:21;9733:19;9785:13;9767:14;:31;9763:264;;;-1:-1:-1;4807:6:0;9763:264;;;9882:13;9877:1;9859:14;:19;;:36;9855:172;;;-1:-1:-1;9926:8:0;9855:172;;;9981:34;:14;10001:13;9981:34;:19;:34;:::i;:::-;9967:48;;9855:172;10037:12;10052:36;:15;10073:14;10052:36;:20;:36;:::i;:::-;10037:51;-1:-1:-1;10099:9:0;10111:26;:15;10037:51;10111:26;:20;:26;:::i;:::-;10099:38;;10148:11;10192:13;10174:14;:31;10170:219;;;-1:-1:-1;10228:1:0;10170:219;;;10274:13;10269:1;10251:14;:19;;:36;10247:142;;;10310:9;10317:1;;10310:9;:6;:9;:::i;:::-;10304:15;;10247:142;;;10358:19;:1;10365:11;10358:19;:6;:19;:::i;:::-;10352:25;;10247:142;10405:14;:3;4807:6;10405:14;:8;:14;:::i;:::-;10399:20;-1:-1:-1;10446:18:0;4807:6;10456:7;10446:18;:9;:18;:::i;:::-;10430:34;-1:-1:-1;10491:44:0;10430:34;10491:24;:14;10511:3;10491:24;:19;:24;:::i;:::-;:29;:44;:29;:44;:::i;:::-;10475:60;9456:1118;-1:-1:-1;;;;;;;;;;;9456:1118:0:o;1451:382::-;1510:7;1538:6;1530:31;;;;;-1:-1:-1;;;1530:31:0;;;;;;;;;;;;-1:-1:-1;;;1530:31:0;;;;;;;;;;;;;;;113:6;1585:8;;1612:6;;;:24;;;113:6;1627:1;1622:2;:6;;;;;;:14;1612:24;1604:53;;;;;-1:-1:-1;;;1604:53:0;;;;;;;;;;;;-1:-1:-1;;;1604:53:0;;;;;;;;;;;;;;;1708:1;1704:5;;1698:12;;1729:8;;;;1721:37;;;;;-1:-1:-1;;;1721:37:0;;;;;;;;;;;;-1:-1:-1;;;1721:37:0;;;;;;;;;;;;;;;1786:10;1804:1;1799:2;:6;;;;;;;-1:-1:-1;;;;1451:382:0;;;;;:::o;689:191::-;748:7;769:9;780;793:14;802:1;805;793:8;:14::i;:::-;768:39;;;;827:4;826:5;818:35;;;;;-1:-1:-1;;;818:35:0;;;;;;;;;;;;-1:-1:-1;;;818:35:0;;;;;;;;;;;;;;;-1:-1:-1;871:1:0;689:191;-1:-1:-1;;;689:191:0:o;1137:306::-;1196:7;1229:5;;;1253:6;;;:21;;;1273:1;1268;1263:2;:6;;;;;;:11;1253:21;1245:50;;;;;-1:-1:-1;;;1245:50:0;;;;;;;;;;;;-1:-1:-1;;;1245:50:0;;;;;;;;;;;;;;;1325:8;1319:15;;1353:8;;;;1345:37;;;;;-1:-1:-1;;;1345:37:0;;;;;;;;;;;;-1:-1:-1;;;1345:37:0;;;;;;;;;;;;;;;1393:10;113:6;1406:2;:9;;512:169;571:7;603:5;;;627:6;;;;619:35;;;;;-1:-1:-1;;;619:35:0;;;;;;;;;;;;-1:-1:-1;;;619:35:0;;;;;;;;;;;;;;;672:1;512:169;-1:-1:-1;;;512:169:0:o;2325:549::-;2389:7;166:5;2417:4;:21;;2409:55;;;;;-1:-1:-1;;;2409:55:0;;;;;;;;;;;;-1:-1:-1;;;2409:55:0;;;;;;;;;;;;;;;218:18;2483:21;;;2475:56;;;;;-1:-1:-1;;;2475:56:0;;;;;;;;;;;;-1:-1:-1;;;2475:56:0;;;;;;;;;;;;;;;2544:13;2560:11;2567:3;2560:6;:11::i;:::-;2544:27;;2582:14;2599:16;2604:3;2609:5;2599:4;:16::i;:::-;2582:33;;2628:16;2647:24;2653:4;2659:11;2664:5;2659:4;:11::i;:::-;2647:5;:24::i;:::-;2628:43;-1:-1:-1;2688:11:0;2684:59;;2723:8;-1:-1:-1;2716:15:0;;-1:-1:-1;;2716:15:0;2684:59;2755:21;2779:40;2790:4;2796:6;284:13;2779:10;:40::i;:::-;2755:64;;2837:29;2842:8;2852:13;2837:4;:29::i;:::-;2830:36;2325:549;-1:-1:-1;;;;;;;2325:549:0:o;888:241::-;978:7;987:4;1018:1;1013;:6;1009:113;;-1:-1:-1;;1044:5:0;;;1051;1036:21;;1009:113;-1:-1:-1;;1098:5:0;;;1105:4;1009:113;888:241;;;;;:::o;405:99::-;455:7;113:6;482:7;487:1;482:4;:7::i;:::-;:14;;405:99;-1:-1:-1;;405:99:0:o;306:91::-;113:6;381:8;;;306:91::o;1861:303::-;1921:7;;1957:1;1953;:5;:21;;113:6;1953:21;;;1966:1;1953:21;1941:33;-1:-1:-1;1997:1:0;1992:6;;;;1987:151;2000:6;;1987:151;;2035:10;2040:1;2043;2035:4;:10::i;:::-;2031:14;-1:-1:-1;2070:1:0;2066;:5;:10;2062:65;;2101:10;2106:1;2109;2101:4;:10::i;:::-;2097:14;;2062:65;2013:1;2008:6;;;;1987:151;;2882:1114;3005:7;3057:3;3005:7;;3096:20;3105:4;113:6;3096:8;:20::i;:::-;3071:45;;-1:-1:-1;3071:45:0;-1:-1:-1;113:6:0;;3127:12;3465:1;3448:518;3476:9;3468:4;:17;3448:518;;3507:12;113:6;3522:1;:8;3507:23;;3546:9;3557;3570:29;3579:1;3582:16;3587:4;113:6;3582:4;:16::i;:::-;3570:8;:29::i;:::-;3545:54;;;;3621:22;3626:4;3632:10;3637:1;3640;3632:4;:10::i;:::-;3621:4;:22::i;:::-;3614:29;;3665:16;3670:4;3676;3665;:16::i;:::-;3658:23;-1:-1:-1;3700:9:0;3696:20;;3711:5;;;;;3696:20;3737:4;3733:30;;;3754:9;;;3733:30;3782:4;3778:30;;;3799:9;;;3778:30;3827:8;3823:132;;;3862:15;3867:3;3872:4;3862;:15::i;:::-;3856:21;;3823:132;;;3924:15;3929:3;3934:4;3924;:15::i;:::-;3918:21;;3823:132;-1:-1:-1;;;3487:3:0;;3448:518;;;-1:-1:-1;3985:3:0;;2882:1114;-1:-1:-1;;;;;;;;;2882:1114:0:o

Swarm Source

bzzr://c5e8ec304c6258c65f2d2a5060fdf9618db8d027e8ca585dfb166299c36bb065

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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.