Skip to content

Commit

Permalink
Merge pull request #3 from Abracadabra-money/fix-bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCalibur authored Dec 17, 2024
2 parents ae40f5d + 8d804ba commit c2e8b6d
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 c2e8b6d

Please sign in to comment.