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

Meta Transaction Support For Staking Contract #73

Open
matYang opened this issue Dec 18, 2019 · 1 comment
Open

Meta Transaction Support For Staking Contract #73

matYang opened this issue Dec 18, 2019 · 1 comment

Comments

@matYang
Copy link

matYang commented Dec 18, 2019

Summary

Allow a 3rd party to invoke Staking contract operations on behalf of makers. E.g. add function executeTransaction(LibZeroExTransaction.ZeroExTransaction memory transaction, bytes memory signature) to the staking contract.

Motivation

To achieve frictionless on-boarding, it is unreasonable to assume makers will have Ether in their wallets. Argent wallet is a good example of this, they use meta transactions so users can onboard and start accessing DeFI functions in a few clicks, without any Ether. Today, the exchange contract supports that with executeTransactions and batchExecuteTransactions, however the staking contract does not have such ability, resulting in makers who reply on meta-transaction capabilities unable to join the staking pool.

Specification

Similar to the Exchange contract, the Staking contract logic should be based on the currentContext instead of msg.sender.

The Staking contract should expose

function executeTransaction(
    LibZeroExTransaction.ZeroExTransaction memory transaction,
    bytes memory signature
)

and

function batchExecuteTransactions(
    LibZeroExTransaction.ZeroExTransaction[] memory transactions,
    bytes[] memory signatures
)

which would set the currentContext to the signer that produced the signatures, then invoke corresponding Staking functions as specified in LibZeroExTransaction.ZeroExTransaction

Rationale (if a suggestion is proposed)

LibZeroExTransaction.ZeroExTransaction can be re-used. Given the Exchange contract has the same interface, it would be straightforward for developers to adapt the same code to invoke meta transactions on the Staking contract.

@mintcloud
Copy link
Contributor

Hey @matYang we've applied the new standard tagging to this ZEIP (see here).
The proposal makes sense - 0x Core Team does not have the bandwidth to work on this right now. Is this something you would consider pushing forward, or do you need another team to work on it?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants