1
let abi = compiled.contracts.example.PartyTime.abi;

This is the line of code that is causing the error. I copied the abi code from Remix into an abi.json file. But it doesn't seem to be reading it correctly. Should I post the full code?

I am in the right folder where I have the code and have the code deploying it and the abi code in the same file.

0

This problem might be related with wrong path while trying to reading the json file from your local machine. If this will make your life easier you can define the abi of the contract as string and use it this way. Example:

let contract_abi = '[{"constant":true,"inputs":[],"name":"getA","outputs":[{"name":"","type":"uint256"},{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"returnAllowanceAndAmount","outputs":[{"name":"_bool","type":"bool"},{"name":"_val","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_val","type":"uint256"}],"name":"setA","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]';

Your Answer

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

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