//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f. pragma solidity ^0.4.24; contract Test { mapping (uint256 => uint256) private tokens; function generateTokens(uint nrOfTokens) public pure returns(bytes32[]) { // Instantiate a new array in memory with a length of 3 bytes32[] memory newTokens = new bytes32[](nrOfTokens); for (uint i = 0; i < nrOfTokens; i++) { newTokens[i] = keccak256(abi.encodePacked("test", i)); } // Return the array return newTokens; } }
0.4.24