Mahima Thacker pfp
Mahima Thacker
@mahimathacker
Did you know that in Solidity, making a function 'payable' can cut down on gas costs, even if you're not sending any ETH? This happens because 'payable' functions don't use certain steps that the Ethereum Virtual Machine normally runs to check if ETH is being sent👇 #SOLIDITY
1 reply
0 recast
2 reactions

Mahima Thacker pfp
Mahima Thacker
@mahimathacker
Skipping these steps means using less gas. Look at this comparison 👇: - hello() function (payable): 21,137 gas - hello2() function (non-payable): 21,161 gas The payable version is slightly cheaper. Remember, only make a function 'payable' if it’s meant to work with ETH
1 reply
0 recast
0 reaction