Unit ID
uDZQcm6ouZZCvzmJKyioY51rl+GktMQv45wpxn809nE=
Received
24.04.2021 19:58:38
Confirmation delay (full node)
9 minutes 38 seconds
Confirmation delay (light node)
14 minutes 18 seconds
Messages
Definition
Definition: [ "autonomous agent", { "getters": "{ $get_growth_factor = ($curve) => { $interest_rate = var[$curve]['interest_rate']; $term = (timestamp - var[$curve]['rate_update_ts']) / (360 * 24 * 3600); // in years $growth_factor = var[$curve]['growth_factor'] * (1 + $interest_rate)^$term; $growth_factor }; }", "init": "{ if(trigger.output[[asset!=base]].asset != 'none'){ $asset = trigger.output[[asset!=base]].asset; if($asset and $asset == 'ambiguous') bounce('Only 1 asset per tx'); } else bounce('usage: send any amount of I asset with params:to,amount and will calc and send O asset amount in interest asset'); $def = asset[$asset].definer_address; if(!is_aa($def)) bounce('asset invalid'); if(definition[$def][1].base_aa != '3DGWRKKWWSC6SV4ZQDWEHYFRYB4TGPKX') bounce('asset invalid'); $growth_factor = $get_growth_factor($def); $stable_amount = trigger.data.amount; if(!$stable_amount OR !is_integer($stable_amount) OR $stable_amount >= 0) bounce('amount param invalid'); $interest_amount = floor($stable_amount / $growth_factor); if($interest_amount > trigger.output[[asset=$asset]]) bounce('not enough i tokens sent'); if(!trigger.data.to or !is_valid_address(trigger.data.to) or is_aa(trigger.data.to)) bounce('to param invalid'); }", "messages": [ { "app": "payment", "payload": { "asset": "{$asset}", "outputs": [ { "address": "{trigger.data.to}", "amount": "{$interest_amount}" }, { "address": "{trigger.address}" } ] } }, { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{trigger.address}" } ] } } ] } ]
Technical information
Fees:
2,526 bytes
(451 headers, 2075 payload)
Level:7605590
Witnessed level:7605581
Main chain index:7291628
Latest included mc index:7291627
Status:stable/confirmed/final