SOCI4L

Take the money

Step 1 of 4
0 of 2 goals

Let it receive

Both calls send AVAX and both are being rejected, because a function refuses money unless it says otherwise.

Add one word:

function fund() external payable {

Now the calls land.

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

contract Jar {
    address public owner;

    event Funded(address indexed from, uint256 amount);

    constructor() {
        owner = msg.sender;
    }

    function fund() external {
        emit Funded(msg.sender, 0);
    }

    function total() external view returns (uint256) {
        return 0;
    }
}

Goals

The contract compiles
nothing to compile yet
Both funding calls go through
the contract has not run yet

Contract storage

Write a contract and it will deploy itself here.