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

feat(#major); Polygon Bridge; Add polygon-bridge subgraph #2288

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

nemani
Copy link
Contributor

@nemani nemani commented Jul 18, 2023

Ethereum Subgraph:

okgraph

@bye43 bye43 linked an issue Jul 18, 2023 that may be closed by this pull request
@melotik melotik self-requested a review August 8, 2023 22:04
deployment/deployment.json Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you fill this in? I would use another bridge as a template for what to note here

@melotik
Copy link
Contributor

melotik commented Aug 8, 2023

Hey @nemani a couple things before a more in depth review:

  • Can you fix the build and lint errors? You can ignore the magic number ones though
  • Can you deploy and link the polygon deployment

@bye43 bye43 linked an issue Aug 15, 2023 that may be closed by this pull request
Comment on lines +7 to +8
export const PROTOCOL_NAME = "Polygon";
export const PROTOCOL_SLUG = "polygon";
Copy link
Contributor

Choose a reason for hiding this comment

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

Polygon Bridge and polygon-bridge

@@ -0,0 +1,206 @@
import { Address, BigDecimal, BigInt, log } from "@graphprotocol/graph-ts";

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove newlines in imports


export function handleTokenMappedERC20(event: TokenMappedERC20): void {
const sdk = SDK.initialize(conf, new Pricer(), new TokenInit(), event);
const crosschainID = BigInt.fromI32(137);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we make this a constant?

const poolAddr = call.inputs.rootToken;
const logData = call.inputs.log;
const logDataLength = call.inputs.log.length;
const logDataOffset = logDataLength - 32;
Copy link
Contributor

Choose a reason for hiding this comment

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

The 32 should be a constant too

@@ -0,0 +1,292 @@
/////////////////////
Copy link
Contributor

Choose a reason for hiding this comment

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

can you remove any unsued files, like this one?

Copy link
Contributor

@melotik melotik left a comment

Choose a reason for hiding this comment

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

Looking good @nemani ! A few change requests, also:

  • can you update to the latest bridge schema (and you'll need to copy over the newer sdk)
  • can you fill out the README.md file
  • the build will need to pass

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.

Build Polygon Bridge Subgraph Polygon Bridge - MAINNET QA
2 participants