Skip to content

Commit

Permalink
fixed bridge task
Browse files Browse the repository at this point in the history
  • Loading branch information
0xm3rlin committed Dec 17, 2024
1 parent ae40f5d commit 8d804ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tasks/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ task("bridge", "Bridge tokens from one chain to another")
if (networkConfig.type === 'adapter') {
const adapterConfig = networkConfig as { type: 'adapter', underlying: string };
const underlyingToken = await hre.ethers.getContractAt("IERC20", adapterConfig.underlying);
const allowance = await underlyingToken.allowance(sender.address, underlyingToken.address);
const allowance = await underlyingToken.allowance(sender.address, oftContract.address);
//console.log(`allowance: ${allowance}`);

if (allowance.lt(amountInWei)) {
console.log(`Approving ${tokenSymbol} tokens to OFT adapter...`);
const approveTx = await underlyingToken.approve(underlyingToken.address, amountInWei);
const approveTx = await underlyingToken.approve(oftContract.address, amountInWei);
await approveTx.wait();
console.log("Approval successful!");
}
Expand Down

0 comments on commit 8d804ba

Please sign in to comment.