-
-
Save CumpsD/82f41910ab897c624da1f45ccac7ac0c to your computer and use it in GitHub Desktop.
This can be used to broadcast a Chainflip signed payload and pay for gas using an EOA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ethers, Wallet } from "ethers"; | |
// This can be used to broadcast a transaction stuck in Chainflip. | |
// | |
// One way this can happen is if a deposit channel's CCM payload has an insufficient gas limit. | |
// It can also happen if you transaction requires external state changes like an approval. | |
// Just run replace the privateKey and payload value and run `bun run ./script/chainflip/broadcast.ts` from root to broadcast the transaction | |
// `payload` can be found on CF's explorer swap page e.g. https://scan.chainflip.io/swaps/345692 | |
const privateKey = "0x"; | |
const contract = "0x79001a5e762f3befc8e5871b42f6734e00498920"; | |
const payload = | |
"0x5293178e1f2a11943836956f8ae0da6e1d9ed9ed7d6e916af99affd70e31caac80cb3416000000000000000000000000000000000000000000000000000000000000286d000000000000000000000000e1434b4c654e029a23d58e3585ad8cfa77957218000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000503ae0caefdec6d4ff54e4746f8e7543cf4cd500000000000000000000000000000000000000000000000000000000017d1ad900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000a052ddf1c1739419b90fb7bf722843ad3e63114b"; | |
const connection = new ethers.JsonRpcProvider("https://arbitrum.llamarpc.com"); // or change to your RPC | |
const wallet = new Wallet(privateKey); | |
const signer = wallet.connect(connection); | |
const tx = { | |
from: wallet.address, | |
to: contract, | |
value: ethers.parseUnits("0", "ether"), | |
data: payload, | |
}; | |
await signer.sendTransaction(tx); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment