From bbbd475df4f42654bd51d9ab7ba51ff68a046225 Mon Sep 17 00:00:00 2001 From: chaitanyapotti Date: Fri, 3 Nov 2023 00:04:36 +0800 Subject: [PATCH] send to diff address erc20 --- demo/react-app/src/services/ethProvider.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demo/react-app/src/services/ethProvider.ts b/demo/react-app/src/services/ethProvider.ts index 9b275fde5..538385d92 100644 --- a/demo/react-app/src/services/ethProvider.ts +++ b/demo/react-app/src/services/ethProvider.ts @@ -77,7 +77,9 @@ const ethProvider = (provider: IProvider, uiConsole: (...args: unknown[]) => voi const web3 = new Web3(provider as any); const accounts = await web3.eth.getAccounts(); const contract = new web3.eth.Contract(erc20Abi, tokenAddress); - const txRes = await contract.methods.transfer(accounts[0], web3.utils.toWei("0.01", "ether")).send({ from: accounts[0] }); + const txRes = await contract.methods + .transfer("0x3E2a1F4f6b6b5d281Ee9a9B36Bb33F7FBf0614C3", web3.utils.toWei("0.01", "ether")) + .send({ from: accounts[0] }); uiConsole("txRes", txRes); } catch (error) { console.log("error", error);