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 2 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 @@ -422,9 +422,18 @@ export const handleIssueClosed = async (
assigneeComment =
`#### ${title} Reward \n### [ **[ CLAIM ${priceInEth} ${tokenSymbol.toUpperCase()} ]** ](${payoutUrl})\n` + "```" + shortenRecipient + "```";
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;
});

if (permitComments.length > 0) {
Expand Down
Loading