Skip to content

Commit

Permalink
fix approvals
Browse files Browse the repository at this point in the history
  • Loading branch information
brtkx committed Oct 24, 2024
1 parent 3ab56f0 commit 93a3072
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,14 @@ export class Erc20DepositStarter extends BridgeTransferStarter {
)
)

const estimatedDestinationChainGasFee = utils.parseEther(
String(estimatedDestinationChainGasFeeEth)
const nativeCurrency = ERC20__factory.connect(
l2Network.nativeToken,
this.sourceChainProvider
)

const estimatedDestinationChainGasFee = utils.parseUnits(
String(estimatedDestinationChainGasFeeEth),
await nativeCurrency.decimals()
)

// We want to bridge a certain amount of an ERC-20 token, but the Retryable fees on the destination chain will be paid in the custom fee token
Expand Down Expand Up @@ -184,8 +190,14 @@ export class Erc20DepositStarter extends BridgeTransferStarter {
)
)

const estimatedDestinationChainGasFee = utils.parseEther(
String(estimatedDestinationChainGasFeeEth)
const nativeCurrency = ERC20__factory.connect(
l2Network.nativeToken,
this.sourceChainProvider
)

const estimatedDestinationChainGasFee = utils.parseUnits(
String(estimatedDestinationChainGasFeeEth),
await nativeCurrency.decimals()
)

return erc20Bridger.approveGasToken({
Expand Down

0 comments on commit 93a3072

Please sign in to comment.