Add proxy call to precompile #1970
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal of the proxy precompile is to allow smart contracts to interact with the subtensor pallet by making other precompile calls on behalf of users. Much like DEXs can swap tokens on behalf of users using ERC20's allowance functionality, the proxy precompile allows smart contracts to perform actions on behalf of users, such as transferring stake.
This is just a draft right now, it still needs tests to ensure it works, and also to ensure that the elevated permissions inside precompile can't be abused. We need tests to prove the proxied call is scoped to the proxy type and the proxied account.
Closes #1967
This won't work, so adding a more specific
proxyTransferStake
precompile method instead.