Git Product home page Git Product logo

solidity-baby-steps's Introduction

以太坊合约简单例子

在fork的基础上,修改了代码风格,更新代码适应solidity新特性等

内容

测试

本項目中使用了truffle和ganache-cli,具体安装方法可以参考官方文档。运行测试用例(只写了较少的一部分):
打开一个客户端

ganache-cli

打开另一个客户端

truffle test

结果:

  Contract: creatorBalanceChecker
Address of contract is 0x56e0d275850b0bf467aae90bfe0e30b5f68c4b5f
creator balance_1 is 7.748564837299342875997e+21
creator dot balance is 7.748539032999342875997e+21
    ✓ check the value of contract (42ms)

  Contract: Greeter contract
    greeting test
      ✓ should right init (42ms)
    set greeting
      ✓ should right set new greeting (668ms)
    global variables
      ✓ should right get block/tx info
    self destroy
      ✓ should right send eth and self destroy (562ms)

  Contract: BasicIterator
    ✓ should right init (79ms)
    ✓ should right sum array


  7 passing (2s)

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.