Abigen! macro fails with 'missing generics for struct `Vec`'

I’m going bonkers on the following issue using
abigen!
macro.

Contract builds fine, but abigen macro errors with:

error[E0107]: missing generics for struct `Vec`
 --> factory-contract/tests/utils/setup.rs:6:1
  |
6 | / abigen!(Contract(
7 | |     name = "Factory",
8 | |     abi = "./factory-contract/out/debug/factory-contract-abi.json"
9 | | ));
  | |__^ expected at least 1 generic argument

The abi json generates as:

{
      "inputs": [
        {
          "name": "bytecode",
          "type": 12,
          "typeArguments": [
            {
              "name": "",
              "type": 15,
              "typeArguments": null
            }
          ]
        }
      ],
      "name": "set_bytecode",
      "output": {
        "name": "",
        "type": 0,
        "typeArguments": null
      },
      "attributes": [
        {
          "name": "storage",
          "arguments": [
            "read",
            "write"
          ]
        }
      ]
    },

On the contract side I used the example base contract for the src12 standard implementation as referenced by sway-standards/examples

Relevant piece of code:

impl MyRegistryContract for Contract {
    #[storage(read, write)]
    fn set_bytecode(bytecode: Vec<u8>) {
        storage.bytecode.store_vec(bytecode);
    }
}

Any help would be much appreciated :slight_smile:

Also to note: This is basically running the standard src12 example from sway-standards library. Double checked the generated abi json of the original in the original library, same result.

will have a look at it and get back to you

Managed to reproduce. Taking a look, will write here asap.
Edit:
Raised the issue with our compiler team internally. Will write back with any updates.

@xpluscal

The issue is being tracked here.

great, thanks for the update @segfault-magnet

1 Like