-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: add erc20 paymaster #6
Conversation
function updateFeePrice(uint256 _feePrice) public onlyRole(PRICE_ORACLE_ROLE) { | ||
feePrice = _feePrice; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to move to a more agnostic architecture where this contract (the Paymaster) pulls the information from another contract which is the price feed itself. Meaning that we have two contracts:
- The Paymaster, with a configurable price feed contract (let's say it implements an interface
IPriceFeed
) - The actual price feed implementing
IPriceFeed
and exposing thisupdateFeePrice
method for its robot to update the price
This will allow us to easily move to another price feed contract in the future without having to rewrite or redeploy the paymaster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup that was the next step. As discussed we wanted to have a minimally working contract quickly and improving it towards the ideal case. Uniswap has already got some interfaces that could be used here even if we are not going to connect the contract to uniswap immediately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think it makes sense to have now
paymaster -> price feed
Then when we have the uniswap (or similar) price feed we can do
paymaster -> price feed -> uniswap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR has already grown too big, if you agree let's not keep it for this feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with this if this PR is followed by one implementing the above. It sounds necessary for production from my perspective as it allows us some flexibility oracle wise in case of upgrades etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it will be followed
…if the token is allowed with Erc20Paymaster is used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aliXsed given the adjustments to use the docker node, we will need to adapt the Github Actions to start the said local node. Careful that it will increase the CI time by a lot since it takes 5 to 10 minutes to completely init a local testnet.
…asEsmitate for failing tx
Co-authored-by: Eliott Teissonniere <[email protected]>
Fix formatting in *.sol and *.ts files as well
"fmt:check": "prettier --check --plugin=prettier-plugin-solidity 'contracts/**/*.sol' '**/*.ts'", | ||
"fmt:fix": "prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol' '**/*.ts'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Niiiiice thanks!
This is a paymaster that allows the gas fee to be paid from our own token. This version relies on a price which can be updated by a permissioned oracle. The admin can easily kick out the oracle at any point and replace her with another trusted wallet. The admin can also withdraw the ETH that this paymaster is charged with.