Getting ParserError: Invalid token when importing LibPart from rarible

I'm following this tutorial on how to add rarible royalties to my smart contract.

I keep getting this Invalid token error

bytes32 public constant TYPE_HASH = keccak256(“Part(address account,uint96 value)”);
                                              ^ 

Entire code:

// SPDX-License-Identifier: MIT pragma
pragma solidity ^0.8.0;

library LibPart { 
    
    bytes32 public constant TYPE_HASH = keccak256(“Part(address account,uint96 value)”);
    
    struct Part {
        address payable account;
        uint96 value; 
    }

    function hash(Part memory part) internal pure returns (bytes32){ 
        return keccak256(abi.encode(TYPE_HASH, part.account,  part.value));
    }

}

:computer: My Environment

  • Solc v 0.8.4
  • Truffle v5.4.0

I think you used the wrong punctuation, it should be:

// SPDX-License-Identifier: MIT pragma
pragma solidity ^0.8.0;

library LibPart { 
    
    bytes32 public constant TYPE_HASH = keccak256("Part(address account,uint96 value)");
    
    struct Part {
        address payable account;
        uint96 value; 
    }

    function hash(Part memory part) internal pure returns (bytes32){ 
        return keccak256(abi.encode(TYPE_HASH, part.account,  part.value));
    }

}
1 Like