-
Notifications
You must be signed in to change notification settings - Fork 141
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/factory supports parameter within struct #1343
base: main
Are you sure you want to change the base?
Feat/factory supports parameter within struct #1343
Conversation
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.
Great start, left some in-progress comments
@@ -6,6 +6,21 @@ const llamaFactoryEventAbiItem = parseAbiItem( | |||
"event LlamaInstanceCreated(address indexed deployer, string indexed name, address llamaCore, address llamaExecutor, address llamaPolicy, uint256 chainId)", | |||
); | |||
|
|||
const FactoryEventSimpleParamsAbiItem = parseAbiItem([ |
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 think you need to use
parseAbi
here because there are multiple items - We use
camelCase
for most identifiers
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.
- In case of function/event with struct, parseAbiItem can be used https://viem.sh/docs/abi/parseAbiItem#parameters . As parseAbiItem was already in use, I preferred to stick to it.
- Refactored, camelCase all the way. 🫡
"struct MarketParams {address loanToken; address collateralToken; address oracle; address irm; uint256 lltv;}", | ||
]); | ||
|
||
const FactoryEventWithDynamicChildParamsAbiItem = parseAbiItem([ |
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.
We should also include a test case where a struct/array is one of the indexed arguments and the user attempts to use one of its properties as the child address parameter. I think we'll have to validate against this - the address is not actually available in the event body because the value gets hashed and then stored as one of the topics.
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.
Handled ✅
…reaking down struct to find param
d264faf
to
211b0f6
Compare
…the user attempts to use one of its properties as the child address parameter.
[Not Complete Yet]
@typedarray