Vault.initVault(ILoveToken loveToken, address managerContract)
can be frontrun
In 2 contracts Vault
(one for airdrop and one for staking)
function initVault(ILoveToken loveToken, address managerContract)
can be frontrun by malicious user which leads to stolen all funds from loveToken contract.
1 Solmate team deploy LoveToken contract.
2 Solmate team deploy Vault for airdrop or staking.
3 Solmate team calls initVault(ILoveToken loveToken, address managerContract)
.
4 Attacker is constantly scanning the mempool for initVault(ILoveToken loveToken, address managerContract)
function calls.
5 Attacker detects a initVault(ILoveToken loveToken, address managerContract)
function call in the mempool.
6 Attacker frontruns the initVault(ILoveToken loveToken, address managerContract)
call with the LoveToken address as loveToken
input parameter and his address as a managerContract
input parameter.
7 Attacker calls LoveToken.transferFrom
with:
from
input parameter equal Vault address,
to
input parameter equal address controlled by the attacker,
amount
input parameter equal 500_000_000 ether.
Manual review.
Implement access control for Vault.initVault(ILoveToken loveToken, address managerContract)
to ensure only the relevant deployer can call Vault.initVault(ILoveToken loveToken, address managerContract)
.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.