2015-07-28 03:44:19 +02:00
|
|
|
var f = require('./formatters');
|
|
|
|
var SolidityType = require('./type');
|
|
|
|
|
2015-07-28 08:28:46 +02:00
|
|
|
/**
|
|
|
|
* SolidityTypeAddress is a prootype that represents address type
|
|
|
|
* It matches:
|
|
|
|
* address
|
|
|
|
* address[]
|
|
|
|
* address[4]
|
|
|
|
* address[][]
|
|
|
|
* address[3][]
|
|
|
|
* address[][6][], ...
|
|
|
|
*/
|
2015-07-28 03:44:19 +02:00
|
|
|
var SolidityTypeAddress = function () {
|
|
|
|
this._inputFormatter = f.formatInputInt;
|
|
|
|
this._outputFormatter = f.formatOutputAddress;
|
|
|
|
};
|
|
|
|
|
|
|
|
SolidityTypeAddress.prototype = new SolidityType({});
|
|
|
|
SolidityTypeAddress.prototype.constructor = SolidityTypeAddress;
|
|
|
|
|
|
|
|
SolidityTypeAddress.prototype.isType = function (name) {
|
|
|
|
return !!name.match(/address(\[([0-9]*)\])?/);
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = SolidityTypeAddress;
|