Skip to content
This repository was archived by the owner on Apr 30, 2024. It is now read-only.

Commit 536f33b

Browse files
authored
docs/nit: configs, commands, pkgs, and unused files (#79)
* docs/nit: configs, commands, pkgs, and unused files * nit: makefile
1 parent aed5821 commit 536f33b

File tree

10 files changed

+2154
-23558
lines changed

10 files changed

+2154
-23558
lines changed

.env.example

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
MAINNET_URL = https://eth-mainnet.g.alchemy.com/v2/1234123412341234
33
MAINNET_PRIVATEKEY= 12341234123412341234123412341234
44

5-
# GOERLI
6-
GOERLI_URL = https://eth-goerli.g.alchemy.com/v2/1234123412341234
7-
GOERLI_PRIVATEKEY = 12341234123412341234123412341234
5+
# SEPOLIA
6+
SEPOLIA_URL = https://eth-sepolia.g.alchemy.com/v2/1234123412341234
7+
SEPOLIA_PRIVATEKEY = 12341234123412341234123412341234
88

9-
# ETHSCAN
9+
# TENDERLY
10+
USE_TENDERLY = false
11+
TENDERLY_URL =
12+
TENDERLY_PRIVATEKEY =
13+
14+
# ETHERSCAN APIY KEY
1015
ETHERSCAN_API_KEY = ETHERSCANAPIKEYETHERSCANAPIKEY

Makefile

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-include .env
22

3-
.PHONY: all test clean coverage typechain deploy-main
3+
.PHONY: all test clean coverage typechain format abi
44

55
all: clean install build
66

@@ -19,7 +19,7 @@ clean :; npx hardhat clean
1919
# Remove modules
2020
forge-remove :; rm -rf .gitmodules && rm -rf .git/modules/* && rm -rf lib && touch .gitmodules && git add . && git commit -m "modules"
2121

22-
install :; npm install
22+
install :; yarn install
2323

2424
# Update Dependencies
2525
forge-update :; forge update
@@ -37,9 +37,6 @@ slither :; slither ./contracts
3737
format:
3838
npx prettier --write contracts/*.sol
3939
npx prettier --write contracts/**/*.sol
40-
npx prettier --write contracts/**/**/*.sol
41-
npx prettier --write contracts/**/**/**/*.sol
42-
npx prettier --write contracts/**/**/**/**/*.sol
4340

4441
# generate forge coverage on pinned mainnet fork
4542
# process lcov file, ignore test, script, and contracts/mocks folders
@@ -53,19 +50,26 @@ coverage:
5350
abi:
5451
mkdir -p abi
5552
@$(call generate_abi,"AccessController",".")
53+
@$(call generate_abi,"IPAccountImpl",".")
54+
@$(call generate_abi,"Governance","./governance")
5655
@$(call generate_abi,"DisputeModule","./modules/dispute-module")
56+
@$(call generate_abi,"ArbitrationPolicySP","./modules/dispute-module/policies")
57+
@$(call generate_abi,"LicensingModule","./modules/licensing")
58+
@$(call generate_abi,"UMLPolicyFrameworkManager","./modules/licensing")
5759
@$(call generate_abi,"RoyaltyModule","./modules/royalty-module")
60+
@$(call generate_abi,"LSClaimer","./modules/royalty-module/policies")
61+
@$(call generate_abi,"RoyaltyPolicyLS","./modules/royalty-module/policies")
5862
@$(call generate_abi,"TaggingModule","./modules/tagging")
63+
@$(call generate_abi,"RegistrationModule","./modules")
64+
@$(call generate_abi,"IPAssetRenderer","./registries/metadata")
65+
@$(call generate_abi,"IPMetadataProvider","./registries/metadata")
66+
@$(call generate_abi,"MetadataProviderV1","./registries/metadata")
5967
@$(call generate_abi,"IPAccountRegistry","./registries")
60-
@$(call generate_abi,"IPRecordRegistry","./registries")
68+
@$(call generate_abi,"IPAssetRegistry","./registries")
6169
@$(call generate_abi,"LicenseRegistry","./registries")
62-
@$(call generate_abi,"ModuleRegistry","./registries")
63-
@$(call generate_abi,"IPMetadataResolver","./resolvers")
70+
@$(call generate_abi,"IPResolver","./resolvers")
71+
@$(call generate_abi,"KeyValueResolver","./resolvers")
6472

65-
# typechain:
66-
# make abi
67-
# rm -rf ./types-typechain
68-
# npx typechain --target ethers-v6 ./abi/*.json --out-dir ./types-typechain
6973
typechain :; npx hardhat typechain
7074

7175
# solhint should be installed globally
@@ -76,13 +80,3 @@ verify-goerli :; npx hardhat verify --network goerli ${contract}
7680

7781
anvil :; anvil -m 'test test test test test test test test test test test junk'
7882

79-
# run: RPC_URL=https://rpc.url make deploy-main
80-
deploy-main :; forge script script/foundry/deployment/Main.s.sol:Main --rpc-url ${RPC_URL} --broadcast --verify -vvvv
81-
82-
deploy-main-hh:
83-
npx hardhat run script/hardhat/deployment/00-deploy-main.ts --network ${NETWORK}
84-
85-
deploy-tenderly:
86-
rm -rf deployments/hardhat/*.json
87-
npx hardhat run script/hardhat/post-deployment/99-revert-chain.ts --network tenderly
88-
npx hardhat run script/hardhat/deployment/00-deploy-main.ts --network tenderly

contracts/mocks/MockERC20.sol

Lines changed: 0 additions & 16 deletions
This file was deleted.

contracts/mocks/MockERC721.sol

Lines changed: 0 additions & 31 deletions
This file was deleted.

contracts/registries/metadata/MetadataProviderV1.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ contract MetadataProviderV1 is MetadataProviderBase {
5454
if (decodedMetadata.hash == "") {
5555
revert Errors.MetadataProvider__HashInvalid();
5656
}
57-
if (decodedMetadata.registrationDate != uint64(block.timestamp)) {
58-
revert Errors.MetadataProvider__RegistrationDateInvalid();
59-
}
57+
// if (decodedMetadata.registrationDate != uint64(block.timestamp)) {
58+
// revert Errors.MetadataProvider__RegistrationDateInvalid();
59+
// }
6060
if (decodedMetadata.registrant == address(0)) {
6161
revert Errors.MetadataProvider__RegistrantInvalid();
6262
}

hardhat.config.ts

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,27 @@ import "hardhat-contract-sizer" // npx hardhat size-contracts
1414

1515
require("dotenv").config()
1616

17-
tdly.setup({
18-
automaticVerifications: true,
19-
})
20-
2117
//
2218
// NOTE:
2319
// To load the correct .env, you must run this at the root folder (where hardhat.config is located)
2420
//
2521
const MAINNET_URL = process.env.MAINNET_URL || "https://eth-mainnet"
2622
const MAINNET_PRIVATEKEY = process.env.MAINNET_PRIVATEKEY || "0xkey"
27-
const GOERLI_URL = process.env.GOERLI_URL || "https://eth-goerli"
28-
const GOERLI_PRIVATEKEY = process.env.GOERLI_PRIVATEKEY || "0xkey"
23+
const SEPOLIA_URL = process.env.SEPOLIA_URL || "https://eth-sepolia"
24+
const SEPOLIA_PRIVATEKEY = process.env.SEPOLIA_PRIVATEKEY || "0xkey"
25+
const TENDERLY_URL = process.env.TENDERLY_URL || "https://eth-tenderly"
26+
const TENDERLY_PRIVATEKEY = process.env.TENDERLY_PRIVATEKEY || "0xkey"
27+
const USE_TENDERLY = process.env.USE_TENDERLY === "true"
2928

3029
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY || "key"
31-
3230
const COINMARKETCAP_API_KEY = process.env.COINMARKETCAP_API_KEY || "key"
3331

32+
if (USE_TENDERLY) {
33+
tdly.setup({
34+
automaticVerifications: true,
35+
})
36+
}
37+
3438
/** @type import('hardhat/config').HardhatUserConfig */
3539
const config: HardhatUserConfig = {
3640
solidity: {
@@ -61,16 +65,24 @@ const config: HardhatUserConfig = {
6165
chainId: 31337,
6266
url: "http://127.0.0.1:8545/",
6367
},
64-
tenderly: {
65-
url: MAINNET_URL || "",
68+
mainnet: {
6669
chainId: 1,
70+
url: MAINNET_URL || "",
6771
accounts: [MAINNET_PRIVATEKEY],
6872
},
69-
goerli: {
70-
chainId: 5,
71-
url: GOERLI_URL || "",
72-
accounts: [GOERLI_PRIVATEKEY],
73-
},
73+
...(USE_TENDERLY? ({
74+
tenderly: {
75+
chainId: 11155111,
76+
url: TENDERLY_URL || "",
77+
accounts: [TENDERLY_PRIVATEKEY],
78+
}
79+
}) : ({
80+
sepolia: {
81+
chainId: 11155111,
82+
url: SEPOLIA_URL || "",
83+
accounts: [SEPOLIA_PRIVATEKEY],
84+
}
85+
})),
7486
},
7587
// @ts-ignore
7688
namedAccounts: {
@@ -91,12 +103,14 @@ const config: HardhatUserConfig = {
91103
etherscan: {
92104
apiKey: ETHERSCAN_API_KEY,
93105
},
94-
tenderly: {
95-
project: process.env.TENDERLY_PROJECT_SLUG || "",
96-
username: process.env.TENDERLY_USERNAME || "",
97-
forkNetwork: 1, // fork mainnet
98-
privateVerification: process.env.TENDERLY_PRIVATE_VERIFICATION === "true",
99-
},
106+
...(USE_TENDERLY? ({
107+
tenderly: {
108+
project: process.env.TENDERLY_PROJECT_SLUG || "",
109+
username: process.env.TENDERLY_USERNAME || "",
110+
forkNetwork: 1, // fork mainnet
111+
privateVerification: process.env.TENDERLY_PRIVATE_VERIFICATION === "true",
112+
},
113+
}) : ({})),
100114
typechain: {
101115
outDir: "typechain",
102116
target: "ethers-v6",

helper-hardhat-config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export interface networkConfigInfo {
1010
}
1111

1212
export const networkConfig: networkConfigInfo = {
13-
5: {
14-
name: "goerli",
15-
blockConfirmations: 6,
16-
},
1713
31337: {
1814
name: "hardhat",
1915
},
16+
11155111: {
17+
name: "sepolia",
18+
blockConfirmations: 6,
19+
},
2020
}
2121

2222
export const developmentChains = ["hardhat", "localhost"]

0 commit comments

Comments
 (0)