-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat: add auto transfer mode #235
base: development
Are you sure you want to change the base?
Conversation
if (!canGeneratePermits) { | ||
this.context.logger.error("[PermitGenerationModule] Non collaborative issue detected, skipping."); | ||
return Promise.resolve(result); | ||
} | ||
|
||
const sumPayouts = await this._sumPayouts(result); | ||
const fundingWalletBalance = await getFundingWalletBalance(this._evmNetworkId, this._erc20RewardToken, this._fudningWalletAddress); |
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.
const fundingWalletBalance = await getFundingWalletBalance(this._evmNetworkId, this._erc20RewardToken, this._fudningWalletAddress); | |
const fundingWalletBalance = await getFundingWalletBalance(this._evmNetworkId, this._erc20RewardToken, this._fundingWalletAddress); |
const fundingWalletBalance = await getFundingWalletBalance(this._evmNetworkId, this._erc20RewardToken, this._fudningWalletAddress); | ||
|
||
if (this._autoTransferMode && sumPayouts < fundingWalletBalance) { | ||
this.context.logger.debug("[PermitGenerationModule] AutoTransforMode is enabled and there are enough funds, skipping."); |
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.
this.context.logger.debug("[PermitGenerationModule] AutoTransforMode is enabled and there are enough funds, skipping."); | |
this.context.logger.debug("[PermitGenerationModule] AutoTransferMode is enabled and there are enough funds, skipping."); |
@gentlementlegen There should be formatting checks with linter and cspell |
@0x4007 Yes they seems to happen? The following run failed: https://github.com/ubiquity-os-marketplace/text-conversation-rewards/actions/runs/12629551075/job/35187679129?pr=235 |
@hhio618 I saw you marked it as |
@gentlementlegen I'll definitely keep that in mind for the future! For now, this task is ready for review. |
await this._savePermitsToDatabase(result[key].userId, { issueUrl: payload.issueUrl, issueId }, permits); | ||
} catch (e) { | ||
this.context.logger.error(`[PermitGenerationModule] Failed to generate permits for user ${key}`, { e }); | ||
result[key].explorerUrl = `https://gnosisscan.io/tx/${tx.hash}`; |
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.
Given that we can use any network and any ERC20 address, wouldn't this be a problem?
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.
Certainly! I addressed this by using the following:
import { getNetworkExplorer, NetworkId } from "@ubiquity-dao/rpc-handler";
@hhio618 If you can please fix the tests:
|
@gentlementlegen I'm on it! I'll update the PR once the tests are fixed. |
Resolves #226