Interface Description
License: MIT
interface IGovUserKeeper
This contract is responsible for securely storing user's funds that are used during the voting. These are either ERC20 tokens or NFTs
struct BalanceInfo {
uint256 tokens;
EnumerableSet.UintSet nfts;
}
The struct holds information about user deposited tokens
Parameters:
the amount of deposited tokens
struct EnumerableSet.UintSet
the array of deposited nfts
The struct holds information about user balances
Parameters:
mapping(enum IGovPool.VoteType => struct IGovUserKeeper.BalanceInfo)
matching vote types with balance infos
mapping(enum IGovPool.VoteType => uint256)
matching vote types with cached nfts powers
mapping(address => struct IGovUserKeeper.BalanceInfo)
matching delegatees with balances infos
mapping(address => uint256)
matching delegatees with delegated nft powers
struct IGovUserKeeper.BalanceInfo
the balance info of all delegated assets
struct EnumerableSet.AddressSet
the upper bound of currently locked tokens
mapping(uint256 => uint256)
the amount of deposited tokens locked in proposals
The struct holds information about nft contract
Parameters:
boolean flag, if true then nft contract supports power
the total supply of nfts that are not enumerable
mapping(uint256 => uint256)
matching nft ids to their minimal powers
VotingPowerView
The struct that is used in view functions of contract as a return argument
Parameters:
the total vote power of a user
the total deposited assets power of a user
the total nft power of a user
the total deposited nft power of a user
the power of every nft, bounded by index with nftIds
the owned erc20 balance, decimals = 18
the array of nft ids, bounded by index with perNftPower
DelegationInfoView
The struct that is used in view functions of contract as a return argument
Parameters:
the address of delegatee (person who gets delegation)
the amount of delegated tokens
the array of delegated nfts, bounded by index with perNftPower
the total power of delegated nfts
the array of nft power, bounded by index with delegatedNfts
depositTokens (0x39dc5ef2)
The function for depositing tokens
Parameters:
the deposit receiver address
withdrawTokens (0x5e35359e)
The function for withdrawing tokens
Parameters:
the address from whom to withdraw the tokens
the withdrawal receiver address
the erc20 withdrawal amount
delegateTokens (0x9161babb)
The function for delegating tokens
Parameters:
the erc20 delegation amount
delegateTokensTreasury (0x69b5330b)
The function for delegating tokens from Treasury
Parameters:
the erc20 delegation amount
undelegateTokens (0x0ae1398e)
The function for undelegating tokens
Parameters:
the erc20 undelegation amount
undelegateTokensTreasury (0x86be8d2d)
The function for undelegating tokens from Treasury
Parameters:
the erc20 undelegation amount
depositNfts (0x9693caad)
The function for depositing nfts
Parameters:
the deposit receiver address
the array of deposited nft ids
withdrawNfts (0x1f96f376)
The function for withdrawing nfts
Parameters:
the address from whom to withdraw the nfts
the withdrawal receiver address
delegateNfts (0xbfb1a57d)
The function for delegating nfts
Parameters:
the array of delegated nft ids
delegateNftsTreasury (0x6ad6d3c1)
The function for delegating nfts from Treasury
Parameters:
the array of delegated nft ids
undelegateNfts (0x37267d4c)
The function for undelegating nfts
Parameters:
the array of undelegated nft ids
undelegateNftsTreasury (0x39be038b)
The function for undelegating nfts from Treasury
Parameters:
the array of undelegated nft ids
updateMaxTokenLockedAmount (0x5f884296)
The function for recalculating max token locked amount of a user
Parameters:
the array of proposal ids for recalculation
lockTokens (0x154b3db0)
The function for locking tokens in a proposal
Parameters:
the amount of tokens to lock
unlockTokens (0x7fde4424)
The function for unlocking tokens in proposal
Parameters:
lockNfts (0x3b389164)
The function for locking nfts
Parameters:
the array of nft ids to lock
unlockNfts (0x7be49fe3)
The function for unlocking nfts
Parameters:
the array of nft ids to unlock
updateNftPowers (0x30132f5e)
The function for recalculating power of nfts
Parameters:
the array of nft ids to recalculate the power for
setERC20Address (0x41bec0d2)
The function for setting erc20 address
Parameters:
setERC721Address (0x37e5e863)
The function for setting erc721 address
Parameters:
the voting power of an nft
the total supply of nft contract
tokenAddress (0x9d76ea58)
The function for getting erc20 address
Return values:
tokenAddress the erc20 address
nftAddress (0x5bf8633a)
The function for getting erc721 address
Return values:
nftAddress the erc721 address
getNftInfo (0x7ca5685f)
The function for getting nft info
Return values:
boolean flag, if true then nft contract supports power
the total supply of nfts that are not enumerable
maxLockedAmount (0x3b3707a3)
The function for getting max locked amount of a user
Parameters:
Return values:
tokenBalance (0xe94e3c67)
The function for getting token balance of a user
Parameters:
Return values:
the total balance with delegations
the user balance that is not deposited to the contract
nftBalance (0x26836340)
The function for getting nft balance of a user
Parameters:
Return values:
the total balance with delegations
the number of nfts that are not deposited to the contract
nftExactBalance (0x3bea071d)
The function for getting nft ids of a user
Parameters:
Return values:
the array of owned nft ids
the number of nfts that are not deposited to the contract
getTotalNftsPower (0x4a5f293c)
The function for getting total power of nfts by ids
Parameters:
should the nft raw powers array be returned
Return values:
the total total power of nfts
the array of nft powers, bounded with nftIds by index
getTotalPower (0x53976a26)
The function for getting total voting power of the contract
Return values:
canCreate (0x6f123e76)
The function to define if voter is able to create a proposal. Includes micropool balance
Parameters:
the required voting power
Return values:
true - can participate, false - can't participate
votingPower (0xae987229)
The function for getting voting power of users
Parameters:
the array of users addresses
should the nft powers array be calculated
Return values:
struct IGovUserKeeper.VotingPowerView[]
the array of VotingPowerView structs
The function for getting voting power after the formula
Parameters:
Return values:
the personal voting power after the formula
the personal plus delegated voting power after the formula
delegations (0x4d123d7e)
The function for getting information about user's delegations
Parameters:
should the nft powers array be calculated
Return values:
the total delegated power
struct IGovUserKeeper.DelegationInfoView[]
the array of DelegationInfoView structs
getWithdrawableAssets (0x221c0fd6)
The function for getting information about funds that can be withdrawn
Parameters:
the array of ids of locked proposals
the array of unlocked nfts
Return values:
the tokens that can we withdrawn
the array of nfts that can we withdrawn
getDelegatedAssetsPower (0x8a3ca923)
The function for getting the total delegated power by the delegator and the delegatee
Parameters:
the address of the delegator
the address of the delegatee
Return values:
the total delegated power