Add MIP-21: Large Contract Deployment Opcode and MRC-22: Large Contract Deployment Factory
Summary
- MIP-21 adds
CREATEBIG(0xAE 0x02, under the MIP-7EXTENSIONmechanism), which deploys contracts of up to 256KiB. It behaves asCREATE2withvalueas the endowment, plus amax_depositargument: 80 gas/byte of the code deposit is charged as gas, and the remaining 120 × base fee per byte is charged in MON from the executing account's balance, capped bymax_deposit, and burned. Execution of large contracts relies on MIP-20's linear code-loading costs. - MRC-22 specifies a deterministic Yul factory (
ICreateBigFactory.deploy) through which EOAs and contracts can useCREATEBIGwithout compiler support. Direct calls bind the salt to the caller and fund the deposit frommsg.valuewith a refund; delegated calls give contracts exactly theCREATE2-from-self semantics. The factory is deployed by a keyless (Nick's method) transaction to0x53F970b36ec7C8Ade2954aCD7a16B2e5ba438dE4. assets/MRC-22contains the Yul source and a script that reproduces the deployment transaction, sender and factory address from the compiled creation bytecode.
Discussion:
- MIP-21: https://forum.monad.xyz/t/mip-21-large-contract-deployment-opcode/594
- MRC-22: https://forum.monad.xyz/t/mrc-22-large-contract-deployment-factory/595
Verification
scripts/lint_mips.py MIPs/MIP-21.md MRCs/MRC-22.md: 0 errors, 0 warnings.- Factory compiled with
solc 0.8.38+commit.1835d247 --strict-assembly --optimize --evm-version osaka(233-byte creation code, keccak0x446b5066…99995420). - The keyless deployment transaction was submitted to a local Osaka
anvilchain: the sender, factory address and runtime code hash match the values in MRC-22, and malformedinitcodelengths revert cleanly.CREATEBIGitself has no implementation yet, so the deploy path is untested. - MIP-21 Test Cases and Reference Implementation remain TODO.
🤖 Generated with Claude Code