2

I'm developing smart contracts using Truffle. I got the contract's bytecode through truffle compile. This produced a large json file and it wasn't too ahrd to find the bytecode. Now, how can I find the Contract JSON Interface for easy testing of the contract, especially those that import from multiple files and so on?

4

Look for the object called abi: {}. It might be huge.

2

Within your truffle test, try this:

let Contract = artifacts.require('./Contract.sol');

contract('Contract', accounts => {
    Contract.deployed().then(instance => {

        console.log(instance.abi);

    });
});

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.