datahaven/contracts/script/utils
Ahmad Kaouk 4a16de1061
fix: resolve forge build warnings (#398)
## Summary

### Configuration
- Remove deprecated `deny_warnings` config key from foundry.toml
- Add global `[lint]` config to suppress naming convention warnings for
AVS/EL/ERC patterns (`mixed-case-function`, `mixed-case-variable`)

### DataHavenServiceManager Refactoring
- Rename immutable variables to SCREAMING_SNAKE_CASE
(`_allocationManager` → `_ALLOCATION_MANAGER`, `_rewardsCoordinator` →
`_REWARDS_COORDINATOR`)
- Wrap modifier logic in internal functions (`_checkRewardsInitiator`,
`_checkValidator`, `_checkAllocationManager`) to reduce contract size
- Add `_toAddress` helper with assembly for safe bytes-to-address
conversion

### Safe Typecasting
- Replace direct typecasts with OpenZeppelin's SafeCast library in
deploy scripts and test utilities
- Use `.toUint32()`, `.toUint64()`, `.toUint160()` for
overflow-protected conversions
- Replace `bytes32("wrong origin")` string cast with hex literal in test
deployer

### Code Cleanup
- Remove 25+ unused imports across script and test files
- Convert plain imports to named imports for better clarity
- Use `SafeERC20.safeTransfer()` for token transfers in tests
- Change `view` to `pure` where appropriate

## Test plan

- [x] `forge build` completes with no warnings
- [x] `forge test` passes all 10 tests
2026-01-22 09:48:27 -03:00
..
Accounts.sol Fix: 🏗️ Message encoding / decoding (#113) 2025-07-16 07:38:58 +00:00
DHScriptStorage.s.sol refactor: cleanup old rewards model (#383) 2026-01-09 15:25:49 +01:00
ELScriptStorage.s.sol fix: resolve forge build warnings (#398) 2026-01-22 09:48:27 -03:00
Logging.sol fix: Resolve Foundry build errors and apply code formatting (#241) 2025-10-20 11:20:59 +03:00
SnowbridgeScriptStorage.s.sol feat: Add script to sign up operator to AVS (#37) 2025-04-11 20:54:20 -03:00
ValidatorsUtils.sol refactor: remove duplicate code for calculating merkle root and proof (#124) 2025-07-28 18:34:28 +02:00