8

Hi I just found that remix added "Load contract from address" option. So I tried to load contract from address "0x67601d7a7cbbD77368785122c508503f168B1dAa" . You can see this contract is in function in https://www.stateofthedapps.com/dapps/cute-kitty-farm . I connected to main network using meta mask but it is not loading any contract. Instead it just deploys my own contract. How can I load contract from this address? Thank you.

1 Answer 1

24

This process works as follows:

  • You must compile the same exact code that the contract you are trying to load.
  • Once the compile succeeds, you have to be on the same network that the contract is, by setting your MetaMask account propperly.
  • The last thing to do is paste the contract address on the option: Load from address: and you'll get it on remix to interact with it.

I've seen that you're doing that on the main net. If you want to test things like that i highly recommend you to search for the same contract on a testnet and then, try to load it. Cause if you deploy by error on the main net, the joke will cost you real money.

Hope it helps.

3
  • 5
    So I need to have exact same of the contract. I thought it will show just the output of compiled contract. Thank you for your help.
    – e.k
    Commented May 24, 2018 at 10:58
  • 1
    why is this necessary??
    – Jim
    Commented Jul 15, 2021 at 0:46
  • 1
    Connecting to the same network is necessary to load the contract. I think compiling the same contract is needed to get the ABI. Accessing a deployed contract requires Address and ABI. Commented Jul 22, 2022 at 0:27

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.