Author

Topic: [Development][Solidity]Truffle or not Truffle? That is the question… (Read 127 times)

newbie
Activity: 56
Merit: 0
After 4 days of deployment nightmare of our new contract with Rob our CTO at Kryptopy Inc, I decided to share our experience with the new Byzantium upgrade of Ethereum, Truffle, Geth, and so on.

We wish to share our tips with other blockchain / ethereum developer here to avoid them to relive the same nightmare as we did.

First of all, Truffle is a good environment, we like it… for testing. If you want to deploy to mainnet, we definitely not recommend it.

The reason is that you will get tons of errors related to the fact that Truffle cannot cope with all the changes and for a reason. There are just too much. So rule #1 use truffle to test your contracts, version them, make sure they work the way they are intended to. But do not use it to deploy.

Took us days to understand it. Maybe with the new upgrade that was released today this has changed, however we still wouldn’t use it for that purpose.
So first step for a successful contract deployment to Ethereum as of today (October 31st 2017) = Upgrade everything. Old versions simply won’t work with the Byzantium upgrade. This means : geth, parity, and whatever else you are using on a daily basis for your smart contracts. For geth, use version 1.7.2 as a minimum.

If you are patient and want to syncronize with geth and do all your deployment from there the old school way, make sure you have plenty of memory and I mean plenty! Less than 16GB of ram and without a decent SSD drive with a lot of space you will run into a lot of problems. Such as the infamous memory leak that is still not fixed (I ran into it again today).

Best way to do it?

1- Develop your contracts using solidity (latest version) and truffle (yes thats good for that!)
2- Test and re-test, if you have a budget make them audited !
3- Merge your contracts with a tool like: sol-merger (npm i -g sol-merger)
4- Use the online ethereum compiler (https://ethereum.github.io/browser-solidity/)
5- Once compiled, click on details, it will give you a javascript with the ABI and Compiled code of your contract.
6- You can use parity, contract tab, deploy paste your contract ABI and compiled code, do not forget to tick advanced parameters if you have parameters you need to include (per example wallet address)
7- Set your gas, deploy and enjoy !

I hope this did save you a lot of headaches!

As self promotion phase 2 of Kryptopy Network pre-sale is currently running at https://www.kryptopy.com if you like this article feel free to pitch 0.1ether or more in it Smiley Thank you for your support in advance.
Jump to: