GithubHelp home page GithubHelp logo

kuaiph / truffle-challanges Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pbrudny/truffle-challanges

0.0 1.0 0.0 1.8 MB

Basic examples of Solidity smart contracts with test coverage

Solidity 22.14% JavaScript 77.16% HTML 0.70%

truffle-challanges's Introduction

Truffle challenges

These examples are part of my guide The best way to become Ethereum Developer in 2018

and 30/30 challenge on polish ethereum programming FB group (members write one contract a day to improve Solidity skills).

First 11 Solidity challenges without Truffle are here

Try to write a contract yourself before checking the code in the repo!

Challenges

12_string_converter

  • create function to convert string to bytes32
  • add Solidity test for that function

13_route_manager

  • contract must store a list of bus stops
  • each bus stop has id, name and coordinates (i.e czn1, PKS Cieszyn, 10.123222, 33.212345)
  • owner should be able to add new stops
  • contract must have test coverage

14_route_manager_test

  • add Solidity tests
  • add JavaScript tests

15_shared_wallet

  • contract has one owner
  • owner can add and remove managers
  • manager can withdraw all the funds
  • contract has a payable fallback function to receive transfers

16_multisig_wallet

  • create a multi signature wallet
  • transfers can only be done when 3 managers sign the transaction

17_crowdsale

  • create mintable coin (use Open Zeppelin)
  • create simple crowdsale (use Open Zeppelin)
  • set opening and closing time
  • set rate and wallet address

18_roles_management

  • create contract which inherites from Ownable (Open Zeppelin)
  • contract must have a list of managers
  • owner can add/update/remove manager
  • owner is a manager too
  • add modifier onlyManager

19_the_dao_attack

  • add very simplified The DAO contract (deposit, withdraw)
  • add attacker contract

20_lpg_price

  • get LPG price using Oraclize API

21_random_oraclize

  • get random number using Oraclize API

22_raffle_oraclize

  • users can join raffle once
  • owner can't participate
  • winner is picked using RNG from Oraclize

23_ipfs_oraclize

  • add a simple json file to ipfs
  • use oraclize to read that file
  • store the result of one json attribute in a string variable

24_election

  • create one contract per election, providing a short name and address for each candidate.
  • creator of the contract gives the right to vote to each address individually
  • each voter can vote once
  • voter can not vote on himself

25_faucet

  • add fallback to accept the payment
  • add withdraw method which allows anyone to get maximum 1 ether
  • log both amounts (paid, transferred) using events

26_swarm_oraclize

27_dapp_pet_shop

28_infura_deployment

  • add settings for ropsten deployment using infura

29_tic_tac_toe

  • add basic tic tac toe for 2 players
  • 3x3 board
  • no AI

Other challenges

Like it?

If you like it please share it with others :)

truffle-challanges's People

Contributors

pbrudny avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.