Skip to content
This new developer portal is under construction. For complete documentation, please refer to the old developer portal.

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.

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 TypeClawbackNo Clawback
Total SupplyTotalTotal
Circulating SupplyTotal - Qty in Reserve Address - Qty in burn addressTotal - Qty in Reserve Address - Qty in burn address
Available SupplyTotalTotal - Qty in burn address
Burned SupplyN/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 9
2
3
// This TEAL was generated by TEALScript v0.62.2
4
// https://github.com/algorandfoundation/TEALScript
5
6
// This contract is compliant with and/or implements the following ARCs: [ ARC4 ]
7
8
// The following ten lines of TEAL handle initial program flow
9
// 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
10
// Here, action refers to the OnComplete in combination with whether the app is being created or called
11
// Every possible action for this contract is represented in the switch statement
12
// If the action is not implemented in the contract, its respective branch will be "NOT_IMPLEMENTED" which just contains "err"
13
txn ApplicationID
14
int 0
15
>
16
int 6
17
*
18
txn OnCompletion
19
+
20
switch create_NoOp NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED call_NoOp
21
22
NOT_IMPLEMENTED:
23
err
24
25
// arc54_optIntoASA(asset)void
26
//
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 to
32
abi_route_arc54_optIntoASA:
33
// asa: asset
34
txna ApplicationArgs 1
35
btoi
36
txnas Assets
37
38
// execute arc54_optIntoASA(asset)void
39
callsub arc54_optIntoASA
40
int 1
41
return
42
43
arc54_optIntoASA:
44
proto 1 0
45
46
// contracts/arc54.algo.ts:13
47
// sendAssetTransfer({
48
// assetReceiver: globals.currentApplicationAddress,
49
// xferAsset: asa,
50
// assetAmount: 0,
51
// fee: 0,
52
// })
53
itxn_begin
54
int axfer
55
itxn_field TypeEnum
56
57
// contracts/arc54.algo.ts:14
58
// assetReceiver: globals.currentApplicationAddress
59
global CurrentApplicationAddress
60
itxn_field AssetReceiver
61
62
// contracts/arc54.algo.ts:15
63
// xferAsset: asa
64
frame_dig -1 // asa: asset
65
itxn_field XferAsset
66
67
// contracts/arc54.algo.ts:16
68
// assetAmount: 0
69
int 0
70
itxn_field AssetAmount
71
72
// contracts/arc54.algo.ts:17
73
// fee: 0
74
int 0
75
itxn_field Fee
76
77
// Submit inner transaction
78
itxn_submit
79
retsub
80
81
abi_route_createApplication:
82
int 1
83
return
84
85
create_NoOp:
86
method "createApplication()void"
87
txna ApplicationArgs 0
88
match abi_route_createApplication
89
err
90
91
call_NoOp:
92
method "arc54_optIntoASA(asset)void"
93
txna ApplicationArgs 0
94
match abi_route_arc54_optIntoASA
95
err

TealScript Source Code

1
import { Contract } from '@algorandfoundation/tealscript';
2
3
// eslint-disable-next-line no-unused-vars
4
class 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 to
10
*/
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:

NetworkApp IDAddress
MainNet1257620981BNFIREKGRXEHCFOEQLTX3PU5SUCMRKDU7WHNBGZA4SXPW42OAHZBP7BPHY
TestNet4978065513TKF2GMZJ5VZ4BQVQGC72BJ63WFN4QBPU2EUD4NQYHFLC3NE5D7GXHXYOQ
BetaNet2019020358XRXCALSRDVUY2OQXWDYCRMHPCF346WKIV5JPAHXQ4MZADSROJGDIHZP7AI

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 and related rights waived via CCO.