Eocene | Security (@EoceneSecurity) header
Eocene | Security (@EoceneSecurity) profile picture

💡Smart contract audit 💡Attack analysis 💡Web3 security research 💡On-chain monitor and alert Powered by Eocene Research | @EoceneNI | @EoceneMI

Joined August 2012
The root cause of EFVault attack:
2
1
151
8/ Simultaneously, the attacker transferred all the YUNA-DEPOSIT-CERT tokens to a contract that has not called the stakeTokens function before, and then called unstakeTokens to retrieve the YUNA tokens, bypassing the lockup time verification:
88
5/ The value of _staker.rewardDebt is initialized in the stakeTokens function and is determined by the balance of YUNA-DEPOSIT-CERT tokens:
1
33
4/ The quantity of reward tokens is obtained by multiplying the balance of the caller's YUNA-DEPOSIT-CERT tokens by the reward coefficient and subtracting _staker.rewardDebt:
1
27
3/ The harvest operation transfers reward tokens to the caller, and the quantity of tokens is calculated using calcHarvestTot:
1
22
2/ The stakeTokens function in the FarmCerts contract: When the caller's YUNA-DEPOSIT-CERT token is not equal to 0, it triggers a harvest operation:
1
27
3/ Then swapped CFC Token to SAFE Token, and then swapped SAFE Token to USDT:
1
112
2/ The attacker transferred the CFC Token to the liquidity pool, then took it out through the skim function, and repeated this operation many times, which eventually led to a sharp decrease in the CFC Token in the liquidity pool and a sharp rise in price:
1
26
8/ The getbnb function utilized the getAmountsOut method from the Router contract. However, due to the significantly low price of SELLC tokens in the USDT-SELLC pool, the return value of the getbnb function became abnormally large.
334
7/ The vulnerability occurred because the price in the USDT-SELLC pool was manipulated, and the sendMiner function relied on the price from that pool.
1
314
6/ The above operations were repeated to acquire a large amount of SELLC tokens. Then, the liquidity in the USDT-SELLC pool was removed, and the remaining SELLC was exchanged for USDT. Finally, a significant amount of SELLC was exchanged for WBNB.
1
313
5/ Then, in the WBNB-SELLC pool, a large number of SELLC tokens were acquired by flash loan, and transferred to the initially created attack contract, and then the sendMiner method of the miner contract was called in the attack contract to obtain a large amount of SELLC tokens:
1
300
4/ The attacker then flash loaned a large amount of WBNB, which was then exchanged for SELLC. Subsequently, the acquired SELLC was exchanged back into USDT. As a result of the low liquidity in the USDT-SELLC pool, the price of SELLC in that pool became significantly low.
1
320
2/The following is an analysis of the attack process: The attacker first created 4 attack contracts, and then performed the following operations in each of the four attack contracts: adding liquidity to the USDT-SELLC liquidity pool, and then calling the setBNB function:
1
328