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