How to Perform and Prevent DOS Attack by rejecting Ether – Practical example

Today we’ll see How to perform and prevent Dos-Attack by rejecting Ether.

I’ll show a practical example of a contract vulnerable to dos attack by rejecting ether and how to prevent this attack by using a design pattern called pull over push pattern

we’ll perform dos attack where the currentLeader is a contract address (the attacker contract) that cannot receive ether.

And when anyone else tries to become the current leader they can’t because the transaction will revert because our contract cannot receive ether(forever).

So we cannot set new currentLeader forever.

——————————————————————————————————–
⚠️ Don’t click this link – https://www.youtube.com/channel/UCmI997WuJrWc5CXeRGqCQlQ?sub_confirmation=1
——————————————————————————————————–

💻 Source code –

[Link to gist](https://gist.github.com/ViktorKuzmanov/a79e6f1f4ee647f43a297716a7d0e7c2)

Buy Trezor Hardware Wallet – https://shop.trezor.io/product/trezor-one-black?offer_id=35&aff_id=9504
——————————————————————————————————-

Disclaimer: When you purchase through links on our site I may earn an affiliate commission.

Disclaimer 2: Anything I say in this video is not financial advice, it’s for entertainment and educational purposes only. I’m not a financial advisor.

(Visited 20 times, 1 visits today)

You might be interested in

LEAVE YOUR COMMENT

Your email address will not be published. Required fields are marked *

eos
EOS (EOS) 0,764290 5,58%
aave
Aave (AAVE) 83,55 1,39%
the-graph
The Graph (GRT) 0,243383 0,55%
kusama
Kusama (KSM) 27,39 1,74%
waves
Waves (WAVES) 2,24 0,32%
dash
Dash (DASH) 28,21 2,33%
bitcoin
Bitcoin (BTC) 59.965,72 1,29%
ethereum
Ethereum (ETH) 2.926,81 1,72%
cardano
Cardano (ADA) 0,436383 0,63%
tether
Tether (USDT) 0,931146 0,07%
xrp
XRP (XRP) 0,487803 1,10%
solana
Solana (SOL) 133,62 0,57%
polkadot
Polkadot (DOT) 6,40 1,78%
usd-coin
USDC (USDC) 0,932100 0,03%
dogecoin
Dogecoin (DOGE) 0,140272 1,56%
uniswap
Uniswap (UNI) 7,18 0,74%
terra-luna
Terra Luna Classic (LUNC) 0,000100 5,62%
litecoin
Litecoin (LTC) 79,41 2,67%
chainlink
Chainlink (LINK) 13,60 0,81%
bitcoin-cash
Bitcoin Cash (BCH) 446,36 1,53%
algorand
Algorand (ALGO) 0,190029 0,99%
matic-network
Polygon (MATIC) 0,663167 2,08%
stellar
Stellar (XLM) 0,105365 0,76%
cosmos
Cosmos Hub (ATOM) 7,65 0,71%
filecoin
Filecoin (FIL) 5,57 1,77%
tron
TRON (TRX) 0,110011 3,14%
ethereum-classic
Ethereum Classic (ETC) 25,16 4,09%
dai
Dai (DAI) 0,930720 0,06%
tezos
Tezos (XTZ) 0,937693 1,03%
monero
Monero (XMR) 111,89 2,00%