1

I have a contract contains 4 .sol files and when I generate its bytecode and api as follows:

> solc --bin GreenToken.sol
> solc --abi GreenToken.sol

I receive:

======= BasicToken.sol:BasicToken =======
Binary:
6060604052341561000f57...

======= GreenToken.sol:GreenToken =======
Binary:
6060604052341561000f5760...

======= Ownable.sol:Ownable =======
Binary:
6060604052341561000f5760008...

======= SafeMath.sol:SafeMath =======
Binary:
604c602c600b82828239...

The smart contract contains these 4 .sol files

BasicToken.sol , GreenToken.sol , Ownable.sol , SafeMath.sol

I receive also 4 api. The question is for deploying the contract I must use which bytecode and api ? In case, I have to use all of them how to merge ?

1 Answer 1

2

You only need to deploy GreenToken bytecode/abi -- the others are being compiled into GreenToken because I'm presuming you imported them into that contract and extended GreenToken using Ownable and BasicToken.

If you were using another contract as a variable inside your contract then you'd need to reference that contract by it's address and provide an interface for it (sans implementation, since that is handled at the contract address you reference).

If that doesn't answer your question post the source code, maybe I misunderstood your ask. Hope that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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