title: Solidity: How to send a nested struct as parameter?
body: <p><br></p>
  
  <p>I am trying to send a nested struct to smart contract, but the transaction reverts: </p>
  
  <pre><code>const person = {
    name: "Me",
    age: 24,
    car: {
      id: 1,
      color: "black"
  }
  
  myContract.methods.addPerson(person).send({from: "0x3b0282D31174B927e102bA71d80dF34F4e596Fc4", gas:300000}, (error, result) =&gt; {
                  if (error) {
                      console.log(error);
                  } else {
                      console.log(result);
                  });
  </code></pre>
  
  <p>this always throws: </p>
  
  <pre><code>(node:17276) UnhandledPromiseRejectionWarning: Error: Transaction has been reverted by the EVM:
  {
    "blockHash": "0x84647034828b4adf766a5bb55d19a32d665ba7e8c9cbcde4f2ecd8f3b112a13a",
    "blockNumber": 49378,
    "contractAddress": null,
    "cumulativeGasUsed": 300000,
    "from": "0x3b0282d31174b927e102ba71d80df34f4e596fc4",
    "gasUsed": 300000,
    "logsBloom": "0x000000000000000000000000000000000...",
    "status": false,
    "to": "0x37fe85f3a96a5fc1f9396ec42ae197d73a239ad7",
    "transactionHash": "0x43f0508b4419525b0eb4ab5a40765a3991ba152ba70c2731c6892d1253c9dfac",
    "transactionIndex": 0,
    "events": {}
  }
  </code></pre>
  
  <p>If I send a simple struct it works fine</p>
  
  <p><strong>NB: I am using web3 1.0.0-beta.37</strong></p>