skills/vulnerability-patterns/use-of-deprecated-functions/SKILL.md
- Contract uses Solidity functions, keywords, or language features that have been deprecated or removed
npx skillsauth add apegurus/solidity-argus use-of-deprecated-functionsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
pragma solidity ^0.4.24;
contract Legacy {
function destroy() external {
// suicide is deprecated — renamed to selfdestruct
// selfdestruct itself is now deprecated post-Dencun
suicide(msg.sender);
}
function getHash(bytes memory data) external view returns (bytes32) {
return sha3(data); // Deprecated — use keccak256
}
function getBlockHash(uint256 n) external view returns (bytes32) {
return block.blockhash(n); // Deprecated — use blockhash(n)
}
function getRemainingGas() external view returns (uint256) {
return msg.gas; // Deprecated — use gasleft()
}
}
| Deprecated | Replacement |
|---|---|
| suicide(address) | selfdestruct(address) (also deprecated) |
| block.blockhash(uint) | blockhash(uint) |
| sha3(...) | keccak256(...) |
| callcode(...) | delegatecall(...) |
| throw | revert() |
| msg.gas | gasleft() |
| constant (function modifier) | view |
| var | Explicit type name |
suicide, sha3, block.blockhash, callcode, throw, msg.gas, constant (as function modifier), varselfdestruct — while it's the replacement for suicide, it is itself deprecated post-Dencun and non-functional on some chainsselfdestruct: remove reliance entirely, as it is deprecated and non-functional on some chains post-Dencun// Modern equivalents
pragma solidity 0.8.24;
contract Modern {
function getHash(bytes memory data) external pure returns (bytes32) {
return keccak256(data);
}
function getBlockHash(uint256 n) external view returns (bytes32) {
return blockhash(n);
}
function getRemainingGas() external view returns (uint256) {
return gasleft();
}
}
testing
Specialist profile for mechanically applying the attack-vector deck and classifying vectors as skip, drop, or investigate.
tools
Specialist profile for libraries, helpers, base contracts, adapters, encoders, wrappers, and integration glue.
testing
Specialist profile for rounding, scale, decimal, downcast, and arithmetic accounting edge cases.
testing
Specialist profile for extracting conservation laws and state couplings, then searching for violating paths.