I am making an updatable contract with dynamic metadata. As the data that will create the json is registered in the contract I am wondering the best way to register many values.
At first I applied the idea of using a struct.
//Metadata
struct Metadata {
string filed1;
string field2;
string field3;
string field4;
string field5;
// and more...
}
But as I have many fields I considered that maybe a mapping record per field of the metadata would be more optimal:
//Metadata
mapping(uint256 => string) public fields1;
mapping(uint256 => string) public fields2;
mapping(uint256 => string) public fields3;
mapping(uint256 => string) public fields4;
mapping(uint256 => string) public fields5;
// and more...
What do you think about?
what is the most efficient record in gas cost?