Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions scripts/deployOsp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,28 @@ import { deployOneStepProofEntry } from './deploymentUtils'
async function main() {
const [deployer] = await ethers.getSigners()

// Get custom DA validator address from environment variable
const customDAValidator =
process.env.CUSTOM_DA_VALIDATOR || ethers.constants.AddressZero

console.log('Deploying OneStepProofEntry with the following configuration:')
console.log('Deployer:', deployer.address)
console.log('Custom DA Validator:', customDAValidator)
console.log('Network:', (await ethers.provider.getNetwork()).name)

// Validate the custom DA validator address if provided
if (customDAValidator !== ethers.constants.AddressZero) {
// Check if the address has code deployed
const code = await ethers.provider.getCode(customDAValidator)
if (code === '0x') {
console.warn('WARNING: Custom DA validator address has no code deployed')
}
}

// Deploy OneStepProofEntry and its dependencies
const deployment = await deployOneStepProofEntry(
deployer,
customDAValidator,
process.env.DISABLE_VERIFICATION !== 'true'
)

Expand Down
5 changes: 3 additions & 2 deletions scripts/deploymentUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export async function create2(

export async function deployOneStepProofEntry(
signer: any,
customDAValidator: string,
verify: boolean = true
): Promise<{
prover0: Contract
Expand Down Expand Up @@ -198,7 +199,7 @@ export async function deployOneStepProofEntry(
const proverHostIo = await deployContract(
'OneStepProverHostIo',
signer,
[ethers.constants.AddressZero],
[customDAValidator],
verify,
true
)
Expand Down Expand Up @@ -348,7 +349,7 @@ export async function deployAllContracts(
true
)
const { prover0, proverMem, proverMath, proverHostIo, osp } =
await deployOneStepProofEntry(signer, verify)
await deployOneStepProofEntry(signer, ethers.constants.AddressZero, verify)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to pass a real value here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

factory should always have no custom da

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah makes sense

const challengeManager = await deployContract(
'EdgeChallengeManager',
signer,
Expand Down
Loading