Skip to content

Commit

Permalink
add explicit type check in onboardByType
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed Apr 10, 2024
1 parent 0259c8f commit 2c7c9e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cadence/contracts/bridge/FlowEVMBridge.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ contract FlowEVMBridge : IFlowEVMNFTBridge, IFlowEVMTokenBridge {
symbol: onboardingValues.symbol,
erc721Address: onboardingValues.evmContractAddress
)
} else {
} else if type.isSubtype(of: Type<@{FungibleToken.Vault}>()) {
let createVaultFunction = FlowEVMBridgeUtils.getCreateEmptyVaultFunction(forType: type)
?? panic("Could not retrieve createEmptyVault function for the given type")
FlowEVMBridgeTokenEscrow.initializeEscrow(
Expand All @@ -129,6 +129,8 @@ contract FlowEVMBridge : IFlowEVMNFTBridge, IFlowEVMTokenBridge {
decimals: onboardingValues.decimals!,
evmTokenAddress: onboardingValues.evmContractAddress
)
} else {
panic("Attempted to onboard unsupported type: ".concat(type.identifier))
}

assert(
Expand Down

0 comments on commit 2c7c9e0

Please sign in to comment.