Skip to content

Commit

Permalink
fix get_evm_address_string_from_bytes script
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed Jun 13, 2024
1 parent 34fa385 commit 2a60d7e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cadence/scripts/evm/get_evm_address_string_from_bytes.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}

0 comments on commit 2a60d7e

Please sign in to comment.