11#! /usr/bin/env bash
22
33set_contract_address () {
4- if [ -z " $contract_address " ] ; then
4+ if is_unset_or_null " $contract_address " ; then
55 show_title " $title " " > Enter contract address <"
66 contract_address=$( get_ethereum_address " Enter contract address" )
77 check_input " $contract_address " " contract address"
@@ -10,7 +10,7 @@ set_contract_address() {
1010}
1111
1212set_fund_receiver () {
13- if [ -z " $fund_receiver " ] ; then
13+ if is_unset_or_null " $fund_receiver " ; then
1414 show_title " $title " " > Set fund receiver <"
1515 if gum confirm " Override fund receiver? (default: $( format_address $SIGNER ) )" --default=false; then
1616 fund_receiver=$( get_ethereum_address " Fund receiver (eg: 0x000...000)" )
@@ -22,7 +22,7 @@ set_fund_receiver() {
2222}
2323
2424set_royalties () {
25- if [ -z " $royalty_receiver " ] && [ -z " $royalty_fee " ] ; then
25+ if is_unset_or_null " $royalty_receiver " && is_unset_or_null " $royalty_fee " ; then
2626 show_title " $title " " > Do you want to set royalties? <"
2727 if gum confirm " Use royalties?" --default=false; then
2828 # Set royalty receiver
@@ -44,15 +44,15 @@ set_royalties() {
4444}
4545
4646set_stages_file () {
47- if [ -z " $stages_file " ] && [ -z " $stages_json " ] ; then
47+ if is_unset_or_null " $stages_file " && is_unset_or_null " $stages_json " ; then
4848 show_title " $title " " > Set stages file <"
4949 stages_file=$( get_collection_file " Enter stages JSON file" )
5050 clear
5151 fi
5252}
5353
5454set_mint_currency () {
55- if [ -z " $mint_currency " ] ; then
55+ if is_unset_or_null " $mint_currency " ; then
5656 show_title " $title " " > Set mint currency <"
5757 if gum confirm " Override default mint currency? ($DEFAULT_MINT_CURRENCY )" --default=false; then
5858 mint_currency=$( get_ethereum_address " Mint currency (default: Native Gas Token)" )
@@ -64,7 +64,7 @@ set_mint_currency() {
6464}
6565
6666set_max_mintable_supply () {
67- if [ -z " $max_mintable_supply " ] ; then
67+ if is_unset_or_null " $max_mintable_supply " ; then
6868 if [ " $token_standard " = " ERC1155" ] && [ -z " $token_id " ]; then
6969 show_title " $title " " > Set max mintable supply for each token <"
7070 max_mintable_supply=" ["
@@ -91,15 +91,15 @@ set_max_mintable_supply() {
9191}
9292
9393set_token_standard () {
94- if [ -z " $token_standard " ] ; then
94+ if is_unset_or_null " $token_standard " ; then
9595 show_title " $title " " > Set token standard <"
9696 token_standard=$( gum choose " ERC721" " ERC1155" )
9797 clear
9898 fi
9999}
100100
101101set_chain () {
102- if [ -z " $chain_id " ] ; then
102+ if is_unset_or_null " $chain_id " ; then
103103 show_title " $title " " > Choose a chain to deploy on <"
104104 chain=$( printf " %s\n" " ${SUPPORTED_CHAINS[@]} " | cut -d' :' -f2 | gum choose)
105105 # Extract the chain ID based on the selected chain name
@@ -111,7 +111,7 @@ set_chain() {
111111}
112112
113113set_base_uri () {
114- if [ -z " $base_uri " ] ; then
114+ if is_unset_or_null " $base_uri " ; then
115115 show_title " $title " " > Enter the base URI <"
116116 base_uri=$( gum input --placeholder " Enter base URI" )
117117 check_input " $base_uri " " base URI"
@@ -120,7 +120,7 @@ set_base_uri() {
120120}
121121
122122set_collection_name () {
123- if [ -z " $name " ] ; then
123+ if is_unset_or_null " $name " ; then
124124 show_title " $title " " > Enter the collection name <"
125125 name=$( gum input --placeholder " Enter collection name" )
126126 check_input " $name " " name"
@@ -129,7 +129,7 @@ set_collection_name() {
129129}
130130
131131set_collection_symbol () {
132- if [ -z " $symbol " ] ; then
132+ if is_unset_or_null " $symbol " ; then
133133 show_title " $title " " > Enter the collection symbol <"
134134 symbol=$( gum input --placeholder " Enter collection symbol" )
135135 check_input " $symbol " " symbol"
@@ -138,7 +138,7 @@ set_collection_symbol() {
138138}
139139
140140set_contract_owner () {
141- if [ -z " $initial_owner " ] ; then
141+ if is_unset_or_null " $initial_owner " ; then
142142 show_title " $title " " > Set initial contract owner <"
143143 if gum confirm " Override initial contract owner? ($( format_address $SIGNER ) )" --default=false; then
144144 initial_owner=$( get_ethereum_address " Initial contract owner" )
@@ -150,7 +150,7 @@ set_contract_owner() {
150150}
151151
152152set_impl_id () {
153- if [ -z " $impl_id " ] ; then
153+ if is_unset_or_null " $impl_id " ; then
154154 show_title " $title " " > Set implementation ID <"
155155 if gum confirm " Override default implementation?" --default=false; then
156156 impl_id=$( get_numeric_input " Enter implementation ID" )
@@ -163,7 +163,7 @@ set_impl_id() {
163163}
164164
165165set_global_wallet_limit () {
166- if [ -z " $global_wallet_limit " ] ; then
166+ if is_unset_or_null " $global_wallet_limit " ; then
167167 if [ " $token_standard " = " ERC1155" ] && [ -z " $token_id " ]; then
168168 show_title " $title " " > Set global wallet limit for each token <"
169169 global_wallet_limit=" ["
@@ -190,7 +190,7 @@ set_global_wallet_limit() {
190190}
191191
192192set_token_id () {
193- if [ -z " $token_id " ] ; then
193+ if is_unset_or_null " $token_id " ; then
194194 show_title " $title " " > Enter token ID <"
195195 token_id=$( get_numeric_input " Enter token ID" )
196196 check_input " $token_id " " token ID"
@@ -199,7 +199,7 @@ set_token_id() {
199199}
200200
201201set_mintable () {
202- if [ -z " $mintable " ] ; then
202+ if is_unset_or_null " $mintable " ; then
203203 show_title " $title " " > Set mintable <"
204204 if gum confirm " Set mintable?" --default=false; then
205205 mintable=true
@@ -211,7 +211,7 @@ set_mintable() {
211211}
212212
213213set_cosigner_address () {
214- if [ -z " $cosigner " ] ; then
214+ if is_unset_or_null " $cosigner " ; then
215215 show_title " $title " " > Enter cosigner address <"
216216 cosigner=$( get_ethereum_address " Enter cosigner address" )
217217 check_input " $cosigner " " cosigner address"
@@ -220,7 +220,7 @@ set_cosigner_address() {
220220}
221221
222222set_timestamp_expiry () {
223- if [ -z " $timestamp_expiry " ] ; then
223+ if is_unset_or_null " $timestamp_expiry " ; then
224224 show_title " $title " " > Enter the timestamp expiry <"
225225 timestamp_expiry=$( get_numeric_input " Enter timestamp expiry in seconds" )
226226 check_input " $timestamp_expiry " " timestamp expiry"
@@ -229,7 +229,7 @@ set_timestamp_expiry() {
229229}
230230
231231set_new_owner () {
232- if [ -z " $new_owner " ] ; then
232+ if is_unset_or_null " $new_owner " ; then
233233 show_title " $title " " > Enter new owner address <"
234234 new_owner=$( get_ethereum_address " Enter new owner address" )
235235 check_input " $new_owner " " new owner address"
@@ -238,7 +238,7 @@ set_new_owner() {
238238}
239239
240240set_token_uri_suffix () {
241- if [ -z " $token_uri_suffix " ] ; then
241+ if is_unset_or_null " $token_uri_suffix " ; then
242242 show_title " $title " " > Set token URI suffix <"
243243 if gum confirm " Override default token URI suffix? ($DEFAULT_TOKEN_URI_SUFFIX )" --default=false; then
244244 token_uri_suffix=$( gum input --placeholder " .json" )
@@ -250,7 +250,7 @@ set_token_uri_suffix() {
250250}
251251
252252set_1155_uri () {
253- if [ -z " $uri " ] ; then
253+ if is_unset_or_null " $uri " ; then
254254 show_title " $title " " > Enter new URI <"
255255 uri=" $( gum input --placeholder " Enter new URI" ) "
256256 check_input " $uri " " URI"
@@ -259,7 +259,7 @@ set_1155_uri() {
259259}
260260
261261set_receiver_address () {
262- if [ -z " $receiver " ] ; then
262+ if is_unset_or_null " $receiver " ; then
263263 show_title " $title " " > Enter receiver address <"
264264 receiver=$( get_ethereum_address " Enter receiver address" )
265265 check_input " $receiver " " receiver address"
@@ -268,7 +268,7 @@ set_receiver_address() {
268268}
269269
270270set_fee_numerator () {
271- if [ -z " $fee_numerator " ] ; then
271+ if is_unset_or_null " $fee_numerator " ; then
272272 show_title " $title " " > Enter fee numerator <"
273273 echo " Notice: The fee numerator is a number from 0 to 10000."
274274 echo " It shows the royalty fee as a percentage."
@@ -282,7 +282,7 @@ set_fee_numerator() {
282282}
283283
284284set_quantity () {
285- if [ -z " $quantity " ] ; then
285+ if is_unset_or_null " $quantity " ; then
286286 show_title " $title " " > Enter quantity <"
287287 quantity=$( get_numeric_input " Enter quantity" )
288288 check_input " $quantity " " quantity"
@@ -291,7 +291,7 @@ set_quantity() {
291291}
292292
293293set_authorized_minter () {
294- if [ -z " $minter " ] ; then
294+ if is_unset_or_null " $minter " ; then
295295 show_title " $title " " > Enter minter address <"
296296 minter=$( get_ethereum_address " Enter minter address" )
297297 check_input " $minter " " minter address"
@@ -300,7 +300,7 @@ set_authorized_minter() {
300300}
301301
302302set_number_of_1155_tokens () {
303- if [ -z " $total_tokens " ] ; then
303+ if is_unset_or_null " $total_tokens " ; then
304304 show_title " $title " " > Enter total tokens <"
305305 echo " "
306306 echo $( gum style --foreground 212 " Notice: This value should match the number of tokens in the stages file. Otherwise, the contract will revert." )
0 commit comments