From 7ad1c773731511f9f7e7d51a47d9f27b7878a161 Mon Sep 17 00:00:00 2001 From: Jongwon Park Date: Wed, 10 Apr 2024 14:36:21 -0500 Subject: [PATCH] Clean minor configs (#50) * fix: makefile * nit: foundry.toml * fix: mappings --- Makefile | 35 ++++++++++++++++------------------- foundry.toml | 5 +---- remappings.txt | 11 +++-------- slither.config.json | 7 +++---- 4 files changed, 23 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index 896a835e..20114d0b 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ all: clean install build define generate_abi $(eval $@_CONTRACT_NAME = $(1)) $(eval $@_CONTRACT_PATH = $(2)) - forge inspect --optimize --optimizer-runs 2000 contracts/${$@_CONTRACT_PATH}/${$@_CONTRACT_NAME}.sol:${$@_CONTRACT_NAME} abi > abi/${$@_CONTRACT_NAME}.json + forge inspect --optimize --optimizer-runs 20000 contracts/${$@_CONTRACT_PATH}/${$@_CONTRACT_NAME}.sol:${$@_CONTRACT_NAME} abi > abi/${$@_CONTRACT_NAME}.json endef # Clean the repo @@ -43,37 +43,34 @@ format: # generate html report from lcov.info (ignore "line ... has branchcov but no linecov data" error) coverage: mkdir -p coverage - forge coverage --report lcov --fork-url https://rpc.ankr.com/eth_sepolia --fork-block-number 5196000 + forge coverage --report lcov lcov --remove lcov.info -o coverage/lcov.info 'test/*' 'script/*' --rc branch_coverage=1 genhtml coverage/lcov.info -o coverage --rc branch_coverage=1 --ignore-errors category abi: + rm -rf abi mkdir -p abi - @$(call generate_abi,"AccessController",".") @$(call generate_abi,"IPAccountImpl",".") + @$(call generate_abi,"LicenseToken",".") + @$(call generate_abi,"AccessController","./access") @$(call generate_abi,"Governance","./governance") - @$(call generate_abi,"DisputeModule","./modules/dispute-module") - @$(call generate_abi,"ArbitrationPolicySP","./modules/dispute-module/policies") + @$(call generate_abi,"DisputeModule","./modules/dispute") + @$(call generate_abi,"ArbitrationPolicySP","./modules/dispute/policies") + @$(call generate_abi,"TokenWithdrawalModule","./modules/external") @$(call generate_abi,"LicensingModule","./modules/licensing") - @$(call generate_abi,"PILPolicyFrameworkManager","./modules/licensing") - @$(call generate_abi,"RoyaltyModule","./modules/royalty-module") - @$(call generate_abi,"LSClaimer","./modules/royalty-module/policies") - @$(call generate_abi,"RoyaltyPolicyLS","./modules/royalty-module/policies") - @$(call generate_abi,"IPAssetRenderer","./registries/metadata") - @$(call generate_abi,"IPMetadataProvider","./registries/metadata") - @$(call generate_abi,"MetadataProviderV1","./registries/metadata") - @$(call generate_abi,"IPAccountRegistry","./registries") + @$(call generate_abi,"PILicenseTemplate","./modules/licensing") + @$(call generate_abi,"CoreMetadataModule","./modules/metadata") + @$(call generate_abi,"CoreMetadataViewModule","./modules/metadata") + @$(call generate_abi,"RoyaltyModule","./modules/royalty") + @$(call generate_abi,"IpRoyaltyVault","./modules/royalty/policies") + @$(call generate_abi,"RoyaltyPolicyLAP","./modules/royalty/policies") @$(call generate_abi,"IPAssetRegistry","./registries") @$(call generate_abi,"LicenseRegistry","./registries") - @$(call generate_abi,"IPResolver","./resolvers") - @$(call generate_abi,"KeyValueResolver","./resolvers") + @$(call generate_abi,"ModuleRegistry","./registries") typechain :; npx hardhat typechain # solhint should be installed globally -lint :; npx solhint contracts/**/*.sol && npx solhint contracts/*.sol - -deploy-goerli :; npx hardhat run ./script/deploy-reveal-engine.js --network goerli -verify-goerli :; npx hardhat verify --network goerli ${contract} +lint :; npx solhint contracts/**/*.sol anvil :; anvil -m 'test test test test test test test test test test test junk' diff --git a/foundry.toml b/foundry.toml index 0d7147cd..867b3435 100644 --- a/foundry.toml +++ b/foundry.toml @@ -13,10 +13,7 @@ build_info = true extra_output = ["storageLayout"] [rpc_endpoints] -# Comment out for local development (testing requires 0xSplit forks — will add Mock soon) -# pin fork by using --fork-block-number 19042069 to reduce wait time -mainnet = "https://rpc.ankr.com/eth" +mainnet = "${MAINNET_RPC_URL}" sepolia = "${SEPOLIA_RPC_URL}" - # See more config options https://github.com/foundry-rs/foundry/tree/master/config \ No newline at end of file diff --git a/remappings.txt b/remappings.txt index f4f34a83..5ad64b5e 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,9 +1,4 @@ -@ethereum-waffle/=node_modules/@ethereum-waffle/ -@openzeppelin/=node_modules/@openzeppelin/ -@openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades -forge-std/=node_modules/forge-std/src/ ds-test/=node_modules/ds-test/src/ -base64-sol/=node_modules/base64-sol/ -eth-gas-reporter/=node_modules/eth-gas-reporter/ -hardhat-deploy/=node_modules/hardhat-deploy/ -hardhat/=node_modules/hardhat/ +forge-std/=node_modules/forge-std/src/ +@openzeppelin/=node_modules/@openzeppelin/ +@openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades \ No newline at end of file diff --git a/slither.config.json b/slither.config.json index a7466781..4d8e59c9 100644 --- a/slither.config.json +++ b/slither.config.json @@ -1,10 +1,9 @@ { "filter_paths": "lib", "solc_remaps": [ - "ds-test/=lib/ds-test/src/", - "forge-std/=lib/forge-std/src/", - "@chainlink/=node_modules/@chainlink/", + "ds-test/=node_modules/ds-test/src/", + "forge-std/=node_modules/forge-std/src/", "@openzeppelin/=node_modules/@openzeppelin/", - "base64-sol/=node_modules/base64-sol/" + "@openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades" ] } \ No newline at end of file