forked from storyprotocol/protocol-core-v1
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployment Script (storyprotocol#15)
* feat: foundry deploy script w/ hardhat wip * feat: fix foundry deploy script * feat: makefile abi & typechain * feat: hardhat scripts * fix: delete ignore folder * feat: script deployments and mocks * fix: package deps * fix: ignore folders * feat: deploy & revert scripts
- Loading branch information
Showing
33 changed files
with
1,171 additions
and
83 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.23; | ||
|
||
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
contract MockERC20 is ERC20 { | ||
constructor() ERC20("MockERC20", "MERC20") {} | ||
|
||
function mint(address to, uint256 amount) external { | ||
_mint(to, amount); | ||
} | ||
|
||
function burn(address from, uint256 amount) external { | ||
_burn(from, amount); | ||
} | ||
} |
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,31 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.23; | ||
|
||
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | ||
|
||
contract MockERC721 is ERC721 { | ||
uint256 private _counter; | ||
|
||
constructor() ERC721("MockERC721", "M721") { | ||
_counter = 0; | ||
} | ||
|
||
function mint(address to) public returns (uint256 tokenId) { | ||
tokenId = ++_counter; | ||
_safeMint(to, tokenId); | ||
return tokenId; | ||
} | ||
|
||
function mintId(address to, uint256 tokenId) public returns (uint256) { | ||
_safeMint(to, tokenId); | ||
return tokenId; | ||
} | ||
|
||
function burn(uint256 tokenId) public { | ||
_burn(tokenId); | ||
} | ||
|
||
function transferFrom(address from, address to, uint256 tokenId) public override { | ||
_transfer(from, to, tokenId); | ||
} | ||
} |
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,10 @@ | ||
{ | ||
"main": { | ||
"AccessController": "0xE2307e3710d108ceC7a4722a020a050681c835b3", | ||
"ERC6551Registry": "0xD28F3246f047Efd4059B24FA1fa587eD9fa3e77F", | ||
"IPAccountImpl": "0x15F2ea83eB97ede71d84Bd04fFF29444f6b7cd52", | ||
"IPAccountRegistry": "0x519b05b3655F4b89731B677d64CEcf761f4076f6", | ||
"LicenseRegistry": "0x057cD3082EfED32d5C907801BF3628B27D88fD80", | ||
"ModuleRegistry": "0x0B32a3F8f5b7E5d315b9E52E640a49A89d89c820" | ||
} | ||
} |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import "@nomicfoundation/hardhat-foundry" | ||
import "@nomiclabs/hardhat-waffle" | ||
import "@nomiclabs/hardhat-ethers" | ||
import "@nomicfoundation/hardhat-verify" | ||
import "@tenderly/hardhat-tenderly" | ||
import * as tdly from "@tenderly/hardhat-tenderly" // also import tdly for setup, in addition to global import above | ||
import "@typechain/hardhat" | ||
// import "@openzeppelin/hardhat-upgrades" | ||
import "hardhat-gas-reporter" | ||
import "solidity-coverage" | ||
import "hardhat-deploy" | ||
import { HardhatConfig, HardhatUserConfig } from "hardhat/types" | ||
import "hardhat-contract-sizer" // npx hardhat size-contracts | ||
|
||
require("dotenv").config() | ||
|
||
tdly.setup({ | ||
automaticVerifications: true, | ||
}) | ||
|
||
// | ||
// NOTE: | ||
// To load the correct .env, you must run this at the root folder (where hardhat.config is located) | ||
// | ||
const MAINNET_URL = process.env.MAINNET_URL || "https://eth-mainnet" | ||
const MAINNET_PRIVATEKEY = process.env.MAINNET_PRIVATEKEY || "0xkey" | ||
const GOERLI_URL = process.env.GOERLI_URL || "https://eth-goerli" | ||
const GOERLI_PRIVATEKEY = process.env.GOERLI_PRIVATEKEY || "0xkey" | ||
|
||
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY || "key" | ||
|
||
const COINMARKETCAP_API_KEY = process.env.COINMARKETCAP_API_KEY || "key" | ||
|
||
/** @type import('hardhat/config').HardhatUserConfig */ | ||
const config: HardhatUserConfig = { | ||
solidity: { | ||
compilers: [ | ||
{ | ||
version: "0.8.18", | ||
}, | ||
{ | ||
version: "0.8.23", | ||
}, | ||
], | ||
settings: { | ||
optimizer: { | ||
enabled: true, | ||
runs: 2000, | ||
}, | ||
}, | ||
}, | ||
paths: { | ||
sources: "./contracts", | ||
tests: "./test", | ||
cache: "./cache", | ||
artifacts: "./artifacts", | ||
}, | ||
defaultNetwork: "tenderly", | ||
networks: { | ||
hardhat: { | ||
chainId: 31337, | ||
}, | ||
localhost: { | ||
chainId: 31337, | ||
url: "http://127.0.0.1:8545/", | ||
}, | ||
tenderly: { | ||
url: MAINNET_URL || "", | ||
chainId: 1, | ||
accounts: [MAINNET_PRIVATEKEY], | ||
}, | ||
goerli: { | ||
chainId: 5, | ||
url: GOERLI_URL || "", | ||
accounts: [GOERLI_PRIVATEKEY], | ||
}, | ||
}, | ||
// @ts-ignore | ||
namedAccounts: { | ||
deployer: { | ||
default: 0, // here this will by default take the first account as deployer | ||
}, | ||
}, | ||
gasReporter: { | ||
enabled: process.env.REPORT_GAS !== undefined, | ||
outputFile: "gas-report.txt", | ||
noColors: true, | ||
currency: "USD", | ||
coinmarketcap: COINMARKETCAP_API_KEY, | ||
}, | ||
mocha: { | ||
timeout: 20_000, | ||
}, | ||
etherscan: { | ||
apiKey: ETHERSCAN_API_KEY, | ||
}, | ||
tenderly: { | ||
project: process.env.TENDERLY_PROJECT_SLUG || "", | ||
username: process.env.TENDERLY_USERNAME || "", | ||
forkNetwork: 1, // fork mainnet | ||
privateVerification: process.env.TENDERLY_PRIVATE_VERIFICATION === "true", | ||
}, | ||
typechain: { | ||
outDir: "typechain", | ||
target: "ethers-v6", | ||
}, | ||
} | ||
|
||
export default config |
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 @@ | ||
import { ethers } from "ethers" | ||
|
||
export interface networkConfigItem { | ||
name?: string | ||
blockConfirmations?: number | ||
} | ||
|
||
export interface networkConfigInfo { | ||
[key: number]: networkConfigItem | ||
} | ||
|
||
export const networkConfig: networkConfigInfo = { | ||
5: { | ||
name: "goerli", | ||
blockConfirmations: 6, | ||
}, | ||
31337: { | ||
name: "hardhat", | ||
}, | ||
} | ||
|
||
export const developmentChains = ["hardhat", "localhost"] |
Oops, something went wrong.