MultiSig Timelock

First Flight #55
Beginner FriendlyWallet
100 EXP
Submission Details
Impact: low
Likelihood: low

19Dec2025_AuditReport10_MultiSigTimelock

Author Revealed upon completion

Root + Impact

Description

Inefficient Storage Pattern in Transaction Struct

The Transaction struct is not optimally packed for storage efficiency. The bool 'executed' field takes a full storage slot when it could be packed with other fields. Additionally, storing the full 'bytes data' on-chain for every transaction is expensive and often unnecessary\

// Root cause in the codebase with @> marks to highlight the relevant section
struct Transaction {
address to; // Slot 1: 20 bytes
uint256 value; // Slot 2: 32 bytes
bytes data; // Slot 3+: Dynamic
uint256 confirmations; // Slot N: 32 bytes
uint256 proposedAt; // Slot N+1: 32 bytes
bool executed; // Slot N+2: 1 byte (wastes 31 bytes)
}

Risk

Likelihood:

  • Creating a transaction with the current struct costs approximately 100,000+ gas for storage, when it could be reduced by 20-30% with better packing.

Impact:

  • Each transaction costs more gas to store than necessary. With many transactions, this adds up to significant wasted gas.

Proof of Concept

struct Transaction {
address to; // Slot 1: 20 bytes
uint256 value; // Slot 2: 32 bytes
bytes data; // Slot 3+: Dynamic
uint256 confirmations; // Slot N: 32 bytes
uint256 proposedAt; // Slot N+1: 32 bytes
bool executed; // Slot N+2: 1 byte (wastes 31 bytes)
}

Recommended Mitigation

Optimize struct packing:

struct Transaction {
address to; // Slot 1: 20 bytes
uint96 value; // Slot 1: 12 bytes (enough for ~79 billion ETH)
uint128 proposedAt; // Slot 2: 16 bytes (enough until year 10,889)
uint120 confirmations; // Slot 2: 15 bytes (enough for counting)
bool executed; // Slot 2: 1 byte
bytes32 dataHash; // Slot 3: 32 bytes (store hash instead of data)
}
// Store full data separately only when needed
mapping(uint256 => bytes) private s_transactionData;

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!