Skip to content

Commit

Permalink
added updated event
Browse files Browse the repository at this point in the history
  • Loading branch information
bjartek committed Dec 1, 2023
1 parent b11e79f commit 95cab95
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion contracts/NonFungibleToken-v2.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ access(all) contract NonFungibleToken {
// An entitlement for allowing the withdrawal of tokens from a Vault
access(all) entitlement Withdrawable

/// Event that is emitted when a token is updated,
///
access(all) event Updated(id: UInt64, uuid: UInt64, owner: Address, type:String)

access(self) view fun emitNFTUpdated(id: UInt64, uuid: UInt64, owner: Address, type: String): Bool
{
emit Updated(id: id, uuid: uuid, owner: owner, type: type)
return true
}


/// Event that is emitted when a token is withdrawn,
/// indicating the owner of the collection that it was withdrawn from.
///
Expand Down Expand Up @@ -195,7 +206,7 @@ access(all) contract NonFungibleToken {
access(all) view fun borrowNFTSafe(id: UInt64): &{NonFungibleToken.NFT}? {
post {
(result == nil) || (result?.getID() == id):
"Cannot borrow NFT reference: The ID of the returned reference does not match the ID that was specified"
"Cannot borrow NFT reference: The ID of the returned reference does not match the ID that was specified"
}
return nil
}
Expand Down

0 comments on commit 95cab95

Please sign in to comment.