Contract 0x960ea3e3c7fb317332d990873d354e18d7645590 3

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xafe5a5e5b412cf798d436650f9c023dda33fceaafd9bf53fc853de6edf007e78Exchange416560722022-11-27 15:34:2311 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00012529
0xfec6a4c995bb4419252f0cd63a2e83f0957f2178bc8fa055a5296f4ee62b9ec8Exchange416559912022-11-27 15:33:5812 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00008936
0xcacd8db243fc25aac70ce9df8f55561853c1304de57e420b040182c1af0f3311Exchange416525132022-11-27 15:18:1027 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00011239
0x1b5451757e5de0a87d756a953d1cb19c26bc973d1677a4c0f77e0c527c8d8e64Exchange416524472022-11-27 15:17:5228 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00011422
0x3e90329c37fe0b2c5e93ddce93186aa1785e3c286e94d8c58b90d6b01fa7899cExchange416498492022-11-27 15:05:5340 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00012056
0xf20cc2f7dbb66037dffff7141571340706940773d08e551f612ef86682b615daExchange416483412022-11-27 14:58:5047 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00011734
0x81c745861e4382b7f68c2a181e67fe21bd2cea8ee66702f6c7de3c70535e68c0Remove_liquidity...416477202022-11-27 14:55:3950 mins ago0x0e49d1d9effb862ff0a7984ac319ce3376cead57 IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00003507
0x8a2bcf0ff47b9c8b45576e02729aad8ee8d4f6d65a030d28a292c07f43ecf7adRemove_liquidity...416436632022-11-27 14:37:451 hr 8 mins ago0x065b53f1b9fa0501b88a9a349e2ca3579be15541 IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00003597
0x415ec4acb2ab5e15c48e50e6d6c9b9936ad1bffb4124e2770f9cb368c99dc316Exchange416423262022-11-27 14:31:451 hr 14 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00011019
0xaf32424e30980929facd5e8bd4e5619f715c0fa0a22621c17c5c0c73347e4c5fExchange416393332022-11-27 14:18:221 hr 27 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00008819
0x8bde577ca88c70c4e5110eb7ef16ead0820ceae7793319bdc0c9dba6518ea775Exchange416373012022-11-27 14:09:171 hr 36 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00012064
0x4e1f8d4f5963490f780d1c9e29112e396a59573ef1f6b28e4bc209fa93dca462Remove_liquidity...416338102022-11-27 13:53:281 hr 52 mins ago0x76d1ae8e3266a352fd9762671928f1f024e55b41 IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00003678
0x3df1bc85e00177e53ed70d31d76c22f2b02cae07f2a1554933302b577af7781fExchange416316742022-11-27 13:43:222 hrs 2 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00012696
0xcd0d948375bf4bd6b20eea863fa87fe1727511b6683ce03ead36a958cc2041fdExchange416275932022-11-27 13:22:502 hrs 23 mins ago0x8e122ea5105245583b6f2d7f776b6660f3203820 IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00004709
0xfb9af7afa814b66a868b44095623919b84ec6798e6cf64aec8e2cf9273a62591Exchange416256912022-11-27 13:13:402 hrs 32 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00009047
0x507f6cbb211ccd59c27cd392c55f52ec7649d067a5fced1687eafcae57001aa0Exchange416220062022-11-27 12:56:022 hrs 50 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00011563
0x84cd18dbb017f9b5b13180ca43543545f403fd53a4245a580d6b5bc767fda952Exchange416216422022-11-27 12:54:162 hrs 51 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00012277
0xfbd58fffbdf7074c059eab9dadf3518d218283126a35ab405d403503209bedb8Exchange416163222022-11-27 12:30:073 hrs 15 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.0001228
0x03ad2890d40d2942c629f20bbf19cbb48a9182a8ddb4da5f7c929b66b596a708Exchange416142052022-11-27 12:20:133 hrs 25 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00011907
0xca2d6bbe90e5d47ffb4dd51bc34adf62d33ab46f0bc60c0b55103ec1242b37adExchange416103652022-11-27 12:01:243 hrs 44 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00011778
0x3b1256324a6e76f130dad19b94538a4513e60a4efbfec7fb46aa021c0034d1b6Exchange416062992022-11-27 11:41:264 hrs 4 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.000122
0xb163de3f611de6e26042f201c81a9cddaf194f4ef4fd7b7fb99029eb79765fa6Exchange416040432022-11-27 11:30:234 hrs 15 mins ago0x9e602c1920443f01cb100a57a7f894df8eb42f66 IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00004215
0xb2d6d4fd6941cdfc43ee873618386c6fc583edfdb1581a2f98d4c94d85feb73aRemove_liquidity...416035512022-11-27 11:28:004 hrs 18 mins ago0xdd6fa21105fe98dff55577620712d27bfc6b2d0c IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.0000356
0x50db58b3cdca8f0352d9670fab19eb5d49e2eaddf1691fec49f2a8a7c2236e28Remove_liquidity...416032462022-11-27 11:26:344 hrs 19 mins ago0x9e602c1920443f01cb100a57a7f894df8eb42f66 IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00003707
0x16ec2d64cb90c68c80b17aedb79932da33972055ddbb00b561c76376137aee9dExchange416027312022-11-27 11:24:004 hrs 22 mins ago0x88928ff265a144aef2c5e228d536d9e477a68cfc IN  0x960ea3e3c7fb317332d990873d354e18d76455900 ETH0.00012394
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xc1f13b2418d2f53aa7f9cd1332a54cb96c8a4e5b01917875db7ecaf7561d2e67416581362022-11-27 15:43:562 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0xc1f13b2418d2f53aa7f9cd1332a54cb96c8a4e5b01917875db7ecaf7561d2e67416581362022-11-27 15:43:562 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x8e0b8c8bb9db49a46697f3a5bb8a308e744821d20 ETH
0xc1f13b2418d2f53aa7f9cd1332a54cb96c8a4e5b01917875db7ecaf7561d2e67416581362022-11-27 15:43:562 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0xc1f13b2418d2f53aa7f9cd1332a54cb96c8a4e5b01917875db7ecaf7561d2e67416581362022-11-27 15:43:562 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0xc1f13b2418d2f53aa7f9cd1332a54cb96c8a4e5b01917875db7ecaf7561d2e67416581362022-11-27 15:43:562 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90 ETH
0xc1f13b2418d2f53aa7f9cd1332a54cb96c8a4e5b01917875db7ecaf7561d2e67416581362022-11-27 15:43:562 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0xc1f13b2418d2f53aa7f9cd1332a54cb96c8a4e5b01917875db7ecaf7561d2e67416581362022-11-27 15:43:562 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0xc1f13b2418d2f53aa7f9cd1332a54cb96c8a4e5b01917875db7ecaf7561d2e67416581362022-11-27 15:43:562 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x82af49447d8a07e3bd95bd0d56f35241523fbab10 ETH
0xc1f13b2418d2f53aa7f9cd1332a54cb96c8a4e5b01917875db7ecaf7561d2e67416581362022-11-27 15:43:562 mins ago 0xdc723b71ca7ed367624a906a008893c69f291894 0x960ea3e3c7fb317332d990873d354e18d76455900 ETH
0x2d06905437b7fbbd60025422fcc62f3a9d25b0b5e3c5a43769d9fbee15e74e44416580392022-11-27 15:43:282 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0x2d06905437b7fbbd60025422fcc62f3a9d25b0b5e3c5a43769d9fbee15e74e44416580392022-11-27 15:43:282 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x8e0b8c8bb9db49a46697f3a5bb8a308e744821d20 ETH
0x2d06905437b7fbbd60025422fcc62f3a9d25b0b5e3c5a43769d9fbee15e74e44416580392022-11-27 15:43:282 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0x2d06905437b7fbbd60025422fcc62f3a9d25b0b5e3c5a43769d9fbee15e74e44416580392022-11-27 15:43:282 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0x2d06905437b7fbbd60025422fcc62f3a9d25b0b5e3c5a43769d9fbee15e74e44416580392022-11-27 15:43:282 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x82af49447d8a07e3bd95bd0d56f35241523fbab10 ETH
0x2d06905437b7fbbd60025422fcc62f3a9d25b0b5e3c5a43769d9fbee15e74e44416580392022-11-27 15:43:282 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0x2d06905437b7fbbd60025422fcc62f3a9d25b0b5e3c5a43769d9fbee15e74e44416580392022-11-27 15:43:282 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0x2d06905437b7fbbd60025422fcc62f3a9d25b0b5e3c5a43769d9fbee15e74e44416580392022-11-27 15:43:282 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90 ETH
0x2d06905437b7fbbd60025422fcc62f3a9d25b0b5e3c5a43769d9fbee15e74e44416580392022-11-27 15:43:282 mins ago 0xdc723b71ca7ed367624a906a008893c69f291894 0x960ea3e3c7fb317332d990873d354e18d76455900 ETH
0xf37067b2b200f9455128252d38269af0c2e1741a8be81949f8889e2faaa61575416576322022-11-27 15:41:324 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0xf37067b2b200f9455128252d38269af0c2e1741a8be81949f8889e2faaa61575416576322022-11-27 15:41:324 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x8e0b8c8bb9db49a46697f3a5bb8a308e744821d20 ETH
0xf37067b2b200f9455128252d38269af0c2e1741a8be81949f8889e2faaa61575416576322022-11-27 15:41:324 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0xf37067b2b200f9455128252d38269af0c2e1741a8be81949f8889e2faaa61575416576322022-11-27 15:41:324 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0xf37067b2b200f9455128252d38269af0c2e1741a8be81949f8889e2faaa61575416576322022-11-27 15:41:324 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90 ETH
0xf37067b2b200f9455128252d38269af0c2e1741a8be81949f8889e2faaa61575416576322022-11-27 15:41:324 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
0xf37067b2b200f9455128252d38269af0c2e1741a8be81949f8889e2faaa61575416576322022-11-27 15:41:324 mins ago 0x960ea3e3c7fb317332d990873d354e18d7645590 0x2f0af8ec2f5893392843a0f647a30a141dba9daf0 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.2.15

Optimization Enabled:
N/A

Other Settings:
, None license

Contract Source Code (Vyper language format)

# @version 0.2.15
# (c) Curve.Fi, 2021
# Pool for USDT/BTC/ETH or similar

interface ERC20:  # Custom ERC20 which works for USDT, WETH and WBTC
    def transfer(_to: address, _amount: uint256): nonpayable
    def transferFrom(_from: address, _to: address, _amount: uint256): nonpayable
    def balanceOf(_user: address) -> uint256: view

interface CurveToken:
    def totalSupply() -> uint256: view
    def mint(_to: address, _value: uint256) -> bool: nonpayable
    def mint_relative(_to: address, frac: uint256) -> uint256: nonpayable
    def burnFrom(_to: address, _value: uint256) -> bool: nonpayable


interface Math:
    def geometric_mean(unsorted_x: uint256[N_COINS]) -> uint256: view
    def reduction_coefficient(x: uint256[N_COINS], fee_gamma: uint256) -> uint256: view
    def newton_D(ANN: uint256, gamma: uint256, x_unsorted: uint256[N_COINS]) -> uint256: view
    def newton_y(ANN: uint256, gamma: uint256, x: uint256[N_COINS], D: uint256, i: uint256) -> uint256: view
    def halfpow(power: uint256, precision: uint256) -> uint256: view
    def sqrt_int(x: uint256) -> uint256: view


interface Views:
    def get_dy(i: uint256, j: uint256, dx: uint256) -> uint256: view
    def calc_token_amount(amounts: uint256[N_COINS], deposit: bool) -> uint256: view


interface WETH:
    def deposit(): payable
    def withdraw(_amount: uint256): nonpayable


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

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

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

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

event CommitNewAdmin:
    deadline: indexed(uint256)
    admin: indexed(address)

event NewAdmin:
    admin: indexed(address)

event CommitNewParameters:
    deadline: indexed(uint256)
    admin_fee: uint256
    mid_fee: uint256
    out_fee: uint256
    fee_gamma: uint256
    allowed_extra_profit: uint256
    adjustment_step: uint256
    ma_half_time: uint256

event NewParameters:
    admin_fee: uint256
    mid_fee: uint256
    out_fee: uint256
    fee_gamma: uint256
    allowed_extra_profit: uint256
    adjustment_step: uint256
    ma_half_time: uint256

event RampAgamma:
    initial_A: uint256
    future_A: uint256
    initial_gamma: uint256
    future_gamma: uint256
    initial_time: uint256
    future_time: uint256

event StopRampA:
    current_A: uint256
    current_gamma: uint256
    time: uint256

event ClaimAdminFee:
    admin: indexed(address)
    tokens: uint256


N_COINS: constant(int128) = 3  # <- change
PRECISION: constant(uint256) = 10 ** 18  # The precision to convert to
A_MULTIPLIER: constant(uint256) = 10000

# These addresses are replaced by the deployer
math: constant(address) = 0x2F0AF8eC2f5893392843a0F647A30A141dba9DaF
token: constant(address) = 0x8e0B8c8BB9db49a46697F3a5Bb8A308e744821D2
views: constant(address) = 0x48A68C5511DfC355007b7B794890F26653A7bF93
coins: constant(address[N_COINS]) = [
    0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9,
    0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f,
    0x82aF49447D8a07e3bd95BD0d56f35241523fBab1,
]

price_scale_packed: uint256   # Internal price scale
price_oracle_packed: uint256  # Price target given by MA

last_prices_packed: uint256
last_prices_timestamp: public(uint256)

initial_A_gamma: public(uint256)
future_A_gamma: public(uint256)
initial_A_gamma_time: public(uint256)
future_A_gamma_time: public(uint256)

allowed_extra_profit: public(uint256)  # 2 * 10**12 - recommended value
future_allowed_extra_profit: public(uint256)

fee_gamma: public(uint256)
future_fee_gamma: public(uint256)

adjustment_step: public(uint256)
future_adjustment_step: public(uint256)

ma_half_time: public(uint256)
future_ma_half_time: public(uint256)

mid_fee: public(uint256)
out_fee: public(uint256)
admin_fee: public(uint256)
future_mid_fee: public(uint256)
future_out_fee: public(uint256)
future_admin_fee: public(uint256)

balances: public(uint256[N_COINS])
D: public(uint256)

owner: public(address)
future_owner: public(address)

xcp_profit: public(uint256)
xcp_profit_a: public(uint256)  # Full profit at last claim of admin fees
virtual_price: public(uint256)  # Cached (fast to read) virtual price also used internally
not_adjusted: bool

is_killed: public(bool)
kill_deadline: public(uint256)
transfer_ownership_deadline: public(uint256)
admin_actions_deadline: public(uint256)

admin_fee_receiver: public(address)

KILL_DEADLINE_DT: constant(uint256) = 2 * 30 * 86400
ADMIN_ACTIONS_DELAY: constant(uint256) = 3 * 86400
MIN_RAMP_TIME: constant(uint256) = 86400

MAX_ADMIN_FEE: constant(uint256) = 10 * 10 ** 9
MIN_FEE: constant(uint256) = 5 * 10 ** 5  # 0.5 bps
MAX_FEE: constant(uint256) = 10 * 10 ** 9
MAX_A: constant(uint256) = 10000 * A_MULTIPLIER * N_COINS**N_COINS
MAX_A_CHANGE: constant(uint256) = 10
MIN_GAMMA: constant(uint256) = 10**10
MAX_GAMMA: constant(uint256) = 10**16
NOISE_FEE: constant(uint256) = 10**5  # 0.1 bps

PRICE_SIZE: constant(int128) = 256 / (N_COINS-1)
PRICE_MASK: constant(uint256) = 2**PRICE_SIZE - 1

# This must be changed for different N_COINS
# For example:
# N_COINS = 3 -> 1  (10**18 -> 10**18)
# N_COINS = 4 -> 10**8  (10**18 -> 10**10)
# PRICE_PRECISION_MUL: constant(uint256) = 1
PRECISIONS: constant(uint256[N_COINS]) = [
    1000000000000,
    10000000000,
    1,
]

INF_COINS: constant(uint256) = 15


@external
def __init__(
    owner: address,
    admin_fee_receiver: address,
    A: uint256,
    gamma: uint256,
    mid_fee: uint256,
    out_fee: uint256,
    allowed_extra_profit: uint256,
    fee_gamma: uint256,
    adjustment_step: uint256,
    admin_fee: uint256,
    ma_half_time: uint256,
    initial_prices: uint256[N_COINS-1]
):
    self.owner = owner

    # Pack A and gamma:
    # shifted A + gamma
    A_gamma: uint256 = shift(A, 128)
    A_gamma = bitwise_or(A_gamma, gamma)
    self.initial_A_gamma = A_gamma
    self.future_A_gamma = A_gamma

    self.mid_fee = mid_fee
    self.out_fee = out_fee
    self.allowed_extra_profit = allowed_extra_profit
    self.fee_gamma = fee_gamma
    self.adjustment_step = adjustment_step
    self.admin_fee = admin_fee

    # Packing prices
    packed_prices: uint256 = 0
    for k in range(N_COINS-1):
        packed_prices = shift(packed_prices, PRICE_SIZE)
        p: uint256 = initial_prices[N_COINS-2 - k]  # / PRICE_PRECISION_MUL
        assert p < PRICE_MASK
        packed_prices = bitwise_or(p, packed_prices)

    self.price_scale_packed = packed_prices
    self.price_oracle_packed = packed_prices
    self.last_prices_packed = packed_prices
    self.last_prices_timestamp = block.timestamp
    self.ma_half_time = ma_half_time

    self.xcp_profit_a = 10**18

    self.kill_deadline = block.timestamp + KILL_DEADLINE_DT

    self.admin_fee_receiver = admin_fee_receiver


@payable
@external
def __default__():
    pass


@internal
@view
def _packed_view(k: uint256, p: uint256) -> uint256:
    assert k < N_COINS-1
    return bitwise_and(
        shift(p, -PRICE_SIZE * convert(k, int256)),
        PRICE_MASK
    )  # * PRICE_PRECISION_MUL


@external
@view
def price_oracle(k: uint256) -> uint256:
    return self._packed_view(k, self.price_oracle_packed)


@external
@view
def price_scale(k: uint256) -> uint256:
    return self._packed_view(k, self.price_scale_packed)


@external
@view
def last_prices(k: uint256) -> uint256:
    return self._packed_view(k, self.last_prices_packed)


@external
@view
def token() -> address:
    return token


@external
@view
def coins(i: uint256) -> address:
    _coins: address[N_COINS] = coins
    return _coins[i]


@internal
@view
def xp() -> uint256[N_COINS]:
    result: uint256[N_COINS] = self.balances
    packed_prices: uint256 = self.price_scale_packed

    precisions: uint256[N_COINS] = PRECISIONS

    result[0] *= PRECISIONS[0]
    for i in range(1, N_COINS):
        p: uint256 = bitwise_and(packed_prices, PRICE_MASK) * precisions[i]  # * PRICE_PRECISION_MUL
        result[i] = result[i] * p / PRECISION
        packed_prices = shift(packed_prices, -PRICE_SIZE)

    return result


@view
@internal
def _A_gamma() -> uint256[2]:
    t1: uint256 = self.future_A_gamma_time

    A_gamma_1: uint256 = self.future_A_gamma
    gamma1: uint256 = bitwise_and(A_gamma_1, 2**128-1)
    A1: uint256 = shift(A_gamma_1, -128)

    if block.timestamp < t1:
        # handle ramping up and down of A
        A_gamma_0: uint256 = self.initial_A_gamma
        t0: uint256 = self.initial_A_gamma_time

        # Less readable but more compact way of writing and converting to uint256
        # gamma0: uint256 = bitwise_and(A_gamma_0, 2**128-1)
        # A0: uint256 = shift(A_gamma_0, -128)
        # A1 = A0 + (A1 - A0) * (block.timestamp - t0) / (t1 - t0)
        # gamma1 = gamma0 + (gamma1 - gamma0) * (block.timestamp - t0) / (t1 - t0)

        t1 -= t0
        t0 = block.timestamp - t0
        t2: uint256 = t1 - t0

        A1 = (shift(A_gamma_0, -128) * t2 + A1 * t0) / t1
        gamma1 = (bitwise_and(A_gamma_0, 2**128-1) * t2 + gamma1 * t0) / t1

    return [A1, gamma1]


@view
@external
def A() -> uint256:
    return self._A_gamma()[0]


@view
@external
def gamma() -> uint256:
    return self._A_gamma()[1]


@internal
@view
def _fee(xp: uint256[N_COINS]) -> uint256:
    f: uint256 = Math(math).reduction_coefficient(xp, self.fee_gamma)
    return (self.mid_fee * f + self.out_fee * (10**18 - f)) / 10**18


@external
@view
def fee() -> uint256:
    return self._fee(self.xp())


@external
@view
def fee_calc(xp: uint256[N_COINS]) -> uint256:
    return self._fee(xp)


@internal
@view
def get_xcp(D: uint256) -> uint256:
    x: uint256[N_COINS] = empty(uint256[N_COINS])
    x[0] = D / N_COINS
    packed_prices: uint256 = self.price_scale_packed
    # No precisions here because we don't switch to "real" units

    for i in range(1, N_COINS):
        x[i] = D * 10**18 / (N_COINS * bitwise_and(packed_prices, PRICE_MASK))  # ... * PRICE_PRECISION_MUL)
        packed_prices = shift(packed_prices, -PRICE_SIZE)

    return Math(math).geometric_mean(x)


@external
@view
def get_virtual_price() -> uint256:
    return 10**18 * self.get_xcp(self.D) / CurveToken(token).totalSupply()


@internal
def _claim_admin_fees():
    A_gamma: uint256[2] = self._A_gamma()

    xcp_profit: uint256 = self.xcp_profit
    xcp_profit_a: uint256 = self.xcp_profit_a

    # Gulp here
    _coins: address[N_COINS] = coins
    for i in range(N_COINS):
        self.balances[i] = ERC20(_coins[i]).balanceOf(self)

    vprice: uint256 = self.virtual_price

    if xcp_profit > xcp_profit_a:
        fees: uint256 = (xcp_profit - xcp_profit_a) * self.admin_fee / (2 * 10**10)
        if fees > 0:
            receiver: address = self.admin_fee_receiver
            if receiver != ZERO_ADDRESS:
                frac: uint256 = vprice * 10**18 / (vprice - fees) - 10**18
                claimed: uint256 = CurveToken(token).mint_relative(receiver, frac)
                xcp_profit -= fees*2
                self.xcp_profit = xcp_profit
                log ClaimAdminFee(receiver, claimed)

    total_supply: uint256 = CurveToken(token).totalSupply()

    # Recalculate D b/c we gulped
    D: uint256 = Math(math).newton_D(A_gamma[0], A_gamma[1], self.xp())
    self.D = D

    self.virtual_price = 10**18 * self.get_xcp(D) / total_supply

    if xcp_profit > xcp_profit_a:
        self.xcp_profit_a = xcp_profit


@internal
def tweak_price(A_gamma: uint256[2],
                _xp: uint256[N_COINS], i: uint256, p_i: uint256,
                new_D: uint256):
    price_oracle: uint256[N_COINS-1] = empty(uint256[N_COINS-1])
    last_prices: uint256[N_COINS-1] = empty(uint256[N_COINS-1])
    price_scale: uint256[N_COINS-1] = empty(uint256[N_COINS-1])
    xp: uint256[N_COINS] = empty(uint256[N_COINS])
    p_new: uint256[N_COINS-1] = empty(uint256[N_COINS-1])

    # Update MA if needed
    packed_prices: uint256 = self.price_oracle_packed
    for k in range(N_COINS-1):
        price_oracle[k] = bitwise_and(packed_prices, PRICE_MASK)  # * PRICE_PRECISION_MUL
        packed_prices = shift(packed_prices, -PRICE_SIZE)

    last_prices_timestamp: uint256 = self.last_prices_timestamp
    packed_prices = self.last_prices_packed
    for k in range(N_COINS-1):
        last_prices[k] = bitwise_and(packed_prices, PRICE_MASK)   # * PRICE_PRECISION_MUL
        packed_prices = shift(packed_prices, -PRICE_SIZE)

    if last_prices_timestamp < block.timestamp:
        # MA update required
        ma_half_time: uint256 = self.ma_half_time
        alpha: uint256 = Math(math).halfpow((block.timestamp - last_prices_timestamp) * 10**18 / ma_half_time, 10**10)
        packed_prices = 0
        for k in range(N_COINS-1):
            price_oracle[k] = (last_prices[k] * (10**18 - alpha) + price_oracle[k] * alpha) / 10**18
        for k in range(N_COINS-1):
            packed_prices = shift(packed_prices, PRICE_SIZE)
            p: uint256 = price_oracle[N_COINS-2 - k]  # / PRICE_PRECISION_MUL
            assert p < PRICE_MASK
            packed_prices = bitwise_or(p, packed_prices)
        self.price_oracle_packed = packed_prices
        self.last_prices_timestamp = block.timestamp

    D_unadjusted: uint256 = new_D  # Withdrawal methods know new D already
    if new_D == 0:
        # We will need this a few times (35k gas)
        D_unadjusted = Math(math).newton_D(A_gamma[0], A_gamma[1], _xp)
    packed_prices = self.price_scale_packed
    for k in range(N_COINS-1):
        price_scale[k] = bitwise_and(packed_prices, PRICE_MASK)  # * PRICE_PRECISION_MUL
        packed_prices = shift(packed_prices, -PRICE_SIZE)

    if p_i > 0:
        # Save the last price
        if i > 0:
            last_prices[i-1] = p_i
        else:
            # If 0th price changed - change all prices instead
            for k in range(N_COINS-1):
                last_prices[k] = last_prices[k] * 10**18 / p_i
    else:
        # calculate real prices
        # it would cost 70k gas for a 3-token pool. Sad. How do we do better?
        __xp: uint256[N_COINS] = _xp
        dx_price: uint256 = __xp[0] / 10**6
        __xp[0] += dx_price
        for k in range(N_COINS-1):
            last_prices[k] = price_scale[k] * dx_price / (_xp[k+1] - Math(math).newton_y(A_gamma[0], A_gamma[1], __xp, D_unadjusted, k+1))

    packed_prices = 0
    for k in range(N_COINS-1):
        packed_prices = shift(packed_prices, PRICE_SIZE)
        p: uint256 = last_prices[N_COINS-2 - k]  # / PRICE_PRECISION_MUL
        assert p < PRICE_MASK
        packed_prices = bitwise_or(p, packed_prices)
    self.last_prices_packed = packed_prices

    total_supply: uint256 = CurveToken(token).totalSupply()
    old_xcp_profit: uint256 = self.xcp_profit
    old_virtual_price: uint256 = self.virtual_price

    # Update profit numbers without price adjustment first
    xp[0] = D_unadjusted / N_COINS
    for k in range(N_COINS-1):
        xp[k+1] = D_unadjusted * 10**18 / (N_COINS * price_scale[k])
    xcp_profit: uint256 = 10**18
    virtual_price: uint256 = 10**18

    if old_virtual_price > 0:
        xcp: uint256 = Math(math).geometric_mean(xp)
        virtual_price = 10**18 * xcp / total_supply
        xcp_profit = old_xcp_profit * virtual_price / old_virtual_price

        t: uint256 = self.future_A_gamma_time
        if virtual_price < old_virtual_price and t == 0:
            raise "Loss"
        if t == 1:
            self.future_A_gamma_time = 0

    self.xcp_profit = xcp_profit

    needs_adjustment: bool = self.not_adjusted
    # if not needs_adjustment and (virtual_price-10**18 > (xcp_profit-10**18)/2 + self.allowed_extra_profit):
    # (re-arrange for gas efficiency)
    if not needs_adjustment and (virtual_price * 2 - 10**18 > xcp_profit + 2*self.allowed_extra_profit):
        needs_adjustment = True
        self.not_adjusted = True

    if needs_adjustment:
        adjustment_step: uint256 = self.adjustment_step
        norm: uint256 = 0

        for k in range(N_COINS-1):
            ratio: uint256 = price_oracle[k] * 10**18 / price_scale[k]
            if ratio > 10**18:
                ratio -= 10**18
            else:
                ratio = 10**18 - ratio
            norm += ratio**2

        if norm > adjustment_step ** 2 and old_virtual_price > 0:
            norm = Math(math).sqrt_int(norm / 10**18)  # Need to convert to 1e18 units!

            for k in range(N_COINS-1):
                p_new[k] = (price_scale[k] * (norm - adjustment_step) + adjustment_step * price_oracle[k]) / norm

            # Calculate balances*prices
            xp = _xp
            for k in range(N_COINS-1):
                xp[k+1] = _xp[k+1] * p_new[k] / price_scale[k]

            # Calculate "extended constant product" invariant xCP and virtual price
            D: uint256 = Math(math).newton_D(A_gamma[0], A_gamma[1], xp)
            xp[0] = D / N_COINS
            for k in range(N_COINS-1):
                xp[k+1] = D * 10**18 / (N_COINS * p_new[k])
            # We reuse old_virtual_price here but it's not old anymore
            old_virtual_price = 10**18 * Math(math).geometric_mean(xp) / total_supply

            # Proceed if we've got enough profit
            # if (old_virtual_price > 10**18) and (2 * (old_virtual_price - 10**18) > xcp_profit - 10**18):
            if (old_virtual_price > 10**18) and (2 * old_virtual_price - 10**18 > xcp_profit):
                packed_prices = 0
                for k in range(N_COINS-1):
                    packed_prices = shift(packed_prices, PRICE_SIZE)
                    p: uint256 = p_new[N_COINS-2 - k]  # / PRICE_PRECISION_MUL
                    assert p < PRICE_MASK
                    packed_prices = bitwise_or(p, packed_prices)
                self.price_scale_packed = packed_prices
                self.D = D
                self.virtual_price = old_virtual_price

                return

            else:
                self.not_adjusted = False

    # If we are here, the price_scale adjustment did not happen
    # Still need to update the profit counter and D
    self.D = D_unadjusted
    self.virtual_price = virtual_price



@payable
@external
@nonreentrant('lock')
def exchange(i: uint256, j: uint256, dx: uint256, min_dy: uint256, use_eth: bool = False):
    assert not self.is_killed  # dev: the pool is killed
    assert i != j  # dev: coin index out of range
    assert i < N_COINS  # dev: coin index out of range
    assert j < N_COINS  # dev: coin index out of range
    assert dx > 0  # dev: do not exchange 0 coins

    A_gamma: uint256[2] = self._A_gamma()
    xp: uint256[N_COINS] = self.balances
    ix: uint256 = j
    p: uint256 = 0
    dy: uint256 = 0

    if True:  # scope to reduce size of memory when making internal calls later
        _coins: address[N_COINS] = coins
        if i == 2 and use_eth:
            assert msg.value == dx  # dev: incorrect eth amount
            WETH(coins[2]).deposit(value=msg.value)
        else:
            assert msg.value == 0  # dev: nonzero eth amount
            # assert might be needed for some tokens - removed one to save bytespace
            ERC20(_coins[i]).transferFrom(msg.sender, self, dx)

        y: uint256 = xp[j]
        x0: uint256 = xp[i]
        xp[i] = x0 + dx
        self.balances[i] = xp[i]

        price_scale: uint256[N_COINS-1] = empty(uint256[N_COINS-1])
        packed_prices: uint256 = self.price_scale_packed
        for k in range(N_COINS-1):
            price_scale[k] = bitwise_and(packed_prices, PRICE_MASK)  # * PRICE_PRECISION_MUL
            packed_prices = shift(packed_prices, -PRICE_SIZE)

        precisions: uint256[N_COINS] = PRECISIONS
        xp[0] *= PRECISIONS[0]
        for k in range(1, N_COINS):
            xp[k] = xp[k] * price_scale[k-1] * precisions[k] / PRECISION

        prec_i: uint256 = precisions[i]

        # In case ramp is happening
        if True:
            t: uint256 = self.future_A_gamma_time
            if t > 0:
                x0 *= prec_i
                if i > 0:
                    x0 = x0 * price_scale[i-1] / PRECISION
                x1: uint256 = xp[i]  # Back up old value in xp
                xp[i] = x0
                self.D = Math(math).newton_D(A_gamma[0], A_gamma[1], xp)
                xp[i] = x1  # And restore
                if block.timestamp >= t:
                    self.future_A_gamma_time = 1

        prec_j: uint256 = precisions[j]

        dy = xp[j] - Math(math).newton_y(A_gamma[0], A_gamma[1], xp, self.D, j)
        # Not defining new "y" here to have less variables / make subsequent calls cheaper
        xp[j] -= dy
        dy -= 1

        if j > 0:
            dy = dy * PRECISION / price_scale[j-1]
        dy /= prec_j

        dy -= self._fee(xp) * dy / 10**10
        assert dy >= min_dy, "Slippage"
        y -= dy

        self.balances[j] = y
        # assert might be needed for some tokens - removed one to save bytespace
        if j == 2 and use_eth:
            WETH(coins[2]).withdraw(dy)
            raw_call(msg.sender, b"", value=dy)
        else:
            ERC20(_coins[j]).transfer(msg.sender, dy)

        y *= prec_j
        if j > 0:
            y = y * price_scale[j-1] / PRECISION
        xp[j] = y

        # Calculate price
        if dx > 10**5 and dy > 10**5:
            _dx: uint256 = dx * prec_i
            _dy: uint256 = dy * prec_j
            if i != 0 and j != 0:
                p = bitwise_and(
                    shift(self.last_prices_packed, -PRICE_SIZE * convert(i-1, int256)),
                    PRICE_MASK
                ) * _dx / _dy  # * PRICE_PRECISION_MUL
            elif i == 0:
                p = _dx * 10**18 / _dy
            else:  # j == 0
                p = _dy * 10**18 / _dx
                ix = i

    self.tweak_price(A_gamma, xp, ix, p, 0)

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


@external
@view
def get_dy(i: uint256, j: uint256, dx: uint256) -> uint256:
    return Views(views).get_dy(i, j, dx)


@view
@internal
def _calc_token_fee(amounts: uint256[N_COINS], xp: uint256[N_COINS]) -> uint256:
    # fee = sum(amounts_i - avg(amounts)) * fee' / sum(amounts)
    fee: uint256 = self._fee(xp) * N_COINS / (4 * (N_COINS-1))
    S: uint256 = 0
    for _x in amounts:
        S += _x
    avg: uint256 = S / N_COINS
    Sdiff: uint256 = 0
    for _x in amounts:
        if _x > avg:
            Sdiff += _x - avg
        else:
            Sdiff += avg - _x
    return fee * Sdiff / S + NOISE_FEE


@external
@view
def calc_token_fee(amounts: uint256[N_COINS], xp: uint256[N_COINS]) -> uint256:
    return self._calc_token_fee(amounts, xp)


@external
@nonreentrant('lock')
def add_liquidity(amounts: uint256[N_COINS], min_mint_amount: uint256):
    assert not self.is_killed  # dev: the pool is killed

    A_gamma: uint256[2] = self._A_gamma()

    _coins: address[N_COINS] = coins

    xp: uint256[N_COINS] = self.balances
    amountsp: uint256[N_COINS] = empty(uint256[N_COINS])
    xx: uint256[N_COINS] = empty(uint256[N_COINS])
    d_token: uint256 = 0
    d_token_fee: uint256 = 0
    old_D: uint256 = 0
    ix: uint256 = INF_COINS

    if True:  # Scope to avoid having extra variables in memory later
        xp_old: uint256[N_COINS] = xp

        for i in range(N_COINS):
            bal: uint256 = xp[i] + amounts[i]
            xp[i] = bal
            self.balances[i] = bal
        xx = xp

        precisions: uint256[N_COINS] = PRECISIONS
        packed_prices: uint256 = self.price_scale_packed
        xp[0] *= PRECISIONS[0]
        xp_old[0] *= PRECISIONS[0]
        for i in range(1, N_COINS):
            price_scale: uint256 = bitwise_and(packed_prices, PRICE_MASK) * precisions[i]  # * PRICE_PRECISION_MUL
            xp[i] = xp[i] * price_scale / PRECISION
            xp_old[i] = xp_old[i] * price_scale / PRECISION
            packed_prices = shift(packed_prices, -PRICE_SIZE)

        for i in range(N_COINS):
            if amounts[i] > 0:
                # assert might be needed for some tokens - removed one to save bytespace
                ERC20(_coins[i]).transferFrom(msg.sender, self, amounts[i])
                amountsp[i] = xp[i] - xp_old[i]
                if ix == INF_COINS:
                    ix = i
                else:
                    ix = INF_COINS-1
        assert ix != INF_COINS  # dev: no coins to add

        t: uint256 = self.future_A_gamma_time
        if t > 0:
            old_D = Math(math).newton_D(A_gamma[0], A_gamma[1], xp_old)
            if block.timestamp >= t:
                self.future_A_gamma_time = 1
        else:
            old_D = self.D

    D: uint256 = Math(math).newton_D(A_gamma[0], A_gamma[1], xp)

    token_supply: uint256 = CurveToken(token).totalSupply()
    if old_D > 0:
        d_token = token_supply * D / old_D - token_supply
    else:
        d_token = self.get_xcp(D)  # making initial virtual price equal to 1
    assert d_token > 0  # dev: nothing minted

    if old_D > 0:
        d_token_fee = self._calc_token_fee(amountsp, xp) * d_token / 10**10 + 1
        d_token -= d_token_fee
        token_supply += d_token
        CurveToken(token).mint(msg.sender, d_token)

        # Calculate price
        # p_i * (dx_i - dtoken / token_supply * xx_i) = sum{k!=i}(p_k * (dtoken / token_supply * xx_k - dx_k))
        # Only ix is nonzero
        p: uint256 = 0
        if d_token > 10**5:
            if ix < N_COINS:
                S: uint256 = 0
                last_prices: uint256[N_COINS-1] = empty(uint256[N_COINS-1])
                packed_prices: uint256 = self.last_prices_packed
                precisions: uint256[N_COINS] = PRECISIONS
                for k in range(N_COINS-1):
                    last_prices[k] = bitwise_and(packed_prices, PRICE_MASK)  # * PRICE_PRECISION_MUL
                    packed_prices = shift(packed_prices, -PRICE_SIZE)
                for i in range(N_COINS):
                    if i != ix:
                        if i == 0:
                            S += xx[0] * PRECISIONS[0]
                        else:
                            S += xx[i] * last_prices[i-1] * precisions[i] / PRECISION
                S = S * d_token / token_supply
                p = S * PRECISION / (amounts[ix] * precisions[ix] - d_token * xx[ix] * precisions[ix] / token_supply)

        self.tweak_price(A_gamma, xp, ix, p, D)

    else:
        self.D = D
        self.virtual_price = 10**18
        self.xcp_profit = 10**18
        CurveToken(token).mint(msg.sender, d_token)

    assert d_token >= min_mint_amount, "Slippage"

    log AddLiquidity(msg.sender, amounts, d_token_fee, token_supply)


@external
@nonreentrant('lock')
def remove_liquidity(_amount: uint256, min_amounts: uint256[N_COINS]):
    """
    This withdrawal method is very safe, does no complex math
    """
    _coins: address[N_COINS] = coins
    total_supply: uint256 = CurveToken(token).totalSupply()
    CurveToken(token).burnFrom(msg.sender, _amount)
    balances: uint256[N_COINS] = self.balances
    amount: uint256 = _amount - 1  # Make rounding errors favoring other LPs a tiny bit

    for i in range(N_COINS):
        d_balance: uint256 = balances[i] * amount / total_supply
        assert d_balance >= min_amounts[i]
        self.balances[i] = balances[i] - d_balance
        balances[i] = d_balance  # now it's the amounts going out
        # assert might be needed for some tokens - removed one to save bytespace
        ERC20(_coins[i]).transfer(msg.sender, d_balance)

    D: uint256 = self.D
    self.D = D - D * amount / total_supply

    log RemoveLiquidity(msg.sender, balances, total_supply - _amount)


@view
@external
def calc_token_amount(amounts: uint256[N_COINS], deposit: bool) -> uint256:
    return Views(views).calc_token_amount(amounts, deposit)


@internal
@view
def _calc_withdraw_one_coin(A_gamma: uint256[2], token_amount: uint256, i: uint256, update_D: bool,
                            calc_price: bool) -> (uint256, uint256, uint256, uint256[N_COINS]):
    token_supply: uint256 = CurveToken(token).totalSupply()
    assert token_amount <= token_supply  # dev: token amount more than supply
    assert i < N_COINS  # dev: coin out of range

    xx: uint256[N_COINS] = self.balances
    xp: uint256[N_COINS] = PRECISIONS
    D0: uint256 = 0

    price_scale_i: uint256 = PRECISION * PRECISIONS[0]
    if True:  # To remove packed_prices from memory
        packed_prices: uint256 = self.price_scale_packed
        xp[0] *= xx[0]
        for k in range(1, N_COINS):
            p: uint256 = bitwise_and(packed_prices, PRICE_MASK)  # * PRICE_PRECISION_MUL
            if i == k:
                price_scale_i = p * xp[i]
            xp[k] = xp[k] * xx[k] * p / PRECISION
            packed_prices = shift(packed_prices, -PRICE_SIZE)

    if update_D:
        D0 = Math(math).newton_D(A_gamma[0], A_gamma[1], xp)
    else:
        D0 = self.D

    D: uint256 = D0

    # Charge the fee on D, not on y, e.g. reducing invariant LESS than charging the user
    fee: uint256 = self._fee(xp)
    dD: uint256 = token_amount * D / token_supply
    D -= (dD - (fee * dD / (2 * 10**10) + 1))
    y: uint256 = Math(math).newton_y(A_gamma[0], A_gamma[1], xp, D, i)
    dy: uint256 = (xp[i] - y) * PRECISION / price_scale_i
    xp[i] = y

    # Price calc
    p: uint256 = 0
    if calc_price and dy > 10**5 and token_amount > 10**5:
        # p_i = dD / D0 * sum'(p_k * x_k) / (dy - dD / D0 * y0)
        S: uint256 = 0
        precisions: uint256[N_COINS] = PRECISIONS
        last_prices: uint256[N_COINS-1] = empty(uint256[N_COINS-1])
        packed_prices: uint256 = self.last_prices_packed
        for k in range(N_COINS-1):
            last_prices[k] = bitwise_and(packed_prices, PRICE_MASK)  # * PRICE_PRECISION_MUL
            packed_prices = shift(packed_prices, -PRICE_SIZE)
        for k in range(N_COINS):
            if k != i:
                if k == 0:
                    S += xx[0] * PRECISIONS[0]
                else:
                    S += xx[k] * last_prices[k-1] * precisions[k] / PRECISION
        S = S * dD / D0
        p = S * PRECISION / (dy * precisions[i] - dD * xx[i] * precisions[i] / D0)

    return dy, p, D, xp


@view
@external
def calc_withdraw_one_coin(token_amount: uint256, i: uint256) -> uint256:
    return self._calc_withdraw_one_coin(self._A_gamma(), token_amount, i, True, False)[0]


@external
@nonreentrant('lock')
def remove_liquidity_one_coin(token_amount: uint256, i: uint256, min_amount: uint256):
    assert not self.is_killed  # dev: the pool is killed

    A_gamma: uint256[2] = self._A_gamma()

    dy: uint256 = 0
    D: uint256 = 0
    p: uint256 = 0
    xp: uint256[N_COINS] = empty(uint256[N_COINS])
    future_A_gamma_time: uint256 = self.future_A_gamma_time
    dy, p, D, xp = self._calc_withdraw_one_coin(A_gamma, token_amount, i, (future_A_gamma_time > 0), True)
    assert dy >= min_amount, "Slippage"

    if block.timestamp >= future_A_gamma_time:
        self.future_A_gamma_time = 1

    self.balances[i] -= dy
    CurveToken(token).burnFrom(msg.sender, token_amount)
    self.tweak_price(A_gamma, xp, i, p, D)

    _coins: address[N_COINS] = coins
    # assert might be needed for some tokens - removed one to save bytespace
    ERC20(_coins[i]).transfer(msg.sender, dy)

    log RemoveLiquidityOne(msg.sender, token_amount, i, dy)


@external
@nonreentrant('lock')
def claim_admin_fees():
    self._claim_admin_fees()


# Admin parameters
@external
def ramp_A_gamma(future_A: uint256, future_gamma: uint256, future_time: uint256):
    assert msg.sender == self.owner  # dev: only owner
    assert block.timestamp > self.initial_A_gamma_time + (MIN_RAMP_TIME-1)
    assert future_time > block.timestamp + (MIN_RAMP_TIME-1)  # dev: insufficient time

    A_gamma: uint256[2] = self._A_gamma()
    initial_A_gamma: uint256 = shift(A_gamma[0], 128)
    initial_A_gamma = bitwise_or(initial_A_gamma, A_gamma[1])

    assert future_A > 0
    assert future_A < MAX_A+1
    assert future_gamma > MIN_GAMMA-1
    assert future_gamma < MAX_GAMMA+1

    ratio: uint256 = 10**18 * future_A / A_gamma[0]
    assert ratio < 10**18 * MAX_A_CHANGE + 1
    assert ratio > 10**18 / MAX_A_CHANGE - 1

    ratio = 10**18 * future_gamma / A_gamma[1]
    assert ratio < 10**18 * MAX_A_CHANGE + 1
    assert ratio > 10**18 / MAX_A_CHANGE - 1

    self.initial_A_gamma = initial_A_gamma
    self.initial_A_gamma_time = block.timestamp

    future_A_gamma: uint256 = shift(future_A, 128)
    future_A_gamma = bitwise_or(future_A_gamma, future_gamma)
    self.future_A_gamma_time = future_time
    self.future_A_gamma = future_A_gamma

    log RampAgamma(A_gamma[0], future_A, A_gamma[1], future_gamma, block.timestamp, future_time)


@external
def stop_ramp_A_gamma():
    assert msg.sender == self.owner  # dev: only owner

    A_gamma: uint256[2] = self._A_gamma()
    current_A_gamma: uint256 = shift(A_gamma[0], 128)
    current_A_gamma = bitwise_or(current_A_gamma, A_gamma[1])
    self.initial_A_gamma = current_A_gamma
    self.future_A_gamma = current_A_gamma
    self.initial_A_gamma_time = block.timestamp
    self.future_A_gamma_time = block.timestamp
    # now (block.timestamp < t1) is always False, so we return saved A

    log StopRampA(A_gamma[0], A_gamma[1], block.timestamp)


@external
def commit_new_parameters(
    _new_mid_fee: uint256,
    _new_out_fee: uint256,
    _new_admin_fee: uint256,
    _new_fee_gamma: uint256,
    _new_allowed_extra_profit: uint256,
    _new_adjustment_step: uint256,
    _new_ma_half_time: uint256,
    ):
    assert msg.sender == self.owner  # dev: only owner
    assert self.admin_actions_deadline == 0  # dev: active action

    new_mid_fee: uint256 = _new_mid_fee
    new_out_fee: uint256 = _new_out_fee
    new_admin_fee: uint256 = _new_admin_fee
    new_fee_gamma: uint256 = _new_fee_gamma
    new_allowed_extra_profit: uint256 = _new_allowed_extra_profit
    new_adjustment_step: uint256 = _new_adjustment_step
    new_ma_half_time: uint256 = _new_ma_half_time

    # Fees
    if new_out_fee < MAX_FEE+1:
        assert new_out_fee > MIN_FEE-1  # dev: fee is out of range
    else:
        new_out_fee = self.out_fee
    if new_mid_fee > MAX_FEE:
        new_mid_fee = self.mid_fee
    assert new_mid_fee <= new_out_fee  # dev: mid-fee is too high
    if new_admin_fee > MAX_ADMIN_FEE:
        new_admin_fee = self.admin_fee

    # AMM parameters
    if new_fee_gamma < 10**18:
        assert new_fee_gamma > 0  # dev: fee_gamma out of range [1 .. 10**18]
    else:
        new_fee_gamma = self.fee_gamma
    if new_allowed_extra_profit > 10**18:
        new_allowed_extra_profit = self.allowed_extra_profit
    if new_adjustment_step > 10**18:
        new_adjustment_step = self.adjustment_step

    # MA
    if new_ma_half_time < 7*86400:
        assert new_ma_half_time > 0  # dev: MA time should be longer than 1 second
    else:
        new_ma_half_time = self.ma_half_time

    _deadline: uint256 = block.timestamp + ADMIN_ACTIONS_DELAY
    self.admin_actions_deadline = _deadline

    self.future_admin_fee = new_admin_fee
    self.future_mid_fee = new_mid_fee
    self.future_out_fee = new_out_fee
    self.future_fee_gamma = new_fee_gamma
    self.future_allowed_extra_profit = new_allowed_extra_profit
    self.future_adjustment_step = new_adjustment_step
    self.future_ma_half_time = new_ma_half_time

    log CommitNewParameters(_deadline, new_admin_fee, new_mid_fee, new_out_fee,
                            new_fee_gamma,
                            new_allowed_extra_profit, new_adjustment_step,
                            new_ma_half_time)


@external
@nonreentrant('lock')
def apply_new_parameters():
    assert msg.sender == self.owner  # dev: only owner
    assert block.timestamp >= self.admin_actions_deadline  # dev: insufficient time
    assert self.admin_actions_deadline != 0  # dev: no active action

    self.admin_actions_deadline = 0

    admin_fee: uint256 = self.future_admin_fee
    if self.admin_fee != admin_fee:
        self._claim_admin_fees()
        self.admin_fee = admin_fee

    mid_fee: uint256 = self.future_mid_fee
    self.mid_fee = mid_fee
    out_fee: uint256 = self.future_out_fee
    self.out_fee = out_fee
    fee_gamma: uint256 = self.future_fee_gamma
    self.fee_gamma = fee_gamma
    allowed_extra_profit: uint256 = self.future_allowed_extra_profit
    self.allowed_extra_profit = allowed_extra_profit
    adjustment_step: uint256 = self.future_adjustment_step
    self.adjustment_step = adjustment_step
    ma_half_time: uint256 = self.future_ma_half_time
    self.ma_half_time = ma_half_time

    log NewParameters(admin_fee, mid_fee, out_fee,
                      fee_gamma,
                      allowed_extra_profit, adjustment_step,
                      ma_half_time)


@external
def revert_new_parameters():
    assert msg.sender == self.owner  # dev: only owner

    self.admin_actions_deadline = 0


@external
def commit_transfer_ownership(_owner: address):
    assert msg.sender == self.owner  # dev: only owner
    assert self.transfer_ownership_deadline == 0  # dev: active transfer

    _deadline: uint256 = block.timestamp + ADMIN_ACTIONS_DELAY
    self.transfer_ownership_deadline = _deadline
    self.future_owner = _owner

    log CommitNewAdmin(_deadline, _owner)


@external
def apply_transfer_ownership():
    assert msg.sender == self.owner  # dev: only owner
    assert block.timestamp >= self.transfer_ownership_deadline  # dev: insufficient time
    assert self.transfer_ownership_deadline != 0  # dev: no active transfer

    self.transfer_ownership_deadline = 0
    _owner: address = self.future_owner
    self.owner = _owner

    log NewAdmin(_owner)


@external
def revert_transfer_ownership():
    assert msg.sender == self.owner  # dev: only owner

    self.transfer_ownership_deadline = 0


@external
def kill_me():
    assert msg.sender == self.owner  # dev: only owner
    assert self.kill_deadline > block.timestamp  # dev: deadline has passed
    self.is_killed = True


@external
def unkill_me():
    assert msg.sender == self.owner  # dev: only owner
    self.is_killed = False


@external
def set_admin_fee_receiver(_admin_fee_receiver: address):
    assert msg.sender == self.owner  # dev: only owner
    self.admin_fee_receiver = _admin_fee_receiver

Contract ABI

[{"name":"TokenExchange","inputs":[{"name":"buyer","type":"address","indexed":true},{"name":"sold_id","type":"uint256","indexed":false},{"name":"tokens_sold","type":"uint256","indexed":false},{"name":"bought_id","type":"uint256","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":"fee","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":"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_index","type":"uint256","indexed":false},{"name":"coin_amount","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"CommitNewAdmin","inputs":[{"name":"deadline","type":"uint256","indexed":true},{"name":"admin","type":"address","indexed":true}],"anonymous":false,"type":"event"},{"name":"NewAdmin","inputs":[{"name":"admin","type":"address","indexed":true}],"anonymous":false,"type":"event"},{"name":"CommitNewParameters","inputs":[{"name":"deadline","type":"uint256","indexed":true},{"name":"admin_fee","type":"uint256","indexed":false},{"name":"mid_fee","type":"uint256","indexed":false},{"name":"out_fee","type":"uint256","indexed":false},{"name":"fee_gamma","type":"uint256","indexed":false},{"name":"allowed_extra_profit","type":"uint256","indexed":false},{"name":"adjustment_step","type":"uint256","indexed":false},{"name":"ma_half_time","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"NewParameters","inputs":[{"name":"admin_fee","type":"uint256","indexed":false},{"name":"mid_fee","type":"uint256","indexed":false},{"name":"out_fee","type":"uint256","indexed":false},{"name":"fee_gamma","type":"uint256","indexed":false},{"name":"allowed_extra_profit","type":"uint256","indexed":false},{"name":"adjustment_step","type":"uint256","indexed":false},{"name":"ma_half_time","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"RampAgamma","inputs":[{"name":"initial_A","type":"uint256","indexed":false},{"name":"future_A","type":"uint256","indexed":false},{"name":"initial_gamma","type":"uint256","indexed":false},{"name":"future_gamma","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":"current_A","type":"uint256","indexed":false},{"name":"current_gamma","type":"uint256","indexed":false},{"name":"time","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"ClaimAdminFee","inputs":[{"name":"admin","type":"address","indexed":true},{"name":"tokens","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"owner","type":"address"},{"name":"admin_fee_receiver","type":"address"},{"name":"A","type":"uint256"},{"name":"gamma","type":"uint256"},{"name":"mid_fee","type":"uint256"},{"name":"out_fee","type":"uint256"},{"name":"allowed_extra_profit","type":"uint256"},{"name":"fee_gamma","type":"uint256"},{"name":"adjustment_step","type":"uint256"},{"name":"admin_fee","type":"uint256"},{"name":"ma_half_time","type":"uint256"},{"name":"initial_prices","type":"uint256[2]"}],"outputs":[]},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"view","type":"function","name":"price_oracle","inputs":[{"name":"k","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":3361},{"stateMutability":"view","type":"function","name":"price_scale","inputs":[{"name":"k","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":3391},{"stateMutability":"view","type":"function","name":"last_prices","inputs":[{"name":"k","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":3421},{"stateMutability":"view","type":"function","name":"token","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":468},{"stateMutability":"view","type":"function","name":"coins","inputs":[{"name":"i","type":"uint256"}],"outputs":[{"name":"","type":"address"}],"gas":582},{"stateMutability":"view","type":"function","name":"A","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":597},{"stateMutability":"view","type":"function","name":"gamma","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":11991},{"stateMutability":"view","type":"function","name":"fee","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":21481},{"stateMutability":"view","type":"function","name":"fee_calc","inputs":[{"name":"xp","type":"uint256[3]"}],"outputs":[{"name":"","type":"uint256"}],"gas":11096},{"stateMutability":"view","type":"function","name":"get_virtual_price","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":11582},{"stateMutability":"payable","type":"function","name":"exchange","inputs":[{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"dx","type":"uint256"},{"name":"min_dy","type":"uint256"}],"outputs":[]},{"stateMutability":"payable","type":"function","name":"exchange","inputs":[{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"dx","type":"uint256"},{"name":"min_dy","type":"uint256"},{"name":"use_eth","type":"bool"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"get_dy","inputs":[{"name":"i","type":"uint256"},{"name":"j","type":"uint256"},{"name":"dx","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":3122},{"stateMutability":"view","type":"function","name":"calc_token_fee","inputs":[{"name":"amounts","type":"uint256[3]"},{"name":"xp","type":"uint256[3]"}],"outputs":[{"name":"","type":"uint256"}],"gas":26582},{"stateMutability":"nonpayable","type":"function","name":"add_liquidity","inputs":[{"name":"amounts","type":"uint256[3]"},{"name":"min_mint_amount","type":"uint256"}],"outputs":[],"gas":738279},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity","inputs":[{"name":"_amount","type":"uint256"},{"name":"min_amounts","type":"uint256[3]"}],"outputs":[],"gas":233573},{"stateMutability":"view","type":"function","name":"calc_token_amount","inputs":[{"name":"amounts","type":"uint256[3]"},{"name":"deposit","type":"bool"}],"outputs":[{"name":"","type":"uint256"}],"gas":3429},{"stateMutability":"view","type":"function","name":"calc_withdraw_one_coin","inputs":[{"name":"token_amount","type":"uint256"},{"name":"i","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":13432},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_one_coin","inputs":[{"name":"token_amount","type":"uint256"},{"name":"i","type":"uint256"},{"name":"min_amount","type":"uint256"}],"outputs":[],"gas":648323},{"stateMutability":"nonpayable","type":"function","name":"claim_admin_fees","inputs":[],"outputs":[],"gas":389296},{"stateMutability":"nonpayable","type":"function","name":"ramp_A_gamma","inputs":[{"name":"future_A","type":"uint256"},{"name":"future_gamma","type":"uint256"},{"name":"future_time","type":"uint256"}],"outputs":[],"gas":163102},{"stateMutability":"nonpayable","type":"function","name":"stop_ramp_A_gamma","inputs":[],"outputs":[],"gas":157247},{"stateMutability":"nonpayable","type":"function","name":"commit_new_parameters","inputs":[{"name":"_new_mid_fee","type":"uint256"},{"name":"_new_out_fee","type":"uint256"},{"name":"_new_admin_fee","type":"uint256"},{"name":"_new_fee_gamma","type":"uint256"},{"name":"_new_allowed_extra_profit","type":"uint256"},{"name":"_new_adjustment_step","type":"uint256"},{"name":"_new_ma_half_time","type":"uint256"}],"outputs":[],"gas":306190},{"stateMutability":"nonpayable","type":"function","name":"apply_new_parameters","inputs":[],"outputs":[],"gas":682926},{"stateMutability":"nonpayable","type":"function","name":"revert_new_parameters","inputs":[],"outputs":[],"gas":23222},{"stateMutability":"nonpayable","type":"function","name":"commit_transfer_ownership","inputs":[{"name":"_owner","type":"address"}],"outputs":[],"gas":77260},{"stateMutability":"nonpayable","type":"function","name":"apply_transfer_ownership","inputs":[],"outputs":[],"gas":65937},{"stateMutability":"nonpayable","type":"function","name":"revert_transfer_ownership","inputs":[],"outputs":[],"gas":23312},{"stateMutability":"nonpayable","type":"function","name":"kill_me","inputs":[],"outputs":[],"gas":40535},{"stateMutability":"nonpayable","type":"function","name":"unkill_me","inputs":[],"outputs":[],"gas":23372},{"stateMutability":"nonpayable","type":"function","name":"set_admin_fee_receiver","inputs":[{"name":"_admin_fee_receiver","type":"address"}],"outputs":[],"gas":38505},{"stateMutability":"view","type":"function","name":"last_prices_timestamp","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3378},{"stateMutability":"view","type":"function","name":"initial_A_gamma","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3408},{"stateMutability":"view","type":"function","name":"future_A_gamma","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3438},{"stateMutability":"view","type":"function","name":"initial_A_gamma_time","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3468},{"stateMutability":"view","type":"function","name":"future_A_gamma_time","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3498},{"stateMutability":"view","type":"function","name":"allowed_extra_profit","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3528},{"stateMutability":"view","type":"function","name":"future_allowed_extra_profit","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3558},{"stateMutability":"view","type":"function","name":"fee_gamma","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3588},{"stateMutability":"view","type":"function","name":"future_fee_gamma","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3618},{"stateMutability":"view","type":"function","name":"adjustment_step","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3648},{"stateMutability":"view","type":"function","name":"future_adjustment_step","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3678},{"stateMutability":"view","type":"function","name":"ma_half_time","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3708},{"stateMutability":"view","type":"function","name":"future_ma_half_time","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3738},{"stateMutability":"view","type":"function","name":"mid_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3768},{"stateMutability":"view","type":"function","name":"out_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3798},{"stateMutability":"view","type":"function","name":"admin_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3828},{"stateMutability":"view","type":"function","name":"future_mid_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3858},{"stateMutability":"view","type":"function","name":"future_out_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3888},{"stateMutability":"view","type":"function","name":"future_admin_fee","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3918},{"stateMutability":"view","type":"function","name":"balances","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":3993},{"stateMutability":"view","type":"function","name":"D","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":3978},{"stateMutability":"view","type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":4008},{"stateMutability":"view","type":"function","name":"future_owner","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":4038},{"stateMutability":"view","type":"function","name":"xcp_profit","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":4068},{"stateMutability":"view","type":"function","name":"xcp_profit_a","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":4098},{"stateMutability":"view","type":"function","name":"virtual_price","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":4128},{"stateMutability":"view","type":"function","name":"is_killed","inputs":[],"outputs":[{"name":"","type":"bool"}],"gas":4158},{"stateMutability":"view","type":"function","name":"kill_deadline","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":4188},{"stateMutability":"view","type":"function","name":"transfer_ownership_deadline","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":4218},{"stateMutability":"view","type":"function","name":"admin_actions_deadline","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":4248},{"stateMutability":"view","type":"function","name":"admin_fee_receiver","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":4278}]

6101a061571161014039602061571160c03960c05160a01c61570c57602060206157110160c03960c05160a01c61570c57610140516020556101805160801b6102e0526101a0516102e051176102e0526102e051600a556102e051600b556101c0516016556101e05160175561020051600e5561022051601055610240516012556102605160185560006103005261032060006002818352015b6103005160801b610300526102a060016103205180821061570c5780820390509050600281101561570c576020020151610340526fffffffffffffffffffffffffffffffff61034051101561570c57610300516103405117610300525b8151600101808352811415610099575b50506103005160065561030051600755610300516008554260095561028051601455670de0b6b3a764000060235542624f1a00818183011061570c578082019050905060275561016051602a556156f456600436101561000d5761316e565b600035601c52600051635b41b90881141561002d57600061014052610058565b63394747c58114156100535760843560011c615597576020608461014037600050610058565b610ca4565b6000546155975760016000556026546155975760243560043518156155975760036004351015615597576003602435101561559757600060443511156155975761014051610160516101805160065801613371565b6101a0526101c0526101805261016052610140526101a080516101605280602001516101805250601c80546101a05260018101546101c05260028101546101e052506024356102005260403661022037600115610ba65773fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb961026052732f2a2543b76a4166549f7aab2e75bef0aefc5b0f610280527382af49447d8a07e3bd95bd0d56f35241523fbab16102a052600260043514156101635761014051610166565b60005b156101c457604435341415615597577382af49447d8a07e3bd95bd0d56f35241523fbab13b156155975760006000600463d0e30db06102c0526102dc347382af49447d8a07e3bd95bd0d56f35241523fbab15af11561559757610224565b346155975761026060043560038110156155975760200201513b15615597576000600060646323b872dd6102c052336102e0523061030052604435610320526102dc600061026060043560038110156155975760200201515af115615597575b6101a060243560038110156155975760200201516102c0526101a060043560038110156155975760200201516102e0526102e051604435818183011061559757808201905090506101a060043560038110156155975760200201526101a06004356003811015615597576020020151600160043560038110156155975702601c0155604036610300376006546103405261036060006002818352015b6fffffffffffffffffffffffffffffffff61034051166103006103605160028110156155975760200201526103405160801c610340525b81516001018083528114156102c0575b505064e8d4a51000610360526402540be4006103805260016103a0526101a0805164e8d4a5100080820282158284830414171561559757809050905090508152506103c060016002818352015b6101a06103c05160038110156155975760200201516103006103c05160018082106155975780820390509050600281101561559757602002015180820282158284830414171561559757809050905090506103606103c05160038110156155975760200201518082028215828483041417156155975780905090509050670de0b6b3a7640000808204905090506101a06103c05160038110156155975760200201525b8151600101808352811415610354575b505061036060043560038110156155975760200201516103c05260011561058157600d546103e05260006103e0511115610580576102e080516103c0518082028215828483041417156155975780905090509050815250600060043511156104bd576102e0516103006004356001808210615597578082039050905060028110156155975760200201518082028215828483041417156155975780905090509050670de0b6b3a7640000808204905090506102e0525b6101a06004356003811015615597576020020151610400526102e0516101a06004356003811015615597576020020152602061052060a463c7fab70861042052610160516104405261018051610460526101a051610480526101c0516104a0526101e0516104c05261043c732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d11156155975760005061052051601f55610400516101a060043560038110156155975760200201526103e051421061057f576001600d555b5b5b61036060243560038110156155975760200201516103e0526101a06024356003811015615597576020020151602061054060e46336bc885561040052610160516104205261018051610440526101a051610460526101c051610480526101e0516104a052601f546104c0526024356104e05261041c732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d111561559757600050610540518082106155975780820390509050610240526101a0602435600381101561559757602002018051610240518082106155975780820390509050815250610240805160018082106155975780820390509050815250600060243511156106db5761024051670de0b6b3a7640000808202821582848304141715615597578090509050905061030060243560018082106155975780820390509050600281101561559757602002015180801561559757820490509050610240525b61024080516103e051808015615597578204905090508152506102408051610140610400525b6104005151602061040051016104005261040061040051101561072357610701565b6101a051610420526101c051610440526101e0516104605261046051610440516104205160065801613531565b6104c0526103e0610400525b61040051526020610400510361040052610140610400511061077d5761075c565b6104c0516102405180820282158284830414171561559757809050905090506402540be40080820490509050808210615597578082039050905081525060643561024051101561080c576308c379a0610400526020610420526008610440527f536c6970706167650000000000000000000000000000000000000000000000006104605261044050606461041cfd5b6102c080516102405180821061559757808203905090508152506102c051600160243560038110156155975702601c0155600260243514156108515761014051610854565b60005b156108e9577382af49447d8a07e3bd95bd0d56f35241523fbab13b1561559757600060006024632e1a7d4d61040052610240516104205261041c60007382af49447d8a07e3bd95bd0d56f35241523fbab15af115615597576000610400526104008051602001806104408284600060045af115615597575050600060006104405161046061024051335af11561559757610940565b61026060243560038110156155975760200201513b156155975760006000604463a9059cbb610400523361042052610240516104405261041c600061026060243560038110156155975760200201515af115615597575b6102c080516103e0518082028215828483041417156155975780905090509050815250600060243511156109c2576102c0516103006024356001808210615597578082039050905060028110156155975760200201518082028215828483041417156155975780905090509050670de0b6b3a7640000808204905090506102c0525b6102c0516101a06024356003811015615597576020020152620186a060443511156109f557620186a061024051116109f8565b60005b15610ba5576044356103c051808202821582848304141715615597578090509050905061040052610240516103e05180820282158284830414171561559757809050905090506104205260006004351815610a595760006024351415610a5c565b60005b15610b1d576fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8060043560018082106155975780820390509050600160ff1b8110156155975780820282158284830514171561559757809050905090506000811215610adf57600854816000031c610ae5565b600854811b5b905016610400518082028215828483041417156155975780905090509050610420518080156155975782049050905061022052610ba4565b600435610b625761040051670de0b6b3a76400008082028215828483041417156155975780905090509050610420518080156155975782049050905061022052610ba3565b61042051670de0b6b3a76400008082028215828483041417156155975780905090509050610400518080156155975782049050905061022052600435610200525b5b5b5b6101405161016051610180516101a0516101c0516101e051610200516102205161024051610160516102605261018051610280526101a0516102a0526101c0516102c0526101e0516102e052610200516103005261022051610320526000610340526103405161032051610300516102e0516102c0516102a051610280516102605160065801613be2565b6102405261022052610200526101e0526101c0526101a05261018052610160526101405260005060043561026052604435610280526024356102a052610240516102c052337fb2e76ae99761dc136e598d4a629bb347eccb9532a5f8bbd72e18467c3c34cc986080610260a26000600055005b6368727653811415610ce55734615597576004356101405260075461016052610160516101405160065801613170565b6101c0526101c05160005260206000f35b63a3f7cdd5811415610d265734615597576004356101405260065461016052610160516101405160065801613170565b6101c0526101c05160005260206000f35b6359189017811415610d675734615597576004356101405260085461016052610160516101405160065801613170565b6101c0526101c05160005260206000f35b63fc0c546a811415610d96573461559757738e0b8c8bb9db49a46697f3a5bb8a308e744821d260005260206000f35b63c6610657811415610e0f57346155975773fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb961014052732f2a2543b76a4166549f7aab2e75bef0aefc5b0f610160527382af49447d8a07e3bd95bd0d56f35241523fbab161018052610140600435600381101561559757602002015160005260206000f35b63f446c1d0811415610e3e57346155975760065801613371565b61014052610160526101405160005260206000f35b63b1373929811415610e7057346155975760065801613371565b61014052610160526101406020015160005260206000f35b63ddca3f43811415610f205734615597576006580161320e565b61014052610160526101805261014080516101a05280602001516101c05280604001516101e052506101405161016051610180516101a0516101c0516101e0516101a051610200526101c051610220526101e0516102405261024051610220516102005160065801613531565b6102a0526101e0526101c0526101a0526101805261016052610140526102a05160005260206000f35b63572e5625811415610f7257346155975760048035610140528060200135610160528060400135610180525061018051610160516101405160065801613531565b6101e0526101e05160005260206000f35b63bb7b8b80811415611014573461559757670de0b6b3a7640000601f54610140526101405160065801613622565b6101a0526101a0518082028215828483041417156155975780905090509050602061022060046318160ddd6101c0526101dc738e0b8c8bb9db49a46697f3a5bb8a308e744821d25afa1561559757601f3d111561559757600050610220518080156155975782049050905060005260206000f35b63556d6e9f8114156110755734615597576020610200606463556d6e9f61014052606060046101603761015c7348a68c5511dfc355007b7b794890f26653a7bf935afa1561559757601f3d1115615597576000506102005160005260206000f35b63cde699fa8114156110ee573461559757600480356101405280602001356101605280604001356101805250606480356101a05280602001356101c05280604001356101e052506101e0516101c0516101a05161018051610160516101405160065801614b8b565b610240526102405160005260206000f35b634515cef3811415611d6957600154615597576001600155346155975760265461559757610140516101605160065801613371565b610180526101a05261016052610140526101808051610140528060200151610160525073fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb961018052732f2a2543b76a4166549f7aab2e75bef0aefc5b0f6101a0527382af49447d8a07e3bd95bd0d56f35241523fbab16101c052601c80546101e052600181015461020052600281015461022052506101203661024037600f610360526001156115c1576101e05161038052610200516103a052610220516103c0526103e060006003818352015b6101e06103e051600381101561559757602002015160046103e05160038110156155975760200201358181830110615597578082019050905061040052610400516101e06103e05160038110156155975760200201526104005160016103e05160038110156155975702601c01555b81516001018083528114156111e5575b50506101e0516102a052610200516102c052610220516102e05264e8d4a510006103e0526402540be40061040052600161042052600654610440526101e0805164e8d4a510008082028215828483041417156155975780905090509050815250610380805164e8d4a51000808202821582848304141715615597578090509050905081525061046060016002818352015b6fffffffffffffffffffffffffffffffff61044051166103e06104605160038110156155975760200201518082028215828483041417156155975780905090509050610480526101e0610460516003811015615597576020020151610480518082028215828483041417156155975780905090509050670de0b6b3a7640000808204905090506101e0610460516003811015615597576020020152610380610460516003811015615597576020020151610480518082028215828483041417156155975780905090509050670de0b6b3a7640000808204905090506103806104605160038110156155975760200201526104405160801c610440525b81516001018083528114156112f5575b505061046060006003818352015b600060046104605160038110156155975760200201351115611506576101806104605160038110156155975760200201513b15615597576000600060646323b872dd61048052336104a052306104c05260046104605160038110156155975760200201356104e05261049c60006101806104605160038110156155975760200201515af115615597576101e06104605160038110156155975760200201516103806104605160038110156155975760200201518082106155975780820390509050610240610460516003811015615597576020020152600f6103605114156114fe576104605161036052611505565b600e610360525b5b5b815160010180835281141561140f575b5050600f61036051181561559757600d546104605260006104605111156115b857602061058060a463c7fab70861048052610140516104a052610160516104c052610380516104e0526103a051610500526103c0516105205261049c732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d11156155975760005061058051610340526104605142106115b3576001600d555b6115c0565b601f54610340525b5b60206104a060a463c7fab7086103a052610140516103c052610160516103e0526101e05161040052610200516104205261022051610440526103bc732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d1115615597576000506104a05161038052602061042060046318160ddd6103c0526103dc738e0b8c8bb9db49a46697f3a5bb8a308e744821d25afa1561559757601f3d111561559757600050610420516103a05260006103405111156116c6576103a05161038051808202821582848304141715615597578090509050905061034051808015615597578204905090506103a05180821061559757808203905090506103005261173b565b6101406103c0525b6103c0515160206103c051016103c0526103c06103c05110156116f0576116ce565b610380516103e0526103e05160065801613622565b610440526103a06103c0525b6103c0515260206103c051036103c0526101406103c0511061173257611711565b61044051610300525b6000610300511115615597576000610340511115611c62576101406103c0525b6103c0515160206103c051016103c0526103c06103c051101561177d5761175b565b610240516103e052610260516104005261028051610420526101e051610440526102005161046052610220516104805261048051610460516104405161042051610400516103e05160065801614b8b565b6104e0526103a06103c0525b6103c0515260206103c051036103c0526101406103c051106117fb576117da565b6104e0516103005180820282158284830414171561559757809050905090506402540be400808204905090506001818183011061559757808201905090506103205261030080516103205180821061559757808203905090508152506103a080516103005181818301106155975780820190509050815250602061046060446340c10f196103c052336103e05261030051610400526103dc6000738e0b8c8bb9db49a46697f3a5bb8a308e744821d25af11561559757601f3d1115615597576000506104605060006103c052620186a0610300511115611b9e576003610360511015611b9d576060366103e0376008546104405264e8d4a51000610460526402540be4006104805260016104a0526104c060006002818352015b6fffffffffffffffffffffffffffffffff61044051166104006104c05160028110156155975760200201526104405160801c610440525b8151600101808352811415611915575b50506104c060006003818352015b610360516104c0511815611a65576104c0516119be576103e080516102a05164e8d4a51000808202821582848304141715615597578090509050905081818301106155975780820190509050815250611a64565b6103e080516102a06104c05160038110156155975760200201516104006104c05160018082106155975780820390509050600281101561559757602002015180820282158284830414171561559757809050905090506104606104c05160038110156155975760200201518082028215828483041417156155975780905090509050670de0b6b3a764000080820490509050818183011061559757808201905090508152505b5b5b815160010180835281141561196a575b50506103e0516103005180820282158284830414171561559757809050905090506103a051808015615597578204905090506103e0526103e051670de0b6b3a7640000808202821582848304141715615597578090509050905060046103605160038110156155975760200201356104606103605160038110156155975760200201518082028215828483041417156155975780905090509050610300516102a0610360516003811015615597576020020151808202821582848304141715615597578090509050905061046061036051600381101561559757602002015180820282158284830414171561559757809050905090506103a051808015615597578204905090508082106155975780820390509050808015615597578204905090506103c0525b5b6101406103e0525b6103e0515160206103e051016103e0526103e06103e0511015611bc857611ba6565b610140516104005261016051610420526101e0516104405261020051610460526102205161048052610360516104a0526103c0516104c052610380516104e0526104e0516104c0516104a051610480516104605161044051610420516104005160065801613be2565b6103c06103e0525b6103e0515260206103e051036103e0526101406103e05110611c5a57611c39565b600050611cd0565b61038051601f55670de0b6b3a7640000602455670de0b6b3a7640000602255602061046060446340c10f196103c052336103e05261030051610400526103dc6000738e0b8c8bb9db49a46697f3a5bb8a308e744821d25af11561559757601f3d111561559757600050610460505b606435610300511015611d22576308c379a06103c05260206103e0526008610400527f536c697070616765000000000000000000000000000000000000000000000000610420526104005060646103dcfd5b606060046103c03761032051610420526103a05161044052337f96b486485420b963edd3fdec0b0195730035600feb7de6f544383d7950fa97ee60a06103c0a26000600155005b63ecb586a581141561206c57600254615597576001600255346155975773fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb961014052732f2a2543b76a4166549f7aab2e75bef0aefc5b0f610160527382af49447d8a07e3bd95bd0d56f35241523fbab161018052602061022060046318160ddd6101c0526101dc738e0b8c8bb9db49a46697f3a5bb8a308e744821d25afa1561559757601f3d111561559757600050610220516101a052602061026060446379cc67906101c052336101e052600435610200526101dc6000738e0b8c8bb9db49a46697f3a5bb8a308e744821d25af11561559757601f3d11156155975760005061026050601c80546101c05260018101546101e05260028101546102005250600435600180821061559757808203905090506102205261024060006003818352015b6101c06102405160038110156155975760200201516102205180820282158284830414171561559757809050905090506101a051808015615597578204905090506102605260246102405160038110156155975760200201356102605110615597576101c061024051600381101561559757602002015161026051808210615597578082039050905060016102405160038110156155975702601c0155610260516101c06102405160038110156155975760200201526101406102405160038110156155975760200201513b156155975760006000604463a9059cbb61028052336102a052610260516102c05261029c60006101406102405160038110156155975760200201515af115615597575b8151600101808352811415611e9f575b5050601f546102405261024051610240516102205180820282158284830414171561559757809050905090506101a051808015615597578204905090508082106155975780820390509050601f556101c051610260526101e05161028052610200516102a0526101a05160043580821061559757808203905090506102c052337fd6cc314a0b1e3b2579f8e64248e82434072e8271290eef8ad0886709304195f56080610260a26000600255005b633883e1198114156120f157346155975760643560011c6155975760206102206084633883e11961014052600480356101605280602001356101805280604001356101a052506064356101c05261015c7348a68c5511dfc355007b7b794890f26653a7bf935afa1561559757601f3d1115615597576000506102205160005260206000f35b634fb08c5e81141561221457346155975760065801613371565b610140526101605261014080516101805280602001516101a052506101405161016051610180516101a051610180516101c0526101a0516101e0526040600461020037600161024052600061026052610260516102405161022051610200516101e0516101c05160065801614d99565b6102c0526102e052610300526103205261034052610360526101a0526101805261016052610140526102c08080808051610380525050602081019050808080516103a0525050602081019050808080516103c05250506020810190508080808080516103e05250506020810190508080805161040052505060208101905080808051610420525050505050506103805160005260206000f35b63f1dc3cc981141561262c57600354615597576001600355346155975760265461559757610140516101605160065801613371565b610180526101a05261016052610140526101808051610140528060200151610160525060c03661018037600d54610240526101405161016051610180516101a0516101c0516101e05161020051610220516102405161014051610260526101605161028052604060046102a037600061024051116102e052600161030052610300516102e0516102c0516102a051610280516102605160065801614d99565b61036052610380526103a0526103c0526103e052610400526102405261022052610200526101e0526101c0526101a05261018052610160526101405261036080808080516104205250506020810190508080805161044052505060208101905080808051610460525050602081019050808080808051610480525050602081019050808080516104a0525050602081019050808080516104c05250505050505061042080516101805280602001516101c05280604001516101a0528060600180516101e0528060200151610200528060400151610220525050604435610180511015612413576308c379a06102605260206102805260086102a0527f536c6970706167650000000000000000000000000000000000000000000000006102c0526102a050606461027cfd5b610240514210612423576001600d555b600160243560038110156155975702601c018054610180518082106155975780820390509050815550602061030060446379cc67906102605233610280526004356102a05261027c6000738e0b8c8bb9db49a46697f3a5bb8a308e744821d25af11561559757601f3d111561559757600050610300506101405161016051610180516101a0516101c0516101e051610200516102205161024051610140516102605261016051610280526101e0516102a052610200516102c052610220516102e052602435610300526101c051610320526101a051610340526103405161032051610300516102e0516102c0516102a051610280516102605160065801613be2565b6102405261022052610200526101e0526101c0526101a05261018052610160526101405260005073fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb961026052732f2a2543b76a4166549f7aab2e75bef0aefc5b0f610280527382af49447d8a07e3bd95bd0d56f35241523fbab16102a05261026060243560038110156155975760200201513b156155975760006000604463a9059cbb6102c052336102e05261018051610300526102dc600061026060243560038110156155975760200201515af11561559757604060046102c0376101805161030052337f5ad056f2e28a8cec232015406b843668c1e36cda598127ec3b8c59b8c72773a060606102c0a26000600355005b63c93f49e881141561265c5760045461559757600160045534615597576006580161374b565b6000506000600455005b635e24807281141561287557346155975760205433141561559757600c546201517f8181830110615597578082019050905042111561559757426201517f81818301106155975780820190509050604435111561559757610140516101605160065801613371565b610180526101a0526101605261014052610180805161014052806020015161016052506101405160801b6101805261016051610180511761018052600060043511156155975763a0eebb016004351015615597576402540be3ff602435111561559757662386f26fc10001602435101561559757670de0b6b3a7640000600435808202821582848304141715615597578090509050905061014051808015615597578204905090506101a052678ac7230489e800016101a05110156155975767016345785d89ffff6101a051111561559757670de0b6b3a7640000602435808202821582848304141715615597578090509050905061016051808015615597578204905090506101a052678ac7230489e800016101a05110156155975767016345785d89ffff6101a05111156155975761018051600a5542600c5560043560801b6101c0526024356101c051176101c052604435600d556101c051600b55610140516101e052600435610200526101605161022052602435610240524261026052604435610280527fe35f0559b0642164e286b30df2077ec3a05426617a25db7578fd20ba39a6cd0560c06101e0a1005b63244c7c2e81141561293057346155975760205433141561559757610140516101605160065801613371565b610180526101a0526101605261014052610180805161014052806020015161016052506101405160801b610180526101605161018051176101805261018051600a5561018051600b5542600c5542600d55610140516101a052610160516101c052426101e0527f5f0e7fba3d100c9e19446e1c92fe436f0a9a22fe99669360e4fdd6d3de2fc28460606101a0a1005b63a43c3351811415612b01573461559757602054331415615597576029546155975760e06004610140376402540be40161016051101561297d576207a11f61016051111561559757612985565b601754610160525b6402540be40061014051111561299d57601654610140525b610160516101405111615597576402540be4006101805111156129c257601854610180525b670de0b6b3a76400006101a05110156129e65760006101a0511115615597576129ee565b6010546101a0525b670de0b6b3a76400006101c0511115612a0957600e546101c0525b670de0b6b3a76400006101e0511115612a24576012546101e0525b62093a80610200511015612a4357600061020051111561559757612a4b565b601454610200525b426203f48081818301106155975780820190509050610220526102205160295561018051601b556101405160195561016051601a556101a0516011556101c051600f556101e051601355610200516015556101805161024052610140516102605261016051610280526101a0516102a0526101c0516102c0526101e0516102e0526102005161030052610220517f913fde9a37e1f8ab67876a4d0ce80790d764fcfc5692f4529526df9c6bdde55360e0610240a2005b632a7dd7cd811415612c2b5760055461559757600160055534615597576020543314156155975760295442106155975760006029541815615597576000602955601b5461014052610140516018541815612b7157610140516006580161374b565b61014052600050610140516018555b6019546101605261016051601655601a5461018052610180516017556011546101a0526101a051601055600f546101c0526101c051600e556013546101e0526101e05160125560155461020052610200516014556101405161022052610160516102405261018051610260526101a051610280526101c0516102a0526101e0516102c052610200516102e0527f1c65bbdc939f346e5d6f0bde1f072819947438d4fc7b182cc59c2f6dc550408760e0610220a16000600555005b63226840fb811415612c4d573461559757602054331415615597576000602955005b636b441a40811415612cce57346155975760043560a01c615597576020543314156155975760285461559757426203f480818183011061559757808201905090506101405261014051602855600435602155600435610140517f181aa3aa17d4cbf99265dd4443eba009433d3cde79d60164fde1d1a192beb93560006000a3005b636a1c05ae811415612d3c57346155975760205433141561559757602854421061559757600060285418156155975760006028556021546101405261014051602055610140517f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c60006000a2005b6386fbf193811415612d5e573461559757602054331415615597576000602855005b63e3698853811415612d8a57346155975760205433141561559757426027541115615597576001602655005b633046f972811415612dac573461559757602054331415615597576000602655005b637242e524811415612dd957346155975760043560a01c6155975760205433141561559757600435602a55005b636112c747811415612df657346155975760095460005260206000f35b63204fe3d5811415612e13573461559757600a5460005260206000f35b63f30cfad5811415612e30573461559757600b5460005260206000f35b63e89876ff811415612e4d573461559757600c5460005260206000f35b63f9ed9597811415612e6a573461559757600d5460005260206000f35b6349fe9e77811415612e87573461559757600e5460005260206000f35b63727ced57811415612ea4573461559757600f5460005260206000f35b6372d4f0e2811415612ec157346155975760105460005260206000f35b63d7c3dcbe811415612ede57346155975760115460005260206000f35b63083812e5811415612efb57346155975760125460005260206000f35b634ea12c7d811415612f1857346155975760135460005260206000f35b63662b6274811415612f3557346155975760145460005260206000f35b630c5e23d4811415612f5257346155975760155460005260206000f35b6392526c0c811415612f6f57346155975760165460005260206000f35b63ee8de675811415612f8c57346155975760175460005260206000f35b63fee3f7f9811415612fa957346155975760185460005260206000f35b637cf9aedc811415612fc657346155975760195460005260206000f35b637d1b060c811415612fe3573461559757601a5460005260206000f35b63e3824462811415613000573461559757601b5460005260206000f35b634903b0d181141561302d573461559757600160043560038110156155975702601c015460005260206000f35b630f529ba281141561304a573461559757601f5460005260206000f35b638da5cb5b81141561306757346155975760205460005260206000f35b631ec0cdc181141561308457346155975760215460005260206000f35b637ba1a74d8114156130a157346155975760225460005260206000f35b630b7b594b8114156130be57346155975760235460005260206000f35b630c46b72a8114156130db57346155975760245460005260206000f35b639c868ac08114156130f857346155975760265460005260206000f35b632a42689681141561311557346155975760275460005260206000f35b63e0a0b58681141561313257346155975760285460005260206000f35b63405e28f881141561314f57346155975760295460005260206000f35b636e42e4d281141561316c573461559757602a5460005260206000f35b505b005b6101805261014052610160526002610140511015615597576fffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8061014051600160ff1b81101561559757808202821582848305141715615597578090509050905060008112156131f85761016051816000031c6131ff565b61016051811b5b90501660005260005161018051565b61014052601c80546101605260018101546101805260028101546101a052506006546101c05264e8d4a510006101e0526402540be40061020052600161022052610160805164e8d4a51000808202821582848304141715615597578090509050905081525061024060016002818352015b6fffffffffffffffffffffffffffffffff6101c051166101e0610240516003811015615597576020020151808202821582848304141715615597578090509050905061026052610160610240516003811015615597576020020151610260518082028215828483041417156155975780905090509050670de0b6b3a7640000808204905090506101606102405160038110156155975760200201526101c05160801c6101c0525b815160010180835281141561327f575b50506060610240525b6000610240511161334f5761336b565b602061024051036101600151602061024051036102405261333f565b61014051565b61014052600d5461016052600b54610180526fffffffffffffffffffffffffffffffff61018051166101a0526101805160801c6101c052610160514210156134e857600a546101e052600c54610200526101608051610200518082106155975780820390509050815250426102005180821061559757808203905090506102005261016051610200518082106155975780820390509050610220526101e05160801c6102205180820282158284830414171561559757809050905090506101c0516102005180820282158284830414171561559757809050905090508181830110615597578082019050905061016051808015615597578204905090506101c0526fffffffffffffffffffffffffffffffff6101e051166102205180820282158284830414171561559757809050905090506101a0516102005180820282158284830414171561559757809050905090508181830110615597578082019050905061016051808015615597578204905090506101a0525b6101c051610200526101a0516102205260406101e0525b60006101e0511161350f5761352b565b60206101e05103610200015160206101e051036101e0526134ff565b61014051565b6101a05261014052610160526101805260206102c0608463fa18042d6101e052610140516102005261016051610220526101805161024052601054610260526101fc732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d1115615597576000506102c0516101c0526016546101c0518082028215828483041417156155975780905090509050601754670de0b6b3a76400006101c0518082106155975780820390509050808202821582848304141715615597578090509050905081818301106155975780820190509050670de0b6b3a7640000808204905090506000526000516101a051565b61016052610140526060366101803761014051600380820490509050610180526006546101e05261020060016002818352015b61014051670de0b6b3a7640000808202821582848304141715615597578090509050905060036fffffffffffffffffffffffffffffffff6101e051168082028215828483041417156155975780905090509050808015615597578204905090506101806102005160038110156155975760200201526101e05160801c6101e0525b8151600101808352811415613655575b505060206102c0606463bad1dc266102005261018051610220526101a051610240526101c0516102605261021c732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d1115615597576000506102c05160005260005161016051565b6101405261014051610160516101805160065801613371565b6101a0526101c0526101805261016052610140526101a0805161016052806020015161018052506022546101a0526023546101c05273fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb96101e052732f2a2543b76a4166549f7aab2e75bef0aefc5b0f610200527382af49447d8a07e3bd95bd0d56f35241523fbab16102205261024060006003818352015b60206102e060246370a0823161026052306102805261027c6101e06102405160038110156155975760200201515afa1561559757601f3d1115615597576000506102e05160016102405160038110156155975702601c01555b81516001018083528114156137f0575b5050602454610240526101c0516101a05111156139f7576101a0516101c051808210615597578082039050905060185480820282158284830414171561559757809050905090506404a817c800808204905090506102605260006102605111156139f657602a546102805260006102805118156139f55761024051670de0b6b3a764000080820282158284830414171561559757809050905090506102405161026051808210615597578082039050905080801561559757820490509050670de0b6b3a764000080821061559757808203905090506102a05260206103806044636962f8456102e05261028051610300526102a051610320526102fc6000738e0b8c8bb9db49a46697f3a5bb8a308e744821d25af11561559757601f3d111561559757600050610380516102c0526101a08051610260516002808202821582848304141715615597578090509050905080821061559757808203905090508152506101a0516022556102c0516102e052610280517f6059a38198b1dc42b3791087d1ff0fbd72b3179553c25f678cd246f52ffaaf5960206102e0a25b5b5b60206102e060046318160ddd6102805261029c738e0b8c8bb9db49a46697f3a5bb8a308e744821d25afa1561559757601f3d1115615597576000506102e05161026052602061040060a463c7fab70861030052610160516103205261018051610340526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516006580161320e565b6102a0526102c0526102e05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526102a080516103605280602001516103805280604001516103a0525061031c732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d111561559757600050610400516102805261028051601f55670de0b6b3a76400006101405161016051610180516101a0516101c0516101e0516102005161022051610240516102605161028051610280516102a0526102a05160065801613622565b6103005261028052610260526102405261022052610200526101e0526101c0526101a05261018052610160526101405261030051808202821582848304141715615597578090509050905061026051808015615597578204905090506024556101c0516101a0511115613bdc576101a0516023555b61014051565b610240526101405261016052610180526101a0526101c0526101e052610200526102205261016036610260376007546103c0526103e060006002818352015b6fffffffffffffffffffffffffffffffff6103c051166102606103e05160028110156155975760200201526103c05160801c6103c0525b8151600101808352811415613c21575b50506009546103e0526008546103c05261040060006002818352015b6fffffffffffffffffffffffffffffffff6103c051166102a06104005160028110156155975760200201526103c05160801c6103c0525b8151600101808352811415613c84575b5050426103e0511015613ecc576014546104005260206104e0604463571bae3f61044052426103e0518082106155975780820390509050670de0b6b3a764000080820282158284830414171561559757809050905090506104005180801561559757820490509050610460526402540be4006104805261045c732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d1115615597576000506104e0516104205260006103c05261044060006002818352015b6102a0610440516002811015615597576020020151670de0b6b3a7640000610420518082106155975780820390509050808202821582848304141715615597578090509050905061026061044051600281101561559757602002015161042051808202821582848304141715615597578090509050905081818301106155975780820190509050670de0b6b3a7640000808204905090506102606104405160028110156155975760200201525b8151600101808352811415613d86575b505061044060006002818352015b6103c05160801b6103c05261026060016104405180821061559757808203905090506002811015615597576020020151610460526fffffffffffffffffffffffffffffffff610460511015615597576103c05161046051176103c0525b8151600101808352811415613e51575b50506103c051600755426009555b610220516104005261022051613f4857602061052060a463c7fab708610420526101405161044052610160516104605261018051610480526101a0516104a0526101c0516104c05261043c732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d11156155975760005061052051610400525b6006546103c05261042060006002818352015b6fffffffffffffffffffffffffffffffff6103c051166102e06104205160028110156155975760200201526103c05160801c6103c0525b8151600101808352811415613f5b575b5050600061020051111561406a5760006101e0511115613fea57610200516102a06101e051600180821061559757808203905090506002811015615597576020020152614065565b61042060006002818352015b6102a0610420516002811015615597576020020151670de0b6b3a7640000808202821582848304141715615597578090509050905061020051808015615597578204905090506102a06104205160028110156155975760200201525b8151600101808352811415613ff6575b50505b6141e1565b61018051610420526101a051610440526101c0516104605261042051620f42408082049050905061048052610420805161048051818183011061559757808201905090508152506104a060006002818352015b6102e06104a05160028110156155975760200201516104805180820282158284830414171561559757809050905090506101806104a0516001818183011061559757808201905090506003811015615597576020020151602061060060e46336bc88556104c052610140516104e052610160516105005261042051610520526104405161054052610460516105605261040051610580526104a0516001818183011061559757808201905090506105a0526104dc732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d111561559757600050610600518082106155975780820390509050808015615597578204905090506102a06104a05160028110156155975760200201525b81516001018083528114156140bd575b50505b60006103c05261042060006002818352015b6103c05160801b6103c0526102a060016104205180821061559757808203905090506002811015615597576020020151610440526fffffffffffffffffffffffffffffffff610440511015615597576103c05161044051176103c0525b81516001018083528114156141f3575b50506103c05160085560206104a060046318160ddd6104405261045c738e0b8c8bb9db49a46697f3a5bb8a308e744821d25afa1561559757601f3d1115615597576000506104a051610420526022546104405260245461046052610400516003808204905090506103205261048060006002818352015b61040051670de0b6b3a7640000808202821582848304141715615597578090509050905060036102e06104805160028110156155975760200201518082028215828483041417156155975780905090509050808015615597578204905090506103206104805160018181830110615597578082019050905060038110156155975760200201525b81516001018083528114156142d7575b5050670de0b6b3a764000061048052670de0b6b3a76400006104a05260006104605111156144dd5760206105a0606463bad1dc266104e0526103205161050052610340516105205261036051610540526104fc732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d1115615597576000506105a0516104c052670de0b6b3a76400006104c051808202821582848304141715615597578090509050905061042051808015615597578204905090506104a052610440516104a0518082028215828483041417156155975780905090509050610460518080156155975782049050905061048052600d546104e052610460516104a051101561447d576104e05115614480565b60005b156144ca576308c379a0610500526020610520526004610540527f4c6f7373000000000000000000000000000000000000000000000000000000006105605261054050606461051cfd5b60016104e05114156144dc576000600d555b5b610480516022556025546104c0526104c05161455d57610480516002600e548082028215828483041417156155975780905090509050818183011061559757808201905090506104a05160028082028215828483041417156155975780905090509050670de0b6b3a7640000808210615597578082039050905011614560565b60005b156145715760016104c05260016025555b6104c05115614b77576012546104e05260006105005261052060006002818352015b610260610520516002811015615597576020020151670de0b6b3a764000080820282158284830414171561559757809050905090506102e06105205160028110156155975760200201518080156155975782049050905061054052670de0b6b3a7640000610540511115614625576105408051670de0b6b3a76400008082106155975780820390509050815250614645565b670de0b6b3a7640000610540518082106155975780820390509050610540525b6105008051700100000000000000000000000000000000610540511015615597576002610540510a818183011061559757808201905090508152505b8151600101808352811415614593575b50507001000000000000000000000000000000006104e05110156155975760026104e0510a6105005111156146cc57600061046051116146cf565b60005b15614b765760206105a06024634e60b1416105205261050051670de0b6b3a7640000808204905090506105405261053c732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d1115615597576000506105a0516105005261052060006002818352015b6102e0610520516002811015615597576020020151610500516104e051808210615597578082039050905080820282158284830414171561559757809050905090506104e05161026061052051600281101561559757602002015180820282158284830414171561559757809050905090508181830110615597578082019050905061050051808015615597578204905090506103806105205160028110156155975760200201525b815160010180835281141561473b575b505061018051610320526101a051610340526101c0516103605261052060006002818352015b61018061052051600181818301106155975780820190509050600381101561559757602002015161038061052051600281101561559757602002015180820282158284830414171561559757809050905090506102e0610520516002811015615597576020020151808015615597578204905090506103206105205160018181830110615597578082019050905060038110156155975760200201525b815160010180835281141561481a575b5050602061064060a463c7fab7086105405261014051610560526101605161058052610320516105a052610340516105c052610360516105e05261055c732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d1115615597576000506106405161052052610520516003808204905090506103205261054060006002818352015b61052051670de0b6b3a7640000808202821582848304141715615597578090509050905060036103806105405160028110156155975760200201518082028215828483041417156155975780905090509050808015615597578204905090506103206105405160018181830110615597578082019050905060038110156155975760200201525b8151600101808352811415614951575b5050670de0b6b3a76400006020610600606463bad1dc266105405261032051610560526103405161058052610360516105a05261055c732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d111561559757600050610600518082028215828483041417156155975780905090509050610420518080156155975782049050905061046052670de0b6b3a7640000610460511115614ac757610480516002610460518082028215828483041417156155975780905090509050670de0b6b3a7640000808210615597578082039050905011614aca565b60005b15614b6f5760006103c05261054060006002818352015b6103c05160801b6103c05261038060016105405180821061559757808203905090506002811015615597576020020151610560526fffffffffffffffffffffffffffffffff610560511015615597576103c05161056051176103c0525b8151600101808352811415614ae1575b50506103c05160065561052051601f55610460516024556102405156614b75565b60006025555b5b5b61040051601f556104a05160245561024051565b610200526101405261016052610180526101a0526101c0526101e0526101405161016051610180516101a0516101c0516101e05161020051610220516101a051610240526101c051610260526101e0516102805261028051610260516102405160065801613531565b6102e05261022052610200526101e0526101c0526101a0526101805261016052610140526102e051600380820282158284830414171561559757809050905090506008808204905090506102205260006102405261028060006003818352015b60206102805102610140015161026052610240805161026051818183011061559757808201905090508152505b8151600101808352811415614c54575b505061024051600380820490509050610260526000610280526102c060006003818352015b60206102c0510261014001516102a052610260516102a0511115614d075761028080516102a05161026051808210615597578082039050905081818301106155975780820190509050815250614d36565b6102808051610260516102a0518082106155975780820390509050818183011061559757808201905090508152505b5b8151600101808352811415614cb6575b5050610220516102805180820282158284830414171561559757809050905090506102405180801561559757820490509050620186a08181830110615597578082019050905060005260005161020051565b610200526101405261016052610180526101a0526101c0526101e05260206102a060046318160ddd6102405261025c738e0b8c8bb9db49a46697f3a5bb8a308e744821d25afa1561559757601f3d1115615597576000506102a051610220526102205161018051116155975760036101a051101561559757601c8054610240526001810154610260526002810154610280525064e8d4a510006102a0526402540be4006102c05260016102e0526000610300526c0c9f2c9cd04674edea4000000061032052600115614f9857600654610340526102a0805161024051808202821582848304141715615597578090509050905081525061036060016002818352015b6fffffffffffffffffffffffffffffffff610340511661038052610360516101a0511415614ef857610380516102a06101a05160038110156155975760200201518082028215828483041417156155975780905090509050610320525b6102a06103605160038110156155975760200201516102406103605160038110156155975760200201518082028215828483041417156155975780905090509050610380518082028215828483041417156155975780905090509050670de0b6b3a7640000808204905090506102a06103605160038110156155975760200201526103405160801c610340525b8151600101808352811415614e9b575b50505b6101c0511561501157602061044060a463c7fab70861034052610140516103605261016051610380526102a0516103a0526102c0516103c0526102e0516103e05261035c732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d1115615597576000506104405161030052615019565b601f54610300525b6103005161034052610140610380525b6103805151602061038051016103805261038061038051101561504b57615029565b6102a0516103a0526102c0516103c0526102e0516103e0526103e0516103c0516103a05160065801613531565b61044052610360610380525b6103805152602061038051036103805261014061038051106150a557615084565b610440516103605261018051610340518082028215828483041417156155975780905090509050610220518080156155975782049050905061038052610340805161038051610360516103805180820282158284830414171561559757809050905090506404a817c8008082049050905060018181830110615597578082019050905080821061559757808203905090508082106155975780820390509050815250602061050060e46336bc88556103c052610140516103e05261016051610400526102a051610420526102c051610440526102e0516104605261034051610480526101a0516104a0526103dc732f0af8ec2f5893392843a0f647a30a141dba9daf5afa1561559757601f3d111561559757600050610500516103a0526102a06101a05160038110156155975760200201516103a0518082106155975780820390509050670de0b6b3a7640000808202821582848304141715615597578090509050905061032051808015615597578204905090506103c0526103a0516102a06101a051600381101561559757602002015260006103e0526101e0511561526a57620186a06103c051111561526257620186a06101805111615265565b60005b61526d565b60005b5b156155255760006104005264e8d4a51000610420526402540be40061044052600161046052604036610480376008546104c0526104e060006002818352015b6fffffffffffffffffffffffffffffffff6104c051166104806104e05160028110156155975760200201526104c05160801c6104c0525b81516001018083528114156152ad575b50506104e060006003818352015b6101a0516104e05118156153fd576104e0516153565761040080516102405164e8d4a510008082028215828483041417156155975780905090509050818183011061559757808201905090508152506153fc565b61040080516102406104e05160038110156155975760200201516104806104e05160018082106155975780820390509050600281101561559757602002015180820282158284830414171561559757809050905090506104206104e05160038110156155975760200201518082028215828483041417156155975780905090509050670de0b6b3a764000080820490509050818183011061559757808201905090508152505b5b5b8151600101808352811415615302575b50506104005161038051808202821582848304141715615597578090509050905061030051808015615597578204905090506104005261040051670de0b6b3a764000080820282158284830414171561559757809050905090506103c0516104206101a05160038110156155975760200201518082028215828483041417156155975780905090509050610380516102406101a051600381101561559757602002015180820282158284830414171561559757809050905090506104206101a0516003811015615597576020020151808202821582848304141715615597578090509050905061030051808015615597578204905090508082106155975780820390509050808015615597578204905090506103e0525b6104c06103c05181526103e0518160200152610340518160400152806060016102a05181526102c05181602001526102e0518160400152505060c0610580525b6000610580511161557557615591565b602061058051036104c001516020610580510361058052615565565b61020051565b600080fd5b6101586156f4036101586000396101586156f4036000f35b600080fd000000000000000000000000babe61887f1de2713c6f97e567623453d3c79f6700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000083d6000000000000000000000000000000000000000000000000000001319718a50000000000000000000000000000000000000000000000000000000000000a7d8c00000000000000000000000000000000000000000000000000000000002aea540000000000000000000000000000000000000000000000000000001d1a94a20000000000000000000000000000000000000000000000000000001c6bf526340000000000000000000000000000000000000000000000000000001bda703f0a000000000000000000000000000000000000000000000000000000000012a05f200000000000000000000000000000000000000000000000000000000000000025800000000000000000000000000000000000000000000097c49a087376f8000000000000000000000000000000000000000000000000000afa8322227a2400000

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000babe61887f1de2713c6f97e567623453d3c79f6700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000083d6000000000000000000000000000000000000000000000000000001319718a50000000000000000000000000000000000000000000000000000000000000a7d8c00000000000000000000000000000000000000000000000000000000002aea540000000000000000000000000000000000000000000000000000001d1a94a20000000000000000000000000000000000000000000000000000001c6bf526340000000000000000000000000000000000000000000000000000001bda703f0a000000000000000000000000000000000000000000000000000000000012a05f200000000000000000000000000000000000000000000000000000000000000025800000000000000000000000000000000000000000000097c49a087376f8000000000000000000000000000000000000000000000000000afa8322227a2400000

-----Decoded View---------------
Arg [0] : owner (address): 0xbabe61887f1de2713c6f97e567623453d3c79f67
Arg [1] : admin_fee_receiver (address): 0x0000000000000000000000000000000000000000
Arg [2] : A (uint256): 540000
Arg [3] : gamma (uint256): 21000000000000
Arg [4] : mid_fee (uint256): 11000000
Arg [5] : out_fee (uint256): 45000000
Arg [6] : allowed_extra_profit (uint256): 2000000000000
Arg [7] : fee_gamma (uint256): 500000000000000
Arg [8] : adjustment_step (uint256): 490000000000000
Arg [9] : admin_fee (uint256): 5000000000
Arg [10] : ma_half_time (uint256): 600
Arg [11] : initial_prices (uint256[2]): 44793999999999997378560,3240300000000000131072

-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 000000000000000000000000babe61887f1de2713c6f97e567623453d3c79f67
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 0000000000000000000000000000000000000000000000000000000000083d60
Arg [3] : 00000000000000000000000000000000000000000000000000001319718a5000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000a7d8c0
Arg [5] : 0000000000000000000000000000000000000000000000000000000002aea540
Arg [6] : 000000000000000000000000000000000000000000000000000001d1a94a2000
Arg [7] : 0000000000000000000000000000000000000000000000000001c6bf52634000
Arg [8] : 0000000000000000000000000000000000000000000000000001bda703f0a000
Arg [9] : 000000000000000000000000000000000000000000000000000000012a05f200
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000258
Arg [11] : 00000000000000000000000000000000000000000000097c49a087376f800000
Arg [12] : 0000000000000000000000000000000000000000000000afa8322227a2400000


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