transfer
function on the contract, which takes in two parameters:
to
: The address of the recipientvalue
: The amount of tokens to sendviem
to provide the ABI and encode the function parameters.
Additionally, each ERC-20 token defines a decimals
value, which is the number of decimal places for the token. For USDC, the decimals
value is usually 6, but for most other ERC-20 tokens, it’s 18.
viem
package if it is not installed yet.