Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Parse Permit Url #828

Open
wants to merge 8 commits into
base: development
Choose a base branch
from
Open
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
15 changes: 12 additions & 3 deletions src/handlers/payout/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,18 @@ export const handleIssueClosed = async (
// ASSIGNEE REWARD HANDLER
if (assigneeReward && assigneeReward.reward && assigneeReward.reward[0].account !== "0x") {
const permitComments = incentivesCalculation.comments.filter((content) => {
const permitUrlMatches = content.body.match(incentivesCalculation.claimUrlRegex);
if (!permitUrlMatches || permitUrlMatches.length < 2) return false;
else return true;
if (content.body.includes("https://pay.ubq.fi") && content.user.type == UserType.Bot) {
const urlPattern = /(https?|ftp):\/\/[^\s/$.?#].[^\s]*\b/g;
const extractedUrls = content.body.match(urlPattern);
if(extractedUrls) {
for(const extractedUrl of extractedUrls) {
const url = new URL(extractedUrl);
return url.searchParams.has("claim");
}
}
// Check if the URL contains the specific query parameter
}
return false;
});

rewardByUser.push({
Expand Down
Loading