How call this contract functions from python code?
pragma solidity ^0.4.24;
pragma experimental ABIEncoderV2;
contract MY_PERSONS {
struct Person{
string name;
uint age;
}
Person[] private persons;
constructor ( Person[] _persons ) public {
// persons = _persons; // not yet supported
for(uint i=0; i<_persons.length; i++)
persons.push(_persons[i]);
}
function add_person(Person _person) public {
persons.push(_person);
}
function get_person(uint index) public view returns(Person) {
require(index >=0 && index < persons.length);
return persons[index];
}
}
I tested Contract Deployment Example and Passing Struct as an argument in call and everything was OK, but I don't know how call the functions.
user = ["hello", 10];alsouser = ("hello", 10);but this error occurre: ValueError: No matching entries for 'tuple' in encoder registry – H.Mohseni Apr 27 '19 at 17:25web3 v5 beta. tuples might not be supported inv4. @H.Mohseni – alper Aug 10 '19 at 20:30