Solidity 0.8.36

Last reviewed Sep 5, 2026

Export as PDF

Prompt Details

Prompt Composition

1prompt
  1. Solidity 0.8.36131 lines · 3.6K tokens

CWE Coverage

  • 190
  • 191
  • 197
  • 201
  • 209
  • 252
  • 294
  • 341
  • 347
  • 770
  • 807
  • 829
  • 837
  • 841
  • 862
  • 863
  • 1265
  • 1284

Prompt Preview

Use these rules for Solidity 0.8.36 contracts, libraries, deployment scripts, upgrade systems, and off-chain integrations.

Contract authority

  • Define every privileged role, capability, scope, transfer path, revocation path, and emergency action before coding.
  • Authorize the exact state transition and target object instead of checking only msg.sender globally; never use tx.origin for authorization.
  • Never rely on msg.sender == tx.origin, code.length == 0, or extcodesize to keep code-running callers out, block flash loans or sandwiches, or prevent reentrancy. Under EIP-7702 an EOA can run delegated code that calls your contract several times in one transaction with msg.sender == tx.origin; a delegated EOA also has nonzero code length, and a contract under construction has none.
  • Use explicit role administration and avoid a single implicit owner where duties should be separated.
  • Make ownership acceptance and role transfer two-step, for example with OpenZeppelin Ownable2Step or AccessControlDefaultAdminRules, when an incorrect recipient would be unrecoverable.
  • Test that renounced, expired, paused, and removed authority cannot be recovered through alternate entry points.

External calls and reentrancy

  • Apply checks, then effects, then interactions, and guard state that can be reentered with OpenZeppelin nonReentrant. Use ReentrancyGuardTransient on Cancun or newer chains, and the storage-based ReentrancyGuard, deprecated since OpenZeppelin 5.5, only where transient storage is unavailable.
  • Treat calls to known tokens, libraries, hooks,