Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown Generation #36

Merged
merged 30 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c82303c
feat: md generation
DhairyaSethi Oct 12, 2023
c7e37de
only ignore devnet broadcast files
gretzke Oct 12, 2023
c33e34e
fix: generateDeploymentHistory
DhairyaSethi Oct 12, 2023
d22c962
upd: goerli deployment json + md
DhairyaSethi Oct 12, 2023
52b637c
fix: etherscan link
DhairyaSethi Oct 12, 2023
f936a49
fix: commit hash of deployment
DhairyaSethi Oct 12, 2023
fc5b5f4
fix: include latest in deployment history
DhairyaSethi Oct 12, 2023
6c5bf11
chore: rm module exports
DhairyaSethi Oct 12, 2023
3d32203
chore: uppercase i, fix table of contents
DhairyaSethi Oct 12, 2023
f6f7bb4
update paths, add 1.1.0 upgrade script
gretzke Oct 13, 2023
a75cdd4
chore: mv json to deployments/json/
DhairyaSethi Oct 16, 2023
5c31fae
new: use deployment input
DhairyaSethi Oct 16, 2023
c96161a
chore: use {version}/input.json
DhairyaSethi Oct 16, 2023
57ae495
chore: ignore devnet json
DhairyaSethi Oct 16, 2023
3dcf7b1
fix: support for upgrade scripts json
DhairyaSethi Oct 16, 2023
304efa0
chore: fs_perms for input.json
DhairyaSethi Oct 16, 2023
ab54089
fix: md gen
DhairyaSethi Oct 16, 2023
686a27c
fix: etherscan link edge case
DhairyaSethi Oct 16, 2023
29cbad3
new: add version column in summary
DhairyaSethi Oct 17, 2023
801bcff
chore: deployment history versions in summary
DhairyaSethi Oct 17, 2023
180327d
chore: fix history
DhairyaSethi Oct 17, 2023
32b0449
new: update json structure - rm lastest.contracts, add first version …
DhairyaSethi Oct 17, 2023
a44df5f
chore: update json/md with new structure
DhairyaSethi Oct 17, 2023
b106c43
chore: update usage, validate inputs, add help cmd
DhairyaSethi Oct 17, 2023
b116636
new: extract commitHash, timestamp in parent obj in history
DhairyaSethi Oct 17, 2023
5ec95e3
fix: add 1.0.0 to history on init
DhairyaSethi Oct 17, 2023
c5132a9
chore: add line break bw contracts
DhairyaSethi Oct 17, 2023
fb881b2
new: use UTC timestamp
DhairyaSethi Oct 17, 2023
9af97e8
chore: rm history before implementation history, GMT->UTC
DhairyaSethi Oct 17, 2023
3cdc51b
Update existing deployment logs to new format
gretzke Oct 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
/coverage
lcov.info
.DS_Store
broadcast/
.env

output/31337.json
broadcast/*/31337
deployments/31337.md
deployments/json/31337.json
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
"singleQuote": false,
"bracketSpacing": false
}
},
{
"files": "*.json",
"options": {
"tabWidth": 4
}
}
]
}
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ A default implementation is included and this contract will be proxy upgradable

### Setup

- [Install foundry](https://book.getfoundry.sh/getting-started/installation)
- Install Dependencies: `forge install`
- Build: `forge build`
- Test: `forge test`
- [Install foundry](https://book.getfoundry.sh/getting-started/installation)
- Install Dependencies: `forge install`
- Build: `forge build`
- Test: `forge test`

### Deployment

1. Ensure .env file is set, `cp .env.example`
2. Populate Enviornment variables: `source .env`
3. We use a forge script to deploy the contracts, and have an additional extract.js script to store a JSON file with coalesced deployment information. (see [output](./output/))
3. We use a forge script to deploy the contracts, and have an additional extract.js script to store a JSON file with coalesced deployment information. (see [deployments](./deployments/))

- (mainnet): `forge script script/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --private-key $PRIVATE_KEY --etherscan-api-key $ETHERSCAN_API_KEY`
- (testnet, goerli for example): `forge script script/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --private-key $PRIVATE_KEY --verifier-url https://api-goerli.etherscan.io/api --chain-id 5`
- (mainnet): `forge script scripts/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --private-key $PRIVATE_KEY --etherscan-api-key $ETHERSCAN_API_KEY`
- (testnet, goerli for example): `forge script scripts/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --private-key $PRIVATE_KEY --verifier-url https://api-goerli.etherscan.io/api --chain-id 5`

4. Run `node script/util/extract.js <chainId>` to extract deployment information from forge broadcast output (broadcast/latest-run.json).
4. Run `node scripts/util/extract.js <chainId> [version = 1.0.0] [scriptName = Deploy.s.sol]` to extract deployment information from forge broadcast output (broadcast/latest-run.json).

## Reference Deployments

Expand Down
238 changes: 238 additions & 0 deletions broadcast/Deploy.s.sol/5/run-1696415718.json

Large diffs are not rendered by default.

685 changes: 685 additions & 0 deletions broadcast/Deploy.s.sol/5/run-1696415725.json

Large diffs are not rendered by default.

685 changes: 685 additions & 0 deletions broadcast/Deploy.s.sol/5/run-1696415816.json

Large diffs are not rendered by default.

685 changes: 685 additions & 0 deletions broadcast/Deploy.s.sol/5/run-latest.json

Large diffs are not rendered by default.

219 changes: 219 additions & 0 deletions deployments/5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
# Polygon Ecosystem Token


### Table of Contents
- [Summary](#summary)
- [Contracts](#contracts)
- [Polygon Migration](#polygon-migration)
- [Default Emission Manager](#default-emission-manager)
- [Proxy Admin](#proxy-admin)
- [Polygon Ecosystem Token](#polygon-ecosystem-token)
- [Deployment History](#deployment-history)
- [1.0.0](#100)

## Summary
<table>
<tr>
<th>Contract</th>
<th>Address</th>
<th>Version</th>
</tr><tr>
<td>PolygonMigration</td>
<td><a href="https://goerli.etherscan.io/address/0x5c5589fca76237Ed00BA024e19b6C077a108f687" target="_blank">0x5c5589fca76237Ed00BA024e19b6C077a108f687</a></td>
<td>1.0.0</td>
</tr>
<tr>
<td>DefaultEmissionManager</td>
<td><a href="https://goerli.etherscan.io/address/0x0e481cfeB712d37A0C6cd4e2801cA01E09Bc1A9d" target="_blank">0x0e481cfeB712d37A0C6cd4e2801cA01E09Bc1A9d</a></td>
<td>1.0.0</td>
</tr>
<tr>
<td>ProxyAdmin</td>
<td><a href="https://goerli.etherscan.io/address/0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2" target="_blank">0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2</a></td>
<td>N/A</td>
</tr>
<tr>
<td>PolygonEcosystemToken</td>
<td><a href="https://goerli.etherscan.io/address/0x4f34BF3352A701AEc924CE34d6CfC373eABb186c" target="_blank">0x4f34BF3352A701AEc924CE34d6CfC373eABb186c</a></td>
<td>1.0.0</td>
</tr></table>

## Contracts

### Polygon Migration

Address: [0x5c5589fca76237Ed00BA024e19b6C077a108f687](https://goerli.etherscan.io/address/0x5c5589fca76237Ed00BA024e19b6C077a108f687)

Deployment Txn: [0xe0786d27a0f9ae581cabfcab6edf6a0fd261f0143e4a52cbd6c383cb87c5b4a4](https://goerli.etherscan.io/tx/0xe0786d27a0f9ae581cabfcab6edf6a0fd261f0143e4a52cbd6c383cb87c5b4a4)

Version: [1.0.0](https://github.com/0xPolygon/pol-token/releases/tag/1.0.0)

Commit Hash: [9af97e8](https://github.com/0xPolygon/pol-token/commit/9af97e84fca5f31e7351cb91b85ac7dd5f40f563)

Wed, 04 Oct 2023 10:36:56 UTC


_Proxy Information_



Proxy Type: TransparentUpgradeableProxy



Implementation: [0x41E44496AfE9FE59004b9d166eFa5A31245746b5](https://goerli.etherscan.io/address/0x41E44496AfE9FE59004b9d166eFa5A31245746b5)



Proxy Admin: [0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2](https://goerli.etherscan.io/address/0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2)



<details>
<summary>Implementation History</sumamry>
<table>
<tr>
<th>Version</th>
<th>Address</th>
<th>Commit Hash</th>
</tr>
<tr>
<td><a href="https://github.com/0xPolygon/pol-token/releases/tag/1.0.0" target="_blank">1.0.0</a></td>
<td><a href="https://goerli.etherscan.io/address/0x41E44496AfE9FE59004b9d166eFa5A31245746b5" target="_blank">0x41E44496AfE9FE59004b9d166eFa5A31245746b5</a></td>
<td><a href="https://github.com/0xPolygon/pol-token/commit/9af97e84fca5f31e7351cb91b85ac7dd5f40f563" target="_blank">9af97e8</a></td>
</tr>
</table>
</details>


---

### Default Emission Manager

Address: [0x0e481cfeB712d37A0C6cd4e2801cA01E09Bc1A9d](https://goerli.etherscan.io/address/0x0e481cfeB712d37A0C6cd4e2801cA01E09Bc1A9d)

Deployment Txn: [0xff69667f86a1050432a4d07f93d6202b9141bad1d0e73da42675e1fdf9b1ce02](https://goerli.etherscan.io/tx/0xff69667f86a1050432a4d07f93d6202b9141bad1d0e73da42675e1fdf9b1ce02)

Version: [1.0.0](https://github.com/0xPolygon/pol-token/releases/tag/1.0.0)

Commit Hash: [9af97e8](https://github.com/0xPolygon/pol-token/commit/9af97e84fca5f31e7351cb91b85ac7dd5f40f563)

Wed, 04 Oct 2023 10:36:56 UTC


_Proxy Information_



Proxy Type: TransparentUpgradeableProxy



Implementation: [0xe76193f2107bF7Cc9C6A0de6af63D3C74b936393](https://goerli.etherscan.io/address/0xe76193f2107bF7Cc9C6A0de6af63D3C74b936393)



Proxy Admin: [0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2](https://goerli.etherscan.io/address/0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2)



<details>
<summary>Implementation History</sumamry>
<table>
<tr>
<th>Version</th>
<th>Address</th>
<th>Commit Hash</th>
</tr>
<tr>
<td><a href="https://github.com/0xPolygon/pol-token/releases/tag/1.0.0" target="_blank">1.0.0</a></td>
<td><a href="https://goerli.etherscan.io/address/0xe76193f2107bF7Cc9C6A0de6af63D3C74b936393" target="_blank">0xe76193f2107bF7Cc9C6A0de6af63D3C74b936393</a></td>
<td><a href="https://github.com/0xPolygon/pol-token/commit/9af97e84fca5f31e7351cb91b85ac7dd5f40f563" target="_blank">9af97e8</a></td>
</tr>
</table>
</details>


---

### Proxy Admin

Address: [0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2](https://goerli.etherscan.io/address/0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2)

Deployment Txn: [0xcc62464cf4ef11bb1d03a0f898eb22feb335286a5c3b546942b03d34e960213d](https://goerli.etherscan.io/tx/0xcc62464cf4ef11bb1d03a0f898eb22feb335286a5c3b546942b03d34e960213d)



Commit Hash: [9af97e8](https://github.com/0xPolygon/pol-token/commit/9af97e84fca5f31e7351cb91b85ac7dd5f40f563)

Wed, 04 Oct 2023 10:36:56 UTC


---

### Polygon Ecosystem Token

Address: [0x4f34BF3352A701AEc924CE34d6CfC373eABb186c](https://goerli.etherscan.io/address/0x4f34BF3352A701AEc924CE34d6CfC373eABb186c)

Deployment Txn: [0x69ee54fefe2d7902a4de228f8f6b19bb3e1308013f10e47cecf07066ecd57fa1](https://goerli.etherscan.io/tx/0x69ee54fefe2d7902a4de228f8f6b19bb3e1308013f10e47cecf07066ecd57fa1)

Version: [1.0.0](https://github.com/0xPolygon/pol-token/releases/tag/1.0.0)

Commit Hash: [9af97e8](https://github.com/0xPolygon/pol-token/commit/9af97e84fca5f31e7351cb91b85ac7dd5f40f563)

Wed, 04 Oct 2023 10:36:56 UTC


----


### Deployment History


### [1.0.0](https://github.com/0xPolygon/pol-token/releases/tag/1.0.0)

Wed, 04 Oct 2023 10:36:56 UTC

Commit Hash: [9af97e8](https://github.com/0xPolygon/pol-token/commit/9af97e84fca5f31e7351cb91b85ac7dd5f40f563)

Deployed contracts:

- [Polygon Migration](https://goerli.etherscan.io/address/0x5c5589fca76237Ed00BA024e19b6C077a108f687) ([Implementation](https://goerli.etherscan.io/address/0x41E44496AfE9FE59004b9d166eFa5A31245746b5))
- [Default Emission Manager](https://goerli.etherscan.io/address/0x0e481cfeB712d37A0C6cd4e2801cA01E09Bc1A9d) ([Implementation](https://goerli.etherscan.io/address/0xe76193f2107bF7Cc9C6A0de6af63D3C74b936393))
- [Polygon Ecosystem Token](https://goerli.etherscan.io/address/0x4f34BF3352A701AEc924CE34d6CfC373eABb186c)

<details>
<summary>Inputs</summary>
<table>
<tr>
<th>Parameter</th>
<th>Value</th>
</tr>

<tr>
<td>matic</td>
<td>0x499d11E0b6eAC7c0593d8Fb292DCBbF815Fb29Ae</td>
</tr>

<tr>
<td>governance</td>
<td>0x531c7Befe78B6496e5753815ab3d3Cc024c1E842</td>
</tr>

<tr>
<td>treasury</td>
<td>0x531c7Befe78B6496e5753815ab3d3Cc024c1E842</td>
</tr>

<tr>
<td>stakeManager</td>
<td>0x00200eA4Ee292E253E6Ca07dBA5EdC07c8Aa37A3</td>
</tr>

<tr>
<td>permit2revoker</td>
<td>0x531c7Befe78B6496e5753815ab3d3Cc024c1E842</td>
</tr>
</table>
</details>

86 changes: 86 additions & 0 deletions deployments/json/5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"chainId": "5",
"latest": {
"PolygonMigration": {
"implementation": "0x41E44496AfE9FE59004b9d166eFa5A31245746b5",
"proxyAdmin": "0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2",
"address": "0x5c5589fca76237Ed00BA024e19b6C077a108f687",
"proxy": true,
"version": "1.0.0",
"proxyType": "TransparentUpgradeableProxy",
"timestamp": 1696415816,
"deploymentTxn": "0xe0786d27a0f9ae581cabfcab6edf6a0fd261f0143e4a52cbd6c383cb87c5b4a4",
"commitHash": "9af97e84fca5f31e7351cb91b85ac7dd5f40f563"
},
"DefaultEmissionManager": {
"implementation": "0xe76193f2107bF7Cc9C6A0de6af63D3C74b936393",
"proxyAdmin": "0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2",
"address": "0x0e481cfeB712d37A0C6cd4e2801cA01E09Bc1A9d",
"proxy": true,
"version": "1.0.0",
"proxyType": "TransparentUpgradeableProxy",
"timestamp": 1696415816,
"deploymentTxn": "0xff69667f86a1050432a4d07f93d6202b9141bad1d0e73da42675e1fdf9b1ce02",
"commitHash": "9af97e84fca5f31e7351cb91b85ac7dd5f40f563"
},
"ProxyAdmin": {
"address": "0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2",
"proxy": false,
"timestamp": 1696415816,
"deploymentTxn": "0xcc62464cf4ef11bb1d03a0f898eb22feb335286a5c3b546942b03d34e960213d",
"commitHash": "9af97e84fca5f31e7351cb91b85ac7dd5f40f563"
},
"PolygonEcosystemToken": {
"address": "0x4f34BF3352A701AEc924CE34d6CfC373eABb186c",
"proxy": false,
"version": "1.0.0",
"timestamp": 1696415816,
"deploymentTxn": "0x69ee54fefe2d7902a4de228f8f6b19bb3e1308013f10e47cecf07066ecd57fa1",
"commitHash": "9af97e84fca5f31e7351cb91b85ac7dd5f40f563"
}
},
"history": [
{
"contracts": {
"PolygonMigration": {
"implementation": "0x41E44496AfE9FE59004b9d166eFa5A31245746b5",
"proxyAdmin": "0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2",
"address": "0x5c5589fca76237Ed00BA024e19b6C077a108f687",
"proxy": true,
"version": "1.0.0",
"proxyType": "TransparentUpgradeableProxy",
"deploymentTxn": "0xe0786d27a0f9ae581cabfcab6edf6a0fd261f0143e4a52cbd6c383cb87c5b4a4"
},
"DefaultEmissionManager": {
"implementation": "0xe76193f2107bF7Cc9C6A0de6af63D3C74b936393",
"proxyAdmin": "0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2",
"address": "0x0e481cfeB712d37A0C6cd4e2801cA01E09Bc1A9d",
"proxy": true,
"version": "1.0.0",
"proxyType": "TransparentUpgradeableProxy",
"deploymentTxn": "0xff69667f86a1050432a4d07f93d6202b9141bad1d0e73da42675e1fdf9b1ce02"
},
"ProxyAdmin": {
"address": "0x9Ed32fDC7E4600E1F733dbCEA750C19E7830FBc2",
"proxy": false,
"deploymentTxn": "0xcc62464cf4ef11bb1d03a0f898eb22feb335286a5c3b546942b03d34e960213d"
},
"PolygonEcosystemToken": {
"address": "0x4f34BF3352A701AEc924CE34d6CfC373eABb186c",
"proxy": false,
"version": "1.0.0",
"deploymentTxn": "0x69ee54fefe2d7902a4de228f8f6b19bb3e1308013f10e47cecf07066ecd57fa1"
}
},
"input": {
"matic": "0x499d11E0b6eAC7c0593d8Fb292DCBbF815Fb29Ae",
"governance": "0x531c7Befe78B6496e5753815ab3d3Cc024c1E842",
"treasury": "0x531c7Befe78B6496e5753815ab3d3Cc024c1E842",
"stakeManager": "0x00200eA4Ee292E253E6Ca07dBA5EdC07c8Aa37A3",
"permit2revoker": "0x531c7Befe78B6496e5753815ab3d3Cc024c1E842"
},
"timestamp": 1696415816,
"commitHash": "9af97e84fca5f31e7351cb91b85ac7dd5f40f563"
}
]
}
16 changes: 8 additions & 8 deletions docs/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ A default implementation is included and this contract will be proxy upgradable

### Setup

- [Install foundry](https://book.getfoundry.sh/getting-started/installation)
- Install Dependencies: `forge install`
- Build: `forge build`
- Test: `forge test`
- [Install foundry](https://book.getfoundry.sh/getting-started/installation)
- Install Dependencies: `forge install`
- Build: `forge build`
- Test: `forge test`

### Deployment

1. Ensure .env file is set, `cp .env.example`
2. Populate Enviornment variables: `source .env`
3. We use a forge script to deploy the contracts, and have an additional extract.js script to store a JSON file with coalesced deployment information. (see [output](./output/))
3. We use a forge script to deploy the contracts, and have an additional extract.js script to store a JSON file with coalesced deployment information. (see [deployments](./deployments/))

- (mainnet): `forge script script/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --private-key $PRIVATE_KEY --etherscan-api-key $ETHERSCAN_API_KEY`
- (testnet, goerli for example): `forge script script/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --private-key $PRIVATE_KEY --verifier-url https://api-goerli.etherscan.io/api --chain-id 5`
- (mainnet): `forge script scripts/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --private-key $PRIVATE_KEY --etherscan-api-key $ETHERSCAN_API_KEY`
- (testnet, goerli for example): `forge script scripts/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --private-key $PRIVATE_KEY --verifier-url https://api-goerli.etherscan.io/api --chain-id 5`

4. Run `node script/util/extract.js <chainId>` to extract deployment information from forge broadcast output (broadcast/latest-run.json).
4. Run `node scripts/util/extract.js <chainId>` to extract deployment information from forge broadcast output (broadcast/latest-run.json).

---

Expand Down
Loading