-
Notifications
You must be signed in to change notification settings - Fork 17
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: watch tower / sdk friendly expanded interface #73
Conversation
src/types/twap/TWAP.sol
Outdated
* @inheritdoc IConditionalOrder | ||
*/ | ||
function validateData(bytes memory data) external override pure { | ||
TWAPOrder.validate(abi.decode(data, (TWAPOrder.Data))); |
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.
Cool, you now expose this function, but shouldn't you use the new Errors in TWAP too?
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.
The intent was to not change existing contracts, however, as the interface enforces this, I'll add the changes to TWAP, but remove the deployment addresses in README.md
as the changes are not reflective of what is deployed (and we need to be careful and ensure we don't merge these into main
unless there is a clear intent to have the changes audited).
tl;dr I don't think it's reasonable to count on these changes being usable in production at the moment until such time in the future that there are additional order types / tweaks that necessitate a new audit / review. It's fine however for new conditional orders to use these tweaks straight up.
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.
Nice addition. Any thoughts on how we can enforce/incentivise developers to care about choosing the most suitable hint (if I don't care about watchtower costs, I'd let it poll every block).
Incentives research is tracked here. |
7420aa7
to
bc089b2
Compare
Description
Provides expanded
IConditionalOrder
interfaces with parameterized errors as these are required to standardise such that the conditional order is able to communicate it's indexing intent to a watch tower.Changes
validateData
external function for verifying a conditional order's data struct if granular verification has been implemented (recommended for order type developers).How to test
The TWAP contract has been updated to implement the expanded interface. To test:
forge test
Related Issues
Fixes #72