5

I see no option to import contracts. Would appreciate any help here.

I do not have the contract code, but I do have its address.

2 Answers 2

5

To import a contract into the Ethereum Wallet (Mist), you will need the following pieces of information:

Here are the steps:

  • Select the Contracts tab on the top of the screen.
  • Click Watch Contract
  • Enter a contract name
  • Enter your contract address
  • Enter the JSON interface. You will need to enter this for Mist to know what the contract functions and data fields are.

If you want to test using the DAO currently in the crowdfunding phase, there are instructions in the The DAO - Voting page (under the title Voting and other information) with the following details:

  • Contract name: The DAO
  • Contract address: 0xbb9bc244d798123fde783fcc1c72d3bb8c189413
  • JSON interface: [{"type":"function","outputs":[{"type":"uint256","name":""}],"name":"minTokensToCreate","inputs":[],"constant":true},{"type":"function","outputs":[{"type":"uint256","name":""}],"name":"totalSupply","inputs":[],"constant":true},{"type":"function","outputs":[{"type":"uint256","name":""}],"name":"closingTime","inputs":[],"constant":true},{"type":"function","outputs":[],"name":"refund","inputs":[],"constant":false},{"type":"function","outputs":[{"type":"address","name":""}],"name":"curator","inputs":[],"constant":true},{"type":"function","outputs":[{"type":"uint256","name":"balance"}],"name":"balanceOf","inputs":[{"type":"address","name":"_owner"}],"constant":true},{"type":"function","outputs":[{"type":"uint256","name":"_numberOfProposals"}],"name":"numberOfProposals","inputs":[],"constant":true},{"type":"function","outputs":[{"type":"address","name":""}],"name":"extraBalance","inputs":[],"constant":true},{"type":"function","outputs":[{"type":"bool","name":""}],"name":"isFueled","inputs":[],"constant":true},{"type":"function","outputs":[{"type":"bool","name":"success"}],"name":"createTokenProxy","inputs":[{"type":"address","name":"_tokenHolder"}],"constant":false},{"type":"function","outputs":[{"type":"uint256","name":"_voteID"}],"name":"vote","inputs":[{"type":"uint256","name":"_proposalID"},{"type":"bool","name":"_supportsProposal"}],"constant":false},{"type":"event","name":"FuelingToDate","inputs":[{"type":"uint256","name":"value","indexed":false}],"anonymous":false},{"type":"event","name":"ProposalAdded","inputs":[{"type":"uint256","name":"proposalID","indexed":true},{"type":"address","name":"recipient","indexed":false},{"type":"uint256","name":"amount","indexed":false},{"type":"bool","name":"newCurator","indexed":false},{"type":"string","name":"description","indexed":false}],"anonymous":false},{"type":"event","name":"ProposalTallied","inputs":[{"type":"uint256","name":"proposalID","indexed":true},{"type":"bool","name":"result","indexed":false},{"type":"uint256","name":"quorum","indexed":false}],"anonymous":false},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"proposals","outputs":[{"name":"recipient","type":"address"},{"name":"amount","type":"uint256"},{"name":"description","type":"string"},{"name":"votingDeadline","type":"uint256"},{"name":"open","type":"bool"},{"name":"proposalPassed","type":"bool"},{"name":"proposalHash","type":"bytes32"},{"name":"proposalDeposit","type":"uint256"},{"name":"newCurator","type":"bool"},{"name":"yea","type":"uint256"},{"name":"nay","type":"uint256"},{"name":"creator","type":"address"}],"type":"function"}]

Note that The DAO is currently generating a lot of events from the transactions generated when "investors" buying tokens in The DAO. This could slow your computer down. Search this site for the text "Mist freeze" if you encounter this issue.

2

You need the code (technically just the ABI); the address is not enough.

For example, to view DAO contract:

Open your mist account and click the contracts tab

Click Watch Contract

For Contract Name type "The DAO" or whatever you want

Paste 0xbb9bc244d798123fde783fcc1c72d3bb8c189413 for the contract address.

Paste either the minimal or the full json interface depending on which one you need. Click OK

5
  • So in my case, I don't have the code... this means it is gone? I can't access it anymore? Commented May 19, 2016 at 1:04
  • You don't need the code. You just need the ABI - it looks like the JSON text in the other answer to your question. Commented May 19, 2016 at 1:06
  • @GianCarloMartinelli You need the code to get the ABI, or get the ABI from whoever wrote the code.
    – eth
    Commented May 19, 2016 at 1:07
  • wow... I wish the tutorials explained the importance of saving the code/abi/json... this is very bad UX design IMO. Hope they fix this. Commented May 19, 2016 at 1:08
  • 3
    When you write a program, you usually always save the code because losing it is the same as losing the program.
    – eth
    Commented May 19, 2016 at 1:22

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.