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

NEP-SPOP: Sponsored Operations #138

Open
igormcoelho opened this issue Apr 29, 2021 · 0 comments
Open

NEP-SPOP: Sponsored Operations #138

igormcoelho opened this issue Apr 29, 2021 · 0 comments

Comments

@igormcoelho
Copy link

igormcoelho commented Apr 29, 2021

Now that we have Refuel mechanism, I propose that we discuss some NEP for Sponsored Operations, with the following operation:

  • sponsorValue(string methodName, object[] args, Hash160 sender) -> BigInteger "GAS"

With this operation, a deployed contract may inform user, aka "sender", its willingness to sponsor some GAS during execution time for the intended operation methodName.

Example:
Some NEP-17 implements this NEP and provides that "transfer" gives extra 0.5 GAS for the user. This check can be done during test time (as a "const" operation), and then, User Wallet then should be able to estimate how much GAS it needs to reach the point of method invocation, including sponsorValue GAS cost. On the other hand, contract that implements this NEP, should use sponsorValue as the first operation in the method, and should throw exception if not willing to provide GAS (so, "transfer" tests, such as balance check, could be put inside sponsorValue, thus being paid by the user together with network/tx fees).

@igormcoelho igormcoelho changed the title NEP: Sponsored Operations NEP-SPOP: Sponsored Operations Apr 29, 2021
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