I have a smart contract compiled resulting in a 10,961 Bytes wasm file and a 2,372 Bytes abi file. However, when deploying the contract on chain it consumes about 110,000 Bytes which is almost 10x the wasm+abi file.

Why is the on chain RAM consumption so much higher than what the binary files consume on my hard drive?

How can I estimate/calculate the on chain RAM usage of a compiled smart contract before deploying it?


Deploying contract is done by two actions, eosio::setcode for wasm, and eosio::setabi for abi. setcode costs 10x the size of wasm file, but setabi costs the exact size of abi file.

  • But why does setcode consume 10 times of the size of the wasm file? Doesn't a normal c/c++ library/executable only consume as much RAM as their filesize? Why is that different for wasm/eosio? Thanks for the info so far. – mschoenebeck Apr 24 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.