I am real beginner so apologize for the dumb question, I have an hard time understanding the account transfer system.
I created a contract from openzeppelin ERC20 template, and deployed it to ganache.
I use the addresses from my ganache’s accounts and everything works fine and I can transfer from my javascript client like this :
web3 = new Web3('ws://127.0.0.1:7545') contract = new web3.eth.Contract(ABI, contractAddress) contract.methods.transfer(to, amount).send({from:from})
-
Now my problem is that from my client, I can transfer from any account to any account, simply by entering their addresses ? The function do not require me to sign the call or prove i know the private key for the sender address. How come I can process a transfer from a account just by knowing their public address ?
-
If I generate a new account with acc = web3.eth.accounts.create(), I can transfer token to acc.address, and the balance for this new address is set fine. but when i want to transfer out of acc.address I get the error “sender account not recognized” which i also do not understand.
Thank you for your advice