Skip to content

Commit

Permalink
fix arbitrum-ethereum fee token (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 authored Jul 19, 2023
1 parent 1389e63 commit 502c417
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,16 @@ export class EthereumArbitrumBridgeL2 extends Bridge<EthereumArbitrumBridgeConfi
): Promise<TokenWithAmount | null> {
try {
const params = await this.getL1toL2Params(direction);
const nativeToken = direction.from.meta.tokens.find(({ type }) => type === 'native');
const { decimals, symbol } =
direction.from.host === 'ethereum' && nativeToken
? { decimals: nativeToken.decimals, symbol: nativeToken.symbol }
: { decimals: direction.from.decimals, symbol: direction.from.symbol };

return {
...omit(direction.from, ['meta', 'amount']),
decimals: direction.to.decimals,
decimals,
symbol,
amount: new BN(params.deposit.toString()),
};
} catch (err) {
Expand Down

0 comments on commit 502c417

Please sign in to comment.