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

Update EVMAddress comparison implementation #97

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion cadence/contracts/bridge/FlowEVMBridgeConfig.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
4 changes: 2 additions & 2 deletions cadence/contracts/bridge/FlowEVMBridgeUtils.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ contract FlowEVMBridgeUtils {
let decodedCallResult = EVM.decodeABI(types: [Type<EVM.EVMAddress>()], 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
}
Expand All @@ -606,7 +606,7 @@ contract FlowEVMBridgeUtils {
let decodedCallResult = EVM.decodeABI(types: [Type<EVM.EVMAddress>()], 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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}) {
Expand Down
Loading