Swapper Deposit
swapperfinance/swapper-toolkit
Deposit and bridge funds into a wallet or protocol using Swapper Finance.
Economic attack vectors and defenses for DeFi protocols. An agent skill from ccashwell/evm-cortex.
$ npx skills add ccashwell/evm-cortex --skill economic-attack-vectors -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ccashwell/evm-cortex economic-attack-vectors --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/economic-attack-vectors .claude/skills/economic-attack-vectors && rm -rf skills-srcUse ~/.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/
Install the "economic-attack-vectors" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/economic-attack-vectors into .claude/skills/economic-attack-vectors/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "economic-attack-vectors", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ccashwell/evm-cortex/tree/main/skills/economic-attack-vectorsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ccashwell/evm-cortex --skill economic-attack-vectors -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ccashwell/evm-cortex economic-attack-vectors --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/economic-attack-vectors .agents/skills/economic-attack-vectors && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "economic-attack-vectors" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/economic-attack-vectors into .agents/skills/economic-attack-vectors/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "economic-attack-vectors", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ccashwell/evm-cortex --skill economic-attack-vectors -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ccashwell/evm-cortex economic-attack-vectors --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/economic-attack-vectors .cursor/skills/economic-attack-vectors && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "economic-attack-vectors" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/economic-attack-vectors into .cursor/skills/economic-attack-vectors/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "economic-attack-vectors", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ccashwell/evm-cortex.git --path skills/economic-attack-vectors--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ccashwell/evm-cortex --skill economic-attack-vectors -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ccashwell/evm-cortex economic-attack-vectors --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/economic-attack-vectors .gemini/skills/economic-attack-vectors && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "economic-attack-vectors" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/economic-attack-vectors into .gemini/skills/economic-attack-vectors/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "economic-attack-vectors", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ccashwell/evm-cortex economic-attack-vectorsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ccashwell/evm-cortex --skill economic-attack-vectors -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/economic-attack-vectors .github/skills/economic-attack-vectors && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "economic-attack-vectors" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/economic-attack-vectors into .github/skills/economic-attack-vectors/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "economic-attack-vectors", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ccashwell/evm-cortex --skill economic-attack-vectors -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ccashwell/evm-cortex economic-attack-vectors --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/economic-attack-vectors .opencode/skills/economic-attack-vectors && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "economic-attack-vectors" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/economic-attack-vectors into .opencode/skills/economic-attack-vectors/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "economic-attack-vectors", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
economic-attack-vectorsEconomic attack vectors and defenses for DeFi protocols. An agent skill from ccashwell/evm-cortex.
Economic Attack Vectors is an agent skill from ccashwell/evm-cortex. Economic attack vectors and defenses for DeFi protocols. Use when designing vaults, lending pools, AMMs, or any system with share-based accounting. Covers first depositor inflation, donation attacks, sandwich attacks on liquidity, JIT liquidity, and flash loan leveraged attacks.
Its SKILL.md is about 1.7k 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 Business, Finance & HR, covering Accounting and bookkeeping, Banking and insurance and Crypto and DeFi analysis. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.
Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.
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.
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.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Economic Attack Vectors loads about 1.7k tokens when it runs. Until then it costs about 76 tokens; SKILL.md has 206 words of instructions outside code blocks.
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.
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.
The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 206 words, ~1,712 tokens.
.claude/skills/economic-attack-vectors/SKILL.md (or your agent's skills folder).The most common vault attack. The first depositor can manipulate the share price to steal from subsequent depositors.
1. Attacker deposits 1 wei → receives 1 share
2. Attacker donates 1e18 tokens directly to vault (not via deposit)
3. Vault state: 1 share, (1 + 1e18) assets
4. Victim deposits 1.5e18 tokens
5. Shares minted = 1.5e18 * 1 / (1 + 1e18) = 0 shares (rounds to 0)
6. Attacker redeems 1 share → gets all 2.5e18 tokens
7. Victim loses ~1.5e18 tokenscontract SafeVault is ERC4626 {
uint256 private constant VIRTUAL_SHARES = 1e3; // 1000 virtual shares
uint256 private constant VIRTUAL_ASSETS = 1; // 1 virtual asset
function totalAssets() public view override returns (uint256) {
return IERC20(asset()).balanceOf(address(this)) + VIRTUAL_ASSETS;
}
function _decimalsOffset() internal pure override returns (uint8) {
return 3; // adds 1e3 virtual shares
}
}uint256 public constant MIN_INITIAL_DEPOSIT = 1e6; // 1 USDC or equivalent
function deposit(uint256 assets, address receiver) public override returns (uint256 shares) {
if (totalSupply() == 0 && assets < MIN_INITIAL_DEPOSIT) {
revert InitialDepositTooSmall();
}
return super.deposit(assets, receiver);
}Lock a small amount of shares on first deposit to establish a non-manipulable base.
function _afterDeposit(uint256 assets, uint256 shares) internal override {
if (totalSupply() == shares) {
// First deposit — burn some shares to dead address
uint256 deadShares = 1e3;
_mint(address(0xdead), deadShares);
}
}An attacker sends tokens directly to a contract (via transfer, not deposit) to manipulate internal accounting.
// VULNERABLE: relies on balanceOf for accounting
function getExchangeRate() public view returns (uint256) {
return IERC20(asset).balanceOf(address(this)) / totalShares;
// Attacker can inflate by donating tokens
}
// SAFE: track deposits explicitly
uint256 public totalManagedAssets;
function deposit(uint256 amount) external {
totalManagedAssets += amount;
IERC20(asset).safeTransferFrom(msg.sender, address(this), amount);
}
function getExchangeRate() public view returns (uint256) {
return totalManagedAssets / totalShares; // not manipulable via donation
}Manipulating the share price (assets per share) to extract value.
// Attack on lending protocol:
// 1. Deposit collateral, borrow assets
// 2. Donate to vault → inflate share price
// 3. Collateral (measured in shares) appears more valuable
// 4. Borrow more than collateral is worth
// 5. Default on the loan
// Defense: use internal accounting, not balanceOf
// Defense: price oracle for share valuation (not instantaneous price)1. Attacker sees victim's addLiquidity TX in mempool
2. Front-run: large swap moves the price
3. Victim adds liquidity at skewed ratio
4. Back-run: attacker swaps back, profiting from the imbalancefunction addLiquidity(
uint256 amount0Desired,
uint256 amount1Desired,
uint256 amount0Min, // minimum token0 actually deposited
uint256 amount1Min, // minimum token1 actually deposited
uint256 deadline
) external returns (uint256 liquidity) {
if (block.timestamp > deadline) revert Expired();
(uint256 amount0, uint256 amount1) = _calculateOptimalAmounts(
amount0Desired, amount1Desired
);
if (amount0 < amount0Min) revert InsufficientAmount0();
if (amount1 < amount1Min) revert InsufficientAmount1();
// ...
}MEV searchers add concentrated liquidity just before a large swap and remove it immediately after, capturing swap fees without taking long-term IL risk.
// Defense: time-weighted fee distribution
mapping(uint256 => uint256) public positionMintBlock;
function collectFees(uint256 positionId) external {
uint256 mintBlock = positionMintBlock[positionId];
uint256 blocksActive = block.number - mintBlock;
if (blocksActive < MIN_ACTIVE_BLOCKS) {
revert PositionTooNew(blocksActive, MIN_ACTIVE_BLOCKS);
}
// Fees are proportional to time * liquidity, not just liquidity
}Flash loans amplify any profitable attack by providing unlimited capital.
// Generic pattern:
// 1. Flash borrow X tokens
// 2. Use X to manipulate state (price, governance, collateral)
// 3. Extract profit from manipulated state
// 4. Return X + fee
// Defense principle: any state that can be profitably manipulated
// with temporary capital must be resistant to single-block manipulation
// Specific defenses:
// - Time-weighted readings (TWAP, voting snapshots)
// - Multi-block delays (deposit → borrow separation)
// - Rate limiting (max action per block)// Attack: borrow governance tokens → propose + vote → drain treasury
// Defense: snapshot voting + proposal threshold + voting delay
// Attack: buy tokens → vote → dump tokens
// Defense: time-locked voting power (must hold tokens for N blocks)
function getVotingPower(address account) public view returns (uint256) {
uint256 balance = token.balanceOf(account);
uint256 holdDuration = block.number - firstPurchaseBlock[account];
if (holdDuration < MIN_HOLD_BLOCKS) return 0;
// Optional: voting power scales with hold time
uint256 multiplier = Math.min(holdDuration / BLOCKS_PER_MONTH, MAX_MULTIPLIER);
return balance * multiplier / MAX_MULTIPLIER;
}balanceOf for internal accounting© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/economic-attack-vectors of ccashwell/evm-cortex.
Open the folder on GitHubat commit f8f3301
Economic Attack Vectors 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Economic Attack Vectors this skillccashwell/evm-cortex | 131 | — | ~1.7k | Automated safety check: Pass | MIT | |
| Swapper Depositswapperfinance/swapper-toolkit | 852 | — | ~1.8k | Automated safety check: Pass | MIT | |
| Okx Cex Earnokx/agent-skills | 186 | 2 repos | ~3.3k | Automated safety check: Pass | MIT | |
| Oracle Flashloan Analysisquillai-network/quillshield_skills | 130 | — | ~2.8k | Automated safety check: Pass | MIT | |
| Squadsinternet-court/internet-court-skill | 6.5k | 2 repos | ~5.9k | Automated safety check: Pass | Apache-2.0 | |
| Starknet Defiinternet-court/internet-court-skill | 6.5k | 1 repos | ~2.3k | Automated safety check: Notes | Apache-2.0 |
swapperfinance/swapper-toolkit
Deposit and bridge funds into a wallet or protocol using Swapper Finance.
okx/agent-skills
Manages OKX Simple Earn (flexible savings/lending), Flash Earn, On-chain Earn (staking/DeFi), Dual Investment (DCD/双币赢), and AutoEarn (自动赚币) via the okx CLI.
quillai-network/quillshield_skills
Detects price oracle manipulation and flash loan attack vectors in DeFi smart contracts.
internet-court/internet-court-skill
Complete guide for Squads Protocol - Solana's leading smart account and multisig infrastructure.
internet-court/internet-court-skill
Execute DeFi operations on Starknet including token swaps via avnu aggregator, DCA recurring buys, STRK staking, and lending/borrowing.
Signal-Execution-Labs/forex-trading-ai-agent
Connect to DeFi protocols for staking, lending, yield farming, and liquidity provision.
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.
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.
ccashwell/evm-cortex
Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.
ccashwell/evm-cortex
A skill your agent uses when running a local Ethereum node with Anvil.
ccashwell/evm-cortex
A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.
ccashwell/evm-cortex
A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.
Categories
Economic attack vectors and defenses for DeFi protocols. An agent skill from ccashwell/evm-cortex. Economic Attack Vectors is an agent skill from ccashwell/evm-cortex. Economic attack vectors and defenses for DeFi protocols.
Economic Attack Vectors fits situations like: designing vaults; any system with share-based accounting.
Run `npx skills add ccashwell/evm-cortex --skill economic-attack-vectors -a claude-code`. Or copy the skill folder (skills/economic-attack-vectors in ccashwell/evm-cortex) into .claude/skills/economic-attack-vectors in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ccashwell/evm-cortex --skill economic-attack-vectors -a codex`. Or copy the skill folder (skills/economic-attack-vectors in ccashwell/evm-cortex) into .agents/skills/economic-attack-vectors in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill economic-attack-vectors -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/economic-attack-vectors, .gemini/skills/economic-attack-vectors, .github/skills/economic-attack-vectors and .opencode/skills/economic-attack-vectors in your project.
SKILL.md names no scripts, command-line tools or credentials: Economic Attack Vectors is instructions for the agent only.
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.
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.
Economic Attack Vectors is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.7k tokens (SKILL.md is roughly 6.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Economic Attack Vectors: Swapper Deposit (swapperfinance/swapper-toolkit, 852 stars), Okx Cex Earn (okx/agent-skills, 186 stars), Oracle Flashloan Analysis (quillai-network/quillshield_skills, 130 stars) and Squads (internet-court/internet-court-skill, 6.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
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.