30 Solidity Tricks You Can’t Live Without
Вставка
- Опубліковано 10 лип 2023
- FREE MASTERCLASS "Get Into Web3 In a Bear Market"
👉 Link: eattheblocks.com/masterclass
👉 Full roadmap to learn Web3 Development & get a 6 figure remote job
👉 EVEN during this bear market
FREE MASTERCLASS "Get Into Web3 In a Bear Market"
👉 Link: eattheblocks.com/masterclass
👉 Full roadmap to learn Web3 Development & get a 6 figure remote job
👉 EVEN during this bear market
^0.8.20 , some tutorials put this for compatible purpose, not for deploying in the production, then putting ^ symbol is not always wrong, it is depending on the objective of example.
We want more videos like this.
yes! thanks for your support
exactly
Thank you! This is really helpful. Much appreciated.
Glad to hear it!
11:41 for "pure" keyword, I compiled the code example with and without optimization using no mutability, "view" and then "pure", and bytecode is exact same in every case (except for metadata hash ofc)
Nice tips and tricks, I love the section on reentrancy guards 👌
Thanks, glad you liked these Solidity tricks!
14:04 Thank you professor, just like in the college 😅
haha
Solidity: EXCUSE MEEE!!! Did you just assume my GENDERR!!!
😂😂😂
The best
Hey pal!
Yes yes yes ooo solidity so good
exactly
Do free functions (or importing scripts) still count towards the size of the contract?
I don't see why they wouldn't but I have my fingers crossed for the opposite lol.
You're like the crypto-Asterix, excellent videos anyway, thanks.
thx!
this is awesome, thanks for sharing these advanced tips
No worries!
Thank you for this.
Thanks for your support
Suggest some courses for beginner to advance in blockchain developement
Here you go (it's my course):
eattheblocks.com/course/
your videos are the best!
Wow, thanks!
Wow that’s a lot of information ,merci
My pleasure!
Wow. I really love this
Thank you
thank u
Welcome
mind explosion .... thankyou
thanks!
this was great
THanks!
05:16 😂 Tu as fais ton "et voilà" comme un étranger qui essaie de parler français
Ah non, en Anglais on peut dire voila.
109th...Thanks Julien
Congrats!
trying to use console.log but not working giving error
code:
pragma solidity ^0.8.8;
import "hardhat/console.sol";
contract Tricks
{
function Console() external pure
{
uint256 a=30;
int256 b=-25;
console.log (a);
console.log (b);
}
}
error:
TypeError: Member "log" not found or not visible after argument-dependent lookup in type(library console).
--> SOLIDITY/SOLIDITY/Tricks.sol:13:10:
|
13 | console.log (b);
| ^^^^^^^^^^^
Are you trying in Remix?
@@EatTheBlocks yes
replace pure with view
u are awosomeeeee
Thanks!
What about huff ?
Good suggestion. I might do a tutorial on that
You have a lot of mistakes in your codes like when you define a global function above other contracts you cannot give it a visiblity state like internal ! and mistake about ^0.8.15 meaning and your syntax is incorrect while declaring a event in timestamp section , other miss-uses ....
So you do a horrible unbounded loop in the iterate() function example, say "et voila", only to let people know in the following trick that doing so is actually a terrible idea. Lol
No, you missed the point. Unbounded loops should be avoided in transactions. If you are just reading data, it's not a transaction.
@@EatTheBlocks there is still a gas limit on reads, plus you might well need to use a read function in a write function, so it's still a pretty ugly thing to do imho
@EatTheBlocks
What's up