LIQUID STAKING

by 3doc

Everybody's buzzing of a new invite-only project, where you get the once-in-a-lifetime opportunity to stake ETH and swap it for a real ERC-20!!!

You liked and re-posted on X a gazillion times to finally get a "free" code; then holding your breath rushed to the fancy UI that wraps their publicly available contracts.

But wait, I am sure none of the fine prints ever said that there is a 10% entry fee...

WINNING CONDITION

Mint synthetic tokens while keeping your ETH balance intact.

src
PoolVault.sol
SyntheticToken.sol
SyntheticTokenFactory.sol
interfaces
script
pragma solidity 0.8.21;

import {IPoolVault} from "./interfaces/IPoolVault.sol";
import {SafeTransferLib} from "lib/solady/src/utils/SafeTransferLib.sol";

contract PoolVault is IPoolVault {
    using SafeTransferLib for address;

    mapping(address synthetic => mapping (address owner => uint)) public balance;

    function depositFor(address synthetic, address beneficiary, uint amount) external {
        synthetic.safeTransferFrom(msg.sender, address(this), amount);
        balance[synthetic][beneficiary] += amount;
    }

    function withdraw(address synthetic, uint amount) external {
        balance[synthetic][msg.sender] -= amount;
        synthetic.safeTransfer(msg.sender, amount);
    }
}