Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Optimize truffle/solidity compilation process #11

@borseno

Description

@borseno

Idea 1

  1. The contract dependencies are important, in one repo there should not be two main contracts, there should be only one, and all the rest to be auxiliary
  2. Compiler should take the file of the main contract and it will find all the necessary dependent contracts and will compile them accordingly
  3. Only the contracts that are really necessary for the main one to function will be output

Suggestion 1 (probably won't work out)

Compile using solc directly and abandon truffle

Pros:

  1. Only compile what the main contract needs, thus reducing ABI files
  2. Don't use file system for the provider, the compilation result is retrieved via stdout of solc
  3. When testing, we can catch the contracts that are no longer available (deleted contracts)

Cons:

  1. This way of organizing the contracts won't fit for everyone - (maybe they have multiple of main contracts in the project)
  2. What truffle did for us before, we will need to do ourselves (and maintain that, as well). For instance:
    • npm packages support
    • a lot of other things we have not yet taken into consideration
  3. Only compile .sol files (forfeiting vyper and other languages)

Suggestion 2

Use hardhat instead

Hardhat does the same job as truffle, but it turns out that you can write your own task for hardhat, that will do exactly what we need (only compile the necessary contracts)

Maybe, we can do the same in hardhat (point to a script, vs a configuration, and run the deployment script instead)

Idea 2

In the type provider we have implemented 3 times more functions than we should have, this is due to the problem in the Type provider SDK, that we cannot create optional arguments for some types. We can investigate this problem, fix it, and reduce the number of functions that our type provider generates. This will increase the speed of the type provider.

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