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

Support foreign objects as ABI arguments

jasonpaulos opened this issue · comments

Summary

This is a follow up to #258, which added support for invoking ABI methods.

In addition to standard ABI type arguments, the SDK should support the special foreign object argument types account, asset, and application, as described in ARC-4.

Scope

Extend the AtomicTransactionComposer.AddMethodCall function to support these new method argument types. At a high level it should:

  1. Recognize when an argument is a special type or a standard ABI type. The special argument types are only valid as top-level arguments, so direct string comparison should be sufficient.
  2. If a special type is present, insert the argument value into the appropriate foreign array, and use the array index of the value as the app call argument, treated as an ABI uint8.