Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 1.76 KB

SWC-111.md

File metadata and controls

32 lines (24 loc) · 1.76 KB

Title

Use of Deprecated Solidity Functions

Relationships

CWE-477: Use of Obsolete Function

Description

Several functions and operators in Solidity are deprecated. Using them leads to reduced code quality. With new major versions of the Solidity compiler, deprecated functions and operators may result in side effects and compile errors.

Remediation

Solidity provides alternatives to the deprecated constructions. Most of them are aliases, thus replacing old constructions will not break current behavior. For example, sha3 can be replaced with keccak256.

Deprecated Alternative
suicide(address) selfdestruct(address)
block.blockhash(uint) blockhash(uint)
sha3(...) keccak256(...)
callcode(...) delegatecall(...)
throw revert()
msg.gas gasleft
constant view
var corresponding type name

References