title: Using EIP-3009 with web3.js in a react-native app,
body: <p>We are trying to use EIP-3009 in our application. First step we follow the web3 part in #3010
  Following is the selected part of our code:</p>
  <pre><code>const nonce = web3.utils.randomHex(32);
          const data = {
              types: {
                EIP712Domain: [
                  { name: &quot;name&quot;, type: &quot;string&quot; },
                  { name: &quot;version&quot;, type: &quot;string&quot; },
                  { name: &quot;chainId&quot;, type: &quot;uint256&quot; },
                  { name: &quot;verifyingContract&quot;, type: &quot;address&quot; },
                ],
                TransferWithAuthorization: [
                  { name: &quot;from&quot;, type: &quot;address&quot; },
                  { name: &quot;to&quot;, type: &quot;address&quot; },
                  { name: &quot;value&quot;, type: &quot;uint256&quot; },
                  { name: &quot;validAfter&quot;, type: &quot;uint256&quot; },
                  { name: &quot;validBefore&quot;, type: &quot;uint256&quot; },
                  { name: &quot;nonce&quot;, type: &quot;bytes32&quot; },
                ],
              },
              domain: {
                name: &quot;Coin Test&quot;,
                version: &quot;1&quot;,
                chainId: &quot;3&quot;,
                verifyingContract: &quot;0xd73ce105814e.......76&quot;,
              },const nonce = web3.utils.randomHex(32);
          const data = {
              types: {
                EIP712Domain: [
                  { name: &quot;name&quot;, type: &quot;string&quot; },
                  { name: &quot;version&quot;, type: &quot;string&quot; },
                  { name: &quot;chainId&quot;, type: &quot;uint256&quot; },
                  { name: &quot;verifyingContract&quot;, type: &quot;address&quot; },
                ],
                TransferWithAuthorization: [
                  { name: &quot;from&quot;, type: &quot;address&quot; },
                  { name: &quot;to&quot;, type: &quot;address&quot; },
                  { name: &quot;value&quot;, type: &quot;uint256&quot; },
                  { name: &quot;validAfter&quot;, type: &quot;uint256&quot; },
                  { name: &quot;validBefore&quot;, type: &quot;uint256&quot; },
                  { name: &quot;nonce&quot;, type: &quot;bytes32&quot; },
                ],
              },
              domain: {
                name: &quot;Things Coin Test&quot;,
                version: &quot;1&quot;,
                chainId: &quot;3&quot;,
                verifyingContract: &quot;0xd73ce105.....Be76&quot;,
              },
              primaryType: &quot;transferWithAuthorization&quot;,
              message: {
                from: this.state.senderAddress,
                to: this.state.receiverAddress,
                value: 100,
                validAfter: 0,
                validBefore: Math.floor(Date.now() / 1000) + 3600, // Valid for an hour
                nonce: nonce,
              },
            };
            const signedMessage = web3.eth.accounts.sign(data, this.state.privateKey)
              primaryType: &quot;transferWithAuthorization&quot;,
              message: {
                from: this.state.senderAddress,
                to: this.state.receiverAddress,
                value: 100,
                validAfter: 0,
                validBefore: Math.floor(Date.now() / 1000) + 3600, // Valid for an hour
                nonce: nonce,
              },
            };
            const signedMessage = web3.eth.accounts.sign(data, this.state.privateKey)
  </code></pre>
  <p>Following that we use a transaction object and signed it to send to Infura. The walletAddress is the address of the third person who is paying the transaction fee in ether. senderAddress is the address of the person who is sending the erc20 but does not have any ether to pay the fee.</p>
  <pre><code>const rawTransaction = ({
              from: walletAddress,
              to: contractAddress,
              value: web3.utils.toHex('0'),
              gasprice: web3.utils.toHex('1000'),
              gas: web3.utils.toHex(&quot;100000&quot;),
              data: TNGContract.methods.transferWithAuthorization(
                  this.state.senderAddress,
                  this.state.receiverAddress,
                  100,
                  0,
                  MAX_UINT256,
                  nonce,
                  signedMessage.v,
                  signedMessage.r,
                  signedMessage.s, 
                ).encodeABI(),
          });
          console.log('-----------rawTransaction: ' + JSON.stringify(rawTransaction))
          web3.eth.accounts.signTransaction(rawTransaction, privateKey)
              .then((signedTransaction) =&gt; {
                  console.log('.-----signedTransaction: ' + JSON.stringify(signedTransaction))
                  web3.eth.sendSignedTransaction(signedTransaction.rawTransaction).then((receipt)=&gt;{
                      console.log('.-----receipt: ' + JSON.stringify(receipt))
                  }).catch(err =&gt; {console.log(&quot;the error is----- &quot; + err)})
              }).catch((e) =&gt; console.log(&quot;the error is: &quot; + e));
  </code></pre>
  <p>Problem is we are getting &quot;Fail with error 'EIP3009: invalid signature'&quot; each time we are sending the transaction. Any help is appricaited.</p>