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 (val) {
if(val) {
defaultAccount = utils.toChecksumAddress(formatters.inputAddressFormatter(val));
}
// update defaultBlock
methods.forEach(function(method) {
method.defaultAccount = defaultAccount;
});
return val;
},
enumerable: true
Contract.prototype._getOrSetDefaultOptions = function getOrSetDefaultOptions(options) {
var gasPrice = options.gasPrice ? String(options.gasPrice): null;
var from = options.from ? utils.toChecksumAddress(formatters.inputAddressFormatter(options.from)) : null;
options.data = options.data || this.options.data;
options.from = from || this.options.from;
options.gasPrice = gasPrice || this.options.gasPrice;
options.gas = options.gas || options.gasLimit || this.options.gas;
// TODO replace with only gasLimit?
delete options.gasLimit;
return options;
};
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(){
this._inputFormatter = function(){
var args = Array.prototype.slice.call(arguments);
args[0] = formatters.inputAddressFormatter(args[0]);
return f.formatInputInt.apply(this, args);
};
this._outputFormatter = f.formatOutputAddress;
set: function (val) {
if(val) {
defaultAccount = utils.toChecksumAddress(formatters.inputAddressFormatter(val));
}
return val;
},
enumerable: true