[Bug]: Crash when verifying a collection with 0 NFTs
mcintyre94 opened this issue Β· comments
Callum McIntyre commented
Issue description
- Create an assets directory. Add collection.png + collection.json:
{
"name": "Cool Collection",
"symbol": "COOL",
"description": "Collection of some stuff on the blockchain.",
"image": "collection.png",
"attributes": [],
"properties": {
"files": [
{
"uri": "collection.png",
"type": "image/png"
}
]
}
}
-
Run
sugar create-config
, thensugar upload
, thensugar launch
-
Everything will upload and be deployed correctly, but the verification in
sugar launch
will error with a division by zero
I think this is a valid use case, eg. if you wanted to start with an empty collection and then have your app mint NFTs into it.
Relevant log output
$ sugar create-config
[1/2] π¬ Sugar interactive config maker
Check out our Candy Machine config docs to learn about the options:
-> https://docs.metaplex.com/tools/sugar/configuration
β What is the price of each NFT? Β· 0.1
β How many NFTs will you have in your candy machine? Β· 0
β What is the symbol of your collection? Hit [ENTER] for no symbol. Β· COOL
β What is the seller fee basis points? Β· 200
? What is your go live date? Many common formats are supported. If unsure, try YYYY-MM-DD HH:MM:SS [+/-]UTC-OFFSET or type 'now' for current time. For example 2022-05-02 18:00:00 +0000 for May 2, 2022 18:00:0
β What is your go live date? Many common formats are supported. If unsure, try YYYY-MM-DD HH:MM:SS [+/-]UTC-OFFSET or type 'now' for current time. For example 2022-05-02 18:00:00 +0000 for May 2, 2022 18:00:00 UTC. Β· now
β How many creator wallets do you have? (max limit of 4) Β· 1
β Enter creator wallet address #1 Β· Fkc4FN7PPhyGsAcHPW3dBBJ4BvtYkDr2rBFBgFpvy3nB
β Enter royalty percentage share for creator #1 (e.g., 70). Total shares must add to 100. Β· 100
? Which extra features do you want to use? (use [SPACEBAR] to select options you want and hit [ENTER] wh
β Which extra features do you want to use? (use [SPACEBAR] to select options you want and hit [ENTER] when done) Β·
β What is your SOL treasury address? Β· Fkc4FN7PPhyGsAcHPW3dBBJ4BvtYkDr2rBFBgFpvy3nB
β What upload method do you want to use? Β· Bundlr
β Do you want to retain update authority on your NFTs? We HIGHLY recommend you choose yes. Β· yes
β Do you want your NFTs to remain mutable? We HIGHLY recommend you choose yes. Β· yes
[2/2] π Saving config file
Saving config to file: "config.json"
Successfully generated the config file. π
β
Command successful.
$ sugar upload
[1/4] π Loading assets
Found 1 asset pair(s), uploading files:
+--------------------+
| images | 1 |
| metadata | 1 |
+--------------------+
[2/4] π₯ Initializing upload
βͺβͺβͺβͺβͺ Connected
Funding address:
-> pubkey: 9AUvdLggr4DezH1FEHFBVqQPNUF9q6sZGTYoPMyum2sk
-> lamports: 99243 (β 0.000099243)
Signature: zkMvNMg3fRyDgdNuNUDQxy5zKEr34JQHuvJDSff1CTD1cE6SD15t1V1F2uWiUQW9QUtTix3Q4CySihrYfGUvDEM
[3/4] π€ Uploading image files
Sending data: (Ctrl+C to abort)
[00:00:01] Upload successful βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 1/1
[4/4] π€ Uploading metadata files
Sending data: (Ctrl+C to abort)
[00:00:00] Upload successful βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 1/1
1/1 asset pair(s) uploaded.
β
Command successful.
$ sugar launch
Starting Sugar launch... π
>>> sugar validate
[1/1] π Loading assets
βͺβͺβͺβͺβͺ Validating 1 metadata file(s)...
Validation complete, your metadata file(s) look good.
>>> sugar upload
[1/4] π Loading assets
Found 1 asset pair(s), uploading files:
+--------------------+
| images | 0 |
| metadata | 0 |
+--------------------+
....no files need uploading, skipping remaining steps.
1/1 asset pair(s) uploaded.
>>> sugar deploy
[1/3] π¬ Creating candy machine
Candy machine ID: DqfEXKYn8Nct9xaY8A5xj2DUNkwZw8cJKXWS1Wwqt4oK
[2/3] π¦ Creating and setting the collection NFT for candy machine
Collection mint ID: DCBN7vi2nqQARtE4GQfVcgm58gAgvHCjvs99UfGJtnrm
[3/3] π Writing config lines
All config lines deployed.
>>> sugar verify
[1/2] π¬ Loading candy machine
βͺβͺβͺβͺβͺ Completed
[2/2] π Verification
Verifying 0 config line(s): (Ctrl+C to abort)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 0/0
thread 'main' panicked at 'attempt to divide by zero', src/verify/process.rs:97:25
Priority this issue should have
Low (slightly annoying)