Jungle 4 (Testnet)

powerbot

Contract

{
  "version": "eosio::abi/1.2",
  "types": [],
  "structs": [
    {
      "name": "action_pattern",
      "base": "",
      "fields": [
        {
          "name": "contract",
          "type": "name"
        },
        {
          "name": "action",
          "type": "name"
        }
      ]
    },
    {
      "name": "allowances_row",
      "base": "",
      "fields": [
        {
          "name": "beneficiaries",
          "type": "name[]"
        },
        {
          "name": "patterns",
          "type": "action_pattern[]"
        }
      ]
    },
    {
      "name": "assertdebit",
      "base": "",
      "fields": []
    },
    {
      "name": "balances_row",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        },
        {
          "name": "balance",
          "type": "asset"
        },
        {
          "name": "credits",
          "type": "credit_entry[]"
        }
      ]
    },
    {
      "name": "beneficiary_entry",
      "base": "",
      "fields": [
        {
          "name": "account",
          "type": "name"
        },
        {
          "name": "cpu_floor_ms",
          "type": "uint32?"
        },
        {
          "name": "net_floor_kb",
          "type": "uint32?"
        },
        {
          "name": "cpu_increment_ms",
          "type": "uint32?"
        },
        {
          "name": "net_increment_kb",
          "type": "uint32?"
        },
        {
          "name": "paused",
          "type": "bool"
        }
      ]
    },
    {
      "name": "bounds_row",
      "base": "",
      "fields": [
        {
          "name": "min_cpu_ms",
          "type": "uint32"
        },
        {
          "name": "max_cpu_ms",
          "type": "uint32"
        },
        {
          "name": "min_net_kb",
          "type": "uint32"
        },
        {
          "name": "max_net_kb",
          "type": "uint32"
        },
        {
          "name": "default_cpu_floor_ms",
          "type": "uint32"
        },
        {
          "name": "default_cpu_increment_ms",
          "type": "uint32"
        },
        {
          "name": "default_net_floor_kb",
          "type": "uint32"
        },
        {
          "name": "default_net_increment_kb",
          "type": "uint32"
        }
      ]
    },
    {
      "name": "claim",
      "base": "",
      "fields": [
        {
          "name": "to",
          "type": "name"
        },
        {
          "name": "quantity",
          "type": "asset"
        }
      ]
    },
    {
      "name": "close",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        }
      ]
    },
    {
      "name": "closepool",
      "base": "",
      "fields": [
        {
          "name": "pool",
          "type": "name"
        }
      ]
    },
    {
      "name": "configure",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        },
        {
          "name": "beneficiary",
          "type": "name"
        },
        {
          "name": "cpu_floor_ms",
          "type": "uint32?"
        },
        {
          "name": "net_floor_kb",
          "type": "uint32?"
        },
        {
          "name": "cpu_increment_ms",
          "type": "uint32?"
        },
        {
          "name": "net_increment_kb",
          "type": "uint32?"
        },
        {
          "name": "paused",
          "type": "bool"
        }
      ]
    },
    {
      "name": "coverage_row",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        }
      ]
    },
    {
      "name": "cpusample_row",
      "base": "",
      "fields": [
        {
          "name": "samples",
          "type": "uint32[]"
        },
        {
          "name": "median_cpu_us",
          "type": "uint32"
        },
        {
          "name": "published_at",
          "type": "time_point_sec"
        }
      ]
    },
    {
      "name": "credit_entry",
      "base": "",
      "fields": [
        {
          "name": "pool",
          "type": "name"
        },
        {
          "name": "remaining",
          "type": "asset"
        },
        {
          "name": "expires_at",
          "type": "time_point_sec"
        }
      ]
    },
    {
      "name": "defund",
      "base": "",
      "fields": [
        {
          "name": "pool",
          "type": "name"
        },
        {
          "name": "quantity",
          "type": "asset"
        }
      ]
    },
    {
      "name": "delallow",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        }
      ]
    },
    {
      "name": "delorder",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        }
      ]
    },
    {
      "name": "earnings_row",
      "base": "",
      "fields": [
        {
          "name": "balance",
          "type": "asset"
        }
      ]
    },
    {
      "name": "expire",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        }
      ]
    },
    {
      "name": "fees_row",
      "base": "",
      "fields": [
        {
          "name": "rate_bp",
          "type": "uint32"
        },
        {
          "name": "u_pool_bp",
          "type": "uint32"
        },
        {
          "name": "ram_carry_rate_bp",
          "type": "uint32"
        }
      ]
    },
    {
      "name": "grant",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        },
        {
          "name": "pool",
          "type": "name"
        },
        {
          "name": "quantity",
          "type": "asset"
        },
        {
          "name": "expires_at",
          "type": "time_point_sec"
        }
      ]
    },
    {
      "name": "inflight_row",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        },
        {
          "name": "beneficiary",
          "type": "name"
        },
        {
          "name": "bound",
          "type": "asset"
        },
        {
          "name": "provider_fee",
          "type": "asset"
        },
        {
          "name": "cpu_ms",
          "type": "uint32"
        },
        {
          "name": "net_kb",
          "type": "uint32"
        },
        {
          "name": "consumed",
          "type": "bool"
        },
        {
          "name": "chain_cost",
          "type": "asset"
        },
        {
          "name": "memo",
          "type": "string"
        }
      ]
    },
    {
      "name": "logresource",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        },
        {
          "name": "beneficiary",
          "type": "name"
        },
        {
          "name": "chain_cost",
          "type": "asset"
        },
        {
          "name": "provider_fee",
          "type": "asset"
        },
        {
          "name": "cpu_ms",
          "type": "uint32"
        },
        {
          "name": "net_kb",
          "type": "uint32"
        },
        {
          "name": "memo",
          "type": "string"
        }
      ]
    },
    {
      "name": "open",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        }
      ]
    },
    {
      "name": "openpool",
      "base": "",
      "fields": [
        {
          "name": "pool",
          "type": "name"
        },
        {
          "name": "owner",
          "type": "name"
        }
      ]
    },
    {
      "name": "orders_row",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        },
        {
          "name": "entries",
          "type": "beneficiary_entry[]"
        }
      ]
    },
    {
      "name": "pool_row",
      "base": "",
      "fields": [
        {
          "name": "pool",
          "type": "name"
        },
        {
          "name": "owner",
          "type": "name"
        },
        {
          "name": "funded",
          "type": "asset"
        }
      ]
    },
    {
      "name": "setallow",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        },
        {
          "name": "beneficiaries",
          "type": "name[]"
        },
        {
          "name": "patterns",
          "type": "action_pattern[]"
        }
      ]
    },
    {
      "name": "setbounds",
      "base": "",
      "fields": [
        {
          "name": "min_cpu_ms",
          "type": "uint32"
        },
        {
          "name": "max_cpu_ms",
          "type": "uint32"
        },
        {
          "name": "min_net_kb",
          "type": "uint32"
        },
        {
          "name": "max_net_kb",
          "type": "uint32"
        },
        {
          "name": "default_cpu_floor_ms",
          "type": "uint32"
        },
        {
          "name": "default_cpu_increment_ms",
          "type": "uint32"
        },
        {
          "name": "default_net_floor_kb",
          "type": "uint32"
        },
        {
          "name": "default_net_increment_kb",
          "type": "uint32"
        }
      ]
    },
    {
      "name": "setcpu",
      "base": "",
      "fields": [
        {
          "name": "watcher_cpu_us",
          "type": "uint32"
        }
      ]
    },
    {
      "name": "setfees",
      "base": "",
      "fields": [
        {
          "name": "rate_bp",
          "type": "uint32"
        },
        {
          "name": "u_pool_bp",
          "type": "uint32"
        },
        {
          "name": "ram_carry_rate_bp",
          "type": "uint32"
        }
      ]
    },
    {
      "name": "setorder",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        },
        {
          "name": "entries",
          "type": "beneficiary_entry[]"
        }
      ]
    },
    {
      "name": "state_row",
      "base": "",
      "fields": [
        {
          "name": "total_entitlements",
          "type": "asset"
        }
      ]
    },
    {
      "name": "sweep",
      "base": "",
      "fields": [
        {
          "name": "to",
          "type": "name"
        },
        {
          "name": "token_contract",
          "type": "name"
        },
        {
          "name": "quantity",
          "type": "asset"
        }
      ]
    },
    {
      "name": "topup",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        },
        {
          "name": "beneficiary",
          "type": "name"
        },
        {
          "name": "cpu_ms",
          "type": "uint32"
        },
        {
          "name": "net_kb",
          "type": "uint32"
        },
        {
          "name": "cpu_frac",
          "type": "int64"
        },
        {
          "name": "net_frac",
          "type": "int64"
        },
        {
          "name": "max_payment",
          "type": "asset"
        },
        {
          "name": "fee",
          "type": "asset"
        },
        {
          "name": "memo",
          "type": "string"
        }
      ]
    },
    {
      "name": "transactfee",
      "base": "",
      "fields": [
        {
          "name": "provider",
          "type": "name"
        },
        {
          "name": "funder",
          "type": "name"
        },
        {
          "name": "beneficiary",
          "type": "name"
        },
        {
          "name": "fee",
          "type": "asset"
        },
        {
          "name": "memo",
          "type": "string"
        }
      ]
    },
    {
      "name": "withdraw",
      "base": "",
      "fields": [
        {
          "name": "funder",
          "type": "name"
        },
        {
          "name": "quantity",
          "type": "asset"
        }
      ]
    }
  ],
  "actions": [
    {
      "name": "assertdebit",
      "type": "assertdebit",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Confirm the debit happened\nsummary: 'Confirm the chain cost of a top-up was observed and debited'\nicon:\n---\n\npowerbot confirms it observed what the chain charged for a top-up it just made,\nand fails the whole transaction if it did not."
    },
    {
      "name": "claim",
      "type": "claim",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Claim earnings\nsummary: 'Claim {{nowrap quantity}} of earnings to {{nowrap to}}'\nicon:\n---\n\nThe contract account claims {{quantity}} of the earnings powerbot has accrued,\nand powerbot transfers it to {{to}}."
    },
    {
      "name": "close",
      "type": "close",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Close a balance\nsummary: 'Close the powerbot balance of {{nowrap funder}}'\nicon:\n---\n\n{{funder}} closes their powerbot balance and reclaims the RAM of its row. The\nbalance must be empty."
    },
    {
      "name": "closepool",
      "type": "closepool",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Close a pool\nsummary: 'Close the credit pool {{nowrap pool}}'\nicon:\n---\n\nThe pool must be empty. Its owner reclaims the RAM of its row."
    },
    {
      "name": "configure",
      "type": "configure",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Configure one account\nsummary: 'Change how {{nowrap beneficiary}} is kept usable for {{nowrap funder}}'\nicon:\n---\n\n{{funder}} changes the amounts that keep {{beneficiary}} usable, or pauses it,\nleaving every other account in the standing order untouched. An amount left\nempty falls back to the operator's published default."
    },
    {
      "name": "defund",
      "type": "defund",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Defund a pool\nsummary: 'Withdraw {{nowrap quantity}} from the credit pool {{nowrap pool}}'\nicon:\n---\n\nUnspent funds return to the pool's owner. Credit already granted is\nunaffected."
    },
    {
      "name": "delallow",
      "type": "delallow",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Erase an allowance\nsummary: 'Erase the allowance of {{nowrap funder}}'\nicon:\n---\n\n{{funder}} erases its allowance and reclaims the RAM of its rows. No account it\nnamed can settle a fee from its balance afterwards."
    },
    {
      "name": "delorder",
      "type": "delorder",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Erase a standing order\nsummary: 'Erase the standing order of {{nowrap funder}}'\nicon:\n---\n\n{{funder}} erases its standing order and reclaims the RAM of\nits row. No account named by it is kept usable afterwards."
    },
    {
      "name": "expire",
      "type": "expire",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Expire lapsed credit\nsummary: \"Remove {{nowrap funder}}'s lapsed credit\"\nicon:\n---\n\nEach lapsed remainder returns to its source pool. Anyone may call this; it\nchanges only credit that can no longer be spent."
    },
    {
      "name": "grant",
      "type": "grant",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Grant credit\nsummary: 'Grant {{nowrap quantity}} of credit to {{nowrap funder}}'\nicon:\n---\n\nThe credit is drawn from the named pool and expires at {{expires_at}}. It can\nbe spent on resources and cannot be withdrawn."
    },
    {
      "name": "logresource",
      "type": "logresource",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Disclose a top-up\nsummary: 'Disclose a top-up of {{nowrap beneficiary}} charged to {{nowrap funder}}'\nicon:\n---\n\npowerbot discloses to {{funder}} that it bought {{cpu_ms}} ms of CPU and\n{{net_kb}} kB of NET for {{beneficiary}}, at a chain cost of {{chain_cost}}\nplus an operator fee of {{provider_fee}}."
    },
    {
      "name": "open",
      "type": "open",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Open a balance\nsummary: 'Open a powerbot balance for {{nowrap funder}}'\nicon:\n---\n\n{{funder}} opens their powerbot balance at zero, paying for the row it occupies.\nDoing so again changes nothing."
    },
    {
      "name": "openpool",
      "type": "openpool",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Open a pool\nsummary: 'Open the credit pool {{nowrap pool}}'\nicon:\n---\n\nThe pool starts at zero, and {{owner}} pays for the row it occupies. Opening\nit again changes nothing."
    },
    {
      "name": "setallow",
      "type": "setallow",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Grant an allowance\nsummary: 'Let the accounts {{nowrap funder}} names settle fees from its balance'\nicon:\n---\n\n{{funder}} names the accounts whose transaction fees its balance may pay, and\noptionally the actions those transactions may carry, paying for the rows they\noccupy. Naming no account covers {{funder}} alone. Doing so again replaces the\nwhole grant. The grant carries no cap and no expiry: the balance is the limit\nand erasing the grant is the only revocation."
    },
    {
      "name": "setbounds",
      "type": "setbounds",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Publish operator bounds\nsummary: 'Publish the limits and defaults the operator will honor'\nicon:\n---\n\nThe contract account publishes the smallest and largest floors and top-up\nincrements it will accept on a standing order, and the values it applies where a standing\norder is silent. Standing orders already written are unaffected."
    },
    {
      "name": "setcpu",
      "type": "setcpu",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Publish a watcher cpu sample\nsummary: 'Publish one measurement of the cpu the watcher spends on a top-up'\nicon:\n---\n\nThe contract account publishes one sample of the CPU its watcher spends executing a\ntop-up, in microseconds. The contract keeps the most recent 28 samples and the median of\nthem, which every service uses to compute the provider fee. One sample is accepted per\ninterval, so the recorded history always spans real time."
    },
    {
      "name": "setfees",
      "type": "setfees",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Publish fee parameters\nsummary: 'Publish the parameters the provider computes its fee from'\nicon:\n---\n\nThe contract account publishes the margin rate, the pool utilisation assumption and the\nRAM carry rate that every service uses to compute the fee a funder is billed. Values are\nin basis points, where 10000 is one. Top-ups already in flight are unaffected."
    },
    {
      "name": "setorder",
      "type": "setorder",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Write a standing order\nsummary: 'Keep the accounts {{nowrap funder}} names usable'\nicon:\n---\n\n{{funder}} names the accounts it wants kept usable and the resource amounts that\ndefine \"usable\", paying for the row they occupy. Doing so again replaces the\nwhole list. Nothing here is denominated in tokens."
    },
    {
      "name": "sweep",
      "type": "sweep",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Sweep surplus\nsummary: 'Sweep {{nowrap quantity}} of {{nowrap token_contract}} to {{nowrap to}}'\nicon:\n---\n\nThe contract account sends {{quantity}}, held by {{token_contract}}, to {{to}}.\nOnly tokens beyond what powerbot owes its funders and its own earnings can move this\nway."
    },
    {
      "name": "topup",
      "type": "topup",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Top up a covered account\nsummary: 'Buy resources for {{nowrap beneficiary}} out of the balance of {{nowrap funder}}'\nicon:\n---\n\npowerbot buys {{cpu_ms}} ms of CPU and {{net_kb}} kB of NET for\n{{beneficiary}}, as the standing order {{funder}} wrote asks for, paying from\npowerbot's pool. {{funder}} is then debited by exactly what the chain charged\nplus the operator's fee of {{fee}}, and never more than {{max_payment}}."
    },
    {
      "name": "transactfee",
      "type": "transactfee",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Settle a transaction fee\nsummary: 'Pay {{nowrap fee}} from the balance of {{nowrap funder}} for a transaction {{nowrap beneficiary}} signed'\nicon:\n---\n\n{{provider}} states that it cosigned this transaction for {{beneficiary}}, and\ntakes {{fee}} from the balance {{funder}} deposited. {{funder}} does not sign:\nits allowance is its standing authorization, and erasing that allowance is how\nit stops. {{beneficiary}} signs, so no fee can be settled against a transaction\nit did not sign. The whole fee becomes powerbot earnings; no tokens move."
    },
    {
      "name": "withdraw",
      "type": "withdraw",
      "ricardian_contract": "---\nspec_version: \"0.2.0\"\ntitle: Withdraw\nsummary: 'Withdraw {{nowrap quantity}} to {{nowrap funder}}'\nicon:\n---\n\n{{funder}} withdraws {{quantity}} from their powerbot balance, and powerbot\ntransfers it back to them."
    }
  ],
  "tables": [
    {
      "name": "allowances",
      "index_type": "i64",
      "key_names": [],
      "key_types": [],
      "type": "allowances_row"
    },
    {
      "name": "balances",
      "index_type": "i64",
      "key_names": [],
      "key_types": [],
      "type": "balances_row"
    },
    {
      "name": "bounds",
      "index_type": "i64",
      "key_names": [],
      "key_types": [],
      "type": "bounds_row"
    },
    {
      "name": "coverage",
      "index_type": "i64",
      "key_names": [],
      "key_types": [],
      "type": "coverage_row"
    },
    {
      "name": "cpusample",
      "index_type": "i64",
      "key_names": [],
      "key_types": [],
      "type": "cpusample_row"
    },
    {
      "name": "earnings",
      "index_type": "i64",
      "key_names": [],
      "key_types": [],
      "type": "earnings_row"
    },
    {
      "name": "fees",
      "index_type": "i64",
      "key_names": [],
      "key_types": [],
      "type": "fees_row"
    },
    {
      "name": "inflight",
      "index_type": "i64",
      "key_names": [],
      "key_types": [],
      "type": "inflight_row"
    },
    {
      "name": "orders",
      "index_type": "i64",
      "key_names": [],
      "key_types": [],
      "type": "orders_row"
    },
    {
      "name": "pools",
      "index_type": "i64",
      "key_names": [],
      "key_types": [],
      "type": "pool_row"
    },
    {
      "name": "state",
      "index_type": "i64",
      "key_names": [],
      "key_types": [],
      "type": "state_row"
    }
  ],
  "ricardian_clauses": [
    {
      "id": "powerbot",
      "body": "---\nspec_version: \"0.2.0\"\n---\n\nThe powerbot contract holds deposits made by funders and pays for resources on\nbehalf of the beneficiaries those funders name."
    }
  ],
  "error_messages": [],
  "abi_extensions": [],
  "variants": [],
  "action_results": []
}