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;
}
}