Content pfp
Content
@
0 reply
0 recast
0 reaction

Noah Bragg ๐Ÿ”ฅ pfp
Noah Bragg ๐Ÿ”ฅ
@nbragg
Solidity devs: How possible is it to store a large array to hold a leaderboard onchain? It would need to be updated as it changes and shifted around. My gut reaction as that this would be too expensive to make happen. Is on a layer2 at least. Or are there any better solutions?
7 replies
0 recast
5 reactions

ndx ๐Ÿ‰ pfp
ndx ๐Ÿ‰
@ndx.eth
Maybe possible if you use a binary or red-black tree? The worst case rebalancing scenario + block gas limit might limit the number of participants, but the best/average case would probably be fairly efficient.
1 reply
0 recast
1 reaction

Angel - Not A Bot pfp
Angel - Not A Bot
@sayangel
Do you want it on chain for composability or provenance? If just provenance Iโ€™d say just update a hash of the leaderboard on chain. And lazy composability would then be to expose the leaderboard via oracle and verify against the hash.
1 reply
0 recast
3 reactions

raulonastool.eth ๐ŸŽฉ ๐Ÿฐ pfp
raulonastool.eth ๐ŸŽฉ ๐Ÿฐ
@raulonastool
I can try to shill you Cairo language (Starknet), and you can use @dojoengine to put your games and leaderboard fully onchain ๐Ÿ˜… There's others building games fully onchain there that can help onboard you and/or you can stral ideas from them. Lots of public repos to copy+paste lol
1 reply
0 recast
2 reactions

flick the dev ๐ŸŽฉ๐Ÿ“ฆ pfp
flick the dev ๐ŸŽฉ๐Ÿ“ฆ
@flick
it all you need is to go from score to rank and rank to score (but not, for example, rank to player) then sparse trees and a little magic could possibly work https://github.com/0xFlicker/ranker/blob/main/src%2Franker%2Franker.ts
1 reply
0 recast
1 reaction

Apex777 pfp
Apex777
@apex777.eth
Sorting is the hard part here... Could store this onchain but keep a smaller mapping of the top 10?
1 reply
0 recast
1 reaction

zoo pfp
zoo
@zoo
@aspyn might be able to help you cook something up w Net...
1 reply
0 recast
1 reaction

Varun Srinivasan pfp
Varun Srinivasan
@v
Do you need the sorting onchain? Or just the scores?
1 reply
0 recast
0 reaction