In my contact have multiple imports and successfully deployed my contract.
This is my contract address 0xc2d4d839001f9d985618a22b89155ea8d6550ae6
How can get the abi of my contracts :
pragma solidity ^0.4.18;
import './DeveloperToken.sol';
import 'zeppelin-solidity/contracts/crowdsale/CappedCrowdsale.sol';
import 'zeppelin-solidity/contracts/crowdsale/RefundableCrowdsale.sol';
contract DeveloperCrowdsale is CappedCrowdsale, RefundableCrowdsale {
I tried this :
var compiled = web3.eth.compile.solidity(contractaddress);
var code = compiled.code;
var abi = compiled.info.abiDefinition;
var contract = web3.eth.contract(abi);
But It's not working .
How can I get the abi of my smart contract ?
Best Answer
Save your source code in a file and use the solidity compiler to generate the ABI.
You can install it with
or
and then run it against your source code
It will generate the ABI in your current directory
contract_sol_[ContractName].abi