Skip to content

Commit 87a04cd

Browse files
committed
fix(@embark/contracts-manager): always deploy contracts with deploy: true
This was an issue experienced with ENS contracts not being deployed because the configs used `strategy: explicit` and ENS configs are not in configs. To fix, I changed the way we check for deploy. If `deploy` is set as `true` it should always deploy even if not in configs. It just means they were added from a plugin (like ENS) Also, I needed to set to `false` the `deploy` property of contracts compiled that were not in config, because otherwise, they tried to deploy, which goes against the strategy. This is because those contracts get initiated as `deploy: true`.
1 parent 0e30bf3 commit 87a04cd

File tree

1 file changed

+6
-2
lines changed
  • packages/stack/contracts-manager/src

1 file changed

+6
-2
lines changed

packages/stack/contracts-manager/src/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ export default class ContractsManager {
313313
contract = new Contract(self.logger, contractConfig);
314314
contract.className = className;
315315
contract.args = [];
316+
if (contractsConfig.strategy === constants.deploymentStrategy.explicit) {
317+
contract.deploy = false;
318+
}
316319
}
317320

318321
contract.code = compiledContract.code;
@@ -353,15 +356,16 @@ export default class ContractsManager {
353356

354357
for (className in self.contracts) {
355358
contract = self.contracts[className];
356-
contract.deploy = (contract.deploy === undefined) || contract.deploy;
357359
if (self.deployOnlyOnConfig && !contractsConfig.contracts[className]) {
358360
contract.deploy = false;
359361
}
360362

361-
if (!contractsConfig.contracts[className] && contractsConfig.strategy === constants.deploymentStrategy.explicit) {
363+
if (contract.deploy !== true && !contractsConfig.contracts[className] && contractsConfig.strategy === constants.deploymentStrategy.explicit) {
362364
contract.deploy = false;
363365
}
364366

367+
contract.deploy = contract.deploy ?? true;
368+
365369
if (contract.code === "") {
366370
const message = __("assuming %s to be an interface", className);
367371
if (contract.silent || (isTest && !contractsInConfig.includes(className))) {

0 commit comments

Comments
 (0)