Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added updated event #196

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
joshuahannan marked this conversation as resolved.
Show resolved Hide resolved

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"
bjartek marked this conversation as resolved.
Show resolved Hide resolved
}
return nil
}
Expand Down
Loading