mirror of https://github.com/embarklabs/embark.git
detect invalid addresses
This commit is contained in:
parent
ac79cef97b
commit
33b42dd9c1
|
@ -66,6 +66,15 @@ class Deploy {
|
||||||
realArgs = self.determineArguments(params || contract.args);
|
realArgs = self.determineArguments(params || contract.args);
|
||||||
|
|
||||||
if (contract.address !== undefined) {
|
if (contract.address !== undefined) {
|
||||||
|
try {
|
||||||
|
this.web3.utils.toChecksumAddress(contract.address);
|
||||||
|
} catch(e) {
|
||||||
|
self.logger.error("error deploying " + contract.className);
|
||||||
|
self.logger.error(e.message);
|
||||||
|
contract.error = e.message;
|
||||||
|
self.events.emit('contractsState', self.contractsManager.contractsState());
|
||||||
|
return callback(e.message);
|
||||||
|
}
|
||||||
contract.deployedAddress = contract.address;
|
contract.deployedAddress = contract.address;
|
||||||
if (this.deployTracker) {
|
if (this.deployTracker) {
|
||||||
self.deployTracker.trackContract(contract.className, contract.realRuntimeBytecode, realArgs, contract.address);
|
self.deployTracker.trackContract(contract.className, contract.realRuntimeBytecode, realArgs, contract.address);
|
||||||
|
|
Loading…
Reference in New Issue