Skip to content

Commit

Permalink
feat(deploy): add zk deployment config (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
thongxuan authored Jul 4, 2024
1 parent 5dbefa9 commit 65fd0da
Show file tree
Hide file tree
Showing 11 changed files with 1,337 additions and 60 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ artifacts
cache
deployments/development
node_modules
cache-zk
artifacts-zk
.deploy
8 changes: 8 additions & 0 deletions deploy/zk-link-nova/AccessRegistry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { deployZkFunction } from '../../services/AccessRegistry';

export default deployZkFunction([
{ role: 'TRUSTED_CLAIMER_ROLE', account: '0xB25D3d684EAB618B51eE8A3127FBacA6224DaFA9', grant: true },
{ role: 'TRUSTED_OPERATOR_ROLE', account: '0xB25D3d684EAB618B51eE8A3127FBacA6224DaFA9', grant: true },
{ role: 'PAYMENT_ADMIN_ROLE', account: '0xB25D3d684EAB618B51eE8A3127FBacA6224DaFA9', grant: true },
]);

7 changes: 7 additions & 0 deletions deploy/zk-link-nova/Introspection.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { DeployFunction } from 'hardhat-deploy/types';

const deployFunction: DeployFunction = async function ({ deployer }) {
await deployer.deploy('Introspection');
};

export default deployFunction;
8 changes: 8 additions & 0 deletions deploy/zk-sepolia/AccessRegistry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { deployZkFunction } from '../../services/AccessRegistry';

export default deployZkFunction([
{ role: 'TRUSTED_CLAIMER_ROLE', account: '0xB25D3d684EAB618B51eE8A3127FBacA6224DaFA9', grant: true },
{ role: 'TRUSTED_OPERATOR_ROLE', account: '0xB25D3d684EAB618B51eE8A3127FBacA6224DaFA9', grant: true },
{ role: 'PAYMENT_ADMIN_ROLE', account: '0xE88616aB140F29f310E98DD720bcEC8be5D5AC5C', grant: true },
]);

7 changes: 7 additions & 0 deletions deploy/zk-sepolia/Introspection.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { DeployFunction } from 'hardhat-deploy/types';

const deployFunction: DeployFunction = async function ({ deployer }) {
await deployer.deploy('Introspection');
};

export default deployFunction;
26 changes: 26 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import '@nomicfoundation/hardhat-toolbox-viem';
import '@nomicfoundation/hardhat-chai-matchers';
import '@openzeppelin/hardhat-upgrades';
import '@matterlabs/hardhat-zksync-solc';
import '@matterlabs/hardhat-zksync-deploy';
import '@matterlabs/hardhat-zksync-upgradable';
import 'hardhat-deploy';
import { HardhatUserConfig } from 'hardhat/config';
import * as dotenv from 'dotenv';
Expand Down Expand Up @@ -218,6 +221,29 @@ const config: HardhatUserConfig = {
accounts,
deploy: ['deploy/__all__', 'deploy/zero'],
},
'zk-sepolia': {
url: process.env.NETWORK_ZK_SEPOLIA_URL || 'https://sepolia.era.zksync.dev',
chainId: 300,
zksync: true,
ethNetwork: "goerli",
accounts,
deploy: ['deploy/zk-sepolia'],
},
'zk-link-nova': {
url: process.env.NETWORK_ZK_LINK_NOVA_URL || 'https://rpc.zklink.io',
chainId: 810180,
zksync: true,
ethNetwork: "mainnet",
accounts,
deploy: ['deploy/zk-link-nova'],
}
},
zksolc: {
version: 'latest',
compilerSource: 'binary',
settings: {
contractsToCompile: ['Introspection', 'AccessRegistry', 'PaymentConfigRegistry', 'LemonadeRelayPayment'],
}
},
solidity: {
compilers: [
Expand Down
Loading

0 comments on commit 65fd0da

Please sign in to comment.