My new 3gm ai banner 🔥
Finally I can put something cool in my profile header 😅
opensea.io/assets/ethereum/0…
Thank you @3gmdev team!
#3gmAIBanners
Wow 🔥
This is very important information about Solana blockchain!
I highly recommend reading.
RT for more explosion 🔥
#SolanaSummer ?
Hey, it's Bamboo
Today I want to discuss with you what's going on with the NFT on Solana. I think a lot of people have noticed that a lot of Sol collections have been hyped and showing outstanding results lately.
#NFT #Solana
4
P.S. I hope this information will help novice developers to optimize their smart contracts.
If you liked my mini article, you can share it with someone or just like it.
Good luck! ❤️
13
4/4. Changing global variables in a loop.
By changing the global variable many times in a loop, we waste gas overwriting the data that is stored in the blockchain and this can cost a lot.
The local variable will help us save gas:
First call costs 30404.
The second 34250.
1
14
3/4. Intermediate variables.
With the help of intermediate variables, we often simplify the readability of the code, but in smart contracts this can also add cost to the execution of the function.
First call costs 43364.
The second 43390.
It's a small difference, but it's there.
1
14
2/4. Data arrays.
When you use arrays, don't use dynamic arrays unnecessarily, as they cost a lot of gas compared to fixed length arrays.
For example, calling the pushSomeData function, in the first case we pay 43753 gas, in the second 65933:
This is a really big difference!
1
13
1/4. Variable initialization.
Many people know that when declaring a variable of type uint, then by default the value 0, and if you need to initialize a variable with a value of 0, then you can not write this and save gas.
The first costs 67066 gas.
The second one is 69324.
1
14





