d
d
docs
Search…
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.
1
event Approval(address indexed _owner, address indexed _spender, uint256 _amount);
Copied!

Transfer

Emitted when _amount tokens are moved from the _from account _to account
1
event Transfer(address indexed _from, address indexed _to, uint256 _amount);
Copied!

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.
1
function allowance(address _owner, address _spender) external override view returns (uint256)
Copied!

approve

Sets _amount as the allowance of _spender over the caller's tokens.
1
function approve(address _spender, uint256 _amount) extrenal override returns (bool)
Copied!

balanceOf

Returns the amount of tokens owned by_account.
1
function balanceOf(address _account) external override view returns (uint256)
Copied!

balanceOfInShares

Returns the amount of shares owned by_account.
1
function balanceOfInShares(address _account) external override view returns (uint256 lambda)
Copied!

balanceOfAt

Returns the amount of tokens owned by _account at the specific _blockNumber
1
function balanceOfAt(address _account, uint256 _blockNumber)
Copied!

balanceOfInSharesAt

Returns the amount of shares owned by _account at _blockNumber.
1
function balanceOfInSharesAt(address _account, uint256 _blockNumber)
Copied!

burn

Reduces the balance(tokens) of _account by _amount
1
function burn(address _account, uint256 _amount) external override onlyDAO returns (bool)
Copied!

burnShares

Reduces the balance(shares) of _account by _amount
1
function burnShares(address _account, uint256 _amount) external override onlyDAO returns (bool)
Copied!

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.
1
function decimals() public view returns (uint256)
Copied!

decreaseAllowance

Decreases the allowance of _spender by _subtractedValue
1
function decreaseAllowance(address _spender, uint256 _subtractedValue) external returns (bool)
Copied!

increaseAllowance

Increases the allowance of _spender by _addedValue
1
function increaseAllowance(address _spender, uint256 _addedValue) external returns (bool)
Copied!

mint

Mints _amount tokens for _account. Note the onlyDAO modifier.
1
function mint(address _account, uint256 _amount) external onlyDAO returns (bool)
Copied!

mintShares

Mints _amount of shares for _account
1
function mintShares(address _account, uint256 _amount) external override returns (bool)
Copied!

name

Returns the name of the token - e.g. Elastic Governance Token
1
function name() public view returns (string memory)
Copied!

numberOfTokenHolders

Returns the number of token holders currently
1
function numberOfTokenHolders() external override view returns (uint256)
Copied!

symbol

Returns the symbol of the token. E.g. EGT
1
function symbol() external view returns (string memory)
Copied!

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
1
function totalSupply() external override view returns (uint256)
Copied!

totalSupplyInShares

Returns the total supply of the shares( λ ) in the DAO.
1
function totalSupplyInShares() external override view returns (uint256)
Copied!

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
1
function transfer(address _to, uint256 _amount) external override returns (bool)
Copied!

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.
1
function transferFrom(
2
address _from,
3
address _to,
4
uint256 _amount
5
) external override returns (bool)
Copied!

Modifiers

onlyDAO

To ensure only the DAO address can call functions on which this modifer is applied upon.
1
modifier onlyDAO() {
2
require(msg.sender == daoAddress, 'ElasticDAO: Not authorized.');
3
_;
4
}
Copied!

Last modified 7mo ago