IERC721Power
Interface Description
License: MIT
This is the custom NFT contract with voting power
Structs info
NftInfo
This struct holds NFT Power parameters. These parameters are used to recalculate nft power
Parameters:
Name | Type | Description |
---|---|---|
lastUpdate | uint64 | the last time when the power was recalculated |
maxRawPower | uint256 | the maximum raw nft power limit |
currentRawPower | uint256 | the current raw nft power |
requiredCollateral | uint256 | the required collateral amount |
currentCollateral | uint256 | the current nft collateral |
NftInfoView
The struct to get info about the NFT
Parameters:
Name | Type | Description |
---|---|---|
rawInfo | struct IERC721Power.NftInfo | the raw NFT info |
maxPower | uint256 | real max nft power |
minPower | uint256 | real min nft power |
currentPower | uint256 | real nft power |
Functions info
addCollateral (0xa8f35adf)
Add collateral amount to certain nft
Parameters:
Name | Type | Description |
---|---|---|
amount | uint256 | Wei |
tokenId | uint256 | Nft number |
removeCollateral (0x6a9b1891)
Remove collateral amount from certain nft
Parameters:
Name | Type | Description |
---|---|---|
amount | uint256 | Wei |
tokenId | uint256 | Nft number |
recalculateNftPowers (0xa79b53d5)
Recalculate nft power (coefficient)
Parameters:
Name | Type | Description |
---|---|---|
tokenIds | uint256[] | Nft numbers |
totalPower (0xdb3ad22c)
Get total power
Return values:
Name | Type | Description |
---|---|---|
[0] | uint256 | totalPower |
getNftMaxPower (0x6c889f41)
Return max possible power (coefficient) for nft
Parameters:
Name | Type | Description |
---|---|---|
tokenId | uint256 | Nft number |
Return values:
Name | Type | Description |
---|---|---|
[0] | uint256 | max power for Nft |
getNftMinPower (0x7c24b33a)
Return min possible power (coefficient) for nft
Parameters:
Name | Type | Description |
---|---|---|
tokenId | uint256 | Nft number |
Return values:
Name | Type | Description |
---|---|---|
[0] | uint256 | min power for Nft |
getNftPower (0x412e8a29)
The function to get current NFT power
Parameters:
Name | Type | Description |
---|---|---|
tokenId | uint256 | the Nft number |
Return values:
Name | Type | Description |
---|---|---|
[0] | uint256 | current power of the Nft |
getNftRequiredCollateral (0xcbf208a7)
Return required collateral amount for nft
Parameters:
Name | Type | Description |
---|---|---|
tokenId | uint256 | Nft number |
Return values:
Name | Type | Description |
---|---|---|
[0] | uint256 | required collateral for Nft |