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

Send tokens #70

Merged
merged 3 commits into from
Sep 2, 2024
Merged

Send tokens #70

merged 3 commits into from
Sep 2, 2024

Conversation

virgil-serbanuta
Copy link
Member

Fixes #49

This PR is more complex than usual because it tries to follow the mx-semantics repository. The main problem is that MunltiversX transfers are tightly linked with contract calls, so I also had to implement some of the call functionality.

@virgil-serbanuta virgil-serbanuta marked this pull request as ready for review September 2, 2024 13:43
)
| checkAccountExists(address: String)
| checkESDTBalance(account: String, token: String, value: Int)
| addToESDTBalance(account: String, token: String, delta: Int, allowNew: Bool)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we intend to have negative deltas to addToESDTBalance? If it is only intended to add amounts to the total balance, then perhaps we should have requires in the rules preventing modifications by negative values and possibly negative balances. Or perhaps change the naming from addToESDTBalance to something like modifyESDTBalanceByDelta.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the deltas can be negative, see https://github.com/Pi-Squared-Inc/rust-demo-semantics/pull/70/files#diff-39d9f39de40db7c63b5cb4ada9dfd2b5c889ffadbae02c26a7db378356ef234cR50-R51. I copied the name from the existing mx-semantics. I renamed it, is it better now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is, @virgil-serbanuta . Thank you!

@virgil-serbanuta virgil-serbanuta merged commit b86e46d into main Sep 2, 2024
1 check passed
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.

Mx semantics - Hooks - Send - Rust + Mx
2 participants