Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ABI Calls support to ARC-0026 #310

Closed
wants to merge 9 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 41 additions & 4 deletions ARCs/arc-0026.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,34 @@ Elements of the query component may contain characters outside the valid range.
algorandurn = "algorand://" algorandaddress [ "?" algorandparams ]
algorandaddress = *base32
algorandparams = algorandparam [ "&" algorandparams ]
algorandparam = [ amountparam / labelparam / noteparam / assetparam / otherparam ]
algorandparam = [ amountparam / labelparam / noteparam / assetparam / appparam / methodparam / argparam / boxparam / assetarrayparam / accountarrayparam / apparrayparam / otherparam ]
amountparam = "amount=" *digit
labelparam = "label=" *qchar
assetparam = "asset=" *digit
appparam = "app=" *digit
noteparam = (xnote | note)
xnote = "xnote=" *qchar
note = "note=" *qchar
note = "note=" *qchar
methodparam = "method=" *qchar
boxparam = "box=" *qchar
argparam = "arg=" (*qchar | *digit)
feeparam = "fee=" *digit
accountarrayparam = "account=" *qchar
assetarrayparam = "asset=" *digit
apparrayparam = "app=" *digit
otherparam = qchar *qchar [ "=" *qchar ]
```

Here, "qchar" corresponds to valid characters of an RFC 3986 URI query component, excluding the "=" and "&" characters, which this specification takes as separators.

The scheme component ("algorand:") is case-insensitive, and implementations must accept any combination of uppercase and lowercase letters. The rest of the URI is case-sensitive, including the query parameter keys.

Note 1: the first `app=` in the presence of the method interprets as the destination app ID and the next ones in sequence would be considered app array members.

Note 2: the `asset=` in the presence of the method interprets as an asset array member.

Note 3: The account address in case of method presence is the Sender account not the destination recipient as it is the case with all Algorand URIs without method.

!!! Caveat
When it comes to generation of an address' QR, many exchanges and wallets encodes the address w/o the scheme component (“algorand:”). This is not a URI so it is OK.

Expand All @@ -56,10 +70,25 @@ The scheme component ("algorand:") is case-insensitive, and implementations must

- amount: microAlgos or smallest unit of asset

- asset: The asset id this request refers to (if Algos, simply omit this parameter)
- asset: The asset id this request refers to (if Algos, simply omit this parameter). When the method is available, the asset is an Asset Array member for the ABI call.

- method: The full ABI method to call. E.g. claim(uint64,uint64)byte[]

- arg: The argument to be added to ABI call arguments array.

- box: The box name reference.

- fee: Optional static transaction fee (in MicroAlgos)

- app: The app id this request refers to. When method is available, first app is the destination app for ABI call and from second index app is an App Array member for ABI call.

- account: The account address to add to accounts array after sender. Only when method is available.

- (others): optional, for future extensions

### Template URI vs actionable URI
If the URI is constructed for templating only so that other dApps, wallets or protocols could user it for any user then the account address in URI must be ZeroAddress ("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ"). Since ZeroAddress cannot initiate any action this assumption is considered non-vulnerable and secure.

### Transfer amount/size

!!! Note
Expand Down Expand Up @@ -99,12 +128,20 @@ Request 150 units of Asset ID 45 from an address
algorand://TMTAD6N22HCS2LKH7677L2KFLT3PAQWY6M4JFQFXQS32ECBFC23F57RYX4?amount=150&asset=45
```

Call claim(uint64,uint64)byte[] method on contract 11111111 paying a fee of 10000 micro ALGO from an address

```
algorand://TMTAD6N22HCS2LKH7677L2KFLT3PAQWY6M4JFQFXQS32ECBFC23F57RYX4?app=11111111&method=claim(uint64,uint64)byte[]&arg=20000&arg=474567&asset=45&fee=10000
```

## Rationale



## Security Considerations

None.

## Copyright

Copyright and related rights waived via <a href="https://creativecommons.org/publicdomain/zero/1.0/">CCO</a>.
Copyright and related rights waived via <a href="https://creativecommons.org/publicdomain/zero/1.0/">CCO</a>.
Loading