I am using the ethersjs when I connect to web3.
And I have a question about the getSigner()
method below.
https://docs.ethers.io/v5/api/providers/jsonrpc-provider/#JsonRpcProvider-getSigner
Does this mean that if I pass someone else's ethereum address as an argument, I can create an object that will be signed by that address?
for example:
const provider = new ethers.providers.JsonRpcProvider('https://mainnet.infura.io/v3/{INFURA_API}')
const signer = provider.getSigner(SOME_RANDOM_ETH_ADDRESS)
const instance = new ethers.Contract(contractAddress, abi, signer)
const tx = await instance.transfer(MALICIOUS_ADDRESS, 10000000000000000)
My impression is that this could be a security issue, but why is this safe?