Network-Goods / hypercerts-protocol

MIT License
13 stars 5 forks source link

Contract improvements #48

Closed bitbeckers closed 1 year ago

bitbeckers commented 2 years ago

The current set of contract has been developed and itterated upon rapidly. We now have a contract set of Minter, Metadata and SVGGenerator that are compliant with ERC3525 and ERC721 tokens and are handled by platforms like OpenSea.

Improvements can be made to reduce technical debt, contract deployment cost and tx gas cost. Also, there are some open ends.

Technical debt

Cleanup method and variables, optimising inheritance and local variable usage, among others.

Contract deployment cost & tx gas cost

Deployment and gas cost are inversely correlated, but impact can be insignificant when doing small tweaks. See comments below.

Gas cost can be reduced by running more optimisation rounds, which increases the contract deployment size and vice versa. We're close to the 24KiB limit so reducing contract size should have a higher priority than reducing gas cost.

Open ends

For instance not finalized, in designs or further discussed:

bitbeckers commented 2 years ago

Clean install - optimiser 100 runs

Image

Image

bitbeckers commented 2 years ago

Methods cleanup - optimiser 300 runs

Image

Image