-
Notifications
You must be signed in to change notification settings - Fork 8
feat: update internal buffer order graph #504
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
value: log.inputs[IndexTransferInput.value].value, | ||
isInternal: from === to, |
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.
Assuming only internal trades will ever have same from & to
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.
Technically, im not even sure is the case
It would be weird that there's an order under this case, it means we spend gas just to do nothing. And we make the user pay some gas. So doesn't look like a legit case, and I don't think the protocol should support wash-trading
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.
so im fine with this assumption
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 moved the node somewhere else, to be clearer there's a trade involved.
Still, if not isInternal
, what's your suggestion?
const transferAddresses = new Set() | ||
|
||
transfers.forEach((transfer) => { | ||
transferAddresses.add(transfer.from) | ||
transferAddresses.add(transfer.to) | ||
}) | ||
|
||
try { | ||
contracts | ||
.filter((contract: Contract) => { | ||
// Only usecontracts which are involved in a transfer | ||
return transfers.find((transfer) => { | ||
return transfer.from === contract.address || transfer.to === contract.address | ||
}) | ||
}) | ||
.forEach((contract: Contract) => { | ||
contracts.forEach((contract: Contract) => { | ||
// Only use contracts which are involved in a transfer | ||
if (transferAddresses.has(contract.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.
Optimization as it was searching the transfers list for every contract
@@ -121,6 +121,7 @@ export function STYLESHEET(theme: DefaultTheme): Stylesheet[] { | |||
'curve-style': 'bezier', | |||
'font-size': '15px', | |||
'text-background-padding': '3px', | |||
'control-point-step-size': 75, |
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.
Giving more space between edges
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.
Not for this PR, and maybe not for now, but maybe we will want to:
- Label some special accounts, like:
0xa03be496e67ec29bc62f01a428683d7f9c204930
- Also, provide a way to open a node in etherscan or something. it's hard to check the actually full address
Nothing you should address here, just some thoughts
value: log.inputs[IndexTransferInput.value].value, | ||
isInternal: from === to, |
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.
Technically, im not even sure is the case
It would be weird that there's an order under this case, it means we spend gas just to do nothing. And we make the user pay some gas. So doesn't look like a legit case, and I don't think the protocol should support wash-trading
value: log.inputs[IndexTransferInput.value].value, | ||
isInternal: from === to, |
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.
so im fine with this assumption
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.
It works great!
LGTM!! |
Update
Using
CoW Protocol Buffer
as the node nameMoved the node together with the receiver address to be explicit this is a trade
Summary
Part of #491
Follow up to #492
Added new node for Internal buffer trades
Tooltip includes only
from
andamount
To Test
0xd78b614d0d5c39d55c516653e8674b73133d2c9bbdf302e5be036de7c6b304e6
graph
tabInternal buffer
0xa6e62c2713ef08d4e979d8ba63643d6d1f522f8b825c27682098578dd9e1f043