Agent skill

Time Manipulation

by ccashwell in ccashwell/evm-cortex

Time-based vulnerability patterns and safe usage for Solidity contracts.

MITAuto-check passedBackend & APIs

Install Time Manipulation

skills CLI
$ npx skills add ccashwell/evm-cortex --skill time-manipulation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ccashwell/evm-cortex time-manipulation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/time-manipulation .claude/skills/time-manipulation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
time-manipulation
GitHub stars
131
Token cost
~1.9k tokens
SKILL.md length
178 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Time-based vulnerability patterns and safe usage for Solidity contracts.

  • Implementing unlock schedules
  • SKILL.md covers block.timestamp Manipulation, Time-Dependent Logic Risks, Epoch Boundary Attacks and Dutch Auction Time Manipulation, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Any time-dependent logic

What it does

Time Manipulation is an agent skill from ccashwell/evm-cortex. Time-based vulnerability patterns and safe usage for Solidity contracts. Use when implementing unlock schedules, cooldowns, auctions, or any time-dependent logic. Covers block.timestamp manipulation, epoch boundary attacks, and safe time patterns.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Smart contracts. It works with Solidity. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Implementing unlock schedules
  • Any time-dependent logic

Example prompts

  • “/time-manipulation”

What it can do on your machine

Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are solidity).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Time Manipulation loads about 1.9k tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 178 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~66
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 178 words, ~1,855 tokens.

Download SKILL.mdSave it as .claude/skills/time-manipulation/SKILL.md (or your agent's skills folder).
name
time-manipulation
description
Time-based vulnerability patterns and safe usage for Solidity contracts. Use when implementing unlock schedules, cooldowns, auctions, or any time-dependent logic. Covers block.timestamp manipulation, epoch boundary attacks, and safe time patterns.

Time Manipulation

block.timestamp Manipulation

Validators/miners have limited control over block.timestamp:

  • Must be greater than parent block's timestamp
  • Must be within ~15 seconds of real time (consensus rule)
  • Post-merge: fixed 12-second slots, but validator chooses timestamp within bounds
solidity
// Safe for: time ranges > 15 seconds
// Unsafe for: precise sub-minute timing, randomness

// VULNERABLE: exact-second conditions
if (block.timestamp == auctionEnd) { ... } // may never be true

// SAFE: range-based conditions
if (block.timestamp >= auctionEnd) { ... } // will always become true

Time-Dependent Logic Risks

Unlock Schedule Gaming
solidity
// VULNERABLE: cliff unlock at exact timestamp
function claimVested() external {
    if (block.timestamp < cliff) revert NotVested();
    uint256 amount = totalAllocation; // full amount at cliff
    _transfer(msg.sender, amount);
}

// Risk: validator can set timestamp to just past cliff in their block
// This allows early claiming relative to wall clock time

// SAFE: linear vesting reduces impact of timestamp manipulation
function claimVested() external {
    uint256 elapsed = block.timestamp - vestingStart;
    if (elapsed == 0) revert NotVested();

    uint256 totalDuration = vestingEnd - vestingStart;
    uint256 vested = totalAllocation * Math.min(elapsed, totalDuration) / totalDuration;
    uint256 claimable = vested - alreadyClaimed[msg.sender];

    if (claimable == 0) revert NothingToClaim();

    alreadyClaimed[msg.sender] += claimable;
    token.safeTransfer(msg.sender, claimable);
}
Cooldown Bypass
solidity
// VULNERABLE: short cooldown can be bypassed by timestamp manipulation
uint256 public constant COOLDOWN = 30 seconds;

mapping(address => uint256) public lastAction;

function doAction() external {
    if (block.timestamp - lastAction[msg.sender] < COOLDOWN) revert Cooldown();
    lastAction[msg.sender] = block.timestamp;
    // A validator can set timestamp 30s ahead to bypass cooldown
}

// SAFER: use block numbers for short cooldowns
uint256 public constant COOLDOWN_BLOCKS = 3; // ~36 seconds

mapping(address => uint256) public lastActionBlock;

function doAction() external {
    if (block.number - lastActionBlock[msg.sender] < COOLDOWN_BLOCKS) revert Cooldown();
    lastActionBlock[msg.sender] = block.number;
}

Epoch Boundary Attacks

Protocols with discrete time periods (epochs, rounds) are vulnerable at boundaries.

solidity
// VULNERABLE: reward rate changes at epoch boundary
function getRewardRate() public view returns (uint256) {
    uint256 epoch = block.timestamp / EPOCH_DURATION;
    return epochRewardRates[epoch];
}

// Attack: validator manipulates timestamp to straddle epochs
// Deposit at end of high-reward epoch, claim, withdraw at start of next

// DEFENSE: actions locked near epoch boundaries
uint256 public constant BOUNDARY_BUFFER = 5 minutes;

function deposit(uint256 amount) external {
    uint256 timeInEpoch = block.timestamp % EPOCH_DURATION;
    if (timeInEpoch > EPOCH_DURATION - BOUNDARY_BUFFER) revert NearEpochBoundary();
    if (timeInEpoch < BOUNDARY_BUFFER) revert NearEpochBoundary();
    // safe to deposit
}

Dutch Auction Time Manipulation

solidity
// Dutch auction: price decreases over time
// Validator can manipulate timestamp to get a lower price

function getCurrentPrice() public view returns (uint256) {
    uint256 elapsed = block.timestamp - auctionStart;
    if (elapsed >= auctionDuration) return reservePrice;

    uint256 priceRange = startPrice - reservePrice;
    return startPrice - (priceRange * elapsed / auctionDuration);
}

// Impact: validator gains at most ~15 seconds of price decrease
// For most auction speeds, this is negligible
// For very fast auctions (price drops rapidly), use block numbers instead

block.number vs block.timestamp

Featureblock.numberblock.timestamp
ManipulationNot manipulable~15s drift
PrecisionPer-block (12s)Per-second
Cross-chainInconsistentMore consistent
Post-mergeFixed intervalFixed interval
Use forShort cooldowns, orderingLong durations, deadlines
solidity
// block.number: use for short-duration, manipulation-sensitive logic
// block.timestamp: use for long-duration, human-readable deadlines

// Short cooldown: use blocks
uint256 public constant WITHDRAWAL_DELAY_BLOCKS = 50; // ~10 minutes

// Long deadline: use timestamp
uint256 public constant PROPOSAL_DURATION = 7 days;

Safe Time Patterns

Time-Locked Actions
solidity
struct TimeLock {
    uint48 executeAfter;
    bool executed;
}

uint256 public constant MIN_DELAY = 2 days;

mapping(bytes32 => TimeLock) public timelocks;

function schedule(bytes32 actionId) external onlyOwner {
    timelocks[actionId] = TimeLock({
        executeAfter: uint48(block.timestamp + MIN_DELAY),
        executed: false
    });
    emit ActionScheduled(actionId, block.timestamp + MIN_DELAY);
}

function execute(bytes32 actionId) external onlyOwner {
    TimeLock storage lock = timelocks[actionId];
    if (lock.executeAfter == 0) revert NotScheduled();
    if (lock.executed) revert AlreadyExecuted();
    if (block.timestamp < lock.executeAfter) revert TooEarly();

    lock.executed = true;
    _executeAction(actionId);
}
Deadline Pattern
solidity
modifier beforeDeadline(uint256 deadline) {
    if (block.timestamp > deadline) revert Expired(deadline);
    _;
}

// Always use >= for "ready" checks, > for expiry checks
function isReady(uint256 readyAt) internal view returns (bool) {
    return block.timestamp >= readyAt;
}

function isExpired(uint256 deadline) internal view returns (bool) {
    return block.timestamp > deadline;
}
Rate Limiting
solidity
struct RateLimit {
    uint48 lastAction;
    uint16 actionsInWindow;
}

uint256 public constant WINDOW = 1 hours;
uint256 public constant MAX_ACTIONS_PER_WINDOW = 10;

mapping(address => RateLimit) public rateLimits;

function checkRateLimit(address user) internal {
    RateLimit storage limit = rateLimits[user];

    if (block.timestamp - limit.lastAction > WINDOW) {
        // New window
        limit.actionsInWindow = 1;
        limit.lastAction = uint48(block.timestamp);
    } else {
        if (limit.actionsInWindow >= MAX_ACTIONS_PER_WINDOW) {
            revert RateLimitExceeded();
        }
        limit.actionsInWindow += 1;
    }
}

Time Safety Checklist

  • No exact-time equality checks (== on timestamps)
  • >= for "ready" checks, > for expiry checks
  • Short cooldowns use block numbers, not timestamps
  • Long durations use timestamps for readability
  • Linear vesting preferred over cliff vesting (reduces manipulation impact)
  • Epoch boundaries have buffer zones
  • Deadline parameters on all time-sensitive user operations
  • Timelocks have minimum delays that cannot be reduced by governance
  • No use of block.timestamp for randomness
  • Dutch auctions: price decrease per 15s is acceptable loss

© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/time-manipulation of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Time Manipulation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Time Manipulation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Time Manipulation this skillccashwell/evm-cortex131—~1.9kAutomated safety check: PassMIT
Fizz Convertpashov/skills1.2k2 repos~3.7kAutomated safety check: PassMIT
Feynman Auditor0xiehnnkta/nemesis-auditor2431 repos~11kAutomated safety check: PassMIT
Smart Contract Auditgreatpie/smart-contract-audit-skill101—~1.1kAutomated safety check: PassNone
RadarAuditware/radar154—~2.1kAutomated safety check: PassGPL-3.0
Solidity AuditorGabson0x/bountyforge443—~3.7kAutomated safety check: PassNone

Similar skills

  • Fizz Convert

    pashov/skills

    Convert English-language properties in PROPERTIES.md (produced by the Fizz skill) into Solidity assertions inside the existing fuzz harness, then flip their checkboxes.

    1.2k GitHub starsUsed in 2 repos~3.7k tokens
    Backend & APIsAuto-check passed
  • Feynman Auditor

    0xiehnnkta/nemesis-auditor

    Deep business logic bug finder using the Feynman technique. An agent skill from 0xiehnnkta/nemesis-auditor.

    243 GitHub starsUsed in 1 repo~11k tokens
    Backend & APIsAuto-check passed
  • Smart Contract Audit

    greatpie/smart-contract-audit-skill

    Script-backed, out-of-box auditing workflow for Solidity/EVM repositories based on EVMbench detect/patch/exploit methodology.

    101 GitHub stars~1.1k tokensUpdated 7 mo ago
    Backend & APIsAuto-check passed
  • Radar

    Auditware/radar

    Use radar for smart contract security analysis, AST generation, and detection template development.

    154 GitHub stars~2.1k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Solidity Auditor

    Gabson0x/bountyforge

    Security audit of Solidity code while you develop. An agent skill from Gabson0x/bountyforge.

    443 GitHub stars~3.7k tokensUpdated 22 days ago
    Backend & APIsAuto-check passed
  • Solidity Auditor

    pashov/skills

    Security audit of Solidity code while you develop. An agent skill from pashov/skills.

    1.2k GitHub starsUsed in 1 repo~9.9k tokens
    Backend & APIsAuto-check passed

More from ccashwell/evm-cortex

All 89 skills in this repo
  • Xray Pre Audit

    ccashwell/evm-cortex

    A skill your agent uses when preparing for a security audit, performing reconnaissance on a new codebase, or creating a protocol overview.

    131 GitHub stars~25k tokensUpdated 8 days ago
    Auto-check passed
  • Aave Integration

    ccashwell/evm-cortex

    A skill your agent uses when integrating with Aave V3 for lending, borrowing, flash loans, or building on top of Aave markets.

    131 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Access Control Patterns

    ccashwell/evm-cortex

    Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.

    131 GitHub stars~1.8k tokensUpdated 8 days ago
    Auto-check passed
  • Anvil Patterns

    ccashwell/evm-cortex

    A skill your agent uses when running a local Ethereum node with Anvil.

    131 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Audit Breadth Scan

    ccashwell/evm-cortex

    A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.

    131 GitHub stars~1.4k tokensUpdated 8 days ago
    Auto-check passed
  • Audit Depth Analysis

    ccashwell/evm-cortex

    A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.

    131 GitHub stars~1.6k tokensUpdated 8 days ago
    Auto-check passed

Works with

Categories

Questions about Time Manipulation

What does Time Manipulation do?

Time-based vulnerability patterns and safe usage for Solidity contracts. Time Manipulation is an agent skill from ccashwell/evm-cortex. Time-based vulnerability patterns and safe usage for Solidity contracts.

When should I use Time Manipulation?

Time Manipulation fits situations like: implementing unlock schedules; any time-dependent logic.

How do I install Time Manipulation in Claude Code?

Run `npx skills add ccashwell/evm-cortex --skill time-manipulation -a claude-code`. Or copy the skill folder (skills/time-manipulation in ccashwell/evm-cortex) into .claude/skills/time-manipulation in your project. Claude Code loads it when a task matches its description.

How do I install Time Manipulation in Codex?

Run `npx skills add ccashwell/evm-cortex --skill time-manipulation -a codex`. Or copy the skill folder (skills/time-manipulation in ccashwell/evm-cortex) into .agents/skills/time-manipulation in your project. Codex loads it when a task matches its description.

Can I use Time Manipulation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill time-manipulation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/time-manipulation, .gemini/skills/time-manipulation, .github/skills/time-manipulation and .opencode/skills/time-manipulation in your project.

What does Time Manipulation need to run?

SKILL.md names no scripts, command-line tools or credentials: Time Manipulation is instructions for the agent only.

Does Time Manipulation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Time Manipulation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Time Manipulation use?

Time Manipulation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Time Manipulation use?

About 1.9k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Time Manipulation?

Skills that share tags, products or a category with Time Manipulation: Fizz Convert (pashov/skills, 1.2k stars), Feynman Auditor (0xiehnnkta/nemesis-auditor, 243 stars), Smart Contract Audit (greatpie/smart-contract-audit-skill, 101 stars) and Radar (Auditware/radar, 154 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Time Manipulation?

ccashwell (a GitHub user) maintains it in ccashwell/evm-cortex, which has 131 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on September 30, 2026.

Source: ccashwell/evm-cortex on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.