contract RMUUtil is Ownable {
    using SafeMath for uint256;

    RMU public ropeMaker;

    constructor(RMU _ropeMakerAddr) public {
        ropeMaker = _ropeMakerAddr;
    }

    // Utility function used to mint in advance some cards reserved for airdrops (Only callable by owner which is the multisig)
    function massMint(uint256[] memory _cardIds, uint256[] memory _amounts) public onlyOwner {
        require(_cardIds.length == _amounts.length, "_cardIds and _amounts have different length");

        uint256 length = _cardIds.length;
        for (uint256 i = 0; i < length; ++i) {
            ropeMaker.mint(msg.sender, _cardIds[i], _amounts[i], "");
        }
    }

    // Utility function to send multiple cards to different addresses with different amounts (Callable by anyone, but need approval on this contract)
    function multiTransfer(address[] memory _addresses, uint256[] memory _cardIds, uint256[] memory _amounts) public {
        require(_cardIds.length == _amounts.length && _addresses.length == _cardIds.length, "All input array must have same length");
        uint256 length = _cardIds.length;
        for (uint256 i = 0; i < length; ++i) {
            ropeMaker.safeTransferFrom(msg.sender, _addresses[i], _cardIds[i], _amounts[i], "");
        }
    }

    // To destroy this contract if we want to remove it
    function close() public onlyOwner {
        selfdestruct(msg.sender);
    }
}
function multiTransfer(address[] memory _addresses, uint256[] memory _cardIds, uint256[] memory _amounts) public {
    require(_cardIds.length == _amounts.length && _addresses.length == _cardIds.length, "All input array must have same length");
    uint256 length = _cardIds.length;
    for (uint256 i = 0; i < length; ++i) {
        ropeMaker.safeTransferFrom(msg.sender, _addresses[i], _cardIds[i], _amounts[i], "");
    }
}

// Utility function to send multiple cards to different addresses with different amounts (Callable by anyone, but need approval on this contract)