ECO Token

Token Purpose

The ECO token is the base currency of the Eco Protocol, having a variable supply controlled by monetary policy set by a user-elected group of “Trustees”. The Trustees vote on monetary governance decisions and may implement various policy levers which affect the ECO token. Additionally, the ECO token is used to vote on general community-proposed system upgrades (alongside ECOx).

Supply and Voting Power

  • Initial Supply: 10 billion units of ECO.

  • Supply Policy: variable supply via Monetary Governance.

  • Voting Power: 0.1 Voting Power per ECO.

In the contracts, voting power is stored as a uint256 number with one decimal. Therefore, when reading the voting power per ECO from the contract, it is displayed as 1, and the voting power per ECOx is displayed as 10.

ECO Token Implementation

The ECO token is implemented as a standard ERC20 (with 18 digits of fixed precision) but has a few behaviors that are unexpected for an ERC20. Using the "Weird ERC20 Token" framework, the ECO token has the following unexpected behavior:

  1. Balance Modifications Outside of Transfers

  2. Upgradable Token

  3. Pausable Token

  4. Revert on Transfer / Approval To Zero Address

  5. Revert on Failed Transfer

  6. Update Allowance Function

1. Balance Modification Outside of Transfers

The ECO token implements rebasing functionality using a _linearInflation coefficient in the core policy contracts. As you can see below, the _linearInflation coefficient scales the unscaled balance of the owner, to derive the final number of ECO the address owns.

InflationCheckpoints.sol
/** Access function to determine the token balance held by some address
*/
function balanceOf(address _owner) public view override returns (uint256) {
    uint256 _linearInflation = _checkpointsLookup(
        _linearInflationCheckpoints,
        block.number
    );
    return _balances[_owner] / _linearInflation;
}

The _linearInflation coefficient also scales the totalSupply of the token.

InflationCheckpoints.sol
/** Returns the total (inflation-corrected) token supply
 */
function totalSupply() public view override returns (uint256) {
    uint256 _linearInflation = _checkpointsLookup(
        _linearInflationCheckpoints,
        block.number
    );
    return _totalSupply / _linearInflation;
}

The _linearInflation coefficient is set by the Trustees through monetary policy (explained in the following section) and is subject to change as frequently as every two weeks through Eco Monetary Governance.

This rebasing system will not allow correct calculation of an address' balance by summing over that address’s transfer events. Instead, a basevaluetransfer is emitted, which allows a user's balance to be calculated using the net balance of the ​​basevaluetransfer events and the current _linearInflation coefficient.

Due to the linear rebasing mechanic, ECO will break the majority of DeFi protocols, as they expect underlying ERC20 token balances not to change. Please see the section on the Eco Token Wrapper for more information about interfacing with existing DeFi protocols.

2. Upgradable Token

The ECO token is managed through a proxy, which allows the core logic of the ERC20 contract to be modified at any time. Any modifications will be managed by the Eco Protocol’s governance system.

3. Pausable Token

To guard against potential catastrophic bugs or outside events, the Eco Protocol is equipped with a circuit breaker, as described in the Circuit Breaker page.

4. Revert on Transfer / Approval To Zero Address

The ECO token reverts on both approvals and transfers to the zero address.

5. Revert on Failed Transfer

The external ERC20 function does not actually return false on failure but reverts. They do return true on success though.

6. Update Allowance Function

There are decreaseAllowance and increaseAllowance functions to change allowances. Also, the transferFrom method emits an Approval event marking the updated allowance.

Last updated