#![cfg_attr(target_arch = "wasm32", no_main)] mod state; use linera_sdk::{{ base::WithContractAbi, views::{{RootView, View, ViewStorageContext}}, Contract, ContractRuntime, }}; use self::state::{project_name}; pub struct {project_name}Contract {{ state: {project_name}, runtime: ContractRuntime, }} linera_sdk::contract!({project_name}Contract); impl WithContractAbi for {project_name}Contract {{ type Abi = {module_name}::{project_name}Abi; }} impl Contract for {project_name}Contract {{ type Message = (); type Parameters = (); type InstantiationArgument = (); async fn load(runtime: ContractRuntime) -> Self {{ let state = {project_name}::load(runtime.root_view_storage_context()) .await .expect("Failed to load state"); {project_name}Contract {{ state, runtime }} }} async fn instantiate(&mut self, _argument: Self::InstantiationArgument) {{}} async fn execute_operation(&mut self, _operation: Self::Operation) -> Self::Response {{}} async fn execute_message(&mut self, _message: Self::Message) {{}} async fn store(mut self) {{ self.state.save().await.expect("Failed to save state"); }} }}