trufflesuite / trufflesuite.github.io

Staging Repo of Build Artifacts for Truffle Suite. Find the source at https://github.com/trufflesuite/trufflesuite.com
https://www.trufflesuite.com
34 stars 161 forks source link

Deployer basic example is very obscure #228

Open barakman opened 5 years ago

barakman commented 5 years ago

From the website:

// Deploy A, then deploy B, passing in A's newly deployed address
deployer.deploy(A).then(function() {
  return deployer.deploy(B, A.address);
});

I would tend to guess that A is the name of a contract, i.e., typeof A == "string".

However, since you also use A.address, this variable has to be an object of some sort.

How do I generate this object (or where do I obtain it from)?

The answer is `A = artifacts.require("A.sol"), so it should probably precede the code above.

Thanks