-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor: remove unused event, legacy getter, optimize vote query #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,12 +73,8 @@ contract DEVoterEscrow is ReentrancyGuard, Ownable, Pausable, AccessControl { | |
uint256 releaseTime, | ||
bool wasForced | ||
); | ||
event VoteCast( | ||
address indexed user, | ||
uint256 indexed repositoryId, | ||
uint256 amount, | ||
uint256 timestamp | ||
); | ||
// Removed unused VoteCast event. Only VoteCasted is used for voting actions. | ||
// Rationale: Only one event is needed for vote actions to avoid confusion and redundancy. | ||
event FeeParametersUpdated( | ||
uint256 newFeePercentage, | ||
address indexed newFeeCollector, | ||
|
@@ -379,7 +375,7 @@ contract DEVoterEscrow is ReentrancyGuard, Ownable, Pausable, AccessControl { | |
|
||
emit FeeBasisPointsUpdated(oldFeeBasisPoints, newFeeBasisPoints); | ||
emit FeeParametersUpdated( | ||
(newFeeBasisPoints * 100) / BASIS_POINTS_DENOMINATOR, | ||
newFeeBasisPoints, // Now emits raw basis points for clarity instead of percentage | ||
feeWallet, | ||
msg.sender | ||
); | ||
|
@@ -397,7 +393,7 @@ contract DEVoterEscrow is ReentrancyGuard, Ownable, Pausable, AccessControl { | |
|
||
emit FeeWalletUpdated(oldFeeWallet, newFeeWallet); | ||
emit FeeParametersUpdated( | ||
(feeBasisPoints * 100) / BASIS_POINTS_DENOMINATOR, | ||
feeBasisPoints, // Now emits raw basis points for clarity instead of percentage | ||
newFeeWallet, | ||
msg.sender | ||
); | ||
|
@@ -691,10 +687,8 @@ contract DEVoterEscrow is ReentrancyGuard, Ownable, Pausable, AccessControl { | |
return feeWallet; | ||
} | ||
|
||
function getFeePercentage() external view returns (uint256) { | ||
// Convert basis points to percentage for backward compatibility | ||
return (feeBasisPoints * 100) / BASIS_POINTS_DENOMINATOR; | ||
} | ||
// Removed legacy getFeePercentage getter for clarity. Use getFeeInfo for raw basis points. | ||
// Rationale: getFeeInfo provides all fee details in basis points, which is the standard for smart contracts. | ||
Comment on lines
+690
to
+691
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainGetter removal looks good; check for external/internal usages Removing getFeePercentage is fine; getFeeInfo is the right replacement. Please verify nothing still calls the old getter. 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Find any lingering references to the removed getter
rg -nP '\bgetFeePercentage\s*\(' -S || echo "OK: no references found" Length of output: 283 Fix remaining getFeePercentage usages in tests and docs
🤖 Prompt for AI Agents
|
||
|
||
function getTokenAddress() external view returns (address) { | ||
return address(token); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Event parameter now represents basis points; rename for correctness
FeeParametersUpdated’s first param is named newFeePercentage but you now emit raw basis points. Rename the parameter to avoid operational confusion for indexers and dashboards. Signature stays identical (uint256,address,address), so ABI compatibility is preserved.
No change needed at emit sites beyond optionally removing the inline percentage-to-bps comments.
Also applies to: 396-399
🤖 Prompt for AI Agents