Skip to main content

New answers tagged

1 vote

No Gas Consumption for Computations not changing the State of the Blockchain

First of all, since your function doesn’t modify the blockchain state, you should mark it with view. One way to look at it is that calling a view function will always consume a certain amount of ...
dwardu's user avatar
  • 1,398
1 vote

No Gas Consumption for Computations not changing the State of the Blockchain

When you call a view or pure function, the EVM (Ethereum Virtual Machine) executes the function locally on the node that receives the request. Since the function you have written above don't change ...
Talha Sajid Chaudhary's user avatar
0 votes

Convert the following address sum function to optimized assembly via both memory and storage. Slots are dynamic

I've creating a working version that avoids the 'unreachable code' error, but it doesn't seem to be much, if at all , faster than regular solidity: function _getCurrentSupplyAssembly() internal view ...
Ashraile's user avatar
  • 125
1 vote

How to further improve Safemoon's reflection token transfer? (ERC20/BEP20)

The calculations for T_TotalExcludedSupply and R_TotalExcludedSupply might be done like this: // optimized uint T_TotalExcludedSupply; uint R_TotalExcludedSupply; function _getRateOptimized() public ...
SYED ASAD KAZMI's user avatar
1 vote

Would small integers saving gas in a struct?

The second one is more cheap, the contiguous items that are less than 32 bytes are packed into a single storage slot. You can look it up here.
Alvan's user avatar
  • 11
2 votes

Is it possible to create a transaction as an admin and send it but with someone else paying for the gas fees?

Is it possible to call this method with gas fees paid by the user You can make your smart contract act based on the message signed by your centralised server. This message is a smart contract ...
Mikko Ohtamaa's user avatar
0 votes

Why out of gas if it doesn't consume that much in the end?

Refunds for a contract execution are returned after the transaction was completed. It could be that the transaction needs more than 62800 gas, you receive the difference as refund.
Ismael's user avatar
  • 30.6k

Top 50 recent answers are included