Conversation
✅ Deploy Preview for vortex-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vortexfi ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR updates the Alfredpay offramp flow to support ERC-20 tokens that do not implement EIP-2612 permit by introducing a “no-permit fallback” path, and adjusts logging/UX timing around related service calls and progress phases.
Changes:
- Add new ramp phases +
additionalDatafields to carry user-submitted tx hashes for no-permit approve/swap/transfer flows. - Implement permit-support probing in the EVM→Alfredpay offramp route and generate fallback user-wallet transactions when
permitisn’t available. - Update backend phase execution to accept/verify user-submitted tx hashes for the fallback path; reduce external API request logs from
infotodebug; slow Alfredpay polling interval.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/shared/src/services/brla/brlaApiService.ts | Reduce BRLA outbound request logging level to debug. |
| packages/shared/src/services/alfredpay/alfredpayApiService.ts | Reduce Alfredpay outbound request logging level to debug. |
| packages/shared/src/endpoints/ramp.endpoints.ts | Extend RampPhase and UpdateRampRequest.additionalData with no-permit fallback phases/hashes. |
| apps/frontend/src/pages/progress/phaseMessages.ts | Add progress messaging mappings for the new no-permit phases. |
| apps/frontend/src/pages/progress/index.tsx | Add estimated durations for the new no-permit phases. |
| apps/frontend/src/machines/actors/sign.actor.ts | Capture and report no-permit tx hashes back to the API via additionalData. |
| apps/api/src/api/services/transactions/validation.ts | Skip presigned-tx validation for the new user-wallet no-permit phases. |
| apps/api/src/api/services/transactions/offramp/routes/evm-to-alfredpay.ts | Probe permit support; generate fallback transactions (transfer or approve+swap) when unsupported; set metadata flags. |
| apps/api/src/api/services/phases/meta-state-types.ts | Add metadata fields for no-permit fallback flag + hash storage. |
| apps/api/src/api/services/phases/handlers/squidrouter-permit-execution-handler.ts | Add execution branch that waits for user-submitted hashes (no-permit fallback) before proceeding. |
| apps/api/src/api/services/phases/handlers/alfredpay-offramp-transfer-handler.ts | Increase Alfredpay status poll interval from 5s to 30s. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Probe EIP-2612 support: tokens that don't implement nonces() (e.g. USDT on Base) revert here. | ||
| let userNonce: bigint | null = null; | ||
| try { | ||
| userNonce = (await publicClient.readContract({ | ||
| abi: erc20Abi, | ||
| address: inputTokenAddress, | ||
| args: [userAddress], | ||
| functionName: "nonces" | ||
| })) as bigint; | ||
| } catch { | ||
| userNonce = null; | ||
| } | ||
| const supportsPermit = userNonce !== null; |
| private async waitForUserHash( | ||
| state: RampState, | ||
| hash: `0x${string}` | undefined, | ||
| fromNetwork: EvmNetworks, | ||
| label: string | ||
| ): Promise<void> { | ||
| if (!hash) { | ||
| throw this.createRecoverableError(`${label} hash not yet reported by frontend`); | ||
| } | ||
| const { publicClient } = this.getExecutorClients(fromNetwork); | ||
| const receipt = await publicClient.waitForTransactionReceipt({ hash }); | ||
| if (!receipt || receipt.status !== "success") { | ||
| throw this.createRecoverableError(`${label} tx failed: ${hash}`); | ||
| } | ||
| logger.info(`${label} tx confirmed: ${hash}`); | ||
| } |
|
@copilot apply changes based on the comments in this thread |
|
@ebma I can’t apply these changes because the pull request’s branch is the repository’s default branch, which I’m not allowed to push to directly. You can ask me to create a new pull request with the requested changes instead and I'll open a separate PR on a new branch. |
|
@copilot please apply the requested changes for this thread in a new pull request against this branch. |
…r, fix phase messages
Address review feedback on no-permit fallback implementation
No description provided.