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

Let user directly got near when withdraw wnear at contract level #42

Open
marco-sundsk opened this issue Aug 29, 2021 · 0 comments
Open

Comments

@marco-sundsk
Copy link
Contributor

Basically, we should let user got near directly when he withdraw wrapped-near. Now, this feature is implemented at frontend. It raise our ref withdraw. followed by a wrap.near::near_deposit action when it recognizes the token is wnear. But these chain transactions has a little probability that can be interrupted by accident like page close or temp network failure.

Actually, there is a way to get these two actions done in our ref contract level. That is, when user withdraw wnear, we first unwrap it as ref-contract and got near back in ref-contract account, and then transfer those native near from ref-contract to user's account. In that way, all work can be done in one contract call to the ref-contract with a total success or failure, nothing can interrupt the two actions due to the powerful NEAR cross-contract call technique.

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

No branches or pull requests

1 participant