Digix Dev Update - 22 August 2017
Vitalik’s Blockbuster at SGInnovate
Ethereum Singapore meetup (http://www.meetup.com/Ethereum-Singapore/), a non-profit meetup that we organize since it’s inception in 2015, has gathered almost 2,700 members thus far and is by far the biggest meetup group of its kind here in Asia.
Last week, we organized a resoundingly successful meetup for Vitalik, with him personally quoting “this is probably one of the top 3 meetup I’ve been to” and the “biggest in Singapore” thus far. We proposed that he talk about the upcoming plans of the Ethereum Foundation, Metropolis, Casper, Sharding and he thoroughly engaged the audience over an hour. Almost 350 people turned up at the venue and we have reasons to believe that the next year’s edition will be even more successful than this. For folks who missed the live stream, you may view the archive link here:
https://www.youtube.com/watch?v=v21FeQX32a8
Gavin Wood pops by to Singapore
Gavin Wood, from Polkadot / Parity Technologies was also in town last week. It has been almost half a year since we have met at the inaugural Ethereum Singapore Parity meetup in November 2016 and it was certainly good to hang out with him again.
TenX Video / VB / interview with Digix team
Our friends and partners at TenX has kindly put together a video log for the Digix Team! More videos like this will soon happen on a fairly regular basis to keep everyone informed on our progress on the ground.
https://www.youtube.com/watch?v=LIyJVs4OSik&feature=youtu.be
Want to learn more about Ethereum’s Swarm / Decentralized File Storage?
Zahoor Mohamed, an Ethereum Foundation developer based out in Chennai, is in town and will be speaking live about the Swarm project on 22nd August 2017, 6:30 to 8:30pm Singapore Time. The event is fully booked out, but the live stream can be watched at :
https://www.youtube.com/watch?v=-9EdPwlgjbo
Finally, due to the upcoming exciting weeks at Digix, we are putting together a short survey link that we hope you can take 2 minutes of your time to help us out on. Your response will go a long way! Teaser: DGDs will be rewarded for a full completion.
DGX Survey Link:
https://goo.gl/forms/Vc9qbt8niaUEXI353
Tech Update
Anthony Eufemio CTO
This week I wanted to talk about the 3rd security audit and the refactoring work needed to get our codebase ready for it.
During the first two audits we wanted the audits to focus on the consumer facing portions of our code. This includes the following:
- DGX Gold Token Contract (ERC-20 token)
- Token transfers
- Token “transfer from” and approvals
- Recasting tokens for a specific gold bar from the minter pool.
- Gold asset explorer
Additionally we wanted to get some feedback regarding our modular contract patterns (made possible through our CACP/ICS contracts) which allows for the following:
- Splitting contract code into different contracts based on their function which may fall in one of the following categories:
- Storage: these are contracts that act as our persistence layer where data can be written to the contract in one transaction and can be read by other transactions or calls at a later date.
- Controller: these are contracts that contain the logic behind the code and can read from and write to the storage contracts through CACP enforced access controlled writer functions.
- Interactive: these are contracts that have functions that can be directly called by other external contracts as well as through web3/JSONRPC sendTransaction and calls.
- Service: these are contracts that provide some commonly used functions such as doing demurrage rate calculations, signature verification, and others.
- Libraries: solidity libraries that provide common low level functionality that can be used anywhere in the ICS stack.
- Function level access control (groups based, account based, mutex based, or state based)
- Contract address forward and reverse lookups which allows us to determine which external contract is invoking the given contract’s function allow the contract to allow or reject the call based on the access control.
- Allows us to deploy complex code that would normally not be possible due to Ethereum’s per-block gas limit.
- Allow us to upgrade certain components to fix bugs and add functionality in the future.
These are all great things that CACP/ICS provides our contract development efforts but the biggest caveat is that this design makes it difficult to properly write unit tests. All of the issues that were brought up during our first and second audits have since been resolved except for the most glaring one which is the lack of unit testing. The reason for this is that writing unit tests in CACP/ICS is not a trivial exercise. A simple test of a controller contract would require the following steps:
- Deploy a new ContractResolver instance
- Deploy underlying storage contract that the controller contract uses.
- Deploy controller contract.
- Configure ContractResolver to use the main tester account as the address for the calling interface contract.
- Check assertions
The amount of test boilerplate code that we need to write just to test a single function would make our test related codebase larger than the actual codebase itself if we are to aspire for near 100% test coverage.
This week we are working towards finding a middle ground solution to our testing woes which involves some of the following:
- Identifying portions of the code that can be DRYed up further.
- Expanding the functionality/scope of storage contracts to handle low level state rules (i.e. StateMachine library) which can be easily tested.
- Writing generic tests for interface contracts and storage contracts that satisfy what’s needed to have full coverage.
- Focusing on refactoring controller contracts which is where we need 100% coverage.
The goal is to have a golden codebase with 100% coverage of mission critical portions of our codebase and 100% sanity check coverage for non-critical portions of the code.
Chris Hitchcott (Core Developer)
This week I skinned the marketplace to make it more closely line with Digix branding, including implementing some components to improve UX, integrating the digix semantic UI theme, adding visuals for the landing page (a big slideshow banner with login overlay), adding the Terms & Conditions, styling charts, the various other UI tweaks. There were also some backend updates to the routing system to deal with redirects, and wiring up the various hard-coded URLs to prepare the app for different staging environments. Additionally I prepared a short survey to help us determining the prominence of copy on the marketplace landing page, based on feedback from potential DGX holders.
Pending the updated contract API from anthony, the final step for publishing a live marketplace (for user testing of purchasing DGX) is to integrate the new contracts and deploy this updated app — plus maybe one or two additional minor iterations of UI tweaking here and there, and recording a walkthrough video.
This week I am wrapping up by working on the PoA system, pending the updated contract API.
I leave you with a few screenshots of the (almost) finalised marketplace UI.
