Skip to main content
Glama
apolosan

Design Patterns MCP Server

by apolosan
checks-effects-interactions.json1.04 kB
{ "id": "checks-effects-interactions", "name": "Checks-Effects-Interactions", "category": "Smart Contract Security", "description": "Prevents reentrancy attacks by ordering function execution Problem: Reentrancy attacks where external calls allow malicious state manipulation", "when_to_use": "Order operations: checks → effects → interactions", "benefits": "Prevents reentrancy, secure by design, industry standard", "drawbacks": "Requires discipline, code refactoring needed", "use_cases": "Withdrawal functions, ETH transfers, external calls in DeFi", "complexity": "Low", "tags": [ "security", "reentrancy", "solidity", "defi", "best-practice" ], "examples": { "solidity": { "language": "solidity", "code": "function withdraw(uint256 amount) public {\n require(balances[msg.sender] >= amount); // Checks\n balances[msg.sender] -= amount; // Effects\n (bool success,) = msg.sender.call{value: amount}(\"\"); // Interactions\n require(success);\n}" } } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/apolosan/design_patterns_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server