// SPDX-License-Identifier: MIT pragma solidity ^0.8.30; /// @title Love /// @notice A minimal on-chain counter of love sent between addresses. contract Love { mapping(address sender => mapping(address recipient => uint256 amount)) public sent; mapping(address recipient => uint256 amount) public received; event LoveSent(address indexed from, address indexed to, uint256 amount); error SelfLove(); error ZeroAmount(); /// @notice Send `amount` units of love to `to`. function send(address to, uint256 amount) external { if (to == msg.sender) revert SelfLove(); if (amount == 0) revert ZeroAmount(); sent[msg.sender][to] += amount; received[to] += amount; emit LoveSent(msg.sender, to, amount); } }