-
Notifications
You must be signed in to change notification settings - Fork 252
Add DeBridge #131
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
base: main
Are you sure you want to change the base?
Add DeBridge #131
Conversation
|
@bussyjd I've made the suggested changes, and also added some code for handling transactions which have "allowanceTarget" and "allowanceValue". Please have a look at it. |
|
howdy partner @parthg1901. this is tremendous work and we really appreciate it! however, i do have some difficulties to comment upon. all of my attempts to create a bridge tx so far have failed, do you see any errors in the way that i am using it? here is one of the commands ive tried action debridge create-bridge-tx evm 8453 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 10 137 0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619 0xFF6CBf6830C47 i have tried different chain and token combinations, all with either unsupported token/chain errors or this other error { the wallet has 45 usdc in it, and i have tried values from 10 to 40. also tried starting with weth but it wouldnt accept decimal token amounts i have only tried stablecoins and weth. let me know if im doing things wrong friend. thanks again |
|
hey @ef95023 , thanks for trying it out!
You're getting this error because you need to add the required zeros to srcChainTokenInAmount. Instead of using 10, you should use 10000000 for USDC. That should work. and for the unexpected chain error, please check if you're using the internal chain ID which DeBridge requires. Check this out. So, for example - for sonic you need to use 100000014 instead of 146 (Should I just make a Dict for it?) We could abstract "adding zeros" into our code, but I haven’t found a clean way to do it without making a mess. Note - Since you're using USDC, keep in mind that the first transaction you create and execute will be an approval transaction. You’ll need to create and execute another transaction afterward. Also make sure your wallet has some native tokens for the DeBridge Flat Fees. Please let me know if you run into any more issues. |
This PR adds support for DeBridge to ZerePy
Approach
The main idea was to integrate DeBridge while keeping the other connection intact.
Changes made
Tests performed
Note: This is not a real transaction. It was sent on the anvil fork of ethereum.

Some changes that might be needed
I've added token approval checks for evm-based chains but I'm not sure what's the equivalent in Solana.
Usage in CLI
agent-action debridge create-bridge-tx {connection} ...other params- Creates a transaction and saves the latest pending-tx into the DeBridgeConnection (similar to what the previous PR does).agent-action debridge execute-bridge-tx {connection}- Executes the transaction on the passed connection. Make sure its the same as your source chain.Example -
{connection} can be "ethereum", "sonic", "solana" or "evm".
Thanks! Let me know if any fixes are required. Any suggestions for the solana integration would be helpful.