DataWriter

Git Source

Inherits: PathFinder, Logger

Functions

writeJson

Writes a JSON data to a file, and prints a log message.

function writeJson(string memory descriptionLog, string memory path, string memory data) internal;

writeDeploymentArtifact

Writes the deployment JSON for a contract on a given chain under the specified alias. Example: contractName = "LinkedPool", contractAlias = "LinkedPool.USDC" Note: writes the JSON file to the FRESH deployments directory. The written file needs to be moved to the correct location outside of the deployment script. Note: will not include the ABI in the output JSON.

function writeDeploymentArtifact(
    string memory chain,
    string memory contractAlias,
    string memory artifact
)
    internal
    returns (string memory path);

writeDeployConfig

Writes the deploy config for a contract on a given chain.

function writeDeployConfig(string memory chain, string memory contractName, string memory configData) internal;

writeGlobalDeployConfig

Writes the global deploy config that is shared across all chains for a contract.

function writeGlobalDeployConfig(
    string memory contractName,
    string memory environment,
    string memory configData
)
    internal;

writeGlobalDeployProdConfig

Writes the global deploy production config that is shared across all chains for a contract.

function writeGlobalDeployProdConfig(string memory contractName, string memory configData) internal;

createDirIfRequired

Creates a directory where the file will be saved if it doesn't exist yet.

function createDirIfRequired(string memory filePath) internal;