-
Notifications
You must be signed in to change notification settings - Fork 5
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
Action Models #182
Action Models #182
Conversation
75f7de9
to
8211bca
Compare
8211bca
to
cb19cf7
Compare
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.
Looks good (would have been nice to split out testing setup and CI logic from the rest of the code).
I believe most of the parsing code could be replaced by depending on the contracts npm package und using ethers parsing library (which I'd prefer a lot) but isn't mandatory.
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 code works, but I also prefer to use a library rather than doing manual event parsing.
I added an issue for this already. I'm not sure it makes sense to add all that into this PR, but rather as an improvement later. See here What do you think? Now or later? |
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 left some nitpicky discussion comments and agreed with some of the issues raised.
Other than that, LGTM.
a7d7f5d
to
c3597e2
Compare
Introducing transaction log parsing via ethers library with appropriate Contract artifacts. Namely, we introduce dependencies on @cowprotocol/contracts which contain the abi files for GPv2Settlement and iERC20 and suffice for us to decode relevant event data from settlement transactions. For us these are Transfer, Settlement and Trade. We construct Event types out of each which only keep the parts that matter for our purposes (namely TradeEvent having owner as the only relevant field).
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
New dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No new dependency issues detected in pull request Bot CommandsTo ignore an alert, reply with a comment starting with Pull request alert summary
📊 Modified Dependency Overview:
|
A bit late, but it looks good to me! As an improvement I'd suggest to check that the emitter address is the settlement contract for events where |
To extend our current web3 action, we prepare the foundational modeling and parsing logic behind processing a Settlement Transaction. In particular this PR introduces
Part of #177
Models
TransferEvent
,TradeEvent
andSettlementEvent
containing only the foreseeable relevant information for Slippage accounting purposes (e.g. TradeEvent only contains owner) which will be used to classify transfers asAMM_{IN/OUT}
vsUSER_{IN/OUT}
Utilities
0x0000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab41
into addresses like0x9008d19f58aabd9ed0d60971565aa8510560ab41
TransferEvent.involves(address)
used to filter out only relevant transfers during transaction processing.Functionality
partitionEventLogs
a method which transforms transaction event logs into the relevant events defined above.Test Plan
Will add CI that runs all the new tests.