From f1c99af90c2550d1df4437d5bba806361e78fa81 Mon Sep 17 00:00:00 2001 From: bitzoic Date: Fri, 3 Nov 2023 10:47:43 +0300 Subject: [PATCH] Update examples based on PR comments --- examples/src_3/multi_asset/src/multi_asset.sw | 14 ++++++++------ examples/src_3/single_asset/src/single_asset.sw | 12 +++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/examples/src_3/multi_asset/src/multi_asset.sw b/examples/src_3/multi_asset/src/multi_asset.sw index 9a02ecf..26e6862 100644 --- a/examples/src_3/multi_asset/src/multi_asset.sw +++ b/examples/src_3/multi_asset/src/multi_asset.sw @@ -52,10 +52,11 @@ impl SRC3 for Contract { /// /// ```sway /// use src3::SRC3; + /// use std::constants::ZERO_B256; /// - /// fn foo(contract: ContractId) { - /// let contract_abi = abi(SR3, contract); - /// contract_abi.mint(Identity::ContractId(this_contract()), ZERO_B256, 100); + /// fn foo(contract_id: ContractId) { + /// let contract_abi = abi(SR3, contract_id); + /// contract_abi.mint(Identity::ContractId(contract_id), ZERO_B256, 100); /// } /// ``` #[storage(read, write)] @@ -97,13 +98,14 @@ impl SRC3 for Contract { /// /// ```sway /// use src3::SRC3; + /// use std::constants::ZERO_B256; /// - /// fn foo(contract: ContractId, asset_id: AssetId) { - /// let contract_abi = abi(SR3, contract); + /// fn foo(contract_id: ContractId, asset_id: AssetId) { + /// let contract_abi = abi(SR3, contract_id); /// contract_abi { /// gas: 10000, /// coins: 100, - /// asset_id: AssetId, + /// asset_id: asset_id, /// }.burn(ZERO_B256, 100); /// } /// ``` diff --git a/examples/src_3/single_asset/src/single_asset.sw b/examples/src_3/single_asset/src/single_asset.sw index 4f15a4a..1797df9 100644 --- a/examples/src_3/single_asset/src/single_asset.sw +++ b/examples/src_3/single_asset/src/single_asset.sw @@ -52,10 +52,11 @@ impl SRC3 for Contract { /// /// ```sway /// use src3::SRC3; + /// use std::constants::ZERO_B256; /// - /// fn foo(contract: ContractId) { + /// fn foo(contract_id: ContractId) { /// let contract_abi = abi(SR3, contract); - /// contract_abi.mint(Identity::ContractId(this_contract()), ZERO_B256, 100); + /// contract_abi.mint(Identity::ContractId(contract_id), ZERO_B256, 100); /// } /// ``` #[storage(read, write)] @@ -89,13 +90,14 @@ impl SRC3 for Contract { /// /// ```sway /// use src3::SRC3; + /// use std::constants::ZERO_B256; /// - /// fn foo(contract: ContractId, asset_id: AssetId) { - /// let contract_abi = abi(SR3, contract); + /// fn foo(contract_id: ContractId, asset_id: AssetId) { + /// let contract_abi = abi(SR3, contract_id); /// contract_abi { /// gas: 10000, /// coins: 100, - /// asset_id: AssetId, + /// asset_id: asset_id, /// }.burn(ZERO_B256, 100); /// } /// ```