From 41bb24180c6627056174418c1b6bd4f8c8258de4 Mon Sep 17 00:00:00 2001 From: Nisheeth Barthwal Date: Wed, 12 Apr 2023 17:59:04 +0200 Subject: [PATCH] [MOON-2311] expose VotingFor and ClassLocksFor data in precompile (#2220) --- .../conviction-voting/ConvictionVoting.sol | 130 +++++++++ precompiles/conviction-voting/src/lib.rs | 247 +++++++++++++++++- precompiles/conviction-voting/src/tests.rs | 169 ++++++++++++ precompiles/utils/src/data/native.rs | 2 +- .../contracts/compiled/ConvictionVoting.json | 52 +++- 5 files changed, 591 insertions(+), 9 deletions(-) diff --git a/precompiles/conviction-voting/ConvictionVoting.sol b/precompiles/conviction-voting/ConvictionVoting.sol index bb0fd50c6f..a2b0c6c27d 100644 --- a/precompiles/conviction-voting/ConvictionVoting.sol +++ b/precompiles/conviction-voting/ConvictionVoting.sol @@ -33,6 +33,136 @@ interface ConvictionVoting { Locked6x } + /// @dev Defines the class lock for an account. + struct ClassLock { + /// The track of this lock. + uint16 trackId; + /// The amount locked. + uint256 amount; + } + + /// @dev Defines the voting information for an account and track, + struct VotingFor { + /// If the voting type is `Casting`, if `true` then `casting` field is significant. + bool isCasting; + /// If the voting type is `Delegating`, if `true` then `delegating` field is significant. + bool isDelegating; + /// Defines the voting information when `isCasting` is true. + Casting casting; + /// Defines the voting information when `isDelegating` is true. + Delegating delegating; + } + + /// @dev Defines the casting vote type from an account. + struct Casting { + /// The votes registered. + PollAccountVote[] votes; + /// The delegation info. + Delegations delegations; + /// Any prior lock information. + PriorLock prior; + } + + /// @dev Defines the delegating vote type from an account. + struct Delegating { + /// The delegated balance. + uint256 balance; + /// The deletegate account + address target; + /// The conviction type for the vote. + Conviction conviction; + /// The delegation info. + Delegations delegations; + /// Any prior lock information. + PriorLock prior; + } + + /// @dev Defines the vote towards a poll from an account. + struct PollAccountVote { + /// The index of the poll. + uint32 pollIndex; + /// The vote registered for the poll from an account. + AccountVote accountVote; + } + + /// @dev Defines the vote from an account. + struct AccountVote { + /// If `true` then the vote is a Standard vote and `standard` field is significant. + bool isStandard; + /// If `true` then the vote is a Split vote and `split` field is significant. + bool isSplit; + /// If `true` then the vote is a SplitAbstrain vote and `splitAbstain` field is significant. + bool isSplitAbstain; + /// Defines the standard vote, if `isStandard` is `true`. + StandardVote standard; + /// Defines the split vote, if `isSplit` is `true`. + SplitVote split; + /// Defines the split-abstain vote, if `isSplitAbstrain` is `true`. + SplitAbstainVote splitAbstain; + } + + /// @dev Defines the standard vote. + struct StandardVote { + /// The vote information. + Vote vote; + /// The locked balance for the vote. + uint256 balance; + } + + /// @dev Defines the vote parameters for a standard vote. + struct Vote { + /// `true` if the vote is an aye. + bool aye; + /// The conviction type for the vote. + Conviction conviction; + } + + /// @dev Defines the standard vote. + struct SplitVote { + /// The amount locked towards aye. + uint256 aye; + /// The amount locked towards nay. + uint256 nay; + } + + /// @dev Defines the standard vote. + struct SplitAbstainVote { + /// The amount locked towards aye. + uint256 aye; + /// The amount locked towards nay. + uint256 nay; + /// The amount locked towards abstain. + uint256 abstain; + } + + /// @dev Defines the delegations for a vote. + struct Delegations { + /// Total number of votes. + uint256 votes; + /// Total capital locked. + uint256 capital; + } + + /// @dev Defines any prior lock for a vote. + struct PriorLock { + /// Amount of balance locked. + uint256 balance; + } + + /// @dev Retrieve votings for a given account and track. + /// @custom:selector 501447ee + /// @param who The requested account + /// @param trackId The requested track + function votingFor( + address who, + uint16 trackId + ) external view returns (ClassLock[] memory); + + /// @dev Retrieve class locks for a given account. + /// @custom:selector 7ae8ac92 + /// @param who The requested account + function classLocksFor(address who) external view returns (uint256); + /// @dev Vote yes in a poll. /// @custom:selector da9df518 /// @param pollIndex Index of poll diff --git a/precompiles/conviction-voting/src/lib.rs b/precompiles/conviction-voting/src/lib.rs index e84e6448f8..8aae1863fa 100644 --- a/precompiles/conviction-voting/src/lib.rs +++ b/precompiles/conviction-voting/src/lib.rs @@ -20,12 +20,16 @@ use fp_evm::PrecompileHandle; use frame_support::dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo}; use frame_support::traits::{Currency, Polling}; use pallet_conviction_voting::Call as ConvictionVotingCall; -use pallet_conviction_voting::{AccountVote, Conviction, Tally, Vote}; +use pallet_conviction_voting::{ + AccountVote, Casting, ClassLocksFor, Conviction, Delegating, Tally, TallyOf, Vote, Voting, + VotingFor, +}; use pallet_evm::{AddressMapping, Log}; -use precompile_utils::prelude::*; +use precompile_utils::{data::String, prelude::*}; use sp_core::{H160, H256, U256}; use sp_runtime::traits::StaticLookup; use sp_std::marker::PhantomData; +use sp_std::vec::Vec; #[cfg(test)] mod mock; @@ -51,6 +55,13 @@ type ClassOf = <::Polls as ::MaxTurnout, >, >>::Class; +type VotingOf = Voting< + BalanceOf, + ::AccountId, + ::BlockNumber, + <::Polls as Polling>>::Index, + ::MaxVotes, +>; /// Solidity selector of the Vote log, which is the Keccak of the Log signature. pub(crate) const SELECTOR_LOG_VOTED: [u8; 32] = @@ -92,14 +103,15 @@ pub struct ConvictionVotingPrecompile(PhantomData); impl ConvictionVotingPrecompile where Runtime: pallet_conviction_voting::Config + pallet_evm::Config + frame_system::Config, - BalanceOf: TryFrom, + BalanceOf: TryFrom + Into, ::RuntimeCall: Dispatchable + GetDispatchInfo, <::RuntimeCall as Dispatchable>::RuntimeOrigin: From>, + Runtime::AccountId: Into, ::RuntimeCall: From>, - IndexOf: TryFrom, - ClassOf: TryFrom, + IndexOf: TryFrom + TryInto, + ClassOf: TryFrom + TryInto, { /// Internal helper function for vote* extrinsics exposed in this precompile. fn vote( @@ -376,6 +388,7 @@ where Ok(()) } + #[precompile::public("undelegate(uint16)")] fn undelegate(handle: &mut impl PrecompileHandle, track_id: u16) -> EvmResult { let caller = handle.context().caller; @@ -400,6 +413,7 @@ where Ok(()) } + #[precompile::public("unlock(uint16,address)")] fn unlock(handle: &mut impl PrecompileHandle, track_id: u16, target: Address) -> EvmResult { let class = Self::u16_to_track_id(track_id).in_field("trackId")?; @@ -431,26 +445,76 @@ where Ok(()) } + + #[precompile::public("votingFor(address,uint16)")] + #[precompile::view] + fn voting_for( + handle: &mut impl PrecompileHandle, + who: Address, + track_id: u16, + ) -> EvmResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + let who = Runtime::AddressMapping::into_account_id(who.into()); + let class = Self::u16_to_track_id(track_id).in_field("trackId")?; + + let voting = >::get(&who, &class); + + Ok(Self::voting_to_output(voting)?) + } + + #[precompile::public("classLocksFor(address)")] + #[precompile::view] + fn class_locks_for( + handle: &mut impl PrecompileHandle, + who: Address, + ) -> EvmResult> { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + let who = Runtime::AddressMapping::into_account_id(who.into()); + + let class_locks_for = >::get(&who); + let mut output = Vec::new(); + for (track_id, amount) in class_locks_for { + output.push(OutputClassLock { + track: Self::track_id_to_u16(track_id)?, + amount: amount.into(), + }); + } + + Ok(output) + } + fn u8_to_conviction(conviction: u8) -> MayRevert { conviction .try_into() .map_err(|_| RevertReason::custom("Must be an integer between 0 and 6 included").into()) } + fn u32_to_index(index: u32) -> MayRevert> { index .try_into() .map_err(|_| RevertReason::value_is_too_large("index type").into()) } + fn u16_to_track_id(class: u16) -> MayRevert> { class .try_into() .map_err(|_| RevertReason::value_is_too_large("trackId type").into()) } + + fn track_id_to_u16(class: ClassOf) -> MayRevert { + class + .try_into() + .map_err(|_| RevertReason::value_is_too_large("trackId type").into()) + } + fn u256_to_amount(value: U256) -> MayRevert> { value .try_into() .map_err(|_| RevertReason::value_is_too_large("balance type").into()) } + fn log_vote_event( handle: &mut impl PrecompileHandle, poll_index: u32, @@ -522,4 +586,177 @@ where handle.record_log_costs(&[&event])?; Ok((Self::u32_to_index(poll_index)?, vote, event)) } + + fn voting_to_output(voting: VotingOf) -> MayRevert { + let output = match voting { + Voting::Casting(Casting { + votes, + delegations, + prior, + }) => { + let mut output_votes = Vec::new(); + for (poll_index, account_vote) in votes { + let poll_index: u32 = poll_index + .try_into() + .map_err(|_| RevertReason::value_is_too_large("index type"))?; + let account_vote = match account_vote { + AccountVote::Standard { vote, balance } => OutputAccountVote { + is_standard: true, + standard: StandardVote { + vote: OutputVote { + aye: vote.aye, + conviction: vote.conviction.into(), + }, + balance: balance.into(), + }, + ..Default::default() + }, + AccountVote::Split { aye, nay } => OutputAccountVote { + is_split: true, + split: SplitVote { + aye: aye.into(), + nay: nay.into(), + }, + ..Default::default() + }, + AccountVote::SplitAbstain { aye, nay, abstain } => OutputAccountVote { + is_split_abstain: true, + split_abstain: SplitAbstainVote { + aye: aye.into(), + nay: nay.into(), + abstain: abstain.into(), + }, + ..Default::default() + }, + }; + + output_votes.push(PollAccountVote { + poll_index, + account_vote, + }); + } + + OutputVotingFor { + is_casting: true, + casting: OutputCasting { + votes: output_votes, + delegations: Delegations { + votes: delegations.votes.into(), + capital: delegations.capital.into(), + }, + prior: PriorLock { + balance: prior.locked().into(), + }, + }, + ..Default::default() + } + } + Voting::Delegating(Delegating { + balance, + target, + conviction, + delegations, + prior, + }) => OutputVotingFor { + is_delegating: true, + delegating: OutputDelegating { + balance: balance.into(), + target: Address(target.into()), + conviction: conviction.into(), + delegations: Delegations { + votes: delegations.votes.into(), + capital: delegations.capital.into(), + }, + prior: PriorLock { + balance: prior.locked().into(), + }, + }, + ..Default::default() + }, + }; + + Ok(output) + } +} + +#[derive(Default, EvmData)] +pub struct OutputClassLock { + track: u16, + amount: U256, +} + +#[derive(Default, EvmData)] +pub struct OutputVotingFor { + is_casting: bool, + is_delegating: bool, + casting: OutputCasting, + delegating: OutputDelegating, +} + +#[derive(Default, EvmData)] +pub struct OutputCasting { + votes: Vec, + delegations: Delegations, + prior: PriorLock, +} + +#[derive(Default, EvmData)] +pub struct PollAccountVote { + poll_index: u32, + account_vote: OutputAccountVote, +} + +#[derive(Default, EvmData)] +pub struct OutputDelegating { + balance: U256, + target: Address, + conviction: u8, + delegations: Delegations, + prior: PriorLock, +} + +#[derive(Default, EvmData)] +pub struct OutputAccountVote { + is_standard: bool, + is_split: bool, + is_split_abstain: bool, + standard: StandardVote, + split: SplitVote, + split_abstain: SplitAbstainVote, +} + +#[derive(Default, EvmData)] +pub struct StandardVote { + vote: OutputVote, + balance: U256, +} + +#[derive(Default, EvmData)] +pub struct OutputVote { + aye: bool, + conviction: u8, +} + +#[derive(Default, EvmData)] +pub struct SplitVote { + aye: U256, + nay: U256, +} + +#[derive(Default, EvmData)] +pub struct SplitAbstainVote { + aye: U256, + nay: U256, + abstain: U256, +} + +#[derive(Default, EvmData)] +pub struct Delegations { + votes: U256, + capital: U256, +} + +#[derive(Default, EvmData)] +pub struct PriorLock { + balance: U256, } diff --git a/precompiles/conviction-voting/src/tests.rs b/precompiles/conviction-voting/src/tests.rs index eef394c5ef..6e012e9187 100644 --- a/precompiles/conviction-voting/src/tests.rs +++ b/precompiles/conviction-voting/src/tests.rs @@ -27,6 +27,10 @@ use sp_runtime::{traits::PostDispatchInfoOf, DispatchResultWithInfo}; const ONGOING_POLL_INDEX: u32 = 3; +fn precompiles() -> Precompiles { + PrecompilesValue::get() +} + fn evm_call(input: Vec) -> EvmCall { EvmCall::call { source: Alice.into(), @@ -427,3 +431,168 @@ fn unlock_logs_work() { )); }) } + +#[test] +fn test_voting_for_returns_correct_value_for_standard_vote() { + ExtBuilder::default() + .with_balances(vec![(Alice.into(), 100_000)]) + .build() + .execute_with(|| { + // Vote Yes + assert_ok!(standard_vote(true, 100_000.into(), 1.into())); + + precompiles() + .prepare_test( + Alice, + Precompile1, + PCall::voting_for { + who: H160::from(Alice).into(), + track_id: 0u16, + }, + ) + .expect_no_logs() + .execute_returns_encoded(crate::OutputVotingFor { + is_casting: true, + casting: crate::OutputCasting { + votes: vec![crate::PollAccountVote { + poll_index: 3, + account_vote: crate::OutputAccountVote { + is_standard: true, + standard: crate::StandardVote { + vote: crate::OutputVote { + aye: true, + conviction: 1, + }, + balance: 100_000.into(), + }, + ..Default::default() + }, + }], + delegations: crate::Delegations { + votes: 0.into(), + capital: 0.into(), + }, + prior: crate::PriorLock { balance: 0.into() }, + }, + ..Default::default() + }); + }) +} + +#[test] +fn test_voting_for_returns_correct_value_for_split_vote() { + ExtBuilder::default() + .with_balances(vec![(Alice.into(), 100_000)]) + .build() + .execute_with(|| { + // Vote Yes + assert_ok!(split_vote(20_000.into(), 30_000.into(), None)); + + precompiles() + .prepare_test( + Alice, + Precompile1, + PCall::voting_for { + who: H160::from(Alice).into(), + track_id: 0u16, + }, + ) + .expect_no_logs() + .execute_returns_encoded(crate::OutputVotingFor { + is_casting: true, + casting: crate::OutputCasting { + votes: vec![crate::PollAccountVote { + poll_index: 3, + account_vote: crate::OutputAccountVote { + is_split: true, + split: crate::SplitVote { + aye: 20_000.into(), + nay: 30_000.into(), + }, + ..Default::default() + }, + }], + delegations: crate::Delegations { + votes: 0.into(), + capital: 0.into(), + }, + prior: crate::PriorLock { balance: 0.into() }, + }, + ..Default::default() + }); + }) +} + +#[test] +fn test_voting_for_returns_correct_value_for_split_abstain_vote() { + ExtBuilder::default() + .with_balances(vec![(Alice.into(), 100_000)]) + .build() + .execute_with(|| { + // Vote Yes + assert_ok!(split_vote( + 20_000.into(), + 30_000.into(), + Some(10_000.into()) + )); + + precompiles() + .prepare_test( + Alice, + Precompile1, + PCall::voting_for { + who: H160::from(Alice).into(), + track_id: 0u16, + }, + ) + .expect_no_logs() + .execute_returns_encoded(crate::OutputVotingFor { + is_casting: true, + casting: crate::OutputCasting { + votes: vec![crate::PollAccountVote { + poll_index: 3, + account_vote: crate::OutputAccountVote { + is_split_abstain: true, + split_abstain: crate::SplitAbstainVote { + aye: 20_000.into(), + nay: 30_000.into(), + abstain: 10_000.into(), + }, + ..Default::default() + }, + }], + delegations: crate::Delegations { + votes: 0.into(), + capital: 0.into(), + }, + prior: crate::PriorLock { balance: 0.into() }, + }, + ..Default::default() + }); + }) +} + +#[test] +fn test_class_locks_for_returns_correct_value() { + ExtBuilder::default() + .with_balances(vec![(Alice.into(), 100_000)]) + .build() + .execute_with(|| { + // Vote Yes + assert_ok!(standard_vote(true, 100_000.into(), 1.into())); + + precompiles() + .prepare_test( + Alice, + Precompile1, + PCall::class_locks_for { + who: H160::from(Alice).into(), + }, + ) + .expect_no_logs() + .execute_returns_encoded(vec![crate::OutputClassLock { + track: 0u16, + amount: U256::from(100_000), + }]); + }) +} diff --git a/precompiles/utils/src/data/native.rs b/precompiles/utils/src/data/native.rs index 7e84e00a15..b466f92eae 100644 --- a/precompiles/utils/src/data/native.rs +++ b/precompiles/utils/src/data/native.rs @@ -106,7 +106,7 @@ impl EvmData for H256 { /// The `address` type of Solidity. /// H160 could represent 2 types of data (bytes20 and address) that are not encoded the same way. /// To avoid issues writing H160 is thus not supported. -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct Address(pub H160); impl From for Address { diff --git a/tests/contracts/compiled/ConvictionVoting.json b/tests/contracts/compiled/ConvictionVoting.json index 8860cca08c..68be8ef51e 100644 --- a/tests/contracts/compiled/ConvictionVoting.json +++ b/tests/contracts/compiled/ConvictionVoting.json @@ -257,6 +257,17 @@ "name": "Voted", "type": "event" }, + { + "inputs": [ + { "internalType": "address", "name": "who", "type": "address" } + ], + "name": "classLocksFor", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { "internalType": "uint16", "name": "trackId", "type": "uint16" }, @@ -386,6 +397,26 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "who", "type": "address" }, + { "internalType": "uint16", "name": "trackId", "type": "uint16" } + ], + "name": "votingFor", + "outputs": [ + { + "components": [ + { "internalType": "uint16", "name": "trackId", "type": "uint16" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "internalType": "struct ConvictionVoting.ClassLock[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" } ], "devdoc": { @@ -481,6 +512,11 @@ }, "kind": "dev", "methods": { + "classLocksFor(address)": { + "custom:selector": "7ae8ac92", + "details": "Retrieve class locks for a given account.", + "params": { "who": "The requested account" } + }, "delegate(uint16,address,uint8,uint256)": { "custom:selector": "681750e8", "details": "Delegate to a representative for the vote trackId", @@ -553,6 +589,14 @@ "pollIndex": "Index of poll", "voteAmount": "Balance locked for vote" } + }, + "votingFor(address,uint16)": { + "custom:selector": "501447ee", + "details": "Retrieve votings for a given account and track.", + "params": { + "trackId": "The requested track", + "who": "The requested account" + } } }, "title": "Pallet Conviction Voting InterfaceThe interface through which solidity contracts will interact with the Conviction Voting pallet", @@ -580,6 +624,7 @@ "gasEstimates": null, "legacyAssembly": null, "methodIdentifiers": { + "classLocksFor(address)": "7ae8ac92", "delegate(uint16,address,uint8,uint256)": "681750e8", "removeOtherVote(address,uint16,uint32)": "cbcb9276", "removeVote(uint32)": "79cae220", @@ -589,13 +634,14 @@ "voteNo(uint32,uint256,uint8)": "cc600eba", "voteSplit(uint32,uint256,uint256)": "dd6c52a4", "voteSplitAbstain(uint32,uint256,uint256,uint256)": "52004540", - "voteYes(uint32,uint256,uint8)": "da9df518" + "voteYes(uint32,uint256,uint8)": "da9df518", + "votingFor(address,uint16)": "501447ee" } }, "ewasm": { "wasm": "" }, - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"delegatedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"conviction\",\"type\":\"uint8\"}],\"name\":\"Delegated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Undelegated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unlocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"VoteRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"VoteRemovedForTrack\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"}],\"name\":\"VoteRemovedOther\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"aye\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nay\",\"type\":\"uint256\"}],\"name\":\"VoteSplit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"aye\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nay\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"abstain\",\"type\":\"uint256\"}],\"name\":\"VoteSplitAbstained\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"aye\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"conviction\",\"type\":\"uint8\"}],\"name\":\"Voted\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"representative\",\"type\":\"address\"},{\"internalType\":\"enum ConvictionVoting.Conviction\",\"name\":\"conviction\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"}],\"name\":\"removeOtherVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"}],\"name\":\"removeVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"}],\"name\":\"removeVoteForTrack\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"}],\"name\":\"undelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"unlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"voteAmount\",\"type\":\"uint256\"},{\"internalType\":\"enum ConvictionVoting.Conviction\",\"name\":\"conviction\",\"type\":\"uint8\"}],\"name\":\"voteNo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"aye\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nay\",\"type\":\"uint256\"}],\"name\":\"voteSplit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"aye\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nay\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"abstain\",\"type\":\"uint256\"}],\"name\":\"voteSplitAbstain\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"voteAmount\",\"type\":\"uint256\"},{\"internalType\":\"enum ConvictionVoting.Conviction\",\"name\":\"conviction\",\"type\":\"uint8\"}],\"name\":\"voteYes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"The Moonbeam Team\",\"custom:address\":\"0x0000000000000000000000000000000000000812\",\"events\":{\"Delegated(uint16,address,address,uint256,uint8)\":{\"custom:selector\":\"6cc151d547592e227b1e85a264ac3699c6f1014112b08bb3832de1f23b9c66db\",\"details\":\"An account delegated for the given trackId.\",\"params\":{\"conviction\":\"uint8 Conviction being delegated.\",\"delegatedAmount\":\"uint256 Amount being delegated.\",\"from\":\"address Address of the caller.\",\"to\":\"address Address of the representative.\",\"trackId\":\"uint16 The trackId.\"}},\"Undelegated(uint16,address)\":{\"custom:selector\":\"1053303328f6db14014ccced6297bcad2b3897157ce46070711ab995a05dfa14\",\"details\":\"An account undelegated for the given trackId.\",\"params\":{\"caller\":\"address Address of the caller.\",\"trackId\":\"uint16 The trackId.\"}},\"Unlocked(uint16,address)\":{\"custom:selector\":\"dcf72fa65ca7fb720b9ccc8ee28e0188edc3d943115124cdd4086c49f836a128\",\"details\":\"An account called to unlock tokens for the given trackId.\",\"params\":{\"caller\":\"address Address of the caller.\",\"trackId\":\"uint16 The trackId.\"}},\"VoteRemoved(uint32,address)\":{\"custom:selector\":\"49fc1dd929f126e1d88cbb9c135625e30c2deba291adeea4740e446098b9957b\",\"details\":\"An account removed its vote from an ongoing poll.\",\"params\":{\"pollIndex\":\"uint32 Index of the poll.\",\"voter\":\"address Address of the voter.\"}},\"VoteRemovedForTrack(uint32,uint16,address)\":{\"custom:selector\":\"49fc1dd929f126e1d88cbb9c135625e30c2deba291adeea4740e446098b9957b\",\"details\":\"An account removed its vote from an ongoing poll.\",\"params\":{\"pollIndex\":\"uint32 Index of the poll.\",\"trackId\":\"uint32 TrackId of the poll.\",\"voter\":\"address Address of the voter.\"}},\"VoteRemovedOther(uint32,address,address,uint16)\":{\"custom:selector\":\"c1d068675720ab00d0c8792a0cbc7e198c0d2202111f0280f039f2c09c50491b\",\"details\":\"An account removed a vote from a poll.\",\"params\":{\"caller\":\"address Address of the origin caller.\",\"pollIndex\":\"uint32 Index of the poll.\",\"target\":\"address Address of the address which's vote is being removed.\",\"trackId\":\"uint16 The trackId.\"}},\"VoteSplit(uint32,address,uint256,uint256)\":{\"custom:selector\":\"022787093a8aa26fe59d28969068711f73e0e78ae67d9359c71058b6a21f7ef0\",\"details\":\"An account made a split vote in a poll.\",\"params\":{\"aye\":\"uint256 Amount for aye vote.\",\"nay\":\"uint256 Amount for nay vote.\",\"pollIndex\":\"uint32 Index of the poll.\",\"voter\":\"address Address of the voter.\"}},\"VoteSplitAbstained(uint32,address,uint256,uint256,uint256)\":{\"custom:selector\":\"476e687ab5e38fc714552f3acc083d7d83ccaa12ea11dd5f3393478d158c6fd4\",\"details\":\"An account made a split abstain vote in a poll.\",\"params\":{\"abstain\":\"uint256 Amount for abstained.\",\"aye\":\"uint256 Amount for aye vote.\",\"nay\":\"uint256 Amount for nay vote.\",\"pollIndex\":\"uint32 Index of the poll.\",\"voter\":\"address Address of the voter.\"}},\"Voted(uint32,address,bool,uint256,uint8)\":{\"custom:selector\":\"3839f7832b2a6263aa1fd5040f37d10fd4f9e9c4a9ef07ec384cb1cef9fb4c0e\",\"details\":\"An account made a vote in a poll.\",\"params\":{\"aye\":\"bool Is it a vote for or against the poll.\",\"conviction\":\"uint8 Conviction of the vote.\",\"pollIndex\":\"uint32 Index of the poll.\",\"voteAmount\":\"uint256 Amount used to vote.\",\"voter\":\"address Address of the voter.\"}}},\"kind\":\"dev\",\"methods\":{\"delegate(uint16,address,uint8,uint256)\":{\"custom:selector\":\"681750e8\",\"details\":\"Delegate to a representative for the vote trackId\",\"params\":{\"amount\":\"delegated to representative for this vote trackId\",\"conviction\":\"The conviction multiplier\",\"representative\":\"The representative for the trackId\",\"trackId\":\"The trackId\"}},\"removeOtherVote(address,uint16,uint32)\":{\"params\":{\"pollIndex\":\"the poll index\",\"trackId\":\"The trackId\"}},\"removeVote(uint32)\":{\"custom:selector\":\"79cae220\",\"details\":\"Remove vote in poll\",\"params\":{\"pollIndex\":\"Index of the poll\"}},\"removeVoteForTrack(uint32,uint16)\":{\"custom:selector\":\"cc3aee1a\",\"details\":\"Remove vote in poll for track\",\"params\":{\"pollIndex\":\"Index of the poll\",\"trackId\":\"Id of the track\"}},\"undelegate(uint16)\":{\"custom:selector\":\"98be4094\",\"details\":\"Undelegate for the trackId\",\"params\":{\"trackId\":\"The trackId\"}},\"unlock(uint16,address)\":{\"custom:selector\":\"4259d98c\",\"details\":\"Unlock tokens locked for trackId\",\"params\":{\"target\":\"The target address\",\"trackId\":\"The trackId\"}},\"voteNo(uint32,uint256,uint8)\":{\"custom:selector\":\"cc600eba\",\"details\":\"Vote no in a poll.\",\"params\":{\"conviction\":\"Conviction multiplier for length of vote lock\",\"pollIndex\":\"Index of poll\",\"voteAmount\":\"Balance locked for vote\"}},\"voteSplit(uint32,uint256,uint256)\":{\"custom:selector\":\"dd6c52a4\",\"details\":\"Vote split in a poll.\",\"params\":{\"aye\":\"Balance locked for aye vote\",\"nay\":\"Balance locked for nay vote\",\"pollIndex\":\"Index of poll\"}},\"voteSplitAbstain(uint32,uint256,uint256,uint256)\":{\"custom:selector\":\"52004540\",\"details\":\"Vote split abstain in a poll.\",\"params\":{\"abstain\":\"Balance locked for abstain vote (support)\",\"aye\":\"Balance locked for aye vote\",\"nay\":\"Balance locked for nay vote\",\"pollIndex\":\"Index of poll\"}},\"voteYes(uint32,uint256,uint8)\":{\"custom:selector\":\"da9df518\",\"details\":\"Vote yes in a poll.\",\"params\":{\"conviction\":\"Conviction multiplier for length of vote lock\",\"pollIndex\":\"Index of poll\",\"voteAmount\":\"Balance locked for vote\"}}},\"title\":\"Pallet Conviction Voting InterfaceThe interface through which solidity contracts will interact with the Conviction Voting pallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"ConvictionVoting\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0x792ed63d767cc168bd810adbc54f89958d6cfed6ce92c7adcfea5567c31c8f89\",\"license\":\"GPL-3.0-only\",\"urls\":[\"bzz-raw://26c0a267d2e4516b9f21ea61cb70809a1518eac5e0e40452c16fa98d5779f905\",\"dweb:/ipfs/QmfWBRAAZxwzTSzVhpGxo3oG83tRaHkkqkv5tjGjMU7zk1\"]}},\"version\":1}", + "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"delegatedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"conviction\",\"type\":\"uint8\"}],\"name\":\"Delegated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Undelegated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unlocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"VoteRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"VoteRemovedForTrack\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"}],\"name\":\"VoteRemovedOther\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"aye\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nay\",\"type\":\"uint256\"}],\"name\":\"VoteSplit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"aye\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nay\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"abstain\",\"type\":\"uint256\"}],\"name\":\"VoteSplitAbstained\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"aye\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"conviction\",\"type\":\"uint8\"}],\"name\":\"Voted\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"who\",\"type\":\"address\"}],\"name\":\"classLocksFor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"representative\",\"type\":\"address\"},{\"internalType\":\"enum ConvictionVoting.Conviction\",\"name\":\"conviction\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"}],\"name\":\"removeOtherVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"}],\"name\":\"removeVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"}],\"name\":\"removeVoteForTrack\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"}],\"name\":\"undelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"unlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"voteAmount\",\"type\":\"uint256\"},{\"internalType\":\"enum ConvictionVoting.Conviction\",\"name\":\"conviction\",\"type\":\"uint8\"}],\"name\":\"voteNo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"aye\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nay\",\"type\":\"uint256\"}],\"name\":\"voteSplit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"aye\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nay\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"abstain\",\"type\":\"uint256\"}],\"name\":\"voteSplitAbstain\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"pollIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"voteAmount\",\"type\":\"uint256\"},{\"internalType\":\"enum ConvictionVoting.Conviction\",\"name\":\"conviction\",\"type\":\"uint8\"}],\"name\":\"voteYes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"who\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"}],\"name\":\"votingFor\",\"outputs\":[{\"components\":[{\"internalType\":\"uint16\",\"name\":\"trackId\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"struct ConvictionVoting.ClassLock[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"The Moonbeam Team\",\"custom:address\":\"0x0000000000000000000000000000000000000812\",\"events\":{\"Delegated(uint16,address,address,uint256,uint8)\":{\"custom:selector\":\"6cc151d547592e227b1e85a264ac3699c6f1014112b08bb3832de1f23b9c66db\",\"details\":\"An account delegated for the given trackId.\",\"params\":{\"conviction\":\"uint8 Conviction being delegated.\",\"delegatedAmount\":\"uint256 Amount being delegated.\",\"from\":\"address Address of the caller.\",\"to\":\"address Address of the representative.\",\"trackId\":\"uint16 The trackId.\"}},\"Undelegated(uint16,address)\":{\"custom:selector\":\"1053303328f6db14014ccced6297bcad2b3897157ce46070711ab995a05dfa14\",\"details\":\"An account undelegated for the given trackId.\",\"params\":{\"caller\":\"address Address of the caller.\",\"trackId\":\"uint16 The trackId.\"}},\"Unlocked(uint16,address)\":{\"custom:selector\":\"dcf72fa65ca7fb720b9ccc8ee28e0188edc3d943115124cdd4086c49f836a128\",\"details\":\"An account called to unlock tokens for the given trackId.\",\"params\":{\"caller\":\"address Address of the caller.\",\"trackId\":\"uint16 The trackId.\"}},\"VoteRemoved(uint32,address)\":{\"custom:selector\":\"49fc1dd929f126e1d88cbb9c135625e30c2deba291adeea4740e446098b9957b\",\"details\":\"An account removed its vote from an ongoing poll.\",\"params\":{\"pollIndex\":\"uint32 Index of the poll.\",\"voter\":\"address Address of the voter.\"}},\"VoteRemovedForTrack(uint32,uint16,address)\":{\"custom:selector\":\"49fc1dd929f126e1d88cbb9c135625e30c2deba291adeea4740e446098b9957b\",\"details\":\"An account removed its vote from an ongoing poll.\",\"params\":{\"pollIndex\":\"uint32 Index of the poll.\",\"trackId\":\"uint32 TrackId of the poll.\",\"voter\":\"address Address of the voter.\"}},\"VoteRemovedOther(uint32,address,address,uint16)\":{\"custom:selector\":\"c1d068675720ab00d0c8792a0cbc7e198c0d2202111f0280f039f2c09c50491b\",\"details\":\"An account removed a vote from a poll.\",\"params\":{\"caller\":\"address Address of the origin caller.\",\"pollIndex\":\"uint32 Index of the poll.\",\"target\":\"address Address of the address which's vote is being removed.\",\"trackId\":\"uint16 The trackId.\"}},\"VoteSplit(uint32,address,uint256,uint256)\":{\"custom:selector\":\"022787093a8aa26fe59d28969068711f73e0e78ae67d9359c71058b6a21f7ef0\",\"details\":\"An account made a split vote in a poll.\",\"params\":{\"aye\":\"uint256 Amount for aye vote.\",\"nay\":\"uint256 Amount for nay vote.\",\"pollIndex\":\"uint32 Index of the poll.\",\"voter\":\"address Address of the voter.\"}},\"VoteSplitAbstained(uint32,address,uint256,uint256,uint256)\":{\"custom:selector\":\"476e687ab5e38fc714552f3acc083d7d83ccaa12ea11dd5f3393478d158c6fd4\",\"details\":\"An account made a split abstain vote in a poll.\",\"params\":{\"abstain\":\"uint256 Amount for abstained.\",\"aye\":\"uint256 Amount for aye vote.\",\"nay\":\"uint256 Amount for nay vote.\",\"pollIndex\":\"uint32 Index of the poll.\",\"voter\":\"address Address of the voter.\"}},\"Voted(uint32,address,bool,uint256,uint8)\":{\"custom:selector\":\"3839f7832b2a6263aa1fd5040f37d10fd4f9e9c4a9ef07ec384cb1cef9fb4c0e\",\"details\":\"An account made a vote in a poll.\",\"params\":{\"aye\":\"bool Is it a vote for or against the poll.\",\"conviction\":\"uint8 Conviction of the vote.\",\"pollIndex\":\"uint32 Index of the poll.\",\"voteAmount\":\"uint256 Amount used to vote.\",\"voter\":\"address Address of the voter.\"}}},\"kind\":\"dev\",\"methods\":{\"classLocksFor(address)\":{\"custom:selector\":\"7ae8ac92\",\"details\":\"Retrieve class locks for a given account.\",\"params\":{\"who\":\"The requested account\"}},\"delegate(uint16,address,uint8,uint256)\":{\"custom:selector\":\"681750e8\",\"details\":\"Delegate to a representative for the vote trackId\",\"params\":{\"amount\":\"delegated to representative for this vote trackId\",\"conviction\":\"The conviction multiplier\",\"representative\":\"The representative for the trackId\",\"trackId\":\"The trackId\"}},\"removeOtherVote(address,uint16,uint32)\":{\"params\":{\"pollIndex\":\"the poll index\",\"trackId\":\"The trackId\"}},\"removeVote(uint32)\":{\"custom:selector\":\"79cae220\",\"details\":\"Remove vote in poll\",\"params\":{\"pollIndex\":\"Index of the poll\"}},\"removeVoteForTrack(uint32,uint16)\":{\"custom:selector\":\"cc3aee1a\",\"details\":\"Remove vote in poll for track\",\"params\":{\"pollIndex\":\"Index of the poll\",\"trackId\":\"Id of the track\"}},\"undelegate(uint16)\":{\"custom:selector\":\"98be4094\",\"details\":\"Undelegate for the trackId\",\"params\":{\"trackId\":\"The trackId\"}},\"unlock(uint16,address)\":{\"custom:selector\":\"4259d98c\",\"details\":\"Unlock tokens locked for trackId\",\"params\":{\"target\":\"The target address\",\"trackId\":\"The trackId\"}},\"voteNo(uint32,uint256,uint8)\":{\"custom:selector\":\"cc600eba\",\"details\":\"Vote no in a poll.\",\"params\":{\"conviction\":\"Conviction multiplier for length of vote lock\",\"pollIndex\":\"Index of poll\",\"voteAmount\":\"Balance locked for vote\"}},\"voteSplit(uint32,uint256,uint256)\":{\"custom:selector\":\"dd6c52a4\",\"details\":\"Vote split in a poll.\",\"params\":{\"aye\":\"Balance locked for aye vote\",\"nay\":\"Balance locked for nay vote\",\"pollIndex\":\"Index of poll\"}},\"voteSplitAbstain(uint32,uint256,uint256,uint256)\":{\"custom:selector\":\"52004540\",\"details\":\"Vote split abstain in a poll.\",\"params\":{\"abstain\":\"Balance locked for abstain vote (support)\",\"aye\":\"Balance locked for aye vote\",\"nay\":\"Balance locked for nay vote\",\"pollIndex\":\"Index of poll\"}},\"voteYes(uint32,uint256,uint8)\":{\"custom:selector\":\"da9df518\",\"details\":\"Vote yes in a poll.\",\"params\":{\"conviction\":\"Conviction multiplier for length of vote lock\",\"pollIndex\":\"Index of poll\",\"voteAmount\":\"Balance locked for vote\"}},\"votingFor(address,uint16)\":{\"custom:selector\":\"501447ee\",\"details\":\"Retrieve votings for a given account and track.\",\"params\":{\"trackId\":\"The requested track\",\"who\":\"The requested account\"}}},\"title\":\"Pallet Conviction Voting InterfaceThe interface through which solidity contracts will interact with the Conviction Voting pallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"main.sol\":\"ConvictionVoting\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0x2add8014a077a91b84a4887f719d0c9745dcf3c6f457514bc869aa42489d3731\",\"license\":\"GPL-3.0-only\",\"urls\":[\"bzz-raw://8f6271e73b96e4f16028d45b4f95386915cd9ea9b85216d5eb71f1c947b3a2aa\",\"dweb:/ipfs/QmU24F6MjfNZHxXmghH7ghqo4MrRPuv6FFmkHx3kH7AjFW\"]}},\"version\":1}", "storageLayout": { "storage": [], "types": null }, "userdoc": { "kind": "user", "methods": {}, "version": 1 } }, - "sourceCode": "// SPDX-License-Identifier: GPL-3.0-only\npragma solidity >=0.8.3;\n\n/// @dev The Conviction Voting contract's address.\naddress constant CONVICTION_VOTING_ADDRESS = 0x0000000000000000000000000000000000000812;\n\n/// @dev The Conviction Voting contract's instance.\nConvictionVoting constant CONVICTION_VOTING_CONTRACT = ConvictionVoting(\n CONVICTION_VOTING_ADDRESS\n);\n\n/// @author The Moonbeam Team\n/// @title Pallet Conviction Voting Interface\n/// @title The interface through which solidity contracts will interact with the Conviction Voting pallet\n/// @custom:address 0x0000000000000000000000000000000000000812\ninterface ConvictionVoting {\n /// @dev Defines the conviction multiplier type.\n /// The values start at `0` and are represented as `uint8`.\n /// None => 0.1x votes, unlocked.\n /// Locked1x => 1x votes, locked for an enactment period following a successful vote.\n /// Locked2x => 2x votes, locked for 2x enactment periods following a successful vote\n /// Locked3x => 3x votes, locked for 4x...\n /// Locked4x => 4x votes, locked for 8x...,\n /// Locked5x => 5x votes, locked for 16x...\n /// Locked6x => 6x votes, locked for 32x...\n enum Conviction {\n None,\n Locked1x,\n Locked2x,\n Locked3x,\n Locked4x,\n Locked5x,\n Locked6x\n }\n\n /// @dev Vote yes in a poll.\n /// @custom:selector da9df518\n /// @param pollIndex Index of poll\n /// @param voteAmount Balance locked for vote\n /// @param conviction Conviction multiplier for length of vote lock\n function voteYes(\n uint32 pollIndex,\n uint256 voteAmount,\n Conviction conviction\n ) external;\n\n /// @dev Vote no in a poll.\n /// @custom:selector cc600eba\n /// @param pollIndex Index of poll\n /// @param voteAmount Balance locked for vote\n /// @param conviction Conviction multiplier for length of vote lock\n function voteNo(\n uint32 pollIndex,\n uint256 voteAmount,\n Conviction conviction\n ) external;\n\n /// @dev Vote split in a poll.\n /// @custom:selector dd6c52a4\n /// @param pollIndex Index of poll\n /// @param aye Balance locked for aye vote\n /// @param nay Balance locked for nay vote\n function voteSplit(uint32 pollIndex, uint256 aye, uint256 nay) external;\n\n /// @dev Vote split abstain in a poll.\n /// @custom:selector 52004540\n /// @param pollIndex Index of poll\n /// @param aye Balance locked for aye vote\n /// @param nay Balance locked for nay vote\n /// @param abstain Balance locked for abstain vote (support)\n function voteSplitAbstain(\n uint32 pollIndex,\n uint256 aye,\n uint256 nay,\n uint256 abstain\n ) external;\n\n /// @dev Remove vote in poll\n /// @custom:selector 79cae220\n /// @param pollIndex Index of the poll\n function removeVote(uint32 pollIndex) external;\n\n /// @dev Remove vote in poll for track\n /// @custom:selector cc3aee1a\n /// @param pollIndex Index of the poll\n /// @param trackId Id of the track\n function removeVoteForTrack(uint32 pollIndex, uint16 trackId) external;\n\n /// @dev Remove vote in poll for other voter\n /// @custom:selector cbcb9276\n //// @param target The voter to have vote removed. The removed vote must already be expired.\n /// @param trackId The trackId\n /// @param pollIndex the poll index\n function removeOtherVote(\n address target,\n uint16 trackId,\n uint32 pollIndex\n ) external;\n\n /// @dev Delegate to a representative for the vote trackId\n /// @custom:selector 681750e8\n /// @param trackId The trackId\n /// @param representative The representative for the trackId\n /// @param conviction The conviction multiplier\n /// @param amount delegated to representative for this vote trackId\n function delegate(\n uint16 trackId,\n address representative,\n Conviction conviction,\n uint256 amount\n ) external;\n\n /// @dev Undelegate for the trackId\n /// @custom:selector 98be4094\n /// @param trackId The trackId\n function undelegate(uint16 trackId) external;\n\n /// @dev Unlock tokens locked for trackId\n /// @custom:selector 4259d98c\n /// @param trackId The trackId\n /// @param target The target address\n function unlock(uint16 trackId, address target) external;\n\n /// @dev An account made a vote in a poll.\n /// @custom:selector 3839f7832b2a6263aa1fd5040f37d10fd4f9e9c4a9ef07ec384cb1cef9fb4c0e\n /// @param pollIndex uint32 Index of the poll.\n /// @param voter address Address of the voter.\n /// @param aye bool Is it a vote for or against the poll.\n /// @param voteAmount uint256 Amount used to vote.\n /// @param conviction uint8 Conviction of the vote.\n event Voted(\n uint32 indexed pollIndex,\n address voter,\n bool aye,\n uint256 voteAmount,\n uint8 conviction\n );\n\n /// @dev An account made a split vote in a poll.\n /// @custom:selector 022787093a8aa26fe59d28969068711f73e0e78ae67d9359c71058b6a21f7ef0\n /// @param pollIndex uint32 Index of the poll.\n /// @param voter address Address of the voter.\n /// @param aye uint256 Amount for aye vote.\n /// @param nay uint256 Amount for nay vote.\n event VoteSplit(\n uint32 indexed pollIndex,\n address voter,\n uint256 aye,\n uint256 nay\n );\n\n /// @dev An account made a split abstain vote in a poll.\n /// @custom:selector 476e687ab5e38fc714552f3acc083d7d83ccaa12ea11dd5f3393478d158c6fd4\n /// @param pollIndex uint32 Index of the poll.\n /// @param voter address Address of the voter.\n /// @param aye uint256 Amount for aye vote.\n /// @param nay uint256 Amount for nay vote.\n /// @param abstain uint256 Amount for abstained.\n event VoteSplitAbstained(\n uint32 indexed pollIndex,\n address voter,\n uint256 aye,\n uint256 nay,\n uint256 abstain\n );\n\n /// @dev An account removed its vote from an ongoing poll.\n /// @custom:selector 49fc1dd929f126e1d88cbb9c135625e30c2deba291adeea4740e446098b9957b\n /// @param pollIndex uint32 Index of the poll.\n /// @param voter address Address of the voter.\n event VoteRemoved(uint32 indexed pollIndex, address voter);\n\n /// @dev An account removed its vote from an ongoing poll.\n /// @custom:selector 49fc1dd929f126e1d88cbb9c135625e30c2deba291adeea4740e446098b9957b\n /// @param pollIndex uint32 Index of the poll.\n /// @param trackId uint32 TrackId of the poll.\n /// @param voter address Address of the voter.\n event VoteRemovedForTrack(\n uint32 indexed pollIndex,\n uint16 trackId,\n address voter\n );\n\n /// @dev An account removed a vote from a poll.\n /// @custom:selector c1d068675720ab00d0c8792a0cbc7e198c0d2202111f0280f039f2c09c50491b\n /// @param pollIndex uint32 Index of the poll.\n /// @param caller address Address of the origin caller.\n /// @param target address Address of the address which's vote is being removed.\n /// @param trackId uint16 The trackId.\n event VoteRemovedOther(\n uint32 indexed pollIndex,\n address caller,\n address target,\n uint16 trackId\n );\n\n /// @dev An account delegated for the given trackId.\n /// @custom:selector 6cc151d547592e227b1e85a264ac3699c6f1014112b08bb3832de1f23b9c66db\n /// @param trackId uint16 The trackId.\n /// @param from address Address of the caller.\n /// @param to address Address of the representative.\n /// @param delegatedAmount uint256 Amount being delegated.\n /// @param conviction uint8 Conviction being delegated.\n event Delegated(\n uint16 indexed trackId,\n address from,\n address to,\n uint256 delegatedAmount,\n uint8 conviction\n );\n\n /// @dev An account undelegated for the given trackId.\n /// @custom:selector 1053303328f6db14014ccced6297bcad2b3897157ce46070711ab995a05dfa14\n /// @param trackId uint16 The trackId.\n /// @param caller address Address of the caller.\n event Undelegated(uint16 indexed trackId, address caller);\n\n /// @dev An account called to unlock tokens for the given trackId.\n /// @custom:selector dcf72fa65ca7fb720b9ccc8ee28e0188edc3d943115124cdd4086c49f836a128\n /// @param trackId uint16 The trackId.\n /// @param caller address Address of the caller.\n event Unlocked(uint16 indexed trackId, address caller);\n}\n" + "sourceCode": "// SPDX-License-Identifier: GPL-3.0-only\npragma solidity >=0.8.3;\n\n/// @dev The Conviction Voting contract's address.\naddress constant CONVICTION_VOTING_ADDRESS = 0x0000000000000000000000000000000000000812;\n\n/// @dev The Conviction Voting contract's instance.\nConvictionVoting constant CONVICTION_VOTING_CONTRACT = ConvictionVoting(\n CONVICTION_VOTING_ADDRESS\n);\n\n/// @author The Moonbeam Team\n/// @title Pallet Conviction Voting Interface\n/// @title The interface through which solidity contracts will interact with the Conviction Voting pallet\n/// @custom:address 0x0000000000000000000000000000000000000812\ninterface ConvictionVoting {\n /// @dev Defines the conviction multiplier type.\n /// The values start at `0` and are represented as `uint8`.\n /// None => 0.1x votes, unlocked.\n /// Locked1x => 1x votes, locked for an enactment period following a successful vote.\n /// Locked2x => 2x votes, locked for 2x enactment periods following a successful vote\n /// Locked3x => 3x votes, locked for 4x...\n /// Locked4x => 4x votes, locked for 8x...,\n /// Locked5x => 5x votes, locked for 16x...\n /// Locked6x => 6x votes, locked for 32x...\n enum Conviction {\n None,\n Locked1x,\n Locked2x,\n Locked3x,\n Locked4x,\n Locked5x,\n Locked6x\n }\n\n /// @dev Defines the class lock for an account.\n struct ClassLock {\n /// The track of this lock.\n uint16 trackId;\n /// The amount locked.\n uint256 amount;\n }\n\n /// @dev Defines the voting information for an account and track,\n struct VotingFor {\n /// If the voting type is `Casting`, if `true` then `casting` field is significant.\n bool isCasting;\n /// If the voting type is `Delegating`, if `true` then `delegating` field is significant.\n bool isDelegating;\n /// Defines the voting information when `isCasting` is true.\n Casting casting;\n /// Defines the voting information when `isDelegating` is true.\n Delegating delegating;\n }\n\n /// @dev Defines the casting vote type from an account.\n struct Casting {\n /// The votes registered.\n PollAccountVote[] votes;\n /// The delegation info.\n Delegations delegations;\n /// Any prior lock information.\n PriorLock prior;\n }\n\n /// @dev Defines the delegating vote type from an account.\n struct Delegating {\n /// The delegated balance.\n uint256 balance;\n /// The deletegate account\n address target;\n /// The conviction type for the vote.\n Conviction conviction;\n /// The delegation info.\n Delegations delegations;\n /// Any prior lock information.\n PriorLock prior;\n }\n\n /// @dev Defines the vote towards a poll from an account.\n struct PollAccountVote {\n /// The index of the poll.\n uint32 pollIndex;\n /// The vote registered for the poll from an account.\n AccountVote accountVote;\n }\n\n /// @dev Defines the vote from an account.\n struct AccountVote {\n /// If `true` then the vote is a Standard vote and `standard` field is significant.\n bool isStandard;\n /// If `true` then the vote is a Split vote and `split` field is significant.\n bool isSplit;\n /// If `true` then the vote is a SplitAbstrain vote and `splitAbstain` field is significant.\n bool isSplitAbstain;\n /// Defines the standard vote, if `isStandard` is `true`.\n StandardVote standard;\n /// Defines the split vote, if `isSplit` is `true`.\n SplitVote split;\n /// Defines the split-abstain vote, if `isSplitAbstrain` is `true`.\n SplitAbstainVote splitAbstain;\n }\n\n /// @dev Defines the standard vote.\n struct StandardVote {\n /// The vote information.\n Vote vote;\n /// The locked balance for the vote.\n uint256 balance;\n }\n\n /// @dev Defines the vote parameters for a standard vote.\n struct Vote {\n /// `true` if the vote is an aye.\n bool aye;\n /// The conviction type for the vote.\n Conviction conviction;\n }\n\n /// @dev Defines the standard vote.\n struct SplitVote {\n /// The amount locked towards aye.\n uint256 aye;\n /// The amount locked towards nay.\n uint256 nay;\n }\n\n /// @dev Defines the standard vote.\n struct SplitAbstainVote {\n /// The amount locked towards aye.\n uint256 aye;\n /// The amount locked towards nay.\n uint256 nay;\n /// The amount locked towards abstain.\n uint256 abstain;\n }\n\n /// @dev Defines the delegations for a vote.\n struct Delegations {\n /// Total number of votes.\n uint256 votes;\n /// Total capital locked.\n uint256 capital;\n }\n\n /// @dev Defines any prior lock for a vote.\n struct PriorLock {\n /// Amount of balance locked.\n uint256 balance;\n }\n\n /// @dev Retrieve votings for a given account and track.\n /// @custom:selector 501447ee\n /// @param who The requested account\n /// @param trackId The requested track\n function votingFor(\n address who,\n uint16 trackId\n ) external view returns (ClassLock[] memory);\n\n /// @dev Retrieve class locks for a given account.\n /// @custom:selector 7ae8ac92\n /// @param who The requested account\n function classLocksFor(address who) external view returns (uint256);\n\n /// @dev Vote yes in a poll.\n /// @custom:selector da9df518\n /// @param pollIndex Index of poll\n /// @param voteAmount Balance locked for vote\n /// @param conviction Conviction multiplier for length of vote lock\n function voteYes(\n uint32 pollIndex,\n uint256 voteAmount,\n Conviction conviction\n ) external;\n\n /// @dev Vote no in a poll.\n /// @custom:selector cc600eba\n /// @param pollIndex Index of poll\n /// @param voteAmount Balance locked for vote\n /// @param conviction Conviction multiplier for length of vote lock\n function voteNo(\n uint32 pollIndex,\n uint256 voteAmount,\n Conviction conviction\n ) external;\n\n /// @dev Vote split in a poll.\n /// @custom:selector dd6c52a4\n /// @param pollIndex Index of poll\n /// @param aye Balance locked for aye vote\n /// @param nay Balance locked for nay vote\n function voteSplit(uint32 pollIndex, uint256 aye, uint256 nay) external;\n\n /// @dev Vote split abstain in a poll.\n /// @custom:selector 52004540\n /// @param pollIndex Index of poll\n /// @param aye Balance locked for aye vote\n /// @param nay Balance locked for nay vote\n /// @param abstain Balance locked for abstain vote (support)\n function voteSplitAbstain(\n uint32 pollIndex,\n uint256 aye,\n uint256 nay,\n uint256 abstain\n ) external;\n\n /// @dev Remove vote in poll\n /// @custom:selector 79cae220\n /// @param pollIndex Index of the poll\n function removeVote(uint32 pollIndex) external;\n\n /// @dev Remove vote in poll for track\n /// @custom:selector cc3aee1a\n /// @param pollIndex Index of the poll\n /// @param trackId Id of the track\n function removeVoteForTrack(uint32 pollIndex, uint16 trackId) external;\n\n /// @dev Remove vote in poll for other voter\n /// @custom:selector cbcb9276\n //// @param target The voter to have vote removed. The removed vote must already be expired.\n /// @param trackId The trackId\n /// @param pollIndex the poll index\n function removeOtherVote(\n address target,\n uint16 trackId,\n uint32 pollIndex\n ) external;\n\n /// @dev Delegate to a representative for the vote trackId\n /// @custom:selector 681750e8\n /// @param trackId The trackId\n /// @param representative The representative for the trackId\n /// @param conviction The conviction multiplier\n /// @param amount delegated to representative for this vote trackId\n function delegate(\n uint16 trackId,\n address representative,\n Conviction conviction,\n uint256 amount\n ) external;\n\n /// @dev Undelegate for the trackId\n /// @custom:selector 98be4094\n /// @param trackId The trackId\n function undelegate(uint16 trackId) external;\n\n /// @dev Unlock tokens locked for trackId\n /// @custom:selector 4259d98c\n /// @param trackId The trackId\n /// @param target The target address\n function unlock(uint16 trackId, address target) external;\n\n /// @dev An account made a vote in a poll.\n /// @custom:selector 3839f7832b2a6263aa1fd5040f37d10fd4f9e9c4a9ef07ec384cb1cef9fb4c0e\n /// @param pollIndex uint32 Index of the poll.\n /// @param voter address Address of the voter.\n /// @param aye bool Is it a vote for or against the poll.\n /// @param voteAmount uint256 Amount used to vote.\n /// @param conviction uint8 Conviction of the vote.\n event Voted(\n uint32 indexed pollIndex,\n address voter,\n bool aye,\n uint256 voteAmount,\n uint8 conviction\n );\n\n /// @dev An account made a split vote in a poll.\n /// @custom:selector 022787093a8aa26fe59d28969068711f73e0e78ae67d9359c71058b6a21f7ef0\n /// @param pollIndex uint32 Index of the poll.\n /// @param voter address Address of the voter.\n /// @param aye uint256 Amount for aye vote.\n /// @param nay uint256 Amount for nay vote.\n event VoteSplit(\n uint32 indexed pollIndex,\n address voter,\n uint256 aye,\n uint256 nay\n );\n\n /// @dev An account made a split abstain vote in a poll.\n /// @custom:selector 476e687ab5e38fc714552f3acc083d7d83ccaa12ea11dd5f3393478d158c6fd4\n /// @param pollIndex uint32 Index of the poll.\n /// @param voter address Address of the voter.\n /// @param aye uint256 Amount for aye vote.\n /// @param nay uint256 Amount for nay vote.\n /// @param abstain uint256 Amount for abstained.\n event VoteSplitAbstained(\n uint32 indexed pollIndex,\n address voter,\n uint256 aye,\n uint256 nay,\n uint256 abstain\n );\n\n /// @dev An account removed its vote from an ongoing poll.\n /// @custom:selector 49fc1dd929f126e1d88cbb9c135625e30c2deba291adeea4740e446098b9957b\n /// @param pollIndex uint32 Index of the poll.\n /// @param voter address Address of the voter.\n event VoteRemoved(uint32 indexed pollIndex, address voter);\n\n /// @dev An account removed its vote from an ongoing poll.\n /// @custom:selector 49fc1dd929f126e1d88cbb9c135625e30c2deba291adeea4740e446098b9957b\n /// @param pollIndex uint32 Index of the poll.\n /// @param trackId uint32 TrackId of the poll.\n /// @param voter address Address of the voter.\n event VoteRemovedForTrack(\n uint32 indexed pollIndex,\n uint16 trackId,\n address voter\n );\n\n /// @dev An account removed a vote from a poll.\n /// @custom:selector c1d068675720ab00d0c8792a0cbc7e198c0d2202111f0280f039f2c09c50491b\n /// @param pollIndex uint32 Index of the poll.\n /// @param caller address Address of the origin caller.\n /// @param target address Address of the address which's vote is being removed.\n /// @param trackId uint16 The trackId.\n event VoteRemovedOther(\n uint32 indexed pollIndex,\n address caller,\n address target,\n uint16 trackId\n );\n\n /// @dev An account delegated for the given trackId.\n /// @custom:selector 6cc151d547592e227b1e85a264ac3699c6f1014112b08bb3832de1f23b9c66db\n /// @param trackId uint16 The trackId.\n /// @param from address Address of the caller.\n /// @param to address Address of the representative.\n /// @param delegatedAmount uint256 Amount being delegated.\n /// @param conviction uint8 Conviction being delegated.\n event Delegated(\n uint16 indexed trackId,\n address from,\n address to,\n uint256 delegatedAmount,\n uint8 conviction\n );\n\n /// @dev An account undelegated for the given trackId.\n /// @custom:selector 1053303328f6db14014ccced6297bcad2b3897157ce46070711ab995a05dfa14\n /// @param trackId uint16 The trackId.\n /// @param caller address Address of the caller.\n event Undelegated(uint16 indexed trackId, address caller);\n\n /// @dev An account called to unlock tokens for the given trackId.\n /// @custom:selector dcf72fa65ca7fb720b9ccc8ee28e0188edc3d943115124cdd4086c49f836a128\n /// @param trackId uint16 The trackId.\n /// @param caller address Address of the caller.\n event Unlocked(uint16 indexed trackId, address caller);\n}\n" }