Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Where can I find the DeployedAddresses.sol file? #471

Closed
JustinDrake opened this issue Jun 29, 2017 · 5 comments
Closed

Where can I find the DeployedAddresses.sol file? #471

JustinDrake opened this issue Jun 29, 2017 · 5 comments
Labels

Comments

@JustinDrake
Copy link

I cannot find the DeployedAddresses.sol file. It's not in the global truffle repo /usr/local/lib/node_modules/truffle. It's not in the folder created by truffle init. It's not in the Git repo https://github.com/trufflesuite/truffle.

Where can I find the DeployedAddresses.sol file?

@tcoulter
Copy link
Contributor

Hi there,

This file is dynamically created at test time. When you run your tests. Truffle creates this file depending on which contracts are deployed. Its contents looks something like this:

contract DeployedAddresses {
  function MetaCoin() returns (address) {
    return 0x...; // address is hardcoded
  }
  // If there are more contracts deployed, they'll be included as well.
}

You include DeployedAddresses.sol in your tests by importing truffle/DeployedAddresses.sol. Here, truffle is a meta package that may include dynamically created contracts like DeployedAddresses.

Let me know if this helps. Thanks!

@VoR0220
Copy link

VoR0220 commented Dec 1, 2017

@tcoulter what if I wanted to test a factory of contracts and pick and choose from which ones to run tests on? How would I best organize this?

@dmgarland
Copy link

Found the source generator in Truffle Core https://github.com/trufflesuite/truffle-core/blob/b3ad375993ec42bc622c7674258edc7614944482/lib/testing/deployed.js

@dmgarland
Copy link

@VoR0220 see also #237 (comment)

@COOLICEBLAST
Copy link

I also faced this kind of problem.
I can't find "DeployedAddresses.sol" file and there is no such a data in roaming folder at my local storage

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants