0

I have some complicated user case and have decided to go with a hybrid offchain and onchain method for my rewards system. The issue is that we want rewards to only be available to certain users that are calculated via public apis but we want users to receive funds from a vault contract. So we have a backend that interacts with the contract. One of our functions transfer is an owner only function. We want to call this function from our website after a user logins in but we want the user to pay for the gas for this function as well. Since we are calling the function through the backend using the owner's private key we can't find a way to make it so that the user pays for the gas.

I have found something called the gas station network but it seems to do the opposite of what we want.

2
  • Using Merkle proof with valid admin signature verifier, this can be possible. Sep 29, 2022 at 7:36
  • @MaheshRajput do you have any examples of where I can find this
    – yuvaly
    Sep 29, 2022 at 17:59

1 Answer 1

0

The account that will pay the gas is the account that makes the call.

If you want the user to pay the gas, they will have to make the call.

1
  • But then I exposes the function to transfer tokens right and anyone can just transfer the tokens from the vault. How would I secure the transfer tokens function then in solidity?
    – yuvaly
    Sep 29, 2022 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.