專案簡介
The target of this audit is the private code repository of DeFiCard Contracts of bitgetwallet. The DeFiCard Contracts project introduces an on-chain payment card infrastructure that connects card-based payment workflows with ERC20 token settlement and optional DeFi protocol actions. Its core business logic covers authorisation, settlement, and refund flows, allowing payment amounts to be escrowed, released to settlement recipients, cancelled back to users, or refunded through designated refund callers. The architecture is built around DeFiCard Router, an entry contract that routes calls through enabled core implementations such as DeFiCardCoreV1 via fallback delegatecall. Each card is backed by a dedicated DeFiCardSettlement contract, and a handler integrates with DeFi protocols so payment flows can optionally use DeFi actions.
Please refer to the report for the detailed audit scope.
Our audit methodology employs automated vulnerability scans, manual verification, and business logic analysis to uncover potential security issues coupled with gas and code quality optimization recommendations.
In summary, we did not find any critical issues within the audited codebase. However, we have identified some non-critical issues that should be addressed. Additionally, we have put forth recommendations and notes that should be taken into consideration. It is important to note that the scope of our audit was strictly limited to the specific code versions mentioned in the report. Any updates made subsequent to our review would require a re-evaluation.
關鍵發現
我們在該智能合約中共發現 4 個潛在問題,另有 8 條建議與 11 條說明,明細如下:
| ID | Severity | Description | Status |
|---|---|---|---|
| 1 | Low | Lack of input token validation for Morpho withdrawals | Fixed |
| 2 | Low | Stale spent amount in function getAccountDailyLimitByCard() |
Fixed |
| 3 | Low | Lack of delay restriction on function cancelOperation() |
Confirmed |
| 4 | Low | Inconsistent timelock enforcement for selector risk level changes | Confirmed |
| 5 | - | Align maxBorrow calculation with Morpho’s health check implementation |
Confirmed |
| 6 | - | Add validation for settlement configuration | Fixed |
| 7 | - | Adopt accurate variable naming | Confirmed |
| 8 | - | Add validation during action execution | Fixed |
| 9 | - | Support share-based withdrawal in the Morpho handler | Confirmed |
| 10 | - | Add allowance revocation logic | Confirmed |
| 11 | - | Align interface and event with implementation | Fixed |
| 12 | - | Add validations on action execution results | Confirmed |
| 13 | - | Potential centralization risks | - |
| 14 | - | Proxy deployment and implementation binding should be atomic | - |
| 15 | - | Assumptions on external protocols | - |
| 16 | - | Authorize the handler before specific Morpho operations | - |
| 17 | - | Trusted off-chain logic | - |
| 18 | - | Assumptions on whitelisted handlers | - |
| 19 | - | Ensure order resolution during settlement replacement | - |
| 20 | - | Storage layout consistency across core versions | - |
| 21 | - | Refund mechanism relies on off-chain logic | - |
| 22 | - | Weird ERC20 tokens | - |
| 23 | - | Cancel stale operations | - |
更多細節見審計報告。