ElasticGovernanceToken.sol

The amount of ETH backing each EGT decreases. More EGT are minted and get liquidated for their underlying ethereum value.

ERC-20

The ElasticGovernanceToken contract is an implementation of our IElasticToken interface. The IElasticToken is an implementation of the ERC20 interface, a standard interface for fungible tokens.

Bootstrapped and Community-owned since day1

Functionality

List of events:

List of functions:

List of modifiers:

If a function refrances another function, event or modifier - link it, have a list of all the functions, events and modifiers and link it)

Events

Approval

Emitted when the allowance of a _spender for _owner is set by a call to approve,

_amount is the new allowance.

event Approval(address indexed _owner, address indexed _spender, uint256 _amount);

Transfer

Emitted when _amount tokens are moved from the _from account _to account

event Transfer(address indexed _from, address indexed _to, uint256 _amount);

Functions

allowance

Returns the remaining number of tokens that _spender will be allowed to spend on behalf of_ownerthrough transferFrom. This is zero by default.

function allowance(address _owner, address _spender) external override view returns (uint256)

approve

Sets _amount as the allowance of _spender over the caller's tokens.

function approve(address _spender, uint256 _amount) extrenal override returns (bool)

balanceOf

Returns the amount of tokens owned by_account.

function balanceOf(address _account) external override view returns (uint256)

balanceOfInShares

Returns the amount of shares owned by_account.

function balanceOfInShares(address _account) external override view returns (uint256 lambda)

balanceOfAt

Returns the amount of tokens owned by _account at the specific _blockNumber

function balanceOfAt(address _account, uint256 _blockNumber)

balanceOfInSharesAt

Returns the amount of shares owned by _account at _blockNumber.

function balanceOfInSharesAt(address _account, uint256 _blockNumber)

burn

Reduces the balance(tokens) of _account by _amount

function burn(address _account, uint256 _amount) external override onlyDAO returns (bool)

burnShares

Reduces the balance(shares) of _account by _amount

function burnShares(address _account, uint256 _amount) external override onlyDAO returns (bool)

decimals

Returns the number of decimals the token uses - e.g. 18, means to divide the token amount by 1000000000000000000 to get its user representation.

function decimals() public view returns (uint256)

decreaseAllowance

Decreases the allowance of _spender by _subtractedValue

function decreaseAllowance(address _spender, uint256 _subtractedValue) external returns (bool)

increaseAllowance

Increases the allowance of _spender by _addedValue

function increaseAllowance(address _spender, uint256 _addedValue) external returns (bool)

mint

Mints _amount tokens for _account. Note the onlyDAO modifier.

function mint(address _account, uint256 _amount) external onlyDAO returns (bool)

mintShares

Mints _amount of shares for _account

function mintShares(address _account, uint256 _amount) external override returns (bool)

name

Returns the name of the token - e.g. Elastic Governance Token

function name() public view returns (string memory)

numberOfTokenHolders

Returns the number of token holders currently

function numberOfTokenHolders() external override view returns (uint256)

symbol

Returns the symbol of the token. E.g. EGT

function symbol() external view returns (string memory)

totalSupply

Returns the total supply of the tokens in the DAO. Given by the equation:

t=(λmk)t = ( λ * m * k )
  • t - the total number of the tokens in the DAO

  • λ (lambda) - the total number of shares outstanding in the DAO currently

  • m - current value of the share value modifier

  • k - constant

function totalSupply() external override view returns (uint256)

totalSupplyInShares

Returns the total supply of the shares( λ ) in the DAO.

function totalSupplyInShares() external override view returns (uint256)

transfer

Moves _amount tokens from the caller's account to _to address using the allowance mechanism. _amount is then deducted from the caller's allowance.

Returns a boolean value indicating whether the operation succeeded. Emits a Transfer event

function transfer(address _to, uint256 _amount) external override returns (bool)

transferFrom

Moves _amount tokens from the _from address to _to address using the allowance mechanism. _amount is then deducted from the caller's allowance.

Returns a boolean value indicating whether the operation succeeded. Emits a Transfer and Approval event.

function transferFrom(
address _from,
address _to,
uint256 _amount
) external override returns (bool)

Modifiers

onlyDAO

To ensure only the DAO address can call functions on which this modifer is applied upon.

modifier onlyDAO() {
require(msg.sender == daoAddress, 'ElasticDAO: Not authorized.');
_;
}