fuzious
fuzious

Reputation: 410

How to read state of a different contract?

How to read state of a different contract? Like let us say I am in Contract A, how to fetch a state of contract B? I need it to read balances from an NEP-141 contract.

Upvotes: 1

Views: 78

Answers (1)

amgando
amgando

Reputation: 1591

you can't directly read the state of a different contract from within your contract.

the best you can do is make a cross contract call to the other contract by calling one of its methods

read more about cross-contract calls here https://github.com/near-examples/cross-contract-calls

Upvotes: 2

Related Questions