mirror of
https://github.com/autistic-symposium/blockchains-security-toolkit.git
synced 2025-10-23 18:46:04 -04:00
| .. | ||
| arithmetic_errors | ||
| ddos | ||
| delegatecall | ||
| nonce | ||
| randomness | ||
| reentrancy_attacks | ||
| replay_attacks | ||
| self_destruct | ||
| README.md | ||
smart contract vulnerabilities
initial thoughts
tx.originneeds to be replaced bymsg.sender, otherwise any contract you call can act on your behalf.- inline assembly should be used only in rare cases.
- unclear semantics:
nowis alias forblock.timestampnot current time; use of low levelcall,callcode,delegatecallshould be avoided whenever possible; usetransferwhenever failure of ether transfer should rollback the whole transaction. - beware of caller contracts:
selfdestructcan block calling contracts unexpectedly. - invocation of local functions via
this: never usethisto 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 avoided due to the block gas limit.
- erc20
decimalsshould haveuint8as return type.
chapters
- reentrancy
- randomness in ethereum
- code injection via
delegatecall - arithmetic errors
- self_destruct
- ddos attacks
- nonce reuse
- replay attacks