Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cross contract convention guide #853

Merged
merged 9 commits into from
Aug 12, 2024

Conversation

tupui
Copy link
Contributor

@tupui tupui commented Aug 2, 2024

Closes #413

This PR adds a convention guide to show how to make cross contract call. There is a bit of discussion around the topic as well.

At first I was thinking about showing how to call Soroban Domain (I did that for my project now), but I then thought this should stay neutral. So this uses the add function which we already have in the example (and the snippet from the original issue) so that the reader can then more easily look at a full example and play with it.

Let me know if I should add anything 😃

cc @briwylde08

@briwylde08
Copy link
Contributor

Yippee! Thank you! We're a bit behind in reviews but I'll assign this one early next week.

@tupui
Copy link
Contributor Author

tupui commented Aug 2, 2024

No worries, I rushed this to have it open before the deadline 😅 Next week I am back on Thursday.

@briwylde08
Copy link
Contributor

#413


## Public API

All public functions of a contract can be called. Here as well, using a network explorer can be helpful as some propose to see the Rust interphase of a contract. Bindings can also be generated using the CLI:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interphase = interface?

@briwylde08 briwylde08 requested a review from ElliotFriend August 5, 2024 18:59
Copy link
Contributor

@ElliotFriend ElliotFriend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic, as usual, @tupui! Thanks for the contribution! I left a couple small nitpicks here and there, but this is pretty close to ready as-is.

Thanks!!

docs/build/guides/conventions/cross-contract.mdx Outdated Show resolved Hide resolved
docs/build/guides/conventions/cross-contract.mdx Outdated Show resolved Hide resolved
docs/build/guides/conventions/cross-contract.mdx Outdated Show resolved Hide resolved
docs/build/guides/conventions/cross-contract.mdx Outdated Show resolved Hide resolved
docs/build/guides/conventions/cross-contract.mdx Outdated Show resolved Hide resolved
docs/build/guides/conventions/cross-contract.mdx Outdated Show resolved Hide resolved
@tupui
Copy link
Contributor Author

tupui commented Aug 12, 2024

Thanks @ElliotFriend for the review 😃 I think this is ready then.

Copy link
Contributor

@ElliotFriend ElliotFriend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks again!!

@briwylde08
Copy link
Contributor

Thanks for the work here @tupui! Let's take the award conversation back to the corresponding issue.

@briwylde08 briwylde08 merged commit be38354 into stellar:main Aug 12, 2024
1 check passed
@tupui
Copy link
Contributor Author

tupui commented Aug 13, 2024

Awesome 🤩 thanks! That must have been quite a review effort for you guys this program, kudos 👏

@tupui tupui deleted the 413_cross_contract_guide branch August 13, 2024 11:52
@briwylde08
Copy link
Contributor

Agreed!!! @ElliotFriend, @Julian-dev28, @Shaptic are review heroes!!

janewang pushed a commit that referenced this pull request Sep 12, 2024
* Structure for cross contract convention guide

* Deps section

* Last words section

* Add handling resp

* Add cross contract call

* Add public API section

* editorial & formatting

* Apply suggestions from code review

Co-authored-by: Elliot Voris <[email protected]>

* Convert other occurrences of Soroban smart contract

---------

Co-authored-by: Bri <[email protected]>
Co-authored-by: Elliot Voris <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cross contract calls: document the non panicking version
3 participants