-
Notifications
You must be signed in to change notification settings - Fork 241
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
base: master
Are you sure you want to change the base?
Conversation
subgraphs/polygon-bridge/README.md
Outdated
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.
Can you fill this in? I would use another bridge as a template for what to note here
…o create withdraws for non-fx pos transfer
…e count, slowing down the syncing but improving accuracy
export const PROTOCOL_NAME = "Polygon"; | ||
export const PROTOCOL_SLUG = "polygon"; |
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.
Polygon Bridge and polygon-bridge
@@ -0,0 +1,206 @@ | |||
import { Address, BigDecimal, BigInt, log } from "@graphprotocol/graph-ts"; | |||
|
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.
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); |
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.
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; |
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 32 should be a constant too
@@ -0,0 +1,292 @@ | |||
///////////////////// |
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.
can you remove any unsued files, like this one?
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.
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
Ethereum Subgraph:
okgraph