Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
set: function (value) {
if(value) {
try {
defaultAccount = utils.toChecksumAddress(formatter.inputAddressFormatter(value));
} catch(error) {
if (value.match(/^[a-z]+([\.\-]?[a-z]+)?$/)) {
ens.getAddress(value).then(function (address) {
_this._address = address;
value = address;
}).catch(function () {
throw new Error('Given ENS address "'+ value +'" does not exist.');
});
} else {
throw error;
}
}
}
// also set on the Contract object
_this.Contract.defaultAccount = defaultAccount;
_this.personal.defaultAccount = defaultAccount;
// update defaultBlock
set: function(value){
if(value) {
try {
_this._address = utils.toChecksumAddress(formatters.inputAddressFormatter(value));
} catch (error) {
if (value.match(/^[a-z]+([\.\-]?[a-z]+)?$/)) {
ens.getAddress(value).then(function (address) {
_this._address = address;
}).catch(function () {
throw new Error('Given ENS address "'+ value +'" does not exist.');
});
} else {
throw error;
}
}
}
},
get: function(){