IGovPool

Interface Description

License: MIT

interface IGovPool

This is the Governance pool contract. This contract is the third contract the user can deploy through the factory. The users can participate in proposal's creation, voting and execution processes

Enums info

ProposalState

enum ProposalState {
	 Voting,
	 WaitingForVotingTransfer,
	 ValidatorVoting,
	 Defeated,
	 SucceededFor,
	 SucceededAgainst,
	 Locked,
	 ExecutedFor,
	 ExecutedAgainst,
	 Undefined
}

The enum that holds information about proposal state

Parameters:

RewardType

enum RewardType {
	 Create,
	 Vote,
	 Execute,
	 SaveOffchainResults
}

The enum that holds information about reward type

Parameters:

VoteType

enum VoteType {
	 PersonalVote,
	 MicropoolVote,
	 DelegatedVote,
	 TreasuryVote
}

The enum that holds information about vote type

Parameters:

Structs info

Dependencies

struct Dependencies {
	address settingsAddress;
	address userKeeperAddress;
	address payable validatorsAddress;
	address expertNftAddress;
	address nftMultiplierAddress;
	address votePowerAddress;
}

The struct that holds information about dependencies

Parameters:

ProposalCore

struct ProposalCore {
	IGovSettings.ProposalSettings settings;
	uint64 voteEnd;
	uint64 executeAfter;
	bool executed;
	uint256 votesFor;
	uint256 votesAgainst;
	uint256 rawVotesFor;
	uint256 rawVotesAgainst;
	uint256 givenRewards;
}

The struct holds core properties of proposal

Parameters:

ProposalAction

struct ProposalAction {
	address executor;
	uint256 value;
	bytes data;
}

The struct holds information about proposal action

Parameters:

Proposal

struct Proposal {
	IGovPool.ProposalCore core;
	string descriptionURL;
	IGovPool.ProposalAction[] actionsOnFor;
	IGovPool.ProposalAction[] actionsOnAgainst;
}

The struct holds all information about proposal

Parameters:

ProposalView

struct ProposalView {
	IGovPool.Proposal proposal;
	IGovValidators.ExternalProposal validatorProposal;
	IGovPool.ProposalState proposalState;
	uint256 requiredQuorum;
	uint256 requiredValidatorsQuorum;
}

The struct that is used in view functions of contract as a return argument

Parameters:

RawVote

struct RawVote {
	uint256 tokensVoted;
	uint256 totalVoted;
	uint256 nftsAmount;
	EnumerableSet.UintSet nftsVoted;
}

The struct that holds information about the typed vote (only for internal needs)

Parameters:

VoteInfo

struct VoteInfo {
	mapping(IGovPool.VoteType => struct IGovPool.RawVote) rawVotes;
	bool isVoteFor;
	uint256 totalVoted;
	uint256 totalRawVoted;
}

The struct that holds information about the global vote properties (only for internal needs)

Parameters:

VoteInfoView

struct VoteInfoView {
	bool isVoteFor;
	uint256 totalVoted;
	uint256 tokensVoted;
	uint256 totalRawVoted;
	uint256[] nftsVoted;
}

The struct that is used in view functions of contract as a return argument

Parameters:

DelegatorRewards

struct DelegatorRewards {
	address[] rewardTokens;
	bool[] isVoteFor;
	bool[] isClaimed;
	uint256[] expectedRewards;
}

The struct that is used in view functions of contract as a return argument

Parameters:

DelegatorInfo

struct DelegatorInfo {
	uint256[] delegationTimes;
	uint256[] delegationPowers;
	mapping(uint256 => bool) isClaimed;
}

The struct that holds information about the delegator (only for internal needs)

Parameters:

PendingRewards

struct PendingRewards {
	mapping(uint256 => bool) areVotingRewardsSet;
	mapping(uint256 => uint256) staticRewards;
	mapping(uint256 => IGovPool.VotingRewards) votingRewards;
	mapping(address => uint256) offchainRewards;
	EnumerableSet.AddressSet offchainTokens;
}

The struct that holds reward properties (only for internal needs)

Parameters:

UserInfo

struct UserInfo {
	mapping(uint256 => IGovPool.VoteInfo) voteInfos;
	IGovPool.PendingRewards pendingRewards;
	mapping(address => IGovPool.DelegatorInfo) delegatorInfos;
	EnumerableSet.UintSet votedInProposals;
	EnumerableSet.UintSet treasuryExemptProposals;
}

The struct that holds the user info (only for internal needs)

Parameters:

VotingRewards

struct VotingRewards {
	uint256 personal;
	uint256 micropool;
	uint256 treasury;
}

The struct that is used in view functions of contract as a return argument

Parameters:

PendingRewardsView

struct PendingRewardsView {
	address[] onchainTokens;
	uint256[] staticRewards;
	IGovPool.VotingRewards[] votingRewards;
	uint256[] offchainRewards;
	address[] offchainTokens;
}

The struct that is used in view functions of contract as a return argument

Parameters:

CreditInfo

struct CreditInfo {
	address[] tokenList;
	mapping(address => IGovPool.TokenCreditInfo) tokenInfo;
}

The struct is used to hold info about validators monthly withdrawal credit

Parameters:

TokenCreditInfo

struct TokenCreditInfo {
	uint256 monthLimit;
	uint256[] cumulativeAmounts;
	uint256[] timestamps;
}

The struct is used to hold info about limits and withdrawals history

Parameters:

CreditInfoView

struct CreditInfoView {
	address token;
	uint256 monthLimit;
	uint256 currentWithdrawLimit;
}

The struct is used to return info about current credit state

Parameters:

OffChain

struct OffChain {
	address verifier;
	string resultsHash;
	mapping(bytes32 => bool) usedHashes;
}

The struct that holds off-chain properties (only for internal needs)

Parameters:

Functions info

getHelperContracts (0x485f4044)

function getHelperContracts()
    external
    view
    returns (
        address settings,
        address userKeeper,
        address validators,
        address poolRegistry,
        address votePower
    )

The function to get helper contract of this pool

Return values:

getNftContracts (0x80326e95)

function getNftContracts()
    external
    view
    returns (
        address nftMultiplier,
        address expertNft,
        address dexeExpertNft,
        address babt
    )

The function to get the nft contracts of this pool

Return values:

createProposal (0xda1c6cfa)

function createProposal(
    string calldata descriptionURL,
    IGovPool.ProposalAction[] calldata actionsOnFor,
    IGovPool.ProposalAction[] calldata actionsOnAgainst
) external

Create proposal

Parameters:

createProposalAndVote (0xee0e5215)

function createProposalAndVote(
    string calldata descriptionURL,
    IGovPool.ProposalAction[] calldata actionsOnFor,
    IGovPool.ProposalAction[] calldata actionsOnAgainst,
    uint256 voteAmount,
    uint256[] calldata voteNftIds
) external

Create and vote for on the proposal

Parameters:

moveProposalToValidators (0x2db47bdd)

function moveProposalToValidators(uint256 proposalId) external

Move proposal from internal voting to Validators contract

Parameters:

vote (0x544df02c)

function vote(
    uint256 proposalId,
    bool isVoteFor,
    uint256 voteAmount,
    uint256[] calldata voteNftIds
) external

The function for voting for proposal with own tokens

Parameters:

cancelVote (0xbacbe2da)

function cancelVote(uint256 proposalId) external

The function for canceling vote

Parameters:

deposit (0xde3ab781)

function deposit(uint256 amount, uint256[] calldata nftIds) external

The function for depositing tokens to the pool

Parameters:

withdraw (0xfb8c5ef0)

function withdraw(
    address receiver,
    uint256 amount,
    uint256[] calldata nftIds
) external

The function for withdrawing deposited tokens

Parameters:

delegate (0x46d0b0b9)

function delegate(
    address delegatee,
    uint256 amount,
    uint256[] calldata nftIds
) external

The function for delegating tokens

Parameters:

delegateTreasury (0x39588f1e)

function delegateTreasury(
    address delegatee,
    uint256 amount,
    uint256[] calldata nftIds
) external

The function for delegating tokens from treasury

Parameters:

undelegate (0x7810436a)

function undelegate(
    address delegatee,
    uint256 amount,
    uint256[] calldata nftIds
) external

The function for undelegating delegated tokens

Parameters:

undelegateTreasury (0xb6b90df4)

function undelegateTreasury(
    address delegatee,
    uint256 amount,
    uint256[] calldata nftIds
) external

The function for undelegating delegated tokens from treasury

Parameters:

unlock (0x2f6c493c)

function unlock(address user) external

The function that unlocks user funds in completed proposals

Parameters:

execute (0xfe0d94c1)

function execute(uint256 proposalId) external

Execute proposal

Parameters:

claimRewards (0x0520537f)

function claimRewards(uint256[] calldata proposalIds, address user) external

The function for claiming rewards from executed proposals

Parameters:

claimMicropoolRewards (0x7b0e1203)

function claimMicropoolRewards(
    uint256[] calldata proposalIds,
    address delegator,
    address delegatee
) external

The function for claiming micropool rewards from executed proposals

Parameters:

changeVotePower (0xcfd9c3c3)

function changeVotePower(address votePower) external

The function to change vote power contract

Parameters:

editDescriptionURL (0x0dbf1c47)

function editDescriptionURL(string calldata newDescriptionURL) external

The function for changing description url

Parameters:

changeVerifier (0xcf04fb94)

function changeVerifier(address newVerifier) external

The function for changing verifier address

Parameters:

setCreditInfo (0xbaa7652f)

function setCreditInfo(
    address[] calldata tokens,
    uint256[] calldata amounts
) external

The function for setting validators credit limit

Parameters:

transferCreditAmount (0xc1e09f97)

function transferCreditAmount(
    address[] memory tokens,
    uint256[] memory amounts,
    address destination
) external

The function for fulfilling transfer request from validators

Parameters:

changeBABTRestriction (0x2050a31b)

function changeBABTRestriction(bool onlyBABT) external

The function for changing the KYC restriction

Parameters:

setNftMultiplierAddress (0xa43040eb)

function setNftMultiplierAddress(address nftMultiplierAddress) external

The function for setting address of nft multiplier contract

Parameters:

saveOffchainResults (0x41c47e3e)

function saveOffchainResults(
    string calldata resultsHash,
    bytes calldata signature
) external

The function for saving ipfs hash of off-chain proposal results

Parameters:

getProposals (0x5e3b4365)

function getProposals(
    uint256 offset,
    uint256 limit
) external view returns (IGovPool.ProposalView[] memory)

The paginated function for getting proposal info list

Parameters:

Return values:

getProposalState (0x9080936f)

function getProposalState(
    uint256 proposalId
) external view returns (IGovPool.ProposalState)

Parameters:

Return values:

getUserActiveProposalsCount (0x38fa211c)

function getUserActiveProposalsCount(
    address user
) external view returns (uint256)

The function for getting user's active proposals count

Parameters:

Return values:

getTotalVotes (0x6545ea83)

function getTotalVotes(
    uint256 proposalId,
    address voter,
    IGovPool.VoteType voteType
) external view returns (uint256, uint256, uint256, bool)

The function for getting total raw votes in the proposal by one voter

Parameters:

Return values:

getProposalRequiredQuorum (0xda437f37)

function getProposalRequiredQuorum(
    uint256 proposalId
) external view returns (uint256)

The function to get required quorum of proposal

Parameters:

Return values:

getUserVotes (0x466d7af2)

function getUserVotes(
    uint256 proposalId,
    address voter,
    IGovPool.VoteType voteType
) external view returns (IGovPool.VoteInfoView memory)

The function to get information about user's votes

Parameters:

Return values:

getWithdrawableAssets (0x7ecd20bb)

function getWithdrawableAssets(
    address delegator
) external view returns (uint256, uint256[] memory)

The function to get withdrawable assets

Parameters:

Return values:

getPendingRewards (0x566aff6a)

function getPendingRewards(
    address user,
    uint256[] calldata proposalIds
) external view returns (IGovPool.PendingRewardsView memory)

The function to get on-chain and off-chain rewards

Parameters:

Return values:

getDelegatorRewards (0x529285af)

function getDelegatorRewards(
    uint256[] calldata proposalIds,
    address delegator,
    address delegatee
) external view returns (IGovPool.DelegatorRewards memory)

The function to get delegator staking rewards from all micropools

Parameters:

Return values:

getCreditInfo (0xf06817cf)

function getCreditInfo()
    external
    view
    returns (IGovPool.CreditInfoView[] memory)

The function to get info about validators credit limit

Return values:

getOffchainInfo (0xb3a72fc4)

function getOffchainInfo()
    external
    view
    returns (address validator, string memory resultsHash)

The function to get off-chain info

Return values:

getOffchainSignHash (0x8e19ade9)

function getOffchainSignHash(
    string calldata resultsHash,
    address user
) external view returns (bytes32)

The function to get the sign hash from string resultsHash, chainid, govPool address

Parameters:

Return values:

getExpertStatus (0x0660b478)

function getExpertStatus(address user) external view returns (bool)

The function to get expert status of a voter

Return values:

coreProperties (0xe9bbc80c)

function coreProperties() external view returns (ICoreProperties)

The function to get core properties

Return values: