ethlite-contracts 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90a5da8f2e9e8abbfc97d576c29c7e17f8215df0dc1900182dc18235931ef89e
4
- data.tar.gz: 4951c60b51a16136b2dbb0e73c01dd2a8a47ea69c34e59f4d411660ae58ccec7
3
+ metadata.gz: c38d59d6529247e37f709720a7d5d4b699eebf0f4f83d2ec1c095e6d62672dfe
4
+ data.tar.gz: d4153da09c7191dcfa95c8ae05697b7c136c5e65c1a2eaf1d5f9b77cb8a5e962
5
5
  SHA512:
6
- metadata.gz: 6ff8e3aa22de5f85f2569199813499c78f02731d66c8d0e4813ea546fea402d808ac97ca4bb7e5bf3e7804e0c63751d6909b5b3230e994319e8894b9e152edda
7
- data.tar.gz: 0bdc6e1f5e5d7065676e97041f067f8ce58624567daf14b0f5e3a4272dc93964b3e934041962408c8bfba21bdece4431aec6c7902e3eb0e8da694e400ec9e6d7
6
+ metadata.gz: 9ca5826c5e7e9f80cdb45cbe489e159970553e6d50b03e93f90636507a1599358e5fa39ce479bb7193912883a51c79701158672426173dce574f69f8035982da
7
+ data.tar.gz: 1ebcbfa74d46fade327ec0e9a24131f165b224dfb2d889af99be48b01849fe8fd618b969570e80f7e96999392a7d9d4fa55b5b8be15296d513932208d8421c1c
data/Manifest.txt CHANGED
@@ -9,9 +9,15 @@ lib/ethlite/contracts/mad_camels.rb
9
9
  lib/ethlite/contracts/marcs.rb
10
10
  lib/ethlite/contracts/moonbirds.rb
11
11
  lib/ethlite/contracts/mooncats.rb
12
+ lib/ethlite/contracts/nouns.rb
13
+ lib/ethlite/contracts/nouns_auction_house.rb
14
+ lib/ethlite/contracts/nouns_descriptor.rb
15
+ lib/ethlite/contracts/nouns_descriptor_v2.rb
16
+ lib/ethlite/contracts/nouns_seeder.rb
12
17
  lib/ethlite/contracts/phunks_v2.rb
13
18
  lib/ethlite/contracts/punk_blocks.rb
14
19
  lib/ethlite/contracts/punks_data.rb
15
20
  lib/ethlite/contracts/punks_meta.rb
16
21
  lib/ethlite/contracts/punks_v1.rb
22
+ lib/ethlite/contracts/synth_nouns.rb
17
23
  lib/ethlite/contracts/synth_punks.rb
data/README.md CHANGED
@@ -11,9 +11,267 @@ ethlite-contracts - ready-to-use (blockchain) contract services / function call
11
11
 
12
12
 
13
13
 
14
- ## Usage
14
+ ## Usage by Example
15
+
16
+
17
+ ### Contract №1 - Nouns, NounsSeeder, NounsDescriptor, NounsDescriptorV2
18
+
19
+ Let's try the `Nouns` contract
20
+ with the token id 1, that is, noun no. 1:
21
+
22
+ ``` ruby
23
+ require 'ethlite/contracts'
24
+
25
+
26
+ contract = Nouns.new
27
+
28
+ contract.totalSupply # as of Jan/16, 2023
29
+ #=> 580
30
+
31
+ token_ids = [1,2,3]
32
+ token_ids.each do |token_id|
33
+ pp seeds = contract.seeds( token_id )
34
+ #=> [1, 20, 95, 88, 14]
35
+ # for background, body, accessory, head, glasses
36
+
37
+ str = contract.tokenURI( token_id )
38
+ if str.start_with?( 'data:application/json;base64,' )
39
+ str = str.sub( 'data:application/json;base64,', '' )
40
+ ## get metadata (base64-encoded)
41
+ data = JSON.parse( Base64.decode64( str ) )
42
+ pp data
43
+ #=> {"name"=>"Noun 1",
44
+ # "description"=>"Noun 1 is a member of the Nouns DAO",
45
+ # "image"=> "data:image/svg+xml;base64..."
46
+ # }
47
+ str_image = data.delete( 'image' )
48
+ str_image = str_image.sub( 'data:image/svg+xml;base64,', '' )
49
+ image = Base64.decode64( str_image )
50
+ write_text( "./tmp/noun#{token_id}.svg", image )
51
+ else
52
+ puts "!! ERROR - expected json base64-encoded; got:"
53
+ pp str
54
+ exit 1
55
+ end
56
+ end
57
+
58
+
59
+ contract.seeder
60
+ #=> "cc8a0fb5ab3c7132c1b2a0109142fb112c4ce515"
61
+
62
+ contract.descriptor
63
+ #=> "6229c811d04501523c6058bfaac29c91bb586268"
64
+ ```
65
+
66
+ Note: See [`nouns/noun1.svg`](nouns/noun1.svg),
67
+ [`nouns/noun2.svg`](nouns/noun2.svg),
68
+ etc. for the saved copies of the ("on-chain") image data.
69
+
70
+
71
+ Let's try the `NounsSeeder` contract
72
+ that returns the pseudo-random seeds for a noun.
73
+ Note - the formula uses the blockhash - 1, and, thus,
74
+ is only deterministic, that is, returns the same seeds - if called within the same block:
75
+
76
+
77
+ ``` ruby
78
+ contract = NounsSeeder.new
79
+
80
+ # using the address of NounsDescriptor
81
+ contract.generateSeed( 1, '0x0cfdb3ba1694c2bb2cfacb0339ad7b1ae5932b63' )
82
+ #=> [1, 15, 54, 48, 16]
83
+ # for background, body, accessory, head, glasses
84
+
85
+
86
+ # using the address of NounsDescriptorV2
87
+ contract.generateSeed( 579, '0x6229c811d04501523c6058bfaac29c91bb586268' )
88
+ #=> [0, 25, 83, 99, 9]
89
+ contract.generateSeed( 579, '0x6229c811d04501523c6058bfaac29c91bb586268' )
90
+ #=> [0, 25, 83, 99, 9]
91
+ ```
92
+
93
+ Let's try the `NounsDescriptor` and
94
+ `NounsDescriptorV2` contracts and get the max available
95
+ artwork counts:
96
+
97
+ ``` ruby
98
+ contract = NounsDescriptor.new
99
+
100
+ contract.backgroundCount #=> 2
101
+ contract.bodyCount #=> 30
102
+ contract.accessoryCount #=> 137
103
+ contract.headCount #=> 234
104
+ contract.glassesCount #=> 21
105
+
106
+ contract = NounsDescriptorV2.new
107
+
108
+ contract.backgroundCount #=> 2
109
+ contract.bodyCount #=> 30
110
+ contract.accessoryCount #=> 140
111
+ contract.headCount #=> 242
112
+ contract.glassesCount #=> 23
113
+ ```
114
+
115
+ And lets generate some more nouns via seeds
116
+ using the `NounsDescriptorV2` contract:
117
+
118
+ ``` ruby
119
+ seeds = [1, 20, 95, 88, 14]
120
+ # for background, body, accessory, head, glasses
121
+ str = contract.generateSVGImage( seeds )
122
+ svg = Base64.decode64( str )
123
+ write_text( "nouns/noun_#{seeds.join('-')}.svg", svg )
124
+ ```
125
+
126
+
127
+
128
+
129
+ ### Contract №2 - SynthPunks
130
+
131
+ Let's try the `SynthPunks` contract that lets you generate
132
+ punks for every ethereum address. Note - the punk token id is
133
+ the ethereum address converted into a (big) integer number:
134
+
135
+
136
+ ``` ruby
137
+ contract = SynthPunks.new
138
+
139
+ ## let's add "pure ruby" helper
140
+ ## convert hex string (that is, address) to (big) integer
141
+ def getTokenID( address ) address.to_i( 16 ); end
142
+
143
+ getTokenID( '0x71c7656ec7ab88b098defb751b7401b5f6d8976f' )
144
+ #=> 649562641434947955654834859981556155081347864431
145
+ getTokenID( '0x0000000000000000000000000000000000000000' )
146
+ #=> 0
147
+
148
+
149
+
150
+ token_ids = [
151
+ 30311890011735557186986086868537068337617285922,
152
+ 699372119169819039191610289391678040975564001026,
153
+ getTokenID( '0x71c7656ec7ab88b098defb751b7401b5f6d8976f' ),
154
+ ]
155
+
156
+ token_ids.each do |token_id|
157
+ contract.getAttributes( token_id )
158
+ end
159
+ #=> [6,20,109,114,14]
160
+ #=> [0,12,65,124,41]
161
+ #=> [7,27,15]
162
+
163
+ [
164
+ [6,20,109,114,14],
165
+ [0,12,65,124,41],
166
+ [7,27,15],
167
+ ].each do |attributes|
168
+ svg = contract.generatePunkSVG( attributes )
169
+ write_text( "synthpunks/punk_#{attributes.join('-')}.svg", svg )
170
+ end
171
+
172
+
173
+ token_ids.each do |token_id|
174
+ str = contract.tokenURI( token_id )
175
+ if str.start_with?( 'data:application/json;base64,' )
176
+ str = str.sub( 'data:application/json;base64,', '' )
177
+ data = JSON.parse( Base64.decode64( str ) )
178
+ ## extract image
179
+ ## "image"=> "data:image/svg+xml;base64
180
+ str_image = data.delete( 'image' )
181
+ str_image = str_image.sub( 'data:image/svg+xml;base64,', '' )
182
+ image = Base64.decode64( str_image )
183
+
184
+ write_json( "synthpunks/punk#{token_id}.json", data )
185
+ write_text( "synthpunks/punk#{token_id}.svg", image )
186
+ else
187
+ puts "!! ERROR - expected json base64-encoded; got:"
188
+ pp str
189
+ exit 1
190
+ end
191
+ end
192
+ ```
193
+
194
+
195
+
196
+
197
+ ### Contract №3 - PunksMeta (aka CryptoPunksTokenUri) by 0xTycoon
198
+
199
+ _The missing tokenURI() for the Punks_
200
+
201
+
202
+ Let's try the `PunksMeta` contract
203
+ with the token id 0, that is, punk no. 0:
204
+
205
+ ``` ruby
206
+ contract = PunksMeta.new
207
+
208
+
209
+ # function parseAttributes(uint256 _tokenId) returns (string[8])
210
+ #
211
+ # parseAttributes returns an array of punk attributes. 8 rows in total
212
+ # The first row is the Type, and next seven rows are the attributes.
213
+ # The values are fetched form the CryptoPunksData contract and then the
214
+ # string is parsed.
215
+ # @param _tokenId the punk id
216
+ ary = contract.parseAttributes( 0 )
217
+ #=> ["Female 2", "Earring", "Blonde Bob", "Green Eye Shadow", "", "", "", ""]
218
+
219
+
220
+ # function getAttributes(uint256 _tokenId) returns (string)
221
+ #
222
+ # getAttributes calls parseAttributes and returns the result as JSON
223
+ # @param _tokenId the punk id
224
+ str = contract.getAttributes( 0 )
225
+ data = JSON.parse( str )
226
+ #=> [{"trait_type"=>"Type", "value"=>"Female 2"},
227
+ # {"trait_type"=>"Accessory", "value"=>"Earring"},
228
+ # {"trait_type"=>"Accessory", "value"=>"Blonde Bob"},
229
+ # {"trait_type"=>"Accessory", "value"=>"Green Eye Shadow"}]
230
+
231
+
232
+ # function tokenURI(uint256 _tokenId) returns (string)
233
+ #
234
+ # tokenURI gets the metadata about a punk and returns as a JSON
235
+ # formatted string, according to the ERC721 schema and market
236
+ # recommendations. It also embeds the SVG data.
237
+ # The attributes and SVG data are fetched form the CryptoPunksData
238
+ # contract, which stores all the CryptoPunks metadata on-chain.
239
+ # @param _tokenId the punk id
240
+ str = contract.tokenURI( 0 )
241
+ if str.start_with?( 'data:application/json;base64,' )
242
+ str = str.sub( 'data:application/json;base64,', '' )
243
+ ## get metadata (base64-encoded)
244
+ data = JSON.parse( Base64.decode64( str ) )
245
+ #=> {"description"=> "CryptoPunks launched as a fixed set of 10,000 items in mid-2017...",
246
+ # "external_url"=>"https://cryptopunks.app/cryptopunks/details/0",
247
+ # "image"=> "data:image/svg+xml;base64,...",
248
+ # "name"=>"CryptoPunk #0",
249
+ # "attributes"=>
250
+ # [{"trait_type"=>"Type", "value"=>"Female 2"},
251
+ # {"trait_type"=>"Accessory", "value"=>"Earring"},
252
+ # {"trait_type"=>"Accessory", "value"=>"Blonde Bob"},
253
+ # {"trait_type"=>"Accessory", "value"=>"Green Eye Shadow"}]}
254
+
255
+ ## get image (base64-encoded)
256
+ str_image = data.delete( 'image' )
257
+ str_image = str_image.sub( 'data:image/svg+xml;base64,', '' )
258
+ image = Base64.decode64( str_image )
259
+ ## cut-off inline leading data:image/svg+xml;utf8, too
260
+ image = image.sub( 'data:image/svg+xml;utf8,', '' )
261
+
262
+ write_json( "punksmeta/punk0.json", data )
263
+ write_text( "punksmeta/punk0.svg", image )
264
+ else
265
+ puts "!! ERROR - expected json base64-encoded; got:"
266
+ pp str
267
+ exit 1
268
+ end
269
+ end
270
+ ```
271
+
272
+ Note: See [`punksmeta/punk0.json`](punksmeta/punk0.json)
273
+ and [`punksmeta/punk0.svg`](punksmeta/punk0.svg) for the saved copies of the "on-chain" data.
15
274
 
16
- To be done
17
275
 
18
276
 
19
277
 
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'hoe'
3
3
 
4
4
  Hoe.spec 'ethlite-contracts' do
5
5
 
6
- self.version = '0.1.2'
6
+ self.version = '0.1.4'
7
7
  self.summary = "ethlite-contracts - ready-to-use (blockchain) contract services / function calls for ethereum & co."
8
8
  self.description = summary
9
9
 
@@ -0,0 +1,211 @@
1
+ # Nouns contract / (blockchain) services / function calls
2
+ #
3
+ # auto-generated via abigen (see https://rubygems.org/gems/abigen) on 2023-01-16 16:17:12 UTC
4
+ # - 33 query functions(s)
5
+ # - 0 helper functions(s)
6
+
7
+
8
+ class Nouns < Ethlite::Contract
9
+
10
+ address "0x9c8ff314c9bc7f6e59a9d9225fb22946427edc03"
11
+
12
+ # function **DELEGATION_TYPEHASH**() ⇒ (bytes32 _) _readonly_
13
+ def DELEGATION_TYPEHASH()
14
+ do_call("DELEGATION_TYPEHASH")
15
+ end
16
+ sig "DELEGATION_TYPEHASH", outputs: ["bytes32"]
17
+
18
+ # function **DOMAIN_TYPEHASH**() ⇒ (bytes32 _) _readonly_
19
+ def DOMAIN_TYPEHASH()
20
+ do_call("DOMAIN_TYPEHASH")
21
+ end
22
+ sig "DOMAIN_TYPEHASH", outputs: ["bytes32"]
23
+
24
+ # function **balanceOf**(address owner) ⇒ (uint256 _) _readonly_
25
+ def balanceOf(owner)
26
+ do_call("balanceOf", owner)
27
+ end
28
+ sig "balanceOf", inputs: ["address"], outputs: ["uint256"]
29
+
30
+ # function **checkpoints**(address _, uint32 _) ⇒ (uint32 fromBlock, uint96 votes) _readonly_
31
+ def checkpoints(arg0, arg1)
32
+ do_call("checkpoints", arg0, arg1)
33
+ end
34
+ sig "checkpoints", inputs: ["address","uint32"], outputs: ["uint32","uint96"]
35
+
36
+ # function **contractURI**() ⇒ (string _) _readonly_
37
+ def contractURI()
38
+ do_call("contractURI")
39
+ end
40
+ sig "contractURI", outputs: ["string"]
41
+
42
+ # function **dataURI**(uint256 tokenId) ⇒ (string _) _readonly_
43
+ def dataURI(tokenId)
44
+ do_call("dataURI", tokenId)
45
+ end
46
+ sig "dataURI", inputs: ["uint256"], outputs: ["string"]
47
+
48
+ # function **decimals**() ⇒ (uint8 _) _readonly_
49
+ def decimals()
50
+ do_call("decimals")
51
+ end
52
+ sig "decimals", outputs: ["uint8"]
53
+
54
+ # function **delegates**(address delegator) ⇒ (address _) _readonly_
55
+ def delegates(delegator)
56
+ do_call("delegates", delegator)
57
+ end
58
+ sig "delegates", inputs: ["address"], outputs: ["address"]
59
+
60
+ # function **descriptor**() ⇒ (contract INounsDescriptor _) _readonly_
61
+ def descriptor()
62
+ do_call("descriptor")
63
+ end
64
+ sig "descriptor", outputs: ["address"]
65
+
66
+ # function **getApproved**(uint256 tokenId) ⇒ (address _) _readonly_
67
+ def getApproved(tokenId)
68
+ do_call("getApproved", tokenId)
69
+ end
70
+ sig "getApproved", inputs: ["uint256"], outputs: ["address"]
71
+
72
+ # function **getCurrentVotes**(address account) ⇒ (uint96 _) _readonly_
73
+ def getCurrentVotes(account)
74
+ do_call("getCurrentVotes", account)
75
+ end
76
+ sig "getCurrentVotes", inputs: ["address"], outputs: ["uint96"]
77
+
78
+ # function **getPriorVotes**(address account, uint256 blockNumber) ⇒ (uint96 _) _readonly_
79
+ def getPriorVotes(account, blockNumber)
80
+ do_call("getPriorVotes", account, blockNumber)
81
+ end
82
+ sig "getPriorVotes", inputs: ["address","uint256"], outputs: ["uint96"]
83
+
84
+ # function **isApprovedForAll**(address owner, address operator) ⇒ (bool _) _readonly_
85
+ def isApprovedForAll(owner, operator)
86
+ do_call("isApprovedForAll", owner, operator)
87
+ end
88
+ sig "isApprovedForAll", inputs: ["address","address"], outputs: ["bool"]
89
+
90
+ # function **isDescriptorLocked**() ⇒ (bool _) _readonly_
91
+ def isDescriptorLocked()
92
+ do_call("isDescriptorLocked")
93
+ end
94
+ sig "isDescriptorLocked", outputs: ["bool"]
95
+
96
+ # function **isMinterLocked**() ⇒ (bool _) _readonly_
97
+ def isMinterLocked()
98
+ do_call("isMinterLocked")
99
+ end
100
+ sig "isMinterLocked", outputs: ["bool"]
101
+
102
+ # function **isSeederLocked**() ⇒ (bool _) _readonly_
103
+ def isSeederLocked()
104
+ do_call("isSeederLocked")
105
+ end
106
+ sig "isSeederLocked", outputs: ["bool"]
107
+
108
+ # function **minter**() ⇒ (address _) _readonly_
109
+ def minter()
110
+ do_call("minter")
111
+ end
112
+ sig "minter", outputs: ["address"]
113
+
114
+ # function **name**() ⇒ (string _) _readonly_
115
+ def name()
116
+ do_call("name")
117
+ end
118
+ sig "name", outputs: ["string"]
119
+
120
+ # function **nonces**(address _) ⇒ (uint256 _) _readonly_
121
+ def nonces(arg0)
122
+ do_call("nonces", arg0)
123
+ end
124
+ sig "nonces", inputs: ["address"], outputs: ["uint256"]
125
+
126
+ # function **noundersDAO**() ⇒ (address _) _readonly_
127
+ def noundersDAO()
128
+ do_call("noundersDAO")
129
+ end
130
+ sig "noundersDAO", outputs: ["address"]
131
+
132
+ # function **numCheckpoints**(address _) ⇒ (uint32 _) _readonly_
133
+ def numCheckpoints(arg0)
134
+ do_call("numCheckpoints", arg0)
135
+ end
136
+ sig "numCheckpoints", inputs: ["address"], outputs: ["uint32"]
137
+
138
+ # function **owner**() ⇒ (address _) _readonly_
139
+ def owner()
140
+ do_call("owner")
141
+ end
142
+ sig "owner", outputs: ["address"]
143
+
144
+ # function **ownerOf**(uint256 tokenId) ⇒ (address _) _readonly_
145
+ def ownerOf(tokenId)
146
+ do_call("ownerOf", tokenId)
147
+ end
148
+ sig "ownerOf", inputs: ["uint256"], outputs: ["address"]
149
+
150
+ # function **proxyRegistry**() ⇒ (contract IProxyRegistry _) _readonly_
151
+ def proxyRegistry()
152
+ do_call("proxyRegistry")
153
+ end
154
+ sig "proxyRegistry", outputs: ["address"]
155
+
156
+ # function **seeder**() ⇒ (contract INounsSeeder _) _readonly_
157
+ def seeder()
158
+ do_call("seeder")
159
+ end
160
+ sig "seeder", outputs: ["address"]
161
+
162
+ # function **seeds**(uint256 _) ⇒ (uint48 background, uint48 body, uint48 accessory, uint48 head, uint48 glasses) _readonly_
163
+ def seeds(arg0)
164
+ do_call("seeds", arg0)
165
+ end
166
+ sig "seeds", inputs: ["uint256"], outputs: ["uint48","uint48","uint48","uint48","uint48"]
167
+
168
+ # function **supportsInterface**(bytes4 interfaceId) ⇒ (bool _) _readonly_
169
+ def supportsInterface(interfaceId)
170
+ do_call("supportsInterface", interfaceId)
171
+ end
172
+ sig "supportsInterface", inputs: ["bytes4"], outputs: ["bool"]
173
+
174
+ # function **symbol**() ⇒ (string _) _readonly_
175
+ def symbol()
176
+ do_call("symbol")
177
+ end
178
+ sig "symbol", outputs: ["string"]
179
+
180
+ # function **tokenByIndex**(uint256 index) ⇒ (uint256 _) _readonly_
181
+ def tokenByIndex(index)
182
+ do_call("tokenByIndex", index)
183
+ end
184
+ sig "tokenByIndex", inputs: ["uint256"], outputs: ["uint256"]
185
+
186
+ # function **tokenOfOwnerByIndex**(address owner, uint256 index) ⇒ (uint256 _) _readonly_
187
+ def tokenOfOwnerByIndex(owner, index)
188
+ do_call("tokenOfOwnerByIndex", owner, index)
189
+ end
190
+ sig "tokenOfOwnerByIndex", inputs: ["address","uint256"], outputs: ["uint256"]
191
+
192
+ # function **tokenURI**(uint256 tokenId) ⇒ (string _) _readonly_
193
+ def tokenURI(tokenId)
194
+ do_call("tokenURI", tokenId)
195
+ end
196
+ sig "tokenURI", inputs: ["uint256"], outputs: ["string"]
197
+
198
+ # function **totalSupply**() ⇒ (uint256 _) _readonly_
199
+ def totalSupply()
200
+ do_call("totalSupply")
201
+ end
202
+ sig "totalSupply", outputs: ["uint256"]
203
+
204
+ # function **votesToDelegate**(address delegator) ⇒ (uint96 _) _readonly_
205
+ def votesToDelegate(delegator)
206
+ do_call("votesToDelegate", delegator)
207
+ end
208
+ sig "votesToDelegate", inputs: ["address"], outputs: ["uint96"]
209
+
210
+ end ## class Nouns
211
+
@@ -0,0 +1,67 @@
1
+ # NounsAuctionHouse contract / (blockchain) services / function calls
2
+ #
3
+ # auto-generated via abigen (see https://rubygems.org/gems/abigen) on 2023-01-16 16:17:13 UTC
4
+ # - 9 query functions(s)
5
+ # - 0 helper functions(s)
6
+
7
+
8
+ class NounsAuctionHouse < Ethlite::Contract
9
+
10
+ address "0xf15a943787014461d94da08ad4040f79cd7c124e"
11
+
12
+ # function **auction**() ⇒ (uint256 nounId, uint256 amount, uint256 startTime, uint256 endTime, address payable bidder, bool settled) _readonly_
13
+ def auction()
14
+ do_call("auction")
15
+ end
16
+ sig "auction", outputs: ["uint256","uint256","uint256","uint256","address","bool"]
17
+
18
+ # function **duration**() ⇒ (uint256 _) _readonly_
19
+ def duration()
20
+ do_call("duration")
21
+ end
22
+ sig "duration", outputs: ["uint256"]
23
+
24
+ # function **minBidIncrementPercentage**() ⇒ (uint8 _) _readonly_
25
+ def minBidIncrementPercentage()
26
+ do_call("minBidIncrementPercentage")
27
+ end
28
+ sig "minBidIncrementPercentage", outputs: ["uint8"]
29
+
30
+ # function **nouns**() ⇒ (contract INounsToken _) _readonly_
31
+ def nouns()
32
+ do_call("nouns")
33
+ end
34
+ sig "nouns", outputs: ["address"]
35
+
36
+ # function **owner**() ⇒ (address _) _readonly_
37
+ def owner()
38
+ do_call("owner")
39
+ end
40
+ sig "owner", outputs: ["address"]
41
+
42
+ # function **paused**() ⇒ (bool _) _readonly_
43
+ def paused()
44
+ do_call("paused")
45
+ end
46
+ sig "paused", outputs: ["bool"]
47
+
48
+ # function **reservePrice**() ⇒ (uint256 _) _readonly_
49
+ def reservePrice()
50
+ do_call("reservePrice")
51
+ end
52
+ sig "reservePrice", outputs: ["uint256"]
53
+
54
+ # function **timeBuffer**() ⇒ (uint256 _) _readonly_
55
+ def timeBuffer()
56
+ do_call("timeBuffer")
57
+ end
58
+ sig "timeBuffer", outputs: ["uint256"]
59
+
60
+ # function **weth**() ⇒ (address _) _readonly_
61
+ def weth()
62
+ do_call("weth")
63
+ end
64
+ sig "weth", outputs: ["address"]
65
+
66
+ end ## class NounsAuctionHouse
67
+
@@ -0,0 +1,127 @@
1
+ # NounsDescriptor contract / (blockchain) services / function calls
2
+ #
3
+ # auto-generated via abigen (see https://rubygems.org/gems/abigen) on 2023-01-16 16:17:10 UTC
4
+ # - 19 query functions(s)
5
+ # - 0 helper functions(s)
6
+
7
+
8
+ class NounsDescriptor < Ethlite::Contract
9
+
10
+ address "0x0cfdb3ba1694c2bb2cfacb0339ad7b1ae5932b63"
11
+
12
+ # function **accessories**(uint256 _) ⇒ (bytes _) _readonly_
13
+ def accessories(arg0)
14
+ do_call("accessories", arg0)
15
+ end
16
+ sig "accessories", inputs: ["uint256"], outputs: ["bytes"]
17
+
18
+ # function **accessoryCount**() ⇒ (uint256 _) _readonly_
19
+ def accessoryCount()
20
+ do_call("accessoryCount")
21
+ end
22
+ sig "accessoryCount", outputs: ["uint256"]
23
+
24
+ # function **arePartsLocked**() ⇒ (bool _) _readonly_
25
+ def arePartsLocked()
26
+ do_call("arePartsLocked")
27
+ end
28
+ sig "arePartsLocked", outputs: ["bool"]
29
+
30
+ # function **backgroundCount**() ⇒ (uint256 _) _readonly_
31
+ def backgroundCount()
32
+ do_call("backgroundCount")
33
+ end
34
+ sig "backgroundCount", outputs: ["uint256"]
35
+
36
+ # function **backgrounds**(uint256 _) ⇒ (string _) _readonly_
37
+ def backgrounds(arg0)
38
+ do_call("backgrounds", arg0)
39
+ end
40
+ sig "backgrounds", inputs: ["uint256"], outputs: ["string"]
41
+
42
+ # function **baseURI**() ⇒ (string _) _readonly_
43
+ def baseURI()
44
+ do_call("baseURI")
45
+ end
46
+ sig "baseURI", outputs: ["string"]
47
+
48
+ # function **bodies**(uint256 _) ⇒ (bytes _) _readonly_
49
+ def bodies(arg0)
50
+ do_call("bodies", arg0)
51
+ end
52
+ sig "bodies", inputs: ["uint256"], outputs: ["bytes"]
53
+
54
+ # function **bodyCount**() ⇒ (uint256 _) _readonly_
55
+ def bodyCount()
56
+ do_call("bodyCount")
57
+ end
58
+ sig "bodyCount", outputs: ["uint256"]
59
+
60
+ # function **dataURI**(uint256 tokenId, struct INounsSeeder.Seed seed) ⇒ (string _) _readonly_
61
+ def dataURI(tokenId, seed)
62
+ do_call("dataURI", tokenId, seed)
63
+ end
64
+ sig "dataURI", inputs: ["uint256","(uint48,uint48,uint48,uint48,uint48)"], outputs: ["string"]
65
+
66
+ # function **generateSVGImage**(struct INounsSeeder.Seed seed) ⇒ (string _) _readonly_
67
+ def generateSVGImage(seed)
68
+ do_call("generateSVGImage", seed)
69
+ end
70
+ sig "generateSVGImage", inputs: ["(uint48,uint48,uint48,uint48,uint48)"], outputs: ["string"]
71
+
72
+ # function **genericDataURI**(string name, string description, struct INounsSeeder.Seed seed) ⇒ (string _) _readonly_
73
+ def genericDataURI(name, description, seed)
74
+ do_call("genericDataURI", name, description, seed)
75
+ end
76
+ sig "genericDataURI", inputs: ["string","string","(uint48,uint48,uint48,uint48,uint48)"], outputs: ["string"]
77
+
78
+ # function **glasses**(uint256 _) ⇒ (bytes _) _readonly_
79
+ def glasses(arg0)
80
+ do_call("glasses", arg0)
81
+ end
82
+ sig "glasses", inputs: ["uint256"], outputs: ["bytes"]
83
+
84
+ # function **glassesCount**() ⇒ (uint256 _) _readonly_
85
+ def glassesCount()
86
+ do_call("glassesCount")
87
+ end
88
+ sig "glassesCount", outputs: ["uint256"]
89
+
90
+ # function **headCount**() ⇒ (uint256 _) _readonly_
91
+ def headCount()
92
+ do_call("headCount")
93
+ end
94
+ sig "headCount", outputs: ["uint256"]
95
+
96
+ # function **heads**(uint256 _) ⇒ (bytes _) _readonly_
97
+ def heads(arg0)
98
+ do_call("heads", arg0)
99
+ end
100
+ sig "heads", inputs: ["uint256"], outputs: ["bytes"]
101
+
102
+ # function **isDataURIEnabled**() ⇒ (bool _) _readonly_
103
+ def isDataURIEnabled()
104
+ do_call("isDataURIEnabled")
105
+ end
106
+ sig "isDataURIEnabled", outputs: ["bool"]
107
+
108
+ # function **owner**() ⇒ (address _) _readonly_
109
+ def owner()
110
+ do_call("owner")
111
+ end
112
+ sig "owner", outputs: ["address"]
113
+
114
+ # function **palettes**(uint8 _, uint256 _) ⇒ (string _) _readonly_
115
+ def palettes(arg0, arg1)
116
+ do_call("palettes", arg0, arg1)
117
+ end
118
+ sig "palettes", inputs: ["uint8","uint256"], outputs: ["string"]
119
+
120
+ # function **tokenURI**(uint256 tokenId, struct INounsSeeder.Seed seed) ⇒ (string _) _readonly_
121
+ def tokenURI(tokenId, seed)
122
+ do_call("tokenURI", tokenId, seed)
123
+ end
124
+ sig "tokenURI", inputs: ["uint256","(uint48,uint48,uint48,uint48,uint48)"], outputs: ["string"]
125
+
126
+ end ## class NounsDescriptor
127
+
@@ -0,0 +1,145 @@
1
+ # NounsDescriptorV2 contract / (blockchain) services / function calls
2
+ #
3
+ # auto-generated via abigen (see https://rubygems.org/gems/abigen) on 2023-01-16 16:17:16 UTC
4
+ # - 22 query functions(s)
5
+ # - 0 helper functions(s)
6
+
7
+
8
+ class NounsDescriptorV2 < Ethlite::Contract
9
+
10
+ address "0x6229c811d04501523c6058bfaac29c91bb586268"
11
+
12
+ # function **accessories**(uint256 index) ⇒ (bytes _) _readonly_
13
+ def accessories(index)
14
+ do_call("accessories", index)
15
+ end
16
+ sig "accessories", inputs: ["uint256"], outputs: ["bytes"]
17
+
18
+ # function **accessoryCount**() ⇒ (uint256 _) _readonly_
19
+ def accessoryCount()
20
+ do_call("accessoryCount")
21
+ end
22
+ sig "accessoryCount", outputs: ["uint256"]
23
+
24
+ # function **arePartsLocked**() ⇒ (bool _) _readonly_
25
+ def arePartsLocked()
26
+ do_call("arePartsLocked")
27
+ end
28
+ sig "arePartsLocked", outputs: ["bool"]
29
+
30
+ # function **art**() ⇒ (contract INounsArt _) _readonly_
31
+ def art()
32
+ do_call("art")
33
+ end
34
+ sig "art", outputs: ["address"]
35
+
36
+ # function **backgroundCount**() ⇒ (uint256 _) _readonly_
37
+ def backgroundCount()
38
+ do_call("backgroundCount")
39
+ end
40
+ sig "backgroundCount", outputs: ["uint256"]
41
+
42
+ # function **backgrounds**(uint256 index) ⇒ (string _) _readonly_
43
+ def backgrounds(index)
44
+ do_call("backgrounds", index)
45
+ end
46
+ sig "backgrounds", inputs: ["uint256"], outputs: ["string"]
47
+
48
+ # function **baseURI**() ⇒ (string _) _readonly_
49
+ def baseURI()
50
+ do_call("baseURI")
51
+ end
52
+ sig "baseURI", outputs: ["string"]
53
+
54
+ # function **bodies**(uint256 index) ⇒ (bytes _) _readonly_
55
+ def bodies(index)
56
+ do_call("bodies", index)
57
+ end
58
+ sig "bodies", inputs: ["uint256"], outputs: ["bytes"]
59
+
60
+ # function **bodyCount**() ⇒ (uint256 _) _readonly_
61
+ def bodyCount()
62
+ do_call("bodyCount")
63
+ end
64
+ sig "bodyCount", outputs: ["uint256"]
65
+
66
+ # function **dataURI**(uint256 tokenId, struct INounsSeeder.Seed seed) ⇒ (string _) _readonly_
67
+ def dataURI(tokenId, seed)
68
+ do_call("dataURI", tokenId, seed)
69
+ end
70
+ sig "dataURI", inputs: ["uint256","(uint48,uint48,uint48,uint48,uint48)"], outputs: ["string"]
71
+
72
+ # function **generateSVGImage**(struct INounsSeeder.Seed seed) ⇒ (string _) _readonly_
73
+ def generateSVGImage(seed)
74
+ do_call("generateSVGImage", seed)
75
+ end
76
+ sig "generateSVGImage", inputs: ["(uint48,uint48,uint48,uint48,uint48)"], outputs: ["string"]
77
+
78
+ # function **genericDataURI**(string name, string description, struct INounsSeeder.Seed seed) ⇒ (string _) _readonly_
79
+ def genericDataURI(name, description, seed)
80
+ do_call("genericDataURI", name, description, seed)
81
+ end
82
+ sig "genericDataURI", inputs: ["string","string","(uint48,uint48,uint48,uint48,uint48)"], outputs: ["string"]
83
+
84
+ # function **getPartsForSeed**(struct INounsSeeder.Seed seed) ⇒ (struct ISVGRenderer.Part[] _) _readonly_
85
+ def getPartsForSeed(seed)
86
+ do_call("getPartsForSeed", seed)
87
+ end
88
+ sig "getPartsForSeed", inputs: ["(uint48,uint48,uint48,uint48,uint48)"], outputs: ["(bytes,bytes)[]"]
89
+
90
+ # function **glasses**(uint256 index) ⇒ (bytes _) _readonly_
91
+ def glasses(index)
92
+ do_call("glasses", index)
93
+ end
94
+ sig "glasses", inputs: ["uint256"], outputs: ["bytes"]
95
+
96
+ # function **glassesCount**() ⇒ (uint256 _) _readonly_
97
+ def glassesCount()
98
+ do_call("glassesCount")
99
+ end
100
+ sig "glassesCount", outputs: ["uint256"]
101
+
102
+ # function **headCount**() ⇒ (uint256 _) _readonly_
103
+ def headCount()
104
+ do_call("headCount")
105
+ end
106
+ sig "headCount", outputs: ["uint256"]
107
+
108
+ # function **heads**(uint256 index) ⇒ (bytes _) _readonly_
109
+ def heads(index)
110
+ do_call("heads", index)
111
+ end
112
+ sig "heads", inputs: ["uint256"], outputs: ["bytes"]
113
+
114
+ # function **isDataURIEnabled**() ⇒ (bool _) _readonly_
115
+ def isDataURIEnabled()
116
+ do_call("isDataURIEnabled")
117
+ end
118
+ sig "isDataURIEnabled", outputs: ["bool"]
119
+
120
+ # function **owner**() ⇒ (address _) _readonly_
121
+ def owner()
122
+ do_call("owner")
123
+ end
124
+ sig "owner", outputs: ["address"]
125
+
126
+ # function **palettes**(uint8 index) ⇒ (bytes _) _readonly_
127
+ def palettes(index)
128
+ do_call("palettes", index)
129
+ end
130
+ sig "palettes", inputs: ["uint8"], outputs: ["bytes"]
131
+
132
+ # function **renderer**() ⇒ (contract ISVGRenderer _) _readonly_
133
+ def renderer()
134
+ do_call("renderer")
135
+ end
136
+ sig "renderer", outputs: ["address"]
137
+
138
+ # function **tokenURI**(uint256 tokenId, struct INounsSeeder.Seed seed) ⇒ (string _) _readonly_
139
+ def tokenURI(tokenId, seed)
140
+ do_call("tokenURI", tokenId, seed)
141
+ end
142
+ sig "tokenURI", inputs: ["uint256","(uint48,uint48,uint48,uint48,uint48)"], outputs: ["string"]
143
+
144
+ end ## class NounsDescriptorV2
145
+
@@ -0,0 +1,19 @@
1
+ # NounsSeeder contract / (blockchain) services / function calls
2
+ #
3
+ # auto-generated via abigen (see https://rubygems.org/gems/abigen) on 2023-01-16 16:17:10 UTC
4
+ # - 1 query functions(s)
5
+ # - 0 helper functions(s)
6
+
7
+
8
+ class NounsSeeder < Ethlite::Contract
9
+
10
+ address "0xcc8a0fb5ab3c7132c1b2a0109142fb112c4ce515"
11
+
12
+ # function **generateSeed**(uint256 nounId, contract INounsDescriptor descriptor) ⇒ (struct INounsSeeder.Seed _) _readonly_
13
+ def generateSeed(nounId, descriptor)
14
+ do_call("generateSeed", nounId, descriptor)
15
+ end
16
+ sig "generateSeed", inputs: ["uint256","address"], outputs: ["(uint48,uint48,uint48,uint48,uint48)"]
17
+
18
+ end ## class NounsSeeder
19
+
@@ -0,0 +1,104 @@
1
+ # SynthNouns contract / (blockchain) services / function calls
2
+ #
3
+ # auto-generated via abigen (see https://rubygems.org/gems/abigen) on 2023-01-16 16:17:17 UTC
4
+ # - 14 query functions(s)
5
+ # - 1 helper functions(s)
6
+
7
+
8
+ class SynthNouns < Ethlite::Contract
9
+
10
+ address "0x8761b55af5a703d5855f1865db8fe4dd18e94c53"
11
+
12
+ # function **addressPreview**(address _address) ⇒ (string _) _readonly_
13
+ def addressPreview(_address)
14
+ do_call("addressPreview", _address)
15
+ end
16
+ sig "addressPreview", inputs: ["address"], outputs: ["string"]
17
+
18
+ # function **balanceOf**(address owner) ⇒ (uint256 _) _readonly_
19
+ def balanceOf(owner)
20
+ do_call("balanceOf", owner)
21
+ end
22
+ sig "balanceOf", inputs: ["address"], outputs: ["uint256"]
23
+
24
+ # function **claimed**(address _) ⇒ (bool _) _readonly_
25
+ def claimed(arg0)
26
+ do_call("claimed", arg0)
27
+ end
28
+ sig "claimed", inputs: ["address"], outputs: ["bool"]
29
+
30
+ # function **claimerOf**(uint256 _) ⇒ (address _) _readonly_
31
+ def claimerOf(arg0)
32
+ do_call("claimerOf", arg0)
33
+ end
34
+ sig "claimerOf", inputs: ["uint256"], outputs: ["address"]
35
+
36
+ # function **descriptor**() ⇒ (contract INounsDescriptor _) _readonly_
37
+ def descriptor()
38
+ do_call("descriptor")
39
+ end
40
+ sig "descriptor", outputs: ["address"]
41
+
42
+ # function **getApproved**(uint256 tokenId) ⇒ (address _) _readonly_
43
+ def getApproved(tokenId)
44
+ do_call("getApproved", tokenId)
45
+ end
46
+ sig "getApproved", inputs: ["uint256"], outputs: ["address"]
47
+
48
+ # function **isApprovedForAll**(address owner, address operator) ⇒ (bool _) _readonly_
49
+ def isApprovedForAll(owner, operator)
50
+ do_call("isApprovedForAll", owner, operator)
51
+ end
52
+ sig "isApprovedForAll", inputs: ["address","address"], outputs: ["bool"]
53
+
54
+ # function **name**() ⇒ (string _) _readonly_
55
+ def name()
56
+ do_call("name")
57
+ end
58
+ sig "name", outputs: ["string"]
59
+
60
+ # function **ownerOf**(uint256 tokenId) ⇒ (address _) _readonly_
61
+ def ownerOf(tokenId)
62
+ do_call("ownerOf", tokenId)
63
+ end
64
+ sig "ownerOf", inputs: ["uint256"], outputs: ["address"]
65
+
66
+ # function **reverseRecords**() ⇒ (contract IENSReverseRecords _) _readonly_
67
+ def reverseRecords()
68
+ do_call("reverseRecords")
69
+ end
70
+ sig "reverseRecords", outputs: ["address"]
71
+
72
+ # function **seeds**(uint256 _) ⇒ (uint48 background, uint48 body, uint48 accessory, uint48 head, uint48 glasses) _readonly_
73
+ def seeds(arg0)
74
+ do_call("seeds", arg0)
75
+ end
76
+ sig "seeds", inputs: ["uint256"], outputs: ["uint48","uint48","uint48","uint48","uint48"]
77
+
78
+ # function **supportsInterface**(bytes4 interfaceId) ⇒ (bool _) _readonly_
79
+ def supportsInterface(interfaceId)
80
+ do_call("supportsInterface", interfaceId)
81
+ end
82
+ sig "supportsInterface", inputs: ["bytes4"], outputs: ["bool"]
83
+
84
+ # function **symbol**() ⇒ (string _) _readonly_
85
+ def symbol()
86
+ do_call("symbol")
87
+ end
88
+ sig "symbol", outputs: ["string"]
89
+
90
+ # function **tokenURI**(uint256 _tokenId) ⇒ (string _) _readonly_
91
+ def tokenURI(_tokenId)
92
+ do_call("tokenURI", _tokenId)
93
+ end
94
+ sig "tokenURI", inputs: ["uint256"], outputs: ["string"]
95
+
96
+
97
+ # function **getSeedInput**(address _address) ⇒ (uint256 _) _readonly_
98
+ def getSeedInput(_address)
99
+ do_call("getSeedInput", _address)
100
+ end
101
+ sig "getSeedInput", inputs: ["address"], outputs: ["uint256"]
102
+
103
+ end ## class SynthNouns
104
+
@@ -13,7 +13,7 @@ require_relative 'ethlite/contract'
13
13
  ### generated contracts via abigen
14
14
  require_relative 'ethlite/contracts/punks_v1'
15
15
  require_relative 'ethlite/contracts/punk_blocks'
16
- require_relative 'ethlite/contracts/punk_meta'
16
+ require_relative 'ethlite/contracts/punks_meta'
17
17
 
18
18
  require_relative 'ethlite/contracts/mooncats'
19
19
  require_relative 'ethlite/contracts/phunks_v2'
@@ -23,3 +23,9 @@ require_relative 'ethlite/contracts/moonbirds'
23
23
  require_relative 'ethlite/contracts/marcs'
24
24
  require_relative 'ethlite/contracts/mad_camels'
25
25
 
26
+ require_relative 'ethlite/contracts/nouns'
27
+ require_relative 'ethlite/contracts/nouns_auction_house'
28
+ require_relative 'ethlite/contracts/nouns_seeder'
29
+ require_relative 'ethlite/contracts/nouns_descriptor'
30
+ require_relative 'ethlite/contracts/nouns_descriptor_v2'
31
+ require_relative 'ethlite/contracts/synth_nouns'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ethlite-contracts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-15 00:00:00.000000000 Z
11
+ date: 2023-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ethlite
@@ -79,11 +79,17 @@ files:
79
79
  - lib/ethlite/contracts/marcs.rb
80
80
  - lib/ethlite/contracts/moonbirds.rb
81
81
  - lib/ethlite/contracts/mooncats.rb
82
+ - lib/ethlite/contracts/nouns.rb
83
+ - lib/ethlite/contracts/nouns_auction_house.rb
84
+ - lib/ethlite/contracts/nouns_descriptor.rb
85
+ - lib/ethlite/contracts/nouns_descriptor_v2.rb
86
+ - lib/ethlite/contracts/nouns_seeder.rb
82
87
  - lib/ethlite/contracts/phunks_v2.rb
83
88
  - lib/ethlite/contracts/punk_blocks.rb
84
89
  - lib/ethlite/contracts/punks_data.rb
85
90
  - lib/ethlite/contracts/punks_meta.rb
86
91
  - lib/ethlite/contracts/punks_v1.rb
92
+ - lib/ethlite/contracts/synth_nouns.rb
87
93
  - lib/ethlite/contracts/synth_punks.rb
88
94
  homepage: https://github.com/rubycocos/blockchain
89
95
  licenses: