ERC-20 is the most popular token standard on Ethereum platform. Numerous number of ERC-20 cryptocurrencies have launched on Ethereum. The ds-token a simple and sufficient ERC20 implementation under GPL-3.0 License and the source code can be found here https://github.com/dapphub/ds-token.
Like other smart contracts, ERC-20 tokens can significantly benefit from Arcology’s concurrency framework. We replace some data structures with our concurrent containers while keeping internal logic unchanged.
The key to the effective parallelization is to avoid conflicts wherever possible. Conflicts happen when some shared states are accessed by multiple transactions simultaneously. Thus, we substituted the majority of global variables with local ones. We also used the deferred functions to handle the ones that couldn’t be easily replaced. Please check out the concurrent programming guide for details.
We chose ds-token mainly because it is simple enough for smart contract developers to easily understand what it is trying to do. It is also complex enough to cover some of challenges developers may face in their daily work when considering possible code parallelization. The main purpose of the this ERC20 showcase is to demonstrate how our concurrency framework takes one step further to help handle large volumes of concurrent user calls to the same contract.
The new implementation allows parallel processing of concurrent calls to the same contract/interface. Given enough resources, the system can process all the transactions simultaneously without causing any conflict of rollback at all.
The new version achieved some astonishing results. Our version is about ~1000x faster than original on Ethereum.