Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zeroekkusu/max-code-size-tester
Test `MAX_CODE_SIZE` of your EVM.
https://github.com/zeroekkusu/max-code-size-tester
eip evm
Last synced: about 2 months ago
JSON representation
Test `MAX_CODE_SIZE` of your EVM.
- Host: GitHub
- URL: https://github.com/zeroekkusu/max-code-size-tester
- Owner: ZeroEkkusu
- License: apache-2.0
- Created: 2024-08-22T15:23:43.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-08-23T11:52:08.000Z (4 months ago)
- Last Synced: 2024-08-23T13:02:02.967Z (4 months ago)
- Topics: eip, evm
- Language: Solidity
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
## Max Code Size Tester
**Test `MAX_CODE_SIZE` of your EVM.**
[`MAX_CODE_SIZE`](https://eips.ethereum.org/EIPS/eip-170) refers to the maximum length of a smart contract's runtime bytecode.
Runtime bytecode is different from creation bytecode. For example, the Solidity compiler generates creation bytecode (binary) from source code (Solidity). When this creation bytecode is deployed onchain, it gets executed, and returns runtime bytecode, which is set as the code of the smart contract.
## Usage
> [!CAUTION]
> This program deploys a smart contract onchain to verify `MAX_CODE_SIZE`. If run in a production environment, it will incur real transaction costs. Use only in test networks unless you fully understand the implications.I have read and understood the above warning. Show me the usage instructions.
**Prerequisites**
```shell
curl -L https://foundry.paradigm.xyz | bash
```**Get**
```shell
git clone [email protected]:ZeroEkkusu/max-code-size-tester.git
cd max-code-size-tester
forge install
```**Run**
```shell
forge script MaxCodeSizeTester \
--rpc-url \
--broadcast \
--private-key \
--sig "run(uint256)" \
```It is recommended to test `code_size` of
- $max - 1$
- $max$
- $max + 1$where $max$ is the `MAX_CODE_SIZE` of the EVM in bytes.
Only $max + 1$ should fail.
## License
Licensed under either of- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
---
© 2024 Zero Ekkusu