Skip to content
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

Merged
merged 5 commits into from
May 20, 2024
Merged

updated billing for base and gnosis! #261

merged 5 commits into from
May 20, 2024

Conversation

wtfsayo
Copy link
Contributor

@wtfsayo wtfsayo commented May 20, 2024

  • updated watcher for base, gnosis
  • can't add gnosis to swap as its not supported by 0x

@wtfsayo wtfsayo requested a review from plor May 20, 2024 07:14
@wtfsayo wtfsayo mentioned this pull request May 20, 2024
Copy link
Contributor

@plor plor left a 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),
Copy link
Contributor

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,
Copy link
Contributor

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.

Comment on lines +176 to +178
{ client: opClient, name: 'optimism' },
{ client: gnosisClient, name: 'gnosis' },
{ client: baseClient, name: 'base' }
Copy link
Contributor

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?

@wtfsayo wtfsayo requested a review from plor May 20, 2024 17:04
Copy link
Contributor

@plor plor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

web-portal/backend/src/utils/utils.service.ts Show resolved Hide resolved
@wtfsayo wtfsayo merged commit 1756ed0 into develop May 20, 2024
2 checks passed
@wtfsayo wtfsayo deleted the update-portr-base branch May 26, 2024 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants