Skip to content

Commit

Permalink
fix encoding issue at getERC20DefaultBridgeData
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad-Altabba committed Sep 5, 2024
1 parent 9e889dd commit 2f58177
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,14 @@ export async function getERC20DefaultBridgeData(
? 18
: await token.methods.decimals().call();


const nameBytes = web3Abi.encodeParameters(['string'], [name]);
const symbolBytes = web3Abi.encodeParameters(['string'], [symbol]);
const decimalsBytes = web3Abi.encodeParameters(['uint256'], [decimals]);

return web3Abi.encodeParameters(
['string', 'string', 'uint256'],
[name, symbol, Number(decimals)],
['bytes', 'bytes', 'bytes'],
[nameBytes, symbolBytes, decimalsBytes],
);
}

Expand Down

0 comments on commit 2f58177

Please sign in to comment.