Contract 0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc

 
Txn Hash
Block
From
To
Value [Txn Fee]
0x515a842c6c02b9c8aca3ec1b0f0fc932b45114c728001ad12e033f4d652d636685377222021-06-23 4:38:356 mins ago0xe90210db2c2d4169d89124eb21a2ce24176082dd IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00026586
0x7596fc04b59e2cf10bd9815b5174a6ed0502578d3354e04ecb8438014108c79685318772021-06-22 23:44:315 hrs 1 min ago0xef0d23d1d1799c5ffc73549d6c4444a921eee318 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022047
0x21922b55d526ae752ea639f49419dfe6f799591ceae279b9d4aa8670dbdaee1485317832021-06-22 23:39:215 hrs 6 mins ago0x2f7a9223ca8ccfa212ff200e4928ffca30786d16 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022047
0xa46792959931bbf30ea349f778442c88f020dda07e4ae80e90c5545e73e466c885311922021-06-22 23:08:555 hrs 36 mins ago0x31c8ff616dd74a0c083554645add7da03ecbbcdf IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022047
0x0c27361ab4e9cf79d5c2b6a20034278460a1f047b572758dbaf428933bb4baca85283732021-06-22 20:47:387 hrs 57 mins ago0x1aacd2510e7ae95d42bea6a974b7c8110077e361 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022155
0x1612c23740d2385a8c2859a6e251078a237c7991f64c17ebfe3486f31accd8b385277042021-06-22 20:14:088 hrs 31 mins ago0xf8b0b8d080183fb385ecfde55e92489d07dd7b10 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022047
0x0e71e07cc5b314690b00c5b6b50d08000ef96b1713b26669280fba140b62598e85160902021-06-22 10:27:5118 hrs 17 mins ago0x825a38140ff24c6b4f6cb0ce6046426d97835313 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022155
0x0937fe9d0ff57cf22061b5eb61246045202b39d0668a7a5eb928e17e6d44663185159462021-06-22 10:20:3918 hrs 24 mins ago0xd0b8893ea28596d4c6be01480ea2384bc79b6026 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022155
0xa694f3af1f67867ae3a27c3ab5181bf3af540dd1dfa87bfa6c6e55da9e3707d585158542021-06-22 10:16:0318 hrs 29 mins ago0xf48b4cb2420712420d15ea01d62ea4dd41c2609d IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022155
0x023d6dce0120a461607ddf9e7d365840d579dd54845fcc670ef122e4c992ba4c85139372021-06-22 8:39:5920 hrs 5 mins ago0x30cc8552fad6a705bbf543744746bec4b2fde2dd IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022155
0xb67b1f242b0b6e68ec02c76c06e656ac42c8cb6d36d1c043afe6720b6ed0840484742892021-06-20 23:30:322 days 5 hrs ago0x1f85830b12b8350795c2044df50ad5ccbb032dfc IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022155
0xbd020e490e8fbcb90c7bb6f6fe7f366d57b8edec90e8a9337b387d5a3fdc17de84668502021-06-20 17:18:352 days 11 hrs ago0xd3f98db93b542c86db3515fc641b8cde8be92da6 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022155
0xc1c7e118a138088832c078e324c24d5c11b9cb8d53870c83a7973f11a7ff5b9c84651342021-06-20 15:52:472 days 12 hrs ago0x02857fe454f31b03e91f80731f624b29d146a2e0 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.000225981
0xf699e89754ee57650769b9855e551fa5ed5edd91f1d76ab18ff67f408d55c88d84631742021-06-20 14:14:472 days 14 hrs ago0x8dfa2fa22c223e563173cbed62a6879efa626f90 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.000225981
0x0df6fbcd74febb7c1a69189029723bb912ecb787d2e2f8ebb751e227d60ef36a84584892021-06-20 10:20:312 days 18 hrs ago0x79ef7269430416c13ef4912b9477440c891bba1c IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022047
0x32a66809a02895368fdb34d93a9d550e5390b21c012dc6020644db8a1eb9a74984416402021-06-19 20:16:373 days 8 hrs ago0x57655580b219b13a3491829cb6d83936bfeda823 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022155
0xcf240a55fd339d6afdf133ccb2e2ec57ed06b3fb2859bd2161aa1b1db6fa586b84335862021-06-19 13:29:003 days 15 hrs ago0x7c35b0c0ffd4fcbd11fcd4b82efa57bddcf15fd1 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.000072315
0xd2402b780e9591e5d4c2913abd353846b68d2094e2f94a3005a3ca9014db0e8484335802021-06-19 13:28:423 days 15 hrs ago0x7c35b0c0ffd4fcbd11fcd4b82efa57bddcf15fd1 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.000072315
0xb84cc7ddc6113fa7535d922afc86fca308d907c10e8ae83944e85f6681157d7684335642021-06-19 13:27:543 days 15 hrs ago0x7c35b0c0ffd4fcbd11fcd4b82efa57bddcf15fd1 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.000072315
0xbeb1ca33c141a5941798c6abee81627b0d73b51a830f0ac3534518e83cd9ef9184326682021-06-19 12:42:473 days 16 hrs ago0xa2030bbcd292e14ae739c61569ed9ccc616341ce IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022155
0x806b46cd0ca6b2a8450fe3b7050157c9730d071b239c27d3c5a49b091f54f11f84150022021-06-18 21:50:534 days 6 hrs ago0x1e449bc189f81722516a2c7b5c5b03a9ae57983d IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.000072315
0x6bf10f04c1521d6705e24b73cb4c04809f35ec5db2d9a5856d6f1706af4bacf284137402021-06-18 20:46:144 days 7 hrs ago0x1e449bc189f81722516a2c7b5c5b03a9ae57983d IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.000072315
0x4ae716f5f9737b43b70d2be4461fa9eb348c61a1c842e1567edb1f4fcab8a67b84041262021-06-18 12:42:184 days 16 hrs ago0x4140f0c3e79a001e2207fa8f8965bf19597465b8 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022047
0x3c60384cb8a0dcf1f182a6fff3bfd57e5de4c867e3b6230845211d0a1cfc027584020702021-06-18 10:58:444 days 17 hrs ago0x2147d20faa94c358e795555799432f0cad3ed2e2 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00026586
0xf395a00ead2ada88d7661cc84bd8682685ad1269fdec2182ca167a661bbb55a683908262021-06-18 1:31:105 days 3 hrs ago0x825a38140ff24c6b4f6cb0ce6046426d97835313 IN  0xa6cc00afd6def77fbfed8caddfa881b3efe6cbbc0 BNB0.00022155
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xbd558ecc514dddc106cfa424ca6824810b2d574c14969a91c0dcdda4ff06bc4e72547752021-05-08 23:33:3045 days 5 hrs ago 0x2c358a7c62cdb9d554a65a86eea034bc55d1e715  Contract Creation0 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x4e2f300238ba5d70fe0b027f343790987b9add5d

Contract Name:
BdexPair

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 8899 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 11 : BdexPair.sol
pragma solidity =0.5.16;

import './interfaces/IBdexPair.sol';
import './interfaces/IBdexFormula.sol';
import './BdexERC20.sol';
import './libraries/Math.sol';
import './libraries/UQ112x112.sol';
import './interfaces/IERC20.sol';
import './interfaces/IBdexFactory.sol';
import './interfaces/IUniswapV2Callee.sol';

contract BdexPair is IBdexPair, BdexERC20 {
    using SafeMath  for uint;
    using UQ112x112 for uint224;

    uint public constant MINIMUM_LIQUIDITY = 10 ** 3;
    bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));

    address public factory;
    address public token0;
    address public token1;

    uint112 private reserve0;           // uses single storage slot, accessible via getReserves
    uint112 private reserve1;           // uses single storage slot, accessible via getReserves
    uint32  private blockTimestampLast; // uses single storage slot, accessible via getReserves
    uint public price0CumulativeLast;
    uint public price1CumulativeLast;
    uint private unlocked = 1;
    address public formula;

    uint112 private collectedFee0;           // uses single storage slot, accessible via getReserves
    uint112 private collectedFee1;           // uses single storage slot, accessible via getReserves
    uint32 private tokenWeight0;

    uint32 private swapFee;

    modifier lock() {
        require(unlocked == 1, 'BLP: LOCKED');
        unlocked = 0;
        _;
        unlocked = 1;
    }

    function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
        _reserve0 = reserve0;
        _reserve1 = reserve1;
        _blockTimestampLast = blockTimestampLast;
    }

    function getCollectedFees() public view returns (uint112 _collectedFee0, uint112 _collectedFee1) {
        _collectedFee0 = collectedFee0;
        _collectedFee1 = collectedFee1;
    }

    function getTokenWeights() public view returns (uint32 _tokenWeight0, uint32 _tokenWeight1) {
        _tokenWeight0 = tokenWeight0;
        _tokenWeight1 = 100 - tokenWeight0;
    }

    function getSwapFee() public view returns (uint32 _swapFee) {
        _swapFee = swapFee;
    }

    function _safeTransfer(address token, address to, uint value) private {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'BLP: TRANSFER_FAILED');
    }

    constructor() public {
        factory = msg.sender;
    }

    // called once by the factory at time of deployment
    function initialize(address _token0, address _token1, uint32 _tokenWeight0, uint32 _swapFee) external {
        require(msg.sender == factory, 'BLP: FORBIDDEN');
        string memory _symbol0 = IERC20(_token0).symbol();
        string memory _symbol1 = IERC20(_token1).symbol();
        initialize(
            string(abi.encodePacked(_symbol0, "/", _symbol1, " BLP")),
            string(abi.encodePacked(_symbol0, _symbol1))
        );
        // sufficient check
        token0 = _token0;
        token1 = _token1;
        tokenWeight0 = _tokenWeight0;
        swapFee = _swapFee;
        formula = IBdexFactory(factory).formula();
    }

    // update reserves and, on the first call per block, price accumulators
    function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
        uint32 _tokenWeight0 = tokenWeight0;
        require(balance0 * (100 - _tokenWeight0) <= uint112(- 1) && balance1 * _tokenWeight0 <= uint112(- 1), 'BLP: OVERFLOW');
        uint32 blockTimestamp = uint32(block.timestamp % 2 ** 32);
        uint32 timeElapsed = blockTimestamp - blockTimestampLast;
        // overflow is desired
        if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
            // * never overflows, and + overflow is desired
            uint112 mReserve0 = _reserve0 * (100 - _tokenWeight0);
            uint112 mReserve1 = _reserve1 * _tokenWeight0;
            price0CumulativeLast += uint(UQ112x112.encode(mReserve1).uqdiv(mReserve0)) * timeElapsed;
            price1CumulativeLast += uint(UQ112x112.encode(mReserve0).uqdiv(mReserve1)) * timeElapsed;
        }
        reserve0 = uint112(balance0);
        reserve1 = uint112(balance1);
        blockTimestampLast = blockTimestamp;
        emit Sync(reserve0, reserve1);
    }
    function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
        address feeTo = IBdexFactory(factory).feeTo();
        uint112 protocolFee = uint112(IBdexFactory(factory).protocolFee());
        feeOn = feeTo != address(0);
        (uint112 _collectedFee0, uint112 _collectedFee1) = getCollectedFees();
        if (protocolFee > 0 && feeOn && (_collectedFee0 > 0 || _collectedFee1 > 0)) {
            uint32 _tokenWeight0 = tokenWeight0;
            uint liquidity = IBdexFormula(formula).mintLiquidityFee(
                totalSupply, _reserve0, _reserve1,
                _tokenWeight0, 100 - _tokenWeight0,
                _collectedFee0 / protocolFee, _collectedFee1 / protocolFee
            );
            if (liquidity > 0) _mint(feeTo, liquidity);
        }
        if (_collectedFee0 > 0) collectedFee0 = 0;
        if (_collectedFee1 > 0) collectedFee1 = 0;
    }
    // this low-level function should be called from a contract which performs important safety checks
    function mint(address to) external lock returns (uint liquidity) {
        (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
        uint balance0 = IERC20(token0).balanceOf(address(this));
        uint balance1 = IERC20(token1).balanceOf(address(this));
        uint amount0 = balance0.sub(_reserve0);
        uint amount1 = balance1.sub(_reserve1);
        _mintFee(_reserve0, _reserve1);
        uint _totalSupply = totalSupply;
        // gas savings, must be defined here since totalSupply can update in _mintFee
        if (_totalSupply == 0) {
            liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
            _mint(address(0), MINIMUM_LIQUIDITY);
            // permanently lock the first MINIMUM_LIQUIDITY tokens
        } else {
            liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
        }
        require(liquidity > 0, 'BLP: INSUFFICIENT_LIQUIDITY_MINTED');
        _mint(to, liquidity);

        _update(balance0, balance1, _reserve0, _reserve1);
        emit Mint(msg.sender, amount0, amount1);
    }

    // this low-level function should be called from a contract which performs important safety checks
    function burn(address to) external lock returns (uint amount0, uint amount1) {
        (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
        address _token0 = token0; // gas savings
        address _token1 = token1; // gas savings
        uint balance0 = IERC20(_token0).balanceOf(address(this));
        uint balance1 = IERC20(_token1).balanceOf(address(this));
        uint liquidity = balanceOf[address(this)];
        _mintFee(_reserve0, _reserve1);
        uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
        amount0 = liquidity.mul(balance0) / _totalSupply;// using balances ensures pro-rata distribution
        amount1 = liquidity.mul(balance1) / _totalSupply;// using balances ensures pro-rata distribution
        require(amount0 > 0 && amount1 > 0, 'BLP: INSUFFICIENT_LIQUIDITY_BURNED');
        _burn(address(this), liquidity);
        _safeTransfer(_token0, to, amount0);
        _safeTransfer(_token1, to, amount1);
        balance0 = IERC20(_token0).balanceOf(address(this));
        balance1 = IERC20(_token1).balanceOf(address(this));

        _update(balance0, balance1, _reserve0, _reserve1);
        emit Burn(msg.sender, amount0, amount1, to);
    }
    // this low-level function should be called from a contract which performs important safety checks
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
        require(amount0Out > 0 || amount1Out > 0, 'BLP: INSUFFICIENT_OUTPUT_AMOUNT');
        uint112 _reserve0 = reserve0; // gas savings
        uint112 _reserve1 = reserve1; // gas savings
        require(amount0Out < _reserve0 && amount1Out < _reserve1, 'BLP: INSUFFICIENT_LIQUIDITY');

        uint balance0;
        uint balance1;
        { // scope for _token{0,1}, avoids stack too deep errors
        address _token0 = token0;
        address _token1 = token1;
        require(to != _token0 && to != _token1, 'BLP: INVALID_TO');
        if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
        if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
        if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
        balance0 = IERC20(_token0).balanceOf(address(this));
        balance1 = IERC20(_token1).balanceOf(address(this));
        }
        uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
        uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
        require(amount0In > 0 || amount1In > 0, 'BLP: INSUFFICIENT_INPUT_AMOUNT');
        { // scope for reserve{0,1}Adjusted, avoids stack too deep errors
            uint balance0Adjusted = balance0.mul(10000);
            uint balance1Adjusted = balance1.mul(10000);
            { // avoids stack too deep errors
                if (amount0In > 0) {
                    uint amount0InFee = amount0In.mul(swapFee);
                    balance0Adjusted = balance0Adjusted.sub(amount0InFee);
                    collectedFee0 = uint112(uint(collectedFee0).add(amount0InFee));
                }
                if (amount1In > 0) {
                    uint amount1InFee = amount1In.mul(swapFee);
                    balance1Adjusted = balance1Adjusted.sub(amount1InFee);
                    collectedFee1 = uint112(uint(collectedFee1).add(amount1InFee));
                }
                uint32 _tokenWeight0 = tokenWeight0;// gas savings
                if (_tokenWeight0 == 50) { // gas savings for pair 50/50
                    require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(10000**2), 'BLP: K');
                } else {
                    require(IBdexFormula(formula).ensureConstantValue(uint(_reserve0).mul(10000), uint(_reserve1).mul(10000), balance0Adjusted, balance1Adjusted, _tokenWeight0), 'BLP: K');
                }
            }
        }
        _update(balance0, balance1, _reserve0, _reserve1);
        emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
    }

    // force balances to match reserves
    function skim(address to) external lock {
        address _token0 = token0; // gas savings
        address _token1 = token1; // gas savings
        _safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
        _safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
    }

    // force reserves to match balances
    function sync() external lock {
        _update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
    }
}

File 2 of 11 : IBdexPair.sol
pragma solidity >=0.5.16;
interface IBdexPair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

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

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

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;


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

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function getCollectedFees() external view returns (uint112 _collectedFee0, uint112 _collectedFee1);
    function getTokenWeights() external view returns (uint32 tokenWeight0, uint32 tokenWeight1);
    function getSwapFee() external view returns (uint32);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);

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

    function initialize(address, address, uint32, uint32) external;
}

File 3 of 11 : IBdexFormula.sol
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity >=0.5.16;

/*
    Bancor Formula interface
*/
interface IBdexFormula {

    function getReserveAndWeights(address pair, address tokenA) external view returns (
        address tokenB,
        uint reserveA,
        uint reserveB,
        uint32 tokenWeightA,
        uint32 tokenWeightB,
        uint32 swapFee
    );

    function getFactoryReserveAndWeights(address factory, address pair, address tokenA) external view returns (
        address tokenB,
        uint reserveA,
        uint reserveB,
        uint32 tokenWeightA,
        uint32 tokenWeightB,
        uint32 swapFee
    );

    function getAmountIn(
        uint amountOut,
        uint reserveIn, uint reserveOut,
        uint32 tokenWeightIn, uint32 tokenWeightOut,
        uint32 swapFee
    ) external view returns (uint amountIn);

    function getPairAmountIn(address pair, address tokenIn, uint amountOut) external view returns (uint amountIn);

    function getAmountOut(
        uint amountIn,
        uint reserveIn, uint reserveOut,
        uint32 tokenWeightIn, uint32 tokenWeightOut,
        uint32 swapFee
    ) external view returns (uint amountOut);

    function getPairAmountOut(address pair, address tokenIn, uint amountIn) external view returns (uint amountOut);

    function getAmountsIn(
        address tokenIn,
        address tokenOut,
        uint amountOut,
        address[] calldata path
    ) external view returns (uint[] memory amounts);

    function getFactoryAmountsIn(
        address factory,
        address tokenIn,
        address tokenOut,
        uint amountOut,
        address[] calldata path
    ) external view returns (uint[] memory amounts);

    function getAmountsOut(
        address tokenIn,
        address tokenOut,
        uint amountIn,
        address[] calldata path
    ) external view returns (uint[] memory amounts);

    function getFactoryAmountsOut(
        address factory,
        address tokenIn,
        address tokenOut,
        uint amountIn,
        address[] calldata path
    ) external view returns (uint[] memory amounts);

    function ensureConstantValue(uint reserve0, uint reserve1, uint balance0Adjusted, uint balance1Adjusted, uint32 tokenWeight0) external view returns (bool);
    function getReserves(address pair, address tokenA, address tokenB) external view returns (uint reserveA, uint reserveB);
    function getOtherToken(address pair, address tokenA) external view returns (address tokenB);
    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function sortTokens(address tokenA, address tokenB) external pure returns (address token0, address token1);
    function mintLiquidityFee(
        uint totalLiquidity,
        uint112 reserve0,
        uint112  reserve1,
        uint32 tokenWeight0,
        uint32 tokenWeight1,
        uint112  collectedFee0,
        uint112 collectedFee1) external view returns (uint amount);
}

File 4 of 11 : BdexERC20.sol
pragma solidity =0.5.16;

import './interfaces/IBdexERC20.sol';
import './libraries/SafeMath.sol';

contract BdexERC20 is IBdexERC20 {
    using SafeMath for uint;

    string public name;
    string public symbol;
    uint8 public constant decimals = 18;
    uint  public totalSupply;
    mapping(address => uint) public balanceOf;
    mapping(address => mapping(address => uint)) public allowance;

    bytes32 public DOMAIN_SEPARATOR;
    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
    mapping(address => uint) public nonces;

    constructor() public {
    }

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

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

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

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

    function _transfer(address from, address to, uint value) private {
        balanceOf[from] = balanceOf[from].sub(value);
        balanceOf[to] = balanceOf[to].add(value);
        emit Transfer(from, to, value);
    }

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

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

    function transferFrom(address from, address to, uint value) external returns (bool) {
        if (allowance[from][msg.sender] != uint(-1)) {
            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
        }
        _transfer(from, to, value);
        return true;
    }

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
        require(deadline >= block.timestamp, 'BLP: EXPIRED');
        bytes32 digest = keccak256(
            abi.encodePacked(
                '\x19\x01',
                DOMAIN_SEPARATOR,
                keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
            )
        );
        address recoveredAddress = ecrecover(digest, v, r, s);
        require(recoveredAddress != address(0) && recoveredAddress == owner, 'BLP: INVALID_SIGNATURE');
        _approve(owner, spender, value);
    }
}

File 5 of 11 : Math.sol
pragma solidity >=0.5.16;

// a library for performing various math operations

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

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

File 6 of 11 : UQ112x112.sol
pragma solidity >=0.5.16;

// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))

// range: [0, 2**112 - 1]
// resolution: 1 / 2**112

library UQ112x112 {
    uint224 constant Q112 = 2**112;

    // encode a uint112 as a UQ112x112
    function encode(uint112 y) internal pure returns (uint224 z) {
        z = uint224(y) * Q112; // never overflows
    }

    // divide a UQ112x112 by a uint112, returning a UQ112x112
    function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
        z = x / uint224(y);
    }
}

File 7 of 11 : IERC20.sol
pragma solidity >=0.5.16;

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

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

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

File 8 of 11 : IBdexFactory.sol
pragma solidity >=0.5.16;

interface IBdexFactory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint32 tokenWeight0, uint32 swapFee, uint);
    function feeTo() external view returns (address);
    function formula() external view returns (address);
    function protocolFee() external view returns (uint);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB, uint32 tokenWeightA, uint32 swapFee) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function isPair(address) external view returns (bool);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB, uint32 tokenWeightA, uint32 swapFee) external returns (address pair);
    function getWeightsAndSwapFee(address pair) external view returns (uint32 tokenWeight0, uint32 tokenWeight1, uint32 swapFee);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
    function setProtocolFee(uint) external;
}

File 9 of 11 : IUniswapV2Callee.sol
pragma solidity >=0.5.16;

interface IUniswapV2Callee {
    function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}

File 10 of 11 : IBdexERC20.sol
pragma solidity >=0.5.16;

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

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

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

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}

File 11 of 11 : SafeMath.sol
pragma solidity >=0.5.16;

// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)

library SafeMath {
    function add(uint x, uint y) internal pure returns (uint z) {
        require((z = x + y) >= x, 'ds-math-add-overflow');
    }

    function sub(uint x, uint y) internal pure returns (uint z) {
        require((z = x - y) <= x, 'ds-math-sub-underflow');
    }

    function mul(uint x, uint y) internal pure returns (uint z) {
        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
    }
    function div(uint a, uint b) internal pure returns (uint c) {
        require(b > 0, 'ds-math-division-by-zero');
        c = a / b;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 8899
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint112","name":"collectedFee0","type":"uint112"},{"indexed":false,"internalType":"uint112","name":"collectedFee1","type":"uint112"}],"name":"PaidProtocolFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0Out","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1Out","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint112","name":"reserve0","type":"uint112"},{"indexed":false,"internalType":"uint112","name":"reserve1","type":"uint112"}],"name":"Sync","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MINIMUM_LIQUIDITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"formula","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCollectedFees","outputs":[{"internalType":"uint112","name":"_collectedFee0","type":"uint112"},{"internalType":"uint112","name":"_collectedFee1","type":"uint112"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getReserves","outputs":[{"internalType":"uint112","name":"_reserve0","type":"uint112"},{"internalType":"uint112","name":"_reserve1","type":"uint112"},{"internalType":"uint32","name":"_blockTimestampLast","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getSwapFee","outputs":[{"internalType":"uint32","name":"_swapFee","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getTokenWeights","outputs":[{"internalType":"uint32","name":"_tokenWeight0","type":"uint32"},{"internalType":"uint32","name":"_tokenWeight1","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_token0","type":"address"},{"internalType":"address","name":"_token1","type":"address"},{"internalType":"uint32","name":"_tokenWeight0","type":"uint32"},{"internalType":"uint32","name":"_swapFee","type":"uint32"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"price0CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"price1CumulativeLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"skim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount0Out","type":"uint256"},{"internalType":"uint256","name":"amount1Out","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"sync","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60806040526001600d5534801561001557600080fd5b50600780546001600160a01b031916331790556132f7806100376000396000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806370a0823111610104578063c45a0155116100a2578063d505accf11610071578063d505accf146105d6578063d54a8d1814610627578063dd62ed3e1461065c578063fff6cae91461068a576101da565b8063c45a015514610561578063d0f6957914610569578063d21220a7146105ad578063d4cadf68146105b5576101da565b806395d89b41116100de57806395d89b41146104ff578063a9059cbb14610507578063ba9a7a5614610533578063bc25cf771461053b576101da565b806370a08231146104745780637ecebe001461049a57806389afcb44146104c0576101da565b806330adf81f1161017c5780634b75f54f1161014b5780634b75f54f146104365780635909c0d51461043e5780635a3d5493146104465780636a6278421461044e576101da565b806330adf81f146103dd578063313ce567146103e557806332bfe469146104035780633644e5151461042e576101da565b8063095ea7b3116101b8578063095ea7b3146103295780630dfe16811461036957806318160ddd1461038d57806323b872dd146103a7576101da565b8063022c0d9f146101df57806306fdde031461026d5780630902f1ac146102ea575b600080fd5b61026b600480360360808110156101f557600080fd5b8135916020810135916001600160a01b03604083013516919081019060808101606082013564010000000081111561022c57600080fd5b82018360208201111561023e57600080fd5b8035906020019184600183028401116401000000008311171561026057600080fd5b509092509050610692565b005b610275610eeb565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102af578181015183820152602001610297565b50505050905090810190601f1680156102dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102f2610f97565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b6103556004803603604081101561033f57600080fd5b506001600160a01b038135169060200135610fec565b604080519115158252519081900360200190f35b610371611003565b604080516001600160a01b039092168252519081900360200190f35b610395611012565b60408051918252519081900360200190f35b610355600480360360608110156103bd57600080fd5b506001600160a01b03813581169160208101359091169060400135611018565b6103956110d0565b6103ed6110f4565b6040805160ff9092168252519081900360200190f35b61040b6110f9565b6040805163ffffffff938416815291909216602082015281519081900390910190f35b61039561112b565b610371611131565b610395611140565b610395611146565b6103956004803603602081101561046457600080fd5b50356001600160a01b031661114c565b6103956004803603602081101561048a57600080fd5b50356001600160a01b031661144b565b610395600480360360208110156104b057600080fd5b50356001600160a01b031661145d565b6104e6600480360360208110156104d657600080fd5b50356001600160a01b031661146f565b6040805192835260208301919091528051918290030190f35b6102756117ee565b6103556004803603604081101561051d57600080fd5b506001600160a01b038135169060200135611866565b610395611873565b61026b6004803603602081101561055157600080fd5b50356001600160a01b0316611879565b610371611a09565b61026b6004803603608081101561057f57600080fd5b506001600160a01b03813581169160208101359091169063ffffffff60408201358116916060013516611a18565b610371612032565b6105bd612041565b6040805163ffffffff9092168252519081900360200190f35b61026b600480360360e08110156105ec57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c0013561204d565b61062f612275565b604080516dffffffffffffffffffffffffffff938416815291909216602082015281519081900390910190f35b6103956004803603604081101561067257600080fd5b506001600160a01b03813581169160200135166122a2565b61026b6122bf565b600d546001146106e9576040805162461bcd60e51b815260206004820152600b60248201527f424c503a204c4f434b4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000600d55841515806106fc5750600084115b61074d576040805162461bcd60e51b815260206004820152601f60248201527f424c503a20494e53554646494349454e545f4f55545055545f414d4f554e5400604482015290519081900360640190fd5b600a546dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041681871080156107945750806dffffffffffffffffffffffffffff1686105b6107e5576040805162461bcd60e51b815260206004820152601b60248201527f424c503a20494e53554646494349454e545f4c49515549444954590000000000604482015290519081900360640190fd5b60085460095460009182916001600160a01b039182169190811690891682148015906108235750806001600160a01b0316896001600160a01b031614155b610874576040805162461bcd60e51b815260206004820152600f60248201527f424c503a20494e56414c49445f544f0000000000000000000000000000000000604482015290519081900360640190fd5b8a1561088557610885828a8d61243f565b891561089657610896818a8c61243f565b861561095157886001600160a01b03166310d1e85c338d8d8c8c6040518663ffffffff1660e01b815260040180866001600160a01b03166001600160a01b03168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b15801561093857600080fd5b505af115801561094c573d6000803e3d6000fd5b505050505b604080516370a0823160e01b815230600482015290516001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561099757600080fd5b505afa1580156109ab573d6000803e3d6000fd5b505050506040513d60208110156109c157600080fd5b5051604080516370a0823160e01b815230600482015290519195506001600160a01b038316916370a0823191602480820192602092909190829003018186803b158015610a0d57600080fd5b505afa158015610a21573d6000803e3d6000fd5b505050506040513d6020811015610a3757600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610a61576000610a77565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610a9b576000610ab1565b89856dffffffffffffffffffffffffffff160383035b90506000821180610ac25750600081115b610b13576040805162461bcd60e51b815260206004820152601e60248201527f424c503a20494e53554646494349454e545f494e5055545f414d4f554e540000604482015290519081900360640190fd5b6000610b278561271063ffffffff61260716565b90506000610b3d8561271063ffffffff61260716565b90508315610bd957601054600090610b6090869063ffffffff9081169061260716565b9050610b72838263ffffffff61267316565b600f54909350610b98906dffffffffffffffffffffffffffff168263ffffffff6126cb16565b600f80547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff92909216919091179055505b8215610c7457601054600090610bfa90859063ffffffff9081169061260716565b9050610c0c828263ffffffff61267316565b600f54909250610c3e906e01000000000000000000000000000090046dffffffffffffffffffffffffffff16826126cb565b600f600e6101000a8154816dffffffffffffffffffffffffffff02191690836dffffffffffffffffffffffffffff160217905550505b600f547c0100000000000000000000000000000000000000000000000000000000900463ffffffff166032811415610d4557610cdd6305f5e100610cd16dffffffffffffffffffffffffffff8c8116908c1663ffffffff61260716565b9063ffffffff61260716565b610ced848463ffffffff61260716565b1015610d40576040805162461bcd60e51b815260206004820152600660248201527f424c503a204b0000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b610e76565b600e546001600160a01b03166379c91b37610d786dffffffffffffffffffffffffffff8c1661271063ffffffff61260716565b610d9a6dffffffffffffffffffffffffffff8c1661271063ffffffff61260716565b8686866040518663ffffffff1660e01b8152600401808681526020018581526020018481526020018381526020018263ffffffff1663ffffffff1681526020019550505050505060206040518083038186803b158015610df957600080fd5b505afa158015610e0d573d6000803e3d6000fd5b505050506040513d6020811015610e2357600080fd5b5051610e76576040805162461bcd60e51b815260206004820152600660248201527f424c503a204b0000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b505050610e8584848888612723565b60408051838152602081018390528082018d9052606081018c905290516001600160a01b038b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600d55505050505050505050565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f81018490048402820184019092528181529291830182828015610f8f5780601f10610f6457610100808354040283529160200191610f8f565b820191906000526020600020905b815481529060010190602001808311610f7257829003601f168201915b505050505081565b600a546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610ff9338484612a15565b5060015b92915050565b6008546001600160a01b031681565b60025481565b6001600160a01b03831660009081526004602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff146110bb576001600160a01b0384166000908152600460209081526040808320338452909152902054611096908363ffffffff61267316565b6001600160a01b03851660009081526004602090815260408083203384529091529020555b6110c6848484612a77565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b600f547c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690606482900390565b60055481565b600e546001600160a01b031681565b600b5481565b600c5481565b6000600d546001146111a5576040805162461bcd60e51b815260206004820152600b60248201527f424c503a204c4f434b4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000600d819055806111b5610f97565b50600854604080516370a0823160e01b815230600482015290519395509193506000926001600160a01b03909116916370a08231916024808301926020929190829003018186803b15801561120957600080fd5b505afa15801561121d573d6000803e3d6000fd5b505050506040513d602081101561123357600080fd5b5051600954604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561128657600080fd5b505afa15801561129a573d6000803e3d6000fd5b505050506040513d60208110156112b057600080fd5b5051905060006112d6836dffffffffffffffffffffffffffff871663ffffffff61267316565b905060006112fa836dffffffffffffffffffffffffffff871663ffffffff61267316565b90506113068686612b31565b506002548061134d576113396103e861132d611328868663ffffffff61260716565b612eaa565b9063ffffffff61267316565b975061134860006103e8612efc565b6113aa565b6113a76dffffffffffffffffffffffffffff8816611371858463ffffffff61260716565b8161137857fe5b046dffffffffffffffffffffffffffff881661139a858563ffffffff61260716565b816113a157fe5b04612f93565b97505b600088116113e95760405162461bcd60e51b81526004018080602001828103825260228152602001806132a16022913960400191505060405180910390fd5b6113f38989612efc565b6113ff85858989612723565b6040805184815260208101849052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600d55509395945050505050565b60036020526000908152604090205481565b60066020526000908152604090205481565b600080600d546001146114c9576040805162461bcd60e51b815260206004820152600b60248201527f424c503a204c4f434b4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000600d819055806114d9610f97565b50600854600954604080516370a0823160e01b815230600482015290519496509294506001600160a01b039182169391169160009184916370a08231916024808301926020929190829003018186803b15801561153557600080fd5b505afa158015611549573d6000803e3d6000fd5b505050506040513d602081101561155f57600080fd5b5051604080516370a0823160e01b815230600482015290519192506000916001600160a01b038516916370a08231916024808301926020929190829003018186803b1580156115ad57600080fd5b505afa1580156115c1573d6000803e3d6000fd5b505050506040513d60208110156115d757600080fd5b5051306000908152600360205260409020549091506115f68787612b31565b506002548061160b838663ffffffff61260716565b8161161257fe5b04995080611626838563ffffffff61260716565b8161162d57fe5b04985060008a1180156116405750600089115b61167b5760405162461bcd60e51b815260040180806020018281038252602281526020018061322d6022913960400191505060405180910390fd5b6116853083612fab565b611690868c8c61243f565b61169b858c8b61243f565b604080516370a0823160e01b815230600482015290516001600160a01b038816916370a08231916024808301926020929190829003018186803b1580156116e157600080fd5b505afa1580156116f5573d6000803e3d6000fd5b505050506040513d602081101561170b57600080fd5b5051604080516370a0823160e01b815230600482015290519195506001600160a01b038716916370a0823191602480820192602092909190829003018186803b15801561175757600080fd5b505afa15801561176b573d6000803e3d6000fd5b505050506040513d602081101561178157600080fd5b5051925061179184848a8a612723565b604080518b8152602081018b905281516001600160a01b038e169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a350505050505050506001600d81905550915091565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f81018490048402820184019092528181529291830182828015610f8f5780601f10610f6457610100808354040283529160200191610f8f565b6000610ff9338484612a77565b6103e881565b600d546001146118d0576040805162461bcd60e51b815260206004820152600b60248201527f424c503a204c4f434b4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000600d55600854600954600a54604080516370a0823160e01b815230600482015290516001600160a01b0394851694909316926119869285928792611981926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b15801561194957600080fd5b505afa15801561195d573d6000803e3d6000fd5b505050506040513d602081101561197357600080fd5b50519063ffffffff61267316565b61243f565b600a54604080516370a0823160e01b815230600482015290516119ff9284928792611981926e01000000000000000000000000000090046dffffffffffffffffffffffffffff16916001600160a01b038616916370a0823191602480820192602092909190829003018186803b15801561194957600080fd5b50506001600d5550565b6007546001600160a01b031681565b6007546001600160a01b03163314611a77576040805162461bcd60e51b815260206004820152600e60248201527f424c503a20464f5242494444454e000000000000000000000000000000000000604482015290519081900360640190fd5b6060846001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015611ab257600080fd5b505afa158015611ac6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015611aef57600080fd5b8101908080516040519392919084640100000000821115611b0f57600080fd5b908301906020820185811115611b2457600080fd5b8251640100000000811182820188101715611b3e57600080fd5b82525081516020918201929091019080838360005b83811015611b6b578181015183820152602001611b53565b50505050905090810190601f168015611b985780820380516001836020036101000a031916815260200191505b5060405250505090506060846001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015611bdc57600080fd5b505afa158015611bf0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015611c1957600080fd5b8101908080516040519392919084640100000000821115611c3957600080fd5b908301906020820185811115611c4e57600080fd5b8251640100000000811182820188101715611c6857600080fd5b82525081516020918201929091019080838360005b83811015611c95578181015183820152602001611c7d565b50505050905090810190601f168015611cc25780820380516001836020036101000a031916815260200191505b506040525050509050611ea882826040516020018083805190602001908083835b60208310611d025780518252601f199092019160209182019101611ce3565b6001836020036101000a038019825116818451168082178552505050505050905001807f2f0000000000000000000000000000000000000000000000000000000000000081525060010182805190602001908083835b60208310611d775780518252601f199092019160209182019101611d58565b6001836020036101000a038019825116818451168082178552505050505050905001807f20424c50000000000000000000000000000000000000000000000000000000008152506004019250505060405160208183030381529060405283836040516020018083805190602001908083835b60208310611e085780518252601f199092019160209182019101611de9565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909216911617905285519190930192850191508083835b60208310611e6e5780518252601f199092019160209182019101611e4f565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052613048565b600880546001600160a01b038089167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617909255600980548884169216919091179055600f805463ffffffff8088167c0100000000000000000000000000000000000000000000000000000000027bffffffffffffffffffffffffffffffffffffffffffffffffffffffff90921691909117909155601080549186167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000909216919091179055600754604080517f4b75f54f00000000000000000000000000000000000000000000000000000000815290519190921691634b75f54f916004808301926020929190829003018186803b158015611fc757600080fd5b505afa158015611fdb573d6000803e3d6000fd5b505050506040513d6020811015611ff157600080fd5b5051600e80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03909216919091179055505050505050565b6009546001600160a01b031681565b60105463ffffffff1690565b428410156120a2576040805162461bcd60e51b815260206004820152600c60248201527f424c503a20455850495245440000000000000000000000000000000000000000604482015290519081900360640190fd5b6005546001600160a01b0380891660008181526006602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e280820193601f1981019281900390910190855afa1580156121d8573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381161580159061220e5750886001600160a01b0316816001600160a01b0316145b61225f576040805162461bcd60e51b815260206004820152601660248201527f424c503a20494e56414c49445f5349474e415455524500000000000000000000604482015290519081900360640190fd5b61226a898989612a15565b505050505050505050565b600f546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000009092041690565b600460209081526000928352604080842090915290825290205481565b600d54600114612316576040805162461bcd60e51b815260206004820152600b60248201527f424c503a204c4f434b4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000600d55600854604080516370a0823160e01b81523060048201529051612438926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561236757600080fd5b505afa15801561237b573d6000803e3d6000fd5b505050506040513d602081101561239157600080fd5b5051600954604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156123de57600080fd5b505afa1580156123f2573d6000803e3d6000fd5b505050506040513d602081101561240857600080fd5b5051600a546dffffffffffffffffffffffffffff808216916e010000000000000000000000000000900416612723565b6001600d55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e74323536290000000000000060209182015281516001600160a01b0385811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b6020831061251a5780518252601f1990920191602091820191016124fb565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461257c576040519150601f19603f3d011682016040523d82523d6000602084013e612581565b606091505b50915091508180156125af5750805115806125af57508080602001905160208110156125ac57600080fd5b50515b612600576040805162461bcd60e51b815260206004820152601460248201527f424c503a205452414e534645525f4641494c4544000000000000000000000000604482015290519081900360640190fd5b5050505050565b60008115806126225750508082028282828161261f57fe5b04145b610ffd576040805162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610ffd576040805162461bcd60e51b815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b80820182811015610ffd576040805162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b600f5463ffffffff7c01000000000000000000000000000000000000000000000000000000009091048116906dffffffffffffffffffffffffffff606483900390911686021180159061278c57506dffffffffffffffffffffffffffff63ffffffff8216850211155b6127dd576040805162461bcd60e51b815260206004820152600d60248201527f424c503a204f564552464c4f5700000000000000000000000000000000000000604482015290519081900360640190fd5b600a5463ffffffff428116917c01000000000000000000000000000000000000000000000000000000009004811682039081161580159061282d57506dffffffffffffffffffffffffffff851615155b801561284857506dffffffffffffffffffffffffffff841615155b1561290a5763ffffffff60648490038116860290808516860290831661289b836128718461312c565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff61315016565b600b80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff83166128db826128718561312c565b600c80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905550505b600a80547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff898116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008983168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a150505050505050565b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316600090815260036020526040902054612aa0908263ffffffff61267316565b6001600160a01b038085166000908152600360205260408082209390935590841681522054612ad5908263ffffffff6126cb16565b6001600160a01b0380841660008181526003602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600760009054906101000a90046001600160a01b03166001600160a01b031663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b158015612b8257600080fd5b505afa158015612b96573d6000803e3d6000fd5b505050506040513d6020811015612bac57600080fd5b5051600754604080517fb0e21e8a00000000000000000000000000000000000000000000000000000000815290519293506000926001600160a01b039092169163b0e21e8a91600480820192602092909190829003018186803b158015612c1257600080fd5b505afa158015612c26573d6000803e3d6000fd5b505050506040513d6020811015612c3c57600080fd5b50516001600160a01b038316151593509050600080612c59612275565b915091506000836dffffffffffffffffffffffffffff16118015612c7a5750845b8015612cb057506000826dffffffffffffffffffffffffffff161180612cb057506000816dffffffffffffffffffffffffffff16115b15612e2257600f54600e546002547c010000000000000000000000000000000000000000000000000000000090920463ffffffff16916000916001600160a01b0316906392aec23c908b8b8660648190036dffffffffffffffffffffffffffff8c8116908c1681612d1d57fe5b048c6dffffffffffffffffffffffffffff168b6dffffffffffffffffffffffffffff1681612d4757fe5b6040805160e08b901b7fffffffff0000000000000000000000000000000000000000000000000000000016815260048101999099526dffffffffffffffffffffffffffff97881660248a0152958716604489015263ffffffff9485166064890152929093166084870152841660a48601520490911660c48301525160e4808301926020929190829003018186803b158015612de157600080fd5b505afa158015612df5573d6000803e3d6000fd5b505050506040513d6020811015612e0b57600080fd5b505190508015612e1f57612e1f8682612efc565b50505b6dffffffffffffffffffffffffffff821615612e6157600f80547fffffffffffffffffffffffffffffffffffff00000000000000000000000000001690555b6dffffffffffffffffffffffffffff811615612ea057600f80547fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff1690555b5050505092915050565b60006003821115612eed575080600160028204015b81811015612ee757809150600281828581612ed657fe5b040181612edf57fe5b049050612ebf565b50612ef7565b8115612ef7575060015b919050565b600254612f0f908263ffffffff6126cb16565b6002556001600160a01b038216600090815260036020526040902054612f3b908263ffffffff6126cb16565b6001600160a01b03831660008181526003602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612fa25781612fa4565b825b9392505050565b6001600160a01b038216600090815260036020526040902054612fd4908263ffffffff61267316565b6001600160a01b038316600090815260036020526040902055600254613000908263ffffffff61267316565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b815161305b906000906020850190613191565b50805161306f906001906020840190613191565b50604051469080605261324f82396040805191829003605201822086516020978801208383018352600184527f310000000000000000000000000000000000000000000000000000000000000093880193909352815180880191909152808201929092527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606083015260808201939093523060a0808301919091528351808303909101815260c090910190925250805192019190912060055550565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff84168161318957fe5b049392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106131d257805160ff19168380011785556131ff565b828001600101855582156131ff579182015b828111156131ff5782518255916020019190600101906131e4565b5061320b92915061320f565b5090565b61322991905b8082111561320b5760008155600101613215565b9056fe424c503a20494e53554646494349454e545f4c49515549444954595f4255524e4544454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429424c503a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a72315820c986b0868fdb88c305baf806d3149aa8bac7e37b3b2d8b84b1394bebee93902b64736f6c63430005100032

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