?○&▪╳█○%◆█&&?&■@▫*◆▫#▫▫%▫○▫▪○#$◆^░$□█□□~◇█╳▫□■*▓◇▫~#▪▓▓╳~●#▪▒●▫▫
Transaction ID
Execution Error
cannot find variable in this scope: `AuthAccount`
1import Crypto
2
3transaction(publicKeys: [Crypto.KeyListEntry], contracts: {String: String}) {
4 prepare(signer: AuthAccount) {
5 let account = AuthAccount(payer: signer)
6
7 // add all the keys to the account
8 for key in publicKeys {
9 account.keys.add(publicKey: key.publicKey, hashAlgorithm: key.hashAlgorithm, weight: key.weight)Raw Error
[Error Code: 1101] error caused by: 1 error occurred: * transaction preprocess failed: [Error Code: 1101] cadence runtime error: Execution failed: error: cannot find type in this scope: `AuthAccount` --> 1b4085fd7f4d2dee7b090293ed5208646beae9a66e9127a4ec07872426131f69:4:17 | 4 | prepare(signer: AuthAccount) { | ^^^^^^^^^^^ not found in this scope error: cannot find variable in this scope: `AuthAccount` --> 1b4085fd7f4d2dee7b090293ed5208646beae9a66e9127a4ec07872426131f69:5:16 | 5 | let account = AuthAccount(payer: signer) | ^^^^^^^^^^^ not found in this scope Was this error unhelpful? Consider suggesting an improvement here: https://github.com/onflow/cadence/issues.
Transaction Summary
TransactionScript Arguments
[
{
"keyIndex": "1000",
"publicKey": {
"publicKey": [
"165",
"111",
"111",
"201",
"198",
"11",
"65",
"151",
"77",
"181",
"126",
"222",
"187",
"213",
"221",
"60",
"92",
"180",
"121",
"16",
"48",
"139",
"130",
"25",
"248",
"72",
"37",
"53",
"153",
"88",
"47",
"94",
"72",
"226",
"143",
"254",
"203",
"115",
"103",
"189",
"124",
"22",
"13",
"100",
"238",
"156",
"56",
"14",
"145",
"206",
"235",
"65",
"184",
"202",
"230",
"255",
"212",
"246",
"93",
"181",
"161",
"255",
"51",
"127"
],
"signatureAlgorithm": {
"id": "SignatureAlgorithm",
"fields": [
{
"name": "rawValue",
"value": {
"type": "UInt8",
"value": "1"
}
}
]
}
},
"hashAlgorithm": {
"id": "HashAlgorithm",
"fields": [
{
"name": "rawValue",
"value": {
"type": "UInt8",
"value": "1"
}
}
]
},
"weight": "1000.00000000",
"isRevoked": false
},
{
"keyIndex": "1000",
"publicKey": {
"publicKey": [
"165",
"111",
"111",
"201",
"198",
"11",
"65",
"151",
"77",
"181",
"126",
"222",
"187",
"213",
"221",
"60",
"92",
"180",
"121",
"16",
"48",
"139",
"130",
"25",
"248",
"72",
"37",
"53",
"153",
"88",
"47",
"94",
"72",
"226",
"143",
"254",
"203",
"115",
"103",
"189",
"124",
"22",
"13",
"100",
"238",
"156",
"56",
"14",
"145",
"206",
"235",
"65",
"184",
"202",
"230",
"255",
"212",
"246",
"93",
"181",
"161",
"255",
"51",
"127"
],
"signatureAlgorithm": {
"id": "SignatureAlgorithm",
"fields": [
{
"name": "rawValue",
"value": {
"type": "UInt8",
"value": "1"
}
}
]
}
},
"hashAlgorithm": {
"id": "HashAlgorithm",
"fields": [
{
"name": "rawValue",
"value": {
"type": "UInt8",
"value": "1"
}
}
]
},
"weight": "1000.00000000",
"isRevoked": false
},
{
"keyIndex": "1000",
"publicKey": {
"publicKey": [
"165",
"111",
"111",
"201",
"198",
"11",
"65",
"151",
"77",
"181",
"126",
"222",
"187",
"213",
"221",
"60",
"92",
"180",
"121",
"16",
"48",
"139",
"130",
"25",
"248",
"72",
"37",
"53",
"153",
"88",
"47",
"94",
"72",
"226",
"143",
"254",
"203",
"115",
"103",
"189",
"124",
"22",
"13",
"100",
"238",
"156",
"56",
"14",
"145",
"206",
"235",
"65",
"184",
"202",
"230",
"255",
"212",
"246",
"93",
"181",
"161",
"255",
"51",
"127"
],
"signatureAlgorithm": {
"id": "SignatureAlgorithm",
"fields": [
{
"name": "rawValue",
"value": {
"type": "UInt8",
"value": "1"
}
}
]
}
},
"hashAlgorithm": {
"id": "HashAlgorithm",
"fields": [
{
"name": "rawValue",
"value": {
"type": "UInt8",
"value": "1"
}
}
]
},
"weight": "1000.00000000",
"isRevoked": false
}
]{}Cadence Script
1import Crypto
2
3transaction(publicKeys: [Crypto.KeyListEntry], contracts: {String: String}) {
4 prepare(signer: AuthAccount) {
5 let account = AuthAccount(payer: signer)
6
7 // add all the keys to the account
8 for key in publicKeys {
9 account.keys.add(publicKey: key.publicKey, hashAlgorithm: key.hashAlgorithm, weight: key.weight)
10 }
11
12 // add contracts if provided
13 for contract in contracts.keys {
14 account.contracts.add(name: contract, code: contracts[contract]!.decodeHex())
15 }
16 }
17}