ethlite-contracts 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,80 @@
1
+ # PunksMeta contract / (blockchain) services / function calls
2
+ #
3
+ # auto-generated via abigen (see https://rubygems.org/gems/abigen) on 2023-01-15 16:36:56 UTC
4
+ # - 3 query functions(s)
5
+ # - 1 helper functions(s)
6
+ #
7
+ #
8
+ # - Author: 0xTycoon. Includes Base64 functionality from OpenZeppelin and builds on top of the on-chain Punks data contact deployed by Larva Labs as described here https://www.larvalabs.com/blog/2021-8-18-18-0/on-chain-cryptopunks
9
+ # - Version: 0.0.2
10
+ # - Pragma: solidity ^0.8.17
11
+ #
12
+ #
13
+ # █████ ██████
14
+ # █ █ █████ █ █ █████ █████ ████ █ █ █ █ █ █ █ █ ████
15
+ # █ █ █ █ █ █ █ █ █ █ █ █ █ █ ██ █ █ █ █
16
+ # █ █ █ █ █ █ █ █ █ ██████ █ █ █ █ █ ████ ████
17
+ # █ █████ █ █████ █ █ █ █ █ █ █ █ █ █ █ █
18
+ # █ █ █ █ █ █ █ █ █ █ █ █ █ ██ █ █ █ █
19
+ # █████ █ █ █ █ █ ████ █ ████ █ █ █ █ ████
20
+ #
21
+ # ███████ █ █
22
+ # █ ████ █ █ ██████ █ █ █ █ █████ █
23
+ # █ █ █ █ █ █ ██ █ █ █ █ █ █
24
+ # █ █ █ ████ █████ █ █ █ █ █ █ █ █
25
+ # █ █ █ █ █ █ █ █ █ █ █ █████ █
26
+ # █ █ █ █ █ █ █ ██ █ █ █ █ █
27
+ # █ ████ █ █ ██████ █ █ █████ █ █ █
28
+ #
29
+ #
30
+ # Punks's missing tokenURI function
31
+
32
+
33
+ class PunksMeta < Ethlite::Contract
34
+
35
+ address "0xd8e916c3016be144eb2907778cf972c4b01645fC"
36
+
37
+ # function getAttributes(uint256 _tokenId) returns (string)
38
+ #
39
+ # getAttributes calls parseAttributes and returns the result as JSON
40
+ # @param _tokenId the punk id
41
+ def getAttributes(_tokenId)
42
+ do_call("getAttributes", _tokenId)
43
+ end
44
+ sig "getAttributes", inputs: ["uint256"], outputs: ["string"]
45
+
46
+ # function parseAttributes(uint256 _tokenId) returns (string[8])
47
+ #
48
+ # parseAttributes returns an array of punk attributes. 8 rows in total
49
+ # The first row is the Type, and next seven rows are the attributes.
50
+ # The values are fetched form the CryptoPunksData contract and then the
51
+ # string is parsed.
52
+ # @param _tokenId the punk id
53
+ def parseAttributes(_tokenId)
54
+ do_call("parseAttributes", _tokenId)
55
+ end
56
+ sig "parseAttributes", inputs: ["uint256"], outputs: ["string[8]"]
57
+
58
+ # function tokenURI(uint256 _tokenId) returns (string)
59
+ #
60
+ # tokenURI gets the metadata about a punk and returns as a JSON
61
+ # formatted string, according to the ERC721 schema and market
62
+ # recommendations. It also embeds the SVG data.
63
+ # The attributes and SVG data are fetched form the CryptoPunksData
64
+ # contract, which stores all the CryptoPunks metadata on-chain.
65
+ # @param _tokenId the punk id
66
+ def tokenURI(_tokenId)
67
+ do_call("tokenURI", _tokenId)
68
+ end
69
+ sig "tokenURI", inputs: ["uint256"], outputs: ["string"]
70
+
71
+
72
+ # function intToString(uint256 value) returns (string)
73
+ #
74
+ def intToString(value)
75
+ do_call("intToString", value)
76
+ end
77
+ sig "intToString", inputs: ["uint256"], outputs: ["string"]
78
+
79
+ end ## class PunksMeta
80
+
@@ -1,38 +1,32 @@
1
- #########################
2
1
  # PunksV1 contract / (blockchain) services / function calls
3
- # auto-generated via abigen (see https://rubygems.org/gems/abigen) on 2023-01-12 17:17:29 UTC
2
+ #
3
+ # auto-generated via abigen (see https://rubygems.org/gems/abigen) on 2023-01-15 16:36:57 UTC
4
4
  # - 14 query functions(s)
5
-
5
+ # - 0 helper functions(s)
6
+ #
7
+ #
6
8
  # - Pragma: solidity ^0.4.8
7
- #
8
- #
9
+ #
10
+ #
9
11
  # **Data Structures**
10
- #
11
- #
12
- # ```
13
- # struct Offer {
14
- # bool isForSale;
15
- # uint punkIndex;
16
- # address seller;
17
- # uint minValue; // in ether
18
- # address onlySellTo; // specify to sell only to a specific person
19
- # }
20
- # ```
21
- #
12
+ #
13
+ #
14
+ # struct Offer {
15
+ # bool isForSale;
16
+ # uint punkIndex;
17
+ # address seller;
18
+ # uint minValue; // in ether
19
+ # address onlySellTo; // specify to sell only to a specific person
20
+ # }
21
+ #
22
22
  # **Events**
23
- #
24
- # ```
25
- # event Assign(address indexed to, uint256 punkIndex)
26
- # event Transfer(address indexed from, address indexed to, uint256 value)
27
- # event PunkTransfer(address indexed from, address indexed to, uint256 punkIndex)
28
- # event PunkOffered(uint indexed punkIndex, uint minValue, address indexed toAddress)
29
- # event PunkBought(uint indexed punkIndex, uint value, address indexed fromAddress, address indexed toAddress)
30
- # event PunkNoLongerForSale(uint indexed punkIndex)
31
- # ```
32
- #
33
- #
34
- #
35
- #
23
+ #
24
+ # event Assign(address indexed to, uint256 punkIndex)
25
+ # event Transfer(address indexed from, address indexed to, uint256 value)
26
+ # event PunkTransfer(address indexed from, address indexed to, uint256 punkIndex)
27
+ # event PunkOffered(uint indexed punkIndex, uint minValue, address indexed toAddress)
28
+ # event PunkBought(uint indexed punkIndex, uint value, address indexed fromAddress, address indexed toAddress)
29
+ # event PunkNoLongerForSale(uint indexed punkIndex)
36
30
 
37
31
 
38
32
  class PunksV1 < Ethlite::Contract
@@ -41,119 +35,104 @@ class PunksV1 < Ethlite::Contract
41
35
 
42
36
  # storage - string public name
43
37
  #
44
- sig "name", outputs: ["string"]
45
38
  def name()
46
39
  do_call("name")
47
40
  end
41
+ sig "name", outputs: ["string"]
48
42
 
49
43
  # storage - mapping (uint => Offer) public punksOfferedForSale
50
44
  #
51
- #
52
45
  # A record of punks that are offered for sale at a specific minimum value, and perhaps to a specific person
53
- #
54
- sig "punksOfferedForSale", inputs: ["uint256"], outputs: ["bool","uint256","address","uint256","address"]
55
46
  def punksOfferedForSale(arg0)
56
47
  do_call("punksOfferedForSale", arg0)
57
48
  end
49
+ sig "punksOfferedForSale", inputs: ["uint256"], outputs: ["bool","uint256","address","uint256","address"]
58
50
 
59
51
  # storage - uint256 public totalSupply
60
52
  #
61
- #
62
- sig "totalSupply", outputs: ["uint256"]
63
53
  def totalSupply()
64
54
  do_call("totalSupply")
65
55
  end
56
+ sig "totalSupply", outputs: ["uint256"]
66
57
 
67
58
  # storage - uint8 public decimals
68
59
  #
69
- sig "decimals", outputs: ["uint8"]
70
60
  def decimals()
71
61
  do_call("decimals")
72
62
  end
63
+ sig "decimals", outputs: ["uint8"]
73
64
 
74
65
  # storage - string public imageHash
75
66
  #
76
- #
77
67
  # You can use this hash to verify the image file containing all the punks
78
- #
79
- sig "imageHash", outputs: ["string"]
80
68
  def imageHash()
81
69
  do_call("imageHash")
82
70
  end
71
+ sig "imageHash", outputs: ["string"]
83
72
 
84
73
  # storage - uint public nextPunkIndexToAssign
85
74
  #
86
- #
87
- sig "nextPunkIndexToAssign", outputs: ["uint256"]
88
75
  def nextPunkIndexToAssign()
89
76
  do_call("nextPunkIndexToAssign")
90
77
  end
78
+ sig "nextPunkIndexToAssign", outputs: ["uint256"]
91
79
 
92
80
  # storage - mapping (uint => address) public punkIndexToAddress
93
81
  #
94
- #
95
- #
96
- sig "punkIndexToAddress", inputs: ["uint256"], outputs: ["address"]
97
82
  def punkIndexToAddress(arg0)
98
83
  do_call("punkIndexToAddress", arg0)
99
84
  end
85
+ sig "punkIndexToAddress", inputs: ["uint256"], outputs: ["address"]
100
86
 
101
87
  # storage - string public standard
102
88
  #
103
- #
104
- sig "standard", outputs: ["string"]
105
89
  def standard()
106
90
  do_call("standard")
107
91
  end
92
+ sig "standard", outputs: ["string"]
108
93
 
109
94
  # storage - mapping (address => uint256) public balanceOf
110
95
  #
111
96
  # This creates an array with all balances
112
- #
113
- #
114
- sig "balanceOf", inputs: ["address"], outputs: ["uint256"]
115
97
  def balanceOf(arg0)
116
98
  do_call("balanceOf", arg0)
117
99
  end
100
+ sig "balanceOf", inputs: ["address"], outputs: ["uint256"]
118
101
 
119
102
  # storage - string public symbol
120
103
  #
121
- sig "symbol", outputs: ["string"]
122
104
  def symbol()
123
105
  do_call("symbol")
124
106
  end
107
+ sig "symbol", outputs: ["string"]
125
108
 
126
109
  # storage - uint public numberOfPunksToReserve
127
110
  #
128
- sig "numberOfPunksToReserve", outputs: ["uint256"]
129
111
  def numberOfPunksToReserve()
130
112
  do_call("numberOfPunksToReserve")
131
113
  end
114
+ sig "numberOfPunksToReserve", outputs: ["uint256"]
132
115
 
133
116
  # storage - uint public numberOfPunksReserved
134
117
  #
135
- #
136
- sig "numberOfPunksReserved", outputs: ["uint256"]
137
118
  def numberOfPunksReserved()
138
119
  do_call("numberOfPunksReserved")
139
120
  end
121
+ sig "numberOfPunksReserved", outputs: ["uint256"]
140
122
 
141
123
  # storage - uint public punksRemainingToAssign
142
124
  #
143
- sig "punksRemainingToAssign", outputs: ["uint256"]
144
125
  def punksRemainingToAssign()
145
126
  do_call("punksRemainingToAssign")
146
127
  end
128
+ sig "punksRemainingToAssign", outputs: ["uint256"]
147
129
 
148
130
  # storage - mapping (address => uint) public pendingWithdrawals
149
131
  #
150
- #
151
- #
152
- #
153
- sig "pendingWithdrawals", inputs: ["address"], outputs: ["uint256"]
154
132
  def pendingWithdrawals(arg0)
155
133
  do_call("pendingWithdrawals", arg0)
156
134
  end
135
+ sig "pendingWithdrawals", inputs: ["address"], outputs: ["uint256"]
157
136
 
158
137
  end ## class PunksV1
159
138
 
@@ -0,0 +1,182 @@
1
+ # SynthPunks contract / (blockchain) services / function calls
2
+ #
3
+ # auto-generated via abigen (see https://rubygems.org/gems/abigen) on 2023-01-15 16:36:48 UTC
4
+ # - 20 query functions(s)
5
+ # - 8 helper functions(s)
6
+
7
+
8
+ class SynthPunks < Ethlite::Contract
9
+
10
+ address "0xaf9ce4b327a3b690abea6f78eccbfefffbea9fdf"
11
+
12
+ # function **_getAttributes**(address _address) ⇒ (uint256[] _) _readonly_
13
+ def _getAttributes(_address)
14
+ do_call("_getAttributes", _address)
15
+ end
16
+ sig "_getAttributes", inputs: ["address"], outputs: ["uint256[]"]
17
+
18
+ # function **_tokenURI**(address _address) ⇒ (string _) _readonly_
19
+ def _tokenURI(_address)
20
+ do_call("_tokenURI", _address)
21
+ end
22
+ sig "_tokenURI", inputs: ["address"], outputs: ["string"]
23
+
24
+ # function **assets**() ⇒ (contract ISyntheticPunksAssets _) _readonly_
25
+ def assets()
26
+ do_call("assets")
27
+ end
28
+ sig "assets", outputs: ["address"]
29
+
30
+ # function **balanceOf**(address _) ⇒ (uint256 _) _readonly_
31
+ def balanceOf(arg0)
32
+ do_call("balanceOf", arg0)
33
+ end
34
+ sig "balanceOf", inputs: ["address"], outputs: ["uint256"]
35
+
36
+ # function **claimMessage**() ⇒ (string _) _readonly_
37
+ def claimMessage()
38
+ do_call("claimMessage")
39
+ end
40
+ sig "claimMessage", outputs: ["string"]
41
+
42
+ # function **claimPrice**() ⇒ (uint256 _) _readonly_
43
+ def claimPrice()
44
+ do_call("claimPrice")
45
+ end
46
+ sig "claimPrice", outputs: ["uint256"]
47
+
48
+ # function **claimed**(address _) ⇒ (bool _) _readonly_
49
+ def claimed(arg0)
50
+ do_call("claimed", arg0)
51
+ end
52
+ sig "claimed", inputs: ["address"], outputs: ["bool"]
53
+
54
+ # function **generatePunkSVG**(uint256[] layers) ⇒ (string _) _readonly_
55
+ def generatePunkSVG(layers)
56
+ do_call("generatePunkSVG", layers)
57
+ end
58
+ sig "generatePunkSVG", inputs: ["uint256[]"], outputs: ["string"]
59
+
60
+ # function **getApproved**(uint256 _) ⇒ (address _) _readonly_
61
+ def getApproved(arg0)
62
+ do_call("getApproved", arg0)
63
+ end
64
+ sig "getApproved", inputs: ["uint256"], outputs: ["address"]
65
+
66
+ # function **getAttribute**(uint256 id, uint256 _attributeId) ⇒ (uint256 _) _readonly_
67
+ def getAttribute(id, _attributeId)
68
+ do_call("getAttribute", id, _attributeId)
69
+ end
70
+ sig "getAttribute", inputs: ["uint256","uint256"], outputs: ["uint256"]
71
+
72
+ # function **getAttributeCategories**(uint256 id) ⇒ (uint256[] _) _readonly_
73
+ def getAttributeCategories(id)
74
+ do_call("getAttributeCategories", id)
75
+ end
76
+ sig "getAttributeCategories", inputs: ["uint256"], outputs: ["uint256[]"]
77
+
78
+ # function **getAttributes**(uint256 id) ⇒ (uint256[] _) _readonly_
79
+ def getAttributes(id)
80
+ do_call("getAttributes", id)
81
+ end
82
+ sig "getAttributes", inputs: ["uint256"], outputs: ["uint256[]"]
83
+
84
+ # function **getGender**(uint256 id) ⇒ (enum SyntheticPunks.Gender _) _readonly_
85
+ def getGender(id)
86
+ do_call("getGender", id)
87
+ end
88
+ sig "getGender", inputs: ["uint256"], outputs: ["uint8"]
89
+
90
+ # function **isApprovedForAll**(address _, address _) ⇒ (bool _) _readonly_
91
+ def isApprovedForAll(arg0, arg1)
92
+ do_call("isApprovedForAll", arg0, arg1)
93
+ end
94
+ sig "isApprovedForAll", inputs: ["address","address"], outputs: ["bool"]
95
+
96
+ # function **name**() ⇒ (string _) _readonly_
97
+ def name()
98
+ do_call("name")
99
+ end
100
+ sig "name", outputs: ["string"]
101
+
102
+ # function **ownerOf**(uint256 _) ⇒ (address _) _readonly_
103
+ def ownerOf(arg0)
104
+ do_call("ownerOf", arg0)
105
+ end
106
+ sig "ownerOf", inputs: ["uint256"], outputs: ["address"]
107
+
108
+ # function **randomUint**(uint256 seed, uint256 offset) ⇒ (uint256 _) _readonly_
109
+ def randomUint(seed, offset)
110
+ do_call("randomUint", seed, offset)
111
+ end
112
+ sig "randomUint", inputs: ["uint256","uint256"], outputs: ["uint256"]
113
+
114
+ # function **symbol**() ⇒ (string _) _readonly_
115
+ def symbol()
116
+ do_call("symbol")
117
+ end
118
+ sig "symbol", outputs: ["string"]
119
+
120
+ # function **tokenURI**(uint256 id) ⇒ (string _) _readonly_
121
+ def tokenURI(id)
122
+ do_call("tokenURI", id)
123
+ end
124
+ sig "tokenURI", inputs: ["uint256"], outputs: ["string"]
125
+
126
+ # function **withdrawAddress**() ⇒ (address _) _readonly_
127
+ def withdrawAddress()
128
+ do_call("withdrawAddress")
129
+ end
130
+ sig "withdrawAddress", outputs: ["address"]
131
+
132
+
133
+ # function **getAddress**(uint256 id) ⇒ (address _) _readonly_
134
+ def getAddress(id)
135
+ do_call("getAddress", id)
136
+ end
137
+ sig "getAddress", inputs: ["uint256"], outputs: ["address"]
138
+
139
+ # function **getEthSignedMessageHash**(bytes32 _messageHash) ⇒ (bytes32 _) _readonly_
140
+ def getEthSignedMessageHash(_messageHash)
141
+ do_call("getEthSignedMessageHash", _messageHash)
142
+ end
143
+ sig "getEthSignedMessageHash", inputs: ["bytes32"], outputs: ["bytes32"]
144
+
145
+ # function **getMessageHash**(string _message) ⇒ (bytes32 _) _readonly_
146
+ def getMessageHash(_message)
147
+ do_call("getMessageHash", _message)
148
+ end
149
+ sig "getMessageHash", inputs: ["string"], outputs: ["bytes32"]
150
+
151
+ # function **getTokenID**(address _address) ⇒ (uint256 _) _readonly_
152
+ def getTokenID(_address)
153
+ do_call("getTokenID", _address)
154
+ end
155
+ sig "getTokenID", inputs: ["address"], outputs: ["uint256"]
156
+
157
+ # function **recoverSigner**(bytes32 _ethSignedMessageHash, bytes _signature) ⇒ (address _) _readonly_
158
+ def recoverSigner(_ethSignedMessageHash, _signature)
159
+ do_call("recoverSigner", _ethSignedMessageHash, _signature)
160
+ end
161
+ sig "recoverSigner", inputs: ["bytes32","bytes"], outputs: ["address"]
162
+
163
+ # function **splitSignature**(bytes sig) ⇒ (bytes32 r, bytes32 s, uint8 v) _readonly_
164
+ def splitSignature(sig)
165
+ do_call("splitSignature", sig)
166
+ end
167
+ sig "splitSignature", inputs: ["bytes"], outputs: ["bytes32","bytes32","uint8"]
168
+
169
+ # function **supportsInterface**(bytes4 interfaceId) ⇒ (bool _) _readonly_
170
+ def supportsInterface(interfaceId)
171
+ do_call("supportsInterface", interfaceId)
172
+ end
173
+ sig "supportsInterface", inputs: ["bytes4"], outputs: ["bool"]
174
+
175
+ # function **verify**(address _signer, string _message, bytes signature) ⇒ (bool _) _readonly_
176
+ def verify(_signer, _message, signature)
177
+ do_call("verify", _signer, _message, signature)
178
+ end
179
+ sig "verify", inputs: ["address","string","bytes"], outputs: ["bool"]
180
+
181
+ end ## class SynthPunks
182
+
@@ -4,7 +4,7 @@ require 'ethlite'
4
4
 
5
5
 
6
6
 
7
- ## out own code
7
+ ## our own code
8
8
 
9
9
  # shared base contract machinery - keep here
10
10
  ## or rename to Base or such - why? why not?
@@ -13,5 +13,13 @@ 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
-
16
+ require_relative 'ethlite/contracts/punk_meta'
17
+
18
+ require_relative 'ethlite/contracts/mooncats'
19
+ require_relative 'ethlite/contracts/phunks_v2'
20
+ require_relative 'ethlite/contracts/punks_data'
21
+ require_relative 'ethlite/contracts/synth_punks'
22
+ require_relative 'ethlite/contracts/moonbirds'
23
+ require_relative 'ethlite/contracts/marcs'
24
+ require_relative 'ethlite/contracts/mad_camels'
17
25
 
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.0
4
+ version: 0.1.2
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-12 00:00:00.000000000 Z
11
+ date: 2023-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ethlite
@@ -75,8 +75,16 @@ files:
75
75
  - lib/ethlite-contracts.rb
76
76
  - lib/ethlite/contract.rb
77
77
  - lib/ethlite/contracts.rb
78
+ - lib/ethlite/contracts/mad_camels.rb
79
+ - lib/ethlite/contracts/marcs.rb
80
+ - lib/ethlite/contracts/moonbirds.rb
81
+ - lib/ethlite/contracts/mooncats.rb
82
+ - lib/ethlite/contracts/phunks_v2.rb
78
83
  - lib/ethlite/contracts/punk_blocks.rb
84
+ - lib/ethlite/contracts/punks_data.rb
85
+ - lib/ethlite/contracts/punks_meta.rb
79
86
  - lib/ethlite/contracts/punks_v1.rb
87
+ - lib/ethlite/contracts/synth_punks.rb
80
88
  homepage: https://github.com/rubycocos/blockchain
81
89
  licenses:
82
90
  - Public Domain