pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; contract ABIExample { enum Permission { ReadOnly, Write, Admin } struct User { uint256 id; Permission permission; } User[] users; constructor() public { users.push(User(0, Permission.Admin)); users.push(User(1, Permission.Write)); users.push(User(2, Permission.ReadOnly)); } // Add a setter to add new users. function set(User newUser) public { users.push(newUser); } function get() public constant returns (bytes) { return abi.encode(users); } }
0.4.24