NethermindEth / StarknetByExample

A collection of examples of Cairo smart contracts for Starknet.
https://starknet-by-example.voyager.online/
MIT License
110 stars 84 forks source link

in chapter List, the List should never be part of a struct #149

Closed JameWade closed 9 months ago

JameWade commented 10 months ago

List should never be part of a struct - rather, it should only be used when interacting from / to storage. Otherwise, the internal storage addresses of elements in the struct will collide!! please look this issue https://github.com/keep-starknet-strange/alexandria/issues/226

julio4 commented 9 months ago

Storage structs of smart contracts are a bit different, see there: https://docs.starknet.io/documentation/architecture_and_concepts/Smart_Contracts/contract-storage/#storage_variables

You can refer to the Store implementation of List here: https://github.com/keep-starknet-strange/alexandria/pull/127