OpenGSN BaseRelayRecipient: ParserError: Expected pragma, import directive or contract/interface/library definition

I imported the @opengsn/gsn/contracts/BaseRelayRecipient.sol in my contract and Compiler Error
:computer: Environment

Windows 10, @openzeppelin/contracts version: 3.4.1-solc-0.7, @opengsn/gsn version: 2.1.0

:memo:Details

I tried compiling but it threw compilation error about the abstract contract.
:1234: Code to reproduce

CompileError: @opengsn/gsn/contracts/BaseRelayRecipient.sol:11:1: ParserError: Expected pragma, import directive or contract/interface/library definition.
abstract contract BaseRelayRecipient is IRelayRecipient {
^------^

Compilation failed. See above.
    at run (C:\Users\Sam\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\compile-solidity\run.js:53:1)
    at Object.sourcesWithDependencies (C:\Users\Sam\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\compile-solidity\index.js:108:58)  
    at necessary (C:\Users\Sam\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\compile-solidity\index.js:70:1)
    at C:\Users\Sam\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\workflow-compile\index.js:33:1
    at async Promise.all (index 0)
    at compile (C:\Users\Sam\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\workflow-compile\index.js:23:1)
    at Object.compile (C:\Users\Sam\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\workflow-compile\index.js:66:45)
Truffle v5.1.60 (core: 5.1.60)
Node v12.18.3
1 Like

Hi @Sam-Devs,

I recommend asking this question in the OpenGSN forum: https://forum.opengsn.org/

As an aside, you may want to consider using Windows Subsystem for Linux 2 (WSL2) for developing on Windows: Solidity Smart Contract development on Windows

1 Like