ETH Price: $1,634.45 (+0.65%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Send_blockhash181910132023-09-22 11:13:59569 days ago1695381239IN
0x12F40734...be021fBF9
0 ETH0.000426119.53901902
Send_blockhash176161982023-07-03 21:46:23650 days ago1688420783IN
0x12F40734...be021fBF9
0 ETH0.0006925215.50686153
Send_blockhash175933302023-06-30 16:38:35653 days ago1688143115IN
0x12F40734...be021fBF9
0 ETH0.0018404441.21101284
Send_blockhash175932962023-06-30 16:31:47653 days ago1688142707IN
0x12F40734...be021fBF9
0 ETH0.0016881337.79048411
Send_blockhash170385542023-04-13 12:30:35731 days ago1681389035IN
0x12F40734...be021fBF9
0 ETH0.0015109633.83327633
Send_blockhash170271212023-04-11 20:12:11733 days ago1681243931IN
0x12F40734...be021fBF9
0 ETH0.000822834.32084699
Send_blockhash169414582023-03-30 17:10:47745 days ago1680196247IN
0x12F40734...be021fBF9
0 ETH0.0021882949
Send_blockhash169320212023-03-29 9:20:23746 days ago1680081623IN
0x12F40734...be021fBF9
0 ETH0.0016057326
Send_blockhash169320142023-03-29 9:18:59746 days ago1680081539IN
0x12F40734...be021fBF9
0 ETH0.0011611326
Send_blockhash166324572023-02-15 6:48:23788 days ago1676443703IN
0x12F40734...be021fBF9
0 ETH0.0015185924.59383289
Send_blockhash161253492022-12-06 11:07:11859 days ago1670324831IN
0x12F40734...be021fBF9
0 ETH0.0005886113.18379404
Send_blockhash161253452022-12-06 11:06:23859 days ago1670324783IN
0x12F40734...be021fBF9
0 ETH0.0005787512.95950283
Send_blockhash161253412022-12-06 11:05:35859 days ago1670324735IN
0x12F40734...be021fBF9
0 ETH0.0005867713.14249713
Send_blockhash159903422022-11-17 14:29:35878 days ago1668695375IN
0x12F40734...be021fBF9
0 ETH0.0009015620.19323917
Send_blockhash159903392022-11-17 14:28:59878 days ago1668695339IN
0x12F40734...be021fBF9
0 ETH0.0012092919.58464813
Send_blockhash159903352022-11-17 14:28:11878 days ago1668695291IN
0x12F40734...be021fBF9
0 ETH0.0008830419.77303955
Send_blockhash159885832022-11-17 8:35:11878 days ago1668674111IN
0x12F40734...be021fBF9
0 ETH0.0006008613.45459667
Send_blockhash156289192022-09-28 2:41:23929 days ago1664332883IN
0x12F40734...be021fBF9
0 ETH0.0010231522.91047004
Send_blockhash156001392022-09-24 2:10:11933 days ago1663985411IN
0x12F40734...be021fBF9
0 ETH0.000483727.83254216
Send_blockhash147543092022-05-11 10:22:371068 days ago1652264557IN
0x12F40734...be021fBF9
0 ETH0.0035213357.02846735

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.3.1

Optimization Enabled:
N/A

Other Settings:
default evmVersion, None license

Contract Source Code (Vyper language format)

# @version 0.3.1
"""
@title Curve Ethereum State Sender
"""


interface AnyCallProxy:
    def anyCall(
        _to: address, _data: Bytes[68], _fallback: address, _to_chain_id: uint256
    ): nonpayable

interface RootGaugeFactory:
    def get_bridger(_chain_id: uint256) -> address: view

interface VotingEscrow:
    def epoch() -> uint256: view
    def point_history(_idx: uint256) -> Point: view
    def user_point_epoch(_user: address) -> uint256: view


struct Point:
    bias: int128
    slope: int128  # - dweight / dt
    ts: uint256
    blk: uint256  # block


WEEK: constant(uint256) = 86400 * 7

ANYCALL_PROXY: constant(address) = 0x37414a8662bC1D25be3ee51Fb27C2686e2490A89
ROOT_GAUGE_FACTORY: constant(address) = 0xabC000d88f23Bb45525E447528DBF656A9D55bf5
VOTING_ESCROW: constant(address) = 0x5f3b5DfEb7B28CDbD7FAba78963EE202a494e2A2


# chain_id => last block number sent
_last_sent: HashMap[uint256, uint256]


@external
def send_blockhash(_block_number: uint256, _chain_id: uint256):
    """
    @notice Send the blockhash of `_block_number` to `_chain_id`
    @dev The `_block_number` chosen must be within `block_number_bounds()`
    @param _block_number The block number to push the blockhash of
    @param _chain_id The chain id of the chain to push the data to
    """
    last_sent: uint256 = self._last_sent[_chain_id]
    # must wait 1024 blocks since the last block sent before sending a new block
    assert self._last_sent[_chain_id] < block.number - 1024  # dev: sending too soon
    # must send a block that has >40 confirmations
    assert block.number - _block_number > 40  # dev: block too fresh
    # must send a block that is <256 blocks old
    assert block.number - _block_number < 256  # dev: block too stale

    block_hash: bytes32 = blockhash(_block_number)
    assert block_hash != EMPTY_BYTES32  # dev: invalid blockhash
    assert RootGaugeFactory(ROOT_GAUGE_FACTORY).get_bridger(_chain_id) != ZERO_ADDRESS  # dev: invalid chain_id

    # update the last block sent
    self._last_sent[_chain_id] = _block_number

    AnyCallProxy(ANYCALL_PROXY).anyCall(
        self,
        _abi_encode(
            _block_number,
            block_hash,
            method_id=method_id("set_eth_blockhash(uint256,bytes32)")
        ),
        ZERO_ADDRESS,
        _chain_id
    )


@view
@external
def block_number_bounds() -> uint256[2]:
    """
    @notice The lower and upper bounds (exclusive) of valid block numbers to push.
    @dev The block number closest to the upper bound should be chosen to send cross chain
    """
    return [block.number - 256, block.number - 40]


@view
@external
def generate_eth_get_proof_params(_user: address) -> (address, uint256[20], uint256):
    """
    @notice Generate the params arguments required for the `eth_getProof` RPC call
    @dev This method should be called at the same block number as the blockhash the proof
        will be verified against. For blocks greater than `block.number - 256` this method
        should be called via an archive node.
    @param _user The account the storage proof will be generated for
    """
    # initialize positions array
    positions: uint256[20] = empty(uint256[20])

    # `VotingEscrow.epoch()`
    positions[0] = 3

    # `VotingEscrow.point_history(uint256)`
    global_epoch: uint256 = VotingEscrow(VOTING_ESCROW).epoch()
    point_history_pos: uint256 = convert(keccak256(_abi_encode(convert(keccak256(_abi_encode(convert(4, bytes32))), uint256) + global_epoch)), uint256)

    for i in range(4):
        positions[1 + i] = point_history_pos + i

    # `VotingEscrow.user_point_epoch(address)`
    positions[5] = convert(keccak256(_abi_encode(convert(6, bytes32), _user)), uint256)

    # `VotingEscrow.user_point_history(address,uint256)`
    user_epoch: uint256 = VotingEscrow(VOTING_ESCROW).user_point_epoch(_user)
    user_point_history_pos: uint256 = convert(keccak256(_abi_encode(convert(keccak256(_abi_encode(keccak256(_abi_encode(convert(5, bytes32), _user)))), uint256) + user_epoch)), uint256)

    for i in range(4):
        positions[6 + i] = user_point_history_pos + i

    # `VotingEscrow.locked(address)`
    # uint256 locked_pos = uint256(keccak256());
    locked_pos: uint256 = convert(keccak256(_abi_encode(keccak256(_abi_encode(convert(2, bytes32), _user)))), uint256)

    positions[10] = locked_pos
    positions[11] = locked_pos + 1

    # `VotingEscrow.slope_changes(uint256)`
    # Slots for the 8 weeks worth of slope changes
    last_point: Point = VotingEscrow(VOTING_ESCROW).point_history(global_epoch)
    start_time: uint256 = (last_point.ts / WEEK) * WEEK + WEEK

    for i in range(8):
        positions[12 + i] = convert(keccak256(_abi_encode(convert(7, bytes32), start_time + WEEK * i)), uint256)

    return VOTING_ESCROW, positions, block.number


@view
@external
def get_last_block_number_sent(_chain_id: uint256) -> uint256:
    """
    @notice Get the last block number which had its blockhash sent to `_chain_id`
    @param _chain_id The chain id of interest
    """
    last_block: uint256 = self._last_sent[_chain_id]
    if last_block == 0:
        last_block = 14309414
    return last_block

Contract Security Audit

Contract ABI

API
[{"stateMutability":"nonpayable","type":"function","name":"send_blockhash","inputs":[{"name":"_block_number","type":"uint256"},{"name":"_chain_id","type":"uint256"}],"outputs":[],"gas":54147},{"stateMutability":"view","type":"function","name":"block_number_bounds","inputs":[],"outputs":[{"name":"","type":"uint256[2]"}],"gas":740},{"stateMutability":"view","type":"function","name":"generate_eth_get_proof_params","inputs":[{"name":"_user","type":"address"}],"outputs":[{"name":"","type":"address"},{"name":"","type":"uint256[20]"},{"name":"","type":"uint256"}],"gas":21089},{"stateMutability":"view","type":"function","name":"get_last_block_number_sent","inputs":[{"name":"_chain_id","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":2747}]

61076556600436101561000d57610756565b60046000601c376000513461075c5763c899fe32811861021e57600060243560a05260805260406080205460e0524361040080821061075c5780820390509050600060243560a052608052604060802054101561075c5760284360043580821061075c5780820390509050111561075c576101004360043580821061075c5780820390509050101561075c576004356101004303811261075c574381101561075c5740610100526000610100511461075c57600063087ca57f61012052602435610140526020610120602461013c73abc000d88f23bb45525e447528dbf656a9d55bf55afa610101573d600060003e3d6000fd5b601f3d111561075c57610120511461075c57600435600060243560a05260805260406080205563f9754c936101a0526101c0806080308252602082019150808252630fb997cc61012452600460043561014452610100516101645260400161012052610120818401808280516020018083828460045afa905050508051806020830101818260206001820306601f8201039050033682375050805160200160206001820306601f8201039050905090509050810190506020820191506000825260208201915060243582525050507337414a8662bc1d25be3ee51fb27c2686e2490a893b1561075c57600060006101046101bc60007337414a8662bc1d25be3ee51fb27c2686e2490a895af161021c573d600060003e3d6000fd5b005b633c90ebc78118610259574361010080821061075c578082039050905060e05243602880821061075c578082039050905061010052604060e0f35b6380dc72db8118610718576004358060a01c61075c5760e052610280366101003760036101005263900cf0cf6103a05260206103a060046103bc735f3b5dfeb7b28cdbd7faba78963ee202a494e2a25afa6102b9573d600060003e3d6000fd5b601f3d111561075c576103a0516103805260046104e05260206104c0526104c080516020820120905061038051818183011061075c5780820190509050610520526020610500526105008051602082012090506103a0526103c060006004818352015b6103a0516103c051818183011061075c578082019050905061010060016103c051818183011061075c5780820190509050601481101561075c576020020152815160010180835281141561031c57505060066104405260e051610460526040610420526104208051602082012090506101a05263010ae7576103e05260e0516104005260206103e060246103fc735f3b5dfeb7b28cdbd7faba78963ee202a494e2a25afa6103cf573d600060003e3d6000fd5b601f3d111561075c576103e0516103c05260056107c05260e0516107e05260406107a0526107a0805160208201209050610820526020610800526108008051602082012090506103c051818183011061075c5780820190509050610860526020610840526108408051602082012090506103e05261040060006004818352015b6103e05161040051818183011061075c5780820190509050610100600661040051818183011061075c5780820190509050601481101561075c576020020152815160010180835281141561044f57505060026105a05260e0516105c0526040610580526105808051602082012090506106005260206105e0526105e0805160208201209050610400526104005161024052610400516001818183011061075c57808201905090506102605263d1febfb96104a052610380516104c05260806104a060246104bc735f3b5dfeb7b28cdbd7faba78963ee202a494e2a25afa61053b573d600060003e3d6000fd5b607f3d111561075c576104a080518060801d81607f1d1861075c576104205260208101518060801d81607f1d1861075c5761044052604081015161046052606081015161048052506104605162093a808082049050905062093a8080820282158284830414171561075c579050905062093a80818183011061075c57808201905090506104a0526104c060006008818352015b6007610560526104a05162093a806104c05180820282158284830414171561075c5790509050818183011061075c578082019050905061058052604061054052610540805160208201209050610100600c6104c051818183011061075c5780820190509050601481101561075c57602002015281516001018083528114156105ce575050735f3b5dfeb7b28cdbd7faba78963ee202a494e2a26104c052610100516104e05261012051610500526101405161052052610160516105405261018051610560526101a051610580526101c0516105a0526101e0516105c052610200516105e05261022051610600526102405161062052610260516106405261028051610660526102a051610680526102c0516106a0526102e0516106c052610300516106e05261032051610700526103405161072052610360516107405243610760526102c06104c0f35b6314d891f0811861075457600060043560a05260805260406080205460e05260e0516107465762da582660e0525b60e051610100526020610100f35b505b60006000fd5b600080fd5b61000461076503610004600039610004610765036000f3

Deployed Bytecode

0x600436101561000d57610756565b60046000601c376000513461075c5763c899fe32811861021e57600060243560a05260805260406080205460e0524361040080821061075c5780820390509050600060243560a052608052604060802054101561075c5760284360043580821061075c5780820390509050111561075c576101004360043580821061075c5780820390509050101561075c576004356101004303811261075c574381101561075c5740610100526000610100511461075c57600063087ca57f61012052602435610140526020610120602461013c73abc000d88f23bb45525e447528dbf656a9d55bf55afa610101573d600060003e3d6000fd5b601f3d111561075c57610120511461075c57600435600060243560a05260805260406080205563f9754c936101a0526101c0806080308252602082019150808252630fb997cc61012452600460043561014452610100516101645260400161012052610120818401808280516020018083828460045afa905050508051806020830101818260206001820306601f8201039050033682375050805160200160206001820306601f8201039050905090509050810190506020820191506000825260208201915060243582525050507337414a8662bc1d25be3ee51fb27c2686e2490a893b1561075c57600060006101046101bc60007337414a8662bc1d25be3ee51fb27c2686e2490a895af161021c573d600060003e3d6000fd5b005b633c90ebc78118610259574361010080821061075c578082039050905060e05243602880821061075c578082039050905061010052604060e0f35b6380dc72db8118610718576004358060a01c61075c5760e052610280366101003760036101005263900cf0cf6103a05260206103a060046103bc735f3b5dfeb7b28cdbd7faba78963ee202a494e2a25afa6102b9573d600060003e3d6000fd5b601f3d111561075c576103a0516103805260046104e05260206104c0526104c080516020820120905061038051818183011061075c5780820190509050610520526020610500526105008051602082012090506103a0526103c060006004818352015b6103a0516103c051818183011061075c578082019050905061010060016103c051818183011061075c5780820190509050601481101561075c576020020152815160010180835281141561031c57505060066104405260e051610460526040610420526104208051602082012090506101a05263010ae7576103e05260e0516104005260206103e060246103fc735f3b5dfeb7b28cdbd7faba78963ee202a494e2a25afa6103cf573d600060003e3d6000fd5b601f3d111561075c576103e0516103c05260056107c05260e0516107e05260406107a0526107a0805160208201209050610820526020610800526108008051602082012090506103c051818183011061075c5780820190509050610860526020610840526108408051602082012090506103e05261040060006004818352015b6103e05161040051818183011061075c5780820190509050610100600661040051818183011061075c5780820190509050601481101561075c576020020152815160010180835281141561044f57505060026105a05260e0516105c0526040610580526105808051602082012090506106005260206105e0526105e0805160208201209050610400526104005161024052610400516001818183011061075c57808201905090506102605263d1febfb96104a052610380516104c05260806104a060246104bc735f3b5dfeb7b28cdbd7faba78963ee202a494e2a25afa61053b573d600060003e3d6000fd5b607f3d111561075c576104a080518060801d81607f1d1861075c576104205260208101518060801d81607f1d1861075c5761044052604081015161046052606081015161048052506104605162093a808082049050905062093a8080820282158284830414171561075c579050905062093a80818183011061075c57808201905090506104a0526104c060006008818352015b6007610560526104a05162093a806104c05180820282158284830414171561075c5790509050818183011061075c578082019050905061058052604061054052610540805160208201209050610100600c6104c051818183011061075c5780820190509050601481101561075c57602002015281516001018083528114156105ce575050735f3b5dfeb7b28cdbd7faba78963ee202a494e2a26104c052610100516104e05261012051610500526101405161052052610160516105405261018051610560526101a051610580526101c0516105a0526101e0516105c052610200516105e05261022051610600526102405161062052610260516106405261028051610660526102a051610680526102c0516106a0526102e0516106c052610300516106e05261032051610700526103405161072052610360516107405243610760526102c06104c0f35b6314d891f0811861075457600060043560a05260805260406080205460e05260e0516107465762da582660e0525b60e051610100526020610100f35b505b60006000fd5b600080fd

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
Loading...
Loading
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.