Skip to content

Commit

Permalink
emit withdraw event when burning
Browse files Browse the repository at this point in the history
  • Loading branch information
austinkline committed Feb 14, 2024
1 parent b533001 commit 84a24ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contracts/TopShot.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,10 @@ pub contract TopShot: NonFungibleToken {
let token <- self.ownedNFTs.remove(key: id)
?? panic("Cannot destroy: Moment does not exist in collection: ".concat(id.toString()))

// Emit a withdraw event here so that platforms do not have to understand TopShot-specific events to see ownership change
// A withdraw without a corresponding deposit means the NFT in question has no owner address
emit Withdraw(id: id, from: self.owner?.address)

// does nothing if the moment is not locked
topShotLockingAdmin.unlockByID(id: id)

Expand Down

0 comments on commit 84a24ab

Please sign in to comment.