Replies: 2 comments
-
No, arrays in Solidity do not have the ability to insert elements at a specific index and move existing elements to the right. To achieve this behavior, you would need to manually copy the elements to a new array with the inserted element. |
Beta Was this translation helpful? Give feedback.
0 replies
-
using a mapping might be a better option |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In solidity arrays', is it possible to insert element in a specific index and the element that was in that indexed becomes in that index+1? Similar to Python operation insert? I am trying to do a leaderboard in a smart contract
Beta Was this translation helpful? Give feedback.
All reactions