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 3 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,882523 1,27%
aave
Aave (AAVE) 60,29 2,93%
the-graph
The Graph (GRT) 0,060505 2,60%
kusama
Kusama (KSM) 28,05 3,46%
waves
Waves (WAVES) 2,22 2,49%
dash
Dash (DASH) 43,13 1,34%
bitcoin
Bitcoin (BTC) 16.146,21 0,18%
ethereum
Ethereum (ETH) 1.194,57 2,36%
cardano
Cardano (ADA) 0,307295 1,54%
tether
Tether (USDT) 0,948776 0,08%
xrp
XRP (XRP) 0,372766 0,56%
solana
Solana (SOL) 12,84 0,68%
polkadot
Polkadot (DOT) 5,26 1,65%
usd-coin
USD Coin (USDC) 0,947184 0,25%
dogecoin
Dogecoin (DOGE) 0,097253 0,76%
uniswap
Uniswap (UNI) 5,87 2,03%
terra-luna
Terra Luna Classic (LUNC) 0,000167 2,08%
litecoin
Litecoin (LTC) 73,07 0,09%
chainlink
Chainlink (LINK) 6,86 3,66%
bitcoin-cash
Bitcoin Cash (BCH) 105,15 0,60%
algorand
Algorand (ALGO) 0,227844 1,66%
matic-network
Polygon (MATIC) 0,868255 2,37%
stellar
Stellar (XLM) 0,082539 1,62%
cosmos
Cosmos Hub (ATOM) 9,59 1,49%
filecoin
Filecoin (FIL) 4,24 2,20%
tron
TRON (TRX) 0,051233 0,68%
ethereum-classic
Ethereum Classic (ETC) 18,48 1,56%
dai
Dai (DAI) 0,948099 0,14%
tezos
Tezos (XTZ) 0,953795 2,45%
monero
Monero (XMR) 138,72 1,09%