From 700dfe4b8e08a968e00c9398f774a06d2a072896 Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Tue, 25 Jun 2024 15:23:06 -0600 Subject: [PATCH] update interface event types & values --- .../FlowEVMBridgeHandlerInterfaces.cdc | 20 ++++++++++++++++--- .../bridge/interfaces/IEVMBridgeNFTMinter.cdc | 4 ++-- .../interfaces/IEVMBridgeTokenMinter.cdc | 9 +++++++-- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/cadence/contracts/bridge/interfaces/FlowEVMBridgeHandlerInterfaces.cdc b/cadence/contracts/bridge/interfaces/FlowEVMBridgeHandlerInterfaces.cdc index c70813ee..0ab989d2 100644 --- a/cadence/contracts/bridge/interfaces/FlowEVMBridgeHandlerInterfaces.cdc +++ b/cadence/contracts/bridge/interfaces/FlowEVMBridgeHandlerInterfaces.cdc @@ -27,8 +27,19 @@ access(all) contract FlowEVMBridgeHandlerInterfaces { **************/ /// Event emitted when a handler is enabled between a Cadence type and an EVM address - access(all) event HandlerEnabled(handlerType: String, targetType: String, targetEVMAddress: String) - access(all) event MinterSet(handlerType: String, targetType: String?, targetEVMAddress: String?, minterType: String) + access(all) event HandlerEnabled( + handlerType: String, + handlerUUID: UInt64, + targetType: String, + targetEVMAddress: String + ) + access(all) event MinterSet(handlerType: String, + handlerUUID: UInt64, + targetType: String?, + targetEVMAddress: String?, + minterType: String, + minterUUID: UInt64 + ) /**************** Constructs @@ -75,9 +86,11 @@ access(all) contract FlowEVMBridgeHandlerInterfaces { minter.getMintedType() == self.getTargetType(): "Minter does not mint the target type" emit MinterSet( handlerType: self.getType().identifier, + handlerUUID: self.uuid, targetType: self.getTargetType()?.identifier, targetEVMAddress: self.getTargetEVMAddress()?.toString(), - minterType: minter.getType().identifier + minterType: minter.getType().identifier, + minterUUID: minter.uuid ) } } @@ -93,6 +106,7 @@ access(all) contract FlowEVMBridgeHandlerInterfaces { self.isEnabled(): "Problem enabling Handler" emit HandlerEnabled( handlerType: self.getType().identifier, + handlerUUID: self.uuid, targetType: self.getTargetType()!.identifier, targetEVMAddress: self.getTargetEVMAddress()!.toString() ) diff --git a/cadence/contracts/bridge/interfaces/IEVMBridgeNFTMinter.cdc b/cadence/contracts/bridge/interfaces/IEVMBridgeNFTMinter.cdc index b88b18cd..93908c9a 100644 --- a/cadence/contracts/bridge/interfaces/IEVMBridgeNFTMinter.cdc +++ b/cadence/contracts/bridge/interfaces/IEVMBridgeNFTMinter.cdc @@ -5,7 +5,7 @@ import "NonFungibleToken" access(all) contract interface IEVMBridgeNFTMinter { - access(all) event Minted(type: Type, id: UInt64, uuid: UInt64, evmID: UInt256, tokenURI: String, minter: Address) + access(all) event Minted(type: String, id: UInt64, uuid: UInt64, evmID: UInt256, tokenURI: String, minter: Address) access(all) event TokenURIUpdated(evmID: UInt256, newURI: String, updater: Address) /// Account-only method to mint an NFT @@ -14,7 +14,7 @@ contract interface IEVMBridgeNFTMinter { fun mintNFT(id: UInt256, tokenURI: String): @{NonFungibleToken.NFT} { post { emit Minted( - type: result.getType(), + type: result.getType().identifier, id: result.id, uuid: result.uuid, evmID: id, diff --git a/cadence/contracts/bridge/interfaces/IEVMBridgeTokenMinter.cdc b/cadence/contracts/bridge/interfaces/IEVMBridgeTokenMinter.cdc index ed3640ee..f5ce9120 100644 --- a/cadence/contracts/bridge/interfaces/IEVMBridgeTokenMinter.cdc +++ b/cadence/contracts/bridge/interfaces/IEVMBridgeTokenMinter.cdc @@ -6,7 +6,7 @@ access(all) contract interface IEVMBridgeTokenMinter { /// Emitted whenever tokens are minted, identifying the type, amount, and minter - access(all) event Minted(type: Type, amount: UFix64, mintedUUID: UInt64, minter: Address) + access(all) event Minted(type: String, amount: UFix64, mintedUUID: UInt64, minter: Address) /// Account-only method to mint a fungible token of the specified amount. /// @@ -14,7 +14,12 @@ contract interface IEVMBridgeTokenMinter { fun mintTokens(amount: UFix64): @{FungibleToken.Vault} { post { result.balance == amount: "Result does not contained specified amount" - emit Minted(type: result.getType(), amount: amount, mintedUUID: result.uuid, minter: self.account.address) + emit Minted( + type: result.getType().identifier, + amount: amount, + mintedUUID: result.uuid, + minter: self.account.address + ) } } }