From 35467cbd10fa571ca387912db790d6134a1468d3 Mon Sep 17 00:00:00 2001 From: Anton Chaika Date: Mon, 4 Sep 2023 16:16:20 +0300 Subject: [PATCH] updated abis, fixed VoteChanged event in AllInteractions --- AllInteractions/abis/DaoPool.json | 106 +++--- AllInteractions/abis/DaoValidators.json | 154 +++++++- AllInteractions/abis/PoolFactory.json | 26 +- AllInteractions/schema.graphql | 4 +- .../dao-pool/DaoPoolProposalInteraction.ts | 8 +- AllInteractions/src/mappings/DaoPool.ts | 14 +- AllInteractions/subgraph.yaml | 4 +- AllInteractions/tests/DaoPool.test.ts | 77 +--- DaoPools/abis/DaoSettings.json | 54 +-- DaoPools/abis/DistributionProposal.json | 36 ++ DaoPools/abis/ERC721Expert.json | 32 ++ DaoPools/abis/PoolFactory.json | 26 +- DaoPools/abis/UserKeeper.json | 341 +++++++----------- DaoValidators/abis/DaoValidators.json | 1 - DaoValidators/abis/PoolFactory.json | 26 +- 15 files changed, 397 insertions(+), 512 deletions(-) diff --git a/AllInteractions/abis/DaoPool.json b/AllInteractions/abis/DaoPool.json index 60612b4c..fc7777c2 100644 --- a/AllInteractions/abis/DaoPool.json +++ b/AllInteractions/abis/DaoPool.json @@ -20,62 +20,14 @@ "name": "isVoteFor", "type": "bool" }, - { - "components": [ - { - "internalType": "uint256", - "name": "personal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "micropool", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "treasury", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct IGovPool.Votes", - "name": "votes", - "type": "tuple" - } - ], - "name": "VoteChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "rewardToken", - "type": "address" - }, { "indexed": false, "internalType": "uint256", - "name": "amount", + "name": "totalVoted", "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" } ], - "name": "RewardCanceled", + "name": "VoteChanged", "type": "event" }, { @@ -196,7 +148,13 @@ { "indexed": false, "internalType": "address", - "name": "user", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegatee", "type": "address" }, { @@ -212,7 +170,32 @@ "type": "uint256" } ], - "name": "MicropoolRewardClaimed", + "name": "DelegatorRewardsClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "DelegatorRewardsSet", "type": "event" }, { @@ -1192,12 +1175,7 @@ }, { "internalType": "uint256", - "name": "voteForRewardsCoefficient", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "voteAgainstRewardsCoefficient", + "name": "voteRewardsCoefficient", "type": "uint256" } ], @@ -1240,6 +1218,16 @@ "name": "votesAgainst", "type": "uint256" }, + { + "internalType": "uint256", + "name": "rawVotesFor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rawVotesAgainst", + "type": "uint256" + }, { "internalType": "uint256", "name": "nftPowerSnapshotId", @@ -1484,7 +1472,7 @@ }, { "internalType": "uint256", - "name": "powerVoted", + "name": "totalRawVoted", "type": "uint256" }, { diff --git a/AllInteractions/abis/DaoValidators.json b/AllInteractions/abis/DaoValidators.json index 456d0a37..41067054 100644 --- a/AllInteractions/abis/DaoValidators.json +++ b/AllInteractions/abis/DaoValidators.json @@ -119,6 +119,31 @@ "name": "OwnershipTransferred", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isInternal", + "type": "bool" + } + ], + "name": "VoteCanceled", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -222,6 +247,11 @@ "internalType": "address", "name": "", "type": "address" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" } ], "name": "addressVoted", @@ -235,6 +265,32 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "cancelVoteExternalProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "cancelVoteInternalProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -253,6 +309,29 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "duration", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "executionDelay", + "type": "uint64" + }, + { + "internalType": "uint128", + "name": "quorum", + "type": "uint128" + } + ], + "name": "changeSettings", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -301,14 +380,9 @@ "type": "string" }, { - "internalType": "uint256[]", - "name": "newValues", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "users", - "type": "address[]" + "internalType": "bytes", + "name": "data", + "type": "bytes" } ], "name": "createInternalProposal", @@ -324,7 +398,7 @@ "type": "uint256" } ], - "name": "execute", + "name": "executeExternalProposal", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -337,7 +411,7 @@ "type": "uint256" } ], - "name": "executeExternalProposal", + "name": "executeInternalProposal", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -477,14 +551,9 @@ "type": "string" }, { - "internalType": "uint256[]", - "name": "newValues", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "userAddresses", - "type": "address[]" + "internalType": "bytes", + "name": "data", + "type": "bytes" } ], "internalType": "struct IGovValidators.InternalProposal", @@ -626,6 +695,29 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "monthlyWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "owner", @@ -686,8 +778,26 @@ }, { "internalType": "bool", - "name": "isInternal", + "name": "isVoteFor", "type": "bool" + } + ], + "name": "voteExternalProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" }, { "internalType": "bool", @@ -695,9 +805,13 @@ "type": "bool" } ], - "name": "vote", + "name": "voteInternalProposal", "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" } ] \ No newline at end of file diff --git a/AllInteractions/abis/PoolFactory.json b/AllInteractions/abis/PoolFactory.json index 025785ee..1a83c0c6 100644 --- a/AllInteractions/abis/PoolFactory.json +++ b/AllInteractions/abis/PoolFactory.json @@ -1,23 +1,4 @@ [ - { - "inputs": [ - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - } - ], - "name": "predictTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "anonymous": false, "inputs": [ @@ -176,12 +157,7 @@ }, { "internalType": "uint256", - "name": "voteForRewardsCoefficient", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "voteAgainstRewardsCoefficient", + "name": "voteRewardsCoefficient", "type": "uint256" } ], diff --git a/AllInteractions/schema.graphql b/AllInteractions/schema.graphql index 131513b8..51ddcd81 100644 --- a/AllInteractions/schema.graphql +++ b/AllInteractions/schema.graphql @@ -78,9 +78,7 @@ type DaoPoolProposalInteraction @entity(immutable: true) { id: Bytes! # tx hash + interactionCount pool: Pool! - personalVote: BigInt! - micropoolVote: BigInt! - treasuryVote: BigInt! + totalVote: BigInt! interactionType: BigInt! diff --git a/AllInteractions/src/entities/dao-pool/DaoPoolProposalInteraction.ts b/AllInteractions/src/entities/dao-pool/DaoPoolProposalInteraction.ts index 4d17ef6a..823e8440 100644 --- a/AllInteractions/src/entities/dao-pool/DaoPoolProposalInteraction.ts +++ b/AllInteractions/src/entities/dao-pool/DaoPoolProposalInteraction.ts @@ -5,9 +5,7 @@ export function getDaoPoolProposalInteraction( hash: Bytes, pool: Address, interactionType: BigInt, - personal: BigInt, - micropool: BigInt, - treasury: BigInt, + totalVote: BigInt, count: BigInt ): DaoPoolProposalInteraction { let id = hash.concatI32(count.toI32()); @@ -18,9 +16,7 @@ export function getDaoPoolProposalInteraction( interaction.pool = pool; interaction.interactionType = interactionType; - interaction.personalVote = personal; - interaction.micropoolVote = micropool; - interaction.treasuryVote = treasury; + interaction.totalVote = totalVote; interaction.transaction = Bytes.empty(); } diff --git a/AllInteractions/src/mappings/DaoPool.ts b/AllInteractions/src/mappings/DaoPool.ts index 5978789b..44487637 100644 --- a/AllInteractions/src/mappings/DaoPool.ts +++ b/AllInteractions/src/mappings/DaoPool.ts @@ -91,11 +91,7 @@ export function onVoteChanged(event: VoteChanged): void { ? ProposalInteractionType.VOTE_FOR : ProposalInteractionType.VOTE_AGAINST; - if ( - isZero(event.params.votes.personal) && - isZero(event.params.votes.micropool) && - isZero(event.params.votes.treasury) - ) { + if (event.params.totalVoted.equals(BigInt.zero())) { txType = TransactionType.DAO_POOL_PROPOSAL_VOTE_CANCELED; interactionType = ProposalInteractionType.VOTE_CANCEL; } @@ -104,9 +100,7 @@ export function onVoteChanged(event: VoteChanged): void { event.transaction.hash, event.address, getProposalInteractionBigInt(interactionType), - event.params.votes.personal, - event.params.votes.micropool, - event.params.votes.treasury, + event.params.totalVoted, transaction.interactionsCount ); @@ -264,7 +258,3 @@ export function onOffchainResultsSaved(event: OffchainResultsSaved): void { transaction.save(); offchainResultsSaved.save(); } - -function isZero(val: BigInt): boolean { - return val.equals(BigInt.zero()); -} diff --git a/AllInteractions/subgraph.yaml b/AllInteractions/subgraph.yaml index 5f2fa28a..32ccde2c 100644 --- a/AllInteractions/subgraph.yaml +++ b/AllInteractions/subgraph.yaml @@ -67,14 +67,12 @@ templates: handler: onProposalCreated - event: Delegated(address,address,uint256,uint256[],bool) handler: onDelegated - - event: VoteChanged(uint256,address,bool,(uint256,uint256,uint256)) + - event: VoteChanged(uint256,address,bool,uint256) handler: onVoteChanged - event: ProposalExecuted(uint256,bool,address) handler: onProposalExecuted - event: RewardClaimed(uint256,address,address,uint256) handler: onRewardClaimed - - event: RewardCanceled(uint256,address,uint256,address) - handler: onRewardCanceled - event: Deposited(uint256,uint256[],address) handler: onDeposited - event: Withdrawn(uint256,uint256[],address) diff --git a/AllInteractions/tests/DaoPool.test.ts b/AllInteractions/tests/DaoPool.test.ts index 8df15950..76a146ae 100644 --- a/AllInteractions/tests/DaoPool.test.ts +++ b/AllInteractions/tests/DaoPool.test.ts @@ -9,7 +9,6 @@ import { ProposalCreated, ProposalExecuted, RewardClaimed, - RewardCanceled, VoteChanged, Withdrawn, } from "../generated/templates/DaoPool/DaoPool"; @@ -87,9 +86,7 @@ function createDelegated( function createVoteChanged( proposalId: BigInt, sender: Address, - personal: BigInt, - micropool: BigInt, - treasury: BigInt, + totalVoted: BigInt, isVoteFor: boolean, contractSender: Address, block: ethereum.Block, @@ -98,16 +95,10 @@ function createVoteChanged( let event = changetype(newMockEvent()); event.parameters = new Array(); - const votes = new ethereum.Tuple(3); - - votes[0] = ethereum.Value.fromUnsignedBigInt(personal); - votes[1] = ethereum.Value.fromUnsignedBigInt(micropool); - votes[2] = ethereum.Value.fromUnsignedBigInt(treasury); - event.parameters.push(new ethereum.EventParam("proposalId", ethereum.Value.fromUnsignedBigInt(proposalId))); event.parameters.push(new ethereum.EventParam("voter", ethereum.Value.fromAddress(sender))); event.parameters.push(new ethereum.EventParam("isVoteFor", ethereum.Value.fromBoolean(isVoteFor))); - event.parameters.push(new ethereum.EventParam("votes", ethereum.Value.fromTuple(votes))); + event.parameters.push(new ethereum.EventParam("totalVoted", ethereum.Value.fromUnsignedBigInt(totalVoted))); event.block = block; event.transaction = tx; @@ -332,22 +323,10 @@ describe("DaoPool", () => { test("should handle VoteChanged", () => { let proposalId = BigInt.fromI32(1); let sender = Address.fromString("0x86e08f7d84603AEb97cd1c89A80A9e914f181671"); - let personal = BigInt.fromI32(1000); - let micropool = BigInt.fromI32(1000); - let treasury = BigInt.fromI32(1000); + let totalVote = BigInt.fromI32(1000); let isVoteFor = true; - let event = createVoteChanged( - proposalId, - sender, - personal, - micropool, - treasury, - isVoteFor, - contractSender, - block, - tx - ); + let event = createVoteChanged(proposalId, sender, totalVote, isVoteFor, contractSender, block, tx); onVoteChanged(event); @@ -361,20 +340,8 @@ describe("DaoPool", () => { assert.fieldEquals( "DaoPoolProposalInteraction", tx.hash.concatI32(0).toHexString(), - "personalVote", - personal.toString() - ); - assert.fieldEquals( - "DaoPoolProposalInteraction", - tx.hash.concatI32(0).toHexString(), - "micropoolVote", - micropool.toString() - ); - assert.fieldEquals( - "DaoPoolProposalInteraction", - tx.hash.concatI32(0).toHexString(), - "treasuryVote", - treasury.toString() + "totalVote", + totalVote.toString() ); assert.fieldEquals( "DaoPoolProposalInteraction", @@ -396,22 +363,10 @@ describe("DaoPool", () => { test("should handle VoteChanged (cancel)", () => { let proposalId = BigInt.fromI32(1); let sender = Address.fromString("0x86e08f7d84603AEb97cd1c89A80A9e914f181671"); - let personal = BigInt.fromI32(0); - let micropool = BigInt.fromI32(0); - let treasury = BigInt.fromI32(0); + let totalVote = BigInt.fromI32(0); let isVoteFor = true; - let event = createVoteChanged( - proposalId, - sender, - personal, - micropool, - treasury, - isVoteFor, - contractSender, - block, - tx - ); + let event = createVoteChanged(proposalId, sender, totalVote, isVoteFor, contractSender, block, tx); onVoteChanged(event); @@ -425,20 +380,8 @@ describe("DaoPool", () => { assert.fieldEquals( "DaoPoolProposalInteraction", tx.hash.concatI32(0).toHexString(), - "personalVote", - personal.toString() - ); - assert.fieldEquals( - "DaoPoolProposalInteraction", - tx.hash.concatI32(0).toHexString(), - "micropoolVote", - micropool.toString() - ); - assert.fieldEquals( - "DaoPoolProposalInteraction", - tx.hash.concatI32(0).toHexString(), - "treasuryVote", - treasury.toString() + "totalVote", + totalVote.toString() ); assert.fieldEquals( "DaoPoolProposalInteraction", diff --git a/DaoPools/abis/DaoSettings.json b/DaoPools/abis/DaoSettings.json index aef9a558..7c32350f 100644 --- a/DaoPools/abis/DaoSettings.json +++ b/DaoPools/abis/DaoSettings.json @@ -76,11 +76,6 @@ "name": "govPoolAddress", "type": "address" }, - { - "internalType": "address", - "name": "distributionProposalAddress", - "type": "address" - }, { "internalType": "address", "name": "validatorsAddress", @@ -162,12 +157,7 @@ }, { "internalType": "uint256", - "name": "voteForRewardsCoefficient", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "voteAgainstRewardsCoefficient", + "name": "voteRewardsCoefficient", "type": "uint256" } ], @@ -269,12 +259,7 @@ }, { "internalType": "uint256", - "name": "voteForRewardsCoefficient", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "voteAgainstRewardsCoefficient", + "name": "voteRewardsCoefficient", "type": "uint256" } ], @@ -394,12 +379,7 @@ }, { "internalType": "uint256", - "name": "voteForRewardsCoefficient", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "voteAgainstRewardsCoefficient", + "name": "voteRewardsCoefficient", "type": "uint256" } ], @@ -517,12 +497,7 @@ }, { "internalType": "uint256", - "name": "voteForRewardsCoefficient", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "voteAgainstRewardsCoefficient", + "name": "voteRewardsCoefficient", "type": "uint256" } ], @@ -625,12 +600,7 @@ }, { "internalType": "uint256", - "name": "voteForRewardsCoefficient", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "voteAgainstRewardsCoefficient", + "name": "voteRewardsCoefficient", "type": "uint256" } ], @@ -727,12 +697,7 @@ }, { "internalType": "uint256", - "name": "voteForRewardsCoefficient", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "voteAgainstRewardsCoefficient", + "name": "voteRewardsCoefficient", "type": "uint256" } ], @@ -866,12 +831,7 @@ }, { "internalType": "uint256", - "name": "voteForRewardsCoefficient", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "voteAgainstRewardsCoefficient", + "name": "voteRewardsCoefficient", "type": "uint256" } ], diff --git a/DaoPools/abis/DistributionProposal.json b/DaoPools/abis/DistributionProposal.json index 1d2c260f..66f93db9 100644 --- a/DaoPools/abis/DistributionProposal.json +++ b/DaoPools/abis/DistributionProposal.json @@ -181,5 +181,41 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IGovPool.ProposalAction[]", + "name": "actions", + "type": "tuple[]" + } + ], + "name": "validate", + "outputs": [ + { + "internalType": "bool", + "name": "valid", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" } ] \ No newline at end of file diff --git a/DaoPools/abis/ERC721Expert.json b/DaoPools/abis/ERC721Expert.json index 29922e17..4cb339de 100644 --- a/DaoPools/abis/ERC721Expert.json +++ b/DaoPools/abis/ERC721Expert.json @@ -49,6 +49,25 @@ "name": "ApprovalForAll", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_fromTokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toTokenId", + "type": "uint256" + } + ], + "name": "BatchMetadataUpdate", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -93,6 +112,19 @@ "name": "Issued", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_tokenId", + "type": "uint256" + } + ], + "name": "MetadataUpdate", + "type": "event" + }, { "anonymous": false, "inputs": [ diff --git a/DaoPools/abis/PoolFactory.json b/DaoPools/abis/PoolFactory.json index 025785ee..1a83c0c6 100644 --- a/DaoPools/abis/PoolFactory.json +++ b/DaoPools/abis/PoolFactory.json @@ -1,23 +1,4 @@ [ - { - "inputs": [ - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - } - ], - "name": "predictTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "anonymous": false, "inputs": [ @@ -176,12 +157,7 @@ }, { "internalType": "uint256", - "name": "voteForRewardsCoefficient", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "voteAgainstRewardsCoefficient", + "name": "voteRewardsCoefficient", "type": "uint256" } ], diff --git a/DaoPools/abis/UserKeeper.json b/DaoPools/abis/UserKeeper.json index a7530c69..94b47331 100644 --- a/DaoPools/abis/UserKeeper.json +++ b/DaoPools/abis/UserKeeper.json @@ -93,9 +93,9 @@ "type": "address" }, { - "internalType": "bool", - "name": "useDelegated", - "type": "bool" + "internalType": "enum IGovPool.VoteType", + "name": "voteType", + "type": "uint8" }, { "internalType": "uint256", @@ -119,45 +119,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "voter", - "type": "address" - }, - { - "internalType": "bool", - "name": "isMicropool", - "type": "bool" - }, - { - "internalType": "bool", - "name": "useDelegated", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "requiredVotes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "snapshotId", - "type": "uint256" - } - ], - "name": "canVote", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "createNftPowerSnapshot", @@ -194,6 +155,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "nftIds", + "type": "uint256[]" + } + ], + "name": "delegateNftsTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -217,12 +196,35 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "delegateTokensTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { "internalType": "address", "name": "user", "type": "address" + }, + { + "internalType": "bool", + "name": "perNftPowerArray", + "type": "bool" } ], "name": "delegations", @@ -258,16 +260,6 @@ "internalType": "uint256[]", "name": "perNftPower", "type": "uint256[]" - }, - { - "internalType": "uint256", - "name": "requestedTokens", - "type": "uint256" - }, - { - "internalType": "uint256[]", - "name": "requestedNfts", - "type": "uint256[]" } ], "internalType": "struct IGovUserKeeper.DelegationInfoView[]", @@ -337,31 +329,17 @@ "type": "address" } ], - "name": "getDelegatedStakeAmount", + "name": "getDelegatedAssets", "outputs": [ { "internalType": "uint256", - "name": "", + "name": "tokenAmount", "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "delegator", - "type": "address" - } - ], - "name": "getDelegatees", - "outputs": [ + }, { - "internalType": "address[]", - "name": "", - "type": "address[]" + "internalType": "uint256[]", + "name": "nftIds", + "type": "uint256[]" } ], "stateMutability": "view", @@ -434,45 +412,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "delegatee", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "lockedProposals", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "unlockedNfts", - "type": "uint256[]" - } - ], - "name": "getUndelegateableAssets", - "outputs": [ - { - "internalType": "uint256", - "name": "undelegateableTokens", - "type": "uint256" - }, - { - "internalType": "uint256[]", - "name": "undelegateableNfts", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -515,14 +454,9 @@ "type": "address" }, { - "internalType": "bool", - "name": "isMicropool", - "type": "bool" - }, - { - "internalType": "bool", - "name": "useDelegated", - "type": "bool" + "internalType": "enum IGovPool.VoteType", + "name": "voteType", + "type": "uint8" }, { "internalType": "uint256[]", @@ -547,11 +481,6 @@ "name": "voter", "type": "address" }, - { - "internalType": "bool", - "name": "isMicropool", - "type": "bool" - }, { "internalType": "uint256", "name": "amount", @@ -569,11 +498,6 @@ "internalType": "address", "name": "voter", "type": "address" - }, - { - "internalType": "bool", - "name": "isMicropool", - "type": "bool" } ], "name": "maxLockedAmount", @@ -608,14 +532,9 @@ "type": "address" }, { - "internalType": "bool", - "name": "isMicropool", - "type": "bool" - }, - { - "internalType": "bool", - "name": "useDelegated", - "type": "bool" + "internalType": "enum IGovPool.VoteType", + "name": "voteType", + "type": "uint8" } ], "name": "nftBalance", @@ -642,14 +561,9 @@ "type": "address" }, { - "internalType": "bool", - "name": "isMicropool", - "type": "bool" - }, - { - "internalType": "bool", - "name": "useDelegated", - "type": "bool" + "internalType": "enum IGovPool.VoteType", + "name": "voteType", + "type": "uint8" } ], "name": "nftExactBalance", @@ -693,6 +607,11 @@ "internalType": "uint256[]", "name": "nftIds", "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "perNftPowerArray", + "type": "bool" } ], "name": "nftVotingPower", @@ -765,52 +684,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "delegatee", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "nftIds", - "type": "uint256[]" - } - ], - "name": "requestNfts", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "delegator", - "type": "address" - }, - { - "internalType": "address", - "name": "delegatee", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "requestTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -868,14 +741,9 @@ "type": "address" }, { - "internalType": "bool", - "name": "isMicropool", - "type": "bool" - }, - { - "internalType": "bool", - "name": "useDelegated", - "type": "bool" + "internalType": "enum IGovPool.VoteType", + "name": "voteType", + "type": "uint8" } ], "name": "tokenBalance", @@ -930,6 +798,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "nftIds", + "type": "uint256[]" + } + ], + "name": "undelegateNftsTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -953,6 +839,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "undelegateTokensTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -978,20 +882,14 @@ "name": "voter", "type": "address" }, - { - "internalType": "bool", - "name": "isMicropool", - "type": "bool" - } - ], - "name": "unlockTokens", - "outputs": [ { "internalType": "uint256", - "name": "unlockedAmount", + "name": "amount", "type": "uint256" } ], + "name": "unlockTokens", + "outputs": [], "stateMutability": "nonpayable", "type": "function" }, @@ -1006,11 +904,6 @@ "internalType": "address", "name": "voter", "type": "address" - }, - { - "internalType": "bool", - "name": "isMicropool", - "type": "bool" } ], "name": "updateMaxTokenLockedAmount", @@ -1039,14 +932,14 @@ "type": "address[]" }, { - "internalType": "bool[]", - "name": "isMicropools", - "type": "bool[]" + "internalType": "enum IGovPool.VoteType[]", + "name": "voteTypes", + "type": "uint8[]" }, { - "internalType": "bool[]", - "name": "useDelegated", - "type": "bool[]" + "internalType": "bool", + "name": "perNftPowerArray", + "type": "bool" } ], "name": "votingPower", @@ -1058,11 +951,21 @@ "name": "power", "type": "uint256" }, + { + "internalType": "uint256", + "name": "rawPower", + "type": "uint256" + }, { "internalType": "uint256", "name": "nftPower", "type": "uint256" }, + { + "internalType": "uint256", + "name": "rawNftPower", + "type": "uint256" + }, { "internalType": "uint256[]", "name": "perNftPower", diff --git a/DaoValidators/abis/DaoValidators.json b/DaoValidators/abis/DaoValidators.json index 9011f0a0..41067054 100644 --- a/DaoValidators/abis/DaoValidators.json +++ b/DaoValidators/abis/DaoValidators.json @@ -1,5 +1,4 @@ [ - { "anonymous": false, "inputs": [ diff --git a/DaoValidators/abis/PoolFactory.json b/DaoValidators/abis/PoolFactory.json index 025785ee..1a83c0c6 100644 --- a/DaoValidators/abis/PoolFactory.json +++ b/DaoValidators/abis/PoolFactory.json @@ -1,23 +1,4 @@ [ - { - "inputs": [ - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - } - ], - "name": "predictTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "anonymous": false, "inputs": [ @@ -176,12 +157,7 @@ }, { "internalType": "uint256", - "name": "voteForRewardsCoefficient", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "voteAgainstRewardsCoefficient", + "name": "voteRewardsCoefficient", "type": "uint256" } ],