0

keep getting error message below:

from solidity: ParserError: Expected '{' but got 'function' --> contracts/GabeCoin.sol:126:5: | 126 | function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) | ^^^^^^^^

Code:

 {
    require(msg.value == publicPrice, ""); 
    _mint(msg.sender,account, id, amount, "");
} 
}


    function uri(uint256 _tokenId) override public view returns (string memory){
      return string(
         abi.encodePacked(
             "http://arweave.net/F-vNncRtEDQADLijhtpINmObAprB0saDk9zj1CKMqa4/cloud",
             Strings.toString(_tokenId),
             ".json"
         )  

      );

    }

 function setURI(string memory newuri) public onlyOwner {
    _setURI(newuri);
}

function pause() public onlyOwner {
    _pause();
}

function unpause() public onlyOwner {
    _unpause();
}

function mint(address account, uint256 id, uint256 amount)
    public
    payable


function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
    public
    onlyOwner
{
    _mintBatch(to, ids, amounts, data);
}

function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
    internal
    whenNotPaused
    override(ERC1155, ERC1155Supply)
{
    super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
}

}

1
  • you are not closing the function mint. it is missing the curly braces Nov 18, 2022 at 4:48

1 Answer 1

0

Add curly braces to your mint function. Replace it with:

function mint(address account, uint256 id, uint256 amount)
    public
    payable {}
1
  • Thank you :) that worked, but it created another ParserError: from solidity: ParserError: Expected identifier but got '(' --> contracts/GabeCoin.sol:125:12: | 125 | require(msg.value == publicPrice, ""); function mint(address account, uint256 id, uint256 amount) public payable {} require(msg.value == publicPrice, ""); _mint(msg.sender,account, id, amount, "");
    – Frantz M.
    Nov 18, 2022 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.