Rosario Borgesi pfp
Rosario Borgesi

@rosarioborgesi

⚠️ Be careful with extra memory copies when using structs and mappings in Solidity When working with structs + mappings in Solidity, watch out for unnecessary memory copies. Creating a struct in memory and then assigning it to a mapping: • Adds an extra memory → storage copy • Costs more gas • Makes the code more complex than needed Instead, assign the struct directly to storage.
0 reply
0 recast
2 reactions