create account

OAAAAA - Obyte Autonomous Autonomous Agent Address Agent by whoisterencelee

View this thread on: hive.blogpeakd.comecency.com
· @whoisterencelee ·
$0.09
OAAAAA - Obyte Autonomous Autonomous Agent Address Agent
[Autonomous Agents on Obyte](https://developer.obyte.org/autonomous-agents/getting-started-guide) are open compute and open data self-running services.

So I imagine situations in which everyone will eventually run into when they use these services.

One of the first thing is how does one know if they are using the latest version of the service?  

The solution is a autonomous service which allows users to check if the address is the latest version, and allow address transfer to the latest version.

I call it Latest Address Check and Route AA or OAAAA

I only came up with the idea today and there are still some functionality which I am not sure OScript has or not.

Anyways, I am going to submit the idea and work on it some more if others think it's a good idea too.

I imagine everyone will run this as their entry point to their AA service.

```
{
    messages: [
        { 
            app: 'state',
            state: `{
                $checkaddress = trigger.data.address;
                if ( !$checkaddress )  // not sure how to check if data.address is an invalid address???  It especially cannot be a logicaladdress
                    bounce( 'input: { address : address , [ newaddress : newaddress ] , [ checkonly : false ] }');

                $logicaladdress = var[ $checkaddress ];
                if ( $logicaladdress ){ // EXISTS
                    $currentaddress = var[ $logicaladdress ];

                    // TRANSFER
                    $newaddress = trigger.data.newaddress;
                    if( $newaddress ){ // again need to check is an valid address??? again cannot be a logicaladdress
                        
                        if( var[ $currentaddress ][ 'author' ] == trigger.address ){  // how to get author of an external address???
                            // transfer to new address only if author of current address ONLY
                            var[ $logicaladdress ] = $newaddress;
                            var[ $newaddress ] = $logicaladdress;
                            
                            if( trigger.data.checkonly ) return "Address transferred from " || $currentaddress || " to " || $newaddress;
                        }

                    }else{
                        if( trigger.data.checkonly ) bounce( "You need to be author of " || $currentaddress || " in order to transfer to newaddress" );
                    }

                    // CHECK IF LATEST ADDRESS
                    if( trigger.data.checkonly ){
                        if( $checkaddress != $currentaddress ) bounce( "Please use latest address at " || $currentaddress );
                        else bounce( "This address is current");
                    }

                    // route to var[ $logicaladdress ]

                }else{ // NEW

                    var[ "L" || $checkaddress ] = $checkaddress; // create logical address
                    var[ $checkaddress ] = "L" || $checkaddress; // set checkaddress to logical address

                    // route to $checkaddress

                }
            }`
        }
    ]
}
```
👍  , , ,
properties (23)
authorwhoisterencelee
permlinkoaaaaa-obyte-autonomous-autonomous-agent-address-agent
categoryobyte
json_metadata{"tags":["obyte","autonomous","crypto"],"links":["https://developer.obyte.org/autonomous-agents/getting-started-guide"],"app":"steemit/0.1","format":"markdown"}
created2019-08-01 16:13:45
last_update2019-08-01 16:13:45
depth0
children0
last_payout2019-08-08 16:13:45
cashout_time1969-12-31 23:59:59
total_payout_value0.065 HBD
curator_payout_value0.021 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,102
author_reputation13,236,025,259
root_title"OAAAAA - Obyte Autonomous Autonomous Agent Address Agent"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,019,919
net_rshares260,003,838,860
author_curate_reward""
vote details (4)