Are there any size limits for contract size?

Ethereum contract has a size limit of 24 KB.
Are there any size limits for sway contracts?

2 Likes

according to the sway documentation:

There is no practical code size limit to Sway contracts. The physical limit is governed by the VM_MAX_RAM VM parameter, which at the time of writing is 64 MiB.

one thing worth notice, MiB / MB = 1.048576

Also, in specification, CONTRACT_MAX_SIZE is uint64 in bytes, which means it can be considered as infinite in practice: (1.84467441 × 1010 gigabytes)

2 Likes

Practically if you are deploying on beta-2 there is an effective 7mb size limit, but that is flexible as needed, and will revert to the above mentioned limits once you can deploy a contract by sending it to your own node where it can gossip the tx via p2p

6 Likes

for the actual mainnet launch, is this 7mb size limitation going to be removed or not?

Just for clarify, the storage size included in contract size right?

1 Like

For mainnet this doesn’t actually matter, because you can spin up your own node and deploy form that (as it will gossip the tx to other nodes). The 7mb limit is just on Fuel-run nodes, and can be adjusted as needed

1 Like

No it is not, this is just on the tx sent to deploy a contract

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.