Array Remove An Element By Shifting | Solidity 0.8

preview_player
Показать описание
There are two common algorithms used to remove an element from an array in Solidity. One way is to copy all elements from right to left starting at the index to remove and then popping the last element.

#Solidity #SmartContract #Ethereum #スマートコントラクト

Remix

Code

Take a course

Follow
Рекомендации по теме
Комментарии
Автор

I love it!!! its a very good sequence of explaning. Thaks man, you help me a lot!!

lilsugarpie
Автор

very good explanations! great videos! thanks a lot.

sdfsfsfd
Автор

many thanks for the video .. this channel looks a one stop solution for solidity related Gyan :)

DevrajSinghRawat
Автор

Nice explanation sir thanks for the series.

ZAHID
Автор

How different is Solidity 0.8 to 0.5? Your Solidity 0.5 playlist is more complete and has more detailed descriptions, is it still worthwhile to go through the 0.5 playlist? Or would that do more harm than good?

is the 0.5 playlist extremely outdated, because the foundational knowledge and functionality still seems valid?

tendies
Автор

Q: In the function test, how does 'remove' know you're targeting the 'arr' ? This bit doesn't make sense to me. How does the remove function know you mean to target the arr at index 2, when all you've stated within the remove is a number. That number could mean anything for all the contract knows. Thanks if you could clarify this brother, good videos

thesiteguys
Автор

I have just started following ur videos and they r really helpful, thanks a lot!!! I am just unable to grasp to the concept of how to view the results of a function.... For example here, how to see the final array after the changes?

Valerie-wszr
Автор

thank you very much, God bless you. Just one question: what I need to be a full stack smart contract in addition to solidity?

saidelkarim
Автор

can you do about payment (withdrow, payment, etc ...)

cryptoexpert
Автор

I wrote the source code above and completed the deployment.
However, remove() and test() did not work normally.

Why?

It's my solidity version 0.8
An error called "VM error: reverse" occurs.

I am studying solidity while watching your video. Thank you so much.
Please understand that I'm not fluent in English. I'm using a translator.

martin.lee.
Автор

not for usable if you do in real app You pay HIGH gas feee

purevdorjganbat
Автор

cant we just specify the index number of the element to remove it, like arr.pop(2)? just asked let me know

kadhamba_topic