Skip to content

Commit

Permalink
Clean minor configs (storyprotocol#50)
Browse files Browse the repository at this point in the history
* fix: makefile

* nit: foundry.toml

* fix: mappings
  • Loading branch information
jdubpark authored Apr 10, 2024
1 parent 66a6a6a commit 7ad1c77
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 35 deletions.
35 changes: 16 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
5 changes: 1 addition & 4 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 3 additions & 8 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -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
7 changes: 3 additions & 4 deletions slither.config.json
Original file line number Diff line number Diff line change
@@ -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"
]
}

0 comments on commit 7ad1c77

Please sign in to comment.