ETH Price: $2,380.63 (+1.43%)

Contract

0xE0a4C53408f5ACf3246c83b9b8bD8d36D5ee38B8
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
194226912024-03-13 0:50:59205 days ago1710291059  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CryptoFromPool

Compiler Version
vyper:0.3.10

Optimization Enabled:
N/A

Other Settings:
None license

Contract Source Code (Vyper language format)

# @version 0.3.10
"""
@title CryptoFromPool
@notice Price oracle for pools which contain cryptos and crvUSD. This is NOT suitable for minted crvUSD - only for lent out
@author Curve.Fi
@license MIT
"""
interface Pool:
    def price_oracle(i: uint256 = 0) -> uint256: view  # Universal method!


POOL: public(immutable(Pool))
BORROWED_IX: public(immutable(uint256))
COLLATERAL_IX: public(immutable(uint256))
N_COINS: public(immutable(uint256))
NO_ARGUMENT: public(immutable(bool))


@external
def __init__(
        pool: Pool,
        N: uint256,
        borrowed_ix: uint256,
        collateral_ix: uint256
    ):
    assert borrowed_ix != collateral_ix
    assert borrowed_ix < N
    assert collateral_ix < N
    POOL = pool
    N_COINS = N
    BORROWED_IX = borrowed_ix
    COLLATERAL_IX = collateral_ix

    no_argument: bool = False
    if N == 2:
        success: bool = False
        res: Bytes[32] = empty(Bytes[32])
        success, res = raw_call(
            pool.address,
            _abi_encode(empty(uint256), method_id=method_id("price_oracle(uint256)")),
            max_outsize=32, is_static_call=True, revert_on_failure=False)
        if not success:
            no_argument = True
    NO_ARGUMENT = no_argument


@internal
@view
def _raw_price() -> uint256:
    p_borrowed: uint256 = 10**18
    p_collateral: uint256 = 10**18

    if NO_ARGUMENT:
        p: uint256 = POOL.price_oracle()
        if COLLATERAL_IX > 0:
            p_collateral = p
        else:
            p_borrowed = p

    else:
        if BORROWED_IX > 0:
            p_borrowed = POOL.price_oracle(BORROWED_IX - 1)
        if COLLATERAL_IX > 0:
            p_collateral = POOL.price_oracle(COLLATERAL_IX - 1)

    return p_collateral * 10**18 / p_borrowed


@external
@view
def price() -> uint256:
    return self._raw_price()


@external
def price_w() -> uint256:
    return self._raw_price()

Contract Security Audit

Contract ABI

[{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"pool","type":"address"},{"name":"N","type":"uint256"},{"name":"borrowed_ix","type":"uint256"},{"name":"collateral_ix","type":"uint256"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"price","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"price_w","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"POOL","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"BORROWED_IX","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"COLLATERAL_IX","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"N_COINS","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"NO_ARGUMENT","inputs":[],"outputs":[{"name":"","type":"bool"}]}]

6103095150346101235760206103c55f395f518060a01c6101235760405260206104255f395f5160206104055f395f51146101235760206103e55f395f5160206104055f395f5110156101235760206103e55f395f5160206104255f395f511015610123576040516102895260206103e55f395f516102e95260206104055f395f516102a95260206104255f395f516102c9525f606052600260206103e55f395f511861010a576040366080376040515a636872765360e45260045f6101045260200160e05260e050602061016060e0516101008585fa905090506080523d602081183d602010021861014052610140805160a052602081015160c0525060805161010a5760016060525b6060516103095261028961012761000039610329610000f35b5f80fd5f3560e01c60026007821660011b61027901601e395f51565b637535d2468118610036573461027557602061028960403960206040f35b63a035b1fe81186100fa573461027557602061005260e06100fe565b60e0f36100fa565b63bf5d248c81186100fa57346102755760206102a960403960206040f36100fa565b63fccecc21811861009a57346102755760206102c960403960206040f35b63ceb7f75981186100fa57346102755760206100b660e06100fe565b60e0f36100fa565b632935775081186100dc57346102755760206102e960403960206040f35b63f74f678081186100fa573461027557602061030960403960206040f35b5f5ffd5b670de0b6b3a7640000604052670de0b6b3a764000060605260206103095f395f516101e75760206102a95f395f51156101835760206102895f395f51636872765360805260206102a95f395f516001810381811161027557905060a052602060806024609c845afa610172573d5f5f3e3d5ffd5b60203d106102755760809050516040525b60206102c95f395f511561023f5760206102895f395f51636872765360805260206102c95f395f516001810381811161027557905060a052602060806024609c845afa6101d2573d5f5f3e3d5ffd5b60203d1061027557608090505160605261023f565b60206102895f395f516386fc88d360a052602060a0600460bc845afa61020f573d5f5f3e3d5ffd5b60203d106102755760a090505160805260206102c95f395f51156102385760805160605261023f565b6080516040525b606051670de0b6b3a7640000810281670de0b6b3a764000082041861027557905060405180156102755780820490509050815250565b5f80fd00be007c00fa00fa005a00fa001800fa84190289811018a0a16576797065728300030a00150000000000000000000000004ebdf703948ddcea3b11f675b4d1fba9d2414a14000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002

Deployed Bytecode

0x5f3560e01c60026007821660011b61027901601e395f51565b637535d2468118610036573461027557602061028960403960206040f35b63a035b1fe81186100fa573461027557602061005260e06100fe565b60e0f36100fa565b63bf5d248c81186100fa57346102755760206102a960403960206040f36100fa565b63fccecc21811861009a57346102755760206102c960403960206040f35b63ceb7f75981186100fa57346102755760206100b660e06100fe565b60e0f36100fa565b632935775081186100dc57346102755760206102e960403960206040f35b63f74f678081186100fa573461027557602061030960403960206040f35b5f5ffd5b670de0b6b3a7640000604052670de0b6b3a764000060605260206103095f395f516101e75760206102a95f395f51156101835760206102895f395f51636872765360805260206102a95f395f516001810381811161027557905060a052602060806024609c845afa610172573d5f5f3e3d5ffd5b60203d106102755760809050516040525b60206102c95f395f511561023f5760206102895f395f51636872765360805260206102c95f395f516001810381811161027557905060a052602060806024609c845afa6101d2573d5f5f3e3d5ffd5b60203d1061027557608090505160605261023f565b60206102895f395f516386fc88d360a052602060a0600460bc845afa61020f573d5f5f3e3d5ffd5b60203d106102755760a090505160805260206102c95f395f51156102385760805160605261023f565b6080516040525b606051670de0b6b3a7640000810281670de0b6b3a764000082041861027557905060405180156102755780820490509050815250565b5f80fd00be007c00fa00fa005a00fa001800fa0000000000000000000000004ebdf703948ddcea3b11f675b4d1fba9d2414a140000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000

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

0000000000000000000000004ebdf703948ddcea3b11f675b4d1fba9d2414a14000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002

-----Decoded View---------------
Arg [0] : pool (address): 0x4eBdF703948ddCEA3B11f675B4D1Fba9d2414A14
Arg [1] : N (uint256): 3
Arg [2] : borrowed_ix (uint256): 0
Arg [3] : collateral_ix (uint256): 2

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000004ebdf703948ddcea3b11f675b4d1fba9d2414a14
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000002


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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