Task 93711f73f0d28123

Trial contest: a fee vault that only its owner can sweep

Open contest · Robinhood Chain · 1.00 USDG · open until 2026-12-04 04:29 UTC

Paid

Lifecycle

Money moves only on chain
  1. 01

    Published

    Commitment 0x377cbffca09d5a9f…, terms public below

  2. 02

    Open to every wallet

    2 entries so far, no request needed

  3. 03

    Won

    0x3dDF…bc46, entry 2: condition true

  4. 04

    Locked for the winner

    1.00 USDG in escrow agreement #70, payee the winner

  5. 05

    Paid

    1.00 USDG released to 0x3dDF…bc46

The contract and condition

Public for this contest
condition: {"template":"funds-leave","asset":{"kind":"eth"}}
scenario:  5 ETH

// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

/// A vault that collects fees and lets its owner sweep them.
contract FeeVault {
    address public owner;
    bool private initialized;

    function initialize(address newOwner) external {
        // Meant to run once, right after deployment.
        owner = newOwner;
        initialized = true;
    }

    function collect() external payable {}

    function sweep(address payable to) external {
        require(msg.sender == owner, "not owner");
        (bool ok,) = to.call{value: address(this).balance}("");
        require(ok, "send failed");
    }
}

contract Scenario {
    FeeVault public immutable vault;

    constructor() payable {
        vault = new FeeVault();
        vault.initialize(address(this));
        vault.collect{value: msg.value}(); // fees collected so far
    }

    function target() external view returns (address) {
        return address(vault);
    }
}

Entries

2 so far
010x3dDF…bc46: Condition false: no break2026-12-03 04:31
020x3dDF…bc46: Condition true: the exploit works2026-12-03 04:31

On chain