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

Clawback assets

Authorized by: Asset Clawback Address

Revoking an asset for an account removes a specific number of the asset from the revoke target account. Revoking an asset from an account requires specifying an asset sender (the revoke target account) and an asset receiver (the account to transfer the funds back to). The code below illustrates the clawback transaction.

sp = algod_client.suggested_params()
# Create clawback transaction to freeze the asset in acct2 balance
clawback_txn = transaction.AssetTransferTxn(
sender=acct1.address,
sp=sp,
receiver=acct1.address,
amt=1,
index=created_asset,
revocation_target=acct2.address,
)
signed_clawback_txn = clawback_txn.sign(acct1.private_key)
txid = algod_client.send_transaction(signed_clawback_txn)
print(f"Sent clawback transaction with txid: {txid}")
results = transaction.wait_for_confirmation(algod_client, txid, 4)
print(f"Result confirmed in round: {results['confirmed-round']}")

See also