FTM Price: $0.515501 (+4.70%)
 

Overview

FTM Balance

Fantom LogoFantom LogoFantom Logo0 FTM

FTM Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Fees Overrid...716597552023-11-29 0:33:02479 days ago1701217982IN
0x472f3C3c...c410C881A
0 FTM0.00398937157
Set Fee659854442023-07-18 2:03:48613 days ago1689645828IN
0x472f3C3c...c410C881A
0 FTM0.00387756147
Transfer Ownersh...649653142023-07-01 8:56:17629 days ago1688201777IN
0x472f3C3c...c410C881A
0 FTM0.00826492275.34154111
Set Tank649652872023-07-01 8:55:20629 days ago1688201720IN
0x472f3C3c...c410C881A
0 FTM0.01371944275.34154111
Set Voter649651972023-07-01 8:51:55629 days ago1688201515IN
0x472f3C3c...c410C881A
0 FTM0.01366465275.34154111

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
1047757572025-02-15 17:02:0634 days ago1739638926
0x472f3C3c...c410C881A
 Contract Creation0 FTM
1031228922025-01-20 16:53:4260 days ago1737392022
0x472f3C3c...c410C881A
 Contract Creation0 FTM
1030561502025-01-19 22:45:4761 days ago1737326747
0x472f3C3c...c410C881A
 Contract Creation0 FTM
1030296362025-01-19 14:51:1761 days ago1737298277
0x472f3C3c...c410C881A
 Contract Creation0 FTM
998681102024-12-12 19:34:2899 days ago1734032068
0x472f3C3c...c410C881A
 Contract Creation0 FTM
996923932024-12-10 19:12:41101 days ago1733857961
0x472f3C3c...c410C881A
 Contract Creation0 FTM
993001512024-12-06 10:29:42105 days ago1733480982
0x472f3C3c...c410C881A
 Contract Creation0 FTM
986429592024-11-29 11:53:21112 days ago1732881201
0x472f3C3c...c410C881A
 Contract Creation0 FTM
970581602024-11-11 5:03:33131 days ago1731301413
0x472f3C3c...c410C881A
 Contract Creation0 FTM
966581502024-11-06 11:38:14135 days ago1730893094
0x472f3C3c...c410C881A
 Contract Creation0 FTM
965653012024-11-05 8:27:42136 days ago1730795262
0x472f3C3c...c410C881A
 Contract Creation0 FTM
962257412024-11-01 11:39:10140 days ago1730461150
0x472f3C3c...c410C881A
 Contract Creation0 FTM
949636742024-10-17 22:21:04155 days ago1729203664
0x472f3C3c...c410C881A
 Contract Creation0 FTM
924959892024-09-24 2:27:02179 days ago1727144822
0x472f3C3c...c410C881A
 Contract Creation0 FTM
922809702024-09-21 17:59:42181 days ago1726941582
0x472f3C3c...c410C881A
 Contract Creation0 FTM
897444812024-08-23 21:02:49210 days ago1724446969
0x472f3C3c...c410C881A
 Contract Creation0 FTM
874801322024-08-01 20:18:02232 days ago1722543482
0x472f3C3c...c410C881A
 Contract Creation0 FTM
858737412024-07-17 9:30:29247 days ago1721208629
0x472f3C3c...c410C881A
 Contract Creation0 FTM
844129792024-07-03 16:43:19261 days ago1720024999
0x472f3C3c...c410C881A
 Contract Creation0 FTM
827657412024-06-12 18:31:12282 days ago1718217072
0x472f3C3c...c410C881A
 Contract Creation0 FTM
825183452024-06-08 17:39:41286 days ago1717868381
0x472f3C3c...c410C881A
 Contract Creation0 FTM
820621822024-06-01 23:43:45293 days ago1717285425
0x472f3C3c...c410C881A
 Contract Creation0 FTM
820567072024-06-01 21:38:24293 days ago1717277904
0x472f3C3c...c410C881A
 Contract Creation0 FTM
817034972024-05-27 18:57:53298 days ago1716836273
0x472f3C3c...c410C881A
 Contract Creation0 FTM
815137512024-05-24 15:11:34301 days ago1716563494
0x472f3C3c...c410C881A
 Contract Creation0 FTM
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x42a0B204...48Ea5DE08
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
PairFactory

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at ftmscan.com on 2023-06-30
*/

// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IPairFactory {
    function allPairsLength() external view returns (uint);
    function isPair(address pair) external view returns (bool);
    function isPaused() external view returns (bool);
    function pairCodeHash() external pure returns (bytes32);
    function getFee(address pair) external view returns (uint256);
    function getPair(address tokenA, address token, bool stable) external view returns (address);
    function getInitializable() external view returns (address, address, bool);
    function createPair(address tokenA, address tokenB, bool stable) external returns (address pair);
    function voter() external view returns (address);
    function tank() external view returns (address);
}



interface IVoter {
    function _ve() external view returns (address);
    function governor() external view returns (address);
    function emergencyCouncil() external view returns (address);
    function attachTokenToGauge(uint _tokenId, address account) external;
    function detachTokenFromGauge(uint _tokenId, address account) external;
    function emitDeposit(uint _tokenId, address account, uint amount) external;
    function emitWithdraw(uint _tokenId, address account, uint amount) external;
    function isWhitelisted(address token) external view returns (bool);
    function notifyRewardAmount(uint amount) external;
    function distribute(address _gauge) external;
    function gauges(address) external view returns (address);
}

// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function transfer(address recipient, uint amount) external returns (bool);
    function decimals() external view returns (uint8);
    function symbol() external view returns (string memory);
    function balanceOf(address) external view returns (uint);
    function transferFrom(address sender, address recipient, uint amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint);
    function approve(address spender, uint value) external returns (bool);

    event Transfer(address indexed from, address indexed to, uint value);
    event Approval(address indexed owner, address indexed spender, uint value);
}

interface IPair {
    function metadata() external view returns (uint dec0, uint dec1, uint r0, uint r1, bool st, address t0, address t1);
    function tokens() external returns (address, address);
    function token0() external returns (address);
    function token1() external returns (address);
    function transferFrom(address src, address dst, uint amount) external returns (bool);
    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function burn(address to) external returns (uint amount0, uint amount1);
    function mint(address to) external returns (uint liquidity);
    function getReserves() external view returns (uint _reserve0, uint _reserve1, uint _blockTimestampLast);
    function getAmountOut(uint, address) external view returns (uint);
    function setHasGauge(bool value) external;
    function setExternalBribe(address _externalBribe) external;
    function hasGauge() external view returns (bool);
    function stable() external view returns (bool);
    function prices(address tokenIn, uint amountIn, uint points) external view returns (uint[] memory);
}

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

interface IBribe {
    function _deposit(uint amount, uint tokenId) external;
    function _withdraw(uint amount, uint tokenId) external;
    function getRewardForOwner(uint tokenId, address[] memory tokens) external;
    function notifyRewardAmount(address token, uint amount) external;
    function left(address token) external view returns (uint);
}

// The base pair of pools, either stable or volatile
contract Pair is IPair {

    string public name;
    string public symbol;
    uint8 public constant decimals = 18;

    // Used to denote stable or volatile pair, not immutable since construction happens in the initialize method for CREATE2 deterministic addresses
    bool public immutable stable;

    uint public totalSupply = 0;

    mapping(address => mapping (address => uint)) public allowance;
    mapping(address => uint) public balanceOf;

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

    uint internal constant MINIMUM_LIQUIDITY = 10**3;

    address public immutable token0;
    address public immutable token1;
    address immutable factory;
    address public externalBribe;
    address public voter;
    bool public hasGauge;

    // Structure to capture time period obervations every 30 minutes, used for local oracles
    struct Observation {
        uint timestamp;
        uint reserve0Cumulative;
        uint reserve1Cumulative;
    }

    // Capture oracle reading every 30 minutes
    uint constant periodSize = 1800;

    Observation[] public observations;

    uint internal immutable decimals0;
    uint internal immutable decimals1;

    uint public reserve0;
    uint public reserve1;
    uint public blockTimestampLast;

    uint public reserve0CumulativeLast;
    uint public reserve1CumulativeLast;

    event TankFees(address indexed token, uint amount, address tank);
    event GaugeFees(address indexed token, uint amount, address externalBribe);
    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(uint reserve0, uint reserve1);

    event Transfer(address indexed from, address indexed to, uint amount);
    event Approval(address indexed owner, address indexed spender, uint amount);

    event ExternalBribeSet(address indexed externalBribe);
    event HasGaugeSet(bool value);

    constructor() {
        factory = msg.sender;
        voter = IPairFactory(msg.sender).voter();
        (address _token0, address _token1, bool _stable) = IPairFactory(msg.sender).getInitializable();
        (token0, token1, stable) = (_token0, _token1, _stable);
        if (_stable) {
            name = string(abi.encodePacked("StableV1 AMM - ", IERC20(_token0).symbol(), "/", IERC20(_token1).symbol()));
            symbol = string(abi.encodePacked("sAMM-", IERC20(_token0).symbol(), "/", IERC20(_token1).symbol()));
        } else {
            name = string(abi.encodePacked("VolatileV1 AMM - ", IERC20(_token0).symbol(), "/", IERC20(_token1).symbol()));
            symbol = string(abi.encodePacked("vAMM-", IERC20(_token0).symbol(), "/", IERC20(_token1).symbol()));
        }

        decimals0 = 10**IERC20(_token0).decimals();
        decimals1 = 10**IERC20(_token1).decimals();

        observations.push(Observation(block.timestamp, 0, 0));
    }

    // simple re-entrancy check
    uint internal _unlocked = 1;
    modifier lock() {
        require(_unlocked == 1);
        _unlocked = 2;
        _;
        _unlocked = 1;
    }

    function _safeApprove(address token, address spender, uint value) internal {
        require(token.code.length > 0);
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, spender, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))));
    }

    function tank() public view returns (address) {
        return IPairFactory(factory).tank();
    }

    function setExternalBribe(address _externalBribe) external {
        require(msg.sender == voter, 'Only voter can set external bribe');
        externalBribe = _externalBribe;
        _safeApprove(token0, externalBribe, type(uint).max);
        _safeApprove(token1, externalBribe, type(uint).max);
        emit ExternalBribeSet(_externalBribe);
    }

    function setHasGauge(bool value) external {
        require(msg.sender == voter, 'Only voter can set has gauge');
        hasGauge = value;
        emit HasGaugeSet(value);
    }

    function observationLength() external view returns (uint) {
        return observations.length;
    }

    function lastObservation() public view returns (Observation memory) {
        return observations[observations.length-1];
    }

    function metadata() external view returns (uint dec0, uint dec1, uint r0, uint r1, bool st, address t0, address t1) {
        return (decimals0, decimals1, reserve0, reserve1, stable, token0, token1);
    }

    function tokens() external view returns (address, address) {
        return (token0, token1);
    }

    function _sendTokenFees(address token, uint amount) internal {
        if (amount != 0) {
            if (hasGauge) {
                IBribe(externalBribe).notifyRewardAmount(token, amount); // transfer fees to exBribes
                emit GaugeFees(token, amount, externalBribe);
            } else {
                address _tank = tank();
                _safeTransfer(token, _tank, amount); // transfer the fees to tank MSig for gaugeless LPs
                emit TankFees(token, amount, _tank);
            }
        }
    }

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

    // update reserves and, on the first call per block, price accumulators
    function _update(uint balance0, uint balance1, uint _reserve0, uint _reserve1) internal {
        uint blockTimestamp = block.timestamp;
        uint timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
        if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
            reserve0CumulativeLast += _reserve0 * timeElapsed;
            reserve1CumulativeLast += _reserve1 * timeElapsed;
        }

        Observation memory _point = lastObservation();
        timeElapsed = blockTimestamp - _point.timestamp; // compare the last observation with current timestamp, if greater than 30 minutes, record a new event
        if (timeElapsed > periodSize) {
            observations.push(Observation(blockTimestamp, reserve0CumulativeLast, reserve1CumulativeLast));
        }
        reserve0 = balance0;
        reserve1 = balance1;
        blockTimestampLast = blockTimestamp;
        emit Sync(reserve0, reserve1);
    }

    // produces the cumulative price using counterfactuals to save gas and avoid a call to sync.
    function currentCumulativePrices() public view returns (uint reserve0Cumulative, uint reserve1Cumulative, uint blockTimestamp) {
        blockTimestamp = block.timestamp;
        reserve0Cumulative = reserve0CumulativeLast;
        reserve1Cumulative = reserve1CumulativeLast;

        // if time has elapsed since the last update on the pair, mock the accumulated price values
        (uint _reserve0, uint _reserve1, uint _blockTimestampLast) = getReserves();
        if (_blockTimestampLast != blockTimestamp) {
            // subtraction overflow is desired
            uint timeElapsed = blockTimestamp - _blockTimestampLast;
            reserve0Cumulative += _reserve0 * timeElapsed;
            reserve1Cumulative += _reserve1 * timeElapsed;
        }
    }

    // gives the current twap price measured from amountIn * tokenIn gives amountOut
    function current(address tokenIn, uint amountIn) external view returns (uint amountOut) {
        Observation memory _observation = lastObservation();
        (uint reserve0Cumulative, uint reserve1Cumulative,) = currentCumulativePrices();
        if (block.timestamp == _observation.timestamp) {
            _observation = observations[observations.length-2];
        }

        uint timeElapsed = block.timestamp - _observation.timestamp;
        uint _reserve0 = (reserve0Cumulative - _observation.reserve0Cumulative) / timeElapsed;
        uint _reserve1 = (reserve1Cumulative - _observation.reserve1Cumulative) / timeElapsed;
        amountOut = _getAmountOut(amountIn, tokenIn, _reserve0, _reserve1);
    }

    // as per `current`, however allows user configured granularity, up to the full window size
    function quote(address tokenIn, uint amountIn, uint granularity) external view returns (uint amountOut) {
        uint [] memory _prices = sample(tokenIn, amountIn, granularity, 1);
        uint priceAverageCumulative;
        for (uint i = 0; i < _prices.length; i++) {
            priceAverageCumulative += _prices[i];
        }
        return priceAverageCumulative / granularity;
    }

    // returns a memory set of twap prices
    function prices(address tokenIn, uint amountIn, uint points) external view returns (uint[] memory) {
        return sample(tokenIn, amountIn, points, 1);
    }

    function sample(address tokenIn, uint amountIn, uint points, uint window) public view returns (uint[] memory) {
        uint[] memory _prices = new uint[](points);

        uint length = observations.length-1;
        uint i = length - (points * window);
        uint nextIndex = 0;
        uint index = 0;

        for (; i < length; i+=window) {
            nextIndex = i + window;
            uint timeElapsed = observations[nextIndex].timestamp - observations[i].timestamp;
            uint _reserve0 = (observations[nextIndex].reserve0Cumulative - observations[i].reserve0Cumulative) / timeElapsed;
            uint _reserve1 = (observations[nextIndex].reserve1Cumulative - observations[i].reserve1Cumulative) / timeElapsed;
            _prices[index] = _getAmountOut(amountIn, tokenIn, _reserve0, _reserve1);
            // index < length; length cannot overflow
            unchecked {
                index = index + 1;
            }
        }
        return _prices;
    }

    // this low-level function should be called by addLiquidity functions in Router.sol, which performs important safety checks
    // standard uniswap v2 implementation
    function mint(address to) external lock returns (uint liquidity) {
        (uint _reserve0, uint _reserve1) = (reserve0, reserve1);
        uint _balance0 = IERC20(token0).balanceOf(address(this));
        uint _balance1 = IERC20(token1).balanceOf(address(this));
        uint _amount0 = _balance0 - _reserve0;
        uint _amount1 = _balance1 - _reserve1;

        uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
        if (_totalSupply == 0) {
            liquidity = Math.sqrt(_amount0 * _amount1) - MINIMUM_LIQUIDITY;
            _mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
        } else {
            liquidity = Math.min(_amount0 * _totalSupply / _reserve0, _amount1 * _totalSupply / _reserve1);
        }
        require(liquidity > 0, 'ILM'); // Pair: 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
    // standard uniswap v2 implementation
    function burn(address to) external lock returns (uint amount0, uint amount1) {
        (uint _reserve0, uint _reserve1) = (reserve0, reserve1);
        (address _token0, address _token1) = (token0, token1);
        uint _balance0 = IERC20(_token0).balanceOf(address(this));
        uint _balance1 = IERC20(_token1).balanceOf(address(this));
        uint _liquidity = balanceOf[address(this)];

        uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
        amount0 = _liquidity * _balance0 / _totalSupply; // using balances ensures pro-rata distribution
        amount1 = _liquidity * _balance1 / _totalSupply; // using balances ensures pro-rata distribution
        require(amount0 > 0 && amount1 > 0, 'ILB'); // Pair: 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(!IPairFactory(factory).isPaused());
        require(amount0Out > 0 || amount1Out > 0, 'IOA'); // Pair: INSUFFICIENT_OUTPUT_AMOUNT
        (uint _reserve0, uint _reserve1) =  (reserve0, reserve1);
        require(amount0Out < _reserve0 && amount1Out < _reserve1, 'IL'); // Pair: INSUFFICIENT_LIQUIDITY

        uint _balance0;
        uint _balance1;
        { // scope for _token{0,1}, avoids stack too deep errors
        (address _token0, address _token1) = (token0, token1);
        require(to != _token0 && to != _token1, 'IT'); // Pair: 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) IPairCallee(to).hook(msg.sender, amount0Out, amount1Out, data); // callback, used for flash loans
        _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, 'IIA'); // Pair: INSUFFICIENT_INPUT_AMOUNT
        { // scope for reserve{0,1}Adjusted, avoids stack too deep errors
        (address _token0, address _token1) = (token0, token1);
        if (amount0In > 0) _sendTokenFees(token0, amount0In * IPairFactory(factory).getFee(address(this)) / 10000);
        if (amount1In > 0) _sendTokenFees(token1, amount1In * IPairFactory(factory).getFee(address(this)) / 10000);
        _balance0 = IERC20(_token0).balanceOf(address(this)); // since we removed tokens, we need to reconfirm balances, can also simply use previous balance - amountIn/ 10000, but doing balanceOf again as safety check
        _balance1 = IERC20(_token1).balanceOf(address(this));
        // The curve, either x3y+y3x for stable pools, or x*y for volatile pools
        require(_k(_balance0, _balance1) >= _k(_reserve0, _reserve1), 'K'); // Pair: 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, address _token1) = (token0, token1);
        _safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)) - (reserve0));
        _safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)) - (reserve1));
    }

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

    function _f(uint x0, uint y) internal pure returns (uint) {
        return x0*(y*y/1e18*y/1e18)/1e18+(x0*x0/1e18*x0/1e18)*y/1e18;
    }

    function _d(uint x0, uint y) internal pure returns (uint) {
        return 3*x0*(y*y/1e18)/1e18+(x0*x0/1e18*x0/1e18);
    }

    function _get_y(uint x0, uint xy, uint y) internal pure returns (uint) {
        for (uint i = 0; i < 255; i++) {
            uint y_prev = y;
            uint k = _f(x0, y);
            if (k < xy) {
                uint dy = (xy - k)*1e18/_d(x0, y);
                y = y + dy;
            } else {
                uint dy = (k - xy)*1e18/_d(x0, y);
                y = y - dy;
            }
            if (y > y_prev) {
                if (y - y_prev <= 1) {
                    return y;
                }
            } else {
                if (y_prev - y <= 1) {
                    return y;
                }
            }
        }
        return y;
    }

    function getAmountOut(uint amountIn, address tokenIn) external view returns (uint) {
        (uint _reserve0, uint _reserve1) = (reserve0, reserve1);
        amountIn -= amountIn * IPairFactory(factory).getFee(address(this)) / 10000; // remove fee from amount received
        return _getAmountOut(amountIn, tokenIn, _reserve0, _reserve1);
    }

    function _getAmountOut(uint amountIn, address tokenIn, uint _reserve0, uint _reserve1) internal view returns (uint) {
        if (stable) {
            uint xy =  _k(_reserve0, _reserve1);
            _reserve0 = _reserve0 * 1e18 / decimals0;
            _reserve1 = _reserve1 * 1e18 / decimals1;
            (uint reserveA, uint reserveB) = tokenIn == token0 ? (_reserve0, _reserve1) : (_reserve1, _reserve0);
            amountIn = tokenIn == token0 ? amountIn * 1e18 / decimals0 : amountIn * 1e18 / decimals1;
            uint y = reserveB - _get_y(amountIn+reserveA, xy, reserveB);
            return y * (tokenIn == token0 ? decimals1 : decimals0) / 1e18;
        } else {
            (uint reserveA, uint reserveB) = tokenIn == token0 ? (_reserve0, _reserve1) : (_reserve1, _reserve0);
            return amountIn * reserveB / (reserveA + amountIn);
        }
    }

    function _k(uint x, uint y) internal view returns (uint) {
        if (stable) {
            uint _x = x * 1e18 / decimals0;
            uint _y = y * 1e18 / decimals1;
            uint _a = (_x * _y) / 1e18;
            uint _b = ((_x * _x) / 1e18 + (_y * _y) / 1e18);
            return _a * _b / 1e18;  // x3y+y3x >= k
        } else {
            return x * y; // xy >= k
        }
    }

    function _mint(address dst, uint amount) internal {
        totalSupply += amount;
        balanceOf[dst] += amount;
        emit Transfer(address(0), dst, amount);
    }

    function _burn(address dst, uint amount) internal {
        totalSupply -= amount;
        balanceOf[dst] -= amount;
        emit Transfer(dst, address(0), amount);
    }

    function approve(address spender, uint amount) external returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);
        return true;
    }

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
        require(deadline >= block.timestamp, 'Pair: EXPIRED');
        DOMAIN_SEPARATOR = keccak256(
            abi.encode(
                keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
                keccak256(bytes(name)),
                keccak256(bytes('1')),
                block.chainid,
                address(this)
            )
        );
        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, 'Pair: INVALID_SIGNATURE');
        allowance[owner][spender] = value;

        emit Approval(owner, spender, value);
    }

    function transfer(address dst, uint amount) external returns (bool) {
        _transferTokens(msg.sender, dst, amount);
        return true;
    }

    function transferFrom(address src, address dst, uint amount) external returns (bool) {
        address spender = msg.sender;
        uint spenderAllowance = allowance[src][spender];

        if (spender != src && spenderAllowance != type(uint).max) {
            uint newAllowance = spenderAllowance - amount;
            allowance[src][spender] = newAllowance;

            emit Approval(src, spender, newAllowance);
        }

        _transferTokens(src, dst, amount);
        return true;
    }

    function _transferTokens(address src, address dst, uint amount) internal {
        balanceOf[src] -= amount;
        balanceOf[dst] += amount;

        emit Transfer(src, dst, amount);
    }

    function _safeTransfer(address token,address to,uint256 value) internal {
        require(token.code.length > 0);
        (bool success, bytes memory data) =
        token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))));
    }
}

// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

contract PairFactory is IPairFactory, Ownable {

    bool public isPaused;
    uint256 public stableFee;
    uint256 public volatileFee;
    uint256 public constant MAX_FEE = 500; // 5%
    address public voter;
    address public tank;
    address public deployer;

    mapping(address => mapping(address => mapping(bool => address))) public getPair;
    address[] public allPairs;
    mapping(address => bool) public isPair; // simplified check if its a pair, given that `stable` flag might not be available in peripherals
    mapping(address => uint256) public feesOverrides;

    address internal _temp0;
    address internal _temp1;
    bool internal _temp;

    event PairCreated(address indexed token0, address indexed token1, bool stable, address pair, uint);
    event VoterSet(address indexed setter, address indexed voter);
    event TankSet(address indexed setter, address indexed tank);
    event Paused(address indexed pauser, bool paused);

    event FeeSet(address indexed setter, bool stable, uint256 fee);

    constructor() {
        stableFee = 3; // 0.03%
        volatileFee = 25; // 0.25%
        deployer = msg.sender;
    }

    function setVoter(address _voter) external {
        require(voter == address(0), 'The voter has already been set.');
        // have to make sure that this can be set to the voter address during init script
        require(msg.sender == deployer, 'Not authorised to set voter.');
        voter = _voter;
        emit VoterSet(msg.sender, _voter);
    }

    function setTank(address _tank) external onlyOwner {
        tank = _tank;
        emit TankSet(msg.sender, _tank);
    }

    function allPairsLength() external view returns (uint) {
        return allPairs.length;
    }

    function setPause(bool _state) external onlyOwner {
        isPaused = _state;
        emit Paused(msg.sender, _state);
    }

    function setFee(bool _stable, uint256 _fee) external onlyOwner {
        require(_fee <= MAX_FEE, 'fee too high');
        if (_stable) {
            stableFee = _fee;
        } else {
            volatileFee = _fee;
        }
        emit FeeSet(msg.sender, _stable, _fee);
    }

    function setFeesOverrides(address _pair, uint256 _fee) external onlyOwner {
        require(_fee <= MAX_FEE, "fee too high");
        feesOverrides[_pair] = _fee;
    }

    function getFee(address _pair) public view returns(uint256) {
    	/// to get base fees, call `stableFee()` or `volatileFee()`
    	uint _fo = feesOverrides[_pair];
    	if( _fo != 0 ) {
    		return _fo;
    	} else {
    		return IPair(_pair).stable() ? stableFee : volatileFee;
    	}
    }

    function pairCodeHash() external pure returns (bytes32) {
        return keccak256(type(Pair).creationCode);
    }

    function getInitializable() external view returns (address, address, bool) {
        return (_temp0, _temp1, _temp);
    }

    function createPair(address tokenA, address tokenB, bool stable) external returns (address pair) {
        require(tokenA != tokenB, 'IA'); // Pair: IDENTICAL_ADDRESSES
        (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        require(token0 != address(0), 'ZA'); // Pair: ZERO_ADDRESS
        require(getPair[token0][token1][stable] == address(0), 'PE'); // Pair: PAIR_EXISTS - single check is sufficient
        if (stable) {
            require(IVoter(voter).governor() == tx.origin, "not governor");
        }
        bytes32 salt = keccak256(abi.encodePacked(token0, token1, stable)); // notice salt includes stable as well, 3 parameters
        (_temp0, _temp1, _temp) = (token0, token1, stable);
        pair = address(new Pair{salt:salt}());
        getPair[token0][token1][stable] = pair;
        getPair[token1][token0][stable] = pair; // populate mapping in the reverse direction
        allPairs.push(pair);
        isPair[pair] = true;
        emit PairCreated(token0, token1, stable, pair, allPairs.length);
    }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"setter","type":"address"},{"indexed":false,"internalType":"bool","name":"stable","type":"bool"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"FeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0","type":"address"},{"indexed":true,"internalType":"address","name":"token1","type":"address"},{"indexed":false,"internalType":"bool","name":"stable","type":"bool"},{"indexed":false,"internalType":"address","name":"pair","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"PairCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pauser","type":"address"},{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"setter","type":"address"},{"indexed":true,"internalType":"address","name":"tank","type":"address"}],"name":"TankSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"setter","type":"address"},{"indexed":true,"internalType":"address","name":"voter","type":"address"}],"name":"VoterSet","type":"event"},{"inputs":[],"name":"MAX_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allPairs","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allPairsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"name":"createPair","outputs":[{"internalType":"address","name":"pair","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deployer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feesOverrides","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_pair","type":"address"}],"name":"getFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInitializable","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"name":"getPair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isPair","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pairCodeHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_stable","type":"bool"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pair","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setFeesOverrides","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tank","type":"address"}],"name":"setTank","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_voter","type":"address"}],"name":"setVoter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stableFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tank","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"volatileFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x60806040523480156200001157600080fd5b5060043610620001755760003560e01c80639aab924811620000d3578063bedb86fb1162000086578063bedb86fb146200032d578063d5f394881462000344578063e1f76b441462000358578063e5e31b13146200036f578063eb13c4cf1462000395578063f2fde38b14620003ce57600080fd5b80639aab924814620002b1578063ad8c3cd214620002bb578063b187bd2614620002d2578063b7f01bfc14620002f8578063b88c9148146200030c578063bc063e1a146200032357600080fd5b80635084ed03116200012c5780635084ed03146200022e578063574f2ba314620002385780636801cc301462000241578063715018a6146200027e57806382dfdce414620002885780638da5cb5b146200029f57600080fd5b80631e3dd18b146200017a578063269eec3a14620001ae57806340bbd77514620001c757806346c96aac14620001e05780634bc2a65714620001f45780634e24f35e146200020b575b600080fd5b620001916200018b36600462000cb3565b620003e5565b6040516001600160a01b0390911681526020015b60405180910390f35b620001c5620001bf36600462000ce3565b62000410565b005b620001d160015481565b604051908152602001620001a5565b60035462000191906001600160a01b031681565b620001c56200020536600462000d12565b6200047d565b620001d16200021c36600462000d12565b60096020526000908152604090205481565b620001d160025481565b600754620001d1565b620001916200025236600462000d41565b60066020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b620001c562000580565b620001916200029936600462000d41565b62000598565b6000546001600160a01b031662000191565b620001d162000941565b620001c5620002cc36600462000d12565b62000975565b600054620002e790600160a01b900460ff1681565b6040519015158152602001620001a5565b60045462000191906001600160a01b031681565b620001d16200031d36600462000d12565b620009cb565b620001d16101f481565b620001c56200033e36600462000d93565b62000a6f565b60055462000191906001600160a01b031681565b620001c56200036936600462000db3565b62000ad4565b620002e76200038036600462000d12565b60086020526000908152604090205460ff1681565b600a54600b54604080516001600160a01b0393841681529282166020840152600160a01b90910460ff16151590820152606001620001a5565b620001c5620003df36600462000d12565b62000b7a565b60078181548110620003f657600080fd5b6000918252602090912001546001600160a01b0316905081565b6200041a62000bf9565b6101f4811115620004615760405162461bcd60e51b815260206004820152600c60248201526b0cccaca40e8dede40d0d2ced60a31b60448201526064015b60405180910390fd5b6001600160a01b03909116600090815260096020526040902055565b6003546001600160a01b031615620004d85760405162461bcd60e51b815260206004820152601f60248201527f54686520766f7465722068617320616c7265616479206265656e207365742e00604482015260640162000458565b6005546001600160a01b03163314620005345760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420617574686f726973656420746f2073657420766f7465722e00000000604482015260640162000458565b600380546001600160a01b0319166001600160a01b03831690811790915560405133907fb32f3288ab299698a7e6e1d7a3dc2cecab02b83346c3745708bd2121c9adb58990600090a350565b6200058a62000bf9565b62000596600062000c55565b565b6000826001600160a01b0316846001600160a01b031603620005e25760405162461bcd60e51b8152602060048201526002602482015261494160f01b604482015260640162000458565b600080846001600160a01b0316866001600160a01b031610620006075784866200060a565b85855b90925090506001600160a01b0382166200064c5760405162461bcd60e51b81526020600482015260026024820152615a4160f01b604482015260640162000458565b6001600160a01b0382811660009081526006602090815260408083208585168452825280832088151584529091529020541615620006b25760405162461bcd60e51b8152602060048201526002602482015261504560f01b604482015260640162000458565b831562000770576003546040805163030d028960e21b8152905132926001600160a01b031691630c340a249160048083019260209291908290030181865afa15801562000703573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000729919062000dd4565b6001600160a01b031614620007705760405162461bcd60e51b815260206004820152600c60248201526b3737ba1033b7bb32b93737b960a11b604482015260640162000458565b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b16603482015284151560f81b604882015260009060490160408051601f19818403018152908290528051602090910120600b80546001600160a01b038087166001600160a01b03198b1515600160a01b0281166001600160a81b03199094169390931717909255600a80549288169290911691909117905591508190620008179062000ca5565b8190604051809103906000f590508015801562000838573d6000803e3d6000fd5b506001600160a01b0384811660008181526006602081815260408084208987168086529083528185208d15158087529084528286208054988a166001600160a01b0319998a16811790915582875294845282862087875284528286208187528452828620805489168617905560078054600181810183557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6889091018054909a1687179099558587526008855295839020805460ff1916909817909755935481519687529186019290925290840152929650907fc4805696c66d7cf352fc1d6bb633ad5ee82f6cb577c453024b6e0eb8306c6fc99060600160405180910390a35050509392505050565b600060405180602001620009559062000ca5565b6020820181038252601f19601f8201166040525080519060200120905090565b6200097f62000bf9565b600480546001600160a01b0319166001600160a01b03831690811790915560405133907f36ed8bbc0a01e979a20cc34c97d74e8a95b8b96fc9df3cf65016ac4f87c9b4ea90600090a350565b6001600160a01b0381166000908152600960205260408120548015620009f15792915050565b826001600160a01b03166322be3de16040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000a30573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a56919062000df4565b62000a645760025462000a68565b6001545b9392505050565b62000a7962000bf9565b60008054821515600160a01b0260ff60a01b1990911617905560405133907fe8699cf681560fd07de85543bd994263f4557bdc5179dd702f256d15fd083e1d9062000ac990841515815260200190565b60405180910390a250565b62000ade62000bf9565b6101f481111562000b215760405162461bcd60e51b815260206004820152600c60248201526b0cccaca40e8dede40d0d2ced60a31b604482015260640162000458565b811562000b3357600181905562000b39565b60028190555b6040805183151581526020810183905233917fff8c07b46b41610b204623c0b2b01f1046618bb634e9b619f71f56eb89630fc0910160405180910390a25050565b62000b8462000bf9565b6001600160a01b03811662000beb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000458565b62000bf68162000c55565b50565b6000546001600160a01b03163314620005965760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000458565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6143f28062000e1583390190565b60006020828403121562000cc657600080fd5b5035919050565b6001600160a01b038116811462000bf657600080fd5b6000806040838503121562000cf757600080fd5b823562000d048162000ccd565b946020939093013593505050565b60006020828403121562000d2557600080fd5b813562000a688162000ccd565b801515811462000bf657600080fd5b60008060006060848603121562000d5757600080fd5b833562000d648162000ccd565b9250602084013562000d768162000ccd565b9150604084013562000d888162000d32565b809150509250925092565b60006020828403121562000da657600080fd5b813562000a688162000d32565b6000806040838503121562000dc757600080fd5b823562000d048162000d32565b60006020828403121562000de757600080fd5b815162000a688162000ccd565b60006020828403121562000e0757600080fd5b815162000a688162000d3256fe61014060405260006002556001600f553480156200001c57600080fd5b503360e0819052604080516311b25aab60e21b815290516346c96aac916004808201926020929091908290030181865afa1580156200005f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000859190620007cf565b600860006101000a8154816001600160a01b0302191690836001600160a01b031602179055506000806000336001600160a01b031663eb13c4cf6040518163ffffffff1660e01b8152600401606060405180830381865afa158015620000ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001159190620007f4565b801580156080526001600160a01b0380841660c052841660a05292955090935091506200035a57826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156200017b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620001a591908101906200088f565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620001e4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200020e91908101906200088f565b6040516020016200022192919062000947565b60405160208183030381529060405260009080519060200190620002479291906200070c565b50826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000287573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620002b191908101906200088f565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620002f0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200031a91908101906200088f565b6040516020016200032d929190620009a2565b60405160208183030381529060405260019080519060200190620003539291906200070c565b5062000573565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000399573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620003c391908101906200088f565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000402573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200042c91908101906200088f565b6040516020016200043f929190620009f3565b60405160208183030381529060405260009080519060200190620004659291906200070c565b50826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620004a5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620004cf91908101906200088f565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156200050e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200053891908101906200088f565b6040516020016200054b92919062000a50565b60405160208183030381529060405260019080519060200190620005719291906200070c565b505b826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620005b2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005d8919062000a72565b620005e590600a62000bac565b6101008181525050816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200062c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000652919062000a72565b6200065f90600a62000bac565b6101205250506040805160608101825242815260006020820181815292820181815260098054600181018255925291517f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af60039092029182015591517f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7b0830155517f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7b1909101555062000bf9565b8280546200071a9062000bbd565b90600052602060002090601f0160209004810192826200073e576000855562000789565b82601f106200075957805160ff191683800117855562000789565b8280016001018555821562000789579182015b82811115620007895782518255916020019190600101906200076c565b50620007979291506200079b565b5090565b5b808211156200079757600081556001016200079c565b80516001600160a01b0381168114620007ca57600080fd5b919050565b600060208284031215620007e257600080fd5b620007ed82620007b2565b9392505050565b6000806000606084860312156200080a57600080fd5b6200081584620007b2565b92506200082560208501620007b2565b9150604084015180151581146200083b57600080fd5b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620008795781810151838201526020016200085f565b8381111562000889576000848401525b50505050565b600060208284031215620008a257600080fd5b81516001600160401b0380821115620008ba57600080fd5b818401915084601f830112620008cf57600080fd5b815181811115620008e457620008e462000846565b604051601f8201601f19908116603f011681019083821181831017156200090f576200090f62000846565b816040528281528760208487010111156200092957600080fd5b6200093c8360208301602088016200085c565b979650505050505050565b6e029ba30b13632ab189020a6a690169608d1b8152600083516200097381600f8501602088016200085c565b602f60f81b600f918401918201528351620009968160108401602088016200085c565b01601001949350505050565b6473414d4d2d60d81b815260008351620009c48160058501602088016200085c565b602f60f81b6005918401918201528351620009e78160068401602088016200085c565b01600601949350505050565b7002b37b630ba34b632ab189020a6a690169607d1b81526000835162000a218160118501602088016200085c565b602f60f81b601191840191820152835162000a448160128401602088016200085c565b01601201949350505050565b6476414d4d2d60d81b815260008351620009c48160058501602088016200085c565b60006020828403121562000a8557600080fd5b815160ff81168114620007ed57600080fd5b634e487b7160e01b600052601160045260246000fd5b600181815b8085111562000aee57816000190482111562000ad25762000ad262000a97565b8085161562000ae057918102915b93841c939080029062000ab2565b509250929050565b60008262000b075750600162000ba6565b8162000b165750600062000ba6565b816001811462000b2f576002811462000b3a5762000b5a565b600191505062000ba6565b60ff84111562000b4e5762000b4e62000a97565b50506001821b62000ba6565b5060208310610133831016604e8410600b841016171562000b7f575081810a62000ba6565b62000b8b838362000aad565b806000190482111562000ba25762000ba262000a97565b0290505b92915050565b6000620007ed60ff84168362000af6565b600181811c9082168062000bd257607f821691505b60208210810362000bf357634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e051610100516101205161369862000d5a600039600081816104050152818161257701528181612861015281816129230152612a2e0152600081816103e20152818161253601528181612822015281816129650152612a0801526000818161074901528181610b9801528181610c6901528181611c2c01526120fb01526000818161048f0152818161060e015281816106ad0152818161088401528181610b2c01528181610c3b0152818161121e015281816115b20152818161179d01528181611cff01526122580152600081816102e301528181610467015281816105e90152818161086301528181610b0b01528181610b6a015281816111ed0152818161151c0152818161177b01528181611cdd015281816121d0015281816128a3015281816128ea015281816129cf0152612a72015260008181610374015281816104370152818161250e01526127ee01526136986000f3fe608060405234801561001057600080fd5b506004361061025e5760003560e01c806370a0823111610146578063b7f01bfc116100c3578063d21220a711610087578063d21220a7146106a8578063d505accf146106cf578063dd62ed3e146106e2578063ebeb31db1461070d578063f140a35a14610715578063fff6cae91461072857600080fd5b8063b7f01bfc14610672578063bc25cf771461067a578063bf944dbc1461068d578063c245febc14610696578063c5700a021461069f57600080fd5b806395d89b411161010a57806395d89b41146105d35780639d63848a146105db5780639e8cc04b14610639578063a9059cbb1461064c578063b22d8fe01461065f57600080fd5b806370a082311461052d5780637ecebe001461054d57806389afcb441461056d5780638a7b8cf21461059557806391f36d65146105bf57600080fd5b806323b872dd116101df57806345a1de79116101a357806345a1de79146104c557806346c96aac146104d8578063517b3f82146104eb5780635881c475146104fe5780635a76f25e146105115780636a6278421461051a57600080fd5b806323b872dd14610396578063252c09d7146103a9578063313ce567146103bc578063392f37e9146103d6578063443cb4bc146104bc57600080fd5b806313345fe11161022657806313345fe11461031d57806318160ddd1461033d57806319999566146103545780631df8c7171461036757806322be3de11461036f57600080fd5b8063022c0d9f1461026357806306fdde03146102785780630902f1ac14610296578063095ea7b3146102bb5780630dfe1681146102de575b600080fd5b6102766102713660046130a1565b610730565b005b610280610e6e565b60405161028d9190613167565b60405180910390f35b600a54600b54600c545b6040805193845260208401929092529082015260600161028d565b6102ce6102c936600461319a565b610efc565b604051901515815260200161028d565b6103057f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161028d565b61033061032b3660046131c6565b610f69565b60405161028d9190613201565b61034660025481565b60405190815260200161028d565b610276610362366004613245565b611165565b6102a0611286565b6102ce7f000000000000000000000000000000000000000000000000000000000000000081565b6102ce6103a4366004613262565b6112f5565b6102a06103b73660046132a3565b6113be565b6103c4601281565b60405160ff909116815260200161028d565b600a54600b54604080517f000000000000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060208201529081019290925260608201527f0000000000000000000000000000000000000000000000000000000000000000151560808201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660a08301527f00000000000000000000000000000000000000000000000000000000000000001660c082015260e00161028d565b610346600a5481565b600754610305906001600160a01b031681565b600854610305906001600160a01b031681565b6103466104f936600461319a565b6113f1565b61033061050c3660046132bc565b6114d9565b610346600b5481565b610346610528366004613245565b6114e8565b61034661053b366004613245565b60046020526000908152604090205481565b61034661055b366004613245565b60066020526000908152604090205481565b61058061057b366004613245565b611749565b6040805192835260208301919091520161028d565b61059d611a66565b604080518251815260208084015190820152918101519082015260600161028d565b6008546102ce90600160a01b900460ff1681565b610280611ae6565b604080516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811682527f00000000000000000000000000000000000000000000000000000000000000001660208201520161028d565b6103466106473660046132bc565b611af3565b6102ce61065a36600461319a565b611b60565b61027661066d3660046132ff565b611b76565b610305611c28565b610276610688366004613245565b611cb1565b610346600d5481565b610346600e5481565b610346600c5481565b6103057f000000000000000000000000000000000000000000000000000000000000000081565b6102766106dd36600461331c565b611dcf565b6103466106f0366004613393565b600360209081526000928352604080842090915290825290205481565b600954610346565b6103466107233660046133cc565b6120d7565b6102766121a3565b600f5460011461073f57600080fd5b6002600f819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b187bd266040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c991906133f1565b156107d357600080fd5b60008511806107e25750600084115b6108195760405162461bcd60e51b8152602060048201526003602482015262494f4160e81b60448201526064015b60405180910390fd5b600a54600b54818710801561082d57508086105b61085e5760405162461bcd60e51b8152602060048201526002602482015261125360f21b6044820152606401610810565b6000807f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03898116908316148015906108d15750806001600160a01b0316896001600160a01b031614155b6109025760405162461bcd60e51b8152602060048201526002602482015261125560f21b6044820152606401610810565b8a1561091357610913828a8d6122dd565b891561092457610924818a8c6122dd565b861561099157604051639a7bff7960e01b81526001600160a01b038a1690639a7bff799061095e9033908f908f908e908e9060040161340e565b600060405180830381600087803b15801561097857600080fd5b505af115801561098c573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa1580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f9919061345a565b6040516370a0823160e01b81523060048201529094506001600160a01b038216906370a0823190602401602060405180830381865afa158015610a40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a64919061345a565b9250505060008985610a769190613489565b8311610a83576000610a97565b610a8d8a86613489565b610a979084613489565b90506000610aa58a86613489565b8311610ab2576000610ac6565b610abc8a86613489565b610ac69084613489565b90506000821180610ad75750600081115b610b095760405162461bcd60e51b815260206004820152600360248201526249494160e81b6044820152606401610810565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008315610c1c57604051631711922960e31b8152306004820152610c1c907f000000000000000000000000000000000000000000000000000000000000000090612710906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b88c914890602401602060405180830381865afa158015610bdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c03919061345a565b610c0d90886134a0565b610c1791906134d5565b6123dd565b8215610cde57604051631711922960e31b8152306004820152610cde907f000000000000000000000000000000000000000000000000000000000000000090612710906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b88c914890602401602060405180830381865afa158015610cb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd4919061345a565b610c0d90876134a0565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610d22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d46919061345a565b6040516370a0823160e01b81523060048201529096506001600160a01b038216906370a0823190602401602060405180830381865afa158015610d8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db1919061345a565b9450610dbd888861250a565b610dc7878761250a565b1015610df95760405162461bcd60e51b81526020600482015260016024820152604b60f81b6044820152606401610810565b5050610e0784848888612656565b60408051838152602081018390529081018c9052606081018b90526001600160a01b038a169033907fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229060800160405180910390a350506001600f55505050505050505050565b60008054610e7b906134f7565b80601f0160208091040260200160405190810160405280929190818152602001828054610ea7906134f7565b8015610ef45780601f10610ec957610100808354040283529160200191610ef4565b820191906000526020600020905b815481529060010190602001808311610ed757829003601f168201915b505050505081565b3360008181526003602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610f579086815260200190565b60405180910390a35060015b92915050565b606060008367ffffffffffffffff811115610f8657610f86613531565b604051908082528060200260200182016040528015610faf578160200160208202803683370190505b50600954909150600090610fc590600190613489565b90506000610fd385876134a0565b610fdd9083613489565b90506000805b8383101561115557610ff58784613547565b915060006009848154811061100c5761100c61355f565b906000526020600020906003020160000154600984815481106110315761103161355f565b90600052602060002090600302016000015461104d9190613489565b9050600081600986815481106110655761106561355f565b9060005260206000209060030201600101546009868154811061108a5761108a61355f565b9060005260206000209060030201600101546110a69190613489565b6110b091906134d5565b9050600082600987815481106110c8576110c861355f565b906000526020600020906003020160020154600987815481106110ed576110ed61355f565b9060005260206000209060030201600201546111099190613489565b61111391906134d5565b90506111218c8e84846127ea565b8885815181106111335761113361355f565b602090810291909101015250505060010161114e8784613547565b9250610fe3565b509293505050505b949350505050565b6008546001600160a01b031633146111c95760405162461bcd60e51b815260206004820152602160248201527f4f6e6c7920766f7465722063616e207365742065787465726e616c20627269626044820152606560f81b6064820152608401610810565b600780546001600160a01b0319166001600160a01b038316908117909155611215907f000000000000000000000000000000000000000000000000000000000000000090600019612adf565b60075461124f907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b0316600019612adf565b6040516001600160a01b038216907f03e9b76bf8c2d2d6948b20459194f64843d25ada1a13e3481bf88399831a046190600090a250565b600d54600e5442600080806112a4600a54600b54600c549192909190565b9250925092508381146112ed5760006112bd8286613489565b90506112c981856134a0565b6112d39088613547565b96506112df81846134a0565b6112e99087613547565b9550505b505050909192565b6001600160a01b03831660008181526003602090815260408083203380855292528220549192909190821480159061132f57506000198114155b156113a55760006113408583613489565b6001600160a01b038881166000818152600360209081526040808320948916808452948252918290208590559051848152939450919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505b6113b0868686612b29565b6001925050505b9392505050565b600981815481106113ce57600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b6000806113fc611a66565b9050600080611409611286565b50845191935091504203611471576009805461142790600290613489565b815481106114375761143761355f565b9060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505092505b82516000906114809042613489565b90506000818560200151856114959190613489565b61149f91906134d5565b90506000828660400151856114b49190613489565b6114be91906134d5565b90506114cc888a84846127ea565b9998505050505050505050565b606061115d8484846001610f69565b6000600f546001146114f957600080fd5b6002600f55600a54600b546040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561156b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158f919061345a565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156115f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061161d919061345a565b9050600061162b8584613489565b905060006116398584613489565b600254909150600081900361167b576103e861165d61165884866134a0565b612bd7565b6116679190613489565b975061167660006103e8612cbf565b6116b0565b6116ad8761168983866134a0565b61169391906134d5565b8761169e84866134a0565b6116a891906134d5565b612d49565b97505b600088116116e65760405162461bcd60e51b8152602060048201526003602482015262494c4d60e81b6044820152606401610810565b6116f08989612cbf565b6116fc85858989612656565b604080518481526020810184905233917f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f910160405180910390a250506001600f55509395945050505050565b600080600f5460011461175b57600080fd5b6002600f55600a54600b546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156117f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611815919061345a565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561185f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611883919061345a565b3060009081526004602052604090205460025491925090806118a585846134a0565b6118af91906134d5565b9950806118bc84846134a0565b6118c691906134d5565b985060008a1180156118d85750600089115b61190a5760405162461bcd60e51b815260206004820152600360248201526224a62160e91b6044820152606401610810565b6119143083612d5f565b61191f868c8c6122dd565b61192a858c8b6122dd565b6040516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa15801561196e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611992919061345a565b6040516370a0823160e01b81523060048201529094506001600160a01b038616906370a0823190602401602060405180830381865afa1580156119d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119fd919061345a565b9250611a0b84848a8a612656565b604080518b8152602081018b90526001600160a01b038d169133917fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496910160405180910390a350505050505050506001600f81905550915091565b611a8a60405180606001604052806000815260200160008152602001600081525090565b60098054611a9a90600190613489565b81548110611aaa57611aaa61355f565b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b60018054610e7b906134f7565b600080611b038585856001610f69565b90506000805b8251811015611b4b57828181518110611b2457611b2461355f565b602002602001015182611b379190613547565b915080611b4381613575565b915050611b09565b50611b5684826134d5565b9695505050505050565b6000611b6d338484612b29565b50600192915050565b6008546001600160a01b03163314611bd05760405162461bcd60e51b815260206004820152601c60248201527f4f6e6c7920766f7465722063616e2073657420686173206761756765000000006044820152606401610810565b60088054821515600160a01b0260ff60a01b199091161790556040517f352eb552c369d470b6f2286567a9f272a1210ad788562e697f254cad5611f10590611c1d90831515815260200190565b60405180910390a150565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b7f01bfc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cac919061358e565b905090565b600f54600114611cc057600080fd5b6002600f55600a546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091611d8d9184918691906001600160a01b038416906370a08231906024015b602060405180830381865afa158015611d5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7e919061345a565b611d889190613489565b6122dd565b600b546040516370a0823160e01b8152306004820152611dc59183918691906001600160a01b038416906370a0823190602401611d3d565b50506001600f5550565b42841015611e0f5760405162461bcd60e51b815260206004820152600d60248201526c14185a5c8e8811561412549151609a1b6044820152606401610810565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051611e3f91906135ab565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f19818403018152918152815160209283012060058190556001600160a01b038a166000908152600690935290822080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b919087611f0a83613575565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001611f8392919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015611fee573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906120245750886001600160a01b0316816001600160a01b0316145b6120705760405162461bcd60e51b815260206004820152601760248201527f506169723a20494e56414c49445f5349474e41545552450000000000000000006044820152606401610810565b6001600160a01b038981166000818152600360209081526040808320948d16808452948252918290208b905590518a81527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050505050505050565b600a54600b54604051631711922960e31b81523060048201526000929190612710907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b88c914890602401602060405180830381865afa15801561214a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216e919061345a565b61217890876134a0565b61218291906134d5565b61218c9086613489565b945061219a858584846127ea565b95945050505050565b600f546001146121b257600080fd5b6002600f556040516370a0823160e01b81523060048201526122d6907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561221f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612243919061345a565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156122a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122cb919061345a565b600a54600b54612656565b6001600f55565b6000836001600160a01b03163b116122f457600080fd5b6040516001600160a01b03838116602483015260448201839052600091829186169063a9059cbb60e01b906064015b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516123619190613646565b6000604051808303816000865af19150503d806000811461239e576040519150601f19603f3d011682016040523d82523d6000602084013e6123a3565b606091505b50915091508180156123cd5750805115806123cd5750808060200190518101906123cd91906133f1565b6123d657600080fd5b5050505050565b801561250657600854600160a01b900460ff16156124a85760075460405163b66503cf60e01b81526001600160a01b038481166004830152602482018490529091169063b66503cf90604401600060405180830381600087803b15801561244357600080fd5b505af1158015612457573d6000803e3d6000fd5b5050600754604080518581526001600160a01b03928316602082015291861693507ff5b850648f086f3f988a2c06dd4214f39db9fa92ee563e6246c398361d1963ad92500160405180910390a25050565b60006124b2611c28565b90506124bf8382846122dd565b604080518381526001600160a01b0383811660208301528516917f8a0270441e721adb81a7413f54853fda4aa273f098843d47749905fcf619fbbf910160405180910390a2505b5050565b60007f0000000000000000000000000000000000000000000000000000000000000000156126455760007f000000000000000000000000000000000000000000000000000000000000000061256785670de0b6b3a76400006134a0565b61257191906134d5565b905060007f00000000000000000000000000000000000000000000000000000000000000006125a885670de0b6b3a76400006134a0565b6125b291906134d5565b90506000670de0b6b3a76400006125c983856134a0565b6125d391906134d5565b90506000670de0b6b3a76400006125ea84806134a0565b6125f491906134d5565b670de0b6b3a764000061260786806134a0565b61261191906134d5565b61261b9190613547565b9050670de0b6b3a764000061263082846134a0565b61263a91906134d5565b945050505050610f63565b61264f82846134a0565b9050610f63565b600c5442906000906126689083613489565b905060008111801561267957508315155b801561268457508215155b156126cb5761269381856134a0565b600d60008282546126a49190613547565b909155506126b4905081846134a0565b600e60008282546126c59190613547565b90915550505b60006126d5611a66565b80519091506126e49084613489565b91506107088211156127995760408051606081018252848152600d5460208201908152600e549282019283526009805460018101825560009190915291517f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af600390930292830155517f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7b082015590517f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7b1909101555b600a879055600b869055600c83905560408051888152602081018890527fcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a910160405180910390a150505050505050565b60007f000000000000000000000000000000000000000000000000000000000000000015612a6d57600061281e848461250a565b90507f000000000000000000000000000000000000000000000000000000000000000061285385670de0b6b3a76400006134a0565b61285d91906134d5565b93507f000000000000000000000000000000000000000000000000000000000000000061289284670de0b6b3a76400006134a0565b61289c91906134d5565b92506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b0316146128e15784866128e4565b85855b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b031614612963577f000000000000000000000000000000000000000000000000000000000000000061295489670de0b6b3a76400006134a0565b61295e91906134d5565b6129a0565b7f000000000000000000000000000000000000000000000000000000000000000061299689670de0b6b3a76400006134a0565b6129a091906134d5565b975060006129b86129b1848b613547565b8584612de1565b6129c29083613489565b9050670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316896001600160a01b031614612a2c577f0000000000000000000000000000000000000000000000000000000000000000612a4e565b7f00000000000000000000000000000000000000000000000000000000000000005b612a5890836134a0565b612a6291906134d5565b94505050505061115d565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614612ab0578385612ab3565b84845b9092509050612ac28783613547565b612acc82896134a0565b612ad691906134d5565b9250505061115d565b6000836001600160a01b03163b11612af657600080fd5b6040516001600160a01b03838116602483015260448201839052600091829186169063095ea7b360e01b90606401612323565b6001600160a01b03831660009081526004602052604081208054839290612b51908490613489565b90915550506001600160a01b03821660009081526004602052604081208054839290612b7e908490613547565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612bca91815260200190565b60405180910390a3505050565b600081600003612be957506000919050565b60006001612bf684612ef0565b901c6001901b90506001818481612c0f57612c0f6134bf565b048201901c90506001818481612c2757612c276134bf565b048201901c90506001818481612c3f57612c3f6134bf565b048201901c90506001818481612c5757612c576134bf565b048201901c90506001818481612c6f57612c6f6134bf565b048201901c90506001818481612c8757612c876134bf565b048201901c90506001818481612c9f57612c9f6134bf565b048201901c90506113b781828581612cb957612cb96134bf565b04612d49565b8060026000828254612cd19190613547565b90915550506001600160a01b03821660009081526004602052604081208054839290612cfe908490613547565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050565b6000818310612d5857816113b7565b5090919050565b8060026000828254612d719190613489565b90915550506001600160a01b03821660009081526004602052604081208054839290612d9e908490613489565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612d3d565b6000805b60ff811015612ee757826000612dfb8783612f84565b905085811015612e4b576000612e118887613021565b612e1b8389613489565b612e2d90670de0b6b3a76400006134a0565b612e3791906134d5565b9050612e438187613547565b955050612e8d565b6000612e578887613021565b612e618884613489565b612e7390670de0b6b3a76400006134a0565b612e7d91906134d5565b9050612e898187613489565b9550505b81851115612eb6576001612ea18387613489565b11612eb1578493505050506113b7565b612ed2565b6001612ec28684613489565b11612ed2578493505050506113b7565b50508080612edf90613575565b915050612de5565b50909392505050565b600080608083901c15612f0557608092831c92015b604083901c15612f1757604092831c92015b602083901c15612f2957602092831c92015b601083901c15612f3b57601092831c92015b600883901c15612f4d57600892831c92015b600483901c15612f5f57600492831c92015b600283901c15612f7157600292831c92015b600183901c15610f635760010192915050565b6000670de0b6b3a764000082818581612f9d82806134a0565b612fa791906134d5565b612fb191906134a0565b612fbb91906134d5565b612fc591906134a0565b612fcf91906134d5565b670de0b6b3a7640000808481612fe582806134a0565b612fef91906134d5565b612ff991906134a0565b61300391906134d5565b61300d90866134a0565b61301791906134d5565b6113b79190613547565b6000670de0b6b3a7640000838161303882806134a0565b61304291906134d5565b61304c91906134a0565b61305691906134d5565b670de0b6b3a76400008061306a85806134a0565b61307491906134d5565b61307f8660036134a0565b61300d91906134a0565b6001600160a01b038116811461309e57600080fd5b50565b6000806000806000608086880312156130b957600080fd5b853594506020860135935060408601356130d281613089565b9250606086013567ffffffffffffffff808211156130ef57600080fd5b818801915088601f83011261310357600080fd5b81358181111561311257600080fd5b89602082850101111561312457600080fd5b9699959850939650602001949392505050565b60005b8381101561315257818101518382015260200161313a565b83811115613161576000848401525b50505050565b6020815260008251806020840152613186816040850160208701613137565b601f01601f19169190910160400192915050565b600080604083850312156131ad57600080fd5b82356131b881613089565b946020939093013593505050565b600080600080608085870312156131dc57600080fd5b84356131e781613089565b966020860135965060408601359560600135945092505050565b6020808252825182820181905260009190848201906040850190845b818110156132395783518352928401929184019160010161321d565b50909695505050505050565b60006020828403121561325757600080fd5b81356113b781613089565b60008060006060848603121561327757600080fd5b833561328281613089565b9250602084013561329281613089565b929592945050506040919091013590565b6000602082840312156132b557600080fd5b5035919050565b6000806000606084860312156132d157600080fd5b83356132dc81613089565b95602085013595506040909401359392505050565b801515811461309e57600080fd5b60006020828403121561331157600080fd5b81356113b7816132f1565b600080600080600080600060e0888a03121561333757600080fd5b873561334281613089565b9650602088013561335281613089565b95506040880135945060608801359350608088013560ff8116811461337657600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156133a657600080fd5b82356133b181613089565b915060208301356133c181613089565b809150509250929050565b600080604083850312156133df57600080fd5b8235915060208301356133c181613089565b60006020828403121561340357600080fd5b81516113b7816132f1565b60018060a01b038616815284602082015283604082015260806060820152816080820152818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b60006020828403121561346c57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561349b5761349b613473565b500390565b60008160001904831182151516156134ba576134ba613473565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826134f257634e487b7160e01b600052601260045260246000fd5b500490565b600181811c9082168061350b57607f821691505b60208210810361352b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6000821982111561355a5761355a613473565b500190565b634e487b7160e01b600052603260045260246000fd5b60006001820161358757613587613473565b5060010190565b6000602082840312156135a057600080fd5b81516113b781613089565b600080835481600182811c9150808316806135c757607f831692505b602080841082036135e657634e487b7160e01b86526022600452602486fd5b8180156135fa576001811461360b57613638565b60ff19861689528489019650613638565b60008a81526020902060005b868110156136305781548b820152908501908301613617565b505084890196505b509498975050505050505050565b60008251613658818460208701613137565b919091019291505056fea2646970667358221220e7ea8b5302dc010ffc93dc478411e6f839fc957a448b429c1fba947f68b79f2764736f6c634300080d0033a264697066735822122071a63950ee65eca57ac64499d49db78a26495f8bdc2aeb341a31679655be774c64736f6c634300080d0033

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

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

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