I'm using web3 to get the RLP encoded data for a function call like so
const safeTransferFrom: any = tokenERC1155Abi.find((f) => f.name === 'safeTransferFrom');
const params: Array<any> = [identity, minterAddr, 1, amount, '0x0'];
web3.eth.abi.encodeFunctionCall(safeTransferFrom, params);
is there a way to achieve the same result with the ethers.js
library?
Best Answer
The equivalent in ethers.js involves first creating an "interface" object and calling a method on that:
Taken from here