Contracts up to 256 KiB
0xAE 0x02 CREATEBIG
CREATE2 with one more argument: the most the deposit may cost in MON.
80 gas + MON
Per byte of code. The other 120 gas' worth is paid in MON at the base fee and burned.
256 KiB
Maximum code size, up from 128 KiB. Initcode can be up to 360 KiB.
MIP-21 is a Draft and is not active on any network. Today the 200 gas per byte code deposit has to fit inside one 30M gas transaction. CREATEBIG pays part of it in MON instead.
The information on this page should not be quoted. Please refer to MIP-21 for the authoritative spec.
Split the deposit
Pick a code size and a base fee. CREATE2 charges the whole deposit as gas. CREATEBIG charges 80 gas per byte and the rest in MON.
CREATE2
Deposit gas
52,428,800
Over the 128 KiB limit for CREATE2. Above 150,000 bytes the deposit alone would pass the 30M transaction gas limit.
CREATEBIG
Deposit gas
20,971,520
80 gas per byte, taken from the constructor frame's gas.
Deposit in MON
3.1457 MON
120 × code size × base fee, burned. Capped by max_deposit_value.
These figures leave out the 32,000 base cost, initcode hashing and calldata. For a 256 KiB contract sent through a minimal factory, the spec works out about 4.28M gas left for the constructor.
What CREATEBIG does
It behaves like CREATE2 except for how the deposit is paid.
1. Balance check
The deployer's balance must cover value + max_deposit_value. If it doesn't, CREATEBIG pushes 0 without running the constructor.
2. Escrow
max_deposit_value is deducted before the constructor runs and held by the CREATEBIG frame. The constructor can't spend it.
3. Gas part
When the constructor returns code, 80 gas per byte is charged from the constructor frame's gas.
4. MON part
deposit = 120 × code size × block.basefee. If that is more than max_deposit_value, the deployment fails.
5. Settle
On success the deposit is burned and the rest of the escrow goes back to the deployer. On any failure the whole escrow goes back.
Address derivation, nonce, depth limit and static-context rules are those of CREATE2.
Why 80 gas and not 0
MON paid as value doesn't count toward block gas, so neither the block gas limit nor the base fee reacts to it.
Today: 200 gas per byte
A 150M gas block can write about 750 KB of code.
MIP-21: 80 gas per byte
About 1.87 MB per block, 2.5 times today.
All in MON: 0 gas per byte
About 1.01 GiB in one block, 1,450 times today. The spec rejects this design.
Price per byte
Unchanged. 200 gas at the base fee, whether it is paid as gas or as MON.
Figures from the spec, at a 150M block gas limit.
Who this affects
Contract developers
One contract where three were needed
Proxy and library splits, the Diamond pattern and SSTORE2-style data contracts are ways to get under the size limit. Up to 256 KiB they would no longer be needed for that.
Solidity users
Compilers can't emit it yet
The two routes are Yul's verbatim_5i_1o or the factory contract specified in MRC-22.
Tooling
Simulate with a real base fee
eth_call and eth_estimateGas often run with a base fee of zero, where CREATEBIG charges no deposit. Tracers and indexers also need a frame type for CREATEBIG.
MIP-21 requires MIP-7 and MIP-20, and MIP-20's constants are not set. Test cases and the reference implementation are marked TODO. Contracts above 256 KiB are out of scope; the spec expects them to need multi-part uploads.
Continue the discussion on Monad Forum
Questions, feedback, or a better idea? Weigh in on the forum thread.
Open forum thread