A simple utility contract to get the current block number on different chains. Includes support for fetching Flashblock numbers on Unichain
| Operation | Gas Used |
|---|---|
block.number |
7 |
getBlockNumberish (other chains) |
68 |
getBlockNumberish (arbitrum) |
5154 |
getFlashblockNumberish (other chains) |
60 |
getFlashblockNumberish (unichain) |
5165 |
| bytecode size | 47 |
Add BlockNumberish to your foundry repo:
forge install https://github.com/Uniswap/blocknumberishFollow 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.
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> --verifyThe 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
If you want to contribute to this project, please check CONTRIBUTING.md first.
MIT