0

I have a smart contract that imports another, and I'm wondering how to deploy them to a testnet.

Right now, one contract imports the other locally;

import "./firstContract.sol"

contract secondContract is firstContract {
...
}

What would I chance the import "./firstContract.sol" line to once the first contract is deployed to a testnet via remix, and I want to deploy the second contract?

I found some documentation on it but it doesn't quite have what I'm looking for.

Rob Hitchens
  • 55,151
  • 11
  • 89
  • 145
JarethRader
  • 57
  • 1
  • 5

1 Answers1

3

You misunderstand inheritance.

In this arrangement, the source code of firstContract.sol is rolled up and included in secondContract.sol. You deploy secondContract. The end.

Communication with another deployed contract is a separate concept that would not include is DeployedContract. Have a look at this for a concise example of how that would work in case it's closer to what you have in mind. Creating a function that calls another contract

Hope it helps.

Rob Hitchens
  • 55,151
  • 11
  • 89
  • 145
  • I was able to figure out what I wanted to do with the help of your answer. What I was looking to do was have the second contract inherit the first one, then I just needed to deploy the second contract. – JarethRader Jan 31 '19 at 05:38