How many slots does storing a contract take?

Like for example:

contract MyContract {
   MyContract2 x;

   //more code

contract MyContract2 {
   //some code

How many slots does "x" take?

1 Answer 1


The state variable of a contract holds the address of that contract. So from storage perspective it is equivalent to:

contract MyContract {
   address x;

And the address is 20 bytes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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