0
pragma solidity 0.8.4;

contract Hellowworld{
    function hellow() public pure returns (string memory) {
        return "hello world";
    }
} 

this is the simplest code I am using for learning purpose but i am getting this error while compiling

**C:\Users\Hamza>truffle compile
TypeError: Error parsing C:/Users/Hamza/contracts/Hellowworld.sol: Cannot read properties of undefined (reading 'addFunction')
    at runWithReadCallback (C:\Users\Hamza\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\solc\wrapper.js:37:1)
    at compileStandard (C:\Users\Hamza\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\solc\wrapper.js:78:1)
    at Object.compileStandardWrapper (C:\Users\Hamza\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\solc\wrapper.js:85:1)
    at Object.parseImports (C:\Users\Hamza\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\parser.js:47:1)
    at Object.getImports (C:\Users\Hamza\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\profiler.js:374:1)
    at C:\Users\Hamza\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\profiler.js:346:1
Truffle v5.0.2 (core: 5.0.2)
Node v16.15.0**
1
  • The part exploding isnt the one you share, please include the part of the code containing addFunction
    – Julissa DC
    Jun 22 at 13:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.