-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ctp): add deploy configuration for NFT bridge (#2780)
* contracts: deploy scripts * deploy-scripts: rename * wip: deploy script * feat: use deploy config plugin Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
- Loading branch information
1 parent
ff0723a
commit a320e74
Showing
21 changed files
with
185 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@eth-optimism/hardhat-deploy-config': patch | ||
--- | ||
|
||
Properly exports DeployConfigSpec type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@eth-optimism/contracts-periphery': patch | ||
--- | ||
|
||
Updates contracts-periphery to use the standardized hardhat deploy config plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { DeployConfig } from '../../src' | ||
|
||
const config: DeployConfig = { | ||
ddd: '0x9C6373dE60c2D3297b18A8f964618ac46E011B58', | ||
} | ||
|
||
export default config |
22 changes: 22 additions & 0 deletions
22
packages/contracts-periphery/deploy/PeripheryProxyAdmin.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* Imports: External */ | ||
import { DeployFunction } from 'hardhat-deploy/dist/types' | ||
|
||
const deployFn: DeployFunction = async (hre) => { | ||
const { deployer } = await hre.getNamedAccounts() | ||
|
||
const { deploy } = await hre.deployments.deterministic('ProxyAdmin', { | ||
salt: hre.ethers.utils.solidityKeccak256( | ||
['string'], | ||
['PeripheryProxyAdmin'] | ||
), | ||
from: deployer, | ||
args: [hre.deployConfig.ddd], | ||
log: true, | ||
}) | ||
|
||
await deploy() | ||
} | ||
|
||
deployFn.tags = ['PeripheryProxyAdmin'] | ||
|
||
export default deployFn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
packages/contracts-periphery/deploy/nft-bridge/L1ERC721Bridge.ts
This file was deleted.
Oops, something went wrong.
9 changes: 5 additions & 4 deletions
9
...loy/nft-bridge/L2StandardERC721Factory.ts → ...ft-bridge/L1ERC721BridgeImplementation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
/* Imports: External */ | ||
import { DeployFunction } from 'hardhat-deploy/dist/types' | ||
import { ethers } from 'hardhat' | ||
|
||
const deployFn: DeployFunction = async (hre) => { | ||
const { deployer } = await hre.getNamedAccounts() | ||
const L2ERC721Bridge = await hre.deployments.get('L2ERC721Bridge') | ||
|
||
await hre.deployments.deploy('L2StandardERC721Factory', { | ||
await hre.deployments.deploy('L1ERC721Bridge', { | ||
from: deployer, | ||
args: [L2ERC721Bridge.address], | ||
args: [ethers.constants.AddressZero, ethers.constants.AddressZero], | ||
log: true, | ||
}) | ||
} | ||
|
||
deployFn.tags = ['L2StandardERC721Factory'] | ||
deployFn.tags = ['L1ERC721BridgeImplementation'] | ||
deployFn.dependencies = ['L1ERC721BridgeProxy'] | ||
|
||
export default deployFn |
22 changes: 22 additions & 0 deletions
22
packages/contracts-periphery/deploy/nft-bridge/L1ERC721BridgeProxy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* Imports: External */ | ||
import { DeployFunction } from 'hardhat-deploy/dist/types' | ||
|
||
const deployFn: DeployFunction = async (hre) => { | ||
const { deployer } = await hre.getNamedAccounts() | ||
|
||
const { deploy } = await hre.deployments.deterministic('Proxy', { | ||
salt: hre.ethers.utils.solidityKeccak256( | ||
['string'], | ||
['L1ERC721BridgeProxy'] | ||
), | ||
from: deployer, | ||
args: [hre.deployConfig.ddd], | ||
log: true, | ||
}) | ||
|
||
await deploy() | ||
} | ||
|
||
deployFn.tags = ['L1ERC721BridgeProxy'] | ||
|
||
export default deployFn |
7 changes: 4 additions & 3 deletions
7
...phery/deploy/nft-bridge/L2ERC721Bridge.ts → ...ft-bridge/L2ERC721BridgeImplementation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
/* Imports: External */ | ||
import { DeployFunction } from 'hardhat-deploy/dist/types' | ||
import { predeploys } from '@eth-optimism/contracts' | ||
import { ethers } from 'hardhat' | ||
|
||
const deployFn: DeployFunction = async (hre) => { | ||
const { deployer } = await hre.getNamedAccounts() | ||
|
||
await hre.deployments.deploy('L2ERC721Bridge', { | ||
from: deployer, | ||
args: [predeploys.L2CrossDomainMessenger], | ||
args: [ethers.constants.AddressZero, ethers.constants.AddressZero], | ||
log: true, | ||
}) | ||
} | ||
|
||
deployFn.tags = ['L2ERC721Bridge'] | ||
deployFn.tags = ['L2ERC721BridgeImplementation'] | ||
deployFn.dependencies = ['L2ERC721BridgeProxy'] | ||
|
||
export default deployFn |
22 changes: 22 additions & 0 deletions
22
packages/contracts-periphery/deploy/nft-bridge/L2ERC721BridgeProxy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* Imports: External */ | ||
import { DeployFunction } from 'hardhat-deploy/dist/types' | ||
|
||
const deployFn: DeployFunction = async (hre) => { | ||
const { deployer } = await hre.getNamedAccounts() | ||
|
||
const { deploy } = await hre.deployments.deterministic('Proxy', { | ||
salt: hre.ethers.utils.solidityKeccak256( | ||
['string'], | ||
['L2ERC721BridgeProxy'] | ||
), | ||
from: deployer, | ||
args: [hre.deployConfig.ddd], | ||
log: true, | ||
}) | ||
|
||
await deploy() | ||
} | ||
|
||
deployFn.tags = ['L2ERC721BridgeProxy'] | ||
|
||
export default deployFn |
18 changes: 18 additions & 0 deletions
18
...ages/contracts-periphery/deploy/nft-bridge/OptimismMintableERC721FactoryImplementation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* Imports: External */ | ||
import { DeployFunction } from 'hardhat-deploy/dist/types' | ||
import { ethers } from 'hardhat' | ||
|
||
const deployFn: DeployFunction = async (hre) => { | ||
const { deployer } = await hre.getNamedAccounts() | ||
|
||
await hre.deployments.deploy('OptimismMintableERC721Factory', { | ||
from: deployer, | ||
args: [ethers.constants.AddressZero], | ||
log: true, | ||
}) | ||
} | ||
|
||
deployFn.tags = ['OptimismMintableERC721FactoryImplementation'] | ||
deployFn.dependencies = ['OptimismMintableERC721FactoryProxy'] | ||
|
||
export default deployFn |
22 changes: 22 additions & 0 deletions
22
packages/contracts-periphery/deploy/nft-bridge/OptimismMintableERC721FactoryProxy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* Imports: External */ | ||
import { DeployFunction } from 'hardhat-deploy/dist/types' | ||
|
||
const deployFn: DeployFunction = async (hre) => { | ||
const { deployer } = await hre.getNamedAccounts() | ||
|
||
const { deploy } = await hre.deployments.deterministic('Proxy', { | ||
salt: hre.ethers.utils.solidityKeccak256( | ||
['string'], | ||
['OptimismMintableERC721FactoryProxy'] | ||
), | ||
from: deployer, | ||
args: [hre.deployConfig.ddd], | ||
log: true, | ||
}) | ||
|
||
await deploy() | ||
} | ||
|
||
deployFn.tags = ['OptimismMintableERC721FactoryProxy'] | ||
|
||
export default deployFn |
45 changes: 0 additions & 45 deletions
45
packages/contracts-periphery/deploy/nft-bridge/initialize-L2ERC721Bridge.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.