Skip to content

Make applications cheaper to deploy with ERC-1167Β #417

@guidanoli

Description

@guidanoli

πŸ“š Context

Application deployment is one of the most expensive L1 operations in Cartesi Rollups.
This is mostly due to the considerable size of the Application contract bytecode.
We can make this operation cheaper by leveraging the ERC-1167 standard.
The standard describes minimal proxy contracts that help reduce deployment costs.
The original proxy contract is described in EVM bytecode.
Thankfully, OpenZeppelin implements the pattern in Solidity (see Clones).
It even supports embedding arguments into the clone's bytecode.
See the cloneDeterministicWithImmutableArgs and fetchCloneArgs functions.
This is crucial for us to convert immutable variables into the ERC-1167 framework.
To give a notion of the reduction in gas costs, see cartesi/dave#151.
We applied this technique in the PRT contracts and witnessed a 10x reduction in gas costs.
This type of reduction in gas costs is crucial for recurrent deployment, such as tournaments.
But this technique can also have positive effects if applied in single-time deployments, such as applications.
In particular, this can reduce the entrance barrier for app developers to deploy their apps to Mainnet.

βœ”οΈ Solution

  • Make ApplicationFactory and Application implement ERC-1167
  • Measure gas cost changes in application deployment and function calls

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    πŸ“‹ Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions