all files / contracts/mocks/ MockSpanningERC20.sol

100% Statements 12/12
50% Branches 1/2
100% Functions 13/13
100% Lines 12/12
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                                            12×                                                                                          
// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: Copyright (C) 2022 Spanning Labs Inc.
 
pragma solidity ^0.8.0;
 
import "../token/ERC20/SpanningERC20.sol";
 
/**
 * @title MockSpanningERC20
 * This mock just provides a public mint, approve and burn functions for testing purposes
 */
contract MockSpanningERC20 is SpanningERC20 {
    /**
     * @dev Creates the contract, initializing various base contracts.
     *
     * @param delegateLegacyAddress - Legacy (local) Address of the Delegate
     */
    constructor(address delegateLegacyAddress)
        SpanningERC20("Spanning Token", "SPAN", delegateLegacyAddress)
    {}
 
    function mint(bytes32 receiverAddress, uint256 amount) public {
        _mint(receiverAddress, amount);
    }
 
    function burn(bytes32 senderAddress, uint256 amount) public {
        _burn(senderAddress, amount);
    }
 
    function approve(
        bytes32 senderAddress,
        bytes32 receiverAddress,
        uint256 amount
    ) public {
        _approve(senderAddress, receiverAddress, amount);
    }
 
    function check_modifier_onlySpanning() public onlySpanning {
        Erequire(delegateAddress() == msg.sender, "onlySpanning: bad role");
    }
 
    function check_spanningMsgSender() public returns (bytes32) {
        return spanningMsgSender();
    }
 
    function check_spanningTxnSender(uint8 mock_value) public returns (bytes32) {
        return spanningTxnSender();
    }
 
    function check_isValidSpanningInfo() public returns (bool) {
        return isValidSpanningInfo();
    }
 
    function check_spanningMsgSenderUnchecked() public returns (bytes32) {
        return spanningMsgSenderUnchecked();
    }
 
    function check_spanningTxnSenderUnchecked() public returns (bytes32) {
        return spanningTxnSenderUnchecked();
    }
 
    function check_getDomainFromAddress(bytes32 inputAddress)
        public
        returns (bytes4)
    {
        return getDomainFromAddress(inputAddress);
    }
 
    function checkmakeRequest(bytes32 programAddress, bytes memory payload)
        public
    {
        makeRequest(programAddress, payload);
    }
 
    function getOwner() public view returns (bytes32) {
        return owner();
    }
}