The idea is to abstract user balances away from the token's business logic making the tokens upgradeable, and opens the door for modular functionality to be added over time.
EIP: <to be assigned>
Title: Token standard for upgradeable and modular tokens
Author: [email protected]
Type: Standard Track
As it stands now, if any ERC20 tokens were to encounter any sort of fatal flaw, ever balance on that token would be at risk and recovering from the flaw would be cumbersome at best. This ERC proposes a way to accomplish the tasks below by abstracting the user balances away from the business logic.
- Makes tokens upgradeable
- Allows for modular functionality
- Creates a way to insulate user balances from exploitable code
Protecting consumers from potential exploits.
Returns an account's token balance.
function getBalance(address _acct) returns(uint balance)
Increases an account's token balance.
function incBalance(address _acct, uint _val) onlyModule returns(bool success)
Decreases an account's token balance.
function decBalance(address _acct, uint _val) onlyModule returns(bool success)
Returns an accounts allowed balance to be spent on behalf of
function getAllowance(address _owner, address _spender) returns(uint remaining)
_spenderto spend from
_sender's account. When the function is called it over writes the current allowance with_value`.
function setApprove(address _sender, address _spender, uint256 _value) onlyModule returns(bool success)
Decreases an accounts allowance amount by
function decApprove(address _from, address _spender, uint _value) onlyModule returns(bool success)
Returns if module
_acctis active or not.
function getModule(address _acct) returns (bool success)
_acctto true or false.
function setModule(address _acct, bool _set) onlyRoot returns(bool success)
Returns the total supply.
function getTotalSupply() returns(uint)
Increases the total supply.
function incTotalSupply(uint _val) onlyModule returns(bool success)
Decreases the total supply.
function decTotalSupply(uint _val) onlyModule returns(bool success)
Transfers to a new account.
function transferRoot(address _new) onlyRoot returns(bool success)
Triggered when balances are adjusted.
event BalanceAdj(address indexed Module, address indexed Account, uint Amount, string Polarity);
Triggered when modules are updated.
event ModuleSet(address indexed Module, bool indexed Set);