Delegate_bips percentage of voting power from a delegator address to a delegatee address.
Parameters
Type
Description
_from
address
The address of the delegator.
_to
address
The address of the delegatee.
_balance
uint256
The delegator's current balance
_bips
uint256
The percentage of voting power to be delegated expressed in basis points (1/100 of one percent). Not cumulative: every call resets the delegation value (and a value of 0 revokes delegation).
Get the delegation mode of an address. This mode determines whether vote power is
allocated by percentage or by explicit value and cannot be changed once set with
delegate or delegateExplicit.
Parameters
Type
Description
_who
address
The address being queried.
Returns
Type
Description
[0]
uint256
Delegation mode (NOTSET=0, PERCENTAGE=1, AMOUNT=2). See Delegatable.DelegationMode.
Delete explicit delegation checkpoints that expired (i.e. are before cleanupBlockNumber).
Method can only be called from the cleanerContract (which may be a proxy to external cleaners).
Return true if this IIVPContract is configured to be used as a replacement for other contract.
It means that vote powers are not necessarily correct at the initialization, therefore
every method that reads vote power must check whether it is initialized for that address and block.
The VPToken (or some other contract) that owns this VPContract.
All state changing methods may be called only from this address.
This is because original msg.sender is typically sent in a parameter
and we must make sure that it cannot be faked by directly calling
IIVPContract methods.
Owner token is also used in case of replacement to recover vote powers from balances.
Delete percentage delegation checkpoints that expired (i.e. are before cleanupBlockNumber).
Method can only be called from the cleanerContract (which may be a proxy to external cleaners).
Delete revocation entry that expired (i.e. is before cleanupBlockNumber).
Method can only be called from the cleanerContract (which may be a proxy to external cleaners).
Parameters
Type
Description
_from
address
Delegator address.
_to
address
Delegatee address.
_blockNumber
uint256
Block number for which total supply value was cached.
Returns
Type
Description
[0]
uint256
Number of revocation entries deleted (always 0 or 1).
Revoke all vote power delegation from a delegator address to a delegatee address at a given block.
Only affects the reads via votePowerOfAtCached in the block _blockNumber.
This method should be used only to prevent rogue delegate voting in the current voting block.
To stop delegating use delegate or delegateExplicit with value of 0,
or undelegateAll/ undelegateAllExplicit.
Parameters
Type
Description
_from
address
The address of the delegator.
_to
address
Address of the delegatee.
_balance
uint256
The delegator's current balance.
_blockNumber
uint256
The block number at which to revoke delegation. Must be in the past.
Set the cleanup block number.
Historic data for the blocks before cleanupBlockNumber can be erased.
History before that block should never be used since it can be inconsistent.
In particular, cleanup block number must be lower than the current vote power block.
Undelegate all explicit vote power by amount for a delegator address.
Can only be used with explicit delegation.
Does not reset delegation mode back to NOTSET.
Parameters
Type
Description
_from
address
The address of the delegator.
_delegateAddresses
address[]
Explicit delegation does not store delegatees' addresses, so the caller must supply them.
Returns
Type
Description
[0]
uint256
The amount still delegated (in case the list of delegates was incomplete).
Update vote powers when tokens are transferred.
Also update delegated vote powers for percentage delegation
and check for enough funds for explicit delegations.
Parameters
Type
Description
_from
address
Source account of the transfer.
_to
address
Destination account of the transfer.
_fromBalance
uint256
Balance of the source account before the transfer.
_toBalance
uint256
Balance of the destination account before the transfer.
Delete vote power cache entry that expired (i.e. is before cleanupBlockNumber).
Method can only be called from the cleanerContract (which may be a proxy to external cleaners).
Parameters
Type
Description
_owner
address
Vote power owner account address.
_blockNumber
uint256
Block number for which total supply value was cached.
Delete vote power checkpoints that expired (i.e. are before cleanupBlockNumber).
Method can only be called from the cleanerContract (which may be a proxy to external cleaners).
Return true if this IIVPContract is configured to be used as a replacement for other contract.
It means that vote powers are not necessarily correct at the initialization, therefore
every method that reads vote power must check whether it is initialized for that address and block.
The VPToken (or some other contract) that owns this VPContract.
All state changing methods may be called only from this address.
This is because original msg.sender is typically sent in a parameter
and we must make sure that it cannot be faked by directly calling
IIVPContract methods.
Owner token is also used in case of replacement to recover vote powers from balances.