ASA Burning App
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
1{2 "name": "ARC54",3 "desc": "Standardized application for burning ASAs",4 "methods": [5 {6 "name": "arc54_optIntoASA",7 "args": [8 {9 "name": "asa",10 "type": "asset",11 "desc": "The asset to which the contract will opt in"12 }13 ],14 "desc": "A method to opt the contract into an ASA",15 "returns": {16 "type": "void",17 "desc": ""18 }19 },20 {21 "name": "createApplication",22 "desc": "",23 "returns": {24 "type": "void",25 "desc": ""26 },27 "args": []28 }29 ]30}
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
1#pragma version 92
3// This TEAL was generated by TEALScript v0.62.24// https://github.com/algorandfoundation/TEALScript5
6// This contract is compliant with and/or implements the following ARCs: [ ARC4 ]7
8// The following ten lines of TEAL handle initial program flow9// This pattern is used to make it easy for anyone to parse the start of the program and determine if a specific action is allowed10// Here, action refers to the OnComplete in combination with whether the app is being created or called11// Every possible action for this contract is represented in the switch statement12// If the action is not implemented in the contract, its respective branch will be "NOT_IMPLEMENTED" which just contains "err"13txn ApplicationID14int 015>16int 617*18txn OnCompletion19+20switch create_NoOp NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED call_NoOp21
22NOT_IMPLEMENTED:23 err24
25// arc54_optIntoASA(asset)void26//27// /*28// Sends an inner transaction to opt the contract account into an ASA.29// The fee for the inner transaction must be covered by the caller.30//31// @param asa The ASA to opt in to32abi_route_arc54_optIntoASA:33 // asa: asset34 txna ApplicationArgs 135 btoi36 txnas Assets37
38 // execute arc54_optIntoASA(asset)void39 callsub arc54_optIntoASA40 int 141 return42
43arc54_optIntoASA:44 proto 1 045
46 // contracts/arc54.algo.ts:1347 // sendAssetTransfer({48 // assetReceiver: globals.currentApplicationAddress,49 // xferAsset: asa,50 // assetAmount: 0,51 // fee: 0,52 // })53 itxn_begin54 int axfer55 itxn_field TypeEnum56
57 // contracts/arc54.algo.ts:1458 // assetReceiver: globals.currentApplicationAddress59 global CurrentApplicationAddress60 itxn_field AssetReceiver61
62 // contracts/arc54.algo.ts:1563 // xferAsset: asa64 frame_dig -1 // asa: asset65 itxn_field XferAsset66
67 // contracts/arc54.algo.ts:1668 // assetAmount: 069 int 070 itxn_field AssetAmount71
72 // contracts/arc54.algo.ts:1773 // fee: 074 int 075 itxn_field Fee76
77 // Submit inner transaction78 itxn_submit79 retsub80
81abi_route_createApplication:82 int 183 return84
85create_NoOp:86 method "createApplication()void"87 txna ApplicationArgs 088 match abi_route_createApplication89 err90
91call_NoOp:92 method "arc54_optIntoASA(asset)void"93 txna ApplicationArgs 094 match abi_route_arc54_optIntoASA95 err
TealScript Source Code
1import { Contract } from '@algorandfoundation/tealscript';2
3// eslint-disable-next-line no-unused-vars4class ARC54 extends Contract {5 /*6 * Sends an inner transaction to opt the contract account into an ASA.7 * The fee for the inner transaction must be covered by the caller.8 *9 * @param asa The ASA to opt in to10 */11 arc54_optIntoASA(asa: Asset): void {12 sendAssetTransfer({13 assetReceiver: globals.currentApplicationAddress,14 xferAsset: asa,15 assetAmount: 0,16 fee: 0,17 });18 }19}
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.