I would like to send some IERC20 tokens from metamask to a contract controlled by my webpage
I link an HTML button action to the following javascript function. This works well when ether is sent directly from metamask after accepting confirming/linking account from metamask with webpage
const placeFunds = async (side, e) => {
e.preventDefault();
await contract.getFunds(
side,
{value: e.target.elements[0].value}
);
Now for the IERC20 token, I would like to figure out the IERC20 token address before passing to the contract function. Where is the token address stored in javascript/how do I get that info, as I want the contract to accept only specific ERC20 tokens?
const placeFunds = async (side, e) => {
e.preventDefault();
await contract.getFunds(
side, TOKENADDRESS,
{value: e.target.elements[0].value}
);