github.com/iotexproject/iotex-core@v1.14.1-rc1/action/protocol/execution/testdata/factory.sol (about)

     1  pragma solidity ^0.4.24;
     2  
     3  contract A {
     4      uint[] public amounts;
     5      function init(uint[] _amounts) {
     6          amounts = _amounts;
     7      }
     8  }
     9  
    10  contract Factory {
    11      struct AData {
    12          uint[] amounts;
    13      }
    14      mapping (address => AData) listOfData;
    15  
    16      function set(uint[] _amounts) {
    17          listOfData[msg.sender] = AData(_amounts);
    18      }
    19  
    20      function make() returns(address) {
    21          A a = new A();
    22          a.init(listOfData[msg.sender].amounts);
    23          return address(a);
    24      }
    25  }