title: How to transfer tokens from a smart contract wallet to an EOA wallet
body: <p>I'm using Next.js, web3-react, ethers.js, MetaMask and Ganache to run a local blockchain.</p>
  <p>What I'm trying to do: when the user clicks a button on the front-end, that button opens MetaMask where some tokens (I &quot;minted/created&quot; these tokens) are sent from the smart contract/smart contract creator to the user upon user consent.</p>
  <p>The problem is: when the user clicks the button, the MetaMask pop-up appears, but the sender/recipient addresses are the same.</p>
  <p><a href="https://i.stack.imgur.com/R1d7a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R1d7a.png" alt="enter image description here" /></a></p>
  <p>What I want is for the sender address to be the same as the smart contract/smart contract creator and this transaction should be done by MetaMask.</p>
  <p>The following code is what I've done so far:</p>
  <pre class="lang-js prettyprint-override"><code>import { ethers, Contract } from 'ethers'
  import { useWeb3React } from '@web3-react/core'
  import HRC20 from '../../assets/HRC20.json'
  
  const { account: userAccountAddress, library } = useWeb3React()
  
  const provider = new ethers.providers.Web3Provider(
    library.provider // this is the same as `window.ethereum.provider` injected by MetaMask
  )
  const signer = provider.getSigner()
  
  const tokenContract = new ethers.Contract(
    '0x4feEc53a54e36C80A2F0a47454Ab285B99A1a240',
     HRC20.abi,
     provider
  )
  
  const tokenContractWithSigner = contract.connect(signer)
  
  const tx = tokenContractWithSigner.transfer(
    userAccountAddress,
    10000000000
  )
  </code></pre>
  <p>My guess is that I need to specify the sender address when creating the provider or signer or something.</p>