Solidity Koans

Logo

Learn Ethereum programming through test driven development. The Koans walk you along the path to enlightenment in order to learn Solidity - as inspired by Ruby Koans.

View the Project on GitHub nczhu/solidity-koans

This is an intermediate series for learning Solidity and smart contract development. You will explore technicalities from syntax edgecases, to assembly in the EVM, to smart contract coding conventions, all through test driven development.

“If your mind is empty, it is always ready for anything, it is open to everything. In the beginner’s mind there are many possibilities, but in the expert’s mind there are few.”

Learning Path


Standard data types

  1. Asserts
  2. Numbers
  3. Bytes
  4. Arrays
  5. Mappings
  6. Structs
  7. Storage

Function types (in progress)

Transactions details (in progress)

Javascript client (in progress)

Design patterns (in progress)

Security (in progress)

Solidity Assembly (in progress)

Directions


How to Setup

How to Tackle Each Koan

  1. Each test is initially incomplete, e.g.:
     function test_should_return_true() public {
    Assert.isTrue(__, "should return true");
     }
    
  2. Run each level with: truffle test ./test/Test_FILENAME Tests will fail with error messages, e.g.:
     2) Test_Assert_1
    test_should_return_true::
    Error: should return true
    
  3. In your editor, replace __ with the correct values or code, e.g.:
     function test_should_return_true() public {
    Assert.isTrue(true, "should return true");
     }
    
  4. To pass each level, make sure:
    • All tests are passing
    • All compiler warnings and errors are fixed

Troubleshooting


Contributing


  1. Fork it the project
  2. Create your feature branch using issue #: git checkout -b issue#-feature
  3. Commit your changes: git commit -am 'Fix/Add/Change: commit msg'
  4. Push to the branch: git push origin issue#-feature
  5. Create a new Pull Request

See full list of outstanding issues here.

Design Decisions


License


MIT License