ton-society / grants-and-bounties

TON Foundation invites talent to imagine and realize projects that have the potential to integrate with the daily lives of users.
https://ton.org/grants
246 stars 106 forks source link

Article: Direct & indirect approaches to reading contract state variables in Tact Language #564

Closed seriybeliy11 closed 3 weeks ago

seriybeliy11 commented 2 months ago

Summary

This material should be a guide for Tact developers who want to understand and implement methods for reading state variables from other contracts. It should cover the limitations of direct getter calls and explore alternative solutions available when you control both contracts' code.

Context

In the realm of Tact smart contract development, effectively accessing data from other contracts is paramount for building interconnected and data-driven applications. While direct getter calls might seem like an obvious approach, Tact imposes certain limitations on this method. This article delves into the intricacies of reading contract state variables, exploring both direct and indirect approaches, and providing a comprehensive overview of the rationale behind its creation.

Learning goals

Сonsumers will acquire a comprehensive understanding of the different strategies available for reading contract state variables in smart contract development, along with the considerations and trade-offs associated with each approach.

References

The official Tact documentation is a great starting point: https://github.com/tact-lang/tact Our issue: https://github.com/tact-lang/tact-docs/issues/179

Estimate suggested reward

300$

delovoyhomie commented 3 weeks ago

@seriybeliy11, this example is too brief for a full article. Let's agree that when we create a new cookbook for the Tact, you will definitely take on this task.