@@BlockExplorerMedia I built this for bnb and want to try and attach it to a domain for my discord to use how do i go about doing that Im a roofer so im not the smartest lol ty in advance
very simple, always straight to the point, very useful video and there is a lot to learn from you! and I really loved that you never cut the video whenever u have errors! learning debugging and solving problems are the most important. no enough words to thank you.
For real as far as leaving the errors and the process a developer goes through to develop. It' s real, and anyone who's developed for any length of time knows and understands that a missing semicolon, or misspelled word can tie you up. Block Explorer has definitely earned my loyalty and repeat visits. He did a great job in this, helpful.
Huh, this absolutely amazing, I believe you explained this far too good and the fact that you fix errors while coding is just dope other tutorials lack that... I believe Design Patters should follow,... Once again thanks
I had to hit the subscribe button. You are really one out of a million out there. The problem now is: I got a couple of questions from this video. How do I get answers??
Great stuff! Much appreciated! I'm just starting off with my journey learning Solidity. I fully appreciate such an awesome and extremely thorough tutorial, one with very real-world use as well.
@@BlockExplorerMedia waiting , n pls make it a simple step by step. 1. Check if metamask install and Connect with metamask with local blockchain. 2. Input box to transfer ethers, display balance etc 3.Click on Play and display winner and ether transfer to winner and display new balance. Thanking you
hey, please check out the Web3.js tutorial released yesterday - it covers all of these things for vending machine contract - same can be applied for the lottery contract.
This can definitely be one - you could transfer some percent of each user's deposit to a treasury or owner's wallet after the participant's initial deposit.
The best blockchain learning platform I have come across. If I wanted to transfer my own erc20 token instead of ether, how will I be doing that. Can anyone please help me with that?
Hi block explorer good video but what if you creating a lottery ticket where users can input/choose a number and if theyre have the same as the random number then they be the winner.
Hey, I am wondering if the order of the keywords matter in Solidity. For example, can you put "public" before "payable" when declaring variables ? Does it change anything ?
While you are declaring variables you can't put visibility before payable as it will give you an error But you can put visibility before payable in case of function
You are a great teacher. It must be a good day that youtube recommended me your video Can you please how does pot balance adds up automaticaly?? because we are doing any total for balance in the code
I have been stuck for a while now... I'm not available to pick a winner... this is the error that I'm getting "Note: The called function should be payable if you send value and the value you send should be less than your current balance. Debug the transaction to get more information." Works fine the first time! Any help?
It would be nice to have a quick self intro (even mention of name) in the beginning so we can all thank you. Also you sounds like the chia channel I watch (coin breakthrough).
At 27.01 the error you got is the same than in the vending machine tuto. I dont think it a gas issue. To fix the issue, inside the contract, instead using writing 0.01 ether, I write 10000000000000000 wei and it works. I dont have lot of experience so I dont know why it works but if someone can explain it would be great.
hey, thank you! this code isn't tested but I think you could do something like this: players[index].transfer(address(this).balance / 2); payable(owner).transfer(address(this).balance / 2);
@@BlockExplorerMedia Yoo! thank you! works with a little edit, when paying the owner no division required as it will pay whats left after paying the winner, which essentially is the total balance. with the division, it will send half of whats left to the owner. great stuff man, cant thank you enough
@@semence2porc166 function payWinner() public onlyowner nonReentrant { require(randomResult > 0, "Must have a source of randomness before choosing winner"); uint index = randomResult % players.length; players[index].transfer(address(this).balance / 5*3); payments.transfer(address(this).balance); lotteryHistory[lotteryId] = players[index]; lotteryId++;
hi, could you teach me how to make a lottery like the one in pancake swap. a lottery with multiple winners and dividing the pot in differents % depending on the amount correct numbers from start to finish max 6 or 7 numbers. please. a video of this would be great. im trying to make a crypto lottery as a project for my class. I was wanting to make a DEX but i find the frontend a little bit to complicate for me
I have found your tutorials helpful Would love to see one on how to make an auto compound vault. Users deposit token/LP token into a vault that auto compounds for users. Could probably be done by forking off of Beefy or Pancake or something but I’m not experienced enough to figure it all out myself.
why not add a function for the creator of this smart contract to receive 5% from each pot? Otherwise why in hell should anyone create this project? "oh no this is just tutorial purposes bla bla bla" ...shitshow
-Declare admin as payable -cast admin as payable in the constructor function -add this line in the getwinner function (before transfer funds to the winner): owner.transfer((address(this).balance)/20); Done ;)
I can't pick a winner it says : transact to Lottery.pickWinner pending ... transact to Lottery.pickWinner errored: VM error: out of gas. out of gas The transaction ran out of gas. Please increase the Gas Limit. Debug the transaction to get more information. I changed the gas but doesn't work what should I do?
If only all tutorials were this good. Clearly explained, no BS, not too fast. Keep them coming!!
Thanks Python - appreciate it!
@@BlockExplorerMedia I built this for bnb and want to try and attach it to a domain for my discord to use how do i go about doing that Im a roofer so im not the smartest lol ty in advance
No doubts. Loved it,
This is the best channel teaching Smart Contract development in a lean, no-BS way.
Appreciate it - that's a great compliment! : )
very simple, always straight to the point, very useful video and there is a lot to learn from you!
and I really loved that you never cut the video whenever u have errors! learning debugging and solving problems are the most important.
no enough words to thank you.
Thanks my friend, glad it was useful!
For real as far as leaving the errors and the process a developer goes through to develop. It' s real, and anyone who's developed for any length of time knows and understands that a missing semicolon, or misspelled word can tie you up. Block Explorer has definitely earned my loyalty and repeat visits. He did a great job in this, helpful.
I have seen quite a few solidity tutorials. Yours one is far far better than anyone else! Great Job!
Huh, this absolutely amazing, I believe you explained this far too good and the fact that you fix errors while coding is just dope other tutorials lack that...
I believe Design Patters should follow,... Once again thanks
You are an amazing teacher, to the point.
Great tutorial! Is it possible to set up an auto payout and restart of the lottery?
Saved me from college examination's submissions!!
thanks a lot sir!
I had to hit the subscribe button. You are really one out of a million out there. The problem now is: I got a couple of questions from this video. How do I get answers??
your are doing a great job pls don't stop....its one video for me per day!!!
Thanks Sukirat! Planning to keep going.
Hi Sukirat, can you recommend me 2-3 ur favorites from this channel? I am jr software developer from US aspiring become Blockchain Engineer
Great stuff! Much appreciated! I'm just starting off with my journey learning Solidity. I fully appreciate such an awesome and extremely thorough tutorial, one with very real-world use as well.
what if you only wanted to give out a percentage of the total balance, and not the entire balance? what would you code in line 26
Thank you so much! You really helped me! So grateful for your help!
Beautifully explained everything and thank you so much for keeping it much simpler.Cheers:)
One of the best it cleared my doubts. But need a simple frontend in html css or react js. Thanku lots
Thanks, will do a frontend video soon - stay tuned!
@@BlockExplorerMedia waiting , n pls make it a simple step by step.
1. Check if metamask install and Connect with metamask with local blockchain.
2. Input box to transfer ethers, display balance etc
3.Click on Play and display winner and ether transfer to winner and display new balance.
Thanking you
hey, please check out the Web3.js tutorial released yesterday - it covers all of these things for vending machine contract - same can be applied for the lottery contract.
Great video. How would you get this to accept some other Erc20 token?
I am interested in the same.
great explanation easy to understand!!. please make a video on lending and borrowing protocal like Aave .
You are an amazing teacher.
How to add more functionality like co.mission for the owner or referral fees. How can this be done
This can definitely be one - you could transfer some percent of each user's deposit to a treasury or owner's wallet after the participant's initial deposit.
The best blockchain learning platform I have come across. If I wanted to transfer my own erc20 token instead of ether, how will I be doing that. Can anyone please help me with that?
36:44 You forgot to put the lotteryId next to the lotteryHistory. If you had done that there was no need to create another utility function!
Hi block explorer good video but what if you creating a lottery ticket where users can input/choose a number and if theyre have the same as the random number then they be the winner.
Hey, I am wondering if the order of the keywords matter in Solidity. For example, can you put "public" before "payable" when declaring variables ? Does it change anything ?
While you are declaring variables you can't put visibility before payable as it will give you an error
But you can put visibility before payable in case of function
As a Solidity expert do you understand that you getRandomNumber function is not random at all and how easily this code can be compromised?
Hello, in production, how to you trigger the getWinner function? using JS in the front? How do you recommend to pay for expenses?
Keep going with this playlist you are the best .
The getRandomNumber should not be a pure function instead of a view function. I was thinking that view function were only used to read states?
can u just use ether as unit instead of wei, so u dont have to copy a huge number
You are a great teacher. It must be a good day that youtube recommended me your video
Can you please how does pot balance adds up automaticaly?? because we are doing any total for balance in the code
what if transaction is failed? I mean value is greater than 0.1 eth but player does not have enough balance to make payment.
I have been stuck for a while now... I'm not available to pick a winner... this is the error that I'm getting
"Note: The called function should be payable if you send value and the value you send should be less than your current balance.
Debug the transaction to get more information."
Works fine the first time!
Any help?
hi. which function are you calling and how much value if any are sending when you encounter this error?
It would be nice to have a quick self intro (even mention of name) in the beginning so we can all thank you. Also you sounds like the chia channel I watch (coin breakthrough).
At 27.01 the error you got is the same than in the vending machine tuto. I dont think it a gas issue. To fix the issue, inside the contract, instead using writing 0.01 ether, I write 10000000000000000 wei and it works. I dont have lot of experience so I dont know why it works but if someone can explain it would be great.
anyone able to deploy this on a cloud like heroku or vercel. I can't for some reason. I've defined the env variables
Do you mean the dApp? For the smart contract I would just deploy directly to Ethereum.
Hello friend, great tutorial! Please how to split pay between winner and owner.
hey, thank you! this code isn't tested but I think you could do something like this:
players[index].transfer(address(this).balance / 2);
payable(owner).transfer(address(this).balance / 2);
@@BlockExplorerMedia Super! thank you, i will try this
@@BlockExplorerMedia Yoo! thank you! works with a little edit, when paying the owner no division required as it will pay whats left after paying the winner, which essentially is the total balance. with the division, it will send half of whats left to the owner. great stuff man, cant thank you enough
@@delostico can you please post your edit or refer to a GitHub / VIDEO / doc ? That would be awesome, thanks in advance.
@@semence2porc166
function payWinner() public onlyowner nonReentrant {
require(randomResult > 0, "Must have a source of randomness before choosing winner");
uint index = randomResult % players.length;
players[index].transfer(address(this).balance / 5*3);
payments.transfer(address(this).balance);
lotteryHistory[lotteryId] = players[index];
lotteryId++;
hi, could you teach me how to make a lottery like the one in pancake swap. a lottery with multiple winners and dividing the pot in differents % depending on the amount correct numbers from start to finish max 6 or 7 numbers. please. a video of this would be great. im trying to make a crypto lottery as a project for my class. I was wanting to make a DEX but i find the frontend a little bit to complicate for me
This was great, thank you
I have found your tutorials helpful
Would love to see one on how to make an auto compound vault. Users deposit token/LP token into a vault that auto compounds for users. Could probably be done by forking off of Beefy or Pancake or something but I’m not experienced enough to figure it all out myself.
I'm adding this to my list of video ideas to research - glad the tutorials have been helpful, thanks!
23:55 "modifier"
Direct and clear!
i liked this and subscribing , i would like it if you could add timestamp. it would be easy to navigate
Thanks Govind! Good suggestiong, I'll try adding timestamps.
very good tutorial thank you !
great videos! thanks dude!
no problemo!
Hi BlockExplorer, I asked you about your contact to ask you something. Some scam guys answer instead of you.
Thanks 🙏 sir
awesome video
thank you!
Awesome
god
nij
q¹!!!1
why not add a function for the creator of this smart contract to receive 5% from each pot? Otherwise why in hell should anyone create this project? "oh no this is just tutorial purposes bla bla bla" ...shitshow
If you werent dumb you would know how to add that function yourself without his help
-Declare admin as payable
-cast admin as payable in the constructor function
-add this line in the getwinner function (before transfer funds to the winner): owner.transfer((address(this).balance)/20);
Done ;)
@@milanis7a thx a lot bratha!
and I will buy around 500 dislikes and let them all downvote your video
I can't pick a winner it says :
transact to Lottery.pickWinner pending ...
transact to Lottery.pickWinner errored: VM error: out of gas.
out of gas
The transaction ran out of gas. Please increase the Gas Limit.
Debug the transaction to get more information.
I changed the gas but doesn't work
what should I do?
getting the same error and changing the gas limit before contract deployment doesn't seem to work
Got any solution?