diff --git a/cadence/scripts/evm/get_evm_address_string_from_bytes.cdc b/cadence/scripts/evm/get_evm_address_string_from_bytes.cdc index 74d04f65..e531d935 100644 --- a/cadence/scripts/evm/get_evm_address_string_from_bytes.cdc +++ b/cadence/scripts/evm/get_evm_address_string_from_bytes.cdc @@ -3,5 +3,9 @@ import "EVM" /// Converts EVM address bytes into to a hex string /// access(all) fun main(bytes: [UInt8]): String? { - return EVM.EVMAddress(bytes: bytes.toConstantSized<[UInt8; 20]>()) + let constBytes = bytes.toConstantSized<[UInt8; 20]>() + ?? panic("Problem converting provided EVMAddress compatible byte array - check byte array contains 20 bytes") + return EVM.EVMAddress( + bytes: constBytes + ) }