Skip to main content
added 152 characters in body
Source Link
minhhn2910
  • 1.8k
  • 5
  • 14

In your code you have at least two locationsdeclarations without data location while it's required. Reference types require the data location notation, according to solidity document:

Status status = unmarshalStatus(_status); should become "reference types comprise structs, arrays and mappings": Status memory status = unmarshalStatus(_status);

uint[] id = certificates.length; should become: uint[] memory id = certificates.length;

  1. Status status = unmarshalStatus(_status); should become: Status memory status = unmarshalStatus(_status);

  2. uint[] id = certificates.length; should become: uint[] memory id = certificates.length;

For the second one, I don't think you mean to use array because the length could be integer. So you may use uint id = certificates.length; depends on the logic of your contract.

Read more : Data location

In your code you have at least two locations without data location while it's required:

Status status = unmarshalStatus(_status); should become: Status memory status = unmarshalStatus(_status);

uint[] id = certificates.length; should become: uint[] memory id = certificates.length;

For the second one, I don't think you mean to use array because the length could be integer. So you may use uint id = certificates.length; depends on the logic of your contract.

Read more : Data location

In your code you have at least two declarations without data location while it's required. Reference types require the data location notation, according to solidity document: "reference types comprise structs, arrays and mappings":

  1. Status status = unmarshalStatus(_status); should become: Status memory status = unmarshalStatus(_status);

  2. uint[] id = certificates.length; should become: uint[] memory id = certificates.length;

For the second one, I don't think you mean to use array because the length could be integer. So you may use uint id = certificates.length; depends on the logic of your contract.

Read more : Data location

Source Link
minhhn2910
  • 1.8k
  • 5
  • 14

In your code you have at least two locations without data location while it's required:

Status status = unmarshalStatus(_status); should become: Status memory status = unmarshalStatus(_status);

uint[] id = certificates.length; should become: uint[] memory id = certificates.length;

For the second one, I don't think you mean to use array because the length could be integer. So you may use uint id = certificates.length; depends on the logic of your contract.

Read more : Data location