β Intro to Security First Development
Intro
This video showcased some vulnerable contracts.
Round 1
Vulnerable contract:
Mitigation: Pull-over-Push pattern
Round 2
Vulnerable contract:
Mitigation: Batches
Round 3
Vulnerable contract:
Mitigation: Checks-Effects-Interactions pattern
Round 4
Vulnerable:
Mitigation:
Round 5
Vulnerable contract:
Attacker can front-run user's buy() transaction by calling updatePrice() and pay higher gas. Attacker can set price much higher so that user receives no tokens.
Mitigation:
Permissions on key functions
Buyer specifies price
Timelocks
Round 6
Vulnerable contract:
Mitigation: Use Chainlink VRF.
Round 7
Vulnerable contract:
Mitigation: Use OpenZeppelin ERC20.
Last updated
Was this helpful?