polkadot
polkadot copied to clipboard
Runtime: Treasury spends various asset kinds
Polkadot/Kusams/Rococo Treasury can accept proposals for spends of various asset kinds by specifying the asset's location and ID.
Treasury Pallet New Dispatchables:
- spend(AssetKind, AssetBalance, Beneficiary, Option<ValidFrom>) - propose and approve a spend;
- payout(SpendIndex) - payout an approved spend or retry a failed payout
- check_payment(SpendIndex) - check the status of a payout;
- void_spend(SpendIndex) - void previously approved spend;
existing
spenddispatchable renamed tospend_local
in this context, the AssetKind parameter contains the asset's location and it's corresponding asset_id, for example:
USDT on AssetHub,
location = MultiLocation(0, Parachain(1000))
asset_id = MultiLocation(0, (PalletInstance(50), GeneralIndex(1984)))
the Beneficiary parameter is a MultiLocation in the context of the asset's location, for example
FellowshipSalaryPallet = MultiLocation(1, (Parachain(1001), PalletInstance(64)))
or Alice = MultiLocation(0, AccountId32(network: None, id: [1,...]))
the AssetBalance represents the amount of the AssetKind to be transferred to the Beneficiary. For permission checks, the asset amount is converted to the native amount and compared against the maximum spendable amount determined by the commanding spend origin.
the spend dispatchable allows for batching spends with different ValidFrom arguments, enabling milestone-based spending. If the expectations tied to an approved spend are not met, it is possible to void the spend later using the void_spend dispatchable.
Asset Rate Pallet provides the conversion rate from the AssetKind to the native balance.
Asset Rate Pallet Dispatchables:
- create(AssetKind, Rate) - initialize a conversion rate to the native balance for the given asset
- update(AssetKind, Rate) - update the conversion rate to the native balance for the given asset
- remove(AssetKind) - remove an existing conversion rate to the native balance for the given asset
the pallet's dispatchables can be executed by the Root or Treasurer origins.
companion for https://github.com/paritytech/substrate/pull/14434
cumulus companion: https://github.com/paritytech/cumulus/pull/2902 // and xcm-emulator based tests
bot rebase
Rebased
bot rebase
Rebased
The CI pipeline was cancelled due to failure one of the required jobs. Job name: test-linux-stable Logs: https://gitlab.parity.io/parity/mirrors/polkadot/-/jobs/3317528