all files / contracts/token/ERC20/ ISpanningERC20.sol

100% Statements 0/0
100% Branches 0/0
100% Functions 0/0
100% Lines 0/0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119                                                                                                                                                                                                                                             
// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: Copyright (C) 2022 Spanning Labs Inc.
 
pragma solidity ^0.8.0;
 
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
 
/**
 * @dev Interface of ERC20 in the Spanning Protocol
 */
interface ISpanningERC20 is IERC20 {
    /**
     * @dev Returns the amount of tokens owned by an account.
     *
     * @param account - Address to be queried
     *
     * @return uint256 - Token value for an account
     */
    function balanceOf(bytes32 account) external view returns (uint256);
 
    /**
     * @dev Moves tokens from the caller's account to another account.
     *
     * @param receiverAddress - Address to receive the transfer
     * @param amount - Amount to transfer
     *
     * @return bool - Indicates whether the operation succeeded
     */
    function transfer(bytes32 receiverAddress, uint256 amount)
        external
        returns (bool);
 
    /**
     * @dev Gets the number of authorized tokens in the allowance pair.
     *
     * Note: This value can change when {approve} or {transferFrom} are called
     * Note: The result is zero when an entry does not exist in the map
     *
     * @param senderAddress - Address of the allowance sender
     * @param receiverAddress - Address of the allowance receiver
     *
     * @return uint256 - Number of tokens in the allowance pair
     */
    function allowance(bytes32 senderAddress, bytes32 receiverAddress)
        external
        view
        returns (uint256);
 
    /**
     * @dev Sets an allowance for a pair of addresses (sender and receiver).
     *
     * Note: There can be race conditions due to ordering. See more:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * @param receiverAddress - Address of the allowance receiver
     * @param amount - Amount of allowance to issue
     *
     * @return bool - Indicates whether the operation succeeded
     */
    function approve(bytes32 receiverAddress, uint256 amount)
        external
        returns (bool);
 
    /**
     * @dev Transfers tokens from from sender to receiver.
     *
     * Note: This uses the allowance mechanism to transfer tokens.
     *
     * @param senderAddress - Address of the allowance sender
     * @param receiverAddress - Address of the allowance receiver
     * @param amount - Amount of allowance to issue
     * @return bool - Indicates whether the operation succeeded
     */
    function transferFrom(
        bytes32 senderAddress,
        bytes32 receiverAddress,
        uint256 amount
    ) external returns (bool);
 
    /**
     * @dev Pulls read-only information relevant to the domain ownership
     * from the appropriate middleware node or domain
     *
     * Note: This function should be called prior to reading any information
     * through this domain, to ensure data is up to date
     *
     * @return bool - Indicates whether the operation succeeded
     */
    function updateRecords() external returns (bool);
 
    /**
     * @dev Emitted tokens are transferred
     *
     * Note that `amount` may be zero.
     *
     * @param senderAddress - Address initiating the transfer
     * @param receiverAddress - Address receiving the transfer
     * @param amount - Amount to transfer
     */
    event Transfer(
        bytes32 indexed senderAddress,
        bytes32 indexed receiverAddress,
        uint256 amount
    );
 
    /**
     * @dev Emitted when an allowance pair changes.
     *
     * @param senderAddress - Address of the allowance sender
     * @param receiverAddress - Address of the allowance receiver
     * @param amount - Amount to approve
     */
    event Approval(
        bytes32 indexed senderAddress,
        bytes32 indexed receiverAddress,
        uint256 amount
    );
}