I have an internal variable like

uint[] distributionAmounts;

which will be populated by the constructor (no issue).

However, I would also like to allow the owner to change this array by calling a contract interface. Something that comes to mind is the following (but the link in the bottom states that has issues?)

  function setArray(uint[] arrayValues) private {
      winningPercentages = arrayValues;

What would be the correct/proper way now to achieve the following?

N.B: Some references I read includes the following Solidity "call" function with array as input

  • Passing an array as data shouldn't be an issue anymore in more recent Solidity versions.
    – Morten
    May 16 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.