1

Imagine if I have an account with contract. Is it allowed for me to look up tables of some another contract from my contract action?

1 Answer 1

2

Yes.

Include the definition of multi_index of the other contract in your source code, and instantiate multi_index with (code, scope). code is the account name of the other contract you want to read. (You may pass _self usually, because you read and write the multi-index table of your contract.)

The multi-index table of other contracts is read-only. You cannot change its value from your contract.

2
  • can it be private for customers? I mean if I do it, will this table be in traces or raw transaction result? Commented Jun 25, 2021 at 13:38
  • 1
    @ВладимирГоворухин No, all data recorded in blockchain are public. (Setting table visibility in C++ contract doesn't hide it) Tables are not in trace or receipt, but in state db which is constructed by accumulating transaction execution results.
    – conr2d
    Commented Jun 26, 2021 at 4:13

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.