// SPDX-License-Identifier: MIT pragma solidity =0.8.18; /** * @title SOMA Swap ERC20 Contract. * @author SOMA.finance * @notice Interface of the Soma Swap ERC20 contract. */ interface ISomaSwapERC20 { /** * @notice Emitted when the ``owner``'s tokens are approved for spending by `spender`. * @param owner The address of the owner. * @param spender The address of the spender. * @param value The amount of tokens that approved for spending by `spender`. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @notice Emitted when `value` tokens are sent from `from` to `to`. * @param from The address that the tokens are being transferred from. * @param to The address receiving the tokens. * @param value The amount of tokens transferred. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @notice The name of the token. */ function name() external pure returns (string memory); /** * @notice The symbol of the token. */ function symbol() external pure returns (string memory); /** * @notice The decimals of the token. */ function decimals() external pure returns (uint8); /** * @notice The total supply of the token. */ function totalSupply() external view returns (uint256); /** * @notice Returns the token balance of a holder. * @param owner The address of the token holder. * @return The balance of the holder. */ function balanceOf(address owner) external view returns (uint256); /** * @notice Returns the remaining number of tokens that `spender` will be allowed * to spend on behalf of `owner` through transferFrom. * @param owner The address of the token holder. * @param spender The caller of the function. * @return The amount of tokens approved for spending by the `spender`. */ function allowance(address owner, address spender) external view returns (uint256); /** * @notice Approves `value` tokens to be spent by `spender`. * @param spender The caller of the function. * @param value The number of tokens to be approved for spending. * @custom:emits Approval * @return Boolean indicating if the transaction was successful. */ function approve(address spender, uint256 value) external returns (bool); /** * @notice Transfers `value` tokens to `to`. * @param to The recipient of the tokens. * @param value The number of tokens to be transferred. * @custom:emits Transfer * @return Boolean value indicating if the operation was successful. */ function transfer(address to, uint256 value) external returns (bool); /** * @notice Transfers `value` tokens from `from` to `to` using the allowance mechanism. * @param from The address that the tokens will be transferred from. * @param to The address that the tokens will be transferred to. * @param value The amount of tokens to be transferred. * @return Boolean indicating if the transaction was successful. */ function transferFrom(address from, address to, uint256 value) external returns (bool); /** * @notice Returns the domain separator of the token which prevents replay attacks from other domains. */ function DOMAIN_SEPARATOR() external view returns (bytes32); /** * @notice Returns the permit typehash of the token. */ function PERMIT_TYPEHASH() external pure returns (bytes32); /** * @notice Returns the permit typehash of the token. * @param owner The address of the owner of the tokens. */ function nonces(address owner) external view returns (uint256); /** * @notice Modifies ``spender``'s allowance via signatures. * @param owner The holder of the tokens. * @param spender The caller of the method. * @param value The number of tokens being moved. * @param v The v component of the permit signature. * @param r The r component of the permit signature. * @param s The s component of the permit signature. */ function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external; }