metaplex-foundation / sugar

Candy Machine Rust CLI.
Apache License 2.0
203 stars 116 forks source link

[Bug]: GoLiveDate and EndDate inconsistent #315

Closed samuelvanderwaal closed 2 years ago

samuelvanderwaal commented 2 years ago

Issue description

The GoLiveDate is specified in the config file as a date string whereas the EndSettings is a Unix timestamp. The create-config command abstracts over this by accepting the same date string for both, but it's confusing for users who manually edit their config file that they are different formats.

The best solution is probably to store both as Unix timestamps in the config file as 1) that's the format sent on-chain, and 2) if you're modifying the config file it's expected you're somewhat of an advanced users who should know how to compute a Unix timestamp. Then the create-config command can continue to abstract over it by accepting a date string format and converting to the timestamp behind the scenes.

Alternately, create two values for the EndSettings: date and number, and store both GoLiveDate and EndSettings date as strings and convert to timestamps before sending to the candy machine.

I also think it's worth writing a date parser that can accept a much broader range of date strings to make it easier for users to put in valid values.

Relevant log output

No response

Priority this issue should have

Medium (should be fixed soon)