Skip to content

Commit

Permalink
Update callbacks.md (#1683)
Browse files Browse the repository at this point in the history
  • Loading branch information
bucanero authored Jan 24, 2024
1 parent 5b2a5a2 commit 5c32505
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/sdk/rust/cross-contract/callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ There are two techniques to write cross-contract calls: [high-level](https://git

There is a helper macro that allows you to make cross-contract calls with the syntax `#[ext_contract(...)]`. It takes a Rust Trait and converts it to a module with static methods. Each of these static methods takes positional arguments defined by the Trait, then the `receiver_id`, the attached deposit and the amount of gas and returns a new `Promise`.


:::info

If the function returns the promise, then it will delegate the return value and status of transaction execution, but if you return a unit type (`()`, `void`, `nothing`), then the `Promise` result will not influence the transaction status.

:::

For example, let's define a calculator contract Trait:

```rust
Expand Down

0 comments on commit 5c32505

Please sign in to comment.