#pragma version 8
// Handle each possible OnCompletion type. We don't have to worry about
// handling ClearState, as that's in the clear program
txn OnCompletion
int NoOp
==
bnz handle_noop
txn OnCompletion
int OptIn
==
bnz handle_optin
txn OnCompletion
int CloseOut
==
bnz handle_closeout
txn OnCompletion
int UpdateApplication
==
bnz handle_updateapp
txn OnCompletion
int DeleteApplication
==
bnz handle_deleteapp
// Unexpected OnCompletion value. Should be unreachable.
err
handle_noop:
// Handle NoOp
// Check if this is the creation call
txn ApplicationID
int 0
==
bnz handle_creation
// Otherwise, must be an increment or decrement call
// Get the first argument
txna ApplicationArgs 0
byte "inc"
==
bnz handle_increment
txna ApplicationArgs 0
byte "dec"
==
bnz handle_decrement
// Unrecognized operation
err
handle_creation:
// Initialize counter to 0
byte "counter"
int 0
app_global_put
int 1
return
handle_optin:
// Always allow opt in
int 1
return
handle_closeout:
// Always allow close out
int 1
return
handle_updateapp:
// Only allow creator to update
txn Sender
global CreatorAddress
==
return
handle_deleteapp:
// Only allow creator to delete
txn Sender
global CreatorAddress
==
return
handle_increment:
// Increment the counter
byte "counter"
byte "counter"
app_global_get
int 1
+
app_global_put
int 1
return
handle_decrement:
// Decrement the counter
byte "counter"
byte "counter"
app_global_get
int 1
-
app_global_put
int 1
return
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/GoPlausible/algorand-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server