Skip to content

Commit

Permalink
feat(@fireblocks/recovery-utility): ✨ add erc20 withdrawal support
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerHFB authored and a0ngo committed Dec 24, 2024
1 parent 24446ee commit 151ea80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 2 additions & 4 deletions apps/recovery-relay/components/WithdrawModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,11 @@ export const WithdrawModal = () => {
}}
>
<Typography variant='body1'>Transaction Hash:</Typography>
{asset.getExplorerUrl ? (
{
<Link href={asset.getExplorerUrl!('tx')(txHash)} target='_blank' rel='noopener noreferrer'>
{txHash}
</Link>
) : (
txHash
)}
}
</Typography>
<Typography variant='body1'>
The transaction might take a few seconds to appear on the block explorer
Expand Down
7 changes: 5 additions & 2 deletions apps/recovery-relay/lib/wallets/ERC20/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ export class ERC20 extends EVMBase implements ConnectedWallet {

const { gasPrice, maxFeePerGas, maxPriorityFeePerGas } = await this.provider!.getFeeData();

const iface = new ethers.Interface(erc20Abi);
const data = iface.encodeFunctionData('transfer', [this.toAddress, BigInt(displayBalance) * BigInt(this.normalizingFactor!)]);
const abiInterface = new ethers.Interface(erc20Abi);
const data = abiInterface.encodeFunctionData('transfer', [
this.toAddress,
BigInt(displayBalance) * BigInt(this.normalizingFactor!),
]);

const tx = {
to: this.tokenAddress,
Expand Down

0 comments on commit 151ea80

Please sign in to comment.