Polkadot's OpenGov has track-independent vote delegation. That is, an account can delegate conviction-weighted votes to different accounts for different tracks. For example, one might delegate to account A for Staking referenda and account B for Treasury proposals. However, the delegate
function must be called for each track, meaning even if one wants to delegate all their votes to the same delegate, they must submit a delegation for each track.
This script constructs a call that will delegate some configuration of (amount, conviction, delegate) to every track.
This only works on Kusama for now.
You need to edit the UserInputs
in src/main.rs
:
fn user_inputs() -> UserInputs {
let decimals: u128 = 10_u128.pow(12);
return UserInputs {
// Address to which to delegate votes.
to: "your delegation here",
// Conviction, from 0 (0.1x), 1 (1x) to 6 (6x).
conviction: 1,
// Amount of KSM to delegate. KSM has 12 decimals.
amount: 1 * decimals,
// Submit this call via proxy. Enter `Some("proxied address")` if submitting via proxy.
// Will not work until https://github.com/paritytech/polkadot/pull/6366 is in a runtime.
// Probably v9340 and higher.
as_proxy: None,
}
}
Once you've configured your settings, just call cargo run
, and it will give you a call. You can then paste this in e.g. Polkadot JS Apps UI and sign/submit it with whatever wallet you prefer.
Call generated from above sample.
Accept arguments as CLI args so you don't need to rebuild every time.