Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ docs/

lcov.info

.idea/
.idea/

/node_modules
18 changes: 18 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"plugins": [
"prettier-plugin-solidity"
],
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": true,
"semi": true
}
}
]
}
82 changes: 82 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"extends": "solhint:recommended",
"plugins": [],
"rules": {
"no-global-import": [
"off"
],
"code-complexity": [
"warn",
7
],
"function-max-lines": [
"off",
50
],
"max-line-length": [
"off",
120
],
"max-states-count": [
"warn",
15
],
"no-empty-blocks": "off",
"no-unused-vars": "warn",
"payable-fallback": "warn",
"reason-string": [
"warn",
{
"maxLength": 32
}
],
"constructor-syntax": "warn",
"comprehensive-interface": "off",
"avoid-call-value": "warn",
"avoid-low-level-calls": "off",
"avoid-sha3": "warn",
"avoid-suicide": "warn",
"avoid-throw": "warn",
"avoid-tx-origin": "warn",
"check-send-result": "warn",
"compiler-version": [
"warn",
"^0.8.0"
],
"imports-on-top": "warn",
"mark-callable-contracts": "off",
"multiple-sends": "warn",
"no-complex-fallback": "warn",
"no-inline-assembly": "warn",
"not-rely-on-block-hash": "warn",
"not-rely-on-time": "off",
"ordering": "warn",
"quotes": [
"warn",
"double"
],
"reentrancy": "warn",
"func-visibility": [
"warn",
{
"ignoreConstructors": true
}
],
"private-vars-leading-underscore": [
"off",
{
"strict": false
}
],
"const-name-snakecase": "warn",
"func-name-mixedcase": "off",
"use-forbidden-name": "warn",
"var-name-mixedcase": "warn",
"visibility-modifier-order": "warn",
"func-param-name-mixedcase": "off",
"modifier-name-mixedcase": "warn",
"indent": ["error", 4],
"two-lines-top-level-separator": "off",
"separate-by-one-line-in-contract": "off"
}
}
1 change: 1 addition & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
33 changes: 29 additions & 4 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,37 @@ build_vesting:
deploy_vesting_earndrop:
forge script script/VestingEarndrop/01_Deploy.s.sol:VestingEarndropScript --broadcast --verify -vvvv

.PHONY: test coverage build_vesting
.PHONY: test coverage build_vesting help format format-check lint lint-fix slither

# Set default target to help
.DEFAULT_GOAL := help

gravity_verify:
forge verify-contract --rpc-url https://rpc.gravity.xyz --verifier blockscout --verifier-url 'https://explorer-gravity-mainnet-0.t.conduit.xyz/api/' $(ADDRESS) src/VestingEarndrop/VestingEarndrop.sol:VestingEarndrop
# Glob pattern for Solidity files
SOL_FILES = 'src/**/*.sol'

help: ## Display help information
@echo "Available commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'

format: ## Format all Solidity files
@echo "Formatting Solidity files..."
@npx prettier --write $(SOL_FILES) || yarn prettier --write $(SOL_FILES)

format-check: ## Check Solidity file formatting without modifying
@echo "Checking Solidity file formatting..."
@npx prettier --check $(SOL_FILES) || yarn prettier --check $(SOL_FILES)

lint: ## Check Solidity code with Solhint
@echo "Linting Solidity files..."
@npx solhint $(SOL_FILES) || yarn solhint $(SOL_FILES)


lint-fix: ## Fix automatically fixable Solhint issues
@echo "Fixing linting issues in Solidity files..."
@npx solhint $(SOL_FILES) --fix || yarn solhint $(SOL_FILES) --fix

slither: ## Run Slither security analysis
@echo "Running Slither security analysis..."
@slither . --config-file slither.config.json

gravity_verify:
forge verify-contract --rpc-url https://rpc.gravity.xyz --verifier blockscout --verifier-url 'https://explorer-gravity-mainnet-0.t.conduit.xyz/api/' $(ADDRESS) src/VestingEarndrop/VestingEarndrop.sol:VestingEarndrop
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"devDependencies": {
"prettier": "^3.5.3",
"prettier-plugin-solidity": "^1.4.2",
"solhint": "^5.0.5"
}
}
3 changes: 3 additions & 0 deletions slither.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"detectors_to_exclude": "reentrancy-eth,reentrancy-no-eth,reentrancy-benign,reentrancy-events,reentrancy-unlimited-gas,divide-before-multiply,dead-code,too-many-digits,conformance-to-solidity-naming-conventions,timestamp,assembly,pragma,low-level-calls"
}
Loading