my remix

I import another contract Hello.sol in contract test1.sol, but after deploying it, only contract Hello's function is displayed in the run interface, not contract test1's function???What is wrong?What should I do?

  • you should deploy the test1 contract, however you will not see the hello methods, cause they are in a different contract and not part of the contract, you are just calling a function of the hello contract inside your Test function.
    – Majd TL
    Oct 17 '19 at 7:00
  • to have that effect you need contract test1 extends Hello {..} but that is actually not useful in your case
    – Majd TL
    Oct 17 '19 at 9:52

You deployed Hello three times.

enter image description here

Your Test1 requires Hello.address passed into the function, so the next step is to copy Hello's address (clipboard icon) then use the drop-down box to select Test1 and deploy one of those.

When the Test1 instance appears on the left, you'll see its Test() function wants an address. Paste Hello's address there.

Hope it helps.

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.