-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERC-1067 (ERC extension) #1067
Comments
I just developed a token with this particular structure and it works seamlessly for updates - totally recommend it! However, we would have to add, aside from the getters and setters inside the DataCentre (I called it Storage) a Communicator contract, storing all contract addresses which may access the setters, provided by the Storage contract, to make sure that the variables cannot be manipulated by unknown sources.
Furthermore, every contract, listed as a communicatorContract would need to inherit a Linked contract, providing the underlying contract with the address of the Storage contract and implementing the functionality of the owner contract, inherited by Storage.
Yet, this would really put the trust of the token users to test as the contract owner could now arbitrarily change the entire smart contract structure and potentially render the token overnight worthless. |
Thanks a lot for sharing your views on this token architecture, Lucas!
I think the proposal more than provides a very standard interface and protocols on which other methods and add-ones can be implemented. |
Thank you for the feedback on my suggestions and especially for the issues you raised about the shareholder contract! I just have one more remark I would like to share, regarding my first and second suggestion. Seeing as the sole purpose of this contract structure lies in providing updatability, it can safely be implied that its adapters will want to actually update their contract from time to time. However, in this case, every update would require the contract owner to delete the entire 'functions contract', add changes as desired, and then deploy the contract again on the blockchain. In most cases, though, the contract owner will probably merely add new functions to the contract and, still, will not just have to pay for deploying the added functions but also all the other functions which have been previously contained by the contract. When talking about a very basic token, these additional costs may be noticeable but not earth-shattering. However, with more complex tokens, this will create substantial additional costs for updates. If new functions, on the other hand, would be added in a new contract, the update costs would be reduced significantly. Therefore, I think, the Communicator contract would in fact provide a true upside for this structure, regardless of whether there are multiple tokens stored in the DataCentre or just one. |
|
There has been no activity on this issue for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review. |
This issue was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment. |
Abstract
Token contract usually have a monolithic design that is not friendly to upgrades. The following proposal describes a more distributed token contract architecture that has a simple upgrade-ability protocol and allows to bring in new functions after being deployed.
Motivation
There have been countless number of tokens where due to the inability to upgrade and fix bugs, contract holders have lost millions of dollars. A simple bug that might take days, months, or years to solve, can be solved simply and quickly using the ERC-1067 standard.
There exist approaches that includes an upgrade agent, which has its own limitations and restrictions and sometimes might not lead to a successful upgrade implementation. It has to include all token holders, and might cost a lot.
If there is a simple bug that was left out during the deployment of a token contract, it might result in the loss of millions of dollars. There have been a number of token contracts owners, who have come to us after the token sale with bugs that have no workaround but to cost a lot of time and money. If instead, we had an upgrade-ability protocol that allows rapid fast upgrades at low cost, such accidents can be rectified.
This will allow contracts to pause and handle bugs and allow them to fix bugs or upgrade the ERC standard to a newer one.
This standard has the ability to be cross compatible with any other monolithic ERC interface like the ERC20, ERC223, ERC721, ERC827 etc.
Specification
The following Upgradeable Token approach requires
Methods
All of the ERC20 functions remain the same in essence. We interact with the DataCentre and write all the data into our DataCentre.
All the calls fetch data from the DataCentre, the supporting DataCentre function is written below each call-
totalSupply
Token-
DataCentre-
balanceOf(address)
Get the account balance of another account with address _owner
Token-
DataCentre-
transfer(address, uint)
Token-
Internal Function-
DataCentre-
The owner of the DataCentre contract is always the Token contract.
Upgradeability Protocol
The token contract has some simple measures through which an upgrade can be made in just 2 transactions-
The kill function looks like below-
Recommended implementation
This is highly recommended implementation of ERC-1067 token:
https://github.com/techracers-blockchain/ERC-1067
The text was updated successfully, but these errors were encountered: