Skip to content

Instantly share code, notes, and snippets.

@riordant
Created March 19, 2018 20:06
Show Gist options
  • Save riordant/a09ec182884f5100b83439d1755ecd26 to your computer and use it in GitHub Desktop.
Save riordant/a09ec182884f5100b83439d1755ecd26 to your computer and use it in GitHub Desktop.
//to accompany ethers_structs.js
pragma solidity 0.4.21;
pragma experimental ABIEncoderV2;
contract TestContract {
struct SubStruct {
uint256 id;
string description;
}
struct TestStruct {
uint256 id;
string description;
SubStruct subStruct1;
}
TestStruct[] public tests;
function addTestStruct(TestStruct testStruct) public {
tests.push(testStruct);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment