ARC-54: ASA Burning App
Standardized Application for Burning ASAs
Author | Joe Polny, Brian Whippo |
---|---|
Discussions-To | https://github.com/algorandfoundation/ARCs/issues/245 |
Status | Final |
Type | Standards Track |
Category | ARC |
Created | 2023-09-15 |
Table of Contents
Abstract
This ARC provides TEAL which would deploy a application that can be used for burning Algorand Standard Assets. The goal is to have the apps deployed on the public networks using this TEAL to provide a standardized burn address and app ID.
Motivation
Currently there is no official way to burn ASAs. While one can currently deploy their own app or rekey an account holding the asset to some other address, having a standardized address for burned assets enables explorers and dapps to easily calculate and display burnt supply for any ASA burned here.
Definitions Related to Token Supply & Burning
It is important to note that assets with clawback enabled are effectively impossible to “burn” and could at any point be clawed back from any account or contract. The definitions below attempt to clarify some terminology around tokens and what can be considered burned.
Token Type | Clawback | No Clawback |
---|---|---|
Total Supply | Total | Total |
Circulating Supply | Total - Qty in Reserve Address - Qty in burn address | Total - Qty in Reserve Address - Qty in burn address |
Available Supply | Total | Total - Qty in burn address |
Burned Supply | N/A (Impossible to burn) | Qty in burn address |
Specification
ARC-4
JSON Description
{
"name": "ARC54",
"desc": "Standardized application for burning ASAs",
"methods": [
{
"name": "arc54_optIntoASA",
"args": [
{
"name": "asa",
"type": "asset",
"desc": "The asset to which the contract will opt in"
}
],
"desc": "A method to opt the contract into an ASA",
"returns": {
"type": "void",
"desc": ""
}
},
{
"name": "createApplication",
"desc": "",
"returns": {
"type": "void",
"desc": ""
},
"args": []
}
]
}
Rationale
This simple application is only able to opt in to ASAs but not send them. As such, once an ASA has been sent to the app address it is effectively burnt.
If the burned ASA does not have clawback enabled, it will remain permanently in this account and can be considered out of circulation.
The app will accept ASAs which have clawback enabled, but any such assets can never be considered permanently burned. Users may use the burning app as a convenient receptable to remove ASAs from their account rather than returning them to the creator account.
The app will, of course, only be able to opt into a new ASA if it has sufficient Algo balance to cover the increase minimum balance requirement (MBR). Callers should fund the contract account as needed to cover the opt-in requests. It is possible for the contract to be funded by donated Algo so that subsequent callers need not pay the MBR requirement to request new ASA opt-ins.
Reference Implementation
TEAL Approval Program
#pragma version 9
// This TEAL was generated by TEALScript v0.62.2
// https://github.com/algorandfoundation/TEALScript
// This contract is compliant with and/or implements the following ARCs: [ ARC4 ]
// The following ten lines of TEAL handle initial program flow
// This pattern is used to make it easy for anyone to parse the start of the program and determine if a specific action is allowed
// Here, action refers to the OnComplete in combination with whether the app is being created or called
// Every possible action for this contract is represented in the switch statement
// If the action is not implemented in the contract, its respective branch will be "NOT_IMPLEMENTED" which just contains "err"
txn ApplicationID
int 0
>
int 6
*
txn OnCompletion
+
switch create_NoOp NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED call_NoOp
NOT_IMPLEMENTED:
err
// arc54_optIntoASA(asset)void
//
// /*
// Sends an inner transaction to opt the contract account into an ASA.
// The fee for the inner transaction must be covered by the caller.
//
// @param asa The ASA to opt in to
abi_route_arc54_optIntoASA:
// asa: asset
txna ApplicationArgs 1
btoi
txnas Assets
// execute arc54_optIntoASA(asset)void
callsub arc54_optIntoASA
int 1
return
arc54_optIntoASA:
proto 1 0
// contracts/arc54.algo.ts:13
// sendAssetTransfer({
// assetReceiver: globals.currentApplicationAddress,
// xferAsset: asa,
// assetAmount: 0,
// fee: 0,
// })
itxn_begin
int axfer
itxn_field TypeEnum
// contracts/arc54.algo.ts:14
// assetReceiver: globals.currentApplicationAddress
global CurrentApplicationAddress
itxn_field AssetReceiver
// contracts/arc54.algo.ts:15
// xferAsset: asa
frame_dig -1 // asa: asset
itxn_field XferAsset
// contracts/arc54.algo.ts:16
// assetAmount: 0
int 0
itxn_field AssetAmount
// contracts/arc54.algo.ts:17
// fee: 0
int 0
itxn_field Fee
// Submit inner transaction
itxn_submit
retsub
abi_route_createApplication:
int 1
return
create_NoOp:
method "createApplication()void"
txna ApplicationArgs 0
match abi_route_createApplication
err
call_NoOp:
method "arc54_optIntoASA(asset)void"
txna ApplicationArgs 0
match abi_route_arc54_optIntoASA
err
TealScript Source Code
import { Contract } from '@algorandfoundation/tealscript';
// eslint-disable-next-line no-unused-vars
class ARC54 extends Contract {
/*
* Sends an inner transaction to opt the contract account into an ASA.
* The fee for the inner transaction must be covered by the caller.
*
* @param asa The ASA to opt in to
*/
arc54_optIntoASA(asa: Asset): void {
sendAssetTransfer({
assetReceiver: globals.currentApplicationAddress,
xferAsset: asa,
assetAmount: 0,
fee: 0,
});
}
}
Deployments
An application per the above reference implementation has been deployed to each of Algorand’s networks at these app IDs:
Network | App ID | Address |
---|---|---|
MainNet | 1257620981 | BNFIREKGRXEHCFOEQLTX3PU5SUCMRKDU7WHNBGZA4SXPW42OAHZBP7BPHY |
TestNet | 497806551 | 3TKF2GMZJ5VZ4BQVQGC72BJ63WFN4QBPU2EUD4NQYHFLC3NE5D7GXHXYOQ |
BetaNet | 2019020358 | XRXCALSRDVUY2OQXWDYCRMHPCF346WKIV5JPAHXQ4MZADSROJGDIHZP7AI |
Security Considerations
It should be noted that once an asset is sent to the contract there will be no way to recover the asset unless it has clawback enabled.
Due to the simplicity of a TEAL, an audit is not needed. The contract has no code paths which can send tokens, thus there is no concern of an exploit that undoes burning of ASAs without clawback.
Copyright
Copyright and related rights waived via CCO.
Citation
Please cite this document as:
Joe Polny, Brian Whippo, "ARC-54: ASA Burning App," Algorand Requests for Comments, no. 54, September 2023. [Online serial]. Available: https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0054.md.