Token Delegation

Delegation System

Users or contracts that do not wish to directly participate in governance may delegate any portion of their ECO or staked ECOx voting power to any number of other addresses. At any time, the delegate may be changed, including back to the original address, which merely changes who is in control of the voting power. Delegation cannot be chained — delegating funds only delegates your balance, not any voting power delegated to you. All addresses are undelegated by default.

If a user wishes to denote a single address to be in charge of voting on behalf of all their funds, they can choose a primary delegate. This is the main use path for end users. The purpose is to tell the system that any new funds sent to the user should also be delegated to the primary delegate. Additionally, it allows the user to transfer funds without undelegating them first. Users with a primary delegate will undelegate from their primary delegate as part of transferring. There is a signature schema (see EIP-712) to allow another address to perform your primary delegation for you.

Because of the special nature of primary delegates, an address has to enable the ability to be chosen as a primary delegate. This is intended for community figures who wish to try and rally people around causes or ideals. Addresses which have enabled primary delegation to them are unable to do any delegation themselves, as they are taking responsibility to be part of the voting process.

As an alternative to primary delegation, users are also able to specify amounts of their voting power to be delegated to specific targets. This is referred to as partial delegation.

Partial delegation does not require the target to have enabled delegation and can be done if funds have been delegated to you. However, it cannot be done if you are a primary delegate, and it can't be used to delegate funds that have been delegated to you. You may not transfer tokens that have been delegated in this way. Transfers will move undelegated funds only, and if your balance is only funds that you have partially delegated, you must undelegate them before you can transfer.

Note that ECO and ECOx delegation systems are separately managed by the ECO.sol contract and the ECOxStaking.sol contract, respectively. Therefore, delegation for ECO and staked ECOx are performed independently.

Delegation and Generation Snapshots

Delegation employs the use of the Generation Timer and Balance Checkpointing systems described in the System Primitives section of this documentation. Practically, this means that changes made to delegation are not reflected until the next generation.

For example:

  1. Assume address A has delegated 100 voting power to address B.

  2. Address A undelegates its voting power from address B in generation 1024.

  3. Address B will still have the 100 voting power until generation 1025.

Enabling Primary Delegation

In order for any address to become a primary delegate, they must enable primary delegation for ECO and ECOx in their respective contracts.

Enable delegation for ECO

Enabling primary delegation for ECO is managed by the ECO.sol contract. In order to enable delegation for an address, that address should call the enableDelegationTo() function in the ECO.sol contract.

Calling enableDelegationTo() will revert if the address has an outstanding delegation. To correct this, undelegate all delegated funds, and re-call enableDelegationTo().

In order to disable primary delegation, an address should call the disableDelegationTo() function. Note that this will not clear existing delegations, it will just prevent any address from assigning you as their primary delegate.

Enabling primary delegation prevents an address from delegating its own voting power. In order to re-enable delegating to others, an address must have no voting power delegated to it when calling the reenableDelegating() function.

Given that calling disableDelegationTo() does not clear existing delegations to your account, you will not be able to re-enable delegating for your address until every single person that delegated to you, undelegates from you.

To translate, it is *extremely* likely enabling primary delegation will permanently prevent your account from delegating your own voting power again. You can still vote yourself with those tokens, but you would have to transfer the tokens to a new address without primary delegation enabled to delegate that tokens' voting power again.

Enable delegation for ECOx

Enabling primary delegation for ECOx is managed by the ECOxStaking.sol contract. In order to enable delegation for an address, that address should call the enableDelegationTo() function in the ECOxStaking.sol contract.

Calling enableDelegationTo() will revert if the address has an outstanding delegation. To correct this, undelegate all delegated funds, and recall enableDelegationTo().

In order to disable primary delegation, an address should call the disableDelegationTo() function. Note that this will not clear existing delegations, it will just prevent any address from assigning you as their primary delegate.

Enabling primary delegation prevents an address from delegating its own voting power. In order to re-enable delegating to others, an address must have no voting power delegated to it when calling the reenableDelegating() function.

Given that calling disableDelegationTo() does not clear existing delegations to your account, you will not be able to re-enable delegating for your address until every single person that delegated to you, undelegates from you.

To translate, it is *extremely* likely enabling primary delegation will permanently prevent your account from delegating your own voting power again. You would have to transfer the tokens to a new address without primary delegation enabled to use those tokens' voting power.

Delegating ECO and ECOx

Performing Primary Delegation

Both the ECO.sol and ECOxStaking.sol contracts contain a delegate(address delegatee) function, which allows an address to set its primary delegate.

Both the ECO.sol and ECOxStaking.sol contracts contain an undelegate() function, which allows an address to remove its primary delegate.

Performing Partial Delegation

Performing a partial delegation is done using the delegateAmount(address delegatee, uint256 amount) function.

Removing a partial delegation is done using the undelegateAmountFromAddress(address delegatee, uint256 amount) function.

The partial delegation will need to be performed with an ABI Transaction until an interface is implemented for it.

The partial delegation will also need to be performed in gons which are unscaled units of ECO. See the GitHub Documentation for more details.

Because checkpointed voting power is used for random inflation, delegating voting power will cause you to lose your chance to win random inflation.

Delegation by Signature

Both ECO and ECOx contain functionality to allow delegation by signature using EIP-712. For more information about using the delegate by signature functionality, please review the GitHub Repository.

Last updated