Repository: CryptoBlades/cryptoblades
File: contracts/cryptoblades.sol (Solidity)

Code before:
        mintPaymentSkillDepositeds[_minter].skillDepositedFromWallet = 0;
        mintPaymentSkillDepositeds[_minter].skillDepositedFromRewards = 0;
        mintPaymentSkillDepositeds[_minter].skillDepositedFromIgo = 0;
    }

    function mintWeapon(uint256 chosenElement) public onlyNonContract oncePerBlock(msg.sender)  {
        _discardPaymentIfExpired(msg.sender);

        require(mintPayments[msg.sender].count == 1, "count mismatch");

        bytes32 hash = mintPayments[msg.sender].blockHash;
        try weapons.mint(msg.sender, randoms.getRandomSeedUsingHash(msg.sender, hash), chosenElement) {
            _usePayment(msg.sender, address(weapons), 1);

            mintPaymentSkillDepositeds[msg.sender].skillDepositedFromWallet = 0;
            mintPaymentSkillDepositeds[msg.sender].skillDepositedFromRewards = 0;
            mintPaymentSkillDepositeds[msg.sender].skillDepositedFromIgo = 0;

            emit MintWeaponsSuccess(msg.sender, 1);
        }
        catch {
            emit MintWeaponsFailure(msg.sender, 1);
        }
    }*/

    function mintWeaponN(uint32 num, uint16 chosenElement, uint16 chosenElementFee)
        public
        onlyNonContract
        oncePerBlock(msg.sender)
    {
        require(num > 0 && num <= 10);
        _payContract(msg.sender, mintWeaponFee * num * chosenElementFee);

        for (uint i = 0; i < num; i++) {
            weapons.mint(msg.sender, uint256(keccak256(abi.encodePacked(blockhash(block.number - 1), msg.sender, i))), chosenElement);
        }
    }

    function mintWeapon(uint16 chosenElement, uint16 chosenElementFee) public onlyNonContract oncePerBlock(msg.sender) {
        _payContract(msg.sender, mintWeaponFee * chosenElementFee);

        //uint256 seed = randoms.getRandomSeed(msg.sender);
        weapons.mint(msg.sender, uint256(keccak256(abi.encodePacked(blockhash(block.number - 1), msg.sender))), chosenElement);
    }

    function burnWeapon(uint256 burnID) public
            isWeaponOwner(burnID) requestPayFromPlayer(burnWeaponFee) {
        _payContract(msg.sender, burnWeaponFee);
        weapons.burn(burnID);
    }


Review comment (suggestion):
Needs check on chosenElementFee value to prevent passing 0 as chosenElementFee there and minting weapons for free with `line 720:  _payContract(msg.sender, mintWeaponFee * num * 0);`

Update: I'd say don't pass chosenElementFee to this function at all and determine what it's value should be based on chosenElement. As I can see chosenElement can have values 0 - 3 or 100, so just set the appropriate fee based on that.

Code after:
    }

    /*function mintWeaponN(uint32 num)
        public
        onlyNonContract
        oncePerBlock(msg.sender)
    {
        require(num > 0 && num <= 1000);
        _discardPaymentIfExpired(msg.sender);
        require(mintPayments[msg.sender].count == num, "count mismatch");

        // the function below is external so we can try-catch on it
        try this._mintWeaponNUsableByThisOnlyButExternalForReasons(msg.sender, num, chosenElement) {
            emit MintWeaponsSuccess(msg.sender, num);
        }
        catch {
            emit MintWeaponsFailure(msg.sender, num);
        }
    }

    function _mintWeaponNUsableByThisOnlyButExternalForReasons(address _minter, uint32 num, uint256 chosenElement) external {
        // the reason referred to in the function name is that we want to
        // try-catch on this from within the same contract

        require(msg.sender == address(this));

        for (uint i = 0; i < num; i++) {
            bytes32 hash = mintPayments[_minter].blockHash;
            weapons.mint(_minter, randoms.getRandomSeedUsingHash(_minter, hash), chosenElement);
            _usePayment(_minter, address(weapons), 1);
        }

        mintPaymentSkillDepositeds[_minter].skillDepositedFromWallet = 0;
        mintPaymentSkillDepositeds[_minter].skillDepositedFromRewards = 0;
        mintPaymentSkillDepositeds[_minter].skillDepositedFromIgo = 0;
    }

    function mintWeapon(uint256 chosenElement) public onlyNonContract oncePerBlock(msg.sender)  {
        _discardPaymentIfExpired(msg.sender);

        require(mintPayments[msg.sender].count == 1, "count mismatch");

        bytes32 hash = mintPayments[msg.sender].blockHash;
        try weapons.mint(msg.sender, randoms.getRandomSeedUsingHash(msg.sender, hash), chosenElement) {
            _usePayment(msg.sender, address(weapons), 1);

            mintPaymentSkillDepositeds[msg.sender].skillDepositedFromWallet = 0;
            mintPaymentSkillDepositeds[msg.sender].skillDepositedFromRewards = 0;
            mintPaymentSkillDepositeds[msg.sender].skillDepositedFromIgo = 0;

            emit MintWeaponsSuccess(msg.sender, 1);