1. Preamble
As a result of the analysis of the past contract hacks, and in particular the recent $12,400,000 hack of VultSX, it became obvious that the activity of security auditors does not sufficiently reduce the damage from the security vulnerabilities of smart-contracts.
As security auditors, we must not only check the code of contracts, but also make sure that the developer of the contract adheres to the best known security practices and the developer of the contract is aware of all the known risks associated with the use of the audited contract.
2. Types of contracts
There are two main types of smart-contracts aimed by hackers:
- Contracts that store funds (on-chain exchanges, wallets, ICO contracts, yield farming contracts, gambling DAPPs).
- Contracts that govern the logic of funds (mostly token contracts and NFTs)
A hacker can simply "withdraw" the funds from a storage contract in order to get profit. A hacker should somehow manipulate the logic of a fund-governing contract in order to get profit (i.e. transfer tokens on behalf of some user or mint new tokens to sell them on exchange).
Special attention needs to be paid to storage contracts as these are at a greater risk category. It would be helpful if the funds in a storage contract were insured.
3. Security practices to follow
Read DAPP security standards for reference.
Platform-specific issues (Ethereum-based)
Platform-specific issues (EOS)
4. Security Audit Report template extension
Conclusion must be moved from paragraph 4 to paragraph 5 ("4. Conclusion" -> "5. Conclusion").
Paragraph 4 must now be "4. Security practices".
Paragraph "4. Security practices" must contain the following checklist relevant for the auditable contract. If one of the points relevant for the contract is checked then it can be left without explanation. Otherwise if one of the points relevant for the audited contract is NOT fulfilled then the explanation of this point from paragraph 3. Security practices to follow (described above) must be included:
See a new ETH_audit_report_example.md.
1. Preamble
As a result of the analysis of the past contract hacks, and in particular the recent $12,400,000 hack of VultSX, it became obvious that the activity of security auditors does not sufficiently reduce the damage from the security vulnerabilities of smart-contracts.
As security auditors, we must not only check the code of contracts, but also make sure that the developer of the contract adheres to the best known security practices and the developer of the contract is aware of all the known risks associated with the use of the audited contract.
2. Types of contracts
There are two main types of smart-contracts aimed by hackers:
A hacker can simply "withdraw" the funds from a storage contract in order to get profit. A hacker should somehow manipulate the logic of a fund-governing contract in order to get profit (i.e. transfer tokens on behalf of some user or mint new tokens to sell them on exchange).
Special attention needs to be paid to storage contracts as these are at a greater risk category. It would be helpful if the funds in a storage contract were insured.
3. Security practices to follow
Read DAPP security standards for reference.
Platform-specific issues (Ethereum-based)
CREATE (0xf0)opcode is assigned following this schemekeccak256(rlp([sender, nonce])). Therefore you need to use the same address that was originally used at the main chain to deploy the mock contract at a transaction with thenoncethat matches that on the original chain. Example: If you have deployed your main contract with address 0x010101 at your 2021th transaction then you need to increase your nonce of 0x010101 address to 2020 at the chain where your mock contract will be deployed. Then you can deploy your mock contract with your 2021th transaction and it will receive the same address as your mainnet contract.Platform-specific issues (EOS)
on_notifyevent handlers can be triggered by any arbitrary contract to forward a carbon copy of a transaction to the recipient. Make sure to check the origin of theon_notifyevent.4. Security Audit Report template extension
Conclusion must be moved from paragraph 4 to paragraph 5 ("4. Conclusion" -> "5. Conclusion").
Paragraph 4 must now be "4. Security practices".
Paragraph "4. Security practices" must contain the following checklist relevant for the auditable contract. If one of the points relevant for the contract is checked then it can be left without explanation. Otherwise if one of the points relevant for the audited contract is NOT fulfilled then the explanation of this point from paragraph 3. Security practices to follow (described above) must be included:
owneraddress is a multisig] Multisig owner account.See a new ETH_audit_report_example.md.