Commit 9aa8049c authored by smartcontracts's avatar smartcontracts Committed by GitHub

feat(ctp): deploy NFT bridge to Kovan (#2791)

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: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent f23bae0b
---
'@eth-optimism/contracts-periphery': patch
---
Deploy NFT bridge contracts
---
'@eth-optimism/contracts-bedrock': patch
---
Have contracts-bedrock properly include contract sources in npm package
import { ethers } from 'ethers' import { ethers } from 'ethers'
import { HardhatUserConfig, task, subtask } from 'hardhat/config' import { HardhatUserConfig, task, subtask } from 'hardhat/config'
import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from 'hardhat/builtin-tasks/task-names' import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from 'hardhat/builtin-tasks/task-names'
// Hardhat plugins
import '@nomiclabs/hardhat-waffle' import '@nomiclabs/hardhat-waffle'
import '@typechain/hardhat' import '@typechain/hardhat'
import 'solidity-coverage' import 'solidity-coverage'
...@@ -8,6 +10,7 @@ import 'hardhat-deploy' ...@@ -8,6 +10,7 @@ import 'hardhat-deploy'
import '@foundry-rs/hardhat-forge' import '@foundry-rs/hardhat-forge'
import '@eth-optimism/hardhat-deploy-config' import '@eth-optimism/hardhat-deploy-config'
// Hardhat tasks
import './tasks/deposits' import './tasks/deposits'
subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction( subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
"dist/**/*.d.ts", "dist/**/*.d.ts",
"dist/types/*.ts", "dist/types/*.ts",
"artifacts/src/**/*.json", "artifacts/src/**/*.json",
"deployments/**/*.json" "deployments/**/*.json",
"contracts/**/*.sol"
], ],
"scripts": { "scripts": {
"build:forge": "forge build", "build:forge": "forge build",
...@@ -33,26 +34,25 @@ ...@@ -33,26 +34,25 @@
"@eth-optimism/core-utils": "^0.8.7", "@eth-optimism/core-utils": "^0.8.7",
"@openzeppelin/contracts": "^4.5.0", "@openzeppelin/contracts": "^4.5.0",
"@openzeppelin/contracts-upgradeable": "^4.5.2", "@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", "@rari-capital/solmate": "https://github.com/rari-capital/solmate.git#8f9b23f8838670afda0fd8983f2c41e8037ae6bc",
"ds-test": "https://github.com/dapphub/ds-test.git#9310e879db8ba3ea6d5c6489a579118fd264a3f5", "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", "forge-std": "https://github.com/foundry-rs/forge-std.git#564510058ab3db01577b772c275e081e678373f2",
"hardhat": "^2.9.6",
"merkle-patricia-tree": "^4.2.4", "merkle-patricia-tree": "^4.2.4",
"rlp": "^2.2.7" "rlp": "^2.2.7"
}, },
"devDependencies": { "devDependencies": {
"@foundry-rs/hardhat-forge": "^0.1.7",
"command-exists": "1.2.9",
"@eth-optimism/hardhat-deploy-config": "^0.2.0", "@eth-optimism/hardhat-deploy-config": "^0.2.0",
"@foundry-rs/hardhat-forge": "^0.1.7",
"@nomiclabs/hardhat-ethers": "^2.0.0", "@nomiclabs/hardhat-ethers": "^2.0.0",
"@nomiclabs/hardhat-etherscan": "^2.1.3",
"@nomiclabs/hardhat-waffle": "^2.0.0", "@nomiclabs/hardhat-waffle": "^2.0.0",
"@typechain/ethers-v5": "^7.0.1", "@typechain/ethers-v5": "^7.0.1",
"@typechain/hardhat": "^2.3.0", "@typechain/hardhat": "^2.3.0",
"@typescript-eslint/eslint-plugin": "^5.26.0", "@typescript-eslint/eslint-plugin": "^5.26.0",
"@typescript-eslint/parser": "^4.29.1", "@typescript-eslint/parser": "^4.29.1",
"chai": "^4.2.0", "chai": "^4.2.0",
"command-exists": "1.2.9",
"dotenv": "^16.0.0", "dotenv": "^16.0.0",
"ethereum-waffle": "^3.0.0", "ethereum-waffle": "^3.0.0",
"ethers": "^5.6.8", "ethers": "^5.6.8",
......
ignores: [ ignores: [
"@eth-optimism/contracts-bedrock",
"@openzeppelin/contracts", "@openzeppelin/contracts",
"@openzeppelin/contracts-upgradeable", "@openzeppelin/contracts-upgradeable",
"@rari-capital/solmate", "@rari-capital/solmate",
......
// 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 {
}
...@@ -38,7 +38,7 @@ contract OptimismMintableERC721Factory is OwnableUpgradeable { ...@@ -38,7 +38,7 @@ contract OptimismMintableERC721Factory is OwnableUpgradeable {
* @param _bridge Address of the ERC721 bridge on this network. * @param _bridge Address of the ERC721 bridge on this network.
*/ */
constructor(address _bridge) { constructor(address _bridge) {
intialize(_bridge); initialize(_bridge);
} }
/** /**
...@@ -46,7 +46,7 @@ contract OptimismMintableERC721Factory is OwnableUpgradeable { ...@@ -46,7 +46,7 @@ contract OptimismMintableERC721Factory is OwnableUpgradeable {
* *
* @param _bridge Address of the ERC721 bridge on this network. * @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; bridge = _bridge;
// Initialize upgradable OZ contracts // Initialize upgradable OZ contracts
......
...@@ -4,15 +4,19 @@ import { DeployFunction } from 'hardhat-deploy/dist/types' ...@@ -4,15 +4,19 @@ import { DeployFunction } from 'hardhat-deploy/dist/types'
const deployFn: DeployFunction = async (hre) => { const deployFn: DeployFunction = async (hre) => {
const { deployer } = await hre.getNamedAccounts() const { deployer } = await hre.getNamedAccounts()
const { deploy } = await hre.deployments.deterministic('ProxyAdmin', { const { deploy } = await hre.deployments.deterministic(
salt: hre.ethers.utils.solidityKeccak256( 'PeripheryProxyAdmin',
['string'], {
['PeripheryProxyAdmin'] contract: 'ProxyAdmin',
), salt: hre.ethers.utils.solidityKeccak256(
from: deployer, ['string'],
args: [hre.deployConfig.ddd], ['PeripheryProxyAdmin']
log: true, ),
}) from: deployer,
args: [hre.deployConfig.ddd],
log: true,
}
)
await deploy() await deploy()
} }
......
...@@ -4,15 +4,19 @@ import { DeployFunction } from 'hardhat-deploy/dist/types' ...@@ -4,15 +4,19 @@ import { DeployFunction } from 'hardhat-deploy/dist/types'
const deployFn: DeployFunction = async (hre) => { const deployFn: DeployFunction = async (hre) => {
const { deployer } = await hre.getNamedAccounts() const { deployer } = await hre.getNamedAccounts()
const { deploy } = await hre.deployments.deterministic('Proxy', { const { deploy } = await hre.deployments.deterministic(
salt: hre.ethers.utils.solidityKeccak256( 'L1ERC721BridgeProxy',
['string'], {
['L1ERC721BridgeProxy'] contract: 'Proxy',
), salt: hre.ethers.utils.solidityKeccak256(
from: deployer, ['string'],
args: [hre.deployConfig.ddd], ['L1ERC721BridgeProxy']
log: true, ),
}) from: deployer,
args: [hre.deployConfig.ddd],
log: true,
}
)
await deploy() await deploy()
} }
......
...@@ -4,15 +4,19 @@ import { DeployFunction } from 'hardhat-deploy/dist/types' ...@@ -4,15 +4,19 @@ import { DeployFunction } from 'hardhat-deploy/dist/types'
const deployFn: DeployFunction = async (hre) => { const deployFn: DeployFunction = async (hre) => {
const { deployer } = await hre.getNamedAccounts() const { deployer } = await hre.getNamedAccounts()
const { deploy } = await hre.deployments.deterministic('Proxy', { const { deploy } = await hre.deployments.deterministic(
salt: hre.ethers.utils.solidityKeccak256( 'L2ERC721BridgeProxy',
['string'], {
['L2ERC721BridgeProxy'] contract: 'Proxy',
), salt: hre.ethers.utils.solidityKeccak256(
from: deployer, ['string'],
args: [hre.deployConfig.ddd], ['L2ERC721BridgeProxy']
log: true, ),
}) from: deployer,
args: [hre.deployConfig.ddd],
log: true,
}
)
await deploy() await deploy()
} }
......
...@@ -4,15 +4,19 @@ import { DeployFunction } from 'hardhat-deploy/dist/types' ...@@ -4,15 +4,19 @@ import { DeployFunction } from 'hardhat-deploy/dist/types'
const deployFn: DeployFunction = async (hre) => { const deployFn: DeployFunction = async (hre) => {
const { deployer } = await hre.getNamedAccounts() const { deployer } = await hre.getNamedAccounts()
const { deploy } = await hre.deployments.deterministic('Proxy', { const { deploy } = await hre.deployments.deterministic(
salt: hre.ethers.utils.solidityKeccak256( 'OptimismMintableERC721FactoryProxy',
['string'], {
['OptimismMintableERC721FactoryProxy'] contract: 'Proxy',
), salt: hre.ethers.utils.solidityKeccak256(
from: deployer, ['string'],
args: [hre.deployConfig.ddd], ['OptimismMintableERC721FactoryProxy']
log: true, ),
}) from: deployer,
args: [hre.deployConfig.ddd],
log: true,
}
)
await deploy() await deploy()
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -80,13 +80,6 @@ const config: HardhatUserConfig = { ...@@ -80,13 +80,6 @@ const config: HardhatUserConfig = {
deployConfig: './config/deploy', deployConfig: './config/deploy',
}, },
deployConfigSpec: configSpec, deployConfigSpec: configSpec,
external: {
contracts: [
{
artifacts: '../contracts-bedrock/artifacts',
},
],
},
mocha: { mocha: {
timeout: 50000, timeout: 50000,
}, },
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
"devDependencies": { "devDependencies": {
"@defi-wonderland/smock": "^2.0.7", "@defi-wonderland/smock": "^2.0.7",
"@eth-optimism/contracts": "^0.5.28", "@eth-optimism/contracts": "^0.5.28",
"@eth-optimism/contracts-bedrock": "^0.2.0",
"@eth-optimism/core-utils": "^0.8.7", "@eth-optimism/core-utils": "^0.8.7",
"@eth-optimism/hardhat-deploy-config": "^0.2.0", "@eth-optimism/hardhat-deploy-config": "^0.2.0",
"@ethersproject/hardware-wallets": "^5.6.1", "@ethersproject/hardware-wallets": "^5.6.1",
......
...@@ -2582,19 +2582,6 @@ ...@@ -2582,19 +2582,6 @@
resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.2.tgz#c472abcba0c5185aaa4ad4070146e95213c68511" resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.2.tgz#c472abcba0c5185aaa4ad4070146e95213c68511"
integrity sha512-6quxWe8wwS4X5v3Au8q1jOvXYEPkS1Fh+cME5u6AwNdnI4uERvPlVjlgRWzpnb+Rrt1l/cEqiNRH9GlsBMSDQg== integrity sha512-6quxWe8wwS4X5v3Au8q1jOvXYEPkS1Fh+cME5u6AwNdnI4uERvPlVjlgRWzpnb+Rrt1l/cEqiNRH9GlsBMSDQg==
"@nomiclabs/hardhat-etherscan@^2.1.3":
version "2.1.8"
resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-2.1.8.tgz#e206275e96962cd15e5ba9148b44388bc922d8c2"
integrity sha512-0+rj0SsZotVOcTLyDOxnOc3Gulo8upo0rsw/h+gBPcmtj91YqYJNhdARHoBxOhhE8z+5IUQPx+Dii04lXT14PA==
dependencies:
"@ethersproject/abi" "^5.1.2"
"@ethersproject/address" "^5.0.2"
cbor "^5.0.2"
debug "^4.1.1"
fs-extra "^7.0.1"
node-fetch "^2.6.0"
semver "^6.3.0"
"@nomiclabs/hardhat-etherscan@^3.0.1": "@nomiclabs/hardhat-etherscan@^3.0.1":
version "3.0.4" version "3.0.4"
resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.0.4.tgz#b12e3e226a5b73c4a66d0e6943f948bd093b2711" resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.0.4.tgz#b12e3e226a5b73c4a66d0e6943f948bd093b2711"
...@@ -12866,7 +12853,7 @@ node-environment-flags@1.0.6: ...@@ -12866,7 +12853,7 @@ node-environment-flags@1.0.6:
object.getownpropertydescriptors "^2.0.3" object.getownpropertydescriptors "^2.0.3"
semver "^5.7.0" semver "^5.7.0"
node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7: node-fetch@^2.6.1, node-fetch@^2.6.7:
version "2.6.7" version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment