algorand / go-algorand-sdk

Algorand Golang SDK

Home Page:https://pkg.go.dev/github.com/algorand/go-algorand-sdk/v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add fields Accounts, Assets, and Applications to future.AddMethodCallParams

shaih opened this issue · comments

Problem

If we want to use AtomicTransactionComposer to add a method call with non-empty arrays for Accounts, Assets, or Applications, is to have them as reference types (as per ARC4). This puts an extra burden on the smart contract that needs to handle the indirection implied by these reference types.

Solution

Instead it would be good if the SDK allows us to put things directly in these arrays without having to include them as method arguments, all while still using the capabilities of AtomicTransactionComposer to encode other arguments and build transaction groups. It can be done by adding optional Accounts, ForeignAssets, and ForeignApps fields to the future.AddMethodCallParams struct, and using them when building the transaction.

(This is possible in the Python SDK for example, using the accounts, foreign_apps, and foreign_assets optional arguments to the add_method_call method.)

To make things simple, this feature can be made mutually exclusive with the reference types: a call to composer.AddMethodCall(params) would fail if the params include both a non-empty Applications field and an application reference argument, etc.

closed w/ #318