-
Notifications
You must be signed in to change notification settings - Fork 0
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
updated billing for base and gnosis! #261
Conversation
wtfsayo
commented
May 20, 2024
- updated watcher for base, gnosis
- can't add gnosis to swap as its not supported by 0x
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 don't like all of this stuff hardcoded this way. It feels like the chain data should be deployment specific. For example we don't have a way to support testnet tokens at this point.
parseLogs(logs: any[], network: string): IParsedLog[] { | ||
return logs.map((log: any) => ({ | ||
tenantId: fromHex(log?.args?._identifier, 'string').replaceAll(`\x00`, ''), | ||
amount: Number(log?.args?._amount), |
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.
This needs to be sized correctly. It is currently 18 decimals, will give the user too many credits (currently 1 trillion times too many).
const blockNumber = await client.getBlockNumber(); | ||
const logs = await client.getLogs({ | ||
event, | ||
address: portrAddress, |
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.
This isn't guaranteed to be the same on every network.
{ client: opClient, name: 'optimism' }, | ||
{ client: gnosisClient, name: 'gnosis' }, | ||
{ client: baseClient, name: 'base' } |
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.
Is this manageable going forward. At what point do we have too many chains to support with the code this way?
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.