Skip to content

Commit

Permalink
feat: PSR deployment on zksync sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
GitGuru7 committed Jul 26, 2024
1 parent 55b693f commit 88197ea
Show file tree
Hide file tree
Showing 18 changed files with 4,750 additions and 58 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ DEPLOYER_PRIVATE_KEY=
#ARCHIVE_NODE_opbnbmainnet=https://opbnb-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
#ARCHIVE_NODE_arbitrumsepolia=https://sepolia-rollup.arbitrum.io/rpc
#ARCHIVE_NODE_arbitrumone=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/arbitrum-nitro/
#ARCHIVE_NODE_zksyncsepolia=https://zksync-sepolia.g.alchemy.com/v2/<YOUR_KEY_HERE>

ETHERSCAN_API_KEY=
REPORT_GAS=
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
**/.coverage_cache
**/.coverage_contracts
**/artifacts
**/artifacts-zk
**/build
**/cache
**/cache-zk
**/coverage
**/dist
**/node_modules
Expand Down
3 changes: 2 additions & 1 deletion .eslinttsconfigrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"jest.config.js",
"saddle.config.js",
"docgen-templates",
"commitlint.config.js"
"commitlint.config.js",
"./hardhat.config.zksync.ts"
]
}
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ jobs:
EXPORT=true yarn hardhat export --network ${NETWORK} --export ./deployments/${NETWORK}.json
jq -M '{name, chainId, addresses: .contracts | map_values(.address)}' ./deployments/${NETWORK}.json > ./deployments/${NETWORK}_addresses.json
done
for NETWORK in zksyncsepolia; do
EXPORT=true yarn hardhat export --network ${NETWORK} --export ./deployments/${NETWORK}.json --config hardhat.config.zksync.ts
jq -M '{name, chainId, addresses: .contracts | map_values(.address)}' ./deployments/${NETWORK}.json > ./deployments/${NETWORK}_addresses.json
done
yarn prettier
- uses: stefanzweifel/git-auto-commit-action@v5
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
!.yarn/sdks
!.yarn/versions
**/artifacts
**/artifacts-zk
**/build
**/cache
**/cache-zk
**/coverage
**/.coverage_artifacts
**/.coverage_cache
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
**/.coverage_cache
**/.coverage_contracts
**/artifacts
**/artifacts-zk
**/build
**/cache
**/cache-zk
**/coverage
**/dist
**/node_modules
Expand Down
12 changes: 11 additions & 1 deletion deploy/001-psr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,29 @@ const func: DeployFunction = async ({
const acmAddress = (await ethers.getContractOrNull("AccessControlManager"))?.address || ADDRESS_ONE;
const loopsLimit = 20;

const defaultProxyAdmin = await hre.artifacts.readArtifact(
"hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol:ProxyAdmin",
);

await deploy("ProtocolShareReserve", {
from: deployer,
log: true,
deterministicDeployment: false,
args: [comptrollerAddress, WBNBAddress, vBNBAddress],
skipIfAlreadyDeployed: true,
proxy: {
owner: live ? timelockAddress : deployer,
proxyContract: "OpenZeppelinTransparentProxy",
proxyContract: "OptimizedTransparentUpgradeableProxy",
execute: {
methodName: "initialize",
args: [acmAddress, loopsLimit],
},
viaAdminContract: {
name: "DefaultProxyAdmin",
artifact: defaultProxyAdmin,
},
},
// maxFeePerGas: "200000000" // Needed for zksync
});

const psr = await hre.ethers.getContract("ProtocolShareReserve");
Expand Down
1 change: 1 addition & 0 deletions deployments/zksyncsepolia/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
300
257 changes: 257 additions & 0 deletions deployments/zksyncsepolia/DefaultProxyAdmin.json

Large diffs are not rendered by default.

Loading

0 comments on commit 88197ea

Please sign in to comment.