TransactionSEALED
~╳◆▫$~!?▪^█^╲▪▓╳▪○▫◆□▪╱▒█◆#◇*$^░▓╳■&■╳&╲╳◇$▓◇@■■●░&○▫█$!░?▓@○#●?
Transaction ID
Execution Fee
0.0001 FLOWExecution Error
[Error Code: 1101] error caused by: 1 error occurred: * transaction execute failed: [Error Code: 1101] cadence runtime error: Execution failed: error: hex string has non-even length --> b70a24a55fec88a7bbf039d565c3517b497be93e06b8a6799901b61a38336194:13:14 | 13 | publicKey: key.decodeHex(), | ^^^^^^^^^^^^^^^ Was this error unhelpful? Consider suggesting an improvement here: https://github.com/onflow/cadence/issues.
Transaction Summary
TransactionScript Arguments
0keyString
e5f304d081204f0a618513bbb7fd96087d526e2cd4e35a1b42a1dbeac9db41f3899556825fd8f468356622c5ba1fab19fbf85914c72e5a957d76c331a119383
1signatureAlgorithmUInt8
1
2hashAlgorithmUInt8
3
3weightUFix64
1000.00000000
Cadence Script
1import Crypto
2
3transaction(key: String, signatureAlgorithm: UInt8, hashAlgorithm: UInt8, weight: UFix64) {
4 prepare(signer: auth(BorrowValue, Storage) &Account) {
5 pre {
6 signatureAlgorithm >= 1 && signatureAlgorithm <= 3: "Must provide a signature algorithm raw value that is 1, 2, or 3"
7 hashAlgorithm >= 1 && hashAlgorithm <= 6: "Must provide a hash algorithm raw value that is between 1 and 6"
8 weight <= 1000.0: "The key weight must be between 0 and 1000"
9 }
10
11 let publicKey = PublicKey(
12 publicKey: key.decodeHex(),
13 signatureAlgorithm: SignatureAlgorithm(rawValue: signatureAlgorithm)!
14 )
15
16 let account = Account(payer: signer)
17
18 account.keys.add(publicKey: publicKey, hashAlgorithm: HashAlgorithm(rawValue: hashAlgorithm)!, weight: weight)
19 }
20}