Skip to content

joepetrowski/delegate-all-tracks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delegate All Tracks

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.

Usage

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.

To Do

Accept arguments as CLI args so you don't need to rebuild every time.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages