detect invalid addresses

This commit is contained in:
Iuri Matias 2018-03-04 19:18:39 -05:00
parent ac79cef97b
commit 33b42dd9c1
1 changed files with 9 additions and 0 deletions

View File

@ -66,6 +66,15 @@ class Deploy {
realArgs = self.determineArguments(params || contract.args);
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;
if (this.deployTracker) {
self.deployTracker.trackContract(contract.className, contract.realRuntimeBytecode, realArgs, contract.address);