2026-04-07
OlderResearch the Rekt Test for smart contract security. This is a well-known checklist created by Trail…
Disclaimer: As an AI with a knowledge cutoff of January 2025, I cannot provide real-time research on changes specific to 2026. Smart contract security standards are highly dynamic. The Rekt Test is a…
RESEARCH: Research the Rekt Test for smart contract security. This is a well-known checklist created by Trail of Bits. P
Disclaimer: As an AI with a knowledge cutoff of January 2025, I cannot provide real-time research on changes specific to 2026. Smart contract security standards are highly dynamic. The Rekt Test is a living checklist, and its current implementation and required updates are best sourced directly from Trail of Bits' official channels (blog/GitHub) or specialized smart contract audit platforms. The following information represents the established, foundational questions of the test as widely published and utilized.
The Rekt Test for Smart Contract Security
The Rekt Test is a well-regarded, comprehensive checklist designed by Trail of Bits to help developers think through the security implications of a smart contract from multiple angles (economic, logical, architectural, and implementation).
(1) The Complete List of Rekt Test Questions (Foundational Set)
The test is not a fixed questionnaire but a framework covering several major security domains. Below are the canonical, foundational questions grouped by area of concern, presented as the required heading structure.
⚙️ Access Control and Permissions
Question: Does the contract enforce granular role-based access control (RBAC) for all sensitive functions (e.g., setOwnership, withdrawFunds, upgradeContract)?
- Why it Matters: Unauthorized access is the primary vector for theft or system manipulation. If a function that should only be callable by the owner can be called by an arbitrary user, the contract is compromised.
- Good Answer Looks Like: The contract uses secure modifiers (like
onlyOwneror specific role enums) for every function that modifies state and is not intended to be public. The mechanism for defining "owner" is itself secured (e.g., multisig or timed epoch transfer).
Question: How is administrative authority delegated, and is there a clear, multi-step, and verifiable process for transferring that authority?
- Why it Matters: Single points of failure (SPOFs) in ownership transfer are catastrophic. If one person can unilaterally transfer ownership, they can "re-kt" the entire system.
- Good Answer Looks Like: Ownership transfer requires consensus (e.g., a 2-of-3 multisig wallet or a time-delayed window requiring multiple keys to sign). The contract should ideally incorporate a "dead man's switch" or emergency pause mechanism.
💾 State Management and Data Integrity
Question: Are there any external calls or state changes that could lead to a violation of the principle of least privilege (PoLP)?
- Why it Matters: Calling arbitrary external contracts can lead to unexpected side effects, such as draining funds, changing variable states, or introducing complex failure pathways that are hard to audit.
- Good Answer Looks Like: All external calls are strictly necessary and guarded by checks (e.g., checking for sufficient receiver balances, using interfaces with explicit function signatures). Complex external interactions are broken down into small, verifiable steps.
Question: Is the contract correctly handling integer overflows/underflows, and are fixed-size data types used appropriately?
- Why it Matters: While modern Solidity versions (>=0.8.0) mitigate classic overflows, incorrect state arithmetic, especially when dealing with percentages or cumulative amounts, can lead to unexpected state changes that corrupt the system's invariants.
- Good Answer Looks Like: All critical arithmetic operations are checked (e.g.,
require(input < MAX_VALUE)) and are designed to be safe and reversible. Solidity versioning best practices (usingSafeMathor native checked arithmetic) are followed.
💰 Economic Security and Invariants
Question: Does the contract maintain its critical economic invariants (e.g., total supply always equals summed balances)?
- Why it Matters: An invariant is a condition that must always be true for the system to function correctly (e.g., in a vault, deposits + withdrawals must balance). If an invariant is violated, the system is broken.
- Good Answer Looks Like: The contract contains internal checks (asserts or require statements) immediately after any state-changing operation that could potentially violate the total supply or balance invariants.
Question: Is the contract resilient to flash loan attacks or unexpected re-entrancy vectors?
- Why it Matters: Re-entrancy allows an attacker to recursively call a function before the original state update (like balance deduction) is complete, leading to repeated withdrawals. Flash loans allow attackers to manipulate state temporarily by borrowing and repaying huge amounts of capital, bypassing collateral checks.
- Good Answer Looks Like: The Checks-Effects-Interactions pattern is rigorously enforced (Checks first, update state/effects second, interact externally last). All external interactions involving asset transfers must be protected by proper callbacks or balance checks.
🛠️ Upgradeability and Upgrade Path Risks
Question: If the contract is upgradeable, what mechanisms prevent malicious actors from hijacking the proxy pattern?
- Why it Matters: The ability to upgrade a contract (often via a Proxy) is necessary for maintenance but introduces the single largest attack surface. If the admin key is compromised, the attacker can change the contract logic entirely.
- Good Answer Looks Like: Upgradeability is protected by multiple layers of control (e.g., a multisig requiring multiple keys, or a time-locked mechanism that enforces a waiting period before the upgrade can take effect).
Question: Are time-dependent functions (like voting periods or liquidation windows) implemented with robust, verifiable time sources, and is there a fallback mechanism if time sources fail?
- Why it Matters: Relying solely on
block.timestampcan be manipulated by miners/validators. Furthermore, if a critical period (like a voting window) is missed or stalls, the contract must fail gracefully, not execute accidentally. - Good Answer Looks Like: Time-sensitive logic uses reliable, accepted time sources (if applicable) and enforces strict temporal checks. Failure to meet time constraints results in a defined, safe failure state, rather than proceeding with ambiguous logic.
(2) Detailed Explanation of Rekt Test Sections
The explanations above cover the "Why it matters" and "Good answer looks like" components required by the prompt.
(3) Variations or Updated Versions (The 2026 Perspective)
Given the rapid evolution of the Ethereum Virtual Machine (EVM) and smart contract tooling, the Rekt Test continues to evolve. While I cannot provide a definitive "2026" checklist, the following trends and areas of focus are critical and represent how the test is likely to adapt:
- Focus on Formal Verification & Tooling: The emphasis is shifting from manual checklist items to verifiable properties. Developers are expected to integrate formal verification tools (like Certora or Found) into the audit process. The "good answer" increasingly involves submitting a formal proof that the contract adheres to its desired invariants under all conditions, not just manual code review.
- Account Abstraction (AA) and Social Recovery: As AA becomes standard, the security questions around identity are changing. The Rekt Test must now account for how the contract handles recovery of lost private keys or management keys using non-custodial, verifiable social recovery mechanisms, ensuring the private key isn't the single point of failure.
- Layer-2 and Cross-Chain Interoperability: With the rise of specialized Layer-2 solutions and bridging protocols, the test must heavily scrutinize cross-chain state transitions. Every bridge or communication channel between chains represents a potential trust assumption that must be auditable, proving that assets are locked and minted atomically on the destination chain.
- Zero-Knowledge Proof (ZKP) Implementation: For contracts utilizing ZK proofs, the security focus expands to the soundness and correctness of the SNARK/STARK circuit logic itself, ensuring that the proof mechanism cannot be fooled into accepting invalid statements.
(4) Attribution and Source URL
- Creator: Trail of Bits
- Nature: A comprehensive security framework/checklist rather than a single piece of code.
- Primary Source Reference: Trail of Bits' official blog, security whitepapers, and developer guides (The Rekt Test has been published and updated across multiple years and mediums; reference is best drawn from their general security best practices).
- Attribution Note: While the concepts are widely disseminated, referencing the original source material requires checking the official Trail of Bits documentation or their public GitHub repositories dedicated to security checklists.