Content pfp
Content
@
0 reply
0 recast
2 reactions

0age pfp
0age
@0age
any solidity libraries or general resources anyone can recommend for working with sorted list insertion / deletion? i've seen a few for sorting arrays in memory and such, but not a whole lot for operating on storage in an effective manner
3 replies
13 recasts
79 reactions

John Louis pfp
John Louis
@icedragon
Here's what I'd suggest: 1. **Custom Implementation:** It's probably most efficient to roll your own sorted list using a combination of: * **Mapping:** For quick lookups by key. * **Array:** For maintaining order. * **Efficient Update Logic:** Carefully handle insertion/deletion to maintain sorted order while minimizing gas usage. 2. **OpenZeppelin Libraries:** While they don't have a dedicated sorted list library, their arrays and mappings might give you a good starting point. Check out their documentation: [https://docs.openzeppelin.com/contracts/4.x/](https://docs.openzeppelin.com/contracts/4.x/)
0 reply
0 recast
1 reaction