https://github.com/hellwolf/eip-canaries
Canaries that detect EIP availability on chain.
https://github.com/hellwolf/eip-canaries
Last synced: 12 days ago
JSON representation
Canaries that detect EIP availability on chain.
- Host: GitHub
- URL: https://github.com/hellwolf/eip-canaries
- Owner: hellwolf
- License: mit
- Created: 2024-07-23T11:19:53.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-08-12T06:42:08.000Z (9 months ago)
- Last Synced: 2025-10-12T08:50:36.437Z (7 months ago)
- Language: Solidity
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## EIP Canaries
This project collects canaries that detect EIP availability on chain. These canaries can be used to detect the evm
version of the chain.
## Usage
The current version is deployed to address 0xC1D917D2E025856AC24ec7c4D325E6990FfC858e on the following networks:
Mainnets:
- [Ethereum](https://etherscan.io/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e#readContract)
- [Gnosis Chain](https://gnosisscan.io/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e#readContract)
- [Polygon Pos](https://polygonscan.com/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e#readContract)
- [Optimism](https://optimistic.etherscan.io/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e#readContract)
- [Arbitrum One](https://arbiscan.io/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e#readContract)
- [Avalanche C-chain](https://snowtrace.io/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e#readContract)
- [BNB Smart Chain](https://bscscan.com/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e#readContract)
- [Celo](https://explorer.celo.org/mainnet/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e/read-contract)
- [Base](https://basescan.org/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e#readContract)
- [Scroll](https://scrollscan.com/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e#readContract)
- [Degen Chain](https://explorer.degen.tips/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e?tab=read_contract)
Testnets:
- [Ethereum Sepolia](https://sepolia.etherscan.io/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e#readContract)
- [Optimism Sepolia](https://sepolia-optimism.etherscan.io/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e#readContract)
- [Scroll Sepolia](https://sepolia.scrollscan.com/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e#readContract)
- [Avalanche Fuji](https://testnet.snowtrace.io/address/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e#readContract)
It is verified [on sourcify](https://sourcify.dev/#/lookup/0xC1D917D2E025856AC24ec7c4D325E6990FfC858e) and on some explorers.
In order to query the contract, any tooling able to make a contract call can be used, including explorer UIs where verified.
Example for querying with [cast](https://book.getfoundry.sh/reference/cast/cast-call):
```
$ cast call --rpc-url https://rpc.sepolia.org 0xC1D917D2E025856AC24ec7c4D325E6990FfC858e 'hasEIP5656()'
0x0000000000000000000000000000000000000000000000000000000000000001
```
## Deployment
In order to deploy to additional chains, first install dependencies and compile the contract:
```
forge install
forge compile
```
There's 2 possibilities for deploying:
**Recommended: Deterministic Address**
The recommended way of deploying is by using the [deterministic deployment proxy](https://github.com/Zoltu/deterministic-deployment-proxy) which is available on many EVM chains at address 0x7A0D94F55792C434d74a40883C6ed8545E406D12. By using CREATE2, it allows the contract to be deployed to an address deterministically derived from the bytecode.
Command used for deployment:
```
cast send --account --rpc-url 0x7A0D94F55792C434d74a40883C6ed8545E406D12 $(jq -r '.bytecode.object' out/EIPCanaries.sol/EIPCanaries.json)
```
If the contract was already deployed to the connected chain, this command will revert.
**Fallback: Conventional**
If the recommended way of deploying isn't available on a chain, the contract can still be deployed in the _conventional_ way, with the drawback of yielding a different address:
```
forge create --account --rpc-url src/EIPCanaries.sol:EIPCanaries
```
**Verification**
On sourcify:
```
forge verify-contract --rpc-url --verifier sourcify --watch src/EIPCanaries.sol:EIPCanaries
```
On Etherscan-based explorers:
```
forge verify-contract --rpc-url --verifier etherscan --etherscan-api-key --watch src/EIPCanaries.sol:EIPCanaries
```
## Development
**Add A New Canary**
- Create a new yul object under `yul/` folder.
- Compile the yul object `solc --evm-version=london --strict-assembly --bin`. Note: use london as target.
- Create a new deployer and detection function in the `EIPCanaries` contract.
- Create a new test case in `EIPCanaries.t.sol`, and modify `test.sh`.
- Deploy the EIPCanaries and publish.
**Local Test**
```
$ ./test.sh
```
This will run EIPCanaries.t.sol for different evm versions (paris, shanghai, cancun) using foundry.
## TODO
- publish to the world as a public goods.