Yieldy contest - 0v3rf10w's results

A protocol for gaining single side yields on various tokens.

General Information

Platform: Code4rena

Start Date: 21/06/2022

Pot Size: $50,000 USDC

Total HM: 31

Participants: 99

Period: 5 days

Judges: moose-code, JasoonS, denhampreen

Total Solo HM: 17

Id: 139

League: ETH

Yieldy

Findings Distribution

Researcher Performance

Rank: 90/99

Findings: 1

Award: $26.57

🌟 Selected for report: 0

🚀 Solo Findings: 0

QA1 : use safe

https://github.com/code-423n4/2022-06-yieldy/blob/524f3b83522125fb7d4677fa7a7e5ba5a2c0fe67/src/contracts/Migration.sol#L48-L52

        IYieldy(OLD_YIELDY_TOKEN).transferFrom( //@audit
            msg.sender,
            address(this),
            userWalletBalance
        );

NA1: Missing events emission

LiquidityReserve.enableLiquidityReserve() (https://github.com/code-423n4/2022-06-yieldy/blob/524f3b83522125fb7d4677fa7a7e5ba5a2c0fe67/src/contracts/LiquidityReserve.sol#57-86)

Staking.unstake() (https://github.com/code-423n4/2022-06-yieldy/blob/524f3b83522125fb7d4677fa7a7e5ba5a2c0fe67/src/contracts/Staking.sol#674-696)

NA2: Lack of zero check

Staking.initialize()._feeAddress (https://github.com/code-423n4/2022-06-yieldy/blob/524f3b83522125fb7d4677fa7a7e5ba5a2c0fe67/src/contracts/Staking.sol#46)

Staking.setCurvePool()._curvePool (https://github.com/code-423n4/2022-06-yieldy/blob/524f3b83522125fb7d4677fa7a7e5ba5a2c0fe67/src/contracts/Staking.sol#157)

Staking.setAffiliateAddress()._affiliateAddress (https://github.com/code-423n4/2022-06-yieldy/blob/524f3b83522125fb7d4677fa7a7e5ba5a2c0fe67/src/contracts/Staking.sol#177)

G1: break && into seperate require to save gas

https://github.com/code-423n4/2022-06-yieldy/blob/524f3b83522125fb7d4677fa7a7e5ba5a2c0fe67/src/contracts/Staking.sol#L54-L63

require(
            _stakingToken != address(0) &&
                _yieldyToken != address(0) &&
                _tokeToken != address(0) &&
                _tokePool != address(0) &&
                _tokeManager != address(0) &&
                _tokeReward != address(0) &&
                _liquidityReserve != address(0),
            "Invalid address"
        );

G2: Code Style mismatch

https://github.com/code-423n4/2022-06-yieldy/blob/524f3b83522125fb7d4677fa7a7e5ba5a2c0fe67/src/contracts/Staking.sol#L706

epoch.endTime = epoch.endTime + epoch.duration;
epoch.timestamp = block.timestamp;
epoch.number++;

modify to

epoch.endTime += epoch.duration;
epoch.timestamp = block.timestamp;
++epoch.number;

G3: Code Style mismatch

https://github.com/code-423n4/2022-06-yieldy/blob/524f3b83522125fb7d4677fa7a7e5ba5a2c0fe67/src/contracts/Staking.sol#L320-L321

ITokePool tokePoolContract = ITokePool(TOKE_POOL); 
        uint256 balance = ITokePool(TOKE_POOL).balanceOf(address(this));

to

ITokePool tokePoolContract = ITokePool(TOKE_POOL);
uint256 balance = tokePoolContract.balanceOf(address(this));

G4: Code format mismatch (Missed Caching for TOKE_TOKEN ?)

https://github.com/code-423n4/2022-06-yieldy/blob/524f3b83522125fb7d4677fa7a7e5ba5a2c0fe67/src/contracts/Staking.sol#L144-L150

uint256 totalTokeAmount = IERC20Upgradeable(TOKE_TOKEN).balanceOf(
            address(this)
        );
        IERC20Upgradeable(TOKE_TOKEN).safeTransfer(
            _claimAddress,
            totalTokeAmount
        );

G5: does it saves gas as there is only one call from tokeRewardContract? or just for format/style(optimising format)?

https://github.com/code-423n4/2022-06-yieldy/blob/524f3b83522125fb7d4677fa7a7e5ba5a2c0fe67/src/contracts/Staking.sol#L120-L121

ITokeReward tokeRewardContract = ITokeReward(TOKE_REWARD);
        tokeRewardContract.claim(_recipient, _v, _r, _s);
AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter