Challenge Overview

The StakeKing CTF challenge is a two-part challenge that involves exploiting vulnerabilities in the StakeKing and FeeManager smart contracts. Our goal is to steal tokens from the StakeKing smart contract and increase our balance from 100 to 200 tokens.

We start with an initial balance of 100 USDC tokens.

You can find more details about the CTF here:

https://academy.quillaudits.com/challenges/quillctf-challenges-1/stakeking


StakeKing Contracts Analysis

stakeKing.sol: The StakeKing contract allows users to stake and redeem tokens while earning interest on their staked amount

erc20.sol: The usdc is a standard ERC20 used within the staking contract for staking and redemption operations.

FeeManager Contract: The FeeManager contract is responsible for collecting fees generated by the StakeKing contract. It manages fee distribution and ensures proper fee handling.


Part 1: Exploiting StakeKing Contract:

Overview of StakeKing Contract:

The StakeKing contract is the heart of the challenge. It is a simple staking contract that allows users to stake tokens and earn rewards over time. It integrates with the ERC20 contract to manage the USDC token used for staking and redemption.

Core functions: