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
the mapping token => withdrawals history and limits
TokenCreditInfo
The struct is used to hold info about limits and withdrawals history
Parameters:
Name
Type
Description
monthLimit
uint256
the monthly withdraw limit for the token
cumulativeAmounts
uint256[]
the list of amounts withdrawn
timestamps
uint256[]
the list of timestamps of withdraws
CreditInfoView
The struct is used to return info about current credit state
Parameters:
Name
Type
Description
token
address
the token address
monthLimit
uint256
the amount that validator could withdraw monthly
currentWithdrawLimit
uint256
the amount that validators could withdraw now
OffChain
The struct that holds off-chain properties (only for internal needs)
Parameters:
Name
Type
Description
verifier
address
the off-chain verifier address
resultsHash
string
the ipfs results hash
usedHashes
mapping(bytes32 => bool)
matching hashes to their usage state
Functions info
getHelperContracts (0x485f4044)
The function to get helper contract of this pool
Return values:
Name
Type
Description
settings
address
settings address
userKeeper
address
user keeper address
validators
address
validators address
poolRegistry
address
pool registry address
votePower
address
vote power address
getNftContracts (0x80326e95)
The function to get the nft contracts of this pool
Return values:
Name
Type
Description
nftMultiplier
address
rewards multiplier nft contract
expertNft
address
local expert nft contract
dexeExpertNft
address
global expert nft contract
babt
address
binance bound token
createProposal (0xda1c6cfa)
Create proposal
Parameters:
Name
Type
Description
descriptionURL
string
IPFS url to the proposal's description
actionsOnFor
struct IGovPool.ProposalAction[]
the array of structs with information about actions on for step
actionsOnAgainst
struct IGovPool.ProposalAction[]
the array of structs with information about actions on against step
createProposalAndVote (0xee0e5215)
Create and vote for on the proposal
Parameters:
Name
Type
Description
descriptionURL
string
IPFS url to the proposal's description
actionsOnFor
struct IGovPool.ProposalAction[]
the array of structs with information about actions on for step
actionsOnAgainst
struct IGovPool.ProposalAction[]
the array of structs with information about actions on against step
voteAmount
uint256
the erc20 vote amount
voteNftIds
uint256[]
the nft ids that will be used in voting
moveProposalToValidators (0x2db47bdd)
Move proposal from internal voting to Validators contract
Parameters:
Name
Type
Description
proposalId
uint256
Proposal ID
vote (0x544df02c)
The function for voting for proposal with own tokens
Parameters:
Name
Type
Description
proposalId
uint256
the id of the proposal
isVoteFor
bool
the bool flag for voting for or against the proposal
voteAmount
uint256
the erc20 vote amount
voteNftIds
uint256[]
the nft ids that will be used in voting
cancelVote (0xbacbe2da)
The function for canceling vote
Parameters:
Name
Type
Description
proposalId
uint256
the id of the proposal to cancel all votes from which
deposit (0xde3ab781)
The function for depositing tokens to the pool
Parameters:
Name
Type
Description
amount
uint256
the erc20 deposit amount
nftIds
uint256[]
the array of nft ids to deposit
withdraw (0xfb8c5ef0)
The function for withdrawing deposited tokens
Parameters:
Name
Type
Description
receiver
address
the withdrawal receiver address
amount
uint256
the erc20 withdrawal amount
nftIds
uint256[]
the array of nft ids to withdraw
delegate (0x46d0b0b9)
The function for delegating tokens
Parameters:
Name
Type
Description
delegatee
address
the target address for delegation (person who will receive the delegation)
amount
uint256
the erc20 delegation amount
nftIds
uint256[]
the array of nft ids to delegate
delegateTreasury (0x39588f1e)
The function for delegating tokens from treasury
Parameters:
Name
Type
Description
delegatee
address
the target address for delegation (person who will receive the delegation)
amount
uint256
the erc20 delegation amount
nftIds
uint256[]
the array of nft ids to delegate
undelegate (0x7810436a)
The function for undelegating delegated tokens
Parameters:
Name
Type
Description
delegatee
address
the undelegation target address (person who will be undelegated)
amount
uint256
the erc20 undelegation amount
nftIds
uint256[]
the array of nft ids to undelegate
undelegateTreasury (0xb6b90df4)
The function for undelegating delegated tokens from treasury
Parameters:
Name
Type
Description
delegatee
address
the undelegation target address (person who will be undelegated)
amount
uint256
the erc20 undelegation amount
nftIds
uint256[]
the array of nft ids to undelegate
unlock (0x2f6c493c)
The function that unlocks user funds in completed proposals
Parameters:
Name
Type
Description
user
address
the user whose funds to unlock
execute (0xfe0d94c1)
Execute proposal
Parameters:
Name
Type
Description
proposalId
uint256
Proposal ID
claimRewards (0x0520537f)
The function for claiming rewards from executed proposals
Parameters:
Name
Type
Description
proposalIds
uint256[]
the array of proposal ids
user
address
the address of the user
claimMicropoolRewards (0x7b0e1203)
The function for claiming micropool rewards from executed proposals
Parameters:
Name
Type
Description
proposalIds
uint256[]
the array of proposal ids
delegator
address
the address of the delegator
delegatee
address
the address of the delegatee
changeVotePower (0xcfd9c3c3)
The function to change vote power contract
Parameters:
Name
Type
Description
votePower
address
new contract for the voting power formula
editDescriptionURL (0x0dbf1c47)
The function for changing description url
Parameters:
Name
Type
Description
newDescriptionURL
string
the string with new url
changeVerifier (0xcf04fb94)
The function for changing verifier address
Parameters:
Name
Type
Description
newVerifier
address
the address of verifier
setCreditInfo (0xbaa7652f)
The function for setting validators credit limit
Parameters:
Name
Type
Description
tokens
address[]
the list of tokens to credit
amounts
uint256[]
the list of amounts to credit per month
transferCreditAmount (0xc1e09f97)
The function for fulfilling transfer request from validators
Parameters:
Name
Type
Description
tokens
address[]
the list of tokens to send
amounts
uint256[]
the list of amounts to send
destination
address
the address to send tokens
changeBABTRestriction (0x2050a31b)
The function for changing the KYC restriction
Parameters:
Name
Type
Description
onlyBABT
bool
true id restriction is needed
setNftMultiplierAddress (0xa43040eb)
The function for setting address of nft multiplier contract
Parameters:
Name
Type
Description
nftMultiplierAddress
address
the address of nft multiplier
saveOffchainResults (0x41c47e3e)
The function for saving ipfs hash of off-chain proposal results
Parameters:
Name
Type
Description
resultsHash
string
the ipfs results hash
signature
bytes
the signature from verifier
getProposals (0x5e3b4365)
The paginated function for getting proposal info list
Parameters:
Name
Type
Description
offset
uint256
the proposal starting index
limit
uint256
the number of proposals to observe
Return values:
Name
Type
Description
[0]
struct IGovPool.ProposalView[]
ProposalView array
getProposalState (0x9080936f)
Parameters:
Name
Type
Description
proposalId
uint256
Proposal ID
Return values:
Name
Type
Description
[0]
enum IGovPool.ProposalState
ProposalState: 0 -Voting, proposal where addresses can vote 1 -WaitingForVotingTransfer, approved proposal that waiting moveProposalToValidators() call 2 -ValidatorVoting, validators voting 3 -Defeated, proposal where voting time is over and proposal defeated on first or second step 4 -SucceededFor, successful proposal with votes for but not executed yet 5 -SucceededAgainst, successful proposal with votes against but not executed yet 6 -Locked, successful proposal but temporarily locked for execution 7 -ExecutedFor, executed proposal with the required number of votes on for step 8 -ExecutedAgainst, executed proposal with the required number of votes on against step 9 -Undefined, nonexistent proposal
getUserActiveProposalsCount (0x38fa211c)
The function for getting user's active proposals count
Parameters:
Name
Type
Description
user
address
the address of user
Return values:
Name
Type
Description
[0]
uint256
the number of active proposals
getTotalVotes (0x6545ea83)
The function for getting total raw votes in the proposal by one voter
Parameters:
Name
Type
Description
proposalId
uint256
the id of proposal
voter
address
the address of voter
voteType
enum IGovPool.VoteType
the type of vote
Return values:
Name
Type
Description
[0]
uint256
Arguments: core raw votes for, core raw votes against, user typed raw votes, is vote for indicator
getProposalRequiredQuorum (0xda437f37)
The function to get required quorum of proposal
Parameters:
Name
Type
Description
proposalId
uint256
the id of proposal
Return values:
Name
Type
Description
[0]
uint256
the required number for votes to reach the quorum
getUserVotes (0x466d7af2)
The function to get information about user's votes
Parameters:
Name
Type
Description
proposalId
uint256
the id of proposal
voter
address
the address of voter
voteType
enum IGovPool.VoteType
the type of vote
Return values:
Name
Type
Description
[0]
struct IGovPool.VoteInfoView
VoteInfoView array
getWithdrawableAssets (0x7ecd20bb)
The function to get withdrawable assets
Parameters:
Name
Type
Description
delegator
address
the delegator address
Return values:
Name
Type
Description
[0]
uint256
Arguments: erc20 amount, array nft ids
getPendingRewards (0x566aff6a)
The function to get on-chain and off-chain rewards
Parameters:
Name
Type
Description
user
address
the address of the user whose rewards are required
proposalIds
uint256[]
the list of proposal ids
Return values:
Name
Type
Description
[0]
struct IGovPool.PendingRewardsView
the list of rewards
getDelegatorRewards (0x529285af)
The function to get delegator staking rewards from all micropools
Parameters:
Name
Type
Description
proposalIds
uint256[]
the list of proposal ids
delegator
address
the address of the delegator
delegatee
address
the address of the delegatee
Return values:
Name
Type
Description
[0]
struct IGovPool.DelegatorRewards
rewards delegator rewards
getCreditInfo (0xf06817cf)
The function to get info about validators credit limit
Return values:
Name
Type
Description
[0]
struct IGovPool.CreditInfoView[]
the list of credit infos
getOffchainInfo (0xb3a72fc4)
The function to get off-chain info
Return values:
Name
Type
Description
validator
address
the verifier address
resultsHash
string
the ipfs hash
getOffchainSignHash (0x8e19ade9)
The function to get the sign hash from string resultsHash, chainid, govPool address