sablier-labs / v2-periphery

🎛 Peripheral smart contracts for interacting with Sablier V2
https://docs.sablier.com
GNU General Public License v3.0
24 stars 7 forks source link

Use precompiles to write a protocol deployment script #238

Closed PaulRBerg closed 6 months ago

PaulRBerg commented 9 months ago

Write a deployment script that uses the V2 Core precompiles to deploy the entire Sablier V2 protocol (V2 Core + V2 Periphery).

This is possible to do now because the precompiles are part of the @sablier/v2-core npm package (in the test/utils package).

Note: there is an appearance of misuse by importing production code from test/utils. As explained here, we should consider moving the precompiles - perhaps in script, or in artifacts, or in `src.

Related: https://github.com/sablier-labs/v2-periphery/pull/91#issuecomment-1580391265

andreivladbrg commented 9 months ago

perhaps in script, or in artifacts, or in `src.

in script makes the most sense

PaulRBerg commented 9 months ago

Then, we need to include script in the npm package.

andreivladbrg commented 9 months ago

i think it would be unnecessary to include all script dir, we should include only that specific deployment script

PaulRBerg commented 9 months ago

Yep, that's what I was referring to.

smol-ninja commented 6 months ago

@PaulRBerg, a script to deploy the entire V2 protocol does not make sense because it exceeds the EVM gas limit. As discussed here, the gas usage of this script is ~100M which is not feasible in production.

For the purpose of testing, we have added a function in periphery precompiles that can be used to deploy code + periphery.

PaulRBerg commented 6 months ago

Oh, I didn't take the EVM gas limit into consideration when I created this issue.

Closing this, it's an obvious conclusion.

For the purpose of testing, we have added a function

Good stuff