solidity-argus 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +37 -0
- package/LICENSE +21 -0
- package/README.md +249 -0
- package/package.json +43 -0
- package/skills/INVENTORY.md +79 -0
- package/skills/README.md +56 -0
- package/skills/checklists/cyfrin-best-practices-runtime/SKILL.md +424 -0
- package/skills/checklists/cyfrin-best-practices-upgrades/SKILL.md +157 -0
- package/skills/checklists/cyfrin-defi-core/SKILL.md +373 -0
- package/skills/checklists/cyfrin-defi-integrations/SKILL.md +412 -0
- package/skills/checklists/cyfrin-gas/SKILL.md +55 -0
- package/skills/checklists/general-audit/SKILL.md +433 -0
- package/skills/methodology/audit-workflow/SKILL.md +129 -0
- package/skills/methodology/report-template/SKILL.md +190 -0
- package/skills/methodology/severity-classification/SKILL.md +179 -0
- package/skills/protocol-patterns/amm-dex/SKILL.md +229 -0
- package/skills/protocol-patterns/bridges-cross-chain/SKILL.md +317 -0
- package/skills/protocol-patterns/dao-governance/SKILL.md +281 -0
- package/skills/protocol-patterns/lending-borrowing/SKILL.md +221 -0
- package/skills/protocol-patterns/staking-vesting/SKILL.md +247 -0
- package/skills/references/exploit-reference/SKILL.md +259 -0
- package/skills/references/smartbugs-examples/SKILL.md +296 -0
- package/skills/vulnerability-patterns/access-control/SKILL.md +298 -0
- package/skills/vulnerability-patterns/arbitrary-storage-location/SKILL.md +59 -0
- package/skills/vulnerability-patterns/assert-violation/SKILL.md +59 -0
- package/skills/vulnerability-patterns/asserting-contract-from-code-size/SKILL.md +61 -0
- package/skills/vulnerability-patterns/authorization-txorigin/SKILL.md +55 -0
- package/skills/vulnerability-patterns/default-visibility/SKILL.md +62 -0
- package/skills/vulnerability-patterns/delegatecall-untrusted-callee/SKILL.md +60 -0
- package/skills/vulnerability-patterns/dos-gas-limit/SKILL.md +59 -0
- package/skills/vulnerability-patterns/dos-revert/SKILL.md +72 -0
- package/skills/vulnerability-patterns/flash-loan-attacks/SKILL.md +249 -0
- package/skills/vulnerability-patterns/floating-pragma/SKILL.md +51 -0
- package/skills/vulnerability-patterns/hash-collision/SKILL.md +52 -0
- package/skills/vulnerability-patterns/inadherence-to-standards/SKILL.md +61 -0
- package/skills/vulnerability-patterns/incorrect-constructor/SKILL.md +60 -0
- package/skills/vulnerability-patterns/incorrect-inheritance-order/SKILL.md +59 -0
- package/skills/vulnerability-patterns/insufficient-gas-griefing/SKILL.md +61 -0
- package/skills/vulnerability-patterns/lack-of-precision/SKILL.md +61 -0
- package/skills/vulnerability-patterns/logic-errors/SKILL.md +333 -0
- package/skills/vulnerability-patterns/missing-protection-signature-replay/SKILL.md +60 -0
- package/skills/vulnerability-patterns/msgvalue-loop/SKILL.md +66 -0
- package/skills/vulnerability-patterns/off-by-one/SKILL.md +67 -0
- package/skills/vulnerability-patterns/oracle-manipulation/SKILL.md +252 -0
- package/skills/vulnerability-patterns/outdated-compiler-version/SKILL.md +65 -0
- package/skills/vulnerability-patterns/overflow-underflow/SKILL.md +61 -0
- package/skills/vulnerability-patterns/reentrancy/SKILL.md +266 -0
- package/skills/vulnerability-patterns/shadowing-state-variables/SKILL.md +72 -0
- package/skills/vulnerability-patterns/signature-malleability/SKILL.md +59 -0
- package/skills/vulnerability-patterns/unbounded-return-data/SKILL.md +63 -0
- package/skills/vulnerability-patterns/unchecked-return-values/SKILL.md +52 -0
- package/skills/vulnerability-patterns/unencrypted-private-data-on-chain/SKILL.md +65 -0
- package/skills/vulnerability-patterns/unexpected-ecrecover-null-address/SKILL.md +61 -0
- package/skills/vulnerability-patterns/uninitialized-storage-pointer/SKILL.md +63 -0
- package/skills/vulnerability-patterns/unsafe-low-level-call/SKILL.md +56 -0
- package/skills/vulnerability-patterns/unsecure-signatures/SKILL.md +80 -0
- package/skills/vulnerability-patterns/unsupported-opcodes/SKILL.md +69 -0
- package/skills/vulnerability-patterns/unused-variables/SKILL.md +70 -0
- package/skills/vulnerability-patterns/use-of-deprecated-functions/SKILL.md +81 -0
- package/skills/vulnerability-patterns/weak-sources-randomness/SKILL.md +77 -0
- package/skills/vulnerability-patterns/weird-tokens/SKILL.md +294 -0
- package/src/agents/argus-prompt.ts +407 -0
- package/src/agents/pythia-prompt.ts +134 -0
- package/src/agents/scribe-prompt.ts +87 -0
- package/src/agents/sentinel-prompt.ts +133 -0
- package/src/cli/cli-program.ts +67 -0
- package/src/cli/commands/doctor.ts +83 -0
- package/src/cli/commands/init.ts +46 -0
- package/src/cli/commands/install.ts +55 -0
- package/src/cli/index.ts +13 -0
- package/src/cli/tui-prompts.ts +75 -0
- package/src/cli/types.ts +9 -0
- package/src/config/index.ts +3 -0
- package/src/config/loader.ts +36 -0
- package/src/config/schema.ts +82 -0
- package/src/config/types.ts +4 -0
- package/src/constants/defaults.ts +6 -0
- package/src/create-hooks.ts +84 -0
- package/src/create-managers.ts +26 -0
- package/src/create-tools.ts +30 -0
- package/src/features/audit-enforcer/audit-enforcer.ts +34 -0
- package/src/features/audit-enforcer/index.ts +1 -0
- package/src/features/background-agent/background-manager.ts +200 -0
- package/src/features/background-agent/index.ts +1 -0
- package/src/features/context-monitor/context-monitor.ts +48 -0
- package/src/features/context-monitor/index.ts +4 -0
- package/src/features/context-monitor/tool-output-truncator.ts +17 -0
- package/src/features/error-recovery/index.ts +2 -0
- package/src/features/error-recovery/session-recovery.ts +27 -0
- package/src/features/error-recovery/tool-error-recovery.ts +35 -0
- package/src/features/index.ts +5 -0
- package/src/features/persistent-state/audit-state-manager.ts +121 -0
- package/src/features/persistent-state/index.ts +1 -0
- package/src/hooks/compaction-hook.ts +50 -0
- package/src/hooks/config-handler.ts +116 -0
- package/src/hooks/event-hook-v2.ts +93 -0
- package/src/hooks/event-hook.ts +74 -0
- package/src/hooks/hook-system.ts +9 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/knowledge-sync-hook.ts +57 -0
- package/src/hooks/safe-create-hook.ts +15 -0
- package/src/hooks/system-prompt-hook.ts +126 -0
- package/src/hooks/tool-tracking-hook.ts +234 -0
- package/src/hooks/types.ts +16 -0
- package/src/index.ts +36 -0
- package/src/knowledge/scvd-client.ts +242 -0
- package/src/knowledge/scvd-index.ts +183 -0
- package/src/knowledge/scvd-sync.ts +85 -0
- package/src/managers/index.ts +1 -0
- package/src/managers/types.ts +85 -0
- package/src/plugin-interface.ts +38 -0
- package/src/shared/binary-utils.ts +63 -0
- package/src/shared/deep-merge.ts +71 -0
- package/src/shared/file-utils.ts +56 -0
- package/src/shared/index.ts +5 -0
- package/src/shared/jsonc-parser.ts +39 -0
- package/src/shared/logger.ts +36 -0
- package/src/state/audit-state.ts +27 -0
- package/src/state/finding-store.ts +126 -0
- package/src/state/plugin-state.ts +14 -0
- package/src/state/types.ts +61 -0
- package/src/tools/contract-analyzer-tool.ts +184 -0
- package/src/tools/forge-fuzz-tool.ts +311 -0
- package/src/tools/forge-test-tool.ts +397 -0
- package/src/tools/pattern-checker-tool.ts +337 -0
- package/src/tools/report-generator-tool.ts +308 -0
- package/src/tools/slither-tool.ts +465 -0
- package/src/tools/solodit-search-tool.ts +131 -0
- package/src/tools/sync-knowledge-tool.ts +116 -0
- package/src/utils/project-detector.ts +133 -0
- package/src/utils/solidity-parser.ts +174 -0
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cyfrin-defi-integrations
|
|
3
|
+
description: Cyfrin DeFi checklist covering integrations, token standards, and ecosystem-specific risks
|
|
4
|
+
---
|
|
5
|
+
<!-- Source: Cyfrin/audit-checklist -->
|
|
6
|
+
<!-- Auto-generated from https://github.com/Cyfrin/audit-checklist -->
|
|
7
|
+
|
|
8
|
+
# Cyfrin Audit Checklist — DeFi Security (Integrations & Tokens)
|
|
9
|
+
|
|
10
|
+
### Integrations > AAVE / Compound
|
|
11
|
+
|
|
12
|
+
- [ ] **[SOL-Integrations-AC-1]** Does the protocol use cETH token?
|
|
13
|
+
- The absence of the `underlying()` function in the cETH token contract can cause integration issues.
|
|
14
|
+
- **Remediation:** Double check the protocol works as expected when integrating cETH token.
|
|
15
|
+
|
|
16
|
+
- [ ] **[SOL-Integrations-AC-2]** What happens if the utilization rate is too high, and collateral cannot be retrieved?
|
|
17
|
+
- A high utilization rate can potentially mean that there aren't enough assets in the pool to allow users to withdraw their collateral.
|
|
18
|
+
- **Remediation:** Ensure that there are mechanisms to handle user withdrawal when the utilization rate is high.
|
|
19
|
+
|
|
20
|
+
- [ ] **[SOL-Integrations-AC-3]** What happens if the protocol is paused?
|
|
21
|
+
- If the AAVE protocol is paused, the protocol can not interact with it.
|
|
22
|
+
- **Remediation:** Ensure the protocol behaves as expected when the AAVE protocol is paused.
|
|
23
|
+
|
|
24
|
+
- [ ] **[SOL-Integrations-AC-4]** What happens if the pool becomes deprecated?
|
|
25
|
+
- Pools can be deprecated.
|
|
26
|
+
- **Remediation:** Ensure the protocol behaves as expected when the Pools are paused.
|
|
27
|
+
|
|
28
|
+
- [ ] **[SOL-Integrations-AC-5]** What happens if assets you lend/borrow are within the same eMode category?
|
|
29
|
+
- Lending and borrowing assets within the same eMode category might have rules or limitations.
|
|
30
|
+
- **Remediation:** Ensure the protocol behaves as expected when interacting with assets in the same eMode category.
|
|
31
|
+
|
|
32
|
+
- [ ] **[SOL-Integrations-AC-6]** Do flash loans on Aave inflate the pool index?
|
|
33
|
+
- Flash loans can influence the pool index (a maximum of 180 flashloans can be performed within a block).
|
|
34
|
+
- **Remediation:** Implement mechanisms to manage the effects of flash loans on the pool index.
|
|
35
|
+
|
|
36
|
+
- [ ] **[SOL-Integrations-AC-7]** Does the protocol properly implement AAVE/COMP reward claims?
|
|
37
|
+
- Misimplementation of reward claims can lead to users not receiving their correct rewards.
|
|
38
|
+
- **Remediation:** Ensure a proper and tested implementation of AAVE/COMP reward claims.
|
|
39
|
+
|
|
40
|
+
- [ ] **[SOL-Integrations-AC-8]** On AAVE, what happens if a user reaches the maximum debt on an isolated asset?
|
|
41
|
+
- Reaching the maximum debt on an isolated asset can result in denial-of-service or other limitations on user actions.
|
|
42
|
+
- **Remediation:** Ensure that the protocol works as expected when a user reaches the maximum debt.
|
|
43
|
+
|
|
44
|
+
- [ ] **[SOL-Integrations-AC-9]** Does borrowing an AAVE siloed asset restrict borrowing other assets?
|
|
45
|
+
- Borrowing a siloed asset on Aave will prohibit users from borrowing other assets.
|
|
46
|
+
- **Remediation:** Make use of `getSiloedBorrowing(address asset)` to prevent unexpected problems.
|
|
47
|
+
- **References:**
|
|
48
|
+
- https://docs.aave.com/developers/whats-new/siloed-borrowing
|
|
49
|
+
|
|
50
|
+
### Integrations > Balancer
|
|
51
|
+
|
|
52
|
+
- [ ] **[SOL-Integrations-Balancer-1]** Does the protocol use the Balancer's flashloan?
|
|
53
|
+
- Balancer vault does not charge any fees for flash loans at the moment. However, it is possible Balancer implements fees for flash loans in the future.
|
|
54
|
+
- **Remediation:** Ensure the protocol repays the fee together with the original debt on repayment in the `receiveFlashLoan` function.
|
|
55
|
+
- **References:**
|
|
56
|
+
- https://solodit.xyz/issues/receiveflashloan-does-not-account-for-fees-trailofbits-none-lindy-labs-sandclock-pdf
|
|
57
|
+
|
|
58
|
+
- [ ] **[SOL-Integrations-Balancer-2]** Does the protocol use Balancer's Oracle? (getTimeWeightedAverage)
|
|
59
|
+
- The price will only be updated whenever a transaction (e.g. swap) within the Balancer pool is triggered. Due to the lack of updates, the price provided by Balancer Oracle will not reflect the true value of the assets.
|
|
60
|
+
- **Remediation:** Do not use the Balancer's oracle for any pricing.
|
|
61
|
+
- **References:**
|
|
62
|
+
- https://solodit.xyz/issues/m-13-rely-on-balancer-oracle-which-is-not-updated-frequently-sherlock-notional-notional-git
|
|
63
|
+
|
|
64
|
+
- [ ] **[SOL-Integrations-Balancer-3]** Does the protocol use Balancer's Boosted Pool?
|
|
65
|
+
- Balancer's Boosted Pool uses Phantom BPT where all pool tokens are minted at the time of pool creation and are held by the pool itself. Therefore, virtualSupply should be used instead of totalSupply to determine the amount of BPT supply in circulation.
|
|
66
|
+
- **Remediation:** Ensure the protocol uses the correct function to get the total BPT supply in circulation.
|
|
67
|
+
- **References:**
|
|
68
|
+
- https://solodit.xyz/issues/h-7-totalbptsupply-will-be-excessively-inflated-sherlock-notional-notional-update-git
|
|
69
|
+
|
|
70
|
+
- [ ] **[SOL-Integrations-Balancer-4]** Does the protocol use Balancer vault pool liquidity status for any pricing?
|
|
71
|
+
- Balancer vault does not charge any fees for flash loans at the moment. However, it is possible Balancer implements fees for flash loans in the future.
|
|
72
|
+
- **Remediation:** Balancer pools are susceptible to manipulation of their external queries, and all integrations must now take an extra step of precaution when consuming data. Via readonly reentrancy, an attacker can force token balances and BPT supply to be out of sync, creating very inaccurate BPT prices.
|
|
73
|
+
- **References:**
|
|
74
|
+
- https://solodit.xyz/issues/h-13-balancerpairoracle-can-be-manipulated-using-read-only-reentrancy-sherlock-none-blueberry-update-git
|
|
75
|
+
|
|
76
|
+
### Integrations > Chainlink > CCIP
|
|
77
|
+
|
|
78
|
+
- [ ] **[SOL-Integrations-Chainlink-CCIP-1]** Does the receiver contract's `_ccipReceive` function properly validate the `sourceChainSelector` and `sender` address against an allowlist?
|
|
79
|
+
- Receiver contracts might process messages from unintended source chains or senders if they don't validate the origin.
|
|
80
|
+
- **Remediation:** Implement checks within `_ccipReceive` to verify the `any2EvmMessage.sourceChainSelector` and decoded `any2EvmMessage.sender` against administratively controlled allowlists.
|
|
81
|
+
|
|
82
|
+
- [ ] **[SOL-Integrations-Chainlink-CCIP-2]** Does the sender contract validate the `destinationChainSelector` against an allowlist before calling `ccipSend`?
|
|
83
|
+
- Sender contracts might accidentally send messages and tokens to unintended or unsupported destination chains.
|
|
84
|
+
- **Remediation:** Implement checks in the sending function to ensure the `destinationChainSelector` corresponds to an explicitly allowlisted chain.
|
|
85
|
+
|
|
86
|
+
- [ ] **[SOL-Integrations-Chainlink-CCIP-3]** Does the receiver contract properly decode data (`any2EvmMessage.data`) ?
|
|
87
|
+
- The encoding on the source chain and decoding on the destination chain must maintain precise structural consistency.
|
|
88
|
+
- **Remediation:** Standardize both contracts to use identical ABI encoding/decoding patterns with explicit type declarations and thorough parameter validation to ensure cross-chain message integrity.
|
|
89
|
+
|
|
90
|
+
- [ ] **[SOL-Integrations-Chainlink-CCIP-4]** Does the application logic account for the potential latency introduced by waiting for source chain finality as defined by CCIP?
|
|
91
|
+
- Applications assuming immediate cross-chain execution might behave unexpectedly due to varying finality times across blockchains which CCIP respects.
|
|
92
|
+
- **Remediation:** Design application logic to be aware of and tolerant to CCIP execution latencies, which depend on the source chain's finality mechanism (finality tag or block depth).
|
|
93
|
+
- **References:**
|
|
94
|
+
- https://docs.chain.link/ccip/concepts/ccip-execution-latency#finality-by-blockchain
|
|
95
|
+
|
|
96
|
+
- [ ] **[SOL-Integrations-Chainlink-CCIP-5]** Are the correct types of token pools (e.g., `BurnMintTokenPool`, `LockReleaseTokenPool`) deployed on the source and destination chains consistent with the desired token handling mechanism?
|
|
97
|
+
- Deploying mismatched pool types (e.g., expecting Lock & Mint but deploying Burn & Mint on the destination) will lead to failed transfers or incorrect token handling.
|
|
98
|
+
- **Remediation:** Verify that the deployed token pool contracts on each chain match the intended cross-chain mechanism (Burn & Mint requires BurnMint pools; Lock & Mint requires LockRelease on source, BurnMint on destination, etc.).
|
|
99
|
+
- **References:**
|
|
100
|
+
- https://docs.chain.link/ccip/concepts/cross-chain-tokens#token-handling-mechanisms-and-token-pool-deployment
|
|
101
|
+
|
|
102
|
+
- [ ] **[SOL-Integrations-Chainlink-CCIP-6]** Is proper router address verification implemented in the ccipReceive method?
|
|
103
|
+
- Without proper router validation, any address can spoof messages, potentially compromising contract security and asset integrity.
|
|
104
|
+
- **Remediation:** Implement a router address verification check that validates msg.sender against a trusted router address.
|
|
105
|
+
- **References:**
|
|
106
|
+
- https://docs.chain.link/ccip/best-practices#verify-router-addresses
|
|
107
|
+
|
|
108
|
+
- [ ] **[SOL-Integrations-Chainlink-CCIP-7]** Are extraArgs parameters hardcoded instead of mutable in cross-chain message configurations?
|
|
109
|
+
- Hardcoded extraArgs parameters prevent adaptation to future CCIP protocol upgrades and gas requirement changes, potentially causing cross-chain transactions to fail or become incompatible with network upgrades.
|
|
110
|
+
- **Remediation:** Implement extraArgs as mutable parameters that can be configured off-chain or via updateable contract variables rather than hardcoding them directly in the contract logic.
|
|
111
|
+
- **References:**
|
|
112
|
+
- https://docs.chain.link/ccip/best-practices#using-extraargs
|
|
113
|
+
|
|
114
|
+
- [ ] **[SOL-Integrations-Chainlink-CCIP-8]** Is there a proper failure handling mechanism for CCIP messages to prevent blocking after Smart Execution window expiration?
|
|
115
|
+
- When a CCIP message fails and the Smart Execution time window (8 hours) expires, all subsequent messages from the same sender will be blocked until the failed message succeeds, potentially causing permanent denial of service if the message cannot be fixed.
|
|
116
|
+
- **Remediation:** Implement robust error handling in CCIPReceiver implementation with try/catch blocks and recovery mechanisms to ensure messages can be successfully processed even under unexpected conditions.
|
|
117
|
+
- **References:**
|
|
118
|
+
- https://solodit.cyfrin.io/issues/m-04-price-updating-mechanism-can-break-code4rena-renzo-renzo-git
|
|
119
|
+
|
|
120
|
+
### Integrations > Chainlink > VRF
|
|
121
|
+
|
|
122
|
+
- [ ] **[SOL-Integrations-Chainlink-VRF-1]** Are all parameters properly verified when Chainlink VRF is called?
|
|
123
|
+
- If the parameters are not thoroughly verified when Chainlink VRF is called, the `fullfillRandomWord` function will not revert but return an incorrect value.
|
|
124
|
+
- **Remediation:** Ensure that all parameters passed to Chainlink VRF are verified to ensure the correct operation of `fullfillRandomWord`.
|
|
125
|
+
|
|
126
|
+
- [ ] **[SOL-Integrations-Chainlink-VRF-2]** Is it guaranteed that the operator holds sufficient LINK in the subscription?
|
|
127
|
+
- Chainlink VRF can go into a pending state if there's insufficient LINK in the subscription. Once the subscription is refilled, the transaction can potentially be frontrun, introducing vulnerabilities.
|
|
128
|
+
- **Remediation:** Ensure the pending subscription does not affect the protocol's functionality.
|
|
129
|
+
|
|
130
|
+
- [ ] **[SOL-Integrations-Chainlink-VRF-3]** Is a sufficiently high request confirmation number chosen considering chain re-orgs?
|
|
131
|
+
- Not choosing a high enough request confirmation number can pose risks, especially in the context of chain re-orgs.
|
|
132
|
+
- **Remediation:** Evaluate the chain's vulnerability to re-orgs and adjust the request confirmation number accordingly.
|
|
133
|
+
- **References:**
|
|
134
|
+
- https://github.com/pashov/audits/blob/master/solo/NFTLoots-security-review.md#c-01-polygon-chain-reorgs-will-often-change-game-results
|
|
135
|
+
|
|
136
|
+
- [ ] **[SOL-Integrations-Chainlink-VRF-4]** Are measures in place to prevent VRF calls from being frontrun?
|
|
137
|
+
- VRF calls can be frontrun and it's crucial to ensure that the user interactions are closed before the VRF call to prevent this.
|
|
138
|
+
- **Remediation:** Ensure the implementation closes the user interaction phase before initiating the VRF call.
|
|
139
|
+
|
|
140
|
+
### Integrations > Gnosis Safe
|
|
141
|
+
|
|
142
|
+
- [ ] **[SOL-Integrations-GS-1]** Do your modules execute the Guard's hooks?
|
|
143
|
+
- Failing to execute the Guard's hooks (`checkTransaction()`, `checkAfterExecution()`) can bypass critical security checks implemented in those hooks.
|
|
144
|
+
- **Remediation:** Ensure that all modules correctly execute the Guard's hooks as intended.
|
|
145
|
+
|
|
146
|
+
- [ ] **[SOL-Integrations-GS-2]** Does the `execTransactionFromModule()` function increment the nonce?
|
|
147
|
+
- If the nonce is not incremented in `execTransactionFromModule()`, it can cause issues when relying on it for signatures.
|
|
148
|
+
- **Remediation:** Ensure increase nonce inside the function `execTransactionFromModule()`.
|
|
149
|
+
|
|
150
|
+
### Integrations > LayerZero
|
|
151
|
+
|
|
152
|
+
- [ ] **[SOL-Integrations-LayerZero-1]** Does the `_debitFrom` function in ONFT properly validate token ownership and transfer permissions?
|
|
153
|
+
- It's crucial that the `_debitFrom` function verifies whether the specified owner is the actual owner of the tokenId and if the sender has the correct permissions to transfer the token.
|
|
154
|
+
- **Remediation:** Ensure thorough checks and validations are performed in the `_debitFrom` function to maintain token security.
|
|
155
|
+
- **References:**
|
|
156
|
+
- https://composable-security.com/blog/secure-integration-with-layer-zero/
|
|
157
|
+
|
|
158
|
+
- [ ] **[SOL-Integrations-LayerZero-2]** Which type of mechanism are utilized? Blocking or non-blocking?
|
|
159
|
+
- Using blocking mechanism can potentially lead to a Denial-of-Service (DoS) attack.
|
|
160
|
+
- **Remediation:** Consider using non-blocking mechanism to prevent potential DoS attacks.
|
|
161
|
+
- **References:**
|
|
162
|
+
- https://solodit.xyz/issues/h-06-attacker-can-block-layerzero-channel-code4rena-velodrome-finance-velodrome-finance-contest-git
|
|
163
|
+
|
|
164
|
+
- [ ] **[SOL-Integrations-LayerZero-3]** Is gas estimated accurately for cross-chain messages?
|
|
165
|
+
- Inaccurate gas estimation can result in cross-chain message failures.
|
|
166
|
+
- **Remediation:** Implement mechanisms to estimate gas accurately.
|
|
167
|
+
|
|
168
|
+
- [ ] **[SOL-Integrations-LayerZero-4]** Is the `_lzSend` function correctly utilized when inheriting LzApp?
|
|
169
|
+
- When inheriting LzApp, direct calls to `lzEndpoint.send` can introduce vulnerabilities. Using `_lzSend` is the recommended approach.
|
|
170
|
+
- **Remediation:** Ensure that the `_lzSend` function is used instead of making direct calls to `lzEndpoint.send`.
|
|
171
|
+
|
|
172
|
+
- [ ] **[SOL-Integrations-LayerZero-5]** Is the `ILayerZeroUserApplicationConfig` interface correctly implemented?
|
|
173
|
+
- The User Application should include the `forceResumeReceive` function to handle unexpected scenarios and unblock the message queue when needed.
|
|
174
|
+
- **Remediation:** Implement the `ILayerZeroUserApplicationConfig` interface and ensure that the `forceResumeReceive` function is present and functional.
|
|
175
|
+
|
|
176
|
+
- [ ] **[SOL-Integrations-LayerZero-6]** Are default contracts used?
|
|
177
|
+
- Default configuration contracts are upgradeable by the LayerZero team.
|
|
178
|
+
- **Remediation:** Configure the applications uniquely and avoid using default settings.
|
|
179
|
+
|
|
180
|
+
- [ ] **[SOL-Integrations-LayerZero-7]** Is the correct number of confirmations chosen for the chain?
|
|
181
|
+
- Choosing an inappropriate number of confirmations can introduce risks, especially considering past reorg events on the chain.
|
|
182
|
+
- **Remediation:** Evaluate the chain's history and potential vulnerabilities to determine the optimal number of confirmations.
|
|
183
|
+
|
|
184
|
+
### Integrations > LSD > cbETH
|
|
185
|
+
|
|
186
|
+
- [ ] **[SOL-Integrations-LSD-cbETH-1]** How is the control over the `cbETH`/`ETH` rate determined? Are there specific addresses with this capability due to the `onlyOracle` modifier?
|
|
187
|
+
- The rate between `cbETH` and `ETH` being controllable by a few addresses can introduce centralization risks and potential manipulations.
|
|
188
|
+
- **Remediation:** Any address with `onlyOracle` permissions should be scrutinized and their actions should be transparent to the community.
|
|
189
|
+
|
|
190
|
+
- [ ] **[SOL-Integrations-LSD-cbETH-2]** How does the system handle potential decreases in the `cbETH`/`ETH` rate?
|
|
191
|
+
- The rate of `cbETH` to `ETH` can decrease, which can impact users who hold or interact with `cbETH`.
|
|
192
|
+
- **Remediation:** Implement mechanisms to inform users about the current `cbETH`/`ETH` rate. Consider providing alerts or notifications for significant rate changes. Ensure there's a mechanism to handle or rectify situations where the rate decreases dramatically.
|
|
193
|
+
|
|
194
|
+
### Integrations > LSD > rETH
|
|
195
|
+
|
|
196
|
+
- [ ] **[SOL-Integrations-LSD-rETH-1]** Does the application account for potential penalties or slashes?
|
|
197
|
+
- Validators on the Ethereum 2.0 Beacon Chain can be penalized or slashed for misbehavior. This can affect the value of `rETH`.
|
|
198
|
+
- **Remediation:** Implement mechanisms to account for potential penalties or slashes that can impact the value of `rETH`.
|
|
199
|
+
|
|
200
|
+
- [ ] **[SOL-Integrations-LSD-rETH-2]** How does the system manage rewards accrued from staking?
|
|
201
|
+
- Staking on the Ethereum 2.0 Beacon Chain accrues rewards. The system should account for these rewards when dealing with `rETH`.
|
|
202
|
+
- **Remediation:** Ensure proper distribution or accumulation of rewards in the system's `rETH` management.
|
|
203
|
+
|
|
204
|
+
- [ ] **[SOL-Integrations-LSD-rETH-3]** Does the application handle potential reverts in the `burn()` function when there's insufficient ether in the `RocketDepositPool`?
|
|
205
|
+
- If there's not enough ether in the `RocketDepositPool` contract, the `burn()` function can fail. It's important for the system to handle these failures gracefully.
|
|
206
|
+
- **Remediation:** Ensure there's a mechanism to either prevent calls to `burn()` when there's insufficient ether or handle the revert gracefully, informing the user appropriately.
|
|
207
|
+
|
|
208
|
+
- [ ] **[SOL-Integrations-LSD-rETH-4]** What measures are in place to counteract potential consensus attacks on RPL nodes?
|
|
209
|
+
- There's a risk of consensus attacks on RPL nodes where malicious nodes may submit incorrect exchange rate data, leading to discrepancies.
|
|
210
|
+
- **Remediation:** Implement a system in place to quickly rectify incorrect data submissions by nodes.
|
|
211
|
+
|
|
212
|
+
- [ ] **[SOL-Integrations-LSD-rETH-5]** How does the system handle the conversion between `ETH` and `rETH`?
|
|
213
|
+
- The conversion rate between `ETH` and `rETH` might change over time based on the rewards accrued from staking. Ensure this dynamic is properly captured.
|
|
214
|
+
- **Remediation:** Integrate accurate conversion mechanisms that consider the ever-changing staking rewards when converting between `ETH` and `rETH`.
|
|
215
|
+
|
|
216
|
+
### Integrations > LSD > sfrxETH
|
|
217
|
+
|
|
218
|
+
- [ ] **[SOL-Integrations-LSD-sfrxETH-1]** How does the system handle potential detachment of `sfrxETH` from `frxETH` during reward transfers?
|
|
219
|
+
- If `sfrxETH` detaches from `frxETH` during reward transfers, it could cause discrepancies in expected and actual values, especially if these transfers are controlled by a centralized entity like the Frax team's multi-sig contract.
|
|
220
|
+
- **Remediation:** Ensure there's transparency around the actions of the Frax team's multi-sig contract. Consider mechanisms to alert users or stakeholders about discrepancies between `sfrxETH` and `frxETH`.
|
|
221
|
+
|
|
222
|
+
- [ ] **[SOL-Integrations-LSD-sfrxETH-2]** Is the stability of the `sfrxETH`/`ETH` rate guaranteed or can it decrease in the future?
|
|
223
|
+
- While the `sfrxETH`/`ETH` rate might be stable now, changes in the future could impact users and stakeholders, especially if they're not forewarned.
|
|
224
|
+
- **Remediation:** Provide clear documentation and alerts about potential changes to the `sfrxETH`/`ETH` rate. Ensure users are informed well in advance about any planned changes that could affect the rate.
|
|
225
|
+
|
|
226
|
+
### Integrations > LSD > stETH
|
|
227
|
+
|
|
228
|
+
- [ ] **[SOL-Integrations-LSD-stETH-1]** Is the application aware that `stETH` is a rebasing token?
|
|
229
|
+
- `stETH` rebases, which can introduce complexities when integrated with DeFi platforms. Using `wstETH` can simplify integrations as it is non-rebasing.
|
|
230
|
+
- **Remediation:** Consider using `wstETH` for simpler DeFi integrations and to avoid complexities associated with rebasing tokens.
|
|
231
|
+
|
|
232
|
+
- [ ] **[SOL-Integrations-LSD-stETH-2]** Are you aware of the overhead when withdrawing `stETH`/`wstETH`?
|
|
233
|
+
- Withdrawing `stETH` or `wstETH` can introduce overheads, due to various problems like queue time, receipt of an NFT, and withdrawal amount limits.
|
|
234
|
+
- **Remediation:** Ensure account for these overheads and constraints in the protocol logic.
|
|
235
|
+
|
|
236
|
+
- [ ] **[SOL-Integrations-LSD-stETH-3]** Does the application handle conversions between `stETH` and `wstETH` correctly?
|
|
237
|
+
- Converting between `stETH` and `wstETH` can be tricky due to the rebasing nature of `stETH`. It's crucial to handle these conversions correctly to avoid potential issues.
|
|
238
|
+
- **Remediation:** Ensure that the rebasing characteristics of `stETH` are properly managed when converting between `stETH` and `wstETH`.
|
|
239
|
+
|
|
240
|
+
### Integrations > Uniswap
|
|
241
|
+
|
|
242
|
+
- [ ] **[SOL-Integrations-Uniswap-1]** Is the slippage calculated on-chain?
|
|
243
|
+
- ON-chain slippage calculation can be manipulated.
|
|
244
|
+
- **Remediation:** Allow users to specify the slippage parameter in the actual asset amount which was calculated off-chain.
|
|
245
|
+
- **References:**
|
|
246
|
+
- https://dacian.me/defi-slippage-attacks#heading-on-chain-slippage-calculation-can-be-manipulated
|
|
247
|
+
|
|
248
|
+
- [ ] **[SOL-Integrations-Uniswap-2]** Are there refunds after swaps?
|
|
249
|
+
- In case of failed or partially filled orders, the protocol must issue refunds to the users.
|
|
250
|
+
- **Remediation:** Implement a refund mechanism to handle failed or partially filled swaps.
|
|
251
|
+
|
|
252
|
+
- [ ] **[SOL-Integrations-Uniswap-3]** Is the order of `token0` and `token1` consistent across chains?
|
|
253
|
+
- The order of `token0` and `token1` in AMM pools may vary depending on the chain, which can lead to inconsistencies.
|
|
254
|
+
- **Remediation:** Always verify the order of tokens when interacting with different chains to avoid potential issues.
|
|
255
|
+
|
|
256
|
+
- [ ] **[SOL-Integrations-Uniswap-4]** Are the pools that are being interacted with whitelisted?
|
|
257
|
+
- Missing verification on the interacting pools can introduce risks.
|
|
258
|
+
- **Remediation:** Ensure pools are whitelisted or verify the pool's factory address before any interactions.
|
|
259
|
+
|
|
260
|
+
- [ ] **[SOL-Integrations-Uniswap-5]** Is there a reliance on pool reserves?
|
|
261
|
+
- Relying on pool reserves can be risky, as they can be manipulated, especially using a flashloan.
|
|
262
|
+
- **Remediation:** Implement alternative methods or checks without relying solely on pool reserves.
|
|
263
|
+
|
|
264
|
+
- [ ] **[SOL-Integrations-Uniswap-6]** Is `pool.swap()` directly used?
|
|
265
|
+
- Directly using `pool.swap()` can bypass certain security mechanisms.
|
|
266
|
+
- **Remediation:** Always use the Router contract to handle swaps, providing an added layer of security and standardization.
|
|
267
|
+
|
|
268
|
+
- [ ] **[SOL-Integrations-Uniswap-7]** Is `unchecked` used properly with Uniswap's math libraries?
|
|
269
|
+
- Uniswap's TickMath and FullMath libraries require careful usage of `unchecked` due to solidity version specifics.
|
|
270
|
+
- **Remediation:** Review and test the use of `unchecked` in contracts utilizing Uniswap's math libraries to ensure safety and correctness.
|
|
271
|
+
- **References:**
|
|
272
|
+
- https://solodit.xyz/issues/use-unchecked-intickmathsol-andfullmathsol-spearbit-overlay-pdf
|
|
273
|
+
|
|
274
|
+
- [ ] **[SOL-Integrations-Uniswap-8]** Is the slippage parameter enforced at the last step before transferring funds to users?
|
|
275
|
+
- Enforcing slippage parameters for intermediate swaps but not the final step can result in users receiving less tokens than their specified minimum
|
|
276
|
+
- **Remediation:** Enforce slippage parameter as the last step before transferring funds to users
|
|
277
|
+
- **References:**
|
|
278
|
+
- https://dacian.me/defi-slippage-attacks#heading-mintokensout-for-intermediate-not-final-amount
|
|
279
|
+
|
|
280
|
+
- [ ] **[SOL-Integrations-Uniswap-9]** Is `pool.slot0` being used to calculate sensitive information like current price and exchange rates?
|
|
281
|
+
- `pool.slot0` can be easily manipulated via flash loans to sandwich attack users.
|
|
282
|
+
- **Remediation:** Use UniswapV3 TWAP or Chainlink Price Oracle.
|
|
283
|
+
- **References:**
|
|
284
|
+
- https://solodit.xyz/issues/h-4-no-slippage-protection-during-repayment-due-to-dynamic-slippage-params-and-easily-influenced-slot0-sherlock-real-wagmi-2-git
|
|
285
|
+
- https://solodit.xyz/issues/h-02-use-of-slot0-to-get-sqrtpricelimitx96-can-lead-to-price-manipulation-code4rena-maia-dao-ecosystem-maia-dao-ecosystem-git
|
|
286
|
+
- https://docs.uniswap.org/concepts/protocol/oracle
|
|
287
|
+
|
|
288
|
+
- [ ] **[SOL-Integrations-Uniswap-10]** Is a hard-coded fee tier parameter being used?
|
|
289
|
+
- In UniswapV3 liquidity can be spread across multiple fee tiers. If a function which initiates a uni v3 swap hard-codes the fee tier parameter, this can have several negative effects.
|
|
290
|
+
- **Remediation:** Functions allowing users to perform uni v3 swaps should allow users to pass in the fee tier parameter.
|
|
291
|
+
- **References:**
|
|
292
|
+
- https://dacian.me/defi-slippage-attacks#heading-hard-coded-fee-tier-in-uniswapv3-swap
|
|
293
|
+
|
|
294
|
+
### Token > Fungible : ERC20
|
|
295
|
+
|
|
296
|
+
- [ ] **[SOL-Token-FE-1]** Are safe transfer functions used throughout the contract?
|
|
297
|
+
- Not all ERC20 tokens are compliant to the EIP20 standard. Some do not return boolean flag, some do not revert on failure.
|
|
298
|
+
- **Remediation:** Use OpenZeppelin's SafeERC20 where the safeTransfer and safeTransferFrom functions handle the return value check as well as non-standard-compliant tokens.
|
|
299
|
+
|
|
300
|
+
- [ ] **[SOL-Token-FE-2]** Is there potential for a race condition for approvals?
|
|
301
|
+
- Race condition for approvals can cause an unexpected loss of funds to the signer.
|
|
302
|
+
- **Remediation:** Use OpenZeppelin's safeIncreaseAllowance and safeDecreaseAllowance functions.
|
|
303
|
+
- **References:**
|
|
304
|
+
- https://solodit.xyz/issues/m01-approval-process-can-be-front-run-openzeppelin-notional-governance-contracts-v2-audit-markdown
|
|
305
|
+
|
|
306
|
+
- [ ] **[SOL-Token-FE-3]** Could a difference in decimals between ERC20 tokens cause issues?
|
|
307
|
+
- Different decimals in ERC20 tokens can cause incorrect calculations or interpretations.
|
|
308
|
+
- **Remediation:** Always check and handle the decimals of ERC20 tokens to prevent potential issues.
|
|
309
|
+
|
|
310
|
+
- [ ] **[SOL-Token-FE-4]** Does the token implement any form of address whitelisting, blacklisting, or checks?
|
|
311
|
+
- Tokens that have address checks can lead to various problems.
|
|
312
|
+
- **Remediation:** Ensure the token's own blacklisting mechanism does not affect the protocol's functionality.
|
|
313
|
+
|
|
314
|
+
- [ ] **[SOL-Token-FE-5]** Could the use of multiple addresses for a single token lead to complications?
|
|
315
|
+
- Some tokens have multiple addresses and this can introduce vulnerabilities.
|
|
316
|
+
- **Remediation:** Do not rely on the token address in the accounting.
|
|
317
|
+
|
|
318
|
+
- [ ] **[SOL-Token-FE-6]** Does the token charge fee on transfer?
|
|
319
|
+
- Some tokens charge fee on transfer and the receiver gets less amount than specified.
|
|
320
|
+
- **Remediation:** If the protocol intends to support this kind of token, ensure the accounting logic is correct.
|
|
321
|
+
|
|
322
|
+
- [ ] **[SOL-Token-FE-7]** Can the token be ERC777?
|
|
323
|
+
- ERC777 tokens have hooks that execute code before and after transfers, which might lead to reentrancy.
|
|
324
|
+
- **Remediation:** Be cautious when integrating with ERC777 and be aware of the hook implications.
|
|
325
|
+
|
|
326
|
+
- [ ] **[SOL-Token-FE-8]** Does the protocol use Solmate's `ERC20.safeTransferLib`?
|
|
327
|
+
- Solmate `ERC20.safeTransferLib` do not check the contract existence and this opens up a possibility for a honeypot attack.
|
|
328
|
+
- **Remediation:** Use OpenZeppelin's SafeERC20.
|
|
329
|
+
- **References:**
|
|
330
|
+
- https://solodit.xyz/issues/m-02-solmates-erc20-does-not-check-for-token-contracts-existence-which-opens-up-possibility-for-a-honeypot-attack-code4rena-size-size-contest-git
|
|
331
|
+
|
|
332
|
+
- [ ] **[SOL-Token-FE-9]** Is there a flash-mint functionality?
|
|
333
|
+
- Flash mints can drastically increase token supply temporarily, leading to potential abuse.
|
|
334
|
+
- **Remediation:** Implement strict controls and checks around any flash mint functionality.
|
|
335
|
+
|
|
336
|
+
- [ ] **[SOL-Token-FE-10]** What happens on zero amount transfer?
|
|
337
|
+
- Some tokens revert on transfer of zero amount and can cause issues in certain integrations and operations.
|
|
338
|
+
- **Remediation:** Transfer only when the amount is positive.
|
|
339
|
+
|
|
340
|
+
- [ ] **[SOL-Token-FE-11]** Is the token an ERC2612 implementation?
|
|
341
|
+
- Missing `DOMAIN_SEPARATOR()` can lead to vulnerabilities in the ERC2612 permit functionality.
|
|
342
|
+
- **Remediation:** Ensure complete and correct implementation of ERC2612, including the `DOMAIN_SEPARATOR()` function.
|
|
343
|
+
|
|
344
|
+
- [ ] **[SOL-Token-FE-12]** Can the token be sent to any address?
|
|
345
|
+
- Certain addresses might be blocked or restricted to receive tokens (e.g. LUSD).
|
|
346
|
+
- **Remediation:** Ensure the receiver blacklisting does not affect the protocol's functionality.
|
|
347
|
+
|
|
348
|
+
- [ ] **[SOL-Token-FE-13]** Is there a direct approval to a non-zero value?
|
|
349
|
+
- Some ERC20 tokens do not work when changing the allowance from an existing non-zero allowance value. For example Tether (USDT)'s approve() function will revert if the current approval is not zero, to protect against front-running changes of approvals.
|
|
350
|
+
- **Remediation:** Set the allowance to zero before increasing the allowance and use safeApprove/safeIncreaseAllowance.
|
|
351
|
+
- **References:**
|
|
352
|
+
- https://solodit.xyz/issues/m-17-did-not-approve-to-zero-first-sherlock-notional-notional-git
|
|
353
|
+
|
|
354
|
+
- [ ] **[SOL-Token-FE-14]** Is there a max approval used?
|
|
355
|
+
- Some tokens don't support approve `type(uint256).max` amount and revert.
|
|
356
|
+
- **Remediation:** Avoid approval of `type(uint256).max`.
|
|
357
|
+
- **References:**
|
|
358
|
+
- https://solodit.xyz/issues/m-3-universalapprovemax-will-not-work-for-some-tokens-that-dont-support-approve-typeuint256max-amount-sherlock-dodo-dodo-git
|
|
359
|
+
|
|
360
|
+
- [ ] **[SOL-Token-FE-15]** Can the token be paused?
|
|
361
|
+
- Some ERC20 tokens can be paused by the contract owner.
|
|
362
|
+
- **Remediation:** Ensure the protocol is not affected when the token is paused.
|
|
363
|
+
|
|
364
|
+
- [ ] **[SOL-Token-FE-16]** Is the decrease allowance feature of transferFrom() handled correctly when the sender is the caller?
|
|
365
|
+
- Allowance should not be decreased in a transferFrom() call if the sender is the same as the caller, to prevent incorrect balance and allowance tracking.
|
|
366
|
+
- **Remediation:** Ensure that the smart contract logic maintains correct allowance levels when transferFrom() involves the token owner themselves.
|
|
367
|
+
- **References:**
|
|
368
|
+
- https://solodit.xyz/issues/m-2-transferfrom-uses-allowance-even-if-spender-from-sherlock-surge-surge-git
|
|
369
|
+
|
|
370
|
+
### Token > Non-fungible : ERC721/1155
|
|
371
|
+
|
|
372
|
+
- [ ] **[SOL-Token-NfE1-1]** How are the minting and transfer implemented?
|
|
373
|
+
- According to the ERC721 standard, a wallet/broker/auction application MUST implement the wallet interface if it will accept safe transfers. Use safe version of mint and transfer functions to prevent NFT being lost. (the similar applies to ERC1155)
|
|
374
|
+
- **Remediation:** Use OpenZeppelin's safe mint/transfer functions for ERC721/1155.
|
|
375
|
+
|
|
376
|
+
- [ ] **[SOL-Token-NfE1-2]** Is the contract safe from reentrancy attack?
|
|
377
|
+
- By standard, the token receiver contracts implement onERC721Received and onERC1155Received and this can potentially be a source of reentrancy attacks if not correctly handled.
|
|
378
|
+
- **Remediation:** Double check the potential reentrancy attack.
|
|
379
|
+
|
|
380
|
+
- [ ] **[SOL-Token-NfE1-3]** Is the OpenZeppelin implementation of ERC721 and ERC1155 safeguarded against reentrancy attacks, especially in the `safeTransferFrom` functions?
|
|
381
|
+
- The `safeTransferFrom` functions in OpenZeppelin's ERC721 and ERC1155 can expose the contract to reentrancy attacks due to external calls to user addresses.
|
|
382
|
+
- **Remediation:** Use the checks-effects-interactions pattern and implement reentrancy guards to prevent potential reentrancy attacks when making external calls.
|
|
383
|
+
|
|
384
|
+
- [ ] **[SOL-Token-NfE1-4]** Is it possible to steal NFT abusing his approval?
|
|
385
|
+
- Most of the time the `from` parameter of `transferFrom()` should be `msg.sender`. Otherwise an attacker can take advantage of other user's approvals and steal.
|
|
386
|
+
- **Remediation:** Ensure that the contract verifies the `msg.sender` is actually the owner.
|
|
387
|
+
|
|
388
|
+
- [ ] **[SOL-Token-NfE1-5]** Does the ERC721/1155 contract correctly implement supportsInterface?
|
|
389
|
+
- Contracts must properly implement the supportsInterface function to ensure they comply with ERC721/1155 standards and interoperate with other contracts correctly.
|
|
390
|
+
- **Remediation:** Implement the supportsInterface function to return true for ERC721 and ERC1155 token types, ensuring accurate reporting of supported features.
|
|
391
|
+
- **References:**
|
|
392
|
+
- https://solodit.xyz/issues/m-04-the-ferc1155sol-dont-respect-the-eip2981-code4rena-fractional-fractional-v2-contest-git
|
|
393
|
+
|
|
394
|
+
- [ ] **[SOL-Token-NfE1-6]** Can the contract support both ERC721 and ERC1155 standards?
|
|
395
|
+
- To facilitate broader compatibility and usage in various applications, contracts may need to support both ERC721 and ERC1155 token standards.
|
|
396
|
+
- **Remediation:** Use the supportsInterface method to check for and support interfaces of both ERC1155 and ERC721 within the same contract.
|
|
397
|
+
- **References:**
|
|
398
|
+
- https://solodit.xyz/issues/h-06-some-real-world-nft-tokens-may-support-both-erc721-and-erc1155-standards-which-may-break-infinityexchange_transfernfts-code4rena-infinity-nft-marketplace-infinity-nft-marketplace-contest-git
|
|
399
|
+
|
|
400
|
+
- [ ] **[SOL-Token-NfE1-7]** What happens to the airdrops that are engaged to specific NFT?
|
|
401
|
+
- For many NFT collections, a kind of privilege is provided in various ways, e.g. airdrop. The NFT owner must be able to claim the benefits while they lock in protocols.
|
|
402
|
+
- **Remediation:** Ensure the NFT holders can claim all benefits.
|
|
403
|
+
- **References:**
|
|
404
|
+
- https://solodit.xyz/issues/m-04-its-possible-to-swap-nft-token-ids-without-fee-and-also-attacker-can-wrap-unwrap-all-the-nft-token-balance-of-the-pair-contract-and-steal-their-air-drops-for-those-token-ids-code4rena-caviar-caviar-contest-git
|
|
405
|
+
|
|
406
|
+
- [ ] **[SOL-Token-NfE1-8]** How is the approval/transfer handled for CryptoPunks collection?
|
|
407
|
+
- CryptoPunks collections that do not support the `transferFrom()` function can present risks. The `offerPunkForSaleToAddress()` function in particular can be susceptible to front-running attacks, which can compromise the ownership and security of the token.
|
|
408
|
+
- **Remediation:** Ensure validation is done properly to prevent malicious actors claiming the ownership.
|
|
409
|
+
- **References:**
|
|
410
|
+
- https://solodit.xyz/issues/h-3-cryptopunks-nfts-may-be-stolen-via-deposit-frontrunning-sherlock-ajna-ajna-git
|
|
411
|
+
- https://solodit.xyz/issues/h-02-anyone-can-steal-cryptopunk-during-the-deposit-flow-to-wpunkgateway-code4rena-paraspace-paraspace-contest-git
|
|
412
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cyfrin-gas
|
|
3
|
+
description: Cyfrin audit checklist — gas optimization and efficiency items for Solidity smart contracts
|
|
4
|
+
---
|
|
5
|
+
<!-- Source: Cyfrin/audit-checklist -->
|
|
6
|
+
<!-- Auto-generated from https://github.com/Cyfrin/audit-checklist -->
|
|
7
|
+
<!-- Total items: 5 -->
|
|
8
|
+
|
|
9
|
+
# Cyfrin Audit Checklist — Gas Optimization
|
|
10
|
+
|
|
11
|
+
Gas-related checklist items extracted from [Cyfrin's audit checklist](https://github.com/Cyfrin/audit-checklist).
|
|
12
|
+
|
|
13
|
+
## Checklist Items
|
|
14
|
+
|
|
15
|
+
### External Call
|
|
16
|
+
|
|
17
|
+
- [ ] **[SOL-EC-9]** What happens if the call returns vast data?
|
|
18
|
+
- External calls returning vast data can deplete available gas.
|
|
19
|
+
- **Remediation:** Limit or verify data size returned from external sources.
|
|
20
|
+
- **References:**
|
|
21
|
+
- https://solodit.cyfrin.io/?b=false&f=&fc=gte&ff=&fn=1&i=HIGH%2CMEDIUM&p=1&pc=&r=all&s=gas+griefing&t=
|
|
22
|
+
|
|
23
|
+
- [ ] **[SOL-EC-7]** What happens if the call consumes all provided gas?
|
|
24
|
+
- Calls that consume all available gas can halt subsequent actions.
|
|
25
|
+
- **Remediation:** Ensure enough gas is reserved for post-call tasks or use dynamic gas estimation.
|
|
26
|
+
- **References:**
|
|
27
|
+
- https://solodit.xyz/issues/a-malicious-fee-receiver-can-cause-a-denial-of-service-trailofbits-nftx-protocol-v2-pdf
|
|
28
|
+
- https://solodit.xyz/issues/poison-order-that-consumes-gas-can-block-market-trades-wont-fix-consensys-0x-v3-exchange-markdown
|
|
29
|
+
|
|
30
|
+
### Basics > Payment
|
|
31
|
+
|
|
32
|
+
- [ ] **[SOL-Basics-Payment-6]** Is `transfer()` or `send()` used for sending ETH?
|
|
33
|
+
- The transfer() and send() functions forward a fixed amount of 2300 gas. Historically, it has often been recommended to use these functions for value transfers to guard against reentrancy attacks. However, the gas cost of EVM instructions may change significantly during hard forks which may break already deployed contract systems that make fixed assumptions about gas costs. For example. EIP 1884 broke several existing smart contracts due to a cost increase of the SLOAD instruction.
|
|
34
|
+
- **Remediation:** Use `call()` to prevent potential gas issues.
|
|
35
|
+
- **References:**
|
|
36
|
+
- https://solodit.xyz/issues/use-call-instead-of-transfer-cyfrin-none-woosh-deposit-vault-markdown
|
|
37
|
+
- https://solodit.xyz/issues/m-5-call-should-be-used-instead-of-transfer-on-an-address-payable-sherlock-dodo-dodo-git
|
|
38
|
+
- https://solodit.xyz/issues/m-10-addresscallvaluex-should-be-used-instead-of-payabletransfer-code4rena-debt-dao-debt-dao-contest-git
|
|
39
|
+
|
|
40
|
+
### Multi-chain/Cross-chain
|
|
41
|
+
|
|
42
|
+
- [ ] **[SOL-McCc-5]** Is there any possibility of exploiting low gas fees to execute many transactions?
|
|
43
|
+
- Some attacks become viable with low gas costs or when a large number of transactions can be processed.
|
|
44
|
+
- **Remediation:** Evaluate and mitigate potential attack vectors associated with gas fees.
|
|
45
|
+
- **References:**
|
|
46
|
+
- https://github.com/0xJuancito/multichain-auditor#gas-fees
|
|
47
|
+
|
|
48
|
+
### Heuristics
|
|
49
|
+
|
|
50
|
+
- [ ] **[SOL-Heuristics-5]** Does the `try/catch` block account for potential gas shortages?
|
|
51
|
+
- A `try/catch` block without adequate gas can fail, leading to unexpected behaviors.
|
|
52
|
+
- **Remediation:** Ensure sufficient gas is supplied when using the `try/catch` block.
|
|
53
|
+
- **References:**
|
|
54
|
+
- https://forum.openzeppelin.com/t/a-brief-analysis-of-the-new-try-catch-functionality-in-solidity-0-6/2564
|
|
55
|
+
|