algorand / algorand/go-algorand

Contract-to-Contract View Function (TBD)

Ouverte
#4,416 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Team Scytale
Langage dominant
Go
Étoiles
1.4k
Forks
537
Merge moyen
1 j 6 h
PR mergées (30 j)
17

Description

## Problem

On-chain applications store information in their global state. Every application has access to read every other application's global state. However, an application A does not know how to decode application B's global state, unless the developer has explicitly read application B to understand the encoding and wrote the corresponding decoding into application A.

App B can offer an ABI method to read values from its global state. App A can call this method to get the values it needs from App B, and this way App A does not worry about App B's encodings. However, this requires paying a transaction fee, unlike reading the global state directly.

An easy example where this would be useful: I want to know an AMM's exchange rate (or multiple AMM's rates) before calling it. Currently, AMM devs expend significant effort explaining their specific encodings so that others can read their state on-chain without calling them.

## Solution

TBD.

Ideally, App A could get values from App B's global state (or local state, analogously, as long as it has access to the related accounts as well) without paying a full transaction fee, and without needing to decode the state itself.

Note that for an off-chain view function, the "simulate" endpoint can be used that is being developed in #3953 without paying a transaction fee.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.