Commit 299157e7 authored by smartcontracts's avatar smartcontracts Committed by GitHub

fix(ct): improve bundle size (#3337)

Significantly improves the bundle size of the contracts package by
exporting deployments more intentionally and by removing certain
unnecessary exports.
parent f772f66c
---
'@eth-optimism/contracts': patch
---
Significantly reduces contracts package bundle size
......@@ -8,8 +8,11 @@
"dist/**/*.js",
"dist/**/*.d.ts",
"dist/types",
"artifacts/contracts/**/*.json",
"deployments/**/*.json",
"artifacts/contracts/chugsplash/**/*.json",
"artifacts/contracts/L1/**/*.json",
"artifacts/contracts/L2/**/*.json",
"artifacts/contracts/libraries/**/*.json",
"artifacts/contracts/standards/**/*.json",
"chugsplash",
"L1",
"L2",
......@@ -104,6 +107,7 @@
"prettier": "^2.3.1",
"prettier-plugin-solidity": "^1.0.0-beta.18",
"random-bytes-seed": "^1.0.3",
"rimraf": "^3.0.2",
"rlp": "^2.2.6",
"solhint": "^3.3.6",
"solhint-plugin-prettier": "^0.0.5",
......
......@@ -50,7 +50,11 @@ const main = async () => {
)
artifactNames.push(artifactName)
content += `const ${artifactName} = require('${relPath}')\n`
// eslint-disable-next-line @typescript-eslint/no-var-requires
const artifact = require(relPath)
content += `const ${artifactName} = { abi: ${JSON.stringify(
artifact.abi
)}, address: '${artifact.address}' }\n`
}
}
......
......@@ -31,7 +31,10 @@ export const getContractDefinition = (name: string): any => {
export const getDeployedContractDefinition = (
name: string,
network: string
): any => {
): {
address: string
abi: any
} => {
const {
getDeployedContractArtifact,
// eslint-disable-next-line @typescript-eslint/no-var-requires
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment