Skip to content

Uniswap/blocknumberish

Repository files navigation

BlockNumberish

A simple utility contract to get the current block number on different chains. Includes support for fetching Flashblock numbers on Unichain

Gas breakdown

Operation Gas Used
block.number 7
getBlockNumberish (other chains) 68
getBlockNumberish (arbitrum) 5154
getFlashblockNumberish (other chains) 60
getFlashblockNumberish (unichain) 5165
bytecode size 47

Installation

Add BlockNumberish to your foundry repo:

forge install https://github.com/Uniswap/blocknumberish

Table of Contents

Setup

Follow these steps to set up your local environment:

  • Install foundry
  • Install dependencies: forge install
  • Build contracts: forge build
  • Test contracts: forge test

If you intend to develop on this repo, follow the steps outlined in CONTRIBUTING.md.

Deployment

This repo utilizes versioned deployments. For more information on how to use forge scripts within the repo, check here.

Smart contracts are deployed or upgraded using the following command:

forge script script/Deploy.s.sol --broadcast --rpc-url <rpc_url> --verify

Docs

The documentation and architecture diagrams for the contracts within this repo can be found here. Detailed documentation generated from the NatSpec documentation of the contracts can be found here. When exploring the contracts within this repository, it is recommended to start with the interfaces first and then move on to the implementation as outlined here

Contributing

If you want to contribute to this project, please check CONTRIBUTING.md first.

License

MIT

About

Utility contract for getting the current block number on different chains

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published