abidoc 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +114 -0
  3. data/lib/abidoc/version.rb +2 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e04cd527574913ca48d6b137779994b1b8591e5f6fef541eb15bf8e3b6189b2c
4
- data.tar.gz: f7ad37ae9775b095d34f74907fee9b84f6af5e574ff939de34090fe654ce98cf
3
+ metadata.gz: f4b3c3f3938f6b54d21344990071ae5e3681a831e890f78889a17ad447f14e34
4
+ data.tar.gz: 8688881c905501c39cb4bbb38c2eca48fcac093108a9ab8c2ec5bb3439bcdc65
5
5
  SHA512:
6
- metadata.gz: 9c60fab097d3b48c02367f98a4f64690c7679467b7c68ab0f7d50631d9da65a75b1546c03cba5644da23fd671643cfef9f9ba8ea89aa832d7926f623495b5aeb
7
- data.tar.gz: c9aa02b3c23cc0b0bc147138726f352d70dedb5e9ecd09b6f4e0be479379d61522b5f15af1c3bccbc75d16ed0e36dded8fcc77356499266e1458928d7d234e12
6
+ metadata.gz: 0a2d6a0c7dedaa90b6e0afcd164cbd4a1ff69833f0d54eb580a25c9340ec2af338281455e941277efe1c98196166b8596b07f9e67381bcfc63302f1c3fb43a39
7
+ data.tar.gz: 59285ecbaf3bee17cd11c9ad6a2d1b35e67fe9c9bb5adab7ae5946f0624182254596040eadc47922998486241533b5c819c0c222130324e4ac53a2c9b35b703a
data/README.md CHANGED
@@ -9,9 +9,123 @@ abidoc - application binary interface (abi) documentation generator for Ethereum
9
9
  * rdoc :: [rubydoc.info/gems/abidoc](http://rubydoc.info/gems/abidoc)
10
10
 
11
11
 
12
+
12
13
  ## Usage
13
14
 
14
15
 
16
+ Let's try to generate the contract abi docs
17
+ for punks v1 (anno 2017):
18
+
19
+ ``` ruby
20
+ require 'abidoc'
21
+
22
+ punks_v1 = '0x6ba6f2207e343923ba692e5cae646fb0f566db8d'
23
+
24
+ abi = ABI.read( "./abis/#{punks_v1}.json" )
25
+ buf = abi.generate_doc( title: 'Contract ABI for Punks V1' )
26
+ write_text( "./o/punks_v1.md", buf )
27
+ ```
28
+
29
+ resulting in:
30
+
31
+
32
+ ---
33
+
34
+ # Contract ABI for Punks V1
35
+
36
+
37
+ **Constructor**
38
+
39
+ - constructor()
40
+
41
+ **1 Payable Function(s)**
42
+
43
+ - function buyPunk(uint256 punkIndex) _payable_
44
+
45
+ **7 Transact Functions(s)**
46
+
47
+ - function reservePunksForOwner(uint256 maxForThisRun)
48
+ - function withdraw()
49
+ - function transferPunk(address to, uint256 punkIndex)
50
+ - function offerPunkForSaleToAddress(uint256 punkIndex, uint256 minSalePriceInWei, address toAddress)
51
+ - function offerPunkForSale(uint256 punkIndex, uint256 minSalePriceInWei)
52
+ - function getPunk(uint256 punkIndex)
53
+ - function punkNoLongerForSale(uint256 punkIndex)
54
+
55
+ **14 Query Functions(s)**
56
+
57
+ - function name() ⇒ (string _) _readonly_
58
+ - function punksOfferedForSale(uint256 _) ⇒ (bool isForSale, uint256 punkIndex, address seller, uint256 minValue, address onlySellTo) _readonly_
59
+ - function totalSupply() ⇒ (uint256 _) _readonly_
60
+ - function decimals() ⇒ (uint8 _) _readonly_
61
+ - function imageHash() ⇒ (string _) _readonly_
62
+ - function nextPunkIndexToAssign() ⇒ (uint256 _) _readonly_
63
+ - function punkIndexToAddress(uint256 _) ⇒ (address _) _readonly_
64
+ - function standard() ⇒ (string _) _readonly_
65
+ - function balanceOf(address _) ⇒ (uint256 _) _readonly_
66
+ - function symbol() ⇒ (string _) _readonly_
67
+ - function numberOfPunksToReserve() ⇒ (uint256 _) _readonly_
68
+ - function numberOfPunksReserved() ⇒ (uint256 _) _readonly_
69
+ - function punksRemainingToAssign() ⇒ (uint256 _) _readonly_
70
+ - function pendingWithdrawals(address _) ⇒ (uint256 _) _readonly_
71
+
72
+ ---
73
+
74
+
75
+ Let's try to generate the contract abi docs
76
+ for punk blocks (anno 2022):
77
+
78
+ ``` ruby
79
+ punk_blocks = '0x58e90596c2065befd3060767736c829c18f3474c'
80
+
81
+ abi = ABI.read( "./address/#{punk_blocks}.json" )
82
+
83
+ buf = abi.generate_doc( title: 'Contract ABI for Punk Blocks' )
84
+ write_text( "./punk_blocks.md", buf )
85
+ ```
86
+
87
+ resulting in:
88
+
89
+ ---
90
+
91
+ # Contract ABI for Punk Blocks
92
+
93
+
94
+ **Constructor**
95
+
96
+ - constructor()
97
+
98
+ **1 Transact Functions(s)**
99
+
100
+ - function registerBlock(bytes _dataMale, bytes _dataFemale, uint8 _layer, string _name)
101
+
102
+ **8 Query Functions(s)**
103
+
104
+ - function blocks(bytes32 _) ⇒ (uint8 layer, bytes dataMale, bytes dataFemale) _readonly_
105
+ - function getBlocks(uint256 _fromID, uint256 _count) ⇒ (tuple[] _, uint256 _) _readonly_
106
+ - function index(uint256 _) ⇒ (bytes32 _) _readonly_
107
+ - function nextId() ⇒ (uint256 _) _readonly_
108
+ - function svgFromIDs(uint256[] _ids) ⇒ (string _) _readonly_
109
+ - function svgFromKeys(bytes32[] _attributeKeys) ⇒ (string _) _readonly_
110
+ - function svgFromNames(string[] _attributeNames) ⇒ (string _) _readonly_
111
+ - function svgFromPunkID(uint256 _tokenID) ⇒ (string _) _readonly_
112
+
113
+ ---
114
+
115
+ and so on.
116
+
117
+
118
+
119
+
120
+ ## Bonus - Awesome Contracts
121
+
122
+ See the [**Awesome (Ethereum) Contracts / Blockchain Services**](https://github.com/rubycocos/awesome-contracts) repo.
123
+ that is a cache of (ethereum) contract ABIs (application binary interfaces)
124
+ and open source code (if verified / available)
125
+ with auto-generated docs via abidoc & friends.
126
+
127
+
128
+
15
129
 
16
130
 
17
131
  ## License
@@ -2,8 +2,8 @@
2
2
  module ABIDoc
3
3
 
4
4
  MAJOR = 0
5
- MINOR = 0
6
- PATCH = 1
5
+ MINOR = 1
6
+ PATCH = 0
7
7
  VERSION = [MAJOR,MINOR,PATCH].join('.')
8
8
 
9
9
  def self.version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abidoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-26 00:00:00.000000000 Z
11
+ date: 2022-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: abiparser