diff --git a/packages/contracts/deployments/README.md b/packages/contracts/deployments/README.md index 85e9b2e03c92..e9ad554bd658 100644 --- a/packages/contracts/deployments/README.md +++ b/packages/contracts/deployments/README.md @@ -11,6 +11,7 @@ |Contract|Address| |--|--| |OVM_ETH: | `0x4200000000000000000000000000000000000006` +|OVM_L2StandardBridge: | `0x4200000000000000000000000000000000000010` |OVM_L2CrossDomainMessenger: | `0x4200000000000000000000000000000000000007` |OVM_L2ToL1MessagePasser: | `0x4200000000000000000000000000000000000000` |OVM_L1MessageSender: | `0x4200000000000000000000000000000000000001` diff --git a/packages/contracts/scripts/generate-markdown.js b/packages/contracts/scripts/generate-markdown.js index 16c73ca1077a..0110cfac1dc7 100644 --- a/packages/contracts/scripts/generate-markdown.js +++ b/packages/contracts/scripts/generate-markdown.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const dirtree = require("directory-tree"); -const fs = require("fs"); +const dirtree = require('directory-tree') +const fs = require('fs') /** * @@ -9,22 +9,22 @@ const fs = require("fs"); */ const networks = { - 1: "mainnet", - 3: "ropsten", - 4: "rinkeby", - 5: "goerli", - 42: "kovan", -}; + 1: 'mainnet', + 3: 'ropsten', + 4: 'rinkeby', + 5: 'goerli', + 42: 'kovan', +} -(async () => { - console.log(`Writing contract addresses`); +;(async () => { + console.log(`Writing contract addresses`) const deployments = dirtree(`./deployments`) .children.filter((child) => { - return child.type === "directory"; + return child.type === 'directory' }) .map((d) => d.name) - .reverse(); + .reverse() let md = `# Optimism Regenesis Deployments ## LAYER 2 @@ -39,6 +39,7 @@ const networks = { |Contract|Address| |--|--| |OVM_ETH: | \`0x4200000000000000000000000000000000000006\` +|OVM_L2StandardBridge: | \`0x4200000000000000000000000000000000000010\` |OVM_L2CrossDomainMessenger: | \`0x4200000000000000000000000000000000000007\` |OVM_L2ToL1MessagePasser: | \`0x4200000000000000000000000000000000000000\` |OVM_L1MessageSender: | \`0x4200000000000000000000000000000000000001\` @@ -51,62 +52,64 @@ const networks = { --- --- -## LAYER 1\n\n`; +## LAYER 1\n\n` - for (let deployment of deployments) { - md += `## ${deployment.toUpperCase()}\n\n`; + for (const deployment of deployments) { + md += `## ${deployment.toUpperCase()}\n\n` const chainId = Number( fs.readFileSync(`./deployments/${deployment}/.chainId`) - ); - const network = networks[chainId]; + ) + const network = networks[chainId] - md += `Network : __${network} (chain id: ${chainId})__\n\n`; + md += `Network : __${network} (chain id: ${chainId})__\n\n` - md += `|Contract|Address|\n`; - md += `|--|--|\n`; + md += `|Contract|Address|\n` + md += `|--|--|\n` const contracts = dirtree(`./deployments/${deployment}`) .children.filter((child) => { - return child.extension === ".json"; + return child.extension === '.json' }) .map((child) => { - return child.name.replace(".json", ""); - }); + return child.name.replace('.json', '') + }) - proxiedContracts = []; + proxiedContracts = [] for (let i = 0; i < contracts.length; i++) { - if (contracts[i] == 'OVM_L1CrossDomainMessenger') - proxiedContracts.push(contracts.splice(i, 1)[0]); - if (contracts[i] == 'OVM_L1ETHGateway') - proxiedContracts.push(contracts.splice(i, 1)[0]); + if (contracts[i] == 'OVM_L1CrossDomainMessenger') { + proxiedContracts.push(contracts.splice(i, 1)[0]) + } + if (contracts[i] == 'OVM_L1ETHGateway') { + proxiedContracts.push(contracts.splice(i, 1)[0]) + } } for (const contract of contracts) { - const colonizedName = contract.split(':').join('-'); + const colonizedName = contract.split(':').join('-') - const deploymentInfo = require(`../deployments/${deployment}/${contract}.json`); + const deploymentInfo = require(`../deployments/${deployment}/${contract}.json`) - const escPrefix = chainId !== 1 ? `${network}.` : ""; - const etherscanUrl = `https://${escPrefix}etherscan.io/address/${deploymentInfo.address}`; - md += `|${colonizedName}|[${deploymentInfo.address}](${etherscanUrl})|\n`; + const escPrefix = chainId !== 1 ? `${network}.` : '' + const etherscanUrl = `https://${escPrefix}etherscan.io/address/${deploymentInfo.address}` + md += `|${colonizedName}|[${deploymentInfo.address}](${etherscanUrl})|\n` } - md += `\n`; - md += `---\n`; + md += `-->\n` + md += `---\n` } - fs.writeFileSync(`./deployments/README.md`, md); -})().catch(console.error); + fs.writeFileSync(`./deployments/README.md`, md) +})().catch(console.error)