项目作者: mattdf

项目描述 :
Smart Contract tools to help streamline Ethereum dapp development and deployment
高级语言: Python
项目地址: git://github.com/mattdf/sc-tools.git
创建时间: 2017-03-12T21:27:38Z
项目社区:https://github.com/mattdf/sc-tools

开源协议:GNU General Public License v3.0

下载


sc-tools by Matthew Di Ferrante

This repo contains a set of tools written in python to help develop, test and
deploy smart contracts under a unified interface that can be easily Makefile’d.

The project consists of three tools:

  • sc-compile: Take a solidity contract and compile it down to a combined ABI +
    bytecode JSON file
  • sc-push: deploy bytecode + ABI to the blockchain, and register/update the
    name and contract address in local “contracts.map” file
  • sc-test: read local contracts.map file and take a tests file, and call into
    contract deployed by sc-push with given test cases

Example run (from Makefile):

  1. $ ./sc-compile ./examples/state.sol
  2. Generated Test.abi ...
  3. Generated Test.test-skeleton ...
  4. $./sc-push -c Test.abi -t ./examples/state.def -p 8881
  5. Using account w/ address: 0xe564ab56ddfb3218fdf84dffe7e7a84f36b1bc8f
  6. Received transaction hash 0x42ba6a85512d8235561a61bc6bdad4c3fa25df7617905565fcf8d20ef047191b
  7. Contract address for Test : 0x1216a17ab9e84aea8d777546f9d04fcca6bfd6f2
  8. {
  9. "blockHash": "0xf36a8e0a37ef02c36b0c31a2f44389d0bbaeb1d31a27ee15f2a9d6606ae5e2f2",
  10. "blockNumber": "0x110b",
  11. "contractAddress": "0x1216a17ab9e84aea8d777546f9d04fcca6bfd6f2",
  12. "cumulativeGasUsed": "0x27387",
  13. "from": "0xe564ab56ddfb3218fdf84dffe7e7a84f36b1bc8f",
  14. "gasUsed": "0x27387",
  15. "logs": [],
  16. "root": "c393fd7eb73b5bf68cff8154fa82c78ae075b558858aff06c8b0b62c64c34362",
  17. "to": null,
  18. "transactionHash": "0x42ba6a85512d8235561a61bc6bdad4c3fa25df7617905565fcf8d20ef047191b",
  19. "transactionIndex": "0x0"
  20. }
  21. Updated map for Test
  22. $ ./sc-test -n Test -t ./examples/state.def -p 8881
  23. ========= Testing setStore(int256) =========
  24. Call setStore(int256) will change blockchain state! Awaiting transaction receipt...
  25. Current block: 4363
  26. ABI Parameters: 0x51c8e02a0000000000000000000000000000000000000000000000000000000000000014
  27. Gas cost: 29014
  28. Event logs: ------
  29. {
  30. "ShortStore(int256)": [
  31. 20
  32. ],
  33. "StoreEvent(int256,int256)": [
  34. 20,
  35. 320
  36. ]
  37. }
  38. ------------------
  39. ========= Testing multStore(int256) =========
  40. Current block: 4365
  41. ABI Parameters: 0xd78db6480000000000000000000000000000000000000000000000000000000000000005
  42. ABI Result: 0x0000000000000000000000000000000000000000000000000000000000000064
  43. JSON Result: -----
  44. [
  45. 100
  46. ]
  47. ------------------
  48. Test 0 for multStore(int256) Passed!
  49. ========= Testing multStore(int256) =========
  50. Current block: 4365
  51. ABI Parameters: 0xd78db648000000000000000000000000000000000000000000000000000000000000000a
  52. ABI Result: 0x00000000000000000000000000000000000000000000000000000000000000c8
  53. JSON Result: -----
  54. [
  55. 200
  56. ]
  57. ------------------
  58. Test 1 for multStore(int256) Passed!
  59. ========= Testing getStore() =========
  60. Current block: 4365
  61. ABI Parameters: 0xc2722ecc
  62. ABI Result: 0x0000000000000000000000000000000000000000000000000000000000000014
  63. JSON Result: -----
  64. [
  65. 20
  66. ]
  67. ------------------
  68. Test 0 for getStore() Passed!