Skip to content

Commit

Permalink
deploy to zksync
Browse files Browse the repository at this point in the history
  • Loading branch information
ezynda3 committed Aug 30, 2023
1 parent 73610ce commit ce0ce8f
Show file tree
Hide file tree
Showing 7 changed files with 953 additions and 8 deletions.
8 changes: 4 additions & 4 deletions deploy/012_deploy_across_facet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export default func
func.id = 'deploy_across_facet'
func.tags = ['DeployAcrossFacet']
func.dependencies = [
// 'InitialFacets',
// diamondContractName,
// 'InitFacets',
// 'DeployDexManagerFacet',
'InitialFacets',
diamondContractName,
'InitFacets',
'DeployDexManagerFacet',
]
43 changes: 43 additions & 0 deletions deploy/013_deploy_generic_swap_facet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types'
import { DeployFunction } from 'hardhat-deploy/types'
import { ethers, network } from 'hardhat'
import { addOrReplaceFacets } from '../utils/diamond'
import {
diamondContractName,
updateDeploymentLogs,
verifyContract,
} from './9999_utils'

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
// Protect against unwanted redeployments
if (network.name !== 'zksync' && network.name !== 'zksyncGoerli') {
return
}

const { deployments, getNamedAccounts } = hre
const { deploy } = deployments
const { deployer } = await getNamedAccounts()

const deployedFacet = await deploy('GenericSwapFacet', {
from: deployer,
log: true,
skipIfAlreadyDeployed: true,
})

const swapFacet = await ethers.getContract('GenericSwapFacet')
const diamond = await ethers.getContract(diamondContractName)

await addOrReplaceFacets([swapFacet], diamond.address)

const isVerified = await verifyContract(hre, 'GenericSwapFacet', {
address: swapFacet.address,
})

await updateDeploymentLogs('GenericSwapFacet', deployedFacet, isVerified)
}

export default func

func.id = 'deploy_generic_swap_facet'
func.tags = ['DeployGenericSwapFacet']
func.dependencies = ['InitialFacets', diamondContractName, 'InitFacets']
15 changes: 14 additions & 1 deletion deployments/_deployments_log_file.json
Original file line number Diff line number Diff line change
Expand Up @@ -4975,6 +4975,19 @@
}
]
}
},
"zksync": {
"production": {
"1.0.0": [
{
"ADDRESS": "0x587B5B33D935F06a41D9fb7197C36c4411D05a96",
"OPTIMIZER_RUNS": "10000",
"TIMESTAMP": "2023-08-30 14:32:33",
"CONSTRUCTOR_ARGS": "0x",
"VERIFIED": "false"
}
]
}
}
},
"HopFacetOptimized": {
Expand Down Expand Up @@ -12466,4 +12479,4 @@
}
}
}
}
}
6 changes: 5 additions & 1 deletion deployments/zksync.diamond.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
"0x7dEfADC99d3E3f5f8d0C7dCFA7D2495B898ef5D8": {
"Name": "AcrossFacet",
"Version": "2.0.0"
},
"0x587B5B33D935F06a41D9fb7197C36c4411D05a96": {
"Name": "GenericSwapFacet",
"Version": "1.0.0"
}
},
"Periphery": {
Expand All @@ -34,4 +38,4 @@
"ServiceFeeCollector": "0x682dBe3f437f040535e728454D7F7f19Ead738b3"
}
}
}
}
5 changes: 3 additions & 2 deletions deployments/zksync.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"Receiver": "0xdeDB2DAe4a9BC63910a722a3b7DC930C7E6f6421",
"FeeCollector": "0x8dBf6f59187b2EB36B980F3D8F4cFC6DC4E4642e",
"ServiceFeeCollector": "0x682dBe3f437f040535e728454D7F7f19Ead738b3",
"AcrossFacet": "0x7dEfADC99d3E3f5f8d0C7dCFA7D2495B898ef5D8"
}
"AcrossFacet": "0x7dEfADC99d3E3f5f8d0C7dCFA7D2495B898ef5D8",
"GenericSwapFacet": "0x587B5B33D935F06a41D9fb7197C36c4411D05a96"
}
Loading

0 comments on commit ce0ce8f

Please sign in to comment.