Skip to content

Commit

Permalink
[encointer] introduce swap options for businesses through democracy (#…
Browse files Browse the repository at this point in the history
…541)

This introduces new functionality for Encointer communities:
* democracy proposals can grant swap options to businesses for them to
swap community currency for KSM from the community treasury. relevant
pallet changes: encointer/pallets#411

### Motivation

In order for community treasuries holding KSM to act as a reserve for
community currencies, we need to enable some form of swap functionality.
This functionality, however, needs to be permissioned, as we can't allow
everyone to "exit" the demurrage-bearing community currency as this
would undermine the community currency and deplete the treasury for no
good.
Businesses making real turnover in community currency, however, should
have an option to reduce their exposure. Otherwise, the most popular
businesses will be punished by bearing the greatest risk by accumulating
community currency before economic circles can be closed (which will
eventually allow them to spend their community currency on goods and
services they need).
The best available source of information which businesses add real value
to the community is the community members. Therefore, we let the
community vote on swap allowances for businesses using Encointer's
personhood-based democracy process.

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
  • Loading branch information
brenzi and acatangiu authored Jan 14, 2025
1 parent b677b84 commit c5e9f58
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Location conversion tests for relays and parachains ([polkadot-fellows/runtimes#487](https://github.com/polkadot-fellows/runtimes/pull/487))

- ParaRegistration proxy for Polkadot and Kusama ([polkadot-fellows/runtimes#520](https://github.com/polkadot-fellows/runtimes/pull/520))
- Encointer: Swap community currency for KSM from community treasuries subject to democratic decision on allowance ([polkadot-fellows/runtimes#541](https://github.com/polkadot-fellows/runtimes/pull/541))

- Delegate stake pools in Kusama ([polkadot-fellows/runtimes#540](https://github.com/polkadot-fellows/runtimes/pull/540))

Expand Down
20 changes: 11 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ emulated-integration-tests-common = { version = "14.1.0" }
encointer-balances-tx-payment = { version = "~14.1.0", default-features = false }
encointer-balances-tx-payment-rpc-runtime-api = { version = "~14.1.0", default-features = false }
encointer-kusama-runtime = { path = "system-parachains/encointer" }
encointer-primitives = { version = "~14.3.0", default-features = false }
encointer-primitives = { version = "~14.4.0", default-features = false }
enumflags2 = { version = "0.7.7" }
frame-benchmarking = { version = "38.0.0", default-features = false }
frame-election-provider-support = { version = "38.0.0", default-features = false }
Expand Down Expand Up @@ -109,18 +109,18 @@ pallet-conviction-voting = { version = "38.0.0", default-features = false }
pallet-core-fellowship = { version = "22.0.0", default-features = false }
pallet-election-provider-multi-phase = { version = "37.0.0", default-features = false }
pallet-election-provider-support-benchmarking = { version = "37.0.0", default-features = false }
pallet-encointer-balances = { version = "~14.1.0", default-features = false }
pallet-encointer-balances = { version = "~14.2.0", default-features = false }
pallet-encointer-bazaar = { version = "~14.1.0", default-features = false }
pallet-encointer-bazaar-rpc-runtime-api = { version = "~14.1.0", default-features = false }
pallet-encointer-ceremonies = { version = "~14.1.0", default-features = false }
pallet-encointer-ceremonies-rpc-runtime-api = { version = "~14.1.0", default-features = false }
pallet-encointer-communities = { version = "~14.1.0", default-features = false }
pallet-encointer-communities-rpc-runtime-api = { version = "~14.1.0", default-features = false }
pallet-encointer-democracy = { version = "~14.3.2", default-features = false }
pallet-encointer-democracy = { version = "~14.4.0", default-features = false }
pallet-encointer-faucet = { version = "~14.2.0", default-features = false }
pallet-encointer-reputation-commitments = { version = "~14.1.0", default-features = false }
pallet-encointer-scheduler = { version = "~14.1.0", default-features = false }
pallet-encointer-treasuries = { version = "~14.3.0", default-features = false }
pallet-encointer-treasuries = { version = "~14.4.1", default-features = false }
pallet-encointer-treasuries-rpc-runtime-api = { version = "~14.3.0", default-features = false }
pallet-fast-unstake = { version = "37.0.0", default-features = false }
pallet-glutton = { version = "24.0.0", default-features = false }
Expand Down
2 changes: 2 additions & 0 deletions system-parachains/encointer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ impl pallet_encointer_treasuries::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = pallet_balances::Pallet<Runtime>;
type PalletId = TreasuriesPalletId;
type WeightInfo = weights::pallet_encointer_treasuries::WeightInfo<Runtime>;
}

impl pallet_aura::Config for Runtime {
Expand Down Expand Up @@ -849,6 +850,7 @@ mod benches {
[pallet_encointer_faucet, EncointerFaucet]
[pallet_encointer_reputation_commitments, EncointerReputationCommitments]
[pallet_encointer_scheduler, EncointerScheduler]
[pallet_encointer_treasuries, EncointerTreasuries]
[cumulus_pallet_parachain_system, ParachainSystem]
[cumulus_pallet_xcmp_queue, XcmpQueue]
// XCM
Expand Down
1 change: 1 addition & 0 deletions system-parachains/encointer/src/weights/mod.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c5e9f58

Please sign in to comment.