Skip to content

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

@marco-sundsk

Description

@marco-sundsk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions