Learn Ethereum programming by making tests pass As inspired by , guides you through simple, bite-sized programming exercises to learn Solidity the gentle way. The goal is to learn the Solidity language, syntax, structure, and how to create secure and gas-efficient smart contracts. It starts off with the basics and slowly guides you through the inner workings of the EVM, through assembly code and security considerations. Ruby Koans Solidity Koans _Learn Etherem programming through test driven development. The Koans walk you along the path to enlightenment in order…_soliditykoans.org Solidity Koans Through tests and exercises, I hope to make you think about edge cases and intrinsic properties of the blockchain and . Your goal is to solve each puzzle and make the tests pass, style. distributed systems test-driven development How to get started Clone the repo: Solidity Koans git clone https://github.com/nczhu/solidity-koans.git 2. Install dependencies: npm install -g truffle ganache-cli 3. Start up Ganache with command: ganache-cli 4. In a new tab, check out the directory, where each test represents a koan. To get started with the easiest (and first) Koan, run: /test truffle test ./test/Test_assert_1.sol You should see failing tests: 5. To make the tests pass, fill in the underscores in each file with the expected values: __ // You can test if a condition returns truefunction test_should_return_true() public { Assert.isTrue(__, “should return true”);} Should be … // You should fill in "true" function test_should_return_true() public { Assert.isTrue(true, “should return true”); } 6. Pass all tests to finish the level. You can find subsequent levels by looking in the directory. I recommend tackling them in order: /test truffle test ./test/< >_< >.sol Koan_subject koan_order What to Expect Solidity Koans uses to run a personal Ethereum blockchain on your local machine, and uses for its testing framework. Each Koan is an actual smart contract with failing tests, that you’ll need to solve. I’ve included helpful inline comments to point you in the right direction. There are also links to relevant documentation and articles to help you understand more. Ganache Truffle Currently, Solidity Koans has that cover the most important aspects of Solidity, such as and , and important concepts such as the difference between . 7 basic levels primitives complex data types memory and storage For example, looks like this: Level 7 Contributing to Solidity Koans Solidity Koans is an , and is open for any pull requests or comments for improvement. open source project on Github The Ethereum white paper outlines many more technical nuances worth exploring in Koans. I’m currently working on evolving future levels around coding patterns, common security pitfalls, and demystifying the EVM. To contribute, simply: Fork this repo : I modified truffle testing framework to provide UX enhancements like handling the double underscore . Refactoring suggestions are welcome. Examine Assert.sol __ 3. Submit issues, design your own levels, and then issue a ! Pull Request Thanks To: for inspiration The Edgecase Ruby Koans , for feedback and reviewing drafts of this post agemanning onggunhao