From 67e41dfbe8c6b824446727715586a3ad845594a4 Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Mon, 1 Jul 2024 12:30:20 -0600 Subject: [PATCH] update EVM address comparison method --- cadence/contracts/bridge/FlowEVMBridgeConfig.cdc | 2 +- cadence/contracts/bridge/FlowEVMBridgeUtils.cdc | 4 ++-- .../bridge/interfaces/FlowEVMBridgeHandlerInterfaces.cdc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cadence/contracts/bridge/FlowEVMBridgeConfig.cdc b/cadence/contracts/bridge/FlowEVMBridgeConfig.cdc index 2bef3205..d064f249 100644 --- a/cadence/contracts/bridge/FlowEVMBridgeConfig.cdc +++ b/cadence/contracts/bridge/FlowEVMBridgeConfig.cdc @@ -386,7 +386,7 @@ contract FlowEVMBridgeConfig { // EVM address is different, update the association FlowEVMBridgeConfig.associateType(targetType, with: targetEVMAddress) assert( - FlowEVMBridgeConfig.getEVMAddressAssociated(with: targetType)!.bytes == targetEVMAddress.bytes, + FlowEVMBridgeConfig.getEVMAddressAssociated(with: targetType)!.equals(targetEVMAddress), message: "Problem associating target Type and target EVM Address" ) diff --git a/cadence/contracts/bridge/FlowEVMBridgeUtils.cdc b/cadence/contracts/bridge/FlowEVMBridgeUtils.cdc index 0f29e2d1..1625497f 100644 --- a/cadence/contracts/bridge/FlowEVMBridgeUtils.cdc +++ b/cadence/contracts/bridge/FlowEVMBridgeUtils.cdc @@ -580,7 +580,7 @@ contract FlowEVMBridgeUtils { let decodedCallResult = EVM.decodeABI(types: [Type()], data: callResult.data) if decodedCallResult.length == 1 { let actualOwner = decodedCallResult[0] as! EVM.EVMAddress - return actualOwner.bytes == owner.bytes + return actualOwner.equals(owner) } return false } @@ -606,7 +606,7 @@ contract FlowEVMBridgeUtils { let decodedCallResult = EVM.decodeABI(types: [Type()], data: callResult.data) if decodedCallResult.length == 1 { let actualApproved = decodedCallResult[0] as! EVM.EVMAddress - return actualApproved.bytes == owner.bytes + return actualApproved.equals(owner) } return false } diff --git a/cadence/contracts/bridge/interfaces/FlowEVMBridgeHandlerInterfaces.cdc b/cadence/contracts/bridge/interfaces/FlowEVMBridgeHandlerInterfaces.cdc index 0ab989d2..5ef15275 100644 --- a/cadence/contracts/bridge/interfaces/FlowEVMBridgeHandlerInterfaces.cdc +++ b/cadence/contracts/bridge/interfaces/FlowEVMBridgeHandlerInterfaces.cdc @@ -77,7 +77,7 @@ access(all) contract FlowEVMBridgeHandlerInterfaces { self.getTargetEVMAddress() == nil: "Target EVM address has already been set" } post { - self.getTargetEVMAddress()!.bytes == address!.bytes: "Problem setting target EVM address" + self.getTargetEVMAddress()!.equals(address!): "Problem setting target EVM address" } } access(Admin) fun setMinter(_ minter: @{FlowEVMBridgeHandlerInterfaces.TokenMinter}) {