cryptopunks 3.0.0 → 2024.2.29

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: 9b204b14496484cc10de9a664c401d7b2fe245c95aa8298350771637ff19273e
4
- data.tar.gz: 87b5acff245bc8c14a4632e1424c0976ace02c7f0fa97c9fd1834a14259aaa67
3
+ metadata.gz: 87c03c79927af52b3756913e3a08942cbf07334520ca360d7832ec69bdd4d8db
4
+ data.tar.gz: ae8e96d0926920951cf1154e218e4535f7f5559bb79a7bcc5225fb701a1a8669
5
5
  SHA512:
6
- metadata.gz: f5ccab1f234b543ec3138840cfbd659edc50a2a05e1a416bb1abc13ceba334c6ad8e689abe1b98a6027cce646c055d8246c23e77e09ffc578303049b0a2d5d3f
7
- data.tar.gz: a2bd9289d237e199b6b1e099f58ab66de6a2d5b195c3947ee44a36ea8b697c1c1bbb079044edcc6e3adea81cdd45f21d4bc122672e789323caae77fd71fbc00d
6
+ metadata.gz: d5c4037f12c60031af368c7b296732a9fc28c155efa218dd988ef0ed29bb28dcd816ae8c7777bb668591fb4bd1208bdc77f463ecc50f7cbb286d98e0c8791c01
7
+ data.tar.gz: a629cb29a1caf1f97b678f5305d591b2d61c29bbadb69e3bc51a2754a56c53fc3345fb4b5669f55df12db7ca96a69ebce584dc3cbf630ca07b82e57119afe85e
data/Manifest.txt CHANGED
@@ -11,8 +11,5 @@ lib/cryptopunks/composite.rb
11
11
  lib/cryptopunks/contract/punksdata-assets.rb
12
12
  lib/cryptopunks/contract/punksdata-contract.rb
13
13
  lib/cryptopunks/contract/punksdata-meta.rb
14
- lib/cryptopunks/dataset.rb
15
- lib/cryptopunks/image.rb
16
- lib/cryptopunks/structs.rb
17
14
  lib/cryptopunks/tool.rb
18
15
  lib/cryptopunks/version.rb
data/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  > in the digital realm [to "flex" how rich and stupid I am].
10
10
  > What could be more desirable than a small [24×24]
11
11
  > pixelated [knitted cap-wearing ape] face?
12
- > Matt & John's® Punk artwork [![](i/punk-8219.png) [#8219](https://www.larvalabs.com/cryptopunks/details/8219)] just sold for $176,000.
12
+ > Matt & John's® Punk artwork [![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-8219.png) [#8219](https://www.larvalabs.com/cryptopunks/details/8219)] just sold for $176,000.
13
13
  >
14
14
  > -- [January 2021](https://decrypt.co/53519/an-ethereum-based-cryptopunk-artwork-just-sold-for-176000)
15
15
  >
@@ -17,7 +17,7 @@
17
17
  > Ultra-rare alien [24×24 pixel] Matt & John's® Punk
18
18
  > sells for 605 ETH, or $750,000.
19
19
  > The investment thesis. "Aliens are the rarest form of Matt & John's® Punk and
20
- > we believe that the acquired Alien [![](i/punk-2890.png) [#2890](https://www.larvalabs.com/cryptopunks/details/2890), one of nine]
20
+ > we believe that the acquired Alien [![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-2890.png) [#2890](https://www.larvalabs.com/cryptopunks/details/2890), one of nine]
21
21
  > will be prized by collectors over
22
22
  > time and mature into an iconic digital art piece."
23
23
  >
@@ -112,7 +112,7 @@ $ punk generate female_2 earring blonde_bob green_eye_shadow
112
112
 
113
113
  resulting in:
114
114
 
115
- ![](i/punk-0000.png)
115
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-0000.png)
116
116
 
117
117
  Let's try the `-z/--zoom` factor 2x, 4x, 8x, etc.:
118
118
 
@@ -124,9 +124,9 @@ $ punk -z2 g female_2 earring blonde_bob green_eye_shadow
124
124
 
125
125
  resulting in:
126
126
 
127
- 2x ![](i/punk-0000x2.png)
128
- 4x ![](i/punk-0000x4.png)
129
- 8x ![](i/punk-0000x8.png)
127
+ 2x ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-0000x2.png)
128
+ 4x ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-0000x4.png)
129
+ 8x ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/punk-0000x8.png)
130
130
 
131
131
 
132
132
  Let's try never-before-seen super-rare punks:
@@ -138,8 +138,8 @@ $ punk generate vampire_female wild_hair
138
138
 
139
139
  resulting in:
140
140
 
141
- ![](i/demon.png)
142
- ![](i/vampire-female.png)
141
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/demon.png)
142
+ ![](https://github.com/cryptopunksnotdead/cryptopunks/raw/master/cryptopunks/i/vampire-female.png)
143
143
 
144
144
 
145
145
 
@@ -348,7 +348,7 @@ _Get punk characters via image tiles from all-in-one punk series composite (`./p
348
348
 
349
349
 
350
350
 
351
- Step 0 - Download the True Official Genuine CryptoPunks™ composite image
351
+ Step 0 - Download the True Official Genuine Matt & John's® Punks composite image
352
352
 
353
353
  One time / first time only - Download the True Official Genuine Matt & John's® Punks composite
354
354
  housing all 10 000 Punks
@@ -644,7 +644,7 @@ And so on.
644
644
  Yes, you can generate punks in your own scripts
645
645
  and much more.
646
646
  See the
647
- [**Programming CryptoPunks & Copypastas Step-by-Step Booklet / Guide »**](https://github.com/cryptopunksnotdead/programming-cryptopunks)
647
+ [**Programming (Crypto) Punk (Pixel) Profile Pictures & (Generative) Art - Step-by-Step Booklet / Guide »**](https://github.com/cryptopunksnotdead/programming-cryptopunks)
648
648
 
649
649
 
650
650
 
data/Rakefile CHANGED
@@ -27,7 +27,7 @@ Hoe.spec 'cryptopunks' do
27
27
 
28
28
  self.extra_deps = [
29
29
  ['pixelart', '>= 1.3.2'],
30
- ['punks', '>= 0.2.0'],
30
+ ['punks', '>= 2024.2.29'],
31
31
  ['gli'],
32
32
  ]
33
33
 
@@ -301,10 +301,11 @@ desc 'List all punk archetype and attribute names from builtin punk spritesheet'
301
301
  command [:l, :ls, :list] do |c|
302
302
  c.action do |g,o,args|
303
303
 
304
- generator = Image.generator
304
+ # generator = Punk::Image.generator
305
+ sheet = Punk::Spritesheet.builtin
305
306
 
306
307
  puts "==> Archetypes"
307
- generator.meta.each do |rec|
308
+ sheet.meta.each do |rec|
308
309
  next unless rec.archetype?
309
310
 
310
311
  print " "
@@ -315,7 +316,7 @@ command [:l, :ls, :list] do |c|
315
316
 
316
317
  puts ""
317
318
  puts "==> Attributes"
318
- generator.meta.each do |rec|
319
+ sheet.meta.each do |rec|
319
320
  next unless rec.attribute?
320
321
 
321
322
  print " "
@@ -325,7 +326,7 @@ command [:l, :ls, :list] do |c|
325
326
  end
326
327
 
327
328
  puts ""
328
- puts " See github.com/cryptopunksnotdead/punks.spritesheet for more."
329
+ puts " See github.com/openpunkart/punkart.spritesheet for more."
329
330
  puts ""
330
331
 
331
332
  puts 'Done.'
@@ -4,9 +4,9 @@ module Pixelart
4
4
  module Module
5
5
  module Cryptopunks
6
6
 
7
- MAJOR = 3
8
- MINOR = 0
9
- PATCH = 0
7
+ MAJOR = 2024
8
+ MINOR = 2
9
+ PATCH = 29
10
10
  VERSION = [MAJOR,MINOR,PATCH].join('.')
11
11
 
12
12
  def self.version
data/lib/cryptopunks.rb CHANGED
@@ -15,23 +15,8 @@ require 'cryptopunks/version' # note: let version always go first
15
15
 
16
16
 
17
17
  require 'cryptopunks/attributes'
18
- require 'cryptopunks/structs'
19
18
  require 'cryptopunks/composite'
20
-
21
-
22
- ## add old backwards compatible alias
23
- module Punk
24
- class Image
25
- Composite = ImageComposite
26
- end
27
- end
28
-
29
-
30
-
31
- require 'cryptopunks/dataset'
32
-
33
19
  require 'cryptopunks/colors'
34
- require 'cryptopunks/image'
35
20
 
36
21
 
37
22
  ####
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptopunks
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 2024.2.29
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-06-11 00:00:00.000000000 Z
11
+ date: 2024-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pixelart
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.2.0
33
+ version: 2024.2.29
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.2.0
40
+ version: 2024.2.29
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: gli
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '3.23'
81
+ version: '4.1'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '3.23'
88
+ version: '4.1'
89
89
  description: cryptopunks - generate your own 24×24 pixel punk images (off-chain) from
90
90
  the Official Genuine Matt & John's® Punks sha256-verified original 10 000 unique
91
91
  character collection; incl. 2x/4x/8x zoom for bigger sizes
@@ -112,9 +112,6 @@ files:
112
112
  - lib/cryptopunks/contract/punksdata-assets.rb
113
113
  - lib/cryptopunks/contract/punksdata-contract.rb
114
114
  - lib/cryptopunks/contract/punksdata-meta.rb
115
- - lib/cryptopunks/dataset.rb
116
- - lib/cryptopunks/image.rb
117
- - lib/cryptopunks/structs.rb
118
115
  - lib/cryptopunks/tool.rb
119
116
  - lib/cryptopunks/version.rb
120
117
  homepage: https://github.com/cryptopunksnotdead/cryptopunks
@@ -138,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
135
  - !ruby/object:Gem::Version
139
136
  version: '0'
140
137
  requirements: []
141
- rubygems_version: 3.3.7
138
+ rubygems_version: 3.4.10
142
139
  signing_key:
143
140
  specification_version: 4
144
141
  summary: cryptopunks - generate your own 24×24 pixel punk images (off-chain) from
@@ -1,67 +0,0 @@
1
-
2
-
3
- module Punk
4
- module Dataset
5
-
6
- def self.read( path='./datasets/punks/*.csv' )
7
-
8
- datasets = Dir.glob( path )
9
- #=> ["./datasets/punks/0-999.csv",
10
- # "./datasets/punks/1000-1999.csv",
11
- # "./datasets/punks/2000-2999.csv",
12
- # "./datasets/punks/3000-3999.csv",
13
- # "./datasets/punks/4000-4999.csv",
14
- # "./datasets/punks/5000-5999.csv",
15
- # "./datasets/punks/6000-6999.csv",
16
- # "./datasets/punks/7000-7999.csv",
17
- # "./datasets/punks/8000-8999.csv",
18
- # "./datasets/punks/9000-9999.csv"]
19
-
20
- rows = []
21
- datasets.each do |dataset|
22
- rows += CsvHash.read( dataset )
23
- end
24
-
25
- # puts " #{rows.size} rows(s)"
26
- #=> 10000 rows(s)
27
-
28
- ### wrap in punk struct for easier access
29
- punks = []
30
- rows.each do |row|
31
- id = row['id'].to_i
32
- type_q = row['type']
33
- count = row['count'].to_i
34
- accessories_q = row['accessories'].split( %r{[ ]*/[ ]*} )
35
-
36
- if count != accessories_q.size
37
- puts "!! ERROR - punk data assertion failed - expected accessories count #{count}; got #{accessories_q.size}"
38
- pp row
39
- exit 1
40
- end
41
-
42
- type = Metadata::Type.find( type_q )
43
- if type.nil?
44
- puts "!! ERROR - punk data assertion failed - unknown punk type >#{type_q}<"
45
- pp row
46
- exit 1
47
- end
48
-
49
- accessories = []
50
- accessories_q.each do |acc_q|
51
- acc = Metadata::Accessory.find( acc_q )
52
- if acc.nil?
53
- puts "!! ERROR - punk data assertion failed - unknown punk accessory type >#{acc_q}<"
54
- pp row
55
- exit 1
56
- end
57
- accessories << acc
58
- end
59
-
60
- punks << Metadata.new( id, type, accessories )
61
- end
62
- punks
63
- end
64
- end # module Dataset
65
- end # module Punk
66
-
67
-
@@ -1,35 +0,0 @@
1
- module Punk
2
-
3
-
4
-
5
- class Image
6
-
7
- def self.read( path ) ## convenience helper
8
- img = ChunkyPNG::Image.from_file( path )
9
- new( img )
10
- end
11
-
12
-
13
-
14
- =begin
15
-
16
- ### keep design & colors keyword args in c'tor here
17
- ## or use parse() like in pixelart - why? why not?
18
-
19
- def initialize( initial=nil, design: nil,
20
- colors: nil )
21
- if initial
22
- ## pass image through as-is
23
- img = initial
24
- else
25
- ## note: unwrap inner image before passing on to super c'tor
26
- img = Pixelart::Image.parse( design, colors: colors ).image
27
- end
28
-
29
- super( img.width, img.height, img )
30
- end
31
- =end
32
-
33
-
34
- end # class Image
35
- end # module Punk
@@ -1,161 +0,0 @@
1
-
2
- module Punk
3
- ### wrap metadata (e.g. punk types, accessories, etc.
4
- ## in structs for easy/easier access)
5
-
6
-
7
-
8
- class Metadata
9
-
10
- ## nested class
11
- class Type ## todo/check: use alias family or such?
12
- attr_reader :name,
13
- :limit
14
- def initialize( name, limit )
15
- @name = name
16
- @limit = limit
17
- end
18
- ## def to_s() @name; end
19
-
20
- def inspect
21
- %Q{<Type "#{@name}", limit: #{@limit}>}
22
- end
23
-
24
-
25
-
26
- def self.build
27
- TYPES.reduce( {} ) do |h, rec|
28
- type = Type.new( rec[:name], rec[:limit ] )
29
- h[ rec[:name].downcase ] = type
30
- h
31
- end
32
- end
33
-
34
- def self.registry
35
- ## auto-build registry (hash table) lookup (by name)
36
- @@types ||= build
37
- @@types
38
- end
39
-
40
- def self.all() registry.values; end
41
-
42
- def self.find( q ) registry[ q.to_s.downcase ]; end
43
- end ## (nested) class Type
44
-
45
-
46
-
47
- ## nested class
48
- class AccessoryType
49
- attr_reader :name,
50
- :accessories
51
- def initialize( name, accessories=[] )
52
- @name = name
53
- @accessories = accessories
54
- end
55
-
56
-
57
-
58
- def self.build
59
- ACCESSORY_TYPES.reduce( {} ) do |h, rec|
60
- type = AccessoryType.new( rec[:name] )
61
- ## add all accessories
62
- rec[:accessories].each do |rec_acc|
63
- type.accessories << Accessory.new( rec_acc[:name],
64
- type,
65
- rec_acc[:limit].to_i )
66
- end
67
- h[ rec[:name].downcase ] = type
68
- h
69
- end
70
- end
71
-
72
- def self.registry
73
- ## auto-build registry (hash table) lookup (by name)
74
- @@types ||= build
75
- @@types
76
- end
77
-
78
- def self.all() registry.values; end
79
-
80
- def self.find( q ) registry[ q.to_s.downcase ]; end
81
- end ## (nested) class AccessoryType
82
-
83
-
84
- ## nested class
85
- class Accessory
86
-
87
- attr_reader :name,
88
- :type,
89
- :limit
90
- def initialize( name, type, limit )
91
- @name = name
92
- @type = type
93
- @limit = limit
94
- end
95
-
96
-
97
- def inspect
98
- %Q{<Accessory "#{@name}", type: "#{@type.name}", limit: #{@limit}>}
99
- end
100
-
101
-
102
-
103
- def self.build
104
- AccessoryType.all.reduce( {} ) do |h, type|
105
- type.accessories.each do |acc|
106
- h[ acc.name.downcase ] = acc
107
- end
108
- h
109
- end
110
- end
111
-
112
- def self.registry
113
- ## auto-build registry (hash table) lookup (by name)
114
- @@types ||= build
115
- @@types
116
- end
117
-
118
- def self.all() registry.values; end
119
-
120
- def self.find( q ) registry[ q.to_s.downcase ]; end
121
- end ## (nested) class Accessory
122
-
123
-
124
-
125
-
126
-
127
-
128
- attr_reader :id,
129
- :type,
130
- :accessories,
131
- :birthday ## todo/check: use minted or such?
132
-
133
- def initialize( id, type, accessories )
134
- @id = id
135
- @type = type
136
- @accessories = accessories
137
- @birthday = Date.new( 2017, 6, 23) ## all 10,000 minted on June 23, 2017
138
- end
139
-
140
- def is_type?( name ) @type.name == name; end
141
- alias_method :is?, :is_type?
142
-
143
- ## convenience helpers for "classic" (5) types
144
- def alien?() is_type?( 'Alien'); end
145
- def ape?() is_type?( 'Ape' ); end
146
- def zombie?() is_type?( 'Zombie' ); end
147
- def female?() is_type?( 'Female' ); end
148
- def male?() is_type?( 'Male' ); end
149
-
150
- ## convenience helpers to lookup attributes
151
- def has_attribute?( name )
152
- accessories.each do |acc|
153
- return true if acc.name == name
154
- end
155
- false
156
- end
157
- alias_method :has?, :has_attribute?
158
- alias_method :include?, :has_attribute?
159
- end # class Metadata
160
-
161
- end # module Punk