At line 18 it should be "kid" address not "msg.sender" since the person calling addKid function is a parent(ie. msg.sender) so we are checking parent address amount ==0 or not which will always will be 0 by default since we are sending amount to kid only not the parent who is adding kid... In the withdraw function msg.sender is a kid address so it works because the person calling that withdraw is a kid not parent..but in addkid function person calling the function is parent. so it is a bug in the code...
22:15 no kid was added using the 3rd address which causes the error. Your code should also check if the kid's address is blank before performing the withdraw
I just came from your video about setting up a development environment where you recommended this video as a follow up.... I setup up VSCode as the IDE as per your recommendation in the previous video.... I love your videos man, but it would be great if there was some consistency in regard to the IDE you use in each video so people can follow along building on each video. Just a suggestion, love your work!
Do we really need the paid variable in the struct? Wouldn't it be the same to set the amount variable to 0 for msg.sender before the transfer? Thanks for sharing!
a simple solidity smart contract that i can use as in interface to quickswap dex on Polygon (basically pancakeswap v2) .I want the smart contract to have the following functions for me Swap MATIC for USDC Swap USDC for MATIC Create MATIC USDC LP Tokens Check MATIC Balance Check USDC Balance Check MATIC/USDC LP Balance Sell MATIC/USDC LP Balance (specific quantity) Transfer MATIC This contract must be easy to read, well documented and can work with my other smart contract. please reply urgent
Followed it step by step and letter by letter but I'm only getting 1 error: ParseError: Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition. --> trust.sol:36:1: | 36 | } | ^ why is that ? any idea?
anyone know what this mean ParserError: Expected a state variable declaration. If you intended this as a fallback function or a function to handle plain ether transactions, use the "fallback" keyword or the "receive" keyword instead. --> contracts/Mhetoken.sol:88:17: | 88 | function () { | ^
No, maturity means minimum required time before which you cannot withdraw. For example, if my funds are maturing on 31st December 2022, then I should not be able to withdraw before that. So, anyone who tries to withdraw before 31st December 2022 would be 'Too early'. So yes, the maturity of the caller needs to be 'less than now', otherwise the funds would be immature and therefore non-withdrawable.
hey, I thought that you had to use the 'payable' keyword on the function as well? But you only have it being used inside the function. So it's not needed as a function modifier anymore?
Thanks for sharing, good stuff. I just came up with a question: which version value is recommended? 0.8.1 or >= 0.7.0 < 0.9.0? And may I get some explanations if you don't mind. 🙏
I just fixed this error (as I got it too). I just refreshed my web page for Remix. If that doesn't work maybe try a different browser and past the code into remix there
i know nothing about coding and this seems alien for beginners...my question is what books or videos can i study to help me memorize the actual language....or else these kinds of tutorial videos dont help people who know nothing about coding if they dont know the actual commands to type to code...
Thank you for the video. What would be the prerequisites for learning this? I'm trying to follow along but there are a lot of things I don't understand.
There isnt't anything special about Flashswap on Infura. In your backend script to monitor arb opportunities you just have to connect to Ethereum with an Infura URL thats it.
What happens if you found a bug in your code, or want to add a feature? Or does your code have to be literally perfect and complete when you send it out?
It's possible to have an updatable mechanism if you delegate part of the functionality to another contract, and you update this contract in the future. But it also raises the question of who can update this contract, and make it less decentralized.
@@EatTheBlocks How do you update the contract in the future? or do you mean just change the pointer to an updated copy of the contract elsewhere on the blockchain?
smart contract is immutable in nature so u cant update after its deployed on network... so if u found a bug after deployment u can't to anything unless u have a special access to that function by having onlyOwner modifier who can alter certain things... But if u do this then it will make ur contract less decentralized... and if u want to add new feature u will have to add owner only function on the network which makes ur smart contract completely centralized since it can be controlled by you right..
Hi Julien, at 14:43 you said that the admin would be the address of the parent who deployed the smart contract. What do you mean by that? Isn't it the developer who is going to deploy the smart contract. How can a user set himself as parent ? Does he have to get the eth address of his kid (from his wallet) to run the addKid function?
If parents hire a dev to do it, they can just tell the dev to use their private key to deploy the smart contract. Of course they would need to find a secure way to handle the private key in this case.
It's the year 2043 and all those still engaged in crypto currencies and have been rounded up and imprisoned, a new sedition law was introduced to ban the technology.
Ethereum is dying unfortunately, I would suggest checking out other less overloaded and overvalued chains! This is just a single way to write SCs there's tons of other compilers. I would not advise learning Solidity in 2021z
At line 18 there is an error, it should be "kid" instead of "msg.sender".
ye right. awesome content anyways. julien best♥
At line 18 it should be "kid" address not "msg.sender" since the person calling addKid function is a parent(ie. msg.sender) so we are checking parent address amount ==0 or not which will always will be 0 by default since we are sending amount to kid only not the parent who is adding kid...
In the withdraw function msg.sender is a kid address so it works because the person calling that withdraw is a kid not parent..but in addkid function person calling the function is parent.
so it is a bug in the code...
INDEED! i was confused at it for quite a while !
I was confused too after trying to understand the code, had to come to the comment section the following day looking for someone with this comment.
22:15 no kid was added using the 3rd address which causes the error. Your code should also check if the kid's address is blank before performing the withdraw
i love the chill of the bacground
is there anybody got the full source code? I tried on my IDE but its unable to run. thank you
this is perfect. thanks.
to others: after the final step, the 18th line should be this.
require(kids[kid].amount == 0, 'kid already exist');
this intro will go down in the history of the blocks
haha thx!
Thanks, I just write my first smart contract
I'm going to learn about storage, memory, emit, payable....
I just came from your video about setting up a development environment where you recommended this video as a follow up.... I setup up VSCode as the IDE as per your recommendation in the previous video.... I love your videos man, but it would be great if there was some consistency in regard to the IDE you use in each video so people can follow along building on each video. Just a suggestion, love your work!
Sure, I use vim in 99.99pct of my videos
Will people stop building contracts on the Ethereum blockchain when BSC is so much cheaper to use?
You made a mistake in your addKid function. It' should be require(amounts[kid] == 0, 'kid already exists')
Do we really need the paid variable in the struct? Wouldn't it be the same to set the amount variable to 0 for msg.sender before the transfer? Thanks for sharing!
Thank you! I would like to watch more of these types of videos.
More to come!
The struct is so useful for data management when developing smart contract , I would use that in my future project thanks !
Glad it was helpful!
a simple solidity smart contract that i can use as in interface to quickswap dex on Polygon (basically pancakeswap v2) .I want the smart contract to have the following functions for me Swap MATIC for USDC Swap USDC for MATIC Create MATIC USDC LP Tokens Check MATIC Balance Check USDC Balance Check MATIC/USDC LP Balance Sell MATIC/USDC LP Balance (specific quantity) Transfer MATIC This contract must be easy to read, well documented and can work with my other smart contract.
please reply urgent
great video, could you share the contract code? on github or pastebin?
can to tell me how to store date of blockchain in ethereum
How come it says there's an unsecure connection on the remix website?
Great tutorial! Thank you!
Glad it was helpful!
im gettin a declation error for unit amount in struct
Followed it step by step and letter by letter but I'm only getting 1 error:
ParseError: Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition. --> trust.sol:36:1: | 36 | } | ^
why is that ? any idea?
anyone know what this mean
ParserError: Expected a state variable declaration. If you intended this as a fallback function or a function to handle plain ether transactions, use the "fallback" keyword or the "receive" keyword instead. --> contracts/Mhetoken.sol:88:17: | 88 | function () { | ^
can you do a code for new token include the Slippage Tolerance 15% goes for LP?
Hi, is there anyway to create blockchain project dapp without using ganache
Sir pls show us frontend on react js for this. Thank you
my script is saying that in line 5: it is a parser error, expected type name. how do i fix that
How to implement a fixed dollar price when holding different rounds like pre/private and public?
Awesome! Only problem is if you want to disown one of the kids, lol!
Good point!
Shouldn't line 16 read be require(amounts[kid] == 0, 'kid already exists'); ? At least before you added the struct I mean.
require (maturities [msg.sender]
No, maturity means minimum required time before which you cannot withdraw. For example, if my funds are maturing on 31st December 2022, then I should not be able to withdraw before that. So, anyone who tries to withdraw before 31st December 2022 would be 'Too early'.
So yes, the maturity of the caller needs to be 'less than now', otherwise the funds would be immature and therefore non-withdrawable.
can you use this on polygon as well??
could you pls write the same code for Solana blockchain?
Amazing!
Can u code a staking smart contrac?
Where can i contac u?
hey, I thought that you had to use the 'payable' keyword on the function as well? But you only have it being used inside the function. So it's not needed as a function modifier anymore?
Is there a looming issue with the Year 2038 Problem and Unix timestamps?
Just depends on if you use 32 bit ints vs 64 bit ints to represent the time.
I think your code is wrong? line 18 should be kids[kid] instead of kids[msg.sender], ...... i think?
Thank you.
You're welcome!
I do not have this code running Plzz Guide Me
This was so useful! Hitting the Subscribe for sure!
Can you put the source code somewhere?
Thanks for sharing, good stuff. I just came up with a question: which version value is recommended? 0.8.1 or >= 0.7.0 < 0.9.0? And may I get some explanations if you don't mind. 🙏
Please report the account spamming a scam in the comments please. They don't even try to hide it lmao, he/she has more likes than the video!
I hide them from the channel when I see them
Thank you very much for the tutorial! Question: why do I get gas deducted if I call withdraw even if it fails? Thank you!
Yo...Julian thanks for always posting new vids.
Merci beaucoup monsieur. J'apprécie vraiment ces exemples de remix car ils fonctionnent très bien sur l'ubuntu Raspberry 4 :)
thank u! U look like Chris Martin lol
awesome video my man
Appreciate it
Smart contracts will change the world. Just imagine being able to create them without coding 🤯
Hello, when i click on deploy, i got an error: cannot convert undefined or null to object, any clue how to fix it pleaase
I just fixed this error (as I got it too). I just refreshed my web page for Remix. If that doesn't work maybe try a different browser and past the code into remix there
i know nothing about coding and this seems alien for beginners...my question is what books or videos can i study to help me memorize the actual language....or else these kinds of tutorial videos dont help people who know nothing about coding if they dont know the actual commands to type to code...
Amazing video, thank you!
My pleasure!
Thank you for the video. What would be the prerequisites for learning this? I'm trying to follow along but there are a lot of things I don't understand.
If you don't have a coding background I would learn the basics of web development first (html, css, Javascript).
Where did you get that ghost from??
haha I just bought it at some electronic shop
Bro! Thanks for sharing! I have a better understanding of Solidity now.
Happy to help!
Since the timestamp of the block can be manipulated by the miner, are there any other alternatives? perhaps using block.number or similar...
There are limits to this, only a couple of hours of difference relative to the timestamp of last block
Amazing video!!
Thank you!!
Could you do an updated tutorial on Flash Swaps on Infura?
There isnt't anything special about Flashswap on Infura. In your backend script to monitor arb opportunities you just have to connect to Ethereum with an Infura URL thats it.
What happens if you found a bug in your code, or want to add a feature? Or does your code have to be literally perfect and complete when you send it out?
It's possible to have an updatable mechanism if you delegate part of the functionality to another contract, and you update this contract in the future. But it also raises the question of who can update this contract, and make it less decentralized.
@@EatTheBlocks How do you update the contract in the future? or do you mean just change the pointer to an updated copy of the contract elsewhere on the blockchain?
smart contract is immutable in nature so u cant update after its deployed on network... so if u found a bug after deployment u can't to anything unless u have a special access to that function by having onlyOwner modifier who can alter certain things... But if u do this then it will make ur contract less decentralized...
and if u want to add new feature u will have to add owner only function on the network which makes ur smart contract completely centralized since it can be controlled by you right..
Why a Constructor "kid = _kid"? Isn't state variable "kid" already initialized by default as written in the first declarations?
`_kid` is where the actual address is, the initial value of `kid` is empty.
Great Tutorial! Thank You!
Glad it was helpful!
Hi Julien, at 14:43 you said that the admin would be the address of the parent who deployed the smart contract. What do you mean by that? Isn't it the developer who is going to deploy the smart contract. How can a user set himself as parent ? Does he have to get the eth address of his kid (from his wallet) to run the addKid function?
If parents hire a dev to do it, they can just tell the dev to use their private key to deploy the smart contract. Of course they would need to find a secure way to handle the private key in this case.
Very helpful and interesting. Thank you!
Glad you enjoyed it!
Do you have a course for beginners?
Yes, this one (Jumpstarter package):
eattheblocks.com/6-figure-blockchain-developer/
Can you do a video on Brownie
Good idea!
You're doing a great job..
thanks!
I'm just wondering one thing about Remix - do they spy all the code used on their platform?
no
can you tell me how one would add fee,s like smart coin a % of transaction
something like burned = uint(value) * 0.03
and then you can choose where to send that burned amount to.
Thank you!
You're welcome!
Can we do in real? And earn eth
wow. Thanks :)
Welcome!
1:22 SOLOdilitiy hahahahahah puhahahahhahaha staaahp haha hehe just joking :P nice tutorial thank you verrryyy much!
hahah
very simple but powerful one
Yes, thanks
lolz bank do not exist anymore lolz bro you are teh man!
Great video, thanks :)
No worries!
T'es français 100%
yes sir!
@@EatTheBlocks On est incapable d’émettre parfaitement l'accent américain ça me tue ptdr
Contenu de qualité en tout cas, +1 sub
It's the year 2043 and all those still engaged in crypto currencies and have been rounded up and imprisoned, a new sedition law was introduced to ban the technology.
Sir, I’m gonna report your channel so that you get banned and no one else can get this extremely valueable information. Jokes aside, THANK YOU!
hahahaha :)
Ethereum is dying unfortunately, I would suggest checking out other less overloaded and overvalued chains! This is just a single way to write SCs there's tons of other compilers. I would not advise learning Solidity in 2021z
What other compilers would you recommend?