How to write upgradeable contract on fuel

I try to compile the demo of the upgradeable code

#[namespace(my_storage_namespace)]
storage {
    target_contract: Option<ContractId> = None,
}

impl Proxy for Contract {
    #[storage(write)]
    fn set_target_contract(id: ContractId) {
        storage.target_contract.write(Some(id));
    }

    #[storage(read)]
    fn double_input(_value: u64) -> u64 {
        let target = storage.target_contract.read().unwrap();
        run_external(target)
    }
}

I got the error

0 |
 #[namespace(my_storage_namespace)]
  |
 ^
 
Expected a module kind (script, contract, predicate or library).

1 |
 storage {
2 |
     target_contract: Option<ContractId> = None,
  |

____

  Aborting due to 1 error.

Error: Failed to compile swaypad
1 Like

Hi @Clara ,

We are currently working on nice tooling/examples for contract chunking and proxying. While it can be done now, it’s rather technical to do this right atm.

The new tooling will be available for development from the Fuel tooling team over the next few weeks. I’d recommend just holding off for now, these two important features are on the way.

1 Like

OK, We will wait for it.

Following this. Any updates?