## Changes ### Configuration - Added .solhint.json with recommended rules + custom config - 160 char line length (warn) - Double quotes enforcement (error) - Explicit visibility required (error) - Console statements allowed (scripts/tests need them) - Gas optimization warnings enabled - Ignores test/helpers/, lib/, out/, cache/, broadcast/ - Added foundry.toml [fmt] section - 160 char line length - 4-space tabs - Double quotes - Thousands separators for numbers - Sort imports enabled - Added .lintstagedrc.json for pre-commit auto-fix - Runs solhint --fix on .sol files - Runs forge fmt on .sol files - Added husky pre-commit hook via lint-staged ### NPM Scripts - lint:sol - run solhint - lint:sol:fix - auto-fix solhint issues - format:sol - format with forge fmt - format:sol:check - check formatting - lint / lint:fix - combined commands ### Code Changes - Added explicit visibility modifiers (internal) to constants in scripts and tests - Fixed quote style in DeployLocal.sol - All Solidity files formatted with forge fmt ## Verification - ✅ forge fmt --check passes - ✅ No solhint errors (warnings only) - ✅ forge build succeeds - ✅ forge test passes (107/107) resolves #44 Co-authored-by: johba <johba@harb.eth> Reviewed-on: https://codeberg.org/johba/harb/pulls/51
33 lines
1.4 KiB
Solidity
33 lines
1.4 KiB
Solidity
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
pragma solidity ^0.8.19;
|
|
|
|
import { Kraiken } from "../../src/Kraiken.sol";
|
|
import { Stake } from "../../src/Stake.sol";
|
|
|
|
contract BearMarketOptimizer {
|
|
/// @notice Calculate sentiment (not used, but required for interface compatibility)
|
|
function calculateSentiment(uint256, uint256) public pure returns (uint256) {
|
|
return 0; // Placeholder implementation
|
|
}
|
|
|
|
/// @notice Get sentiment (not used, but required for interface compatibility)
|
|
function getSentiment() external pure returns (uint256) {
|
|
return 0; // Placeholder implementation
|
|
}
|
|
|
|
/// @notice Returns bear market liquidity parameters
|
|
/// @return capitalInefficiency 80% - conservative
|
|
/// @return anchorShare 20% - small anchor
|
|
/// @return anchorWidth 80 - wide width
|
|
/// @return discoveryDepth 20% - shallow discovery
|
|
function getLiquidityParams() external pure returns (uint256 capitalInefficiency, uint256 anchorShare, uint24 anchorWidth, uint256 discoveryDepth) {
|
|
capitalInefficiency = 8 * 10 ** 17; // 80% - conservative
|
|
anchorShare = 2 * 10 ** 17; // 20% - small anchor
|
|
anchorWidth = 1000; // wide width
|
|
discoveryDepth = 2 * 10 ** 17; // 20% - shallow discovery
|
|
}
|
|
|
|
function getDescription() external pure returns (string memory) {
|
|
return "Bear Market (Low Risk)";
|
|
}
|
|
}
|