Open sshivaditya2019 opened 3 weeks ago
@ubosshivaditya I want to work on this issue. How do I being? Could you provide a good starting point for this ?
Certainly! I'd be happy to help you get started on this issue. Here's a good starting point for implementing the requested changes:
First, create a draft pull request for this issue. This is important as it allows you to start working on the task and shows others that you're actively addressing it.
Review the current implementation of the daemon-disqualifier plugin. You'll need to understand how it currently tracks activity and issues warnings.
Modify the plugin to focus on pull requests instead of issue comments for follow-ups. This will involve:
Implement a configurable option to determine whether a pull request is required for a given task. This could be done through:
Update the activity tracking to only consider actions from the assigned user. This will likely involve:
Implement the automatic disqualification if a pull request isn't opened in time. This will require:
Add appropriate error handling and logging throughout these new features.
Update any relevant documentation or README files to reflect these changes.
Write tests for the new functionality to ensure it works as expected.
Here's a basic pseudocode outline to get you started:
class DaemonDisqualifier {
// ... existing code ...
async onIssueAssigned(issue: Issue) {
if (this.isPullRequestRequired(issue)) {
await this.startPullRequestCountdown(issue);
}
}
async startPullRequestCountdown(issue: Issue) {
// Set a timer for X hours
// If PR not opened within X hours, disqualify assignee
}
isPullRequestRequired(issue: Issue): boolean {
// Check issue labels or body for PR requirement
}
async checkActivity(issue: Issue) {
// Only consider activity from the assignee
const assigneeActivity = await this.getAssigneeActivity(issue);
if (!this.isActivitySufficient(assigneeActivity)) {
await this.issueWarning(issue);
}
}
async getAssigneeActivity(issue: Issue) {
// Fetch and filter activity to only include assignee's actions
}
// ... implement other necessary methods ...
}
Remember, this is just a starting point. You'll need to flesh out these methods and integrate them with the existing codebase. As you work, make sure to commit your changes regularly and update your pull request.
If you have any questions or need clarification on any part of the implementation, feel free to ask. Good luck with your work on this issue!
@ubosshivaditya Can you check the code and verify if everything is correct https://www.github.com/ubiquity/ubiquity-dollar/blob/0a230f977ad91bbfb01dd28bc1d2ea77faed5237/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol
Hi @sshivaditya2019,
I've reviewed the LibUbiquityPool.sol
file from the provided repository. Here are my observations and suggestions:
Security Considerations:
Gas Optimization:
uint256
variables into a single uint256
slot can save gas.Code Clarity and Maintainability:
Functionality Enhancements:
AccessControl
can be beneficial.Testing and Auditing:
Compliance and Standards:
Example Enhancement:
// Adding a reentrancy guard
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract LibUbiquityPool is ReentrancyGuard {
// Existing code...
function addLiquidity(uint256 amount) external nonReentrant {
// Function logic...
}
// Existing code...
}
Implementing the ReentrancyGuard
from OpenZeppelin ensures that the addLiquidity
function is protected against reentrancy attacks.
Overall, the contract structure looks solid, but addressing the points above will enhance its security, efficiency, and maintainability. Let me know if you need further assistance or specific clarifications on any part of the code!
Follow up should be on pull request so that they don't reply under issue and get paid for it. If there isn't a pull request open in time for the warning, automatically disqualify them (they should open a draft pull as soon as they self assign) Must be configurable since some tasks are not coding related. If pull isn't required then follow up under issue as we do now. "activity which should be considered is only the one from the assignees themselves. I believe currently any activity from anyone is considered in the events."
Orginally Posted in Link