Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Update Bank.sol #1510

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Commits on Mar 7, 2024

  1. Update Bank.sol

    There are several things that can be optimized in this code. Firstly, the use of `string` type parameters can increase gas consumption. Therefore, lower gas-consuming types such as `bytes32` or `uint256` can be used as much as possible.
    
    Secondly, `mapping` or `array` structures can be used instead of `for` loops, which can reduce gas consumption.
    
    Thirdly, `view` functions can be preferred because they have lower gas consumption.
    
    Fourthly, `public` functions can be used instead of `external` functions. `external` functions consume more gas because they make data copying when they are called.
    
    Finally, correctly ordering the parameters of functions can reduce gas consumption. In particular, placing small parameters first can reduce gas consumption.
    
    However, if there is no specific performance issue in this code, any optimization may be unnecessary.
    
    Signed-off-by: Ahmet KILIÇ <[email protected]>
    ahmetmatematikci authored Mar 7, 2024
    Configuration menu
    Copy the full SHA
    dbd864f View commit details
    Browse the repository at this point in the history