-
Notifications
You must be signed in to change notification settings - Fork 165
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
Fix/1138 followup #1185
Fix/1138 followup #1185
Conversation
Preview is available here: |
Hi @elizabethengelman! Is 1138 an issue somewhere? |
@briwylde08 Good question - I was doing this work as a follow up to Jane's PR that was addressing #1138 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I left a couple minor thoughts/questions, but I think it's pretty close to ready as-is! Thanks @elizabethengelman!!
``` | ||
|
||
Many of the types available in typical Rust programs, such as `std::vec::Vec`, are not available, as there is no allocator and no heap memory in Soroban contracts. The `soroban-sdk` provides a variety of types like `Vec`, `Map`, `Bytes`, `BytesN`, `Symbol`, that all utilize the Soroban environment's memory and native capabilities. Primitive values like `u128`, `i128`, `u64`, `i64`, `u32`, `i32`, and `bool` can also be used. Floats and floating point math are not supported. | ||
|
||
Contract inputs must not be references. | ||
|
||
The `#[contract]` attribute designates the Contract struct as the type to which contract functions are associated. This implies that the struct will have contract functions implemented for it. | ||
The `#[contract]` attribute designates the `HelloContract` struct as the type to which contract functions are associated. This implies that the struct will have contract functions implemented for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CLI (at least v22.2.0
, which I think is the current version) creates a struct called Contract
.
Edit: Never mind, we're talking about the astro template, not the stellar contract init
command... 🤦🏻♂️
Edit Edit: Oh, wait, no... This page isn't talking about the astro template, right? We might need to modify instances of HelloContract
to just Contract
then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! You're right, the current version of the CLI just has Contract
.
I have a branch to update the code that stellar contract init
creates to make it HelloContract
so that it matches the soroban-examples repo but I forgot to open a PR!
I'll revert this back to Contract
for now. And we can make this change when the cli change is also updated. I can open 2 new PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Elliot Voris <elliot@voris.me>
Preview is available here: |
@ElliotFriend just made the updates from your review - thank you! I also noticed one more small thing that needed to be fix, and pushed up a commit for that as well. |
Preview is available here: |
1 similar comment
Preview is available here: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great @elizabethengelman!! Thanks so much!!
Some additional fixes/updates that i noticed while looking into 1138
getting start
contract bindings
command works in dapp-frontend.mdxinit
command, and how the--name
flag worksdapp-frontend.mdx
.stellar
over into theirst-soroban-app
directory so we can reuse the deployments from the first secionscontract bindings
example