-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e8d4df
commit 02aab3f
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import "EVM" | ||
|
||
import "EVMUtils" | ||
import "FlowEVMBridgeConfig" | ||
|
||
/// Returns the Cadence Type associated with the given EVM address (as its hex String) | ||
/// | ||
/// @param evmAddressHex: The hex-encoded address of the EVM contract as a String | ||
/// | ||
/// @return The Cadence Type associated with the EVM address or nil if the address is not onboarded. `nil` may also be | ||
/// returned if the address is not a valid EVM address. | ||
/// | ||
access(all) | ||
fun main(addressHex: String): Type? { | ||
let address = EVMUtils.getEVMAddressFromHexString(address: addressHex) | ||
return address != nil ? FlowEVMBridgeConfig.getTypeAssociated(with: address!) : nil | ||
} |