Skip to content

Commit f39b18b

Browse files
committed
Solved small bugs in auctions contract
1 parent 7cd7930 commit f39b18b

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

nft/nft-marketplace/src/dutch_auction.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ mod dutch_auction {
118118
"[Instantiation]: The starting price must be greater than the ending price."
119119
);
120120
assert!(
121-
Runtime::current_epoch().after(relative_ending_epoch) > Runtime::current_epoch(),
121+
Runtime::current_epoch().after(relative_ending_epoch).unwrap() > Runtime::current_epoch(),
122122
"[Instantiation]: The ending epoch has already passed."
123123
);
124124

@@ -165,13 +165,13 @@ mod dutch_auction {
165165
starting_price,
166166
ending_price,
167167
starting_epoch: Runtime::current_epoch(),
168-
ending_epoch: Runtime::current_epoch().after(relative_ending_epoch),
168+
ending_epoch: Runtime::current_epoch().after(relative_ending_epoch).unwrap(),
169169
}
170-
.instantiate()
171-
.prepare_to_globalize(OwnerRole::Updatable(rule!(require(
170+
.instantiate()
171+
.prepare_to_globalize(OwnerRole::Updatable(rule!(require(
172172
ownership_badge.resource_address()
173173
))))
174-
.globalize();
174+
.globalize();
175175

176176
return (dutch_auction, ownership_badge);
177177
}

nft/nft-marketplace/src/english_auction.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ mod english_auction {
112112
"[Instantiation]: Only payments of fungible resources are accepted."
113113
);
114114
assert!(
115-
Runtime::current_epoch().after(relative_ending_epoch) > Runtime::current_epoch(),
115+
Runtime::current_epoch().after(relative_ending_epoch).unwrap() > Runtime::current_epoch(),
116116
"[Instantiation]: The ending epoch has already passed."
117117
);
118118

@@ -137,7 +137,7 @@ mod english_auction {
137137
.metadata(metadata!(
138138
init {
139139
"name" => "Ownership Badge".to_owned(), locked;
140-
"description" =>
140+
"description" =>
141141
"An ownership badge used to authenticate the owner of the NFT(s).".to_owned(), locked;
142142
"symbol" => "OWNER".to_owned(), locked;
143143
}
@@ -154,7 +154,7 @@ mod english_auction {
154154
.metadata(metadata!(
155155
init {
156156
"name" => "Bidder Badge".to_owned(), locked;
157-
"description" =>
157+
"description" =>
158158
"A badge provided to bidders to keep track of the amount they've bid".to_owned(), locked;
159159
"symbol" => "BIDDER".to_owned(), locked;
160160
}
@@ -186,15 +186,15 @@ mod english_auction {
186186
payment_vault: Vault::new(accepted_payment_token),
187187
bidders_badge: bidder_badge_resource_address,
188188
accepted_payment_token,
189-
ending_epoch: Runtime::current_epoch().after(relative_ending_epoch),
189+
ending_epoch: Runtime::current_epoch().after(relative_ending_epoch).unwrap(),
190190
state: AuctionState::Open,
191191
}
192-
.instantiate()
193-
.prepare_to_globalize(OwnerRole::Updatable(rule!(require(
192+
.instantiate()
193+
.prepare_to_globalize(OwnerRole::Updatable(rule!(require(
194194
ownership_badge.resource_address()
195195
))))
196-
.with_address(address_reservation)
197-
.globalize();
196+
.with_address(address_reservation)
197+
.globalize();
198198

199199
return (english_auction, ownership_badge);
200200
}
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
CALL_METHOD
2-
Address("account_sim1cyfhfs4a94n7kp7k47s55yx685lgwvp2kc6k6tm9kev8qpnlgjea7f")
2+
Address("account_sim1c8m6h4yv2x9ca0wx5ddtl0nctqmjt2t740wfjgj9w8sdz82zf8ppcr")
33
"withdraw_non_fungibles"
4-
Address("resource_sim1ngs0rnmld9e9jhrd2ujcnp0np4n30ph0u9307ulnr28tvrjy4uwvfl")
4+
Address("resource_sim1nf6kz5luvdz6rugagxx7ksst22xud8nj3mmldh2d92tvxsgd003lqe")
55
Array<NonFungibleLocalId>(
66
NonFungibleLocalId("#1#")
77
)
88
;
99
TAKE_ALL_FROM_WORKTOP
10-
Address("resource_sim1ngs0rnmld9e9jhrd2ujcnp0np4n30ph0u9307ulnr28tvrjy4uwvfl")
10+
Address("resource_sim1nf6kz5luvdz6rugagxx7ksst22xud8nj3mmldh2d92tvxsgd003lqe")
1111
Bucket("bucket")
1212
;
1313
CALL_FUNCTION
14-
Address("package_sim1pkv87klswwg29hqznsfjtlfc69r2glfjj3dpj0ascm0pjw5e0g75h5")
14+
Address("package_sim1phhyaadjcggz9vs26vp5rl52pvsa0mppqkfkt9ld7rqdndxpzcl9j8")
1515
"DutchAuction"
1616
"instantiate_dutch_auction"
1717
Array<Bucket>(
@@ -23,7 +23,7 @@ CALL_FUNCTION
2323
10u64
2424
;
2525
CALL_METHOD
26-
Address("account_sim1cyfhfs4a94n7kp7k47s55yx685lgwvp2kc6k6tm9kev8qpnlgjea7f")
26+
Address("account_sim1c8m6h4yv2x9ca0wx5ddtl0nctqmjt2t740wfjgj9w8sdz82zf8ppcr")
2727
"deposit_batch"
2828
Expression("ENTIRE_WORKTOP")
2929
;
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
CALL_METHOD
2-
Address("account_sim1cyfhfs4a94n7kp7k47s55yx685lgwvp2kc6k6tm9kev8qpnlgjea7f")
2+
Address("account_sim1c8m6h4yv2x9ca0wx5ddtl0nctqmjt2t740wfjgj9w8sdz82zf8ppcr")
33
"withdraw_non_fungibles"
4-
Address("resource_sim1ngs0rnmld9e9jhrd2ujcnp0np4n30ph0u9307ulnr28tvrjy4uwvfl")
4+
Address("resource_sim1nf6kz5luvdz6rugagxx7ksst22xud8nj3mmldh2d92tvxsgd003lqe")
55
Array<NonFungibleLocalId>(
66
NonFungibleLocalId("#1#")
77
)
88
;
99
TAKE_ALL_FROM_WORKTOP
10-
Address("resource_sim1ngs0rnmld9e9jhrd2ujcnp0np4n30ph0u9307ulnr28tvrjy4uwvfl")
10+
Address("resource_sim1nf6kz5luvdz6rugagxx7ksst22xud8nj3mmldh2d92tvxsgd003lqe")
1111
Bucket("bucket")
1212
;
1313
CALL_FUNCTION
14-
Address("package_sim1pkv87klswwg29hqznsfjtlfc69r2glfjj3dpj0ascm0pjw5e0g75h5")
14+
Address("package_sim1phhyaadjcggz9vs26vp5rl52pvsa0mppqkfkt9ld7rqdndxpzcl9j8")
1515
"FixedPriceSale"
1616
"instantiate_fixed_price_sale"
1717
Array<Bucket>(
@@ -21,7 +21,7 @@ CALL_FUNCTION
2121
Decimal("10")
2222
;
2323
CALL_METHOD
24-
Address("account_sim1cyfhfs4a94n7kp7k47s55yx685lgwvp2kc6k6tm9kev8qpnlgjea7f")
24+
Address("account_sim1c8m6h4yv2x9ca0wx5ddtl0nctqmjt2t740wfjgj9w8sdz82zf8ppcr")
2525
"deposit_batch"
2626
Expression("ENTIRE_WORKTOP")
2727
;

0 commit comments

Comments
 (0)