HZENJOEOLEBRGKQYJBGGIJNLX7RAAVSH
[
"autonomous agent",
{
"doc_url": "https://devid.org/github.json",
"getters": "{
$username2address = ($github_username) => var['u2a_'||$github_username];
$address2username = ($address) => var['a2u_'||$address];
}",
"init": "{
$overwrite_delay = 3; // in days
// $attestor = 'OYW2XTDKSNKGSEZ27LMGNOPJSYIXHBHC'; // mainnet
$attestor = 'QBIAZQZWO3YK2I2C3X37DCVY643S4NI4'; // testnet
// $attestor = 'QMWQRJV6NCYGUI6X7BWRKLLBQVQYLZ27'; // testkit tests
require(trigger.address == $attestor, "only the attestor can call this AA");
}",
"messages": {
"cases": [
{
"if": "{trigger.data.address AND trigger.data.github_username}",
"messages": [
{
"app": "state",
"state": "{
$address = trigger.data.address;
$github_username = trigger.data.github_username;
require(is_valid_address($address), "address not valid");
require(has_only($github_username, '\w-'), "github username not valid");
$existing_owner = var['u2a_'||$github_username];
if ($existing_owner){ // would overwrite
require($existing_owner != $address, "the same owner");
$pending_varname = 'pending_'||$address||'_'||$github_username;
$pending_ts = var[$pending_varname];
if (!$pending_ts){
var[$pending_varname] = timestamp;
response['message'] = "This attestation would overwrite an existing record and can't be activated immediately for security reasons. Please repeat your attestation in "||$overwrite_delay||" days to activate the new owner of this github username.";
return;
}
require(timestamp > $pending_ts + $overwrite_delay * 24 * 3600, "the delay period is still ongoing");
var[$pending_varname] = false;
// the old a2u stays intact
}
var['u2a_'||$github_username] = $address;
var['a2u_'||$address] = $github_username;
response['message'] = $github_username||' => '||$address;
}"
}
]
},
{
"if": "{trigger.data.withdraw AND trigger.data.amount}",
"messages": [
{
"app": "payment",
"payload": {
"asset": "base",
"outputs": [
{
"address": "{$attestor}",
"amount": "{trigger.data.amount}"
}
]
}
}
]
}
]
}
}
]
- MCI: 2519445
- Not bounced
- Response: {
"responseVars": {
"message": "microsoft => EJC4A7WQGHEZEKW6RLO7F26SAR4LAQBU"
},
"info": "no messages after filtering"
}
- MCI: 2519442
- Not bounced
- Response: {
"responseVars": {
"message": "byteball => EJC4A7WQGHEZEKW6RLO7F26SAR4LAQBU"
},
"info": "no messages after filtering"
}
- MCI: 2519429
- Not bounced
- Response: {
"responseVars": {
"message": "taump => 2QVJOY3BRRGWP7IOYL64O5BU3WLUJ4TZ"
},
"info": "no messages after filtering"
}
- MCI: 2519425
- Bounced
- Response: {
"error": "only the attestor can call this AA"
}
- MCI: 2519409
- Not bounced
- Response: {
"responseVars": {
"message": "facebook => 2QVJOY3BRRGWP7IOYL64O5BU3WLUJ4TZ"
},
"info": "no messages after filtering"
}
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount
29.12.2021 11:56:03
in
HZENJOEOLEBRGKQYJBGGIJNLX7RAAVSH
29.12.2021 11:55:21
in
HZENJOEOLEBRGKQYJBGGIJNLX7RAAVSH
29.12.2021 11:52:49
in
HZENJOEOLEBRGKQYJBGGIJNLX7RAAVSH
29.12.2021 11:52:07
in
HZENJOEOLEBRGKQYJBGGIJNLX7RAAVSH
29.12.2021 11:49:08
in
HZENJOEOLEBRGKQYJBGGIJNLX7RAAVSH