PathFinder

Git Source

Inherits: CommonBase

State Variables

DEFAULT_DEVOPS_CONFIG

string private constant DEFAULT_DEVOPS_CONFIG = "./devops.json";

ENVIRONMENT_PROD

string internal constant ENVIRONMENT_PROD = "";

devopsConfig

string private devopsConfig;

Functions

withDevopsConfig

modifier withDevopsConfig();

assertFileExists

function assertFileExists(string memory filePath) internal;

loadDevopsConfig

function loadDevopsConfig() internal;

getDevopsConfigPath

Path to the devops.json file. Could be overridden if the location of the file is different.

function getDevopsConfigPath() internal pure virtual returns (string memory);

getForgeArtifactsPath

Returns the path to the directory where the forge artifacts for the contracts are stored.

The path is configured in the devops.json file.

function getForgeArtifactsPath() internal view withDevopsConfig returns (string memory);

getFreshDeploymentsPath

Returns the path to the temp directory where the deployment artifacts are saved during a script run. Note: deployment artifacts are NOT saved to the deployments directory automatically, another script must be run to verify that the deployment was successful and save the deployment artifacts to the deployments directory. The reason for this is that the forge script is simulated before the broadcasted transactions are sent, and the artifacts are saved during the script simulation. So we can't know if the deployment was successful until the script is actually run.

The path is configured in the devops.json file.

function getFreshDeploymentsPath() internal view withDevopsConfig returns (string memory);

getDeploymentsPath

Returns the path to the directory where the deployment artifacts are stored. Note: only verified deployments are stored in this directory.

The path is configured in the devops.json file.

function getDeploymentsPath() internal view withDevopsConfig returns (string memory);

getDeployConfigsPath

Returns the path to the directory where the deployment configuration files are stored.

The path is configured in the devops.json file.

function getDeployConfigsPath() internal view withDevopsConfig returns (string memory);

getGlobalDeployConfigPath

Returns the path to the global deployment configuration file for a contract.

Override this function to customize the path to the global deployment config file.

function getGlobalDeployConfigPath() internal view virtual returns (string memory);

getArtifactFN

Returns the path to the contract artifact generated by forge. Example: "artifacts/SynapseRouter.sol/SynapseRouter.json"

function getArtifactFN(string memory contractName) internal view returns (string memory);

getFreshDeploymentFN

Returns the path to the FRESH contract deployment JSON for a contract. Example: ".deployments/mainnet/SynapseRouter.json"

function getFreshDeploymentFN(string memory chain, string memory contractName) internal view returns (string memory);

getDeploymentFN

Returns the path to the SAVED deployment JSON for a contract. Example: "deployments/mainnet/SynapseRouter.json"

function getDeploymentFN(string memory chain, string memory contractName) internal view returns (string memory);

getChainGenericFN

Returns the path to the generic file on a given chain.

Useful for the files that are not specific to a contract, but are specific to a chain.

function getChainGenericFN(string memory chain, string memory fileName) internal view returns (string memory);

getDeployConfigFN

Returns the path to the contract deployment config JSON for a contract on a given chain. Example: "script/configs/mainnet/SynapseRouter.dc.json"

function getDeployConfigFN(string memory chain, string memory contractName) internal view returns (string memory);

getGlobalDeployConfigFN

Returns the path to the global config JSON that is shared across all chains for a contract. We expect different environments to exist, therefore the following pattern is used:

  • For a production environment, the environment param is empty, e.g. "script/configs/global/SynapseCCTP.json"
  • For a testnet, the environment param is "testnet", e.g. "script/configs/global/testnet/SynapseCCTP.json"
function getGlobalDeployConfigFN(
    string memory contractName,
    string memory environment
)
    internal
    view
    returns (string memory);