This repository was archived by the owner on Jul 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
This repository was archived by the owner on Jul 8, 2022. It is now read-only.
Optimize truffle/solidity compilation process #11
Copy link
Copy link
Open
Description
Idea 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
- Compiler should take the file of the main contract and it will find all the necessary dependent contracts and will compile them accordingly
- 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:
- Only compile what the main contract needs, thus reducing ABI files
- Don't use file system for the provider, the compilation result is retrieved via stdout of solc
- When testing, we can catch the contracts that are no longer available (deleted contracts)
Cons:
- This way of organizing the contracts won't fit for everyone - (maybe they have multiple of main contracts in the project)
- 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
- 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
Labels
No labels