Smart ASA reference implementation
Usage:
smart_asa create <creator> <total> [--decimals=<d>] [--default-frozen=<df>]
[--name=<n>] [--unit-name=<un>] [--metadata-hash=<mh>]
[--url=<l>] [--manager=<m>] [--reserve=<r>]
[--freeze=<f>] [--clawback=<c>]
smart_asa config <asset-id> <manager> [--total=<t>] [--decimals=<d>]
[--default-frozen=<df>] [--name=<n>] [--unit-name=<un>]
[--metadata-hash=<mh>] [--url=<u>] [--manager=<m>]
[--reserve=<r>] [--freeze=<f>] [--clawback=<c>]
smart_asa destroy <asset-id> <manager>
smart_asa freeze <asset-id> <freeze> (--asset | <account>) <boolean>
smart_asa optin <asset-id> <account>
smart_asa optout <asset-id> <account> <close-to>
smart_asa send <asset-id> <from> <to> <amount>
[--minter=<i> | --clawback=<c>]
smart_asa info <asset-id> [--account=<a>]
smart_asa get <asset-id> <caller> <getter> [--account=<a>]
smart_asa [--help]
Commands:
create Create a Smart ASA
config Configure a Smart ASA
destroy Destroy a Smart ASA
freeze Freeze whole Smart ASA or specific account
optin Optin Smart ASAs
optout Optout Smart ASAs
send Transfer Smart ASAs
info Look up current parameters for Smart ASA or specific account
get Look up a parameter for Smart ASA
Options:
-h, --help
python3 smart_asa.py create KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ 1 --name Red --unit-name π΄
--- Creating Smart ASA App...
--- Smart ASA App ID: 2988
--- Funding Smart ASA App with 1 ALGO...
--- Creating Smart ASA...
--- Created Smart ASA with ID: 2991
python3 smart_asa.py info 2991
Asset ID: 2991
App ID: 2988
App Address: T6QBA5AXSJMBG55Y2BVDR6MN5KTXHHLU7LWDY3LGZNAPGIKDOWMP4GF5PU
Creator: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Asset name: Red
Unit name: π΄
Maximum issue: 1 π΄
Issued: 0 π΄
Decimals: 0
Global frozen: False
Default frozen: False
Manager address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Reserve address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Freeze address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Clawback address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
python3 smart_asa.py config 2991 KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ --total 100 --decimals 2
--- Configuring Smart ASA 2991...
--- Smart ASA 2991 configured!
python3 smart_asa.py info 2991
Asset ID: 2991
App ID: 2988
App Address: T6QBA5AXSJMBG55Y2BVDR6MN5KTXHHLU7LWDY3LGZNAPGIKDOWMP4GF5PU
Creator: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Asset name: Red
Unit name: π΄
Maximum issue: 100 π΄ <-- π±
Issued: 0 π΄
Decimals: 2 <-- π±
Global frozen: False
Default frozen: False
Manager address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Reserve address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Freeze address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Clawback address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
python3 smart_asa.py optin 2991 KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
--- Opt-in Smart ASA 2991...
--- Smart ASA 2991 state:
{'frozen': 0, 'smart_asa_id': 2991}
python3 smart_asa.py send 2991 T6QBA5AXSJMBG55Y2BVDR6MN5KTXHHLU7LWDY3LGZNAPGIKDOWMP4GF5PU
KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ 100
--reserve KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
--- Minting 100 units of Smart ASA 2991
from T6QBA5AXSJMBG55Y2BVDR6MN5KTXHHLU7LWDY3LGZNAPGIKDOWMP4GF5PU
to KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ...
--- Confirmed!
python3 smart_asa.py info 2991
Asset ID: 2991
App ID: 2988
App Address: T6QBA5AXSJMBG55Y2BVDR6MN5KTXHHLU7LWDY3LGZNAPGIKDOWMP4GF5PU
Creator: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Asset name: Red
Unit name: π΄
Maximum issue: 100 π΄
Issued: 100 π΄ <-- π
Decimals: 2
Global frozen: False
Default frozen: False
Manager address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Reserve address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Freeze address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Clawback address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
python3 smart_asa.py freeze 2991 KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ --asset 1
--- Freezing Smart ASA 2991...
python3 smart_asa.py info 2991
Asset ID: 2991
App ID: 2988
App Address: T6QBA5AXSJMBG55Y2BVDR6MN5KTXHHLU7LWDY3LGZNAPGIKDOWMP4GF5PU
Creator: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Asset name: Red
Unit name: π΄
Maximum issue: 100 π΄
Issued: 100 π΄
Decimals: 2
Global frozen: True <-- π±
Default frozen: False
Manager address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Reserve address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Freeze address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Clawback address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
python3 smart_asa.py config 2991 KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ --name Blue --unit-name π΅
--- Configuring Smart ASA 2991...
--- Smart ASA 2991 configured!
python3 smart_asa.py info 2991
Asset ID: 2991
App ID: 2988
App Address: T6QBA5AXSJMBG55Y2BVDR6MN5KTXHHLU7LWDY3LGZNAPGIKDOWMP4GF5PU
Creator: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Asset name: Blue <-- π±
Unit name: π΅ <-- π±
Maximum issue: 100 π΅
Issued: 100 π΅
Decimals: 2
Global frozen: True
Default frozen: False
Manager address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Reserve address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Freeze address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Clawback address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
python3 smart_asa.py freeze 2991 KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ --asset 0
--- Unfreezing Smart ASA 2991...
python3 smart_asa.py info 2991
Asset ID: 2991
App ID: 2988
App Address: T6QBA5AXSJMBG55Y2BVDR6MN5KTXHHLU7LWDY3LGZNAPGIKDOWMP4GF5PU
Creator: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Asset name: Blue
Unit name: π΅
Maximum issue: 100 π΅
Issued: 100 π΅
Decimals: 2
Global frozen: False <-- π±
Default frozen: False
Manager address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Reserve address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Freeze address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Clawback address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
python3 smart_asa.py send 2991 KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
T6QBA5AXSJMBG55Y2BVDR6MN5KTXHHLU7LWDY3LGZNAPGIKDOWMP4GF5PU 100
--reserve KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
--- Burning 100 units of Smart ASA 2991
from KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
to T6QBA5AXSJMBG55Y2BVDR6MN5KTXHHLU7LWDY3LGZNAPGIKDOWMP4GF5PU...
--- Confirmed!
python3 smart_asa.py info 2991
Asset ID: 2991
App ID: 2988
App Address: T6QBA5AXSJMBG55Y2BVDR6MN5KTXHHLU7LWDY3LGZNAPGIKDOWMP4GF5PU
Creator: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Asset name: Blue
Unit name: π΅
Maximum issue: 100 π΅
Issued: 0 π΅ <-- π
Decimals: 2
Global frozen: False
Default frozen: False
Manager address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Reserve address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Freeze address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
Clawback address: KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
python3 smart_asa.py destroy 2991 KAVHOSWPO3XLBL5Q7FFOTPHAIRAT6DRDXUYGSLQOAEOPRSAXJKKPMHWLLQ
--- Destroying Smart ASA 2991...
--- Smart ASA 2991 destroyed!
{
"name": "asset_app_optin",
"args": [{"type": "asset"}],
"returns": {"type": "void"}
}
{
"name": "asset_app_closeout",
"args": [{"type": "asset"}],
"returns": {"type": "void"}
}
{
"name": "asset_create",
"args": [
{"type": "uint64"},
{"type": "uint32"},
{"type": "bool"},
{"type": "string"},
{"type": "string"},
{"type": "string"},
{"type": "string"},
{"type": "address"},
{"type": "address"},
{"type": "address"},
{"type": "address"}
],
"returns": {"type": "uint64"}
}
{
"name": "asset_config",
"args": [
{"type": "asset"},
{"type": "uint64"},
{"type": "uint32"},
{"type": "bool"},
{"type": "string"},
{"type": "string"},
{"type": "string"},
{"type": "string"},
{"type": "address"},
{"type": "address"},
{"type": "address"},
{"type": "address"}
],
"returns": {"type": "void"}
}
{
"name": "asset_transfer",
"args": [
{"type": "asset"},
{"type": "uint64"},
{"type": "account"},
{"type": "account"}
],
"returns": {"type": "void"}
}
{
"name": "asset_freeze",
"args": [
{"type": "asset"},
{"type": "bool"}
],
"returns": {"type": "void"}
}
{
"name": "account_freeze",
"args": [
{"type": "asset"},
{"type": "account"},
{"type": "bool"}
],
"returns": {"type": "void"}
}
{
"name": "asset_destroy",
"args": [
{"type": "asset"}
],
"returns": {"type": "void"}
}