mirror of
https://github.com/autistic-symposium/blockchains-security-toolkit.git
synced 2025-05-12 11:42:15 -04:00
.. | ||
delegatecall | ||
nonce | ||
reentrancy_attacks | ||
ddos.md | ||
random_numbers.md | ||
README.md |
smart contract vulnerabilities
tl; dr
tx.origin
needs to bere placed bymsg.sender
, otherwise any contract you call can act on your behalf.- inline assembly should be used only in rare cases.
- unclear semantics:
now
is alias forblock.timestamp
not current time; use of low levelcall
,callcode
,delegatecall
should be avoided whenever possible; usetransfer
whenever failure of ether transfer should rollnack the whole transaction. - beware of caller contracts:
selfdestruct
can block calling contracts unexpectedly. - invocation of local functions via
this
: never usethis
to call functions in the same contract, it only consumes more gas than normal call. - transferring Ether in a for/while/do-while loop should be avoid due to the block gas limit.
- erc20
decimals
should haveuint8
as return type.
in this dir
resources
- secureum-mind-map
- defi hacks & exploits
- ethereum smart contract security best practices
- [biased nonce sense lattice attacks against weak ECDSA](https://www.youtube.com/watch?v=6ssTlSSIJQE_