diff --git a/docs/src/calling-contracts/low-level-calls.md b/docs/src/calling-contracts/low-level-calls.md index 407dc7fe94..32a52bd536 100644 --- a/docs/src/calling-contracts/low-level-calls.md +++ b/docs/src/calling-contracts/low-level-calls.md @@ -19,7 +19,7 @@ On the SDK side, you can construct an encoded function selector using the `fuels E.g. to call the following function on the target contract: ```rust,ignore -{{#include ../../../packages/fuels/tests/contracts/contract_test/src/main.sw:initialize_counter}} +{{#include ../../../packages/fuels/tests/contracts/contract_test/src/main.sw:low_level_call}} ``` you would construct the function selector and the calldata as such, and provide them to the caller contract (like the one above): diff --git a/packages/fuels/tests/contracts/contract_test/src/main.sw b/packages/fuels/tests/contracts/contract_test/src/main.sw index 77de71a916..caff855433 100644 --- a/packages/fuels/tests/contracts/contract_test/src/main.sw +++ b/packages/fuels/tests/contracts/contract_test/src/main.sw @@ -21,16 +21,16 @@ enum State { } abi TestContract { - // ANCHOR: initialize_counter #[storage(write)] fn initialize_counter(value: u64) -> u64; - // ANCHOR_END: initialize_counter #[storage(read, write)] fn increment_counter(value: u64) -> u64; #[storage(read)] fn get_counter() -> u64; + // ANCHOR: low_level_call #[storage(write)] fn set_value_multiple_complex(a: MyStruct, b: str[4]); + // ANCHOR_END: low_level_call #[storage(read)] fn get_str_value() -> str[4]; #[storage(read)]