Skip to content

Commit

Permalink
Merge pull request #5 from 0xPolygon/dev
Browse files Browse the repository at this point in the history
Rename library
  • Loading branch information
gretzke authored Dec 11, 2023
2 parents f3fc0bf + 8c48c95 commit c2be7a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Deplyoment Log Generator
# Forge Chronicles

The deployment log generator is a tool that generates a json file and a human readable markdown log file with the deployment information about contracts deployed using `forge script`. It can keep track of upgrades for transparent proxies and generates a history of deployments. An example for such a log can be found [here](https://github.com/0xPolygon/pol-token/blob/main/deployments/5.md). Logs are generated by extracting information from the `run-latest.json` file generated by `forge script` in the `broadcast` directory.
The Forge Chronicles library is a tool that generates a json file and a human readable markdown log file with the deployment information about contracts deployed using `forge script`. It can keep track of upgrades for transparent proxies and generates a history of deployments. An example for such a log can be found [here](https://github.com/0xPolygon/pol-token/blob/main/deployments/5.md). Logs are generated by extracting information from the `run-latest.json` file generated by `forge script` in the `broadcast` directory.

## Requirements

Expand All @@ -9,15 +9,15 @@ The script utilizes Node.js to run. We recommend the node version defined in the
## Installation

```bash
forge install 0xPolygon/deployment-log-generator
forge install 0xPolygon/forge-chronicles
```

## Usage Example

The following command will create a log for the contracts deployed in the `Deploy.s.sol` script on Ethereum mainnet.

```bash
node lib/deployment-log-generator Deploy.s.sol --chain-id 1 --rpc-url https://mainnet.infura.io/v3/{your-infura-key}
node lib/forge-chronicles Deploy.s.sol --chain-id 1 --rpc-url https://mainnet.infura.io/v3/{your-infura-key}
```

## Usage
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function validateAndExtractInputs() {
printHelp();
process.exit(0);
} else if (scriptName === "-v" || scriptName === "--version") {
console.log(JSON.parse(readFileSync("lib/deployment-log-generator/package.json", "utf8")).version);
console.log(JSON.parse(readFileSync("lib/forge-chronicles/package.json", "utf8")).version);
process.exit(0);
}

Expand Down Expand Up @@ -85,7 +85,7 @@ function validateAndExtractInputs() {

const printHelp = () => {
console.log(
"\nUsage: node lib/deployment-log-generator <scriptName> [-c chain-id] [-r rpc-url] [-s skip-json]\n\nCommands:\n -c, --chain-id\tChain id of the network where the script was executed (default: 31337)\n -r, --rpc-url\t\tRPC url used to fetch the version of the contract or verify an upgrade (default: $RPC_URL). If no rpc url is provided, version fetching is skipped.\n -s, --skip-json\tSkips the json generation and creates the markdown file using an existing json file\n\nOptions:\n -h, --help\t\tPrint help\n -v, --version\t\tPrint version\n\nDocumentation can be found at https://github.com/0xPolygon/deployment-log-generator",
"\nUsage: node lib/forge-chronicles <scriptName> [-c chain-id] [-r rpc-url] [-s skip-json]\n\nCommands:\n -c, --chain-id\tChain id of the network where the script was executed (default: 31337)\n -r, --rpc-url\t\tRPC url used to fetch the version of the contract or verify an upgrade (default: $RPC_URL). If no rpc url is provided, version fetching is skipped.\n -s, --skip-json\tSkips the json generation and creates the markdown file using an existing json file\n\nOptions:\n -h, --help\t\tPrint help\n -v, --version\t\tPrint version\n\nDocumentation can be found at https://github.com/0xPolygon/forge-chronicles",
);
};

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deployment-log-generator",
"version": "0.1.0",
"name": "forge-chronicles",
"version": "0.2.0",
"description": "Extracts contract deployment data from run-latest.json (foundry broadcast output) and writes to deployments/json/{chainId}.json & deployments/{chainId}.md",
"main": "index.js",
"author": "Polygon Labs",
Expand Down

0 comments on commit c2be7a4

Please sign in to comment.