mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-22 12:41:04 +00:00
Uniques: Reset approved account after transfer (#12145)
* reset approved account * wrap at 100 * doc * fmt * Update frame/uniques/src/tests.rs Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * new test * Update frame/uniques/src/lib.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * fmt Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
@@ -48,6 +48,12 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
Account::<T, I>::insert((&dest, &collection, &item), ());
|
||||
let origin = details.owner;
|
||||
details.owner = dest;
|
||||
|
||||
// The approved account has to be reset to None, because otherwise pre-approve attack would
|
||||
// be possible, where the owner can approve his second account before making the transaction
|
||||
// and then claiming the item back.
|
||||
details.approved = None;
|
||||
|
||||
Item::<T, I>::insert(&collection, &item, &details);
|
||||
ItemPriceOf::<T, I>::remove(&collection, &item);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user