@@ -109,7 +109,7 @@ NFTokenAcceptOffer::preclaim(PreclaimContext const& ctx)
109
109
110
110
// The two offers may not form a loop. A broker may not sell the
111
111
// token to the current owner of the token.
112
- if (ctx.view .rules ().enabled (fixUnburnableNFToken ) &&
112
+ if (ctx.view .rules ().enabled (fixNonFungibleTokensV1_2 ) &&
113
113
((*bo)[sfOwner] == (*so)[sfOwner]))
114
114
return tecCANT_ACCEPT_OWN_NFTOKEN_OFFER;
115
115
@@ -121,37 +121,29 @@ NFTokenAcceptOffer::preclaim(PreclaimContext const& ctx)
121
121
// If the buyer specified a destination
122
122
if (auto const dest = bo->at (~sfDestination))
123
123
{
124
- // fixUnburnableNFToken
125
- if (ctx.view .rules ().enabled (fixUnburnableNFToken))
124
+ // Before this fix the destination could be either the seller or
125
+ // a broker. After, it must be whoever is submitting the tx.
126
+ if (ctx.view .rules ().enabled (fixNonFungibleTokensV1_2))
126
127
{
127
- // the destination may only be the account brokering the offer
128
128
if (*dest != ctx.tx [sfAccount])
129
129
return tecNO_PERMISSION;
130
130
}
131
- else
132
- {
133
- // the destination must be the seller or the broker.
134
- if (*dest != so->at (sfOwner) && *dest != ctx.tx [sfAccount])
135
- return tecNFTOKEN_BUY_SELL_MISMATCH;
136
- }
131
+ else if (*dest != so->at (sfOwner) && *dest != ctx.tx [sfAccount])
132
+ return tecNFTOKEN_BUY_SELL_MISMATCH;
137
133
}
138
134
139
135
// If the seller specified a destination
140
136
if (auto const dest = so->at (~sfDestination))
141
137
{
142
- // fixUnburnableNFToken
143
- if (ctx.view .rules ().enabled (fixUnburnableNFToken))
138
+ // Before this fix the destination could be either the seller or
139
+ // a broker. After, it must be whoever is submitting the tx.
140
+ if (ctx.view .rules ().enabled (fixNonFungibleTokensV1_2))
144
141
{
145
- // the destination may only be the account brokering the offer
146
142
if (*dest != ctx.tx [sfAccount])
147
143
return tecNO_PERMISSION;
148
144
}
149
- else
150
- {
151
- // the destination must be the buyer or the broker.
152
- if (*dest != bo->at (sfOwner) && *dest != ctx.tx [sfAccount])
153
- return tecNFTOKEN_BUY_SELL_MISMATCH;
154
- }
145
+ else if (*dest != bo->at (sfOwner) && *dest != ctx.tx [sfAccount])
146
+ return tecNFTOKEN_BUY_SELL_MISMATCH;
155
147
}
156
148
157
149
// The broker can specify an amount that represents their cut; if they
@@ -200,7 +192,7 @@ NFTokenAcceptOffer::preclaim(PreclaimContext const& ctx)
200
192
// After this amendment, we allow an IOU issuer to buy an NFT with their
201
193
// own currency
202
194
auto const needed = bo->at (sfAmount);
203
- if (ctx.view .rules ().enabled (fixUnburnableNFToken ))
195
+ if (ctx.view .rules ().enabled (fixNonFungibleTokensV1_2 ))
204
196
{
205
197
if (accountFunds (
206
198
ctx.view , (*bo)[sfOwner], needed, fhZERO_IF_FROZEN, ctx.j ) <
@@ -243,7 +235,7 @@ NFTokenAcceptOffer::preclaim(PreclaimContext const& ctx)
243
235
244
236
// The account offering to buy must have funds:
245
237
auto const needed = so->at (sfAmount);
246
- if (!ctx.view .rules ().enabled (fixUnburnableNFToken ))
238
+ if (!ctx.view .rules ().enabled (fixNonFungibleTokensV1_2 ))
247
239
{
248
240
if (accountHolds (
249
241
ctx.view ,
@@ -298,7 +290,7 @@ NFTokenAcceptOffer::pay(
298
290
// their own currency, we know that something went wrong. This was
299
291
// originally found in the context of IOU transfer fees. Since there are
300
292
// several payouts in this tx, just confirm that the end state is OK.
301
- if (!view ().rules ().enabled (fixUnburnableNFToken ))
293
+ if (!view ().rules ().enabled (fixNonFungibleTokensV1_2 ))
302
294
return result;
303
295
if (result != tesSUCCESS)
304
296
return result;
0 commit comments