DAPPCON 2019: Etherlime, Ethers.js-based Stability - Danial Ivanov & George Spasov (LimeChain)
DappCon 2019 · August 2019 · 18:12
Danial Ivanov and George Spasov of LimeChain present Etherlime at DappCon 2019, an Ethers.js-based development framework for smart contracts. They cover the tooling's approach to testing, deployment, and stability, addressing common pain points developers face when building and shipping decentralized applications on Ethereum.
Speakers
Topics
From DappCon 2019, hosted by Dappcon Berlin.
Transcript
hi guys I'm Daniel and this is George so guys are applying comm hacking on it Berlin anyone who's going to be hacking ok so one two three people okay cool another question how many of you know what eaters jess is cool how many of you have actually used it urges and how many of you like it more than web three Jess okay very common so whoever actually has touched it urges likes it more not that web through Jesus is somewhat inferior but the way that little Jess is built it just gives a stability and Ito lime is a tool that we're going to be speaking
about in the next twenty minutes is actually built on it urges with stability in mind because me and our company lime chain we have been developing decentralized applications for the past two and a half years almost three years we have worked with more than twenty companies and what we have found is that half of the time we're actually fighting the tools and fighting the the infrastructure instead of fighting the business problem that is there and we needed to we said that hey we need to be more productive and in order for us to be more productive we need to have a stability in our development experience in order to be able to tackle the hard business problems that are there and at this time three years ago it was only truffle and
truffle was based on web purchase as it is now and we said we decided to go on met after we have developed an application for for a long time and we said hey we have these four smart constructs that are linked to each other we want to go on the minute how many of you have gone to my net okay how many of you have gone on my net to truffle how many of you two have gone with more than one contract okay what was your first experience when you are doing this when you had to link multiple contracts with with truffle all goods not what about you okay so yeah pretty much
the same for me I had to deploy for contracts first went through actually know this what happened I had to test very very diligently so I went to ganache I tested everything I have full coverage of unit tests then I went to ring goodbye perfect migration scripts perfect I went to roxton because Robson is the closest thing you have to men that migration scripts perfect I was super super confident three days later after I press the migrate to live I had one contract deployed eight times I have spent something like half on it already on something that is not not there and as a sign of desperation what I did is I
just spin up nodejs script based on it urges and I said hey deployment is deployment this deployment is deployment is linked them together through some setter functions I ran this script at the third day and in ten minutes I was actually able to do all I needed to do four four three four three days and I had very terrible time I passed my deadlines it was it was fighting the the tools as I said in the beginning so based on this story we said hey we are going to be doing it like this but if we were doing it like this why don't we actually try and do something more and in addition to deploying with it urges we said hey why can we actually do compiling and can we actually do unit
testing and can actually do coverage and can all of this be based on it or just because we find the stability is there and this is how it aligned was born it'll I'm is developing a deployment framework based on liter chest it has no configs that you can mess up or commit into your rap where all your private keys with thousands of feature are there and it has a documentation that is always up-to-date we never released without updating the documentation any release that we have also any any pull request that we have also has a review over they could be comment and last year at Def Con we got approached by a Tyrian Community Fund
and it price and we got actually granted by them to continue this development and today I'm going to show you what is the state of fetal I'm and I'm going to walk through the different functions that you can have you need alignment then we have for you a little video demonstration of how all of these looks and feels so what you can do is obviously we can in each a new project we have embedded ganache core into it so lime so that you don't need to install both of them you can just say it aligned ganache and it spins ganache for you with million in million and million of eath so that you can even
test your large high cos i also whatever it's called these days you can compile and our compiler or supports viper so you can have a mixture of solidity and viper contracts obviously you can you can unit tests what's important here is that your unit tests are actually based on liturgy s so you have a fool you have a single library where you can do your client-side applications deployment scripts and your unit tests so you don't constantly need to context switch between two libraries for development we have a code coverage too so we pretty much can see what how much you have covered your to this is based on 0x work
deployment scripts i already spoke about it's where everything started and we have also integrated a teacher scan which means that you can pretty much say hey i want to deploy and verify and in a single in a single comment view or going to deploy or contract when you net that supported by either scan and this and you're going to go to eaters can we're going to go out Twitter's can API for you and verify your contract so you don't need to bother for flattening stuff finding out what go what version you have used everything is there we have history because a lot of time I have forgotten the addresses that I have used so you can see the history of your deployments and the different networks
and yeah there is there are even more stuff that's there you can debug stuff you can flatten contracts we have integrated IDE which pretty much you can spawn through a time ID and we have started our work with I then treat and integrating zk snark so you can generate your witnesses and verifiers directly from from it lime and make your apps based on on zero knowledge and one thing that I probably have missed here is we have shapes something that email you might know as boxes in in truffle we have six or seven different different boxes all major client-side framework
smaller plasma and some more and seeing these slides is not good enough so just hand over to Daniel to show you and walk you through different things that we do yeah I'm just going to demonstrate you a couple of the Commons well we can step so we can start with either lime in it what this does is basically creates your territory with some simple contracts simple deployment script simple unit
test that can give you some insight of how you should structure your application decentralized application after that you can spawn a ganache so when you have the sample depth you can spawn your ganache and it will basically give you the ten default addresses with millions and millions of eaters as George said so you can develop your and test your code so here is the structure you can see that there's contracts deployment which is the poison which has the boy script and a test folder so a regular solid a smart contract with some
some lime in it here's the boy script you can currently it use the it or lime ganache deploy just two comments and you deploy your contract here are the unit tests you can see that there are some custom asserts for example each address is hash you can assert whether the transaction have reverted not reverted assert whether some events have been emitted or not so it's pretty useful most personally I almost always write some utility functions for example did revert it or not the ether lime
assertions give you give you that out-of-the-box yeah and actually when you when you develop some unit tests you basically sometimes you have to perform transactions from different users and different addresses we've augmented the contract wrapper on top of the ethers gs wrapper and added some cool syntax to the cute transactions from different users just contract that from dot function name it executes the transaction from that from that to address so we can compile with it our line compile which
accepts any kind of facility compiled version you can pass the directory there are a couple of parameters here that you can pass I'm not going to go into details of those but once you perform interline compile it you get your built folder in which you have your JSON with the ABI and the bytecode you can see that there on the bottom there it's in for regarding the compiler and the optimizer etc so once we are ready to deploy we just type it or line deploy again you can pass a couple of
parameters here as well for example the network private key from which you're going to deploy eaters can API key in order to verify the contract after the deployment etc I'm going to show you in that as well so here is the deploy as you can see it's very very verbose information you get your network you get the name of the contracts the address from which your the point and some useful information regarding the transaction hash well the status of the transaction gas price etc and the most important the the contract address after it's been deployed the next thing that we can do is sit
around tests which basically execute the test the test file and you get your test run again it's pretty pretty pretty good information is displayed here we have some ether line coverage we will talk into in a minute but just that means we yeah here it is so it'll I'm coverage it compiles again the the contract performs the test you can notice that well you notice that there's the transaction you
the gas usage so every tip every test has its transaction usage well we vary here we go you have for every unit test you get your gas usage after you've done that you're presented with HTML website where you can browse your browse your contract and see whether you where at what line you didn't get your tests covered and which is pretty pretty cool you get a visual of your coverage lastly
here's an example where you can deploy on rinca by either wine deploy and you'll provide your deploy deployment script with the private key from which you're deploying the network and the ether scan api key and after this goes true actually to deploy it on rinca by so yep we will go to eater scan and check the deploy contract as you can see as it goes it's very verbose the the transaction has that be that's being mined the addresses at which the contract is being deployed and after
that you get information that your contract is being verified on rinca by it takes a while to to verify to the knitters can a couple of seconds personally I find it the verification useful not only when you deploy something on production and leave your contracts verified for your users but when you're developing it's pretty useful because you can deploy your contract immediately get verified and start clicking out using it in either scan and see what's wrong whether whether everything is okay etc so here
is the contract deployed in either scan you you see that it's already verified you can see the code you can perform some read functions and some write to the contract functions and yeah that that's basically it we're good we have time for questions okay one last remark from my side was that this was all real time this was not spread up this was exactly what you're going to experience I mean this was just a fresh new style future lime that I did and I did all of these things just out of the box so it's
not some funny video that is made for specifically for you in order to showcase how awesome it Alam is this is what you actually get there the good and the bad so yeah do you have any any questions anyone wants to throw something at us show hands yes please yeah should I pass hello things guys for introduction two questions first one so you say it you have a verification for it smart contracts first of all would
flatten or do you use so it's your own album flattener or use already existing solutions and another one do you consider to integrate with other blocks bulk chain explorers for example open-source one like block Scout 80k we tried three using the open-source ones ended up hitting a lot of walls and wrote it ourselves and we are pretty pretty happy at this stage because it works at least exactly as we as we want there in terms of integrations yes we are looking for the pretty correct
installation so block Scout is definitely something that's on our mind in terms of other networks we were supporting little atrium and quorum also for the public version we are also looking to develop similar tools to eat a line for for other networks for graphs so for example we are partnering with eternity on doing something very similar for returning sorry guys we will go up schedule if we continue but we have to take this offline go thank you [Applause]