4

Just to clarify, I am not asking about the max upload size of a contract. I am able to upload my contract to my chain no problem.

I have two smart contracts (A,B) A calls a transaction on smart contract B when smart contract A is deployed. This was working absolutely fine, I made sure that the contracts were funded, so it is not the case the the contract ended up in tombstone state. Then out of nowhere i got an error when deploying Contract A, I got a ContractTrapped Error.

I investigated more deeply and it was not an error with Contract A. I was able to deduce this from the fact that when contract A called a copy of B, it worked fine.

Looked deeper into this and it turns out I could not make any transactions on Contract B at all, but could still query the data stored in it.

So i looked into the contract StorageDeposit over time

  const r = range(573000, 574000, 1);
  r.map(async (block) => {
    const hash = await api.rpc.chain.getBlockHash(block);
    const apiAt = await api.at(hash);
    const contract = await apiAt.query.contracts.contractInfoOf(
      "5CAwMPDocR23HDDsLC2RqR4CFFZkgvjR7PsPtrKyK1qhdkNv"
    );
    const timestamp = await apiAt.query.timestamp.now();
    console.log(
      `StorageDeposit at block ${block} is ${
        contract.toJSON()?.storageDeposit
      } and timestamp is ${new Date(timestamp.toNumber())}`
    );
  });

And I found this was the issue

  • StorageDeposit at block 573007 is 1382380000000 and timestamp is Mon Jan 02 2023 13:03:00 GMT+0100 (Central European Standard Time)
  • StorageDeposit at block 573008 is 1382580000000 and timestamp is Mon Jan 02 2023 13:03:06 GMT+0100 (Central European Standard Time)

The contract StorageDeposit maxed out at 1382580000000, which also explains why i can read the state of the smartcontract, but not add more.

So ultimately my question is, where on the contracts pallet configuration can i increase this?

1 Answer 1

2

You can specify the storage_deposit_limit as part of your message/instantiation call in cargo-contract

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.