Skip to content

Commit

Permalink
feat(ctp): deploy NFT bridge to Kovan (#2791)
Browse files Browse the repository at this point in the history
Adds deployment artifacts for our Kovan deployment of the NFT bridge and
all related proxy contracts. Also includes an update to
contracts-bedrock to properly export contract sources.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
smartcontracts and mergify[bot] committed Jun 15, 2022
1 parent f23bae0 commit 9aa8049
Show file tree
Hide file tree
Showing 26 changed files with 4,146 additions and 65 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-chefs-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/contracts-periphery': patch
---

Deploy NFT bridge contracts
5 changes: 5 additions & 0 deletions .changeset/tidy-cats-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/contracts-bedrock': patch
---

Have contracts-bedrock properly include contract sources in npm package
3 changes: 3 additions & 0 deletions packages/contracts-bedrock/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { ethers } from 'ethers'
import { HardhatUserConfig, task, subtask } from 'hardhat/config'
import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from 'hardhat/builtin-tasks/task-names'

// Hardhat plugins
import '@nomiclabs/hardhat-waffle'
import '@typechain/hardhat'
import 'solidity-coverage'
import 'hardhat-deploy'
import '@foundry-rs/hardhat-forge'
import '@eth-optimism/hardhat-deploy-config'

// Hardhat tasks
import './tasks/deposits'

subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(
Expand Down
12 changes: 6 additions & 6 deletions packages/contracts-bedrock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"dist/**/*.d.ts",
"dist/types/*.ts",
"artifacts/src/**/*.json",
"deployments/**/*.json"
"deployments/**/*.json",
"contracts/**/*.sol"
],
"scripts": {
"build:forge": "forge build",
Expand All @@ -33,26 +34,25 @@
"@eth-optimism/core-utils": "^0.8.7",
"@openzeppelin/contracts": "^4.5.0",
"@openzeppelin/contracts-upgradeable": "^4.5.2",
"ethers": "^5.6.8",
"hardhat": "^2.9.6",
"@rari-capital/solmate": "https://github.com/rari-capital/solmate.git#8f9b23f8838670afda0fd8983f2c41e8037ae6bc",
"ds-test": "https://github.com/dapphub/ds-test.git#9310e879db8ba3ea6d5c6489a579118fd264a3f5",
"ethers": "^5.6.8",
"forge-std": "https://github.com/foundry-rs/forge-std.git#564510058ab3db01577b772c275e081e678373f2",
"hardhat": "^2.9.6",
"merkle-patricia-tree": "^4.2.4",
"rlp": "^2.2.7"
},
"devDependencies": {
"@foundry-rs/hardhat-forge": "^0.1.7",
"command-exists": "1.2.9",
"@eth-optimism/hardhat-deploy-config": "^0.2.0",
"@foundry-rs/hardhat-forge": "^0.1.7",
"@nomiclabs/hardhat-ethers": "^2.0.0",
"@nomiclabs/hardhat-etherscan": "^2.1.3",
"@nomiclabs/hardhat-waffle": "^2.0.0",
"@typechain/ethers-v5": "^7.0.1",
"@typechain/hardhat": "^2.3.0",
"@typescript-eslint/eslint-plugin": "^5.26.0",
"@typescript-eslint/parser": "^4.29.1",
"chai": "^4.2.0",
"command-exists": "1.2.9",
"dotenv": "^16.0.0",
"ethereum-waffle": "^3.0.0",
"ethers": "^5.6.8",
Expand Down
1 change: 1 addition & 0 deletions packages/contracts-periphery/.depcheckrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ignores: [
"@eth-optimism/contracts-bedrock",
"@openzeppelin/contracts",
"@openzeppelin/contracts-upgradeable",
"@rari-capital/solmate",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import { ProxyAdmin } from "@eth-optimism/contracts-bedrock/contracts/universal/ProxyAdmin.sol";
import { Proxy } from "@eth-optimism/contracts-bedrock/contracts/universal/Proxy.sol";

/**
* Just exists so we can compile external contracts.
*/
contract ExternalContractCompiler {

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ contract OptimismMintableERC721Factory is OwnableUpgradeable {
* @param _bridge Address of the ERC721 bridge on this network.
*/
constructor(address _bridge) {
intialize(_bridge);
initialize(_bridge);
}

/**
* @notice Initializes the factory.
*
* @param _bridge Address of the ERC721 bridge on this network.
*/
function intialize(address _bridge) public reinitializer(VERSION) {
function initialize(address _bridge) public reinitializer(VERSION) {
bridge = _bridge;

// Initialize upgradable OZ contracts
Expand Down
22 changes: 13 additions & 9 deletions packages/contracts-periphery/deploy/PeripheryProxyAdmin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ 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,
})
const { deploy } = await hre.deployments.deterministic(
'PeripheryProxyAdmin',
{
contract: 'ProxyAdmin',
salt: hre.ethers.utils.solidityKeccak256(
['string'],
['PeripheryProxyAdmin']
),
from: deployer,
args: [hre.deployConfig.ddd],
log: true,
}
)

await deploy()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ 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,
})
const { deploy } = await hre.deployments.deterministic(
'L1ERC721BridgeProxy',
{
contract: 'Proxy',
salt: hre.ethers.utils.solidityKeccak256(
['string'],
['L1ERC721BridgeProxy']
),
from: deployer,
args: [hre.deployConfig.ddd],
log: true,
}
)

await deploy()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ 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,
})
const { deploy } = await hre.deployments.deterministic(
'L2ERC721BridgeProxy',
{
contract: 'Proxy',
salt: hre.ethers.utils.solidityKeccak256(
['string'],
['L2ERC721BridgeProxy']
),
from: deployer,
args: [hre.deployConfig.ddd],
log: true,
}
)

await deploy()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ 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,
})
const { deploy } = await hre.deployments.deterministic(
'OptimismMintableERC721FactoryProxy',
{
contract: 'Proxy',
salt: hre.ethers.utils.solidityKeccak256(
['string'],
['OptimismMintableERC721FactoryProxy']
),
from: deployer,
args: [hre.deployConfig.ddd],
log: true,
}
)

await deploy()
}
Expand Down

0 comments on commit 9aa8049

Please sign in to comment.