all files / contracts/mocks/ MockSpanningERC1155.sol

100% Statements 9/9
100% Branches 0/0
100% Functions 5/5
100% Lines 9/9
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                                        165× 165× 165× 165× 165×                           39×                                             14×      
// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: Copyright (C) 2022 Spanning Labs Inc.
 
pragma solidity ^0.8.0;
 
import "../token/ERC1155/SpanningERC1155.sol";
import "../SpanningUtils.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
 
contract MockSpanningERC1155 is SpanningERC1155 {
    using Strings for uint256;
    using SpanningAddress for bytes32;
 
    uint256 public constant GOLD = 0;
    uint256 public constant SILVER = 1;
    uint256 public constant THORS_HAMMER = 2;
    uint256 public constant SWORD = 3;
    uint256 public constant SHIELD = 4;
 
    constructor(address delegate_) SpanningERC1155("Test", delegate_) {
        _mint(spanningMsgSender(), GOLD, 10**5, "");
        _mint(spanningMsgSender(), SILVER, 10**7, "");
        _mint(spanningMsgSender(), THORS_HAMMER, 1, "");
        _mint(spanningMsgSender(), SWORD, 10**3, "");
        _mint(spanningMsgSender(), SHIELD, 10**3, "");
    }
 
    /**
     * @dev Mint `tokenId` SPAN to `recipientAddress`
     *
     * @param recipientAddress - Spanning Address that SPANNFT is minted to
     */
    function mint(
        bytes32 recipientAddress,
        uint256 tokenId,
        uint256 amount,
        bytes memory data
    ) external payable {
        _mint(recipientAddress, tokenId, amount, data);
    }
 
    function burn(
        bytes32 from,
        uint256 id,
        uint256 amount
    ) external {
        _burn(from, id, amount);
    }
 
    function burnBatch(
        bytes32 from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) external {
        _burnBatch(from, ids, amounts);
    }
 
    function mintBatch(
        bytes32 to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) external {
        _mintBatch(to, ids, amounts, data);
    }
}