FIL-Builders / onramp-contracts

Prototyping smart contracts piping data to the filecoin network
0 stars 0 forks source link

Simplify deployment script #8

Closed longfeiWan9 closed 2 days ago

longfeiWan9 commented 1 week ago

Currently, onramp uses deploy-onramp.fish to deploy onramp contract to Filecoin as well as other chains. It is a complicated process involving:

We should make this deployment process easier for regular builders, and easier to deploy to other chains when it is necessary.

longfeiWan9 commented 3 days ago

The deployment steps should be:

Deploy contracts on different chains

  1. Filecoin
    • deploy DealClient from Prover-Axelar.sol with args [_gateway, _gasReceiver] to set up Axelar for prover to call back.
  2. SourceChain - Linea
    • deploy OnRampContract
    • deloy AxelarBridge from Oracle.sol with args[_gateway]

Wire contracts together

  1. Filecoin
    • Calling DealClient.setDestinationChains() with info for Linea & other chains
  2. SourceChain - Linea
    • Calling OnRampContract.setOracle(onrampAddressLinea) to wire Oracle to Onramp
    • calling AxelarBridge.setSenderReceiver(proverAddressFilecoin,onrampAddressLinea) so that Axelar knows where to call when sending cross-chain calls.

FYI. We would have to call addGasFunds() for Axelar call to succeed with an appropriate amount for cross-chain call and the same providerAddrData as a parameter that you will use while making a deal with xchain backend so that dealNotify() uses the funds you provided correctly.