0

I want to update my contract on testnet using the flow CLI command. But instead of seeing a success, I get the following error:

> flow accounts update-contract Xxxxx ./Xxxxx.cdc --signer admin-account -n testnet
Transaction ID: 04bd2c8f5b62f112e3311f8053e4af9cad66fc10df83471d53d990dbf4de9867
Updating contract 'Xxxxx' on account 'Yyyyy'...⠙
❌ Command Error: [Error Code: 1006] invalid proposal key: public key 0 on account Yyyyy does not have a valid signature: [Error Code: 1009] invalid envelope key: public key 0 on account Yyyyy does not have a valid signature: signature is not valid

My flow.json config looks like this

{
  "accounts": {
    "admin-account": {
      "address": "zszssszszz",
      "key": "yyyyyyyyyyy"
    }
  }
}

The account that I want to deploy to has 4 keys. When I deploy to another account which has only 1 key, I get no error message.

louis_guitton
  • 5,105
  • 1
  • 31
  • 33

1 Answers1

0

For accounts with multiple keys, you can specify the key index using the Accounts advanced format in the flow CLI config https://docs.onflow.org/flow-cli/configuration/#advanced-format-1

For example, if you're trying to use the fourth key in your account, you would write:

{
  "accounts": {
    "admin-account": {
      "address": "zszssszszz",
      "key": {
        "type": "hex",
        "index": 3,
        "signatureAlgorithm": "ECDSA_P256",
        "hashAlgorithm": "SHA3_256",
        "privateKey": "yyyyyyyyyyy"
      }
    }
  },
}
louis_guitton
  • 5,105
  • 1
  • 31
  • 33