Skip to content

Add reorg protection to LilNounsOracle contract #3

@nvonpentz

Description

@nvonpentz

Currently the LilNounsOracle contract ensures the by checking expectedBlockNumber == block.number. But we would have stronger guarantees in the case of a reorg if we checked if against a specific blockhash instead.

This is not easily possible because I believe the usePrepareContractWrite function we use from wagmi uses ethers js to fetch the gas estimate, which only only runs on the 'latest' block https://github.com/orgs/Lil-Nouns-Community-Engineering/projects/1/views/1. We need it to run on pending or else the gas estimate will result in a revert.

Potentially we can drop down to a lower level and use JsonRpcProvider.send directly and provide the correct blockTag there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions