I wrote the code to encoding an array of numbers and got the error, what is the best solution

Viewed 28

I wrote the code below in Soldi to encode an array of numbers and I got the following error: Expected ',' but got identifier --> contracts/paper.sol:15:40: return keccak256(abi.encode(uint expandValues[])); | ^^^^^^^^^^^^

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.17;
 // this code is to encrypted any numbers *
 contract Test {  
  function expand(uint randomValue, uint n) public pure returns (uint[] memory expandedValues) {
    expandedValues = new uint[](n);
    for (uint i = 0; i < n; i++) {
        expandedValues[i] = uint(keccak256(abi.encode(randomValue, i)));
    }
    return callKeccak256();
}
function callKeccak256() public pure returns(bytes32 result){
       
      return keccak256(abi.encode(uint expandValues[]));

 }
 }
0 Answers
Related