Тёмный

Solidity Tutorial: Sending Ether to a smart contract (function payable keyword) 

EatTheBlocks
Подписаться 164 тыс.
Просмотров 27 тыс.
50% 1

Опубликовано:

 

11 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 42   
@AmanSharma-li7ct
@AmanSharma-li7ct 4 года назад
Hey man, loving your tutorial on Solidity. Just to mention that 10^-18 has 17 zeroes after decimal and not 18 XD
@EatTheBlocks
@EatTheBlocks 4 года назад
yeah silly me haha
@SinghSingh-du8tw
@SinghSingh-du8tw 4 года назад
good video
@janhvibhosle3852
@janhvibhosle3852 5 лет назад
Nice video sir.
@asimraza2572
@asimraza2572 3 года назад
thanks buddy
@Dufftata
@Dufftata 3 года назад
mapping(address => uint) balances; gives me: data location must be storage or memory for variable but none was given
@MichaelImo
@MichaelImo 2 года назад
Set the mapping outside of the function and not within the function. mapping(address => uint) public balances; function invest() external payable{ //track address to amount of ether if(msg.value < 1 ether){ revert(); } balances[msg.sender] += msg.value; } function balanceOf() external view returns(uint){ return address(this).balance; }
@bigmac5865
@bigmac5865 3 года назад
Julian How do you send money from your Wallet when deploying a Smart Contract or using a Function without using the Remix Value Box which you show around 2 minutes 50 seconds ? Nobody considers that as a possibility. We can't use the Remix IDE all the time. H
@RollyRTOM
@RollyRTOM 3 года назад
Hello Julian, can you help me, how to change the system payable from phase 1 to phase 2
@sata3205
@sata3205 5 лет назад
Good
@vedxtoken699
@vedxtoken699 4 года назад
very informative video sir, it will help a lot, so even we have already the erc20 token we can still make this contract sir?
@EatTheBlocks
@EatTheBlocks 4 года назад
I am not sure to understand your question? Could you reformulate?
@vedxtoken699
@vedxtoken699 4 года назад
@@EatTheBlocks hi sir, what I mean sir, if I have the smart contract already created still we can integrate the additional contract that you make or this is part of the erc20 functions
@vedxtoken699
@vedxtoken699 4 года назад
@@EatTheBlocks how can I contact you directly sir thank you
@EatTheBlocks
@EatTheBlocks 4 года назад
@@vedxtoken699 I am very sorry but I still dont understand the question :( If you want to explain your problem with more details, you can register on the forum of the channel, forum.eattheblocks.com
@EatTheBlocks
@EatTheBlocks 4 года назад
@@vedxtoken699 I sent you a link to the forum of eattheblocks
@ajazm1295
@ajazm1295 4 года назад
I wrote the code on remix compiler to check how it works. I can see invest button and balanceof. But after sending the wei i am getting the balance output zero.
@MotherCoin
@MotherCoin 3 года назад
Thank you
@renegade5942
@renegade5942 3 года назад
so does the ether goes to the smart contract and not the creator of the smart contract? if so how does the creator of the smart contract gets that ether to himself?
@MrHanSoL0
@MrHanSoL0 4 года назад
Good stuff man!! How can I flush tokens from an erc20 smart contract to another wallet? I have some value in some tokens however, I noticed that the owner I bought these from coded it to return back to him. How can I change this to go to my address, I lost $150 trying to send to my Eth because the tokens went back to him..😠
@EatTheBlocks
@EatTheBlocks 4 года назад
you need to call these functions on the ERC20 token: 1 - approve() 2 - transfer()
@MrHanSoL0
@MrHanSoL0 4 года назад
@@EatTheBlocks Thanks! where do I do this? How would I update this smart contract?
@MrHanSoL0
@MrHanSoL0 4 года назад
@@EatTheBlocks Do I input the private key into MEW wallet and then change/modify the code from there? Or do I need to run it on Solidity? If you have a video or instructions on how I can do this I will donate some Ether to you, I dont have much but will send what I can. Thanks.
@EatTheBlocks
@EatTheBlocks 4 года назад
@@MrHanSoL0 I am not sure what you are trying to do exactly. If you want to send an ERC20 token from an address to another one, you simply use a Wallet that can send ERC20 tokens, like Metamask. If you use a smart contract to send ERC20 to another smart contract, the first smart contract needs to have a function to send the tokens, otherwise there are stuck inside the contract. If you dont have a UI for this smart contract you can use Etherscan. You search the address of the contract, and on the page of the contract they have a read and write tab where you can execute the function of the smart contract.
@MrHanSoL0
@MrHanSoL0 4 года назад
@@EatTheBlocks ahh okay, that helps! Thank you, will let you know if successful, thx again.
@pankajjoshi8292
@pankajjoshi8292 2 года назад
sir how to send ether between two accounts not contracts , pls help
@kobki66
@kobki66 3 года назад
Can you please help me?? I created contract, sent some bnb there, but i don't know how to withdraw it. I'm noob, and lost in the documentation. Can you please help me to save my coins? I can send you source code.
@Dave-pz2pz
@Dave-pz2pz 2 года назад
Hi Robert did you manage to get your coins? Having the same problem here...
@kobki66
@kobki66 2 года назад
@@Dave-pz2pz nope, it is lost forever
@Dave-pz2pz
@Dave-pz2pz 2 года назад
@@kobki66 Thanks for letting me know, guess ill have to open a bottle of whisky and try to feel less stupid;( The scammer does have the balls to keep interacting... Anyway wish you a good christmass and lets hope crypto will payout in the end..
@kobki66
@kobki66 2 года назад
@@Dave-pz2pz Thank You Dave. I wish you Merry Christmas too! did you tried flash loan code?
@Dave-pz2pz
@Dave-pz2pz 2 года назад
@@kobki66 Never heard of it, thanks for the advice! will try and look..
@astrarai-thesobercoder
@astrarai-thesobercoder 4 года назад
Zero dislikes and we all know why :)
@EatTheBlocks
@EatTheBlocks 4 года назад
haha thanks Astra :)
@meeexy116
@meeexy116 4 года назад
That's cool and all but I fail to understand the application of sending ether to a smart contract.
@ivankashuba3439
@ivankashuba3439 4 года назад
How to reduce a balance of a smart contract?
Далее
Think Fast, Talk Smart: Communication Techniques
58:20
Свинья неудачник ( Liar's Bar )
24:01
Просмотров 493 тыс.
5 Nooby Coding Mistakes You NEED To Avoid
19:45
Просмотров 10 тыс.
Solidity Tutorial: Call function of other contract
11:30
Learn Solidity (0.5) - Payable
10:27
Просмотров 11 тыс.
Solidity Tutorial - Variable Types
9:15
Просмотров 24 тыс.
Send ETH | Solidity 0.8
6:11
Просмотров 25 тыс.
All Rust string types explained
22:13
Просмотров 176 тыс.
OpenAI Embeddings and Vector Databases Crash Course
18:41