Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose VotingFor and ClassLocksFor in ConvictionVoting precompile #2220

Merged
merged 6 commits into from Apr 12, 2023

Conversation

nbaztec
Copy link
Contributor

@nbaztec nbaztec commented Apr 12, 2023

What does it do?

expose VotingFor and ClassLocksFor data in precompile

@nbaztec nbaztec added B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D9-needsaudit👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited not-breaking Does not need to be mentioned in breaking changes labels Apr 12, 2023
@librelois librelois mentioned this pull request Apr 12, 2023
20 tasks
}
},
"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.17+commit.8df45f5f\"},\"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\":\"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\":\"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.\"}},\"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\"}},\"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\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"main.sol\":{\"keccak256\":\"0x0d6f117e5e73047989b58590df44bc74dc08576c9a75bbf174d3a1eca0d392ce\",\"license\":\"GPL-3.0-only\",\"urls\":[\"bzz-raw://81142d09769a9d06674d0a4aa7c9f894a3a183aea18d28cf3fa5a166dd0501eb\",\"dweb:/ipfs/QmXZj52xsvJsRmwzAK9MH9rsBAGHtWJ9t1J4oJZiUe5GYu\"]}},\"version\":1}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the same compiler:
rm package-lock.json && npm ci && npm run pre-build-contracts

@nbaztec nbaztec requested a review from crystalin April 12, 2023 13:56
@nbaztec nbaztec merged commit 41bb241 into master Apr 12, 2023
20 checks passed
@nbaztec nbaztec deleted the nish-conviction-info branch April 12, 2023 15:59
@crystalin crystalin changed the title [MOON-2311] expose VotingFor and ClassLocksFor data in precompile Expose VotingFor and ClassLocksFor in ConvictionVoting precompile Apr 13, 2023
@notlesh notlesh added D1-audited👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited and removed D9-needsaudit👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited labels Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D1-audited👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited not-breaking Does not need to be mentioned in breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants