Skip to content

feat: optimize gas usage #8

Description

@quiet-node

function inputs and outputs should be appropriately allocate using the data location keywords

  • calldata (most of the time inputs should be marked as calldata as they do not need to be modified): for input arguments (cheaper gas used compared to memory) that are read-only, non-modifiable.

  • storage vs memory inside function body. Use storage in case of updating multiple fields in a struct will be cheaper in terms of gas usage compared to memory (example needs fix: https://github.com/syns-platform/contracts/blob/main/contracts/v1/SynsMarketplace.sol#L398)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions