-
Notifications
You must be signed in to change notification settings - Fork 99
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
multi: USDC Bridge between eth and polygon #2797
base: master
Are you sure you want to change the base?
Conversation
Implements the CCTP protocol to bridge native USDC between eth and polygon.
fmt.Println("~~~~~~", tokenCfg.AssetID, usdcEthID, usdcPolygonID) | ||
if tokenCfg.AssetID == usdcEthID || tokenCfg.AssetID == usdcPolygonID { | ||
fmt.Println("returning bridge wallet") |
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.
Did you mean to leave in these prints? Can trace log?
|
||
type Bridger interface { |
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 add a comment for Bridger
.
value (int): The amount of tokens to bridge. | ||
burnTxID (string): The transaction ID of the burn transaction. Returned from the burn command. | ||
mintInfo (string): The information needed to mint tokens. Returned from the getmintinfo command.`, | ||
}, |
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 add returns? Whats 2?
$ ./bwctl -p abc -p "" --testnet bridge checkbridgeapproval 60001
2
return createResponse(bridgeRoute, approvalStatus, nil) | ||
} | ||
|
||
func handleApproveBridge(s *RPCServer, params *RawParams) *msgjson.ResponsePayload { |
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.
Could also unlock the wallet in this method if locked by requiring password params. It looks like we haven't been doing that though, so feel free to ignore.
if len(params.Args) != 2 { | ||
return usage(bridgeRoute, fmt.Errorf("expected 1 args, got %d", len(params.Args))) | ||
} |
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.
$ ./bwctl -p abc -p "" --testnet bridge getmintinfo ed90645fc6058b27e11c71060b0b55d5f55db55f7365610359c6f5768f4cffd5
expected 1 args, got 1
I guess it would be bad to lose the txids between burn and mint. Need to log them alot and also save in a db somewhere at some point? |
Implements the CCTP protocol to bridge native USDC between eth and polygon.
This will be used to support running market making bots doing rebalances between the local wallet and a centralized exchange when the exchange does not support withdrawing USDC to Polygon. Binance supports neither deposits nor withdrawals to Polygon. Coinbase (coming soon) supports deposits, but not withdrawals.