-
Notifications
You must be signed in to change notification settings - Fork 215
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
Paraswap, AaveV2, Balancer, Yearn, DSR Filters #208
Conversation
9f0b470
to
854caff
Compare
0d89160
to
29cdf6f
Compare
09ce94d
to
c19710a
Compare
return (method == ERC20_APPROVE); | ||
} | ||
|
||
function getMethod(bytes memory _data) internal pure returns (bytes4 method) { |
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.
Maybe we should move this method to an abstract BaseFilter
contract given that it will be used by all filters.
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.
There's already Utils.functionPrefix
that does that
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.
Utils.functionPrefix
has a require(_data.length >= 4, "Utils: Invalid functionPrefix");
which we don't want (we want to return false
in most of these cases, and sometimes even accept _data.length == 0
).
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.
But by the point where this is called you've already ensured that require
is met
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.
True. But that's a useless require. Also, I like that we have tried so far to write filters in a way that doesn't rely on any other file than IFilter
and BaseFilter
, making it easier to publish the filters and DappRegistry
in a standalone repo, should this become a reference registry used outside Argent.
test/paraswap.js
Outdated
|
||
filter = await Filter.new(tokenPriceRegistry.address, dexRegistry.address); | ||
await dappRegistry.addDapp(0, paraswap.address, filter.address); | ||
await dappRegistry.addDapp(0, paraswapProxy, ZERO_ADDRESS); |
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.
Shouldn't we have a filter for the proxy as well?
const AaveV2Filter = artifacts.require("AaveV2Filter"); | ||
const BalancerFilter = artifacts.require("BalancerFilter"); | ||
const YearnFilter = artifacts.require("YearnFilter"); | ||
|
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.
Missing the paraswap proxy filter
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.
As discussed I think best to integrate test these with a mainnet fork although happy to leave it on the tech debt backlog for now.
Includes implementation & tests for the following authorisation filters: