GLMR Price: $0.51 (-3.40%)
Gas: 154 GWei

Contract

0x2b70A5B878665FfDB4A06Ba40a264d6c70f68F4B

Overview

GLMR Balance

Moonbeam Chain LogoMoonbeam Chain LogoMoonbeam Chain Logo0 GLMR

GLMR Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
0x617a696010715682022-05-21 9:20:12677 days ago1653124812IN
 Create: Vyper_contract
0 GLMR0.3078095100

Advanced mode:
Parent Txn Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.3.1

Optimization Enabled:
N/A

Other Settings:
None license

Contract Source Code (Vyper language format)

# @version 0.3.1
"""
@title StableSwap
@author Curve.Fi
@license Copyright (c) Curve.Fi, 2020-2021 - all rights reserved
@notice 3 coin pool implementation with no lending
@dev Optimized to only support ERC20's with 18 decimals that return True/revert
"""

from vyper.interfaces import ERC20

interface Factory:
    def convert_fees() -> bool: nonpayable
    def get_fee_receiver(_pool: address) -> address: view
    def admin() -> address: view

interface ERC1271:
    def isValidSignature(_hash: bytes32, _signature: Bytes[65]) -> bytes32: view


event Transfer:
    sender: indexed(address)
    receiver: indexed(address)
    value: uint256

event Approval:
    owner: indexed(address)
    spender: indexed(address)
    value: uint256

event TokenExchange:
    buyer: indexed(address)
    sold_id: int128
    tokens_sold: uint256
    bought_id: int128
    tokens_bought: uint256

event AddLiquidity:
    provider: indexed(address)
    token_amounts: uint256[N_COINS]
    fees: uint256[N_COINS]
    invariant: uint256
    token_supply: uint256

event RemoveLiquidity:
    provider: indexed(address)
    token_amounts: uint256[N_COINS]
    fees: uint256[N_COINS]
    token_supply: uint256

event RemoveLiquidityOne:
    provider: indexed(address)
    token_amount: uint256
    coin_amount: uint256
    token_supply: uint256

event RemoveLiquidityImbalance:
    provider: indexed(address)
    token_amounts: uint256[N_COINS]
    fees: uint256[N_COINS]
    invariant: uint256
    token_supply: uint256

event RampA:
    old_A: uint256
    new_A: uint256
    initial_time: uint256
    future_time: uint256

event StopRampA:
    A: uint256
    t: uint256


N_COINS: constant(int128) = 3
PRECISION: constant(int128) = 10 ** 18

FEE_DENOMINATOR: constant(uint256) = 10 ** 10
ADMIN_FEE: constant(uint256) = 5000000000

A_PRECISION: constant(uint256) = 100
MAX_A: constant(uint256) = 10 ** 6
MAX_A_CHANGE: constant(uint256) = 10
MIN_RAMP_TIME: constant(uint256) = 86400

factory: address

coins: public(address[N_COINS])
balances: public(uint256[N_COINS])
fee: public(uint256)  # fee * 1e10

initial_A: public(uint256)
future_A: public(uint256)
initial_A_time: public(uint256)
future_A_time: public(uint256)

EIP712_TYPEHASH: constant(bytes32) = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")
PERMIT_TYPEHASH: constant(bytes32) = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)")

# keccak256("isValidSignature(bytes32,bytes)")[:4] << 224
ERC1271_MAGIC_VAL: constant(bytes32) = 0x1626ba7e00000000000000000000000000000000000000000000000000000000
VERSION: constant(String[8]) = "v5.0.0"


name: public(String[64])
symbol: public(String[32])

balanceOf: public(HashMap[address, uint256])
allowance: public(HashMap[address, HashMap[address, uint256]])
totalSupply: public(uint256)

DOMAIN_SEPARATOR: public(bytes32)
nonces: public(HashMap[address, uint256])


@external
def __init__():
    # we do this to prevent the implementation contract from being used as a pool
    self.fee = 31337


@external
def initialize(
    _name: String[32],
    _symbol: String[10],
    _coins: address[4],
    _rate_multipliers: uint256[4],
    _A: uint256,
    _fee: uint256,
):
    """
    @notice Contract constructor
    @param _name Name of the new pool
    @param _symbol Token symbol
    @param _coins List of all ERC20 conract addresses of coins
    @param _rate_multipliers List of number of decimals in coins
    @param _A Amplification coefficient multiplied by n ** (n - 1)
    @param _fee Fee to charge for exchanges
    """
    # check if fee was already set to prevent initializing contract twice
    assert self.fee == 0

    for i in range(N_COINS):
        coin: address = _coins[i]
        if coin == ZERO_ADDRESS:
            break
        self.coins[i] = coin
        assert _rate_multipliers[i] == PRECISION

    A: uint256 = _A * A_PRECISION
    self.initial_A = A
    self.future_A = A
    self.fee = _fee
    self.factory = msg.sender

    name: String[64] = concat("Curve.fi Factory Plain Pool: ", _name)
    self.name = name
    self.symbol = concat(_symbol, "-f")

    self.DOMAIN_SEPARATOR = keccak256(
        _abi_encode(EIP712_TYPEHASH, keccak256(name), keccak256(VERSION), chain.id, self)
    )

    # fire a transfer event so block explorers identify the contract as an ERC20
    log Transfer(ZERO_ADDRESS, self, 0)


### ERC20 Functionality ###

@view
@external
def decimals() -> uint256:
    """
    @notice Get the number of decimals for this token
    @dev Implemented as a view method to reduce gas costs
    @return uint256 decimal places
    """
    return 18


@internal
def _transfer(_from: address, _to: address, _value: uint256):
    # # NOTE: vyper does not allow underflows
    # #       so the following subtraction would revert on insufficient balance
    self.balanceOf[_from] -= _value
    self.balanceOf[_to] += _value

    log Transfer(_from, _to, _value)


@external
def transfer(_to : address, _value : uint256) -> bool:
    """
    @dev Transfer token for a specified address
    @param _to The address to transfer to.
    @param _value The amount to be transferred.
    """
    self._transfer(msg.sender, _to, _value)
    return True


@external
def transferFrom(_from : address, _to : address, _value : uint256) -> bool:
    """
     @dev Transfer tokens from one address to another.
     @param _from address The address which you want to send tokens from
     @param _to address The address which you want to transfer to
     @param _value uint256 the amount of tokens to be transferred
    """
    self._transfer(_from, _to, _value)

    _allowance: uint256 = self.allowance[_from][msg.sender]
    if _allowance != MAX_UINT256:
        self.allowance[_from][msg.sender] = _allowance - _value

    return True


@external
def approve(_spender : address, _value : uint256) -> bool:
    """
    @notice Approve the passed address to transfer the specified amount of
            tokens on behalf of msg.sender
    @dev Beware that changing an allowance via this method brings the risk that
         someone may use both the old and new allowance by unfortunate transaction
         ordering: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
    @param _spender The address which will transfer the funds
    @param _value The amount of tokens that may be transferred
    @return bool success
    """
    self.allowance[msg.sender][_spender] = _value

    log Approval(msg.sender, _spender, _value)
    return True


@external
def permit(
    _owner: address,
    _spender: address,
    _value: uint256,
    _deadline: uint256,
    _v: uint8,
    _r: bytes32,
    _s: bytes32
) -> bool:
    """
    @notice Approves spender by owner's signature to expend owner's tokens.
        See https://eips.ethereum.org/EIPS/eip-2612.
    @dev Inspired by https://github.com/yearn/yearn-vaults/blob/main/contracts/Vault.vy#L753-L793
    @dev Supports smart contract wallets which implement ERC1271
        https://eips.ethereum.org/EIPS/eip-1271
    @param _owner The address which is a source of funds and has signed the Permit.
    @param _spender The address which is allowed to spend the funds.
    @param _value The amount of tokens to be spent.
    @param _deadline The timestamp after which the Permit is no longer valid.
    @param _v The bytes[64] of the valid secp256k1 signature of permit by owner
    @param _r The bytes[0:32] of the valid secp256k1 signature of permit by owner
    @param _s The bytes[32:64] of the valid secp256k1 signature of permit by owner
    @return True, if transaction completes successfully
    """
    assert _owner != ZERO_ADDRESS
    assert block.timestamp <= _deadline

    nonce: uint256 = self.nonces[_owner]
    digest: bytes32 = keccak256(
        concat(
            b"\x19\x01",
            self.DOMAIN_SEPARATOR,
            keccak256(_abi_encode(PERMIT_TYPEHASH, _owner, _spender, _value, nonce, _deadline))
        )
    )

    if _owner.is_contract:
        sig: Bytes[65] = concat(_abi_encode(_r, _s), slice(convert(_v, bytes32), 31, 1))
        # reentrancy not a concern since this is a staticcall
        assert ERC1271(_owner).isValidSignature(digest, sig) == ERC1271_MAGIC_VAL
    else:
        assert ecrecover(digest, convert(_v, uint256), convert(_r, uint256), convert(_s, uint256)) == _owner

    self.allowance[_owner][_spender] = _value
    self.nonces[_owner] = nonce + 1

    log Approval(_owner, _spender, _value)
    return True


### StableSwap Functionality ###

@view
@external
def get_balances() -> uint256[N_COINS]:
    return self.balances


@view
@internal
def _A() -> uint256:
    """
    Handle ramping A up or down
    """
    t1: uint256 = self.future_A_time
    A1: uint256 = self.future_A

    if block.timestamp < t1:
        A0: uint256 = self.initial_A
        t0: uint256 = self.initial_A_time
        # Expressions in uint256 cannot have negative numbers, thus "if"
        if A1 > A0:
            return A0 + (A1 - A0) * (block.timestamp - t0) / (t1 - t0)
        else:
            return A0 - (A0 - A1) * (block.timestamp - t0) / (t1 - t0)

    else:  # when t1 == 0 or block.timestamp >= t1
        return A1


@view
@external
def admin_fee() -> uint256:
    return ADMIN_FEE


@view
@external
def A() -> uint256:
    return self._A() / A_PRECISION


@view
@external
def A_precise() -> uint256:
    return self._A()


@pure
@internal
def get_D(_xp: uint256[N_COINS], _amp: uint256) -> uint256:
    """
    D invariant calculation in non-overflowing integer operations
    iteratively

    A * sum(x_i) * n**n + D = A * D * n**n + D**(n+1) / (n**n * prod(x_i))

    Converging solution:
    D[j+1] = (A * n**n * sum(x_i) - D[j]**(n+1) / (n**n prod(x_i))) / (A * n**n - 1)
    """
    S: uint256 = 0
    Dprev: uint256 = 0
    for x in _xp:
        S += x
    if S == 0:
        return 0

    D: uint256 = S
    Ann: uint256 = _amp * N_COINS
    for i in range(255):
        D_P: uint256 = D
        for x in _xp:
            D_P = D_P * D / (x * N_COINS)  # If division by 0, this will be borked: only withdrawal will work. And that is good
        Dprev = D
        D = (Ann * S / A_PRECISION + D_P * N_COINS) * D / ((Ann - A_PRECISION) * D / A_PRECISION + (N_COINS + 1) * D_P)
        # Equality with the precision of 1
        if D > Dprev:
            if D - Dprev <= 1:
                return D
        else:
            if Dprev - D <= 1:
                return D
    # convergence typically occurs in 4 rounds or less, this should be unreachable!
    # if it does happen the pool is borked and LPs can withdraw via `remove_liquidity`
    raise


@view
@external
def get_virtual_price() -> uint256:
    """
    @notice The current virtual price of the pool LP token
    @dev Useful for calculating profits
    @return LP token virtual price normalized to 1e18
    """
    amp: uint256 = self._A()
    D: uint256 = self.get_D(self.balances, amp)
    # D is in the units similar to DAI (e.g. converted to precision 1e18)
    # When balanced, D = n * x_u - total virtual value of the portfolio
    return D * PRECISION / self.totalSupply


@view
@external
def calc_token_amount(_amounts: uint256[N_COINS], _is_deposit: bool) -> uint256:
    """
    @notice Calculate addition or reduction in token supply from a deposit or withdrawal
    @dev This calculation accounts for slippage, but not fees.
         Needed to prevent front-running, not for precise calculations!
    @param _amounts Amount of each coin being deposited
    @param _is_deposit set True for deposits, False for withdrawals
    @return Expected amount of LP tokens received
    """
    amp: uint256 = self._A()
    balances: uint256[N_COINS] = self.balances

    D0: uint256 = self.get_D(balances, amp)
    for i in range(N_COINS):
        amount: uint256 = _amounts[i]
        if _is_deposit:
            balances[i] += amount
        else:
            balances[i] -= amount
    D1: uint256 = self.get_D(balances, amp)
    diff: uint256 = 0
    if _is_deposit:
        diff = D1 - D0
    else:
        diff = D0 - D1
    return diff * self.totalSupply / D0


@external
@nonreentrant('lock')
def add_liquidity(
    _amounts: uint256[N_COINS],
    _min_mint_amount: uint256,
    _receiver: address = msg.sender
) -> uint256:
    """
    @notice Deposit coins into the pool
    @param _amounts List of amounts of coins to deposit
    @param _min_mint_amount Minimum amount of LP tokens to mint from the deposit
    @param _receiver Address that owns the minted LP tokens
    @return Amount of LP tokens received by depositing
    """
    amp: uint256 = self._A()
    old_balances: uint256[N_COINS] = self.balances

    # Initial invariant
    D0: uint256 = self.get_D(old_balances, amp)

    total_supply: uint256 = self.totalSupply
    new_balances: uint256[N_COINS] = old_balances
    for i in range(N_COINS):
        amount: uint256 = _amounts[i]
        if total_supply == 0:
            assert amount > 0  # dev: initial deposit requires all coins
        new_balances[i] += amount

    # Invariant after change
    D1: uint256 = self.get_D(new_balances, amp)
    assert D1 > D0

    # We need to recalculate the invariant accounting for fees
    # to calculate fair user's share
    fees: uint256[N_COINS] = empty(uint256[N_COINS])
    mint_amount: uint256 = 0
    if total_supply > 0:
        # Only account for fees if we are not the first to deposit
        base_fee: uint256 = self.fee * N_COINS / (4 * (N_COINS - 1))
        for i in range(N_COINS):
            ideal_balance: uint256 = D1 * old_balances[i] / D0
            difference: uint256 = 0
            new_balance: uint256 = new_balances[i]
            if ideal_balance > new_balance:
                difference = ideal_balance - new_balance
            else:
                difference = new_balance - ideal_balance
            fees[i] = base_fee * difference / FEE_DENOMINATOR
            self.balances[i] = new_balance - (fees[i] * ADMIN_FEE / FEE_DENOMINATOR)
            new_balances[i] -= fees[i]
        D2: uint256 = self.get_D(new_balances, amp)
        mint_amount = total_supply * (D2 - D0) / D0
    else:
        self.balances = new_balances
        mint_amount = D1  # Take the dust if there was any

    assert mint_amount >= _min_mint_amount, "Slippage screwed you"

    # Take coins from the sender
    for i in range(N_COINS):
        amount: uint256 = _amounts[i]
        if amount > 0:
            assert ERC20(self.coins[i]).transferFrom(msg.sender, self, amount)

    # Mint pool tokens
    total_supply += mint_amount
    self.balanceOf[_receiver] += mint_amount
    self.totalSupply = total_supply
    log Transfer(ZERO_ADDRESS, _receiver, mint_amount)

    log AddLiquidity(msg.sender, _amounts, fees, D1, total_supply)

    return mint_amount


@view
@internal
def get_y(i: int128, j: int128, x: uint256, xp: uint256[N_COINS]) -> uint256:
    """
    Calculate x[j] if one makes x[i] = x

    Done by solving quadratic equation iteratively.
    x_1**2 + x_1 * (sum' - (A*n**n - 1) * D / (A * n**n)) = D ** (n + 1) / (n ** (2 * n) * prod' * A)
    x_1**2 + b*x_1 = c

    x_1 = (x_1**2 + c) / (2*x_1 + b)
    """
    # x in the input is converted to the same price/precision

    assert i != j       # dev: same coin
    assert j >= 0       # dev: j below zero
    assert j < N_COINS  # dev: j above N_COINS

    # should be unreachable, but good for safety
    assert i >= 0
    assert i < N_COINS

    amp: uint256 = self._A()
    D: uint256 = self.get_D(xp, amp)
    S_: uint256 = 0
    _x: uint256 = 0
    y_prev: uint256 = 0
    c: uint256 = D
    Ann: uint256 = amp * N_COINS

    for _i in range(N_COINS):
        if _i == i:
            _x = x
        elif _i != j:
            _x = xp[_i]
        else:
            continue
        S_ += _x
        c = c * D / (_x * N_COINS)

    c = c * D * A_PRECISION / (Ann * N_COINS)
    b: uint256 = S_ + D * A_PRECISION / Ann  # - D
    y: uint256 = D

    for _i in range(255):
        y_prev = y
        y = (y*y + c) / (2 * y + b - D)
        # Equality with the precision of 1
        if y > y_prev:
            if y - y_prev <= 1:
                return y
        else:
            if y_prev - y <= 1:
                return y
    raise


@view
@external
def get_dy(i: int128, j: int128, dx: uint256) -> uint256:
    """
    @notice Calculate the current output dy given input dx
    @dev Index values can be found via the `coins` public getter method
    @param i Index value for the coin to send
    @param j Index valie of the coin to recieve
    @param dx Amount of `i` being exchanged
    @return Amount of `j` predicted
    """
    xp: uint256[N_COINS] = self.balances

    x: uint256 = xp[i] + dx
    y: uint256 = self.get_y(i, j, x, xp)
    dy: uint256 = xp[j] - y - 1
    fee: uint256 = self.fee * dy / FEE_DENOMINATOR
    return dy - fee


@external
@nonreentrant('lock')
def exchange(
    i: int128,
    j: int128,
    _dx: uint256,
    _min_dy: uint256,
    _receiver: address = msg.sender,
) -> uint256:
    """
    @notice Perform an exchange between two coins
    @dev Index values can be found via the `coins` public getter method
    @param i Index value for the coin to send
    @param j Index valie of the coin to recieve
    @param _dx Amount of `i` being exchanged
    @param _min_dy Minimum amount of `j` to receive
    @return Actual amount of `j` received
    """
    old_balances: uint256[N_COINS] = self.balances

    x: uint256 = old_balances[i] + _dx
    y: uint256 = self.get_y(i, j, x, old_balances)

    dy: uint256 = old_balances[j] - y - 1  # -1 just in case there were some rounding errors
    dy_fee: uint256 = dy * self.fee / FEE_DENOMINATOR

    # Convert all to real units
    dy -= dy_fee
    assert dy >= _min_dy, "Exchange resulted in fewer coins than expected"

    dy_admin_fee: uint256 = dy_fee * ADMIN_FEE / FEE_DENOMINATOR

    # Change balances exactly in same way as we change actual ERC20 coin amounts
    self.balances[i] = old_balances[i] + _dx
    # When rounding errors happen, we undercharge admin fee in favor of LP
    self.balances[j] = old_balances[j] - dy - dy_admin_fee

    assert ERC20(self.coins[i]).transferFrom(msg.sender, self, _dx)
    assert ERC20(self.coins[j]).transfer(_receiver, dy)

    log TokenExchange(msg.sender, i, _dx, j, dy)

    return dy


@external
@nonreentrant('lock')
def remove_liquidity(
    _burn_amount: uint256,
    _min_amounts: uint256[N_COINS],
    _receiver: address = msg.sender
) -> uint256[N_COINS]:
    """
    @notice Withdraw coins from the pool
    @dev Withdrawal amounts are based on current deposit ratios
    @param _burn_amount Quantity of LP tokens to burn in the withdrawal
    @param _min_amounts Minimum amounts of underlying coins to receive
    @param _receiver Address that receives the withdrawn coins
    @return List of amounts of coins that were withdrawn
    """
    total_supply: uint256 = self.totalSupply
    amounts: uint256[N_COINS] = empty(uint256[N_COINS])

    for i in range(N_COINS):
        old_balance: uint256 = self.balances[i]
        value: uint256 = old_balance * _burn_amount / total_supply
        assert value >= _min_amounts[i], "Withdrawal resulted in fewer coins than expected"
        self.balances[i] = old_balance - value
        amounts[i] = value
        assert ERC20(self.coins[i]).transfer(_receiver, value)

    total_supply -= _burn_amount
    self.balanceOf[msg.sender] -= _burn_amount
    self.totalSupply = total_supply
    log Transfer(msg.sender, ZERO_ADDRESS, _burn_amount)

    log RemoveLiquidity(msg.sender, amounts, empty(uint256[N_COINS]), total_supply)

    return amounts


@external
@nonreentrant('lock')
def remove_liquidity_imbalance(
    _amounts: uint256[N_COINS],
    _max_burn_amount: uint256,
    _receiver: address = msg.sender
) -> uint256:
    """
    @notice Withdraw coins from the pool in an imbalanced amount
    @param _amounts List of amounts of underlying coins to withdraw
    @param _max_burn_amount Maximum amount of LP token to burn in the withdrawal
    @param _receiver Address that receives the withdrawn coins
    @return Actual amount of the LP token burned in the withdrawal
    """
    amp: uint256 = self._A()
    old_balances: uint256[N_COINS] = self.balances
    D0: uint256 = self.get_D(old_balances, amp)

    new_balances: uint256[N_COINS] = old_balances
    for i in range(N_COINS):
        new_balances[i] -= _amounts[i]
    D1: uint256 = self.get_D(new_balances, amp)

    fees: uint256[N_COINS] = empty(uint256[N_COINS])
    base_fee: uint256 = self.fee * N_COINS / (4 * (N_COINS - 1))
    for i in range(N_COINS):
        ideal_balance: uint256 = D1 * old_balances[i] / D0
        difference: uint256 = 0
        new_balance: uint256 = new_balances[i]
        if ideal_balance > new_balance:
            difference = ideal_balance - new_balance
        else:
            difference = new_balance - ideal_balance
        fees[i] = base_fee * difference / FEE_DENOMINATOR
        self.balances[i] = new_balance - (fees[i] * ADMIN_FEE / FEE_DENOMINATOR)
        new_balances[i] -= fees[i]
    D2: uint256 = self.get_D(new_balances, amp)

    total_supply: uint256 = self.totalSupply
    burn_amount: uint256 = ((D0 - D2) * total_supply / D0) + 1
    assert burn_amount > 1  # dev: zero tokens burned
    assert burn_amount <= _max_burn_amount, "Slippage screwed you"

    total_supply -= burn_amount
    self.totalSupply = total_supply
    self.balanceOf[msg.sender] -= burn_amount
    log Transfer(msg.sender, ZERO_ADDRESS, burn_amount)

    for i in range(N_COINS):
        if _amounts[i] != 0:
            assert ERC20(self.coins[i]).transfer(_receiver, _amounts[i])

    log RemoveLiquidityImbalance(msg.sender, _amounts, fees, D1, total_supply)

    return burn_amount


@pure
@internal
def get_y_D(A: uint256, i: int128, xp: uint256[N_COINS], D: uint256) -> uint256:
    """
    Calculate x[i] if one reduces D from being calculated for xp to D

    Done by solving quadratic equation iteratively.
    x_1**2 + x_1 * (sum' - (A*n**n - 1) * D / (A * n**n)) = D ** (n + 1) / (n ** (2 * n) * prod' * A)
    x_1**2 + b*x_1 = c

    x_1 = (x_1**2 + c) / (2*x_1 + b)
    """
    # x in the input is converted to the same price/precision

    assert i >= 0  # dev: i below zero
    assert i < N_COINS  # dev: i above N_COINS

    S_: uint256 = 0
    _x: uint256 = 0
    y_prev: uint256 = 0
    c: uint256 = D
    Ann: uint256 = A * N_COINS

    for _i in range(N_COINS):
        if _i != i:
            _x = xp[_i]
        else:
            continue
        S_ += _x
        c = c * D / (_x * N_COINS)

    c = c * D * A_PRECISION / (Ann * N_COINS)
    b: uint256 = S_ + D * A_PRECISION / Ann
    y: uint256 = D

    for _i in range(255):
        y_prev = y
        y = (y*y + c) / (2 * y + b - D)
        # Equality with the precision of 1
        if y > y_prev:
            if y - y_prev <= 1:
                return y
        else:
            if y_prev - y <= 1:
                return y
    raise


@view
@internal
def _calc_withdraw_one_coin(_burn_amount: uint256, i: int128) -> uint256[2]:
    # First, need to calculate
    # * Get current D
    # * Solve Eqn against y_i for D - _token_amount
    amp: uint256 = self._A()
    balances: uint256[N_COINS] = self.balances
    D0: uint256 = self.get_D(balances, amp)

    total_supply: uint256 = self.totalSupply
    D1: uint256 = D0 - _burn_amount * D0 / total_supply
    new_y: uint256 = self.get_y_D(amp, i, balances, D1)

    base_fee: uint256 = self.fee * N_COINS / (4 * (N_COINS - 1))
    xp_reduced: uint256[N_COINS] = empty(uint256[N_COINS])

    for j in range(N_COINS):
        dx_expected: uint256 = 0
        xp_j: uint256 = balances[j]
        if j == i:
            dx_expected = xp_j * D1 / D0 - new_y
        else:
            dx_expected = xp_j - xp_j * D1 / D0
        xp_reduced[j] = xp_j - base_fee * dx_expected / FEE_DENOMINATOR

    dy: uint256 = xp_reduced[i] - self.get_y_D(amp, i, xp_reduced, D1)
    dy_0: uint256 = (balances[i] - new_y)  # w/o fees
    dy = (dy - 1)  # Withdraw less to account for rounding errors

    return [dy, dy_0 - dy]


@view
@external
def calc_withdraw_one_coin(_burn_amount: uint256, i: int128) -> uint256:
    """
    @notice Calculate the amount received when withdrawing a single coin
    @param _burn_amount Amount of LP tokens to burn in the withdrawal
    @param i Index value of the coin to withdraw
    @return Amount of coin received
    """
    return self._calc_withdraw_one_coin(_burn_amount, i)[0]


@external
@nonreentrant('lock')
def remove_liquidity_one_coin(
    _burn_amount: uint256,
    i: int128,
    _min_received: uint256,
    _receiver: address = msg.sender,
) -> uint256:
    """
    @notice Withdraw a single coin from the pool
    @param _burn_amount Amount of LP tokens to burn in the withdrawal
    @param i Index value of the coin to withdraw
    @param _min_received Minimum amount of coin to receive
    @param _receiver Address that receives the withdrawn coins
    @return Amount of coin received
    """
    dy: uint256[2] = self._calc_withdraw_one_coin(_burn_amount, i)
    assert dy[0] >= _min_received, "Not enough coins removed"

    self.balances[i] -= (dy[0] + dy[1] * ADMIN_FEE / FEE_DENOMINATOR)
    total_supply: uint256 = self.totalSupply - _burn_amount
    self.totalSupply = total_supply
    self.balanceOf[msg.sender] -= _burn_amount
    log Transfer(msg.sender, ZERO_ADDRESS, _burn_amount)

    assert ERC20(self.coins[i]).transfer(_receiver, dy[0])

    log RemoveLiquidityOne(msg.sender, _burn_amount, dy[0], total_supply)

    return dy[0]


@external
def ramp_A(_future_A: uint256, _future_time: uint256):
    assert msg.sender == Factory(self.factory).admin()  # dev: only owner
    assert block.timestamp >= self.initial_A_time + MIN_RAMP_TIME
    assert _future_time >= block.timestamp + MIN_RAMP_TIME  # dev: insufficient time

    _initial_A: uint256 = self._A()
    _future_A_p: uint256 = _future_A * A_PRECISION

    assert _future_A > 0 and _future_A < MAX_A
    if _future_A_p < _initial_A:
        assert _future_A_p * MAX_A_CHANGE >= _initial_A
    else:
        assert _future_A_p <= _initial_A * MAX_A_CHANGE

    self.initial_A = _initial_A
    self.future_A = _future_A_p
    self.initial_A_time = block.timestamp
    self.future_A_time = _future_time

    log RampA(_initial_A, _future_A_p, block.timestamp, _future_time)


@external
def stop_ramp_A():
    assert msg.sender == Factory(self.factory).admin()  # dev: only owner

    current_A: uint256 = self._A()
    self.initial_A = current_A
    self.future_A = current_A
    self.initial_A_time = block.timestamp
    self.future_A_time = block.timestamp
    # now (block.timestamp < t1) is always False, so we return saved A

    log StopRampA(current_A, block.timestamp)


@view
@external
def admin_balances(i: uint256) -> uint256:
    return ERC20(self.coins[i]).balanceOf(self) - self.balances[i]


@external
def withdraw_admin_fees():
    receiver: address = Factory(self.factory).get_fee_receiver(self)

    for i in range(N_COINS):
        coin: address = self.coins[i]
        fees: uint256 = ERC20(coin).balanceOf(self) - self.balances[i]
        ERC20(coin).transfer(receiver, fees)


@view
@external
def version() -> String[8]:
    """
    @notice Get the version of this token contract
    """
    return VERSION

Contract Security Audit

Contract ABI

[{"name":"Transfer","inputs":[{"name":"sender","type":"address","indexed":true},{"name":"receiver","type":"address","indexed":true},{"name":"value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"Approval","inputs":[{"name":"owner","type":"address","indexed":true},{"name":"spender","type":"address","indexed":true},{"name":"value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"TokenExchange","inputs":[{"name":"buyer","type":"address","indexed":true},{"name":"sold_id","type":"int128","indexed":false},{"name":"tokens_sold","type":"uint256","indexed":false},{"name":"bought_id","type":"int128","indexed":false},{"name":"tokens_bought","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"AddLiquidity","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"token_amounts","type":"uint256[3]","indexed":false},{"name":"fees","type":"uint256[3]","indexed":false},{"name":"invariant","type":"uint256","indexed":false},{"name":"token_supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"RemoveLiquidity","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"token_amounts","type":"uint256[3]","indexed":false},{"name":"fees","type":"uint256[3]","indexed":false},{"name":"token_supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"RemoveLiquidityOne","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"token_amount","type":"uint256","indexed":false},{"name":"coin_amount","type":"uint256","indexed":false},{"name":"token_supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"RemoveLiquidityImbalance","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"token_amounts","type":"uint256[3]","indexed":false},{"name":"fees","type":"uint256[3]","indexed":false},{"name":"invariant","type":"uint256","indexed":false},{"name":"token_supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"RampA","inputs":[{"name":"old_A","type":"uint256","indexed":false},{"name":"new_A","type":"uint256","indexed":false},{"name":"initial_time","type":"uint256","indexed":false},{"name":"future_time","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"StopRampA","inputs":[{"name":"A","type":"uint256","indexed":false},{"name":"t","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"initialize","inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_coins","type":"address[4]"},{"name":"_rate_multipliers","type":"uint256[4]"},{"name":"_A","type":"uint256"},{"name":"_fee","type":"uint256"}],"outputs":[],"gas":482307},{"stateMutability":"view","type":"function","name":"decimals","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":390},{"stateMutability":"nonpayable","type":"function","name":"transfer","inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}],"gas":79005},{"stateMutability":"nonpayable","type":"function","name":"transferFrom","inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}],"gas":116985},{"stateMutability":"nonpayable","type":"function","name":"approve","inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}],"gas":39211},{"stateMutability":"nonpayable","type":"function","name":"permit","inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_deadline","type":"uint256"},{"name":"_v","type":"uint8"},{"name":"_r","type":"bytes32"},{"name":"_s","type":"bytes32"}],"outputs":[{"name":"","type":"bool"}],"gas":102281},{"stateMutability":"view","type":"function","name":"get_balances","inputs":[],"outputs":[{"name":"","type":"uint256[3]"}],"gas":6894},{"stateMutability":"view","type":"function","name":"admin_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":570},{"stateMutability":"view","type":"function","name":"A","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":10508},{"stateMutability":"view","type":"function","name":"A_precise","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":10508},{"stateMutability":"view","type":"function","name":"get_virtual_price","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":945519},{"stateMutability":"view","type":"function","name":"calc_token_amount","inputs":[{"name":"_amounts","type":"uint256[3]"},{"name":"_is_deposit","type":"bool"}],"outputs":[{"name":"","type":"uint256"}],"gas":1873508},{"stateMutability":"nonpayable","type":"function","name":"add_liquidity","inputs":[{"name":"_amounts","type":"uint256[3]"},{"name":"_min_mint_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":3068394},{"stateMutability":"nonpayable","type":"function","name":"add_liquidity","inputs":[{"name":"_amounts","type":"uint256[3]"},{"name":"_min_mint_amount","type":"uint256"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":3068394},{"stateMutability":"view","type":"function","name":"get_dy","inputs":[{"name":"i","type":"int128"},{"name":"j","type":"int128"},{"name":"dx","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":1292587},{"stateMutability":"nonpayable","type":"function","name":"exchange","inputs":[{"name":"i","type":"int128"},{"name":"j","type":"int128"},{"name":"_dx","type":"uint256"},{"name":"_min_dy","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":1437116},{"stateMutability":"nonpayable","type":"function","name":"exchange","inputs":[{"name":"i","type":"int128"},{"name":"j","type":"int128"},{"name":"_dx","type":"uint256"},{"name":"_min_dy","type":"uint256"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":1437116},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity","inputs":[{"name":"_burn_amount","type":"uint256"},{"name":"_min_amounts","type":"uint256[3]"}],"outputs":[{"name":"","type":"uint256[3]"}],"gas":278164},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity","inputs":[{"name":"_burn_amount","type":"uint256"},{"name":"_min_amounts","type":"uint256[3]"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256[3]"}],"gas":278164},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_imbalance","inputs":[{"name":"_amounts","type":"uint256[3]"},{"name":"_max_burn_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":3068106},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_imbalance","inputs":[{"name":"_amounts","type":"uint256[3]"},{"name":"_max_burn_amount","type":"uint256"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":3068106},{"stateMutability":"view","type":"function","name":"calc_withdraw_one_coin","inputs":[{"name":"_burn_amount","type":"uint256"},{"name":"i","type":"int128"}],"outputs":[{"name":"","type":"uint256"}],"gas":1232},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_one_coin","inputs":[{"name":"_burn_amount","type":"uint256"},{"name":"i","type":"int128"},{"name":"_min_received","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":1828732},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_one_coin","inputs":[{"name":"_burn_amount","type":"uint256"},{"name":"i","type":"int128"},{"name":"_min_received","type":"uint256"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":1828732},{"stateMutability":"nonpayable","type":"function","name":"ramp_A","inputs":[{"name":"_future_A","type":"uint256"},{"name":"_future_time","type":"uint256"}],"outputs":[],"gas":161164},{"stateMutability":"nonpayable","type":"function","name":"stop_ramp_A","inputs":[],"outputs":[],"gas":157387},{"stateMutability":"view","type":"function","name":"admin_balances","inputs":[{"name":"i","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":7829},{"stateMutability":"nonpayable","type":"function","name":"withdraw_admin_fees","inputs":[],"outputs":[],"gas":33631},{"stateMutability":"view","type":"function","name":"version","inputs":[],"outputs":[{"name":"","type":"string"}],"gas":6677},{"stateMutability":"view","type":"function","name":"coins","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"address"}],"gas":3225},{"stateMutability":"view","type":"function","name":"balances","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":3255},{"stateMutability":"view","type":"function","name":"fee","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3240},{"stateMutability":"view","type":"function","name":"initial_A","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3270},{"stateMutability":"view","type":"function","name":"future_A","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3300},{"stateMutability":"view","type":"function","name":"initial_A_time","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3330},{"stateMutability":"view","type":"function","name":"future_A_time","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3360},{"stateMutability":"view","type":"function","name":"name","inputs":[],"outputs":[{"name":"","type":"string"}],"gas":13679},{"stateMutability":"view","type":"function","name":"symbol","inputs":[],"outputs":[{"name":"","type":"string"}],"gas":11438},{"stateMutability":"view","type":"function","name":"balanceOf","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":3716},{"stateMutability":"view","type":"function","name":"allowance","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":4012},{"stateMutability":"view","type":"function","name":"totalSupply","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3510},{"stateMutability":"view","type":"function","name":"DOMAIN_SEPARATOR","inputs":[],"outputs":[{"name":"","type":"bytes32"}],"gas":3540},{"stateMutability":"view","type":"function","name":"nonces","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":3836}]

617a6960085561366356600436101561000d57612931565b60046000601c37600051346136545763a461b3c8811861039357600435600401602081351161365457808035602001808260e037505050602435600401600a813511613654578080356020018082610120375050506044358060a01c61365457610160526064358060a01c61365457610180526084358060a01c613654576101a05260a4358060a01c613654576101c052600854613654576101e060006003818352015b6101606101e051600481101561365457602002015161020052610200516100d757610118565b6102005160016101e0516003811015613654570260020155670de0b6b3a764000060206101e0510260c40135186136545781516001018083528114156100b1575b505061014435606480820282158284830414171561365457905090506101e0526101e0516009556101e051600a5561016435600855336001556000601d610260527f43757276652e666920466163746f727920506c61696e20506f6f6c3a2000000061028052610260601d806020846102a00101826020850160045afa50508051820191505060e06020806020846102a00101826020850160045afa505080518201915050806102a0526102a09050805160200180610200828460045afa9050505061020080600d602082510160c060006003818352015b8260c051602002111561020257610221565b60c05160200285015160c05185015581516001018083528114156101f0575b5050505050506000610120600a806020846102a00101826020850160045afa5050805182019150506002610260527f2d66000000000000000000000000000000000000000000000000000000000000610280526102606002806020846102a00101826020850160045afa505080518201915050806102a0526102a09050806010602082510160c060006002818352015b8260c05160200211156102c3576102e2565b60c05160200285015160c05185015581516001018083528114156102b1575b5050505050507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61034052610200805160208201209050610360527f572f01d824885a118d5d21c74542f263b131d2897955c62a721594f1d7c3b2e261038052466103a052306103c05260a0610320526103208051602082012090506015553060007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000610260526020610260a3005b63313ce56781186103a957601260e052602060e0f35b63a9059cbb81186103eb576004358060a01c61365457610160523360e0526101605161010052602435610120526103de612937565b6001610180526020610180f35b6323b872dd81186104bf576004358060a01c61365457610160526024358060a01c61365457610180526101605160e052610180516101005260443561012052610432612937565b60136101605160a05260805260406080203360a0526080526040608020546101a0527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101a051146104b2576101a051604435808210613654578082039050905060136101605160a05260805260406080203360a0526080526040608020555b60016101c05260206101c0f35b63095ea7b38118610537576004358060a01c6136545760e05260243560133360a052608052604060802060e05160a05260805260406080205560e051337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925602435610100526020610100a36001610100526020610100f35b63d505accf81186108a4576004358060a01c6136545760e0526024358060a01c61365457610100526084358060081c6136545761012052600060e0511461365457606435421161365457601660e05160a0526080526040608020546101405260006002610400527f1901000000000000000000000000000000000000000000000000000000000000610420526104006002806020846106000101826020850160045afa5050805182019150506015546020826106000101526020810190507f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c96105405260e0516105605261010051610580526044356105a052610140516105c0526064356105e05260c0610520526105208051602082012090506020826106000101526020810190508061060052610600905080516020820120905061016052600060e0513b116106b85760e0516101605161018052610120516101a052604060a46101c03760206080608061018060015afa506080511861365457610818565b600060a4356102205260c435610240526040610200526102006040806020846102c00101826020850160045afa505080518201915050601f60016020820661026001602082840111613654576020806102808261012060045afa5050818152905090506001806020846102c00101826020850160045afa505080518201915050806102c0526102c09050805160200180610180828460045afa905050507f1626ba7e00000000000000000000000000000000000000000000000000000000631626ba7e610200526102208060406101605182526020820191508082528083018061018080516020018083828460045afa905050508051806020830101818260206001820306601f8201039050033682375050805160200160206001820306601f820103905090509050810150505050602061020060c461021c60e0515afa610805573d600060003e3d6000fd5b601f3d1115613654576102005118613654575b604435601360e05160a05260805260406080206101005160a05260805260406080205561014051600181818301106136545780820190509050601660e05160a0526080526040608020556101005160e0517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925604435610180526020610180a36001610180526020610180f35b6314f0597981186108c95760055460e0526006546101005260075461012052606060e0f35b63fee3f7f981186108e35764012a05f20060e052602060e0f35b63f446c1d08118610911576108f96101606129c0565b61016051606480820490509050610180526020610180f35b6376a2f0f08118610936576109276101606129c0565b61016051610180526020610180f35b63bb7b8b8081186109bf5761094c6102806129c0565b610280516102605260055460e0526006546101005260075461012052610260516101405261097b6102a0612afb565b6102a0516102805261028051670de0b6b3a76400008082028215828483041417156136545790509050601454808015613654578204905090506102a05260206102a0f35b633883e1198118610b76576064358060011c61365457610260526109e46102a06129c0565b6102a051610280526005546102a0526006546102c0526007546102e0526102a05160e0526102c051610100526102e051610120526102805161014052610a2b610320612afb565b610320516103005261032060006003818352015b60206103205102600401356103405261026051610a86576102a061032051600381101561365457602002018051610340518082106136545780820390509050815250610ab4565b6102a06103205160038110156136545760200201805161034051818183011061365457808201905090508152505b8151600101808352811415610a3f5750506102a05160e0526102c051610100526102e051610120526102805161014052610aef610340612afb565b610340516103205260006103405261026051610b24576103005161032051808210613654578082039050905061034052610b3f565b61032051610300518082106136545780820390509050610340525b6103405160145480820282158284830414171561365457905090506103005180801561365457820490509050610360526020610360f35b634515cef38118610b8b573361026052610ba6565b6375b96abc8118611161576084358060a01c61365457610260525b600054613654576001600055610bbd6102a06129c0565b6102a051610280526005546102a0526006546102c0526007546102e0526102a05160e0526102c051610100526102e051610120526102805161014052610c04610320612afb565b6103205161030052601454610320526102a051610340526102c051610360526102e051610380526103a060006003818352015b60206103a05102600401356103c05261032051610c5b5760006103c0511115613654575b6103406103a0516003811015613654576020020180516103c051818183011061365457808201905090508152508151600101808352811415610c375750506103405160e052610360516101005261038051610120526102805161014052610cc36103c0612afb565b6103c0516103a052610300516103a0511115613654576080366103c03760006103205111610d0d576103405160055561036051600655610380516007556103a05161042052610f4a565b600854600380820282158284830414171561365457905090506008808204905090506104405261046060006003818352015b6103a0516102a0610460516003811015613654576020020151808202821582848304141715613654579050905061030051808015613654578204905090506104805260006104a0526103406104605160038110156136545760200201516104c0526104c0516104805111610dcc576104c0516104805180821061365457808203905090506104a052610de7565b610480516104c05180821061365457808203905090506104a0525b610440516104a05180820282158284830414171561365457905090506402540be400808204905090506103c06104605160038110156136545760200201526104c0516103c061046051600381101561365457602002015164012a05f20080820282158284830414171561365457905090506402540be4008082049050905080821061365457808203905090506001610460516003811015613654570260050155610340610460516003811015613654576020020180516103c061046051600381101561365457602002015180821061365457808203905090508152508151600101808352811415610d3f5750506103405160e052610360516101005261038051610120526102805161014052610efe610480612afb565b6104805161046052610320516104605161030051808210613654578082039050905080820282158284830414171561365457905090506103005180801561365457820490509050610420525b606435610420511015610fce576014610440527f536c697070616765207363726577656420796f750000000000000000000000006104605261044050610440518061046001818260206001820306601f82010390500336823750506308c379a0610400526020610420526104405160206001820306601f820103905060440161041cfd5b61044060006003818352015b6020610440510260040135610460526000610460511115611054576323b872dd61048052336104a052306104c052610460516104e0526020610480606461049c600060016104405160038110156136545702600201545af1611041573d600060003e3d6000fd5b601f3d1115613654576104805115613654575b8151600101808352811415610fda5750506103208051610420518181830110613654578082019050905081525060126102605160a052608052604060802080546104205181818301106136545780820190509050815550610320516014556102605160007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef61042051610440526020610440a3337f423f6495a08fc652425cf4ed0d1f9e37e571d9b9529b1c1c23cce780b2e7df0d6004356104405260243561046052604435610480526103c0516104a0526103e0516104c052610400516104e0526103a051610500526103205161052052610100610440a2610420516104405260206104406000600055f35b635e0d443f81186112a0576004358060801d81607f1d1861365457610460526024358060801d81607f1d1861365457610480526005546104a0526006546104c0526007546104e0526104a0610460516003811015613654576020020151604435818183011061365457808201905090506105005261046051610260526104805161028052610500516102a0526104a0516102c0526104c0516102e0526104e05161030052611210610540612d68565b61054051610520526104a061048051600381101561365457602002015161052051808210613654578082039050905060018082106136545780820390509050610540526008546105405180820282158284830414171561365457905090506402540be400808204905090506105605261054051610560518082106136545780820390509050610580526020610580f35b633df0212481186112b557336104a0526112d0565b63ddc1f59d811861167e576084358060a01c613654576104a0525b6004358060801d81607f1d1861365457610460526024358060801d81607f1d1861365457610480526000546136545760016000556005546104c0526006546104e052600754610500526104c0610460516003811015613654576020020151604435818183011061365457808201905090506105205261046051610260526104805161028052610520516102a0526104c0516102c0526104e0516102e0526105005161030052611380610560612d68565b61056051610540526104c061048051600381101561365457602002015161054051808210613654578082039050905060018082106136545780820390509050610560526105605160085480820282158284830414171561365457905090506402540be400808204905090506105805261056080516105805180821061365457808203905090508152506064356105605110156114b257602e6105a0527f45786368616e676520726573756c74656420696e20666577657220636f696e736105c0527f207468616e2065787065637465640000000000000000000000000000000000006105e0526105a0506105a051806105c001818260206001820306601f82010390500336823750506308c379a0610560526020610580526105a05160206001820306601f820103905060440161057cfd5b6105805164012a05f20080820282158284830414171561365457905090506402540be400808204905090506105a0526104c06104605160038110156136545760200201516044358181830110613654578082019050905060016104605160038110156136545702600501556104c06104805160038110156136545760200201516105605180821061365457808203905090506105a051808210613654578082039050905060016104805160038110156136545702600501556323b872dd6105c052336105e05230610600526044356106205260206105c060646105dc600060016104605160038110156136545702600201545af16115b5573d600060003e3d6000fd5b601f3d1115613654576105c051156136545763a9059cbb6105c0526104a0516105e052610560516106005260206105c060446105dc600060016104805160038110156136545702600201545af1611611573d600060003e3d6000fd5b601f3d1115613654576105c0511561365457337f8b3e96f2b889fa771c53c981b40daf005f63f637f1869f707052d15a3dd97140610460516105c0526044356105e0526104805161060052610560516106205260806105c0a2610560516105c05260206105c06000600055f35b63ecb586a58118611692573360e0526116ac565b632da5dc218118611962576084358060a01c6136545760e0525b600054613654576001600055601454610100526060366101203761018060006003818352015b60016101805160038110156136545702600501546101a0526101a051600435808202821582848304141715613654579050905061010051808015613654578204905090506101c05260206101805102602401356101c05110156117cb5760306101e0527f5769746864726177616c20726573756c74656420696e20666577657220636f69610200527f6e73207468616e20657870656374656400000000000000000000000000000000610220526101e0506101e0518061020001818260206001820306601f82010390500336823750506308c379a06101a05260206101c0526101e05160206001820306601f82010390506044016101bcfd5b6101a0516101c051808210613654578082039050905060016101805160038110156136545702600501556101c05161012061018051600381101561365457602002015263a9059cbb6101e05260e051610200526101c0516102205260206101e060446101fc600060016101805160038110156136545702600201545af1611857573d600060003e3d6000fd5b601f3d1115613654576101e051156136545781516001018083528114156116d25750506101008051600435808210613654578082039050905081525060123360a052608052604060802080546004358082106136545780820390509050815550610100516014556000337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600435610180526020610180a3337fa49d4cf02656aebf8c771f5a8585638a2a15ee6c97cf7205d4208ed7c1df252d6101205161018052610140516101a052610160516101c0526060366101e037610100516102405260e0610180a26101205161018052610140516101a052610160516101c05260606101806000600055f35b639fdaea0c8118611977573361026052611992565b639504fae88118611f02576084358060a01c61365457610260525b6000546136545760016000556119a96102a06129c0565b6102a051610280526005546102a0526006546102c0526007546102e0526102a05160e0526102c051610100526102e0516101205261028051610140526119f0610320612afb565b61032051610300526102a051610320526102c051610340526102e0516103605261038060006003818352015b61032061038051600381101561365457602002018051602061038051026004013580821061365457808203905090508152508151600101808352811415611a1c5750506103205160e052610340516101005261036051610120526102805161014052611a896103a0612afb565b6103a051610380526060366103a037600854600380820282158284830414171561365457905090506008808204905090506104005261042060006003818352015b610380516102a0610420516003811015613654576020020151808202821582848304141715613654579050905061030051808015613654578204905090506104405260006104605261032061042051600381101561365457602002015161048052610480516104405111611b57576104805161044051808210613654578082039050905061046052611b72565b61044051610480518082106136545780820390509050610460525b610400516104605180820282158284830414171561365457905090506402540be400808204905090506103a0610420516003811015613654576020020152610480516103a061042051600381101561365457602002015164012a05f20080820282158284830414171561365457905090506402540be4008082049050905080821061365457808203905090506001610420516003811015613654570260050155610320610420516003811015613654576020020180516103a061042051600381101561365457602002015180821061365457808203905090508152508151600101808352811415611aca5750506103205160e052610340516101005261036051610120526102805161014052611c89610440612afb565b61044051610420526014546104405261030051610420518082106136545780820390509050610440518082028215828483041417156136545790509050610300518080156136545782049050905060018181830110613654578082019050905061046052600161046051111561365457606435610460511115611d7d576014610480527f536c697070616765207363726577656420796f750000000000000000000000006104a0526104805061048051806104a001818260206001820306601f82010390500336823750506308c379a0610440526020610460526104805160206001820306601f820103905060440161045cfd5b61044080516104605180821061365457808203905090508152506104405160145560123360a052608052604060802080546104605180821061365457808203905090508155506000337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef61046051610480526020610480a361048060006003818352015b6000602061048051026004013514611e775763a9059cbb6104a052610260516104c05260206104805102600401356104e05260206104a060446104bc600060016104805160038110156136545702600201545af1611e64573d600060003e3d6000fd5b601f3d1115613654576104a05115613654575b8151600101808352811415611e01575050337f173599dbf9c6ca6f7c3b590df07ae98a45d74ff54065505141e7de6c46a624c2600435610480526024356104a0526044356104c0526103a0516104e0526103c051610500526103e0516105205261038051610540526104405161056052610100610480a2610460516104805260206104806000600055f35b63cc2b27d78118611f4a576024358060801d81607f1d18613654576104c0526004356102a0526104c0516102c052611f3b6104e0613350565b6104e051610520526020610520f35b631a4d01d28118611f5f57336104e052611f7a565b63081579a581186121d3576064358060a01c613654576104e0525b6024358060801d81607f1d18613654576104c0526000546136545760016000556004356102a0526104c0516102c052611fb4610540613350565b6105408051610500528060200151610520525060443561050051101561204b576018610540527f4e6f7420656e6f75676820636f696e732072656d6f76656400000000000000006105605261054050610540518061056001818260206001820306601f82010390500336823750506308c379a0610500526020610520526105405160206001820306601f820103905060440161051cfd5b60016104c051600381101561365457026005018054610500516105205164012a05f20080820282158284830414171561365457905090506402540be400808204905090508181830110613654578082019050905080821061365457808203905090508155506014546004358082106136545780820390509050610540526105405160145560123360a0526080526040608020805460043580821061365457808203905090508155506000337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600435610560526020610560a363a9059cbb610560526104e05161058052610500516105a0526020610560604461057c600060016104c05160038110156136545702600201545af161216e573d600060003e3d6000fd5b601f3d111561365457610560511561365457337f5ad056f2e28a8cec232015406b843668c1e36cda598127ec3b8c59b8c72773a0600435610560526105005161058052610540516105a0526060610560a2610500516105605260206105606000600055f35b633c157e6481186123575763f851a440610160526020610160600461017c6001545afa612205573d600060003e3d6000fd5b601f3d11156136545761016051331861365457600b546201518081818301106136545780820190509050421061365457426201518081818301106136545780820190509050602435106136545761225d6101806129c0565b6101805161016052600435606480820282158284830414171561365457905090506101805260006004351161229357600061229c565b620f4240600435105b15613654576101605161018051106122d65761016051600a80820282158284830414171561365457905090506101805111613654576122fa565b6101605161018051600a808202821582848304141715613654579050905010613654575b6101605160095561018051600a5542600b55602435600c557fa2b71ec6df949300b59aab36b55e189697b750119dd349fcfa8c0f779e83c254610160516101a052610180516101c052426101e0526024356102005260806101a0a1005b63551a658881186123fb5763f851a440610160526020610160600461017c6001545afa612389573d600060003e3d6000fd5b601f3d111561365457610160513318613654576123a76101806129c0565b61018051610160526101605160095561016051600a5542600b5542600c557f46e22fb3709ad289f62ce63d469248536dbc78d82b84a3d7e74ad606dc2019386101605161018052426101a0526040610180a1005b63e2e7d2648118612477576370a0823160e0523061010052602060e0602460fc600160043560038110156136545702600201545afa61243f573d600060003e3d6000fd5b601f3d11156136545760e051600160043560038110156136545702600501548082106136545780820390509050610120526020610120f35b6330c5408581186125a35763154aa8f56101005230610120526020610100602461011c6001545afa6124ae573d600060003e3d6000fd5b601f3d111561365457610100518060a01c6136545760e05261010060006003818352015b6001610100516003811015613654570260020154610120526370a082316101605230610180526020610160602461017c610120515afa612517573d600060003e3d6000fd5b601f3d11156136545761016051600161010051600381101561365457026005015480821061365457808203905090506101405263a9059cbb6101605260e05161018052610140516101a0526020610160604461017c6000610120515af1612583573d600060003e3d6000fd5b601f3d1115613654576101605081516001018083528114156124d2575050005b6354fd4d50811861263d57610120806020808252600660e0527f76352e302e3000000000000000000000000000000000000000000000000000006101005260e0818401808280516020018083828460045afa905050508051806020830101818260206001820306601f8201039050033682375050805160200160206001820306601f82010390509050905090508101905090509050610120f35b63c66106578118612664576001600435600381101561365457026002015460e052602060e0f35b634903b0d1811861268b576001600435600381101561365457026005015460e052602060e0f35b63ddca3f4381186126a25760085460e052602060e0f35b635409491a81186126b95760095460e052602060e0f35b63b4b577ad81186126d057600a5460e052602060e0f35b632081066c81186126e757600b5460e052602060e0f35b631405228881186126fe57600c5460e052602060e0f35b6306fdde0381186127a15760e080602080825280830180600d8082602082540160c060006003818352015b8260c051602002111561273b5761275a565b60c05185015460c0516020028501528151600101808352811415612729575b5050505050508051806020830101818260206001820306601f8201039050033682375050805160200160206001820306601f820103905090509050810190509050905060e0f35b6395d89b4181186128445760e08060208082528083018060108082602082540160c060006002818352015b8260c05160200211156127de576127fd565b60c05185015460c05160200285015281516001018083528114156127cc575b5050505050508051806020830101818260206001820306601f8201039050033682375050805160200160206001820306601f820103905090509050810190509050905060e0f35b6370a082318118612879576004358060a01c6136545760e052601260e05160a052608052604060802054610100526020610100f35b63dd62ed3e81186128cc576004358060a01c6136545760e0526024358060a01c6136545761010052601360e05160a05260805260406080206101005160a052608052604060802054610120526020610120f35b6318160ddd81186128e35760145460e052602060e0f35b633644e51581186128fa5760155460e052602060e0f35b637ecebe00811861292f576004358060a01c6136545760e052601660e05160a052608052604060802054610100526020610100f35b505b60006000fd5b601260e05160a0526080526040608020805461012051808210613654578082039050905081555060126101005160a0526080526040608020805461012051818183011061365457808201905090508155506101005160e0517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef61012051610140526020610140a3565b600c5460e052600a546101005260e05142106129e65761010051815250612af956612af9565b60095461012052600b5461014052610120516101005111612a7e57610120516101205161010051808210613654578082039050905042610140518082106136545780820390509050808202821582848304141715613654579050905060e051610140518082106136545780820390509050808015613654578204905090508082106136545780820390509050815250612af956612af9565b610120516101005161012051808210613654578082039050905042610140518082106136545780820390509050808202821582848304141715613654579050905060e0516101405180821061365457808203905090508080156136545782049050905081818301106136545780820190509050815250612af9565b565b604036610160376101c060006003818352015b60206101c0510260e001516101a05261016080516101a051818183011061365457808201905090508152508151600101808352811415612b0e57505061016051612b5c576000815250612d66565b610160516101a05261014051600380820282158284830414171561365457905090506101c0526101e0600060ff818352015b6101a0516102005261024060006003818352015b6020610240510260e0015161022052610200516101a0518082028215828483041417156136545790509050610220516003808202821582848304141715613654579050905080801561365457820490509050610200528151600101808352811415612ba25750506101a051610180526101c0516101605180820282158284830414171561365457905090506064808204905090506102005160038082028215828483041417156136545790509050818183011061365457808201905090506101a05180820282158284830414171561365457905090506101c051606480821061365457808203905090506101a0518082028215828483041417156136545790509050606480820490509050600461020051808202821582848304141715613654579050905081818301106136545780820190509050808015613654578204905090506101a052610180516101a05111612d24576001610180516101a051808210613654578082039050905011612d4f5750506101a051815250612d6656612d4f565b60016101a05161018051808210613654578082039050905011612d4f5750506101a051815250612d66565b8151600101808352811415612b8e57505060006000fd5b565b6102805161026051146136545760006102805112613654576003610280511215613654576000610260511261365457600361026051121561365457612dae6103406129c0565b61034051610320526102c05160e0526102e0516101005261030051610120526103205161014052612de0610360612afb565b610360516103405260603661036037610340516103c05261032051600380820282158284830414171561365457905090506103e05261040060006003818352015b610260516104005118612e3b576102a05161038052612e6c565b61028051610400511415612e5257612ed056612e6c565b6102c0610400516003811015613654576020020151610380525b610360805161038051818183011061365457808201905090508152506103c0516103405180820282158284830414171561365457905090506103805160038082028215828483041417156136545790509050808015613654578204905090506103c0525b8151600101808352811415612e215750506103c051610340518082028215828483041417156136545790509050606480820282158284830414171561365457905090506103e05160038082028215828483041417156136545790509050808015613654578204905090506103c0526103605161034051606480820282158284830414171561365457905090506103e0518080156136545782049050905081818301106136545780820190509050610400526103405161042052610440600060ff818352015b610420516103a052610420516104205180820282158284830414171561365457905090506103c051818183011061365457808201905090506002610420518082028215828483041417156136545790509050610400518181830110613654578082019050905061034051808210613654578082039050905080801561365457820490509050610420526103a051610420511161305a5760016103a051610420518082106136545780820390509050116130855750506104205181525061309c56613085565b6001610420516103a0518082106136545780820390509050116130855750506104205181525061309c565b8151600101808352811415612f9557505060006000fd5b565b60006101005112613654576003610100511215613654576060366101a037610180516102005260e051600380820282158284830414171561365457905090506102205261024060006003818352015b61010051610240511415613104576131825661311e565b6101206102405160038110156136545760200201516101c0525b6101a080516101c05181818301106136545780820190509050815250610200516101805180820282158284830414171561365457905090506101c0516003808202821582848304141715613654579050905080801561365457820490509050610200525b81516001018083528114156130ed5750506102005161018051808202821582848304141715613654579050905060648082028215828483041417156136545790509050610220516003808202821582848304141715613654579050905080801561365457820490509050610200526101a0516101805160648082028215828483041417156136545790509050610220518080156136545782049050905081818301106136545780820190509050610240526101805161026052610280600060ff818352015b610260516101e0526102605161026051808202821582848304141715613654579050905061020051818183011061365457808201905090506002610260518082028215828483041417156136545790509050610240518181830110613654578082019050905061018051808210613654578082039050905080801561365457820490509050610260526101e051610260511161330c5760016101e051610260518082106136545780820390509050116133375750506102605181525061334e56613337565b6001610260516101e0518082106136545780820390509050116133375750506102605181525061334e565b815160010180835281141561324757505060006000fd5b565b61335b6103006129c0565b610300516102e0526005546103005260065461032052600754610340526103005160e052610320516101005261034051610120526102e051610140526133a2610380612afb565b610380516103605260145461038052610360516102a051610360518082028215828483041417156136545790509050610380518080156136545782049050905080821061365457808203905090506103a0526102e05160e0526102c051610100526103005161012052610320516101405261034051610160526103a0516101805261342e6103e061309e565b6103e0516103c052600854600380820282158284830414171561365457905090506008808204905090506103e0526060366104003761046060006003818352015b6000610480526103006104605160038110156136545760200201516104a0526102c05161046051186134e3576104a0516103a051808202821582848304141715613654579050905061036051808015613654578204905090506103c051808210613654578082039050905061048052613527565b6104a0516104a0516103a051808202821582848304141715613654579050905061036051808015613654578204905090508082106136545780820390509050610480525b6104a0516103e0516104805180820282158284830414171561365457905090506402540be400808204905090508082106136545780820390509050610400610460516003811015613654576020020152815160010180835281141561346f5750506104006102c05160038110156136545760200201516102e05160e0526102c051610100526104005161012052610420516101405261044051610160526103a051610180526135d761048061309e565b610480518082106136545780820390509050610460526103006102c05160038110156136545760200201516103c05180821061365457808203905090506104805261046051600180821061365457808203905090506104605261046051815261048051610460518082106136545780820390509050816020015250565b600080fd5b61000a6136630361000a60003961000a613663036000f3

Deployed Bytecode

0x600436101561000d57612931565b60046000601c37600051346136545763a461b3c8811861039357600435600401602081351161365457808035602001808260e037505050602435600401600a813511613654578080356020018082610120375050506044358060a01c61365457610160526064358060a01c61365457610180526084358060a01c613654576101a05260a4358060a01c613654576101c052600854613654576101e060006003818352015b6101606101e051600481101561365457602002015161020052610200516100d757610118565b6102005160016101e0516003811015613654570260020155670de0b6b3a764000060206101e0510260c40135186136545781516001018083528114156100b1575b505061014435606480820282158284830414171561365457905090506101e0526101e0516009556101e051600a5561016435600855336001556000601d610260527f43757276652e666920466163746f727920506c61696e20506f6f6c3a2000000061028052610260601d806020846102a00101826020850160045afa50508051820191505060e06020806020846102a00101826020850160045afa505080518201915050806102a0526102a09050805160200180610200828460045afa9050505061020080600d602082510160c060006003818352015b8260c051602002111561020257610221565b60c05160200285015160c05185015581516001018083528114156101f0575b5050505050506000610120600a806020846102a00101826020850160045afa5050805182019150506002610260527f2d66000000000000000000000000000000000000000000000000000000000000610280526102606002806020846102a00101826020850160045afa505080518201915050806102a0526102a09050806010602082510160c060006002818352015b8260c05160200211156102c3576102e2565b60c05160200285015160c05185015581516001018083528114156102b1575b5050505050507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61034052610200805160208201209050610360527f572f01d824885a118d5d21c74542f263b131d2897955c62a721594f1d7c3b2e261038052466103a052306103c05260a0610320526103208051602082012090506015553060007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000610260526020610260a3005b63313ce56781186103a957601260e052602060e0f35b63a9059cbb81186103eb576004358060a01c61365457610160523360e0526101605161010052602435610120526103de612937565b6001610180526020610180f35b6323b872dd81186104bf576004358060a01c61365457610160526024358060a01c61365457610180526101605160e052610180516101005260443561012052610432612937565b60136101605160a05260805260406080203360a0526080526040608020546101a0527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101a051146104b2576101a051604435808210613654578082039050905060136101605160a05260805260406080203360a0526080526040608020555b60016101c05260206101c0f35b63095ea7b38118610537576004358060a01c6136545760e05260243560133360a052608052604060802060e05160a05260805260406080205560e051337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925602435610100526020610100a36001610100526020610100f35b63d505accf81186108a4576004358060a01c6136545760e0526024358060a01c61365457610100526084358060081c6136545761012052600060e0511461365457606435421161365457601660e05160a0526080526040608020546101405260006002610400527f1901000000000000000000000000000000000000000000000000000000000000610420526104006002806020846106000101826020850160045afa5050805182019150506015546020826106000101526020810190507f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c96105405260e0516105605261010051610580526044356105a052610140516105c0526064356105e05260c0610520526105208051602082012090506020826106000101526020810190508061060052610600905080516020820120905061016052600060e0513b116106b85760e0516101605161018052610120516101a052604060a46101c03760206080608061018060015afa506080511861365457610818565b600060a4356102205260c435610240526040610200526102006040806020846102c00101826020850160045afa505080518201915050601f60016020820661026001602082840111613654576020806102808261012060045afa5050818152905090506001806020846102c00101826020850160045afa505080518201915050806102c0526102c09050805160200180610180828460045afa905050507f1626ba7e00000000000000000000000000000000000000000000000000000000631626ba7e610200526102208060406101605182526020820191508082528083018061018080516020018083828460045afa905050508051806020830101818260206001820306601f8201039050033682375050805160200160206001820306601f820103905090509050810150505050602061020060c461021c60e0515afa610805573d600060003e3d6000fd5b601f3d1115613654576102005118613654575b604435601360e05160a05260805260406080206101005160a05260805260406080205561014051600181818301106136545780820190509050601660e05160a0526080526040608020556101005160e0517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925604435610180526020610180a36001610180526020610180f35b6314f0597981186108c95760055460e0526006546101005260075461012052606060e0f35b63fee3f7f981186108e35764012a05f20060e052602060e0f35b63f446c1d08118610911576108f96101606129c0565b61016051606480820490509050610180526020610180f35b6376a2f0f08118610936576109276101606129c0565b61016051610180526020610180f35b63bb7b8b8081186109bf5761094c6102806129c0565b610280516102605260055460e0526006546101005260075461012052610260516101405261097b6102a0612afb565b6102a0516102805261028051670de0b6b3a76400008082028215828483041417156136545790509050601454808015613654578204905090506102a05260206102a0f35b633883e1198118610b76576064358060011c61365457610260526109e46102a06129c0565b6102a051610280526005546102a0526006546102c0526007546102e0526102a05160e0526102c051610100526102e051610120526102805161014052610a2b610320612afb565b610320516103005261032060006003818352015b60206103205102600401356103405261026051610a86576102a061032051600381101561365457602002018051610340518082106136545780820390509050815250610ab4565b6102a06103205160038110156136545760200201805161034051818183011061365457808201905090508152505b8151600101808352811415610a3f5750506102a05160e0526102c051610100526102e051610120526102805161014052610aef610340612afb565b610340516103205260006103405261026051610b24576103005161032051808210613654578082039050905061034052610b3f565b61032051610300518082106136545780820390509050610340525b6103405160145480820282158284830414171561365457905090506103005180801561365457820490509050610360526020610360f35b634515cef38118610b8b573361026052610ba6565b6375b96abc8118611161576084358060a01c61365457610260525b600054613654576001600055610bbd6102a06129c0565b6102a051610280526005546102a0526006546102c0526007546102e0526102a05160e0526102c051610100526102e051610120526102805161014052610c04610320612afb565b6103205161030052601454610320526102a051610340526102c051610360526102e051610380526103a060006003818352015b60206103a05102600401356103c05261032051610c5b5760006103c0511115613654575b6103406103a0516003811015613654576020020180516103c051818183011061365457808201905090508152508151600101808352811415610c375750506103405160e052610360516101005261038051610120526102805161014052610cc36103c0612afb565b6103c0516103a052610300516103a0511115613654576080366103c03760006103205111610d0d576103405160055561036051600655610380516007556103a05161042052610f4a565b600854600380820282158284830414171561365457905090506008808204905090506104405261046060006003818352015b6103a0516102a0610460516003811015613654576020020151808202821582848304141715613654579050905061030051808015613654578204905090506104805260006104a0526103406104605160038110156136545760200201516104c0526104c0516104805111610dcc576104c0516104805180821061365457808203905090506104a052610de7565b610480516104c05180821061365457808203905090506104a0525b610440516104a05180820282158284830414171561365457905090506402540be400808204905090506103c06104605160038110156136545760200201526104c0516103c061046051600381101561365457602002015164012a05f20080820282158284830414171561365457905090506402540be4008082049050905080821061365457808203905090506001610460516003811015613654570260050155610340610460516003811015613654576020020180516103c061046051600381101561365457602002015180821061365457808203905090508152508151600101808352811415610d3f5750506103405160e052610360516101005261038051610120526102805161014052610efe610480612afb565b6104805161046052610320516104605161030051808210613654578082039050905080820282158284830414171561365457905090506103005180801561365457820490509050610420525b606435610420511015610fce576014610440527f536c697070616765207363726577656420796f750000000000000000000000006104605261044050610440518061046001818260206001820306601f82010390500336823750506308c379a0610400526020610420526104405160206001820306601f820103905060440161041cfd5b61044060006003818352015b6020610440510260040135610460526000610460511115611054576323b872dd61048052336104a052306104c052610460516104e0526020610480606461049c600060016104405160038110156136545702600201545af1611041573d600060003e3d6000fd5b601f3d1115613654576104805115613654575b8151600101808352811415610fda5750506103208051610420518181830110613654578082019050905081525060126102605160a052608052604060802080546104205181818301106136545780820190509050815550610320516014556102605160007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef61042051610440526020610440a3337f423f6495a08fc652425cf4ed0d1f9e37e571d9b9529b1c1c23cce780b2e7df0d6004356104405260243561046052604435610480526103c0516104a0526103e0516104c052610400516104e0526103a051610500526103205161052052610100610440a2610420516104405260206104406000600055f35b635e0d443f81186112a0576004358060801d81607f1d1861365457610460526024358060801d81607f1d1861365457610480526005546104a0526006546104c0526007546104e0526104a0610460516003811015613654576020020151604435818183011061365457808201905090506105005261046051610260526104805161028052610500516102a0526104a0516102c0526104c0516102e0526104e05161030052611210610540612d68565b61054051610520526104a061048051600381101561365457602002015161052051808210613654578082039050905060018082106136545780820390509050610540526008546105405180820282158284830414171561365457905090506402540be400808204905090506105605261054051610560518082106136545780820390509050610580526020610580f35b633df0212481186112b557336104a0526112d0565b63ddc1f59d811861167e576084358060a01c613654576104a0525b6004358060801d81607f1d1861365457610460526024358060801d81607f1d1861365457610480526000546136545760016000556005546104c0526006546104e052600754610500526104c0610460516003811015613654576020020151604435818183011061365457808201905090506105205261046051610260526104805161028052610520516102a0526104c0516102c0526104e0516102e0526105005161030052611380610560612d68565b61056051610540526104c061048051600381101561365457602002015161054051808210613654578082039050905060018082106136545780820390509050610560526105605160085480820282158284830414171561365457905090506402540be400808204905090506105805261056080516105805180821061365457808203905090508152506064356105605110156114b257602e6105a0527f45786368616e676520726573756c74656420696e20666577657220636f696e736105c0527f207468616e2065787065637465640000000000000000000000000000000000006105e0526105a0506105a051806105c001818260206001820306601f82010390500336823750506308c379a0610560526020610580526105a05160206001820306601f820103905060440161057cfd5b6105805164012a05f20080820282158284830414171561365457905090506402540be400808204905090506105a0526104c06104605160038110156136545760200201516044358181830110613654578082019050905060016104605160038110156136545702600501556104c06104805160038110156136545760200201516105605180821061365457808203905090506105a051808210613654578082039050905060016104805160038110156136545702600501556323b872dd6105c052336105e05230610600526044356106205260206105c060646105dc600060016104605160038110156136545702600201545af16115b5573d600060003e3d6000fd5b601f3d1115613654576105c051156136545763a9059cbb6105c0526104a0516105e052610560516106005260206105c060446105dc600060016104805160038110156136545702600201545af1611611573d600060003e3d6000fd5b601f3d1115613654576105c0511561365457337f8b3e96f2b889fa771c53c981b40daf005f63f637f1869f707052d15a3dd97140610460516105c0526044356105e0526104805161060052610560516106205260806105c0a2610560516105c05260206105c06000600055f35b63ecb586a58118611692573360e0526116ac565b632da5dc218118611962576084358060a01c6136545760e0525b600054613654576001600055601454610100526060366101203761018060006003818352015b60016101805160038110156136545702600501546101a0526101a051600435808202821582848304141715613654579050905061010051808015613654578204905090506101c05260206101805102602401356101c05110156117cb5760306101e0527f5769746864726177616c20726573756c74656420696e20666577657220636f69610200527f6e73207468616e20657870656374656400000000000000000000000000000000610220526101e0506101e0518061020001818260206001820306601f82010390500336823750506308c379a06101a05260206101c0526101e05160206001820306601f82010390506044016101bcfd5b6101a0516101c051808210613654578082039050905060016101805160038110156136545702600501556101c05161012061018051600381101561365457602002015263a9059cbb6101e05260e051610200526101c0516102205260206101e060446101fc600060016101805160038110156136545702600201545af1611857573d600060003e3d6000fd5b601f3d1115613654576101e051156136545781516001018083528114156116d25750506101008051600435808210613654578082039050905081525060123360a052608052604060802080546004358082106136545780820390509050815550610100516014556000337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600435610180526020610180a3337fa49d4cf02656aebf8c771f5a8585638a2a15ee6c97cf7205d4208ed7c1df252d6101205161018052610140516101a052610160516101c0526060366101e037610100516102405260e0610180a26101205161018052610140516101a052610160516101c05260606101806000600055f35b639fdaea0c8118611977573361026052611992565b639504fae88118611f02576084358060a01c61365457610260525b6000546136545760016000556119a96102a06129c0565b6102a051610280526005546102a0526006546102c0526007546102e0526102a05160e0526102c051610100526102e0516101205261028051610140526119f0610320612afb565b61032051610300526102a051610320526102c051610340526102e0516103605261038060006003818352015b61032061038051600381101561365457602002018051602061038051026004013580821061365457808203905090508152508151600101808352811415611a1c5750506103205160e052610340516101005261036051610120526102805161014052611a896103a0612afb565b6103a051610380526060366103a037600854600380820282158284830414171561365457905090506008808204905090506104005261042060006003818352015b610380516102a0610420516003811015613654576020020151808202821582848304141715613654579050905061030051808015613654578204905090506104405260006104605261032061042051600381101561365457602002015161048052610480516104405111611b57576104805161044051808210613654578082039050905061046052611b72565b61044051610480518082106136545780820390509050610460525b610400516104605180820282158284830414171561365457905090506402540be400808204905090506103a0610420516003811015613654576020020152610480516103a061042051600381101561365457602002015164012a05f20080820282158284830414171561365457905090506402540be4008082049050905080821061365457808203905090506001610420516003811015613654570260050155610320610420516003811015613654576020020180516103a061042051600381101561365457602002015180821061365457808203905090508152508151600101808352811415611aca5750506103205160e052610340516101005261036051610120526102805161014052611c89610440612afb565b61044051610420526014546104405261030051610420518082106136545780820390509050610440518082028215828483041417156136545790509050610300518080156136545782049050905060018181830110613654578082019050905061046052600161046051111561365457606435610460511115611d7d576014610480527f536c697070616765207363726577656420796f750000000000000000000000006104a0526104805061048051806104a001818260206001820306601f82010390500336823750506308c379a0610440526020610460526104805160206001820306601f820103905060440161045cfd5b61044080516104605180821061365457808203905090508152506104405160145560123360a052608052604060802080546104605180821061365457808203905090508155506000337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef61046051610480526020610480a361048060006003818352015b6000602061048051026004013514611e775763a9059cbb6104a052610260516104c05260206104805102600401356104e05260206104a060446104bc600060016104805160038110156136545702600201545af1611e64573d600060003e3d6000fd5b601f3d1115613654576104a05115613654575b8151600101808352811415611e01575050337f173599dbf9c6ca6f7c3b590df07ae98a45d74ff54065505141e7de6c46a624c2600435610480526024356104a0526044356104c0526103a0516104e0526103c051610500526103e0516105205261038051610540526104405161056052610100610480a2610460516104805260206104806000600055f35b63cc2b27d78118611f4a576024358060801d81607f1d18613654576104c0526004356102a0526104c0516102c052611f3b6104e0613350565b6104e051610520526020610520f35b631a4d01d28118611f5f57336104e052611f7a565b63081579a581186121d3576064358060a01c613654576104e0525b6024358060801d81607f1d18613654576104c0526000546136545760016000556004356102a0526104c0516102c052611fb4610540613350565b6105408051610500528060200151610520525060443561050051101561204b576018610540527f4e6f7420656e6f75676820636f696e732072656d6f76656400000000000000006105605261054050610540518061056001818260206001820306601f82010390500336823750506308c379a0610500526020610520526105405160206001820306601f820103905060440161051cfd5b60016104c051600381101561365457026005018054610500516105205164012a05f20080820282158284830414171561365457905090506402540be400808204905090508181830110613654578082019050905080821061365457808203905090508155506014546004358082106136545780820390509050610540526105405160145560123360a0526080526040608020805460043580821061365457808203905090508155506000337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600435610560526020610560a363a9059cbb610560526104e05161058052610500516105a0526020610560604461057c600060016104c05160038110156136545702600201545af161216e573d600060003e3d6000fd5b601f3d111561365457610560511561365457337f5ad056f2e28a8cec232015406b843668c1e36cda598127ec3b8c59b8c72773a0600435610560526105005161058052610540516105a0526060610560a2610500516105605260206105606000600055f35b633c157e6481186123575763f851a440610160526020610160600461017c6001545afa612205573d600060003e3d6000fd5b601f3d11156136545761016051331861365457600b546201518081818301106136545780820190509050421061365457426201518081818301106136545780820190509050602435106136545761225d6101806129c0565b6101805161016052600435606480820282158284830414171561365457905090506101805260006004351161229357600061229c565b620f4240600435105b15613654576101605161018051106122d65761016051600a80820282158284830414171561365457905090506101805111613654576122fa565b6101605161018051600a808202821582848304141715613654579050905010613654575b6101605160095561018051600a5542600b55602435600c557fa2b71ec6df949300b59aab36b55e189697b750119dd349fcfa8c0f779e83c254610160516101a052610180516101c052426101e0526024356102005260806101a0a1005b63551a658881186123fb5763f851a440610160526020610160600461017c6001545afa612389573d600060003e3d6000fd5b601f3d111561365457610160513318613654576123a76101806129c0565b61018051610160526101605160095561016051600a5542600b5542600c557f46e22fb3709ad289f62ce63d469248536dbc78d82b84a3d7e74ad606dc2019386101605161018052426101a0526040610180a1005b63e2e7d2648118612477576370a0823160e0523061010052602060e0602460fc600160043560038110156136545702600201545afa61243f573d600060003e3d6000fd5b601f3d11156136545760e051600160043560038110156136545702600501548082106136545780820390509050610120526020610120f35b6330c5408581186125a35763154aa8f56101005230610120526020610100602461011c6001545afa6124ae573d600060003e3d6000fd5b601f3d111561365457610100518060a01c6136545760e05261010060006003818352015b6001610100516003811015613654570260020154610120526370a082316101605230610180526020610160602461017c610120515afa612517573d600060003e3d6000fd5b601f3d11156136545761016051600161010051600381101561365457026005015480821061365457808203905090506101405263a9059cbb6101605260e05161018052610140516101a0526020610160604461017c6000610120515af1612583573d600060003e3d6000fd5b601f3d1115613654576101605081516001018083528114156124d2575050005b6354fd4d50811861263d57610120806020808252600660e0527f76352e302e3000000000000000000000000000000000000000000000000000006101005260e0818401808280516020018083828460045afa905050508051806020830101818260206001820306601f8201039050033682375050805160200160206001820306601f82010390509050905090508101905090509050610120f35b63c66106578118612664576001600435600381101561365457026002015460e052602060e0f35b634903b0d1811861268b576001600435600381101561365457026005015460e052602060e0f35b63ddca3f4381186126a25760085460e052602060e0f35b635409491a81186126b95760095460e052602060e0f35b63b4b577ad81186126d057600a5460e052602060e0f35b632081066c81186126e757600b5460e052602060e0f35b631405228881186126fe57600c5460e052602060e0f35b6306fdde0381186127a15760e080602080825280830180600d8082602082540160c060006003818352015b8260c051602002111561273b5761275a565b60c05185015460c0516020028501528151600101808352811415612729575b5050505050508051806020830101818260206001820306601f8201039050033682375050805160200160206001820306601f820103905090509050810190509050905060e0f35b6395d89b4181186128445760e08060208082528083018060108082602082540160c060006002818352015b8260c05160200211156127de576127fd565b60c05185015460c05160200285015281516001018083528114156127cc575b5050505050508051806020830101818260206001820306601f8201039050033682375050805160200160206001820306601f820103905090509050810190509050905060e0f35b6370a082318118612879576004358060a01c6136545760e052601260e05160a052608052604060802054610100526020610100f35b63dd62ed3e81186128cc576004358060a01c6136545760e0526024358060a01c6136545761010052601360e05160a05260805260406080206101005160a052608052604060802054610120526020610120f35b6318160ddd81186128e35760145460e052602060e0f35b633644e51581186128fa5760155460e052602060e0f35b637ecebe00811861292f576004358060a01c6136545760e052601660e05160a052608052604060802054610100526020610100f35b505b60006000fd5b601260e05160a0526080526040608020805461012051808210613654578082039050905081555060126101005160a0526080526040608020805461012051818183011061365457808201905090508155506101005160e0517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef61012051610140526020610140a3565b600c5460e052600a546101005260e05142106129e65761010051815250612af956612af9565b60095461012052600b5461014052610120516101005111612a7e57610120516101205161010051808210613654578082039050905042610140518082106136545780820390509050808202821582848304141715613654579050905060e051610140518082106136545780820390509050808015613654578204905090508082106136545780820390509050815250612af956612af9565b610120516101005161012051808210613654578082039050905042610140518082106136545780820390509050808202821582848304141715613654579050905060e0516101405180821061365457808203905090508080156136545782049050905081818301106136545780820190509050815250612af9565b565b604036610160376101c060006003818352015b60206101c0510260e001516101a05261016080516101a051818183011061365457808201905090508152508151600101808352811415612b0e57505061016051612b5c576000815250612d66565b610160516101a05261014051600380820282158284830414171561365457905090506101c0526101e0600060ff818352015b6101a0516102005261024060006003818352015b6020610240510260e0015161022052610200516101a0518082028215828483041417156136545790509050610220516003808202821582848304141715613654579050905080801561365457820490509050610200528151600101808352811415612ba25750506101a051610180526101c0516101605180820282158284830414171561365457905090506064808204905090506102005160038082028215828483041417156136545790509050818183011061365457808201905090506101a05180820282158284830414171561365457905090506101c051606480821061365457808203905090506101a0518082028215828483041417156136545790509050606480820490509050600461020051808202821582848304141715613654579050905081818301106136545780820190509050808015613654578204905090506101a052610180516101a05111612d24576001610180516101a051808210613654578082039050905011612d4f5750506101a051815250612d6656612d4f565b60016101a05161018051808210613654578082039050905011612d4f5750506101a051815250612d66565b8151600101808352811415612b8e57505060006000fd5b565b6102805161026051146136545760006102805112613654576003610280511215613654576000610260511261365457600361026051121561365457612dae6103406129c0565b61034051610320526102c05160e0526102e0516101005261030051610120526103205161014052612de0610360612afb565b610360516103405260603661036037610340516103c05261032051600380820282158284830414171561365457905090506103e05261040060006003818352015b610260516104005118612e3b576102a05161038052612e6c565b61028051610400511415612e5257612ed056612e6c565b6102c0610400516003811015613654576020020151610380525b610360805161038051818183011061365457808201905090508152506103c0516103405180820282158284830414171561365457905090506103805160038082028215828483041417156136545790509050808015613654578204905090506103c0525b8151600101808352811415612e215750506103c051610340518082028215828483041417156136545790509050606480820282158284830414171561365457905090506103e05160038082028215828483041417156136545790509050808015613654578204905090506103c0526103605161034051606480820282158284830414171561365457905090506103e0518080156136545782049050905081818301106136545780820190509050610400526103405161042052610440600060ff818352015b610420516103a052610420516104205180820282158284830414171561365457905090506103c051818183011061365457808201905090506002610420518082028215828483041417156136545790509050610400518181830110613654578082019050905061034051808210613654578082039050905080801561365457820490509050610420526103a051610420511161305a5760016103a051610420518082106136545780820390509050116130855750506104205181525061309c56613085565b6001610420516103a0518082106136545780820390509050116130855750506104205181525061309c565b8151600101808352811415612f9557505060006000fd5b565b60006101005112613654576003610100511215613654576060366101a037610180516102005260e051600380820282158284830414171561365457905090506102205261024060006003818352015b61010051610240511415613104576131825661311e565b6101206102405160038110156136545760200201516101c0525b6101a080516101c05181818301106136545780820190509050815250610200516101805180820282158284830414171561365457905090506101c0516003808202821582848304141715613654579050905080801561365457820490509050610200525b81516001018083528114156130ed5750506102005161018051808202821582848304141715613654579050905060648082028215828483041417156136545790509050610220516003808202821582848304141715613654579050905080801561365457820490509050610200526101a0516101805160648082028215828483041417156136545790509050610220518080156136545782049050905081818301106136545780820190509050610240526101805161026052610280600060ff818352015b610260516101e0526102605161026051808202821582848304141715613654579050905061020051818183011061365457808201905090506002610260518082028215828483041417156136545790509050610240518181830110613654578082019050905061018051808210613654578082039050905080801561365457820490509050610260526101e051610260511161330c5760016101e051610260518082106136545780820390509050116133375750506102605181525061334e56613337565b6001610260516101e0518082106136545780820390509050116133375750506102605181525061334e565b815160010180835281141561324757505060006000fd5b565b61335b6103006129c0565b610300516102e0526005546103005260065461032052600754610340526103005160e052610320516101005261034051610120526102e051610140526133a2610380612afb565b610380516103605260145461038052610360516102a051610360518082028215828483041417156136545790509050610380518080156136545782049050905080821061365457808203905090506103a0526102e05160e0526102c051610100526103005161012052610320516101405261034051610160526103a0516101805261342e6103e061309e565b6103e0516103c052600854600380820282158284830414171561365457905090506008808204905090506103e0526060366104003761046060006003818352015b6000610480526103006104605160038110156136545760200201516104a0526102c05161046051186134e3576104a0516103a051808202821582848304141715613654579050905061036051808015613654578204905090506103c051808210613654578082039050905061048052613527565b6104a0516104a0516103a051808202821582848304141715613654579050905061036051808015613654578204905090508082106136545780820390509050610480525b6104a0516103e0516104805180820282158284830414171561365457905090506402540be400808204905090508082106136545780820390509050610400610460516003811015613654576020020152815160010180835281141561346f5750506104006102c05160038110156136545760200201516102e05160e0526102c051610100526104005161012052610420516101405261044051610160526103a051610180526135d761048061309e565b610480518082106136545780820390509050610460526103006102c05160038110156136545760200201516103c05180821061365457808203905090506104805261046051600180821061365457808203905090506104605261046051815261048051610460518082106136545780820390509050816020015250565b600080fd

Block Transaction Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.