").append( jQuery.parseHTML( responseText ) ).find( selector ) :
// Otherwise use the full result
responseText );
}).complete( callback && function( jqXHR, status ) {
self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
});
}
return this;
};
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
};
var docElem = window.document.documentElement;
/**
* Gets a window from an element
*/
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
jQuery.offset = {
setOffset: function( elem, options, i ) {
var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
position = jQuery.css( elem, "position" ),
curElem = jQuery( elem ),
props = {};
// set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
elem.style.position = "relative";
}
curOffset = curElem.offset();
curCSSTop = jQuery.css( elem, "top" );
curCSSLeft = jQuery.css( elem, "left" );
calculatePosition = ( position === "absolute" || position === "fixed" ) &&
jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
if ( calculatePosition ) {
curPosition = curElem.position();
curTop = curPosition.top;
curLeft = curPosition.left;
} else {
curTop = parseFloat( curCSSTop ) || 0;
curLeft = parseFloat( curCSSLeft ) || 0;
}
if ( jQuery.isFunction( options ) ) {
options = options.call( elem, i, curOffset );
}
if ( options.top != null ) {
props.top = ( options.top - curOffset.top ) + curTop;
}
if ( options.left != null ) {
props.left = ( options.left - curOffset.left ) + curLeft;
}
if ( "using" in options ) {
options.using.call( elem, props );
} else {
curElem.css( props );
}
}
};
jQuery.fn.extend({
offset: function( options ) {
if ( arguments.length ) {
return options === undefined ?
this :
this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
var docElem, win,
box = { top: 0, left: 0 },
elem = this[ 0 ],
doc = elem && elem.ownerDocument;
if ( !doc ) {
return;
}
docElem = doc.documentElement;
// Make sure it's not a disconnected DOM node
if ( !jQuery.contains( docElem, elem ) ) {
return box;
}
// If we don't have gBCR, just use 0,0 rather than error
// BlackBerry 5, iOS 3 (original iPhone)
if ( typeof elem.getBoundingClientRect !== strundefined ) {
box = elem.getBoundingClientRect();
}
win = getWindow( doc );
return {
top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
};
},
position: function() {
if ( !this[ 0 ] ) {
return;
}
var offsetParent, offset,
parentOffset = { top: 0, left: 0 },
elem = this[ 0 ];
// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
if ( jQuery.css( elem, "position" ) === "fixed" ) {
// we assume that getBoundingClientRect is available when computed position is fixed
offset = elem.getBoundingClientRect();
} else {
// Get *real* offsetParent
offsetParent = this.offsetParent();
// Get correct offsets
offset = this.offset();
if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
parentOffset = offsetParent.offset();
}
// Add offsetParent borders
parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
}
// Subtract parent offsets and element margins
// note: when an element has margin: auto the offsetLeft and marginLeft
// are the same in Safari causing offset.left to incorrectly be 0
return {
top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
};
},
offsetParent: function() {
return this.map(function() {
var offsetParent = this.offsetParent || docElem;
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent || docElem;
});
}
});
// Create scrollLeft and scrollTop methods
jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
var top = /Y/.test( prop );
jQuery.fn[ method ] = function( val ) {
return access( this, function( elem, method, val ) {
var win = getWindow( elem );
if ( val === undefined ) {
return win ? (prop in win) ? win[ prop ] :
win.document.documentElement[ method ] :
elem[ method ];
}
if ( win ) {
win.scrollTo(
!top ? val : jQuery( win ).scrollLeft(),
top ? val : jQuery( win ).scrollTop()
);
} else {
elem[ method ] = val;
}
}, method, val, arguments.length, null );
};
});
// Add the top/left cssHooks using jQuery.fn.position
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
// getComputedStyle returns percent when specified for top/left/bottom/right
// rather than make the css module depend on the offset module, we just check for it here
jQuery.each( [ "top", "left" ], function( i, prop ) {
jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
function( elem, computed ) {
if ( computed ) {
computed = curCSS( elem, prop );
// if curCSS returns percentage, fallback to offset
return rnumnonpx.test( computed ) ?
jQuery( elem ).position()[ prop ] + "px" :
computed;
}
}
);
});
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
// margin is only for outerHeight, outerWidth
jQuery.fn[ funcName ] = function( margin, value ) {
var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
return access( this, function( elem, type, value ) {
var doc;
if ( jQuery.isWindow( elem ) ) {
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
// isn't a whole lot we can do. See pull request at this URL for discussion:
// https://github.com/jquery/jquery/pull/764
return elem.document.documentElement[ "client" + name ];
}
// Get document width or height
if ( elem.nodeType === 9 ) {
doc = elem.documentElement;
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
return Math.max(
elem.body[ "scroll" + name ], doc[ "scroll" + name ],
elem.body[ "offset" + name ], doc[ "offset" + name ],
doc[ "client" + name ]
);
}
return value === undefined ?
// Get width or height on the element, requesting but not forcing parseFloat
jQuery.css( elem, type, extra ) :
// Set width or height on the element
jQuery.style( elem, type, value, extra );
}, type, chainable ? margin : undefined, chainable, null );
};
});
});
// The number of elements contained in the matched element set
jQuery.fn.size = function() {
return this.length;
};
jQuery.fn.andSelf = jQuery.fn.addBack;
// Register as a named AMD module, since jQuery can be concatenated with other
// files that may use define, but not via a proper concatenation script that
// understands anonymous AMD modules. A named AMD is safest and most robust
// way to register. Lowercase jquery is used because AMD module names are
// derived from file names, and jQuery is normally delivered in a lowercase
// file name. Do this after creating the global so that if an AMD module wants
// to call noConflict to hide this version of jQuery, it will work.
// Note that for maximum portability, libraries that are not jQuery should
// declare themselves as anonymous modules, and avoid setting a global if an
// AMD loader is present. jQuery is a special case. For more information, see
// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
if ( typeof define === "function" && define.amd ) {
define( "jquery", [], function() {
return jQuery;
});
}
var
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$;
jQuery.noConflict = function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
}
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQuery;
}
return jQuery;
};
// Expose jQuery and $ identifiers, even in
// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
// and CommonJS for browser emulators (#13566)
if ( typeof noGlobal === strundefined ) {
window.jQuery = window.$ = jQuery;
}
return jQuery;
}));
================================================
FILE: DatabaseManager/asset/socket.io-1.3.7.js
================================================
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.io=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o
0&&!this.encoding){var pack=this.packetBuffer.shift();this.packet(pack)}};Manager.prototype.cleanup=function(){var sub;while(sub=this.subs.shift())sub.destroy();this.packetBuffer=[];this.encoding=false;this.decoder.destroy()};Manager.prototype.close=Manager.prototype.disconnect=function(){this.skipReconnect=true;this.backoff.reset();this.readyState="closed";this.engine&&this.engine.close()};Manager.prototype.onclose=function(reason){debug("close");this.cleanup();this.backoff.reset();this.readyState="closed";this.emit("close",reason);if(this._reconnection&&!this.skipReconnect){this.reconnect()}};Manager.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var self=this;if(this.backoff.attempts>=this._reconnectionAttempts){debug("reconnect failed");this.backoff.reset();this.emitAll("reconnect_failed");this.reconnecting=false}else{var delay=this.backoff.duration();debug("will wait %dms before reconnect attempt",delay);this.reconnecting=true;var timer=setTimeout(function(){if(self.skipReconnect)return;debug("attempting reconnect");self.emitAll("reconnect_attempt",self.backoff.attempts);self.emitAll("reconnecting",self.backoff.attempts);if(self.skipReconnect)return;self.open(function(err){if(err){debug("reconnect attempt error");self.reconnecting=false;self.reconnect();self.emitAll("reconnect_error",err.data)}else{debug("reconnect success");self.onreconnect()}})},delay);this.subs.push({destroy:function(){clearTimeout(timer)}})}};Manager.prototype.onreconnect=function(){var attempt=this.backoff.attempts;this.reconnecting=false;this.backoff.reset();this.updateSocketIds();this.emitAll("reconnect",attempt)}},{"./on":4,"./socket":5,"./url":6,backo2:7,"component-bind":8,"component-emitter":9,debug:10,"engine.io-client":11,indexof:40,"object-component":41,"socket.io-parser":44}],4:[function(_dereq_,module,exports){module.exports=on;function on(obj,ev,fn){obj.on(ev,fn);return{destroy:function(){obj.removeListener(ev,fn)}}}},{}],5:[function(_dereq_,module,exports){var parser=_dereq_("socket.io-parser");var Emitter=_dereq_("component-emitter");var toArray=_dereq_("to-array");var on=_dereq_("./on");var bind=_dereq_("component-bind");var debug=_dereq_("debug")("socket.io-client:socket");var hasBin=_dereq_("has-binary");module.exports=exports=Socket;var events={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1};var emit=Emitter.prototype.emit;function Socket(io,nsp){this.io=io;this.nsp=nsp;this.json=this;this.ids=0;this.acks={};if(this.io.autoConnect)this.open();this.receiveBuffer=[];this.sendBuffer=[];this.connected=false;this.disconnected=true}Emitter(Socket.prototype);Socket.prototype.subEvents=function(){if(this.subs)return;var io=this.io;this.subs=[on(io,"open",bind(this,"onopen")),on(io,"packet",bind(this,"onpacket")),on(io,"close",bind(this,"onclose"))]};Socket.prototype.open=Socket.prototype.connect=function(){if(this.connected)return this;this.subEvents();this.io.open();if("open"==this.io.readyState)this.onopen();return this};Socket.prototype.send=function(){var args=toArray(arguments);args.unshift("message");this.emit.apply(this,args);return this};Socket.prototype.emit=function(ev){if(events.hasOwnProperty(ev)){emit.apply(this,arguments);return this}var args=toArray(arguments);var parserType=parser.EVENT;if(hasBin(args)){parserType=parser.BINARY_EVENT}var packet={type:parserType,data:args};if("function"==typeof args[args.length-1]){debug("emitting packet with ack id %d",this.ids);this.acks[this.ids]=args.pop();packet.id=this.ids++}if(this.connected){this.packet(packet)}else{this.sendBuffer.push(packet)}return this};Socket.prototype.packet=function(packet){packet.nsp=this.nsp;this.io.packet(packet)};Socket.prototype.onopen=function(){debug("transport is open - connecting");if("/"!=this.nsp){this.packet({type:parser.CONNECT})}};Socket.prototype.onclose=function(reason){debug("close (%s)",reason);this.connected=false;this.disconnected=true;delete this.id;this.emit("disconnect",reason)};Socket.prototype.onpacket=function(packet){if(packet.nsp!=this.nsp)return;switch(packet.type){case parser.CONNECT:this.onconnect();break;case parser.EVENT:this.onevent(packet);break;case parser.BINARY_EVENT:this.onevent(packet);break;case parser.ACK:this.onack(packet);break;case parser.BINARY_ACK:this.onack(packet);break;case parser.DISCONNECT:this.ondisconnect();break;case parser.ERROR:this.emit("error",packet.data);break}};Socket.prototype.onevent=function(packet){var args=packet.data||[];debug("emitting event %j",args);if(null!=packet.id){debug("attaching ack callback to event");args.push(this.ack(packet.id))}if(this.connected){emit.apply(this,args)}else{this.receiveBuffer.push(args)}};Socket.prototype.ack=function(id){var self=this;var sent=false;return function(){if(sent)return;sent=true;var args=toArray(arguments);debug("sending ack %j",args);var type=hasBin(args)?parser.BINARY_ACK:parser.ACK;self.packet({type:type,id:id,data:args})}};Socket.prototype.onack=function(packet){debug("calling ack %s with %j",packet.id,packet.data);var fn=this.acks[packet.id];fn.apply(this,packet.data);delete this.acks[packet.id]};Socket.prototype.onconnect=function(){this.connected=true;this.disconnected=false;this.emit("connect");this.emitBuffered()};Socket.prototype.emitBuffered=function(){var i;for(i=0;i0&&opts.jitter<=1?opts.jitter:0;this.attempts=0}Backoff.prototype.duration=function(){var ms=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var rand=Math.random();var deviation=Math.floor(rand*this.jitter*ms);ms=(Math.floor(rand*10)&1)==0?ms-deviation:ms+deviation}return Math.min(ms,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(min){this.ms=min};Backoff.prototype.setMax=function(max){this.max=max};Backoff.prototype.setJitter=function(jitter){this.jitter=jitter}},{}],8:[function(_dereq_,module,exports){var slice=[].slice;module.exports=function(obj,fn){if("string"==typeof fn)fn=obj[fn];if("function"!=typeof fn)throw new Error("bind() requires a function");var args=slice.call(arguments,2);return function(){return fn.apply(obj,args.concat(slice.call(arguments)))}}},{}],9:[function(_dereq_,module,exports){module.exports=Emitter;function Emitter(obj){if(obj)return mixin(obj)}function mixin(obj){for(var key in Emitter.prototype){obj[key]=Emitter.prototype[key]}return obj}Emitter.prototype.on=Emitter.prototype.addEventListener=function(event,fn){this._callbacks=this._callbacks||{};(this._callbacks[event]=this._callbacks[event]||[]).push(fn);return this};Emitter.prototype.once=function(event,fn){var self=this;this._callbacks=this._callbacks||{};function on(){self.off(event,on);fn.apply(this,arguments)}on.fn=fn;this.on(event,on);return this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(event,fn){this._callbacks=this._callbacks||{};if(0==arguments.length){this._callbacks={};return this}var callbacks=this._callbacks[event];if(!callbacks)return this;if(1==arguments.length){delete this._callbacks[event];return this}var cb;for(var i=0;i=hour)return(ms/hour).toFixed(1)+"h";if(ms>=min)return(ms/min).toFixed(1)+"m";if(ms>=sec)return(ms/sec|0)+"s";return ms+"ms"};debug.enabled=function(name){for(var i=0,len=debug.skips.length;i';iframe=document.createElement(html)}catch(e){iframe=document.createElement("iframe");iframe.name=self.iframeId;iframe.src="javascript:0"}iframe.id=self.iframeId;self.form.appendChild(iframe);self.iframe=iframe}initIframe();data=data.replace(rEscapedNewline,"\\\n");this.area.value=data.replace(rNewline,"\\n");try{this.form.submit()}catch(e){}if(this.iframe.attachEvent){this.iframe.onreadystatechange=function(){if(self.iframe.readyState=="complete"){complete()}}}else{this.iframe.onload=complete}}}).call(this,typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./polling":18,"component-inherit":21}],17:[function(_dereq_,module,exports){(function(global){var XMLHttpRequest=_dereq_("xmlhttprequest");var Polling=_dereq_("./polling");var Emitter=_dereq_("component-emitter");var inherit=_dereq_("component-inherit");var debug=_dereq_("debug")("engine.io-client:polling-xhr");module.exports=XHR;module.exports.Request=Request;function empty(){}function XHR(opts){Polling.call(this,opts);if(global.location){var isSSL="https:"==location.protocol;var port=location.port;if(!port){port=isSSL?443:80}this.xd=opts.hostname!=global.location.hostname||port!=opts.port;this.xs=opts.secure!=isSSL}}inherit(XHR,Polling);XHR.prototype.supportsBinary=true;XHR.prototype.request=function(opts){opts=opts||{};opts.uri=this.uri();opts.xd=this.xd;opts.xs=this.xs;opts.agent=this.agent||false;opts.supportsBinary=this.supportsBinary;opts.enablesXDR=this.enablesXDR;opts.pfx=this.pfx;opts.key=this.key;opts.passphrase=this.passphrase;opts.cert=this.cert;opts.ca=this.ca;opts.ciphers=this.ciphers;opts.rejectUnauthorized=this.rejectUnauthorized;return new Request(opts)};XHR.prototype.doWrite=function(data,fn){var isBinary=typeof data!=="string"&&data!==undefined;var req=this.request({method:"POST",data:data,isBinary:isBinary});var self=this;req.on("success",fn);req.on("error",function(err){self.onError("xhr post error",err)});this.sendXhr=req};XHR.prototype.doPoll=function(){debug("xhr poll");var req=this.request();var self=this;req.on("data",function(data){self.onData(data)});req.on("error",function(err){self.onError("xhr poll error",err)});this.pollXhr=req};function Request(opts){this.method=opts.method||"GET";this.uri=opts.uri;this.xd=!!opts.xd;this.xs=!!opts.xs;this.async=false!==opts.async;this.data=undefined!=opts.data?opts.data:null;this.agent=opts.agent;this.isBinary=opts.isBinary;this.supportsBinary=opts.supportsBinary;this.enablesXDR=opts.enablesXDR;this.pfx=opts.pfx;this.key=opts.key;this.passphrase=opts.passphrase;this.cert=opts.cert;this.ca=opts.ca;this.ciphers=opts.ciphers;this.rejectUnauthorized=opts.rejectUnauthorized;this.create()}Emitter(Request.prototype);Request.prototype.create=function(){var opts={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};opts.pfx=this.pfx;opts.key=this.key;opts.passphrase=this.passphrase;opts.cert=this.cert;opts.ca=this.ca;opts.ciphers=this.ciphers;opts.rejectUnauthorized=this.rejectUnauthorized;var xhr=this.xhr=new XMLHttpRequest(opts);var self=this;try{debug("xhr open %s: %s",this.method,this.uri);xhr.open(this.method,this.uri,this.async);if(this.supportsBinary){xhr.responseType="arraybuffer"}if("POST"==this.method){try{if(this.isBinary){xhr.setRequestHeader("Content-type","application/octet-stream")}else{xhr.setRequestHeader("Content-type","text/plain;charset=UTF-8")}}catch(e){}}if("withCredentials"in xhr){xhr.withCredentials=true}if(this.hasXDR()){xhr.onload=function(){self.onLoad()};xhr.onerror=function(){self.onError(xhr.responseText)}}else{xhr.onreadystatechange=function(){if(4!=xhr.readyState)return;if(200==xhr.status||1223==xhr.status){self.onLoad()}else{setTimeout(function(){self.onError(xhr.status)},0)}}}debug("xhr data %s",this.data);xhr.send(this.data)}catch(e){setTimeout(function(){self.onError(e)},0);return}if(global.document){this.index=Request.requestsCount++;Request.requests[this.index]=this}};Request.prototype.onSuccess=function(){this.emit("success");this.cleanup()};Request.prototype.onData=function(data){this.emit("data",data);this.onSuccess()};Request.prototype.onError=function(err){this.emit("error",err);this.cleanup(true)};Request.prototype.cleanup=function(fromError){if("undefined"==typeof this.xhr||null===this.xhr){return}if(this.hasXDR()){this.xhr.onload=this.xhr.onerror=empty}else{this.xhr.onreadystatechange=empty}if(fromError){try{this.xhr.abort()}catch(e){}}if(global.document){delete Request.requests[this.index]}this.xhr=null};Request.prototype.onLoad=function(){var data;try{var contentType;try{contentType=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch(e){}if(contentType==="application/octet-stream"){data=this.xhr.response}else{if(!this.supportsBinary){data=this.xhr.responseText}else{data="ok"}}}catch(e){this.onError(e)}if(null!=data){this.onData(data)}};Request.prototype.hasXDR=function(){return"undefined"!==typeof global.XDomainRequest&&!this.xs&&this.enablesXDR};Request.prototype.abort=function(){this.cleanup()};if(global.document){Request.requestsCount=0;Request.requests={};if(global.attachEvent){global.attachEvent("onunload",unloadHandler)}else if(global.addEventListener){global.addEventListener("beforeunload",unloadHandler,false)}}function unloadHandler(){for(var i in Request.requests){if(Request.requests.hasOwnProperty(i)){Request.requests[i].abort()}}}}).call(this,typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./polling":18,"component-emitter":9,"component-inherit":21,debug:22,xmlhttprequest:20}],18:[function(_dereq_,module,exports){var Transport=_dereq_("../transport");var parseqs=_dereq_("parseqs");var parser=_dereq_("engine.io-parser");var inherit=_dereq_("component-inherit");var debug=_dereq_("debug")("engine.io-client:polling");module.exports=Polling;var hasXHR2=function(){var XMLHttpRequest=_dereq_("xmlhttprequest");var xhr=new XMLHttpRequest({xdomain:false});return null!=xhr.responseType}();function Polling(opts){var forceBase64=opts&&opts.forceBase64;if(!hasXHR2||forceBase64){this.supportsBinary=false}Transport.call(this,opts)}inherit(Polling,Transport);Polling.prototype.name="polling";Polling.prototype.doOpen=function(){this.poll()};Polling.prototype.pause=function(onPause){var pending=0;var self=this;this.readyState="pausing";function pause(){debug("paused");self.readyState="paused";onPause()}if(this.polling||!this.writable){var total=0;if(this.polling){debug("we are currently polling - waiting to pause");total++;this.once("pollComplete",function(){debug("pre-pause polling complete");--total||pause()})}if(!this.writable){debug("we are currently writing - waiting to pause");total++;this.once("drain",function(){debug("pre-pause writing complete");--total||pause()})}}else{pause()}};Polling.prototype.poll=function(){debug("polling");this.polling=true;this.doPoll();this.emit("poll")};Polling.prototype.onData=function(data){var self=this;debug("polling got data %s",data);var callback=function(packet,index,total){if("opening"==self.readyState){self.onOpen()}if("close"==packet.type){self.onClose();return false}self.onPacket(packet)};parser.decodePayload(data,this.socket.binaryType,callback);if("closed"!=this.readyState){this.polling=false;this.emit("pollComplete");if("open"==this.readyState){this.poll()}else{debug('ignoring poll - transport state "%s"',this.readyState)}}};Polling.prototype.doClose=function(){var self=this;function close(){debug("writing close packet");self.write([{type:"close"}])}if("open"==this.readyState){debug("transport open - closing");close()}else{debug("transport not open - deferring close");this.once("open",close)}};Polling.prototype.write=function(packets){var self=this;this.writable=false;var callbackfn=function(){self.writable=true;self.emit("drain")};var self=this;parser.encodePayload(packets,this.supportsBinary,function(data){self.doWrite(data,callbackfn)})};Polling.prototype.uri=function(){var query=this.query||{};var schema=this.secure?"https":"http";var port="";if(false!==this.timestampRequests){query[this.timestampParam]=+new Date+"-"+Transport.timestamps++}if(!this.supportsBinary&&!query.sid){query.b64=1}query=parseqs.encode(query);if(this.port&&("https"==schema&&this.port!=443||"http"==schema&&this.port!=80)){port=":"+this.port}if(query.length){query="?"+query}return schema+"://"+this.hostname+port+this.path+query}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,xmlhttprequest:20}],19:[function(_dereq_,module,exports){var Transport=_dereq_("../transport");var parser=_dereq_("engine.io-parser");var parseqs=_dereq_("parseqs");var inherit=_dereq_("component-inherit");var debug=_dereq_("debug")("engine.io-client:websocket");var WebSocket=_dereq_("ws");module.exports=WS;function WS(opts){var forceBase64=opts&&opts.forceBase64;if(forceBase64){this.supportsBinary=false}Transport.call(this,opts)}inherit(WS,Transport);WS.prototype.name="websocket";WS.prototype.supportsBinary=true;WS.prototype.doOpen=function(){if(!this.check()){return}var self=this;var uri=this.uri();var protocols=void 0;var opts={agent:this.agent};opts.pfx=this.pfx;opts.key=this.key;opts.passphrase=this.passphrase;opts.cert=this.cert;opts.ca=this.ca;opts.ciphers=this.ciphers;opts.rejectUnauthorized=this.rejectUnauthorized;this.ws=new WebSocket(uri,protocols,opts);if(this.ws.binaryType===undefined){this.supportsBinary=false}this.ws.binaryType="arraybuffer";this.addEventListeners()};WS.prototype.addEventListeners=function(){var self=this;this.ws.onopen=function(){self.onOpen()};this.ws.onclose=function(){self.onClose()};this.ws.onmessage=function(ev){self.onData(ev.data)};this.ws.onerror=function(e){self.onError("websocket error",e)}};if("undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)){WS.prototype.onData=function(data){var self=this;setTimeout(function(){Transport.prototype.onData.call(self,data)},0)}}WS.prototype.write=function(packets){var self=this;this.writable=false;for(var i=0,l=packets.length;i=31}exports.formatters.j=function(v){return JSON.stringify(v)};function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?"%c":"")+this.namespace+(useColors?" %c":" ")+args[0]+(useColors?"%c ":" ")+"+"+exports.humanize(this.diff);if(!useColors)return args;var c="color: "+this.color;args=[args[0],c,"color: inherit"].concat(Array.prototype.slice.call(args,1));var index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if("%%"===match)return;index++;if("%c"===match){lastC=index}});args.splice(lastC,0,c);return args}function log(){return"object"==typeof console&&"function"==typeof console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(namespaces){try{if(null==namespaces){localStorage.removeItem("debug")}else{localStorage.debug=namespaces}}catch(e){}}function load(){var r;try{r=localStorage.debug}catch(e){}return r}exports.enable(load())},{"./debug":23}],23:[function(_dereq_,module,exports){exports=module.exports=debug;exports.coerce=coerce;exports.disable=disable;exports.enable=enable;exports.enabled=enabled;exports.humanize=_dereq_("ms");exports.names=[];exports.skips=[];exports.formatters={};var prevColor=0;var prevTime;function selectColor(){return exports.colors[prevColor++%exports.colors.length]}function debug(namespace){function disabled(){}disabled.enabled=false;function enabled(){var self=enabled;var curr=+new Date;var ms=curr-(prevTime||curr);self.diff=ms;self.prev=prevTime;self.curr=curr;prevTime=curr;if(null==self.useColors)self.useColors=exports.useColors();if(null==self.color&&self.useColors)self.color=selectColor();var args=Array.prototype.slice.call(arguments);args[0]=exports.coerce(args[0]);if("string"!==typeof args[0]){args=["%o"].concat(args)}var index=0;args[0]=args[0].replace(/%([a-z%])/g,function(match,format){if(match==="%%")return match;index++;var formatter=exports.formatters[format];if("function"===typeof formatter){var val=args[index];match=formatter.call(self,val);args.splice(index,1);index--}return match});if("function"===typeof exports.formatArgs){args=exports.formatArgs.apply(self,args)}var logFn=enabled.log||exports.log||console.log.bind(console);logFn.apply(self,args)}enabled.enabled=true;var fn=exports.enabled(namespace)?enabled:disabled;fn.namespace=namespace;return fn}function enable(namespaces){exports.save(namespaces);var split=(namespaces||"").split(/[\s,]+/);var len=split.length;for(var i=0;i=d)return Math.round(ms/d)+"d";if(ms>=h)return Math.round(ms/h)+"h";if(ms>=m)return Math.round(ms/m)+"m";if(ms>=s)return Math.round(ms/s)+"s";return ms+"ms"}function long(ms){return plural(ms,d,"day")||plural(ms,h,"hour")||plural(ms,m,"minute")||plural(ms,s,"second")||ms+" ms"}function plural(ms,n,name){if(ms1){return{type:packetslist[type],data:data.substring(1)}}else{return{type:packetslist[type]}}}var asArray=new Uint8Array(data);var type=asArray[0];var rest=sliceBuffer(data,1);if(Blob&&binaryType==="blob"){rest=new Blob([rest])}return{type:packetslist[type],data:rest}};exports.decodeBase64Packet=function(msg,binaryType){var type=packetslist[msg.charAt(0)];if(!global.ArrayBuffer){return{type:type,data:{base64:true,data:msg.substr(1)}}}var data=base64encoder.decode(msg.substr(1));if(binaryType==="blob"&&Blob){data=new Blob([data])}return{type:type,data:data}};exports.encodePayload=function(packets,supportsBinary,callback){if(typeof supportsBinary=="function"){callback=supportsBinary;supportsBinary=null}var isBinary=hasBinary(packets);if(supportsBinary&&isBinary){if(Blob&&!dontSendBlobs){return exports.encodePayloadAsBlob(packets,callback)}return exports.encodePayloadAsArrayBuffer(packets,callback)}if(!packets.length){return callback("0:")}function setLengthHeader(message){return message.length+":"+message}function encodeOne(packet,doneCallback){exports.encodePacket(packet,!isBinary?false:supportsBinary,true,function(message){doneCallback(null,setLengthHeader(message))})}map(packets,encodeOne,function(err,results){return callback(results.join(""))})};function map(ary,each,done){var result=new Array(ary.length);var next=after(ary.length,done);var eachWithIndex=function(i,el,cb){each(el,function(error,msg){result[i]=msg;cb(error,result)})};for(var i=0;i0){var tailArray=new Uint8Array(bufferTail);var isString=tailArray[0]===0;var msgLength="";for(var i=1;;i++){if(tailArray[i]==255)break;if(msgLength.length>310){numberTooLong=true;break}msgLength+=tailArray[i]}if(numberTooLong)return callback(err,0,1);bufferTail=sliceBuffer(bufferTail,2+msgLength.length);msgLength=parseInt(msgLength);var msg=sliceBuffer(bufferTail,0,msgLength);if(isString){try{msg=String.fromCharCode.apply(null,new Uint8Array(msg))}catch(e){var typed=new Uint8Array(msg);msg="";for(var i=0;ibytes){end=bytes}if(start>=bytes||start>=end||bytes===0){return new ArrayBuffer(0)}var abv=new Uint8Array(arraybuffer);var result=new Uint8Array(end-start);for(var i=start,ii=0;i>2];base64+=chars[(bytes[i]&3)<<4|bytes[i+1]>>4];base64+=chars[(bytes[i+1]&15)<<2|bytes[i+2]>>6];base64+=chars[bytes[i+2]&63]}if(len%3===2){base64=base64.substring(0,base64.length-1)+"="}else if(len%3===1){base64=base64.substring(0,base64.length-2)+"=="}return base64};exports.decode=function(base64){var bufferLength=base64.length*.75,len=base64.length,i,p=0,encoded1,encoded2,encoded3,encoded4;if(base64[base64.length-1]==="="){bufferLength--;if(base64[base64.length-2]==="="){bufferLength--}}var arraybuffer=new ArrayBuffer(bufferLength),bytes=new Uint8Array(arraybuffer);for(i=0;i>4;bytes[p++]=(encoded2&15)<<4|encoded3>>2;bytes[p++]=(encoded3&3)<<6|encoded4&63}return arraybuffer}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],30:[function(_dereq_,module,exports){(function(global){var BlobBuilder=global.BlobBuilder||global.WebKitBlobBuilder||global.MSBlobBuilder||global.MozBlobBuilder;var blobSupported=function(){try{var a=new Blob(["hi"]);return a.size===2}catch(e){return false}}();var blobSupportsArrayBufferView=blobSupported&&function(){try{var b=new Blob([new Uint8Array([1,2])]);return b.size===2}catch(e){return false}}();var blobBuilderSupported=BlobBuilder&&BlobBuilder.prototype.append&&BlobBuilder.prototype.getBlob;function mapArrayBufferViews(ary){for(var i=0;i=55296&&value<=56319&&counter65535){value-=65536;output+=stringFromCharCode(value>>>10&1023|55296);value=56320|value&1023}output+=stringFromCharCode(value)}return output}function checkScalarValue(codePoint){if(codePoint>=55296&&codePoint<=57343){throw Error("Lone surrogate U+"+codePoint.toString(16).toUpperCase()+" is not a scalar value")
}}function createByte(codePoint,shift){return stringFromCharCode(codePoint>>shift&63|128)}function encodeCodePoint(codePoint){if((codePoint&4294967168)==0){return stringFromCharCode(codePoint)}var symbol="";if((codePoint&4294965248)==0){symbol=stringFromCharCode(codePoint>>6&31|192)}else if((codePoint&4294901760)==0){checkScalarValue(codePoint);symbol=stringFromCharCode(codePoint>>12&15|224);symbol+=createByte(codePoint,6)}else if((codePoint&4292870144)==0){symbol=stringFromCharCode(codePoint>>18&7|240);symbol+=createByte(codePoint,12);symbol+=createByte(codePoint,6)}symbol+=stringFromCharCode(codePoint&63|128);return symbol}function utf8encode(string){var codePoints=ucs2decode(string);var length=codePoints.length;var index=-1;var codePoint;var byteString="";while(++index=byteCount){throw Error("Invalid byte index")}var continuationByte=byteArray[byteIndex]&255;byteIndex++;if((continuationByte&192)==128){return continuationByte&63}throw Error("Invalid continuation byte")}function decodeSymbol(){var byte1;var byte2;var byte3;var byte4;var codePoint;if(byteIndex>byteCount){throw Error("Invalid byte index")}if(byteIndex==byteCount){return false}byte1=byteArray[byteIndex]&255;byteIndex++;if((byte1&128)==0){return byte1}if((byte1&224)==192){var byte2=readContinuationByte();codePoint=(byte1&31)<<6|byte2;if(codePoint>=128){return codePoint}else{throw Error("Invalid continuation byte")}}if((byte1&240)==224){byte2=readContinuationByte();byte3=readContinuationByte();codePoint=(byte1&15)<<12|byte2<<6|byte3;if(codePoint>=2048){checkScalarValue(codePoint);return codePoint}else{throw Error("Invalid continuation byte")}}if((byte1&248)==240){byte2=readContinuationByte();byte3=readContinuationByte();byte4=readContinuationByte();codePoint=(byte1&15)<<18|byte2<<12|byte3<<6|byte4;if(codePoint>=65536&&codePoint<=1114111){return codePoint}}throw Error("Invalid UTF-8 detected")}var byteArray;var byteCount;var byteIndex;function utf8decode(byteString){byteArray=ucs2decode(byteString);byteCount=byteArray.length;byteIndex=0;var codePoints=[];var tmp;while((tmp=decodeSymbol())!==false){codePoints.push(tmp)}return ucs2encode(codePoints)}var utf8={version:"2.0.0",encode:utf8encode,decode:utf8decode};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define(function(){return utf8})}else if(freeExports&&!freeExports.nodeType){if(freeModule){freeModule.exports=utf8}else{var object={};var hasOwnProperty=object.hasOwnProperty;for(var key in utf8){hasOwnProperty.call(utf8,key)&&(freeExports[key]=utf8[key])}}}else{root.utf8=utf8}})(this)}).call(this,typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],32:[function(_dereq_,module,exports){(function(global){var rvalidchars=/^[\],:{}\s]*$/;var rvalidescape=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;var rvalidtokens=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;var rvalidbraces=/(?:^|:|,)(?:\s*\[)+/g;var rtrimLeft=/^\s+/;var rtrimRight=/\s+$/;module.exports=function parsejson(data){if("string"!=typeof data||!data){return null}data=data.replace(rtrimLeft,"").replace(rtrimRight,"");if(global.JSON&&JSON.parse){return JSON.parse(data)}if(rvalidchars.test(data.replace(rvalidescape,"@").replace(rvalidtokens,"]").replace(rvalidbraces,""))){return new Function("return "+data)()}}}).call(this,typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],33:[function(_dereq_,module,exports){exports.encode=function(obj){var str="";for(var i in obj){if(obj.hasOwnProperty(i)){if(str.length)str+="&";str+=encodeURIComponent(i)+"="+encodeURIComponent(obj[i])}}return str};exports.decode=function(qs){var qry={};var pairs=qs.split("&");for(var i=0,l=pairs.length;i1)))/4)-floor((year-1901+month)/100)+floor((year-1601+month)/400)}}if(!(isProperty={}.hasOwnProperty)){isProperty=function(property){var members={},constructor;if((members.__proto__=null,members.__proto__={toString:1},members).toString!=getClass){isProperty=function(property){var original=this.__proto__,result=property in(this.__proto__=null,this);this.__proto__=original;return result}}else{constructor=members.constructor;isProperty=function(property){var parent=(this.constructor||constructor).prototype;return property in this&&!(property in parent&&this[property]===parent[property])}}members=null;return isProperty.call(this,property)}}var PrimitiveTypes={"boolean":1,number:1,string:1,undefined:1};var isHostType=function(object,property){var type=typeof object[property];return type=="object"?!!object[property]:!PrimitiveTypes[type]};forEach=function(object,callback){var size=0,Properties,members,property;(Properties=function(){this.valueOf=0}).prototype.valueOf=0;members=new Properties;for(property in members){if(isProperty.call(members,property)){size++}}Properties=members=null;if(!size){members=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"];forEach=function(object,callback){var isFunction=getClass.call(object)==functionClass,property,length;var hasProperty=!isFunction&&typeof object.constructor!="function"&&isHostType(object,"hasOwnProperty")?object.hasOwnProperty:isProperty;for(property in object){if(!(isFunction&&property=="prototype")&&hasProperty.call(object,property)){callback(property)}}for(length=members.length;property=members[--length];hasProperty.call(object,property)&&callback(property));}}else if(size==2){forEach=function(object,callback){var members={},isFunction=getClass.call(object)==functionClass,property;for(property in object){if(!(isFunction&&property=="prototype")&&!isProperty.call(members,property)&&(members[property]=1)&&isProperty.call(object,property)){callback(property)}}}}else{forEach=function(object,callback){var isFunction=getClass.call(object)==functionClass,property,isConstructor;for(property in object){if(!(isFunction&&property=="prototype")&&isProperty.call(object,property)&&!(isConstructor=property==="constructor")){callback(property)}}if(isConstructor||isProperty.call(object,property="constructor")){callback(property)}}}return forEach(object,callback)};if(!has("json-stringify")){var Escapes={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"};var leadingZeroes="000000";var toPaddedString=function(width,value){return(leadingZeroes+(value||0)).slice(-width)};var unicodePrefix="\\u00";var quote=function(value){var result='"',index=0,length=value.length,isLarge=length>10&&charIndexBuggy,symbols;if(isLarge){symbols=value.split("")}for(;index-1/0&&value<1/0){if(getDay){date=floor(value/864e5);for(year=floor(date/365.2425)+1970-1;getDay(year+1,0)<=date;year++);for(month=floor((date-getDay(year,0))/30.42);getDay(year,month+1)<=date;month++);date=1+date-getDay(year,month);time=(value%864e5+864e5)%864e5;hours=floor(time/36e5)%24;minutes=floor(time/6e4)%60;seconds=floor(time/1e3)%60;milliseconds=time%1e3}else{year=value.getUTCFullYear();month=value.getUTCMonth();date=value.getUTCDate();hours=value.getUTCHours();minutes=value.getUTCMinutes();seconds=value.getUTCSeconds();milliseconds=value.getUTCMilliseconds()}value=(year<=0||year>=1e4?(year<0?"-":"+")+toPaddedString(6,year<0?-year:year):toPaddedString(4,year))+"-"+toPaddedString(2,month+1)+"-"+toPaddedString(2,date)+"T"+toPaddedString(2,hours)+":"+toPaddedString(2,minutes)+":"+toPaddedString(2,seconds)+"."+toPaddedString(3,milliseconds)+"Z"}else{value=null}}else if(typeof value.toJSON=="function"&&(className!=numberClass&&className!=stringClass&&className!=arrayClass||isProperty.call(value,"toJSON"))){value=value.toJSON(property)}}if(callback){value=callback.call(object,property,value)}if(value===null){return"null"}className=getClass.call(value);if(className==booleanClass){return""+value}else if(className==numberClass){return value>-1/0&&value<1/0?""+value:"null"}else if(className==stringClass){return quote(""+value)}if(typeof value=="object"){for(length=stack.length;length--;){if(stack[length]===value){throw TypeError()}}stack.push(value);results=[];prefix=indentation;indentation+=whitespace;if(className==arrayClass){for(index=0,length=value.length;index0){for(whitespace="",width>10&&(width=10);whitespace.length=48&&charCode<=57||charCode>=97&&charCode<=102||charCode>=65&&charCode<=70)){abort()}}value+=fromCharCode("0x"+source.slice(begin,Index));break;default:abort()}}else{if(charCode==34){break}charCode=source.charCodeAt(Index);begin=Index;while(charCode>=32&&charCode!=92&&charCode!=34){charCode=source.charCodeAt(++Index)}value+=source.slice(begin,Index)}}if(source.charCodeAt(Index)==34){Index++;return value}abort();default:begin=Index;if(charCode==45){isSigned=true;charCode=source.charCodeAt(++Index)}if(charCode>=48&&charCode<=57){if(charCode==48&&(charCode=source.charCodeAt(Index+1),charCode>=48&&charCode<=57)){abort()}isSigned=false;for(;Index=48&&charCode<=57);Index++);if(source.charCodeAt(Index)==46){position=++Index;for(;position=48&&charCode<=57);position++);if(position==Index){abort()}Index=position}charCode=source.charCodeAt(Index);if(charCode==101||charCode==69){charCode=source.charCodeAt(++Index);if(charCode==43||charCode==45){Index++}for(position=Index;position=48&&charCode<=57);position++);if(position==Index){abort()}Index=position}return+source.slice(begin,Index)}if(isSigned){abort()}if(source.slice(Index,Index+4)=="true"){Index+=4;return true}else if(source.slice(Index,Index+5)=="false"){Index+=5;return false}else if(source.slice(Index,Index+4)=="null"){Index+=4;return null}abort()}}return"$"};var get=function(value){var results,hasMembers;if(value=="$"){abort()}if(typeof value=="string"){if((charIndexBuggy?value.charAt(0):value[0])=="@"){return value.slice(1)}if(value=="["){results=[];for(;;hasMembers||(hasMembers=true)){value=lex();if(value=="]"){break}if(hasMembers){if(value==","){value=lex();if(value=="]"){abort()}}else{abort()}}if(value==","){abort()}results.push(get(value))}return results}else if(value=="{"){results={};for(;;hasMembers||(hasMembers=true)){value=lex();if(value=="}"){break}if(hasMembers){if(value==","){value=lex();if(value=="}"){abort()}}else{abort()}}if(value==","||typeof value!="string"||(charIndexBuggy?value.charAt(0):value[0])!="@"||lex()!=":"){abort()}results[value.slice(1)]=get(lex())}return results}abort()}return value};var update=function(source,property,callback){var element=walk(source,property,callback);if(element===undef){delete source[property]}else{source[property]=element}};var walk=function(source,property,callback){var value=source[property],length;if(typeof value=="object"&&value){if(getClass.call(value)==arrayClass){for(length=value.length;length--;){update(value,length,callback)}}else{forEach(value,function(property){update(value,property,callback)})}}return callback.call(source,property,value)};JSON3.parse=function(source,callback){var result,value;Index=0;Source=""+source;result=get(lex());if(lex()!="$"){abort()}Index=Source=null;return callback&&getClass.call(callback)==functionClass?walk((value={},value[""]=result,value),"",callback):result}}}if(isLoader){define(function(){return JSON3})}})(this)},{}],48:[function(_dereq_,module,exports){module.exports=toArray;function toArray(list,index){var array=[];index=index||0;for(var i=index||0;i lastBlockNumber {
lastBlockNumber = blockNumber
hexBlockNumber := "0x" + fmt.Sprintf("%x", lastBlockNumber+1)
txObject["fromBlock"] = hexBlockNumber
}
}
}
}()
}
// RemoveSigner watches the AgentRegistry for the RemoveSigner event and upon detecting one votes
// to kick a signer via the clique protocol
func RemoveSigner() {
//sha3 (keccack-256) hash of the "RemoveSigner(address)" event
const addSignerHash = "0x1803740ef72fc16e647c10fe2d31cf61a1578081960c2e3fb7f5aa957e82f550"
rpcClient, _ := GetEthereumRPCConn()
var events []map[string]interface{}
var lastBlockNumber int64
lastBlockNumber = 1
hexBlockNumber := "0x" + fmt.Sprintf("%x", lastBlockNumber)
txObject := map[string]string{"fromBlock": hexBlockNumber, "toBlock": "latest", "topic": addSignerHash}
ticker := time.NewTicker(time.Second * 5)
go func() {
for range ticker.C {
err := rpcClient.Call(&events, "eth_getLogs", txObject)
if err != nil {
log.Printf("Failed to get the filter logs: %v", err)
continue
}
for _, event := range events {
removeSignerTopic := event["topics"].([]interface{})
hexBlockNumber := event["blockNumber"].(string)
blockNumber, _ := strconv.ParseInt(hexBlockNumber, 0, 64)
kickedSigner := "0x" + removeSignerTopic[1].(string)[26:]
log.Printf("Signer removed %s at block %d\n", kickedSigner, blockNumber)
err = rpcClient.Call(&events, "clique_propose", kickedSigner, false)
if err != nil {
log.Printf("Non fatal err when proposing new signer to the clique, likely due to using ganache-cli")
}
if blockNumber > lastBlockNumber {
lastBlockNumber = blockNumber
hexBlockNumber := "0x" + fmt.Sprintf("%x", lastBlockNumber+1)
txObject["fromBlock"] = hexBlockNumber
}
}
}
}()
}
================================================
FILE: DatabaseManager/ethereum/README.md
================================================
Run `go generate` to generate the smart contract libraries.
You will need to have `solc`, the solidity compiler installed
================================================
FILE: DatabaseManager/ethereum/ethereum.go
================================================
//go:generate abigen --sol ../../SmartContracts/contracts/AgentRegistry.sol --pkg ethereum --out AgentRegistry.go
package ethereum
import (
"log"
"github.com/ethereum/go-ethereum/rpc"
)
func Init() {
AddSigner()
}
func GetEthereumRPCConn() (*rpc.Client, error) {
//create a connection over json rpc to the ethereum client
rpcClient, err := rpc.Dial("http://localhost:8545")
if err != nil {
log.Fatalf("Failed to connect to the Ethereum client: %v", err)
}
return rpcClient, err
}
================================================
FILE: DatabaseManager/localRPC/listener.go
================================================
package localRPC
import (
"github.com/mitmedialab/medrec/DatabaseManager/middleware"
"github.com/gorilla/mux"
"github.com/gorilla/rpc/v2"
"github.com/gorilla/rpc/v2/json"
"github.com/urfave/negroni"
)
//Scrypt values as recommended here: https://godoc.org/golang.org/x/crypto/scrypt
const (
ScryptSaltBytes = 8
ScryptN = 32768
ScryptR = 8
ScryptP = 1
ScryptKeyLen = 32
AesKeyLen = 32
PrivateKeyLen = 64
)
// MedRecLocal interface for all the rpc methods
type MedRecLocal struct {
}
// ListenandServe starts the local websocket listener
func ListenandServe(router *mux.Router) {
s := rpc.NewServer()
s.RegisterCodec(json.NewCodec(), "application/json")
s.RegisterCodec(json.NewCodec(), "application/json;charset=UTF-8")
s.RegisterService(new(MedRecLocal), "MedRecLocal")
n := negroni.New()
n.UseFunc(middleware.Whitelist)
n.UseHandler(s)
router.Handle("/localRPC", n)
}
================================================
FILE: DatabaseManager/localRPC/localUsers.go
================================================
package localRPC
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"io"
"io/ioutil"
"log"
"net/http"
"strings"
"github.com/mitmedialab/medrec/DatabaseManager/common"
"github.com/syndtr/goleveldb/leveldb/util"
"golang.org/x/crypto/scrypt"
)
type SetWalletPasswordArgs struct {
WalletPassword string //wallet password
}
type SetWalletPasswordReply struct {
}
func (client *MedRecLocal) SetWalletPassword(r *http.Request, args *SetWalletPasswordArgs, reply *SetWalletPasswordReply) error {
common.WalletPassword = args.WalletPassword
return nil
}
type GetUsernamesReply struct {
Usernames []string
Passwords []string
}
// GetUsernames queries the sql databse for the list of local users
func (client *MedRecLocal) GetUsernames(r *http.Request, args *common.NoArgs, reply *GetUsernamesReply) error {
tab := common.InstantiateLookupTable()
defer tab.Close()
rows := tab.NewIterator(util.BytesPrefix([]byte("username-")), nil)
rows.Release()
reply.Usernames = []string{}
for rows.Next() {
reply.Usernames = append(reply.Usernames, string(rows.Value()))
}
return nil
}
type UserDetailsArgs struct {
Username string
}
type GetUserDetailsReply struct {
FirstName string
LastName string
}
// GetUserDetails queries the sql databse for the list of local users
func (client *MedRecLocal) GetUserDetails(r *http.Request, args *UserDetailsArgs, reply *GetUserDetailsReply) error {
tab := common.InstantiateLookupTable()
defer tab.Close()
firstName, _ := tab.Get([]byte(args.Username+"-firstName"), nil)
lastName, _ := tab.Get([]byte(args.Username+"-lastName"), nil)
reply.FirstName = string(firstName)
reply.LastName = string(lastName)
return nil
}
type NewUserArgs struct {
FirstName string
LastName string
Username string
Password string
Seed string
}
type NewUserReply struct {
Error string
}
// NewUser adds a new user to the database
func (client *MedRecLocal) NewUser(r *http.Request, args *NewUserArgs, reply *NewUserReply) error {
tab := common.InstantiateLookupTable()
defer tab.Close()
salt := make([]byte, ScryptSaltBytes)
_, err := io.ReadFull(rand.Reader, salt)
if err != nil {
log.Fatal(err)
}
//use the salt to encrypt the password
hashedPassword, err := scrypt.Key([]byte(args.Password), salt, ScryptN, ScryptR, ScryptP, ScryptKeyLen)
if err != nil {
log.Fatal(err)
}
//encode it for storage
derivedPassword := base64.StdEncoding.EncodeToString(hashedPassword)
//use the encrypted password to reversibly encrypt the privatekey
//fist get the first aes encryption block
block, err := aes.NewCipher([]byte(derivedPassword[0:AesKeyLen]))
if err != nil {
log.Fatal(err)
}
//generate a placeholder byte array for the future ciphertext
ciphertext := make([]byte, aes.BlockSize+len(args.Seed))
//we need a pseudorandom iv to ensure the first block of aes is secure
//https://stackoverflow.com/questions/9049789/aes-encryption-key-versus-iv
iv := ciphertext[:aes.BlockSize]
if _, err = io.ReadFull(rand.Reader, iv); err != nil {
panic(err)
}
//encrypt each block of the aes key in CFB mode
stream := cipher.NewCFBEncrypter(block, iv)
stream.XORKeyStream(ciphertext[aes.BlockSize:], []byte(args.Seed))
//encode the ciphertext for storage
derivedSeed := base64.StdEncoding.EncodeToString(ciphertext)
//we can't directly store the encrypted password since we used it to encrypt the private key
//so encrypt it again before storage
hashedPassword, err = scrypt.Key(hashedPassword, salt, ScryptN, ScryptR, ScryptP, ScryptKeyLen)
if err != nil {
log.Fatal(err)
}
derivedPassword = base64.StdEncoding.EncodeToString(hashedPassword)
derivedPassword += ":" + base64.StdEncoding.EncodeToString(salt)
tab.Put([]byte("username-"+args.Username), []byte(args.Username), nil)
tab.Put([]byte(args.Username+"-firstName"), []byte(args.FirstName), nil)
tab.Put([]byte(args.Username+"-lastName"), []byte(args.LastName), nil)
tab.Put([]byte(args.Username+"-password"), []byte(derivedPassword), nil)
tab.Put([]byte(args.Username+"-privateKey"), []byte(derivedSeed), nil)
if err != nil {
reply.Error = err.Error()
}
return nil
}
type GetSeedArgs struct {
Username string
Password string
}
type GetSeedReply struct {
Seed string
Error string
}
// GetSeed ecrypts and retrives a user's private key seed
func (client *MedRecLocal) GetSeed(r *http.Request, args *GetSeedArgs, reply *GetSeedReply) error {
tab := common.InstantiateLookupTable()
defer tab.Close()
storedPassword, _ := tab.Get([]byte(args.Username+"-password"), nil)
derivedSeed, _ := tab.Get([]byte(args.Username+"-privateKey"), nil)
if string(storedPassword) != "" {
saltedPass := strings.Split(string(storedPassword), ":")
salt, _ := base64.StdEncoding.DecodeString(saltedPass[1])
hashedPassword, err := scrypt.Key([]byte(args.Password), salt, ScryptN, ScryptR, ScryptP, ScryptKeyLen)
if err != nil {
log.Fatal(err)
}
hashedPassword2, err := scrypt.Key(hashedPassword, salt, ScryptN, ScryptR, ScryptP, ScryptKeyLen)
if err != nil {
log.Fatal(err)
}
derivedPassword := base64.StdEncoding.EncodeToString(hashedPassword2)
if saltedPass[0] != derivedPassword {
reply.Error = "Invalid password"
return nil
}
// generate the first block of aes
derivedPassword = base64.StdEncoding.EncodeToString(hashedPassword)
block, err := aes.NewCipher([]byte(derivedPassword[0:AesKeyLen]))
if err != nil {
log.Fatal(err)
}
//decode the encrypted key from storage
hashedSeed, _ := base64.StdEncoding.DecodeString(string(derivedSeed))
//split up the ciphertext and iv
iv := hashedSeed[:aes.BlockSize]
ciphertext := hashedSeed[aes.BlockSize:]
//run the decryption and set the privatekey in the reply
stream := cipher.NewCFBDecrypter(block, iv)
stream.XORKeyStream(ciphertext, ciphertext)
reply.Seed = string(ciphertext)
} else {
reply.Error = "the selected username could not be found"
}
return nil
}
type DeleteUserArgs struct {
Username string
Password string
}
type DeleteUserReply struct {
Error string
}
// DeleteUser retrieves a user's decrypts and retrives a user's private key
func (client *MedRecLocal) DeleteUser(r *http.Request, args *DeleteUserArgs, reply *DeleteUserReply) error {
tab := common.InstantiateLookupTable()
defer tab.Close()
storedPassword, _ := tab.Get([]byte(args.Username+"-password"), nil)
saltedPass := strings.Split(string(storedPassword), ":")
salt, _ := base64.StdEncoding.DecodeString(saltedPass[1])
hashedPassword, err := scrypt.Key([]byte(args.Password), salt, ScryptN, ScryptR, ScryptP, ScryptKeyLen)
if err != nil {
log.Fatal(err)
}
hashedPassword2, err := scrypt.Key(hashedPassword, salt, ScryptN, ScryptR, ScryptP, ScryptKeyLen)
if err != nil {
log.Fatal(err)
}
derivedPassword := base64.StdEncoding.EncodeToString(hashedPassword2)
if saltedPass[0] != derivedPassword {
reply.Error = "Password mismatch"
return nil
}
tab.Delete([]byte("username-"+args.Username), nil)
tab.Delete([]byte(args.Username+"-firstName"), nil)
tab.Delete([]byte(args.Username+"-lastName"), nil)
tab.Delete([]byte(args.Username+"-password"), nil)
tab.Delete([]byte(args.Username+"-privateKey"), nil)
return nil
}
type SaveKeystoreArgs struct {
Keystore string
Username string
}
type SaveKeystoreReply struct {
}
//TODO this should take a password and check the password matches
func (client *MedRecLocal) SaveKeystore(r *http.Request, args *SaveKeystoreArgs, reply *SaveKeystoreReply) error {
tab := common.InstantiateLookupTable()
defer tab.Close()
path := common.GetKeystorePath(args.Username)
err := ioutil.WriteFile(path, []byte(args.Keystore), 0644)
return err
}
type GetKeystoreArgs struct {
Username string
}
type GetKeystoreReply struct {
Keystore string
}
func (client *MedRecLocal) GetKeystore(r *http.Request, args *GetKeystoreArgs, reply *GetKeystoreReply) error {
tab := common.InstantiateLookupTable()
defer tab.Close()
path := common.GetKeystorePath(args.Username)
data, err := ioutil.ReadFile(path)
if err != nil {
return err
}
reply.Keystore = string(data)
return nil
}
// UNUSED FUNCTIONS
// type SetNumAddressesArgs struct {
// Username string
// Password string
// Num int
// }
//
// type SetNumAddressesReply struct {
// Error string
// }
// // SetNumAddresses updates how many unique addresses have been generated
// func (client *MedRecLocal) SetNumAddresses(r *http.Request, args *SetNumAddressesArgs, reply *SetNumAddressesReply) error {
// tab := common.InstantiateLookupTable()
// defer tab.Close()
//
// err := tab.Put([]byte(args.Username+"-number-addresses"), []byte(strconv.Itoa(args.Num)), nil)
//
// return err
// }
//
// type GetNumAddressesArgs struct {
// Username string
// Num int
// }
//
// type GetNumAddressesReply struct {
// Num int
// Error string
// }
//
// // GetNumAddresses updates how many unique addresses have been generated
// func (client *MedRecLocal) GetNumAddresses(r *http.Request, args *GetNumAddressesArgs, reply *GetNumAddressesReply) error {
// tab := common.InstantiateLookupTable()
// defer tab.Close()
//
// num, err := tab.Get([]byte(args.Username+"-number-addresses"), nil)
// if err != nil {
// reply.Error = err.Error()
// return nil
// }
//
// reply.Num, _ = strconv.Atoi(string(num))
//
// return nil
// }
================================================
FILE: DatabaseManager/localRPC/localUsers_test.go
================================================
package localRPC
import (
"testing"
)
func TestEncryption(t *testing.T) {
client := new(MedRecLocal)
newUserArgs := &NewUserArgs{
Username: "testuser1",
Password: "pass1",
Seed: "3a1076bf45ab87712ad64ccb3b10217737f7faacbf2872e88fdd9a537d8fe266",
}
newUserReply := &NewUserReply{}
client.NewUser(nil, newUserArgs, newUserReply)
getSeedArgs := &GetSeedArgs{
Username: "testuser1",
Password: "pass1",
}
getSeedReply := &GetSeedReply{}
client.GetSeed(nil, getSeedArgs, getSeedReply)
if newUserArgs.Seed != getSeedReply.Seed {
t.Error("the saved privatekey could not be recovered")
}
deleteUserArgs := &DeleteUserArgs{
Username: "testuser1",
Password: "pass1",
}
deleteUserReply := &DeleteUserReply{}
client.DeleteUser(nil, deleteUserArgs, deleteUserReply)
getSeedReply.Seed = ""
client.GetSeed(nil, getSeedArgs, getSeedReply)
if newUserArgs.Seed == getSeedReply.Seed {
t.Error("the user's private seed was not deleted")
}
}
================================================
FILE: DatabaseManager/localRPC/remoteUsers.go
================================================
package localRPC
import (
"log"
"net/http"
"os/exec"
"strings"
"github.com/mitmedialab/medrec/DatabaseManager/common"
)
type AddAccountArgs struct {
UniqueID string
Account string
Username string
Password string
}
type AddAccountReply struct {
}
//should add test to check that:
//unique ID is not a duplicate
//unique id matches an entry in the database
func (client *MedRecLocal) AddAccount(r *http.Request, args *AddAccountArgs, reply *AddAccountReply) error {
tab := common.InstantiateLookupTable()
defer tab.Close()
err := tab.Put([]byte(common.PrefixPatientUID(args.Account)), []byte(args.UniqueID), nil)
if err != nil {
return err
}
newAccount, err := exec.Command("node", "./GolangJSHelpers/generateNewAccount.js", common.GetKeystorePath(args.Username), args.Password).CombinedOutput()
if err != nil {
log.Fatalf("Failed to generate a new account for this patient: %v", err)
}
err = tab.Put([]byte(strings.ToLower("patient-provider-account"+args.Account)), []byte(newAccount), nil)
if err != nil {
return err
}
return nil
}
================================================
FILE: DatabaseManager/manager.go
================================================
package manager
import (
"fmt"
"net/http"
"github.com/gorilla/mux"
"github.com/mitmedialab/medrec/DatabaseManager/ethereum"
"github.com/mitmedialab/medrec/DatabaseManager/localRPC"
"github.com/mitmedialab/medrec/DatabaseManager/middleware"
"github.com/mitmedialab/medrec/DatabaseManager/remoteRPC"
"github.com/urfave/negroni"
)
func Init() {
n := negroni.New()
router := mux.NewRouter()
//two different RPC clients are used to prevent accidental leaks of private functions
remoteRPC.ListenandServe(router)
localRPC.ListenandServe(router)
ethereum.Init()
n.UseFunc(middleware.EnableCORS)
n.UseFunc(middleware.Logger)
n.UseHandler(router)
listenString := fmt.Sprintf("127.0.0.1:%d", 6337)
http.ListenAndServe(listenString, n)
}
================================================
FILE: DatabaseManager/middleware/enableCORS.go
================================================
package middleware
import (
"net/http"
)
// EnableCORS sets the cors header
func EnableCORS(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
if origin := r.Header.Get("Origin"); origin != "" {
w.Header().Set("Access-Control-Allow-Origin", origin)
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
w.Header().Set("Access-Control-Allow-Headers",
"Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization")
}
// Stop here if its Preflighted OPTIONS request
if r.Method == "OPTIONS" {
return
}
next(w, r)
}
================================================
FILE: DatabaseManager/middleware/logger.go
================================================
package middleware
import (
"log"
"net/http"
"time"
)
// Logger logs info about every request to the console
func Logger(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
log.Printf(
"%s\t%s\t%s",
r.Method,
r.RequestURI,
time.Now(),
)
next(w, r)
}
================================================
FILE: DatabaseManager/middleware/whitelist.go
================================================
package middleware
import (
"net/http"
"strings"
)
var whitelist = []string{
"localhost:",
"127.0.0.1:",
}
// Whitelist restricts access to the localRPC to local nodes
func Whitelist(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
youShallNotPass := true
for _, host := range whitelist {
if strings.Index(r.Host, host) != -1 {
youShallNotPass = false
break
}
}
if youShallNotPass {
return
}
next(w, r)
}
================================================
FILE: DatabaseManager/remoteRPC/auth.go
================================================
package remoteRPC
//TODO require that the authentication messsage is within a more stringent time domain
//such as between 0 and 5 minutes, additionally should requre that time signatures
//are monotonically increasing
import (
"encoding/json"
"errors"
"log"
"net/http"
"os/exec"
"strconv"
"strings"
"time"
"github.com/mitmedialab/medrec/DatabaseManager/common"
)
// AuthenticateProvider verifies that the provided message was signed by a provider
// message is current time in seconds formatted as a string
// signature is the signature of the current time
// returns the patient account
func AuthenticatePatient(msg string, signature string) (string, error) {
//fail authentication if the msg is too old
msgInt, _ := strconv.ParseInt(msg, 10, 64)
elapsedTime := time.Now().Sub(time.Unix(msgInt, 0))
if elapsedTime.Seconds() > 10 {
return "", errors.New("signature is too old")
}
tab := common.InstantiateLookupTable()
defer tab.Close()
messageSigner, _ := common.ECRecover(msg, signature)
ret, _ := tab.Has([]byte("patient-uid-"+messageSigner), nil)
if ret {
return messageSigner, nil
}
return "", errors.New("account " + messageSigner + " could not be found")
}
// AuthenticateProvider verifies that the provided message was signed by a provider
// message is current time in seconds formatted as a string
// signature is the signature of the current time
// returns provider account
func AuthenticateProvider(msg string, signature string) (string, error) {
msgInt, _ := strconv.ParseInt(msg, 10, 64)
elapsedTime := time.Now().Sub(time.Unix(msgInt, 0))
if elapsedTime.Minutes() > 10 {
return "", errors.New("signature is too old")
}
// get the current list of signers
var signers []string
result, err := exec.Command("node", "./GolangJSHelpers/getSigners.js").CombinedOutput()
if err != nil {
log.Fatalf("Failed to get current signers list: %v", err)
}
json.Unmarshal(result, &signers)
messageSigner, _ := common.ECRecover(msg, signature)
log.Print(signers)
for _, signer := range signers {
if signer == messageSigner {
return messageSigner, nil
}
}
return "", errors.New("account is not a provider")
}
type GetProviderAccountArgs struct {
Time string //unix time encoded into a hex string
Signature string //signature of the time
}
type GetProviderAccountReply struct {
Account string
}
func (client *MedRecRemote) GetProviderAccount(r *http.Request, args *GetProviderAccountArgs, reply *GetProviderAccountReply) error {
patientAccount, err := AuthenticatePatient(args.Time, args.Signature)
if err != nil {
return err
}
tab := common.InstantiateLookupTable()
defer tab.Close()
account, err := tab.Get([]byte(strings.ToLower("patient-provider-account"+patientAccount)), nil)
reply.Account = string(account)
return err
}
type ChangeAccountArgs struct {
Account string
Time string
Signature string
}
type ChangeAccountReply struct {
}
//ChangeAccount transfers the mapping from patient account to unique identifier to a different account
func (client *MedRecRemote) ChangeAccount(r *http.Request, args *ChangeAccountArgs, reply *ChangeAccountReply) error {
patientAccount, err := AuthenticatePatient(args.Time, args.Signature)
if err != nil {
return err
}
tab := common.InstantiateLookupTable()
defer tab.Close()
uniqueID, _ := tab.Get([]byte(strings.ToLower("patient-uid-"+patientAccount)), nil)
err = tab.Put([]byte(strings.ToLower("patient-uid-"+args.Account)), []byte(uniqueID), nil)
if err != nil {
return err
}
tab.Delete([]byte(strings.ToLower("patient-uid-"+patientAccount)), nil)
newAccount, _ := tab.Get([]byte(strings.ToLower("patient-provider-"+patientAccount)), nil)
err = tab.Put([]byte(strings.ToLower("patient-provider-account"+args.Account)), []byte(newAccount), nil)
if err != nil {
return err
}
tab.Delete([]byte(strings.ToLower("patient-provider-"+patientAccount)), nil)
return nil
}
================================================
FILE: DatabaseManager/remoteRPC/databse.go
================================================
package remoteRPC
import (
"database/sql"
"log"
_ "github.com/go-sql-driver/mysql"
)
func instantiateDatabase() *sql.DB {
db, err := sql.Open("mysql",
"root:medrecpassword@tcp(127.0.0.1:3306)/medrec-v1")
if err != nil {
log.Fatal(err)
}
return db
}
================================================
FILE: DatabaseManager/remoteRPC/documentRequest.go
================================================
package remoteRPC
import (
"fmt"
"log"
"net/http"
"github.com/mitmedialab/medrec/DatabaseManager/common"
)
type PatientDocumentsArgs struct {
PatientID int
Time string
Signature string
}
type PatientDocumentsReply struct {
//restructure as a JSON string
Documents common.Documents
Error string
}
//returns a pointer to an sql database.
func (client *MedRecRemote) PatientDocuments(r *http.Request, args *PatientDocumentsArgs, reply *PatientDocumentsReply) error {
patientAccount, err := AuthenticatePatient(args.Time, args.Signature)
if err != nil {
return err
}
tab := common.InstantiateLookupTable()
defer tab.Close()
db := instantiateDatabase()
defer db.Close()
uid, err := tab.Get([]byte(common.PrefixPatientUID(patientAccount)), nil)
if err != nil {
return err
}
fmt.Printf("fetching records for patient %s with uid %s \n", patientAccount, string(uid))
rows, err := db.Query(fmt.Sprintf("SELECT PatientID, DocumentID, DocDateTime, PracticeID, RecvdDateTime FROM document_info WHERE PatientID = %s", uid))
if err != nil {
log.Fatal(err)
}
defer rows.Close()
var (
PatientID string
DocumentID int
DocDateTime string
PracticeID string
RecvdDateTime string
)
for rows.Next() {
log.Println("have another row")
err = rows.Scan(&PatientID, &DocumentID, &DocDateTime, &PracticeID, &RecvdDateTime)
if err != nil {
log.Fatal(err)
}
result := *new(common.Document)
if err != nil {
log.Fatal(err)
reply.Error = err.Error()
}
result.PatientID = PatientID
result.DocumentID = DocumentID
result.DocDateTime = DocDateTime
result.PracticeID = PracticeID
result.RecvdDateTime = RecvdDateTime
reply.Documents = append(reply.Documents, result)
}
err = rows.Err()
return err
}
================================================
FILE: DatabaseManager/remoteRPC/ethereum.go
================================================
package remoteRPC
import (
"fmt"
"log"
"math/rand"
"net/http"
"os/exec"
"strconv"
"time"
"github.com/mitmedialab/medrec/DatabaseManager/common"
"github.com/ethereum/go-ethereum/rpc"
)
// GetMedRecRemoteRPCConn returns a connection to a random provider
func GetMedRecRemoteRPCConn() (*rpc.Client, string, error) {
//create a connection over json rpc to the ethereum client
gethClient, _ := common.GetEthereumRPCConn()
// get the current list of signers
var signers []string
err := gethClient.Call(&signers, "clique_getSigners", "latest")
if err != nil {
log.Fatalf("Failed to get signers: %v", err)
}
rand.Seed(time.Now().Unix())
nextProvider := signers[rand.Intn(len(signers))]
//get the host info of the provider who should fufil the faucet request
//using a js helper script
host, err := exec.Command("node", "./GolangJSHelpers/getProviderHost.js", nextProvider).CombinedOutput()
if err != nil {
log.Fatalf("Failed to get the next provider's hostname: %v", err)
}
//create a connection over json rpc to the ethereum client
rpcClient, err := rpc.Dial("http://" + string(host) + ":6337/remoteRPC")
if err != nil {
log.Fatalf("Failed to connect to the Ethereum client: %v", err)
}
return rpcClient, nextProvider, err
}
type PatientFaucetArgs struct {
Account string // the provider account to provide the refund
Time string // the current time
Signature string // signature of the current time
}
type PatientFaucetReply struct {
Error string
Txid string
}
//PatientFaucet takes an ethereum account and gives it some ether
//Message and Signature should be from the patient
//Account should refer to the Provider's account that money should be sent from
func (client *MedRecRemote) PatientFaucet(r *http.Request, args *PatientFaucetArgs, reply *PatientFaucetReply) error {
patientAddress, err := AuthenticatePatient(args.Time, args.Signature)
if err != nil {
return err
}
// sign the current time
curTime := fmt.Sprintf("%d", time.Now().Unix())
signature, err := common.Sign(curTime, args.Account)
if err != nil {
log.Fatalf("Failed to Sign: %v", err)
}
rpcClient, providerAddress, _ := GetMedRecRemoteRPCConn()
nextArgs := &ProviderFaucetArgs{patientAddress, providerAddress, curTime, signature}
err = rpcClient.Call(&reply, "MedRecRemote.ProviderFaucet", nextArgs)
return err
}
type ProviderFaucetArgs struct {
RecipientAccount string // the patient account to recieve the funds
SendingAccount string // the provider account providing the funds
Time string // the current time
Signature string // signature of the current time
}
type ProviderFaucetReply struct {
Error string
Txid string
}
//ProviderFaucet takes an ethereum account and gives it some ether
// The Message and Signature should be from the requesting provider
// The Account should be of the patient to whom funds should be sent
func (client *MedRecRemote) ProviderFaucet(r *http.Request, args *ProviderFaucetArgs, reply *ProviderFaucetReply) error {
log.Printf("provider faucet: %v", args)
_, err := AuthenticateProvider(args.Time, args.Signature)
if err != nil {
log.Printf("there was auth error: %v", err)
return err
}
//create a connection over json rpc to the ethereum client
rpcClient, _ := common.GetEthereumRPCConn()
//get the list of accounts open on the client
var accounts []string
err = rpcClient.Call(&accounts, "eth_accounts")
if err != nil {
log.Fatalf("Failed to get the ethereum accounts: %v", err)
}
// execute a ftransaction funding the user account with some ether
var txid string
value := "0x" + strconv.FormatInt(1000000000000000000, 16)
txObject := map[string]string{"from": args.SendingAccount, "to": args.RecipientAccount, "value": value}
err = rpcClient.Call(&txid, "eth_sendTransaction", txObject)
if err != nil {
log.Fatalf("Failed to send transaction: %v", err)
}
//reply with the transaction id
reply.Txid = txid
return err
}
================================================
FILE: DatabaseManager/remoteRPC/ethereum_test.go
================================================
package remoteRPC
import (
"fmt"
"log"
"os"
"testing"
"time"
"../common"
"../localRPC"
)
func TestRecover(t *testing.T) {
type RecoverArgs struct {
Time string
Signature string
}
signerAccount := "0xc5b2fe6f6bc85d71f4ae9a335896c9308ec8977c"
recoverArgs := &RecoverArgs{
Time: "1526422718",
Signature: "0xe27f440e8520bd9ea447505a3ff42f5220e29f285ac542806aff78ab66f8a95f03d3c5edb809c0b39e4233a3dc2ce71bf6ba61e0783e8abafce8d7fdd815bb711c",
}
type ecRecoverResult struct {
data []byte
}
result, _ := common.ECRecover(recoverArgs.Time, recoverArgs.Signature)
if result != signerAccount {
t.Errorf("ECRecover failed")
}
}
// TestFaucet requires an ethereum client to be running locally
// with rpc enabled on port 8545,
// ganache-cli is recommended
func TestFaucet(t *testing.T) {
os.Chdir("../../")
localClient := new(localRPC.MedRecLocal)
remoteClient := new(MedRecRemote)
//create a connection over json rpc to the ethereum client
rpcClient, _ := common.GetEthereumRPCConn()
//get a local ethereum address which can be used for testing
var accounts []string
err := rpcClient.Call(&accounts, "eth_accounts")
if err != nil {
log.Fatalf("Failed to get an ethereum account: %v", err)
}
//make sure the patient exists in the database
addArgs := &localRPC.AddAccountArgs{
UniqueID: accounts[0],
}
addReply := &localRPC.AddAccountReply{}
localClient.AddAccount(nil, addArgs, addReply)
//create the arguments to the call to the faucet
faucetArgs := &PatientFaucetArgs{
Account: accounts[1],
Time: fmt.Sprintf("%d", time.Now().Unix()),
}
faucetArgs.Signature, _ = common.Sign(faucetArgs.Time, accounts[0])
faucetReply := &PatientFaucetReply{}
//request the faucent send some ether
err = remoteClient.PatientFaucet(nil, faucetArgs, faucetReply)
if faucetReply.Error != "" && faucetReply.Txid != "" {
t.Errorf("The Faucet threw an error: %s", faucetReply.Error)
}
if err != nil {
t.Errorf("Faucet failed with error: %v", err)
}
}
================================================
FILE: DatabaseManager/remoteRPC/listener.go
================================================
package remoteRPC
import (
// "./ethereum
"github.com/gorilla/mux"
"github.com/gorilla/rpc/v2"
"github.com/gorilla/rpc/v2/json"
)
// MedRecRemote interface for all the rpc methods
type MedRecRemote struct {
}
// ListenandServe remote connections
func ListenandServe(router *mux.Router) {
s := rpc.NewServer()
s.RegisterCodec(json.NewCodec(), "application/json")
s.RegisterCodec(json.NewCodec(), "application/json;charset=UTF-8")
s.RegisterService(new(MedRecRemote), "MedRecRemote")
router.Handle("/remoteRPC", s)
}
================================================
FILE: DatabaseManager/remoteRPC/permissions.go
================================================
package remoteRPC
import (
"encoding/json"
"log"
"net/http"
"strconv"
"time"
"github.com/mitmedialab/medrec/DatabaseManager/common"
)
type AddPermissionArgs struct {
AgentID string
ViewerGroup string
Name string
StartTime int64
DurationDays int64
}
type AddPermissionReply struct {
Error string
}
func (client *MedRecRemote) AddPermission(r *http.Request, args *AddPermissionArgs, reply *AddPermissionReply) error {
log.Println("adding new permission" + args.ViewerGroup + " " + args.Name)
tab := common.InstantiateLookupTable()
defer tab.Close()
rawPerms, err := tab.Get([]byte("perm-list-"+args.AgentID+"-"+args.ViewerGroup), nil)
var perms []string
json.Unmarshal(rawPerms, &perms)
perms = append(perms, args.Name)
rawPerms, err = json.Marshal(perms)
err = tab.Put([]byte("perm-list-"+args.AgentID+"-"+args.ViewerGroup), rawPerms, nil)
if err != nil {
log.Println(err)
}
err = tab.Put([]byte("perm-startTime-"+args.AgentID+"-"+args.ViewerGroup+"-"+args.Name), []byte(strconv.FormatInt(args.StartTime, 10)), nil)
err = tab.Put([]byte("perm-durationDays-"+args.AgentID+"-"+args.ViewerGroup+"-"+args.Name), []byte(strconv.FormatInt(args.DurationDays, 10)), nil)
return err
}
type RemovePermissionArgs struct {
AgentID string
ViewerGroup string
Index uint
}
type RemovePermissionReply struct {
Error string
}
func (client *MedRecRemote) RemovePermission(r *http.Request, args *RemovePermissionArgs, reply *RemovePermissionReply) error {
tab := common.InstantiateLookupTable()
defer tab.Close()
rawPerms, err := tab.Get([]byte("perm-list-"+args.AgentID+"-"+args.ViewerGroup), nil)
var perms []string
json.Unmarshal(rawPerms, &perms)
name := perms[args.Index]
perms = append(perms[:args.Index], perms[args.Index+1:]...)
rawPerms, err = json.Marshal(perms)
err = tab.Delete([]byte("perm-startTime-"+args.AgentID+"-"+args.ViewerGroup+"-"+name), nil)
err = tab.Delete([]byte("perm-durationDays-"+args.AgentID+"-"+args.ViewerGroup+"-"+name), nil)
return err
}
func (client *MedRecRemote) SetPermissionDuration(r *http.Request, args *AddPermissionArgs, reply *AddPermissionReply) error {
tab := common.InstantiateLookupTable()
defer tab.Close()
err := tab.Put([]byte("perm-durationDays-"+args.AgentID+"-"+args.ViewerGroup+"-"+args.Name), []byte(strconv.FormatInt(args.DurationDays, 10)), nil)
return err
}
func (client *MedRecRemote) SetPermissionStartTime(r *http.Request, args *AddPermissionArgs, reply *AddPermissionReply) error {
tab := common.InstantiateLookupTable()
defer tab.Close()
err := tab.Put([]byte("perm-startTime-"+args.AgentID+"-"+args.ViewerGroup+"-"+args.Name), []byte(strconv.FormatInt(args.StartTime, 10)), nil)
return err
}
type GetPermissionsArgs struct {
AgentID string
ViewerGroup string
}
type Permission struct {
Name string
StartTime int64
DurationDays int64
}
type GetPermissionsReply struct {
Permissions []Permission
Error string
}
func (client *MedRecRemote) GetPermissions(r *http.Request, args *GetPermissionsArgs, reply *GetPermissionsReply) error {
tab := common.InstantiateLookupTable()
defer tab.Close()
rawPerms, _ := tab.Get([]byte("perm-list-"+args.AgentID+"-"+args.ViewerGroup), nil)
var perms []string
json.Unmarshal(rawPerms, &perms)
for _, name := range perms {
_startTime, _ := tab.Get([]byte("perm-startTime-"+args.AgentID+"-"+args.ViewerGroup+"-"+name), nil)
_durationDays, _ := tab.Get([]byte("perm-durationDays-"+args.AgentID+"-"+args.ViewerGroup+"-"+name), nil)
startTime, _ := strconv.ParseInt(string(_startTime), 10, 64)
durationDays, _ := strconv.ParseInt(string(_durationDays), 10, 64)
perm := Permission{name, startTime, durationDays}
reply.Permissions = append(reply.Permissions, perm)
}
return nil
}
type CheckPermissionArgs struct {
AgentID string
ViewerGroup string
Index int
}
type CheckPermissionReply struct {
Approved bool
Error string
}
//utility function for checking the access permissions of a particular viewer
func (client *MedRecRemote) CheckPermission(r *http.Request, args *CheckPermissionArgs, reply *CheckPermissionReply) error {
tab := common.InstantiateLookupTable()
defer tab.Close()
rawPerms, err := tab.Get([]byte("perm-list-"+args.AgentID+"-"+args.ViewerGroup), nil)
var perms []string
json.Unmarshal(rawPerms, &perms)
name := perms[args.Index]
if len(perms) <= args.Index {
reply.Approved = false
return nil
}
_startTime, err := tab.Get([]byte("perm-startTime-"+args.AgentID+"-"+args.ViewerGroup+"-"+name), nil)
_durationDays, err := tab.Get([]byte("perm-durationDays-"+args.AgentID+"-"+args.ViewerGroup+"-"+name), nil)
startTime, _ := strconv.ParseInt(string(_startTime), 10, 64)
durationDays, _ := strconv.ParseInt(string(_durationDays), 10, 32)
if durationDays == 0 {
reply.Approved = false
return nil
}
if durationDays < 0 {
reply.Approved = true
return nil
}
//need to worry about overflow somewhat, too many durationDays and the provider will
// won't get treated properly, but the failure mode for too many days is restricted access
// which if you think about it is the appropriate action
expirationTime := time.Unix(startTime, 0).AddDate(0, 0, int(durationDays))
if expirationTime.After(time.Now()) {
reply.Approved = true
return nil
}
reply.Approved = false
return err
}
================================================
FILE: DatabaseManager/scripts/createDocuments.go
================================================
package main
import (
"database/sql"
"log"
_ "github.com/go-sql-driver/mysql"
)
//returns a pointer to an sql database.
func main() {
//doesn't open db, but prepares abstraction
db, err := sql.Open("mysql",
"root:medrecpassword@tcp(127.0.0.1:3306)/medrec-v1")
if err != nil {
log.Fatal(err)
}
_, err = db.Exec(`INSERT INTO document_info (DocumentID, PatientID, PracticeID, RecvdDateTime)
VALUES (445534, 4, 1234567, '2017-01-01 00:00:00')`)
if err != nil {
log.Fatal(err)
}
err = db.Ping()
if err != nil {
log.Printf("connection error")
}
defer db.Close()
}
================================================
FILE: DatabaseManager/scripts/insert-patient.sql
================================================
USE medrec-v1
INSERT INTO patient_info (PatientID, LastName, FirstName, Gender, DOB)
VALUES (004, 'Smith', 'Jane', 'F', '1986-03-15');
================================================
FILE: DatabaseManager/scripts/test-db.sql
================================================
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: localhost (MySQL 5.7.20)
# Database: medrecV1
# Generation Time: 2017-10-27 02:27:26 +0000
# ************************************************************
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Dump of table document_info
# ------------------------------------------------------------
USE medrec-v1;
DROP TABLE IF EXISTS `document_info`;
CREATE TABLE `document_info` (
`DocumentID` int(11) NOT NULL,
`PatientID` int(11) NOT NULL,
`PracticeID` int(11) NOT NULL,
`RecvdDateTime` datetime NOT NULL,
`DocDateTime` datetime NOT NULL,
PRIMARY KEY (`DocumentID`),
UNIQUE KEY `DocumentID` (`DocumentID`),
KEY `PatientID` (`PatientID`),
CONSTRAINT `document_info_ibfk_1` FOREIGN KEY (`PatientID`) REFERENCES `patient_info` (`PatientID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Dump of table encounter_info
# ------------------------------------------------------------
DROP TABLE IF EXISTS `encounter_info`;
CREATE TABLE `encounter_info` (
`DocumentID` int(11) NOT NULL,
`VisitCode` varchar(30) NOT NULL,
`VisitCodeDisplayName` varchar(30) NOT NULL,
`NormalisedCodeSystemName` varchar(30) NOT NULL,
`NormalisedDate` datetime NOT NULL,
`ProviderID` int(11) NOT NULL,
KEY `DocumentID` (`DocumentID`),
CONSTRAINT `encounter_info_ibfk_1` FOREIGN KEY (`DocumentID`) REFERENCES `document_info` (`DocumentID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Dump of table immunization_info
# ------------------------------------------------------------
DROP TABLE IF EXISTS `immunization_info`;
CREATE TABLE `immunization_info` (
`DocumentID` int(11) NOT NULL,
`ProviderID` int(11) NOT NULL,
`ImmunizationCode` varchar(30) NOT NULL,
`NormalizedCodeSystemName` varchar(30) NOT NULL,
`ImmunizationName` varchar(30) NOT NULL,
`NormalisedImmunizationDate` datetime NOT NULL,
`AdministrationStatus` varchar(30) NOT NULL,
`Dosage` float NOT NULL,
`DosageUnit` varchar(30) NOT NULL,
`RouteCode` varchar(30) NOT NULL,
`RouteName` varchar(30) NOT NULL,
KEY `DocumentID` (`DocumentID`),
CONSTRAINT `immunization_info_ibfk_1` FOREIGN KEY (`DocumentID`) REFERENCES `document_info` (`DocumentID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Dump of table medication_info
# ------------------------------------------------------------
DROP TABLE IF EXISTS `medication_info`;
CREATE TABLE `medication_info` (
`DocumentID` int(11) NOT NULL,
`MedicationCode` varchar(30) NOT NULL,
`NormalizedCodeSystemName` varchar(30) NOT NULL,
`MedicationName` varchar(30) NOT NULL,
`MedicationStatus` varchar(30) NOT NULL,
`NormalisedStartDate` datetime NOT NULL,
`NormalisedEndDate` datetime NOT NULL,
`DosageInterval` float NOT NULL,
`DosagePeriod` varchar(30) NOT NULL,
`DosageUnit` varchar(30) NOT NULL,
`DosageQuantity` float NOT NULL,
KEY `DocumentID` (`DocumentID`),
CONSTRAINT `medication_info_ibfk_1` FOREIGN KEY (`DocumentID`) REFERENCES `document_info` (`DocumentID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Dump of table patient_info
# ------------------------------------------------------------
DROP TABLE IF EXISTS `patient_info`;
CREATE TABLE `patient_info` (
`PatientID` int(11) NOT NULL,
`LastName` varchar(30) DEFAULT NULL,
`FirstName` varchar(30) DEFAULT NULL,
`MiddleName` varchar(30) DEFAULT NULL,
`Gender` varchar(30) DEFAULT NULL,
`DOB` date DEFAULT NULL,
`Address1` varchar(30) DEFAULT NULL,
`Address2` varchar(30) DEFAULT NULL,
`City` varchar(30) DEFAULT NULL,
`State` varchar(30) DEFAULT NULL,
`Zip` int(11) DEFAULT NULL,
`Telecom1` int(11) DEFAULT NULL,
`Race` varchar(30) DEFAULT NULL,
`Ethnicity` varchar(30) DEFAULT NULL,
`EducationLevel` varchar(30) DEFAULT NULL,
`Lang` varchar(30) DEFAULT NULL,
PRIMARY KEY (`PatientID`),
UNIQUE KEY `PatientID` (`PatientID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Dump of table result_info
# ------------------------------------------------------------
DROP TABLE IF EXISTS `result_info`;
CREATE TABLE `result_info` (
`ResultsInfoID` int(11) NOT NULL,
`DocID` int(11) NOT NULL,
`ResultCode` int(11) NOT NULL,
`NormalisedCodeSystemName` varchar(30) NOT NULL,
`LabName` varchar(30) NOT NULL,
`LabStatus` varchar(30) NOT NULL,
`NormalisedObservationDate` datetime NOT NULL,
PRIMARY KEY (`ResultsInfoID`),
UNIQUE KEY `ResultsInfoID` (`ResultsInfoID`),
KEY `DocID` (`DocID`),
CONSTRAINT `result_info_ibfk_1` FOREIGN KEY (`DocID`) REFERENCES `document_info` (`DocumentID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# Dump of table resultdetail_info
# ------------------------------------------------------------
DROP TABLE IF EXISTS `resultdetail_info`;
CREATE TABLE `resultdetail_info` (
`ResultsDetailID` int(11) NOT NULL,
`ResultsInfoID` int(11) NOT NULL,
`ComponentName` varchar(30) NOT NULL,
`LabCode` varchar(30) NOT NULL,
`LabStatus` varchar(30) NOT NULL,
`NormalisedObservationDate` datetime NOT NULL,
`ResultValue` varchar(30) NOT NULL,
`ResultRange` varchar(30) NOT NULL,
`Unit` varchar(30) NOT NULL,
PRIMARY KEY (`ResultsDetailID`),
UNIQUE KEY `ResultsDetailID` (`ResultsDetailID`),
KEY `ResultsInfoID` (`ResultsInfoID`),
CONSTRAINT `resultdetail_info_ibfk_1` FOREIGN KEY (`ResultsInfoID`) REFERENCES `result_info` (`ResultsInfoID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
================================================
FILE: GolangJSHelpers/.eslintrc
================================================
/*******************************************************************************
* A Meteor Developer's ECMA 6th Edition ESLint Configuration
* by @iDoMeteor
*
* http://github.com/idometeor/meteor-style-skeleton/.eslint
*
* TL;DR
*
* This is more friendly than Meteor's config.. mostly. Not always though. :)
* Check Github/README.md for quick usage instructions.
*
* Description
*
* Meteor upholds a high standard for coding, so do I, and so should you.
* With that goal in mind, I set every option in this file with intent. It
* may provide you with a fair amount of frustration if you are new to linting
* tools.
*
* This is intended to be integrated into your editor (along with .editorconfig)
* in such a way as to allow you to use it continually. If you drop it on a
* large, existing code base that may be... lax in coding standards, expect to
* get an enormous amount of reports.
*
* However, if you already have smart ECMA coding style, then you will most
* likely appreciate the learning experience / tightening up of your style.
*
* Meter and ECMA are both intended to be flexible. This file allows for that
* flexibility where appropriate, but also has sane protections for actual
* poor programming methodology. Hopefully it will allow enough flexibility
* to still take advantage of the fun parts of the language.
*
* In general, this configuration in tandem with my .jscsrc should provide
* one of the best programmatic ways to ensure that your Meteor code is as
* near to being inline with the MDG Style Guide as is practical from an
* automated tool.
*
* Caveats:
*
* I allow (and prefer, unless Sciencing) ==. The Abstract Equality
* Comparison Algorithm is no more "obscure (src: ESLint)" than is the
* Strict Equality Comparison Algorithm. Actually, it comes first not only
* in this paragraph, but also in the ECMA specification (11.9.3 vs 11.9.6).
*
* The standard convention comes from the same old-school origin as using !!.
* Namely, poor programming practices and ECMA implementations from the past.
* There are distinct advantages to using == in non-precision (read
* non-mission-critical) contexts. I'll leave that dark magic up to you to
* discover.
*
* Point is, you should probably be statically typing if you are that are that
* concerned about precision, or not concerned about this level of semantics if
* your ability to keep your types straight is ... still developing.
*
* That being said, I throw warnings on (x == null) || (x != null). :p
*
* This is not for niave Javascripters, you should be able to
* grok what this is going to do for you or use eslint --init at the command
* line and go from there.
*
* I use object literals instead of switch, as one should. However, once in
* a while, a switch w/fallthrough and/or no default is actually highly useful.
* For instance, Twiefbot uses micro-switches in the natural language
* processing. Therefore, they are allowed, but will throw warnings. That
* means that, while you should not do it, if you really know what you're doing
* then go for it.
*
* Contributing:
* I welcome pull requests!
*
* ****************************************************************************/
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"experimentalObjectRestSpread": true,
"forOf": true,
"generators": true,
"jsx": true,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": false,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"regexYFlag": true,
"regexUFlag": true,
"spread": true,
"superInFunctions": true,
"templateStrings": true,
},
},
"env": {
"browser": true,
"es6": true,
"jasmine": true,
"jquery": true,
"meteor": true,
"mocha": true,
"mongo": true,
"node": true,
"phantomjs": true,
},
"rules": {
/**
* General
*/
// This will throw warnings anywhere 'use strict' occurs, which is good.
"strict": [2, "never"],
// This wants you to migrate to using let & const instead of var for locals
"no-var": 0, // Best to start migrating now tho :)
/**
* Allowances
*/
"block-scoped-var": 0,
"dot-notation": [1, {"allowKeywords": true}], // Dynamic keys ftw, especially ES6 style
"eqeqeq": 0, // This contradicts MDG Style Guide, which prolly is [2, "allow-null"]
"no-console": 0,
"no-param-reassign": 0, // I do it, but don't use arguments meta-var much
"no-reserved-keys": 0, // 3rd edition is dead, no worries here
"no-undef": 0, // Super annoying in Meteor code, lol
"radix": 0, // If you screw up your numbers, your own fault
"yoda": 0, // I yoda, everyone should
"vars-on-top": 0, // Seriously, hoist your vars. But sometimes I like to validate
// first. Just don't bury (or not delcare!) your declarations.
/**
* Errors
*/
"curly": [2, "multi-line"],
"no-cond-assign": [2, "always"], // This is why you should yoda :p
"no-constant-condition": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-else-return": 2,
"no-empty": 2, // Empties can break Meteor in Templates.*
"no-eq-null": 2,
"no-eval": 2,
"no-ex-assign": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-semi": 2,
"no-func-assign": 2,
"no-implied-eval": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-native-reassign": 2,
"no-new": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-proto": 2,
"no-redeclare": 2,
"no-return-assign": 2,
"no-script-url": 2, // No need for these in Meteor!
"no-self-compare": 2,
"no-sequences": 2, // I hate that!
"no-shadow": [1, {"hoist": "functions"}],
"no-sparse-arrays": 2,
"no-throw-literal": 2, // Hopefully this lets Meteor.Error pass
"no-unreachable": 2,
"no-with": 2,
"use-isnan": 2,
"wrap-iife": [2, "any"],
/**
* Warnings
*/
"comma-dangle": [1, "always-multiline"],
"consistent-return": 1,
"default-case": 1, // *If* you happen to use a switch, maybe you don't want a default
"guard-for-in": 1,
"max-len": [1, 100, 4], // Warn if over 100, tabs expand to 4 (should use spaces anyway)
"no-alert": 1,
"no-caller": 1, // Should be 2, but there is some code out there... ;>
"no-debugger": 1,
"no-extra-boolean-cast": 1, // I should give it a 2 but being nice!! (Sasha uses them)
// ^punny, eh! :D
"no-fallthrough": 1, // *If* you happen to.. it shouldn't be often.
"no-floating-decimal": 1, // Should be 2, but I bet lots of you...
"no-multi-spaces": 0, // I like pretty
"no-multi-str": 1, // Should be 2, I'm being nice :>
"no-shadow-restricted-names": 2,
"no-unused-vars": [1,
{
"vars": "local",
"args": "none"
}
],
"no-use-before-define": 2,
/**
* Style
*/
"brace-style": [2,
"1tbs", {
"allowSingleLine": true
}
],
"camelcase": [2, {
"properties": "always"
}],
"comma-spacing": [2, {
"before": false,
"after": true
}
],
"comma-style": [2, "last"],
"eol-last": 0,
"func-names": 0, // Something I'm trying to eliminate, anonymous functions
"func-style": 0, // Flexibility ftw
"indent": [2, 2, {"SwitchCase": 1}],
"key-spacing": [2, {
"afterColon": true,
"beforeColon": false,
}
], // 'prop': x, extra spacing allowed if lining up blocks
"linebreak-style": [
2,
"unix"
],
"new-cap": 2,
"no-multiple-empty-lines": 0,
"no-nested-ternary": 0, // I <3 them, as long as they are clean & clear
"no-new-object": 2, // There are good reasons not to
"no-array-constructor": 2, // There are good reasons not to
"no-spaced-func": 2, // Nice addition!
"no-trailing-spaces": 2,
"no-underscore-dangle": 0,
"one-var": [2, "never"],
"padded-blocks": [0, "always"],
"quotes": [
2, "single", "avoid-escape"
],
"semi": [2, "always"],
"semi-spacing": [2,
{
"before": false,
"after": true
}
],
"keyword-spacing": [2,
{
"before": false, "after": true, "overrides": {
"if": {"after": false},
"for": {"after": false},
"while": {"after": false},
"from": {"before": true}
}
}
],
"space-before-blocks": 2,
"space-before-function-paren": [2, "always"],
"space-infix-ops": 2,
"spaced-comment": [2, "never"],
}
}
================================================
FILE: GolangJSHelpers/addAgentToRegistry.js
================================================
const agentRegistryJson = require('../SmartContracts/build/contracts/AgentRegistry.json');
const Web3 = require('web3');
const contract = require('truffle-contract');
let Agent = contract(agentRegistryJson);
Agent.setProvider(new Web3.providers.HttpProvider('http://127.0.0.1:8545'));
let contractAddr = process.argv[2] || '0x0';
AgentRegistry.deployed()
.then(agentRegistry => agentRegistry.setAgentContractAddr(contractAddr))
.then(() => { });
================================================
FILE: GolangJSHelpers/clientBinaries.json
================================================
{
"clients": {
"Geth": {
"version": "1.8.2",
"platforms": {
"linux": {
"x64": {
"download": {
"url": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.8.2-b8b9f7f4.tar.gz",
"type": "tar",
"md5": "46a76e77fc9ae4dc9f8d1cf50f3b5798",
"bin": "geth-linux-amd64-1.8.2-b8b9f7f4/geth"
},
"bin": "geth",
"commands": {
"sanity": {
"args": [
"version"
],
"output": [
"Geth",
"1.8.2"
]
}
}
}
},
"mac": {
"x64": {
"download": {
"url": "https://gethstore.blob.core.windows.net/builds/geth-darwin-amd64-1.8.2-b8b9f7f4.tar.gz",
"type": "tar",
"md5": "33e03f5df5798c3efb8aabd7c11fdd34",
"bin": "geth-darwin-amd64-1.8.2-b8b9f7f4/geth"
},
"bin": "geth",
"commands": {
"sanity": {
"args": [
"version"
],
"output": [
"Geth",
"1.8.2"
]
}
}
}
},
"win": {
"x64": {
"download": {
"url": "https://gethstore.blob.core.windows.net/builds/geth-windows-amd64-1.8.2-b8b9f7f4.zip",
"type": "zip",
"md5": "18039e1e92d5ce272411552adb7ccbb1",
"bin": "geth-windows-amd64-1.8.2-b8b9f7f4\\geth.exe"
},
"bin": "geth.exe",
"commands": {
"sanity": {
"args": [
"version"
],
"output": [
"Geth",
"1.8.2"
]
}
}
}
}
}
}
}
}
================================================
FILE: GolangJSHelpers/generateNewAccount.js
================================================
const Web3 = require('web3');
const Promise = require('bluebird');
const {keystore, signing} = require('eth-lightwallet');
const fs = require('fs');
let path = process.argv[2] || 'path';
let password = process.argv[3] || '';
//TODO there is a potential race condition if this script is called in rapid succession
//TODO this could be fixed by making the GolangHelpers into a single node server
//TODO or using a concurrent access enabled database handle requests
let serializedKeystore = fs.readFileSync(path, {flag: 'r'});
let vault = keystore.deserialize(serializedKeystore);
vault.keyFromPassword(password, (_, pwDerivedKey) => {
//generate new address/private key pair
vault.generateNewAddress(pwDerivedKey, 1);
let addresses = vault.getAddresses();
fs.writeFileSync(path, vault.serialize(), {mode: 0o666});
process.stdout.write(addresses[addresses.length - 1]);
});
================================================
FILE: GolangJSHelpers/getProviderHost.js
================================================
const agentRegistryJson = require('../SmartContracts/build/contracts/AgentRegistry.json');
const Web3 = require('web3');
const contract = require('truffle-contract');
let AgentRegistry = contract(agentRegistryJson);
AgentRegistry.setProvider(new Web3.providers.HttpProvider('http://127.0.0.1:8545'));
let providerAcc = process.argv[2] || '0x0';
AgentRegistry.deployed()
.then(agentRegistry => agentRegistry.getAgentHost(providerAcc))
.then(host => {
process.stdout.write(host);
});
================================================
FILE: GolangJSHelpers/getSigners.js
================================================
const agentRegistryJson = require('../SmartContracts/build/contracts/AgentRegistry.json');
const Web3 = require('web3');
const contract = require('truffle-contract');
const Promise = require('bluebird');
let AgentRegistry = contract(agentRegistryJson);
AgentRegistry.setProvider(new Web3.providers.HttpProvider('http://127.0.0.1:8545'));
let agentRegistry;
Promise.resolve(AgentRegistry.deployed())
.then(_reg => {
agentRegistry = _reg;
return agentRegistry.getNumSigners();
}).then(numSigners => {
let signerPromises = [];
for(let i = 0; i < numSigners.toNumber(); i++) {
signerPromises.push(agentRegistry.getSigner(i));
}
return signerPromises;
}).spread((...signerAccounts) => {
process.stdout.write(JSON.stringify(signerAccounts));
});
================================================
FILE: GolangJSHelpers/medrec-genesis.json
================================================
{
"config": {
"chainId": 633732,
"homesteadBlock": 1,
"eip150Block": 2,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 4,
"clique": {
"period": 15,
"epoch": 30000
}
},
"nonce": "0x0",
"timestamp": "0x5a4c6ea8",
"extraData": "0x00000000000000000000000000000000000000000000000000000000000000004098fa4025e506b54d2ffce2c345e7da38355aaf8e708e6a27e22bc6b823dc774700bfa34322dab3e2003918b50cc0d84903c41e25943757d47f1aae0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0xe8d4a51000",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"0000000000000000000000000000000000000000": {
"balance": "0x1"
},
"0000000000000000000000000000000000000001": {
"balance": "0x1"
},
"0000000000000000000000000000000000000002": {
"balance": "0x1"
},
"0000000000000000000000000000000000000003": {
"balance": "0x1"
},
"0000000000000000000000000000000000000004": {
"balance": "0x1"
},
"0000000000000000000000000000000000000005": {
"balance": "0x1"
},
"0000000000000000000000000000000000000006": {
"balance": "0x1"
},
"0000000000000000000000000000000000000007": {
"balance": "0x1"
},
"0000000000000000000000000000000000000008": {
"balance": "0x1"
},
"0000000000000000000000000000000000000009": {
"balance": "0x1"
},
"000000000000000000000000000000000000000a": {
"balance": "0x1"
},
"000000000000000000000000000000000000000b": {
"balance": "0x1"
},
"000000000000000000000000000000000000000c": {
"balance": "0x1"
},
"000000000000000000000000000000000000000d": {
"balance": "0x1"
},
"000000000000000000000000000000000000000e": {
"balance": "0x1"
},
"000000000000000000000000000000000000000f": {
"balance": "0x1"
},
"0000000000000000000000000000000000000010": {
"balance": "0x1"
},
"0000000000000000000000000000000000000011": {
"balance": "0x1"
},
"0000000000000000000000000000000000000012": {
"balance": "0x1"
},
"0000000000000000000000000000000000000013": {
"balance": "0x1"
},
"0000000000000000000000000000000000000014": {
"balance": "0x1"
},
"0000000000000000000000000000000000000015": {
"balance": "0x1"
},
"0000000000000000000000000000000000000016": {
"balance": "0x1"
},
"0000000000000000000000000000000000000017": {
"balance": "0x1"
},
"0000000000000000000000000000000000000018": {
"balance": "0x1"
},
"0000000000000000000000000000000000000019": {
"balance": "0x1"
},
"000000000000000000000000000000000000001a": {
"balance": "0x1"
},
"000000000000000000000000000000000000001b": {
"balance": "0x1"
},
"000000000000000000000000000000000000001c": {
"balance": "0x1"
},
"000000000000000000000000000000000000001d": {
"balance": "0x1"
},
"000000000000000000000000000000000000001e": {
"balance": "0x1"
},
"000000000000000000000000000000000000001f": {
"balance": "0x1"
},
"0000000000000000000000000000000000000020": {
"balance": "0x1"
},
"0000000000000000000000000000000000000021": {
"balance": "0x1"
},
"0000000000000000000000000000000000000022": {
"balance": "0x1"
},
"0000000000000000000000000000000000000023": {
"balance": "0x1"
},
"0000000000000000000000000000000000000024": {
"balance": "0x1"
},
"0000000000000000000000000000000000000025": {
"balance": "0x1"
},
"0000000000000000000000000000000000000026": {
"balance": "0x1"
},
"0000000000000000000000000000000000000027": {
"balance": "0x1"
},
"0000000000000000000000000000000000000028": {
"balance": "0x1"
},
"0000000000000000000000000000000000000029": {
"balance": "0x1"
},
"000000000000000000000000000000000000002a": {
"balance": "0x1"
},
"000000000000000000000000000000000000002b": {
"balance": "0x1"
},
"000000000000000000000000000000000000002c": {
"balance": "0x1"
},
"000000000000000000000000000000000000002d": {
"balance": "0x1"
},
"000000000000000000000000000000000000002e": {
"balance": "0x1"
},
"000000000000000000000000000000000000002f": {
"balance": "0x1"
},
"0000000000000000000000000000000000000030": {
"balance": "0x1"
},
"0000000000000000000000000000000000000031": {
"balance": "0x1"
},
"0000000000000000000000000000000000000032": {
"balance": "0x1"
},
"0000000000000000000000000000000000000033": {
"balance": "0x1"
},
"0000000000000000000000000000000000000034": {
"balance": "0x1"
},
"0000000000000000000000000000000000000035": {
"balance": "0x1"
},
"0000000000000000000000000000000000000036": {
"balance": "0x1"
},
"0000000000000000000000000000000000000037": {
"balance": "0x1"
},
"0000000000000000000000000000000000000038": {
"balance": "0x1"
},
"0000000000000000000000000000000000000039": {
"balance": "0x1"
},
"000000000000000000000000000000000000003a": {
"balance": "0x1"
},
"000000000000000000000000000000000000003b": {
"balance": "0x1"
},
"000000000000000000000000000000000000003c": {
"balance": "0x1"
},
"000000000000000000000000000000000000003d": {
"balance": "0x1"
},
"000000000000000000000000000000000000003e": {
"balance": "0x1"
},
"000000000000000000000000000000000000003f": {
"balance": "0x1"
},
"0000000000000000000000000000000000000040": {
"balance": "0x1"
},
"0000000000000000000000000000000000000041": {
"balance": "0x1"
},
"0000000000000000000000000000000000000042": {
"balance": "0x1"
},
"0000000000000000000000000000000000000043": {
"balance": "0x1"
},
"0000000000000000000000000000000000000044": {
"balance": "0x1"
},
"0000000000000000000000000000000000000045": {
"balance": "0x1"
},
"0000000000000000000000000000000000000046": {
"balance": "0x1"
},
"0000000000000000000000000000000000000047": {
"balance": "0x1"
},
"0000000000000000000000000000000000000048": {
"balance": "0x1"
},
"0000000000000000000000000000000000000049": {
"balance": "0x1"
},
"000000000000000000000000000000000000004a": {
"balance": "0x1"
},
"000000000000000000000000000000000000004b": {
"balance": "0x1"
},
"000000000000000000000000000000000000004c": {
"balance": "0x1"
},
"000000000000000000000000000000000000004d": {
"balance": "0x1"
},
"000000000000000000000000000000000000004e": {
"balance": "0x1"
},
"000000000000000000000000000000000000004f": {
"balance": "0x1"
},
"0000000000000000000000000000000000000050": {
"balance": "0x1"
},
"0000000000000000000000000000000000000051": {
"balance": "0x1"
},
"0000000000000000000000000000000000000052": {
"balance": "0x1"
},
"0000000000000000000000000000000000000053": {
"balance": "0x1"
},
"0000000000000000000000000000000000000054": {
"balance": "0x1"
},
"0000000000000000000000000000000000000055": {
"balance": "0x1"
},
"0000000000000000000000000000000000000056": {
"balance": "0x1"
},
"0000000000000000000000000000000000000057": {
"balance": "0x1"
},
"0000000000000000000000000000000000000058": {
"balance": "0x1"
},
"0000000000000000000000000000000000000059": {
"balance": "0x1"
},
"000000000000000000000000000000000000005a": {
"balance": "0x1"
},
"000000000000000000000000000000000000005b": {
"balance": "0x1"
},
"000000000000000000000000000000000000005c": {
"balance": "0x1"
},
"000000000000000000000000000000000000005d": {
"balance": "0x1"
},
"000000000000000000000000000000000000005e": {
"balance": "0x1"
},
"000000000000000000000000000000000000005f": {
"balance": "0x1"
},
"0000000000000000000000000000000000000060": {
"balance": "0x1"
},
"0000000000000000000000000000000000000061": {
"balance": "0x1"
},
"0000000000000000000000000000000000000062": {
"balance": "0x1"
},
"0000000000000000000000000000000000000063": {
"balance": "0x1"
},
"0000000000000000000000000000000000000064": {
"balance": "0x1"
},
"0000000000000000000000000000000000000065": {
"balance": "0x1"
},
"0000000000000000000000000000000000000066": {
"balance": "0x1"
},
"0000000000000000000000000000000000000067": {
"balance": "0x1"
},
"0000000000000000000000000000000000000068": {
"balance": "0x1"
},
"0000000000000000000000000000000000000069": {
"balance": "0x1"
},
"000000000000000000000000000000000000006a": {
"balance": "0x1"
},
"000000000000000000000000000000000000006b": {
"balance": "0x1"
},
"000000000000000000000000000000000000006c": {
"balance": "0x1"
},
"000000000000000000000000000000000000006d": {
"balance": "0x1"
},
"000000000000000000000000000000000000006e": {
"balance": "0x1"
},
"000000000000000000000000000000000000006f": {
"balance": "0x1"
},
"0000000000000000000000000000000000000070": {
"balance": "0x1"
},
"0000000000000000000000000000000000000071": {
"balance": "0x1"
},
"0000000000000000000000000000000000000072": {
"balance": "0x1"
},
"0000000000000000000000000000000000000073": {
"balance": "0x1"
},
"0000000000000000000000000000000000000074": {
"balance": "0x1"
},
"0000000000000000000000000000000000000075": {
"balance": "0x1"
},
"0000000000000000000000000000000000000076": {
"balance": "0x1"
},
"0000000000000000000000000000000000000077": {
"balance": "0x1"
},
"0000000000000000000000000000000000000078": {
"balance": "0x1"
},
"0000000000000000000000000000000000000079": {
"balance": "0x1"
},
"000000000000000000000000000000000000007a": {
"balance": "0x1"
},
"000000000000000000000000000000000000007b": {
"balance": "0x1"
},
"000000000000000000000000000000000000007c": {
"balance": "0x1"
},
"000000000000000000000000000000000000007d": {
"balance": "0x1"
},
"000000000000000000000000000000000000007e": {
"balance": "0x1"
},
"000000000000000000000000000000000000007f": {
"balance": "0x1"
},
"0000000000000000000000000000000000000080": {
"balance": "0x1"
},
"0000000000000000000000000000000000000081": {
"balance": "0x1"
},
"0000000000000000000000000000000000000082": {
"balance": "0x1"
},
"0000000000000000000000000000000000000083": {
"balance": "0x1"
},
"0000000000000000000000000000000000000084": {
"balance": "0x1"
},
"0000000000000000000000000000000000000085": {
"balance": "0x1"
},
"0000000000000000000000000000000000000086": {
"balance": "0x1"
},
"0000000000000000000000000000000000000087": {
"balance": "0x1"
},
"0000000000000000000000000000000000000088": {
"balance": "0x1"
},
"0000000000000000000000000000000000000089": {
"balance": "0x1"
},
"000000000000000000000000000000000000008a": {
"balance": "0x1"
},
"000000000000000000000000000000000000008b": {
"balance": "0x1"
},
"000000000000000000000000000000000000008c": {
"balance": "0x1"
},
"000000000000000000000000000000000000008d": {
"balance": "0x1"
},
"000000000000000000000000000000000000008e": {
"balance": "0x1"
},
"000000000000000000000000000000000000008f": {
"balance": "0x1"
},
"0000000000000000000000000000000000000090": {
"balance": "0x1"
},
"0000000000000000000000000000000000000091": {
"balance": "0x1"
},
"0000000000000000000000000000000000000092": {
"balance": "0x1"
},
"0000000000000000000000000000000000000093": {
"balance": "0x1"
},
"0000000000000000000000000000000000000094": {
"balance": "0x1"
},
"0000000000000000000000000000000000000095": {
"balance": "0x1"
},
"0000000000000000000000000000000000000096": {
"balance": "0x1"
},
"0000000000000000000000000000000000000097": {
"balance": "0x1"
},
"0000000000000000000000000000000000000098": {
"balance": "0x1"
},
"0000000000000000000000000000000000000099": {
"balance": "0x1"
},
"000000000000000000000000000000000000009a": {
"balance": "0x1"
},
"000000000000000000000000000000000000009b": {
"balance": "0x1"
},
"000000000000000000000000000000000000009c": {
"balance": "0x1"
},
"000000000000000000000000000000000000009d": {
"balance": "0x1"
},
"000000000000000000000000000000000000009e": {
"balance": "0x1"
},
"000000000000000000000000000000000000009f": {
"balance": "0x1"
},
"00000000000000000000000000000000000000a0": {
"balance": "0x1"
},
"00000000000000000000000000000000000000a1": {
"balance": "0x1"
},
"00000000000000000000000000000000000000a2": {
"balance": "0x1"
},
"00000000000000000000000000000000000000a3": {
"balance": "0x1"
},
"00000000000000000000000000000000000000a4": {
"balance": "0x1"
},
"00000000000000000000000000000000000000a5": {
"balance": "0x1"
},
"00000000000000000000000000000000000000a6": {
"balance": "0x1"
},
"00000000000000000000000000000000000000a7": {
"balance": "0x1"
},
"00000000000000000000000000000000000000a8": {
"balance": "0x1"
},
"00000000000000000000000000000000000000a9": {
"balance": "0x1"
},
"00000000000000000000000000000000000000aa": {
"balance": "0x1"
},
"00000000000000000000000000000000000000ab": {
"balance": "0x1"
},
"00000000000000000000000000000000000000ac": {
"balance": "0x1"
},
"00000000000000000000000000000000000000ad": {
"balance": "0x1"
},
"00000000000000000000000000000000000000ae": {
"balance": "0x1"
},
"00000000000000000000000000000000000000af": {
"balance": "0x1"
},
"00000000000000000000000000000000000000b0": {
"balance": "0x1"
},
"00000000000000000000000000000000000000b1": {
"balance": "0x1"
},
"00000000000000000000000000000000000000b2": {
"balance": "0x1"
},
"00000000000000000000000000000000000000b3": {
"balance": "0x1"
},
"00000000000000000000000000000000000000b4": {
"balance": "0x1"
},
"00000000000000000000000000000000000000b5": {
"balance": "0x1"
},
"00000000000000000000000000000000000000b6": {
"balance": "0x1"
},
"00000000000000000000000000000000000000b7": {
"balance": "0x1"
},
"00000000000000000000000000000000000000b8": {
"balance": "0x1"
},
"00000000000000000000000000000000000000b9": {
"balance": "0x1"
},
"00000000000000000000000000000000000000ba": {
"balance": "0x1"
},
"00000000000000000000000000000000000000bb": {
"balance": "0x1"
},
"00000000000000000000000000000000000000bc": {
"balance": "0x1"
},
"00000000000000000000000000000000000000bd": {
"balance": "0x1"
},
"00000000000000000000000000000000000000be": {
"balance": "0x1"
},
"00000000000000000000000000000000000000bf": {
"balance": "0x1"
},
"00000000000000000000000000000000000000c0": {
"balance": "0x1"
},
"00000000000000000000000000000000000000c1": {
"balance": "0x1"
},
"00000000000000000000000000000000000000c2": {
"balance": "0x1"
},
"00000000000000000000000000000000000000c3": {
"balance": "0x1"
},
"00000000000000000000000000000000000000c4": {
"balance": "0x1"
},
"00000000000000000000000000000000000000c5": {
"balance": "0x1"
},
"00000000000000000000000000000000000000c6": {
"balance": "0x1"
},
"00000000000000000000000000000000000000c7": {
"balance": "0x1"
},
"00000000000000000000000000000000000000c8": {
"balance": "0x1"
},
"00000000000000000000000000000000000000c9": {
"balance": "0x1"
},
"00000000000000000000000000000000000000ca": {
"balance": "0x1"
},
"00000000000000000000000000000000000000cb": {
"balance": "0x1"
},
"00000000000000000000000000000000000000cc": {
"balance": "0x1"
},
"00000000000000000000000000000000000000cd": {
"balance": "0x1"
},
"00000000000000000000000000000000000000ce": {
"balance": "0x1"
},
"00000000000000000000000000000000000000cf": {
"balance": "0x1"
},
"00000000000000000000000000000000000000d0": {
"balance": "0x1"
},
"00000000000000000000000000000000000000d1": {
"balance": "0x1"
},
"00000000000000000000000000000000000000d2": {
"balance": "0x1"
},
"00000000000000000000000000000000000000d3": {
"balance": "0x1"
},
"00000000000000000000000000000000000000d4": {
"balance": "0x1"
},
"00000000000000000000000000000000000000d5": {
"balance": "0x1"
},
"00000000000000000000000000000000000000d6": {
"balance": "0x1"
},
"00000000000000000000000000000000000000d7": {
"balance": "0x1"
},
"00000000000000000000000000000000000000d8": {
"balance": "0x1"
},
"00000000000000000000000000000000000000d9": {
"balance": "0x1"
},
"00000000000000000000000000000000000000da": {
"balance": "0x1"
},
"00000000000000000000000000000000000000db": {
"balance": "0x1"
},
"00000000000000000000000000000000000000dc": {
"balance": "0x1"
},
"00000000000000000000000000000000000000dd": {
"balance": "0x1"
},
"00000000000000000000000000000000000000de": {
"balance": "0x1"
},
"00000000000000000000000000000000000000df": {
"balance": "0x1"
},
"00000000000000000000000000000000000000e0": {
"balance": "0x1"
},
"00000000000000000000000000000000000000e1": {
"balance": "0x1"
},
"00000000000000000000000000000000000000e2": {
"balance": "0x1"
},
"00000000000000000000000000000000000000e3": {
"balance": "0x1"
},
"00000000000000000000000000000000000000e4": {
"balance": "0x1"
},
"00000000000000000000000000000000000000e5": {
"balance": "0x1"
},
"00000000000000000000000000000000000000e6": {
"balance": "0x1"
},
"00000000000000000000000000000000000000e7": {
"balance": "0x1"
},
"00000000000000000000000000000000000000e8": {
"balance": "0x1"
},
"00000000000000000000000000000000000000e9": {
"balance": "0x1"
},
"00000000000000000000000000000000000000ea": {
"balance": "0x1"
},
"00000000000000000000000000000000000000eb": {
"balance": "0x1"
},
"00000000000000000000000000000000000000ec": {
"balance": "0x1"
},
"00000000000000000000000000000000000000ed": {
"balance": "0x1"
},
"00000000000000000000000000000000000000ee": {
"balance": "0x1"
},
"00000000000000000000000000000000000000ef": {
"balance": "0x1"
},
"00000000000000000000000000000000000000f0": {
"balance": "0x1"
},
"00000000000000000000000000000000000000f1": {
"balance": "0x1"
},
"00000000000000000000000000000000000000f2": {
"balance": "0x1"
},
"00000000000000000000000000000000000000f3": {
"balance": "0x1"
},
"00000000000000000000000000000000000000f4": {
"balance": "0x1"
},
"00000000000000000000000000000000000000f5": {
"balance": "0x1"
},
"00000000000000000000000000000000000000f6": {
"balance": "0x1"
},
"00000000000000000000000000000000000000f7": {
"balance": "0x1"
},
"00000000000000000000000000000000000000f8": {
"balance": "0x1"
},
"00000000000000000000000000000000000000f9": {
"balance": "0x1"
},
"00000000000000000000000000000000000000fa": {
"balance": "0x1"
},
"00000000000000000000000000000000000000fb": {
"balance": "0x1"
},
"00000000000000000000000000000000000000fc": {
"balance": "0x1"
},
"00000000000000000000000000000000000000fd": {
"balance": "0x1"
},
"00000000000000000000000000000000000000fe": {
"balance": "0x1"
},
"00000000000000000000000000000000000000ff": {
"balance": "0x1"
},
"4098fa4025e506b54d2ffce2c345e7da38355aaf": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"8e708e6a27e22bc6b823dc774700bfa34322dab3": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
}
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
================================================
FILE: GolangJSHelpers/package.json
================================================
{
"name": "ethereumclient",
"version": "1.0.0",
"description": "",
"main": "main.js",
"dependencies": {
"bluebird": "^3.5.1",
"eth-lightwallet": "^3.0.1",
"ethereum-client-binaries": "^1.6.2",
"openport": "^0.0.4",
"truffle-contract": "^3.0.5",
"web3": "^0.20.1"
}
}
================================================
FILE: GolangJSHelpers/startGeth.js
================================================
const Manager = require('ethereum-client-binaries').Manager;
const config = require('./clientBinaries.json');
const mgr = new Manager(config);
const { spawn, spawnSync } = require('child_process'); var op = require('openport');
let home;
if(process.env.APPDATA) {
home = process.env.APPDATA + '/MedRec';
}else {
home = process.env.HOME;
home += process.platform == 'darwin' ? '/Library/Preferences' : '/.medrec';
}
let runGeth = (binaryPath) => {
op.find(
{
startingPort: 6338,
endingPort: 10000,
},
function (err, port) {
if(err) {
console.error('Could not find open port for the Ethereum client');
process.exit(1);
}
let bootnode = 'enode://757b0f2c9e2bede3a2554985880fae15bdf6ce90b375ec9cb025a397499b75f7994ee05edbdaddaf469edb72198220f2a32c216925ca50a5626f497de889d652@34.239.63.141:6338';
let instance = spawn(binaryPath, [
'--datadir=' + home,
'--bootnodes=' + bootnode,
'--rpc',
'--rpcapi=eth,miner,personal,net,web3,clique',
'--rpccorsdomain=*', //TODO: fix this security vulnerability and specify exact domains
'--ws',
'--wsapi=eth,miner,personal,net,web3,clique',
'--wsorigins=*', //TODO: fix this security vulnerability and specify exact domains
'--port=' + port, '--networkid=633732',
'--targetgaslimit=10000000000000',
]);
instance.stderr.on('data', (data) => {
process.stdout.write(`Ethereum: ${data}`);
});
}
);
};
let initGeth = (binaryPath) => {
spawnSync(binaryPath, ['--datadir', home, 'init', 'GolangJSHelpers/medrec-genesis.json']);
runGeth(binaryPath);
};
mgr.init({
folders: [
home + '/Geth/',
],
})
.then(() => {
if(mgr.clients.Geth.state.available) {
initGeth(mgr.clients.Geth.activeCli.fullPath);
}else {
mgr.download('Geth', {
downloadFolder: home,
}).then(file => initGeth(file.unpackFolder + '/geth'));
}
})
.catch(err => {
console.log(err);
process.exit(1);
});
================================================
FILE: GolangJSHelpers/tsconfig.json
================================================
{
"compilerOptions": {
"module": "commonjs",
"target": "ESNext",
"jsx": "react",
"importHelpers": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
}
}
================================================
FILE: LICENSE
================================================
You may use, distribute and copy Kodi under the terms of GNU General
Public License version 2, which is displayed below.
-------------------------------------------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
-------------------------------------------------------------------------
================================================
FILE: README.md
================================================
# MedRec
##### _Patient controlled medical records_
---
THIS PROJECT IS CURRENTLY NOT MAINTAINED
---
https://medrec.media.mit.edu
### Components
- Database Manager - API written in GoLang that provides access to an underlying database. R/W access is governed by permissions stored on the blockchain.
- Ethereum Client - A pointer to the go-ethereum codebase
- SmartContracts - The Solidity contracts and their tests that are used by other MedRec components
- UserClient - A front-facing node app that can be used by any party to interact with the MedRec system.
This project is being developed under the GPLv2 LICENSE.
## For production
### 1. Install golang and build
Install golang from the repositories for your operating system (apt, yum, homebrew, etc.) or from the golang website. https://golang.org/dl/
Then build the go components of medred
```
$ go build
```
#### 2. Install NPM
Install NPM: https://nodejs.org/en/
#### 3. Install npm packages
Setup the UserClient
```
$ cd UserClient
$ npm install
$ npm run build
$ cd ..
```
To resolve an annoying won't fix bug in the bitcoin-mnemonic library you also need to run the following in the UserClient directory.
```
$ rm -r node_modules/bitcore-mnemonic/node_modules/bitcore-lib
```
Setup the Javascript helper files
```
$ cd GolangJSHelpers
$ npm install
$ cd ..
```
#### 4. Setup your MySQL Database
You need to be running a mysql database instance locally with username:password root:medrecpassword:
- run query `/scripts/medrec-v1.sql`. It will create a schema called `medrec-v1` for you to store/retrieve information from. It is representing the "remote" DB.
- run query `/scripts/medrecWebApp.sql` for the "local" DB.
If you do not want to be able to look at the example patient records you can skip this section.
#### 5. Start all of MedRec's components
```
$ ./medrec EthereumClient
$ ./medrec DatabaseManager
$ ./medrec UserClient
```
## For Development
#### 1. Setup a PoA blockchain
Refer to [this guide](https://hackernoon.com/setup-your-own-private-proof-of-authority-ethereum-network-with-geth-9a0a3750cda8) to setup a proof of authority blockchain with go-ethereum as its backend. Change the RPC port in the above tutorial to `8545` while starting `geth`.
##### 2. Connect to the blockchain
MedRec has to be modified to connect to the provider nodes of this blockchain. Edit medrec-genesis.json and startGeth.js in `GolangJSHelpers/` to match with your genesis and chain parameters of your PoA blockchain.
#### 3. Install Go and golang libraries
Install Go: https://github.com/golang/go or `brew install go` if you're on macOS
`cd` into your `GOPATH` and run
```
$ go get -v ./...
```
#### 4. Install NPM
Install NPM: https://nodejs.org/en/
#### 5. Install npm packages
```
$ cd UserClient
$ npm install
$ npm run build
```
To resolve an annoying won't fix bug in the bitcoin-mnemonic library you also need to run the following in the UserClient directory.
```
$ rm node_modules/bitcore-mnemonic/node_modules/bitcore-lib
```
#### 6. Run the Database manager
You need to be running a mysql database instance locally with username:password root:medrecpassword:
```
create user 'password'@'localhost' identified by 'medrecpassword';
```
- run query `/scripts/medrec-v1.sql`:
```
mysql -u password -p < medrec-v1.sql
```
It will create a schema called `medrec-v1` for you to store/retrieve information from. It is representing the "remote" DB.
- run query `/scripts/medrecWebApp.sql` for the "local" DB:
```
mysql -u password -p < medrecWebApp.sql
```
`$ go run main.go DatabaseManager`
It should start the DatabaseManager running on localhost:6337
#### 7. Deploy the contracts
You will need to install the program truffle using npm to deploy contracts:
```
npm install truffle -g
```
Make sure that the parameters in `SmartContracts/truffle.js` match your PoA chain.
Then deploy the contract using `truffle deploy`. The `ganache-cli` should respond to this command showing that the contracts have been deployed.
#### 8. Start the UserClient
```
$ cd UserClient
$ npm start
```
if it throws an error with `web3-requestManager`, do `npm install web3@1.0.0-beta.26`.
#### 9. Building a new production version
```
$ go build
$ cd UserClient
$ npm run build
```
# Getting Started With the MedRec Codebase
## 1. Link MedRec to an existing database
In order to use MedRec as a medical records provider, MedRec's Database Manager needs to be linked to the provider's database. This does not require a change in the database itself, but does involve changing MedRec to fit the form of database used. This might involve more or less work (from changing a few table names, up to completely rewriting queries) depending on the form and structure of database used. In order to link MedRec to your database, the data will need to be directly queryable by an external piece of software -- e.g., using SQL or other style queries.
### SQL-type databases
MedRec uses the Golang mysql driver (github.com/go-sql-driver/mysql) to interface with its test database. There is support for a wide range of common hospital database types, including
- FHIR: https://golanglibs.com/top?q=fhir
### Non-SQL-type databases
There's a pretty exhaustive list of Golang drivers for different forms of database. Depending on the database
### Setup Guide
All the files that need to be changed are located in the `DatabaseManager/remoteRPC` directory. This manages remote access to your database by people granted access to view a particular record.
1. Instantiate the database:
In `databse.go`,
- SQL (but not MySQL): replace the database driver for mysql (`import "github.com/go-sql-driver/mysql"`) with the driver for your database format
- NOSQL (/other) -- also get rid of `import "database/sql"`
Once the driver and database type has been set, replace the contents of `instantiateDatabase()` with your own server.
```
func instantiateDatabase() *sql.DB {
db, err := sql.Open("mysql",
":@tcp(127.0.0.1:)/")
if err != nil {
log.Fatal(err)
}
return db
}
```
2. Setting up the eth key-value store
The Database Manager uses a LevelDB key-value store to link the unique patient identifier used by MedRec (the patient's ethereum address) to some unique identifier in the record provider's database. This is managed in `lookup.go`.
A unique ID from the database needs to be sent to the prospective patient, so that they can enter it, along with the creation of an ethereum address, when they create an account. This then creates an entry in the LevelDB (`Lookup Table`) that maps the patient's AgentID (some unique patient ID) to their eth address. Depending on the type of UID that is used to identify the patient, you might want to change the type of args.AgentID to match that of the stored value.
```
type AccountArgs struct {
Account string
AgentID string
}
...
err := tab.Put([]byte(args.Account), []byte(args.AgentID), nil)
if err != nil {
log.Println(err)
}
```
NB -- you *don't* need to add the eth address of the agent -- that gets added automatically when an account is made. To test the functionality of this, navigate to the frontend and create a new patient account, with some UID stored in your database. The records returned for that patient should match those associated with that UID.
3. Requesting Documents
The management of this part of MedRec will vary with the kind of information the record provider should make available to each patient. The generic function `PatientDocuments` in `documentRequest.go` provides an outline for receiving a call from a patient's account, checking that their eth address is listed in the key-value store, and replying with the contents of that request (`reply.Documents`).
In order to adapt this to specific instances, the names of specific tables must be changed to align the provider database with the records requested. In `PatientDocuments` these are specified as:
```
var (
PatientID string
DocumentID int
DocDateTime string
PracticeID string
RecvdDateTime string
)
```
The names of the result (`params.Document`, defined in `params.go`) remain the same -- the entries in the provider database that correspond to them should be changed to match.
4. The rest of the Database Manager (overview)
Instructions 1, 2, and 3 unpack the 'provider-facing' layers of the Database Manager, which interact directly with the provider database. The rest of this repo (`DatabaseManager/RemoteRPC`) deals with the blockchain interface.
In particular `ethereum.go` handles authentication and connection to the ethereum client.
- Authentication: `Recover(r *http.Request, args *RecoverArgs, reply *RecoverReply)` recovers
## 2. Joining the blockchain as a provider
## 3. Write a custom contract
================================================
FILE: SmartContracts/.eslintrc
================================================
/*******************************************************************************
* A Meteor Developer's ECMA 6th Edition ESLint Configuration
* by @iDoMeteor
*
* http://github.com/idometeor/meteor-style-skeleton/.eslint
*
* TL;DR
*
* This is more friendly than Meteor's config.. mostly. Not always though. :)
* Check Github/README.md for quick usage instructions.
*
* Description
*
* Meteor upholds a high standard for coding, so do I, and so should you.
* With that goal in mind, I set every option in this file with intent. It
* may provide you with a fair amount of frustration if you are new to linting
* tools.
*
* This is intended to be integrated into your editor (along with .editorconfig)
* in such a way as to allow you to use it continually. If you drop it on a
* large, existing code base that may be... lax in coding standards, expect to
* get an enormous amount of reports.
*
* However, if you already have smart ECMA coding style, then you will most
* likely appreciate the learning experience / tightening up of your style.
*
* Meter and ECMA are both intended to be flexible. This file allows for that
* flexibility where appropriate, but also has sane protections for actual
* poor programming methodology. Hopefully it will allow enough flexibility
* to still take advantage of the fun parts of the language.
*
* In general, this configuration in tandem with my .jscsrc should provide
* one of the best programmatic ways to ensure that your Meteor code is as
* near to being inline with the MDG Style Guide as is practical from an
* automated tool.
*
* Caveats:
*
* I allow (and prefer, unless Sciencing) ==. The Abstract Equality
* Comparison Algorithm is no more "obscure (src: ESLint)" than is the
* Strict Equality Comparison Algorithm. Actually, it comes first not only
* in this paragraph, but also in the ECMA specification (11.9.3 vs 11.9.6).
*
* The standard convention comes from the same old-school origin as using !!.
* Namely, poor programming practices and ECMA implementations from the past.
* There are distinct advantages to using == in non-precision (read
* non-mission-critical) contexts. I'll leave that dark magic up to you to
* discover.
*
* Point is, you should probably be statically typing if you are that are that
* concerned about precision, or not concerned about this level of semantics if
* your ability to keep your types straight is ... still developing.
*
* That being said, I throw warnings on (x == null) || (x != null). :p
*
* This is not for niave Javascripters, you should be able to
* grok what this is going to do for you or use eslint --init at the command
* line and go from there.
*
* I use object literals instead of switch, as one should. However, once in
* a while, a switch w/fallthrough and/or no default is actually highly useful.
* For instance, Twiefbot uses micro-switches in the natural language
* processing. Therefore, they are allowed, but will throw warnings. That
* means that, while you should not do it, if you really know what you're doing
* then go for it.
*
* Contributing:
* I welcome pull requests!
*
* ****************************************************************************/
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"experimentalObjectRestSpread": true,
"forOf": true,
"generators": true,
"jsx": true,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": false,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"regexYFlag": true,
"regexUFlag": true,
"spread": true,
"superInFunctions": true,
"templateStrings": true,
},
},
"env": {
"browser": true,
"es6": true,
"jasmine": true,
"jquery": true,
"meteor": true,
"mocha": true,
"mongo": true,
"node": true,
"phantomjs": true,
},
"rules": {
/**
* General
*/
// This will throw warnings anywhere 'use strict' occurs, which is good.
"strict": [2, "never"],
// This wants you to migrate to using let & const instead of var for locals
"no-var": 0, // Best to start migrating now tho :)
/**
* Allowances
*/
"block-scoped-var": 0,
"dot-notation": [1, {"allowKeywords": true}], // Dynamic keys ftw, especially ES6 style
"eqeqeq": 0, // This contradicts MDG Style Guide, which prolly is [2, "allow-null"]
"no-console": 0,
"no-param-reassign": 0, // I do it, but don't use arguments meta-var much
"no-reserved-keys": 0, // 3rd edition is dead, no worries here
"no-undef": 0, // Super annoying in Meteor code, lol
"radix": 0, // If you screw up your numbers, your own fault
"yoda": 0, // I yoda, everyone should
"vars-on-top": 0, // Seriously, hoist your vars. But sometimes I like to validate
// first. Just don't bury (or not delcare!) your declarations.
/**
* Errors
*/
"curly": [2, "multi-line"],
"no-cond-assign": [2, "always"], // This is why you should yoda :p
"no-constant-condition": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-else-return": 2,
"no-empty": 2, // Empties can break Meteor in Templates.*
"no-eq-null": 2,
"no-eval": 2,
"no-ex-assign": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-semi": 2,
"no-func-assign": 2,
"no-implied-eval": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-native-reassign": 2,
"no-new": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-proto": 2,
"no-redeclare": 2,
"no-return-assign": 2,
"no-script-url": 2, // No need for these in Meteor!
"no-self-compare": 2,
"no-sequences": 2, // I hate that!
"no-shadow": [1, {"hoist": "functions"}],
"no-sparse-arrays": 2,
"no-throw-literal": 2, // Hopefully this lets Meteor.Error pass
"no-unreachable": 2,
"no-with": 2,
"use-isnan": 2,
"wrap-iife": [2, "any"],
/**
* Warnings
*/
"comma-dangle": [1, "always-multiline"],
"consistent-return": 1,
"default-case": 1, // *If* you happen to use a switch, maybe you don't want a default
"guard-for-in": 1,
"max-len": [1, 100, 4], // Warn if over 100, tabs expand to 4 (should use spaces anyway)
"no-alert": 1,
"no-caller": 1, // Should be 2, but there is some code out there... ;>
"no-debugger": 1,
"no-extra-boolean-cast": 1, // I should give it a 2 but being nice!! (Sasha uses them)
// ^punny, eh! :D
"no-fallthrough": 1, // *If* you happen to.. it shouldn't be often.
"no-floating-decimal": 1, // Should be 2, but I bet lots of you...
"no-multi-spaces": 0, // I like pretty
"no-multi-str": 1, // Should be 2, I'm being nice :>
"no-shadow-restricted-names": 2,
"no-unused-vars": [1, {
"vars": "local",
"args": "none"
}],
"no-use-before-define": 2,
/**
* Style
*/
"brace-style": [2,
"1tbs", {
"allowSingleLine": true
}],
"camelcase": [2, {
"properties": "always"
}],
"comma-spacing": [2, {
"before": false,
"after": true
}],
"comma-style": [2, "last"],
"eol-last": 0,
"func-names": 0, // Something I'm trying to eliminate, anonymous functions
"func-style": 0, // Flexibility ftw
"indent": [2, 2, {"SwitchCase": 1}],
"key-spacing": [2, {
"afterColon": true,
"beforeColon": false,
}], // 'prop': x, extra spacing allowed if lining up blocks
"linebreak-style": [
2,
"unix"
],
"new-cap": 2,
"no-multiple-empty-lines": 0,
"no-nested-ternary": 0, // I <3 them, as long as they are clean & clear
"no-new-object": 2, // There are good reasons not to
"no-array-constructor": 2, // There are good reasons not to
"no-spaced-func": 2, // Nice addition!
"no-trailing-spaces": 2,
"no-underscore-dangle": 0,
"one-var": [2, "never"],
"padded-blocks": [0, "always"],
"quotes": [
2, "single", "avoid-escape"
],
"semi": [2, "always"],
"semi-spacing": [2, {
"before": false,
"after": true
}],
"keyword-spacing": [2, {"before": false, "after": true, "overrides": {
"if": {"after": false},
"for": {"after": false},
"while": {"after": false},
"from": {"before": true}
}}],
"space-before-blocks": 2,
"space-before-function-paren": [2, "always"],
"space-infix-ops": 2,
"spaced-comment": [2, "never"],
}
}
================================================
FILE: SmartContracts/README.md
================================================
There are two contracts used in MedRec:
- _Agent_ - stores information about an agent in MedRec, this could be a provider, patient, research group, family member of a patient, etc. If the Agent is a patient then the contract stores a list of their _Relationship_ contracts. Otherwise the Agent has a list of the different permissions it references. For example: in the case of a provider this is a list of permissions needed for various categories it provides, and in the case of a pharmacy this is a list of permissions it requests from patrons.
The _Agent_ contract also allows for a list of custodians to make operations on behalf of the agent. Each of the agent and all custodians can have their access rights selectively enabled or disabled. This allows parents to be custodians of minors and for married couples to turn on and off the ability for their spouse to make decisions on their behalf.
- _Agent Group_ - stores information about a group of agents in MedRec. Agent Groups cannot initiate relationships with other agents, they can only be the second party entered into one. An Agent Group allows an agent to give access to a set of other agents in one step, without explicitly giving permission to each group member. En example use case would allow users to give the members of an Emergency Room Agent Group access to their blood type.
- _Relationship_ - represents the relationship between two Agents, referred to as the patron and the provider. This contract manages the access permissions for data stored by the provider about the patron. The patron and provider are allowed to read all data, but other viewers need to be added.
- _AgentRegistry_ - stores information about signers. This contract provides an easy way to get the list of all signers and their names. It also retrieves the agent contract associated with a particular address. After a signer has been voted in via this contract they will then be added to the actual blockchain validator set. Current signers should be watching this contract for a new signer to be approved and then propose the new signer address via the clique API.
Make sure when testing to add at least 11 separate ethereum accounts to your blockchain provider. Each account will be assigned a role for the tests, pharmacy, family member, agent, etc.
================================================
FILE: SmartContracts/build/contracts/Agent.json
================================================
{
"contractName": "Agent",
"abi": [
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "custodianEnabled",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "custodians",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "relationships",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "agentEnabled",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "agent",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "setAgent",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "enable",
"type": "bool"
}
],
"name": "enableAgent",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "addCustodian",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "removeCustodian",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
},
{
"name": "enable",
"type": "bool"
}
],
"name": "enableCustodian",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "r",
"type": "address"
}
],
"name": "addRelationship",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getNumRelationships",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getNumEnabledOwners",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getNumCustodians",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600060146101000a81548160ff02191690831515021790555061122e806100796000396000f3006060604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630f12a66a146100d5578063108fd0cc1461010e5780632299bda6146101495780632788aa71146101ac5780636ca9677a146101d157806379bda9371461021557806385d95b811461024e57806394aa27181461028757806399d29e71146102ea578063bcf685ed14610317578063c23a0d2814610350578063e968177e14610379578063f5ff5c76146103a2578063faea7b2c146103f7575b600080fd5b34156100e057600080fd5b61010c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610420565b005b341561011957600080fd5b61012f60048080359060200190919050506107d7565b604051808215151515815260200191505060405180910390f35b341561015457600080fd5b61016a600480803590602001909190505061080a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101b757600080fd5b6101cf60048080351515906020019091905050610849565b005b34156101dc57600080fd5b610213600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803515159060200190919050506109cc565b005b341561022057600080fd5b61024c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ab3565b005b341561025957600080fd5b610285600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c69565b005b341561029257600080fd5b6102a86004808035906020019091905050610e63565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102f557600080fd5b6102fd610ea2565b604051808215151515815260200191505060405180910390f35b341561032257600080fd5b61034e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610eb5565b005b341561035b57600080fd5b610363611048565b6040518082815260200191505060405180910390f35b341561038457600080fd5b61038c6110d2565b6040518082815260200191505060405180910390f35b34156103ad57600080fd5b6103b56110df565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561040257600080fd5b61040a611104565b6040518082815260200191505060405180910390f35b600080600080600060149054906101000a900460ff16801561048e57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1561049857600191505b600090505b600180549050811015610565576002818154811015156104b957fe5b90600052602060002090602091828204019190069054906101000a900460ff16801561054a57506001818154811015156104ef57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b156105585760019150610565565b808060010191505061049d565b81151561057157600080fd5b60009350600092505b60018054905083101561070d57831561068d5760018381548110151561059c57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660018085038154811015156105d957fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060028381548110151561063157fe5b90600052602060002090602091828204019190069054906101000a900460ff1660026001850381548110151561066357fe5b90600052602060002090602091828204019190066101000a81548160ff0219169083151502179055505b8473ffffffffffffffffffffffffffffffffffffffff166001848154811015156106b357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561070057600193505b828060010193505061057a565b60018080805490500381548110151561072257fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600260016002805490500381548110151561076757fe5b90600052602060002090602091828204019190066101000a81549060ff0219169055600180818180549050039150816107a09190611111565b5060016002818180549050039150816107b9919061113d565b5060006107c4611048565b1115156107d057600080fd5b5050505050565b6002818154811015156107e657fe5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b60018181548110151561081957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600060149054906101000a900460ff1680156108b457506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b156108be57600191505b600090505b60018054905081101561098b576002818154811015156108df57fe5b90600052602060002090602091828204019190069054906101000a900460ff168015610970575060018181548110151561091557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1561097e576001915061098b565b80806001019150506108c3565b81151561099757600080fd5b82600060146101000a81548160ff02191690831515021790555060006109bb611048565b1115156109c757600080fd5b505050565b60008090505b600180549050811015610a98578273ffffffffffffffffffffffffffffffffffffffff16600182815481101515610a0557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a8b5781600282815481101515610a5d57fe5b90600052602060002090602091828204019190066101000a81548160ff021916908315150217905550610a98565b80806001019150506109d2565b6000610aa2611048565b111515610aae57600080fd5b505050565b600080600060149054906101000a900460ff168015610b1e57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610b2857600191505b600090505b600180549050811015610bf557600281815481101515610b4957fe5b90600052602060002090602091828204019190069054906101000a900460ff168015610bda5750600181815481101515610b7f57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610be85760019150610bf5565b8080600101915050610b2d565b811515610c0157600080fd5b60038054806001018281610c159190611177565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b600080600060149054906101000a900460ff168015610cd457506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610cde57600191505b600090505b600180549050811015610dab57600281815481101515610cff57fe5b90600052602060002090602091828204019190069054906101000a900460ff168015610d905750600181815481101515610d3557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610d9e5760019150610dab565b8080600101915050610ce3565b811515610db757600080fd5b60018054806001018281610dcb9190611177565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060028054806001018281610e2e91906111a3565b91600052602060002090602091828204019190066001909190916101000a81548160ff02191690831515021790555050505050565b600381815481101515610e7257fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060149054906101000a900460ff1681565b600080600060149054906101000a900460ff168015610f2057506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610f2a57600191505b600090505b600180549050811015610ff757600281815481101515610f4b57fe5b90600052602060002090602091828204019190069054906101000a900460ff168015610fdc5750600181815481101515610f8157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610fea5760019150610ff7565b8080600101915050610f2f565b81151561100357600080fd5b826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b6000806000809150600060149054906101000a900460ff161561106e5781806001019250505b600090505b6002805490508110156110ca5760028181548110151561108f57fe5b90600052602060002090602091828204019190069054906101000a900460ff16156110bd5781806001019250505b8080600101915050611073565b819250505090565b6000600380549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600180549050905090565b8154818355818115116111385781836000526020600020918201910161113791906111dd565b5b505050565b81548183558181151161117257601f016020900481601f0160209004836000526020600020918201910161117191906111dd565b5b505050565b81548183558181151161119e5781836000526020600020918201910161119d91906111dd565b5b505050565b8154818355818115116111d857601f016020900481601f016020900483600052602060002091820191016111d791906111dd565b5b505050565b6111ff91905b808211156111fb5760008160009055506001016111e3565b5090565b905600a165627a7a7230582084a4b64c310f70890ffaef78130567fb396ca94bdf09f104edb3b1bdad1588e40029",
"deployedBytecode": "0x6060604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630f12a66a146100d5578063108fd0cc1461010e5780632299bda6146101495780632788aa71146101ac5780636ca9677a146101d157806379bda9371461021557806385d95b811461024e57806394aa27181461028757806399d29e71146102ea578063bcf685ed14610317578063c23a0d2814610350578063e968177e14610379578063f5ff5c76146103a2578063faea7b2c146103f7575b600080fd5b34156100e057600080fd5b61010c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610420565b005b341561011957600080fd5b61012f60048080359060200190919050506107d7565b604051808215151515815260200191505060405180910390f35b341561015457600080fd5b61016a600480803590602001909190505061080a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101b757600080fd5b6101cf60048080351515906020019091905050610849565b005b34156101dc57600080fd5b610213600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803515159060200190919050506109cc565b005b341561022057600080fd5b61024c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ab3565b005b341561025957600080fd5b610285600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c69565b005b341561029257600080fd5b6102a86004808035906020019091905050610e63565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102f557600080fd5b6102fd610ea2565b604051808215151515815260200191505060405180910390f35b341561032257600080fd5b61034e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610eb5565b005b341561035b57600080fd5b610363611048565b6040518082815260200191505060405180910390f35b341561038457600080fd5b61038c6110d2565b6040518082815260200191505060405180910390f35b34156103ad57600080fd5b6103b56110df565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561040257600080fd5b61040a611104565b6040518082815260200191505060405180910390f35b600080600080600060149054906101000a900460ff16801561048e57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1561049857600191505b600090505b600180549050811015610565576002818154811015156104b957fe5b90600052602060002090602091828204019190069054906101000a900460ff16801561054a57506001818154811015156104ef57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b156105585760019150610565565b808060010191505061049d565b81151561057157600080fd5b60009350600092505b60018054905083101561070d57831561068d5760018381548110151561059c57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660018085038154811015156105d957fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060028381548110151561063157fe5b90600052602060002090602091828204019190069054906101000a900460ff1660026001850381548110151561066357fe5b90600052602060002090602091828204019190066101000a81548160ff0219169083151502179055505b8473ffffffffffffffffffffffffffffffffffffffff166001848154811015156106b357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561070057600193505b828060010193505061057a565b60018080805490500381548110151561072257fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600260016002805490500381548110151561076757fe5b90600052602060002090602091828204019190066101000a81549060ff0219169055600180818180549050039150816107a09190611111565b5060016002818180549050039150816107b9919061113d565b5060006107c4611048565b1115156107d057600080fd5b5050505050565b6002818154811015156107e657fe5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b60018181548110151561081957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600060149054906101000a900460ff1680156108b457506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b156108be57600191505b600090505b60018054905081101561098b576002818154811015156108df57fe5b90600052602060002090602091828204019190069054906101000a900460ff168015610970575060018181548110151561091557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1561097e576001915061098b565b80806001019150506108c3565b81151561099757600080fd5b82600060146101000a81548160ff02191690831515021790555060006109bb611048565b1115156109c757600080fd5b505050565b60008090505b600180549050811015610a98578273ffffffffffffffffffffffffffffffffffffffff16600182815481101515610a0557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a8b5781600282815481101515610a5d57fe5b90600052602060002090602091828204019190066101000a81548160ff021916908315150217905550610a98565b80806001019150506109d2565b6000610aa2611048565b111515610aae57600080fd5b505050565b600080600060149054906101000a900460ff168015610b1e57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610b2857600191505b600090505b600180549050811015610bf557600281815481101515610b4957fe5b90600052602060002090602091828204019190069054906101000a900460ff168015610bda5750600181815481101515610b7f57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610be85760019150610bf5565b8080600101915050610b2d565b811515610c0157600080fd5b60038054806001018281610c159190611177565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b600080600060149054906101000a900460ff168015610cd457506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610cde57600191505b600090505b600180549050811015610dab57600281815481101515610cff57fe5b90600052602060002090602091828204019190069054906101000a900460ff168015610d905750600181815481101515610d3557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610d9e5760019150610dab565b8080600101915050610ce3565b811515610db757600080fd5b60018054806001018281610dcb9190611177565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060028054806001018281610e2e91906111a3565b91600052602060002090602091828204019190066001909190916101000a81548160ff02191690831515021790555050505050565b600381815481101515610e7257fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060149054906101000a900460ff1681565b600080600060149054906101000a900460ff168015610f2057506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610f2a57600191505b600090505b600180549050811015610ff757600281815481101515610f4b57fe5b90600052602060002090602091828204019190069054906101000a900460ff168015610fdc5750600181815481101515610f8157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610fea5760019150610ff7565b8080600101915050610f2f565b81151561100357600080fd5b826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b6000806000809150600060149054906101000a900460ff161561106e5781806001019250505b600090505b6002805490508110156110ca5760028181548110151561108f57fe5b90600052602060002090602091828204019190069054906101000a900460ff16156110bd5781806001019250505b8080600101915050611073565b819250505090565b6000600380549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600180549050905090565b8154818355818115116111385781836000526020600020918201910161113791906111dd565b5b505050565b81548183558181151161117257601f016020900481601f0160209004836000526020600020918201910161117191906111dd565b5b505050565b81548183558181151161119e5781836000526020600020918201910161119d91906111dd565b5b505050565b8154818355818115116111d857601f016020900481601f016020900483600052602060002091820191016111d791906111dd565b5b505050565b6111ff91905b808211156111fb5760008160009055506001016111e3565b5090565b905600a165627a7a7230582084a4b64c310f70890ffaef78130567fb396ca94bdf09f104edb3b1bdad1588e40029",
"sourceMap": "128:2239:0:-;;;643:78;;;;;;;;681:10;673:5;;:18;;;;;;;;;;;;;;;;;;712:4;697:12;;:19;;;;;;;;;;;;;;;;;;128:2239;;;;;;",
"deployedSourceMap": "128:2239:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1044:541;;;;;;;;;;;;;;;;;;;;;;;;;;;;230:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;199:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;799:121;;;;;;;;;;;;;;;;;;;;;;;;;;;;1589:255;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1848:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;924:116;;;;;;;;;;;;;;;;;;;;;;;;;;;;264:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;171:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;725:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;2039:228;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1935:100;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;147:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2271:94;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1044:541;1104:14;1136:6;366:11;446:6;386:12;;;;;;;;;;;:35;;;;;416:5;;;;;;;;;;;402:19;;:10;:19;;;386:35;383:53;;;432:4;423:13;;383:53;455:1;446:10;;442:160;462:10;:17;;;;458:1;:21;442:160;;;497:16;514:1;497:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:50;;;;;534:10;545:1;534:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;520:27;;:10;:27;;;497:50;494:102;;;568:4;559:13;;582:5;;494:102;481:3;;;;;;;442:160;;;611:6;610:7;607:20;;;619:8;;;607:20;1121:5;1104:22;;1145:1;1136:10;;1132:245;1152:10;:17;;;;1148:1;:21;1132:245;;;1187:9;1184:119;;;1228:10;1239:1;1228:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;1208:10;1223:1;1219;:5;1208:17;;;;;;;;;;;;;;;;;;;:33;;;;;;;;;;;;;;;;;;1275:16;1292:1;1275:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1251:16;1270:1;1268;:3;1251:21;;;;;;;;;;;;;;;;;;;;;;;;;;:43;;;;;;;;;;;;;;;;;;1184:119;1330:4;1313:21;;:10;1324:1;1313:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;:21;;;1310:61;;;1358:4;1346:16;;1310:61;1171:3;;;;;;;1132:245;;;1389:10;1418:1;1400:10;:17;;;;:19;1389:31;;;;;;;;;;;;;;;;;;;1382:39;;;;;;;;;;;1434:16;1475:1;1451:16;:23;;;;:25;1434:43;;;;;;;;;;;;;;;;;;;;;;;;;;1427:51;;;;;;;;;;;1505:1;1484:10;:22;;;;;;;;;;;;;;:::i;:::-;;1539:1;1512:16;:28;;;;;;;;;;;;;;:::i;:::-;;1578:1;1554:21;:19;:21::i;:::-;:25;1546:34;;;;;;;;1044:541;;;;;:::o;230:30::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;199:27::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;799:121::-;366:11;446:6;386:12;;;;;;;;;;;:35;;;;;416:5;;;;;;;;;;;402:19;;:10;:19;;;386:35;383:53;;;432:4;423:13;;383:53;455:1;446:10;;442:160;462:10;:17;;;;458:1;:21;442:160;;;497:16;514:1;497:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:50;;;;;534:10;545:1;534:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;520:27;;:10;:27;;;497:50;494:102;;;568:4;559:13;;582:5;;494:102;481:3;;;;;;;442:160;;;611:6;610:7;607:20;;;619:8;;;607:20;869:6;854:12;;:21;;;;;;;;;;;;;;;;;;913:1;889:21;:19;:21::i;:::-;:25;881:34;;;;;;;;799:121;;;:::o;1589:255::-;1658:6;1667:1;1658:10;;1654:146;1674:10;:17;;;;1670:1;:21;1654:146;;;1726:4;1709:21;;:10;1720:1;1709:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;:21;;;1706:88;;;1764:6;1742:16;1759:1;1742:19;;;;;;;;;;;;;;;;;;;;;;;;;;:28;;;;;;;;;;;;;;;;;;1780:5;;1706:88;1693:3;;;;;;;1654:146;;;1837:1;1813:21;:19;:21::i;:::-;:25;1805:34;;;;;;;;1589:255;;;:::o;1848:83::-;366:11;446:6;386:12;;;;;;;;;;;:35;;;;;416:5;;;;;;;;;;;402:19;;:10;:19;;;386:35;383:53;;;432:4;423:13;;383:53;455:1;446:10;;442:160;462:10;:17;;;;458:1;:21;442:160;;;497:16;514:1;497:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:50;;;;;534:10;545:1;534:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;520:27;;:10;:27;;;497:50;494:102;;;568:4;559:13;;582:5;;494:102;481:3;;;;;;;442:160;;;611:6;610:7;607:20;;;619:8;;;607:20;1905:13;:21;;;;;;;;;;;:::i;:::-;;;;;;;;;;1924:1;1905:21;;;;;;;;;;;;;;;;;;;;;;;1848:83;;;:::o;924:116::-;366:11;446:6;386:12;;;;;;;;;;;:35;;;;;416:5;;;;;;;;;;;402:19;;:10;:19;;;386:35;383:53;;;432:4;423:13;;383:53;455:1;446:10;;442:160;462:10;:17;;;;458:1;:21;442:160;;;497:16;514:1;497:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:50;;;;;534:10;545:1;534:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;520:27;;:10;:27;;;497:50;494:102;;;568:4;559:13;;582:5;;494:102;481:3;;;;;;;442:160;;;611:6;610:7;607:20;;;619:8;;;607:20;981:10;:21;;;;;;;;;;;:::i;:::-;;;;;;;;;;997:4;981:21;;;;;;;;;;;;;;;;;;;;;;;1008:16;:27;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;1030:4;1008:27;;;;;;;;;;;;;;;;;;;;;;;924:116;;;:::o;264:30::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;171:24::-;;;;;;;;;;;;;:::o;725:70::-;366:11;446:6;386:12;;;;;;;;;;;:35;;;;;416:5;;;;;;;;;;;402:19;;:10;:19;;;386:35;383:53;;;432:4;423:13;;383:53;455:1;446:10;;442:160;462:10;:17;;;;458:1;:21;442:160;;;497:16;514:1;497:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:50;;;;;534:10;545:1;534:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;520:27;;:10;:27;;;497:50;494:102;;;568:4;559:13;;582:5;;494:102;481:3;;;;;;;442:160;;;611:6;610:7;607:20;;;619:8;;;607:20;786:4;778:5;;:12;;;;;;;;;;;;;;;;;;725:70;;;:::o;2039:228::-;2095:4;2107:8;2157:6;2118:1;2107:12;;2128;;;;;;;;;;;2125:22;;;2142:5;;;;;;;2125:22;2166:1;2157:10;;2153:94;2173:16;:23;;;;2169:1;:27;2153:94;;;2214:16;2231:1;2214:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2211:29;;;2235:5;;;;;;;2211:29;2198:3;;;;;;;2153:94;;;2259:3;2252:10;;2039:228;;;:::o;1935:100::-;1991:4;2010:13;:20;;;;2003:27;;1935:100;:::o;147:20::-;;;;;;;;;;;;;:::o;2271:94::-;2324:4;2343:10;:17;;;;2336:24;;2271:94;:::o;128:2239::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o",
"source": "pragma solidity ^0.4.15;\n\n//Represents both a Patient and a Provider,\n//Patients list of relationships with different Providers\ncontract Agent {\n address public agent;\n bool public agentEnabled;\n address[] public custodians;\n bool[] public custodianEnabled;\n address[] public relationships; //list of Relationship contract addresses\n\n modifier isOwner() {\n bool enable;\n if(agentEnabled && msg.sender == agent) enable = true;\n for(uint i = 0; i < custodians.length; i++) {\n if(custodianEnabled[i] && msg.sender == custodians[i]) {\n enable = true;\n break;\n }\n }\n if(!enable) revert();\n _;\n }\n\n function Agent() public {\n agent = msg.sender;\n agentEnabled = true;\n }\n\n function setAgent(address addr) public isOwner {\n agent = addr;\n }\n\n function enableAgent(bool enable) public isOwner {\n agentEnabled = enable;\n require(getNumEnabledOwners() > 0);\n }\n\n function addCustodian(address addr) public isOwner {\n custodians.push(addr);\n custodianEnabled.push(true);\n }\n\n function removeCustodian(address addr) public isOwner {\n bool overwrite = false;\n for(uint i = 0; i < custodians.length; i++) {\n if(overwrite) {\n custodians[i - 1] = custodians[i];\n custodianEnabled[i-1] = custodianEnabled[i];\n }\n if(custodians[i] == addr) {\n overwrite = true;\n }\n }\n delete(custodians[custodians.length-1]);\n delete(custodianEnabled[custodianEnabled.length-1]);\n custodians.length -= 1;\n custodianEnabled.length -= 1;\n require(getNumEnabledOwners() > 0);\n }\n\n function enableCustodian(address addr, bool enable) public {\n for(uint i = 0; i < custodians.length; i++) {\n if(custodians[i] == addr) {\n custodianEnabled[i] = enable;\n break;\n }\n }\n require(getNumEnabledOwners() > 0);\n }\n\n function addRelationship(address r) public isOwner {\n relationships.push(r);\n }\n\n function getNumRelationships() public constant returns (uint) {\n return relationships.length;\n }\n\n function getNumEnabledOwners() public constant returns (uint) {\n uint num = 0;\n if(agentEnabled) num++;\n for(uint i = 0; i < custodianEnabled.length; i++) {\n if(custodianEnabled[i]) num++;\n }\n return num;\n }\n\n function getNumCustodians() public constant returns (uint) {\n return custodians.length;\n }\n}\n",
"sourcePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/Agent.sol",
"ast": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/Agent.sol",
"exportedSymbols": {
"Agent": [
340
]
},
"id": 341,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.4",
".15"
],
"nodeType": "PragmaDirective",
"src": "0:24:0"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 340,
"linearizedBaseContracts": [
340
],
"name": "Agent",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 3,
"name": "agent",
"nodeType": "VariableDeclaration",
"scope": 340,
"src": "147:20:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "147:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 5,
"name": "agentEnabled",
"nodeType": "VariableDeclaration",
"scope": 340,
"src": "171:24:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 4,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "171:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 8,
"name": "custodians",
"nodeType": "VariableDeclaration",
"scope": 340,
"src": "199:27:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 6,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "199:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 7,
"length": null,
"nodeType": "ArrayTypeName",
"src": "199:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 11,
"name": "custodianEnabled",
"nodeType": "VariableDeclaration",
"scope": 340,
"src": "230:30:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
},
"typeName": {
"baseType": {
"id": 9,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "230:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 10,
"length": null,
"nodeType": "ArrayTypeName",
"src": "230:6:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage_ptr",
"typeString": "bool[] storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 14,
"name": "relationships",
"nodeType": "VariableDeclaration",
"scope": 340,
"src": "264:30:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 12,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "264:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 13,
"length": null,
"nodeType": "ArrayTypeName",
"src": "264:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 67,
"nodeType": "Block",
"src": "360:279:0",
"statements": [
{
"assignments": [],
"declarations": [
{
"constant": false,
"id": 17,
"name": "enable",
"nodeType": "VariableDeclaration",
"scope": 68,
"src": "366:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 16,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "366:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 18,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "366:11:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 24,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 19,
"name": "agentEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "386:12:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 23,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 20,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "402:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 21,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "402:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 22,
"name": "agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "416:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "402:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "386:35:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 29,
"nodeType": "IfStatement",
"src": "383:53:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 27,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 25,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 17,
"src": "423:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 26,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "432:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "423:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 28,
"nodeType": "ExpressionStatement",
"src": "423:13:0"
}
},
{
"body": {
"id": 58,
"nodeType": "Block",
"src": "486:116:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 50,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 41,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "497:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 43,
"indexExpression": {
"argumentTypes": null,
"id": 42,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 31,
"src": "514:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "497:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 49,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 44,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "520:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 45,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "520:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 46,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "534:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 48,
"indexExpression": {
"argumentTypes": null,
"id": 47,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 31,
"src": "545:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "534:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "520:27:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "497:50:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 57,
"nodeType": "IfStatement",
"src": "494:102:0",
"trueBody": {
"id": 56,
"nodeType": "Block",
"src": "549:47:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 53,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 51,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 17,
"src": "559:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 52,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "568:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "559:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 54,
"nodeType": "ExpressionStatement",
"src": "559:13:0"
},
{
"id": 55,
"nodeType": "Break",
"src": "582:5:0"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 37,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 34,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 31,
"src": "458:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 35,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "462:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 36,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "462:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "458:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 59,
"initializationExpression": {
"assignments": [
31
],
"declarations": [
{
"constant": false,
"id": 31,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 68,
"src": "446:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 30,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "446:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 33,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 32,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "455:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "446:10:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 39,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "481:3:0",
"subExpression": {
"argumentTypes": null,
"id": 38,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 31,
"src": "481:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 40,
"nodeType": "ExpressionStatement",
"src": "481:3:0"
},
"nodeType": "ForStatement",
"src": "442:160:0"
},
{
"condition": {
"argumentTypes": null,
"id": 61,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "610:7:0",
"subExpression": {
"argumentTypes": null,
"id": 60,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 17,
"src": "611:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 65,
"nodeType": "IfStatement",
"src": "607:20:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 62,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2203,
"src": "619:6:0",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 63,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "619:8:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 64,
"nodeType": "ExpressionStatement",
"src": "619:8:0"
}
},
{
"id": 66,
"nodeType": "PlaceholderStatement",
"src": "633:1:0"
}
]
},
"id": 68,
"name": "isOwner",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 15,
"nodeType": "ParameterList",
"parameters": [],
"src": "357:2:0"
},
"src": "341:298:0",
"visibility": "internal"
},
{
"body": {
"id": 80,
"nodeType": "Block",
"src": "667:54:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 74,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 71,
"name": "agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "673:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 72,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "681:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 73,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "681:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "673:18:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 75,
"nodeType": "ExpressionStatement",
"src": "673:18:0"
},
{
"expression": {
"argumentTypes": null,
"id": 78,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 76,
"name": "agentEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "697:12:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 77,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "712:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "697:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 79,
"nodeType": "ExpressionStatement",
"src": "697:19:0"
}
]
},
"id": 81,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "Agent",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 69,
"nodeType": "ParameterList",
"parameters": [],
"src": "657:2:0"
},
"payable": false,
"returnParameters": {
"id": 70,
"nodeType": "ParameterList",
"parameters": [],
"src": "667:0:0"
},
"scope": 340,
"src": "643:78:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 92,
"nodeType": "Block",
"src": "772:23:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 90,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 88,
"name": "agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "778:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 89,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 83,
"src": "786:4:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "778:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 91,
"nodeType": "ExpressionStatement",
"src": "778:12:0"
}
]
},
"id": 93,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 86,
"modifierName": {
"argumentTypes": null,
"id": 85,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 68,
"src": "764:7:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "764:7:0"
}
],
"name": "setAgent",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 84,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 83,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 93,
"src": "743:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 82,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "743:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "742:14:0"
},
"payable": false,
"returnParameters": {
"id": 87,
"nodeType": "ParameterList",
"parameters": [],
"src": "772:0:0"
},
"scope": 340,
"src": "725:70:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 111,
"nodeType": "Block",
"src": "848:72:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 102,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 100,
"name": "agentEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "854:12:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 101,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 95,
"src": "869:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "854:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 103,
"nodeType": "ExpressionStatement",
"src": "854:21:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 108,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 105,
"name": "getNumEnabledOwners",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 330,
"src": "889:19:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 106,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "889:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 107,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "913:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "889:25:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 104,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2202,
"src": "881:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 109,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "881:34:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 110,
"nodeType": "ExpressionStatement",
"src": "881:34:0"
}
]
},
"id": 112,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 98,
"modifierName": {
"argumentTypes": null,
"id": 97,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 68,
"src": "840:7:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "840:7:0"
}
],
"name": "enableAgent",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 96,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 95,
"name": "enable",
"nodeType": "VariableDeclaration",
"scope": 112,
"src": "820:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 94,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "820:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "819:13:0"
},
"payable": false,
"returnParameters": {
"id": 99,
"nodeType": "ParameterList",
"parameters": [],
"src": "848:0:0"
},
"scope": 340,
"src": "799:121:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 131,
"nodeType": "Block",
"src": "975:65:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 122,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 114,
"src": "997:4:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 119,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "981:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 121,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "981:15:0",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 123,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "981:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 124,
"nodeType": "ExpressionStatement",
"src": "981:21:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "74727565",
"id": 128,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1030:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"expression": {
"argumentTypes": null,
"id": 125,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1008:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 127,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1008:21:0",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_bool_$returns$_t_uint256_$",
"typeString": "function (bool) returns (uint256)"
}
},
"id": 129,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1008:27:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 130,
"nodeType": "ExpressionStatement",
"src": "1008:27:0"
}
]
},
"id": 132,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 117,
"modifierName": {
"argumentTypes": null,
"id": 116,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 68,
"src": "967:7:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "967:7:0"
}
],
"name": "addCustodian",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 115,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 114,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 132,
"src": "946:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 113,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "946:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "945:14:0"
},
"payable": false,
"returnParameters": {
"id": 118,
"nodeType": "ParameterList",
"parameters": [],
"src": "975:0:0"
},
"scope": 340,
"src": "924:116:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 227,
"nodeType": "Block",
"src": "1098:487:0",
"statements": [
{
"assignments": [
140
],
"declarations": [
{
"constant": false,
"id": 140,
"name": "overwrite",
"nodeType": "VariableDeclaration",
"scope": 228,
"src": "1104:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 139,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1104:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 142,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 141,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1121:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "1104:22:0"
},
{
"body": {
"id": 188,
"nodeType": "Block",
"src": "1176:201:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 154,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 140,
"src": "1187:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 176,
"nodeType": "IfStatement",
"src": "1184:119:0",
"trueBody": {
"id": 175,
"nodeType": "Block",
"src": "1198:105:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 163,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 155,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1208:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 159,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 158,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 156,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1219:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 157,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1223:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1219:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1208:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 160,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1228:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 162,
"indexExpression": {
"argumentTypes": null,
"id": 161,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1239:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1228:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1208:33:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 164,
"nodeType": "ExpressionStatement",
"src": "1208:33:0"
},
{
"expression": {
"argumentTypes": null,
"id": 173,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 165,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1251:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 169,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 168,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 166,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1268:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 167,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1270:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1268:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1251:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 170,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1275:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 172,
"indexExpression": {
"argumentTypes": null,
"id": 171,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1292:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1275:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1251:43:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 174,
"nodeType": "ExpressionStatement",
"src": "1251:43:0"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 181,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 177,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1313:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 179,
"indexExpression": {
"argumentTypes": null,
"id": 178,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1324:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1313:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 180,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 134,
"src": "1330:4:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1313:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 187,
"nodeType": "IfStatement",
"src": "1310:61:0",
"trueBody": {
"id": 186,
"nodeType": "Block",
"src": "1336:35:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 184,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 182,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 140,
"src": "1346:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 183,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1358:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "1346:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 185,
"nodeType": "ExpressionStatement",
"src": "1346:16:0"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 150,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 147,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1148:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 148,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1152:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 149,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1152:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1148:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 189,
"initializationExpression": {
"assignments": [
144
],
"declarations": [
{
"constant": false,
"id": 144,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 228,
"src": "1136:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 143,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1136:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 146,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 145,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1145:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "1136:10:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 152,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "1171:3:0",
"subExpression": {
"argumentTypes": null,
"id": 151,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1171:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 153,
"nodeType": "ExpressionStatement",
"src": "1171:3:0"
},
"nodeType": "ForStatement",
"src": "1132:245:0"
},
{
"expression": {
"argumentTypes": null,
"id": 197,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "1382:39:0",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 190,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1389:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 195,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 194,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 191,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1400:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 192,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1400:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 193,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1418:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1400:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1389:31:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 196,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "1388:33:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 198,
"nodeType": "ExpressionStatement",
"src": "1382:39:0"
},
{
"expression": {
"argumentTypes": null,
"id": 206,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "1427:51:0",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 199,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1434:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 204,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 203,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 200,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1451:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 201,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1451:23:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 202,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1475:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1451:25:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1434:43:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 205,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "1433:45:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 207,
"nodeType": "ExpressionStatement",
"src": "1427:51:0"
},
{
"expression": {
"argumentTypes": null,
"id": 212,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 208,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1484:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 210,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1484:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 211,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1505:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1484:22:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 213,
"nodeType": "ExpressionStatement",
"src": "1484:22:0"
},
{
"expression": {
"argumentTypes": null,
"id": 218,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 214,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1512:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 216,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1512:23:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 217,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1539:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1512:28:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 219,
"nodeType": "ExpressionStatement",
"src": "1512:28:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 224,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 221,
"name": "getNumEnabledOwners",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 330,
"src": "1554:19:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 222,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1554:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 223,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1578:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1554:25:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 220,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2202,
"src": "1546:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 225,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1546:34:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 226,
"nodeType": "ExpressionStatement",
"src": "1546:34:0"
}
]
},
"id": 228,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 137,
"modifierName": {
"argumentTypes": null,
"id": 136,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 68,
"src": "1090:7:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1090:7:0"
}
],
"name": "removeCustodian",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 135,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 134,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 228,
"src": "1069:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 133,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1069:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1068:14:0"
},
"payable": false,
"returnParameters": {
"id": 138,
"nodeType": "ParameterList",
"parameters": [],
"src": "1098:0:0"
},
"scope": 340,
"src": "1044:541:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 269,
"nodeType": "Block",
"src": "1648:196:0",
"statements": [
{
"body": {
"id": 260,
"nodeType": "Block",
"src": "1698:102:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 250,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 246,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1709:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 248,
"indexExpression": {
"argumentTypes": null,
"id": 247,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 236,
"src": "1720:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1709:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 249,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 230,
"src": "1726:4:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1709:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 259,
"nodeType": "IfStatement",
"src": "1706:88:0",
"trueBody": {
"id": 258,
"nodeType": "Block",
"src": "1732:62:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 255,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 251,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1742:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 253,
"indexExpression": {
"argumentTypes": null,
"id": 252,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 236,
"src": "1759:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1742:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 254,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 232,
"src": "1764:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1742:28:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 256,
"nodeType": "ExpressionStatement",
"src": "1742:28:0"
},
{
"id": 257,
"nodeType": "Break",
"src": "1780:5:0"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 242,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 239,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 236,
"src": "1670:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 240,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1674:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 241,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1674:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1670:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 261,
"initializationExpression": {
"assignments": [
236
],
"declarations": [
{
"constant": false,
"id": 236,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 270,
"src": "1658:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 235,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1658:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 238,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 237,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1667:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "1658:10:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 244,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "1693:3:0",
"subExpression": {
"argumentTypes": null,
"id": 243,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 236,
"src": "1693:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 245,
"nodeType": "ExpressionStatement",
"src": "1693:3:0"
},
"nodeType": "ForStatement",
"src": "1654:146:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 266,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 263,
"name": "getNumEnabledOwners",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 330,
"src": "1813:19:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 264,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1813:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 265,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1837:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1813:25:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 262,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2202,
"src": "1805:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 267,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1805:34:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 268,
"nodeType": "ExpressionStatement",
"src": "1805:34:0"
}
]
},
"id": 270,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "enableCustodian",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 233,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 230,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 270,
"src": "1614:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 229,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1614:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 232,
"name": "enable",
"nodeType": "VariableDeclaration",
"scope": 270,
"src": "1628:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 231,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1628:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1613:27:0"
},
"payable": false,
"returnParameters": {
"id": 234,
"nodeType": "ParameterList",
"parameters": [],
"src": "1648:0:0"
},
"scope": 340,
"src": "1589:255:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 283,
"nodeType": "Block",
"src": "1899:32:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 280,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 272,
"src": "1924:1:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 277,
"name": "relationships",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "1905:13:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 279,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1905:18:0",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 281,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1905:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 282,
"nodeType": "ExpressionStatement",
"src": "1905:21:0"
}
]
},
"id": 284,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 275,
"modifierName": {
"argumentTypes": null,
"id": 274,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 68,
"src": "1891:7:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1891:7:0"
}
],
"name": "addRelationship",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 273,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 272,
"name": "r",
"nodeType": "VariableDeclaration",
"scope": 284,
"src": "1873:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 271,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1873:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1872:11:0"
},
"payable": false,
"returnParameters": {
"id": 276,
"nodeType": "ParameterList",
"parameters": [],
"src": "1899:0:0"
},
"scope": 340,
"src": "1848:83:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 292,
"nodeType": "Block",
"src": "1997:38:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 289,
"name": "relationships",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "2010:13:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 290,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2010:20:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 288,
"id": 291,
"nodeType": "Return",
"src": "2003:27:0"
}
]
},
"id": 293,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumRelationships",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 285,
"nodeType": "ParameterList",
"parameters": [],
"src": "1963:2:0"
},
"payable": false,
"returnParameters": {
"id": 288,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 287,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 293,
"src": "1991:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 286,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1991:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1990:6:0"
},
"scope": 340,
"src": "1935:100:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 329,
"nodeType": "Block",
"src": "2101:166:0",
"statements": [
{
"assignments": [
299
],
"declarations": [
{
"constant": false,
"id": 299,
"name": "num",
"nodeType": "VariableDeclaration",
"scope": 330,
"src": "2107:8:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 298,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2107:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 301,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 300,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2118:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "2107:12:0"
},
{
"condition": {
"argumentTypes": null,
"id": 302,
"name": "agentEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "2128:12:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 306,
"nodeType": "IfStatement",
"src": "2125:22:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 304,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "2142:5:0",
"subExpression": {
"argumentTypes": null,
"id": 303,
"name": "num",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 299,
"src": "2142:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 305,
"nodeType": "ExpressionStatement",
"src": "2142:5:0"
}
},
{
"body": {
"id": 325,
"nodeType": "Block",
"src": "2203:44:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 318,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "2214:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 320,
"indexExpression": {
"argumentTypes": null,
"id": 319,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 308,
"src": "2231:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2214:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 324,
"nodeType": "IfStatement",
"src": "2211:29:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 322,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "2235:5:0",
"subExpression": {
"argumentTypes": null,
"id": 321,
"name": "num",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 299,
"src": "2235:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 323,
"nodeType": "ExpressionStatement",
"src": "2235:5:0"
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 314,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 311,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 308,
"src": "2169:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 312,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "2173:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 313,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2173:23:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2169:27:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 326,
"initializationExpression": {
"assignments": [
308
],
"declarations": [
{
"constant": false,
"id": 308,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 330,
"src": "2157:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 307,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2157:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 310,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 309,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2166:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "2157:10:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 316,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "2198:3:0",
"subExpression": {
"argumentTypes": null,
"id": 315,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 308,
"src": "2198:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 317,
"nodeType": "ExpressionStatement",
"src": "2198:3:0"
},
"nodeType": "ForStatement",
"src": "2153:94:0"
},
{
"expression": {
"argumentTypes": null,
"id": 327,
"name": "num",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 299,
"src": "2259:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 297,
"id": 328,
"nodeType": "Return",
"src": "2252:10:0"
}
]
},
"id": 330,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumEnabledOwners",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 294,
"nodeType": "ParameterList",
"parameters": [],
"src": "2067:2:0"
},
"payable": false,
"returnParameters": {
"id": 297,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 296,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 330,
"src": "2095:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 295,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2095:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2094:6:0"
},
"scope": 340,
"src": "2039:228:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 338,
"nodeType": "Block",
"src": "2330:35:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 335,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "2343:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 336,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2343:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 334,
"id": 337,
"nodeType": "Return",
"src": "2336:24:0"
}
]
},
"id": 339,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumCustodians",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 331,
"nodeType": "ParameterList",
"parameters": [],
"src": "2296:2:0"
},
"payable": false,
"returnParameters": {
"id": 334,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 333,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 339,
"src": "2324:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 332,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2324:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2323:6:0"
},
"scope": 340,
"src": "2271:94:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 341,
"src": "128:2239:0"
}
],
"src": "0:2368:0"
},
"legacyAST": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/Agent.sol",
"exportedSymbols": {
"Agent": [
340
]
},
"id": 341,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.4",
".15"
],
"nodeType": "PragmaDirective",
"src": "0:24:0"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 340,
"linearizedBaseContracts": [
340
],
"name": "Agent",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 3,
"name": "agent",
"nodeType": "VariableDeclaration",
"scope": 340,
"src": "147:20:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "147:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 5,
"name": "agentEnabled",
"nodeType": "VariableDeclaration",
"scope": 340,
"src": "171:24:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 4,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "171:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 8,
"name": "custodians",
"nodeType": "VariableDeclaration",
"scope": 340,
"src": "199:27:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 6,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "199:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 7,
"length": null,
"nodeType": "ArrayTypeName",
"src": "199:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 11,
"name": "custodianEnabled",
"nodeType": "VariableDeclaration",
"scope": 340,
"src": "230:30:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
},
"typeName": {
"baseType": {
"id": 9,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "230:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 10,
"length": null,
"nodeType": "ArrayTypeName",
"src": "230:6:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage_ptr",
"typeString": "bool[] storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 14,
"name": "relationships",
"nodeType": "VariableDeclaration",
"scope": 340,
"src": "264:30:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 12,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "264:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 13,
"length": null,
"nodeType": "ArrayTypeName",
"src": "264:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 67,
"nodeType": "Block",
"src": "360:279:0",
"statements": [
{
"assignments": [],
"declarations": [
{
"constant": false,
"id": 17,
"name": "enable",
"nodeType": "VariableDeclaration",
"scope": 68,
"src": "366:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 16,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "366:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 18,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "366:11:0"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 24,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 19,
"name": "agentEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "386:12:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 23,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 20,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "402:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 21,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "402:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 22,
"name": "agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "416:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "402:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "386:35:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 29,
"nodeType": "IfStatement",
"src": "383:53:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 27,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 25,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 17,
"src": "423:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 26,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "432:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "423:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 28,
"nodeType": "ExpressionStatement",
"src": "423:13:0"
}
},
{
"body": {
"id": 58,
"nodeType": "Block",
"src": "486:116:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 50,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 41,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "497:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 43,
"indexExpression": {
"argumentTypes": null,
"id": 42,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 31,
"src": "514:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "497:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 49,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 44,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "520:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 45,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "520:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 46,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "534:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 48,
"indexExpression": {
"argumentTypes": null,
"id": 47,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 31,
"src": "545:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "534:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "520:27:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "497:50:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 57,
"nodeType": "IfStatement",
"src": "494:102:0",
"trueBody": {
"id": 56,
"nodeType": "Block",
"src": "549:47:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 53,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 51,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 17,
"src": "559:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 52,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "568:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "559:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 54,
"nodeType": "ExpressionStatement",
"src": "559:13:0"
},
{
"id": 55,
"nodeType": "Break",
"src": "582:5:0"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 37,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 34,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 31,
"src": "458:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 35,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "462:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 36,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "462:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "458:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 59,
"initializationExpression": {
"assignments": [
31
],
"declarations": [
{
"constant": false,
"id": 31,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 68,
"src": "446:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 30,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "446:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 33,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 32,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "455:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "446:10:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 39,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "481:3:0",
"subExpression": {
"argumentTypes": null,
"id": 38,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 31,
"src": "481:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 40,
"nodeType": "ExpressionStatement",
"src": "481:3:0"
},
"nodeType": "ForStatement",
"src": "442:160:0"
},
{
"condition": {
"argumentTypes": null,
"id": 61,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "610:7:0",
"subExpression": {
"argumentTypes": null,
"id": 60,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 17,
"src": "611:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 65,
"nodeType": "IfStatement",
"src": "607:20:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 62,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2203,
"src": "619:6:0",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 63,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "619:8:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 64,
"nodeType": "ExpressionStatement",
"src": "619:8:0"
}
},
{
"id": 66,
"nodeType": "PlaceholderStatement",
"src": "633:1:0"
}
]
},
"id": 68,
"name": "isOwner",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 15,
"nodeType": "ParameterList",
"parameters": [],
"src": "357:2:0"
},
"src": "341:298:0",
"visibility": "internal"
},
{
"body": {
"id": 80,
"nodeType": "Block",
"src": "667:54:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 74,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 71,
"name": "agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "673:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 72,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "681:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 73,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "681:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "673:18:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 75,
"nodeType": "ExpressionStatement",
"src": "673:18:0"
},
{
"expression": {
"argumentTypes": null,
"id": 78,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 76,
"name": "agentEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "697:12:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 77,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "712:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "697:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 79,
"nodeType": "ExpressionStatement",
"src": "697:19:0"
}
]
},
"id": 81,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "Agent",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 69,
"nodeType": "ParameterList",
"parameters": [],
"src": "657:2:0"
},
"payable": false,
"returnParameters": {
"id": 70,
"nodeType": "ParameterList",
"parameters": [],
"src": "667:0:0"
},
"scope": 340,
"src": "643:78:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 92,
"nodeType": "Block",
"src": "772:23:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 90,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 88,
"name": "agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "778:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 89,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 83,
"src": "786:4:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "778:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 91,
"nodeType": "ExpressionStatement",
"src": "778:12:0"
}
]
},
"id": 93,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 86,
"modifierName": {
"argumentTypes": null,
"id": 85,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 68,
"src": "764:7:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "764:7:0"
}
],
"name": "setAgent",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 84,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 83,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 93,
"src": "743:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 82,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "743:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "742:14:0"
},
"payable": false,
"returnParameters": {
"id": 87,
"nodeType": "ParameterList",
"parameters": [],
"src": "772:0:0"
},
"scope": 340,
"src": "725:70:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 111,
"nodeType": "Block",
"src": "848:72:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 102,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 100,
"name": "agentEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "854:12:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 101,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 95,
"src": "869:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "854:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 103,
"nodeType": "ExpressionStatement",
"src": "854:21:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 108,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 105,
"name": "getNumEnabledOwners",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 330,
"src": "889:19:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 106,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "889:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 107,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "913:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "889:25:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 104,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2202,
"src": "881:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 109,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "881:34:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 110,
"nodeType": "ExpressionStatement",
"src": "881:34:0"
}
]
},
"id": 112,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 98,
"modifierName": {
"argumentTypes": null,
"id": 97,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 68,
"src": "840:7:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "840:7:0"
}
],
"name": "enableAgent",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 96,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 95,
"name": "enable",
"nodeType": "VariableDeclaration",
"scope": 112,
"src": "820:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 94,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "820:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "819:13:0"
},
"payable": false,
"returnParameters": {
"id": 99,
"nodeType": "ParameterList",
"parameters": [],
"src": "848:0:0"
},
"scope": 340,
"src": "799:121:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 131,
"nodeType": "Block",
"src": "975:65:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 122,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 114,
"src": "997:4:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 119,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "981:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 121,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "981:15:0",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 123,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "981:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 124,
"nodeType": "ExpressionStatement",
"src": "981:21:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "74727565",
"id": 128,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1030:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"expression": {
"argumentTypes": null,
"id": 125,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1008:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 127,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1008:21:0",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_bool_$returns$_t_uint256_$",
"typeString": "function (bool) returns (uint256)"
}
},
"id": 129,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1008:27:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 130,
"nodeType": "ExpressionStatement",
"src": "1008:27:0"
}
]
},
"id": 132,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 117,
"modifierName": {
"argumentTypes": null,
"id": 116,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 68,
"src": "967:7:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "967:7:0"
}
],
"name": "addCustodian",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 115,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 114,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 132,
"src": "946:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 113,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "946:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "945:14:0"
},
"payable": false,
"returnParameters": {
"id": 118,
"nodeType": "ParameterList",
"parameters": [],
"src": "975:0:0"
},
"scope": 340,
"src": "924:116:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 227,
"nodeType": "Block",
"src": "1098:487:0",
"statements": [
{
"assignments": [
140
],
"declarations": [
{
"constant": false,
"id": 140,
"name": "overwrite",
"nodeType": "VariableDeclaration",
"scope": 228,
"src": "1104:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 139,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1104:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 142,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 141,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1121:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "1104:22:0"
},
{
"body": {
"id": 188,
"nodeType": "Block",
"src": "1176:201:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 154,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 140,
"src": "1187:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 176,
"nodeType": "IfStatement",
"src": "1184:119:0",
"trueBody": {
"id": 175,
"nodeType": "Block",
"src": "1198:105:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 163,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 155,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1208:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 159,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 158,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 156,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1219:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 157,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1223:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1219:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1208:17:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 160,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1228:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 162,
"indexExpression": {
"argumentTypes": null,
"id": 161,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1239:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1228:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1208:33:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 164,
"nodeType": "ExpressionStatement",
"src": "1208:33:0"
},
{
"expression": {
"argumentTypes": null,
"id": 173,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 165,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1251:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 169,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 168,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 166,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1268:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 167,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1270:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1268:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1251:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 170,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1275:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 172,
"indexExpression": {
"argumentTypes": null,
"id": 171,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1292:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1275:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1251:43:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 174,
"nodeType": "ExpressionStatement",
"src": "1251:43:0"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 181,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 177,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1313:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 179,
"indexExpression": {
"argumentTypes": null,
"id": 178,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1324:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1313:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 180,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 134,
"src": "1330:4:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1313:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 187,
"nodeType": "IfStatement",
"src": "1310:61:0",
"trueBody": {
"id": 186,
"nodeType": "Block",
"src": "1336:35:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 184,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 182,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 140,
"src": "1346:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 183,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1358:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "1346:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 185,
"nodeType": "ExpressionStatement",
"src": "1346:16:0"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 150,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 147,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1148:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 148,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1152:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 149,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1152:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1148:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 189,
"initializationExpression": {
"assignments": [
144
],
"declarations": [
{
"constant": false,
"id": 144,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 228,
"src": "1136:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 143,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1136:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 146,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 145,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1145:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "1136:10:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 152,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "1171:3:0",
"subExpression": {
"argumentTypes": null,
"id": 151,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 144,
"src": "1171:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 153,
"nodeType": "ExpressionStatement",
"src": "1171:3:0"
},
"nodeType": "ForStatement",
"src": "1132:245:0"
},
{
"expression": {
"argumentTypes": null,
"id": 197,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "1382:39:0",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 190,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1389:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 195,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 194,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 191,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1400:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 192,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1400:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 193,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1418:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1400:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1389:31:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 196,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "1388:33:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 198,
"nodeType": "ExpressionStatement",
"src": "1382:39:0"
},
{
"expression": {
"argumentTypes": null,
"id": 206,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "1427:51:0",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 199,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1434:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 204,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 203,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 200,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1451:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 201,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1451:23:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 202,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1475:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1451:25:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1434:43:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 205,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "1433:45:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 207,
"nodeType": "ExpressionStatement",
"src": "1427:51:0"
},
{
"expression": {
"argumentTypes": null,
"id": 212,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 208,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1484:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 210,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1484:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 211,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1505:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1484:22:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 213,
"nodeType": "ExpressionStatement",
"src": "1484:22:0"
},
{
"expression": {
"argumentTypes": null,
"id": 218,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 214,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1512:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 216,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1512:23:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 217,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1539:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1512:28:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 219,
"nodeType": "ExpressionStatement",
"src": "1512:28:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 224,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 221,
"name": "getNumEnabledOwners",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 330,
"src": "1554:19:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 222,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1554:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 223,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1578:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1554:25:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 220,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2202,
"src": "1546:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 225,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1546:34:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 226,
"nodeType": "ExpressionStatement",
"src": "1546:34:0"
}
]
},
"id": 228,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 137,
"modifierName": {
"argumentTypes": null,
"id": 136,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 68,
"src": "1090:7:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1090:7:0"
}
],
"name": "removeCustodian",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 135,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 134,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 228,
"src": "1069:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 133,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1069:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1068:14:0"
},
"payable": false,
"returnParameters": {
"id": 138,
"nodeType": "ParameterList",
"parameters": [],
"src": "1098:0:0"
},
"scope": 340,
"src": "1044:541:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 269,
"nodeType": "Block",
"src": "1648:196:0",
"statements": [
{
"body": {
"id": 260,
"nodeType": "Block",
"src": "1698:102:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 250,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 246,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1709:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 248,
"indexExpression": {
"argumentTypes": null,
"id": 247,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 236,
"src": "1720:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1709:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 249,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 230,
"src": "1726:4:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1709:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 259,
"nodeType": "IfStatement",
"src": "1706:88:0",
"trueBody": {
"id": 258,
"nodeType": "Block",
"src": "1732:62:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 255,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 251,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1742:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 253,
"indexExpression": {
"argumentTypes": null,
"id": 252,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 236,
"src": "1759:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1742:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 254,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 232,
"src": "1764:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1742:28:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 256,
"nodeType": "ExpressionStatement",
"src": "1742:28:0"
},
{
"id": 257,
"nodeType": "Break",
"src": "1780:5:0"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 242,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 239,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 236,
"src": "1670:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 240,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "1674:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 241,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1674:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1670:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 261,
"initializationExpression": {
"assignments": [
236
],
"declarations": [
{
"constant": false,
"id": 236,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 270,
"src": "1658:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 235,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1658:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 238,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 237,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1667:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "1658:10:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 244,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "1693:3:0",
"subExpression": {
"argumentTypes": null,
"id": 243,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 236,
"src": "1693:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 245,
"nodeType": "ExpressionStatement",
"src": "1693:3:0"
},
"nodeType": "ForStatement",
"src": "1654:146:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 266,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 263,
"name": "getNumEnabledOwners",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 330,
"src": "1813:19:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 264,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1813:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 265,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1837:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1813:25:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 262,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2202,
"src": "1805:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 267,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1805:34:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 268,
"nodeType": "ExpressionStatement",
"src": "1805:34:0"
}
]
},
"id": 270,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "enableCustodian",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 233,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 230,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 270,
"src": "1614:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 229,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1614:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 232,
"name": "enable",
"nodeType": "VariableDeclaration",
"scope": 270,
"src": "1628:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 231,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1628:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1613:27:0"
},
"payable": false,
"returnParameters": {
"id": 234,
"nodeType": "ParameterList",
"parameters": [],
"src": "1648:0:0"
},
"scope": 340,
"src": "1589:255:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 283,
"nodeType": "Block",
"src": "1899:32:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 280,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 272,
"src": "1924:1:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 277,
"name": "relationships",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "1905:13:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 279,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1905:18:0",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 281,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1905:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 282,
"nodeType": "ExpressionStatement",
"src": "1905:21:0"
}
]
},
"id": 284,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 275,
"modifierName": {
"argumentTypes": null,
"id": 274,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 68,
"src": "1891:7:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1891:7:0"
}
],
"name": "addRelationship",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 273,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 272,
"name": "r",
"nodeType": "VariableDeclaration",
"scope": 284,
"src": "1873:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 271,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1873:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1872:11:0"
},
"payable": false,
"returnParameters": {
"id": 276,
"nodeType": "ParameterList",
"parameters": [],
"src": "1899:0:0"
},
"scope": 340,
"src": "1848:83:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 292,
"nodeType": "Block",
"src": "1997:38:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 289,
"name": "relationships",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "2010:13:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 290,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2010:20:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 288,
"id": 291,
"nodeType": "Return",
"src": "2003:27:0"
}
]
},
"id": 293,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumRelationships",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 285,
"nodeType": "ParameterList",
"parameters": [],
"src": "1963:2:0"
},
"payable": false,
"returnParameters": {
"id": 288,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 287,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 293,
"src": "1991:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 286,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1991:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1990:6:0"
},
"scope": 340,
"src": "1935:100:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 329,
"nodeType": "Block",
"src": "2101:166:0",
"statements": [
{
"assignments": [
299
],
"declarations": [
{
"constant": false,
"id": 299,
"name": "num",
"nodeType": "VariableDeclaration",
"scope": 330,
"src": "2107:8:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 298,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2107:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 301,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 300,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2118:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "2107:12:0"
},
{
"condition": {
"argumentTypes": null,
"id": 302,
"name": "agentEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "2128:12:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 306,
"nodeType": "IfStatement",
"src": "2125:22:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 304,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "2142:5:0",
"subExpression": {
"argumentTypes": null,
"id": 303,
"name": "num",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 299,
"src": "2142:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 305,
"nodeType": "ExpressionStatement",
"src": "2142:5:0"
}
},
{
"body": {
"id": 325,
"nodeType": "Block",
"src": "2203:44:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 318,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "2214:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 320,
"indexExpression": {
"argumentTypes": null,
"id": 319,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 308,
"src": "2231:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2214:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 324,
"nodeType": "IfStatement",
"src": "2211:29:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"id": 322,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "2235:5:0",
"subExpression": {
"argumentTypes": null,
"id": 321,
"name": "num",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 299,
"src": "2235:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 323,
"nodeType": "ExpressionStatement",
"src": "2235:5:0"
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 314,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 311,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 308,
"src": "2169:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 312,
"name": "custodianEnabled",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "2173:16:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bool_$dyn_storage",
"typeString": "bool[] storage ref"
}
},
"id": 313,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2173:23:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2169:27:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 326,
"initializationExpression": {
"assignments": [
308
],
"declarations": [
{
"constant": false,
"id": 308,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 330,
"src": "2157:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 307,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2157:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 310,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 309,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2166:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "2157:10:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 316,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "2198:3:0",
"subExpression": {
"argumentTypes": null,
"id": 315,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 308,
"src": "2198:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 317,
"nodeType": "ExpressionStatement",
"src": "2198:3:0"
},
"nodeType": "ForStatement",
"src": "2153:94:0"
},
{
"expression": {
"argumentTypes": null,
"id": 327,
"name": "num",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 299,
"src": "2259:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 297,
"id": 328,
"nodeType": "Return",
"src": "2252:10:0"
}
]
},
"id": 330,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumEnabledOwners",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 294,
"nodeType": "ParameterList",
"parameters": [],
"src": "2067:2:0"
},
"payable": false,
"returnParameters": {
"id": 297,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 296,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 330,
"src": "2095:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 295,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2095:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2094:6:0"
},
"scope": 340,
"src": "2039:228:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 338,
"nodeType": "Block",
"src": "2330:35:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 335,
"name": "custodians",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "2343:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 336,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2343:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 334,
"id": 337,
"nodeType": "Return",
"src": "2336:24:0"
}
]
},
"id": 339,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumCustodians",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 331,
"nodeType": "ParameterList",
"parameters": [],
"src": "2296:2:0"
},
"payable": false,
"returnParameters": {
"id": 334,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 333,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 339,
"src": "2324:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 332,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2324:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2323:6:0"
},
"scope": 340,
"src": "2271:94:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 341,
"src": "128:2239:0"
}
],
"src": "0:2368:0"
},
"compiler": {
"name": "solc",
"version": "0.4.19+commit.c4cbbb05.Emscripten.clang"
},
"networks": {
"633732": {
"events": {},
"links": {},
"address": "0x361616d4c31bdf197cc00327aa848bc8e7456a5f",
"transactionHash": "0x0bee2123569c772f57b90b93af5f686622c2b562fc7e87981feae31218f6339d"
}
},
"schemaVersion": "2.0.0",
"updatedAt": "2018-06-05T05:32:07.932Z"
}
================================================
FILE: SmartContracts/build/contracts/AgentGroup.json
================================================
{
"contractName": "AgentGroup",
"abi": [
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "agents",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "addAgent",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "removeAgent",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getNumAgents",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x6060604052341561000f57600080fd5b600080548060010182816100239190610077565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100c8565b81548183558181151161009e5781836000526020600020918201910161009d91906100a3565b5b505050565b6100c591905b808211156100c15760008160009055506001016100a9565b5090565b90565b6105bc806100d76000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063513856c81461006757806384e79842146100ca57806397a6278e14610103578063dc7926461461013c575b600080fd5b341561007257600080fd5b6100886004808035906020019091905050610165565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100d557600080fd5b610101600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506101a4565b005b341561010e57600080fd5b61013a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506102b1565b005b341561014757600080fd5b61014f610507565b6040518082815260200191505060405180910390f35b60008181548110151561017457fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600090505b60008054905081101561023d576000818154811015156101c857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610230576001915061023d565b80806001019150506101ac565b81151561024957600080fd5b6000805480600101828161025d9190610513565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b600080600080600090505b60008054905081101561034d576000818154811015156102d857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610340576001915061034d565b80806001019150506102bc565b81151561035957600080fd5b60009350600092505b60008054905083101561048c57831561040c5760008381548110151561038457fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000600185038154811015156103c257fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff1660008481548110151561043257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561047f57600193505b8280600101935050610362565b60006001600080549050038154811015156104a357fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560016000818180549050039150816104e9919061053f565b5060006104f4610507565b11151561050057600080fd5b5050505050565b60008080549050905090565b81548183558181151161053a57818360005260206000209182019101610539919061056b565b5b505050565b81548183558181151161056657818360005260206000209182019101610565919061056b565b5b505050565b61058d91905b80821115610589576000816000905550600101610571565b5090565b905600a165627a7a72305820bd9936918d8c622d938afbc93fd7e98c6c2dcb2ab8fa5b4ec934388de7c8a4120029",
"deployedBytecode": "0x606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063513856c81461006757806384e79842146100ca57806397a6278e14610103578063dc7926461461013c575b600080fd5b341561007257600080fd5b6100886004808035906020019091905050610165565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100d557600080fd5b610101600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506101a4565b005b341561010e57600080fd5b61013a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506102b1565b005b341561014757600080fd5b61014f610507565b6040518082815260200191505060405180910390f35b60008181548110151561017457fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600090505b60008054905081101561023d576000818154811015156101c857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610230576001915061023d565b80806001019150506101ac565b81151561024957600080fd5b6000805480600101828161025d9190610513565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b600080600080600090505b60008054905081101561034d576000818154811015156102d857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610340576001915061034d565b80806001019150506102bc565b81151561035957600080fd5b60009350600092505b60008054905083101561048c57831561040c5760008381548110151561038457fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000600185038154811015156103c257fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff1660008481548110151561043257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561047f57600193505b8280600101935050610362565b60006001600080549050038154811015156104a357fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560016000818180549050039150816104e9919061053f565b5060006104f4610507565b11151561050057600080fd5b5050505050565b60008080549050905090565b81548183558181151161053a57818360005260206000209182019101610539919061056b565b5b505050565b81548183558181151161056657818360005260206000209182019101610565919061056b565b5b505050565b61058d91905b80821115610589576000816000905550600101610571565b5090565b905600a165627a7a72305820bd9936918d8c622d938afbc93fd7e98c6c2dcb2ab8fa5b4ec934388de7c8a4120029",
"sourceMap": "85:860:1:-;;;349:63;;;;;;;;384:6;:23;;;;;;;;;;;:::i;:::-;;;;;;;;;;396:10;384:23;;;;;;;;;;;;;;;;;;;;;;;85:860;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;",
"deployedSourceMap": "85:860:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;109:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;416:75;;;;;;;;;;;;;;;;;;;;;;;;;;;;495:358;;;;;;;;;;;;;;;;;;;;;;;;;;;;857:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;109:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;416:75::-;162:11;183:6;192:1;183:10;;179:129;199:6;:13;;;;195:1;:17;179:129;;;244:6;251:1;244:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;230:23;;:10;:23;;;227:75;;;274:4;265:13;;288:5;;227:75;214:3;;;;;;;179:129;;;317:6;316:7;313:20;;;325:8;;;313:20;469:6;:17;;;;;;;;;;;:::i;:::-;;;;;;;;;;481:4;469:17;;;;;;;;;;;;;;;;;;;;;;;416:75;;;:::o;495:358::-;551:14;583:6;162:11;183:6;192:1;183:10;;179:129;199:6;:13;;;;195:1;:17;179:129;;;244:6;251:1;244:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;230:23;;:10;:23;;;227:75;;;274:4;265:13;;288:5;;227:75;214:3;;;;;;;179:129;;;317:6;316:7;313:20;;;325:8;;;313:20;568:5;551:22;;592:1;583:10;;579:176;599:6;:13;;;;595:1;:17;579:176;;;630:9;627:58;;;667:6;674:1;667:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;651:6;662:1;658;:5;651:13;;;;;;;;;;;;;;;;;;;:25;;;;;;;;;;;;;;;;;;627:58;708:4;695:17;;:6;702:1;695:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;:17;;;692:57;;;736:4;724:16;;692:57;614:3;;;;;;;579:176;;;767:6;788:1;774:6;:13;;;;:15;767:23;;;;;;;;;;;;;;;;;;;760:31;;;;;;;;;;;814:1;797:6;:18;;;;;;;;;;;;;;:::i;:::-;;846:1;829:14;:12;:14::i;:::-;:18;821:27;;;;;;;;495:358;;;;;:::o;857:86::-;906:4;925:6;:13;;;;918:20;;857:86;:::o;85:860::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o",
"source": "pragma solidity ^0.4.15;\n\n//Represents a set of agents who represent themself as one\ncontract AgentGroup {\n address[] public agents;\n\n modifier isOwner() {\n bool enable;\n for(uint i = 0; i < agents.length; i++) {\n if(msg.sender == agents[i]) {\n enable = true;\n break;\n }\n }\n if(!enable) revert();\n _;\n }\n\n function AgentGroup() public {\n agents.push(msg.sender);\n }\n\n function addAgent(address addr) public isOwner {\n agents.push(addr);\n }\n\n function removeAgent(address addr) public isOwner {\n bool overwrite = false;\n for(uint i = 0; i < agents.length; i++) {\n if(overwrite) {\n agents[i - 1] = agents[i];\n }\n if(agents[i] == addr) {\n overwrite = true;\n }\n }\n delete(agents[agents.length-1]);\n agents.length -= 1;\n require(getNumAgents() > 0);\n }\n\n function getNumAgents() public constant returns (uint) {\n return agents.length;\n }\n}\n",
"sourcePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/AgentGroup.sol",
"ast": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/AgentGroup.sol",
"exportedSymbols": {
"AgentGroup": [
490
]
},
"id": 491,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 342,
"literals": [
"solidity",
"^",
"0.4",
".15"
],
"nodeType": "PragmaDirective",
"src": "0:24:1"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 490,
"linearizedBaseContracts": [
490
],
"name": "AgentGroup",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 345,
"name": "agents",
"nodeType": "VariableDeclaration",
"scope": 490,
"src": "109:23:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 343,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "109:7:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 344,
"length": null,
"nodeType": "ArrayTypeName",
"src": "109:9:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 383,
"nodeType": "Block",
"src": "156:189:1",
"statements": [
{
"assignments": [],
"declarations": [
{
"constant": false,
"id": 348,
"name": "enable",
"nodeType": "VariableDeclaration",
"scope": 384,
"src": "162:11:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 347,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "162:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 349,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "162:11:1"
},
{
"body": {
"id": 374,
"nodeType": "Block",
"src": "219:89:1",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 366,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 361,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "230:3:1",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 362,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "230:10:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 363,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "244:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 365,
"indexExpression": {
"argumentTypes": null,
"id": 364,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 351,
"src": "251:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "244:9:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "230:23:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 373,
"nodeType": "IfStatement",
"src": "227:75:1",
"trueBody": {
"id": 372,
"nodeType": "Block",
"src": "255:47:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 369,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 367,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 348,
"src": "265:6:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 368,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "274:4:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "265:13:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 370,
"nodeType": "ExpressionStatement",
"src": "265:13:1"
},
{
"id": 371,
"nodeType": "Break",
"src": "288:5:1"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 357,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 354,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 351,
"src": "195:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 355,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "199:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 356,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "199:13:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "195:17:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 375,
"initializationExpression": {
"assignments": [
351
],
"declarations": [
{
"constant": false,
"id": 351,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 384,
"src": "183:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 350,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "183:4:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 353,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 352,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "192:1:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "183:10:1"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 359,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "214:3:1",
"subExpression": {
"argumentTypes": null,
"id": 358,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 351,
"src": "214:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 360,
"nodeType": "ExpressionStatement",
"src": "214:3:1"
},
"nodeType": "ForStatement",
"src": "179:129:1"
},
{
"condition": {
"argumentTypes": null,
"id": 377,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "316:7:1",
"subExpression": {
"argumentTypes": null,
"id": 376,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 348,
"src": "317:6:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 381,
"nodeType": "IfStatement",
"src": "313:20:1",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 378,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2203,
"src": "325:6:1",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 379,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "325:8:1",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 380,
"nodeType": "ExpressionStatement",
"src": "325:8:1"
}
},
{
"id": 382,
"nodeType": "PlaceholderStatement",
"src": "339:1:1"
}
]
},
"id": 384,
"name": "isOwner",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 346,
"nodeType": "ParameterList",
"parameters": [],
"src": "153:2:1"
},
"src": "137:208:1",
"visibility": "internal"
},
{
"body": {
"id": 394,
"nodeType": "Block",
"src": "378:34:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 390,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "396:3:1",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 391,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "396:10:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 387,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "384:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 389,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "384:11:1",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 392,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "384:23:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 393,
"nodeType": "ExpressionStatement",
"src": "384:23:1"
}
]
},
"id": 395,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "AgentGroup",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 385,
"nodeType": "ParameterList",
"parameters": [],
"src": "368:2:1"
},
"payable": false,
"returnParameters": {
"id": 386,
"nodeType": "ParameterList",
"parameters": [],
"src": "378:0:1"
},
"scope": 490,
"src": "349:63:1",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 408,
"nodeType": "Block",
"src": "463:28:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 405,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 397,
"src": "481:4:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 402,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "469:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 404,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "469:11:1",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 406,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "469:17:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 407,
"nodeType": "ExpressionStatement",
"src": "469:17:1"
}
]
},
"id": 409,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 400,
"modifierName": {
"argumentTypes": null,
"id": 399,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 384,
"src": "455:7:1",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "455:7:1"
}
],
"name": "addAgent",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 398,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 397,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 409,
"src": "434:12:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 396,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "434:7:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "433:14:1"
},
"payable": false,
"returnParameters": {
"id": 401,
"nodeType": "ParameterList",
"parameters": [],
"src": "463:0:1"
},
"scope": 490,
"src": "416:75:1",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 479,
"nodeType": "Block",
"src": "545:308:1",
"statements": [
{
"assignments": [
417
],
"declarations": [
{
"constant": false,
"id": 417,
"name": "overwrite",
"nodeType": "VariableDeclaration",
"scope": 480,
"src": "551:14:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 416,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "551:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 419,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 418,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "568:5:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "551:22:1"
},
{
"body": {
"id": 455,
"nodeType": "Block",
"src": "619:136:1",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 431,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 417,
"src": "630:9:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 443,
"nodeType": "IfStatement",
"src": "627:58:1",
"trueBody": {
"id": 442,
"nodeType": "Block",
"src": "641:44:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 440,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 432,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "651:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 436,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 435,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 433,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 421,
"src": "658:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 434,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "662:1:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "658:5:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "651:13:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 437,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "667:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 439,
"indexExpression": {
"argumentTypes": null,
"id": 438,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 421,
"src": "674:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "667:9:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "651:25:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 441,
"nodeType": "ExpressionStatement",
"src": "651:25:1"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 448,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 444,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "695:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 446,
"indexExpression": {
"argumentTypes": null,
"id": 445,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 421,
"src": "702:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "695:9:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 447,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 411,
"src": "708:4:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "695:17:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 454,
"nodeType": "IfStatement",
"src": "692:57:1",
"trueBody": {
"id": 453,
"nodeType": "Block",
"src": "714:35:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 451,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 449,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 417,
"src": "724:9:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 450,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "736:4:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "724:16:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 452,
"nodeType": "ExpressionStatement",
"src": "724:16:1"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 427,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 424,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 421,
"src": "595:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 425,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "599:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 426,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "599:13:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "595:17:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 456,
"initializationExpression": {
"assignments": [
421
],
"declarations": [
{
"constant": false,
"id": 421,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 480,
"src": "583:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 420,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "583:4:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 423,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 422,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "592:1:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "583:10:1"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 429,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "614:3:1",
"subExpression": {
"argumentTypes": null,
"id": 428,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 421,
"src": "614:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 430,
"nodeType": "ExpressionStatement",
"src": "614:3:1"
},
"nodeType": "ForStatement",
"src": "579:176:1"
},
{
"expression": {
"argumentTypes": null,
"id": 464,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "760:31:1",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 457,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "767:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 462,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 461,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 458,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "774:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 459,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "774:13:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 460,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "788:1:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "774:15:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "767:23:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 463,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "766:25:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 465,
"nodeType": "ExpressionStatement",
"src": "760:31:1"
},
{
"expression": {
"argumentTypes": null,
"id": 470,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 466,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "797:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 468,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "797:13:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 469,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "814:1:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "797:18:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 471,
"nodeType": "ExpressionStatement",
"src": "797:18:1"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 476,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 473,
"name": "getNumAgents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 489,
"src": "829:12:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 474,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "829:14:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 475,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "846:1:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "829:18:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 472,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2202,
"src": "821:7:1",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 477,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "821:27:1",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 478,
"nodeType": "ExpressionStatement",
"src": "821:27:1"
}
]
},
"id": 480,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 414,
"modifierName": {
"argumentTypes": null,
"id": 413,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 384,
"src": "537:7:1",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "537:7:1"
}
],
"name": "removeAgent",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 412,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 411,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 480,
"src": "516:12:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 410,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "516:7:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "515:14:1"
},
"payable": false,
"returnParameters": {
"id": 415,
"nodeType": "ParameterList",
"parameters": [],
"src": "545:0:1"
},
"scope": 490,
"src": "495:358:1",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 488,
"nodeType": "Block",
"src": "912:31:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 485,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "925:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 486,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "925:13:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 484,
"id": 487,
"nodeType": "Return",
"src": "918:20:1"
}
]
},
"id": 489,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumAgents",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 481,
"nodeType": "ParameterList",
"parameters": [],
"src": "878:2:1"
},
"payable": false,
"returnParameters": {
"id": 484,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 483,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 489,
"src": "906:4:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 482,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "906:4:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "905:6:1"
},
"scope": 490,
"src": "857:86:1",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 491,
"src": "85:860:1"
}
],
"src": "0:946:1"
},
"legacyAST": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/AgentGroup.sol",
"exportedSymbols": {
"AgentGroup": [
490
]
},
"id": 491,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 342,
"literals": [
"solidity",
"^",
"0.4",
".15"
],
"nodeType": "PragmaDirective",
"src": "0:24:1"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 490,
"linearizedBaseContracts": [
490
],
"name": "AgentGroup",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 345,
"name": "agents",
"nodeType": "VariableDeclaration",
"scope": 490,
"src": "109:23:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 343,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "109:7:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 344,
"length": null,
"nodeType": "ArrayTypeName",
"src": "109:9:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 383,
"nodeType": "Block",
"src": "156:189:1",
"statements": [
{
"assignments": [],
"declarations": [
{
"constant": false,
"id": 348,
"name": "enable",
"nodeType": "VariableDeclaration",
"scope": 384,
"src": "162:11:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 347,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "162:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 349,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "162:11:1"
},
{
"body": {
"id": 374,
"nodeType": "Block",
"src": "219:89:1",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 366,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 361,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "230:3:1",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 362,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "230:10:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 363,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "244:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 365,
"indexExpression": {
"argumentTypes": null,
"id": 364,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 351,
"src": "251:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "244:9:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "230:23:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 373,
"nodeType": "IfStatement",
"src": "227:75:1",
"trueBody": {
"id": 372,
"nodeType": "Block",
"src": "255:47:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 369,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 367,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 348,
"src": "265:6:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 368,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "274:4:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "265:13:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 370,
"nodeType": "ExpressionStatement",
"src": "265:13:1"
},
{
"id": 371,
"nodeType": "Break",
"src": "288:5:1"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 357,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 354,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 351,
"src": "195:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 355,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "199:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 356,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "199:13:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "195:17:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 375,
"initializationExpression": {
"assignments": [
351
],
"declarations": [
{
"constant": false,
"id": 351,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 384,
"src": "183:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 350,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "183:4:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 353,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 352,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "192:1:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "183:10:1"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 359,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "214:3:1",
"subExpression": {
"argumentTypes": null,
"id": 358,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 351,
"src": "214:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 360,
"nodeType": "ExpressionStatement",
"src": "214:3:1"
},
"nodeType": "ForStatement",
"src": "179:129:1"
},
{
"condition": {
"argumentTypes": null,
"id": 377,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "316:7:1",
"subExpression": {
"argumentTypes": null,
"id": 376,
"name": "enable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 348,
"src": "317:6:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 381,
"nodeType": "IfStatement",
"src": "313:20:1",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 378,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2203,
"src": "325:6:1",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 379,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "325:8:1",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 380,
"nodeType": "ExpressionStatement",
"src": "325:8:1"
}
},
{
"id": 382,
"nodeType": "PlaceholderStatement",
"src": "339:1:1"
}
]
},
"id": 384,
"name": "isOwner",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 346,
"nodeType": "ParameterList",
"parameters": [],
"src": "153:2:1"
},
"src": "137:208:1",
"visibility": "internal"
},
{
"body": {
"id": 394,
"nodeType": "Block",
"src": "378:34:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 390,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "396:3:1",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 391,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "396:10:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 387,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "384:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 389,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "384:11:1",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 392,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "384:23:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 393,
"nodeType": "ExpressionStatement",
"src": "384:23:1"
}
]
},
"id": 395,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "AgentGroup",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 385,
"nodeType": "ParameterList",
"parameters": [],
"src": "368:2:1"
},
"payable": false,
"returnParameters": {
"id": 386,
"nodeType": "ParameterList",
"parameters": [],
"src": "378:0:1"
},
"scope": 490,
"src": "349:63:1",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 408,
"nodeType": "Block",
"src": "463:28:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 405,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 397,
"src": "481:4:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 402,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "469:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 404,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "469:11:1",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 406,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "469:17:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 407,
"nodeType": "ExpressionStatement",
"src": "469:17:1"
}
]
},
"id": 409,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 400,
"modifierName": {
"argumentTypes": null,
"id": 399,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 384,
"src": "455:7:1",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "455:7:1"
}
],
"name": "addAgent",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 398,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 397,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 409,
"src": "434:12:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 396,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "434:7:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "433:14:1"
},
"payable": false,
"returnParameters": {
"id": 401,
"nodeType": "ParameterList",
"parameters": [],
"src": "463:0:1"
},
"scope": 490,
"src": "416:75:1",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 479,
"nodeType": "Block",
"src": "545:308:1",
"statements": [
{
"assignments": [
417
],
"declarations": [
{
"constant": false,
"id": 417,
"name": "overwrite",
"nodeType": "VariableDeclaration",
"scope": 480,
"src": "551:14:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 416,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "551:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 419,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 418,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "568:5:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "551:22:1"
},
{
"body": {
"id": 455,
"nodeType": "Block",
"src": "619:136:1",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 431,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 417,
"src": "630:9:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 443,
"nodeType": "IfStatement",
"src": "627:58:1",
"trueBody": {
"id": 442,
"nodeType": "Block",
"src": "641:44:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 440,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 432,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "651:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 436,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 435,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 433,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 421,
"src": "658:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 434,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "662:1:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "658:5:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "651:13:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 437,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "667:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 439,
"indexExpression": {
"argumentTypes": null,
"id": 438,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 421,
"src": "674:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "667:9:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "651:25:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 441,
"nodeType": "ExpressionStatement",
"src": "651:25:1"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 448,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 444,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "695:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 446,
"indexExpression": {
"argumentTypes": null,
"id": 445,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 421,
"src": "702:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "695:9:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 447,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 411,
"src": "708:4:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "695:17:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 454,
"nodeType": "IfStatement",
"src": "692:57:1",
"trueBody": {
"id": 453,
"nodeType": "Block",
"src": "714:35:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 451,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 449,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 417,
"src": "724:9:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 450,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "736:4:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "724:16:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 452,
"nodeType": "ExpressionStatement",
"src": "724:16:1"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 427,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 424,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 421,
"src": "595:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 425,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "599:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 426,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "599:13:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "595:17:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 456,
"initializationExpression": {
"assignments": [
421
],
"declarations": [
{
"constant": false,
"id": 421,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 480,
"src": "583:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 420,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "583:4:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 423,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 422,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "592:1:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "583:10:1"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 429,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "614:3:1",
"subExpression": {
"argumentTypes": null,
"id": 428,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 421,
"src": "614:1:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 430,
"nodeType": "ExpressionStatement",
"src": "614:3:1"
},
"nodeType": "ForStatement",
"src": "579:176:1"
},
{
"expression": {
"argumentTypes": null,
"id": 464,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "760:31:1",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 457,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "767:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 462,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 461,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 458,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "774:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 459,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "774:13:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 460,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "788:1:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "774:15:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "767:23:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 463,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "766:25:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 465,
"nodeType": "ExpressionStatement",
"src": "760:31:1"
},
{
"expression": {
"argumentTypes": null,
"id": 470,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 466,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "797:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 468,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "797:13:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 469,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "814:1:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "797:18:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 471,
"nodeType": "ExpressionStatement",
"src": "797:18:1"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 476,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 473,
"name": "getNumAgents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 489,
"src": "829:12:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 474,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "829:14:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 475,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "846:1:1",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "829:18:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 472,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2202,
"src": "821:7:1",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 477,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "821:27:1",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 478,
"nodeType": "ExpressionStatement",
"src": "821:27:1"
}
]
},
"id": 480,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 414,
"modifierName": {
"argumentTypes": null,
"id": 413,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 384,
"src": "537:7:1",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "537:7:1"
}
],
"name": "removeAgent",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 412,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 411,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 480,
"src": "516:12:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 410,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "516:7:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "515:14:1"
},
"payable": false,
"returnParameters": {
"id": 415,
"nodeType": "ParameterList",
"parameters": [],
"src": "545:0:1"
},
"scope": 490,
"src": "495:358:1",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 488,
"nodeType": "Block",
"src": "912:31:1",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 485,
"name": "agents",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "925:6:1",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 486,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "925:13:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 484,
"id": 487,
"nodeType": "Return",
"src": "918:20:1"
}
]
},
"id": 489,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumAgents",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 481,
"nodeType": "ParameterList",
"parameters": [],
"src": "878:2:1"
},
"payable": false,
"returnParameters": {
"id": 484,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 483,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 489,
"src": "906:4:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 482,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "906:4:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "905:6:1"
},
"scope": 490,
"src": "857:86:1",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 491,
"src": "85:860:1"
}
],
"src": "0:946:1"
},
"compiler": {
"name": "solc",
"version": "0.4.19+commit.c4cbbb05.Emscripten.clang"
},
"networks": {},
"schemaVersion": "2.0.0",
"updatedAt": "2018-06-05T05:32:07.934Z"
}
================================================
FILE: SmartContracts/build/contracts/AgentRegistry.json
================================================
{
"contractName": "AgentRegistry",
"abi": [
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "isProspective",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "isKicked",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "isSigner",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "agentFromContract",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "name",
"type": "string"
},
{
"name": "contractAddr",
"type": "address"
},
{
"name": "host",
"type": "string"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "addr",
"type": "address"
}
],
"name": "AddSigner",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "addr",
"type": "address"
}
],
"name": "RemoveSigner",
"type": "event"
},
{
"constant": false,
"inputs": [
{
"name": "name",
"type": "string"
}
],
"name": "setAgentName",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "contractAddr",
"type": "address"
}
],
"name": "setAgentContractAddr",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "host",
"type": "string"
}
],
"name": "setAgentHost",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "name",
"type": "string"
}
],
"name": "propose",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "rip",
"type": "address"
}
],
"name": "kick",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "prospective",
"type": "address"
}
],
"name": "rescind",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "prospective",
"type": "address"
},
{
"name": "value",
"type": "bool"
}
],
"name": "vote",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "name",
"type": "string"
}
],
"name": "getAgentByName",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getAgentName",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getAgentContractAddr",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getAgentHost",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getNumSigners",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "idx",
"type": "uint256"
}
],
"name": "getSigner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "prospective",
"type": "address"
}
],
"name": "getNumVoters",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "prospective",
"type": "address"
},
{
"name": "idx",
"type": "uint256"
}
],
"name": "getVoter",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "prospective",
"type": "address"
},
{
"name": "signer",
"type": "address"
}
],
"name": "getVoteInfo",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "prospective",
"type": "address"
}
],
"name": "getNumYayVotes",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getNumProspectives",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "idx",
"type": "uint256"
}
],
"name": "getProspective",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getNumKicked",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "idx",
"type": "uint256"
}
],
"name": "getKicked",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "prospective",
"type": "address"
}
],
"name": "getProposer",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x606060405234156200001057600080fd5b604051620030f9380380620030f9833981016040528080518201919060200180519060200190919080518201919050506003805480600101828162000056919062000328565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506060604051908101604052808481526020018373ffffffffffffffffffffffffffffffffffffffff168152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000190805190602001906200013392919062000357565b5060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020190805190602001906200019992919062000357565b50905050336001846040518082805190602001908083835b602083101515620001d85780518252602082019150602081019050602083039250620001b1565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050505062000406565b8154818355818115116200035257818360005260206000209182019101620003519190620003de565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200039a57805160ff1916838001178555620003cb565b82800160010185558215620003cb579182015b82811115620003ca578251825591602001919060010190620003ad565b5b509050620003da9190620003de565b5090565b6200040391905b80821115620003ff576000816000905550600101620003e5565b5090565b90565b612ce380620004166000396000f300606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806309475e49146101595780630c99e4581461020b5780631758d62b1461025c5780633ffefe4e146102b95780634e2bd9ce1461031c57806351a3d71a1461035557806352dca174146103b8578063563abf65146103e15780635e9196141461040a578063644c3668146104435780636a9cea53146104b35780636e5e865f146105165780637c8160a51461058f5780637df73e27146105e05780637ffe3a6514610631578063851a974c1461067e57806396c55175146106f7578063aa98df3914610730578063b0034f0f1461078d578063bd041c4d1461082a578063c60623921461086e578063cbd69b4614610920578063d453f9e51461096d578063d4dc4a4b146109ef578063d947a1c814610a68578063f889af0514610a91575b600080fd5b341561016457600080fd5b610190600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610aee565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101d05780820151818401526020810190506101b5565b50505050905090810190601f1680156101fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021657600080fd5b610242600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bd7565b604051808215151515815260200191505060405180910390f35b341561026757600080fd5b6102b7600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610bf7565b005b34156102c457600080fd5b6102da6004808035906020019091905050610e18565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561032757600080fd5b610353600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e5c565b005b341561036057600080fd5b6103766004808035906020019091905050610f01565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103c357600080fd5b6103cb610f45565b6040518082815260200191505060405180910390f35b34156103ec57600080fd5b6103f4610f52565b6040518082815260200191505060405180910390f35b341561041557600080fd5b610441600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f5f565b005b341561044e57600080fd5b610499600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611060565b604051808215151515815260200191505060405180910390f35b34156104be57600080fd5b6104d460048080359060200190919050506110f4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561052157600080fd5b61054d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611138565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561059a57600080fd5b6105c6600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111a3565b604051808215151515815260200191505060405180910390f35b34156105eb57600080fd5b610617600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111c3565b604051808215151515815260200191505060405180910390f35b341561063c57600080fd5b610668600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111e3565b6040518082815260200191505060405180910390f35b341561068957600080fd5b6106b5600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061122f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561070257600080fd5b61072e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611298565b005b341561073b57600080fd5b61078b600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506114fc565b005b341561079857600080fd5b6107e8600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611806565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561083557600080fd5b61086c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035151590602001909190505061189b565b005b341561087957600080fd5b6108a5600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506121ca565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108e55780820151818401526020810190506108ca565b50505050905090810190601f1680156109125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561092b57600080fd5b610957600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506122b3565b6040518082815260200191505060405180910390f35b341561097857600080fd5b6109ad600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506122fc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109fa57600080fd5b610a26600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061237e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610a7357600080fd5b610a7b6123b1565b6040518082815260200191505060405180910390f35b3415610a9c57600080fd5b610aec600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506123be565b005b610af6612b85565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bcb5780601f10610ba057610100808354040283529160200191610bcb565b820191906000526020600020905b815481529060010190602001808311610bae57829003601f168201915b50505050509050919050565b600b6020528060005260406000206000915054906101000a900460ff1681565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c4f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166001826040518082805190602001908083835b602083101515610c9f5780518252602082019150602081019050602083039250610c7a565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610d1557600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000019080519060200190610d6a929190612b99565b50336001826040518082805190602001908083835b602083101515610da45780518252602082019150602081019050602083039250610d7f565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600382815481101515610e2957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610ef557600080fd5b610efe81612417565b50565b6000600a82815481101515610f1257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600a80549050905090565b6000600380549050905090565b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600060098281548110151561110557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600c6020528060005260406000206000915054906101000a900460ff1681565b60046020528060005260406000206000915054906101000a900460ff1681565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156112f057600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561134857600080fd5b600c60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156113a157600080fd5b60026003805490501115156113b557600080fd5b600a80548060010182816113c99190612c19565b9160005260206000209001600083909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555033600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506114f981600161189b565b50565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561155557600080fd5b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156115ae57600080fd5b600980548060010182816115c29190612c19565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555033600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff166001826040518082805190602001908083835b6020831015156117375780518252602082019150602081019050602083039250611712565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156117ad57600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000019080519060200190611802929190612b99565b5050565b60006001826040518082805190602001908083835b602083101515611840578051825260208201915060208101905060208303925061181b565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156118f657600080fd5b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806119975750600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156119a257600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611a36575082155b15611a8a576001600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b1e5750825b15611b72576001600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611d3757600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806001018281611ce79190612c19565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b6001600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550821515611dd8576121c4565b6002600160038054905001811515611dec57fe5b04600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611e38576121c4565b600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156120bb5760009150600090505b600a80549050811015611fbd578115611f3d57600381815481101515611eb557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360018303815481101515611ef357fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8373ffffffffffffffffffffffffffffffffffffffff16600382815481101515611f6357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611fb057600191505b8080600101915050611e93565b6003600160038054905003815481101515611fd457fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600160038181805490500391508161201a9190612c45565b506000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f1803740ef72fc16e647c10fe2d31cf61a1578081960c2e3fb7f5aa957e82f55060405160405180910390a26121ba565b600380548060010182816120cf9190612c19565b9160005260206000209001600086909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f637c77a2d598a51d085d4a2413332c45a235a25ee855bf3dfcdc2c8fcf02860f60405160405180910390a25b6121c384612417565b5b50505050565b6121d2612b85565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156122a75780601f1061227c576101008083540402835291602001916122a7565b820191906000526020600020905b81548152906001019060200180831161228a57829003601f168201915b50505050509050919050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561234a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600980549050905090565b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002019080519060200190612413929190612b99565b5050565b600080600091505b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905082101561267c57600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811015156124f657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811015156125f957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055818060010192505061241f565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006126c79190612c71565b600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000905560009050600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156129a357600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055600091505b6009805490508210156129405780156128c05760098281548110151561283857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660096001840381548110151561287657fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8273ffffffffffffffffffffffffffffffffffffffff166009838154811015156128e657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561293357600190505b8180600101925050612816565b600960016009805490500381548110151561295757fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600160098181805490500391508161299d9190612c45565b50612b80565b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055600091505b600a80549050821015612b21578015612aa157600a82815481101515612a1957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a60018403815481101515612a5757fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8273ffffffffffffffffffffffffffffffffffffffff16600a83815481101515612ac757fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612b1457600190505b81806001019250506129f7565b600a6001600a8054905003815481101515612b3857fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600a81818054905003915081612b7e9190612c45565b505b505050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612bda57805160ff1916838001178555612c08565b82800160010185558215612c08579182015b82811115612c07578251825591602001919060010190612bec565b5b509050612c159190612c92565b5090565b815481835581811511612c4057818360005260206000209182019101612c3f9190612c92565b5b505050565b815481835581811511612c6c57818360005260206000209182019101612c6b9190612c92565b5b505050565b5080546000825590600052602060002090810190612c8f9190612c92565b50565b612cb491905b80821115612cb0576000816000905550600101612c98565b5090565b905600a165627a7a7230582072d5768e199dd99a54859e584a62bcd4a7cb513733d7c589010fb03ace3eb4880029",
"deployedBytecode": "0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806309475e49146101595780630c99e4581461020b5780631758d62b1461025c5780633ffefe4e146102b95780634e2bd9ce1461031c57806351a3d71a1461035557806352dca174146103b8578063563abf65146103e15780635e9196141461040a578063644c3668146104435780636a9cea53146104b35780636e5e865f146105165780637c8160a51461058f5780637df73e27146105e05780637ffe3a6514610631578063851a974c1461067e57806396c55175146106f7578063aa98df3914610730578063b0034f0f1461078d578063bd041c4d1461082a578063c60623921461086e578063cbd69b4614610920578063d453f9e51461096d578063d4dc4a4b146109ef578063d947a1c814610a68578063f889af0514610a91575b600080fd5b341561016457600080fd5b610190600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610aee565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101d05780820151818401526020810190506101b5565b50505050905090810190601f1680156101fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021657600080fd5b610242600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bd7565b604051808215151515815260200191505060405180910390f35b341561026757600080fd5b6102b7600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610bf7565b005b34156102c457600080fd5b6102da6004808035906020019091905050610e18565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561032757600080fd5b610353600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e5c565b005b341561036057600080fd5b6103766004808035906020019091905050610f01565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103c357600080fd5b6103cb610f45565b6040518082815260200191505060405180910390f35b34156103ec57600080fd5b6103f4610f52565b6040518082815260200191505060405180910390f35b341561041557600080fd5b610441600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f5f565b005b341561044e57600080fd5b610499600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611060565b604051808215151515815260200191505060405180910390f35b34156104be57600080fd5b6104d460048080359060200190919050506110f4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561052157600080fd5b61054d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611138565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561059a57600080fd5b6105c6600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111a3565b604051808215151515815260200191505060405180910390f35b34156105eb57600080fd5b610617600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111c3565b604051808215151515815260200191505060405180910390f35b341561063c57600080fd5b610668600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111e3565b6040518082815260200191505060405180910390f35b341561068957600080fd5b6106b5600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061122f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561070257600080fd5b61072e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611298565b005b341561073b57600080fd5b61078b600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506114fc565b005b341561079857600080fd5b6107e8600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611806565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561083557600080fd5b61086c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035151590602001909190505061189b565b005b341561087957600080fd5b6108a5600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506121ca565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108e55780820151818401526020810190506108ca565b50505050905090810190601f1680156109125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561092b57600080fd5b610957600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506122b3565b6040518082815260200191505060405180910390f35b341561097857600080fd5b6109ad600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506122fc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109fa57600080fd5b610a26600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061237e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610a7357600080fd5b610a7b6123b1565b6040518082815260200191505060405180910390f35b3415610a9c57600080fd5b610aec600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506123be565b005b610af6612b85565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bcb5780601f10610ba057610100808354040283529160200191610bcb565b820191906000526020600020905b815481529060010190602001808311610bae57829003601f168201915b50505050509050919050565b600b6020528060005260406000206000915054906101000a900460ff1681565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c4f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166001826040518082805190602001908083835b602083101515610c9f5780518252602082019150602081019050602083039250610c7a565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610d1557600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000019080519060200190610d6a929190612b99565b50336001826040518082805190602001908083835b602083101515610da45780518252602082019150602081019050602083039250610d7f565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600382815481101515610e2957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610ef557600080fd5b610efe81612417565b50565b6000600a82815481101515610f1257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600a80549050905090565b6000600380549050905090565b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600060098281548110151561110557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600c6020528060005260406000206000915054906101000a900460ff1681565b60046020528060005260406000206000915054906101000a900460ff1681565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156112f057600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561134857600080fd5b600c60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156113a157600080fd5b60026003805490501115156113b557600080fd5b600a80548060010182816113c99190612c19565b9160005260206000209001600083909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555033600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506114f981600161189b565b50565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561155557600080fd5b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156115ae57600080fd5b600980548060010182816115c29190612c19565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555033600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff166001826040518082805190602001908083835b6020831015156117375780518252602082019150602081019050602083039250611712565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156117ad57600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000019080519060200190611802929190612b99565b5050565b60006001826040518082805190602001908083835b602083101515611840578051825260208201915060208101905060208303925061181b565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156118f657600080fd5b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806119975750600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156119a257600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611a36575082155b15611a8a576001600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b1e5750825b15611b72576001600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611d3757600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806001018281611ce79190612c19565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b6001600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550821515611dd8576121c4565b6002600160038054905001811515611dec57fe5b04600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611e38576121c4565b600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156120bb5760009150600090505b600a80549050811015611fbd578115611f3d57600381815481101515611eb557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360018303815481101515611ef357fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8373ffffffffffffffffffffffffffffffffffffffff16600382815481101515611f6357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611fb057600191505b8080600101915050611e93565b6003600160038054905003815481101515611fd457fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600160038181805490500391508161201a9190612c45565b506000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f1803740ef72fc16e647c10fe2d31cf61a1578081960c2e3fb7f5aa957e82f55060405160405180910390a26121ba565b600380548060010182816120cf9190612c19565b9160005260206000209001600086909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f637c77a2d598a51d085d4a2413332c45a235a25ee855bf3dfcdc2c8fcf02860f60405160405180910390a25b6121c384612417565b5b50505050565b6121d2612b85565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156122a75780601f1061227c576101008083540402835291602001916122a7565b820191906000526020600020905b81548152906001019060200180831161228a57829003601f168201915b50505050509050919050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561234a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600980549050905090565b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002019080519060200190612413929190612b99565b5050565b600080600091505b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905082101561267c57600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811015156124f657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811015156125f957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055818060010192505061241f565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006126c79190612c71565b600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000905560009050600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156129a357600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055600091505b6009805490508210156129405780156128c05760098281548110151561283857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660096001840381548110151561287657fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8273ffffffffffffffffffffffffffffffffffffffff166009838154811015156128e657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561293357600190505b8180600101925050612816565b600960016009805490500381548110151561295757fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600160098181805490500391508161299d9190612c45565b50612b80565b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055600091505b600a80549050821015612b21578015612aa157600a82815481101515612a1957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a60018403815481101515612a5757fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8273ffffffffffffffffffffffffffffffffffffffff16600a83815481101515612ac757fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612b1457600190505b81806001019250506129f7565b600a6001600a8054905003815481101515612b3857fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600a81818054905003915081612b7e9190612c45565b505b505050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612bda57805160ff1916838001178555612c08565b82800160010185558215612c08579182015b82811115612c07578251825591602001919060010190612bec565b5b509050612c159190612c92565b5090565b815481835581811511612c4057818360005260206000209182019101612c3f9190612c92565b5b505050565b815481835581811511612c6c57818360005260206000209182019101612c6b9190612c92565b5b505050565b5080546000825590600052602060002090810190612c8f9190612c92565b50565b612cb491905b80821115612cb0576000816000905550600101612c98565b5090565b905600a165627a7a7230582072d5768e199dd99a54859e584a62bcd4a7cb513733d7c589010fb03ace3eb4880029",
"sourceMap": "37:7306:2:-;;;1158:293;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1242:7;:24;;;;;;;;;;;:::i;:::-;;;;;;;;;;1255:10;1242:24;;;;;;;;;;;;;;;;;;;;;;;1296:31;;;;;;;;;1302:4;1296:31;;;;1308:12;1296:31;;;;;;1322:4;1296:31;;;1272:9;:21;1282:10;1272:21;;;;;;;;;;;;;;;:55;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;1353:10;1333:11;1345:4;1333:17;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:2;51:6;36:153;;;182:3;176:5;171:3;164:6;98:2;93:3;89;82:19;;123:2;118:3;114;107:19;;148:2;143:3;139;132:19;;36:153;;;274:1;267:3;263:2;259:3;254;250;246;315:4;311:3;305;299:5;295:3;356:4;350:3;344:5;340:3;389:7;380;377:2;372:3;365:6;3:399;;;;;;;;;;;;;;;;;;;;;;;;;1333:30:2;;;;;;;;;;;;;;;;;;1403:10;1369:17;:31;1387:12;1369:31;;;;;;;;;;;;;;;;:44;;;;;;;;;;;;;;;;;;1442:4;1419:8;:20;1428:10;1419:20;;;;;;;;;;;;;;;;:27;;;;;;;;;;;;;;;;;;1158:293;;;37:7306;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;",
"deployedSourceMap": "37:7306:2:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6021:107;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;814:46:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1516:241;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6224:93;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2925:130;;;;;;;;;;;;;;;;;;;;;;;;;;;;7130:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7040:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6132:88;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1761:173;;;;;;;;;;;;;;;;;;;;;;;;;;;;6572:136;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6933:103;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5893:124;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;864:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;335:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6321:118;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7226:115;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2546:312;;;;;;;;;;;;;;;;;;;;;;;;;;;;2140:368;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5672:106;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4208:1460;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5782:107;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6712:115:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6443:125;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;226:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6831:98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1938:88;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6021:107;6082:6;;:::i;:::-;6103:9;:15;6113:4;6103:15;;;;;;;;;;;;;;;:20;;6096:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6021:107;;;:::o;814:46::-;;;;;;;;;;;;;;;;;;;;;;:::o;1516:241::-;1121:8;:20;1130:10;1121:20;;;;;;;;;;;;;;;;;;;;;;;;;1113:29;;;;;;;;1669:1;1640:31;;:11;1652:4;1640:17;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:2;51:6;36:153;;;182:3;176:5;171:3;164:6;98:2;93:3;89;82:19;;123:2;118:3;114;107:19;;148:2;143:3;139;132:19;;36:153;;;274:1;267:3;263:2;259:3;254;250;246;315:4;311:3;305;299:5;295:3;356:4;350:3;344:5;340:3;389:7;380;377:2;372:3;365:6;3:399;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1640:31:2;;;1632:40;;;;;;;;1710:4;1681:9;:21;1691:10;1681:21;;;;;;;;;;;;;;;:26;;:33;;;;;;;;;;;;:::i;:::-;;1742:10;1722:11;1734:4;1722:17;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:2;51:6;36:153;;;182:3;176:5;171:3;164:6;98:2;93:3;89;82:19;;123:2;118:3;114;107:19;;148:2;143:3;139;132:19;;36:153;;;274:1;267:3;263:2;259:3;254;250;246;315:4;311:3;305;299:5;295:3;356:4;350:3;344:5;340:3;389:7;380;377:2;372:3;365:6;3:399;;;;;;;;;;;;;;;;;;;;;;;;;1722:30:2;;;;;;;;;;;;;;;;;;1516:241;:::o;6224:93::-;6278:7;6300;6308:3;6300:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;6293:19;;6224:93;;;:::o;2925:130::-;3010:10;2985:35;;:8;:21;2994:11;2985:21;;;;;;;;;;;;;;;;;;;;;;;;;:35;;;2977:44;;;;;;;;3027:23;3038:11;3027:10;:23::i;:::-;2925:130;:::o;7130:92::-;7184:7;7206:6;7213:3;7206:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;7199:18;;7130:92;;;:::o;7040:86::-;7089:4;7108:6;:13;;;;7101:20;;7040:86;:::o;6132:88::-;6182:4;6201:7;:14;;;;6194:21;;6132:88;:::o;1761:173::-;1865:12;1828:9;:21;1838:10;1828:21;;;;;;;;;;;;;;;:34;;;:49;;;;;;;;;;;;;;;;;;1919:10;1885:17;:31;1903:12;1885:31;;;;;;;;;;;;;;;;:44;;;;;;;;;;;;;;;;;;1761:173;:::o;6572:136::-;6655:4;6674:8;:21;6683:11;6674:21;;;;;;;;;;;;;;;:29;6696:6;6674:29;;;;;;;;;;;;;;;;;;;;;;;;;6667:36;;6572:136;;;;:::o;6933:103::-;6992:7;7014:12;7027:3;7014:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;7007:24;;6933:103;;;:::o;5893:124::-;5962:7;5984:9;:15;5994:4;5984:15;;;;;;;;;;;;;;;:28;;;;;;;;;;;;5977:35;;5893:124;;;:::o;864:41::-;;;;;;;;;;;;;;;;;;;;;;:::o;335:40::-;;;;;;;;;;;;;;;;;;;;;;:::o;6321:118::-;6389:4;6408:6;:19;6415:11;6408:19;;;;;;;;;;;;;;;:26;;;;6401:33;;6321:118;;;:::o;7226:115::-;7293:7;7315:8;:21;7324:11;7315:21;;;;;;;;;;;;;;;;;;;;;;;;;7308:28;;7226:115;;;:::o;2546:312::-;1121:8;:20;1130:10;1121:20;;;;;;;;;;;;;;;;;;;;;;;;;1113:29;;;;;;;;2607:8;:20;2616:10;2607:20;;;;;;;;;;;;;;;;;;;;;;;;;2599:29;;;;;;;;2643:8;:13;2652:3;2643:13;;;;;;;;;;;;;;;;;;;;;;;;;2642:14;2634:23;;;;;;;;2749:1;2732:7;:14;;;;:18;2724:27;;;;;;;;2758:6;:16;;;;;;;;;;;:::i;:::-;;;;;;;;;;2770:3;2758:16;;;;;;;;;;;;;;;;;;;;;;;2796:4;2780:8;:13;2789:3;2780:13;;;;;;;;;;;;;;;;:20;;;;;;;;;;;;;;;;;;2822:10;2806:8;:13;2815:3;2806:13;;;;;;;;;;;;;;;;:26;;;;;;;;;;;;;;;;;;2838:15;2843:3;2848:4;2838;:15::i;:::-;2546:312;:::o;2140:368::-;2192:8;:20;2201:10;2192:20;;;;;;;;;;;;;;;;;;;;;;;;;2191:21;2183:30;;;;;;;;2228:13;:25;2242:10;2228:25;;;;;;;;;;;;;;;;;;;;;;;;;2227:26;2219:35;;;;;;;;2261:12;:29;;;;;;;;;;;:::i;:::-;;;;;;;;;;2279:10;2261:29;;;;;;;;;;;;;;;;;;;;;;;2324:4;2296:13;:25;2310:10;2296:25;;;;;;;;;;;;;;;;:32;;;;;;;;;;;;;;;;;;2357:10;2334:8;:20;2343:10;2334:20;;;;;;;;;;;;;;;;:33;;;;;;;;;;;;;;;;;;2461:1;2432:31;;:11;2444:4;2432:17;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:2;51:6;36:153;;;182:3;176:5;171:3;164:6;98:2;93:3;89;82:19;;123:2;118:3;114;107:19;;148:2;143:3;139;132:19;;36:153;;;274:1;267:3;263:2;259:3;254;250;246;315:4;311:3;305;299:5;295:3;356:4;350:3;344:5;340:3;389:7;380;377:2;372:3;365:6;3:399;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2432:31:2;;;2424:40;;;;;;;;2499:4;2470:9;:21;2480:10;2470:21;;;;;;;;;;;;;;;:26;;:33;;;;;;;;;;;;:::i;:::-;;2140:368;:::o;5672:106::-;5734:7;5756:11;5768:4;5756:17;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:2;51:6;36:153;;;182:3;176:5;171:3;164:6;98:2;93:3;89;82:19;;123:2;118:3;114;107:19;;148:2;143:3;139;132:19;;36:153;;;274:1;267:3;263:2;259:3;254;250;246;315:4;311:3;305;299:5;295:3;356:4;350:3;344:5;340:3;389:7;380;377:2;372:3;365:6;3:399;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5749:24:2;;5672:106;;;:::o;4208:1460::-;5148:14;5182:6;1121:8;:20;1130:10;1121:20;;;;;;;;;;;;;;;;;;;;;;;;;1113:29;;;;;;;;4290:13;:26;4304:11;4290:26;;;;;;;;;;;;;;;;;;;;;;;;;:51;;;;4320:8;:21;4329:11;4320:21;;;;;;;;;;;;;;;;;;;;;;;;;4290:51;4282:60;;;;;;;;4428:8;:21;4437:11;4428:21;;;;;;;;;;;;;;;:33;4450:10;4428:33;;;;;;;;;;;;;;;;;;;;;;;;;:43;;;;;4466:5;4465:6;4428:43;4425:89;;;4506:1;4481:8;:21;4490:11;4481:21;;;;;;;;;;;;;;;;:26;;;;;;;;;;;4425:89;4590:8;:21;4599:11;4590:21;;;;;;;;;;;;;;;:33;4612:10;4590:33;;;;;;;;;;;;;;;;;;;;;;;;;4589:34;:43;;;;;4627:5;4589:43;4586:89;;;4667:1;4642:8;:21;4651:11;4642:21;;;;;;;;;;;;;;;;:26;;;;;;;;;;;4586:89;4716:5;4680:8;:21;4689:11;4680:21;;;;;;;;;;;;;;;:33;4702:10;4680:33;;;;;;;;;;;;;;;;:41;;;;;;;;;;;;;;;;;;4731:8;:21;4740:11;4731:21;;;;;;;;;;;;;;;:33;4753:10;4731:33;;;;;;;;;;;;;;;;;;;;;;;;;4730:34;4727:90;;;4774:6;:19;4781:11;4774:19;;;;;;;;;;;;;;;:36;;;;;;;;;;;:::i;:::-;;;;;;;;;;4799:10;4774:36;;;;;;;;;;;;;;;;;;;;;;;4727:90;4858:4;4822:8;:21;4831:11;4822:21;;;;;;;;;;;;;;;:33;4844:10;4822:33;;;;;;;;;;;;;;;;:40;;;;;;;;;;;;;;;;;;4963:5;4962:6;4959:18;;;4970:7;;4959:18;5098:1;5095;5080:7;:14;;;;:16;5079:20;;;;;;;;5055:8;:21;5064:11;5055:21;;;;;;;;;;;;;;;;:44;5052:56;;;5101:7;;5052:56;5117:8;:21;5126:11;5117:21;;;;;;;;;;;;;;;;;;;;;;;;;5114:520;;;5165:5;5148:22;;5191:1;5182:10;;5178:200;5198:6;:13;;;;5194:1;:17;5178:200;;;5231:9;5228:64;;;5271:7;5279:1;5271:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;5254:7;5266:1;5262;:5;5254:14;;;;;;;;;;;;;;;;;;;:27;;;;;;;;;;;;;;;;;;5228:64;5318:11;5304:25;;:7;5312:1;5304:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;:25;;;5301:69;;;5355:4;5343:16;;5301:69;5213:3;;;;;;;5178:200;;;5392:7;5415:1;5400:7;:14;;;;:16;5392:25;;;;;;;;;;;;;;;;;;;5385:33;;;;;;;;;;;5444:1;5426:7;:19;;;;;;;;;;;;;;:::i;:::-;;5477:5;5453:8;:21;5462:11;5453:21;;;;;;;;;;;;;;;;:29;;;;;;;;;;;;;;;;;;5503:11;5490:25;;;;;;;;;;;;5114:520;;;5536:7;:25;;;;;;;;;;;:::i;:::-;;;;;;;;;;5549:11;5536:25;;;;;;;;;;;;;;;;;;;;;;;5593:4;5569:8;:21;5578:11;5569:21;;;;;;;;;;;;;;;;:28;;;;;;;;;;;;;;;;;;5615:11;5605:22;;;;;;;;;;;;5114:520;5640:23;5651:11;5640:10;:23::i;:::-;1148:1;4208:1460;;;;:::o;5782:107::-;5843:6;;:::i;:::-;5864:9;:15;5874:4;5864:15;;;;;;;;;;;;;;;:20;;5857:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5782:107;;;:::o;6712:115::-;6782:4;6801:8;:21;6810:11;6801:21;;;;;;;;;;;;;;;;6794:28;;6712:115;;;:::o;6443:125::-;6517:7;6539:6;:19;6546:11;6539:19;;;;;;;;;;;;;;;6559:3;6539:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;6532:31;;6443:125;;;;:::o;226:52::-;;;;;;;;;;;;;;;;;;;;;;:::o;6831:98::-;6886:4;6905:12;:19;;;;6898:26;;6831:98;:::o;1938:88::-;2017:4;1988:9;:21;1998:10;1988:21;;;;;;;;;;;;;;;:26;;:33;;;;;;;;;;;;:::i;:::-;;1938:88;:::o;3059:1079::-;3115:6;3408:14;3135:1;3131:5;;3127:175;3142:6;:19;3149:11;3142:19;;;;;;;;;;;;;;;:26;;;;3138:1;:30;3127:175;;;3190:8;:21;3199:11;3190:21;;;;;;;;;;;;;;;:45;3212:6;:19;3219:11;3212:19;;;;;;;;;;;;;;;3232:1;3212:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;3190:45;;;;;;;;;;;;;;;;3183:52;;;;;;;;;;;3250:8;:21;3259:11;3250:21;;;;;;;;;;;;;;;:45;3272:6;:19;3279:11;3272:19;;;;;;;;;;;;;;;3292:1;3272:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;3250:45;;;;;;;;;;;;;;;;3243:52;;;;;;;;;;;3170:3;;;;;;;3127:175;;;3314:6;:19;3321:11;3314:19;;;;;;;;;;;;;;;;3307:26;;;;:::i;:::-;3346:8;:21;3355:11;3346:21;;;;;;;;;;;;;;;;3339:28;;;;;;;;;;;3380:8;:21;3389:11;3380:21;;;;;;;;;;;;;;;3373:28;;;3425:5;3408:22;;3439:13;:26;3453:11;3439:26;;;;;;;;;;;;;;;;;;;;;;;;;3436:698;;;3482:13;:26;3496:11;3482:26;;;;;;;;;;;;;;;;3475:33;;;;;;;;;;;3524:1;3520:5;;3516:216;3531:12;:19;;;;3527:1;:23;3516:216;;;3570:9;3567:74;;;3615:12;3628:1;3615:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;3593:12;3610:1;3606;:5;3593:19;;;;;;;;;;;;;;;;;;;:37;;;;;;;;;;;;;;;;;;3567:74;3672:11;3653:30;;:12;3666:1;3653:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;:30;;;3650:74;;;3709:4;3697:16;;3650:74;3552:3;;;;;;;3516:216;;;3746:12;3779:1;3759:12;:19;;;;:21;3746:35;;;;;;;;;;;;;;;;;;;3739:43;;;;;;;;;;;3813:1;3790:12;:24;;;;;;;;;;;;;;:::i;:::-;;3436:698;;;3842:8;:21;3851:11;3842:21;;;;;;;;;;;;;;;;3835:28;;;;;;;;;;;3879:1;3875:5;;3871:192;3886:6;:13;;;;3882:1;:17;3871:192;;;3919:9;3916:62;;;3958:6;3965:1;3958:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;3942:6;3953:1;3949;:5;3942:13;;;;;;;;;;;;;;;;;;;:25;;;;;;;;;;;;;;;;;;3916:62;4003:11;3990:24;;:6;3997:1;3990:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;:24;;;3987:68;;;4040:4;4028:16;;3987:68;3901:3;;;;;;;3871:192;;;4077:6;4098:1;4084:6;:13;;;;:15;4077:23;;;;;;;;;;;;;;;;;;;4070:31;;;;;;;;;;;4126:1;4109:6;:18;;;;;;;;;;;;;;:::i;:::-;;3436:698;3059:1079;;;:::o;37:7306::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o",
"source": "pragma solidity ^0.4.15;\n\n//Contains\ncontract AgentRegistry {\n struct Agent {\n string name;\n address contractAddr;\n string host;\n }\n mapping(address => Agent) agentInfo;\n mapping(string => address) agentByName;\n mapping(address => address) public agentFromContract;\n\n //the current set of signers\n address[] signers;\n mapping(address => bool) public isSigner;\n //keeps track of votes per signer and the yay count\n mapping( address => address[]) voters;\n mapping( address => mapping(address => bool)) hasVoted;\n mapping( address => mapping(address => bool)) voteInfo;\n mapping( address => uint) yayVotes;\n //prospectives is a list of all prospective waiting to be voted\n address[] prospectives;\n //kicked is a list of all signers on the chopping block to be voted out\n address[] kicked;\n mapping(address => bool) public isProspective;\n mapping(address => bool) public isKicked;\n //keeps track of who's idea each proposal was\n mapping(address => address) proposer;\n\n event AddSigner(address indexed addr);\n event RemoveSigner(address indexed addr);\n\n modifier onlySigners() {\n require(isSigner[msg.sender]);\n _;\n }\n\n function AgentRegistry(string name, address contractAddr, string host) public {\n signers.push(msg.sender);\n agentInfo[msg.sender] = Agent(name, contractAddr, host);\n agentByName[name] = msg.sender;\n agentFromContract[contractAddr] = msg.sender;\n isSigner[msg.sender] = true;\n }\n\n // to prevent fraud only signers are allowed to set a name\n function setAgentName(string name) onlySigners() public {\n //throw if the proposed name is already taken\n require(agentByName[name] == address(0));\n\n agentInfo[msg.sender].name = name;\n agentByName[name] = msg.sender;\n }\n\n function setAgentContractAddr(address contractAddr) public {\n agentInfo[msg.sender].contractAddr = contractAddr;\n agentFromContract[contractAddr] = msg.sender;\n }\n\n function setAgentHost(string host) public {\n agentInfo[msg.sender].host = host;\n }\n\n //the caller proposes to add themself to the set of signers\n //the name is used to identify the new signer\n function propose(string name) public {\n require(!isSigner[msg.sender]);\n require(!isProspective[msg.sender]);\n\n prospectives.push(msg.sender);\n isProspective[msg.sender] = true;\n proposer[msg.sender] = msg.sender;\n\n //throw if the proposed name is already taken\n require(agentByName[name] == address(0));\n agentInfo[msg.sender].name = name;\n }\n\n //propose a signer to be kicked\n function kick (address rip) public onlySigners {\n require(isSigner[msg.sender]);\n require(!isKicked[rip]);\n //the blockchain cannot survive with less than 2 signers\n require(signers.length > 2);\n\n kicked.push(rip);\n isKicked[rip] = true;\n proposer[rip] = msg.sender;\n vote(rip, true);\n }\n\n //the caller recinds their proposal, deleting all cast votes\n function rescind (address prospective) public {\n require(proposer[prospective] == msg.sender);\n clearVotes(prospective);\n }\n\n function clearVotes(address prospective) internal {\n uint i;\n for(i = 0; i < voters[prospective].length; i++) {\n delete voteInfo[prospective][voters[prospective][i]];\n delete hasVoted[prospective][voters[prospective][i]];\n }\n delete voters[prospective];\n delete proposer[prospective];\n delete yayVotes[prospective];\n\n bool overwrite = false;\n if(isProspective[prospective]) {\n delete isProspective[prospective];\n for(i = 0; i < prospectives.length; i++) {\n if(overwrite) {\n prospectives[i - 1] = prospectives[i];\n }\n if(prospectives[i] == prospective) {\n overwrite = true;\n }\n }\n delete(prospectives[prospectives.length-1]);\n prospectives.length -= 1;\n } else {\n delete isKicked[prospective];\n for(i = 0; i < kicked.length; i++) {\n if(overwrite) {\n kicked[i - 1] = kicked[i];\n }\n if(kicked[i] == prospective) {\n overwrite = true;\n }\n }\n delete(kicked[kicked.length-1]);\n kicked.length -= 1;\n }\n }\n\n //an existing singer can vote or revote on an existing proposal\n function vote(address prospective, bool value) public onlySigners() {\n require(isProspective[prospective] || isKicked[prospective]);\n\n //if the signer voted yes before and votes no now remove their old vote\n if(voteInfo[prospective][msg.sender] && !value) {\n yayVotes[prospective] -= 1;\n }\n //if the signer is voting yes and hadn't before add a yay vote\n if(!voteInfo[prospective][msg.sender] && value) {\n yayVotes[prospective] += 1;\n }\n voteInfo[prospective][msg.sender] = value;\n if(!hasVoted[prospective][msg.sender]) {\n voters[prospective].push(msg.sender);\n }\n hasVoted[prospective][msg.sender] = true;\n\n //if this was a no vote it won't trigger anything and no further processing is needed\n if(!value) return;\n //if there aren't enought votes for a majority nothing more to do\n if(yayVotes[prospective] < (signers.length+1)/2) return;\n\n if(isKicked[prospective]) {\n bool overwrite = false;\n for(uint i = 0; i < kicked.length; i++) {\n if(overwrite) {\n signers[i - 1] = signers[i];\n }\n if(signers[i] == prospective) {\n overwrite = true;\n }\n }\n delete(signers[signers.length-1]);\n signers.length -= 1;\n isSigner[prospective] = false;\n RemoveSigner(prospective);\n } else {\n signers.push(prospective);\n isSigner[prospective] = true;\n AddSigner(prospective);\n }\n\n clearVotes(prospective);\n }\n\n function getAgentByName(string name) public constant returns (address) {\n return agentByName[name];\n }\n\n function getAgentName(address addr) public constant returns (string) {\n return agentInfo[addr].name;\n }\n\n function getAgentContractAddr(address addr) public constant returns (address) {\n return agentInfo[addr].contractAddr;\n }\n\n function getAgentHost(address addr) public constant returns (string) {\n return agentInfo[addr].host;\n }\n\n function getNumSigners() public constant returns (uint) {\n return signers.length;\n }\n\n function getSigner(uint idx) public constant returns (address) {\n return signers[idx];\n }\n\n function getNumVoters(address prospective) public constant returns (uint) {\n return voters[prospective].length;\n }\n\n function getVoter(address prospective, uint idx) public constant returns (address) {\n return voters[prospective][idx];\n }\n\n function getVoteInfo(address prospective, address signer) public constant returns (bool) {\n return voteInfo[prospective][signer];\n }\n\n function getNumYayVotes(address prospective) public constant returns (uint) {\n return yayVotes[prospective];\n }\n\n function getNumProspectives() public constant returns (uint) {\n return prospectives.length;\n }\n\n function getProspective(uint idx) public constant returns (address) {\n return prospectives[idx];\n }\n\n function getNumKicked() public constant returns (uint) {\n return kicked.length;\n }\n\n function getKicked(uint idx) public constant returns (address) {\n return kicked[idx];\n }\n\n function getProposer(address prospective) public constant returns (address) {\n return proposer[prospective];\n }\n}\n",
"sourcePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/AgentRegistry.sol",
"ast": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/AgentRegistry.sol",
"exportedSymbols": {
"AgentRegistry": [
1394
]
},
"id": 1395,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 492,
"literals": [
"solidity",
"^",
"0.4",
".15"
],
"nodeType": "PragmaDirective",
"src": "0:24:2"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 1394,
"linearizedBaseContracts": [
1394
],
"name": "AgentRegistry",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "AgentRegistry.Agent",
"id": 499,
"members": [
{
"constant": false,
"id": 494,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 499,
"src": "83:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
},
"typeName": {
"id": 493,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "83:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 496,
"name": "contractAddr",
"nodeType": "VariableDeclaration",
"scope": 499,
"src": "100:20:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 495,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "100:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 498,
"name": "host",
"nodeType": "VariableDeclaration",
"scope": 499,
"src": "126:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
},
"typeName": {
"id": 497,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "126:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Agent",
"nodeType": "StructDefinition",
"scope": 1394,
"src": "64:78:2",
"visibility": "public"
},
{
"constant": false,
"id": 503,
"name": "agentInfo",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "145:35:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
},
"typeName": {
"id": 502,
"keyType": {
"id": 500,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "153:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "145:25:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
},
"valueType": {
"contractScope": null,
"id": 501,
"name": "Agent",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 499,
"src": "164:5:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage_ptr",
"typeString": "struct AgentRegistry.Agent storage pointer"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 507,
"name": "agentByName",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "184:38:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
},
"typeName": {
"id": 506,
"keyType": {
"id": 504,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "192:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"nodeType": "Mapping",
"src": "184:26:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
},
"valueType": {
"id": 505,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "202:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 511,
"name": "agentFromContract",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "226:52:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
},
"typeName": {
"id": 510,
"keyType": {
"id": 508,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "234:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "226:27:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
},
"valueType": {
"id": 509,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "245:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 514,
"name": "signers",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "314:17:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 512,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "314:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 513,
"length": null,
"nodeType": "ArrayTypeName",
"src": "314:9:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 518,
"name": "isSigner",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "335:40:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 517,
"keyType": {
"id": 515,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "343:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "335:24:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 516,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "354:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 523,
"name": "voters",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "433:37:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
},
"typeName": {
"id": 522,
"keyType": {
"id": 519,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "442:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "433:30:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
},
"valueType": {
"baseType": {
"id": 520,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "453:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 521,
"length": null,
"nodeType": "ArrayTypeName",
"src": "453:9:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 529,
"name": "hasVoted",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "474:54:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
},
"typeName": {
"id": 528,
"keyType": {
"id": 524,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "483:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "474:45:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
},
"valueType": {
"id": 527,
"keyType": {
"id": 525,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "502:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "494:24:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 526,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "513:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 535,
"name": "voteInfo",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "532:54:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
},
"typeName": {
"id": 534,
"keyType": {
"id": 530,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "541:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "532:45:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
},
"valueType": {
"id": 533,
"keyType": {
"id": 531,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "560:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "552:24:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 532,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "571:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 539,
"name": "yayVotes",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "590:34:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"typeName": {
"id": 538,
"keyType": {
"id": 536,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "599:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "590:25:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"valueType": {
"id": 537,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "610:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 542,
"name": "prospectives",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "694:22:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 540,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "694:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 541,
"length": null,
"nodeType": "ArrayTypeName",
"src": "694:9:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 545,
"name": "kicked",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "794:16:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 543,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "794:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 544,
"length": null,
"nodeType": "ArrayTypeName",
"src": "794:9:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 549,
"name": "isProspective",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "814:46:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 548,
"keyType": {
"id": 546,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "822:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "814:24:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 547,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "833:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 553,
"name": "isKicked",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "864:41:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 552,
"keyType": {
"id": 550,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "872:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "864:24:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 551,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "883:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 557,
"name": "proposer",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "957:36:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
},
"typeName": {
"id": 556,
"keyType": {
"id": 554,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "965:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "957:27:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
},
"valueType": {
"id": 555,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "976:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
"value": null,
"visibility": "internal"
},
{
"anonymous": false,
"id": 561,
"name": "AddSigner",
"nodeType": "EventDefinition",
"parameters": {
"id": 560,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 559,
"indexed": true,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 561,
"src": "1014:20:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 558,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1014:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1013:22:2"
},
"src": "998:38:2"
},
{
"anonymous": false,
"id": 565,
"name": "RemoveSigner",
"nodeType": "EventDefinition",
"parameters": {
"id": 564,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 563,
"indexed": true,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 565,
"src": "1058:20:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 562,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1058:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1057:22:2"
},
"src": "1039:41:2"
},
{
"body": {
"id": 575,
"nodeType": "Block",
"src": "1107:47:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 568,
"name": "isSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 518,
"src": "1121:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 571,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 569,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1130:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 570,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1130:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1121:20:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 567,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "1113:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 572,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1113:29:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 573,
"nodeType": "ExpressionStatement",
"src": "1113:29:2"
},
{
"id": 574,
"nodeType": "PlaceholderStatement",
"src": "1148:1:2"
}
]
},
"id": 576,
"name": "onlySigners",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 566,
"nodeType": "ParameterList",
"parameters": [],
"src": "1104:2:2"
},
"src": "1084:70:2",
"visibility": "internal"
},
{
"body": {
"id": 624,
"nodeType": "Block",
"src": "1236:215:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 588,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1255:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 589,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1255:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 585,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "1242:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 587,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1242:12:2",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 590,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1242:24:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 591,
"nodeType": "ExpressionStatement",
"src": "1242:24:2"
},
{
"expression": {
"argumentTypes": null,
"id": 601,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 592,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "1272:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 595,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 593,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1282:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 594,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1282:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1272:21:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 597,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 578,
"src": "1302:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 598,
"name": "contractAddr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 580,
"src": "1308:12:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 599,
"name": "host",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 582,
"src": "1322:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 596,
"name": "Agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 499,
"src": "1296:5:2",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Agent_$499_storage_ptr_$",
"typeString": "type(struct AgentRegistry.Agent storage pointer)"
}
},
"id": 600,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1296:31:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_memory",
"typeString": "struct AgentRegistry.Agent memory"
}
},
"src": "1272:55:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 602,
"nodeType": "ExpressionStatement",
"src": "1272:55:2"
},
{
"expression": {
"argumentTypes": null,
"id": 608,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 603,
"name": "agentByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 507,
"src": "1333:11:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 605,
"indexExpression": {
"argumentTypes": null,
"id": 604,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 578,
"src": "1345:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1333:17:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 606,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1353:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 607,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1353:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1333:30:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 609,
"nodeType": "ExpressionStatement",
"src": "1333:30:2"
},
{
"expression": {
"argumentTypes": null,
"id": 615,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 610,
"name": "agentFromContract",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 511,
"src": "1369:17:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 612,
"indexExpression": {
"argumentTypes": null,
"id": 611,
"name": "contractAddr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 580,
"src": "1387:12:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1369:31:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 613,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1403:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 614,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1403:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1369:44:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 616,
"nodeType": "ExpressionStatement",
"src": "1369:44:2"
},
{
"expression": {
"argumentTypes": null,
"id": 622,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 617,
"name": "isSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 518,
"src": "1419:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 620,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 618,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1428:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 619,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1428:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1419:20:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 621,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1442:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "1419:27:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 623,
"nodeType": "ExpressionStatement",
"src": "1419:27:2"
}
]
},
"id": 625,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "AgentRegistry",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 583,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 578,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 625,
"src": "1181:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 577,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1181:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 580,
"name": "contractAddr",
"nodeType": "VariableDeclaration",
"scope": 625,
"src": "1194:20:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 579,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1194:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 582,
"name": "host",
"nodeType": "VariableDeclaration",
"scope": 625,
"src": "1216:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 581,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1216:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1180:48:2"
},
"payable": false,
"returnParameters": {
"id": 584,
"nodeType": "ParameterList",
"parameters": [],
"src": "1236:0:2"
},
"scope": 1394,
"src": "1158:293:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 657,
"nodeType": "Block",
"src": "1572:185:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 639,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 633,
"name": "agentByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 507,
"src": "1640:11:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 635,
"indexExpression": {
"argumentTypes": null,
"id": 634,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 627,
"src": "1652:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1640:17:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 637,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1669:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 636,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1661:7:2",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 638,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1661:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1640:31:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 632,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "1632:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 640,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1632:40:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 641,
"nodeType": "ExpressionStatement",
"src": "1632:40:2"
},
{
"expression": {
"argumentTypes": null,
"id": 648,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 642,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "1681:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 645,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 643,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1691:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 644,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1691:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1681:21:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 646,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "name",
"nodeType": "MemberAccess",
"referencedDeclaration": 494,
"src": "1681:26:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 647,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 627,
"src": "1710:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "1681:33:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 649,
"nodeType": "ExpressionStatement",
"src": "1681:33:2"
},
{
"expression": {
"argumentTypes": null,
"id": 655,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 650,
"name": "agentByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 507,
"src": "1722:11:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 652,
"indexExpression": {
"argumentTypes": null,
"id": 651,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 627,
"src": "1734:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1722:17:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 653,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1742:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 654,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1742:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1722:30:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 656,
"nodeType": "ExpressionStatement",
"src": "1722:30:2"
}
]
},
"id": 658,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 630,
"modifierName": {
"argumentTypes": null,
"id": 629,
"name": "onlySigners",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 576,
"src": "1551:11:2",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1551:13:2"
}
],
"name": "setAgentName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 628,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 627,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 658,
"src": "1538:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 626,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1538:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1537:13:2"
},
"payable": false,
"returnParameters": {
"id": 631,
"nodeType": "ParameterList",
"parameters": [],
"src": "1572:0:2"
},
"scope": 1394,
"src": "1516:241:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 678,
"nodeType": "Block",
"src": "1820:114:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 669,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 663,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "1828:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 666,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 664,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1838:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 665,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1838:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1828:21:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 667,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "contractAddr",
"nodeType": "MemberAccess",
"referencedDeclaration": 496,
"src": "1828:34:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 668,
"name": "contractAddr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 660,
"src": "1865:12:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1828:49:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 670,
"nodeType": "ExpressionStatement",
"src": "1828:49:2"
},
{
"expression": {
"argumentTypes": null,
"id": 676,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 671,
"name": "agentFromContract",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 511,
"src": "1885:17:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 673,
"indexExpression": {
"argumentTypes": null,
"id": 672,
"name": "contractAddr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 660,
"src": "1903:12:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1885:31:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 674,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1919:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 675,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1919:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1885:44:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 677,
"nodeType": "ExpressionStatement",
"src": "1885:44:2"
}
]
},
"id": 679,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "setAgentContractAddr",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 661,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 660,
"name": "contractAddr",
"nodeType": "VariableDeclaration",
"scope": 679,
"src": "1791:20:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 659,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1791:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1790:22:2"
},
"payable": false,
"returnParameters": {
"id": 662,
"nodeType": "ParameterList",
"parameters": [],
"src": "1820:0:2"
},
"scope": 1394,
"src": "1761:173:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 692,
"nodeType": "Block",
"src": "1980:46:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 690,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 684,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "1988:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 687,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 685,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1998:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 686,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1998:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1988:21:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 688,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "host",
"nodeType": "MemberAccess",
"referencedDeclaration": 498,
"src": "1988:26:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 689,
"name": "host",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 681,
"src": "2017:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "1988:33:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 691,
"nodeType": "ExpressionStatement",
"src": "1988:33:2"
}
]
},
"id": 693,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "setAgentHost",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 682,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 681,
"name": "host",
"nodeType": "VariableDeclaration",
"scope": 693,
"src": "1960:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 680,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1960:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1959:13:2"
},
"payable": false,
"returnParameters": {
"id": 683,
"nodeType": "ParameterList",
"parameters": [],
"src": "1980:0:2"
},
"scope": 1394,
"src": "1938:88:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 754,
"nodeType": "Block",
"src": "2177:331:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 703,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "2191:21:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 699,
"name": "isSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 518,
"src": "2192:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 702,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 700,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2201:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 701,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2201:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2192:20:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 698,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2183:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 704,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2183:30:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 705,
"nodeType": "ExpressionStatement",
"src": "2183:30:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 711,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "2227:26:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 707,
"name": "isProspective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 549,
"src": "2228:13:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 710,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 708,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2242:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 709,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2242:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2228:25:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 706,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2219:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 712,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2219:35:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 713,
"nodeType": "ExpressionStatement",
"src": "2219:35:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 717,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2279:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 718,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2279:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 714,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "2261:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 716,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2261:17:2",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 719,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2261:29:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 720,
"nodeType": "ExpressionStatement",
"src": "2261:29:2"
},
{
"expression": {
"argumentTypes": null,
"id": 726,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 721,
"name": "isProspective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 549,
"src": "2296:13:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 724,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 722,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2310:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 723,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2310:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2296:25:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 725,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2324:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "2296:32:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 727,
"nodeType": "ExpressionStatement",
"src": "2296:32:2"
},
{
"expression": {
"argumentTypes": null,
"id": 734,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 728,
"name": "proposer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 557,
"src": "2334:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 731,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 729,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2343:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 730,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2343:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2334:20:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 732,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2357:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 733,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2357:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2334:33:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 735,
"nodeType": "ExpressionStatement",
"src": "2334:33:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 743,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 737,
"name": "agentByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 507,
"src": "2432:11:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 739,
"indexExpression": {
"argumentTypes": null,
"id": 738,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 695,
"src": "2444:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2432:17:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 741,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2461:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 740,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2453:7:2",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 742,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2453:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2432:31:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 736,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2424:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 744,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2424:40:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 745,
"nodeType": "ExpressionStatement",
"src": "2424:40:2"
},
{
"expression": {
"argumentTypes": null,
"id": 752,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 746,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "2470:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 749,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 747,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2480:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 748,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2480:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2470:21:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 750,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "name",
"nodeType": "MemberAccess",
"referencedDeclaration": 494,
"src": "2470:26:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 751,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 695,
"src": "2499:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "2470:33:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 753,
"nodeType": "ExpressionStatement",
"src": "2470:33:2"
}
]
},
"id": 755,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "propose",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 696,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 695,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 755,
"src": "2157:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 694,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "2157:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2156:13:2"
},
"payable": false,
"returnParameters": {
"id": 697,
"nodeType": "ParameterList",
"parameters": [],
"src": "2177:0:2"
},
"scope": 1394,
"src": "2140:368:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 807,
"nodeType": "Block",
"src": "2593:265:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 763,
"name": "isSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 518,
"src": "2607:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 766,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 764,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2616:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 765,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2616:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2607:20:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 762,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2599:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 767,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2599:29:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 768,
"nodeType": "ExpressionStatement",
"src": "2599:29:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 773,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "2642:14:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 770,
"name": "isKicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 553,
"src": "2643:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 772,
"indexExpression": {
"argumentTypes": null,
"id": 771,
"name": "rip",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 757,
"src": "2652:3:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2643:13:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 769,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2634:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 774,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2634:23:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 775,
"nodeType": "ExpressionStatement",
"src": "2634:23:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 780,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 777,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "2732:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 778,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2732:14:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 779,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2749:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "2732:18:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 776,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2724:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 781,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2724:27:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 782,
"nodeType": "ExpressionStatement",
"src": "2724:27:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 786,
"name": "rip",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 757,
"src": "2770:3:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 783,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "2758:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 785,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2758:11:2",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 787,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2758:16:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 788,
"nodeType": "ExpressionStatement",
"src": "2758:16:2"
},
{
"expression": {
"argumentTypes": null,
"id": 793,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 789,
"name": "isKicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 553,
"src": "2780:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 791,
"indexExpression": {
"argumentTypes": null,
"id": 790,
"name": "rip",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 757,
"src": "2789:3:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2780:13:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 792,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2796:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "2780:20:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 794,
"nodeType": "ExpressionStatement",
"src": "2780:20:2"
},
{
"expression": {
"argumentTypes": null,
"id": 800,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 795,
"name": "proposer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 557,
"src": "2806:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 797,
"indexExpression": {
"argumentTypes": null,
"id": 796,
"name": "rip",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 757,
"src": "2815:3:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2806:13:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 798,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2822:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 799,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2822:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2806:26:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 801,
"nodeType": "ExpressionStatement",
"src": "2806:26:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 803,
"name": "rip",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 757,
"src": "2843:3:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"hexValue": "74727565",
"id": 804,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2848:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 802,
"name": "vote",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1210,
"src": "2838:4:2",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bool_$returns$__$",
"typeString": "function (address,bool)"
}
},
"id": 805,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2838:15:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 806,
"nodeType": "ExpressionStatement",
"src": "2838:15:2"
}
]
},
"id": 808,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 760,
"modifierName": {
"argumentTypes": null,
"id": 759,
"name": "onlySigners",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 576,
"src": "2581:11:2",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "2581:11:2"
}
],
"name": "kick",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 758,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 757,
"name": "rip",
"nodeType": "VariableDeclaration",
"scope": 808,
"src": "2561:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 756,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2561:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2560:13:2"
},
"payable": false,
"returnParameters": {
"id": 761,
"nodeType": "ParameterList",
"parameters": [],
"src": "2593:0:2"
},
"scope": 1394,
"src": "2546:312:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 826,
"nodeType": "Block",
"src": "2971:84:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 819,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 814,
"name": "proposer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 557,
"src": "2985:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 816,
"indexExpression": {
"argumentTypes": null,
"id": 815,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 810,
"src": "2994:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2985:21:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 817,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "3010:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 818,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3010:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2985:35:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 813,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2977:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 820,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2977:44:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 821,
"nodeType": "ExpressionStatement",
"src": "2977:44:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 823,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 810,
"src": "3038:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 822,
"name": "clearVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1012,
"src": "3027:10:2",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 824,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3027:23:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 825,
"nodeType": "ExpressionStatement",
"src": "3027:23:2"
}
]
},
"id": 827,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "rescind",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 811,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 810,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 827,
"src": "2943:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 809,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2943:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2942:21:2"
},
"payable": false,
"returnParameters": {
"id": 812,
"nodeType": "ParameterList",
"parameters": [],
"src": "2971:0:2"
},
"scope": 1394,
"src": "2925:130:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1011,
"nodeType": "Block",
"src": "3109:1029:2",
"statements": [
{
"assignments": [],
"declarations": [
{
"constant": false,
"id": 833,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 1012,
"src": "3115:6:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 832,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "3115:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 834,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "3115:6:2"
},
{
"body": {
"id": 870,
"nodeType": "Block",
"src": "3175:127:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 857,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3183:52:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 848,
"name": "voteInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 535,
"src": "3190:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 850,
"indexExpression": {
"argumentTypes": null,
"id": 849,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3199:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3190:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 856,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 851,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "3212:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 853,
"indexExpression": {
"argumentTypes": null,
"id": 852,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3219:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3212:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 855,
"indexExpression": {
"argumentTypes": null,
"id": 854,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3232:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3212:22:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3190:45:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 858,
"nodeType": "ExpressionStatement",
"src": "3183:52:2"
},
{
"expression": {
"argumentTypes": null,
"id": 868,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3243:52:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 859,
"name": "hasVoted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 529,
"src": "3250:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 861,
"indexExpression": {
"argumentTypes": null,
"id": 860,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3259:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3250:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 867,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 862,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "3272:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 864,
"indexExpression": {
"argumentTypes": null,
"id": 863,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3279:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3272:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 866,
"indexExpression": {
"argumentTypes": null,
"id": 865,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3292:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3272:22:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3250:45:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 869,
"nodeType": "ExpressionStatement",
"src": "3243:52:2"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 844,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 839,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3138:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 840,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "3142:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 842,
"indexExpression": {
"argumentTypes": null,
"id": 841,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3149:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3142:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 843,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3142:26:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "3138:30:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 871,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 837,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 835,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3131:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 836,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3135:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "3131:5:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 838,
"nodeType": "ExpressionStatement",
"src": "3131:5:2"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 846,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "3170:3:2",
"subExpression": {
"argumentTypes": null,
"id": 845,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3170:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 847,
"nodeType": "ExpressionStatement",
"src": "3170:3:2"
},
"nodeType": "ForStatement",
"src": "3127:175:2"
},
{
"expression": {
"argumentTypes": null,
"id": 875,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3307:26:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 872,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "3314:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 874,
"indexExpression": {
"argumentTypes": null,
"id": 873,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3321:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3314:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 876,
"nodeType": "ExpressionStatement",
"src": "3307:26:2"
},
{
"expression": {
"argumentTypes": null,
"id": 880,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3339:28:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 877,
"name": "proposer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 557,
"src": "3346:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 879,
"indexExpression": {
"argumentTypes": null,
"id": 878,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3355:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3346:21:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 881,
"nodeType": "ExpressionStatement",
"src": "3339:28:2"
},
{
"expression": {
"argumentTypes": null,
"id": 885,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3373:28:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 882,
"name": "yayVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 539,
"src": "3380:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
}
},
"id": 884,
"indexExpression": {
"argumentTypes": null,
"id": 883,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3389:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3380:21:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 886,
"nodeType": "ExpressionStatement",
"src": "3373:28:2"
},
{
"assignments": [
888
],
"declarations": [
{
"constant": false,
"id": 888,
"name": "overwrite",
"nodeType": "VariableDeclaration",
"scope": 1012,
"src": "3408:14:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 887,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "3408:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 890,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 889,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3425:5:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "3408:22:2"
},
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 891,
"name": "isProspective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 549,
"src": "3439:13:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 893,
"indexExpression": {
"argumentTypes": null,
"id": 892,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3453:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3439:26:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 1009,
"nodeType": "Block",
"src": "3827:307:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 955,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3835:28:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 952,
"name": "isKicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 553,
"src": "3842:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 954,
"indexExpression": {
"argumentTypes": null,
"id": 953,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3851:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3842:21:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 956,
"nodeType": "ExpressionStatement",
"src": "3835:28:2"
},
{
"body": {
"id": 992,
"nodeType": "Block",
"src": "3906:157:2",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 968,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 888,
"src": "3919:9:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 980,
"nodeType": "IfStatement",
"src": "3916:62:2",
"trueBody": {
"id": 979,
"nodeType": "Block",
"src": "3930:48:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 977,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 969,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "3942:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 973,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 972,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 970,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3949:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 971,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3953:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "3949:5:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3942:13:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 974,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "3958:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 976,
"indexExpression": {
"argumentTypes": null,
"id": 975,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3965:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3958:9:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "3942:25:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 978,
"nodeType": "ExpressionStatement",
"src": "3942:25:2"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 985,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 981,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "3990:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 983,
"indexExpression": {
"argumentTypes": null,
"id": 982,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3997:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3990:9:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 984,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "4003:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "3990:24:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 991,
"nodeType": "IfStatement",
"src": "3987:68:2",
"trueBody": {
"id": 990,
"nodeType": "Block",
"src": "4016:39:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 988,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 986,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 888,
"src": "4028:9:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 987,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4040:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "4028:16:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 989,
"nodeType": "ExpressionStatement",
"src": "4028:16:2"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 964,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 961,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3882:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 962,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "3886:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 963,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3886:13:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "3882:17:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 993,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 959,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 957,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3875:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 958,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3879:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "3875:5:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 960,
"nodeType": "ExpressionStatement",
"src": "3875:5:2"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 966,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "3901:3:2",
"subExpression": {
"argumentTypes": null,
"id": 965,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3901:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 967,
"nodeType": "ExpressionStatement",
"src": "3901:3:2"
},
"nodeType": "ForStatement",
"src": "3871:192:2"
},
{
"expression": {
"argumentTypes": null,
"id": 1001,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "4070:31:2",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 994,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "4077:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 999,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 998,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 995,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "4084:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 996,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4084:13:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 997,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4098:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "4084:15:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "4077:23:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 1000,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "4076:25:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1002,
"nodeType": "ExpressionStatement",
"src": "4070:31:2"
},
{
"expression": {
"argumentTypes": null,
"id": 1007,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1003,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "4109:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1005,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4109:13:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 1006,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4126:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "4109:18:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1008,
"nodeType": "ExpressionStatement",
"src": "4109:18:2"
}
]
},
"id": 1010,
"nodeType": "IfStatement",
"src": "3436:698:2",
"trueBody": {
"id": 951,
"nodeType": "Block",
"src": "3467:354:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 897,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3475:33:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 894,
"name": "isProspective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 549,
"src": "3482:13:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 896,
"indexExpression": {
"argumentTypes": null,
"id": 895,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3496:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3482:26:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 898,
"nodeType": "ExpressionStatement",
"src": "3475:33:2"
},
{
"body": {
"id": 934,
"nodeType": "Block",
"src": "3557:175:2",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 910,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 888,
"src": "3570:9:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 922,
"nodeType": "IfStatement",
"src": "3567:74:2",
"trueBody": {
"id": 921,
"nodeType": "Block",
"src": "3581:60:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 919,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 911,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3593:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 915,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 914,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 912,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3606:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 913,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3610:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "3606:5:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3593:19:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 916,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3615:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 918,
"indexExpression": {
"argumentTypes": null,
"id": 917,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3628:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3615:15:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "3593:37:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 920,
"nodeType": "ExpressionStatement",
"src": "3593:37:2"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 927,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 923,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3653:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 925,
"indexExpression": {
"argumentTypes": null,
"id": 924,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3666:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3653:15:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 926,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3672:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "3653:30:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 933,
"nodeType": "IfStatement",
"src": "3650:74:2",
"trueBody": {
"id": 932,
"nodeType": "Block",
"src": "3685:39:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 930,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 928,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 888,
"src": "3697:9:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 929,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3709:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "3697:16:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 931,
"nodeType": "ExpressionStatement",
"src": "3697:16:2"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 906,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 903,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3527:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 904,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3531:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 905,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3531:19:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "3527:23:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 935,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 901,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 899,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3520:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 900,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3524:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "3520:5:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 902,
"nodeType": "ExpressionStatement",
"src": "3520:5:2"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 908,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "3552:3:2",
"subExpression": {
"argumentTypes": null,
"id": 907,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3552:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 909,
"nodeType": "ExpressionStatement",
"src": "3552:3:2"
},
"nodeType": "ForStatement",
"src": "3516:216:2"
},
{
"expression": {
"argumentTypes": null,
"id": 943,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3739:43:2",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 936,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3746:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 941,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 940,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 937,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3759:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 938,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3759:19:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 939,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3779:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "3759:21:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3746:35:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 942,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "3745:37:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 944,
"nodeType": "ExpressionStatement",
"src": "3739:43:2"
},
{
"expression": {
"argumentTypes": null,
"id": 949,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 945,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3790:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 947,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3790:19:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 948,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3813:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "3790:24:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 950,
"nodeType": "ExpressionStatement",
"src": "3790:24:2"
}
]
}
}
]
},
"id": 1012,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "clearVotes",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 830,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 829,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1012,
"src": "3079:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 828,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3079:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3078:21:2"
},
"payable": false,
"returnParameters": {
"id": 831,
"nodeType": "ParameterList",
"parameters": [],
"src": "3109:0:2"
},
"scope": 1394,
"src": "3059:1079:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 1209,
"nodeType": "Block",
"src": "4276:1392:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1028,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1022,
"name": "isProspective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 549,
"src": "4290:13:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1024,
"indexExpression": {
"argumentTypes": null,
"id": 1023,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4304:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4290:26:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1025,
"name": "isKicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 553,
"src": "4320:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1027,
"indexExpression": {
"argumentTypes": null,
"id": 1026,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4329:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4320:21:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4290:51:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1021,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "4282:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1029,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4282:60:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1030,
"nodeType": "ExpressionStatement",
"src": "4282:60:2"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1039,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1031,
"name": "voteInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 535,
"src": "4428:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 1033,
"indexExpression": {
"argumentTypes": null,
"id": 1032,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4437:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4428:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1036,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1034,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "4450:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1035,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4450:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4428:33:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"id": 1038,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "4465:6:2",
"subExpression": {
"argumentTypes": null,
"id": 1037,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1016,
"src": "4466:5:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4428:43:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1047,
"nodeType": "IfStatement",
"src": "4425:89:2",
"trueBody": {
"id": 1046,
"nodeType": "Block",
"src": "4473:41:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1044,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1040,
"name": "yayVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 539,
"src": "4481:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
}
},
"id": 1042,
"indexExpression": {
"argumentTypes": null,
"id": 1041,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4490:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "4481:21:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 1043,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4506:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "4481:26:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1045,
"nodeType": "ExpressionStatement",
"src": "4481:26:2"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1056,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1054,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "4589:34:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1048,
"name": "voteInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 535,
"src": "4590:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 1050,
"indexExpression": {
"argumentTypes": null,
"id": 1049,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4599:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4590:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1053,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1051,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "4612:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1052,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4612:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4590:33:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"id": 1055,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1016,
"src": "4627:5:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4589:43:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1064,
"nodeType": "IfStatement",
"src": "4586:89:2",
"trueBody": {
"id": 1063,
"nodeType": "Block",
"src": "4634:41:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1061,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1057,
"name": "yayVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 539,
"src": "4642:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
}
},
"id": 1059,
"indexExpression": {
"argumentTypes": null,
"id": 1058,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4651:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "4642:21:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 1060,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4667:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "4642:26:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1062,
"nodeType": "ExpressionStatement",
"src": "4642:26:2"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"id": 1072,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1065,
"name": "voteInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 535,
"src": "4680:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 1069,
"indexExpression": {
"argumentTypes": null,
"id": 1066,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4689:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4680:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1070,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1067,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "4702:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1068,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4702:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "4680:33:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1071,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1016,
"src": "4716:5:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4680:41:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1073,
"nodeType": "ExpressionStatement",
"src": "4680:41:2"
},
{
"condition": {
"argumentTypes": null,
"id": 1080,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "4730:34:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1074,
"name": "hasVoted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 529,
"src": "4731:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 1076,
"indexExpression": {
"argumentTypes": null,
"id": 1075,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4740:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4731:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1079,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1077,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "4753:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1078,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4753:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4731:33:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1090,
"nodeType": "IfStatement",
"src": "4727:90:2",
"trueBody": {
"id": 1089,
"nodeType": "Block",
"src": "4766:51:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1085,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "4799:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1086,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4799:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1081,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "4774:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 1083,
"indexExpression": {
"argumentTypes": null,
"id": 1082,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4781:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4774:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1084,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4774:24:2",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 1087,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4774:36:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1088,
"nodeType": "ExpressionStatement",
"src": "4774:36:2"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"id": 1098,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1091,
"name": "hasVoted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 529,
"src": "4822:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 1095,
"indexExpression": {
"argumentTypes": null,
"id": 1092,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4831:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4822:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1096,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1093,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "4844:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1094,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4844:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "4822:33:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1097,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4858:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "4822:40:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1099,
"nodeType": "ExpressionStatement",
"src": "4822:40:2"
},
{
"condition": {
"argumentTypes": null,
"id": 1101,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "4962:6:2",
"subExpression": {
"argumentTypes": null,
"id": 1100,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1016,
"src": "4963:5:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1103,
"nodeType": "IfStatement",
"src": "4959:18:2",
"trueBody": {
"expression": null,
"functionReturnParameters": 1020,
"id": 1102,
"nodeType": "Return",
"src": "4970:7:2"
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1114,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1104,
"name": "yayVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 539,
"src": "5055:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
}
},
"id": 1106,
"indexExpression": {
"argumentTypes": null,
"id": 1105,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5064:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5055:21:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1113,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1110,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1107,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5080:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1108,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5080:14:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1109,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5095:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "5080:16:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 1111,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "5079:18:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 1112,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5098:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "5079:20:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "5055:44:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1116,
"nodeType": "IfStatement",
"src": "5052:56:2",
"trueBody": {
"expression": null,
"functionReturnParameters": 1020,
"id": 1115,
"nodeType": "Return",
"src": "5101:7:2"
}
},
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1117,
"name": "isKicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 553,
"src": "5117:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1119,
"indexExpression": {
"argumentTypes": null,
"id": 1118,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5126:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5117:21:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 1203,
"nodeType": "Block",
"src": "5528:106:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1190,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5549:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 1187,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5536:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1189,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5536:12:2",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 1191,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5536:25:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1192,
"nodeType": "ExpressionStatement",
"src": "5536:25:2"
},
{
"expression": {
"argumentTypes": null,
"id": 1197,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1193,
"name": "isSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 518,
"src": "5569:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1195,
"indexExpression": {
"argumentTypes": null,
"id": 1194,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5578:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "5569:21:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1196,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5593:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "5569:28:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1198,
"nodeType": "ExpressionStatement",
"src": "5569:28:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1200,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5615:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1199,
"name": "AddSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 561,
"src": "5605:9:2",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 1201,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5605:22:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1202,
"nodeType": "ExpressionStatement",
"src": "5605:22:2"
}
]
},
"id": 1204,
"nodeType": "IfStatement",
"src": "5114:520:2",
"trueBody": {
"id": 1186,
"nodeType": "Block",
"src": "5140:382:2",
"statements": [
{
"assignments": [
1121
],
"declarations": [
{
"constant": false,
"id": 1121,
"name": "overwrite",
"nodeType": "VariableDeclaration",
"scope": 1210,
"src": "5148:14:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1120,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "5148:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1123,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1122,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5165:5:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "5148:22:2"
},
{
"body": {
"id": 1159,
"nodeType": "Block",
"src": "5218:160:2",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 1135,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1121,
"src": "5231:9:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1147,
"nodeType": "IfStatement",
"src": "5228:64:2",
"trueBody": {
"id": 1146,
"nodeType": "Block",
"src": "5242:50:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1144,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1136,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5254:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1140,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1139,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1137,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1125,
"src": "5262:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1138,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5266:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "5262:5:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "5254:14:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1141,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5271:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1143,
"indexExpression": {
"argumentTypes": null,
"id": 1142,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1125,
"src": "5279:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5271:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "5254:27:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1145,
"nodeType": "ExpressionStatement",
"src": "5254:27:2"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1152,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1148,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5304:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1150,
"indexExpression": {
"argumentTypes": null,
"id": 1149,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1125,
"src": "5312:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5304:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 1151,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5318:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "5304:25:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1158,
"nodeType": "IfStatement",
"src": "5301:69:2",
"trueBody": {
"id": 1157,
"nodeType": "Block",
"src": "5331:39:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1155,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1153,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1121,
"src": "5343:9:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1154,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5355:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "5343:16:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1156,
"nodeType": "ExpressionStatement",
"src": "5343:16:2"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1131,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1128,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1125,
"src": "5194:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1129,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "5198:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1130,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5198:13:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "5194:17:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1160,
"initializationExpression": {
"assignments": [
1125
],
"declarations": [
{
"constant": false,
"id": 1125,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 1210,
"src": "5182:6:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1124,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "5182:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1127,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 1126,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5191:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "5182:10:2"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 1133,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "5213:3:2",
"subExpression": {
"argumentTypes": null,
"id": 1132,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1125,
"src": "5213:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1134,
"nodeType": "ExpressionStatement",
"src": "5213:3:2"
},
"nodeType": "ForStatement",
"src": "5178:200:2"
},
{
"expression": {
"argumentTypes": null,
"id": 1168,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "5385:33:2",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1161,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5392:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1166,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1165,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1162,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5400:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1163,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5400:14:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1164,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5415:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "5400:16:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "5392:25:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 1167,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "5391:27:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1169,
"nodeType": "ExpressionStatement",
"src": "5385:33:2"
},
{
"expression": {
"argumentTypes": null,
"id": 1174,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1170,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5426:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1172,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5426:14:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 1173,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5444:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "5426:19:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1175,
"nodeType": "ExpressionStatement",
"src": "5426:19:2"
},
{
"expression": {
"argumentTypes": null,
"id": 1180,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1176,
"name": "isSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 518,
"src": "5453:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1178,
"indexExpression": {
"argumentTypes": null,
"id": 1177,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5462:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "5453:21:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1179,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5477:5:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"src": "5453:29:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1181,
"nodeType": "ExpressionStatement",
"src": "5453:29:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1183,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5503:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1182,
"name": "RemoveSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 565,
"src": "5490:12:2",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 1184,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5490:25:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1185,
"nodeType": "ExpressionStatement",
"src": "5490:25:2"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1206,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5651:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1205,
"name": "clearVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1012,
"src": "5640:10:2",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 1207,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5640:23:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1208,
"nodeType": "ExpressionStatement",
"src": "5640:23:2"
}
]
},
"id": 1210,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1019,
"modifierName": {
"argumentTypes": null,
"id": 1018,
"name": "onlySigners",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 576,
"src": "4262:11:2",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "4262:13:2"
}
],
"name": "vote",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1017,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1014,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1210,
"src": "4222:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1013,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4222:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1016,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 1210,
"src": "4243:10:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1015,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "4243:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4221:33:2"
},
"payable": false,
"returnParameters": {
"id": 1020,
"nodeType": "ParameterList",
"parameters": [],
"src": "4276:0:2"
},
"scope": 1394,
"src": "4208:1460:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1221,
"nodeType": "Block",
"src": "5743:35:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1217,
"name": "agentByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 507,
"src": "5756:11:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 1219,
"indexExpression": {
"argumentTypes": null,
"id": 1218,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1212,
"src": "5768:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5756:17:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1216,
"id": 1220,
"nodeType": "Return",
"src": "5749:24:2"
}
]
},
"id": 1222,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getAgentByName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1213,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1212,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 1222,
"src": "5696:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1211,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "5696:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5695:13:2"
},
"payable": false,
"returnParameters": {
"id": 1216,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1215,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1222,
"src": "5734:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1214,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5734:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5733:9:2"
},
"scope": 1394,
"src": "5672:106:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1234,
"nodeType": "Block",
"src": "5851:38:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1229,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "5864:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 1231,
"indexExpression": {
"argumentTypes": null,
"id": 1230,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1224,
"src": "5874:4:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5864:15:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 1232,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "name",
"nodeType": "MemberAccess",
"referencedDeclaration": 494,
"src": "5864:20:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"functionReturnParameters": 1228,
"id": 1233,
"nodeType": "Return",
"src": "5857:27:2"
}
]
},
"id": 1235,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getAgentName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1225,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1224,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1235,
"src": "5804:12:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1223,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5804:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5803:14:2"
},
"payable": false,
"returnParameters": {
"id": 1228,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1227,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1235,
"src": "5843:6:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1226,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "5843:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5842:8:2"
},
"scope": 1394,
"src": "5782:107:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1247,
"nodeType": "Block",
"src": "5971:46:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1242,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "5984:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 1244,
"indexExpression": {
"argumentTypes": null,
"id": 1243,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1237,
"src": "5994:4:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5984:15:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 1245,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "contractAddr",
"nodeType": "MemberAccess",
"referencedDeclaration": 496,
"src": "5984:28:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1241,
"id": 1246,
"nodeType": "Return",
"src": "5977:35:2"
}
]
},
"id": 1248,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getAgentContractAddr",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1238,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1237,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1248,
"src": "5923:12:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1236,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5923:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5922:14:2"
},
"payable": false,
"returnParameters": {
"id": 1241,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1240,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1248,
"src": "5962:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1239,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5962:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5961:9:2"
},
"scope": 1394,
"src": "5893:124:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1260,
"nodeType": "Block",
"src": "6090:38:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1255,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "6103:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 1257,
"indexExpression": {
"argumentTypes": null,
"id": 1256,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1250,
"src": "6113:4:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6103:15:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 1258,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "host",
"nodeType": "MemberAccess",
"referencedDeclaration": 498,
"src": "6103:20:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"functionReturnParameters": 1254,
"id": 1259,
"nodeType": "Return",
"src": "6096:27:2"
}
]
},
"id": 1261,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getAgentHost",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1251,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1250,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1261,
"src": "6043:12:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1249,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6043:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6042:14:2"
},
"payable": false,
"returnParameters": {
"id": 1254,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1253,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1261,
"src": "6082:6:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1252,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "6082:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6081:8:2"
},
"scope": 1394,
"src": "6021:107:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1269,
"nodeType": "Block",
"src": "6188:32:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1266,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "6201:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1267,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6201:14:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1265,
"id": 1268,
"nodeType": "Return",
"src": "6194:21:2"
}
]
},
"id": 1270,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumSigners",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1262,
"nodeType": "ParameterList",
"parameters": [],
"src": "6154:2:2"
},
"payable": false,
"returnParameters": {
"id": 1265,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1264,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1270,
"src": "6182:4:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1263,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6182:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6181:6:2"
},
"scope": 1394,
"src": "6132:88:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1281,
"nodeType": "Block",
"src": "6287:30:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1277,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "6300:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1279,
"indexExpression": {
"argumentTypes": null,
"id": 1278,
"name": "idx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1272,
"src": "6308:3:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6300:12:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1276,
"id": 1280,
"nodeType": "Return",
"src": "6293:19:2"
}
]
},
"id": 1282,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getSigner",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1273,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1272,
"name": "idx",
"nodeType": "VariableDeclaration",
"scope": 1282,
"src": "6243:8:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1271,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6243:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6242:10:2"
},
"payable": false,
"returnParameters": {
"id": 1276,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1275,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1282,
"src": "6278:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1274,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6278:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6277:9:2"
},
"scope": 1394,
"src": "6224:93:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1294,
"nodeType": "Block",
"src": "6395:44:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1289,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "6408:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 1291,
"indexExpression": {
"argumentTypes": null,
"id": 1290,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1284,
"src": "6415:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6408:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1292,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6408:26:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1288,
"id": 1293,
"nodeType": "Return",
"src": "6401:33:2"
}
]
},
"id": 1295,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumVoters",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1285,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1284,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1295,
"src": "6343:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1283,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6343:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6342:21:2"
},
"payable": false,
"returnParameters": {
"id": 1288,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1287,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1295,
"src": "6389:4:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1286,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6389:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6388:6:2"
},
"scope": 1394,
"src": "6321:118:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1310,
"nodeType": "Block",
"src": "6526:42:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1304,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "6539:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 1306,
"indexExpression": {
"argumentTypes": null,
"id": 1305,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1297,
"src": "6546:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6539:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1308,
"indexExpression": {
"argumentTypes": null,
"id": 1307,
"name": "idx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1299,
"src": "6559:3:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6539:24:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1303,
"id": 1309,
"nodeType": "Return",
"src": "6532:31:2"
}
]
},
"id": 1311,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getVoter",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1300,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1297,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1311,
"src": "6461:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1296,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6461:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1299,
"name": "idx",
"nodeType": "VariableDeclaration",
"scope": 1311,
"src": "6482:8:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1298,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6482:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6460:31:2"
},
"payable": false,
"returnParameters": {
"id": 1303,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1302,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1311,
"src": "6517:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1301,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6517:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6516:9:2"
},
"scope": 1394,
"src": "6443:125:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1326,
"nodeType": "Block",
"src": "6661:47:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1320,
"name": "voteInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 535,
"src": "6674:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 1322,
"indexExpression": {
"argumentTypes": null,
"id": 1321,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1313,
"src": "6683:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6674:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1324,
"indexExpression": {
"argumentTypes": null,
"id": 1323,
"name": "signer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1315,
"src": "6696:6:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6674:29:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 1319,
"id": 1325,
"nodeType": "Return",
"src": "6667:36:2"
}
]
},
"id": 1327,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getVoteInfo",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1316,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1313,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1327,
"src": "6593:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1312,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6593:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1315,
"name": "signer",
"nodeType": "VariableDeclaration",
"scope": 1327,
"src": "6614:14:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1314,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6614:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6592:37:2"
},
"payable": false,
"returnParameters": {
"id": 1319,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1318,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1327,
"src": "6655:4:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1317,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "6655:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6654:6:2"
},
"scope": 1394,
"src": "6572:136:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1338,
"nodeType": "Block",
"src": "6788:39:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1334,
"name": "yayVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 539,
"src": "6801:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
}
},
"id": 1336,
"indexExpression": {
"argumentTypes": null,
"id": 1335,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1329,
"src": "6810:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6801:21:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1333,
"id": 1337,
"nodeType": "Return",
"src": "6794:28:2"
}
]
},
"id": 1339,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumYayVotes",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1330,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1329,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1339,
"src": "6736:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1328,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6736:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6735:21:2"
},
"payable": false,
"returnParameters": {
"id": 1333,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1332,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1339,
"src": "6782:4:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1331,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6782:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6781:6:2"
},
"scope": 1394,
"src": "6712:115:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1347,
"nodeType": "Block",
"src": "6892:37:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1344,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "6905:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1345,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6905:19:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1343,
"id": 1346,
"nodeType": "Return",
"src": "6898:26:2"
}
]
},
"id": 1348,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumProspectives",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1340,
"nodeType": "ParameterList",
"parameters": [],
"src": "6858:2:2"
},
"payable": false,
"returnParameters": {
"id": 1343,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1342,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1348,
"src": "6886:4:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1341,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6886:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6885:6:2"
},
"scope": 1394,
"src": "6831:98:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1359,
"nodeType": "Block",
"src": "7001:35:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1355,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "7014:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1357,
"indexExpression": {
"argumentTypes": null,
"id": 1356,
"name": "idx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1350,
"src": "7027:3:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "7014:17:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1354,
"id": 1358,
"nodeType": "Return",
"src": "7007:24:2"
}
]
},
"id": 1360,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getProspective",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1351,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1350,
"name": "idx",
"nodeType": "VariableDeclaration",
"scope": 1360,
"src": "6957:8:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1349,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6957:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6956:10:2"
},
"payable": false,
"returnParameters": {
"id": 1354,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1353,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1360,
"src": "6992:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1352,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6992:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6991:9:2"
},
"scope": 1394,
"src": "6933:103:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1368,
"nodeType": "Block",
"src": "7095:31:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1365,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "7108:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1366,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "7108:13:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1364,
"id": 1367,
"nodeType": "Return",
"src": "7101:20:2"
}
]
},
"id": 1369,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumKicked",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1361,
"nodeType": "ParameterList",
"parameters": [],
"src": "7061:2:2"
},
"payable": false,
"returnParameters": {
"id": 1364,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1363,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1369,
"src": "7089:4:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1362,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "7089:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7088:6:2"
},
"scope": 1394,
"src": "7040:86:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1380,
"nodeType": "Block",
"src": "7193:29:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1376,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "7206:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1378,
"indexExpression": {
"argumentTypes": null,
"id": 1377,
"name": "idx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1371,
"src": "7213:3:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "7206:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1375,
"id": 1379,
"nodeType": "Return",
"src": "7199:18:2"
}
]
},
"id": 1381,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getKicked",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1372,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1371,
"name": "idx",
"nodeType": "VariableDeclaration",
"scope": 1381,
"src": "7149:8:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1370,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "7149:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7148:10:2"
},
"payable": false,
"returnParameters": {
"id": 1375,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1374,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1381,
"src": "7184:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1373,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "7184:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7183:9:2"
},
"scope": 1394,
"src": "7130:92:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1392,
"nodeType": "Block",
"src": "7302:39:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1388,
"name": "proposer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 557,
"src": "7315:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 1390,
"indexExpression": {
"argumentTypes": null,
"id": 1389,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1383,
"src": "7324:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "7315:21:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1387,
"id": 1391,
"nodeType": "Return",
"src": "7308:28:2"
}
]
},
"id": 1393,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getProposer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1384,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1383,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1393,
"src": "7247:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1382,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "7247:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7246:21:2"
},
"payable": false,
"returnParameters": {
"id": 1387,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1386,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1393,
"src": "7293:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1385,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "7293:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7292:9:2"
},
"scope": 1394,
"src": "7226:115:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 1395,
"src": "37:7306:2"
}
],
"src": "0:7344:2"
},
"legacyAST": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/AgentRegistry.sol",
"exportedSymbols": {
"AgentRegistry": [
1394
]
},
"id": 1395,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 492,
"literals": [
"solidity",
"^",
"0.4",
".15"
],
"nodeType": "PragmaDirective",
"src": "0:24:2"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 1394,
"linearizedBaseContracts": [
1394
],
"name": "AgentRegistry",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "AgentRegistry.Agent",
"id": 499,
"members": [
{
"constant": false,
"id": 494,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 499,
"src": "83:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
},
"typeName": {
"id": 493,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "83:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 496,
"name": "contractAddr",
"nodeType": "VariableDeclaration",
"scope": 499,
"src": "100:20:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 495,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "100:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 498,
"name": "host",
"nodeType": "VariableDeclaration",
"scope": 499,
"src": "126:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
},
"typeName": {
"id": 497,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "126:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Agent",
"nodeType": "StructDefinition",
"scope": 1394,
"src": "64:78:2",
"visibility": "public"
},
{
"constant": false,
"id": 503,
"name": "agentInfo",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "145:35:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
},
"typeName": {
"id": 502,
"keyType": {
"id": 500,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "153:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "145:25:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
},
"valueType": {
"contractScope": null,
"id": 501,
"name": "Agent",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 499,
"src": "164:5:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage_ptr",
"typeString": "struct AgentRegistry.Agent storage pointer"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 507,
"name": "agentByName",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "184:38:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
},
"typeName": {
"id": 506,
"keyType": {
"id": 504,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "192:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"nodeType": "Mapping",
"src": "184:26:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
},
"valueType": {
"id": 505,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "202:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 511,
"name": "agentFromContract",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "226:52:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
},
"typeName": {
"id": 510,
"keyType": {
"id": 508,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "234:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "226:27:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
},
"valueType": {
"id": 509,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "245:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 514,
"name": "signers",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "314:17:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 512,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "314:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 513,
"length": null,
"nodeType": "ArrayTypeName",
"src": "314:9:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 518,
"name": "isSigner",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "335:40:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 517,
"keyType": {
"id": 515,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "343:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "335:24:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 516,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "354:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 523,
"name": "voters",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "433:37:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
},
"typeName": {
"id": 522,
"keyType": {
"id": 519,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "442:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "433:30:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
},
"valueType": {
"baseType": {
"id": 520,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "453:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 521,
"length": null,
"nodeType": "ArrayTypeName",
"src": "453:9:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 529,
"name": "hasVoted",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "474:54:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
},
"typeName": {
"id": 528,
"keyType": {
"id": 524,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "483:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "474:45:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
},
"valueType": {
"id": 527,
"keyType": {
"id": 525,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "502:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "494:24:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 526,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "513:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 535,
"name": "voteInfo",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "532:54:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
},
"typeName": {
"id": 534,
"keyType": {
"id": 530,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "541:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "532:45:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
},
"valueType": {
"id": 533,
"keyType": {
"id": 531,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "560:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "552:24:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 532,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "571:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 539,
"name": "yayVotes",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "590:34:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"typeName": {
"id": 538,
"keyType": {
"id": 536,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "599:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "590:25:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"valueType": {
"id": 537,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "610:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 542,
"name": "prospectives",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "694:22:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 540,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "694:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 541,
"length": null,
"nodeType": "ArrayTypeName",
"src": "694:9:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 545,
"name": "kicked",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "794:16:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 543,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "794:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 544,
"length": null,
"nodeType": "ArrayTypeName",
"src": "794:9:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 549,
"name": "isProspective",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "814:46:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 548,
"keyType": {
"id": 546,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "822:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "814:24:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 547,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "833:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 553,
"name": "isKicked",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "864:41:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 552,
"keyType": {
"id": 550,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "872:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "864:24:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 551,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "883:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 557,
"name": "proposer",
"nodeType": "VariableDeclaration",
"scope": 1394,
"src": "957:36:2",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
},
"typeName": {
"id": 556,
"keyType": {
"id": 554,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "965:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "957:27:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
},
"valueType": {
"id": 555,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "976:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
"value": null,
"visibility": "internal"
},
{
"anonymous": false,
"id": 561,
"name": "AddSigner",
"nodeType": "EventDefinition",
"parameters": {
"id": 560,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 559,
"indexed": true,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 561,
"src": "1014:20:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 558,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1014:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1013:22:2"
},
"src": "998:38:2"
},
{
"anonymous": false,
"id": 565,
"name": "RemoveSigner",
"nodeType": "EventDefinition",
"parameters": {
"id": 564,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 563,
"indexed": true,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 565,
"src": "1058:20:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 562,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1058:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1057:22:2"
},
"src": "1039:41:2"
},
{
"body": {
"id": 575,
"nodeType": "Block",
"src": "1107:47:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 568,
"name": "isSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 518,
"src": "1121:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 571,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 569,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1130:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 570,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1130:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1121:20:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 567,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "1113:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 572,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1113:29:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 573,
"nodeType": "ExpressionStatement",
"src": "1113:29:2"
},
{
"id": 574,
"nodeType": "PlaceholderStatement",
"src": "1148:1:2"
}
]
},
"id": 576,
"name": "onlySigners",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 566,
"nodeType": "ParameterList",
"parameters": [],
"src": "1104:2:2"
},
"src": "1084:70:2",
"visibility": "internal"
},
{
"body": {
"id": 624,
"nodeType": "Block",
"src": "1236:215:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 588,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1255:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 589,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1255:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 585,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "1242:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 587,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1242:12:2",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 590,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1242:24:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 591,
"nodeType": "ExpressionStatement",
"src": "1242:24:2"
},
{
"expression": {
"argumentTypes": null,
"id": 601,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 592,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "1272:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 595,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 593,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1282:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 594,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1282:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1272:21:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 597,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 578,
"src": "1302:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 598,
"name": "contractAddr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 580,
"src": "1308:12:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 599,
"name": "host",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 582,
"src": "1322:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 596,
"name": "Agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 499,
"src": "1296:5:2",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Agent_$499_storage_ptr_$",
"typeString": "type(struct AgentRegistry.Agent storage pointer)"
}
},
"id": 600,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1296:31:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_memory",
"typeString": "struct AgentRegistry.Agent memory"
}
},
"src": "1272:55:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 602,
"nodeType": "ExpressionStatement",
"src": "1272:55:2"
},
{
"expression": {
"argumentTypes": null,
"id": 608,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 603,
"name": "agentByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 507,
"src": "1333:11:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 605,
"indexExpression": {
"argumentTypes": null,
"id": 604,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 578,
"src": "1345:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1333:17:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 606,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1353:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 607,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1353:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1333:30:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 609,
"nodeType": "ExpressionStatement",
"src": "1333:30:2"
},
{
"expression": {
"argumentTypes": null,
"id": 615,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 610,
"name": "agentFromContract",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 511,
"src": "1369:17:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 612,
"indexExpression": {
"argumentTypes": null,
"id": 611,
"name": "contractAddr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 580,
"src": "1387:12:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1369:31:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 613,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1403:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 614,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1403:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1369:44:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 616,
"nodeType": "ExpressionStatement",
"src": "1369:44:2"
},
{
"expression": {
"argumentTypes": null,
"id": 622,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 617,
"name": "isSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 518,
"src": "1419:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 620,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 618,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1428:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 619,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1428:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1419:20:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 621,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1442:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "1419:27:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 623,
"nodeType": "ExpressionStatement",
"src": "1419:27:2"
}
]
},
"id": 625,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "AgentRegistry",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 583,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 578,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 625,
"src": "1181:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 577,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1181:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 580,
"name": "contractAddr",
"nodeType": "VariableDeclaration",
"scope": 625,
"src": "1194:20:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 579,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1194:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 582,
"name": "host",
"nodeType": "VariableDeclaration",
"scope": 625,
"src": "1216:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 581,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1216:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1180:48:2"
},
"payable": false,
"returnParameters": {
"id": 584,
"nodeType": "ParameterList",
"parameters": [],
"src": "1236:0:2"
},
"scope": 1394,
"src": "1158:293:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 657,
"nodeType": "Block",
"src": "1572:185:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 639,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 633,
"name": "agentByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 507,
"src": "1640:11:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 635,
"indexExpression": {
"argumentTypes": null,
"id": 634,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 627,
"src": "1652:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1640:17:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 637,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1669:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 636,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1661:7:2",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 638,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1661:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1640:31:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 632,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "1632:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 640,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1632:40:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 641,
"nodeType": "ExpressionStatement",
"src": "1632:40:2"
},
{
"expression": {
"argumentTypes": null,
"id": 648,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 642,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "1681:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 645,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 643,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1691:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 644,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1691:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1681:21:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 646,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "name",
"nodeType": "MemberAccess",
"referencedDeclaration": 494,
"src": "1681:26:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 647,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 627,
"src": "1710:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "1681:33:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 649,
"nodeType": "ExpressionStatement",
"src": "1681:33:2"
},
{
"expression": {
"argumentTypes": null,
"id": 655,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 650,
"name": "agentByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 507,
"src": "1722:11:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 652,
"indexExpression": {
"argumentTypes": null,
"id": 651,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 627,
"src": "1734:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1722:17:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 653,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1742:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 654,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1742:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1722:30:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 656,
"nodeType": "ExpressionStatement",
"src": "1722:30:2"
}
]
},
"id": 658,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 630,
"modifierName": {
"argumentTypes": null,
"id": 629,
"name": "onlySigners",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 576,
"src": "1551:11:2",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1551:13:2"
}
],
"name": "setAgentName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 628,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 627,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 658,
"src": "1538:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 626,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1538:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1537:13:2"
},
"payable": false,
"returnParameters": {
"id": 631,
"nodeType": "ParameterList",
"parameters": [],
"src": "1572:0:2"
},
"scope": 1394,
"src": "1516:241:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 678,
"nodeType": "Block",
"src": "1820:114:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 669,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 663,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "1828:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 666,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 664,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1838:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 665,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1838:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1828:21:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 667,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "contractAddr",
"nodeType": "MemberAccess",
"referencedDeclaration": 496,
"src": "1828:34:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 668,
"name": "contractAddr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 660,
"src": "1865:12:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1828:49:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 670,
"nodeType": "ExpressionStatement",
"src": "1828:49:2"
},
{
"expression": {
"argumentTypes": null,
"id": 676,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 671,
"name": "agentFromContract",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 511,
"src": "1885:17:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 673,
"indexExpression": {
"argumentTypes": null,
"id": 672,
"name": "contractAddr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 660,
"src": "1903:12:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1885:31:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 674,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1919:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 675,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1919:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1885:44:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 677,
"nodeType": "ExpressionStatement",
"src": "1885:44:2"
}
]
},
"id": 679,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "setAgentContractAddr",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 661,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 660,
"name": "contractAddr",
"nodeType": "VariableDeclaration",
"scope": 679,
"src": "1791:20:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 659,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1791:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1790:22:2"
},
"payable": false,
"returnParameters": {
"id": 662,
"nodeType": "ParameterList",
"parameters": [],
"src": "1820:0:2"
},
"scope": 1394,
"src": "1761:173:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 692,
"nodeType": "Block",
"src": "1980:46:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 690,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 684,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "1988:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 687,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 685,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "1998:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 686,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1998:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1988:21:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 688,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "host",
"nodeType": "MemberAccess",
"referencedDeclaration": 498,
"src": "1988:26:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 689,
"name": "host",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 681,
"src": "2017:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "1988:33:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 691,
"nodeType": "ExpressionStatement",
"src": "1988:33:2"
}
]
},
"id": 693,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "setAgentHost",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 682,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 681,
"name": "host",
"nodeType": "VariableDeclaration",
"scope": 693,
"src": "1960:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 680,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1960:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1959:13:2"
},
"payable": false,
"returnParameters": {
"id": 683,
"nodeType": "ParameterList",
"parameters": [],
"src": "1980:0:2"
},
"scope": 1394,
"src": "1938:88:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 754,
"nodeType": "Block",
"src": "2177:331:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 703,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "2191:21:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 699,
"name": "isSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 518,
"src": "2192:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 702,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 700,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2201:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 701,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2201:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2192:20:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 698,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2183:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 704,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2183:30:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 705,
"nodeType": "ExpressionStatement",
"src": "2183:30:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 711,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "2227:26:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 707,
"name": "isProspective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 549,
"src": "2228:13:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 710,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 708,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2242:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 709,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2242:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2228:25:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 706,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2219:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 712,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2219:35:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 713,
"nodeType": "ExpressionStatement",
"src": "2219:35:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 717,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2279:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 718,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2279:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 714,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "2261:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 716,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2261:17:2",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 719,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2261:29:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 720,
"nodeType": "ExpressionStatement",
"src": "2261:29:2"
},
{
"expression": {
"argumentTypes": null,
"id": 726,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 721,
"name": "isProspective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 549,
"src": "2296:13:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 724,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 722,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2310:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 723,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2310:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2296:25:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 725,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2324:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "2296:32:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 727,
"nodeType": "ExpressionStatement",
"src": "2296:32:2"
},
{
"expression": {
"argumentTypes": null,
"id": 734,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 728,
"name": "proposer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 557,
"src": "2334:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 731,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 729,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2343:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 730,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2343:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2334:20:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 732,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2357:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 733,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2357:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2334:33:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 735,
"nodeType": "ExpressionStatement",
"src": "2334:33:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 743,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 737,
"name": "agentByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 507,
"src": "2432:11:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 739,
"indexExpression": {
"argumentTypes": null,
"id": 738,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 695,
"src": "2444:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2432:17:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 741,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2461:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 740,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2453:7:2",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 742,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2453:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2432:31:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 736,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2424:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 744,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2424:40:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 745,
"nodeType": "ExpressionStatement",
"src": "2424:40:2"
},
{
"expression": {
"argumentTypes": null,
"id": 752,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 746,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "2470:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 749,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 747,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2480:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 748,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2480:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2470:21:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 750,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "name",
"nodeType": "MemberAccess",
"referencedDeclaration": 494,
"src": "2470:26:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 751,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 695,
"src": "2499:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "2470:33:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 753,
"nodeType": "ExpressionStatement",
"src": "2470:33:2"
}
]
},
"id": 755,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "propose",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 696,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 695,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 755,
"src": "2157:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 694,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "2157:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2156:13:2"
},
"payable": false,
"returnParameters": {
"id": 697,
"nodeType": "ParameterList",
"parameters": [],
"src": "2177:0:2"
},
"scope": 1394,
"src": "2140:368:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 807,
"nodeType": "Block",
"src": "2593:265:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 763,
"name": "isSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 518,
"src": "2607:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 766,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 764,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2616:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 765,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2616:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2607:20:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 762,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2599:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 767,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2599:29:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 768,
"nodeType": "ExpressionStatement",
"src": "2599:29:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 773,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "2642:14:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 770,
"name": "isKicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 553,
"src": "2643:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 772,
"indexExpression": {
"argumentTypes": null,
"id": 771,
"name": "rip",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 757,
"src": "2652:3:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2643:13:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 769,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2634:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 774,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2634:23:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 775,
"nodeType": "ExpressionStatement",
"src": "2634:23:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 780,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 777,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "2732:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 778,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2732:14:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 779,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2749:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "2732:18:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 776,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2724:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 781,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2724:27:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 782,
"nodeType": "ExpressionStatement",
"src": "2724:27:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 786,
"name": "rip",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 757,
"src": "2770:3:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 783,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "2758:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 785,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2758:11:2",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 787,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2758:16:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 788,
"nodeType": "ExpressionStatement",
"src": "2758:16:2"
},
{
"expression": {
"argumentTypes": null,
"id": 793,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 789,
"name": "isKicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 553,
"src": "2780:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 791,
"indexExpression": {
"argumentTypes": null,
"id": 790,
"name": "rip",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 757,
"src": "2789:3:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2780:13:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 792,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2796:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "2780:20:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 794,
"nodeType": "ExpressionStatement",
"src": "2780:20:2"
},
{
"expression": {
"argumentTypes": null,
"id": 800,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 795,
"name": "proposer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 557,
"src": "2806:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 797,
"indexExpression": {
"argumentTypes": null,
"id": 796,
"name": "rip",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 757,
"src": "2815:3:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2806:13:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 798,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "2822:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 799,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2822:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2806:26:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 801,
"nodeType": "ExpressionStatement",
"src": "2806:26:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 803,
"name": "rip",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 757,
"src": "2843:3:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"hexValue": "74727565",
"id": 804,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2848:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 802,
"name": "vote",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1210,
"src": "2838:4:2",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bool_$returns$__$",
"typeString": "function (address,bool)"
}
},
"id": 805,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2838:15:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 806,
"nodeType": "ExpressionStatement",
"src": "2838:15:2"
}
]
},
"id": 808,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 760,
"modifierName": {
"argumentTypes": null,
"id": 759,
"name": "onlySigners",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 576,
"src": "2581:11:2",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "2581:11:2"
}
],
"name": "kick",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 758,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 757,
"name": "rip",
"nodeType": "VariableDeclaration",
"scope": 808,
"src": "2561:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 756,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2561:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2560:13:2"
},
"payable": false,
"returnParameters": {
"id": 761,
"nodeType": "ParameterList",
"parameters": [],
"src": "2593:0:2"
},
"scope": 1394,
"src": "2546:312:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 826,
"nodeType": "Block",
"src": "2971:84:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 819,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 814,
"name": "proposer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 557,
"src": "2985:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 816,
"indexExpression": {
"argumentTypes": null,
"id": 815,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 810,
"src": "2994:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2985:21:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 817,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "3010:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 818,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3010:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2985:35:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 813,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "2977:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 820,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2977:44:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 821,
"nodeType": "ExpressionStatement",
"src": "2977:44:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 823,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 810,
"src": "3038:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 822,
"name": "clearVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1012,
"src": "3027:10:2",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 824,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3027:23:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 825,
"nodeType": "ExpressionStatement",
"src": "3027:23:2"
}
]
},
"id": 827,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "rescind",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 811,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 810,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 827,
"src": "2943:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 809,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2943:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2942:21:2"
},
"payable": false,
"returnParameters": {
"id": 812,
"nodeType": "ParameterList",
"parameters": [],
"src": "2971:0:2"
},
"scope": 1394,
"src": "2925:130:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1011,
"nodeType": "Block",
"src": "3109:1029:2",
"statements": [
{
"assignments": [],
"declarations": [
{
"constant": false,
"id": 833,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 1012,
"src": "3115:6:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 832,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "3115:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 834,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "3115:6:2"
},
{
"body": {
"id": 870,
"nodeType": "Block",
"src": "3175:127:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 857,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3183:52:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 848,
"name": "voteInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 535,
"src": "3190:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 850,
"indexExpression": {
"argumentTypes": null,
"id": 849,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3199:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3190:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 856,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 851,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "3212:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 853,
"indexExpression": {
"argumentTypes": null,
"id": 852,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3219:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3212:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 855,
"indexExpression": {
"argumentTypes": null,
"id": 854,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3232:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3212:22:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3190:45:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 858,
"nodeType": "ExpressionStatement",
"src": "3183:52:2"
},
{
"expression": {
"argumentTypes": null,
"id": 868,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3243:52:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 859,
"name": "hasVoted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 529,
"src": "3250:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 861,
"indexExpression": {
"argumentTypes": null,
"id": 860,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3259:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3250:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 867,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 862,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "3272:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 864,
"indexExpression": {
"argumentTypes": null,
"id": 863,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3279:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3272:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 866,
"indexExpression": {
"argumentTypes": null,
"id": 865,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3292:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3272:22:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3250:45:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 869,
"nodeType": "ExpressionStatement",
"src": "3243:52:2"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 844,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 839,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3138:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 840,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "3142:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 842,
"indexExpression": {
"argumentTypes": null,
"id": 841,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3149:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3142:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 843,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3142:26:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "3138:30:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 871,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 837,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 835,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3131:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 836,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3135:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "3131:5:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 838,
"nodeType": "ExpressionStatement",
"src": "3131:5:2"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 846,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "3170:3:2",
"subExpression": {
"argumentTypes": null,
"id": 845,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3170:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 847,
"nodeType": "ExpressionStatement",
"src": "3170:3:2"
},
"nodeType": "ForStatement",
"src": "3127:175:2"
},
{
"expression": {
"argumentTypes": null,
"id": 875,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3307:26:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 872,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "3314:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 874,
"indexExpression": {
"argumentTypes": null,
"id": 873,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3321:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3314:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 876,
"nodeType": "ExpressionStatement",
"src": "3307:26:2"
},
{
"expression": {
"argumentTypes": null,
"id": 880,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3339:28:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 877,
"name": "proposer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 557,
"src": "3346:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 879,
"indexExpression": {
"argumentTypes": null,
"id": 878,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3355:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3346:21:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 881,
"nodeType": "ExpressionStatement",
"src": "3339:28:2"
},
{
"expression": {
"argumentTypes": null,
"id": 885,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3373:28:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 882,
"name": "yayVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 539,
"src": "3380:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
}
},
"id": 884,
"indexExpression": {
"argumentTypes": null,
"id": 883,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3389:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3380:21:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 886,
"nodeType": "ExpressionStatement",
"src": "3373:28:2"
},
{
"assignments": [
888
],
"declarations": [
{
"constant": false,
"id": 888,
"name": "overwrite",
"nodeType": "VariableDeclaration",
"scope": 1012,
"src": "3408:14:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 887,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "3408:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 890,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 889,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3425:5:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "3408:22:2"
},
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 891,
"name": "isProspective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 549,
"src": "3439:13:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 893,
"indexExpression": {
"argumentTypes": null,
"id": 892,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3453:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3439:26:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 1009,
"nodeType": "Block",
"src": "3827:307:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 955,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3835:28:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 952,
"name": "isKicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 553,
"src": "3842:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 954,
"indexExpression": {
"argumentTypes": null,
"id": 953,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3851:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3842:21:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 956,
"nodeType": "ExpressionStatement",
"src": "3835:28:2"
},
{
"body": {
"id": 992,
"nodeType": "Block",
"src": "3906:157:2",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 968,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 888,
"src": "3919:9:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 980,
"nodeType": "IfStatement",
"src": "3916:62:2",
"trueBody": {
"id": 979,
"nodeType": "Block",
"src": "3930:48:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 977,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 969,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "3942:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 973,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 972,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 970,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3949:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 971,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3953:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "3949:5:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3942:13:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 974,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "3958:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 976,
"indexExpression": {
"argumentTypes": null,
"id": 975,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3965:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3958:9:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "3942:25:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 978,
"nodeType": "ExpressionStatement",
"src": "3942:25:2"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 985,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 981,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "3990:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 983,
"indexExpression": {
"argumentTypes": null,
"id": 982,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3997:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3990:9:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 984,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "4003:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "3990:24:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 991,
"nodeType": "IfStatement",
"src": "3987:68:2",
"trueBody": {
"id": 990,
"nodeType": "Block",
"src": "4016:39:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 988,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 986,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 888,
"src": "4028:9:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 987,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4040:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "4028:16:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 989,
"nodeType": "ExpressionStatement",
"src": "4028:16:2"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 964,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 961,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3882:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 962,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "3886:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 963,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3886:13:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "3882:17:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 993,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 959,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 957,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3875:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 958,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3879:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "3875:5:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 960,
"nodeType": "ExpressionStatement",
"src": "3875:5:2"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 966,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "3901:3:2",
"subExpression": {
"argumentTypes": null,
"id": 965,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3901:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 967,
"nodeType": "ExpressionStatement",
"src": "3901:3:2"
},
"nodeType": "ForStatement",
"src": "3871:192:2"
},
{
"expression": {
"argumentTypes": null,
"id": 1001,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "4070:31:2",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 994,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "4077:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 999,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 998,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 995,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "4084:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 996,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4084:13:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 997,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4098:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "4084:15:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "4077:23:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 1000,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "4076:25:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1002,
"nodeType": "ExpressionStatement",
"src": "4070:31:2"
},
{
"expression": {
"argumentTypes": null,
"id": 1007,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1003,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "4109:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1005,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4109:13:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 1006,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4126:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "4109:18:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1008,
"nodeType": "ExpressionStatement",
"src": "4109:18:2"
}
]
},
"id": 1010,
"nodeType": "IfStatement",
"src": "3436:698:2",
"trueBody": {
"id": 951,
"nodeType": "Block",
"src": "3467:354:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 897,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3475:33:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 894,
"name": "isProspective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 549,
"src": "3482:13:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 896,
"indexExpression": {
"argumentTypes": null,
"id": 895,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3496:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3482:26:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 898,
"nodeType": "ExpressionStatement",
"src": "3475:33:2"
},
{
"body": {
"id": 934,
"nodeType": "Block",
"src": "3557:175:2",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 910,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 888,
"src": "3570:9:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 922,
"nodeType": "IfStatement",
"src": "3567:74:2",
"trueBody": {
"id": 921,
"nodeType": "Block",
"src": "3581:60:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 919,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 911,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3593:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 915,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 914,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 912,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3606:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 913,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3610:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "3606:5:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3593:19:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 916,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3615:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 918,
"indexExpression": {
"argumentTypes": null,
"id": 917,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3628:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3615:15:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "3593:37:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 920,
"nodeType": "ExpressionStatement",
"src": "3593:37:2"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 927,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 923,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3653:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 925,
"indexExpression": {
"argumentTypes": null,
"id": 924,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3666:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3653:15:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 926,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 829,
"src": "3672:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "3653:30:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 933,
"nodeType": "IfStatement",
"src": "3650:74:2",
"trueBody": {
"id": 932,
"nodeType": "Block",
"src": "3685:39:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 930,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 928,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 888,
"src": "3697:9:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 929,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3709:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "3697:16:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 931,
"nodeType": "ExpressionStatement",
"src": "3697:16:2"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 906,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 903,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3527:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 904,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3531:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 905,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3531:19:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "3527:23:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 935,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 901,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 899,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3520:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 900,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3524:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "3520:5:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 902,
"nodeType": "ExpressionStatement",
"src": "3520:5:2"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 908,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "3552:3:2",
"subExpression": {
"argumentTypes": null,
"id": 907,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 833,
"src": "3552:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 909,
"nodeType": "ExpressionStatement",
"src": "3552:3:2"
},
"nodeType": "ForStatement",
"src": "3516:216:2"
},
{
"expression": {
"argumentTypes": null,
"id": 943,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "3739:43:2",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 936,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3746:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 941,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 940,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 937,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3759:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 938,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3759:19:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 939,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3779:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "3759:21:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "3746:35:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 942,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "3745:37:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 944,
"nodeType": "ExpressionStatement",
"src": "3739:43:2"
},
{
"expression": {
"argumentTypes": null,
"id": 949,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 945,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "3790:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 947,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3790:19:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 948,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3813:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "3790:24:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 950,
"nodeType": "ExpressionStatement",
"src": "3790:24:2"
}
]
}
}
]
},
"id": 1012,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "clearVotes",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 830,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 829,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1012,
"src": "3079:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 828,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3079:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3078:21:2"
},
"payable": false,
"returnParameters": {
"id": 831,
"nodeType": "ParameterList",
"parameters": [],
"src": "3109:0:2"
},
"scope": 1394,
"src": "3059:1079:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 1209,
"nodeType": "Block",
"src": "4276:1392:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1028,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1022,
"name": "isProspective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 549,
"src": "4290:13:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1024,
"indexExpression": {
"argumentTypes": null,
"id": 1023,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4304:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4290:26:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1025,
"name": "isKicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 553,
"src": "4320:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1027,
"indexExpression": {
"argumentTypes": null,
"id": 1026,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4329:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4320:21:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4290:51:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1021,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "4282:7:2",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1029,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4282:60:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1030,
"nodeType": "ExpressionStatement",
"src": "4282:60:2"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1039,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1031,
"name": "voteInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 535,
"src": "4428:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 1033,
"indexExpression": {
"argumentTypes": null,
"id": 1032,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4437:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4428:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1036,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1034,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "4450:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1035,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4450:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4428:33:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"id": 1038,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "4465:6:2",
"subExpression": {
"argumentTypes": null,
"id": 1037,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1016,
"src": "4466:5:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4428:43:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1047,
"nodeType": "IfStatement",
"src": "4425:89:2",
"trueBody": {
"id": 1046,
"nodeType": "Block",
"src": "4473:41:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1044,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1040,
"name": "yayVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 539,
"src": "4481:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
}
},
"id": 1042,
"indexExpression": {
"argumentTypes": null,
"id": 1041,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4490:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "4481:21:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 1043,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4506:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "4481:26:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1045,
"nodeType": "ExpressionStatement",
"src": "4481:26:2"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1056,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1054,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "4589:34:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1048,
"name": "voteInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 535,
"src": "4590:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 1050,
"indexExpression": {
"argumentTypes": null,
"id": 1049,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4599:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4590:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1053,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1051,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "4612:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1052,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4612:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4590:33:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"id": 1055,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1016,
"src": "4627:5:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4589:43:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1064,
"nodeType": "IfStatement",
"src": "4586:89:2",
"trueBody": {
"id": 1063,
"nodeType": "Block",
"src": "4634:41:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1061,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1057,
"name": "yayVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 539,
"src": "4642:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
}
},
"id": 1059,
"indexExpression": {
"argumentTypes": null,
"id": 1058,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4651:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "4642:21:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 1060,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4667:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "4642:26:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1062,
"nodeType": "ExpressionStatement",
"src": "4642:26:2"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"id": 1072,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1065,
"name": "voteInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 535,
"src": "4680:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 1069,
"indexExpression": {
"argumentTypes": null,
"id": 1066,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4689:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4680:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1070,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1067,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "4702:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1068,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4702:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "4680:33:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1071,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1016,
"src": "4716:5:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "4680:41:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1073,
"nodeType": "ExpressionStatement",
"src": "4680:41:2"
},
{
"condition": {
"argumentTypes": null,
"id": 1080,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "4730:34:2",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1074,
"name": "hasVoted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 529,
"src": "4731:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 1076,
"indexExpression": {
"argumentTypes": null,
"id": 1075,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4740:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4731:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1079,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1077,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "4753:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1078,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4753:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4731:33:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1090,
"nodeType": "IfStatement",
"src": "4727:90:2",
"trueBody": {
"id": 1089,
"nodeType": "Block",
"src": "4766:51:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1085,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "4799:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1086,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4799:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1081,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "4774:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 1083,
"indexExpression": {
"argumentTypes": null,
"id": 1082,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4781:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4774:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1084,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4774:24:2",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 1087,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4774:36:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1088,
"nodeType": "ExpressionStatement",
"src": "4774:36:2"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"id": 1098,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1091,
"name": "hasVoted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 529,
"src": "4822:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 1095,
"indexExpression": {
"argumentTypes": null,
"id": 1092,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "4831:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4822:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1096,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1093,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "4844:3:2",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1094,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4844:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "4822:33:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1097,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4858:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "4822:40:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1099,
"nodeType": "ExpressionStatement",
"src": "4822:40:2"
},
{
"condition": {
"argumentTypes": null,
"id": 1101,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "4962:6:2",
"subExpression": {
"argumentTypes": null,
"id": 1100,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1016,
"src": "4963:5:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1103,
"nodeType": "IfStatement",
"src": "4959:18:2",
"trueBody": {
"expression": null,
"functionReturnParameters": 1020,
"id": 1102,
"nodeType": "Return",
"src": "4970:7:2"
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1114,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1104,
"name": "yayVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 539,
"src": "5055:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
}
},
"id": 1106,
"indexExpression": {
"argumentTypes": null,
"id": 1105,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5064:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5055:21:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1113,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1110,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1107,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5080:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1108,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5080:14:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1109,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5095:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "5080:16:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 1111,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "5079:18:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 1112,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5098:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "5079:20:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "5055:44:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1116,
"nodeType": "IfStatement",
"src": "5052:56:2",
"trueBody": {
"expression": null,
"functionReturnParameters": 1020,
"id": 1115,
"nodeType": "Return",
"src": "5101:7:2"
}
},
{
"condition": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1117,
"name": "isKicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 553,
"src": "5117:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1119,
"indexExpression": {
"argumentTypes": null,
"id": 1118,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5126:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5117:21:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 1203,
"nodeType": "Block",
"src": "5528:106:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1190,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5549:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 1187,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5536:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1189,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5536:12:2",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 1191,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5536:25:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1192,
"nodeType": "ExpressionStatement",
"src": "5536:25:2"
},
{
"expression": {
"argumentTypes": null,
"id": 1197,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1193,
"name": "isSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 518,
"src": "5569:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1195,
"indexExpression": {
"argumentTypes": null,
"id": 1194,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5578:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "5569:21:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1196,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5593:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "5569:28:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1198,
"nodeType": "ExpressionStatement",
"src": "5569:28:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1200,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5615:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1199,
"name": "AddSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 561,
"src": "5605:9:2",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 1201,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5605:22:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1202,
"nodeType": "ExpressionStatement",
"src": "5605:22:2"
}
]
},
"id": 1204,
"nodeType": "IfStatement",
"src": "5114:520:2",
"trueBody": {
"id": 1186,
"nodeType": "Block",
"src": "5140:382:2",
"statements": [
{
"assignments": [
1121
],
"declarations": [
{
"constant": false,
"id": 1121,
"name": "overwrite",
"nodeType": "VariableDeclaration",
"scope": 1210,
"src": "5148:14:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1120,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "5148:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1123,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1122,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5165:5:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "5148:22:2"
},
{
"body": {
"id": 1159,
"nodeType": "Block",
"src": "5218:160:2",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 1135,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1121,
"src": "5231:9:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1147,
"nodeType": "IfStatement",
"src": "5228:64:2",
"trueBody": {
"id": 1146,
"nodeType": "Block",
"src": "5242:50:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1144,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1136,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5254:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1140,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1139,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1137,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1125,
"src": "5262:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1138,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5266:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "5262:5:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "5254:14:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1141,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5271:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1143,
"indexExpression": {
"argumentTypes": null,
"id": 1142,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1125,
"src": "5279:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5271:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "5254:27:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1145,
"nodeType": "ExpressionStatement",
"src": "5254:27:2"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1152,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1148,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5304:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1150,
"indexExpression": {
"argumentTypes": null,
"id": 1149,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1125,
"src": "5312:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5304:10:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 1151,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5318:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "5304:25:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1158,
"nodeType": "IfStatement",
"src": "5301:69:2",
"trueBody": {
"id": 1157,
"nodeType": "Block",
"src": "5331:39:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1155,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1153,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1121,
"src": "5343:9:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1154,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5355:4:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "5343:16:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1156,
"nodeType": "ExpressionStatement",
"src": "5343:16:2"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1131,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1128,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1125,
"src": "5194:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1129,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "5198:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1130,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5198:13:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "5194:17:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1160,
"initializationExpression": {
"assignments": [
1125
],
"declarations": [
{
"constant": false,
"id": 1125,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 1210,
"src": "5182:6:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1124,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "5182:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1127,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 1126,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5191:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "5182:10:2"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 1133,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "5213:3:2",
"subExpression": {
"argumentTypes": null,
"id": 1132,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1125,
"src": "5213:1:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1134,
"nodeType": "ExpressionStatement",
"src": "5213:3:2"
},
"nodeType": "ForStatement",
"src": "5178:200:2"
},
{
"expression": {
"argumentTypes": null,
"id": 1168,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "5385:33:2",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1161,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5392:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1166,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1165,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1162,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5400:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1163,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5400:14:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1164,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5415:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "5400:16:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "5392:25:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 1167,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "5391:27:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1169,
"nodeType": "ExpressionStatement",
"src": "5385:33:2"
},
{
"expression": {
"argumentTypes": null,
"id": 1174,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1170,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "5426:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1172,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5426:14:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 1173,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5444:1:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "5426:19:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1175,
"nodeType": "ExpressionStatement",
"src": "5426:19:2"
},
{
"expression": {
"argumentTypes": null,
"id": 1180,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1176,
"name": "isSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 518,
"src": "5453:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1178,
"indexExpression": {
"argumentTypes": null,
"id": 1177,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5462:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "5453:21:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1179,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5477:5:2",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"src": "5453:29:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1181,
"nodeType": "ExpressionStatement",
"src": "5453:29:2"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1183,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5503:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1182,
"name": "RemoveSigner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 565,
"src": "5490:12:2",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 1184,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5490:25:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1185,
"nodeType": "ExpressionStatement",
"src": "5490:25:2"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1206,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1014,
"src": "5651:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1205,
"name": "clearVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1012,
"src": "5640:10:2",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 1207,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5640:23:2",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1208,
"nodeType": "ExpressionStatement",
"src": "5640:23:2"
}
]
},
"id": 1210,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1019,
"modifierName": {
"argumentTypes": null,
"id": 1018,
"name": "onlySigners",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 576,
"src": "4262:11:2",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "4262:13:2"
}
],
"name": "vote",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1017,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1014,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1210,
"src": "4222:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1013,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "4222:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1016,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 1210,
"src": "4243:10:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1015,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "4243:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4221:33:2"
},
"payable": false,
"returnParameters": {
"id": 1020,
"nodeType": "ParameterList",
"parameters": [],
"src": "4276:0:2"
},
"scope": 1394,
"src": "4208:1460:2",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1221,
"nodeType": "Block",
"src": "5743:35:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1217,
"name": "agentByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 507,
"src": "5756:11:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 1219,
"indexExpression": {
"argumentTypes": null,
"id": 1218,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1212,
"src": "5768:4:2",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5756:17:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1216,
"id": 1220,
"nodeType": "Return",
"src": "5749:24:2"
}
]
},
"id": 1222,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getAgentByName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1213,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1212,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 1222,
"src": "5696:11:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1211,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "5696:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5695:13:2"
},
"payable": false,
"returnParameters": {
"id": 1216,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1215,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1222,
"src": "5734:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1214,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5734:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5733:9:2"
},
"scope": 1394,
"src": "5672:106:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1234,
"nodeType": "Block",
"src": "5851:38:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1229,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "5864:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 1231,
"indexExpression": {
"argumentTypes": null,
"id": 1230,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1224,
"src": "5874:4:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5864:15:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 1232,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "name",
"nodeType": "MemberAccess",
"referencedDeclaration": 494,
"src": "5864:20:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"functionReturnParameters": 1228,
"id": 1233,
"nodeType": "Return",
"src": "5857:27:2"
}
]
},
"id": 1235,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getAgentName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1225,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1224,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1235,
"src": "5804:12:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1223,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5804:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5803:14:2"
},
"payable": false,
"returnParameters": {
"id": 1228,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1227,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1235,
"src": "5843:6:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1226,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "5843:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5842:8:2"
},
"scope": 1394,
"src": "5782:107:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1247,
"nodeType": "Block",
"src": "5971:46:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1242,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "5984:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 1244,
"indexExpression": {
"argumentTypes": null,
"id": 1243,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1237,
"src": "5994:4:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5984:15:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 1245,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "contractAddr",
"nodeType": "MemberAccess",
"referencedDeclaration": 496,
"src": "5984:28:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1241,
"id": 1246,
"nodeType": "Return",
"src": "5977:35:2"
}
]
},
"id": 1248,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getAgentContractAddr",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1238,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1237,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1248,
"src": "5923:12:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1236,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5923:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5922:14:2"
},
"payable": false,
"returnParameters": {
"id": 1241,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1240,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1248,
"src": "5962:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1239,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5962:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5961:9:2"
},
"scope": 1394,
"src": "5893:124:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1260,
"nodeType": "Block",
"src": "6090:38:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1255,
"name": "agentInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 503,
"src": "6103:9:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Agent_$499_storage_$",
"typeString": "mapping(address => struct AgentRegistry.Agent storage ref)"
}
},
"id": 1257,
"indexExpression": {
"argumentTypes": null,
"id": 1256,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1250,
"src": "6113:4:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6103:15:2",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agent_$499_storage",
"typeString": "struct AgentRegistry.Agent storage ref"
}
},
"id": 1258,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "host",
"nodeType": "MemberAccess",
"referencedDeclaration": 498,
"src": "6103:20:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"functionReturnParameters": 1254,
"id": 1259,
"nodeType": "Return",
"src": "6096:27:2"
}
]
},
"id": 1261,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getAgentHost",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1251,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1250,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1261,
"src": "6043:12:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1249,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6043:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6042:14:2"
},
"payable": false,
"returnParameters": {
"id": 1254,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1253,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1261,
"src": "6082:6:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1252,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "6082:6:2",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6081:8:2"
},
"scope": 1394,
"src": "6021:107:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1269,
"nodeType": "Block",
"src": "6188:32:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1266,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "6201:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1267,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6201:14:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1265,
"id": 1268,
"nodeType": "Return",
"src": "6194:21:2"
}
]
},
"id": 1270,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumSigners",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1262,
"nodeType": "ParameterList",
"parameters": [],
"src": "6154:2:2"
},
"payable": false,
"returnParameters": {
"id": 1265,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1264,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1270,
"src": "6182:4:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1263,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6182:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6181:6:2"
},
"scope": 1394,
"src": "6132:88:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1281,
"nodeType": "Block",
"src": "6287:30:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1277,
"name": "signers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "6300:7:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1279,
"indexExpression": {
"argumentTypes": null,
"id": 1278,
"name": "idx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1272,
"src": "6308:3:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6300:12:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1276,
"id": 1280,
"nodeType": "Return",
"src": "6293:19:2"
}
]
},
"id": 1282,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getSigner",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1273,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1272,
"name": "idx",
"nodeType": "VariableDeclaration",
"scope": 1282,
"src": "6243:8:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1271,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6243:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6242:10:2"
},
"payable": false,
"returnParameters": {
"id": 1276,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1275,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1282,
"src": "6278:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1274,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6278:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6277:9:2"
},
"scope": 1394,
"src": "6224:93:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1294,
"nodeType": "Block",
"src": "6395:44:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1289,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "6408:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 1291,
"indexExpression": {
"argumentTypes": null,
"id": 1290,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1284,
"src": "6415:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6408:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1292,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6408:26:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1288,
"id": 1293,
"nodeType": "Return",
"src": "6401:33:2"
}
]
},
"id": 1295,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumVoters",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1285,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1284,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1295,
"src": "6343:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1283,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6343:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6342:21:2"
},
"payable": false,
"returnParameters": {
"id": 1288,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1287,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1295,
"src": "6389:4:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1286,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6389:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6388:6:2"
},
"scope": 1394,
"src": "6321:118:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1310,
"nodeType": "Block",
"src": "6526:42:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1304,
"name": "voters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 523,
"src": "6539:6:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_address_$dyn_storage_$",
"typeString": "mapping(address => address[] storage ref)"
}
},
"id": 1306,
"indexExpression": {
"argumentTypes": null,
"id": 1305,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1297,
"src": "6546:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6539:19:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1308,
"indexExpression": {
"argumentTypes": null,
"id": 1307,
"name": "idx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1299,
"src": "6559:3:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6539:24:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1303,
"id": 1309,
"nodeType": "Return",
"src": "6532:31:2"
}
]
},
"id": 1311,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getVoter",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1300,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1297,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1311,
"src": "6461:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1296,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6461:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1299,
"name": "idx",
"nodeType": "VariableDeclaration",
"scope": 1311,
"src": "6482:8:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1298,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6482:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6460:31:2"
},
"payable": false,
"returnParameters": {
"id": 1303,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1302,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1311,
"src": "6517:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1301,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6517:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6516:9:2"
},
"scope": 1394,
"src": "6443:125:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1326,
"nodeType": "Block",
"src": "6661:47:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1320,
"name": "voteInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 535,
"src": "6674:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_bool_$_$",
"typeString": "mapping(address => mapping(address => bool))"
}
},
"id": 1322,
"indexExpression": {
"argumentTypes": null,
"id": 1321,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1313,
"src": "6683:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6674:21:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1324,
"indexExpression": {
"argumentTypes": null,
"id": 1323,
"name": "signer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1315,
"src": "6696:6:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6674:29:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 1319,
"id": 1325,
"nodeType": "Return",
"src": "6667:36:2"
}
]
},
"id": 1327,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getVoteInfo",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1316,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1313,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1327,
"src": "6593:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1312,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6593:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1315,
"name": "signer",
"nodeType": "VariableDeclaration",
"scope": 1327,
"src": "6614:14:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1314,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6614:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6592:37:2"
},
"payable": false,
"returnParameters": {
"id": 1319,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1318,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1327,
"src": "6655:4:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1317,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "6655:4:2",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6654:6:2"
},
"scope": 1394,
"src": "6572:136:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1338,
"nodeType": "Block",
"src": "6788:39:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1334,
"name": "yayVotes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 539,
"src": "6801:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
}
},
"id": 1336,
"indexExpression": {
"argumentTypes": null,
"id": 1335,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1329,
"src": "6810:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "6801:21:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1333,
"id": 1337,
"nodeType": "Return",
"src": "6794:28:2"
}
]
},
"id": 1339,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumYayVotes",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1330,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1329,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1339,
"src": "6736:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1328,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6736:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6735:21:2"
},
"payable": false,
"returnParameters": {
"id": 1333,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1332,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1339,
"src": "6782:4:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1331,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6782:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6781:6:2"
},
"scope": 1394,
"src": "6712:115:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1347,
"nodeType": "Block",
"src": "6892:37:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1344,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "6905:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1345,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "6905:19:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1343,
"id": 1346,
"nodeType": "Return",
"src": "6898:26:2"
}
]
},
"id": 1348,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumProspectives",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1340,
"nodeType": "ParameterList",
"parameters": [],
"src": "6858:2:2"
},
"payable": false,
"returnParameters": {
"id": 1343,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1342,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1348,
"src": "6886:4:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1341,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6886:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6885:6:2"
},
"scope": 1394,
"src": "6831:98:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1359,
"nodeType": "Block",
"src": "7001:35:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1355,
"name": "prospectives",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 542,
"src": "7014:12:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1357,
"indexExpression": {
"argumentTypes": null,
"id": 1356,
"name": "idx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1350,
"src": "7027:3:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "7014:17:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1354,
"id": 1358,
"nodeType": "Return",
"src": "7007:24:2"
}
]
},
"id": 1360,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getProspective",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1351,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1350,
"name": "idx",
"nodeType": "VariableDeclaration",
"scope": 1360,
"src": "6957:8:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1349,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6957:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6956:10:2"
},
"payable": false,
"returnParameters": {
"id": 1354,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1353,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1360,
"src": "6992:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1352,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6992:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6991:9:2"
},
"scope": 1394,
"src": "6933:103:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1368,
"nodeType": "Block",
"src": "7095:31:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1365,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "7108:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1366,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "7108:13:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1364,
"id": 1367,
"nodeType": "Return",
"src": "7101:20:2"
}
]
},
"id": 1369,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumKicked",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1361,
"nodeType": "ParameterList",
"parameters": [],
"src": "7061:2:2"
},
"payable": false,
"returnParameters": {
"id": 1364,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1363,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1369,
"src": "7089:4:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1362,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "7089:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7088:6:2"
},
"scope": 1394,
"src": "7040:86:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1380,
"nodeType": "Block",
"src": "7193:29:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1376,
"name": "kicked",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 545,
"src": "7206:6:2",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1378,
"indexExpression": {
"argumentTypes": null,
"id": 1377,
"name": "idx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1371,
"src": "7213:3:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "7206:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1375,
"id": 1379,
"nodeType": "Return",
"src": "7199:18:2"
}
]
},
"id": 1381,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getKicked",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1372,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1371,
"name": "idx",
"nodeType": "VariableDeclaration",
"scope": 1381,
"src": "7149:8:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1370,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "7149:4:2",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7148:10:2"
},
"payable": false,
"returnParameters": {
"id": 1375,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1374,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1381,
"src": "7184:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1373,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "7184:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7183:9:2"
},
"scope": 1394,
"src": "7130:92:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1392,
"nodeType": "Block",
"src": "7302:39:2",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1388,
"name": "proposer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 557,
"src": "7315:8:2",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_address_$",
"typeString": "mapping(address => address)"
}
},
"id": 1390,
"indexExpression": {
"argumentTypes": null,
"id": 1389,
"name": "prospective",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1383,
"src": "7324:11:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "7315:21:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1387,
"id": 1391,
"nodeType": "Return",
"src": "7308:28:2"
}
]
},
"id": 1393,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getProposer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1384,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1383,
"name": "prospective",
"nodeType": "VariableDeclaration",
"scope": 1393,
"src": "7247:19:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1382,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "7247:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7246:21:2"
},
"payable": false,
"returnParameters": {
"id": 1387,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1386,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1393,
"src": "7293:7:2",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1385,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "7293:7:2",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "7292:9:2"
},
"scope": 1394,
"src": "7226:115:2",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 1395,
"src": "37:7306:2"
}
],
"src": "0:7344:2"
},
"compiler": {
"name": "solc",
"version": "0.4.19+commit.c4cbbb05.Emscripten.clang"
},
"networks": {
"633732": {
"events": {},
"links": {},
"address": "0x05aa11b32b18e0648796998b421ca8241be55fe0",
"transactionHash": "0xb0951ff00af1e418c1617c823b74c7766e4f9a89fc591c55a51742218c4d2ad6"
}
},
"schemaVersion": "2.0.0",
"updatedAt": "2018-05-08T20:46:06.219Z"
}
================================================
FILE: SmartContracts/build/contracts/AllAccessRelationship.json
================================================
{
"contractName": "AllAccessRelationship",
"abi": [
{
"constant": true,
"inputs": [],
"name": "providerName",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "provider",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "patron",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "isViewer",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "viewers",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_provider",
"type": "address"
}
],
"name": "Relationship",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "name",
"type": "string"
}
],
"name": "setProviderName",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "name",
"type": "string"
},
{
"name": "viewer",
"type": "address"
}
],
"name": "addViewer",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "viewer",
"type": "address"
}
],
"name": "removeViewer",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getNumViewers",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "name",
"type": "string"
}
],
"name": "getViewerByName",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getViewerName",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "terminate",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x6060604052341561000f57600080fd5b61110f8061001e6000396000f3006060604052600436106100c4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062dad7d4146100c9578063046f3ab714610157578063085d48831461018057806309c0974f146101d55780630ba32b27146102515780630c08bf88146102a65780632bba6fb7146102bb578063322eb71d1461030c578063444ee902146103be5780635155cb161461041b5780639abdc7a21461047e578063bc1d7087146104b7578063d1d9891414610554575b600080fd5b34156100d457600080fd5b6100dc61058d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561016257600080fd5b61016a61062b565b6040518082815260200191505060405180910390f35b341561018b57600080fd5b610193610638565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e057600080fd5b61024f600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061065e565b005b341561025c57600080fd5b6102646108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102b157600080fd5b6102b96108c7565b005b34156102c657600080fd5b6102f2600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506109b6565b604051808215151515815260200191505060405180910390f35b341561031757600080fd5b610343600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506109d6565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610383578082015181840152602081019050610368565b50505050905090810190601f1680156103b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103c957600080fd5b610419600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610ac0565b005b341561042657600080fd5b61043c6004808035906020019091905050610ada565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561048957600080fd5b6104b5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b19565b005b34156104c257600080fd5b610512600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610b9d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561055f57600080fd5b61058b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c32565b005b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106235780601f106105f857610100808354040283529160200191610623565b820191906000526020600020905b81548152906001019060200180831161060657829003601f168201915b505050505081565b6000600380549050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106b957600080fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561071257600080fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506003805480600101828161077e9190610f36565b9160005260206000209001600083909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060408051908101604052808381526020018273ffffffffffffffffffffffffffffffffffffffff16815250600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000019080519060200190610853929190610f62565b5060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156109725750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561097c57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b60046020528060005260406000206000915054906101000a900460ff1681565b6109de610fe2565b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ab45780601f10610a8957610100808354040283529160200191610ab4565b820191906000526020600020905b815481529060010190602001808311610a9757829003601f168201915b50505050509050919050565b8060029080519060200190610ad6929190610ff6565b5050565b600381815481101515610ae957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006006826040518082805190602001908083835b602083101515610bd75780518252602082019150602081019050602083039250610bb2565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9057600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610ce857600080fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060009150600090505b600380549050811015610e73578115610df357600381815481101515610d6b57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360018303815481101515610da957fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8273ffffffffffffffffffffffffffffffffffffffff16600382815481101515610e1957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610e6657600191505b8080600101915050610d49565b6003600160038054905003815481101515610e8a57fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008082016000610f089190611076565b6001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555050505050565b815481835581811511610f5d57818360005260206000209182019101610f5c91906110be565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610fa357805160ff1916838001178555610fd1565b82800160010185558215610fd1579182015b82811115610fd0578251825591602001919060010190610fb5565b5b509050610fde91906110be565b5090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061103757805160ff1916838001178555611065565b82800160010185558215611065579182015b82811115611064578251825591602001919060010190611049565b5b50905061107291906110be565b5090565b50805460018160011615610100020316600290046000825580601f1061109c57506110bb565b601f0160209004906000526020600020908101906110ba91906110be565b5b50565b6110e091905b808211156110dc5760008160009055506001016110c4565b5090565b905600a165627a7a723058209fcc5953d625e5ac200560851bf568147c2fca466daf194880533963b4e6ae7f0029",
"deployedBytecode": "0x6060604052600436106100c4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062dad7d4146100c9578063046f3ab714610157578063085d48831461018057806309c0974f146101d55780630ba32b27146102515780630c08bf88146102a65780632bba6fb7146102bb578063322eb71d1461030c578063444ee902146103be5780635155cb161461041b5780639abdc7a21461047e578063bc1d7087146104b7578063d1d9891414610554575b600080fd5b34156100d457600080fd5b6100dc61058d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561016257600080fd5b61016a61062b565b6040518082815260200191505060405180910390f35b341561018b57600080fd5b610193610638565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e057600080fd5b61024f600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061065e565b005b341561025c57600080fd5b6102646108a2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102b157600080fd5b6102b96108c7565b005b34156102c657600080fd5b6102f2600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506109b6565b604051808215151515815260200191505060405180910390f35b341561031757600080fd5b610343600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506109d6565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610383578082015181840152602081019050610368565b50505050905090810190601f1680156103b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103c957600080fd5b610419600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610ac0565b005b341561042657600080fd5b61043c6004808035906020019091905050610ada565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561048957600080fd5b6104b5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b19565b005b34156104c257600080fd5b610512600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610b9d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561055f57600080fd5b61058b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c32565b005b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106235780601f106105f857610100808354040283529160200191610623565b820191906000526020600020905b81548152906001019060200180831161060657829003601f168201915b505050505081565b6000600380549050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106b957600080fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561071257600080fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506003805480600101828161077e9190610f36565b9160005260206000209001600083909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060408051908101604052808381526020018273ffffffffffffffffffffffffffffffffffffffff16815250600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000019080519060200190610853929190610f62565b5060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156109725750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561097c57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b60046020528060005260406000206000915054906101000a900460ff1681565b6109de610fe2565b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ab45780601f10610a8957610100808354040283529160200191610ab4565b820191906000526020600020905b815481529060010190602001808311610a9757829003601f168201915b50505050509050919050565b8060029080519060200190610ad6929190610ff6565b5050565b600381815481101515610ae957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006006826040518082805190602001908083835b602083101515610bd75780518252602082019150602081019050602083039250610bb2565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9057600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610ce857600080fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060009150600090505b600380549050811015610e73578115610df357600381815481101515610d6b57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360018303815481101515610da957fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8273ffffffffffffffffffffffffffffffffffffffff16600382815481101515610e1957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610e6657600191505b8080600101915050610d49565b6003600160038054905003815481101515610e8a57fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008082016000610f089190611076565b6001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555050505050565b815481835581811511610f5d57818360005260206000209182019101610f5c91906110be565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610fa357805160ff1916838001178555610fd1565b82800160010185558215610fd1579182015b82811115610fd0578251825591602001919060010190610fb5565b5b509050610fde91906110be565b5090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061103757805160ff1916838001178555611065565b82800160010185558215611065579182015b82811115611064578251825591602001919060010190611049565b5b50905061107291906110be565b5090565b50805460018160011615610100020316600290046000825580601f1061109c57506110bb565b601f0160209004906000526020600020908101906110ba91906110be565b5b50565b6110e091905b808211156110dc5760008160009055506001016110c4565b5090565b905600a165627a7a723058209fcc5953d625e5ac200560851bf568147c2fca466daf194880533963b4e6ae7f0029",
"sourceMap": "26:1955:3:-;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "26:1955:3:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;113:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1537:87:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;86:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;918:204;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;61:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1851:128;;;;;;;;;;;;;;230:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1739:108;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;839:75:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;202:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;481:104;;;;;;;;;;;;;;;;;;;;;;;;;;;;1628:107;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1126:407;;;;;;;;;;;;;;;;;;;;;;;;;;;;113:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1537:87::-;1586:4;1605:7;:14;;;;1598:21;;1537:87;:::o;86:23::-;;;;;;;;;;;;;:::o;918:204::-;449:6;;;;;;;;;;;435:20;;:10;:20;;;;432:33;;;457:8;;;432:33;997:8;:16;1006:6;997:16;;;;;;;;;;;;;;;;;;;;;;;;;996:17;988:26;;;;;;;;1040:4;1021:8;:16;1030:6;1021:16;;;;;;;;;;;;;;;;:23;;;;;;;;;;;;;;;;;;1050:7;:20;;;;;;;;;;;:::i;:::-;;;;;;;;;;1063:6;1050:20;;;;;;;;;;;;;;;;;;;;;;;1097;;;;;;;;;1104:4;1097:20;;;;1110:6;1097:20;;;;;1076:10;:18;1087:6;1076:18;;;;;;;;;;;;;;;:41;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;918:204;;:::o;61:21::-;;;;;;;;;;;;;:::o;1851:128::-;1904:6;;;;;;;;;;;1890:20;;:10;:20;;;;:46;;;;;1928:8;;;;;;;;;;;1914:22;;:10;:22;;;;1890:46;1887:59;;;1938:8;;;1887:59;1967:6;;;;;;;;;;;1954:20;;;230:40;;;;;;;;;;;;;;;;;;;;;;:::o;1739:108::-;1800:6;;:::i;:::-;1821:10;:16;1832:4;1821:16;;;;;;;;;;;;;;;:21;;1814:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1739:108;;;:::o;839:75::-;905:4;890:12;:19;;;;;;;;;;;;:::i;:::-;;839:75;:::o;202:24::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;481:104::-;544:10;535:6;;:19;;;;;;;;;;;;;;;;;;571:9;560:8;;:20;;;;;;;;;;;;;;;;;;481:104;:::o;1628:107::-;1690:7;1712:12;1725:4;1712:18;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:2;51:6;36:153;;;182:3;176:5;171:3;164:6;98:2;93:3;89;82:19;;123:2;118:3;114;107:19;;148:2;143:3;139;132:19;;36:153;;;274:1;267:3;263:2;259:3;254;250;246;315:4;311:3;305;299:5;295:3;356:4;350:3;344:5;340:3;389:7;380;377:2;372:3;365:6;3:399;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1705:25:3;;1628:107;;;:::o;1126:407::-;1248:14;1280:6;449;;;;;;;;;;;435:20;;:10;:20;;;;432:33;;;457:8;;;432:33;1194:8;:16;1203:6;1194:16;;;;;;;;;;;;;;;;;;;;;;;;;1186:25;;;;;;;;1237:5;1218:8;:16;1227:6;1218:16;;;;;;;;;;;;;;;;:24;;;;;;;;;;;;;;;;;;1265:5;1248:22;;1289:1;1280:10;;1276:182;1296:7;:14;;;;1292:1;:18;1276:182;;;1328:9;1325:60;;;1366:7;1374:1;1366:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;1349:7;1361:1;1357;:5;1349:14;;;;;;;;;;;;;;;;;;;:27;;;;;;;;;;;;;;;;;;1325:60;1409:6;1395:20;;:7;1403:1;1395:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;:20;;;1392:60;;;1439:4;1427:16;;1392:60;1312:3;;;;;;;1276:182;;;1470:7;1493:1;1478:7;:14;;;;:16;1470:25;;;;;;;;;;;;;;;;;;;1463:33;;;;;;;;;;;1509:10;:18;1520:6;1509:18;;;;;;;;;;;;;;;;1502:26;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;1126:407;;;:::o;26:1955::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o",
"source": "pragma solidity ^0.4.18;\n\ncontract AllAccessRelationship {\n address public patron;\n address public provider;\n string public providerName;\n\n struct Viewer {\n string name;\n address addr;\n }\n\n address[] public viewers;\n mapping(address => bool) public isViewer;\n mapping(address => Viewer) viewerInfo;\n mapping(string => address) viewerByName;\n\n uint256 constant UINT256_MAX = ~uint256(0);\n\n modifier isPatron() {\n if(msg.sender != patron) revert();\n _;\n }\n\n function Relationship(address _provider) public {\n patron = msg.sender;\n provider = _provider;\n }\n\n /****These functions should be left commented out until a use case for them arises\n function setPatron(address addr) isPatron {\n patron = addr;\n }\n function setProvider(address addr) isPatron {\n provider = addr;\n }\n ******************/\n\n function setProviderName(string name) public {\n providerName = name;\n }\n\n function addViewer(string name, address viewer) public isPatron {\n require(!isViewer[viewer]);\n\n isViewer[viewer] = true;\n viewers.push(viewer);\n viewerInfo[viewer] = Viewer(name, viewer);\n }\n\n function removeViewer(address viewer) public isPatron {\n require(isViewer[viewer]);\n\n isViewer[viewer] = false;\n bool overwrite = false;\n for(uint i = 0; i < viewers.length; i++) {\n if(overwrite) {\n viewers[i - 1] = viewers[i];\n }\n if(viewers[i] == viewer) {\n overwrite = true;\n }\n }\n delete(viewers[viewers.length-1]);\n delete(viewerInfo[viewer]);\n }\n\n function getNumViewers() public constant returns(uint) {\n return viewers.length;\n }\n\n function getViewerByName(string name) public constant returns(address) {\n return viewerByName[name];\n }\n\n function getViewerName(address addr) public constant returns(string) {\n return viewerInfo[addr].name;\n }\n\n function terminate() public {\n if(msg.sender != patron && msg.sender != provider) revert();\n selfdestruct(patron);\n }\n}\n",
"sourcePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/AllAccessRelationship.sol",
"ast": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/AllAccessRelationship.sol",
"exportedSymbols": {
"AllAccessRelationship": [
1635
]
},
"id": 1636,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1396,
"literals": [
"solidity",
"^",
"0.4",
".18"
],
"nodeType": "PragmaDirective",
"src": "0:24:3"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 1635,
"linearizedBaseContracts": [
1635
],
"name": "AllAccessRelationship",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 1398,
"name": "patron",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "61:21:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1397,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "61:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1400,
"name": "provider",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "86:23:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1399,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "86:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1402,
"name": "providerName",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "113:26:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
},
"typeName": {
"id": 1401,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "113:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"canonicalName": "AllAccessRelationship.Viewer",
"id": 1407,
"members": [
{
"constant": false,
"id": 1404,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 1407,
"src": "164:11:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
},
"typeName": {
"id": 1403,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "164:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1406,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1407,
"src": "181:12:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1405,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "181:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Viewer",
"nodeType": "StructDefinition",
"scope": 1635,
"src": "144:54:3",
"visibility": "public"
},
{
"constant": false,
"id": 1410,
"name": "viewers",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "202:24:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 1408,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "202:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1409,
"length": null,
"nodeType": "ArrayTypeName",
"src": "202:9:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1414,
"name": "isViewer",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "230:40:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 1413,
"keyType": {
"id": 1411,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "238:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "230:24:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 1412,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "249:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1418,
"name": "viewerInfo",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "274:37:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$1407_storage_$",
"typeString": "mapping(address => struct AllAccessRelationship.Viewer storage ref)"
},
"typeName": {
"id": 1417,
"keyType": {
"id": 1415,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "282:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "274:26:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$1407_storage_$",
"typeString": "mapping(address => struct AllAccessRelationship.Viewer storage ref)"
},
"valueType": {
"contractScope": null,
"id": 1416,
"name": "Viewer",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1407,
"src": "293:6:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_storage_ptr",
"typeString": "struct AllAccessRelationship.Viewer storage pointer"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1422,
"name": "viewerByName",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "315:39:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
},
"typeName": {
"id": 1421,
"keyType": {
"id": 1419,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "323:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"nodeType": "Mapping",
"src": "315:26:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
},
"valueType": {
"id": 1420,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "333:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": true,
"id": 1428,
"name": "UINT256_MAX",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "359:42:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1423,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "359:7:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"id": 1427,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "~",
"prefix": true,
"src": "390:11:3",
"subExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1425,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "399:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1424,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "391:7:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": "uint256"
},
"id": 1426,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "391:10:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"body": {
"id": 1439,
"nodeType": "Block",
"src": "426:51:3",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1433,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1430,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "435:3:3",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1431,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "435:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 1432,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1398,
"src": "449:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "435:20:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1437,
"nodeType": "IfStatement",
"src": "432:33:3",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 1434,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2203,
"src": "457:6:3",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1435,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "457:8:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1436,
"nodeType": "ExpressionStatement",
"src": "457:8:3"
}
},
{
"id": 1438,
"nodeType": "PlaceholderStatement",
"src": "471:1:3"
}
]
},
"id": 1440,
"name": "isPatron",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 1429,
"nodeType": "ParameterList",
"parameters": [],
"src": "423:2:3"
},
"src": "406:71:3",
"visibility": "internal"
},
{
"body": {
"id": 1454,
"nodeType": "Block",
"src": "529:56:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1448,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1445,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1398,
"src": "535:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1446,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "544:3:3",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1447,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "544:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "535:19:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1449,
"nodeType": "ExpressionStatement",
"src": "535:19:3"
},
{
"expression": {
"argumentTypes": null,
"id": 1452,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1450,
"name": "provider",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1400,
"src": "560:8:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1451,
"name": "_provider",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1442,
"src": "571:9:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "560:20:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1453,
"nodeType": "ExpressionStatement",
"src": "560:20:3"
}
]
},
"id": 1455,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "Relationship",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1443,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1442,
"name": "_provider",
"nodeType": "VariableDeclaration",
"scope": 1455,
"src": "503:17:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1441,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "503:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "502:19:3"
},
"payable": false,
"returnParameters": {
"id": 1444,
"nodeType": "ParameterList",
"parameters": [],
"src": "529:0:3"
},
"scope": 1635,
"src": "481:104:3",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1464,
"nodeType": "Block",
"src": "884:30:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1462,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1460,
"name": "providerName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1402,
"src": "890:12:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1461,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1457,
"src": "905:4:3",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "890:19:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 1463,
"nodeType": "ExpressionStatement",
"src": "890:19:3"
}
]
},
"id": 1465,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "setProviderName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1458,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1457,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 1465,
"src": "864:11:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1456,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "864:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "863:13:3"
},
"payable": false,
"returnParameters": {
"id": 1459,
"nodeType": "ParameterList",
"parameters": [],
"src": "884:0:3"
},
"scope": 1635,
"src": "839:75:3",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1502,
"nodeType": "Block",
"src": "982:140:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1478,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "996:17:3",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1475,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1414,
"src": "997:8:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1477,
"indexExpression": {
"argumentTypes": null,
"id": 1476,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1469,
"src": "1006:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "997:16:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1474,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2202,
"src": "988:7:3",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1479,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "988:26:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1480,
"nodeType": "ExpressionStatement",
"src": "988:26:3"
},
{
"expression": {
"argumentTypes": null,
"id": 1485,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1481,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1414,
"src": "1021:8:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1483,
"indexExpression": {
"argumentTypes": null,
"id": 1482,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1469,
"src": "1030:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1021:16:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1484,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1040:4:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "1021:23:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1486,
"nodeType": "ExpressionStatement",
"src": "1021:23:3"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1490,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1469,
"src": "1063:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 1487,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1050:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1489,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1050:12:3",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 1491,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1050:20:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1492,
"nodeType": "ExpressionStatement",
"src": "1050:20:3"
},
{
"expression": {
"argumentTypes": null,
"id": 1500,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1493,
"name": "viewerInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1418,
"src": "1076:10:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$1407_storage_$",
"typeString": "mapping(address => struct AllAccessRelationship.Viewer storage ref)"
}
},
"id": 1495,
"indexExpression": {
"argumentTypes": null,
"id": 1494,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1469,
"src": "1087:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1076:18:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_storage",
"typeString": "struct AllAccessRelationship.Viewer storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1497,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1467,
"src": "1104:4:3",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 1498,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1469,
"src": "1110:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1496,
"name": "Viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1407,
"src": "1097:6:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Viewer_$1407_storage_ptr_$",
"typeString": "type(struct AllAccessRelationship.Viewer storage pointer)"
}
},
"id": 1499,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1097:20:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_memory",
"typeString": "struct AllAccessRelationship.Viewer memory"
}
},
"src": "1076:41:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_storage",
"typeString": "struct AllAccessRelationship.Viewer storage ref"
}
},
"id": 1501,
"nodeType": "ExpressionStatement",
"src": "1076:41:3"
}
]
},
"id": 1503,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1472,
"modifierName": {
"argumentTypes": null,
"id": 1471,
"name": "isPatron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1440,
"src": "973:8:3",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "973:8:3"
}
],
"name": "addViewer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1470,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1467,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 1503,
"src": "937:11:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1466,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "937:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1469,
"name": "viewer",
"nodeType": "VariableDeclaration",
"scope": 1503,
"src": "950:14:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1468,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "950:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "936:29:3"
},
"payable": false,
"returnParameters": {
"id": 1473,
"nodeType": "ParameterList",
"parameters": [],
"src": "982:0:3"
},
"scope": 1635,
"src": "918:204:3",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1578,
"nodeType": "Block",
"src": "1180:353:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1511,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1414,
"src": "1194:8:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1513,
"indexExpression": {
"argumentTypes": null,
"id": 1512,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1505,
"src": "1203:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1194:16:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1510,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2202,
"src": "1186:7:3",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1514,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1186:25:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1515,
"nodeType": "ExpressionStatement",
"src": "1186:25:3"
},
{
"expression": {
"argumentTypes": null,
"id": 1520,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1516,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1414,
"src": "1218:8:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1518,
"indexExpression": {
"argumentTypes": null,
"id": 1517,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1505,
"src": "1227:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1218:16:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1519,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1237:5:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"src": "1218:24:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1521,
"nodeType": "ExpressionStatement",
"src": "1218:24:3"
},
{
"assignments": [
1523
],
"declarations": [
{
"constant": false,
"id": 1523,
"name": "overwrite",
"nodeType": "VariableDeclaration",
"scope": 1579,
"src": "1248:14:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1522,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1248:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1525,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1524,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1265:5:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "1248:22:3"
},
{
"body": {
"id": 1561,
"nodeType": "Block",
"src": "1317:141:3",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 1537,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1523,
"src": "1328:9:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1549,
"nodeType": "IfStatement",
"src": "1325:60:3",
"trueBody": {
"id": 1548,
"nodeType": "Block",
"src": "1339:46:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1546,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1538,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1349:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1542,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1541,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1539,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1527,
"src": "1357:1:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1540,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1361:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1357:5:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1349:14:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1543,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1366:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1545,
"indexExpression": {
"argumentTypes": null,
"id": 1544,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1527,
"src": "1374:1:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1366:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1349:27:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1547,
"nodeType": "ExpressionStatement",
"src": "1349:27:3"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1554,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1550,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1395:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1552,
"indexExpression": {
"argumentTypes": null,
"id": 1551,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1527,
"src": "1403:1:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1395:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 1553,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1505,
"src": "1409:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1395:20:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1560,
"nodeType": "IfStatement",
"src": "1392:60:3",
"trueBody": {
"id": 1559,
"nodeType": "Block",
"src": "1417:35:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1557,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1555,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1523,
"src": "1427:9:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1556,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1439:4:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "1427:16:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1558,
"nodeType": "ExpressionStatement",
"src": "1427:16:3"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1533,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1530,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1527,
"src": "1292:1:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1531,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1296:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1532,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1296:14:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1292:18:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1562,
"initializationExpression": {
"assignments": [
1527
],
"declarations": [
{
"constant": false,
"id": 1527,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 1579,
"src": "1280:6:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1526,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1280:4:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1529,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 1528,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1289:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "1280:10:3"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 1535,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "1312:3:3",
"subExpression": {
"argumentTypes": null,
"id": 1534,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1527,
"src": "1312:1:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1536,
"nodeType": "ExpressionStatement",
"src": "1312:3:3"
},
"nodeType": "ForStatement",
"src": "1276:182:3"
},
{
"expression": {
"argumentTypes": null,
"id": 1570,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "1463:33:3",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1563,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1470:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1568,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1567,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1564,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1478:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1565,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1478:14:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1566,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1493:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1478:16:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1470:25:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 1569,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "1469:27:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1571,
"nodeType": "ExpressionStatement",
"src": "1463:33:3"
},
{
"expression": {
"argumentTypes": null,
"id": 1576,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "1502:26:3",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1572,
"name": "viewerInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1418,
"src": "1509:10:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$1407_storage_$",
"typeString": "mapping(address => struct AllAccessRelationship.Viewer storage ref)"
}
},
"id": 1574,
"indexExpression": {
"argumentTypes": null,
"id": 1573,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1505,
"src": "1520:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1509:18:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_storage",
"typeString": "struct AllAccessRelationship.Viewer storage ref"
}
}
],
"id": 1575,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "1508:20:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_storage",
"typeString": "struct AllAccessRelationship.Viewer storage ref"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1577,
"nodeType": "ExpressionStatement",
"src": "1502:26:3"
}
]
},
"id": 1579,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1508,
"modifierName": {
"argumentTypes": null,
"id": 1507,
"name": "isPatron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1440,
"src": "1171:8:3",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1171:8:3"
}
],
"name": "removeViewer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1506,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1505,
"name": "viewer",
"nodeType": "VariableDeclaration",
"scope": 1579,
"src": "1148:14:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1504,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1148:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1147:16:3"
},
"payable": false,
"returnParameters": {
"id": 1509,
"nodeType": "ParameterList",
"parameters": [],
"src": "1180:0:3"
},
"scope": 1635,
"src": "1126:407:3",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1587,
"nodeType": "Block",
"src": "1592:32:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1584,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1605:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1585,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1605:14:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1583,
"id": 1586,
"nodeType": "Return",
"src": "1598:21:3"
}
]
},
"id": 1588,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumViewers",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1580,
"nodeType": "ParameterList",
"parameters": [],
"src": "1559:2:3"
},
"payable": false,
"returnParameters": {
"id": 1583,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1582,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1588,
"src": "1586:4:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1581,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1586:4:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1585:6:3"
},
"scope": 1635,
"src": "1537:87:3",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1599,
"nodeType": "Block",
"src": "1699:36:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1595,
"name": "viewerByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1422,
"src": "1712:12:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 1597,
"indexExpression": {
"argumentTypes": null,
"id": 1596,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1590,
"src": "1725:4:3",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1712:18:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1594,
"id": 1598,
"nodeType": "Return",
"src": "1705:25:3"
}
]
},
"id": 1600,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getViewerByName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1591,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1590,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 1600,
"src": "1653:11:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1589,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1653:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1652:13:3"
},
"payable": false,
"returnParameters": {
"id": 1594,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1593,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1600,
"src": "1690:7:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1592,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1690:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1689:9:3"
},
"scope": 1635,
"src": "1628:107:3",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1612,
"nodeType": "Block",
"src": "1808:39:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1607,
"name": "viewerInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1418,
"src": "1821:10:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$1407_storage_$",
"typeString": "mapping(address => struct AllAccessRelationship.Viewer storage ref)"
}
},
"id": 1609,
"indexExpression": {
"argumentTypes": null,
"id": 1608,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1602,
"src": "1832:4:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1821:16:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_storage",
"typeString": "struct AllAccessRelationship.Viewer storage ref"
}
},
"id": 1610,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "name",
"nodeType": "MemberAccess",
"referencedDeclaration": 1404,
"src": "1821:21:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"functionReturnParameters": 1606,
"id": 1611,
"nodeType": "Return",
"src": "1814:28:3"
}
]
},
"id": 1613,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getViewerName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1603,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1602,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1613,
"src": "1762:12:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1601,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1762:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1761:14:3"
},
"payable": false,
"returnParameters": {
"id": 1606,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1605,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1613,
"src": "1800:6:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1604,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1800:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1799:8:3"
},
"scope": 1635,
"src": "1739:108:3",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1633,
"nodeType": "Block",
"src": "1879:100:3",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1624,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1619,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1616,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "1890:3:3",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1617,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1890:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 1618,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1398,
"src": "1904:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1890:20:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1623,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1620,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "1914:3:3",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1621,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1914:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 1622,
"name": "provider",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1400,
"src": "1928:8:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1914:22:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1890:46:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1628,
"nodeType": "IfStatement",
"src": "1887:59:3",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 1625,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2203,
"src": "1938:6:3",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1626,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1938:8:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1627,
"nodeType": "ExpressionStatement",
"src": "1938:8:3"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1630,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1398,
"src": "1967:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1629,
"name": "selfdestruct",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2205,
"src": "1954:12:3",
"typeDescriptions": {
"typeIdentifier": "t_function_selfdestruct_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 1631,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1954:20:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1632,
"nodeType": "ExpressionStatement",
"src": "1954:20:3"
}
]
},
"id": 1634,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "terminate",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1614,
"nodeType": "ParameterList",
"parameters": [],
"src": "1869:2:3"
},
"payable": false,
"returnParameters": {
"id": 1615,
"nodeType": "ParameterList",
"parameters": [],
"src": "1879:0:3"
},
"scope": 1635,
"src": "1851:128:3",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
}
],
"scope": 1636,
"src": "26:1955:3"
}
],
"src": "0:1982:3"
},
"legacyAST": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/AllAccessRelationship.sol",
"exportedSymbols": {
"AllAccessRelationship": [
1635
]
},
"id": 1636,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1396,
"literals": [
"solidity",
"^",
"0.4",
".18"
],
"nodeType": "PragmaDirective",
"src": "0:24:3"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 1635,
"linearizedBaseContracts": [
1635
],
"name": "AllAccessRelationship",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 1398,
"name": "patron",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "61:21:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1397,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "61:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1400,
"name": "provider",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "86:23:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1399,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "86:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1402,
"name": "providerName",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "113:26:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
},
"typeName": {
"id": 1401,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "113:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"canonicalName": "AllAccessRelationship.Viewer",
"id": 1407,
"members": [
{
"constant": false,
"id": 1404,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 1407,
"src": "164:11:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
},
"typeName": {
"id": 1403,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "164:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1406,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1407,
"src": "181:12:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1405,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "181:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Viewer",
"nodeType": "StructDefinition",
"scope": 1635,
"src": "144:54:3",
"visibility": "public"
},
{
"constant": false,
"id": 1410,
"name": "viewers",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "202:24:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 1408,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "202:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1409,
"length": null,
"nodeType": "ArrayTypeName",
"src": "202:9:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1414,
"name": "isViewer",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "230:40:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 1413,
"keyType": {
"id": 1411,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "238:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "230:24:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 1412,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "249:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1418,
"name": "viewerInfo",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "274:37:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$1407_storage_$",
"typeString": "mapping(address => struct AllAccessRelationship.Viewer storage ref)"
},
"typeName": {
"id": 1417,
"keyType": {
"id": 1415,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "282:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "274:26:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$1407_storage_$",
"typeString": "mapping(address => struct AllAccessRelationship.Viewer storage ref)"
},
"valueType": {
"contractScope": null,
"id": 1416,
"name": "Viewer",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1407,
"src": "293:6:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_storage_ptr",
"typeString": "struct AllAccessRelationship.Viewer storage pointer"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1422,
"name": "viewerByName",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "315:39:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
},
"typeName": {
"id": 1421,
"keyType": {
"id": 1419,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "323:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"nodeType": "Mapping",
"src": "315:26:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
},
"valueType": {
"id": 1420,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "333:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": true,
"id": 1428,
"name": "UINT256_MAX",
"nodeType": "VariableDeclaration",
"scope": 1635,
"src": "359:42:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1423,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "359:7:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"id": 1427,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "~",
"prefix": true,
"src": "390:11:3",
"subExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1425,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "399:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 1424,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "391:7:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": "uint256"
},
"id": 1426,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "391:10:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"body": {
"id": 1439,
"nodeType": "Block",
"src": "426:51:3",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1433,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1430,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "435:3:3",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1431,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "435:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 1432,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1398,
"src": "449:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "435:20:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1437,
"nodeType": "IfStatement",
"src": "432:33:3",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 1434,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2203,
"src": "457:6:3",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1435,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "457:8:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1436,
"nodeType": "ExpressionStatement",
"src": "457:8:3"
}
},
{
"id": 1438,
"nodeType": "PlaceholderStatement",
"src": "471:1:3"
}
]
},
"id": 1440,
"name": "isPatron",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 1429,
"nodeType": "ParameterList",
"parameters": [],
"src": "423:2:3"
},
"src": "406:71:3",
"visibility": "internal"
},
{
"body": {
"id": 1454,
"nodeType": "Block",
"src": "529:56:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1448,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1445,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1398,
"src": "535:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1446,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "544:3:3",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1447,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "544:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "535:19:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1449,
"nodeType": "ExpressionStatement",
"src": "535:19:3"
},
{
"expression": {
"argumentTypes": null,
"id": 1452,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1450,
"name": "provider",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1400,
"src": "560:8:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1451,
"name": "_provider",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1442,
"src": "571:9:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "560:20:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1453,
"nodeType": "ExpressionStatement",
"src": "560:20:3"
}
]
},
"id": 1455,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "Relationship",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1443,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1442,
"name": "_provider",
"nodeType": "VariableDeclaration",
"scope": 1455,
"src": "503:17:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1441,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "503:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "502:19:3"
},
"payable": false,
"returnParameters": {
"id": 1444,
"nodeType": "ParameterList",
"parameters": [],
"src": "529:0:3"
},
"scope": 1635,
"src": "481:104:3",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1464,
"nodeType": "Block",
"src": "884:30:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1462,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1460,
"name": "providerName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1402,
"src": "890:12:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1461,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1457,
"src": "905:4:3",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "890:19:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 1463,
"nodeType": "ExpressionStatement",
"src": "890:19:3"
}
]
},
"id": 1465,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "setProviderName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1458,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1457,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 1465,
"src": "864:11:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1456,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "864:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "863:13:3"
},
"payable": false,
"returnParameters": {
"id": 1459,
"nodeType": "ParameterList",
"parameters": [],
"src": "884:0:3"
},
"scope": 1635,
"src": "839:75:3",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1502,
"nodeType": "Block",
"src": "982:140:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1478,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "996:17:3",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1475,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1414,
"src": "997:8:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1477,
"indexExpression": {
"argumentTypes": null,
"id": 1476,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1469,
"src": "1006:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "997:16:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1474,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2202,
"src": "988:7:3",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1479,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "988:26:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1480,
"nodeType": "ExpressionStatement",
"src": "988:26:3"
},
{
"expression": {
"argumentTypes": null,
"id": 1485,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1481,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1414,
"src": "1021:8:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1483,
"indexExpression": {
"argumentTypes": null,
"id": 1482,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1469,
"src": "1030:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1021:16:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1484,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1040:4:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "1021:23:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1486,
"nodeType": "ExpressionStatement",
"src": "1021:23:3"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1490,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1469,
"src": "1063:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 1487,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1050:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1489,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1050:12:3",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 1491,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1050:20:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1492,
"nodeType": "ExpressionStatement",
"src": "1050:20:3"
},
{
"expression": {
"argumentTypes": null,
"id": 1500,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1493,
"name": "viewerInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1418,
"src": "1076:10:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$1407_storage_$",
"typeString": "mapping(address => struct AllAccessRelationship.Viewer storage ref)"
}
},
"id": 1495,
"indexExpression": {
"argumentTypes": null,
"id": 1494,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1469,
"src": "1087:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1076:18:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_storage",
"typeString": "struct AllAccessRelationship.Viewer storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1497,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1467,
"src": "1104:4:3",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 1498,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1469,
"src": "1110:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1496,
"name": "Viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1407,
"src": "1097:6:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Viewer_$1407_storage_ptr_$",
"typeString": "type(struct AllAccessRelationship.Viewer storage pointer)"
}
},
"id": 1499,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1097:20:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_memory",
"typeString": "struct AllAccessRelationship.Viewer memory"
}
},
"src": "1076:41:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_storage",
"typeString": "struct AllAccessRelationship.Viewer storage ref"
}
},
"id": 1501,
"nodeType": "ExpressionStatement",
"src": "1076:41:3"
}
]
},
"id": 1503,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1472,
"modifierName": {
"argumentTypes": null,
"id": 1471,
"name": "isPatron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1440,
"src": "973:8:3",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "973:8:3"
}
],
"name": "addViewer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1470,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1467,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 1503,
"src": "937:11:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1466,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "937:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1469,
"name": "viewer",
"nodeType": "VariableDeclaration",
"scope": 1503,
"src": "950:14:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1468,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "950:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "936:29:3"
},
"payable": false,
"returnParameters": {
"id": 1473,
"nodeType": "ParameterList",
"parameters": [],
"src": "982:0:3"
},
"scope": 1635,
"src": "918:204:3",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1578,
"nodeType": "Block",
"src": "1180:353:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1511,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1414,
"src": "1194:8:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1513,
"indexExpression": {
"argumentTypes": null,
"id": 1512,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1505,
"src": "1203:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1194:16:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1510,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2202,
"src": "1186:7:3",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1514,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1186:25:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1515,
"nodeType": "ExpressionStatement",
"src": "1186:25:3"
},
{
"expression": {
"argumentTypes": null,
"id": 1520,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1516,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1414,
"src": "1218:8:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1518,
"indexExpression": {
"argumentTypes": null,
"id": 1517,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1505,
"src": "1227:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1218:16:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1519,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1237:5:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"src": "1218:24:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1521,
"nodeType": "ExpressionStatement",
"src": "1218:24:3"
},
{
"assignments": [
1523
],
"declarations": [
{
"constant": false,
"id": 1523,
"name": "overwrite",
"nodeType": "VariableDeclaration",
"scope": 1579,
"src": "1248:14:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1522,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1248:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1525,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1524,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1265:5:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "1248:22:3"
},
{
"body": {
"id": 1561,
"nodeType": "Block",
"src": "1317:141:3",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 1537,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1523,
"src": "1328:9:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1549,
"nodeType": "IfStatement",
"src": "1325:60:3",
"trueBody": {
"id": 1548,
"nodeType": "Block",
"src": "1339:46:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1546,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1538,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1349:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1542,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1541,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1539,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1527,
"src": "1357:1:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1540,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1361:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1357:5:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1349:14:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1543,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1366:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1545,
"indexExpression": {
"argumentTypes": null,
"id": 1544,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1527,
"src": "1374:1:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1366:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1349:27:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1547,
"nodeType": "ExpressionStatement",
"src": "1349:27:3"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1554,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1550,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1395:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1552,
"indexExpression": {
"argumentTypes": null,
"id": 1551,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1527,
"src": "1403:1:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1395:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 1553,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1505,
"src": "1409:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1395:20:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1560,
"nodeType": "IfStatement",
"src": "1392:60:3",
"trueBody": {
"id": 1559,
"nodeType": "Block",
"src": "1417:35:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1557,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1555,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1523,
"src": "1427:9:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1556,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1439:4:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "1427:16:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1558,
"nodeType": "ExpressionStatement",
"src": "1427:16:3"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1533,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1530,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1527,
"src": "1292:1:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1531,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1296:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1532,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1296:14:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1292:18:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1562,
"initializationExpression": {
"assignments": [
1527
],
"declarations": [
{
"constant": false,
"id": 1527,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 1579,
"src": "1280:6:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1526,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1280:4:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1529,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 1528,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1289:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "1280:10:3"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 1535,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "1312:3:3",
"subExpression": {
"argumentTypes": null,
"id": 1534,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1527,
"src": "1312:1:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1536,
"nodeType": "ExpressionStatement",
"src": "1312:3:3"
},
"nodeType": "ForStatement",
"src": "1276:182:3"
},
{
"expression": {
"argumentTypes": null,
"id": 1570,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "1463:33:3",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1563,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1470:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1568,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1567,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1564,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1478:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1565,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1478:14:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 1566,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1493:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1478:16:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1470:25:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 1569,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "1469:27:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1571,
"nodeType": "ExpressionStatement",
"src": "1463:33:3"
},
{
"expression": {
"argumentTypes": null,
"id": 1576,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "1502:26:3",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1572,
"name": "viewerInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1418,
"src": "1509:10:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$1407_storage_$",
"typeString": "mapping(address => struct AllAccessRelationship.Viewer storage ref)"
}
},
"id": 1574,
"indexExpression": {
"argumentTypes": null,
"id": 1573,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1505,
"src": "1520:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1509:18:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_storage",
"typeString": "struct AllAccessRelationship.Viewer storage ref"
}
}
],
"id": 1575,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "1508:20:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_storage",
"typeString": "struct AllAccessRelationship.Viewer storage ref"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1577,
"nodeType": "ExpressionStatement",
"src": "1502:26:3"
}
]
},
"id": 1579,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1508,
"modifierName": {
"argumentTypes": null,
"id": 1507,
"name": "isPatron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1440,
"src": "1171:8:3",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1171:8:3"
}
],
"name": "removeViewer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1506,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1505,
"name": "viewer",
"nodeType": "VariableDeclaration",
"scope": 1579,
"src": "1148:14:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1504,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1148:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1147:16:3"
},
"payable": false,
"returnParameters": {
"id": 1509,
"nodeType": "ParameterList",
"parameters": [],
"src": "1180:0:3"
},
"scope": 1635,
"src": "1126:407:3",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1587,
"nodeType": "Block",
"src": "1592:32:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1584,
"name": "viewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1410,
"src": "1605:7:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1585,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1605:14:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1583,
"id": 1586,
"nodeType": "Return",
"src": "1598:21:3"
}
]
},
"id": 1588,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumViewers",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1580,
"nodeType": "ParameterList",
"parameters": [],
"src": "1559:2:3"
},
"payable": false,
"returnParameters": {
"id": 1583,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1582,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1588,
"src": "1586:4:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1581,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1586:4:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1585:6:3"
},
"scope": 1635,
"src": "1537:87:3",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1599,
"nodeType": "Block",
"src": "1699:36:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1595,
"name": "viewerByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1422,
"src": "1712:12:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 1597,
"indexExpression": {
"argumentTypes": null,
"id": 1596,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1590,
"src": "1725:4:3",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1712:18:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1594,
"id": 1598,
"nodeType": "Return",
"src": "1705:25:3"
}
]
},
"id": 1600,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getViewerByName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1591,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1590,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 1600,
"src": "1653:11:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1589,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1653:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1652:13:3"
},
"payable": false,
"returnParameters": {
"id": 1594,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1593,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1600,
"src": "1690:7:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1592,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1690:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1689:9:3"
},
"scope": 1635,
"src": "1628:107:3",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1612,
"nodeType": "Block",
"src": "1808:39:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 1607,
"name": "viewerInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1418,
"src": "1821:10:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$1407_storage_$",
"typeString": "mapping(address => struct AllAccessRelationship.Viewer storage ref)"
}
},
"id": 1609,
"indexExpression": {
"argumentTypes": null,
"id": 1608,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1602,
"src": "1832:4:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1821:16:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$1407_storage",
"typeString": "struct AllAccessRelationship.Viewer storage ref"
}
},
"id": 1610,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "name",
"nodeType": "MemberAccess",
"referencedDeclaration": 1404,
"src": "1821:21:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"functionReturnParameters": 1606,
"id": 1611,
"nodeType": "Return",
"src": "1814:28:3"
}
]
},
"id": 1613,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getViewerName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1603,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1602,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1613,
"src": "1762:12:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1601,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1762:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1761:14:3"
},
"payable": false,
"returnParameters": {
"id": 1606,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1605,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1613,
"src": "1800:6:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 1604,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1800:6:3",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1799:8:3"
},
"scope": 1635,
"src": "1739:108:3",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1633,
"nodeType": "Block",
"src": "1879:100:3",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 1624,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1619,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1616,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "1890:3:3",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1617,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1890:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 1618,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1398,
"src": "1904:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1890:20:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1623,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1620,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "1914:3:3",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1621,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1914:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 1622,
"name": "provider",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1400,
"src": "1928:8:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1914:22:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1890:46:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1628,
"nodeType": "IfStatement",
"src": "1887:59:3",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 1625,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2203,
"src": "1938:6:3",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1626,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1938:8:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1627,
"nodeType": "ExpressionStatement",
"src": "1938:8:3"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1630,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1398,
"src": "1967:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1629,
"name": "selfdestruct",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2205,
"src": "1954:12:3",
"typeDescriptions": {
"typeIdentifier": "t_function_selfdestruct_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 1631,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1954:20:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1632,
"nodeType": "ExpressionStatement",
"src": "1954:20:3"
}
]
},
"id": 1634,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "terminate",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1614,
"nodeType": "ParameterList",
"parameters": [],
"src": "1869:2:3"
},
"payable": false,
"returnParameters": {
"id": 1615,
"nodeType": "ParameterList",
"parameters": [],
"src": "1879:0:3"
},
"scope": 1635,
"src": "1851:128:3",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
}
],
"scope": 1636,
"src": "26:1955:3"
}
],
"src": "0:1982:3"
},
"compiler": {
"name": "solc",
"version": "0.4.19+commit.c4cbbb05.Emscripten.clang"
},
"networks": {},
"schemaVersion": "2.0.0",
"updatedAt": "2018-06-05T05:32:07.938Z"
}
================================================
FILE: SmartContracts/build/contracts/DeadmanSwitch.json
================================================
{
"contractName": "DeadmanSwitch",
"abi": [
{
"constant": true,
"inputs": [],
"name": "lastTouch",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "timeout",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "relationships",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "agent",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "setAgent",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "r",
"type": "address"
}
],
"name": "addRelationship",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getNumRelationships",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "touch",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_timeout",
"type": "uint256"
}
],
"name": "setTimeout",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "isAlive",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506105e68061005e6000396000f3006060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806333403002146100a95780634136aa35146100d257806370dea79a146100ff57806379bda9371461012857806394aa271814610161578063a55526db146101c4578063bcf685ed146101d9578063c58a34cc14610212578063e968177e14610235578063f5ff5c761461025e575b600080fd5b34156100b457600080fd5b6100bc6102b3565b6040518082815260200191505060405180910390f35b34156100dd57600080fd5b6100e56102b9565b604051808215151515815260200191505060405180910390f35b341561010a57600080fd5b6101126102ca565b6040518082815260200191505060405180910390f35b341561013357600080fd5b61015f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506102d0565b005b341561016c57600080fd5b6101826004808035906020019091905050610391565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101cf57600080fd5b6101d76103d0565b005b34156101e457600080fd5b610210600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610434565b005b341561021d57600080fd5b61023360048080359060200190919050506104d2565b005b341561024057600080fd5b610248610537565b6040518082815260200191505060405180910390f35b341561026957600080fd5b610271610544565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60025481565b600060035460025401421115905090565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561032b57600080fd5b6001805480600101828161033f9190610569565b9160005260206000209001600083909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6001818154811015156103a057fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561042b57600080fd5b42600281905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561048f57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561052d57600080fd5b8060038190555050565b6000600180549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b8154818355818115116105905781836000526020600020918201910161058f9190610595565b5b505050565b6105b791905b808211156105b357600081600090555060010161059b565b5090565b905600a165627a7a72305820817a1962cb2f39cd66933c251e20cc797f2d1c102926a0f654e232a7ceeccee60029",
"deployedBytecode": "0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806333403002146100a95780634136aa35146100d257806370dea79a146100ff57806379bda9371461012857806394aa271814610161578063a55526db146101c4578063bcf685ed146101d9578063c58a34cc14610212578063e968177e14610235578063f5ff5c761461025e575b600080fd5b34156100b457600080fd5b6100bc6102b3565b6040518082815260200191505060405180910390f35b34156100dd57600080fd5b6100e56102b9565b604051808215151515815260200191505060405180910390f35b341561010a57600080fd5b6101126102ca565b6040518082815260200191505060405180910390f35b341561013357600080fd5b61015f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506102d0565b005b341561016c57600080fd5b6101826004808035906020019091905050610391565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101cf57600080fd5b6101d76103d0565b005b34156101e457600080fd5b610210600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610434565b005b341561021d57600080fd5b61023360048080359060200190919050506104d2565b005b341561024057600080fd5b610248610537565b6040518082815260200191505060405180910390f35b341561026957600080fd5b610271610544565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60025481565b600060035460025401421115905090565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561032b57600080fd5b6001805480600101828161033f9190610569565b9160005260206000209001600083909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6001818154811015156103a057fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561042b57600080fd5b42600281905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561048f57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561052d57600080fd5b8060038190555050565b6000600180549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b8154818355818115116105905781836000526020600020918201910161058f9190610595565b5b505050565b6105b791905b808211156105b357600081600090555060010161059b565b5090565b905600a165627a7a72305820817a1962cb2f39cd66933c251e20cc797f2d1c102926a0f654e232a7ceeccee60029",
"sourceMap": "26:926:4:-;;;376:61;;;;;;;;422:10;414:5;;:18;;;;;;;;;;;;;;;;;;26:926;;;;;;",
"deployedSourceMap": "26:926:4:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;153:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;855:95;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;233:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;515:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;77:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;706:60;;;;;;;;;;;;;;441:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;770:81;;;;;;;;;;;;;;;;;;;;;;;;;;602:100;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;53:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;153:21;;;;:::o;855:95::-;899:4;938:7;;926:9;;:19;919:3;:26;;912:33;;855:95;:::o;233:19::-;;;;:::o;515:83::-;345:5;;;;;;;;;;;331:19;;:10;:19;;;;328:32;;;352:8;;;328:32;572:13;:21;;;;;;;;;;;:::i;:::-;;;;;;;;;;591:1;572:21;;;;;;;;;;;;;;;;;;;;;;;515:83;:::o;77:30::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;706:60::-;345:5;;;;;;;;;;;331:19;;:10;:19;;;;328:32;;;352:8;;;328:32;758:3;746:9;:15;;;;706:60::o;441:70::-;345:5;;;;;;;;;;;331:19;;:10;:19;;;;328:32;;;352:8;;;328:32;502:4;494:5;;:12;;;;;;;;;;;;;;;;;;441:70;:::o;770:81::-;345:5;;;;;;;;;;;331:19;;:10;:19;;;;328:32;;;352:8;;;328:32;838:8;828:7;:18;;;;770:81;:::o;602:100::-;658:4;677:13;:20;;;;670:27;;602:100;:::o;53:20::-;;;;;;;;;;;;;:::o;26:926::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o",
"source": "pragma solidity ^0.4.15;\n\ncontract DeadmanSwitch {\n address public agent;\n address[] public relationships; //list of Relationship contract addresses\n uint public lastTouch; // gets updated whenever the owner touches this switch\n uint public timeout; //minimum time in miliseconds between touches\n\n modifier isOwner() {\n if(msg.sender != agent) revert();\n _;\n }\n\n function DeadmanSwitch() public {\n agent = msg.sender;\n }\n\n function setAgent(address addr) public isOwner {\n agent = addr;\n }\n\n function addRelationship(address r) public isOwner {\n relationships.push(r);\n }\n\n function getNumRelationships() public constant returns (uint) {\n return relationships.length;\n }\n\n function touch() public isOwner {\n lastTouch = now;\n }\n\n function setTimeout(uint _timeout) public isOwner {\n timeout = _timeout;\n }\n\n function isAlive() public constant returns (bool){\n return now <= lastTouch + timeout;\n }\n}\n",
"sourcePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/DeadmanSwitch.sol",
"ast": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/DeadmanSwitch.sol",
"exportedSymbols": {
"DeadmanSwitch": [
1737
]
},
"id": 1738,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1637,
"literals": [
"solidity",
"^",
"0.4",
".15"
],
"nodeType": "PragmaDirective",
"src": "0:24:4"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 1737,
"linearizedBaseContracts": [
1737
],
"name": "DeadmanSwitch",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 1639,
"name": "agent",
"nodeType": "VariableDeclaration",
"scope": 1737,
"src": "53:20:4",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1638,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "53:7:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1642,
"name": "relationships",
"nodeType": "VariableDeclaration",
"scope": 1737,
"src": "77:30:4",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 1640,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "77:7:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1641,
"length": null,
"nodeType": "ArrayTypeName",
"src": "77:9:4",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1644,
"name": "lastTouch",
"nodeType": "VariableDeclaration",
"scope": 1737,
"src": "153:21:4",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1643,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "153:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1646,
"name": "timeout",
"nodeType": "VariableDeclaration",
"scope": 1737,
"src": "233:19:4",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1645,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "233:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 1657,
"nodeType": "Block",
"src": "322:50:4",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1651,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1648,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "331:3:4",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1649,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "331:10:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 1650,
"name": "agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1639,
"src": "345:5:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "331:19:4",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1655,
"nodeType": "IfStatement",
"src": "328:32:4",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 1652,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2203,
"src": "352:6:4",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1653,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "352:8:4",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1654,
"nodeType": "ExpressionStatement",
"src": "352:8:4"
}
},
{
"id": 1656,
"nodeType": "PlaceholderStatement",
"src": "366:1:4"
}
]
},
"id": 1658,
"name": "isOwner",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 1647,
"nodeType": "ParameterList",
"parameters": [],
"src": "319:2:4"
},
"src": "303:69:4",
"visibility": "internal"
},
{
"body": {
"id": 1666,
"nodeType": "Block",
"src": "408:29:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1664,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1661,
"name": "agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1639,
"src": "414:5:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1662,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "422:3:4",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1663,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "422:10:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "414:18:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1665,
"nodeType": "ExpressionStatement",
"src": "414:18:4"
}
]
},
"id": 1667,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "DeadmanSwitch",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1659,
"nodeType": "ParameterList",
"parameters": [],
"src": "398:2:4"
},
"payable": false,
"returnParameters": {
"id": 1660,
"nodeType": "ParameterList",
"parameters": [],
"src": "408:0:4"
},
"scope": 1737,
"src": "376:61:4",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1678,
"nodeType": "Block",
"src": "488:23:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1676,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1674,
"name": "agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1639,
"src": "494:5:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1675,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1669,
"src": "502:4:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "494:12:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1677,
"nodeType": "ExpressionStatement",
"src": "494:12:4"
}
]
},
"id": 1679,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1672,
"modifierName": {
"argumentTypes": null,
"id": 1671,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1658,
"src": "480:7:4",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "480:7:4"
}
],
"name": "setAgent",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1670,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1669,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1679,
"src": "459:12:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1668,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "459:7:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "458:14:4"
},
"payable": false,
"returnParameters": {
"id": 1673,
"nodeType": "ParameterList",
"parameters": [],
"src": "488:0:4"
},
"scope": 1737,
"src": "441:70:4",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1692,
"nodeType": "Block",
"src": "566:32:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1689,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1681,
"src": "591:1:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 1686,
"name": "relationships",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1642,
"src": "572:13:4",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1688,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "572:18:4",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 1690,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "572:21:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1691,
"nodeType": "ExpressionStatement",
"src": "572:21:4"
}
]
},
"id": 1693,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1684,
"modifierName": {
"argumentTypes": null,
"id": 1683,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1658,
"src": "558:7:4",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "558:7:4"
}
],
"name": "addRelationship",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1682,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1681,
"name": "r",
"nodeType": "VariableDeclaration",
"scope": 1693,
"src": "540:9:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1680,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "540:7:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "539:11:4"
},
"payable": false,
"returnParameters": {
"id": 1685,
"nodeType": "ParameterList",
"parameters": [],
"src": "566:0:4"
},
"scope": 1737,
"src": "515:83:4",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1701,
"nodeType": "Block",
"src": "664:38:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1698,
"name": "relationships",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1642,
"src": "677:13:4",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1699,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "677:20:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1697,
"id": 1700,
"nodeType": "Return",
"src": "670:27:4"
}
]
},
"id": 1702,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumRelationships",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1694,
"nodeType": "ParameterList",
"parameters": [],
"src": "630:2:4"
},
"payable": false,
"returnParameters": {
"id": 1697,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1696,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1702,
"src": "658:4:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1695,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "658:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "657:6:4"
},
"scope": 1737,
"src": "602:100:4",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1711,
"nodeType": "Block",
"src": "738:28:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1709,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1707,
"name": "lastTouch",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1644,
"src": "746:9:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1708,
"name": "now",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2201,
"src": "758:3:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "746:15:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1710,
"nodeType": "ExpressionStatement",
"src": "746:15:4"
}
]
},
"id": 1712,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1705,
"modifierName": {
"argumentTypes": null,
"id": 1704,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1658,
"src": "730:7:4",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "730:7:4"
}
],
"name": "touch",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1703,
"nodeType": "ParameterList",
"parameters": [],
"src": "720:2:4"
},
"payable": false,
"returnParameters": {
"id": 1706,
"nodeType": "ParameterList",
"parameters": [],
"src": "738:0:4"
},
"scope": 1737,
"src": "706:60:4",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1723,
"nodeType": "Block",
"src": "820:31:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1721,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1719,
"name": "timeout",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1646,
"src": "828:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1720,
"name": "_timeout",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1714,
"src": "838:8:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "828:18:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1722,
"nodeType": "ExpressionStatement",
"src": "828:18:4"
}
]
},
"id": 1724,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1717,
"modifierName": {
"argumentTypes": null,
"id": 1716,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1658,
"src": "812:7:4",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "812:7:4"
}
],
"name": "setTimeout",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1715,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1714,
"name": "_timeout",
"nodeType": "VariableDeclaration",
"scope": 1724,
"src": "790:13:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1713,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "790:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "789:15:4"
},
"payable": false,
"returnParameters": {
"id": 1718,
"nodeType": "ParameterList",
"parameters": [],
"src": "820:0:4"
},
"scope": 1737,
"src": "770:81:4",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1735,
"nodeType": "Block",
"src": "904:46:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1733,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1729,
"name": "now",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2201,
"src": "919:3:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1732,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1730,
"name": "lastTouch",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1644,
"src": "926:9:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"id": 1731,
"name": "timeout",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1646,
"src": "938:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "926:19:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "919:26:4",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 1728,
"id": 1734,
"nodeType": "Return",
"src": "912:33:4"
}
]
},
"id": 1736,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "isAlive",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1725,
"nodeType": "ParameterList",
"parameters": [],
"src": "871:2:4"
},
"payable": false,
"returnParameters": {
"id": 1728,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1727,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1736,
"src": "899:4:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1726,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "899:4:4",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "898:6:4"
},
"scope": 1737,
"src": "855:95:4",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 1738,
"src": "26:926:4"
}
],
"src": "0:953:4"
},
"legacyAST": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/DeadmanSwitch.sol",
"exportedSymbols": {
"DeadmanSwitch": [
1737
]
},
"id": 1738,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1637,
"literals": [
"solidity",
"^",
"0.4",
".15"
],
"nodeType": "PragmaDirective",
"src": "0:24:4"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 1737,
"linearizedBaseContracts": [
1737
],
"name": "DeadmanSwitch",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 1639,
"name": "agent",
"nodeType": "VariableDeclaration",
"scope": 1737,
"src": "53:20:4",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1638,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "53:7:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1642,
"name": "relationships",
"nodeType": "VariableDeclaration",
"scope": 1737,
"src": "77:30:4",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
},
"typeName": {
"baseType": {
"id": 1640,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "77:7:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1641,
"length": null,
"nodeType": "ArrayTypeName",
"src": "77:9:4",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1644,
"name": "lastTouch",
"nodeType": "VariableDeclaration",
"scope": 1737,
"src": "153:21:4",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1643,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "153:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1646,
"name": "timeout",
"nodeType": "VariableDeclaration",
"scope": 1737,
"src": "233:19:4",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1645,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "233:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 1657,
"nodeType": "Block",
"src": "322:50:4",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1651,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1648,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "331:3:4",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1649,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "331:10:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 1650,
"name": "agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1639,
"src": "345:5:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "331:19:4",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1655,
"nodeType": "IfStatement",
"src": "328:32:4",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 1652,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2203,
"src": "352:6:4",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1653,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "352:8:4",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1654,
"nodeType": "ExpressionStatement",
"src": "352:8:4"
}
},
{
"id": 1656,
"nodeType": "PlaceholderStatement",
"src": "366:1:4"
}
]
},
"id": 1658,
"name": "isOwner",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 1647,
"nodeType": "ParameterList",
"parameters": [],
"src": "319:2:4"
},
"src": "303:69:4",
"visibility": "internal"
},
{
"body": {
"id": 1666,
"nodeType": "Block",
"src": "408:29:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1664,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1661,
"name": "agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1639,
"src": "414:5:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1662,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2199,
"src": "422:3:4",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1663,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "422:10:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "414:18:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1665,
"nodeType": "ExpressionStatement",
"src": "414:18:4"
}
]
},
"id": 1667,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "DeadmanSwitch",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1659,
"nodeType": "ParameterList",
"parameters": [],
"src": "398:2:4"
},
"payable": false,
"returnParameters": {
"id": 1660,
"nodeType": "ParameterList",
"parameters": [],
"src": "408:0:4"
},
"scope": 1737,
"src": "376:61:4",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1678,
"nodeType": "Block",
"src": "488:23:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1676,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1674,
"name": "agent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1639,
"src": "494:5:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1675,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1669,
"src": "502:4:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "494:12:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1677,
"nodeType": "ExpressionStatement",
"src": "494:12:4"
}
]
},
"id": 1679,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1672,
"modifierName": {
"argumentTypes": null,
"id": 1671,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1658,
"src": "480:7:4",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "480:7:4"
}
],
"name": "setAgent",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1670,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1669,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1679,
"src": "459:12:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1668,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "459:7:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "458:14:4"
},
"payable": false,
"returnParameters": {
"id": 1673,
"nodeType": "ParameterList",
"parameters": [],
"src": "488:0:4"
},
"scope": 1737,
"src": "441:70:4",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1692,
"nodeType": "Block",
"src": "566:32:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1689,
"name": "r",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1681,
"src": "591:1:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 1686,
"name": "relationships",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1642,
"src": "572:13:4",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1688,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "572:18:4",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 1690,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "572:21:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1691,
"nodeType": "ExpressionStatement",
"src": "572:21:4"
}
]
},
"id": 1693,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1684,
"modifierName": {
"argumentTypes": null,
"id": 1683,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1658,
"src": "558:7:4",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "558:7:4"
}
],
"name": "addRelationship",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1682,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1681,
"name": "r",
"nodeType": "VariableDeclaration",
"scope": 1693,
"src": "540:9:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1680,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "540:7:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "539:11:4"
},
"payable": false,
"returnParameters": {
"id": 1685,
"nodeType": "ParameterList",
"parameters": [],
"src": "566:0:4"
},
"scope": 1737,
"src": "515:83:4",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1701,
"nodeType": "Block",
"src": "664:38:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1698,
"name": "relationships",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1642,
"src": "677:13:4",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 1699,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "677:20:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1697,
"id": 1700,
"nodeType": "Return",
"src": "670:27:4"
}
]
},
"id": 1702,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumRelationships",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1694,
"nodeType": "ParameterList",
"parameters": [],
"src": "630:2:4"
},
"payable": false,
"returnParameters": {
"id": 1697,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1696,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1702,
"src": "658:4:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1695,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "658:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "657:6:4"
},
"scope": 1737,
"src": "602:100:4",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1711,
"nodeType": "Block",
"src": "738:28:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1709,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1707,
"name": "lastTouch",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1644,
"src": "746:9:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1708,
"name": "now",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2201,
"src": "758:3:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "746:15:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1710,
"nodeType": "ExpressionStatement",
"src": "746:15:4"
}
]
},
"id": 1712,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1705,
"modifierName": {
"argumentTypes": null,
"id": 1704,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1658,
"src": "730:7:4",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "730:7:4"
}
],
"name": "touch",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1703,
"nodeType": "ParameterList",
"parameters": [],
"src": "720:2:4"
},
"payable": false,
"returnParameters": {
"id": 1706,
"nodeType": "ParameterList",
"parameters": [],
"src": "738:0:4"
},
"scope": 1737,
"src": "706:60:4",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1723,
"nodeType": "Block",
"src": "820:31:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1721,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1719,
"name": "timeout",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1646,
"src": "828:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1720,
"name": "_timeout",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1714,
"src": "838:8:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "828:18:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1722,
"nodeType": "ExpressionStatement",
"src": "828:18:4"
}
]
},
"id": 1724,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1717,
"modifierName": {
"argumentTypes": null,
"id": 1716,
"name": "isOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1658,
"src": "812:7:4",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "812:7:4"
}
],
"name": "setTimeout",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1715,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1714,
"name": "_timeout",
"nodeType": "VariableDeclaration",
"scope": 1724,
"src": "790:13:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1713,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "790:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "789:15:4"
},
"payable": false,
"returnParameters": {
"id": 1718,
"nodeType": "ParameterList",
"parameters": [],
"src": "820:0:4"
},
"scope": 1737,
"src": "770:81:4",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1735,
"nodeType": "Block",
"src": "904:46:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1733,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1729,
"name": "now",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2201,
"src": "919:3:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1732,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1730,
"name": "lastTouch",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1644,
"src": "926:9:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"id": 1731,
"name": "timeout",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1646,
"src": "938:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "926:19:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "919:26:4",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 1728,
"id": 1734,
"nodeType": "Return",
"src": "912:33:4"
}
]
},
"id": 1736,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "isAlive",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1725,
"nodeType": "ParameterList",
"parameters": [],
"src": "871:2:4"
},
"payable": false,
"returnParameters": {
"id": 1728,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1727,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1736,
"src": "899:4:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1726,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "899:4:4",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "898:6:4"
},
"scope": 1737,
"src": "855:95:4",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
}
],
"scope": 1738,
"src": "26:926:4"
}
],
"src": "0:953:4"
},
"compiler": {
"name": "solc",
"version": "0.4.19+commit.c4cbbb05.Emscripten.clang"
},
"networks": {},
"schemaVersion": "2.0.0",
"updatedAt": "2018-06-05T05:32:07.939Z"
}
================================================
FILE: SmartContracts/build/contracts/Migrations.json
================================================
{
"contractName": "Migrations",
"abi": [
{
"constant": true,
"inputs": [],
"name": "last_completed_migration",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": false,
"inputs": [
{
"name": "completed",
"type": "uint256"
}
],
"name": "setCompleted",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "new_address",
"type": "address"
}
],
"name": "upgrade",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102db8061005e6000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100a05780638da5cb5b146100c9578063fdacd5761461011e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610141565b005b34156100ab57600080fd5b6100b3610224565b6040518082815260200191505060405180910390f35b34156100d457600080fd5b6100dc61022a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012957600080fd5b61013f600480803590602001909190505061024f565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610220578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561020b57600080fd5b6102c65a03f1151561021c57600080fd5b5050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102ac57806001819055505b505600a165627a7a723058208e62444eff59b9da4fa816e5fcf2bf4ef53a765d50ab2a4bfa5109525412f10b0029",
"deployedBytecode": "0x606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100a05780638da5cb5b146100c9578063fdacd5761461011e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610141565b005b34156100ab57600080fd5b6100b3610224565b6040518082815260200191505060405180910390f35b34156100d457600080fd5b6100dc61022a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012957600080fd5b61013f600480803590602001909190505061024f565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610220578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561020b57600080fd5b6102c65a03f1151561021c57600080fd5b5050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102ac57806001819055505b505600a165627a7a723058208e62444eff59b9da4fa816e5fcf2bf4ef53a765d50ab2a4bfa5109525412f10b0029",
"sourceMap": "25:467:5:-;;;177:51;;;;;;;;213:10;205:5;;:18;;;;;;;;;;;;;;;;;;25:467;;;;;;",
"deployedSourceMap": "25:467:5:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;332:158;;;;;;;;;;;;;;;;;;;;;;;;;;;;73:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;232:96;;;;;;;;;;;;;;;;;;;;;;;;;;332:158;387:19;160:5;;;;;;;;;;;146:19;;:10;:19;;;142:26;;;420:11;387:45;;438:8;:21;;;460:24;;438:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;142:26;332:158;;:::o;73:36::-;;;;:::o;49:20::-;;;;;;;;;;;;;:::o;232:96::-;160:5;;;;;;;;;;;146:19;;:10;:19;;;142:26;;;314:9;287:24;:36;;;;142:26;232:96;:::o",
"source": "pragma solidity ^0.4.4;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n modifier restricted() {\n if (msg.sender == owner) _;\n }\n\n function Migrations() {\n owner = msg.sender;\n }\n\n function setCompleted(uint completed) restricted {\n last_completed_migration = completed;\n }\n\n function upgrade(address new_address) restricted {\n Migrations upgraded = Migrations(new_address);\n upgraded.setCompleted(last_completed_migration);\n }\n}\n",
"sourcePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/Migrations.sol",
"ast": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/Migrations.sol",
"exportedSymbols": {
"Migrations": [
1794
]
},
"id": 1795,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1739,
"literals": [
"solidity",
"^",
"0.4",
".4"
],
"nodeType": "PragmaDirective",
"src": "0:23:5"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 1794,
"linearizedBaseContracts": [
1794
],
"name": "Migrations",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 1741,
"name": "owner",
"nodeType": "VariableDeclaration",
"scope": 1794,
"src": "49:20:5",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1740,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "49:7:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1743,
"name": "last_completed_migration",
"nodeType": "VariableDeclaration",
"scope": 1794,
"src": "73:36:5",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1742,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "73:4:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 1751,
"nodeType": "Block",
"src": "136:37:5",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1748,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1745,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "146:3:5",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1746,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "146:10:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 1747,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1741,
"src": "160:5:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "146:19:5",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1750,
"nodeType": "IfStatement",
"src": "142:26:5",
"trueBody": {
"id": 1749,
"nodeType": "PlaceholderStatement",
"src": "167:1:5"
}
}
]
},
"id": 1752,
"name": "restricted",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 1744,
"nodeType": "ParameterList",
"parameters": [],
"src": "133:2:5"
},
"src": "114:59:5",
"visibility": "internal"
},
{
"body": {
"id": 1760,
"nodeType": "Block",
"src": "199:29:5",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1758,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1755,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1741,
"src": "205:5:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1756,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "213:3:5",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1757,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "213:10:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "205:18:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1759,
"nodeType": "ExpressionStatement",
"src": "205:18:5"
}
]
},
"id": 1761,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "Migrations",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1753,
"nodeType": "ParameterList",
"parameters": [],
"src": "196:2:5"
},
"payable": false,
"returnParameters": {
"id": 1754,
"nodeType": "ParameterList",
"parameters": [],
"src": "199:0:5"
},
"scope": 1794,
"src": "177:51:5",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1772,
"nodeType": "Block",
"src": "281:47:5",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1770,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1768,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1743,
"src": "287:24:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1769,
"name": "completed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1763,
"src": "314:9:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "287:36:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1771,
"nodeType": "ExpressionStatement",
"src": "287:36:5"
}
]
},
"id": 1773,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1766,
"modifierName": {
"argumentTypes": null,
"id": 1765,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1752,
"src": "270:10:5",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "270:10:5"
}
],
"name": "setCompleted",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1764,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1763,
"name": "completed",
"nodeType": "VariableDeclaration",
"scope": 1773,
"src": "254:14:5",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1762,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "254:4:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "253:16:5"
},
"payable": false,
"returnParameters": {
"id": 1767,
"nodeType": "ParameterList",
"parameters": [],
"src": "281:0:5"
},
"scope": 1794,
"src": "232:96:5",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1792,
"nodeType": "Block",
"src": "381:109:5",
"statements": [
{
"assignments": [
1781
],
"declarations": [
{
"constant": false,
"id": 1781,
"name": "upgraded",
"nodeType": "VariableDeclaration",
"scope": 1793,
"src": "387:19:5",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1794",
"typeString": "contract Migrations"
},
"typeName": {
"contractScope": null,
"id": 1780,
"name": "Migrations",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1794,
"src": "387:10:5",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1794",
"typeString": "contract Migrations"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1785,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1783,
"name": "new_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1775,
"src": "420:11:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1782,
"name": "Migrations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1794,
"src": "409:10:5",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Migrations_$1794_$",
"typeString": "type(contract Migrations)"
}
},
"id": 1784,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "409:23:5",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1794",
"typeString": "contract Migrations"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "387:45:5"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1789,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1743,
"src": "460:24:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 1786,
"name": "upgraded",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1781,
"src": "438:8:5",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1794",
"typeString": "contract Migrations"
}
},
"id": 1788,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "setCompleted",
"nodeType": "MemberAccess",
"referencedDeclaration": 1773,
"src": "438:21:5",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256) external"
}
},
"id": 1790,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "438:47:5",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1791,
"nodeType": "ExpressionStatement",
"src": "438:47:5"
}
]
},
"id": 1793,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1778,
"modifierName": {
"argumentTypes": null,
"id": 1777,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1752,
"src": "370:10:5",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "370:10:5"
}
],
"name": "upgrade",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1776,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1775,
"name": "new_address",
"nodeType": "VariableDeclaration",
"scope": 1793,
"src": "349:19:5",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1774,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "349:7:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "348:21:5"
},
"payable": false,
"returnParameters": {
"id": 1779,
"nodeType": "ParameterList",
"parameters": [],
"src": "381:0:5"
},
"scope": 1794,
"src": "332:158:5",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
}
],
"scope": 1795,
"src": "25:467:5"
}
],
"src": "0:493:5"
},
"legacyAST": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/Migrations.sol",
"exportedSymbols": {
"Migrations": [
1794
]
},
"id": 1795,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1739,
"literals": [
"solidity",
"^",
"0.4",
".4"
],
"nodeType": "PragmaDirective",
"src": "0:23:5"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 1794,
"linearizedBaseContracts": [
1794
],
"name": "Migrations",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 1741,
"name": "owner",
"nodeType": "VariableDeclaration",
"scope": 1794,
"src": "49:20:5",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1740,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "49:7:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1743,
"name": "last_completed_migration",
"nodeType": "VariableDeclaration",
"scope": 1794,
"src": "73:36:5",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1742,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "73:4:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 1751,
"nodeType": "Block",
"src": "136:37:5",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1748,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1745,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "146:3:5",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1746,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "146:10:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 1747,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1741,
"src": "160:5:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "146:19:5",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1750,
"nodeType": "IfStatement",
"src": "142:26:5",
"trueBody": {
"id": 1749,
"nodeType": "PlaceholderStatement",
"src": "167:1:5"
}
}
]
},
"id": 1752,
"name": "restricted",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 1744,
"nodeType": "ParameterList",
"parameters": [],
"src": "133:2:5"
},
"src": "114:59:5",
"visibility": "internal"
},
{
"body": {
"id": 1760,
"nodeType": "Block",
"src": "199:29:5",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1758,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1755,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1741,
"src": "205:5:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1756,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "213:3:5",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1757,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "213:10:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "205:18:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1759,
"nodeType": "ExpressionStatement",
"src": "205:18:5"
}
]
},
"id": 1761,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "Migrations",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1753,
"nodeType": "ParameterList",
"parameters": [],
"src": "196:2:5"
},
"payable": false,
"returnParameters": {
"id": 1754,
"nodeType": "ParameterList",
"parameters": [],
"src": "199:0:5"
},
"scope": 1794,
"src": "177:51:5",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1772,
"nodeType": "Block",
"src": "281:47:5",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1770,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1768,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1743,
"src": "287:24:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1769,
"name": "completed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1763,
"src": "314:9:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "287:36:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1771,
"nodeType": "ExpressionStatement",
"src": "287:36:5"
}
]
},
"id": 1773,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1766,
"modifierName": {
"argumentTypes": null,
"id": 1765,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1752,
"src": "270:10:5",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "270:10:5"
}
],
"name": "setCompleted",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1764,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1763,
"name": "completed",
"nodeType": "VariableDeclaration",
"scope": 1773,
"src": "254:14:5",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1762,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "254:4:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "253:16:5"
},
"payable": false,
"returnParameters": {
"id": 1767,
"nodeType": "ParameterList",
"parameters": [],
"src": "281:0:5"
},
"scope": 1794,
"src": "232:96:5",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 1792,
"nodeType": "Block",
"src": "381:109:5",
"statements": [
{
"assignments": [
1781
],
"declarations": [
{
"constant": false,
"id": 1781,
"name": "upgraded",
"nodeType": "VariableDeclaration",
"scope": 1793,
"src": "387:19:5",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1794",
"typeString": "contract Migrations"
},
"typeName": {
"contractScope": null,
"id": 1780,
"name": "Migrations",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1794,
"src": "387:10:5",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1794",
"typeString": "contract Migrations"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1785,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1783,
"name": "new_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1775,
"src": "420:11:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1782,
"name": "Migrations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1794,
"src": "409:10:5",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Migrations_$1794_$",
"typeString": "type(contract Migrations)"
}
},
"id": 1784,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "409:23:5",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1794",
"typeString": "contract Migrations"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "387:45:5"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1789,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1743,
"src": "460:24:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 1786,
"name": "upgraded",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1781,
"src": "438:8:5",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1794",
"typeString": "contract Migrations"
}
},
"id": 1788,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "setCompleted",
"nodeType": "MemberAccess",
"referencedDeclaration": 1773,
"src": "438:21:5",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256) external"
}
},
"id": 1790,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "438:47:5",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1791,
"nodeType": "ExpressionStatement",
"src": "438:47:5"
}
]
},
"id": 1793,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 1778,
"modifierName": {
"argumentTypes": null,
"id": 1777,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1752,
"src": "370:10:5",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "370:10:5"
}
],
"name": "upgrade",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1776,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1775,
"name": "new_address",
"nodeType": "VariableDeclaration",
"scope": 1793,
"src": "349:19:5",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1774,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "349:7:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "348:21:5"
},
"payable": false,
"returnParameters": {
"id": 1779,
"nodeType": "ParameterList",
"parameters": [],
"src": "381:0:5"
},
"scope": 1794,
"src": "332:158:5",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
}
],
"scope": 1795,
"src": "25:467:5"
}
],
"src": "0:493:5"
},
"compiler": {
"name": "solc",
"version": "0.4.19+commit.c4cbbb05.Emscripten.clang"
},
"networks": {
"633732": {
"events": {},
"links": {},
"address": "0x4bdc6f0dfcbf23b2cd52ca2904b381d6d585de96",
"transactionHash": "0xc1645ebd62bb46a73fd943eb44734b745f9c0b05f0cbfb105bda37cf719d5c65"
}
},
"schemaVersion": "2.0.0",
"updatedAt": "2018-05-08T20:46:06.186Z"
}
================================================
FILE: SmartContracts/build/contracts/Relationship.json
================================================
{
"contractName": "Relationship",
"abi": [
{
"constant": true,
"inputs": [],
"name": "providerName",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "provider",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "patron",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "providerAddr",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "isViewer",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_provider",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "string"
}
],
"name": "setProviderAddress",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "name",
"type": "string"
}
],
"name": "setProviderName",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "addViewerGroup",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "viewerGroup",
"type": "uint256"
}
],
"name": "removeViewerGroup",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "name",
"type": "string"
},
{
"name": "viewerGroup",
"type": "uint256"
},
{
"name": "viewer",
"type": "address"
},
{
"name": "provAddr",
"type": "string"
}
],
"name": "addViewer",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "viewerGroup",
"type": "uint256"
},
{
"name": "viewer",
"type": "address"
}
],
"name": "removeViewer",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getNumViewerGroups",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "group",
"type": "uint256"
}
],
"name": "getNumViewers",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "group",
"type": "uint256"
},
{
"name": "index",
"type": "uint256"
}
],
"name": "getViewer",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "name",
"type": "string"
}
],
"name": "getViewerByName",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getViewerName",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "terminate",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x6060604052341561000f57600080fd5b60405160208061180383398101604052808051906020019091905050336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050611747806100bc6000396000f3006060604052600436106100f0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062dad7d4146100f5578063019d8d5f14610183578063085d48831461024b5780630ba32b27146102a05780630c08bf88146102f5578063231505bd1461030a5780632a7a832d146103985780632bba6fb7146103cf5780632f35de6114610420578063322eb71d146104495780633d2c8861146104fb578063444ee902146105585780637e26ea63146105b5578063a9ef019014610621578063bc1d708714610636578063d97034d5146106d3578063e267eea0146106f6575b600080fd5b341561010057600080fd5b610108610738565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014857808201518184015260208101905061012d565b50505050905090810190601f1680156101755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018e57600080fd5b610249600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506107d6565b005b341561025657600080fd5b61025e6109f4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102ab57600080fd5b6102b3610a1a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561030057600080fd5b610308610a3f565b005b341561031557600080fd5b61031d610b2e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035d578082015181840152602081019050610342565b50505050905090810190601f16801561038a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103a357600080fd5b6103b96004808035906020019091905050610bcc565b6040518082815260200191505060405180910390f35b34156103da57600080fd5b610406600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bf3565b604051808215151515815260200191505060405180910390f35b341561042b57600080fd5b610433610c13565b6040518082815260200191505060405180910390f35b341561045457600080fd5b610480600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c20565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c05780820151818401526020810190506104a5565b50505050905090810190601f1680156104ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561050657600080fd5b610556600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610d0a565b005b341561056357600080fd5b6105b3600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610d24565b005b34156105c057600080fd5b6105df6004808035906020019091908035906020019091905050610d3e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561062c57600080fd5b610634610d9b565b005b341561064157600080fd5b610691600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610e11565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106de57600080fd5b6106f46004808035906020019091905050610ea6565b005b341561070157600080fd5b610736600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061109c565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107ce5780601f106107a3576101008083540402835291602001916107ce565b820191906000526020600020905b8154815290600101906020018083116107b157829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561083157600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561088a57600080fd5b6001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506004838154811015156108f157fe5b9060005260206000209001805480600101828161090e9190611434565b9160005260206000209001600084909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050604080519081016040528085815260200182815250600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000190805190602001906109cd929190611460565b5060208201518160010190805190602001906109ea929190611460565b5090505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015610aea5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15610af457600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bc45780601f10610b9957610100808354040283529160200191610bc4565b820191906000526020600020905b815481529060010190602001808311610ba757829003601f168201915b505050505081565b6000600482815481101515610bdd57fe5b9060005260206000209001805490509050919050565b60056020528060005260406000206000915054906101000a900460ff1681565b6000600480549050905090565b610c286114e0565b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610cfe5780601f10610cd357610100808354040283529160200191610cfe565b820191906000526020600020905b815481529060010190602001808311610ce157829003601f168201915b50505050509050919050565b8060029080519060200190610d209291906114f4565b5050565b8060039080519060200190610d3a9291906114f4565b5050565b6000600483815481101515610d4f57fe5b906000526020600020900182815481101515610d6757fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610df657600080fd5b6001600481818054905001915081610e0e9190611574565b50565b60006007826040518082805190602001908083835b602083101515610e4b5780518252602082019150602081019050602083039250610e26565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0657600080fd5b600484815481101515610f1557fe5b9060005260206000209001805490509250600091505b82821015610fea57600060056000600487815481101515610f4857fe5b906000526020600020900185815481101515610f6057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508180600101925050610f2b565b60048054905090506001840191505b808210156110545760048281548110151561101057fe5b906000526020600020900160046001840381548110151561102d57fe5b90600052602060002090019080546110469291906115a0565b508180600101925050610ff9565b60046001820381548110151561106657fe5b9060005260206000209001600061107d91906115f2565b60016004818180549050039150816110959190611574565b5050505050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110fc57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561115457600080fd5b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506004858154811015156111bb57fe5b906000526020600020900180549050925060009150600090505b828110156113425781156112aa576004858154811015156111f257fe5b90600052602060002090018181548110151561120a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660048681548110151561124557fe5b90600052602060002090016001830381548110151561126057fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8373ffffffffffffffffffffffffffffffffffffffff166004868154811015156112d057fe5b9060005260206000209001828154811015156112e857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561133557600191505b80806001019150506111d5565b60048581548110151561135157fe5b90600052602060002090016001840381548110151561136c57fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560016004868154811015156113ab57fe5b9060005260206000209001818180549050039150816113ca9190611613565b50600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000808201600061141b919061163f565b60018201600061142b919061163f565b50505050505050565b81548183558181151161145b5781836000526020600020918201910161145a9190611687565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114a157805160ff19168380011785556114cf565b828001600101855582156114cf579182015b828111156114ce5782518255916020019190600101906114b3565b5b5090506114dc9190611687565b5090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061153557805160ff1916838001178555611563565b82800160010185558215611563579182015b82811115611562578251825591602001919060010190611547565b5b5090506115709190611687565b5090565b81548183558181151161159b5781836000526020600020918201910161159a91906116ac565b5b505050565b8280548282559060005260206000209081019282156115e15760005260206000209182015b828111156115e05782548255916001019190600101906115c5565b5b5090506115ee91906116d8565b5090565b50805460008255906000526020600020908101906116109190611687565b50565b81548183558181151161163a578183600052602060002091820191016116399190611687565b5b505050565b50805460018160011615610100020316600290046000825580601f106116655750611684565b601f0160209004906000526020600020908101906116839190611687565b5b50565b6116a991905b808211156116a557600081600090555060010161168d565b5090565b90565b6116d591905b808211156116d157600081816116c891906115f2565b506001016116b2565b5090565b90565b61171891905b8082111561171457600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055506001016116de565b5090565b905600a165627a7a72305820a34ca51e0ac59de90d62021072144138f449769bdf9a39349352b13de2961aec0029",
"deployedBytecode": "0x6060604052600436106100f0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062dad7d4146100f5578063019d8d5f14610183578063085d48831461024b5780630ba32b27146102a05780630c08bf88146102f5578063231505bd1461030a5780632a7a832d146103985780632bba6fb7146103cf5780632f35de6114610420578063322eb71d146104495780633d2c8861146104fb578063444ee902146105585780637e26ea63146105b5578063a9ef019014610621578063bc1d708714610636578063d97034d5146106d3578063e267eea0146106f6575b600080fd5b341561010057600080fd5b610108610738565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014857808201518184015260208101905061012d565b50505050905090810190601f1680156101755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018e57600080fd5b610249600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506107d6565b005b341561025657600080fd5b61025e6109f4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102ab57600080fd5b6102b3610a1a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561030057600080fd5b610308610a3f565b005b341561031557600080fd5b61031d610b2e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035d578082015181840152602081019050610342565b50505050905090810190601f16801561038a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103a357600080fd5b6103b96004808035906020019091905050610bcc565b6040518082815260200191505060405180910390f35b34156103da57600080fd5b610406600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bf3565b604051808215151515815260200191505060405180910390f35b341561042b57600080fd5b610433610c13565b6040518082815260200191505060405180910390f35b341561045457600080fd5b610480600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c20565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c05780820151818401526020810190506104a5565b50505050905090810190601f1680156104ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561050657600080fd5b610556600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610d0a565b005b341561056357600080fd5b6105b3600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610d24565b005b34156105c057600080fd5b6105df6004808035906020019091908035906020019091905050610d3e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561062c57600080fd5b610634610d9b565b005b341561064157600080fd5b610691600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610e11565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106de57600080fd5b6106f46004808035906020019091905050610ea6565b005b341561070157600080fd5b610736600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061109c565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107ce5780601f106107a3576101008083540402835291602001916107ce565b820191906000526020600020905b8154815290600101906020018083116107b157829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561083157600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561088a57600080fd5b6001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506004838154811015156108f157fe5b9060005260206000209001805480600101828161090e9190611434565b9160005260206000209001600084909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050604080519081016040528085815260200182815250600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000190805190602001906109cd929190611460565b5060208201518160010190805190602001906109ea929190611460565b5090505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015610aea5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15610af457600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bc45780601f10610b9957610100808354040283529160200191610bc4565b820191906000526020600020905b815481529060010190602001808311610ba757829003601f168201915b505050505081565b6000600482815481101515610bdd57fe5b9060005260206000209001805490509050919050565b60056020528060005260406000206000915054906101000a900460ff1681565b6000600480549050905090565b610c286114e0565b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610cfe5780601f10610cd357610100808354040283529160200191610cfe565b820191906000526020600020905b815481529060010190602001808311610ce157829003601f168201915b50505050509050919050565b8060029080519060200190610d209291906114f4565b5050565b8060039080519060200190610d3a9291906114f4565b5050565b6000600483815481101515610d4f57fe5b906000526020600020900182815481101515610d6757fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610df657600080fd5b6001600481818054905001915081610e0e9190611574565b50565b60006007826040518082805190602001908083835b602083101515610e4b5780518252602082019150602081019050602083039250610e26565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0657600080fd5b600484815481101515610f1557fe5b9060005260206000209001805490509250600091505b82821015610fea57600060056000600487815481101515610f4857fe5b906000526020600020900185815481101515610f6057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508180600101925050610f2b565b60048054905090506001840191505b808210156110545760048281548110151561101057fe5b906000526020600020900160046001840381548110151561102d57fe5b90600052602060002090019080546110469291906115a0565b508180600101925050610ff9565b60046001820381548110151561106657fe5b9060005260206000209001600061107d91906115f2565b60016004818180549050039150816110959190611574565b5050505050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110fc57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561115457600080fd5b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506004858154811015156111bb57fe5b906000526020600020900180549050925060009150600090505b828110156113425781156112aa576004858154811015156111f257fe5b90600052602060002090018181548110151561120a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660048681548110151561124557fe5b90600052602060002090016001830381548110151561126057fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8373ffffffffffffffffffffffffffffffffffffffff166004868154811015156112d057fe5b9060005260206000209001828154811015156112e857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561133557600191505b80806001019150506111d5565b60048581548110151561135157fe5b90600052602060002090016001840381548110151561136c57fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560016004868154811015156113ab57fe5b9060005260206000209001818180549050039150816113ca9190611613565b50600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000808201600061141b919061163f565b60018201600061142b919061163f565b50505050505050565b81548183558181151161145b5781836000526020600020918201910161145a9190611687565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114a157805160ff19168380011785556114cf565b828001600101855582156114cf579182015b828111156114ce5782518255916020019190600101906114b3565b5b5090506114dc9190611687565b5090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061153557805160ff1916838001178555611563565b82800160010185558215611563579182015b82811115611562578251825591602001919060010190611547565b5b5090506115709190611687565b5090565b81548183558181151161159b5781836000526020600020918201910161159a91906116ac565b5b505050565b8280548282559060005260206000209081019282156115e15760005260206000209182015b828111156115e05782548255916001019190600101906115c5565b5b5090506115ee91906116d8565b5090565b50805460008255906000526020600020908101906116109190611687565b50565b81548183558181151161163a578183600052602060002091820191016116399190611687565b5b505050565b50805460018160011615610100020316600290046000825580601f106116655750611684565b601f0160209004906000526020600020908101906116839190611687565b5b50565b6116a991905b808211156116a557600081600090555060010161168d565b5090565b90565b6116d591905b808211156116d157600081816116c891906115f2565b506001016116b2565b5090565b90565b61171891905b8082111561171457600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055506001016116de565b5090565b905600a165627a7a72305820a34ca51e0ac59de90d62021072144138f449769bdf9a39349352b13de2961aec0029",
"sourceMap": "26:3288:0:-;;;750:114;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;817:10;808:6;;:19;;;;;;;;;;;;;;;;;;848:9;837:8;;:20;;;;;;;;;;;;;;;;;;750:114;26:3288;;;;;;",
"deployedSourceMap": "26:3288:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;248:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1788:257:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;81:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;54:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3190:122;;;;;;;;;;;;;;187:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2748:107:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;479:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2651:95;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3082:106;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1112:76:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1190:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2857:116;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1263:75;;;;;;;;;;;;;;2975:105;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1340:446;;;;;;;;;;;;;;;;;;;;;;;;;;2047:602;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;248:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1788:257::-;710:6;;;;;;;;;;;696:20;;:10;:20;;;;693:33;;;718:8;;;693:33;1902:8;:16;1911:6;1902:16;;;;;;;;;;;;;;;;;;;;;;;;;1901:17;1893:26;;;;;;;;1945:4;1926:8;:16;1935:6;1926:16;;;;;;;;;;;;;;;;:23;;;;;;;;;;;;;;;;;;1955:12;1968:11;1955:25;;;;;;;;;;;;;;;;;;:38;;;;;;;;;;;:::i;:::-;;;;;;;;;;1986:6;1955:38;;;;;;;;;;;;;;;;;;;;;;;2020:22;;;;;;;;;2027:4;2020:22;;;;2033:8;2020:22;;;1999:10;:18;2010:6;1999:18;;;;;;;;;;;;;;;:43;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;1788:257;;;;:::o;81:23::-;;;;;;;;;;;;;:::o;54:21::-;;;;;;;;;;;;;:::o;3190:122::-;3241:6;;;;;;;;;;;3227:20;;:10;:20;;;;:46;;;;;3265:8;;;;;;;;;;;3251:22;;:10;:22;;;;3227:46;3224:59;;;3275:8;;;3224:59;3302:6;;;;;;;;;;;3289:20;;;187:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2748:107::-;2807:4;2826:12;2839:5;2826:19;;;;;;;;;;;;;;;;;;:26;;;;2819:33;;2748:107;;;:::o;479:40::-;;;;;;;;;;;;;;;;;;;;;;:::o;2651:95::-;2705:4;2724:12;:19;;;;2717:26;;2651:95;:::o;3082:106::-;3143:6;;:::i;:::-;3164:10;:16;3175:4;3164:16;;;;;;;;;;;;;;;:21;;3157:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3082:106;;;:::o;1112:76::-;1181:4;1166:12;:19;;;;;;;;;;;;:::i;:::-;;1112:76;:::o;1190:71::-;1254:4;1239:12;:19;;;;;;;;;;;;:::i;:::-;;1190:71;:::o;2857:116::-;2924:7;2944:12;2957:5;2944:19;;;;;;;;;;;;;;;;;;2964:5;2944:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;2937:33;;2857:116;;;;:::o;1263:75::-;710:6;;;;;;;;;;;696:20;;:10;:20;;;;693:33;;;718:8;;;693:33;1334:1;1311:12;:24;;;;;;;;;;;;;;:::i;:::-;;1263:75::o;2975:105::-;3037:7;3059:12;3072:4;3059:18;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:2;51:6;36:153;;;182:3;176:5;171:3;164:6;98:2;93:3;89;82:19;;123:2;118:3;114;107:19;;148:2;143:3;139;132:19;;36:153;;;274:1;267:3;263:2;259:3;254;250;246;315:4;311:3;305;299:5;295:3;356:4;350:3;344:5;340:3;389:7;380;377:2;372:3;365:6;3:399;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3052:25:0;;2975:105;;;:::o;1340:446::-;1407:15;1463:6;1576:14;710:6;;;;;;;;;;;696:20;;:10;:20;;;;693:33;;;718:8;;;693:33;1425:12;1438:11;1425:25;;;;;;;;;;;;;;;;;;:32;;;;1407:50;;1483:1;1479:5;;1475:95;1490:10;1486:1;:14;1475:95;;;1558:5;1517:8;:38;1526:12;1539:11;1526:25;;;;;;;;;;;;;;;;;;1552:1;1526:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;1517:38;;;;;;;;;;;;;;;;:46;;;;;;;;;;;;;;;;;;1502:3;;;;;;;1475:95;;;1593:12;:19;;;;1576:36;;1638:1;1626:11;:13;1622:17;;1618:97;1645:9;1641:1;:13;1618:97;;;1693:12;1706:1;1693:15;;;;;;;;;;;;;;;;;;1671:12;1688:1;1684;:5;1671:19;;;;;;;;;;;;;;;;;;:37;;;;;;;;:::i;:::-;;1656:3;;;;;;;1618:97;;;1727:12;1750:1;1740:9;:11;1727:25;;;;;;;;;;;;;;;;;;;1720:33;;;;:::i;:::-;1782:1;1759:12;:24;;;;;;;;;;;;;;:::i;:::-;;1340:446;;;;:::o;2047:602::-;2187:15;2243:14;2275:6;710;;;;;;;;;;;696:20;;:10;:20;;;;693:33;;;718:8;;;693:33;2133:8;:16;2142:6;2133:16;;;;;;;;;;;;;;;;;;;;;;;;;2125:25;;;;;;;;2176:5;2157:8;:16;2166:6;2157:16;;;;;;;;;;;;;;;;:24;;;;;;;;;;;;;;;;;;2205:12;2218:11;2205:25;;;;;;;;;;;;;;;;;;:32;;;;2187:50;;2260:5;2243:22;;2284:1;2275:10;;2271:248;2291:10;2287:1;:14;2271:248;;;2321:9;2318:102;;;2381:12;2394:11;2381:25;;;;;;;;;;;;;;;;;;2407:1;2381:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;2346:12;2359:11;2346:25;;;;;;;;;;;;;;;;;;2376:1;2372;:5;2346:32;;;;;;;;;;;;;;;;;;;:63;;;;;;;;;;;;;;;;;;2318:102;2464:6;2432:38;;:12;2445:11;2432:25;;;;;;;;;;;;;;;;;;2458:1;2432:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;:38;;;2429:84;;;2498:4;2486:16;;2429:84;2303:3;;;;;;;2271:248;;;2531:12;2544:11;2531:25;;;;;;;;;;;;;;;;;;2568:1;2557:10;:12;2531:39;;;;;;;;;;;;;;;;;;;2524:47;;;;;;;;;;;2613:1;2577:12;2590:11;2577:25;;;;;;;;;;;;;;;;;;:37;;;;;;;;;;;;;;:::i;:::-;;2627:10;:18;2638:6;2627:18;;;;;;;;;;;;;;;;2620:26;;;;;;;;:::i;:::-;;;;;;;;;:::i;:::-;;;2047:602;;;;;:::o;26:3288::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o",
"source": "pragma solidity ^0.4.18;\n\ncontract Relationship {\n address public patron;\n address public provider; // this is a unique address for the provider used only for this relationship\n string public providerAddr; //encrypted provider address\n string public providerName; //encrypted provider name\n\n struct Viewer {\n string name;\n string providerAddr; //the real provider address encypted so only the viewer can read\n }\n\n address[][] viewerGroups;\n mapping(address => bool) public isViewer;\n mapping(address => Viewer) viewerInfo;\n mapping(string => address) viewerByName;\n\n uint256 constant UINT256_MAX = ~uint256(0);\n\n modifier isPatron() {\n if(msg.sender != patron) revert();\n _;\n }\n\n function Relationship(address _provider) public {\n patron = msg.sender;\n provider = _provider;\n }\n\n/****These functions should be left commented out until a use case for them arises\n function setPatron(address addr) isPatron {\n patron = addr;\n }\n function setProvider(address addr) isPatron {\n provider = addr;\n }\n******************/\n\nfunction setProviderAddress(string addr) public {\n providerAddr = addr;\n}\n\nfunction setProviderName(string name) public {\n providerName = name;\n}\n\nfunction addViewerGroup() public isPatron {\n viewerGroups.length += 1;\n}\n\nfunction removeViewerGroup(uint viewerGroup) public isPatron {\n uint numViewers = viewerGroups[viewerGroup].length;\n uint i;\n for(i = 0; i < numViewers; i++) {\n isViewer[viewerGroups[viewerGroup][i]] = false;\n }\n\n uint numGroups = viewerGroups.length;\n for(i = viewerGroup+1; i < numGroups; i++) {\n viewerGroups[i - 1] = viewerGroups[i];\n }\n delete(viewerGroups[numGroups-1]);\n viewerGroups.length -= 1;\n}\n\nfunction addViewer(string name, uint viewerGroup, address viewer, string provAddr) public isPatron {\n require(!isViewer[viewer]);\n\n isViewer[viewer] = true;\n viewerGroups[viewerGroup].push(viewer);\n viewerInfo[viewer] = Viewer(name, provAddr);\n}\n\nfunction removeViewer(uint viewerGroup, address viewer) public isPatron {\n require(isViewer[viewer]);\n\n isViewer[viewer] = false;\n uint numViewers = viewerGroups[viewerGroup].length;\n bool overwrite = false;\n for(uint i = 0; i < numViewers; i++) {\n if(overwrite) {\n viewerGroups[viewerGroup][i - 1] = viewerGroups[viewerGroup][i];\n }\n if(viewerGroups[viewerGroup][i] == viewer) {\n overwrite = true;\n }\n }\n delete(viewerGroups[viewerGroup][numViewers-1]);\n viewerGroups[viewerGroup].length -= 1;\n delete(viewerInfo[viewer]);\n}\n\nfunction getNumViewerGroups() public constant returns(uint) {\n return viewerGroups.length;\n}\n\nfunction getNumViewers(uint group) public constant returns(uint) {\n return viewerGroups[group].length;\n}\n\nfunction getViewer(uint group, uint index) public constant returns(address) {\n return viewerGroups[group][index];\n}\n\nfunction getViewerByName(string name) public constant returns(address) {\n return viewerByName[name];\n}\n\nfunction getViewerName(address addr) public constant returns(string) {\n return viewerInfo[addr].name;\n}\n\nfunction terminate() public {\n if(msg.sender != patron && msg.sender != provider) revert();\n selfdestruct(patron);\n}\n}\n",
"sourcePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/Relationship.sol",
"ast": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/Relationship.sol",
"exportedSymbols": {
"Relationship": [
404
]
},
"id": 405,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.4",
".18"
],
"nodeType": "PragmaDirective",
"src": "0:24:0"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 404,
"linearizedBaseContracts": [
404
],
"name": "Relationship",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 3,
"name": "patron",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "54:21:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "54:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 5,
"name": "provider",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "81:23:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "81:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 7,
"name": "providerAddr",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "187:26:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
},
"typeName": {
"id": 6,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "187:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 9,
"name": "providerName",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "248:26:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
},
"typeName": {
"id": 8,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "248:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"canonicalName": "Relationship.Viewer",
"id": 14,
"members": [
{
"constant": false,
"id": 11,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 14,
"src": "331:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
},
"typeName": {
"id": 10,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "331:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13,
"name": "providerAddr",
"nodeType": "VariableDeclaration",
"scope": 14,
"src": "352:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
},
"typeName": {
"id": 12,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "352:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Viewer",
"nodeType": "StructDefinition",
"scope": 404,
"src": "307:136:0",
"visibility": "public"
},
{
"constant": false,
"id": 18,
"name": "viewerGroups",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "449:24:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
},
"typeName": {
"baseType": {
"baseType": {
"id": 15,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "449:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 16,
"length": null,
"nodeType": "ArrayTypeName",
"src": "449:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"id": 17,
"length": null,
"nodeType": "ArrayTypeName",
"src": "449:11:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage_ptr",
"typeString": "address[] storage ref[] storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22,
"name": "isViewer",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "479:40:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 21,
"keyType": {
"id": 19,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "487:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "479:24:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 20,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "498:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 26,
"name": "viewerInfo",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "525:37:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$14_storage_$",
"typeString": "mapping(address => struct Relationship.Viewer storage ref)"
},
"typeName": {
"id": 25,
"keyType": {
"id": 23,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "533:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "525:26:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$14_storage_$",
"typeString": "mapping(address => struct Relationship.Viewer storage ref)"
},
"valueType": {
"contractScope": null,
"id": 24,
"name": "Viewer",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 14,
"src": "544:6:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_storage_ptr",
"typeString": "struct Relationship.Viewer storage pointer"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 30,
"name": "viewerByName",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "568:39:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
},
"typeName": {
"id": 29,
"keyType": {
"id": 27,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "576:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"nodeType": "Mapping",
"src": "568:26:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
},
"valueType": {
"id": 28,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "586:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": true,
"id": 36,
"name": "UINT256_MAX",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "614:42:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 31,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "614:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"id": 35,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "~",
"prefix": true,
"src": "645:11:0",
"subExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 33,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "654:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 32,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "646:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": "uint256"
},
"id": 34,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "646:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"body": {
"id": 47,
"nodeType": "Block",
"src": "683:61:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 41,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 38,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 416,
"src": "696:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 39,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "696:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 40,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "710:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "696:20:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 45,
"nodeType": "IfStatement",
"src": "693:33:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 42,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 420,
"src": "718:6:0",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 43,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "718:8:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 44,
"nodeType": "ExpressionStatement",
"src": "718:8:0"
}
},
{
"id": 46,
"nodeType": "PlaceholderStatement",
"src": "736:1:0"
}
]
},
"id": 48,
"name": "isPatron",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 37,
"nodeType": "ParameterList",
"parameters": [],
"src": "680:2:0"
},
"src": "663:81:0",
"visibility": "internal"
},
{
"body": {
"id": 62,
"nodeType": "Block",
"src": "798:66:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 56,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 53,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "808:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 54,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 416,
"src": "817:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 55,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "817:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "808:19:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 57,
"nodeType": "ExpressionStatement",
"src": "808:19:0"
},
{
"expression": {
"argumentTypes": null,
"id": 60,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 58,
"name": "provider",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "837:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 59,
"name": "_provider",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 50,
"src": "848:9:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "837:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 61,
"nodeType": "ExpressionStatement",
"src": "837:20:0"
}
]
},
"id": 63,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "Relationship",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 51,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 50,
"name": "_provider",
"nodeType": "VariableDeclaration",
"scope": 63,
"src": "772:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 49,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "772:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "771:19:0"
},
"payable": false,
"returnParameters": {
"id": 52,
"nodeType": "ParameterList",
"parameters": [],
"src": "798:0:0"
},
"scope": 404,
"src": "750:114:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 72,
"nodeType": "Block",
"src": "1160:28:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 70,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 68,
"name": "providerAddr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "1166:12:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 69,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 65,
"src": "1181:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "1166:19:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 71,
"nodeType": "ExpressionStatement",
"src": "1166:19:0"
}
]
},
"id": 73,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "setProviderAddress",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 66,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 65,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 73,
"src": "1140:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 64,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1140:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1139:13:0"
},
"payable": false,
"returnParameters": {
"id": 67,
"nodeType": "ParameterList",
"parameters": [],
"src": "1160:0:0"
},
"scope": 404,
"src": "1112:76:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 82,
"nodeType": "Block",
"src": "1235:26:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 80,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 78,
"name": "providerName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9,
"src": "1239:12:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 79,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 75,
"src": "1254:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "1239:19:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 81,
"nodeType": "ExpressionStatement",
"src": "1239:19:0"
}
]
},
"id": 83,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "setProviderName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 76,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 75,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 83,
"src": "1215:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 74,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1215:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1214:13:0"
},
"payable": false,
"returnParameters": {
"id": 77,
"nodeType": "ParameterList",
"parameters": [],
"src": "1235:0:0"
},
"scope": 404,
"src": "1190:71:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 94,
"nodeType": "Block",
"src": "1305:33:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 92,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 88,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1311:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 90,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1311:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 91,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1334:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1311:24:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 93,
"nodeType": "ExpressionStatement",
"src": "1311:24:0"
}
]
},
"id": 95,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 86,
"modifierName": {
"argumentTypes": null,
"id": 85,
"name": "isPatron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 48,
"src": "1296:8:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1296:8:0"
}
],
"name": "addViewerGroup",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 84,
"nodeType": "ParameterList",
"parameters": [],
"src": "1286:2:0"
},
"payable": false,
"returnParameters": {
"id": 87,
"nodeType": "ParameterList",
"parameters": [],
"src": "1305:0:0"
},
"scope": 404,
"src": "1263:75:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 177,
"nodeType": "Block",
"src": "1401:385:0",
"statements": [
{
"assignments": [
103
],
"declarations": [
{
"constant": false,
"id": 103,
"name": "numViewers",
"nodeType": "VariableDeclaration",
"scope": 178,
"src": "1407:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 102,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1407:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 108,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 104,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1425:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 106,
"indexExpression": {
"argumentTypes": null,
"id": 105,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 97,
"src": "1438:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1425:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 107,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1425:32:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1407:50:0"
},
{
"assignments": [],
"declarations": [
{
"constant": false,
"id": 110,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 178,
"src": "1463:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 109,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1463:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 111,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "1463:6:0"
},
{
"body": {
"id": 132,
"nodeType": "Block",
"src": "1507:63:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 130,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 122,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22,
"src": "1517:8:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 128,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 123,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1526:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 125,
"indexExpression": {
"argumentTypes": null,
"id": 124,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 97,
"src": "1539:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1526:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 127,
"indexExpression": {
"argumentTypes": null,
"id": 126,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1552:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1526:28:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1517:38:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 129,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1558:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"src": "1517:46:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 131,
"nodeType": "ExpressionStatement",
"src": "1517:46:0"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 118,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 116,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1486:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 117,
"name": "numViewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 103,
"src": "1490:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1486:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 133,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 114,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 112,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1479:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 113,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1483:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1479:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 115,
"nodeType": "ExpressionStatement",
"src": "1479:5:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 120,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "1502:3:0",
"subExpression": {
"argumentTypes": null,
"id": 119,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1502:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 121,
"nodeType": "ExpressionStatement",
"src": "1502:3:0"
},
"nodeType": "ForStatement",
"src": "1475:95:0"
},
{
"assignments": [
135
],
"declarations": [
{
"constant": false,
"id": 135,
"name": "numGroups",
"nodeType": "VariableDeclaration",
"scope": 178,
"src": "1576:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 134,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1576:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 138,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 136,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1593:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 137,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1593:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1576:36:0"
},
{
"body": {
"id": 161,
"nodeType": "Block",
"src": "1661:54:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 159,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 151,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1671:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 155,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 154,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 152,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1684:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 153,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1688:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1684:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1671:19:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 156,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1693:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 158,
"indexExpression": {
"argumentTypes": null,
"id": 157,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1706:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1693:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"src": "1671:37:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 160,
"nodeType": "ExpressionStatement",
"src": "1671:37:0"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 147,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 145,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1641:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 146,
"name": "numGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 135,
"src": "1645:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1641:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 162,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 143,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 139,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1622:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 142,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 140,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 97,
"src": "1626:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 141,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1638:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1626:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1622:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 144,
"nodeType": "ExpressionStatement",
"src": "1622:17:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 149,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "1656:3:0",
"subExpression": {
"argumentTypes": null,
"id": 148,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1656:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 150,
"nodeType": "ExpressionStatement",
"src": "1656:3:0"
},
"nodeType": "ForStatement",
"src": "1618:97:0"
},
{
"expression": {
"argumentTypes": null,
"id": 169,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "1720:33:0",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 163,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1727:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 167,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 166,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 164,
"name": "numGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 135,
"src": "1740:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 165,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1750:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1740:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1727:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
}
],
"id": 168,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "1726:27:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 170,
"nodeType": "ExpressionStatement",
"src": "1720:33:0"
},
{
"expression": {
"argumentTypes": null,
"id": 175,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 171,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1759:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 173,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1759:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 174,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1782:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1759:24:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 176,
"nodeType": "ExpressionStatement",
"src": "1759:24:0"
}
]
},
"id": 178,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 100,
"modifierName": {
"argumentTypes": null,
"id": 99,
"name": "isPatron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 48,
"src": "1392:8:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1392:8:0"
}
],
"name": "removeViewerGroup",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 98,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 97,
"name": "viewerGroup",
"nodeType": "VariableDeclaration",
"scope": 178,
"src": "1367:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 96,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1367:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1366:18:0"
},
"payable": false,
"returnParameters": {
"id": 101,
"nodeType": "ParameterList",
"parameters": [],
"src": "1401:0:0"
},
"scope": 404,
"src": "1340:446:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 220,
"nodeType": "Block",
"src": "1887:158:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 195,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "1901:17:0",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 192,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22,
"src": "1902:8:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 194,
"indexExpression": {
"argumentTypes": null,
"id": 193,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "1911:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1902:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 191,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 419,
"src": "1893:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 196,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1893:26:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 197,
"nodeType": "ExpressionStatement",
"src": "1893:26:0"
},
{
"expression": {
"argumentTypes": null,
"id": 202,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 198,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22,
"src": "1926:8:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 200,
"indexExpression": {
"argumentTypes": null,
"id": 199,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "1935:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1926:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 201,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1945:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "1926:23:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 203,
"nodeType": "ExpressionStatement",
"src": "1926:23:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 208,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "1986:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 204,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1955:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 206,
"indexExpression": {
"argumentTypes": null,
"id": 205,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 182,
"src": "1968:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1955:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 207,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1955:30:0",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 209,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1955:38:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 210,
"nodeType": "ExpressionStatement",
"src": "1955:38:0"
},
{
"expression": {
"argumentTypes": null,
"id": 218,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 211,
"name": "viewerInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26,
"src": "1999:10:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$14_storage_$",
"typeString": "mapping(address => struct Relationship.Viewer storage ref)"
}
},
"id": 213,
"indexExpression": {
"argumentTypes": null,
"id": 212,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "2010:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1999:18:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_storage",
"typeString": "struct Relationship.Viewer storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 215,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 180,
"src": "2027:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 216,
"name": "provAddr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 186,
"src": "2033:8:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 214,
"name": "Viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "2020:6:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Viewer_$14_storage_ptr_$",
"typeString": "type(struct Relationship.Viewer storage pointer)"
}
},
"id": 217,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2020:22:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_memory",
"typeString": "struct Relationship.Viewer memory"
}
},
"src": "1999:43:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_storage",
"typeString": "struct Relationship.Viewer storage ref"
}
},
"id": 219,
"nodeType": "ExpressionStatement",
"src": "1999:43:0"
}
]
},
"id": 221,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 189,
"modifierName": {
"argumentTypes": null,
"id": 188,
"name": "isPatron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 48,
"src": "1878:8:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1878:8:0"
}
],
"name": "addViewer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 187,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 180,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 221,
"src": "1807:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 179,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1807:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 182,
"name": "viewerGroup",
"nodeType": "VariableDeclaration",
"scope": 221,
"src": "1820:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 181,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1820:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 184,
"name": "viewer",
"nodeType": "VariableDeclaration",
"scope": 221,
"src": "1838:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 183,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1838:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 186,
"name": "provAddr",
"nodeType": "VariableDeclaration",
"scope": 221,
"src": "1854:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 185,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1854:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1806:64:0"
},
"payable": false,
"returnParameters": {
"id": 190,
"nodeType": "ParameterList",
"parameters": [],
"src": "1887:0:0"
},
"scope": 404,
"src": "1788:257:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 318,
"nodeType": "Block",
"src": "2119:530:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 231,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22,
"src": "2133:8:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 233,
"indexExpression": {
"argumentTypes": null,
"id": 232,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 225,
"src": "2142:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2133:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 230,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 419,
"src": "2125:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 234,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2125:25:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 235,
"nodeType": "ExpressionStatement",
"src": "2125:25:0"
},
{
"expression": {
"argumentTypes": null,
"id": 240,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 236,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22,
"src": "2157:8:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 238,
"indexExpression": {
"argumentTypes": null,
"id": 237,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 225,
"src": "2166:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2157:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 239,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2176:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"src": "2157:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 241,
"nodeType": "ExpressionStatement",
"src": "2157:24:0"
},
{
"assignments": [
243
],
"declarations": [
{
"constant": false,
"id": 243,
"name": "numViewers",
"nodeType": "VariableDeclaration",
"scope": 319,
"src": "2187:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 242,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2187:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 248,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 244,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2205:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 246,
"indexExpression": {
"argumentTypes": null,
"id": 245,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 223,
"src": "2218:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2205:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 247,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2205:32:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2187:50:0"
},
{
"assignments": [
250
],
"declarations": [
{
"constant": false,
"id": 250,
"name": "overwrite",
"nodeType": "VariableDeclaration",
"scope": 319,
"src": "2243:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 249,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2243:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 252,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 251,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2260:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "2243:22:0"
},
{
"body": {
"id": 293,
"nodeType": "Block",
"src": "2308:211:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 263,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 250,
"src": "2321:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 279,
"nodeType": "IfStatement",
"src": "2318:102:0",
"trueBody": {
"id": 278,
"nodeType": "Block",
"src": "2332:88:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 276,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 264,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2346:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 269,
"indexExpression": {
"argumentTypes": null,
"id": 265,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 223,
"src": "2359:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2346:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 270,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 268,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 266,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 254,
"src": "2372:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 267,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2376:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "2372:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2346:32:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 271,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2381:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 273,
"indexExpression": {
"argumentTypes": null,
"id": 272,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 223,
"src": "2394:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2381:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 275,
"indexExpression": {
"argumentTypes": null,
"id": 274,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 254,
"src": "2407:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2381:28:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2346:63:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 277,
"nodeType": "ExpressionStatement",
"src": "2346:63:0"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 286,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 280,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2432:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 282,
"indexExpression": {
"argumentTypes": null,
"id": 281,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 223,
"src": "2445:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2432:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 284,
"indexExpression": {
"argumentTypes": null,
"id": 283,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 254,
"src": "2458:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2432:28:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 285,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 225,
"src": "2464:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2432:38:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 292,
"nodeType": "IfStatement",
"src": "2429:84:0",
"trueBody": {
"id": 291,
"nodeType": "Block",
"src": "2472:41:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 289,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 287,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 250,
"src": "2486:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 288,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2498:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "2486:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 290,
"nodeType": "ExpressionStatement",
"src": "2486:16:0"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 259,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 257,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 254,
"src": "2287:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 258,
"name": "numViewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 243,
"src": "2291:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2287:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 294,
"initializationExpression": {
"assignments": [
254
],
"declarations": [
{
"constant": false,
"id": 254,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 319,
"src": "2275:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 253,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2275:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 256,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 255,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2284:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "2275:10:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 261,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "2303:3:0",
"subExpression": {
"argumentTypes": null,
"id": 260,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 254,
"src": "2303:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 262,
"nodeType": "ExpressionStatement",
"src": "2303:3:0"
},
"nodeType": "ForStatement",
"src": "2271:248:0"
},
{
"expression": {
"argumentTypes": null,
"id": 303,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "2524:47:0",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 295,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2531:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 297,
"indexExpression": {
"argumentTypes": null,
"id": 296,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 223,
"src": "2544:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2531:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 301,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 300,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 298,
"name": "numViewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 243,
"src": "2557:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 299,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2568:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "2557:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2531:39:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 302,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "2530:41:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 304,
"nodeType": "ExpressionStatement",
"src": "2524:47:0"
},
{
"expression": {
"argumentTypes": null,
"id": 310,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 305,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2577:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 307,
"indexExpression": {
"argumentTypes": null,
"id": 306,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 223,
"src": "2590:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2577:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 308,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2577:32:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 309,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2613:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "2577:37:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 311,
"nodeType": "ExpressionStatement",
"src": "2577:37:0"
},
{
"expression": {
"argumentTypes": null,
"id": 316,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "2620:26:0",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 312,
"name": "viewerInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26,
"src": "2627:10:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$14_storage_$",
"typeString": "mapping(address => struct Relationship.Viewer storage ref)"
}
},
"id": 314,
"indexExpression": {
"argumentTypes": null,
"id": 313,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 225,
"src": "2638:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2627:18:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_storage",
"typeString": "struct Relationship.Viewer storage ref"
}
}
],
"id": 315,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "2626:20:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_storage",
"typeString": "struct Relationship.Viewer storage ref"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 317,
"nodeType": "ExpressionStatement",
"src": "2620:26:0"
}
]
},
"id": 319,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 228,
"modifierName": {
"argumentTypes": null,
"id": 227,
"name": "isPatron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 48,
"src": "2110:8:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "2110:8:0"
}
],
"name": "removeViewer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 226,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 223,
"name": "viewerGroup",
"nodeType": "VariableDeclaration",
"scope": 319,
"src": "2069:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 222,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2069:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 225,
"name": "viewer",
"nodeType": "VariableDeclaration",
"scope": 319,
"src": "2087:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 224,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2087:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2068:34:0"
},
"payable": false,
"returnParameters": {
"id": 229,
"nodeType": "ParameterList",
"parameters": [],
"src": "2119:0:0"
},
"scope": 404,
"src": "2047:602:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 327,
"nodeType": "Block",
"src": "2711:35:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 324,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2724:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 325,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2724:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 323,
"id": 326,
"nodeType": "Return",
"src": "2717:26:0"
}
]
},
"id": 328,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumViewerGroups",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 320,
"nodeType": "ParameterList",
"parameters": [],
"src": "2678:2:0"
},
"payable": false,
"returnParameters": {
"id": 323,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 322,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 328,
"src": "2705:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 321,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2705:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2704:6:0"
},
"scope": 404,
"src": "2651:95:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 340,
"nodeType": "Block",
"src": "2813:42:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 335,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2826:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 337,
"indexExpression": {
"argumentTypes": null,
"id": 336,
"name": "group",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 330,
"src": "2839:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2826:19:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 338,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2826:26:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 334,
"id": 339,
"nodeType": "Return",
"src": "2819:33:0"
}
]
},
"id": 341,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumViewers",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 331,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 330,
"name": "group",
"nodeType": "VariableDeclaration",
"scope": 341,
"src": "2771:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 329,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2771:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2770:12:0"
},
"payable": false,
"returnParameters": {
"id": 334,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 333,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 341,
"src": "2807:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 332,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2807:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2806:6:0"
},
"scope": 404,
"src": "2748:107:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 356,
"nodeType": "Block",
"src": "2933:40:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 350,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2944:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 352,
"indexExpression": {
"argumentTypes": null,
"id": 351,
"name": "group",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 343,
"src": "2957:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2944:19:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 354,
"indexExpression": {
"argumentTypes": null,
"id": 353,
"name": "index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "2964:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2944:26:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 349,
"id": 355,
"nodeType": "Return",
"src": "2937:33:0"
}
]
},
"id": 357,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getViewer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 346,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 343,
"name": "group",
"nodeType": "VariableDeclaration",
"scope": 357,
"src": "2876:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 342,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2876:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 345,
"name": "index",
"nodeType": "VariableDeclaration",
"scope": 357,
"src": "2888:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 344,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2888:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2875:24:0"
},
"payable": false,
"returnParameters": {
"id": 349,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 348,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 357,
"src": "2924:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 347,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2924:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2923:9:0"
},
"scope": 404,
"src": "2857:116:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 368,
"nodeType": "Block",
"src": "3046:34:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 364,
"name": "viewerByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 30,
"src": "3059:12:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 366,
"indexExpression": {
"argumentTypes": null,
"id": 365,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 359,
"src": "3072:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3059:18:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 363,
"id": 367,
"nodeType": "Return",
"src": "3052:25:0"
}
]
},
"id": 369,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getViewerByName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 360,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 359,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 369,
"src": "3000:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 358,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "3000:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2999:13:0"
},
"payable": false,
"returnParameters": {
"id": 363,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 362,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 369,
"src": "3037:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 361,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3037:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3036:9:0"
},
"scope": 404,
"src": "2975:105:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 381,
"nodeType": "Block",
"src": "3151:37:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 376,
"name": "viewerInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26,
"src": "3164:10:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$14_storage_$",
"typeString": "mapping(address => struct Relationship.Viewer storage ref)"
}
},
"id": 378,
"indexExpression": {
"argumentTypes": null,
"id": 377,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 371,
"src": "3175:4:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3164:16:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_storage",
"typeString": "struct Relationship.Viewer storage ref"
}
},
"id": 379,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "name",
"nodeType": "MemberAccess",
"referencedDeclaration": 11,
"src": "3164:21:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"functionReturnParameters": 375,
"id": 380,
"nodeType": "Return",
"src": "3157:28:0"
}
]
},
"id": 382,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getViewerName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 372,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 371,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 382,
"src": "3105:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 370,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3105:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3104:14:0"
},
"payable": false,
"returnParameters": {
"id": 375,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 374,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 382,
"src": "3143:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 373,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "3143:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3142:8:0"
},
"scope": 404,
"src": "3082:106:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 402,
"nodeType": "Block",
"src": "3218:94:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 393,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 388,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 385,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 416,
"src": "3227:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 386,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3227:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 387,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "3241:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "3227:20:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 392,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 389,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 416,
"src": "3251:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 390,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3251:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 391,
"name": "provider",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "3265:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "3251:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "3227:46:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 397,
"nodeType": "IfStatement",
"src": "3224:59:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 394,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 420,
"src": "3275:6:0",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 395,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3275:8:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 396,
"nodeType": "ExpressionStatement",
"src": "3275:8:0"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 399,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "3302:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 398,
"name": "selfdestruct",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 422,
"src": "3289:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_selfdestruct_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 400,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3289:20:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 401,
"nodeType": "ExpressionStatement",
"src": "3289:20:0"
}
]
},
"id": 403,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "terminate",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 383,
"nodeType": "ParameterList",
"parameters": [],
"src": "3208:2:0"
},
"payable": false,
"returnParameters": {
"id": 384,
"nodeType": "ParameterList",
"parameters": [],
"src": "3218:0:0"
},
"scope": 404,
"src": "3190:122:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
}
],
"scope": 405,
"src": "26:3288:0"
}
],
"src": "0:3315:0"
},
"legacyAST": {
"absolutePath": "/home/firescar96/Documents/MIT/MEng/research/medrec/SmartContracts/contracts/Relationship.sol",
"exportedSymbols": {
"Relationship": [
404
]
},
"id": 405,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.4",
".18"
],
"nodeType": "PragmaDirective",
"src": "0:24:0"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 404,
"linearizedBaseContracts": [
404
],
"name": "Relationship",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 3,
"name": "patron",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "54:21:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "54:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 5,
"name": "provider",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "81:23:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "81:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 7,
"name": "providerAddr",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "187:26:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
},
"typeName": {
"id": 6,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "187:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 9,
"name": "providerName",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "248:26:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
},
"typeName": {
"id": 8,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "248:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "public"
},
{
"canonicalName": "Relationship.Viewer",
"id": 14,
"members": [
{
"constant": false,
"id": 11,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 14,
"src": "331:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
},
"typeName": {
"id": 10,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "331:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 13,
"name": "providerAddr",
"nodeType": "VariableDeclaration",
"scope": 14,
"src": "352:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
},
"typeName": {
"id": 12,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "352:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Viewer",
"nodeType": "StructDefinition",
"scope": 404,
"src": "307:136:0",
"visibility": "public"
},
{
"constant": false,
"id": 18,
"name": "viewerGroups",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "449:24:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
},
"typeName": {
"baseType": {
"baseType": {
"id": 15,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "449:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 16,
"length": null,
"nodeType": "ArrayTypeName",
"src": "449:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[] storage pointer"
}
},
"id": 17,
"length": null,
"nodeType": "ArrayTypeName",
"src": "449:11:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage_ptr",
"typeString": "address[] storage ref[] storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22,
"name": "isViewer",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "479:40:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 21,
"keyType": {
"id": 19,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "487:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "479:24:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 20,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "498:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 26,
"name": "viewerInfo",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "525:37:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$14_storage_$",
"typeString": "mapping(address => struct Relationship.Viewer storage ref)"
},
"typeName": {
"id": 25,
"keyType": {
"id": 23,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "533:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "525:26:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$14_storage_$",
"typeString": "mapping(address => struct Relationship.Viewer storage ref)"
},
"valueType": {
"contractScope": null,
"id": 24,
"name": "Viewer",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 14,
"src": "544:6:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_storage_ptr",
"typeString": "struct Relationship.Viewer storage pointer"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 30,
"name": "viewerByName",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "568:39:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
},
"typeName": {
"id": 29,
"keyType": {
"id": 27,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "576:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"nodeType": "Mapping",
"src": "568:26:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
},
"valueType": {
"id": 28,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "586:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": true,
"id": 36,
"name": "UINT256_MAX",
"nodeType": "VariableDeclaration",
"scope": 404,
"src": "614:42:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 31,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "614:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"id": 35,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "~",
"prefix": true,
"src": "645:11:0",
"subExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 33,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "654:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 32,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "646:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": "uint256"
},
"id": 34,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "646:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"body": {
"id": 47,
"nodeType": "Block",
"src": "683:61:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 41,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 38,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 416,
"src": "696:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 39,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "696:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 40,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "710:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "696:20:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 45,
"nodeType": "IfStatement",
"src": "693:33:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 42,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 420,
"src": "718:6:0",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 43,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "718:8:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 44,
"nodeType": "ExpressionStatement",
"src": "718:8:0"
}
},
{
"id": 46,
"nodeType": "PlaceholderStatement",
"src": "736:1:0"
}
]
},
"id": 48,
"name": "isPatron",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 37,
"nodeType": "ParameterList",
"parameters": [],
"src": "680:2:0"
},
"src": "663:81:0",
"visibility": "internal"
},
{
"body": {
"id": 62,
"nodeType": "Block",
"src": "798:66:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 56,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 53,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "808:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 54,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 416,
"src": "817:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 55,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "817:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "808:19:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 57,
"nodeType": "ExpressionStatement",
"src": "808:19:0"
},
{
"expression": {
"argumentTypes": null,
"id": 60,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 58,
"name": "provider",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "837:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 59,
"name": "_provider",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 50,
"src": "848:9:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "837:20:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 61,
"nodeType": "ExpressionStatement",
"src": "837:20:0"
}
]
},
"id": 63,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "Relationship",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 51,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 50,
"name": "_provider",
"nodeType": "VariableDeclaration",
"scope": 63,
"src": "772:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 49,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "772:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "771:19:0"
},
"payable": false,
"returnParameters": {
"id": 52,
"nodeType": "ParameterList",
"parameters": [],
"src": "798:0:0"
},
"scope": 404,
"src": "750:114:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 72,
"nodeType": "Block",
"src": "1160:28:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 70,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 68,
"name": "providerAddr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "1166:12:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 69,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 65,
"src": "1181:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "1166:19:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 71,
"nodeType": "ExpressionStatement",
"src": "1166:19:0"
}
]
},
"id": 73,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "setProviderAddress",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 66,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 65,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 73,
"src": "1140:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 64,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1140:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1139:13:0"
},
"payable": false,
"returnParameters": {
"id": 67,
"nodeType": "ParameterList",
"parameters": [],
"src": "1160:0:0"
},
"scope": 404,
"src": "1112:76:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 82,
"nodeType": "Block",
"src": "1235:26:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 80,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 78,
"name": "providerName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9,
"src": "1239:12:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 79,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 75,
"src": "1254:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "1239:19:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 81,
"nodeType": "ExpressionStatement",
"src": "1239:19:0"
}
]
},
"id": 83,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "setProviderName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 76,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 75,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 83,
"src": "1215:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 74,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1215:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1214:13:0"
},
"payable": false,
"returnParameters": {
"id": 77,
"nodeType": "ParameterList",
"parameters": [],
"src": "1235:0:0"
},
"scope": 404,
"src": "1190:71:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 94,
"nodeType": "Block",
"src": "1305:33:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 92,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 88,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1311:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 90,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1311:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 91,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1334:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1311:24:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 93,
"nodeType": "ExpressionStatement",
"src": "1311:24:0"
}
]
},
"id": 95,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 86,
"modifierName": {
"argumentTypes": null,
"id": 85,
"name": "isPatron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 48,
"src": "1296:8:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1296:8:0"
}
],
"name": "addViewerGroup",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 84,
"nodeType": "ParameterList",
"parameters": [],
"src": "1286:2:0"
},
"payable": false,
"returnParameters": {
"id": 87,
"nodeType": "ParameterList",
"parameters": [],
"src": "1305:0:0"
},
"scope": 404,
"src": "1263:75:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 177,
"nodeType": "Block",
"src": "1401:385:0",
"statements": [
{
"assignments": [
103
],
"declarations": [
{
"constant": false,
"id": 103,
"name": "numViewers",
"nodeType": "VariableDeclaration",
"scope": 178,
"src": "1407:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 102,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1407:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 108,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 104,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1425:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 106,
"indexExpression": {
"argumentTypes": null,
"id": 105,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 97,
"src": "1438:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1425:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 107,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1425:32:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1407:50:0"
},
{
"assignments": [],
"declarations": [
{
"constant": false,
"id": 110,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 178,
"src": "1463:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 109,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1463:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 111,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "1463:6:0"
},
{
"body": {
"id": 132,
"nodeType": "Block",
"src": "1507:63:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 130,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 122,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22,
"src": "1517:8:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 128,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 123,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1526:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 125,
"indexExpression": {
"argumentTypes": null,
"id": 124,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 97,
"src": "1539:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1526:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 127,
"indexExpression": {
"argumentTypes": null,
"id": 126,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1552:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1526:28:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1517:38:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 129,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1558:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"src": "1517:46:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 131,
"nodeType": "ExpressionStatement",
"src": "1517:46:0"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 118,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 116,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1486:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 117,
"name": "numViewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 103,
"src": "1490:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1486:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 133,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 114,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 112,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1479:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 113,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1483:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1479:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 115,
"nodeType": "ExpressionStatement",
"src": "1479:5:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 120,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "1502:3:0",
"subExpression": {
"argumentTypes": null,
"id": 119,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1502:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 121,
"nodeType": "ExpressionStatement",
"src": "1502:3:0"
},
"nodeType": "ForStatement",
"src": "1475:95:0"
},
{
"assignments": [
135
],
"declarations": [
{
"constant": false,
"id": 135,
"name": "numGroups",
"nodeType": "VariableDeclaration",
"scope": 178,
"src": "1576:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 134,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1576:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 138,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 136,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1593:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 137,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1593:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1576:36:0"
},
{
"body": {
"id": 161,
"nodeType": "Block",
"src": "1661:54:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 159,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 151,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1671:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 155,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 154,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 152,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1684:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 153,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1688:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1684:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1671:19:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 156,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1693:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 158,
"indexExpression": {
"argumentTypes": null,
"id": 157,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1706:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1693:15:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"src": "1671:37:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 160,
"nodeType": "ExpressionStatement",
"src": "1671:37:0"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 147,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 145,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1641:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 146,
"name": "numGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 135,
"src": "1645:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1641:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 162,
"initializationExpression": {
"expression": {
"argumentTypes": null,
"id": 143,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 139,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1622:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 142,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 140,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 97,
"src": "1626:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 141,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1638:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1626:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1622:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 144,
"nodeType": "ExpressionStatement",
"src": "1622:17:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 149,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "1656:3:0",
"subExpression": {
"argumentTypes": null,
"id": 148,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1656:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 150,
"nodeType": "ExpressionStatement",
"src": "1656:3:0"
},
"nodeType": "ForStatement",
"src": "1618:97:0"
},
{
"expression": {
"argumentTypes": null,
"id": 169,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "1720:33:0",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 163,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1727:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 167,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 166,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 164,
"name": "numGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 135,
"src": "1740:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 165,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1750:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1740:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1727:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
}
],
"id": 168,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "1726:27:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 170,
"nodeType": "ExpressionStatement",
"src": "1720:33:0"
},
{
"expression": {
"argumentTypes": null,
"id": 175,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 171,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1759:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 173,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1759:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 174,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1782:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1759:24:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 176,
"nodeType": "ExpressionStatement",
"src": "1759:24:0"
}
]
},
"id": 178,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 100,
"modifierName": {
"argumentTypes": null,
"id": 99,
"name": "isPatron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 48,
"src": "1392:8:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1392:8:0"
}
],
"name": "removeViewerGroup",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 98,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 97,
"name": "viewerGroup",
"nodeType": "VariableDeclaration",
"scope": 178,
"src": "1367:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 96,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1367:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1366:18:0"
},
"payable": false,
"returnParameters": {
"id": 101,
"nodeType": "ParameterList",
"parameters": [],
"src": "1401:0:0"
},
"scope": 404,
"src": "1340:446:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 220,
"nodeType": "Block",
"src": "1887:158:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 195,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "1901:17:0",
"subExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 192,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22,
"src": "1902:8:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 194,
"indexExpression": {
"argumentTypes": null,
"id": 193,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "1911:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1902:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 191,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 419,
"src": "1893:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 196,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1893:26:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 197,
"nodeType": "ExpressionStatement",
"src": "1893:26:0"
},
{
"expression": {
"argumentTypes": null,
"id": 202,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 198,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22,
"src": "1926:8:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 200,
"indexExpression": {
"argumentTypes": null,
"id": 199,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "1935:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1926:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 201,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1945:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "1926:23:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 203,
"nodeType": "ExpressionStatement",
"src": "1926:23:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 208,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "1986:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 204,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1955:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 206,
"indexExpression": {
"argumentTypes": null,
"id": 205,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 182,
"src": "1968:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1955:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 207,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1955:30:0",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) returns (uint256)"
}
},
"id": 209,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1955:38:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 210,
"nodeType": "ExpressionStatement",
"src": "1955:38:0"
},
{
"expression": {
"argumentTypes": null,
"id": 218,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 211,
"name": "viewerInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26,
"src": "1999:10:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$14_storage_$",
"typeString": "mapping(address => struct Relationship.Viewer storage ref)"
}
},
"id": 213,
"indexExpression": {
"argumentTypes": null,
"id": 212,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 184,
"src": "2010:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1999:18:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_storage",
"typeString": "struct Relationship.Viewer storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 215,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 180,
"src": "2027:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 216,
"name": "provAddr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 186,
"src": "2033:8:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 214,
"name": "Viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "2020:6:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Viewer_$14_storage_ptr_$",
"typeString": "type(struct Relationship.Viewer storage pointer)"
}
},
"id": 217,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2020:22:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_memory",
"typeString": "struct Relationship.Viewer memory"
}
},
"src": "1999:43:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_storage",
"typeString": "struct Relationship.Viewer storage ref"
}
},
"id": 219,
"nodeType": "ExpressionStatement",
"src": "1999:43:0"
}
]
},
"id": 221,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 189,
"modifierName": {
"argumentTypes": null,
"id": 188,
"name": "isPatron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 48,
"src": "1878:8:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1878:8:0"
}
],
"name": "addViewer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 187,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 180,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 221,
"src": "1807:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 179,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1807:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 182,
"name": "viewerGroup",
"nodeType": "VariableDeclaration",
"scope": 221,
"src": "1820:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 181,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1820:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 184,
"name": "viewer",
"nodeType": "VariableDeclaration",
"scope": 221,
"src": "1838:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 183,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1838:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 186,
"name": "provAddr",
"nodeType": "VariableDeclaration",
"scope": 221,
"src": "1854:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 185,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1854:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1806:64:0"
},
"payable": false,
"returnParameters": {
"id": 190,
"nodeType": "ParameterList",
"parameters": [],
"src": "1887:0:0"
},
"scope": 404,
"src": "1788:257:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 318,
"nodeType": "Block",
"src": "2119:530:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 231,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22,
"src": "2133:8:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 233,
"indexExpression": {
"argumentTypes": null,
"id": 232,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 225,
"src": "2142:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2133:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 230,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 419,
"src": "2125:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 234,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2125:25:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 235,
"nodeType": "ExpressionStatement",
"src": "2125:25:0"
},
{
"expression": {
"argumentTypes": null,
"id": 240,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 236,
"name": "isViewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 22,
"src": "2157:8:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 238,
"indexExpression": {
"argumentTypes": null,
"id": 237,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 225,
"src": "2166:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2157:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 239,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2176:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"src": "2157:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 241,
"nodeType": "ExpressionStatement",
"src": "2157:24:0"
},
{
"assignments": [
243
],
"declarations": [
{
"constant": false,
"id": 243,
"name": "numViewers",
"nodeType": "VariableDeclaration",
"scope": 319,
"src": "2187:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 242,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2187:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 248,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 244,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2205:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 246,
"indexExpression": {
"argumentTypes": null,
"id": 245,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 223,
"src": "2218:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2205:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 247,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2205:32:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2187:50:0"
},
{
"assignments": [
250
],
"declarations": [
{
"constant": false,
"id": 250,
"name": "overwrite",
"nodeType": "VariableDeclaration",
"scope": 319,
"src": "2243:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 249,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2243:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 252,
"initialValue": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 251,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2260:5:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"nodeType": "VariableDeclarationStatement",
"src": "2243:22:0"
},
{
"body": {
"id": 293,
"nodeType": "Block",
"src": "2308:211:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 263,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 250,
"src": "2321:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 279,
"nodeType": "IfStatement",
"src": "2318:102:0",
"trueBody": {
"id": 278,
"nodeType": "Block",
"src": "2332:88:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 276,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 264,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2346:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 269,
"indexExpression": {
"argumentTypes": null,
"id": 265,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 223,
"src": "2359:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2346:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 270,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 268,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 266,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 254,
"src": "2372:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 267,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2376:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "2372:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2346:32:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 271,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2381:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 273,
"indexExpression": {
"argumentTypes": null,
"id": 272,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 223,
"src": "2394:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2381:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 275,
"indexExpression": {
"argumentTypes": null,
"id": 274,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 254,
"src": "2407:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2381:28:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2346:63:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 277,
"nodeType": "ExpressionStatement",
"src": "2346:63:0"
}
]
}
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 286,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 280,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2432:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 282,
"indexExpression": {
"argumentTypes": null,
"id": 281,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 223,
"src": "2445:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2432:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 284,
"indexExpression": {
"argumentTypes": null,
"id": 283,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 254,
"src": "2458:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2432:28:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 285,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 225,
"src": "2464:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2432:38:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 292,
"nodeType": "IfStatement",
"src": "2429:84:0",
"trueBody": {
"id": 291,
"nodeType": "Block",
"src": "2472:41:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 289,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 287,
"name": "overwrite",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 250,
"src": "2486:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 288,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2498:4:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "2486:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 290,
"nodeType": "ExpressionStatement",
"src": "2486:16:0"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 259,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 257,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 254,
"src": "2287:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 258,
"name": "numViewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 243,
"src": "2291:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2287:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 294,
"initializationExpression": {
"assignments": [
254
],
"declarations": [
{
"constant": false,
"id": 254,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 319,
"src": "2275:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 253,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2275:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 256,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 255,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2284:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "2275:10:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 261,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "2303:3:0",
"subExpression": {
"argumentTypes": null,
"id": 260,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 254,
"src": "2303:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 262,
"nodeType": "ExpressionStatement",
"src": "2303:3:0"
},
"nodeType": "ForStatement",
"src": "2271:248:0"
},
{
"expression": {
"argumentTypes": null,
"id": 303,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "2524:47:0",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 295,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2531:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 297,
"indexExpression": {
"argumentTypes": null,
"id": 296,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 223,
"src": "2544:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2531:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 301,
"indexExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 300,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 298,
"name": "numViewers",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 243,
"src": "2557:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 299,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2568:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "2557:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2531:39:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 302,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "2530:41:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 304,
"nodeType": "ExpressionStatement",
"src": "2524:47:0"
},
{
"expression": {
"argumentTypes": null,
"id": 310,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 305,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2577:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 307,
"indexExpression": {
"argumentTypes": null,
"id": 306,
"name": "viewerGroup",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 223,
"src": "2590:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2577:25:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 308,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2577:32:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "-=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 309,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2613:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "2577:37:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 311,
"nodeType": "ExpressionStatement",
"src": "2577:37:0"
},
{
"expression": {
"argumentTypes": null,
"id": 316,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "delete",
"prefix": true,
"src": "2620:26:0",
"subExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 312,
"name": "viewerInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26,
"src": "2627:10:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$14_storage_$",
"typeString": "mapping(address => struct Relationship.Viewer storage ref)"
}
},
"id": 314,
"indexExpression": {
"argumentTypes": null,
"id": 313,
"name": "viewer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 225,
"src": "2638:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2627:18:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_storage",
"typeString": "struct Relationship.Viewer storage ref"
}
}
],
"id": 315,
"isConstant": false,
"isInlineArray": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "TupleExpression",
"src": "2626:20:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_storage",
"typeString": "struct Relationship.Viewer storage ref"
}
},
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 317,
"nodeType": "ExpressionStatement",
"src": "2620:26:0"
}
]
},
"id": 319,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [],
"id": 228,
"modifierName": {
"argumentTypes": null,
"id": 227,
"name": "isPatron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 48,
"src": "2110:8:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "2110:8:0"
}
],
"name": "removeViewer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 226,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 223,
"name": "viewerGroup",
"nodeType": "VariableDeclaration",
"scope": 319,
"src": "2069:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 222,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2069:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 225,
"name": "viewer",
"nodeType": "VariableDeclaration",
"scope": 319,
"src": "2087:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 224,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2087:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2068:34:0"
},
"payable": false,
"returnParameters": {
"id": 229,
"nodeType": "ParameterList",
"parameters": [],
"src": "2119:0:0"
},
"scope": 404,
"src": "2047:602:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 327,
"nodeType": "Block",
"src": "2711:35:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 324,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2724:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 325,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2724:19:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 323,
"id": 326,
"nodeType": "Return",
"src": "2717:26:0"
}
]
},
"id": 328,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumViewerGroups",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 320,
"nodeType": "ParameterList",
"parameters": [],
"src": "2678:2:0"
},
"payable": false,
"returnParameters": {
"id": 323,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 322,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 328,
"src": "2705:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 321,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2705:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2704:6:0"
},
"scope": 404,
"src": "2651:95:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 340,
"nodeType": "Block",
"src": "2813:42:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 335,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2826:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 337,
"indexExpression": {
"argumentTypes": null,
"id": 336,
"name": "group",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 330,
"src": "2839:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2826:19:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 338,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2826:26:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 334,
"id": 339,
"nodeType": "Return",
"src": "2819:33:0"
}
]
},
"id": 341,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getNumViewers",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 331,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 330,
"name": "group",
"nodeType": "VariableDeclaration",
"scope": 341,
"src": "2771:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 329,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2771:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2770:12:0"
},
"payable": false,
"returnParameters": {
"id": 334,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 333,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 341,
"src": "2807:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 332,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2807:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2806:6:0"
},
"scope": 404,
"src": "2748:107:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 356,
"nodeType": "Block",
"src": "2933:40:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 350,
"name": "viewerGroups",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2944:12:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_array$_t_address_$dyn_storage_$dyn_storage",
"typeString": "address[] storage ref[] storage ref"
}
},
"id": 352,
"indexExpression": {
"argumentTypes": null,
"id": 351,
"name": "group",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 343,
"src": "2957:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2944:19:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[] storage ref"
}
},
"id": 354,
"indexExpression": {
"argumentTypes": null,
"id": 353,
"name": "index",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 345,
"src": "2964:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2944:26:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 349,
"id": 355,
"nodeType": "Return",
"src": "2937:33:0"
}
]
},
"id": 357,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getViewer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 346,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 343,
"name": "group",
"nodeType": "VariableDeclaration",
"scope": 357,
"src": "2876:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 342,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2876:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 345,
"name": "index",
"nodeType": "VariableDeclaration",
"scope": 357,
"src": "2888:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 344,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "2888:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2875:24:0"
},
"payable": false,
"returnParameters": {
"id": 349,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 348,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 357,
"src": "2924:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 347,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2924:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2923:9:0"
},
"scope": 404,
"src": "2857:116:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 368,
"nodeType": "Block",
"src": "3046:34:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 364,
"name": "viewerByName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 30,
"src": "3059:12:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$",
"typeString": "mapping(string memory => address)"
}
},
"id": 366,
"indexExpression": {
"argumentTypes": null,
"id": 365,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 359,
"src": "3072:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3059:18:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 363,
"id": 367,
"nodeType": "Return",
"src": "3052:25:0"
}
]
},
"id": 369,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getViewerByName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 360,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 359,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 369,
"src": "3000:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 358,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "3000:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2999:13:0"
},
"payable": false,
"returnParameters": {
"id": 363,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 362,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 369,
"src": "3037:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 361,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3037:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3036:9:0"
},
"scope": 404,
"src": "2975:105:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 381,
"nodeType": "Block",
"src": "3151:37:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 376,
"name": "viewerInfo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26,
"src": "3164:10:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_Viewer_$14_storage_$",
"typeString": "mapping(address => struct Relationship.Viewer storage ref)"
}
},
"id": 378,
"indexExpression": {
"argumentTypes": null,
"id": 377,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 371,
"src": "3175:4:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3164:16:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Viewer_$14_storage",
"typeString": "struct Relationship.Viewer storage ref"
}
},
"id": 379,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "name",
"nodeType": "MemberAccess",
"referencedDeclaration": 11,
"src": "3164:21:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"functionReturnParameters": 375,
"id": 380,
"nodeType": "Return",
"src": "3157:28:0"
}
]
},
"id": 382,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getViewerName",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 372,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 371,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 382,
"src": "3105:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 370,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3105:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3104:14:0"
},
"payable": false,
"returnParameters": {
"id": 375,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 374,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 382,
"src": "3143:6:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
"typeName": {
"id": 373,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "3143:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string storage pointer"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3142:8:0"
},
"scope": 404,
"src": "3082:106:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 402,
"nodeType": "Block",
"src": "3218:94:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 393,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 388,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 385,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 416,
"src": "3227:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 386,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3227:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 387,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "3241:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "3227:20:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 392,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 389,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 416,
"src": "3251:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 390,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3251:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"id": 391,
"name": "provider",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "3265:8:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "3251:22:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "3227:46:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 397,
"nodeType": "IfStatement",
"src": "3224:59:0",
"trueBody": {
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 394,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 420,
"src": "3275:6:0",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 395,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3275:8:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 396,
"nodeType": "ExpressionStatement",
"src": "3275:8:0"
}
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 399,
"name": "patron",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "3302:6:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 398,
"name": "selfdestruct",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 422,
"src": "3289:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_selfdestruct_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 400,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3289:20:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 401,
"nodeType": "ExpressionStatement",
"src": "3289:20:0"
}
]
},
"id": 403,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "terminate",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 383,
"nodeType": "ParameterList",
"parameters": [],
"src": "3208:2:0"
},
"payable": false,
"returnParameters": {
"id": 384,
"nodeType": "ParameterList",
"parameters": [],
"src": "3218:0:0"
},
"scope": 404,
"src": "3190:122:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
}
],
"scope": 405,
"src": "26:3288:0"
}
],
"src": "0:3315:0"
},
"compiler": {
"name": "solc",
"version": "0.4.19+commit.c4cbbb05.Emscripten.clang"
},
"networks": {},
"schemaVersion": "2.0.0",
"updatedAt": "2018-06-06T03:28:00.936Z"
}
================================================
FILE: SmartContracts/contracts/Agent.sol
================================================
pragma solidity ^0.4.15;
//Represents both a Patient and a Provider,
//Patients list of relationships with different Providers
contract Agent {
address public agent;
bool public agentEnabled;
address[] public custodians;
bool[] public custodianEnabled;
address[] public relationships; //list of Relationship contract addresses
modifier isOwner() {
bool enable;
if(agentEnabled && msg.sender == agent) enable = true;
for(uint i = 0; i < custodians.length; i++) {
if(custodianEnabled[i] && msg.sender == custodians[i]) {
enable = true;
break;
}
}
if(!enable) revert();
_;
}
function Agent() public {
agent = msg.sender;
agentEnabled = true;
}
function setAgent(address addr) public isOwner {
agent = addr;
}
function enableAgent(bool enable) public isOwner {
agentEnabled = enable;
require(getNumEnabledOwners() > 0);
}
function addCustodian(address addr) public isOwner {
custodians.push(addr);
custodianEnabled.push(true);
}
function removeCustodian(address addr) public isOwner {
bool overwrite = false;
for(uint i = 0; i < custodians.length; i++) {
if(overwrite) {
custodians[i - 1] = custodians[i];
custodianEnabled[i-1] = custodianEnabled[i];
}
if(custodians[i] == addr) {
overwrite = true;
}
}
delete(custodians[custodians.length-1]);
delete(custodianEnabled[custodianEnabled.length-1]);
custodians.length -= 1;
custodianEnabled.length -= 1;
require(getNumEnabledOwners() > 0);
}
function enableCustodian(address addr, bool enable) public {
for(uint i = 0; i < custodians.length; i++) {
if(custodians[i] == addr) {
custodianEnabled[i] = enable;
break;
}
}
require(getNumEnabledOwners() > 0);
}
function addRelationship(address r) public isOwner {
relationships.push(r);
}
function getNumRelationships() public constant returns (uint) {
return relationships.length;
}
function getNumEnabledOwners() public constant returns (uint) {
uint num = 0;
if(agentEnabled) num++;
for(uint i = 0; i < custodianEnabled.length; i++) {
if(custodianEnabled[i]) num++;
}
return num;
}
function getNumCustodians() public constant returns (uint) {
return custodians.length;
}
}
================================================
FILE: SmartContracts/contracts/AgentGroup.sol
================================================
pragma solidity ^0.4.15;
//Represents a set of agents who represent themself as one
contract AgentGroup {
address[] public agents;
modifier isOwner() {
bool enable;
for(uint i = 0; i < agents.length; i++) {
if(msg.sender == agents[i]) {
enable = true;
break;
}
}
if(!enable) revert();
_;
}
function AgentGroup() public {
agents.push(msg.sender);
}
function addAgent(address addr) public isOwner {
agents.push(addr);
}
function removeAgent(address addr) public isOwner {
bool overwrite = false;
for(uint i = 0; i < agents.length; i++) {
if(overwrite) {
agents[i - 1] = agents[i];
}
if(agents[i] == addr) {
overwrite = true;
}
}
delete(agents[agents.length-1]);
agents.length -= 1;
require(getNumAgents() > 0);
}
function getNumAgents() public constant returns (uint) {
return agents.length;
}
}
================================================
FILE: SmartContracts/contracts/AgentRegistry.sol
================================================
pragma solidity ^0.4.15;
//Contains
contract AgentRegistry {
struct Agent {
string name;
address contractAddr;
string host;
}
mapping(address => Agent) agentInfo;
mapping(string => address) agentByName;
mapping(address => address) public agentFromContract;
//the current set of signers
address[] signers;
mapping(address => bool) public isSigner;
//keeps track of votes per signer and the yay count
mapping( address => address[]) voters;
mapping( address => mapping(address => bool)) hasVoted;
mapping( address => mapping(address => bool)) voteInfo;
mapping( address => uint) yayVotes;
//prospectives is a list of all prospective waiting to be voted
address[] prospectives;
//kicked is a list of all signers on the chopping block to be voted out
address[] kicked;
mapping(address => bool) public isProspective;
mapping(address => bool) public isKicked;
//keeps track of who's idea each proposal was
mapping(address => address) proposer;
event AddSigner(address indexed addr);
event RemoveSigner(address indexed addr);
modifier onlySigners() {
require(isSigner[msg.sender]);
_;
}
function AgentRegistry(string name, address contractAddr, string host) public {
signers.push(msg.sender);
agentInfo[msg.sender] = Agent(name, contractAddr, host);
agentByName[name] = msg.sender;
agentFromContract[contractAddr] = msg.sender;
isSigner[msg.sender] = true;
}
// to prevent fraud only signers are allowed to set a name
function setAgentName(string name) onlySigners() public {
//throw if the proposed name is already taken
require(agentByName[name] == address(0));
agentInfo[msg.sender].name = name;
agentByName[name] = msg.sender;
}
function setAgentContractAddr(address contractAddr) public {
agentInfo[msg.sender].contractAddr = contractAddr;
agentFromContract[contractAddr] = msg.sender;
}
function setAgentHost(string host) public {
agentInfo[msg.sender].host = host;
}
//the caller proposes to add themself to the set of signers
//the name is used to identify the new signer
function propose(string name) public {
require(!isSigner[msg.sender]);
require(!isProspective[msg.sender]);
prospectives.push(msg.sender);
isProspective[msg.sender] = true;
proposer[msg.sender] = msg.sender;
//throw if the proposed name is already taken
require(agentByName[name] == address(0));
agentInfo[msg.sender].name = name;
}
//propose a signer to be kicked
function kick (address rip) public onlySigners {
require(isSigner[msg.sender]);
require(!isKicked[rip]);
//the blockchain cannot survive with less than 2 signers
require(signers.length > 2);
kicked.push(rip);
isKicked[rip] = true;
proposer[rip] = msg.sender;
vote(rip, true);
}
//the caller recinds their proposal, deleting all cast votes
function rescind (address prospective) public {
require(proposer[prospective] == msg.sender);
clearVotes(prospective);
}
function clearVotes(address prospective) internal {
uint i;
for(i = 0; i < voters[prospective].length; i++) {
delete voteInfo[prospective][voters[prospective][i]];
delete hasVoted[prospective][voters[prospective][i]];
}
delete voters[prospective];
delete proposer[prospective];
delete yayVotes[prospective];
bool overwrite = false;
if(isProspective[prospective]) {
delete isProspective[prospective];
for(i = 0; i < prospectives.length; i++) {
if(overwrite) {
prospectives[i - 1] = prospectives[i];
}
if(prospectives[i] == prospective) {
overwrite = true;
}
}
delete(prospectives[prospectives.length-1]);
prospectives.length -= 1;
} else {
delete isKicked[prospective];
for(i = 0; i < kicked.length; i++) {
if(overwrite) {
kicked[i - 1] = kicked[i];
}
if(kicked[i] == prospective) {
overwrite = true;
}
}
delete(kicked[kicked.length-1]);
kicked.length -= 1;
}
}
//an existing singer can vote or revote on an existing proposal
function vote(address prospective, bool value) public onlySigners() {
require(isProspective[prospective] || isKicked[prospective]);
//if the signer voted yes before and votes no now remove their old vote
if(voteInfo[prospective][msg.sender] && !value) {
yayVotes[prospective] -= 1;
}
//if the signer is voting yes and hadn't before add a yay vote
if(!voteInfo[prospective][msg.sender] && value) {
yayVotes[prospective] += 1;
}
voteInfo[prospective][msg.sender] = value;
if(!hasVoted[prospective][msg.sender]) {
voters[prospective].push(msg.sender);
}
hasVoted[prospective][msg.sender] = true;
//if this was a no vote it won't trigger anything and no further processing is needed
if(!value) return;
//if there aren't enought votes for a majority nothing more to do
if(yayVotes[prospective] < (signers.length+1)/2) return;
if(isKicked[prospective]) {
bool overwrite = false;
for(uint i = 0; i < signers.length; i++) {
if(overwrite) {
signers[i - 1] = signers[i];
}
if(signers[i] == prospective) {
overwrite = true;
}
}
delete(signers[signers.length-1]);
signers.length -= 1;
isSigner[prospective] = false;
RemoveSigner(prospective);
} else {
signers.push(prospective);
isSigner[prospective] = true;
AddSigner(prospective);
}
clearVotes(prospective);
}
function getAgentByName(string name) public constant returns (address) {
return agentByName[name];
}
function getAgentName(address addr) public constant returns (string) {
return agentInfo[addr].name;
}
function getAgentContractAddr(address addr) public constant returns (address) {
return agentInfo[addr].contractAddr;
}
function getAgentHost(address addr) public constant returns (string) {
return agentInfo[addr].host;
}
function getNumSigners() public constant returns (uint) {
return signers.length;
}
function getSigner(uint idx) public constant returns (address) {
return signers[idx];
}
function getNumVoters(address prospective) public constant returns (uint) {
return voters[prospective].length;
}
function getVoter(address prospective, uint idx) public constant returns (address) {
return voters[prospective][idx];
}
function getVoteInfo(address prospective, address signer) public constant returns (bool) {
return voteInfo[prospective][signer];
}
function getNumYayVotes(address prospective) public constant returns (uint) {
return yayVotes[prospective];
}
function getNumProspectives() public constant returns (uint) {
return prospectives.length;
}
function getProspective(uint idx) public constant returns (address) {
return prospectives[idx];
}
function getNumKicked() public constant returns (uint) {
return kicked.length;
}
function getKicked(uint idx) public constant returns (address) {
return kicked[idx];
}
function getProposer(address prospective) public constant returns (address) {
return proposer[prospective];
}
}
================================================
FILE: SmartContracts/contracts/AllAccessRelationship.sol
================================================
pragma solidity ^0.4.18;
contract AllAccessRelationship {
address public patron;
address public provider;
string public providerName;
struct Viewer {
string name;
address addr;
}
address[] public viewers;
mapping(address => bool) public isViewer;
mapping(address => Viewer) viewerInfo;
mapping(string => address) viewerByName;
uint256 constant UINT256_MAX = ~uint256(0);
modifier isPatron() {
if(msg.sender != patron) revert();
_;
}
function Relationship(address _provider) public {
patron = msg.sender;
provider = _provider;
}
/****These functions should be left commented out until a use case for them arises
function setPatron(address addr) isPatron {
patron = addr;
}
function setProvider(address addr) isPatron {
provider = addr;
}
******************/
function setProviderName(string name) public {
providerName = name;
}
function addViewer(string name, address viewer) public isPatron {
require(!isViewer[viewer]);
isViewer[viewer] = true;
viewers.push(viewer);
viewerInfo[viewer] = Viewer(name, viewer);
}
function removeViewer(address viewer) public isPatron {
require(isViewer[viewer]);
isViewer[viewer] = false;
bool overwrite = false;
for(uint i = 0; i < viewers.length; i++) {
if(overwrite) {
viewers[i - 1] = viewers[i];
}
if(viewers[i] == viewer) {
overwrite = true;
}
}
delete(viewers[viewers.length-1]);
delete(viewerInfo[viewer]);
}
function getNumViewers() public constant returns(uint) {
return viewers.length;
}
function getViewerByName(string name) public constant returns(address) {
return viewerByName[name];
}
function getViewerName(address addr) public constant returns(string) {
return viewerInfo[addr].name;
}
function terminate() public {
if(msg.sender != patron && msg.sender != provider) revert();
selfdestruct(patron);
}
}
================================================
FILE: SmartContracts/contracts/DeadmanSwitch.sol
================================================
pragma solidity ^0.4.15;
contract DeadmanSwitch {
address public agent;
address[] public relationships; //list of Relationship contract addresses
uint public lastTouch; // gets updated whenever the owner touches this switch
uint public timeout; //minimum time in miliseconds between touches
modifier isOwner() {
if(msg.sender != agent) revert();
_;
}
function DeadmanSwitch() public {
agent = msg.sender;
}
function setAgent(address addr) public isOwner {
agent = addr;
}
function addRelationship(address r) public isOwner {
relationships.push(r);
}
function getNumRelationships() public constant returns (uint) {
return relationships.length;
}
function touch() public isOwner {
lastTouch = now;
}
function setTimeout(uint _timeout) public isOwner {
timeout = _timeout;
}
function isAlive() public constant returns (bool){
return now <= lastTouch + timeout;
}
}
================================================
FILE: SmartContracts/contracts/Migrations.sol
================================================
pragma solidity ^0.4.4;
contract Migrations {
address public owner;
uint public last_completed_migration;
modifier restricted() {
if (msg.sender == owner) _;
}
function Migrations() {
owner = msg.sender;
}
function setCompleted(uint completed) restricted {
last_completed_migration = completed;
}
function upgrade(address new_address) restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}
================================================
FILE: SmartContracts/contracts/Relationship.sol
================================================
pragma solidity ^0.4.18;
contract Relationship {
address public patron;
address public provider; // this is a unique address for the provider used only for this relationship
string public providerAddr; //encrypted provider address
string public providerName; //encrypted provider name
struct Viewer {
string name;
string providerAddr; //the real provider address encypted so only the viewer can read
}
address[][] viewerGroups;
mapping(address => bool) public isViewer;
mapping(address => Viewer) viewerInfo;
mapping(string => address) viewerByName;
uint256 constant UINT256_MAX = ~uint256(0);
modifier isPatron() {
if(msg.sender != patron) revert();
_;
}
function Relationship(address _provider) public {
patron = msg.sender;
provider = _provider;
}
/****These functions should be left commented out until a use case for them arises
function setPatron(address addr) isPatron {
patron = addr;
}
function setProvider(address addr) isPatron {
provider = addr;
}
******************/
function setProviderAddress(string addr) public {
providerAddr = addr;
}
function setProviderName(string name) public {
providerName = name;
}
function addViewerGroup() public isPatron {
viewerGroups.length += 1;
}
function removeViewerGroup(uint viewerGroup) public isPatron {
uint numViewers = viewerGroups[viewerGroup].length;
uint i;
for(i = 0; i < numViewers; i++) {
isViewer[viewerGroups[viewerGroup][i]] = false;
}
uint numGroups = viewerGroups.length;
for(i = viewerGroup+1; i < numGroups; i++) {
viewerGroups[i - 1] = viewerGroups[i];
}
delete(viewerGroups[numGroups-1]);
viewerGroups.length -= 1;
}
function addViewer(string name, uint viewerGroup, address viewer, string provAddr) public isPatron {
require(!isViewer[viewer]);
isViewer[viewer] = true;
viewerGroups[viewerGroup].push(viewer);
viewerInfo[viewer] = Viewer(name, provAddr);
}
function removeViewer(uint viewerGroup, address viewer) public isPatron {
require(isViewer[viewer]);
isViewer[viewer] = false;
uint numViewers = viewerGroups[viewerGroup].length;
bool overwrite = false;
for(uint i = 0; i < numViewers; i++) {
if(overwrite) {
viewerGroups[viewerGroup][i - 1] = viewerGroups[viewerGroup][i];
}
if(viewerGroups[viewerGroup][i] == viewer) {
overwrite = true;
}
}
delete(viewerGroups[viewerGroup][numViewers-1]);
viewerGroups[viewerGroup].length -= 1;
delete(viewerInfo[viewer]);
}
function getNumViewerGroups() public constant returns(uint) {
return viewerGroups.length;
}
function getNumViewers(uint group) public constant returns(uint) {
return viewerGroups[group].length;
}
function getViewer(uint group, uint index) public constant returns(address) {
return viewerGroups[group][index];
}
function getViewerByName(string name) public constant returns(address) {
return viewerByName[name];
}
function getViewerName(address addr) public constant returns(string) {
return viewerInfo[addr].name;
}
function terminate() public {
if(msg.sender != patron && msg.sender != provider) revert();
selfdestruct(patron);
}
}
================================================
FILE: SmartContracts/migrations/1_initial_migration.js
================================================
var Migrations = artifacts.require('./Migrations.sol');
module.exports = function (deployer) {
deployer.deploy(Migrations);
};
================================================
FILE: SmartContracts/migrations/2_deploy_contracts.js
================================================
var Agent = artifacts.require('Agent');
var AgentRegistry = artifacts.require('AgentRegistry');
module.exports = function (deployer) {
deployer.deploy(Agent).then(a => {
return deployer.deploy(AgentRegistry, 'TheFirstProvider', Agent.address, '127.0.0.1');
});
};
================================================
FILE: SmartContracts/test/agent.js
================================================
var Agent = artifacts.require('./Agent.sol');
contract('Agent', function (accounts) {
let agent;
var constants = require('./constants.js')(accounts);
before(() => {
return Agent.new({from: constants.agent1}).then(_agent => {
agent = _agent;
});
});
it('should have an owner', function () {
return agent.agent().then(agent => {
assert.equal(agent, constants.agent1);
});
});
it('should enable the agent', function () {
return agent.agentEnabled().then(enable => {
assert.equal(enable, true);
});
});
it('should have the right number of owners', function () {
return agent.getNumEnabledOwners().then(owners => {
assert.equal(owners, 1);
});
});
it('let the owner add relationships', function () {
return agent.addRelationship(constants.provider1, {from: constants.agent1});
});
it('should transfer the agent', function () {
return agent.setAgent(constants.agent2, {from: constants.agent1});
});
it('should not let other people add relationships', function () {
return agent.addRelationship(constants.provider1, {from: constants.agent1})
.then(() => {assert(false);}, (test, err) => {
assert(true);
});
});
it('should let the agent add a relationship', function () {
return agent.addRelationship(constants.pharmacy1, {from: constants.agent2});
});
it('should not let the agent remove the only owner', function () {
return agent.enableAgent(false, {from: constants.agent1})
.then(() => {assert(false);}, (test, err) => {
assert(true);
});
});
it('should let the agent add a custodian', function () {
return agent.addCustodian(constants.family1, {from: constants.agent2});
});
it('should have the right number of owners', function () {
return agent.getNumEnabledOwners().then(owners => {
assert.equal(owners, 2);
});
});
it('should not let other people add custodians', function () {
return agent.addCustodian(constants.family1, {from: constants.agent1})
.then(() => {assert(false);}, (test, err) => {
assert(true);
});
});
it('should disable the agent', function () {
return agent.enableAgent(false, {from: constants.family1}).then(() => {
return agent.agentEnabled();
}).then((enable) => {
assert.equal(enable, false);
});
});
it('should not let the custodian disable the only owner', function () {
return agent.enableCustodian(constants.family1, false, {from: constants.family1})
.then(() => {assert(false);}, (test, err) => {
assert(true);
});
});
it('should not let the custodian remove the only owner', function () {
return agent.removeCustodian(constants.family1, false, {from: constants.family1})
.then(() => {assert(false);}, (test, err) => {
assert(true);
});
});
it('should let the custodian add a custodian', function () {
return agent.addCustodian(constants.family2, {from: constants.family1});
});
it('should have the right number of owners', function () {
return agent.getNumEnabledOwners().then(owners => {
assert.equal(owners, 2);
});
});
it('should let the custodian add a relationship', function () {
return agent.addRelationship(constants.provider2, {from: constants.family1});
});
it('should let the custodian disable a custodian', function () {
return agent.enableCustodian(constants.family1, false, {from: constants.family1});
});
it('should have the right number of owners', function () {
return agent.getNumEnabledOwners().then(owners => {
assert.equal(owners, 1);
});
});
it('should have the right number of relationships', function () {
return agent.getNumRelationships().then(relations => {
assert.equal(relations, 3);
});
});
});
================================================
FILE: SmartContracts/test/agentGroup.js
================================================
var AgentGroup = artifacts.require('./AgentGroup.sol');
contract('AgentGroup', function (accounts) {
let agentGroup;
var constants = require('./constants.js')(accounts);
before(() => {
return AgentGroup.new({from: constants.agent1}).then(_agentGroup => {
agentGroup = _agentGroup;
});
});
it('should have an owner', function () {
return agentGroup.agents(0).then(agent => {
assert.equal(agent, constants.agent1);
});
});
it('should not let the agent remove the only agent', function () {
return agentGroup.removeAgent(constants.agent1, false, {from: constants.agent1})
.then(() => {assert(false);}, (test, err) => {
assert(true);
});
});
it('should let the agent add an agent', function () {
return agentGroup.addAgent(constants.agent2, {from: constants.agent1});
});
it('should have the right number of agents', function () {
return agentGroup.getNumAgents().then(agents => {
assert.equal(agents, 2);
});
});
it('should have teh correct owners', function () {
return Promise.all([
agentGroup.agents(0).then(agent => {
assert.equal(agent, constants.agent1);
}),
agentGroup.agents(1).then(agent => {
assert.equal(agent, constants.agent2);
}),
]);
});
it('should not let other people add agents', function () {
return agentGroup.addAgent(constants.family1, {from: constants.family1})
.then(() => {assert(false);}, (test, err) => {
assert(true);
});
});
it('should let the second agent add an agent', function () {
return agentGroup.addAgent(constants.family1, {from: constants.agent1});
});
it('should have the right number of agents', function () {
return agentGroup.getNumAgents().then(agents => {
assert.equal(agents, 3);
});
});
it('should let agents remove an agent', function () {
return agentGroup.removeAgent(constants.agent1, {from: constants.family1});
});
it('should have the right number of owners', function () {
return agentGroup.getNumAgents().then(agents => {
assert.equal(agents, 2);
});
});
});
================================================
FILE: SmartContracts/test/agentRegistry.js
================================================
var Agent = artifacts.require('./Agent.sol');
var AgentRegistry = artifacts.require('./AgentRegistry.sol');
contract('AgentRegistry', function (accounts) {
let agentRegistry;
let agent;
var constants = require('./constants.js')(accounts);
before(() => {
return Agent.new({from: constants.provider1}).then(_agent => {
agent = _agent;
return AgentRegistry.new(constants.providerName1, agent.address, constants.host1, {from: constants.provider1});
}).then(_agentRegistry => {
agentRegistry = _agentRegistry;
});
});
it('should have a signer', () => {
return agentRegistry.getSigner(0).then(signer => {
assert.equal(signer, constants.provider1);
});
});
it('should have only one singer', () => {
return agentRegistry.getNumSigners().then(value => {
assert.equal(value, 1);
});
});
it('should store the signer\'s name', () => {
return agentRegistry.getAgentName(constants.provider1).then(name => {
assert.equal(name, constants.providerName1);
});
});
it('should store the signer\'s agent contract address', () => {
return agentRegistry.getAgentContractAddr(constants.provider1).then(value => {
assert.equal(value, agent.address);
});
});
it('should reject proposals for an existing name', () => {
return agentRegistry.propose(constants.providerName1, {from: constants.provider2})
.then(() => {assert(false);}, () => {
assert(true);
});
});
it('should allow someone to propose themself', () => {
return agentRegistry.propose(constants.providerName4, {from: constants.provider2});
});
it('should store the prospective\'s name', () => {
return agentRegistry.getAgentName(constants.provider2).then(name => {
assert.equal(name, constants.providerName4);
});
});
it('shouldn\'t allow prospectives to readd themself', () => {
return agentRegistry.propose({from: constants.provider2})
.then(() => {assert(false);}, () => {
assert(true);
});
});
it('shouldn\'t allow signers to repropose themself', () => {
return agentRegistry.propose(constants.providerName4, {from: constants.provider1})
.then(() => {assert(false);}, () => {
assert(true);
});
});
it('shouldn\'t allow someone else to rescind the proposal', () => {
return agentRegistry.rescind(constants.provider2, {from: constants.provider1})
.then(() => {assert(false);}, () => {
assert(true);
});
});
it('should set the prospective contract address', () => {
return agentRegistry.setAgentContractAddr(constants.provider2,
{from: constants.provider2}
);
});
it('should store the prospective\'s contract address', () => {
return agentRegistry.getAgentContractAddr(constants.provider2).then(value => {
assert.equal(value, constants.provider2);
});
});
it('should reject votes from non signers', () => {
return agentRegistry.vote(constants.provider2, true, {from: constants.provider2})
.then(() => {assert(false);}, () => {
assert(true);
});
});
it('should accept the signers vote', () => {
return agentRegistry.vote(constants.provider2, true, {from: constants.provider1})
.then(result => {
assert.equal(result.logs.length, 1);
assert.equal(result.logs[0].event, 'AddSigner');
assert.equal(result.logs[0].args.addr, constants.provider2);
});
});
it('should reject further votes on a completed proposal', () => {
return agentRegistry.vote(constants.provider2, true, {from: constants.provider1})
.then(() => {assert(false);}, () => {
assert(true);
});
});
it('should reject name changs to an existing name', () => {
return agentRegistry.setAgentName(constants.providerName1, {from: constants.provider2})
.then(() => {assert(false);}, () => {
assert(true);
});
});
it('should change the new signer\'s name', () => {
return agentRegistry.setAgentName(constants.providerName2,
{from: constants.provider2}
);
});
it('should store the signers\'s name', () => {
return agentRegistry.getAgentName(constants.provider2).then(name => {
assert.equal(name, constants.providerName2);
});
});
it('should set the new signer\'s name', () => {
return agentRegistry.setAgentHost(constants.host2,
{from: constants.provider2}
);
});
it('should store the signers\'s host', () => {
return agentRegistry.getAgentHost(constants.provider2).then(name => {
assert.equal(name, constants.host2);
});
});
it('should reverse lookup the signer by name', () => {
return agentRegistry.getAgentByName(constants.providerName2).then(name => {
assert.equal(name, constants.provider2);
});
});
it('should set the prospective contractAddr', () => {
return agentRegistry.setAgentContractAddr(constants.provider4,
{from: constants.provider4}
);
});
it('should allow someone to propose themself', () => {
//truffle add Promises to the global namespace
return Promise.all([
agentRegistry.propose('', {from: constants.provider3}),
agentRegistry.propose('', {from: constants.provider4}),
agentRegistry.propose('', {from: constants.pharmacy1}),
]);
});
it('should properly store info about the pending prospectives', () => {
return Promise.all([
agentRegistry.getNumProspectives().then(value => {
assert.equal(value.toNumber(), 3);
}),
agentRegistry.getProspective(0).then(value => {
assert.equal(value, constants.provider3);
}),
agentRegistry.getProposer(constants.provider3).then(value => {
assert.equal(value, constants.provider3);
}),
]);
});
//this signer should also get automatically confirmed by 1/2 of the signers
it('should accept the first signers vote', () => {
return agentRegistry.vote(constants.provider3, true, {from: constants.provider1})
.then(result => {
assert.equal(result.logs.length, 1);
assert.equal(result.logs[0].event, 'AddSigner');
assert.equal(result.logs[0].args.addr, constants.provider3);
});
});
it('should properly store info about the pending transactions', () => {
return Promise.all([
agentRegistry.getNumProspectives().then(value => {
assert.equal(value.toNumber(), 2);
}),
agentRegistry.getProspective(1).then(value => {
assert.equal(value, constants.pharmacy1);
}),
agentRegistry.getProposer(constants.pharmacy1).then(value => {
assert.equal(value, constants.pharmacy1);
}),
]);
});
//these signers won't get automatically confirmed, they need 2/3 confirmations
it('should accept the first signer\'s vote', () => {
return Promise.all([
agentRegistry.vote(constants.provider4, true, {from: constants.provider1}),
agentRegistry.vote(constants.pharmacy1, true, {from: constants.provider1}),
]);
});
it('should allow someone rescind their proposal', () => {
return agentRegistry.rescind(constants.pharmacy1, {from: constants.pharmacy1});
});
it('should properly store info about the pending transactions', () => {
return Promise.all([
agentRegistry.getNumProspectives().then(value => {
assert.equal(value.toNumber(), 1);
}),
agentRegistry.getProspective(0).then(value => {
assert.equal(value, constants.provider4);
}),
agentRegistry.getProposer(constants.provider4).then(value => {
assert.equal(value, constants.provider4);
}),
]);
});
it('should accept the first signer change their vote', () => {
return agentRegistry.vote(constants.provider4, false, {from: constants.provider1});
});
it('should store the right number of voters', () => {
return agentRegistry.getNumVoters(constants.provider4).then(value => {
assert.equal(value.toNumber(), 1);
});
});
it('should store the first voter in the list of voters', () => {
return agentRegistry.getVoter(constants.provider4, 0).then(value => {
assert.equal(value, constants.provider1);
});
});
it('should store a no vote for the first signer', () => {
return agentRegistry.getVoteInfo(constants.provider4, constants.provider1).then(value => {
assert.isFalse(value);
});
});
it('should store no yay vote', () => {
return agentRegistry.getNumYayVotes(constants.provider4).then(value => {
assert.equal(value.toNumber(), 0);
});
});
it('should accept both signers\' vote', () => {
return Promise.all([
agentRegistry.vote(constants.provider4, true, {from: constants.provider1}),
agentRegistry.vote(constants.provider4, true, {from: constants.provider2}).then(result => {
assert.equal(result.logs.length, 1);
assert.equal(result.logs[0].event, 'AddSigner');
assert.equal(result.logs[0].args.addr, constants.provider4);
}),
]);
});
it('should store no yay vote', () => {
return agentRegistry.getNumYayVotes(constants.provider4).then(value => {
assert.equal(value.toNumber(), 0);
});
});
it('should register the new signer', () => {
Promise.all([
agentRegistry.setAgentName(constants.providerName4,
{from: constants.provider4}
),
agentRegistry.setAgentContractAddr(constants.providerName4,
{from: constants.provider4}
),
agentRegistry.setAgentHost(constants.host1,
{from: constants.provider4}
),
]);
});
it('should properly update the signer info', () => {
return Promise.all([
agentRegistry.getNumSigners().then(value => {
assert.equal(value.toNumber(), 4);
}),
agentRegistry.getAgentName(constants.provider4).then(name => {
assert.equal(name, constants.providerName4);
}),
agentRegistry.getAgentHost(constants.provider4).then(name => {
assert.equal(name, constants.host1);
}),
agentRegistry.getAgentContractAddr(constants.provider4).then(value => {
assert.equal(value, constants.provider4);
}),
agentRegistry.getSigner(3).then(value => {
assert.equal(value, constants.provider4);
}),
agentRegistry.isSigner.call(constants.provider2).then(value => {
assert.isTrue(value);
}),
agentRegistry.getNumProspectives().then(value => {
assert.equal(value.toNumber(), 0);
}),
]);
});
it('shouldn\'t allow randos to kick people', () => {
return agentRegistry.kick(constants.provider1, {from: constants.pharmacy1})
.then(() => {assert(false);}, () => {
assert(true);
});
});
it('should allow a signer to kick someone', () => {
return agentRegistry.kick(constants.provider1, {from: constants.provider2});
});
it('shouldn\'t allow duplicate kicks', () => {
return agentRegistry.kick(constants.provider1, {from: constants.provider3})
.then(() => {assert(false);}, () => {
assert(true);
});
});
it('should properly store info about the pending transactions', () => {
return Promise.all([
agentRegistry.getNumKicked().then(value => {
assert.equal(value.toNumber(), 1);
}),
agentRegistry.getKicked(0).then(value => {
assert.equal(value, constants.provider1);
}),
agentRegistry.getProposer(constants.provider1).then(value => {
assert.equal(value, constants.provider2);
}),
]);
});
it('should allow the other signers to vote', () => {
return agentRegistry.vote(constants.provider1, true, {from: constants.provider3})
.then(result => {
assert.equal(result.logs.length, 1);
assert.equal(result.logs[0].event, 'RemoveSigner');
assert.equal(result.logs[0].args.addr, constants.provider1);
});
});
it('should properly update the signer info', () => {
return Promise.all([
agentRegistry.getNumSigners().then(value => {
assert.equal(value.toNumber(), 3);
}),
agentRegistry.getSigner(2).then(value => {
assert.equal(value, constants.provider3);
}),
agentRegistry.isSigner.call(constants.provider1).then(value => {
assert.isFalse(value);
}),
agentRegistry.getNumProspectives().then(value => {
assert.equal(value.toNumber(), 0);
}),
]);
});
});
================================================
FILE: SmartContracts/test/constants.js
================================================
let constants = (accounts) => {
return {
agent1: accounts[0],
agent2: accounts[1],
patron1: accounts[2],
patron2: accounts[3],
provider1: accounts[4],
providerName1: 'TheFirstProvider',
provider2: accounts[5],
providerName2: 'TheSecondProvider',
provider3: accounts[6],
providerName3: 'TheThirdProvider',
provider4: accounts[7],
providerName4: 'TheFourthProvider',
pharmacy1: accounts[8],
pharmacyName1: 'TheFirstPharma',
family1: accounts[9],
familyName1: 'Fam1',
family2: accounts[10],
familyName2: 'Fam2',
perm1: 'bloodtest',
permIndex1: 0,
perm2: 'radiology',
permIndex2: 1,
perm3: 'xrays',
permIndex3: 2,
canRead: true,
cannotRead: false,
canWrite: true,
cannotWrite: false,
duration0: 0,
durationForever: 100000,
duration1: 50,
host1: '0.0.0.0',
host2: '127.0.0.1',
};
};
module.exports = constants;
================================================
FILE: SmartContracts/test/deadmanSwitch.js
================================================
var DeadmanSwitch = artifacts.require('./DeadmanSwitch.sol');
contract('DeadmanSwitch', function (accounts) {
let agent;
var constants = require('./constants.js')(accounts);
before(() => {
return DeadmanSwitch.new({from: constants.agent1}).then(_agent => {
agent = _agent;
});
});
it('should have an owner', function () {
return agent.agent().then(agent => {
assert.equal(agent, constants.agent1);
});
});
it('let the owner add relationships', function () {
return agent.addRelationship(constants.provider1, {from: constants.agent1});
});
it('should transfer the agent', function () {
return agent.setAgent(constants.agent2, {from: constants.agent1});
});
it('should touch the switch', function () {
return agent.touch({from: constants.agent2});
});
it('should set the timeout to 5 seconds', function () {
return agent.setTimeout(5000, {from: constants.agent2});
});
it('should have the right timeout time', function () {
return agent.timeout().then(time => {
assert.equal(time, 5000);
});
});
it('should stil have an alive agent', function () {
return agent.isAlive().then(alive => {
assert.isTrue(alive);
});
});
it('should be dead after 5 seconds', function (done) {
agent.touch({from: constants.agent2}).then(() => {
web3.currentProvider.sendAsync({
jsonrpc: '2.0',
method: 'evm_increaseTime',
params: [6000],
id: new Date().getTime(),
}, (err, res) => {
if(err !== null)throw err;
agent.isAlive().then(alive => {
assert.isFalse(alive);
done();
});
});
});
});
});
================================================
FILE: SmartContracts/test/relationship.js
================================================
var Relationship = artifacts.require('./Relationship.sol');
contract('Relationship', function (accounts) {
let relationship;
var constants = require('./constants.js')(accounts);
before(() => {
return Relationship.new(constants.provider1, {from: constants.patron1}).then(_relationship => {
relationship = _relationship;
});
});
it('should have an patron', function () {
return relationship.patron().then(patron => {
assert.equal(patron, constants.patron1);
});
});
it('should have an provider', function () {
return relationship.provider().then(provider => {
assert.equal(provider, constants.provider1);
});
});
it('should set the provider name', function () {
return relationship.setProviderName(constants.providerName1);
});
it('should have the correct provider name', function () {
return relationship.providerName().then(name => {
assert.equal(name, constants.providerName1);
});
});
it('should add a new viewer group', function () {
return Promise.all([
relationship.addViewerGroup({from: constants.patron1}),
relationship.addViewerGroup({from: constants.patron1}),
]);
});
//Test adding a new viewer
it('should add a new viewer', () => {
return Promise.all([
relationship.addViewer(constants.providerName2, 0, constants.provider2, constants.providerName1, {from: constants.patron1}),
relationship.addViewer(constants.providerName3, 1, constants.provider3, constants.providerName1, {from: constants.patron1}),
]);
});
it('should fail for duplicate viewers', () => {
return relationship.addViewer(constants.providerName2, 0, constants.provider2, constants.providerName1, {from: constants.patron1})
.then(() => {assert(false);}, () => {assert(true);});
});
it('should have all the viewers', () => {
return relationship.getNumViewerGroups().then(num => {
assert.equal(num, 2);
});
});
it('should add a new viewer group', function () {
return relationship.addViewerGroup({from: constants.patron1});
});
//Test removing a viewer and adding a different one
it('should add new viewers', () => {
return Promise.all([
relationship.addViewer(constants.familyName1, 0, constants.family1, constants.providerName1, {from: constants.patron1}),
relationship.addViewer(constants.familyName2, 1, constants.family2, constants.providerName1, {from: constants.patron1}),
relationship.addViewer(constants.providerName4, 2, constants.provider4, constants.providerName1, {from: constants.patron1}),
]);
});
it('should remove a viewer', () => {
return relationship.removeViewer(0, constants.provider2, {from: constants.patron1});
});
it('should remove a viewer', () => {
return relationship.removeViewerGroup(1, {from: constants.patron1});
});
it('should have the rightviewers', () => {
return Promise.all([
relationship.getNumViewerGroups().then(num => {
assert.equal(num, 2);
}),
relationship.getViewerName(constants.provider3).then(name => {
assert.equal(name, constants.providerName3);
}),
relationship.getViewerName(constants.family1).then(name => {
assert.equal(name, constants.familyName1);
}),
]);
});
it('should prevent randos from terminating the contract', () => {
return relationship.terminate({from: constants.provider2})
.then(() => {assert(false);}, () => {assert(true);});
});
it('should terminate the contract', () => {
return relationship.terminate({from: constants.provider1});
});
it('should be dead', () => {
return relationship.patron()
.then(() => {assert(false);}, () => {assert(true);});
});
});
================================================
FILE: SmartContracts/truffle.js
================================================
module.exports = {
networks: {
development: {
host: 'localhost',
port: 8545,
network_id: '*', //Match any network id
},
production: {
host: 'localhost',
port: 8545,
network_id: 633732, //matches the MedRec PoA blockchain
},
},
};
================================================
FILE: UserClient/.eslintrc
================================================
/*******************************************************************************
* A Meteor Developer's ECMA 6th Edition ESLint Configuration
* by @iDoMeteor
*
* http://github.com/idometeor/meteor-style-skeleton/.eslint
*
* TL;DR
*
* This is more friendly than Meteor's config.. mostly. Not always though. :)
* Check Github/README.md for quick usage instructions.
*
* Description
*
* Meteor upholds a high standard for coding, so do I, and so should you.
* With that goal in mind, I set every option in this file with intent. It
* may provide you with a fair amount of frustration if you are new to linting
* tools.
*
* This is intended to be integrated into your editor (along with .editorconfig)
* in such a way as to allow you to use it continually. If you drop it on a
* large, existing code base that may be... lax in coding standards, expect to
* get an enormous amount of reports.
*
* However, if you already have smart ECMA coding style, then you will most
* likely appreciate the learning experience / tightening up of your style.
*
* Meter and ECMA are both intended to be flexible. This file allows for that
* flexibility where appropriate, but also has sane protections for actual
* poor programming methodology. Hopefully it will allow enough flexibility
* to still take advantage of the fun parts of the language.
*
* In general, this configuration in tandem with my .jscsrc should provide
* one of the best programmatic ways to ensure that your Meteor code is as
* near to being inline with the MDG Style Guide as is practical from an
* automated tool.
*
* Caveats:
*
* I allow (and prefer, unless Sciencing) ==. The Abstract Equality
* Comparison Algorithm is no more "obscure (src: ESLint)" than is the
* Strict Equality Comparison Algorithm. Actually, it comes first not only
* in this paragraph, but also in the ECMA specification (11.9.3 vs 11.9.6).
*
* The standard convention comes from the same old-school origin as using !!.
* Namely, poor programming practices and ECMA implementations from the past.
* There are distinct advantages to using == in non-precision (read
* non-mission-critical) contexts. I'll leave that dark magic up to you to
* discover.
*
* Point is, you should probably be statically typing if you are that are that
* concerned about precision, or not concerned about this level of semantics if
* your ability to keep your types straight is ... still developing.
*
* That being said, I throw warnings on (x == null) || (x != null). :p
*
* This is not for niave Javascripters, you should be able to
* grok what this is going to do for you or use eslint --init at the command
* line and go from there.
*
* I use object literals instead of switch, as one should. However, once in
* a while, a switch w/fallthrough and/or no default is actually highly useful.
* For instance, Twiefbot uses micro-switches in the natural language
* processing. Therefore, they are allowed, but will throw warnings. That
* means that, while you should not do it, if you really know what you're doing
* then go for it.
*
* Contributing:
* I welcome pull requests!
*
* ****************************************************************************/
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"experimentalObjectRestSpread": true,
"forOf": true,
"generators": true,
"jsx": true,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": false,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"regexYFlag": true,
"regexUFlag": true,
"spread": true,
"superInFunctions": true,
"templateStrings": true,
},
},
"env": {
"browser": true,
"es6": true,
"jasmine": true,
"meteor": true,
"mocha": true,
"mongo": true,
"node": true,
"phantomjs": true,
},
"rules": {
/**
* General
*/
// This will throw warnings anywhere 'use strict' occurs, which is good.
"strict": [2, "never"],
// This wants you to migrate to using let & const instead of var for locals
"no-var": 0, // Best to start migrating now tho :)
/**
* Allowances
*/
"block-scoped-var": 0,
"dot-notation": [1, {"allowKeywords": true}], // Dynamic keys ftw, especially ES6 style
"eqeqeq": 0, // This contradicts MDG Style Guide, which prolly is [2, "allow-null"]
"no-console": 0,
"no-param-reassign": 0, // I do it, but don't use arguments meta-var much
"no-reserved-keys": 0, // 3rd edition is dead, no worries here
"no-undef": 0, // Super annoying in Meteor code, lol
"radix": 0, // If you screw up your numbers, your own fault
"yoda": 0, // I yoda, everyone should
"vars-on-top": 0, // Seriously, hoist your vars. But sometimes I like to validate
// first. Just don't bury (or not delcare!) your declarations.
/**
* Errors
*/
"curly": [2, "multi-line"],
"no-cond-assign": [2, "always"], // This is why you should yoda :p
"no-constant-condition": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-else-return": 2,
"no-empty": 2, // Empties can break Meteor in Templates.*
"no-eq-null": 2,
"no-eval": 2,
"no-ex-assign": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-semi": 2,
"no-func-assign": 2,
"no-implied-eval": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-native-reassign": 2,
"no-new": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-proto": 2,
"no-redeclare": 2,
"no-return-assign": 2,
"no-script-url": 2, // No need for these in Meteor!
"no-self-compare": 2,
"no-sequences": 2, // I hate that!
"no-shadow": [1, {"hoist": "functions"}],
"no-sparse-arrays": 2,
"no-throw-literal": 2, // Hopefully this lets Meteor.Error pass
"no-unreachable": 2,
"no-with": 2,
"use-isnan": 2,
"wrap-iife": [2, "any"],
/**
* Warnings
*/
"comma-dangle": [1, "always-multiline"],
"consistent-return": 1,
"default-case": 1, // *If* you happen to use a switch, maybe you don't want a default
"guard-for-in": 1,
"max-len": [1, 100, 4], // Warn if over 100, tabs expand to 4 (should use spaces anyway)
"no-alert": 1,
"no-caller": 1, // Should be 2, but there is some code out there... ;>
"no-debugger": 1,
"no-extra-boolean-cast": 1, // I should give it a 2 but being nice!! (Sasha uses them)
// ^punny, eh! :D
"no-fallthrough": 1, // *If* you happen to.. it shouldn't be often.
"no-floating-decimal": 1, // Should be 2, but I bet lots of you...
"no-multi-spaces": 0, // I like pretty
"no-multi-str": 1, // Should be 2, I'm being nice :>
"no-shadow-restricted-names": 2,
"no-unused-vars": [1,
{
"vars": "local",
"args": "none"
}
],
"no-use-before-define": 2,
/**
* Style
*/
"brace-style": [2,
"1tbs", {
"allowSingleLine": true
}
],
"camelcase": [2, {
"properties": "always"
}],
"comma-spacing": [2, {
"before": false,
"after": true
}
],
"comma-style": [2, "last"],
"eol-last": 0,
"func-names": 0, // Something I'm trying to eliminate, anonymous functions
"func-style": 0, // Flexibility ftw
"indent": [2, 2, {"SwitchCase": 1}],
"key-spacing": [2, {
"afterColon": true,
"beforeColon": false,
}
], // 'prop': x, extra spacing allowed if lining up blocks
"linebreak-style": [
2,
"unix"
],
"new-cap": 2,
"no-multiple-empty-lines": 0,
"no-nested-ternary": 0, // I <3 them, as long as they are clean & clear
"no-new-object": 2, // There are good reasons not to
"no-array-constructor": 2, // There are good reasons not to
"no-spaced-func": 2, // Nice addition!
"no-trailing-spaces": 2,
"no-underscore-dangle": 0,
"one-var": [2, "never"],
"padded-blocks": [0, "always"],
"quotes": [
2, "single", "avoid-escape"
],
"semi": [2, "always"],
"semi-spacing": [2,
{
"before": false,
"after": true
}
],
"keyword-spacing": [2,
{
"before": false, "after": true, "overrides": {
"if": {"after": false},
"for": {"after": false},
"while": {"after": false},
"from": {"before": true}
}
}
],
"space-before-blocks": 2,
"space-before-function-paren": [2, "always"],
"space-infix-ops": 2,
"spaced-comment": [2, "never"],
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/react-in-jsx-scope": 2
},
"plugins": [
"react"
]
}
================================================
FILE: UserClient/README.md
================================================
## medrec User Client

================================================
FILE: UserClient/build/asset-manifest.json
================================================
{
"main.css": "static/css/main.d82984ea.css",
"main.css.map": "static/css/main.d82984ea.css.map",
"main.js": "static/js/main.477a304c.js",
"main.js.map": "static/js/main.477a304c.js.map",
"static/media/agent.png": "static/media/agent.260ee943.png",
"static/media/group.png": "static/media/group.7808ba89.png",
"static/media/switch.png": "static/media/switch.819adcac.png",
"static/media/visualization.png": "static/media/visualization.75feea6f.png"
}
================================================
FILE: UserClient/build/index.html
================================================
MedRec You need to enable JavaScript to run this app.
================================================
FILE: UserClient/build/service-worker.js
================================================
"use strict";var precacheConfig=[["./index.html","1302f2c4fba2f609afcdf1551e48fd85"],["./static/css/main.d82984ea.css","79c481cdc6aa3e605a97050bd3ff7934"],["./static/media/agent.260ee943.png","260ee943218aea490ce72404638623c5"],["./static/media/group.7808ba89.png","7808ba891a0beec8f399058974f358f8"],["./static/media/switch.819adcac.png","819adcac56c3b975eac04ddafebb3d9c"],["./static/media/visualization.75feea6f.png","75feea6fec0d96cd548e630b17eadefe"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(t){return t.redirected?("body"in t?Promise.resolve(t.body):t.blob()).then(function(e){return new Response(e,{headers:t.headers,status:t.status,statusText:t.statusText})}):Promise.resolve(t)},createCacheKey=function(e,t,n,r){var a=new URL(e);return r&&a.pathname.match(r)||(a.search+=(a.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),a.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,n){var t=new URL(e);return t.hash="",t.search=t.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(t){return n.every(function(e){return!e.test(t[0])})}).map(function(e){return e.join("=")}).join("&"),t.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],r=new URL(t,self.location),a=createCacheKey(r,hashParamName,n,/\.\w{8}\./);return[r.toString(),a]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(r){return setOfCachedUrls(r).then(function(n){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(t){if(!n.has(t)){var e=new Request(t,{credentials:"same-origin"});return fetch(e).then(function(e){if(!e.ok)throw new Error("Request for "+t+" returned a response with status "+e.status);return cleanResponse(e).then(function(e){return r.put(t,e)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var n=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(t){return t.keys().then(function(e){return Promise.all(e.map(function(e){if(!n.has(e.url))return t.delete(e)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(t){if("GET"===t.request.method){var e,n=stripIgnoredUrlParameters(t.request.url,ignoreUrlParametersMatching),r="index.html";(e=urlsToCacheKeys.has(n))||(n=addDirectoryIndex(n,r),e=urlsToCacheKeys.has(n));var a="./index.html";!e&&"navigate"===t.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],t.request.url)&&(n=new URL(a,self.location).toString(),e=urlsToCacheKeys.has(n)),e&&t.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(e){return console.warn('Couldn\'t serve response for "%s" from cache: %O',t.request.url,e),fetch(t.request)}))}});
================================================
FILE: UserClient/build/static/css/main.d82984ea.css
================================================
@import url(https://rsms.me/inter/inter-ui.css);.left{float:left}#patientStyle{left:0;position:absolute;font-size:1rem;overflow-y:hidden}#patientStyle,.sidebar{margin:0;padding:0;top:0;height:100vh}.sidebar{width:220px;float:left;border:0 solid rgba(0,0,0,.06);-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.17);box-shadow:0 2px 2px 0 rgba(0,0,0,.17)}#patientStyle>.sidebar{background:rgba(186,203,204,.41)!important;color:#000!important}.sidebar>p{margin:0;font-size:1em;line-height:18px;padding-left:2.5vw}.medrec-logo-patient{width:146px;height:80px;position:relative;margin:0 auto;display:block;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJIAAABPCAYAAAF33KzpAAAABGdBTUEAALGPC/xhBQAAEGlJREFUeAHtmwm0XtMVxzOIOWjSBkkQITGk1FCKGEIihlJUJ4tKqbFYUdqaVnVAK6slhpVWSJsQIRXFirZWK0VSitbcRaOmRCSmIISQEPr/fe/sl/1O7r3f/fK+L3nyzn+t/9v77L3Puefue+655577vQ4dyuGTEIY8Pq9Kp+B41wWjUskamBh8iI7iZ0N5ZJBnSd6BjjMLbzhjd+k07GPnunI3p0ttgvWEku+Z1/FN4Y8QxzdZG/13gA4wKhyE3MwTkePFoeJzYldxJUNnnY8No+V3amUvcTxEWvQwr9uXhShfeZpsDFpO19sr+iquQlArQW+qsL7oRzv+BeKaIn5DcwwtGkw3uViOhcE5NcitJRlrFoO8P/gaJ+ao6c3FZ8XJ4TBjJIeIl4rnB1sSy5ABLqFdTqueZTNflvT1bagQ915WcBmbNfhACL4iSLObxMxdspf4M9FuDqktTuollbnTmLWt7tnSPcxuEt/nsgLWk3FjcWBwWgWTVofny77iMDNI+hifKbPvoZi9Xfw2QTc/xVnOn9SGZsDSP15HYQa/IByN8sXiyeJd4t+CzmU6Ukxocxnorx5xxzJFdGlzvatnh/xcYe1m2cwXS1YLZAtQz7NiLPvHz8Zl65SJ6+iC6JwvO9fSqi3CRsj1sXPPlv5VV6bRe8QPxNNEcJ2I/VFxV7EazlEAay8Wc9QzoN8kIpvHIXNJHHSYbAZ726BscSaxXSn6S8azDhJzqAh8/PtNpg50srkT0jcJ9srkhn66yNl2Fn2H5qv8hqPUFgdYQ2XfIfzAdwI9buOVSlTGHzIEqGSN+A6ZjRibtb2NM87q0Auy01ng4/s1mTrsIEkSDJ/YGDID0/3lVnDym9JpEL4a7NQ1mx00uJrFptIYN4CBbfGMGfCI+EPR7KUHP5UTPjUZWKSesoNxithTfEf8i3iLCG5uEh1mBMkS5I6g2xbL06H8epCtEnQI3C7SMHMOk+E6osH2a6ycZMrASpOBRi1nakpQ15qil3Pwyv0ssifuhCpZHS6/xVYJrdnN2py2bSljDWB7WNze8TjpC0V8vxGXCzjYCBF5cM4RewX/SUFmhbHcZolOOzPF3mIWhso4TyTuQ5EEFCVpqvxZOFVG2lg7cnLcZ4IP/42R3xd7qPBfkTiYuzOKkwXtF0Lg6pIxiDleZJGL7jFJBWzxWpRExbGUnxc9WPJjh1kjKS9JVse3he0+b5C+loh9ZGTH9mJko4h9qb1CjLbqvzAESTQD/52hlJUk/FwBrlhM3/aD8lPOwtYy4stKEvaYvDC22DNUmeQQF/eB8qzgk6jgfv0ltjQItiRRabpoDdAZ7n9DXpLKzA03qBFr19oz+eXgy0pSPJLWDbEPWeUgrw32yJxZHFNDbKWBOEkYsRkrQeFPVpJsFDzhAlkM8IUkToq1uYuLZYeQF2Z8ZZJEVXtVZNnv8ZEKtEOfDMdKwXa9GYJcEOz7OfvZwUbCGwau8oEi80AROsrJ9kS3oqBW+gapvk9WUXNctC2LApIvZWDFZ4B7fbo4I6crzGHgqiZR+Hf/Qm91J780qCviNc2yNs5E+SPRti1oh7afRBH2aRIdviS5hfgZkfnoGpHPO6CXyBw2kIKD+S8JtjOD/GeQ/wjyjCD7BnmkJMdgwdoq1CtJjKTJoj2VpkqfIfJ0AzuJtqfDng9PshfFE0TDy1LYzGQZET+tiPmQPwJPIzBaZLH3ewrC7uJr4uMUhH3F2eJ2FBJSBlIGUgZSBuqXAZ50YIC4oeifbkz8rN4TlIEdXBZ8kngibup8SU0ZWAkywAKOBaEtxIpO6ZoQG+/jFNUp66MP0MP6Zj4v5yqwXgtif8wWuq2IzbitKQXyuAJfI11+3uJ70RHiSSL7Vbx+NBz+ap1TcLTB8tmVXN4jKatb/UJ/bs5y1ttmSeJNPh7u/li8Py0MMVlJ6i3fM8FPOzeKeZgihyX81hBkZV/H+uZtXqfOx94Q9OuCHf9Mkb7lYYwctoPKS/qQrEDriO0b980I4tbkgLsFGSeJEYh/gThSnBbK2GJgg8+Lo0WSD80utRnWt2ZDpFDH7z7gtnbukX6Z+EGwnSYZgwQTP0PkxxbsGlC+R2wB3xEC5rbwNhXuksAHkHGSsPGlwoOtD+wkzcAOAbaeZgjyD8GOz8P3zdvRDxCJP49CwCRJbPGEzmiK2/5jsG0s6XGRCsTS/2b4jhwha9wYgdi4KgDdJ+nsYMMX430ZfHvoL8RBoYzPx2K2vnFsI5t3c0Ris0YRt3KMzjIQv5dzUJ7hyl7dRIX1MMRPN2zMIzeI3Kf2JDteOji9SSz19+BgyZqDGJXxfDBuqRaqG4ZnhIyQjQsUgxGQ1RfiGH2MZsNYUyLJyKsgK0k4bhO/K1qSrpY+S8zDFsExNCfgzcj+QlS2Ile2oxUi6e295HtJ3CqKseLnpfS3gpP0gxHiUXRePq55SJuRDtHhwSJfSNF7iAbK/na7VmVsZUDc2JxAfHE7drvFVRihxPrkEYONOmVA7IQygcRkdYTf7vHE4QkUd5yyT9IeIWZvyRj9ZNjGGakbt4d7g2CPfVl9I361EP8iBYe89gmhH91crD3ZnKmidtFf2hnmHVkd2S4EEnyCDw52nyTcHwW7/xB4bLBdT0DAXpK0OdsMkjZamYTxeWT1zfyPSSG+hxkkOT62J5yNacXWQc7cYSMViPXTwZoqZyYvryM0AGNgi5NEzDzR6ph8FEeEH6tsfpNcCOYZyh55fbMY4rlAHt9Qwdr10ifT4vfJiY2XKBZfNzlILfkRldcwE+8uec462NdVGweKLdY7Oe0ygg4SV83xJ3PKQMpAykDKQHvKAE+x6eICcWDGiduvRMo+xQ7LaKMW0261BC+vWP+oZxEG/i3yvgdYO80Q9xTBhuJboi1QT5T+hsgvTkaJ74ibi4ZTpOBnRT5XtB9ePCz9ERGwQn5VZAeDJHUWZ4q/E1sNVqL1wFfUyABxYmhsJ0lsgI0sFo/7URCeFdcWSQj4othdZEFIf0g0MYa+UvCPE0nQJJHV9I4i+Jl4uLi+2E9k9c4Cto84SGw16pWkyeoJBGeKXMFOFDKAnVXw94Lv6SC5+ll4ORgZfYA4Ro4B3RaA7F0ByhzjbgqtRd6JtKbdG1WZkdA7NMJrBbeQgZHztmgjyewmGYV2S5ktlufL8LrI7XeuyKhiJB4lgh1EEnYXhYSUgZSBlIGUgZSBlIGUgZSB9pkBXl8SlIH+IQskxL8m7Rrs2wa5wkQjXktqPRnes7qL74q83BrsXa6rGVaUbAtJekon3ydKAF855gfbnMiXiiEDHYNcLWUkZSBloF1ngA0y/+0cPWtzv5Ykrafg96J2H6qlgRUUy2dvnwtbqmR1Jytvvm41/X41ulZWw58WW5kVADugPZbxhHhIPSByUdoLpulEOe9q5JuFfezhaxvLxKHipxJFA4mtfMB6+F9iUSxxWbhZxi2Cw9rLiitjY3k5SBwsdhNbCy40P/w5VOQFqB5tqpnSIB98vrjG1cj7NOJCWqj1zok1zuxITg4SGfD+ZVHF6vBT9MUKHy7atHxH9eotIn7q6k6Qzrdra6vMo+1gxc91daxuLPm0e4hYDQycc8TFYtyGL38g/3fEZX20TVXdWnC4gv3xNymoXO+c2KEOkPJK1A/fJ68zDnjRLkQ8kAgeLVpDvyqsvcT5NVfn0WAuO5A2U/wiV59HxaahDS8GqPC4aH3j9wZ5J7i7iyOeF2Z+LxCDRzgDgZj5QVr7ZddItQ6kye4406VnoRE54Ti0u1C0c3xN+iAxButcrr3FIS+Pg3w5ayDhv1e0Ro72FTJ0HhcW+5Z0Wx+VGUg7u7qc4NZiNXxdAXY86sRfxwc7P3HHiNXQUwHMTNYusp4DqbPaO1l80x3jbenrijEakROOwY3kz++E+MAZ5dVlY7BZvW9lxFRMeQNpVXn91MdPEbLAs5WZgQOxv+iTX2YgjQ11qX+BWBYPK9BO7rioEo9V842LfEVF1gdWD+nPJa7n8+brlNFZZPN4y8NYOaydeuWEY41z7V6LoZ7wCWGN5LGRCh+JnBSv80x3MXiM2UkfGjnLDKTXXX1rp1Y5KTouayhrY1jkKyquISc3g9UtO5D+pzon5vB21x7/sGMvIlJz0YiccDA/G3479+jL6CgaSDQ5RLTE8jzviDFgvKT5zjOjk2UGEvsp1gYXox54UI1Ymz+poUH/iKZ+2YFUbY30C9cf2h0kFqEROeF4rD0tLxcWdaCMr1OZIBczRfrpoczddHPQz5I8Kug3SF4U9FrFn12FY53eGvWvrvIw6au4cpF6UpGzFb5zVfcMV/9u6UUzQiNywuGZHQ0sB5iBy6CLglYLzM1ltRnJDnS1FBvN/3H6YxaQIcvMSFT7k2htPyGdBV4RjpfT4nn09s0IvtfFPCd9g4wYM5GcCaK1abJeM5IdhxvP2kYywPLQiJxwrOtF6wNr4H4YC8AkYvG8jGS9HFSqlx1IBN8nWqPIeSKL7TyUHUjUv0j0bfM2xhQ/SrxUZGAsEH0Mj9qeYh6YKX08OoNqosiNwfqOdQt21kYHiC+FMrZ6DyQ1WfnVv+/TVRhz0IiccKjh4mLR92OWyqw1LxdvE+P9PF5u7G1c6tKoZSCtqupcUGYhyKOuCLUMJGunjxQGABfcL3ztpBnMvPF0FstifwX+XXxbtHaQDKJbxO1FQ6MHEsfZUfTn5h9l1g8v+6hQ75zQPtsmo8UnRWZ2nxvKDJ5DxISUgZSBlIGUgZSBlIGUgZSBlIGUgfaYAd4At3TcqJVJ2EX1f9vKNtpKdb4S9GkrnWnr/eAr/yLXSfajfinOFrs4e57Kx8wr85yttDey7TJdY+tjtzKBKzKm1k8ky6uv7+lA/E6HDcZuYn9xWpDdJa8TLxYBsxmDDbJJxve//UQ2GA3sd7HpSHvsI7HBtrcIxotzRPZIeohseE4RQVbbTZ4lf6n/vDhQpJ9c+JniIHFj8QHxNBH0FdlI/b5IX9gM5Fz7ieBs8RnxQJGb61axt2ggnt3+nUWOdae4ssy8OpXWg6SxKcev7+BN4qniKiLoKv5afFrkIr0QdIkK4lnDDyT0RSL1PBkAAPmDitb0p5MEm3Fs0IG47Sbrkr9xfQb4yCXuyu+O2OgEY8RLKtqSPyOkjg3FdyR5LHu8qsJuwcAmKoPenwc6+VmhsAu1QjsRDs7uKZ8lssCd2kvcSlxfnChuIBpelrKnyKz0oRmDZHbhLr9d/Lm4WBwl2sWVWoiitgsrZjh5/DJDMUPSn4NEZqvdRcDsQt+OFl8RGZTMwIYrpAwRjxBniMeIA8T5YkINGah251W7MdbRsTrWcDwfWq1tH1tG55GdB9aIRcfjkbtGXuVkTxlIGUgZSBlIGUgZSBlIGUgZSBlIGUgZSBlIGUgZSBlIGWirGejcVjvWBvrFzvlm4ubirKg/fJPbRmTjkO9k/OMDn2ES2nEG+La2azh/r2OiPDD4THDz2bcvbHHZ4tqVLNqGby+J4GPxs2JfkW91T4lF4Fvd6iIDCJ3PNvH3PZnaF9JAarrer0vwMZgBwRf2LDDI+Lg6TXxQ5KccC0UGFP+OlZAykDKQMpAykDKQMrDyZOD/I7gdP/U5m9oAAAAASUVORK5CYII=);background-position:50%;background-repeat:no-repeat;margin-bottom:10vh;margin-top:10vh}.sidebar>p>.status{text-transform:uppercase;font-weight:600;margin-left:1vw}.sidebar .button-group{padding-left:2.5vw;margin-top:2vh}button.buttonAbout,button.buttonHome,button.buttonRelationships{margin-right:.5vw;margin-bottom:2vh;width:150px;padding:5px 8px;position:relative;display:inline-block;background:#fff;border:0 solid rgba(0,0,0,.1);-webkit-box-shadow:0 0 1px 0 rgba(0,0,0,.22);box-shadow:0 0 1px 0 rgba(0,0,0,.22);border-radius:3.5px}.mainPanel{padding-top:20vh;padding-bottom:20vh;margin-left:25.5vw;height:80vh;width:60vw;overflow-y:scroll;font-size:1rem}.mainPanel .inputStyle{margin-right:.5vw;margin-bottom:1vh;border-radius:3px;width:150px;padding:5px 8px;position:relative;border:0 solid rgba(0,0,0,.25);border:0 solid rgba(0,0,0,.51);border-radius:4px;background:#fff;z-index:1}.mainPanel .inputStyle::-webkit-input-placeholder{color:#ccc}.mainPanel .inputStyle:-ms-input-placeholder,.mainPanel .inputStyle::-ms-input-placeholder{color:#ccc}.mainPanel .inputStyle::placeholder{color:#ccc}.mainPanel .inputStyle:focus{-webkit-transition:.5s;-o-transition:.5s;transition:.5s;background-color:hsla(0,0%,100%,.9);color:#344256}.mainPanel>h1,h2,h3,h4{font-weight:400}button.buttonStyle{width:150px;height:21px;position:relative;display:inline-block;margin:0 auto;color:#fff;background:rgba(0,0,0,.35);border:0 solid rgba(0,0,0,.1);border-radius:4px}button.buttonStyle:hover{background:rgba(0,0,0,.55);cursor:pointer}table{background:hsla(0,0%,97%,.4);border:0 solid rgba(0,0,0,.06);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.17);box-shadow:0 1px 1px 0 rgba(0,0,0,.17);border-radius:2px;font-size:1rem}table.isHidden{opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"}table.isVisible{opacity:1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";font-size:1rem}table>thead{background:rgba(0,0,0,.05);border-radius:5px;color:rgba(0,0,0,.6);line-height:18px;font-weight:400;font-size:1rem}td,tr{padding-right:2vw;width:20%;font-size:1rem}.relationshipsTable{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:start;justify-content:flex-start;padding:0;margin:0}.relationshipsTable>.settingsColumn{display:-ms-flexbox;display:flex;padding:0;width:18vw;margin-right:1vw;-ms-flex-direction:column;flex-direction:column}.relationshipsTable>.DMswitch{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:start;justify-content:flex-start;padding:0;margin:0}.relationshipsTable>.DMswitch>.settingsColumn{display:-ms-flexbox;display:flex;padding:0;width:18vw;margin-right:2vw;line-height:1.5;-ms-flex-direction:column;flex-direction:column}.relationshipsTable>.DMswitch>.settingsColumn>button.DMbutton{margin:0 auto;padding:0;margin-top:3.4vh;margin-bottom:3vh;width:150px;height:21px;color:#000;border:1px solid rgba(0,0,0,.1);border-radius:4px;-webkit-box-shadow:0 0 1px 0 rgba(0,0,0,.22);box-shadow:0 0 1px 0 rgba(0,0,0,.22)}.tab{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.5vh .2vw;margin:0;border-left:4px solid transparent}.tab:hover{background:hsla(0,0%,97%,.5)}.tab>span{overflow-y:auto;width:auto;padding:0 .2vw}.tab>span>input:hover{cursor:pointer}.settingsColumn>.content,.settingsColumn>.edit,.settingsColumn>.header{height:auto;margin:2vh 0}.settingsColumn>.content{height:20vh;overflow-x:scroll}.header>p{border-radius:5px;color:rgba(0,0,0,.6);line-height:20px;font-weight:600;padding-left:.1vw;text-align:center}.edit,.header>p{background:rgba(0,0,0,.05)}.edit{text-align:left;height:23vh!important;text-align:center;padding-bottom:2vh}.edit,.edit>p{border-radius:4px}.edit>p{color:rgba(0,0,0,.6);line-height:20px;font-weight:600;margin:2vh 0 1vh;padding:0}.edit>form>label{position:relative;display:block;margin:1vh}input#permissionDuration,input#permissionName,input#providerAccount,input#providerName,input#viewerAccount,input#viewerName{width:140px;border-radius:3px;padding:5px 8px;position:relative;border:1px solid rgba(0,0,0,.25);border-radius:4px;background:#fff;z-index:1;height:10px;margin:.5vh}input#permissionDuration{width:10px}.tooltip{padding:0!important;position:relative;margin:auto 10px auto 0;display:inline-block;border-bottom:1px dotted #000;border-radius:50%;border:1px solid #000;width:20px;height:20px;text-align:center;line-height:20px;font-size:1rem;vertical-align:top}.tooltip .tooltiptext{visibility:hidden;width:22vw;background-color:#000;color:#fff;text-align:center;padding:5px;border-radius:6px;position:absolute;z-index:100}.tooltip:hover .tooltiptext{visibility:visible}svg{-webkit-transform-origin:0 0 0;-ms-transform-origin:0 0 0;transform-origin:0 0 0}svg>text{font-weight:600}.signout{position:absolute;top:10vh;right:0;z-index:100}.signout>button.buttonStyle{background:#fff;color:rgba(0,0,0,.55);text-decoration:underline}.signout>button.buttonStyle:hover{color:rgba(0,0,0,.85);cursor:pointer}#providerStyle{left:0;position:absolute;font-size:1rem;overflow-y:hidden}#providerStyle,.sidebar{margin:0;padding:0;top:0;height:100vh}.sidebar{width:220px;float:left;border:0 solid rgba(0,0,0,.06);-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.17);box-shadow:0 2px 2px 0 rgba(0,0,0,.17)}#providerStyle>.sidebar{color:#000!important;background:rgba(0,0,0,.05)!important}.sidebar>p{margin:0;font-size:1em;line-height:18px;padding-left:2.5vw}.medrec-logo-provider{width:146px;height:80px;position:relative;margin:0 auto;display:block;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJIAAABPCAYAAAF33KzpAAAABGdBTUEAALGPC/xhBQAAEJhJREFUeAHtnAuwVlUVxy8i+EhS0dB8ARpYouZrHAQcIRDTNLXUMk0SxXSSgSwTcdSctHAaRTRNFAMfkIkmqY2TkgpqauOTylB8gIipgKIkyiv7/75vr+tic853z3fv912Ru9fM/66111p77X3W2Wefvff5oKGhGH0c3ODD8qpsEAz/dc6IVLIAtwYbrJ2wdSiPDfwc8XuRMWbRYqfcSjKBve8iV+7sZIllsp5Q8j3zMrbp/BHF/mVtvf++oAY2DI1cI35DkCeIDxIuFy4IuvWItde12DBqvcsqeovjIbJGD/O6fUXw8pVnSseg5XK9viTbbadghPyOsI3gRzv2ZcKmAnajRp84CA6mWy15eagxI/DdxJcI5gN/LNjqw3op7B0uNDl5UWBGuFkYLLwsdBISNSMD3EK7nVY9S2e2LO7r21DB74Ms5yI6C/h4cL4ycNMbR82IOEi4SLCHQ+IaF/W6yjxpzNpWd5RkT6Y3ju0LWQ5bSLmT0DcYrYJxq8P75WBhiCnEvY/PlOkPlM8A579HkM1Ocb6zJ7HmGeCezxFODpEvDnx24B8FzuwzRjhDeEC4L8jcqhOEROtUBnqqNzyxTBEd1qme1bozfq6w2Fk6s8Wc1QLZgqjnUVIW/eNn46J1ivi1c050zpedaW3RFmGXyvQ/Z14g+VuuTNCHBB714QJ0k4D+GeEAoSk6Vw6svVjMUc8I+TYB3jgOmUdip6OlM7LdBmXzM47uKsHfMt51AJ+jBMj7f1hWNdDJxk5I7hr0pYkNeaTA1fKS9R1aqvJiB4lrNLCJyr5D2CHfCeQ4xpslr4w/ZAiikgXxHTIdPlkvTa44q0OvSk9nIR+jR1nVsI84STD62MaQKZjqx1nB8e9IJiB4K+ipazprNJgaWXdJjBuIgW3+jBnoaeFswfSFBz+VE30mMrBCveT0go0ONFd4SWCO+pHwb4EN0DwBeqHMSkuQe4NsxyxmWxj0zWJ0CGJCtKeL8rHCaASRndGUS+lvysB6loF6LWeqSlOnqrxb2Xn9fhfZG3dyE1kdIbv5NuFatZm1ObFtKWMB0D0l7O1wquTlAjYOiVuFaOxSAX5ETovbB/vpgWe5sdxmiU4cXnM7CFk0WMolAn4rBRJQKUkzZM+iM6UkxmaRkXbnBBv230d2X+yiAq9m/EDuyShGFrRfDY4bi8eEzzCBRS6yp6kqoIvXoiQq9qX8iuCJJT96kDWS8pJkdXwsdI96heTPCejjJQG614SY0H+QpbRV/8Uy4uSJ8v1BkZUk7NwB7lgMbBb7CclxbKlKtJv+YstKEvoYrI84P/JEcvCL+0CZozxsRo9J8GXT53Kc7UJwmi1YADrD82+Ul6Qic8MUBbG4Fs/4N4ItK0nxSNo8+D5plQO/MegjdWZxQhW+pQBxklCiM5Scwp+sJNkomOUcWQzwhSROisXs7Xw5HWTDjK1IkqhqW8X3KThaJZk49MloqAR0t5gicLaR6A9x+lFBR8LrRtzlwwTmgUrUTkaOJzpXcmqhrb/q+2RVCsdN+3Ilh2RLGfj0MsCzPFuYW2UXToj849dyZG5WkW+wNaF4TVNtUCbInwn+yIIYPNcs5qDnhRNLUkPDe4F3Fb8wyMaY8JmjBgTFR2YInE9A0GVl1vCTwP8W+MOBnxX4zoFzQ4jLwrVZ1NIkMZLuEuK3EaNrmsCF7ifwRpknMKEbXSSBwyU7aOotmTfN+UIlWhmM+ELjBRZ9v6Mg6ie8LTxHQXSwsEDYi0KilIGUgZSBlIGWZ2DLEKKX+BeFvi4k2xo/2TtT2xP3cZfsk8SvUrs7WxJTBtaDDFyja2BhaAuwSpd0ffCNz3Eq1Slqow/Ak/XNbJ4vkmNLF8S+rUyZidHTnr6QI5+ao6+32s9bfC86Xjhd4LyKbUfdyd+tcyu0NlA2u5OtPZKyutUj9Of2LGOtdZYk9lzxcPdtsW9aHnyyksSmdk6wE4dz5TyaLoMl/M7gZGVfx/rmdV6mDl9nYrpJCvTY2TfStzyaIIOdoLJZH5TlaB1hTUJQ20F7Xx5NbH0Cj5PECMS+TBgrzAxldDGhA68I4wWSD0wvsZGsb42KSKCOnUKYyeI8JMUVAhttdMOFmCyRc2W4SuC0AN+HhDXIdwSHRWtYy4UHxLBB8DhJ6PhS4SnrM84MOeC7nXeU/IegtzbM7PtmOuOHhjrnmUJ8atDFEzqjKY59R9DtJO7pEhXwXeP42Xfk+ODgKyFTibsCIfskjQo6bDF9KIXvHPKrsVMoY/O+qK1vtG24VvIbAr5Zo4hHOab2UuB/kDNQnuvKXuyqwhYo4rcbOuaRKQLPqb3JhkmGRpbZWn+PCJqsOYhRGc8Hk9aK0LRiRIYLX5y5QTExArL6gh+jj9FsNNGEiDPySpSVJAzThFMES9J1kucLebRrMAzOcfD/UgeXV3P8uLPtcmxev718Xhe+kuO7u/Q9M2z0gxHiqdJ1eb/GIW1KOkSHBwp8IUXuIhhR9o/bjSqjK0L4TcxxxBbHscctrsIIxdcnDx901ClC+E4u4ohPVkc4WuWNwxso7jhln6QDg88A8Zh6SLGHU1I3jod526CPbVl9w3+j4P8aBUd58XGhH52dr73ZnKokdtBf4gzxhqyO7BUccT7NOwe9TxLmVUHvPwQODbpbcAh0kDgxF5hC3EYrkzA2T1l9M/uzEvDvYgpx2kc3y+mYVmwd5NQNO6qAr58ONlU5M3l5HSEAiAldnCR8lghWx/gzGCI6X2WzG+dGMM9Q9pTXN/PBnxvk6TgVLK7nPpnm/7Uc33iJYv414/0VyY+ovMBMvL3zjDXQszg+TFhjvZMTlxF0uNAxx57UKQMpAykDKQNtIQO8vWYLy4S+VVzw2ZGv/wliZGpRsU+LarvK8XGCMxUS+fUIr86Hg/f3xK8TWGOwQLtI4F/sAIg9IZ+JoKOFhUJ7CqILBMqdKIgsVrlU/hc+i1VgZb5IsDhPSX5agFgpvyVwkgERe55wA4VPgxhJ3xQ4bJsSOtAvcFsQDg9lfjnCWoXF3ISgezxwVs3QCQL7MBakkMUqlz75yc2koJgqzqLUiBvyz1BgK9RHYNVNzAFCs4nlekvoLlUGRraPsiR9FAxvik8UWAkb8ZhCxpGptwWCyGKVSw0N/wnCu4EzShg5Rsi2EOQMC6JMzAcpNJda+rjltbu7DPxmiLsJDRXs4koK/fmTsFSYGRQHi78hdAvlIsweUR6/0cK+AluUEwVoH4GEPUAhUcpAykDKQMpAykDKQMpAykDbysBmbety86+2ZzCREL9NOiDo98yv2jqWem1Lquk9+ytOCfjOx6ccIzsdsFMB07c6XxeS9Lyuult05XzlYF8HsZ9LlJEBjjcgvtImShlIGWi7GbhGl85Jnkc1h/xZmeOkkQM4H/PJLMd1TMfZve+zLVWyupmVN1+3KfkxBeV4+zNLRVYAnHx2aeYV8pLivJ+b0laI02iuuynwrcI+8vCbEZaJg4XPJFUaSC+FK2I9/Hehkm/exd8uw67BaPHyfJvSs7zsLwwUOgstJW40P/w5SmADVIuYClOYyAefLa53Na52chGx1jmxNpkdycnhAgPebxZVbJr8FD1G7iMEm5b5ulgN/VzOVneyZD7XWrnIq+0I+S9ydaxuzBfL50ihKWLg8BV1tRDH8GU+FP5AaO6rbYbqVkPflrNvv2uFyrXOiTV1qAQ+jPp+5MmMAzbaFSkeSDiPFyzoryvW/sR4jKvzTFAXHUi7yH+Fq8+ronuI4VkvFZ4TrG98Gs+7wH7OD382zPbRVGIj8QpnIOCzNHCLX3SNVO1A4uu3tTFbchbVIye0Q9zlgrX/tuT+Qkysc7n35gcfFzv5ctZAwv6IYEFO8hUyZF4X5vuuZFsfFRlI+7u6XOBuQlN0rBysPepsHVUY6Oz4nRzZs4rbScnMZHHhtRxI7RXvDOEd18Z7kjcXYqpHTmiDB8lf32lxwxnljaVjsFm972b4lFR5A6mjrH7q4ycIWcS7lZmBhjhf9MkvMpAmhrrU/4VQlJ6So13cqVElXqtmmxTZKhVZH1g9uL+WuJ7Pm69TRGaRzestjybKYHFqlRPamuTi3oiiluQTwhrJ044qrBK4KLbzTHcx8Rqziz4qMhYZSAtdfYtTLZ8atcsaymIMiWyVipvIyMNgdYsOpBdV54c5uNvFWynZNiISc6keOaExPxt+P7f1ZhoqDSRCDhIssbzP26EMdLO42c4zpeNFBhLnKRaDm1ELekJBLOaFVQT0r2jqFx1ITa2Rfun6Q9z+QiWqR05oj7Wn5eXiSh0oYtugiJPzmS55ZCjzNN0e5HPETwzyFPFLglwt+7OrMNTJLRH/4ioPkbyhK1cST69kbIFttOqe5eo/KLnSjFCPnNA8s6MRywFm4CLUQU4bBeTmsqkZyRq6ToKN5n84+VlzyOBFZiSq3SNY7FmSWeBVomEymj+v3p0znB9xPi9L3jbDx1QkZ7JgMY3XakaydnjwLDacAZZH9cgJbd0iWB9YA/dAWYGYRMyfzUjW5qBUvehAwvlRwYLClwgstvOo6ECi/iWCj81ujCn+auFygYGxTPA+vGq3E/KImdL7IzOobhV4MFjfsW5Bz9roUOH1UEZX64GkkKX/idj36VqUOVSPnNDUCGG14PsxX2XWmuOEaUJ8nsfmxnbjEtemagZSR1XnhjILAV51laiagWRxuklgAHDD/cLXLprBzI6nvVCUvi7HvwrvCRYHziD6o7C3YFTvgUQ7+wr+2vyrzPrheTcVap0T4nNsMl74l8DM7nNDmcFzpJAoZSBlIGUgZSBlIGUgZSBlIGUgZaA1M1DNbqeW/WLH10NgpwA4DHtfqBf9VIG7C5x5ZRHf1fhAzBHCuk58NWB7znFLmydu2gqXBc6ffiUsEDo4fWuJY9TQ2NZqrIXtcBTSp4Uxal692k8kNe9ACPiB+F0CB4qdg46T0+lCb+HzQce50W0CZ1YcGDKDMNtA9wmnlKTynzvERobyBPHRQe4pzgHnWcL2wrnCmYIRB3SzhP0FfO8XfisYZfXLbPCbhVeEvgL1ufHzhP7CTsLjwnAB4hSeg9UfC1w7bZMLZmtolDBHOEzg4btT2EEwaqqv5rfecpLCIRy/tgMMDm7mhoIRN4zEGx0i4TUrBL6fOImHNhUWC1sKxwn3CEZ+ICFfZobAfyM+NsgcVL4hcPM9OgV73K+gbmQMJBvcKOPZ7gzpOPiEsvpyqfQTS9by6753kI29JaFPKDTVV6tTd+5vXN0bixpYpTKzSlGaLsf3hSuFCwSeYE7ixwkQT/YxwjRhlwCxtehaaZjZwN0CJ+PDBGJBxB8kHC/MFU4WeglLhVrTVQrIDPWIQF9YqzFb9RMgZsKrhZOENwUG5VaCUWv21dpcrzivug4tvKL2qm+zTFaojlJukmWok65zhbisISs99K3d1wpdTaaUgZSBlIGUgZSBlIGUgZSBlIGUgZSBlIGUgZSBlIGUgZSB/AxwKJcoOwPbSs0J+ZeE+ZFLF5X3EDgo7CHwJX6FkKgNZ4AP1weE6/cyKsp8fPXEw2ffutDHZe/bZuRKx+5tJQl8PH5J2Fngs8vzQiVaLePGAgMImc8sK4U2TWkglW//QrFtBAYEX9SziEHGx9SZwhPC/gI/R2FAPSskShlIGUgZSBlIGUgZWH8y8H8MWTX5/2nAKAAAAABJRU5ErkJggg==);background-position:50%;background-repeat:no-repeat;margin-bottom:10vh;margin-top:10vh}.sidebar>p>.status{text-transform:uppercase;font-weight:600;margin-left:1vw}.sidebar .button-group{padding-left:2.5vw;margin-top:2vh}button.buttonEdit,button.buttonHome,button.buttonList{margin-right:.5vw;margin-bottom:2vh;width:150px;padding:5px 8px;position:relative;display:inline-block;background:#fff;border:0 solid rgba(0,0,0,.1);-webkit-box-shadow:0 0 1px 0 rgba(0,0,0,.22);box-shadow:0 0 1px 0 rgba(0,0,0,.22);border-radius:3.5px}.mainPanel{padding-top:20vh;padding-bottom:20vh;margin-left:25.5vw;height:80vh;width:70vw;overflow-y:scroll;font-size:1rem}#signersList{line-height:2}#signersList>div>span{padding-right:0 2vw}.mainPanel .inputStyle{margin-right:.5vw;margin-bottom:1vh;border-radius:3px;width:150px;padding:5px 8px;position:relative;border:0 solid rgba(0,0,0,.25);border:0 solid rgba(0,0,0,.51);border-radius:4px;background:#fff;z-index:1}.mainPanel .inputStyle::-webkit-input-placeholder{color:#ccc}.mainPanel .inputStyle:-ms-input-placeholder,.mainPanel .inputStyle::-ms-input-placeholder{color:#ccc}.mainPanel .inputStyle::placeholder{color:#ccc}.mainPanel .inputStyle:focus{-webkit-transition:.5s;-o-transition:.5s;transition:.5s;background-color:hsla(0,0%,100%,.9);color:#344256}.mainPanel>h1,h2,h3,h4{font-weight:400}button.buttonStyle{width:150px;height:21px;position:relative;display:inline-block;margin:0 auto;color:#fff;background:rgba(0,0,0,.35);border:0 solid rgba(0,0,0,.1);border-radius:4px}button.buttonStyle:hover{background:rgba(0,0,0,.55);cursor:pointer}table{background:hsla(0,0%,97%,.4);border:0 solid rgba(0,0,0,.06);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.17);box-shadow:0 1px 1px 0 rgba(0,0,0,.17);border-radius:2px}table.isHidden{opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"}table.isVisible{opacity:1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"}table>thead{background:rgba(0,0,0,.05);border-radius:5px;color:rgba(0,0,0,.6);line-height:18px;font-weight:400}td,tr{padding-right:2vw;width:20%}.settingsColumn,.tab{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.settingsColumn>.visualization{height:215px;width:320px;background:url(../../static/media/visualization.75feea6f.png);background-position:100%;background-repeat:no-repeat;width:15vw}.settingsColumn>.Add,.settingsColumn>.Create,.settingsColumn>.Groups{margin:1vh 0;width:40vw;line-height:2}.Add>p,.Create>p,.Groups>p{background:rgba(0,0,0,.05);border-radius:5px;color:rgba(0,0,0,.6);line-height:20px;font-weight:600;padding-left:.1vw}div#proposeKickSection{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}div#proposeKickSection>div{width:95%}input#kickAddress,input#proposalName{margin:0 .3vw;border-radius:3px;width:150px;padding:5px 8px;position:relative;border:1px solid rgba(0,0,0,.25);border-radius:4px;background:#fff;z-index:1;height:10px}.settingsColumn>button.buttonStyle{width:150px;height:21px;position:relative;display:inline-block;margin:0 auto;color:#fff;background:rgba(0,0,0,.35);border:0 solid rgba(0,0,0,.1);border-radius:4px;line-height:20px}.settingsColumn>button.buttonStyle:hover{background:rgba(0,0,0,.55);cursor:pointer}body{font-family:Inter UI,sans-serif;font-weight:"Regular"}#homepageWrapper{top:0;position:absolute;width:100vw;height:100vh;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;overflow-y:hidden;overflow-x:hidden}#sidePane{text-align:center;width:50vw;height:100vh;left:0;position:relative;padding:0;margin:0;border-right:1px solid rgba(0,0,0,.07);-webkit-box-shadow:0 2px rgba(0,0,0,.37);box-shadow:0 2px rgba(0,0,0,.37)}#sidePane>h1{font-size:6rem;color:#000;font-weight:400;position:relative;top:13vh}#sidePane>h2{margin:1vh;width:30vw;line-height:1.5;margin:0 auto;font-size:1.7rem}#sidePane>h2,#sidePane>p{position:relative;top:20vh}#sidePane>p{margin-top:5vh;font-size:1rem}#logoSprite{width:49vw;height:50px;position:absolute;margin:0 auto;bottom:12vh;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARkAAAAiCAYAAABr2q3NAAAABGdBTUEAALGPC/xhBQAAIb1JREFUeAHtnQl8VsXVhychBAiyySogBBBRUBRBxB1xQ6XVVqv91KrF1lZt7VfrWmsVrS1tXWq1at3qQq2ldQEEsaDGHXcRRNkkbGGXfU/I9zzje+NLTEICSINfzu/3z73vvXPnzp07859zzpy5yejSpUvrwsLCs0DYFsnMzFxaq1atodOmTVuxLflUh2uLi4vfpRwHVIey/D8sw48yMjLuLfXctfndDRSDiaAIfN0lhwesB5aB+Ly0y6bs9wc7VIqKisKE8ePDX++5J6zdsCF07do1/PCHPwxNmjSpTDmmZBUUFOSuWbPmD5s2barMBeWmgWAKdttttxdJsNOTzHPPPRd4oSXPamX26tUr8IzxmOfefPPNsHz58pJ0ubm5Yc899wyQbUxDnYZXX301VKVea9euHQ477LBQp06dknvX7MQasDUPAIvAVLAeKJKPL8oRMju13ci2LjCN5xW3a8AXL9Wj1VeyKFovYJnTSbUjv4eAHS61aZNNmjULtVetChvWrw9VUEruzmLU2GSnSe9UW/EExXSmdeS1s7zECh+xf//NB4vevXuH559/Puyyyy7xOonjkksuCe+++24JifzsZz8LgwcPDnXr2r5DmDt3bjCfqtRrvXr1wvTp0wNkHfOo+VNSA1b8EpAH2gI7nxW9K3CU93d9IMGYrjFYCZqB1aANGJfaZ1OtxZFMgrkUXAu2bfQng20VB85WrVqFk08+OcyePTu8+847YenSpaFhw4YhKyurZPAt7z4yZo1soQbUMEpL6WOJlpOkg3BDdnZ2WA/rV1ZM73U18qUaWMiR5eA4IKnMAS2A5sPi1P58tpKKA90U0A40BG+Cg8H7QMKpziLB9AS3gOkpSJz/VUmUkKZNm4YWzZuHSZMmhbffeisOpHvssUfYfffdKyxfJhlAVJlRza/KtqYzVFivW3WyKlrPVt1g571Ic+kjIHnMBtqTmuV2yqkpSC5vp/Y/S20nsZ0APgEbQHUWn+m74H7gqPY7sBb8162DjRs3hk8++SSMfOaZ0AySOeaYY0IGnPE67oB3IJstSVanTp0mzZ8//6QtJUw/j7mQzY1/hMrUP/14zX7FNaA5VFrjSb9Cc6yGvNNrpGRf0lDFm5naqrH4OxfMAI72nYBEtA60Ap63k+o4tSfoSNXsWgAcevXveL46iKbfaeAKoHZ2OZgG/usEQxlim8QfEmbk54dXX345NEGjOapv31AbU6kozXdp2rIk64MPPvAljCrrZAXH6jZr1qyGYCqooLJO/f73vw+HHnpoWafiMQlo1111M9RIqRrQzJE8NJUU26wj/4ugAEgomk12VrfaqPuB0UACmgX2BYl5dQD7H4CZIOnI5pHss7vDRPI7HVwG2oA7wDNA7U1S1DQsUwvT+frpp5+GmTNnhr322ivkQwKa8QceeOCXBjO1ZP0o+hH1r+y9997hs88+iz5EfStlySqcvJpGajKNmfzwHouXLIl5Z2MmdWaiozKD4rb4ZLbl2rKe6Wt/zBd7wAG27xqpYg20JP0eQPKQaCQEScfO1xNIOsqewHbZBegg3gtIRktBZ6AT1Wslmx6prflJYpKT6XakNOBm3wWXArWrh8FfgWUdAJ4H80CZsoHp5Jdeeik89eST4RImHtxXW7aNldaYJZnFixeHof/8Z+h90EHR7Ln/3nvDvt27h1NOOaXM/E3/j8ceCxshs6uvvjqcccYZcaJDZ69ad4NyyKl0ZjVEUbpGvsLfjgg1slU14AivOSRhOLqrvai1rAC7AYlDf4zEYmfVvLID9wGaR2o1EojpFMlGf84hQOIyfR7YkdKYm50NLgE+wxBwP7DMZwHLOwNspsVIFp+hTUxjFtJZzrnM9ugvMWTCWck6qcmDBQsWhBkzZnxOBhDCunXrQiaask7aBg0ahIkffhgJpGDevBie4bVqRPP4LVG1b9cuTlqYhySjxlI6LqY0kVHWMqWGZMqslpqD1bAG1GbeA63AdODsURF4CewN7JASkW26EXA2SlJZmfrdMHWMTdQOJClNJslIsrJT7yjpwI0GAbUV/UL6YCTOa8Bh4AnwB+CxEhNuxYoVkWBuuPHGMHny5NCqZcuwCG0jJycnqNVoCtWvXz+eG3zTTWEmBNQK8lizenWoR5rzzz8/jCO+ay2Eo6xZuzZMnDgx/Oc//wlt27YNt916a5yW3sBg2L59+3AKU9bGbG3rhEQNycTqrvlTzWugHuVT25AUFLWPT4GRj5LJXCCZjAVqKRJIIVBMOwGoBbnv8TeAadQS1BychZKwKi3DR43qk5OdPYOZloVcVEIElcigG2luAMeCfHA3aAF+BNqDv4L7gH6kzfIdO3Zs9KPofD0d0+XIvn3DfZg8ixctisFxTOCEumgyL774Ynj7vffCjy+4IHTdZ5/wpz/9KczKzw+rIZs5s2YFovzDSSeeGIY99VTYh/M6cT9FYzmUQFDJ5QXu8+a4cTGyt7LaCmUtV3Y2knFkygRVahDlPn3NiZ2lBmZTUGeD1DYkkdKyLHXANJURiUnUBu+DKmsxGUVFHQsLiy8bPnzkQw0a5Iw+6qijElIju3LlYM6owRwGXgEvg+NAL+AzXAHGgq5gDdDUKyGav//972EtZlEWzt2j+vWLZs5bTCEzeUMy1DZMGhMbMFeLKebDjzgidOjYMXTq0CEsgohiGo7rHFbDMR9NoNZt2oRJH38cpk6ZElgWFNNqiklKlXHsxowr+GOH3W5CgUoqZLtlmpYRjtNWnTt3PrRbt26tevbs2YhTjnAST418vWtgHo83A5RFMNvy5BJDVTWReD8sjZc2Fm5aVX+XnN+tXls0eNSosV2vv/76ivpTfy68Fej5HwbmgP8B+oVGgauAZtuNQDPKgXSz/uSsEW0/mjsSictaZqOZGN+WiJqHpo9k9Oyzz4YXXnghTMJnk5VaEpOkc0uofyQS/Tf/+te/ot/mjNNPDwf07Bn9PdurY6nJmFe2N02TjexX+YXiMLJS6qTlU5ldKzN9FLDGknJ5veWwjMU4t/ZnWu3n2J33UsmntGzZ8l2IbQhqYmVHMPOrkZ2vBmyPX4XYXjfryJW9yemnf2PuqFGjbtywfuP59PHTGF6P6Hlgn7+z7u0fxx9/vO0xPd/v8vtqUAuMAbuDtmAi+Bsw7fdBN6Bm9TDQPNxMvv3tb4eFCxdGc+juu+4KY/ClTGcKW5+J0C9j1Hj/448P06ZODXl5eXEKutAJB7QctZONpHHBo76bBvhp8jCt2rRuTQmKY14vcs0USKnItFznNLnYFr9MFnEZbei851uANHmKAn+Y9ntLuxkUogne6Z/xkInquqVrPO96pw8IvX8uScz1XSGrPhxvxcNlUq455N0ILOJ3AdNnL5B+d8rcmzLm4il/l2u951fVEJOi1WxramCzGmjRosXimTPn/bt27VrPoU18o1atzAs2FhafOXLk6L+1bt3y8R49emiSqaGcDyanLu7Jdgp4ETQFksuu4G3wa5AHloDNOiS/4wLcdsz63HHnneFl/DLNCIobiDN3Ab6YXmg5xrvQb8IqzBzNoYOYqtYUuvWWW4JOY7Wga6+7LphHa4jlFnw1HzLLZPzLKd/6Vnhu9OhQn5mo4447Lixbtiz6Z/bbf//P42QaN7YIWyVZsFU7Ouv1pUgmn9yqQjIyXZO1a9f+bxVL4Ut4BJSQDGXpzu9foPZlwrhZlCubF+jI0AhiGQPBHAMLj6AyC7nnan7rvKuRmhrY4TUwfvzcTc13qz0gK9SGODbN3FhU+DhmSbNaGdn9Z8+ec0huxz0K5xfM6c70sY5nicSBUDKxx54AbP8vAEnHWB3PLQbpWhA/vxAX4Go26bDVNDJmxb6rn0XycF+/yhuvvx6efOKJOPO0GtNp4Pe/H0mKCP9oXqnxmM/+kIj5eH3rgQPjuSRPjye8YPqtlbgKu4yL082XMk5vt0Oy9Zc0EMhlJpU5gumzDhBXLprNMMjkUh66EeSyCbwPwRxAxbxJmvyy8uBYjdTUwFdaAwMHfnPVyJGv3pGZtfoIzIv+mcWZvVHpay9b/tmGx/4xpGeTRg2b1a7VbtWSJYuLiK5VO6kP2gDJZRrQDdAeNAGSjSZSuQTDuSiSgLEupUVSUNRM7rr77vDRRx9F30zHDh1Cp86dI5FIJom4n/47+cpAcn57bavj7BKO+6JNmEabqEzWYWVKKlZ8ifrIcWuTZEWdSNeMfTWdmhknKqFGdlwNpNrl0jFjpuetWfNJ+7o5Gdnr1m2o89bb49rXrVsvv23bNqOmTJnyFm10NqWyDXcDhwCJpiGYDx4Eb4JVKbApXxhc4/KAV155JSwhKM8PSPmto1k4gPXD7LfffqEJS1PmzJkTzSfPO2tUhwA7Z5j0xWg6uXyFATwG67mS+hXML4PxukBQftpkNUsKjKExBkfzy/ww/+L9vG7ChAlhEiTWnAWTPYgw9lg+0+ROj3vMID4D+/zG0laTDJ1fNraSqiLSqKri55RbxpU81DLyzkd7WQIz18d8MgLRr+5NRWWbyYttwLYATScPkjmW/U5406dTCQY15fCAmbzUWqzTUBtzGnCLI0MZxai2h1RfdchV9GGryqSptg+4Exbs2GM7rRgzZszDy5cXtt+UubF+40ZN122slblowpQpq2ija+nUyQCo2TQcGFgoyawAnwLb7hYFd0EkmOvwq/hNl4aNGsVAu/POOy9qJHfhDP7jH/8YyeBWAut08p5zzjnhhkGDQnMC91ZCLicSH0NZo5m1nvPfxhejPM5yg+Z8lMq25TIDZ5h+fe21YUMq2tcoY2Z0w+VXXBE+eP/9cA+aUobmFE7kLhCJxPRP8jiZ/E477bRwD2XJh/huuOGGrSYZyrfhz5RtSCxhJf9ACF2p9JtA+/IuISpxLKbRqzim1vMBp1qsn5CQ1jOf/zrEUcTxrHHjxq2iYp9/4okn7li5cuVaGHQ9DJ+BConzrdbudLJsyGYBzP1PrnWEUC3d6cnGUcypy4+JaSAuo0yioW5jGiNCjzzyyJKPaPH8NfLV1UDxscceu5z3M2HQoEEZkEBxSsspfcdk4NN0StpkpdvlaByzcXaJD6hdetll4aSTTgqPPvJImM8UdKJx+P6dml6HZuFSAgfpFStXhuYtWgQjhRnAIxlobl1++eVxqcG1v/pVjKmRcB5//PF43k85uJxAB/HFP/5xGDZiRMhjbdQItvS/0D43N1x3/fVx9sovQBpR3AIie4uIYh3MH7GwsjvrotRstlaTKcb7PJOKEpUWtI8s1Kp1VkR5cscdd1j5WXwgZxdeWibEtI54gIZct57jEkYOU9dtWdG8nmO+rEK8/C1QC+uS/kQqdU9e8FsQzUrO1aOSmlCxdcljKYSkzVtidrFf7UXVVrtZzcVVtKqwDz/8cFSRIeM4tagzUHUVDS7OLhgZ6opvX77nvgbSlmc4Ahje4BTvxyB5j5oeOlEfBbaRLUkLEhhtOxfojLVNLQPeYzxQsyiv4w/k3EupNGoj/YCmTryGdpfL/qHEywxlW9GEhPmXdw9OlS333XdfJI66mD46bHNzc6NmoYbzCG3CaWjXJ0VhlonyxPYhsfQjeK9v377RzHGwcjaq/wknhNHE0iwj3mY8AX35mDguKdCUMopY308uEcDdMZMmYBq9ALkthNCWsXpbx7MEoqmldmTMziKm14cSbyMR2R5diGm73VqSKbsWKnc0YwvJDodYvgcL50IUtSGNBVQWEdzZ842PoSMNoOMdSsVtwlF1u8eNnQFtqLwWpJ0DiTXlHovgnsMhwws41oJzEzC7rrnyyisLaARJA91CUf67p31RdzJdqSPvkEMOCarA++67b3yxvkiX+evsO/zwwwMxG5GEXIErKdlAvkai2WuHlkh+BK4EiYkhSbQCFbUrHa6yrYOMZv7hwAA4yWkeGAL6gpdBRZ1fb2s94L00dY4Er4FEHD33AJnJge25dRX0EtYq2Sb0sxCYGj/u7ade1TgKGbw/ZWZJB+78goK40tr7SzZqGrYVCcbfDj4SgBpODvsH9ekTLrroooAPKfpu6nJuDIOVaTMlK/KRwBphouXg15mDRu19nQJ3FfjJmFgH8xkTSWYs5pgE1AvzSqmOLbE5JLE3JDKFB2wEybSDSN6lrEdCOjmM3j1Q9Z6BhPbn90A6YjHE0xJ18QEY/TSuqUPaHmz9sFYxne1j9j/l3NmYXI8RLKX2kzRQdqu36EBTMzFu4UleJt/xCY+gImsKPf300/Gr8b7ofJxukGr47W9/G84999zYoKr3k1WpdOtIramhFqLWYLs9CewGJgM7/4VgOtDvIYksAGobEoKDjtfeBozwfRa0Ax8CI8clBcnmqNTv0Wwli/ZgNpgGeoN9wHNAsQ1JWt77dCCR2U71tZwH3gEdwC7AMkhgBwPvqQbl/eeA1sD7CzUgp7LLFIPxdN76SQff80MPPRT4RwDhrLPOCofQwW0Xg9FgbSNo7aERsS36TPS9FKGhKPSZ6KtR63Ug0rQ5acCAMJJBayLOXNuZGoixMmrK+mgkmCLSu5+bmxuJ6S8Q3WmnnhrTOHXekeULmmzdcTwbZbw3DmdNKqU6kkwGFbGQ0TgPoukMyaxm/wWO9YIsfGnZrKnoDCMvhplXsO3G+YXsj2crdXYBzChucvqpOdu9+e2Ly4SccmDvlD7JkWoukGt0orl6VhNJtdSl+jYORyU99zr6dLhpf7tAzuPuf83Edu57OwHYEXuA5kCyuAY4cAwDF4GjgWaPHdl37/E9wSKwAphXHhgEZoFcYH6dwQggWVwJZoOHwCXgeHAHkBgygOJWk+gM8ARoCU4FalYTgLNI9YBkI0H1AT2BZbVcj4KfAp9jCDgGNANrgGX8khhspy/lgQcfDM+iuc6FYCSJfv36RV/LnX/5S5y21heSg0nlrJAaxW233Ra3tg1nm25GI3ZAUjSN9K24zsmP2BtH05cBTJeGDua2BPM5IyXp5HboEPZPzV7Z9jSxdiUgUDPMT0W4hkoyakQZ1WISbbo6kswmnp1nLJLZ3ZeCbWBOZY+DeA6k8NM5X4vfkyGWeXSqE9m/EEI6gAqxMW0kXR20l6NJO4k0UyGb3qTZRMct8wVyTbUTG4UefT/grCP3ehqDjj+P83yhMSOVo4vrThx1jqChvI/nX0lecLV7qK0rkO3UTv17cDmYCGwftg01HLUHmVUSaQM+TqE92xlAf4sd3vakLAfOjEpE+mNaATu/Ws1KYBtpAky/HqhtCAkoByRimdRUGoC1wHZqmRYCxWuXAo+ZvxrRKcA2at6W2etMI2HVBuWKpoy+j6dYPe1/DjgHjTVd/O8YTgjk5eXFGaTzf/CDaDo58+O0siSi9tMH00go9InYjtSSNKX8Gp7akiS0H2T1DxzBfrvGGaNu+GESYelEEIn4Bb1BtE/LaNn6HX10cqr6aTKoXJ9ACE9jM34MORTQeZq4TwU8RkWNJTbgP/pl6GS+uDcxgWYyA7WUytqTdE9CIvM4V4/0C+mc63kpR5FuPRrMIxzPp4PaKHca0QZ2FsCXZ2NxZum8886L6qmOYO3qn/zkJ2Ho0KGRcNR6HL200VVft1VseIK6q3RWpk/ERrwdxLCHycCOeD9QM7FAA8CDQE3B/RFATeJUoA9mMfDad8CJQDKw4yuPAcnLzm6BvU4C8B6/Ab3AyWAMkAS8Xo04eTivE/eAI4Dk5P27gaYg0UgkwAXAey8Dt4NcYN6vpvY9JzFJhFZYcg92vxAJRp/M22+/Hb9+57KB0qIZJJm8wxS3ZpCRv/fyOQhNKf0y7/EJCM2pssT8H3300fAYq71vwhxjgiW8T/rKDFiaS2pSTptrJqUH9lnJZUmZD1lWwu19DO1jDtrIJho1juwFb5i/diIykW13nLfvDRgw4Fk61UYacLGzLzTqm03gb5k4XTj3hMc9ZiXaWasq6Z0muVZzLF1K/04/l+xXpaMm10C04eyzz05+xlklg6/ShenTILa3qB05Za4DWrW8ovKbVtLTxOMdxnfWBlXbTwlsB5lNHn9M5TOD7bhSeX5Q6vfg1O8X047flbbv7qxSv/35QNqxUWn77kpyiUgiZ4CXgNpJ+rmkbMmW01+Sj9KOmIdSUfqYwI6shnHhhRfGb/S+A9k4MyRpjHvjjegvOQrTyYmA6AiGcMbznx81n/XjaPJ4re9FDdiAutchIUnkcL4lk82ANYnZS6e8nYpWU/k+Sw2yaYNebzqXIvh+JSvNN80m7z2ZfuXnZb23A1+6lEkyNOymNI5O6Qm3tE8BNmKXzePrXGoY2yKOCueS31NUylAqIQe7sZCIxgYcu4nOPGr48OEj+BjyfNKpaiYRwWXeMyGYMk+Wc9CXmU4sVqYRlRBcyRUey4Wxk3SaLtyr5HxZO0Zo6sgtT+zELtPXHErE/CVHX6xajfaxjcaPQNuhbWCew1SMDceGICQG02NWbnZO0jK95fec5GieOgq9zpHQY25tiDrxdC46k+F9hX4BtSS/N+J1Xu9Mg2q8PiPv4fqZb37zm7GMpnE2w9FNMrKs3tvye62DiMfMt3QDTdVDW7ZqGZoctq9hqS2bLYomyC/Ao6AAxAGHraJGZI+w028+anCgAlHbGQskmKpcV0GWWz5l+IJRtJf94hfhf3/+8xhx61ftJB4/16Af5hpiXnxfai8/Jr5Fzde69p8T+g7+/Oc/x/dyBH6Xi5lN0mlrhfjxqx+gBX+MWe5nIt6AOJQR/BsUP8XptQ7QzmwtwGS/+sorQz/+NYrv1O8A+69SvO5ojunL2aImQyP3f2Proa+sFPMgi2mUg7hAtW9bpA6NXBWzOY6kQ2mI+9JI19LBx9PAG9ERe/HATdBYptLQn6fDSDbpDWdb7h2vJaCqhDw8oLZ08803x46XZK7daUUmxKJDzU5akTzwwAPBgKryxA7mfSQHRYJRkxg2bFjsiI4aR2Pr2gAcoeyg2uGm8TuvdmDL4NfobRDOQEkK7ksYltVzUwk/99/hSjY2QO14Z648Z2h5QmxOl2vLSzget6FKeJpjjmj6fxwNdRZKOD6bBG3eOgLVKu0ENnRHT/OzA5iX6R1tzcsPL1nHjoQSTRnyGce6gt+ADsCOnQ3s7FsS09YFXzD357NSmk0zgWZXVfIjeTSNVrqzo8UBSHL2PQvr69d0agcoyUdTyoFKUjj44INDHbb+D+trid6tRXrF6/TzXcXHwfX55TGQ/IUIXjWZM77znfAgfpuLLr44aqEjhg+Ps0nG5TiLadvzs521KUNj2qmhE8eiIX3ve9+LCzKNJj4abcoYnETK7BU0zINEkqgyWx5+Np3+VtJuK8lIGK6w3p1O49qkvUAj8n+a4zasTnSYhhw7g05ZSEMdTsPV/t1ukm6emKmd4KqrroqdJrnJT3/60/iCKjIhkrTJVq2gIrHxGIadkIyj+/333x81BGeWhgwZEglAElRLUNXV9lareIYRR1XVTu0/31Lz8puvkoTHbHBuJRQ7us+UdGgb0O233x6JwzLa8SWIOBVJx5fQHEH9CJLxOtr8Eo+/NZFMZ1CWjddOYGOU+GyQam+aTEaJ5uXlxS/mm5fPKJmp+Ug6alaWtxwp5HgR2AdICvozHIh8742B5pKeTLdHA30x84Am0R5AYtIR0Q+sA92BfpJ8YL6SjOdte6qrktIu4EFguu06iJHftot+LwYNNWh9M8vRBo1f8Tsw1msi/r8kJSM5wNbzkrqBeE+xUlvycYBTgzVaWEkGT3/Xg6gcICSm0fyfeD9W7mDiIKFGrdlmzBYLDkM7gveWk3e6+MK2i1Dw6CPZLpl93pBUuwt4+Cl05A3kb6BdHRryKNTD69hfzr26UVk2hq9U1ALSxY5U+lj6+WQ//WUnxyraOvokL9d03sOFcGoNv0INvoBvtjrLpPlxBWtIJBptZbULNalrrrkmdl6DttRw7MyWwQbi9TZIz53AKOM5tRgblvl5X6E28wNmJQxZ919iqAnZIF3Ra6Cf9zjzzDPjSGl+klhi6vh9WLWtDh06RE1FDcY0FzMqGiGqCaVppK2vg1qiEYnpJsmmq9lpdWXLt59INl2AztXHU9vWbNVSJA/PSxKqi2o+J4ERQPLRbHIA3AssAq8CHXg6uMRQ0B5IZJpPOnlzwXbrI+S17cL7tDISMjBDCd9AvEgokkQqTbwZ79TlAXMYWHyXvmNJ4G9o1fMIebiV6e2B+F2ceo5tAI3I92k4hNqmxxTbxT60I9dMSSgONntgQjuAGFfjIHUZExQuTVA7SpeoySQZpZ+o6n4V8kgn1TJvA6lk0MH2o1IyIJVZdOrl/LZu7RS70+h7s1uHTrIcIrJhfaXis8n0lSGW9ILom6hCvURfRnp6NQMJwunBkSNHRk3ElbB2TNVUNQxX3fpbH4z3U6txa4eVtMxDjSU55zH3NbUcmdQeNMcknOQa8/B5hWklCkcuCc5IYwnHfPxwkuab573WsqtBeT+Jw9kJO4Cajj4DtRZNNPP1eq+xkRqrkZ+fH1577bVIQul1mNrPYat28Q6YCi4GrYAkocmkb0WCmA4SrYfdSDg92DpV3ReYRx1gW1IDkpwcQeoD81Mzchh2+BemrV5CHRuB60AX2Y99xbpXq46adSqN64/iN2Z4t38YPDicSdCe5pN13xHN8z3MXZefqI363yBNr5m7HjLSR+NkgiaUEsmEwU6/m+3NCGHzdsD697//HQP51H67MkHgB87ThW/s1FpNAd+LhUs/U4V9rndBWAENtUIbmQa/hnSTuFe0Z9lfwTVzS93K6egpjMCFbOtDKn64agX7BZT1Q9K2pUN1YTuL/F6DcDbXzUpltj1+2gkcfR0JFOvKDkqZys3eEZlZsCoRkx3fDpiIndBQb78278tVSzBeQUKQZEz/y1/+Mo4smkB2bM0qbXI1GEnRju3L95wNQt+IogbjlLgxEZorai7m74glvIeNLDc3N/pcNMWcBvVL+PpONL8kNv1AEp9ajqaRROSz9+vXL5pQEpImndqNeXgv69Ny+N80LZd+HcnM1b8+/038O49SopPqPdAWfAKeAeeAp0EBOBVMA5KGMz3NwCygRnIg8JrPQEtgG5WoOgKPjQdqNueC58BuwMHXY/ptyn/JnNyRwvKSdbyPybcQTOdSE2NdJAid/9ajCyD9NymubTKmRe1WLVjS16xxwOqI/8w2IZk4CGhmnci7dxDQt6YJ1IgV1EtI78DSh/ds/rY1nbp3ch/zM+BPsvr5pZfG6F4Hnz5oNN/Bp+NShTRZkEGh61JQK3abBAIo5EHmk4kjQ3lShwbmsgFVVztpMQ1yBZ9p8GVHQf3W/NmFhr6ecuXQsevT2VxUuY6GGK9jNGzEQy/DbFq0HWazUnf+YkMHvYZf7ZIjdkhH4HRxtK+ImMu6Jv36svbNz3xLi2RhY3IWIRFNGV+yHTrRsKweO32qmiJRJOlLn/MajyUzP2o8iuV2lFRM43GPmdbfpldzsaySrvezDIqkm5TF8+bj70R78dkkr4Sc3TdfzT3zcbTk9xDOvxIzrPnztaiB/wMtmD9sPhfPpQAAAABJRU5ErkJggg==);background-repeat:no-repeat;background-position:50%}#loginPane{width:49vw;height:100vh;font-size:1.3rem;border-left:.5px solid rgba(0,0,0,.06)}#loginPatient,#loginProvider{padding:20px;border:.5px solid rgba(0,0,0,.06);-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.17);box-shadow:0 2px 2px 0 rgba(0,0,0,.17);border-radius:5px;color:#000;position:relative;top:16vh;height:11vh;width:25vw;margin:0 auto}#loginPatient{background:rgba(186,203,204,.41)}#loginProvider{background:rgba(0,0,0,.05)}#loginPatient>h3,#loginProvider>h3{font-weight:400}#contractPatient,#contractProvider{color:#000;height:10vh;line-height:1.6;padding:20px;border-radius:5px;border:.5px solid rgba(0,0,0,.06);-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.17);box-shadow:0 2px 2px 0 rgba(0,0,0,.17);position:relative;top:17vh;width:25vw;height:auto;margin:0 auto}#contractPatient{background:rgba(186,203,204,.41)}#contractProvider{color:rgba(52,66,86,.8);background:rgba(0,0,0,.05)}#contractPatient>div,#contractProvider>div{font-size:1rem}#contractPatient>div>span.preview,#contractProvider>div>span.preview{color:rgba(0,0,0,.5);font-size:1rem;margin-left:10px}#contractPatient>div>span.preview:hover,#contractProvider>div>span.preview:hover{cursor:pointer;text-decoration:underline}#identityPatient,#identityProvider{padding:20px;border-radius:5px;border:.5px solid rgba(0,0,0,.06);-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.17);box-shadow:0 2px 2px 0 rgba(0,0,0,.17);position:relative;top:18vh;width:25vw;height:auto;margin:0 auto}#identityPatient{color:#fff;background:rgba(186,203,204,.41)}#contractPatient>h3,#contractProvider>h3,#identityPatient>h3,#identityProvider>h3{font-weight:400;color:#000;margin-top:0}#identityProvider{color:rgba(52,66,86,.8);background:rgba(0,0,0,.05)}.switch{border:1px solid #ccc;width:50px;height:26px;border-radius:13px;float:right}.switch,.switch-toggle:hover{cursor:pointer}.switch-toggle{border:1px solid #999;-webkit-box-shadow:1px 1px 1px #ccc;box-shadow:1px 1px 1px #ccc;width:25px;height:24px;left:0;border-radius:12px;background:#fff;position:relative;-webkit-transition:left .2s ease-in-out;-o-transition:left .2s ease-in-out;transition:left .2s ease-in-out}.switch.on{background:#ccc}.switch.on .switch-toggle{left:23px}.switch.disabled{cursor:not-allowed}.inputStyle{margin-right:.5vw;margin-bottom:1vh;border-radius:3px;width:150px;padding:5px 8px;position:relative;border:.5px solid rgba(0,0,0,.05);border-radius:4px;background:#fff;z-index:1}.inputStyle::-webkit-input-placeholder{color:#ccc}.inputStyle:-ms-input-placeholder,.inputStyle::-ms-input-placeholder{color:#ccc}.inputStyle::placeholder{color:#ccc}.inputStyle:focus{-webkit-transition:.5s;-o-transition:.5s;transition:.5s;background-color:hsla(0,0%,100%,.9);color:#344256}#loginPassword.inputStyle,#loginUser.inputStyle{width:100px}button.loginStyle{margin-right:.5vw;margin-bottom:2vh;width:auto;padding:5px 8px;position:relative;display:inline-block;background:#fff;border:0 solid rgba(0,0,0,.1);-webkit-box-shadow:0 0 1px 0 rgba(0,0,0,.22);box-shadow:0 0 1px 0 rgba(0,0,0,.22);border-radius:3.5px}button.loginStyle:hover{background-color:hsla(0,0%,100%,.7);cursor:pointer}#previewModal,#seedModal{position:fixed;z-index:1;left:0;top:0;width:100%;height:100%;display:none}#seedModal .modalBackground{position:absolute;width:100%;height:100%;background-color:rgba(0,0,0,.4)}#previewModal .modalBackground{position:absolute;width:100%;height:100%;background-color:#fff)}#previewModal .modalContent,#seedModal .modalContent{position:fixed;background-color:hsla(0,0%,100%,.98);width:50vw;height:auto;overflow:visible;top:35vh;left:24.5vw;padding:2vh;display:none;margin:auto;background:#f6f6f6}#previewModal.display,#previewModal .modalContent.display,#seedModal.display,#seedModal .modalContent.display{display:block;border:0 solid rgba(0,0,0,.2);-webkit-box-shadow:0 2px 10px 0 rgba(0,0,0,.3);box-shadow:0 2px 10px 0 rgba(0,0,0,.3);border-radius:6px}#seedModal .modalContent.display>p.seed{font-weight:600;vertical-align:middle;text-align:center}#seedModal>.modalContent.display>button.buttonStyle{width:150px;position:relative;display:inline-block;margin:0 auto;color:#fff;background:rgba(0,0,0,.35);border:.5px solid rgba(0,0,0,.1);border-radius:4px}#seedModal>.modalContent.display>button.buttonStyle:hover{cursor:pointer}#confirmSeed.inputStyle{margin:0 auto;border-radius:3px;width:98%;padding:5px 8px;position:relative;border:.5px solid rgba(0,0,0,.25);border:.5px solid rgba(0,0,0,.51);border-radius:4px;background:#fff;z-index:1;margin-bottom:1vh}button.close{margin-bottom:1vh;position:fixed;z-index:1;height:13px;width:13px;top:36vh;left:75vw;border:0;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAAEhcmxxAAAABGdBTUEAALGPC/xhBQAAAYNJREFUKBU9UbtuwkAQ3LMlKkSfNCYWVHxAlJbkC2h4KFR5fEAaHqJIgbCrfABKKlLYNW3iykVSUlCBeDTJByRCshC+zJwjVvJ5b3d2dnZPBNbr9e7MsdvttHS73Q+ZzWaZxxAvttZaJUnyE8exZ+/3e91sNnOFQuHRchxHgiAgkyjC+v1+qpSSw+EgruvKer2ObNYimWu1WlKr1WQ6nUqapmeKZej5jmSVPs227VOToDQknhCbe553AVptEV0sFsdI5C3LOmc/+Ep1Oh1NfjYvlUoyHA7Z49MiZxiGJrhcLo0yhComMRgMDBIURi6qHzjDCfR/sZKGYOT7/qVRxSR4X1FxlJzBspNgCLsejUbfiiMAPOYm2u22LBYLo4XQer0u5XJZJpOJrFYrQdG9wnjcVJ4ALEIajYYRzjvFc9dcLQ2dfjnEnBeCycjRCeRHnzHm/m1uHgmy3lBdxSJlu90eGQnki242G4GKCFu/MkOzGgFu5hb/G1wrR0alXjDsMwg1Y3/rN9UbUYXUrAAAAABJRU5ErkJggg==);background-position:50%;background-repeat:no-repeat}#previewModal .close:hover,#seedModal .close:hover{text-decoration:none;cursor:pointer;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.3);box-shadow:0 2px 2px 0 rgba(0,0,0,.3)}#previewModal.display>.modalContent>.wrapper{width:auto;height:50vh;overflow-y:scroll!important;background:#fff}#previewModal.display>.modalContent>.wrapper>.agent{background-image:url(../../static/media/agent.260ee943.png);background-repeat:no-repeat;width:auto;height:100vh}#previewModal.display>.modalContent>.wrapper>.group{background-image:url(../../static/media/group.7808ba89.png);background-repeat:no-repeat;width:auto;height:100vh}#previewModal.display>.modalContent>.wrapper>.DMswitch{background-image:url(../../static/media/switch.819adcac.png);background-repeat:no-repeat;width:auto;height:100vh}
/*# sourceMappingURL=main.d82984ea.css.map*/
================================================
FILE: UserClient/build/static/js/main.477a304c.js
================================================
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "./";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 352);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh
* @license MIT
*/
/* eslint-disable no-proto */
var base64 = __webpack_require__(433)
var ieee754 = __webpack_require__(434)
var isArray = __webpack_require__(435)
exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50
/**
* If `Buffer.TYPED_ARRAY_SUPPORT`:
* === true Use Uint8Array implementation (fastest)
* === false Use Object implementation (most compatible, even IE6)
*
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+.
*
* Due to various browser bugs, sometimes the Object implementation will be used even
* when the browser supports typed arrays.
*
* Note:
*
* - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
* See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
*
* - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
*
* - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
* incorrect length in some situations.
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
* get the Object implementation, which is slower but behaves correctly.
*/
Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
? global.TYPED_ARRAY_SUPPORT
: typedArraySupport()
/*
* Export kMaxLength after typed array support is determined.
*/
exports.kMaxLength = kMaxLength()
function typedArraySupport () {
try {
var arr = new Uint8Array(1)
arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
return arr.foo() === 42 && // typed array instances can be augmented
typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
} catch (e) {
return false
}
}
function kMaxLength () {
return Buffer.TYPED_ARRAY_SUPPORT
? 0x7fffffff
: 0x3fffffff
}
function createBuffer (that, length) {
if (kMaxLength() < length) {
throw new RangeError('Invalid typed array length')
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = new Uint8Array(length)
that.__proto__ = Buffer.prototype
} else {
// Fallback: Return an object instance of the Buffer class
if (that === null) {
that = new Buffer(length)
}
that.length = length
}
return that
}
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
function Buffer (arg, encodingOrOffset, length) {
if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
return new Buffer(arg, encodingOrOffset, length)
}
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new Error(
'If encoding is specified then the first argument must be a string'
)
}
return allocUnsafe(this, arg)
}
return from(this, arg, encodingOrOffset, length)
}
Buffer.poolSize = 8192 // not used by this implementation
// TODO: Legacy, not needed anymore. Remove in next major version.
Buffer._augment = function (arr) {
arr.__proto__ = Buffer.prototype
return arr
}
function from (that, value, encodingOrOffset, length) {
if (typeof value === 'number') {
throw new TypeError('"value" argument must not be a number')
}
if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
return fromArrayBuffer(that, value, encodingOrOffset, length)
}
if (typeof value === 'string') {
return fromString(that, value, encodingOrOffset)
}
return fromObject(that, value)
}
/**
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
* if value is a number.
* Buffer.from(str[, encoding])
* Buffer.from(array)
* Buffer.from(buffer)
* Buffer.from(arrayBuffer[, byteOffset[, length]])
**/
Buffer.from = function (value, encodingOrOffset, length) {
return from(null, value, encodingOrOffset, length)
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
Buffer.prototype.__proto__ = Uint8Array.prototype
Buffer.__proto__ = Uint8Array
if (typeof Symbol !== 'undefined' && Symbol.species &&
Buffer[Symbol.species] === Buffer) {
// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
Object.defineProperty(Buffer, Symbol.species, {
value: null,
configurable: true
})
}
}
function assertSize (size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be a number')
} else if (size < 0) {
throw new RangeError('"size" argument must not be negative')
}
}
function alloc (that, size, fill, encoding) {
assertSize(size)
if (size <= 0) {
return createBuffer(that, size)
}
if (fill !== undefined) {
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// be interpretted as a start offset.
return typeof encoding === 'string'
? createBuffer(that, size).fill(fill, encoding)
: createBuffer(that, size).fill(fill)
}
return createBuffer(that, size)
}
/**
* Creates a new filled Buffer instance.
* alloc(size[, fill[, encoding]])
**/
Buffer.alloc = function (size, fill, encoding) {
return alloc(null, size, fill, encoding)
}
function allocUnsafe (that, size) {
assertSize(size)
that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) {
for (var i = 0; i < size; ++i) {
that[i] = 0
}
}
return that
}
/**
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
* */
Buffer.allocUnsafe = function (size) {
return allocUnsafe(null, size)
}
/**
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
*/
Buffer.allocUnsafeSlow = function (size) {
return allocUnsafe(null, size)
}
function fromString (that, string, encoding) {
if (typeof encoding !== 'string' || encoding === '') {
encoding = 'utf8'
}
if (!Buffer.isEncoding(encoding)) {
throw new TypeError('"encoding" must be a valid string encoding')
}
var length = byteLength(string, encoding) | 0
that = createBuffer(that, length)
var actual = that.write(string, encoding)
if (actual !== length) {
// Writing a hex string, for example, that contains invalid characters will
// cause everything after the first invalid character to be ignored. (e.g.
// 'abxxcd' will be treated as 'ab')
that = that.slice(0, actual)
}
return that
}
function fromArrayLike (that, array) {
var length = array.length < 0 ? 0 : checked(array.length) | 0
that = createBuffer(that, length)
for (var i = 0; i < length; i += 1) {
that[i] = array[i] & 255
}
return that
}
function fromArrayBuffer (that, array, byteOffset, length) {
array.byteLength // this throws if `array` is not a valid ArrayBuffer
if (byteOffset < 0 || array.byteLength < byteOffset) {
throw new RangeError('\'offset\' is out of bounds')
}
if (array.byteLength < byteOffset + (length || 0)) {
throw new RangeError('\'length\' is out of bounds')
}
if (byteOffset === undefined && length === undefined) {
array = new Uint8Array(array)
} else if (length === undefined) {
array = new Uint8Array(array, byteOffset)
} else {
array = new Uint8Array(array, byteOffset, length)
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = array
that.__proto__ = Buffer.prototype
} else {
// Fallback: Return an object instance of the Buffer class
that = fromArrayLike(that, array)
}
return that
}
function fromObject (that, obj) {
if (Buffer.isBuffer(obj)) {
var len = checked(obj.length) | 0
that = createBuffer(that, len)
if (that.length === 0) {
return that
}
obj.copy(that, 0, 0, len)
return that
}
if (obj) {
if ((typeof ArrayBuffer !== 'undefined' &&
obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
if (typeof obj.length !== 'number' || isnan(obj.length)) {
return createBuffer(that, 0)
}
return fromArrayLike(that, obj)
}
if (obj.type === 'Buffer' && isArray(obj.data)) {
return fromArrayLike(that, obj.data)
}
}
throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
}
function checked (length) {
// Note: cannot use `length < kMaxLength()` here because that fails when
// length is NaN (which is otherwise coerced to zero.)
if (length >= kMaxLength()) {
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + kMaxLength().toString(16) + ' bytes')
}
return length | 0
}
function SlowBuffer (length) {
if (+length != length) { // eslint-disable-line eqeqeq
length = 0
}
return Buffer.alloc(+length)
}
Buffer.isBuffer = function isBuffer (b) {
return !!(b != null && b._isBuffer)
}
Buffer.compare = function compare (a, b) {
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
throw new TypeError('Arguments must be Buffers')
}
if (a === b) return 0
var x = a.length
var y = b.length
for (var i = 0, len = Math.min(x, y); i < len; ++i) {
if (a[i] !== b[i]) {
x = a[i]
y = b[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
Buffer.isEncoding = function isEncoding (encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'latin1':
case 'binary':
case 'base64':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return true
default:
return false
}
}
Buffer.concat = function concat (list, length) {
if (!isArray(list)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
if (list.length === 0) {
return Buffer.alloc(0)
}
var i
if (length === undefined) {
length = 0
for (i = 0; i < list.length; ++i) {
length += list[i].length
}
}
var buffer = Buffer.allocUnsafe(length)
var pos = 0
for (i = 0; i < list.length; ++i) {
var buf = list[i]
if (!Buffer.isBuffer(buf)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
buf.copy(buffer, pos)
pos += buf.length
}
return buffer
}
function byteLength (string, encoding) {
if (Buffer.isBuffer(string)) {
return string.length
}
if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
(ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
return string.byteLength
}
if (typeof string !== 'string') {
string = '' + string
}
var len = string.length
if (len === 0) return 0
// Use a for loop to avoid recursion
var loweredCase = false
for (;;) {
switch (encoding) {
case 'ascii':
case 'latin1':
case 'binary':
return len
case 'utf8':
case 'utf-8':
case undefined:
return utf8ToBytes(string).length
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return len * 2
case 'hex':
return len >>> 1
case 'base64':
return base64ToBytes(string).length
default:
if (loweredCase) return utf8ToBytes(string).length // assume utf8
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.byteLength = byteLength
function slowToString (encoding, start, end) {
var loweredCase = false
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
// This behaves neither like String nor Uint8Array in that we set start/end
// to their upper/lower bounds if the value passed is out of range.
// undefined is handled specially as per ECMA-262 6th Edition,
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
if (start === undefined || start < 0) {
start = 0
}
// Return early if start > this.length. Done here to prevent potential uint32
// coercion fail below.
if (start > this.length) {
return ''
}
if (end === undefined || end > this.length) {
end = this.length
}
if (end <= 0) {
return ''
}
// Force coersion to uint32. This will also coerce falsey/NaN values to 0.
end >>>= 0
start >>>= 0
if (end <= start) {
return ''
}
if (!encoding) encoding = 'utf8'
while (true) {
switch (encoding) {
case 'hex':
return hexSlice(this, start, end)
case 'utf8':
case 'utf-8':
return utf8Slice(this, start, end)
case 'ascii':
return asciiSlice(this, start, end)
case 'latin1':
case 'binary':
return latin1Slice(this, start, end)
case 'base64':
return base64Slice(this, start, end)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return utf16leSlice(this, start, end)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = (encoding + '').toLowerCase()
loweredCase = true
}
}
}
// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
// Buffer instances.
Buffer.prototype._isBuffer = true
function swap (b, n, m) {
var i = b[n]
b[n] = b[m]
b[m] = i
}
Buffer.prototype.swap16 = function swap16 () {
var len = this.length
if (len % 2 !== 0) {
throw new RangeError('Buffer size must be a multiple of 16-bits')
}
for (var i = 0; i < len; i += 2) {
swap(this, i, i + 1)
}
return this
}
Buffer.prototype.swap32 = function swap32 () {
var len = this.length
if (len % 4 !== 0) {
throw new RangeError('Buffer size must be a multiple of 32-bits')
}
for (var i = 0; i < len; i += 4) {
swap(this, i, i + 3)
swap(this, i + 1, i + 2)
}
return this
}
Buffer.prototype.swap64 = function swap64 () {
var len = this.length
if (len % 8 !== 0) {
throw new RangeError('Buffer size must be a multiple of 64-bits')
}
for (var i = 0; i < len; i += 8) {
swap(this, i, i + 7)
swap(this, i + 1, i + 6)
swap(this, i + 2, i + 5)
swap(this, i + 3, i + 4)
}
return this
}
Buffer.prototype.toString = function toString () {
var length = this.length | 0
if (length === 0) return ''
if (arguments.length === 0) return utf8Slice(this, 0, length)
return slowToString.apply(this, arguments)
}
Buffer.prototype.equals = function equals (b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return true
return Buffer.compare(this, b) === 0
}
Buffer.prototype.inspect = function inspect () {
var str = ''
var max = exports.INSPECT_MAX_BYTES
if (this.length > 0) {
str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
if (this.length > max) str += ' ... '
}
return ''
}
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
if (!Buffer.isBuffer(target)) {
throw new TypeError('Argument must be a Buffer')
}
if (start === undefined) {
start = 0
}
if (end === undefined) {
end = target ? target.length : 0
}
if (thisStart === undefined) {
thisStart = 0
}
if (thisEnd === undefined) {
thisEnd = this.length
}
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
throw new RangeError('out of range index')
}
if (thisStart >= thisEnd && start >= end) {
return 0
}
if (thisStart >= thisEnd) {
return -1
}
if (start >= end) {
return 1
}
start >>>= 0
end >>>= 0
thisStart >>>= 0
thisEnd >>>= 0
if (this === target) return 0
var x = thisEnd - thisStart
var y = end - start
var len = Math.min(x, y)
var thisCopy = this.slice(thisStart, thisEnd)
var targetCopy = target.slice(start, end)
for (var i = 0; i < len; ++i) {
if (thisCopy[i] !== targetCopy[i]) {
x = thisCopy[i]
y = targetCopy[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
// Empty buffer means no match
if (buffer.length === 0) return -1
// Normalize byteOffset
if (typeof byteOffset === 'string') {
encoding = byteOffset
byteOffset = 0
} else if (byteOffset > 0x7fffffff) {
byteOffset = 0x7fffffff
} else if (byteOffset < -0x80000000) {
byteOffset = -0x80000000
}
byteOffset = +byteOffset // Coerce to Number.
if (isNaN(byteOffset)) {
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
byteOffset = dir ? 0 : (buffer.length - 1)
}
// Normalize byteOffset: negative offsets start from the end of the buffer
if (byteOffset < 0) byteOffset = buffer.length + byteOffset
if (byteOffset >= buffer.length) {
if (dir) return -1
else byteOffset = buffer.length - 1
} else if (byteOffset < 0) {
if (dir) byteOffset = 0
else return -1
}
// Normalize val
if (typeof val === 'string') {
val = Buffer.from(val, encoding)
}
// Finally, search either indexOf (if dir is true) or lastIndexOf
if (Buffer.isBuffer(val)) {
// Special case: looking for empty string/buffer always fails
if (val.length === 0) {
return -1
}
return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
} else if (typeof val === 'number') {
val = val & 0xFF // Search for a byte value [0-255]
if (Buffer.TYPED_ARRAY_SUPPORT &&
typeof Uint8Array.prototype.indexOf === 'function') {
if (dir) {
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
} else {
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
}
}
return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
}
throw new TypeError('val must be string, number or Buffer')
}
function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
var indexSize = 1
var arrLength = arr.length
var valLength = val.length
if (encoding !== undefined) {
encoding = String(encoding).toLowerCase()
if (encoding === 'ucs2' || encoding === 'ucs-2' ||
encoding === 'utf16le' || encoding === 'utf-16le') {
if (arr.length < 2 || val.length < 2) {
return -1
}
indexSize = 2
arrLength /= 2
valLength /= 2
byteOffset /= 2
}
}
function read (buf, i) {
if (indexSize === 1) {
return buf[i]
} else {
return buf.readUInt16BE(i * indexSize)
}
}
var i
if (dir) {
var foundIndex = -1
for (i = byteOffset; i < arrLength; i++) {
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
if (foundIndex === -1) foundIndex = i
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
} else {
if (foundIndex !== -1) i -= i - foundIndex
foundIndex = -1
}
}
} else {
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
for (i = byteOffset; i >= 0; i--) {
var found = true
for (var j = 0; j < valLength; j++) {
if (read(arr, i + j) !== read(val, j)) {
found = false
break
}
}
if (found) return i
}
}
return -1
}
Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
return this.indexOf(val, byteOffset, encoding) !== -1
}
Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}
Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}
function hexWrite (buf, string, offset, length) {
offset = Number(offset) || 0
var remaining = buf.length - offset
if (!length) {
length = remaining
} else {
length = Number(length)
if (length > remaining) {
length = remaining
}
}
// must be an even number of digits
var strLen = string.length
if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
if (length > strLen / 2) {
length = strLen / 2
}
for (var i = 0; i < length; ++i) {
var parsed = parseInt(string.substr(i * 2, 2), 16)
if (isNaN(parsed)) return i
buf[offset + i] = parsed
}
return i
}
function utf8Write (buf, string, offset, length) {
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}
function asciiWrite (buf, string, offset, length) {
return blitBuffer(asciiToBytes(string), buf, offset, length)
}
function latin1Write (buf, string, offset, length) {
return asciiWrite(buf, string, offset, length)
}
function base64Write (buf, string, offset, length) {
return blitBuffer(base64ToBytes(string), buf, offset, length)
}
function ucs2Write (buf, string, offset, length) {
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}
Buffer.prototype.write = function write (string, offset, length, encoding) {
// Buffer#write(string)
if (offset === undefined) {
encoding = 'utf8'
length = this.length
offset = 0
// Buffer#write(string, encoding)
} else if (length === undefined && typeof offset === 'string') {
encoding = offset
length = this.length
offset = 0
// Buffer#write(string, offset[, length][, encoding])
} else if (isFinite(offset)) {
offset = offset | 0
if (isFinite(length)) {
length = length | 0
if (encoding === undefined) encoding = 'utf8'
} else {
encoding = length
length = undefined
}
// legacy write(string, encoding, offset, length) - remove in v0.13
} else {
throw new Error(
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
)
}
var remaining = this.length - offset
if (length === undefined || length > remaining) length = remaining
if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
throw new RangeError('Attempt to write outside buffer bounds')
}
if (!encoding) encoding = 'utf8'
var loweredCase = false
for (;;) {
switch (encoding) {
case 'hex':
return hexWrite(this, string, offset, length)
case 'utf8':
case 'utf-8':
return utf8Write(this, string, offset, length)
case 'ascii':
return asciiWrite(this, string, offset, length)
case 'latin1':
case 'binary':
return latin1Write(this, string, offset, length)
case 'base64':
// Warning: maxLength not taken into account in base64Write
return base64Write(this, string, offset, length)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return ucs2Write(this, string, offset, length)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.prototype.toJSON = function toJSON () {
return {
type: 'Buffer',
data: Array.prototype.slice.call(this._arr || this, 0)
}
}
function base64Slice (buf, start, end) {
if (start === 0 && end === buf.length) {
return base64.fromByteArray(buf)
} else {
return base64.fromByteArray(buf.slice(start, end))
}
}
function utf8Slice (buf, start, end) {
end = Math.min(buf.length, end)
var res = []
var i = start
while (i < end) {
var firstByte = buf[i]
var codePoint = null
var bytesPerSequence = (firstByte > 0xEF) ? 4
: (firstByte > 0xDF) ? 3
: (firstByte > 0xBF) ? 2
: 1
if (i + bytesPerSequence <= end) {
var secondByte, thirdByte, fourthByte, tempCodePoint
switch (bytesPerSequence) {
case 1:
if (firstByte < 0x80) {
codePoint = firstByte
}
break
case 2:
secondByte = buf[i + 1]
if ((secondByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
if (tempCodePoint > 0x7F) {
codePoint = tempCodePoint
}
}
break
case 3:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
codePoint = tempCodePoint
}
}
break
case 4:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
fourthByte = buf[i + 3]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
codePoint = tempCodePoint
}
}
}
}
if (codePoint === null) {
// we did not generate a valid codePoint so insert a
// replacement char (U+FFFD) and advance only 1 byte
codePoint = 0xFFFD
bytesPerSequence = 1
} else if (codePoint > 0xFFFF) {
// encode to utf16 (surrogate pair dance)
codePoint -= 0x10000
res.push(codePoint >>> 10 & 0x3FF | 0xD800)
codePoint = 0xDC00 | codePoint & 0x3FF
}
res.push(codePoint)
i += bytesPerSequence
}
return decodeCodePointsArray(res)
}
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000
function decodeCodePointsArray (codePoints) {
var len = codePoints.length
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
}
// Decode in chunks to avoid "call stack size exceeded".
var res = ''
var i = 0
while (i < len) {
res += String.fromCharCode.apply(
String,
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
)
}
return res
}
function asciiSlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i] & 0x7F)
}
return ret
}
function latin1Slice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i])
}
return ret
}
function hexSlice (buf, start, end) {
var len = buf.length
if (!start || start < 0) start = 0
if (!end || end < 0 || end > len) end = len
var out = ''
for (var i = start; i < end; ++i) {
out += toHex(buf[i])
}
return out
}
function utf16leSlice (buf, start, end) {
var bytes = buf.slice(start, end)
var res = ''
for (var i = 0; i < bytes.length; i += 2) {
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
}
return res
}
Buffer.prototype.slice = function slice (start, end) {
var len = this.length
start = ~~start
end = end === undefined ? len : ~~end
if (start < 0) {
start += len
if (start < 0) start = 0
} else if (start > len) {
start = len
}
if (end < 0) {
end += len
if (end < 0) end = 0
} else if (end > len) {
end = len
}
if (end < start) end = start
var newBuf
if (Buffer.TYPED_ARRAY_SUPPORT) {
newBuf = this.subarray(start, end)
newBuf.__proto__ = Buffer.prototype
} else {
var sliceLen = end - start
newBuf = new Buffer(sliceLen, undefined)
for (var i = 0; i < sliceLen; ++i) {
newBuf[i] = this[i + start]
}
}
return newBuf
}
/*
* Need to make sure that buffer isn't trying to write out of bounds.
*/
function checkOffset (offset, ext, length) {
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
return val
}
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
checkOffset(offset, byteLength, this.length)
}
var val = this[offset + --byteLength]
var mul = 1
while (byteLength > 0 && (mul *= 0x100)) {
val += this[offset + --byteLength] * mul
}
return val
}
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
return this[offset]
}
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return this[offset] | (this[offset + 1] << 8)
}
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return (this[offset] << 8) | this[offset + 1]
}
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ((this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16)) +
(this[offset + 3] * 0x1000000)
}
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
this[offset + 3])
}
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var i = byteLength
var mul = 1
var val = this[offset + --i]
while (i > 0 && (mul *= 0x100)) {
val += this[offset + --i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
if (!(this[offset] & 0x80)) return (this[offset])
return ((0xff - this[offset] + 1) * -1)
}
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset] | (this[offset + 1] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset + 1] | (this[offset] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16) |
(this[offset + 3] << 24)
}
Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] << 24) |
(this[offset + 1] << 16) |
(this[offset + 2] << 8) |
(this[offset + 3])
}
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, true, 23, 4)
}
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, false, 23, 4)
}
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, true, 52, 8)
}
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, false, 52, 8)
}
function checkInt (buf, value, offset, ext, max, min) {
if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
if (offset + ext > buf.length) throw new RangeError('Index out of range')
}
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var mul = 1
var i = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var i = byteLength - 1
var mul = 1
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
this[offset] = (value & 0xff)
return offset + 1
}
function objectWriteUInt16 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
(littleEndian ? i : 1 - i) * 8
}
}
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
function objectWriteUInt32 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffffffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
}
}
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset + 3] = (value >>> 24)
this[offset + 2] = (value >>> 16)
this[offset + 1] = (value >>> 8)
this[offset] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = 0
var mul = 1
var sub = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = byteLength - 1
var mul = 1
var sub = 0
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
if (value < 0) value = 0xff + value + 1
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
this[offset + 2] = (value >>> 16)
this[offset + 3] = (value >>> 24)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (value < 0) value = 0xffffffff + value + 1
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
function checkIEEE754 (buf, value, offset, ext, max, min) {
if (offset + ext > buf.length) throw new RangeError('Index out of range')
if (offset < 0) throw new RangeError('Index out of range')
}
function writeFloat (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
}
ieee754.write(buf, value, offset, littleEndian, 23, 4)
return offset + 4
}
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
return writeFloat(this, value, offset, true, noAssert)
}
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
return writeFloat(this, value, offset, false, noAssert)
}
function writeDouble (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
}
ieee754.write(buf, value, offset, littleEndian, 52, 8)
return offset + 8
}
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
return writeDouble(this, value, offset, true, noAssert)
}
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
return writeDouble(this, value, offset, false, noAssert)
}
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
if (!start) start = 0
if (!end && end !== 0) end = this.length
if (targetStart >= target.length) targetStart = target.length
if (!targetStart) targetStart = 0
if (end > 0 && end < start) end = start
// Copy 0 bytes; we're done
if (end === start) return 0
if (target.length === 0 || this.length === 0) return 0
// Fatal error conditions
if (targetStart < 0) {
throw new RangeError('targetStart out of bounds')
}
if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
if (end < 0) throw new RangeError('sourceEnd out of bounds')
// Are we oob?
if (end > this.length) end = this.length
if (target.length - targetStart < end - start) {
end = target.length - targetStart + start
}
var len = end - start
var i
if (this === target && start < targetStart && targetStart < end) {
// descending copy from end
for (i = len - 1; i >= 0; --i) {
target[i + targetStart] = this[i + start]
}
} else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
// ascending copy from start
for (i = 0; i < len; ++i) {
target[i + targetStart] = this[i + start]
}
} else {
Uint8Array.prototype.set.call(
target,
this.subarray(start, start + len),
targetStart
)
}
return len
}
// Usage:
// buffer.fill(number[, offset[, end]])
// buffer.fill(buffer[, offset[, end]])
// buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
// Handle string cases:
if (typeof val === 'string') {
if (typeof start === 'string') {
encoding = start
start = 0
end = this.length
} else if (typeof end === 'string') {
encoding = end
end = this.length
}
if (val.length === 1) {
var code = val.charCodeAt(0)
if (code < 256) {
val = code
}
}
if (encoding !== undefined && typeof encoding !== 'string') {
throw new TypeError('encoding must be a string')
}
if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
} else if (typeof val === 'number') {
val = val & 255
}
// Invalid ranges are not set to a default, so can range check early.
if (start < 0 || this.length < start || this.length < end) {
throw new RangeError('Out of range index')
}
if (end <= start) {
return this
}
start = start >>> 0
end = end === undefined ? this.length : end >>> 0
if (!val) val = 0
var i
if (typeof val === 'number') {
for (i = start; i < end; ++i) {
this[i] = val
}
} else {
var bytes = Buffer.isBuffer(val)
? val
: utf8ToBytes(new Buffer(val, encoding).toString())
var len = bytes.length
for (i = 0; i < end - start; ++i) {
this[i + start] = bytes[i % len]
}
}
return this
}
// HELPER FUNCTIONS
// ================
var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
function base64clean (str) {
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = stringtrim(str).replace(INVALID_BASE64_RE, '')
// Node converts strings with length < 2 to ''
if (str.length < 2) return ''
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
while (str.length % 4 !== 0) {
str = str + '='
}
return str
}
function stringtrim (str) {
if (str.trim) return str.trim()
return str.replace(/^\s+|\s+$/g, '')
}
function toHex (n) {
if (n < 16) return '0' + n.toString(16)
return n.toString(16)
}
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
var length = string.length
var leadSurrogate = null
var bytes = []
for (var i = 0; i < length; ++i) {
codePoint = string.charCodeAt(i)
// is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) {
// last char was a lead
if (!leadSurrogate) {
// no lead yet
if (codePoint > 0xDBFF) {
// unexpected trail
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
} else if (i + 1 === length) {
// unpaired lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
}
// valid lead
leadSurrogate = codePoint
continue
}
// 2 leads in a row
if (codePoint < 0xDC00) {
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = codePoint
continue
}
// valid surrogate pair
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
} else if (leadSurrogate) {
// valid bmp char, but last char was a lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
}
leadSurrogate = null
// encode utf8
if (codePoint < 0x80) {
if ((units -= 1) < 0) break
bytes.push(codePoint)
} else if (codePoint < 0x800) {
if ((units -= 2) < 0) break
bytes.push(
codePoint >> 0x6 | 0xC0,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x10000) {
if ((units -= 3) < 0) break
bytes.push(
codePoint >> 0xC | 0xE0,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x110000) {
if ((units -= 4) < 0) break
bytes.push(
codePoint >> 0x12 | 0xF0,
codePoint >> 0xC & 0x3F | 0x80,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else {
throw new Error('Invalid code point')
}
}
return bytes
}
function asciiToBytes (str) {
var byteArray = []
for (var i = 0; i < str.length; ++i) {
// Node's code seems to be doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF)
}
return byteArray
}
function utf16leToBytes (str, units) {
var c, hi, lo
var byteArray = []
for (var i = 0; i < str.length; ++i) {
if ((units -= 2) < 0) break
c = str.charCodeAt(i)
hi = c >> 8
lo = c % 256
byteArray.push(lo)
byteArray.push(hi)
}
return byteArray
}
function base64ToBytes (str) {
return base64.toByteArray(base64clean(str))
}
function blitBuffer (src, dst, offset, length) {
for (var i = 0; i < length; ++i) {
if ((i + offset >= dst.length) || (i >= src.length)) break
dst[i + offset] = src[i]
}
return i
}
function isnan (val) {
return val !== val // eslint-disable-line no-self-compare
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
/***/ }),
/* 1 */
/***/ (function(module, exports) {
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
/* eslint-disable node/no-deprecated-api */
var buffer = __webpack_require__(0)
var Buffer = buffer.Buffer
// alternative to using Object.keys for old browsers
function copyProps (src, dst) {
for (var key in src) {
dst[key] = src[key]
}
}
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
module.exports = buffer
} else {
// Copy properties from require('buffer')
copyProps(buffer, exports)
exports.Buffer = SafeBuffer
}
function SafeBuffer (arg, encodingOrOffset, length) {
return Buffer(arg, encodingOrOffset, length)
}
// Copy static methods from Buffer
copyProps(Buffer, SafeBuffer)
SafeBuffer.from = function (arg, encodingOrOffset, length) {
if (typeof arg === 'number') {
throw new TypeError('Argument must not be a number')
}
return Buffer(arg, encodingOrOffset, length)
}
SafeBuffer.alloc = function (size, fill, encoding) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
var buf = Buffer(size)
if (fill !== undefined) {
if (typeof encoding === 'string') {
buf.fill(fill, encoding)
} else {
buf.fill(fill)
}
} else {
buf.fill(0)
}
return buf
}
SafeBuffer.allocUnsafe = function (size) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
return Buffer(size)
}
SafeBuffer.allocUnsafeSlow = function (size) {
if (typeof size !== 'number') {
throw new TypeError('Argument must be a number')
}
return buffer.SlowBuffer(size)
}
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
;(function (root, factory) {
if (true) {
// CommonJS
module.exports = exports = factory();
}
else if (typeof define === "function" && define.amd) {
// AMD
define([], factory);
}
else {
// Global (browser)
root.CryptoJS = factory();
}
}(this, function () {
/**
* CryptoJS core components.
*/
var CryptoJS = CryptoJS || (function (Math, undefined) {
/*
* Local polyfil of Object.create
*/
var create = Object.create || (function () {
function F() {};
return function (obj) {
var subtype;
F.prototype = obj;
subtype = new F();
F.prototype = null;
return subtype;
};
}())
/**
* CryptoJS namespace.
*/
var C = {};
/**
* Library namespace.
*/
var C_lib = C.lib = {};
/**
* Base object for prototypal inheritance.
*/
var Base = C_lib.Base = (function () {
return {
/**
* Creates a new object that inherits from this object.
*
* @param {Object} overrides Properties to copy into the new object.
*
* @return {Object} The new object.
*
* @static
*
* @example
*
* var MyType = CryptoJS.lib.Base.extend({
* field: 'value',
*
* method: function () {
* }
* });
*/
extend: function (overrides) {
// Spawn
var subtype = create(this);
// Augment
if (overrides) {
subtype.mixIn(overrides);
}
// Create default initializer
if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {
subtype.init = function () {
subtype.$super.init.apply(this, arguments);
};
}
// Initializer's prototype is the subtype object
subtype.init.prototype = subtype;
// Reference supertype
subtype.$super = this;
return subtype;
},
/**
* Extends this object and runs the init method.
* Arguments to create() will be passed to init().
*
* @return {Object} The new object.
*
* @static
*
* @example
*
* var instance = MyType.create();
*/
create: function () {
var instance = this.extend();
instance.init.apply(instance, arguments);
return instance;
},
/**
* Initializes a newly created object.
* Override this method to add some logic when your objects are created.
*
* @example
*
* var MyType = CryptoJS.lib.Base.extend({
* init: function () {
* // ...
* }
* });
*/
init: function () {
},
/**
* Copies properties into this object.
*
* @param {Object} properties The properties to mix in.
*
* @example
*
* MyType.mixIn({
* field: 'value'
* });
*/
mixIn: function (properties) {
for (var propertyName in properties) {
if (properties.hasOwnProperty(propertyName)) {
this[propertyName] = properties[propertyName];
}
}
// IE won't copy toString using the loop above
if (properties.hasOwnProperty('toString')) {
this.toString = properties.toString;
}
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = instance.clone();
*/
clone: function () {
return this.init.prototype.extend(this);
}
};
}());
/**
* An array of 32-bit words.
*
* @property {Array} words The array of 32-bit words.
* @property {number} sigBytes The number of significant bytes in this word array.
*/
var WordArray = C_lib.WordArray = Base.extend({
/**
* Initializes a newly created word array.
*
* @param {Array} words (Optional) An array of 32-bit words.
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
*
* @example
*
* var wordArray = CryptoJS.lib.WordArray.create();
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
*/
init: function (words, sigBytes) {
words = this.words = words || [];
if (sigBytes != undefined) {
this.sigBytes = sigBytes;
} else {
this.sigBytes = words.length * 4;
}
},
/**
* Converts this word array to a string.
*
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
*
* @return {string} The stringified word array.
*
* @example
*
* var string = wordArray + '';
* var string = wordArray.toString();
* var string = wordArray.toString(CryptoJS.enc.Utf8);
*/
toString: function (encoder) {
return (encoder || Hex).stringify(this);
},
/**
* Concatenates a word array to this word array.
*
* @param {WordArray} wordArray The word array to append.
*
* @return {WordArray} This word array.
*
* @example
*
* wordArray1.concat(wordArray2);
*/
concat: function (wordArray) {
// Shortcuts
var thisWords = this.words;
var thatWords = wordArray.words;
var thisSigBytes = this.sigBytes;
var thatSigBytes = wordArray.sigBytes;
// Clamp excess bits
this.clamp();
// Concat
if (thisSigBytes % 4) {
// Copy one byte at a time
for (var i = 0; i < thatSigBytes; i++) {
var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
}
} else {
// Copy one word at a time
for (var i = 0; i < thatSigBytes; i += 4) {
thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
}
}
this.sigBytes += thatSigBytes;
// Chainable
return this;
},
/**
* Removes insignificant bits.
*
* @example
*
* wordArray.clamp();
*/
clamp: function () {
// Shortcuts
var words = this.words;
var sigBytes = this.sigBytes;
// Clamp
words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
words.length = Math.ceil(sigBytes / 4);
},
/**
* Creates a copy of this word array.
*
* @return {WordArray} The clone.
*
* @example
*
* var clone = wordArray.clone();
*/
clone: function () {
var clone = Base.clone.call(this);
clone.words = this.words.slice(0);
return clone;
},
/**
* Creates a word array filled with random bytes.
*
* @param {number} nBytes The number of random bytes to generate.
*
* @return {WordArray} The random word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.lib.WordArray.random(16);
*/
random: function (nBytes) {
var words = [];
var r = (function (m_w) {
var m_w = m_w;
var m_z = 0x3ade68b1;
var mask = 0xffffffff;
return function () {
m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;
m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;
var result = ((m_z << 0x10) + m_w) & mask;
result /= 0x100000000;
result += 0.5;
return result * (Math.random() > .5 ? 1 : -1);
}
});
for (var i = 0, rcache; i < nBytes; i += 4) {
var _r = r((rcache || Math.random()) * 0x100000000);
rcache = _r() * 0x3ade67b7;
words.push((_r() * 0x100000000) | 0);
}
return new WordArray.init(words, nBytes);
}
});
/**
* Encoder namespace.
*/
var C_enc = C.enc = {};
/**
* Hex encoding strategy.
*/
var Hex = C_enc.Hex = {
/**
* Converts a word array to a hex string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The hex string.
*
* @static
*
* @example
*
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
*/
stringify: function (wordArray) {
// Shortcuts
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
// Convert
var hexChars = [];
for (var i = 0; i < sigBytes; i++) {
var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
hexChars.push((bite >>> 4).toString(16));
hexChars.push((bite & 0x0f).toString(16));
}
return hexChars.join('');
},
/**
* Converts a hex string to a word array.
*
* @param {string} hexStr The hex string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
*/
parse: function (hexStr) {
// Shortcut
var hexStrLength = hexStr.length;
// Convert
var words = [];
for (var i = 0; i < hexStrLength; i += 2) {
words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
}
return new WordArray.init(words, hexStrLength / 2);
}
};
/**
* Latin1 encoding strategy.
*/
var Latin1 = C_enc.Latin1 = {
/**
* Converts a word array to a Latin1 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The Latin1 string.
*
* @static
*
* @example
*
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
*/
stringify: function (wordArray) {
// Shortcuts
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
// Convert
var latin1Chars = [];
for (var i = 0; i < sigBytes; i++) {
var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
latin1Chars.push(String.fromCharCode(bite));
}
return latin1Chars.join('');
},
/**
* Converts a Latin1 string to a word array.
*
* @param {string} latin1Str The Latin1 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
*/
parse: function (latin1Str) {
// Shortcut
var latin1StrLength = latin1Str.length;
// Convert
var words = [];
for (var i = 0; i < latin1StrLength; i++) {
words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
}
return new WordArray.init(words, latin1StrLength);
}
};
/**
* UTF-8 encoding strategy.
*/
var Utf8 = C_enc.Utf8 = {
/**
* Converts a word array to a UTF-8 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The UTF-8 string.
*
* @static
*
* @example
*
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
*/
stringify: function (wordArray) {
try {
return decodeURIComponent(escape(Latin1.stringify(wordArray)));
} catch (e) {
throw new Error('Malformed UTF-8 data');
}
},
/**
* Converts a UTF-8 string to a word array.
*
* @param {string} utf8Str The UTF-8 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
*/
parse: function (utf8Str) {
return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
}
};
/**
* Abstract buffered block algorithm template.
*
* The property blockSize must be implemented in a concrete subtype.
*
* @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
*/
var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
/**
* Resets this block algorithm's data buffer to its initial state.
*
* @example
*
* bufferedBlockAlgorithm.reset();
*/
reset: function () {
// Initial values
this._data = new WordArray.init();
this._nDataBytes = 0;
},
/**
* Adds new data to this block algorithm's buffer.
*
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
*
* @example
*
* bufferedBlockAlgorithm._append('data');
* bufferedBlockAlgorithm._append(wordArray);
*/
_append: function (data) {
// Convert string to WordArray, else assume WordArray already
if (typeof data == 'string') {
data = Utf8.parse(data);
}
// Append
this._data.concat(data);
this._nDataBytes += data.sigBytes;
},
/**
* Processes available data blocks.
*
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
*
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
*
* @return {WordArray} The processed data.
*
* @example
*
* var processedData = bufferedBlockAlgorithm._process();
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
*/
_process: function (doFlush) {
// Shortcuts
var data = this._data;
var dataWords = data.words;
var dataSigBytes = data.sigBytes;
var blockSize = this.blockSize;
var blockSizeBytes = blockSize * 4;
// Count blocks ready
var nBlocksReady = dataSigBytes / blockSizeBytes;
if (doFlush) {
// Round up to include partial blocks
nBlocksReady = Math.ceil(nBlocksReady);
} else {
// Round down to include only full blocks,
// less the number of blocks that must remain in the buffer
nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
}
// Count words ready
var nWordsReady = nBlocksReady * blockSize;
// Count bytes ready
var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
// Process blocks
if (nWordsReady) {
for (var offset = 0; offset < nWordsReady; offset += blockSize) {
// Perform concrete-algorithm logic
this._doProcessBlock(dataWords, offset);
}
// Remove processed words
var processedWords = dataWords.splice(0, nWordsReady);
data.sigBytes -= nBytesReady;
}
// Return processed words
return new WordArray.init(processedWords, nBytesReady);
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = bufferedBlockAlgorithm.clone();
*/
clone: function () {
var clone = Base.clone.call(this);
clone._data = this._data.clone();
return clone;
},
_minBufferSize: 0
});
/**
* Abstract hasher template.
*
* @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
*/
var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
/**
* Configuration options.
*/
cfg: Base.extend(),
/**
* Initializes a newly created hasher.
*
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
*
* @example
*
* var hasher = CryptoJS.algo.SHA256.create();
*/
init: function (cfg) {
// Apply config defaults
this.cfg = this.cfg.extend(cfg);
// Set initial values
this.reset();
},
/**
* Resets this hasher to its initial state.
*
* @example
*
* hasher.reset();
*/
reset: function () {
// Reset data buffer
BufferedBlockAlgorithm.reset.call(this);
// Perform concrete-hasher logic
this._doReset();
},
/**
* Updates this hasher with a message.
*
* @param {WordArray|string} messageUpdate The message to append.
*
* @return {Hasher} This hasher.
*
* @example
*
* hasher.update('message');
* hasher.update(wordArray);
*/
update: function (messageUpdate) {
// Append
this._append(messageUpdate);
// Update the hash
this._process();
// Chainable
return this;
},
/**
* Finalizes the hash computation.
* Note that the finalize operation is effectively a destructive, read-once operation.
*
* @param {WordArray|string} messageUpdate (Optional) A final message update.
*
* @return {WordArray} The hash.
*
* @example
*
* var hash = hasher.finalize();
* var hash = hasher.finalize('message');
* var hash = hasher.finalize(wordArray);
*/
finalize: function (messageUpdate) {
// Final message update
if (messageUpdate) {
this._append(messageUpdate);
}
// Perform concrete-hasher logic
var hash = this._doFinalize();
return hash;
},
blockSize: 512/32,
/**
* Creates a shortcut function to a hasher's object interface.
*
* @param {Hasher} hasher The hasher to create a helper for.
*
* @return {Function} The shortcut function.
*
* @static
*
* @example
*
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
*/
_createHelper: function (hasher) {
return function (message, cfg) {
return new hasher.init(cfg).finalize(message);
};
},
/**
* Creates a shortcut function to the HMAC's object interface.
*
* @param {Hasher} hasher The hasher to use in this HMAC helper.
*
* @return {Function} The shortcut function.
*
* @static
*
* @example
*
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
*/
_createHmacHelper: function (hasher) {
return function (message, key) {
return new C_algo.HMAC.init(hasher, key).finalize(message);
};
}
});
/**
* Algorithm namespace.
*/
var C_algo = C.algo = {};
return C;
}(Math));
return CryptoJS;
}));
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
* @license
* Lodash
* Copyright JS Foundation and other contributors
* Released under MIT license
* Based on Underscore.js 1.8.3
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
;(function() {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
/** Used as the semantic version number. */
var VERSION = '4.17.4';
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/** Error message constants. */
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
FUNC_ERROR_TEXT = 'Expected a function';
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;
/** Used as the internal argument placeholder. */
var PLACEHOLDER = '__lodash_placeholder__';
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_BOUND_FLAG = 4,
WRAP_CURRY_FLAG = 8,
WRAP_CURRY_RIGHT_FLAG = 16,
WRAP_PARTIAL_FLAG = 32,
WRAP_PARTIAL_RIGHT_FLAG = 64,
WRAP_ARY_FLAG = 128,
WRAP_REARG_FLAG = 256,
WRAP_FLIP_FLAG = 512;
/** Used as default options for `_.truncate`. */
var DEFAULT_TRUNC_LENGTH = 30,
DEFAULT_TRUNC_OMISSION = '...';
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
HOT_SPAN = 16;
/** Used to indicate the type of lazy iteratees. */
var LAZY_FILTER_FLAG = 1,
LAZY_MAP_FLAG = 2,
LAZY_WHILE_FLAG = 3;
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_SAFE_INTEGER = 9007199254740991,
MAX_INTEGER = 1.7976931348623157e+308,
NAN = 0 / 0;
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295,
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
/** Used to associate wrap methods with their bit flags. */
var wrapFlags = [
['ary', WRAP_ARY_FLAG],
['bind', WRAP_BIND_FLAG],
['bindKey', WRAP_BIND_KEY_FLAG],
['curry', WRAP_CURRY_FLAG],
['curryRight', WRAP_CURRY_RIGHT_FLAG],
['flip', WRAP_FLIP_FLAG],
['partial', WRAP_PARTIAL_FLAG],
['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
['rearg', WRAP_REARG_FLAG]
];
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
asyncTag = '[object AsyncFunction]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
domExcTag = '[object DOMException]',
errorTag = '[object Error]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
numberTag = '[object Number]',
nullTag = '[object Null]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
proxyTag = '[object Proxy]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
undefinedTag = '[object Undefined]',
weakMapTag = '[object WeakMap]',
weakSetTag = '[object WeakSet]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to match empty string literals in compiled template source. */
var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
/** Used to match HTML entities and HTML characters. */
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
reUnescapedHtml = /[&<>"']/g,
reHasEscapedHtml = RegExp(reEscapedHtml.source),
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
/** Used to match template delimiters. */
var reEscape = /<%-([\s\S]+?)%>/g,
reEvaluate = /<%([\s\S]+?)%>/g,
reInterpolate = /<%=([\s\S]+?)%>/g;
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/,
reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
reHasRegExpChar = RegExp(reRegExpChar.source);
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g,
reTrimStart = /^\s+/,
reTrimEnd = /\s+$/;
/** Used to match wrap detail comments. */
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
reSplitDetails = /,? & /;
/** Used to match words composed of alphanumeric characters. */
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/**
* Used to match
* [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
*/
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/** Used to match Latin Unicode letters (excluding mathematical operators). */
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
/** Used to ensure capturing order of template delimiters. */
var reNoMatch = /($^)/;
/** Used to match unescaped characters in compiled string literals. */
var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboMarksRange = '\\u0300-\\u036f',
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
rsComboSymbolsRange = '\\u20d0-\\u20ff',
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
rsDingbatRange = '\\u2700-\\u27bf',
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
rsPunctuationRange = '\\u2000-\\u206f',
rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
rsVarRange = '\\ufe0e\\ufe0f',
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
/** Used to compose unicode capture groups. */
var rsApos = "['\u2019]",
rsAstral = '[' + rsAstralRange + ']',
rsBreak = '[' + rsBreakRange + ']',
rsCombo = '[' + rsComboRange + ']',
rsDigits = '\\d+',
rsDingbat = '[' + rsDingbatRange + ']',
rsLower = '[' + rsLowerRange + ']',
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
rsFitz = '\\ud83c[\\udffb-\\udfff]',
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
rsNonAstral = '[^' + rsAstralRange + ']',
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
rsUpper = '[' + rsUpperRange + ']',
rsZWJ = '\\u200d';
/** Used to compose unicode regexes. */
var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
reOptMod = rsModifier + '?',
rsOptVar = '[' + rsVarRange + ']?',
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)',
rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)',
rsSeq = rsOptVar + reOptMod + rsOptJoin,
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
/** Used to match apostrophes. */
var reApos = RegExp(rsApos, 'g');
/**
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
*/
var reComboMark = RegExp(rsCombo, 'g');
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
/** Used to match complex or compound words. */
var reUnicodeWord = RegExp([
rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
rsUpper + '+' + rsOptContrUpper,
rsOrdUpper,
rsOrdLower,
rsDigits,
rsEmoji
].join('|'), 'g');
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
/** Used to detect strings that need a more robust regexp to match words. */
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
/** Used to assign default `context` object properties. */
var contextProps = [
'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
'_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
];
/** Used to make template sourceURLs easier to identify. */
var templateCounter = -1;
/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;
/** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false;
/** Used to map Latin Unicode letters to basic Latin letters. */
var deburredLetters = {
// Latin-1 Supplement block.
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
'\xc7': 'C', '\xe7': 'c',
'\xd0': 'D', '\xf0': 'd',
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
'\xd1': 'N', '\xf1': 'n',
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
'\xc6': 'Ae', '\xe6': 'ae',
'\xde': 'Th', '\xfe': 'th',
'\xdf': 'ss',
// Latin Extended-A block.
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
'\u0134': 'J', '\u0135': 'j',
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
'\u0163': 't', '\u0165': 't', '\u0167': 't',
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
'\u0174': 'W', '\u0175': 'w',
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
'\u0132': 'IJ', '\u0133': 'ij',
'\u0152': 'Oe', '\u0153': 'oe',
'\u0149': "'n", '\u017f': 's'
};
/** Used to map characters to HTML entities. */
var htmlEscapes = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
};
/** Used to map HTML entities to characters. */
var htmlUnescapes = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
''': "'"
};
/** Used to escape characters for inclusion in compiled string literals. */
var stringEscapes = {
'\\': '\\',
"'": "'",
'\n': 'n',
'\r': 'r',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
/** Built-in method references without a dependency on `root`. */
var freeParseFloat = parseFloat,
freeParseInt = parseInt;
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
try {
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}());
/* Node.js helper references. */
var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
nodeIsDate = nodeUtil && nodeUtil.isDate,
nodeIsMap = nodeUtil && nodeUtil.isMap,
nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
nodeIsSet = nodeUtil && nodeUtil.isSet,
nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
/*--------------------------------------------------------------------------*/
/**
* Adds the key-value `pair` to `map`.
*
* @private
* @param {Object} map The map to modify.
* @param {Array} pair The key-value pair to add.
* @returns {Object} Returns `map`.
*/
function addMapEntry(map, pair) {
// Don't return `map.set` because it's not chainable in IE 11.
map.set(pair[0], pair[1]);
return map;
}
/**
* Adds `value` to `set`.
*
* @private
* @param {Object} set The set to modify.
* @param {*} value The value to add.
* @returns {Object} Returns `set`.
*/
function addSetEntry(set, value) {
// Don't return `set.add` because it's not chainable in IE 11.
set.add(value);
return set;
}
/**
* A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`.
*
* @private
* @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} args The arguments to invoke `func` with.
* @returns {*} Returns the result of `func`.
*/
function apply(func, thisArg, args) {
switch (args.length) {
case 0: return func.call(thisArg);
case 1: return func.call(thisArg, args[0]);
case 2: return func.call(thisArg, args[0], args[1]);
case 3: return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
/**
* A specialized version of `baseAggregator` for arrays.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform keys.
* @param {Object} accumulator The initial aggregated object.
* @returns {Function} Returns `accumulator`.
*/
function arrayAggregator(array, setter, iteratee, accumulator) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
var value = array[index];
setter(accumulator, value, iteratee(value), array);
}
return accumulator;
}
/**
* A specialized version of `_.forEach` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEach(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
/**
* A specialized version of `_.forEachRight` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEachRight(array, iteratee) {
var length = array == null ? 0 : array.length;
while (length--) {
if (iteratee(array[length], length, array) === false) {
break;
}
}
return array;
}
/**
* A specialized version of `_.every` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
*/
function arrayEvery(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (!predicate(array[index], index, array)) {
return false;
}
}
return true;
}
/**
* A specialized version of `_.filter` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function arrayFilter(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[resIndex++] = value;
}
}
return result;
}
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
var length = array == null ? 0 : array.length;
return !!length && baseIndexOf(array, value, 0) > -1;
}
/**
* This function is like `arrayIncludes` except that it accepts a comparator.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
/**
* A specialized version of `_.reduce` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the first element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduce(array, iteratee, accumulator, initAccum) {
var index = -1,
length = array == null ? 0 : array.length;
if (initAccum && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accumulator;
}
/**
* A specialized version of `_.reduceRight` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the last element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduceRight(array, iteratee, accumulator, initAccum) {
var length = array == null ? 0 : array.length;
if (initAccum && length) {
accumulator = array[--length];
}
while (length--) {
accumulator = iteratee(accumulator, array[length], length, array);
}
return accumulator;
}
/**
* A specialized version of `_.some` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function arraySome(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
}
/**
* Gets the size of an ASCII `string`.
*
* @private
* @param {string} string The string inspect.
* @returns {number} Returns the string size.
*/
var asciiSize = baseProperty('length');
/**
* Converts an ASCII `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function asciiToArray(string) {
return string.split('');
}
/**
* Splits an ASCII `string` into an array of its words.
*
* @private
* @param {string} The string to inspect.
* @returns {Array} Returns the words of `string`.
*/
function asciiWords(string) {
return string.match(reAsciiWord) || [];
}
/**
* The base implementation of methods like `_.findKey` and `_.findLastKey`,
* without support for iteratee shorthands, which iterates over `collection`
* using `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the found element or its key, else `undefined`.
*/
function baseFindKey(collection, predicate, eachFunc) {
var result;
eachFunc(collection, function(value, key, collection) {
if (predicate(value, key, collection)) {
result = key;
return false;
}
});
return result;
}
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 1 : -1);
while ((fromRight ? index-- : ++index < length)) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
return value === value
? strictIndexOf(array, value, fromIndex)
: baseFindIndex(array, baseIsNaN, fromIndex);
}
/**
* This function is like `baseIndexOf` except that it accepts a comparator.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @param {Function} comparator The comparator invoked per element.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOfWith(array, value, fromIndex, comparator) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (comparator(array[index], value)) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.isNaN` without support for number objects.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
*/
function baseIsNaN(value) {
return value !== value;
}
/**
* The base implementation of `_.mean` and `_.meanBy` without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {number} Returns the mean.
*/
function baseMean(array, iteratee) {
var length = array == null ? 0 : array.length;
return length ? (baseSum(array, iteratee) / length) : NAN;
}
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
/**
* The base implementation of `_.propertyOf` without support for deep paths.
*
* @private
* @param {Object} object The object to query.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyOf(object) {
return function(key) {
return object == null ? undefined : object[key];
};
}
/**
* The base implementation of `_.reduce` and `_.reduceRight`, without support
* for iteratee shorthands, which iterates over `collection` using `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} accumulator The initial value.
* @param {boolean} initAccum Specify using the first or last element of
* `collection` as the initial value.
* @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the accumulated value.
*/
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
eachFunc(collection, function(value, index, collection) {
accumulator = initAccum
? (initAccum = false, value)
: iteratee(accumulator, value, index, collection);
});
return accumulator;
}
/**
* The base implementation of `_.sortBy` which uses `comparer` to define the
* sort order of `array` and replaces criteria objects with their corresponding
* values.
*
* @private
* @param {Array} array The array to sort.
* @param {Function} comparer The function to define sort order.
* @returns {Array} Returns `array`.
*/
function baseSortBy(array, comparer) {
var length = array.length;
array.sort(comparer);
while (length--) {
array[length] = array[length].value;
}
return array;
}
/**
* The base implementation of `_.sum` and `_.sumBy` without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {number} Returns the sum.
*/
function baseSum(array, iteratee) {
var result,
index = -1,
length = array.length;
while (++index < length) {
var current = iteratee(array[index]);
if (current !== undefined) {
result = result === undefined ? current : (result + current);
}
}
return result;
}
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
/**
* The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
* of key-value pairs for `object` corresponding to the property names of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the key-value pairs.
*/
function baseToPairs(object, props) {
return arrayMap(props, function(key) {
return [key, object[key]];
});
}
/**
* The base implementation of `_.unary` without support for storing metadata.
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
*/
function baseUnary(func) {
return function(value) {
return func(value);
};
}
/**
* The base implementation of `_.values` and `_.valuesIn` which creates an
* array of `object` property values corresponding to the property names
* of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the array of property values.
*/
function baseValues(object, props) {
return arrayMap(props, function(key) {
return object[key];
});
}
/**
* Checks if a `cache` value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
/**
* Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
* that is not found in the character symbols.
*
* @private
* @param {Array} strSymbols The string symbols to inspect.
* @param {Array} chrSymbols The character symbols to find.
* @returns {number} Returns the index of the first unmatched string symbol.
*/
function charsStartIndex(strSymbols, chrSymbols) {
var index = -1,
length = strSymbols.length;
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
return index;
}
/**
* Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
* that is not found in the character symbols.
*
* @private
* @param {Array} strSymbols The string symbols to inspect.
* @param {Array} chrSymbols The character symbols to find.
* @returns {number} Returns the index of the last unmatched string symbol.
*/
function charsEndIndex(strSymbols, chrSymbols) {
var index = strSymbols.length;
while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
return index;
}
/**
* Gets the number of `placeholder` occurrences in `array`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} placeholder The placeholder to search for.
* @returns {number} Returns the placeholder count.
*/
function countHolders(array, placeholder) {
var length = array.length,
result = 0;
while (length--) {
if (array[length] === placeholder) {
++result;
}
}
return result;
}
/**
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
* letters to basic Latin letters.
*
* @private
* @param {string} letter The matched letter to deburr.
* @returns {string} Returns the deburred letter.
*/
var deburrLetter = basePropertyOf(deburredLetters);
/**
* Used by `_.escape` to convert characters to HTML entities.
*
* @private
* @param {string} chr The matched character to escape.
* @returns {string} Returns the escaped character.
*/
var escapeHtmlChar = basePropertyOf(htmlEscapes);
/**
* Used by `_.template` to escape characters for inclusion in compiled string literals.
*
* @private
* @param {string} chr The matched character to escape.
* @returns {string} Returns the escaped character.
*/
function escapeStringChar(chr) {
return '\\' + stringEscapes[chr];
}
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
/**
* Checks if `string` contains Unicode symbols.
*
* @private
* @param {string} string The string to inspect.
* @returns {boolean} Returns `true` if a symbol is found, else `false`.
*/
function hasUnicode(string) {
return reHasUnicode.test(string);
}
/**
* Checks if `string` contains a word composed of Unicode symbols.
*
* @private
* @param {string} string The string to inspect.
* @returns {boolean} Returns `true` if a word is found, else `false`.
*/
function hasUnicodeWord(string) {
return reHasUnicodeWord.test(string);
}
/**
* Converts `iterator` to an array.
*
* @private
* @param {Object} iterator The iterator to convert.
* @returns {Array} Returns the converted array.
*/
function iteratorToArray(iterator) {
var data,
result = [];
while (!(data = iterator.next()).done) {
result.push(data.value);
}
return result;
}
/**
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
/**
* Replaces all `placeholder` elements in `array` with an internal placeholder
* and returns an array of their indexes.
*
* @private
* @param {Array} array The array to modify.
* @param {*} placeholder The placeholder to replace.
* @returns {Array} Returns the new array of placeholder indexes.
*/
function replaceHolders(array, placeholder) {
var index = -1,
length = array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value === placeholder || value === PLACEHOLDER) {
array[index] = PLACEHOLDER;
result[resIndex++] = index;
}
}
return result;
}
/**
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
/**
* Converts `set` to its value-value pairs.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the value-value pairs.
*/
function setToPairs(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = [value, value];
});
return result;
}
/**
* A specialized version of `_.indexOf` which performs strict equality
* comparisons of values, i.e. `===`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function strictIndexOf(array, value, fromIndex) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* A specialized version of `_.lastIndexOf` which performs strict equality
* comparisons of values, i.e. `===`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function strictLastIndexOf(array, value, fromIndex) {
var index = fromIndex + 1;
while (index--) {
if (array[index] === value) {
return index;
}
}
return index;
}
/**
* Gets the number of symbols in `string`.
*
* @private
* @param {string} string The string to inspect.
* @returns {number} Returns the string size.
*/
function stringSize(string) {
return hasUnicode(string)
? unicodeSize(string)
: asciiSize(string);
}
/**
* Converts `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function stringToArray(string) {
return hasUnicode(string)
? unicodeToArray(string)
: asciiToArray(string);
}
/**
* Used by `_.unescape` to convert HTML entities to characters.
*
* @private
* @param {string} chr The matched character to unescape.
* @returns {string} Returns the unescaped character.
*/
var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
/**
* Gets the size of a Unicode `string`.
*
* @private
* @param {string} string The string inspect.
* @returns {number} Returns the string size.
*/
function unicodeSize(string) {
var result = reUnicode.lastIndex = 0;
while (reUnicode.test(string)) {
++result;
}
return result;
}
/**
* Converts a Unicode `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function unicodeToArray(string) {
return string.match(reUnicode) || [];
}
/**
* Splits a Unicode `string` into an array of its words.
*
* @private
* @param {string} The string to inspect.
* @returns {Array} Returns the words of `string`.
*/
function unicodeWords(string) {
return string.match(reUnicodeWord) || [];
}
/*--------------------------------------------------------------------------*/
/**
* Create a new pristine `lodash` function using the `context` object.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Util
* @param {Object} [context=root] The context object.
* @returns {Function} Returns a new `lodash` function.
* @example
*
* _.mixin({ 'foo': _.constant('foo') });
*
* var lodash = _.runInContext();
* lodash.mixin({ 'bar': lodash.constant('bar') });
*
* _.isFunction(_.foo);
* // => true
* _.isFunction(_.bar);
* // => false
*
* lodash.isFunction(lodash.foo);
* // => false
* lodash.isFunction(lodash.bar);
* // => true
*
* // Create a suped-up `defer` in Node.js.
* var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
*/
var runInContext = (function runInContext(context) {
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
/** Built-in constructor references. */
var Array = context.Array,
Date = context.Date,
Error = context.Error,
Function = context.Function,
Math = context.Math,
Object = context.Object,
RegExp = context.RegExp,
String = context.String,
TypeError = context.TypeError;
/** Used for built-in method references. */
var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = context['__core-js_shared__'];
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to generate unique IDs. */
var idCounter = 0;
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/** Used to restore the original `_` reference in `_.noConflict`. */
var oldDash = root._;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var Buffer = moduleExports ? context.Buffer : undefined,
Symbol = context.Symbol,
Uint8Array = context.Uint8Array,
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
getPrototype = overArg(Object.getPrototypeOf, Object),
objectCreate = Object.create,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
splice = arrayProto.splice,
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
symIterator = Symbol ? Symbol.iterator : undefined,
symToStringTag = Symbol ? Symbol.toStringTag : undefined;
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
/** Mocked built-ins. */
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
ctxNow = Date && Date.now !== root.Date.now && Date.now,
ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
nativeFloor = Math.floor,
nativeGetSymbols = Object.getOwnPropertySymbols,
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
nativeIsFinite = context.isFinite,
nativeJoin = arrayProto.join,
nativeKeys = overArg(Object.keys, Object),
nativeMax = Math.max,
nativeMin = Math.min,
nativeNow = Date.now,
nativeParseInt = context.parseInt,
nativeRandom = Math.random,
nativeReverse = arrayProto.reverse;
/* Built-in method references that are verified to be native. */
var DataView = getNative(context, 'DataView'),
Map = getNative(context, 'Map'),
Promise = getNative(context, 'Promise'),
Set = getNative(context, 'Set'),
WeakMap = getNative(context, 'WeakMap'),
nativeCreate = getNative(Object, 'create');
/** Used to store function metadata. */
var metaMap = WeakMap && new WeakMap;
/** Used to lookup unminified function names. */
var realNames = {};
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/*------------------------------------------------------------------------*/
/**
* Creates a `lodash` object which wraps `value` to enable implicit method
* chain sequences. Methods that operate on and return arrays, collections,
* and functions can be chained together. Methods that retrieve a single value
* or may return a primitive value will automatically end the chain sequence
* and return the unwrapped value. Otherwise, the value must be unwrapped
* with `_#value`.
*
* Explicit chain sequences, which must be unwrapped with `_#value`, may be
* enabled using `_.chain`.
*
* The execution of chained methods is lazy, that is, it's deferred until
* `_#value` is implicitly or explicitly called.
*
* Lazy evaluation allows several methods to support shortcut fusion.
* Shortcut fusion is an optimization to merge iteratee calls; this avoids
* the creation of intermediate arrays and can greatly reduce the number of
* iteratee executions. Sections of a chain sequence qualify for shortcut
* fusion if the section is applied to an array and iteratees accept only
* one argument. The heuristic for whether a section qualifies for shortcut
* fusion is subject to change.
*
* Chaining is supported in custom builds as long as the `_#value` method is
* directly or indirectly included in the build.
*
* In addition to lodash methods, wrappers have `Array` and `String` methods.
*
* The wrapper `Array` methods are:
* `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
*
* The wrapper `String` methods are:
* `replace` and `split`
*
* The wrapper methods that support shortcut fusion are:
* `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
* `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
*
* The chainable wrapper methods are:
* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
* `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
* `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
* `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
* `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
* `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
* `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
* `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
* `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
* `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
* `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
* `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
* `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
* `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
* `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
* `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
* `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
* `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
* `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
* `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
* `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
* `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
* `zipObject`, `zipObjectDeep`, and `zipWith`
*
* The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
* `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
* `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
* `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
* `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
* `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
* `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
* `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
* `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
* `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
* `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
* `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
* `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
* `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
* `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
* `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
* `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
* `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
* `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
* `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
* `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
* `upperFirst`, `value`, and `words`
*
* @name _
* @constructor
* @category Seq
* @param {*} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2, 3]);
*
* // Returns an unwrapped value.
* wrapped.reduce(_.add);
* // => 6
*
* // Returns a wrapped value.
* var squares = wrapped.map(square);
*
* _.isArray(squares);
* // => false
*
* _.isArray(squares.value());
* // => true
*/
function lodash(value) {
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
if (value instanceof LodashWrapper) {
return value;
}
if (hasOwnProperty.call(value, '__wrapped__')) {
return wrapperClone(value);
}
}
return new LodashWrapper(value);
}
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} proto The object to inherit from.
* @returns {Object} Returns the new object.
*/
var baseCreate = (function() {
function object() {}
return function(proto) {
if (!isObject(proto)) {
return {};
}
if (objectCreate) {
return objectCreate(proto);
}
object.prototype = proto;
var result = new object;
object.prototype = undefined;
return result;
};
}());
/**
* The function whose prototype chain sequence wrappers inherit from.
*
* @private
*/
function baseLodash() {
// No operation performed.
}
/**
* The base constructor for creating `lodash` wrapper objects.
*
* @private
* @param {*} value The value to wrap.
* @param {boolean} [chainAll] Enable explicit method chain sequences.
*/
function LodashWrapper(value, chainAll) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__chain__ = !!chainAll;
this.__index__ = 0;
this.__values__ = undefined;
}
/**
* By default, the template delimiters used by lodash are like those in
* embedded Ruby (ERB) as well as ES2015 template strings. Change the
* following template settings to use alternative delimiters.
*
* @static
* @memberOf _
* @type {Object}
*/
lodash.templateSettings = {
/**
* Used to detect `data` property values to be HTML-escaped.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
'escape': reEscape,
/**
* Used to detect code to be evaluated.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
'evaluate': reEvaluate,
/**
* Used to detect `data` property values to inject.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
'interpolate': reInterpolate,
/**
* Used to reference the data object in the template text.
*
* @memberOf _.templateSettings
* @type {string}
*/
'variable': '',
/**
* Used to import variables into the compiled template.
*
* @memberOf _.templateSettings
* @type {Object}
*/
'imports': {
/**
* A reference to the `lodash` function.
*
* @memberOf _.templateSettings.imports
* @type {Function}
*/
'_': lodash
}
};
// Ensure wrappers are instances of `baseLodash`.
lodash.prototype = baseLodash.prototype;
lodash.prototype.constructor = lodash;
LodashWrapper.prototype = baseCreate(baseLodash.prototype);
LodashWrapper.prototype.constructor = LodashWrapper;
/*------------------------------------------------------------------------*/
/**
* Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
*
* @private
* @constructor
* @param {*} value The value to wrap.
*/
function LazyWrapper(value) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__dir__ = 1;
this.__filtered__ = false;
this.__iteratees__ = [];
this.__takeCount__ = MAX_ARRAY_LENGTH;
this.__views__ = [];
}
/**
* Creates a clone of the lazy wrapper object.
*
* @private
* @name clone
* @memberOf LazyWrapper
* @returns {Object} Returns the cloned `LazyWrapper` object.
*/
function lazyClone() {
var result = new LazyWrapper(this.__wrapped__);
result.__actions__ = copyArray(this.__actions__);
result.__dir__ = this.__dir__;
result.__filtered__ = this.__filtered__;
result.__iteratees__ = copyArray(this.__iteratees__);
result.__takeCount__ = this.__takeCount__;
result.__views__ = copyArray(this.__views__);
return result;
}
/**
* Reverses the direction of lazy iteration.
*
* @private
* @name reverse
* @memberOf LazyWrapper
* @returns {Object} Returns the new reversed `LazyWrapper` object.
*/
function lazyReverse() {
if (this.__filtered__) {
var result = new LazyWrapper(this);
result.__dir__ = -1;
result.__filtered__ = true;
} else {
result = this.clone();
result.__dir__ *= -1;
}
return result;
}
/**
* Extracts the unwrapped value from its lazy wrapper.
*
* @private
* @name value
* @memberOf LazyWrapper
* @returns {*} Returns the unwrapped value.
*/
function lazyValue() {
var array = this.__wrapped__.value(),
dir = this.__dir__,
isArr = isArray(array),
isRight = dir < 0,
arrLength = isArr ? array.length : 0,
view = getView(0, arrLength, this.__views__),
start = view.start,
end = view.end,
length = end - start,
index = isRight ? end : (start - 1),
iteratees = this.__iteratees__,
iterLength = iteratees.length,
resIndex = 0,
takeCount = nativeMin(length, this.__takeCount__);
if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
return baseWrapperValue(array, this.__actions__);
}
var result = [];
outer:
while (length-- && resIndex < takeCount) {
index += dir;
var iterIndex = -1,
value = array[index];
while (++iterIndex < iterLength) {
var data = iteratees[iterIndex],
iteratee = data.iteratee,
type = data.type,
computed = iteratee(value);
if (type == LAZY_MAP_FLAG) {
value = computed;
} else if (!computed) {
if (type == LAZY_FILTER_FLAG) {
continue outer;
} else {
break outer;
}
}
}
result[resIndex++] = value;
}
return result;
}
// Ensure `LazyWrapper` is an instance of `baseLodash`.
LazyWrapper.prototype = baseCreate(baseLodash.prototype);
LazyWrapper.prototype.constructor = LazyWrapper;
/*------------------------------------------------------------------------*/
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
/*------------------------------------------------------------------------*/
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
--this.size;
return true;
}
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/*------------------------------------------------------------------------*/
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.size = 0;
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
var result = getMapData(this, key)['delete'](key);
this.size -= result ? 1 : 0;
return result;
}
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
var data = getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/*------------------------------------------------------------------------*/
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values == null ? 0 : values.length;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
/*------------------------------------------------------------------------*/
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
var data = this.__data__ = new ListCache(entries);
this.size = data.size;
}
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache;
this.size = 0;
}
/**
* Removes `key` and its value from the stack.
*
* @private
* @name delete
* @memberOf Stack
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
var data = this.__data__,
result = data['delete'](key);
this.size = data.size;
return result;
}
/**
* Gets the stack value for `key`.
*
* @private
* @name get
* @memberOf Stack
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function stackGet(key) {
return this.__data__.get(key);
}
/**
* Checks if a stack value for `key` exists.
*
* @private
* @name has
* @memberOf Stack
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function stackHas(key) {
return this.__data__.has(key);
}
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var data = this.__data__;
if (data instanceof ListCache) {
var pairs = data.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new MapCache(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
/*------------------------------------------------------------------------*/
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
var isArr = isArray(value),
isArg = !isArr && isArguments(value),
isBuff = !isArr && !isArg && isBuffer(value),
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
skipIndexes = isArr || isArg || isBuff || isType,
result = skipIndexes ? baseTimes(value.length, String) : [],
length = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (
// Safari 9 has enumerable `arguments.length` in strict mode.
key == 'length' ||
// Node.js 0.10 has enumerable non-index properties on buffers.
(isBuff && (key == 'offset' || key == 'parent')) ||
// PhantomJS 2 has enumerable non-index properties on typed arrays.
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
// Skip index properties.
isIndex(key, length)
))) {
result.push(key);
}
}
return result;
}
/**
* A specialized version of `_.sample` for arrays.
*
* @private
* @param {Array} array The array to sample.
* @returns {*} Returns the random element.
*/
function arraySample(array) {
var length = array.length;
return length ? array[baseRandom(0, length - 1)] : undefined;
}
/**
* A specialized version of `_.sampleSize` for arrays.
*
* @private
* @param {Array} array The array to sample.
* @param {number} n The number of elements to sample.
* @returns {Array} Returns the random elements.
*/
function arraySampleSize(array, n) {
return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
}
/**
* A specialized version of `_.shuffle` for arrays.
*
* @private
* @param {Array} array The array to shuffle.
* @returns {Array} Returns the new shuffled array.
*/
function arrayShuffle(array) {
return shuffleSelf(copyArray(array));
}
/**
* This function is like `assignValue` except that it doesn't assign
* `undefined` values.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignMergeValue(object, key, value) {
if ((value !== undefined && !eq(object[key], value)) ||
(value === undefined && !(key in object))) {
baseAssignValue(object, key, value);
}
}
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
baseAssignValue(object, key, value);
}
}
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
/**
* Aggregates elements of `collection` on `accumulator` with keys transformed
* by `iteratee` and values set by `setter`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform keys.
* @param {Object} accumulator The initial aggregated object.
* @returns {Function} Returns `accumulator`.
*/
function baseAggregator(collection, setter, iteratee, accumulator) {
baseEach(collection, function(value, key, collection) {
setter(accumulator, value, iteratee(value), collection);
});
return accumulator;
}
/**
* The base implementation of `_.assign` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssign(object, source) {
return object && copyObject(source, keys(source), object);
}
/**
* The base implementation of `_.assignIn` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssignIn(object, source) {
return object && copyObject(source, keysIn(source), object);
}
/**
* The base implementation of `assignValue` and `assignMergeValue` without
* value checks.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function baseAssignValue(object, key, value) {
if (key == '__proto__' && defineProperty) {
defineProperty(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
/**
* The base implementation of `_.at` without support for individual paths.
*
* @private
* @param {Object} object The object to iterate over.
* @param {string[]} paths The property paths to pick.
* @returns {Array} Returns the picked elements.
*/
function baseAt(object, paths) {
var index = -1,
length = paths.length,
result = Array(length),
skip = object == null;
while (++index < length) {
result[index] = skip ? undefined : get(object, paths[index]);
}
return result;
}
/**
* The base implementation of `_.clamp` which doesn't coerce arguments.
*
* @private
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
*/
function baseClamp(number, lower, upper) {
if (number === number) {
if (upper !== undefined) {
number = number <= upper ? number : upper;
}
if (lower !== undefined) {
number = number >= lower ? number : lower;
}
}
return number;
}
/**
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
* traversed objects.
*
* @private
* @param {*} value The value to clone.
* @param {boolean} bitmask The bitmask flags.
* 1 - Deep clone
* 2 - Flatten inherited properties
* 4 - Clone symbols
* @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value.
*/
function baseClone(value, bitmask, customizer, key, object, stack) {
var result,
isDeep = bitmask & CLONE_DEEP_FLAG,
isFlat = bitmask & CLONE_FLAT_FLAG,
isFull = bitmask & CLONE_SYMBOLS_FLAG;
if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value);
}
if (result !== undefined) {
return result;
}
if (!isObject(value)) {
return value;
}
var isArr = isArray(value);
if (isArr) {
result = initCloneArray(value);
if (!isDeep) {
return copyArray(value, result);
}
} else {
var tag = getTag(value),
isFunc = tag == funcTag || tag == genTag;
if (isBuffer(value)) {
return cloneBuffer(value, isDeep);
}
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
result = (isFlat || isFunc) ? {} : initCloneObject(value);
if (!isDeep) {
return isFlat
? copySymbolsIn(value, baseAssignIn(result, value))
: copySymbols(value, baseAssign(result, value));
}
} else {
if (!cloneableTags[tag]) {
return object ? value : {};
}
result = initCloneByTag(value, tag, baseClone, isDeep);
}
}
// Check for circular references and return its corresponding clone.
stack || (stack = new Stack);
var stacked = stack.get(value);
if (stacked) {
return stacked;
}
stack.set(value, result);
var keysFunc = isFull
? (isFlat ? getAllKeysIn : getAllKeys)
: (isFlat ? keysIn : keys);
var props = isArr ? undefined : keysFunc(value);
arrayEach(props || value, function(subValue, key) {
if (props) {
key = subValue;
subValue = value[key];
}
// Recursively populate clone (susceptible to call stack limits).
assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
return result;
}
/**
* The base implementation of `_.conforms` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property predicates to conform to.
* @returns {Function} Returns the new spec function.
*/
function baseConforms(source) {
var props = keys(source);
return function(object) {
return baseConformsTo(object, source, props);
};
}
/**
* The base implementation of `_.conformsTo` which accepts `props` to check.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property predicates to conform to.
* @returns {boolean} Returns `true` if `object` conforms, else `false`.
*/
function baseConformsTo(object, source, props) {
var length = props.length;
if (object == null) {
return !length;
}
object = Object(object);
while (length--) {
var key = props[length],
predicate = source[key],
value = object[key];
if ((value === undefined && !(key in object)) || !predicate(value)) {
return false;
}
}
return true;
}
/**
* The base implementation of `_.delay` and `_.defer` which accepts `args`
* to provide to `func`.
*
* @private
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @param {Array} args The arguments to provide to `func`.
* @returns {number|Object} Returns the timer id or timeout object.
*/
function baseDelay(func, wait, args) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return setTimeout(function() { func.apply(undefined, args); }, wait);
}
/**
* The base implementation of methods like `_.difference` without support
* for excluding multiple arrays or iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Array} values The values to exclude.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
*/
function baseDifference(array, values, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
isCommon = true,
length = array.length,
result = [],
valuesLength = values.length;
if (!length) {
return result;
}
if (iteratee) {
values = arrayMap(values, baseUnary(iteratee));
}
if (comparator) {
includes = arrayIncludesWith;
isCommon = false;
}
else if (values.length >= LARGE_ARRAY_SIZE) {
includes = cacheHas;
isCommon = false;
values = new SetCache(values);
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee == null ? value : iteratee(value);
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var valuesIndex = valuesLength;
while (valuesIndex--) {
if (values[valuesIndex] === computed) {
continue outer;
}
}
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.forEach` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEach = createBaseEach(baseForOwn);
/**
* The base implementation of `_.forEachRight` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEachRight = createBaseEach(baseForOwnRight, true);
/**
* The base implementation of `_.every` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`
*/
function baseEvery(collection, predicate) {
var result = true;
baseEach(collection, function(value, index, collection) {
result = !!predicate(value, index, collection);
return result;
});
return result;
}
/**
* The base implementation of methods like `_.max` and `_.min` which accepts a
* `comparator` to determine the extremum value.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The iteratee invoked per iteration.
* @param {Function} comparator The comparator used to compare values.
* @returns {*} Returns the extremum value.
*/
function baseExtremum(array, iteratee, comparator) {
var index = -1,
length = array.length;
while (++index < length) {
var value = array[index],
current = iteratee(value);
if (current != null && (computed === undefined
? (current === current && !isSymbol(current))
: comparator(current, computed)
)) {
var computed = current,
result = value;
}
}
return result;
}
/**
* The base implementation of `_.fill` without an iteratee call guard.
*
* @private
* @param {Array} array The array to fill.
* @param {*} value The value to fill `array` with.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns `array`.
*/
function baseFill(array, value, start, end) {
var length = array.length;
start = toInteger(start);
if (start < 0) {
start = -start > length ? 0 : (length + start);
}
end = (end === undefined || end > length) ? length : toInteger(end);
if (end < 0) {
end += length;
}
end = start > end ? 0 : toLength(end);
while (start < end) {
array[start++] = value;
}
return array;
}
/**
* The base implementation of `_.filter` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function baseFilter(collection, predicate) {
var result = [];
baseEach(collection, function(value, index, collection) {
if (predicate(value, index, collection)) {
result.push(value);
}
});
return result;
}
/**
* The base implementation of `_.flatten` with support for restricting flattening.
*
* @private
* @param {Array} array The array to flatten.
* @param {number} depth The maximum recursion depth.
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, depth, predicate, isStrict, result) {
var index = -1,
length = array.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index < length) {
var value = array[index];
if (depth > 0 && predicate(value)) {
if (depth > 1) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, depth - 1, predicate, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
/**
* The base implementation of `baseForOwn` which iterates over `object`
* properties returned by `keysFunc` and invokes `iteratee` for each property.
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
var baseFor = createBaseFor();
/**
* This function is like `baseFor` except that it iterates over properties
* in the opposite order.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
var baseForRight = createBaseFor(true);
/**
* The base implementation of `_.forOwn` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwn(object, iteratee) {
return object && baseFor(object, iteratee, keys);
}
/**
* The base implementation of `_.forOwnRight` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwnRight(object, iteratee) {
return object && baseForRight(object, iteratee, keys);
}
/**
* The base implementation of `_.functions` which creates an array of
* `object` function property names filtered from `props`.
*
* @private
* @param {Object} object The object to inspect.
* @param {Array} props The property names to filter.
* @returns {Array} Returns the function names.
*/
function baseFunctions(object, props) {
return arrayFilter(props, function(key) {
return isFunction(object[key]);
});
}
/**
* The base implementation of `_.get` without support for default values.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @returns {*} Returns the resolved value.
*/
function baseGet(object, path) {
path = castPath(path, object);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return (index && index == length) ? object : undefined;
}
/**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Function} keysFunc The function to get the keys of `object`.
* @param {Function} symbolsFunc The function to get the symbols of `object`.
* @returns {Array} Returns the array of property names and symbols.
*/
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value)
: objectToString(value);
}
/**
* The base implementation of `_.gt` which doesn't coerce arguments.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than `other`,
* else `false`.
*/
function baseGt(value, other) {
return value > other;
}
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
return object != null && hasOwnProperty.call(object, key);
}
/**
* The base implementation of `_.hasIn` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHasIn(object, key) {
return object != null && key in Object(object);
}
/**
* The base implementation of `_.inRange` which doesn't coerce arguments.
*
* @private
* @param {number} number The number to check.
* @param {number} start The start of the range.
* @param {number} end The end of the range.
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
*/
function baseInRange(number, start, end) {
return number >= nativeMin(start, end) && number < nativeMax(start, end);
}
/**
* The base implementation of methods like `_.intersection`, without support
* for iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of shared values.
*/
function baseIntersection(arrays, iteratee, comparator) {
var includes = comparator ? arrayIncludesWith : arrayIncludes,
length = arrays[0].length,
othLength = arrays.length,
othIndex = othLength,
caches = Array(othLength),
maxLength = Infinity,
result = [];
while (othIndex--) {
var array = arrays[othIndex];
if (othIndex && iteratee) {
array = arrayMap(array, baseUnary(iteratee));
}
maxLength = nativeMin(array.length, maxLength);
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
? new SetCache(othIndex && array)
: undefined;
}
array = arrays[0];
var index = -1,
seen = caches[0];
outer:
while (++index < length && result.length < maxLength) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (!(seen
? cacheHas(seen, computed)
: includes(result, computed, comparator)
)) {
othIndex = othLength;
while (--othIndex) {
var cache = caches[othIndex];
if (!(cache
? cacheHas(cache, computed)
: includes(arrays[othIndex], computed, comparator))
) {
continue outer;
}
}
if (seen) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.invert` and `_.invertBy` which inverts
* `object` with values transformed by `iteratee` and set by `setter`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform values.
* @param {Object} accumulator The initial inverted object.
* @returns {Function} Returns `accumulator`.
*/
function baseInverter(object, setter, iteratee, accumulator) {
baseForOwn(object, function(value, key, object) {
setter(accumulator, iteratee(value), key, object);
});
return accumulator;
}
/**
* The base implementation of `_.invoke` without support for individual
* method arguments.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {Array} args The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
*/
function baseInvoke(object, path, args) {
path = castPath(path, object);
object = parent(object, path);
var func = object == null ? object : object[toKey(last(path))];
return func == null ? undefined : apply(func, object, args);
}
/**
* The base implementation of `_.isArguments`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
*/
function baseIsArguments(value) {
return isObjectLike(value) && baseGetTag(value) == argsTag;
}
/**
* The base implementation of `_.isArrayBuffer` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
*/
function baseIsArrayBuffer(value) {
return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
}
/**
* The base implementation of `_.isDate` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a date object, else `false`.
*/
function baseIsDate(value) {
return isObjectLike(value) && baseGetTag(value) == dateTag;
}
/**
* The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {boolean} bitmask The bitmask flags.
* 1 - Unordered comparison
* 2 - Partial comparison
* @param {Function} [customizer] The function to customize comparisons.
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, bitmask, customizer, stack) {
if (value === other) {
return true;
}
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
}
/**
* A specialized version of `baseIsEqual` for arrays and objects which performs
* deep comparisons and tracks traversed objects enabling objects with circular
* references to be compared.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = objIsArr ? arrayTag : getTag(object),
othTag = othIsArr ? arrayTag : getTag(other);
objTag = objTag == argsTag ? objectTag : objTag;
othTag = othTag == argsTag ? objectTag : othTag;
var objIsObj = objTag == objectTag,
othIsObj = othTag == objectTag,
isSameTag = objTag == othTag;
if (isSameTag && isBuffer(object)) {
if (!isBuffer(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack);
return (objIsArr || isTypedArray(object))
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack);
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack);
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}
/**
* The base implementation of `_.isMap` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
*/
function baseIsMap(value) {
return isObjectLike(value) && getTag(value) == mapTag;
}
/**
* The base implementation of `_.isMatch` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Array} matchData The property names, values, and compare flags to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
*/
function baseIsMatch(object, source, matchData, customizer) {
var index = matchData.length,
length = index,
noCustomizer = !customizer;
if (object == null) {
return !length;
}
object = Object(object);
while (index--) {
var data = matchData[index];
if ((noCustomizer && data[2])
? data[1] !== object[data[0]]
: !(data[0] in object)
) {
return false;
}
}
while (++index < length) {
data = matchData[index];
var key = data[0],
objValue = object[key],
srcValue = data[1];
if (noCustomizer && data[2]) {
if (objValue === undefined && !(key in object)) {
return false;
}
} else {
var stack = new Stack;
if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === undefined
? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
: result
)) {
return false;
}
}
}
return true;
}
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.isRegExp` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
*/
function baseIsRegExp(value) {
return isObjectLike(value) && baseGetTag(value) == regexpTag;
}
/**
* The base implementation of `_.isSet` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
*/
function baseIsSet(value) {
return isObjectLike(value) && getTag(value) == setTag;
}
/**
* The base implementation of `_.isTypedArray` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
*/
function baseIsTypedArray(value) {
return isObjectLike(value) &&
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}
/**
* The base implementation of `_.iteratee`.
*
* @private
* @param {*} [value=_.identity] The value to convert to an iteratee.
* @returns {Function} Returns the iteratee.
*/
function baseIteratee(value) {
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
if (typeof value == 'function') {
return value;
}
if (value == null) {
return identity;
}
if (typeof value == 'object') {
return isArray(value)
? baseMatchesProperty(value[0], value[1])
: baseMatches(value);
}
return property(value);
}
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/**
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
if (!isObject(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object),
result = [];
for (var key in object) {
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
/**
* The base implementation of `_.lt` which doesn't coerce arguments.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than `other`,
* else `false`.
*/
function baseLt(value, other) {
return value < other;
}
/**
* The base implementation of `_.map` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function baseMap(collection, iteratee) {
var index = -1,
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value, key, collection) {
result[++index] = iteratee(value, key, collection);
});
return result;
}
/**
* The base implementation of `_.matches` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatches(source) {
var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
}
return function(object) {
return object === source || baseIsMatch(object, source, matchData);
};
}
/**
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatchesProperty(path, srcValue) {
if (isKey(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey(path), srcValue);
}
return function(object) {
var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue)
? hasIn(object, path)
: baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
/**
* The base implementation of `_.merge` without support for multiple sources.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {number} srcIndex The index of `source`.
* @param {Function} [customizer] The function to customize merged values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMerge(object, source, srcIndex, customizer, stack) {
if (object === source) {
return;
}
baseFor(source, function(srcValue, key) {
if (isObject(srcValue)) {
stack || (stack = new Stack);
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
}
else {
var newValue = customizer
? customizer(object[key], srcValue, (key + ''), object, source, stack)
: undefined;
if (newValue === undefined) {
newValue = srcValue;
}
assignMergeValue(object, key, newValue);
}
}, keysIn);
}
/**
* A specialized version of `baseMerge` for arrays and objects which performs
* deep merges and tracks traversed objects enabling objects with circular
* references to be merged.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {string} key The key of the value to merge.
* @param {number} srcIndex The index of `source`.
* @param {Function} mergeFunc The function to merge values.
* @param {Function} [customizer] The function to customize assigned values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = object[key],
srcValue = source[key],
stacked = stack.get(srcValue);
if (stacked) {
assignMergeValue(object, key, stacked);
return;
}
var newValue = customizer
? customizer(objValue, srcValue, (key + ''), object, source, stack)
: undefined;
var isCommon = newValue === undefined;
if (isCommon) {
var isArr = isArray(srcValue),
isBuff = !isArr && isBuffer(srcValue),
isTyped = !isArr && !isBuff && isTypedArray(srcValue);
newValue = srcValue;
if (isArr || isBuff || isTyped) {
if (isArray(objValue)) {
newValue = objValue;
}
else if (isArrayLikeObject(objValue)) {
newValue = copyArray(objValue);
}
else if (isBuff) {
isCommon = false;
newValue = cloneBuffer(srcValue, true);
}
else if (isTyped) {
isCommon = false;
newValue = cloneTypedArray(srcValue, true);
}
else {
newValue = [];
}
}
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
newValue = objValue;
if (isArguments(objValue)) {
newValue = toPlainObject(objValue);
}
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
newValue = initCloneObject(srcValue);
}
}
else {
isCommon = false;
}
}
if (isCommon) {
// Recursively merge objects and arrays (susceptible to call stack limits).
stack.set(srcValue, newValue);
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
stack['delete'](srcValue);
}
assignMergeValue(object, key, newValue);
}
/**
* The base implementation of `_.nth` which doesn't coerce arguments.
*
* @private
* @param {Array} array The array to query.
* @param {number} n The index of the element to return.
* @returns {*} Returns the nth element of `array`.
*/
function baseNth(array, n) {
var length = array.length;
if (!length) {
return;
}
n += n < 0 ? length : 0;
return isIndex(n, length) ? array[n] : undefined;
}
/**
* The base implementation of `_.orderBy` without param guards.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
* @param {string[]} orders The sort orders of `iteratees`.
* @returns {Array} Returns the new sorted array.
*/
function baseOrderBy(collection, iteratees, orders) {
var index = -1;
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
var result = baseMap(collection, function(value, key, collection) {
var criteria = arrayMap(iteratees, function(iteratee) {
return iteratee(value);
});
return { 'criteria': criteria, 'index': ++index, 'value': value };
});
return baseSortBy(result, function(object, other) {
return compareMultiple(object, other, orders);
});
}
/**
* The base implementation of `_.pick` without support for individual
* property identifiers.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @returns {Object} Returns the new object.
*/
function basePick(object, paths) {
return basePickBy(object, paths, function(value, path) {
return hasIn(object, path);
});
}
/**
* The base implementation of `_.pickBy` without support for iteratee shorthands.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @param {Function} predicate The function invoked per property.
* @returns {Object} Returns the new object.
*/
function basePickBy(object, paths, predicate) {
var index = -1,
length = paths.length,
result = {};
while (++index < length) {
var path = paths[index],
value = baseGet(object, path);
if (predicate(value, path)) {
baseSet(result, castPath(path, object), value);
}
}
return result;
}
/**
* A specialized version of `baseProperty` which supports deep paths.
*
* @private
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
return function(object) {
return baseGet(object, path);
};
}
/**
* The base implementation of `_.pullAllBy` without support for iteratee
* shorthands.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns `array`.
*/
function basePullAll(array, values, iteratee, comparator) {
var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
index = -1,
length = values.length,
seen = array;
if (array === values) {
values = copyArray(values);
}
if (iteratee) {
seen = arrayMap(array, baseUnary(iteratee));
}
while (++index < length) {
var fromIndex = 0,
value = values[index],
computed = iteratee ? iteratee(value) : value;
while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
if (seen !== array) {
splice.call(seen, fromIndex, 1);
}
splice.call(array, fromIndex, 1);
}
}
return array;
}
/**
* The base implementation of `_.pullAt` without support for individual
* indexes or capturing the removed elements.
*
* @private
* @param {Array} array The array to modify.
* @param {number[]} indexes The indexes of elements to remove.
* @returns {Array} Returns `array`.
*/
function basePullAt(array, indexes) {
var length = array ? indexes.length : 0,
lastIndex = length - 1;
while (length--) {
var index = indexes[length];
if (length == lastIndex || index !== previous) {
var previous = index;
if (isIndex(index)) {
splice.call(array, index, 1);
} else {
baseUnset(array, index);
}
}
}
return array;
}
/**
* The base implementation of `_.random` without support for returning
* floating-point numbers.
*
* @private
* @param {number} lower The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the random number.
*/
function baseRandom(lower, upper) {
return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
}
/**
* The base implementation of `_.range` and `_.rangeRight` which doesn't
* coerce arguments.
*
* @private
* @param {number} start The start of the range.
* @param {number} end The end of the range.
* @param {number} step The value to increment or decrement by.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Array} Returns the range of numbers.
*/
function baseRange(start, end, step, fromRight) {
var index = -1,
length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
result = Array(length);
while (length--) {
result[fromRight ? length : ++index] = start;
start += step;
}
return result;
}
/**
* The base implementation of `_.repeat` which doesn't coerce arguments.
*
* @private
* @param {string} string The string to repeat.
* @param {number} n The number of times to repeat the string.
* @returns {string} Returns the repeated string.
*/
function baseRepeat(string, n) {
var result = '';
if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
return result;
}
// Leverage the exponentiation by squaring algorithm for a faster repeat.
// See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
do {
if (n % 2) {
result += string;
}
n = nativeFloor(n / 2);
if (n) {
string += string;
}
} while (n);
return result;
}
/**
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
*/
function baseRest(func, start) {
return setToString(overRest(func, start, identity), func + '');
}
/**
* The base implementation of `_.sample`.
*
* @private
* @param {Array|Object} collection The collection to sample.
* @returns {*} Returns the random element.
*/
function baseSample(collection) {
return arraySample(values(collection));
}
/**
* The base implementation of `_.sampleSize` without param guards.
*
* @private
* @param {Array|Object} collection The collection to sample.
* @param {number} n The number of elements to sample.
* @returns {Array} Returns the random elements.
*/
function baseSampleSize(collection, n) {
var array = values(collection);
return shuffleSelf(array, baseClamp(n, 0, array.length));
}
/**
* The base implementation of `_.set`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseSet(object, path, value, customizer) {
if (!isObject(object)) {
return object;
}
path = castPath(path, object);
var index = -1,
length = path.length,
lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = toKey(path[index]),
newValue = value;
if (index != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
newValue = isObject(objValue)
? objValue
: (isIndex(path[index + 1]) ? [] : {});
}
}
assignValue(nested, key, newValue);
nested = nested[key];
}
return object;
}
/**
* The base implementation of `setData` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var baseSetData = !metaMap ? identity : function(func, data) {
metaMap.set(func, data);
return func;
};
/**
* The base implementation of `setToString` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var baseSetToString = !defineProperty ? identity : function(func, string) {
return defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
};
/**
* The base implementation of `_.shuffle`.
*
* @private
* @param {Array|Object} collection The collection to shuffle.
* @returns {Array} Returns the new shuffled array.
*/
function baseShuffle(collection) {
return shuffleSelf(values(collection));
}
/**
* The base implementation of `_.slice` without an iteratee call guard.
*
* @private
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function baseSlice(array, start, end) {
var index = -1,
length = array.length;
if (start < 0) {
start = -start > length ? 0 : (length + start);
}
end = end > length ? length : end;
if (end < 0) {
end += length;
}
length = start > end ? 0 : ((end - start) >>> 0);
start >>>= 0;
var result = Array(length);
while (++index < length) {
result[index] = array[index + start];
}
return result;
}
/**
* The base implementation of `_.some` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function baseSome(collection, predicate) {
var result;
baseEach(collection, function(value, index, collection) {
result = predicate(value, index, collection);
return !result;
});
return !!result;
}
/**
* The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
* performs a binary search of `array` to determine the index at which `value`
* should be inserted into `array` in order to maintain its sort order.
*
* @private
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {boolean} [retHighest] Specify returning the highest qualified index.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
*/
function baseSortedIndex(array, value, retHighest) {
var low = 0,
high = array == null ? low : array.length;
if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
while (low < high) {
var mid = (low + high) >>> 1,
computed = array[mid];
if (computed !== null && !isSymbol(computed) &&
(retHighest ? (computed <= value) : (computed < value))) {
low = mid + 1;
} else {
high = mid;
}
}
return high;
}
return baseSortedIndexBy(array, value, identity, retHighest);
}
/**
* The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
* which invokes `iteratee` for `value` and each element of `array` to compute
* their sort ranking. The iteratee is invoked with one argument; (value).
*
* @private
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} iteratee The iteratee invoked per element.
* @param {boolean} [retHighest] Specify returning the highest qualified index.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
*/
function baseSortedIndexBy(array, value, iteratee, retHighest) {
value = iteratee(value);
var low = 0,
high = array == null ? 0 : array.length,
valIsNaN = value !== value,
valIsNull = value === null,
valIsSymbol = isSymbol(value),
valIsUndefined = value === undefined;
while (low < high) {
var mid = nativeFloor((low + high) / 2),
computed = iteratee(array[mid]),
othIsDefined = computed !== undefined,
othIsNull = computed === null,
othIsReflexive = computed === computed,
othIsSymbol = isSymbol(computed);
if (valIsNaN) {
var setLow = retHighest || othIsReflexive;
} else if (valIsUndefined) {
setLow = othIsReflexive && (retHighest || othIsDefined);
} else if (valIsNull) {
setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
} else if (valIsSymbol) {
setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
} else if (othIsNull || othIsSymbol) {
setLow = false;
} else {
setLow = retHighest ? (computed <= value) : (computed < value);
}
if (setLow) {
low = mid + 1;
} else {
high = mid;
}
}
return nativeMin(high, MAX_ARRAY_INDEX);
}
/**
* The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseSortedUniq(array, iteratee) {
var index = -1,
length = array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
if (!index || !eq(computed, seen)) {
var seen = computed;
result[resIndex++] = value === 0 ? 0 : value;
}
}
return result;
}
/**
* The base implementation of `_.toNumber` which doesn't ensure correct
* conversions of binary, hexadecimal, or octal string values.
*
* @private
* @param {*} value The value to process.
* @returns {number} Returns the number.
*/
function baseToNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
return +value;
}
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return arrayMap(value, baseToString) + '';
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseUniq(array, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
length = array.length,
isCommon = true,
result = [],
seen = result;
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
}
else if (length >= LARGE_ARRAY_SIZE) {
var set = iteratee ? null : createSet(array);
if (set) {
return setToArray(set);
}
isCommon = false;
includes = cacheHas;
seen = new SetCache;
}
else {
seen = iteratee ? [] : result;
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The property path to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = castPath(path, object);
object = parent(object, path);
return object == null || delete object[toKey(last(path))];
}
/**
* The base implementation of `_.update`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to update.
* @param {Function} updater The function to produce the updated value.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseUpdate(object, path, updater, customizer) {
return baseSet(object, path, updater(baseGet(object, path)), customizer);
}
/**
* The base implementation of methods like `_.dropWhile` and `_.takeWhile`
* without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to query.
* @param {Function} predicate The function invoked per iteration.
* @param {boolean} [isDrop] Specify dropping elements instead of taking them.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Array} Returns the slice of `array`.
*/
function baseWhile(array, predicate, isDrop, fromRight) {
var length = array.length,
index = fromRight ? length : -1;
while ((fromRight ? index-- : ++index < length) &&
predicate(array[index], index, array)) {}
return isDrop
? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
: baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
}
/**
* The base implementation of `wrapperValue` which returns the result of
* performing a sequence of actions on the unwrapped `value`, where each
* successive action is supplied the return value of the previous.
*
* @private
* @param {*} value The unwrapped value.
* @param {Array} actions Actions to perform to resolve the unwrapped value.
* @returns {*} Returns the resolved value.
*/
function baseWrapperValue(value, actions) {
var result = value;
if (result instanceof LazyWrapper) {
result = result.value();
}
return arrayReduce(actions, function(result, action) {
return action.func.apply(action.thisArg, arrayPush([result], action.args));
}, result);
}
/**
* The base implementation of methods like `_.xor`, without support for
* iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of values.
*/
function baseXor(arrays, iteratee, comparator) {
var length = arrays.length;
if (length < 2) {
return length ? baseUniq(arrays[0]) : [];
}
var index = -1,
result = Array(length);
while (++index < length) {
var array = arrays[index],
othIndex = -1;
while (++othIndex < length) {
if (othIndex != index) {
result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
}
}
}
return baseUniq(baseFlatten(result, 1), iteratee, comparator);
}
/**
* This base implementation of `_.zipObject` which assigns values using `assignFunc`.
*
* @private
* @param {Array} props The property identifiers.
* @param {Array} values The property values.
* @param {Function} assignFunc The function to assign values.
* @returns {Object} Returns the new object.
*/
function baseZipObject(props, values, assignFunc) {
var index = -1,
length = props.length,
valsLength = values.length,
result = {};
while (++index < length) {
var value = index < valsLength ? values[index] : undefined;
assignFunc(result, props[index], value);
}
return result;
}
/**
* Casts `value` to an empty array if it's not an array like object.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array|Object} Returns the cast array-like object.
*/
function castArrayLikeObject(value) {
return isArrayLikeObject(value) ? value : [];
}
/**
* Casts `value` to `identity` if it's not a function.
*
* @private
* @param {*} value The value to inspect.
* @returns {Function} Returns cast function.
*/
function castFunction(value) {
return typeof value == 'function' ? value : identity;
}
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @param {Object} [object] The object to query keys on.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value, object) {
if (isArray(value)) {
return value;
}
return isKey(value, object) ? [value] : stringToPath(toString(value));
}
/**
* A `baseRest` alias which can be replaced with `identity` by module
* replacement plugins.
*
* @private
* @type {Function}
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
var castRest = baseRest;
/**
* Casts `array` to a slice if it's needed.
*
* @private
* @param {Array} array The array to inspect.
* @param {number} start The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the cast slice.
*/
function castSlice(array, start, end) {
var length = array.length;
end = end === undefined ? length : end;
return (!start && end >= length) ? array : baseSlice(array, start, end);
}
/**
* A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
*
* @private
* @param {number|Object} id The timer id or timeout object of the timer to clear.
*/
var clearTimeout = ctxClearTimeout || function(id) {
return root.clearTimeout(id);
};
/**
* Creates a clone of `buffer`.
*
* @private
* @param {Buffer} buffer The buffer to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Buffer} Returns the cloned buffer.
*/
function cloneBuffer(buffer, isDeep) {
if (isDeep) {
return buffer.slice();
}
var length = buffer.length,
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
buffer.copy(result);
return result;
}
/**
* Creates a clone of `arrayBuffer`.
*
* @private
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
* @returns {ArrayBuffer} Returns the cloned array buffer.
*/
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
return result;
}
/**
* Creates a clone of `dataView`.
*
* @private
* @param {Object} dataView The data view to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned data view.
*/
function cloneDataView(dataView, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}
/**
* Creates a clone of `map`.
*
* @private
* @param {Object} map The map to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned map.
*/
function cloneMap(map, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
return arrayReduce(array, addMapEntry, new map.constructor);
}
/**
* Creates a clone of `regexp`.
*
* @private
* @param {Object} regexp The regexp to clone.
* @returns {Object} Returns the cloned regexp.
*/
function cloneRegExp(regexp) {
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
result.lastIndex = regexp.lastIndex;
return result;
}
/**
* Creates a clone of `set`.
*
* @private
* @param {Object} set The set to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned set.
*/
function cloneSet(set, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);
return arrayReduce(array, addSetEntry, new set.constructor);
}
/**
* Creates a clone of the `symbol` object.
*
* @private
* @param {Object} symbol The symbol object to clone.
* @returns {Object} Returns the cloned symbol object.
*/
function cloneSymbol(symbol) {
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
}
/**
* Creates a clone of `typedArray`.
*
* @private
* @param {Object} typedArray The typed array to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned typed array.
*/
function cloneTypedArray(typedArray, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
/**
* Compares values to sort them in ascending order.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {number} Returns the sort order indicator for `value`.
*/
function compareAscending(value, other) {
if (value !== other) {
var valIsDefined = value !== undefined,
valIsNull = value === null,
valIsReflexive = value === value,
valIsSymbol = isSymbol(value);
var othIsDefined = other !== undefined,
othIsNull = other === null,
othIsReflexive = other === other,
othIsSymbol = isSymbol(other);
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
(valIsNull && othIsDefined && othIsReflexive) ||
(!valIsDefined && othIsReflexive) ||
!valIsReflexive) {
return 1;
}
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
(othIsNull && valIsDefined && valIsReflexive) ||
(!othIsDefined && valIsReflexive) ||
!othIsReflexive) {
return -1;
}
}
return 0;
}
/**
* Used by `_.orderBy` to compare multiple properties of a value to another
* and stable sort them.
*
* If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
* specify an order of "desc" for descending or "asc" for ascending sort order
* of corresponding values.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {boolean[]|string[]} orders The order to sort by for each property.
* @returns {number} Returns the sort order indicator for `object`.
*/
function compareMultiple(object, other, orders) {
var index = -1,
objCriteria = object.criteria,
othCriteria = other.criteria,
length = objCriteria.length,
ordersLength = orders.length;
while (++index < length) {
var result = compareAscending(objCriteria[index], othCriteria[index]);
if (result) {
if (index >= ordersLength) {
return result;
}
var order = orders[index];
return result * (order == 'desc' ? -1 : 1);
}
}
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
// that causes it, under certain circumstances, to provide the same value for
// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
// for more details.
//
// This also ensures a stable sort in V8 and other engines.
// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
return object.index - other.index;
}
/**
* Creates an array that is the composition of partially applied arguments,
* placeholders, and provided arguments into a single array of arguments.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to prepend to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgs(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersLength = holders.length,
leftIndex = -1,
leftLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(leftLength + rangeLength),
isUncurried = !isCurried;
while (++leftIndex < leftLength) {
result[leftIndex] = partials[leftIndex];
}
while (++argsIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[holders[argsIndex]] = args[argsIndex];
}
}
while (rangeLength--) {
result[leftIndex++] = args[argsIndex++];
}
return result;
}
/**
* This function is like `composeArgs` except that the arguments composition
* is tailored for `_.partialRight`.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to append to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgsRight(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersIndex = -1,
holdersLength = holders.length,
rightIndex = -1,
rightLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(rangeLength + rightLength),
isUncurried = !isCurried;
while (++argsIndex < rangeLength) {
result[argsIndex] = args[argsIndex];
}
var offset = argsIndex;
while (++rightIndex < rightLength) {
result[offset + rightIndex] = partials[rightIndex];
}
while (++holdersIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[offset + holders[holdersIndex]] = args[argsIndex++];
}
}
return result;
}
/**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.
*/
function copyArray(source, array) {
var index = -1,
length = source.length;
array || (array = Array(length));
while (++index < length) {
array[index] = source[index];
}
return array;
}
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`.
*/
function copyObject(source, props, object, customizer) {
var isNew = !object;
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer
? customizer(object[key], source[key], key, object, source)
: undefined;
if (newValue === undefined) {
newValue = source[key];
}
if (isNew) {
baseAssignValue(object, key, newValue);
} else {
assignValue(object, key, newValue);
}
}
return object;
}
/**
* Copies own symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbols(source, object) {
return copyObject(source, getSymbols(source), object);
}
/**
* Copies own and inherited symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbolsIn(source, object) {
return copyObject(source, getSymbolsIn(source), object);
}
/**
* Creates a function like `_.groupBy`.
*
* @private
* @param {Function} setter The function to set accumulator values.
* @param {Function} [initializer] The accumulator object initializer.
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter, initializer) {
return function(collection, iteratee) {
var func = isArray(collection) ? arrayAggregator : baseAggregator,
accumulator = initializer ? initializer() : {};
return func(collection, setter, getIteratee(iteratee, 2), accumulator);
};
}
/**
* Creates a function like `_.assign`.
*
* @private
* @param {Function} assigner The function to assign values.
* @returns {Function} Returns the new assigner function.
*/
function createAssigner(assigner) {
return baseRest(function(object, sources) {
var index = -1,
length = sources.length,
customizer = length > 1 ? sources[length - 1] : undefined,
guard = length > 2 ? sources[2] : undefined;
customizer = (assigner.length > 3 && typeof customizer == 'function')
? (length--, customizer)
: undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer;
length = 1;
}
object = Object(object);
while (++index < length) {
var source = sources[index];
if (source) {
assigner(object, source, index, customizer);
}
}
return object;
});
}
/**
* Creates a `baseEach` or `baseEachRight` function.
*
* @private
* @param {Function} eachFunc The function to iterate over a collection.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseEach(eachFunc, fromRight) {
return function(collection, iteratee) {
if (collection == null) {
return collection;
}
if (!isArrayLike(collection)) {
return eachFunc(collection, iteratee);
}
var length = collection.length,
index = fromRight ? length : -1,
iterable = Object(collection);
while ((fromRight ? index-- : ++index < length)) {
if (iteratee(iterable[index], index, iterable) === false) {
break;
}
}
return collection;
};
}
/**
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseFor(fromRight) {
return function(object, iteratee, keysFunc) {
var index = -1,
iterable = Object(object),
props = keysFunc(object),
length = props.length;
while (length--) {
var key = props[fromRight ? length : ++index];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object;
};
}
/**
* Creates a function that wraps `func` to invoke it with the optional `this`
* binding of `thisArg`.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createBind(func, bitmask, thisArg) {
var isBind = bitmask & WRAP_BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return fn.apply(isBind ? thisArg : this, arguments);
}
return wrapper;
}
/**
* Creates a function like `_.lowerFirst`.
*
* @private
* @param {string} methodName The name of the `String` case method to use.
* @returns {Function} Returns the new case function.
*/
function createCaseFirst(methodName) {
return function(string) {
string = toString(string);
var strSymbols = hasUnicode(string)
? stringToArray(string)
: undefined;
var chr = strSymbols
? strSymbols[0]
: string.charAt(0);
var trailing = strSymbols
? castSlice(strSymbols, 1).join('')
: string.slice(1);
return chr[methodName]() + trailing;
};
}
/**
* Creates a function like `_.camelCase`.
*
* @private
* @param {Function} callback The function to combine each word.
* @returns {Function} Returns the new compounder function.
*/
function createCompounder(callback) {
return function(string) {
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
};
}
/**
* Creates a function that produces an instance of `Ctor` regardless of
* whether it was invoked as part of a `new` expression or by `call` or `apply`.
*
* @private
* @param {Function} Ctor The constructor to wrap.
* @returns {Function} Returns the new wrapped function.
*/
function createCtor(Ctor) {
return function() {
// Use a `switch` statement to work with class constructors. See
// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
// for more details.
var args = arguments;
switch (args.length) {
case 0: return new Ctor;
case 1: return new Ctor(args[0]);
case 2: return new Ctor(args[0], args[1]);
case 3: return new Ctor(args[0], args[1], args[2]);
case 4: return new Ctor(args[0], args[1], args[2], args[3]);
case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
}
var thisBinding = baseCreate(Ctor.prototype),
result = Ctor.apply(thisBinding, args);
// Mimic the constructor's `return` behavior.
// See https://es5.github.io/#x13.2.2 for more details.
return isObject(result) ? result : thisBinding;
};
}
/**
* Creates a function that wraps `func` to enable currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {number} arity The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createCurry(func, bitmask, arity) {
var Ctor = createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length,
placeholder = getHolder(wrapper);
while (index--) {
args[index] = arguments[index];
}
var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
? []
: replaceHolders(args, placeholder);
length -= holders.length;
if (length < arity) {
return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, undefined,
args, holders, undefined, undefined, arity - length);
}
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return apply(fn, this, args);
}
return wrapper;
}
/**
* Creates a `_.find` or `_.findLast` function.
*
* @private
* @param {Function} findIndexFunc The function to find the collection index.
* @returns {Function} Returns the new find function.
*/
function createFind(findIndexFunc) {
return function(collection, predicate, fromIndex) {
var iterable = Object(collection);
if (!isArrayLike(collection)) {
var iteratee = getIteratee(predicate, 3);
collection = keys(collection);
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
}
var index = findIndexFunc(collection, predicate, fromIndex);
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
};
}
/**
* Creates a `_.flow` or `_.flowRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new flow function.
*/
function createFlow(fromRight) {
return flatRest(function(funcs) {
var length = funcs.length,
index = length,
prereq = LodashWrapper.prototype.thru;
if (fromRight) {
funcs.reverse();
}
while (index--) {
var func = funcs[index];
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
var wrapper = new LodashWrapper([], true);
}
}
index = wrapper ? index : length;
while (++index < length) {
func = funcs[index];
var funcName = getFuncName(func),
data = funcName == 'wrapper' ? getData(func) : undefined;
if (data && isLaziable(data[0]) &&
data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
!data[4].length && data[9] == 1
) {
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
} else {
wrapper = (func.length == 1 && isLaziable(func))
? wrapper[funcName]()
: wrapper.thru(func);
}
}
return function() {
var args = arguments,
value = args[0];
if (wrapper && args.length == 1 && isArray(value)) {
return wrapper.plant(value).value();
}
var index = 0,
result = length ? funcs[index].apply(this, args) : value;
while (++index < length) {
result = funcs[index].call(this, result);
}
return result;
};
});
}
/**
* Creates a function that wraps `func` to invoke it with optional `this`
* binding of `thisArg`, partial application, and currying.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [partialsRight] The arguments to append to those provided
* to the new function.
* @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
var isAry = bitmask & WRAP_ARY_FLAG,
isBind = bitmask & WRAP_BIND_FLAG,
isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
isFlip = bitmask & WRAP_FLIP_FLAG,
Ctor = isBindKey ? undefined : createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length;
while (index--) {
args[index] = arguments[index];
}
if (isCurried) {
var placeholder = getHolder(wrapper),
holdersCount = countHolders(args, placeholder);
}
if (partials) {
args = composeArgs(args, partials, holders, isCurried);
}
if (partialsRight) {
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
}
length -= holdersCount;
if (isCurried && length < arity) {
var newHolders = replaceHolders(args, placeholder);
return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, thisArg,
args, newHolders, argPos, ary, arity - length
);
}
var thisBinding = isBind ? thisArg : this,
fn = isBindKey ? thisBinding[func] : func;
length = args.length;
if (argPos) {
args = reorder(args, argPos);
} else if (isFlip && length > 1) {
args.reverse();
}
if (isAry && ary < length) {
args.length = ary;
}
if (this && this !== root && this instanceof wrapper) {
fn = Ctor || createCtor(fn);
}
return fn.apply(thisBinding, args);
}
return wrapper;
}
/**
* Creates a function like `_.invertBy`.
*
* @private
* @param {Function} setter The function to set accumulator values.
* @param {Function} toIteratee The function to resolve iteratees.
* @returns {Function} Returns the new inverter function.
*/
function createInverter(setter, toIteratee) {
return function(object, iteratee) {
return baseInverter(object, setter, toIteratee(iteratee), {});
};
}
/**
* Creates a function that performs a mathematical operation on two values.
*
* @private
* @param {Function} operator The function to perform the operation.
* @param {number} [defaultValue] The value used for `undefined` arguments.
* @returns {Function} Returns the new mathematical operation function.
*/
function createMathOperation(operator, defaultValue) {
return function(value, other) {
var result;
if (value === undefined && other === undefined) {
return defaultValue;
}
if (value !== undefined) {
result = value;
}
if (other !== undefined) {
if (result === undefined) {
return other;
}
if (typeof value == 'string' || typeof other == 'string') {
value = baseToString(value);
other = baseToString(other);
} else {
value = baseToNumber(value);
other = baseToNumber(other);
}
result = operator(value, other);
}
return result;
};
}
/**
* Creates a function like `_.over`.
*
* @private
* @param {Function} arrayFunc The function to iterate over iteratees.
* @returns {Function} Returns the new over function.
*/
function createOver(arrayFunc) {
return flatRest(function(iteratees) {
iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
return baseRest(function(args) {
var thisArg = this;
return arrayFunc(iteratees, function(iteratee) {
return apply(iteratee, thisArg, args);
});
});
});
}
/**
* Creates the padding for `string` based on `length`. The `chars` string
* is truncated if the number of characters exceeds `length`.
*
* @private
* @param {number} length The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padding for `string`.
*/
function createPadding(length, chars) {
chars = chars === undefined ? ' ' : baseToString(chars);
var charsLength = chars.length;
if (charsLength < 2) {
return charsLength ? baseRepeat(chars, length) : chars;
}
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
return hasUnicode(chars)
? castSlice(stringToArray(result), 0, length).join('')
: result.slice(0, length);
}
/**
* Creates a function that wraps `func` to invoke it with the `this` binding
* of `thisArg` and `partials` prepended to the arguments it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} partials The arguments to prepend to those provided to
* the new function.
* @returns {Function} Returns the new wrapped function.
*/
function createPartial(func, bitmask, thisArg, partials) {
var isBind = bitmask & WRAP_BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var argsIndex = -1,
argsLength = arguments.length,
leftIndex = -1,
leftLength = partials.length,
args = Array(leftLength + argsLength),
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
while (++leftIndex < leftLength) {
args[leftIndex] = partials[leftIndex];
}
while (argsLength--) {
args[leftIndex++] = arguments[++argsIndex];
}
return apply(fn, isBind ? thisArg : this, args);
}
return wrapper;
}
/**
* Creates a `_.range` or `_.rangeRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new range function.
*/
function createRange(fromRight) {
return function(start, end, step) {
if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
end = step = undefined;
}
// Ensure the sign of `-0` is preserved.
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toFinite(end);
}
step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
return baseRange(start, end, step, fromRight);
};
}
/**
* Creates a function that performs a relational operation on two values.
*
* @private
* @param {Function} operator The function to perform the operation.
* @returns {Function} Returns the new relational operation function.
*/
function createRelationalOperation(operator) {
return function(value, other) {
if (!(typeof value == 'string' && typeof other == 'string')) {
value = toNumber(value);
other = toNumber(other);
}
return operator(value, other);
};
}
/**
* Creates a function that wraps `func` to continue currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {Function} wrapFunc The function to create the `func` wrapper.
* @param {*} placeholder The placeholder value.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
var isCurry = bitmask & WRAP_CURRY_FLAG,
newHolders = isCurry ? holders : undefined,
newHoldersRight = isCurry ? undefined : holders,
newPartials = isCurry ? partials : undefined,
newPartialsRight = isCurry ? undefined : partials;
bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
}
var newData = [
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
newHoldersRight, argPos, ary, arity
];
var result = wrapFunc.apply(undefined, newData);
if (isLaziable(func)) {
setData(result, newData);
}
result.placeholder = placeholder;
return setWrapToString(result, func, bitmask);
}
/**
* Creates a function like `_.round`.
*
* @private
* @param {string} methodName The name of the `Math` method to use when rounding.
* @returns {Function} Returns the new round function.
*/
function createRound(methodName) {
var func = Math[methodName];
return function(number, precision) {
number = toNumber(number);
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
if (precision) {
// Shift with exponential notation to avoid floating-point issues.
// See [MDN](https://mdn.io/round#Examples) for more details.
var pair = (toString(number) + 'e').split('e'),
value = func(pair[0] + 'e' + (+pair[1] + precision));
pair = (toString(value) + 'e').split('e');
return +(pair[0] + 'e' + (+pair[1] - precision));
}
return func(number);
};
}
/**
* Creates a set object of `values`.
*
* @private
* @param {Array} values The values to add to the set.
* @returns {Object} Returns the new set.
*/
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
return new Set(values);
};
/**
* Creates a `_.toPairs` or `_.toPairsIn` function.
*
* @private
* @param {Function} keysFunc The function to get the keys of a given object.
* @returns {Function} Returns the new pairs function.
*/
function createToPairs(keysFunc) {
return function(object) {
var tag = getTag(object);
if (tag == mapTag) {
return mapToArray(object);
}
if (tag == setTag) {
return setToPairs(object);
}
return baseToPairs(object, keysFunc(object));
};
}
/**
* Creates a function that either curries or invokes `func` with optional
* `this` binding and partially applied arguments.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags.
* 1 - `_.bind`
* 2 - `_.bindKey`
* 4 - `_.curry` or `_.curryRight` of a bound function
* 8 - `_.curry`
* 16 - `_.curryRight`
* 32 - `_.partial`
* 64 - `_.partialRight`
* 128 - `_.rearg`
* 256 - `_.ary`
* 512 - `_.flip`
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to be partially applied.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
if (!isBindKey && typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
var length = partials ? partials.length : 0;
if (!length) {
bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
partials = holders = undefined;
}
ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
arity = arity === undefined ? arity : toInteger(arity);
length -= holders ? holders.length : 0;
if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
var partialsRight = partials,
holdersRight = holders;
partials = holders = undefined;
}
var data = isBindKey ? undefined : getData(func);
var newData = [
func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
argPos, ary, arity
];
if (data) {
mergeData(newData, data);
}
func = newData[0];
bitmask = newData[1];
thisArg = newData[2];
partials = newData[3];
holders = newData[4];
arity = newData[9] = newData[9] === undefined
? (isBindKey ? 0 : func.length)
: nativeMax(newData[9] - length, 0);
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
}
if (!bitmask || bitmask == WRAP_BIND_FLAG) {
var result = createBind(func, bitmask, thisArg);
} else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
result = createCurry(func, bitmask, arity);
} else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
result = createPartial(func, bitmask, thisArg, partials);
} else {
result = createHybrid.apply(undefined, newData);
}
var setter = data ? baseSetData : setData;
return setWrapToString(setter(result, newData), func, bitmask);
}
/**
* Used by `_.defaults` to customize its `_.assignIn` use to assign properties
* of source objects to the destination object for all destination properties
* that resolve to `undefined`.
*
* @private
* @param {*} objValue The destination value.
* @param {*} srcValue The source value.
* @param {string} key The key of the property to assign.
* @param {Object} object The parent object of `objValue`.
* @returns {*} Returns the value to assign.
*/
function customDefaultsAssignIn(objValue, srcValue, key, object) {
if (objValue === undefined ||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
return srcValue;
}
return objValue;
}
/**
* Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
* objects into destination objects that are passed thru.
*
* @private
* @param {*} objValue The destination value.
* @param {*} srcValue The source value.
* @param {string} key The key of the property to merge.
* @param {Object} object The parent object of `objValue`.
* @param {Object} source The parent object of `srcValue`.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
* @returns {*} Returns the value to assign.
*/
function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
if (isObject(objValue) && isObject(srcValue)) {
// Recursively merge objects and arrays (susceptible to call stack limits).
stack.set(srcValue, objValue);
baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
stack['delete'](srcValue);
}
return objValue;
}
/**
* Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
* objects.
*
* @private
* @param {*} value The value to inspect.
* @param {string} key The key of the property to inspect.
* @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
*/
function customOmitClone(value) {
return isPlainObject(value) ? undefined : value;
}
/**
* A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons.
*
* @private
* @param {Array} array The array to compare.
* @param {Array} other The other array to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `array` and `other` objects.
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
*/
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
arrLength = array.length,
othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(array);
if (stacked && stack.get(other)) {
return stacked == other;
}
var index = -1,
result = true,
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
stack.set(array, other);
stack.set(other, array);
// Ignore non-index properties.
while (++index < arrLength) {
var arrValue = array[index],
othValue = other[index];
if (customizer) {
var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack);
}
if (compared !== undefined) {
if (compared) {
continue;
}
result = false;
break;
}
// Recursively compare arrays (susceptible to call stack limits).
if (seen) {
if (!arraySome(other, function(othValue, othIndex) {
if (!cacheHas(seen, othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
return seen.push(othIndex);
}
})) {
result = false;
break;
}
} else if (!(
arrValue === othValue ||
equalFunc(arrValue, othValue, bitmask, customizer, stack)
)) {
result = false;
break;
}
}
stack['delete'](array);
stack['delete'](other);
return result;
}
/**
* A specialized version of `baseIsEqualDeep` for comparing objects of
* the same `toStringTag`.
*
* **Note:** This function only supports comparing values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag:
if ((object.byteLength != other.byteLength) ||
(object.byteOffset != other.byteOffset)) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag:
if ((object.byteLength != other.byteLength) ||
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
// Coerce booleans to `1` or `0` and dates to milliseconds.
// Invalid dates are coerced to `NaN`.
return eq(+object, +other);
case errorTag:
return object.name == other.name && object.message == other.message;
case regexpTag:
case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details.
return object == (other + '');
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
convert || (convert = setToArray);
if (object.size != other.size && !isPartial) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG;
// Recursively compare objects (susceptible to call stack limits).
stack.set(object, other);
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
stack['delete'](object);
return result;
case symbolTag:
if (symbolValueOf) {
return symbolValueOf.call(object) == symbolValueOf.call(other);
}
}
return false;
}
/**
* A specialized version of `baseIsEqualDeep` for objects with support for
* partial deep comparisons.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
objProps = getAllKeys(object),
objLength = objProps.length,
othProps = getAllKeys(other),
othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false;
}
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked && stack.get(other)) {
return stacked == other;
}
var result = true;
stack.set(object, other);
stack.set(other, object);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object[key],
othValue = other[key];
if (customizer) {
var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack);
}
// Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
: compared
)) {
result = false;
break;
}
skipCtor || (skipCtor = key == 'constructor');
}
if (result && !skipCtor) {
var objCtor = object.constructor,
othCtor = other.constructor;
// Non `Object` object instances with different constructors are not equal.
if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false;
}
}
stack['delete'](object);
stack['delete'](other);
return result;
}
/**
* A specialized version of `baseRest` which flattens the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
function flatRest(func) {
return setToString(overRest(func, undefined, flatten), func + '');
}
/**
* Creates an array of own enumerable property names and symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols);
}
/**
* Creates an array of own and inherited enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeysIn(object) {
return baseGetAllKeys(object, keysIn, getSymbolsIn);
}
/**
* Gets metadata for `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {*} Returns the metadata for `func`.
*/
var getData = !metaMap ? noop : function(func) {
return metaMap.get(func);
};
/**
* Gets the name of `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {string} Returns the function name.
*/
function getFuncName(func) {
var result = (func.name + ''),
array = realNames[result],
length = hasOwnProperty.call(realNames, result) ? array.length : 0;
while (length--) {
var data = array[length],
otherFunc = data.func;
if (otherFunc == null || otherFunc == func) {
return data.name;
}
}
return result;
}
/**
* Gets the argument placeholder value for `func`.
*
* @private
* @param {Function} func The function to inspect.
* @returns {*} Returns the placeholder value.
*/
function getHolder(func) {
var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
return object.placeholder;
}
/**
* Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
* this function returns the custom method, otherwise it returns `baseIteratee`.
* If arguments are provided, the chosen function is invoked with them and
* its result is returned.
*
* @private
* @param {*} [value] The value to convert to an iteratee.
* @param {number} [arity] The arity of the created iteratee.
* @returns {Function} Returns the chosen function or its result.
*/
function getIteratee() {
var result = lodash.iteratee || iteratee;
result = result === iteratee ? baseIteratee : result;
return arguments.length ? result(arguments[0], arguments[1]) : result;
}
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
/**
* Gets the property names, values, and compare flags of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the match data of `object`.
*/
function getMatchData(object) {
var result = keys(object),
length = result.length;
while (length--) {
var key = result[length],
value = object[key];
result[length] = [key, value, isStrictComparable(value)];
}
return result;
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
/**
* Creates an array of the own enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
if (object == null) {
return [];
}
object = Object(object);
return arrayFilter(nativeGetSymbols(object), function(symbol) {
return propertyIsEnumerable.call(object, symbol);
});
};
/**
* Creates an array of the own and inherited enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) ||
(Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
getTag = function(value) {
var result = baseGetTag(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : '';
if (ctorString) {
switch (ctorString) {
case dataViewCtorString: return dataViewTag;
case mapCtorString: return mapTag;
case promiseCtorString: return promiseTag;
case setCtorString: return setTag;
case weakMapCtorString: return weakMapTag;
}
}
return result;
};
}
/**
* Gets the view, applying any `transforms` to the `start` and `end` positions.
*
* @private
* @param {number} start The start of the view.
* @param {number} end The end of the view.
* @param {Array} transforms The transformations to apply to the view.
* @returns {Object} Returns an object containing the `start` and `end`
* positions of the view.
*/
function getView(start, end, transforms) {
var index = -1,
length = transforms.length;
while (++index < length) {
var data = transforms[index],
size = data.size;
switch (data.type) {
case 'drop': start += size; break;
case 'dropRight': end -= size; break;
case 'take': end = nativeMin(end, start + size); break;
case 'takeRight': start = nativeMax(start, end - size); break;
}
}
return { 'start': start, 'end': end };
}
/**
* Extracts wrapper details from the `source` body comment.
*
* @private
* @param {string} source The source to inspect.
* @returns {Array} Returns the wrapper details.
*/
function getWrapDetails(source) {
var match = source.match(reWrapDetails);
return match ? match[1].split(reSplitDetails) : [];
}
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
path = castPath(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result || ++index != length) {
return result;
}
length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isArguments(object));
}
/**
* Initializes an array clone.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the initialized clone.
*/
function initCloneArray(array) {
var length = array.length,
result = array.constructor(length);
// Add properties assigned by `RegExp#exec`.
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
result.index = array.index;
result.input = array.input;
}
return result;
}
/**
* Initializes an object clone.
*
* @private
* @param {Object} object The object to clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototype(object))
: {};
}
/**
* Initializes an object clone based on its `toStringTag`.
*
* **Note:** This function only supports cloning values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to clone.
* @param {string} tag The `toStringTag` of the object to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneByTag(object, tag, cloneFunc, isDeep) {
var Ctor = object.constructor;
switch (tag) {
case arrayBufferTag:
return cloneArrayBuffer(object);
case boolTag:
case dateTag:
return new Ctor(+object);
case dataViewTag:
return cloneDataView(object, isDeep);
case float32Tag: case float64Tag:
case int8Tag: case int16Tag: case int32Tag:
case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
return cloneTypedArray(object, isDeep);
case mapTag:
return cloneMap(object, isDeep, cloneFunc);
case numberTag:
case stringTag:
return new Ctor(object);
case regexpTag:
return cloneRegExp(object);
case setTag:
return cloneSet(object, isDeep, cloneFunc);
case symbolTag:
return cloneSymbol(object);
}
}
/**
* Inserts wrapper `details` in a comment at the top of the `source` body.
*
* @private
* @param {string} source The source to modify.
* @returns {Array} details The details to insert.
* @returns {string} Returns the modified source.
*/
function insertWrapDetails(source, details) {
var length = details.length;
if (!length) {
return source;
}
var lastIndex = length - 1;
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
details = details.join(length > 2 ? ', ' : ' ');
return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
}
/**
* Checks if `value` is a flattenable `arguments` object or array.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
*/
function isFlattenable(value) {
return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol]);
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
}
/**
* Checks if the given arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
* else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)
) {
return eq(object[index], value);
}
return false;
}
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object));
}
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
/**
* Checks if `func` has a lazy counterpart.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` has a lazy counterpart,
* else `false`.
*/
function isLaziable(func) {
var funcName = getFuncName(func),
other = lodash[funcName];
if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
return false;
}
if (func === other) {
return true;
}
var data = getData(other);
return !!data && func === data[0];
}
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
/**
* Checks if `func` is capable of being masked.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `func` is maskable, else `false`.
*/
var isMaskable = coreJsData ? isFunction : stubFalse;
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
/**
* A specialized version of `matchesProperty` for source values suitable
* for strict equality comparisons, i.e. `===`.
*
* @private
* @param {string} key The key of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function matchesStrictComparable(key, srcValue) {
return function(object) {
if (object == null) {
return false;
}
return object[key] === srcValue &&
(srcValue !== undefined || (key in Object(object)));
};
}
/**
* A specialized version of `_.memoize` which clears the memoized function's
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
*
* @private
* @param {Function} func The function to have its output memoized.
* @returns {Function} Returns the new memoized function.
*/
function memoizeCapped(func) {
var result = memoize(func, function(key) {
if (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
return key;
});
var cache = result.cache;
return result;
}
/**
* Merges the function metadata of `source` into `data`.
*
* Merging metadata reduces the number of wrappers used to invoke a function.
* This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
* may be applied regardless of execution order. Methods like `_.ary` and
* `_.rearg` modify function arguments, making the order in which they are
* executed important, preventing the merging of metadata. However, we make
* an exception for a safe combined case where curried functions have `_.ary`
* and or `_.rearg` applied.
*
* @private
* @param {Array} data The destination metadata.
* @param {Array} source The source metadata.
* @returns {Array} Returns `data`.
*/
function mergeData(data, source) {
var bitmask = data[1],
srcBitmask = source[1],
newBitmask = bitmask | srcBitmask,
isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
var isCombo =
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
// Exit early if metadata can't be merged.
if (!(isCommon || isCombo)) {
return data;
}
// Use source `thisArg` if available.
if (srcBitmask & WRAP_BIND_FLAG) {
data[2] = source[2];
// Set when currying a bound function.
newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
}
// Compose partial arguments.
var value = source[3];
if (value) {
var partials = data[3];
data[3] = partials ? composeArgs(partials, value, source[4]) : value;
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
}
// Compose partial right arguments.
value = source[5];
if (value) {
partials = data[5];
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
}
// Use source `argPos` if available.
value = source[7];
if (value) {
data[7] = value;
}
// Use source `ary` if it's smaller.
if (srcBitmask & WRAP_ARY_FLAG) {
data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
}
// Use source `arity` if one is not provided.
if (data[9] == null) {
data[9] = source[9];
}
// Use source `func` and merge bitmasks.
data[0] = source[0];
data[1] = newBitmask;
return data;
}
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString(value) {
return nativeObjectToString.call(value);
}
/**
* A specialized version of `baseRest` which transforms the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @param {Function} transform The rest array transform.
* @returns {Function} Returns the new function.
*/
function overRest(func, start, transform) {
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = transform(array);
return apply(func, this, otherArgs);
};
}
/**
* Gets the parent value at `path` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
}
/**
* Reorder `array` according to the specified indexes where the element at
* the first index is assigned as the first element, the element at
* the second index is assigned as the second element, and so on.
*
* @private
* @param {Array} array The array to reorder.
* @param {Array} indexes The arranged array indexes.
* @returns {Array} Returns `array`.
*/
function reorder(array, indexes) {
var arrLength = array.length,
length = nativeMin(indexes.length, arrLength),
oldArray = copyArray(array);
while (length--) {
var index = indexes[length];
array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
}
return array;
}
/**
* Sets metadata for `func`.
*
* **Note:** If this function becomes hot, i.e. is invoked a lot in a short
* period of time, it will trip its breaker and transition to an identity
* function to avoid garbage collection pauses in V8. See
* [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
* for more details.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var setData = shortOut(baseSetData);
/**
* A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
*
* @private
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @returns {number|Object} Returns the timer id or timeout object.
*/
var setTimeout = ctxSetTimeout || function(func, wait) {
return root.setTimeout(func, wait);
};
/**
* Sets the `toString` method of `func` to return `string`.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var setToString = shortOut(baseSetToString);
/**
* Sets the `toString` method of `wrapper` to mimic the source of `reference`
* with wrapper details in a comment at the top of the source body.
*
* @private
* @param {Function} wrapper The function to modify.
* @param {Function} reference The reference function.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Function} Returns `wrapper`.
*/
function setWrapToString(wrapper, reference, bitmask) {
var source = (reference + '');
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
}
/**
* Creates a function that'll short out and invoke `identity` instead
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
* milliseconds.
*
* @private
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new shortable function.
*/
function shortOut(func) {
var count = 0,
lastCalled = 0;
return function() {
var stamp = nativeNow(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return arguments[0];
}
} else {
count = 0;
}
return func.apply(undefined, arguments);
};
}
/**
* A specialized version of `_.shuffle` which mutates and sets the size of `array`.
*
* @private
* @param {Array} array The array to shuffle.
* @param {number} [size=array.length] The size of `array`.
* @returns {Array} Returns `array`.
*/
function shuffleSelf(array, size) {
var index = -1,
length = array.length,
lastIndex = length - 1;
size = size === undefined ? length : size;
while (++index < size) {
var rand = baseRandom(index, lastIndex),
value = array[rand];
array[rand] = array[index];
array[index] = value;
}
array.length = size;
return array;
}
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoizeCapped(function(string) {
var result = [];
if (reLeadingDot.test(string)) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to convert.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
/**
* Updates wrapper `details` based on `bitmask` flags.
*
* @private
* @returns {Array} details The details to modify.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Array} Returns `details`.
*/
function updateWrapDetails(details, bitmask) {
arrayEach(wrapFlags, function(pair) {
var value = '_.' + pair[0];
if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
details.push(value);
}
});
return details.sort();
}
/**
* Creates a clone of `wrapper`.
*
* @private
* @param {Object} wrapper The wrapper to clone.
* @returns {Object} Returns the cloned wrapper.
*/
function wrapperClone(wrapper) {
if (wrapper instanceof LazyWrapper) {
return wrapper.clone();
}
var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
result.__actions__ = copyArray(wrapper.__actions__);
result.__index__ = wrapper.__index__;
result.__values__ = wrapper.__values__;
return result;
}
/*------------------------------------------------------------------------*/
/**
* Creates an array of elements split into groups the length of `size`.
* If `array` can't be split evenly, the final chunk will be the remaining
* elements.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to process.
* @param {number} [size=1] The length of each chunk
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the new array of chunks.
* @example
*
* _.chunk(['a', 'b', 'c', 'd'], 2);
* // => [['a', 'b'], ['c', 'd']]
*
* _.chunk(['a', 'b', 'c', 'd'], 3);
* // => [['a', 'b', 'c'], ['d']]
*/
function chunk(array, size, guard) {
if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
size = 1;
} else {
size = nativeMax(toInteger(size), 0);
}
var length = array == null ? 0 : array.length;
if (!length || size < 1) {
return [];
}
var index = 0,
resIndex = 0,
result = Array(nativeCeil(length / size));
while (index < length) {
result[resIndex++] = baseSlice(array, index, (index += size));
}
return result;
}
/**
* Creates an array with all falsey values removed. The values `false`, `null`,
* `0`, `""`, `undefined`, and `NaN` are falsey.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to compact.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.compact([0, 1, false, 2, '', 3]);
* // => [1, 2, 3]
*/
function compact(array) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result[resIndex++] = value;
}
}
return result;
}
/**
* Creates a new array concatenating `array` with any additional arrays
* and/or values.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to concatenate.
* @param {...*} [values] The values to concatenate.
* @returns {Array} Returns the new concatenated array.
* @example
*
* var array = [1];
* var other = _.concat(array, 2, [3], [[4]]);
*
* console.log(other);
* // => [1, 2, 3, [4]]
*
* console.log(array);
* // => [1]
*/
function concat() {
var length = arguments.length;
if (!length) {
return [];
}
var args = Array(length - 1),
array = arguments[0],
index = length;
while (index--) {
args[index - 1] = arguments[index];
}
return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
}
/**
* Creates an array of `array` values not included in the other given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. The order and references of result values are
* determined by the first array.
*
* **Note:** Unlike `_.pullAll`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.without, _.xor
* @example
*
* _.difference([2, 1], [2, 3]);
* // => [1]
*/
var difference = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
: [];
});
/**
* This method is like `_.difference` except that it accepts `iteratee` which
* is invoked for each element of `array` and `values` to generate the criterion
* by which they're compared. The order and references of result values are
* determined by the first array. The iteratee is invoked with one argument:
* (value).
*
* **Note:** Unlike `_.pullAllBy`, this method returns a new array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
* // => [1.2]
*
* // The `_.property` iteratee shorthand.
* _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
* // => [{ 'x': 2 }]
*/
var differenceBy = baseRest(function(array, values) {
var iteratee = last(values);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
: [];
});
/**
* This method is like `_.difference` except that it accepts `comparator`
* which is invoked to compare elements of `array` to `values`. The order and
* references of result values are determined by the first array. The comparator
* is invoked with two arguments: (arrVal, othVal).
*
* **Note:** Unlike `_.pullAllWith`, this method returns a new array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
*
* _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
* // => [{ 'x': 2, 'y': 1 }]
*/
var differenceWith = baseRest(function(array, values) {
var comparator = last(values);
if (isArrayLikeObject(comparator)) {
comparator = undefined;
}
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
: [];
});
/**
* Creates a slice of `array` with `n` elements dropped from the beginning.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.drop([1, 2, 3]);
* // => [2, 3]
*
* _.drop([1, 2, 3], 2);
* // => [3]
*
* _.drop([1, 2, 3], 5);
* // => []
*
* _.drop([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function drop(array, n, guard) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
return baseSlice(array, n < 0 ? 0 : n, length);
}
/**
* Creates a slice of `array` with `n` elements dropped from the end.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.dropRight([1, 2, 3]);
* // => [1, 2]
*
* _.dropRight([1, 2, 3], 2);
* // => [1]
*
* _.dropRight([1, 2, 3], 5);
* // => []
*
* _.dropRight([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function dropRight(array, n, guard) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
n = length - n;
return baseSlice(array, 0, n < 0 ? 0 : n);
}
/**
* Creates a slice of `array` excluding elements dropped from the end.
* Elements are dropped until `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.dropRightWhile(users, function(o) { return !o.active; });
* // => objects for ['barney']
*
* // The `_.matches` iteratee shorthand.
* _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
* // => objects for ['barney', 'fred']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.dropRightWhile(users, ['active', false]);
* // => objects for ['barney']
*
* // The `_.property` iteratee shorthand.
* _.dropRightWhile(users, 'active');
* // => objects for ['barney', 'fred', 'pebbles']
*/
function dropRightWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3), true, true)
: [];
}
/**
* Creates a slice of `array` excluding elements dropped from the beginning.
* Elements are dropped until `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.dropWhile(users, function(o) { return !o.active; });
* // => objects for ['pebbles']
*
* // The `_.matches` iteratee shorthand.
* _.dropWhile(users, { 'user': 'barney', 'active': false });
* // => objects for ['fred', 'pebbles']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.dropWhile(users, ['active', false]);
* // => objects for ['pebbles']
*
* // The `_.property` iteratee shorthand.
* _.dropWhile(users, 'active');
* // => objects for ['barney', 'fred', 'pebbles']
*/
function dropWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3), true)
: [];
}
/**
* Fills elements of `array` with `value` from `start` up to, but not
* including, `end`.
*
* **Note:** This method mutates `array`.
*
* @static
* @memberOf _
* @since 3.2.0
* @category Array
* @param {Array} array The array to fill.
* @param {*} value The value to fill `array` with.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3];
*
* _.fill(array, 'a');
* console.log(array);
* // => ['a', 'a', 'a']
*
* _.fill(Array(3), 2);
* // => [2, 2, 2]
*
* _.fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*/
function fill(array, value, start, end) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
start = 0;
end = length;
}
return baseFill(array, value, start, end);
}
/**
* This method is like `_.find` except that it returns the index of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.findIndex(users, function(o) { return o.user == 'barney'; });
* // => 0
*
* // The `_.matches` iteratee shorthand.
* _.findIndex(users, { 'user': 'fred', 'active': false });
* // => 1
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findIndex(users, ['active', false]);
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.findIndex(users, 'active');
* // => 2
*/
function findIndex(array, predicate, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseFindIndex(array, getIteratee(predicate, 3), index);
}
/**
* This method is like `_.findIndex` except that it iterates over elements
* of `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=array.length-1] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
* // => 2
*
* // The `_.matches` iteratee shorthand.
* _.findLastIndex(users, { 'user': 'barney', 'active': true });
* // => 0
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findLastIndex(users, ['active', false]);
* // => 2
*
* // The `_.property` iteratee shorthand.
* _.findLastIndex(users, 'active');
* // => 0
*/
function findLastIndex(array, predicate, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = length - 1;
if (fromIndex !== undefined) {
index = toInteger(fromIndex);
index = fromIndex < 0
? nativeMax(length + index, 0)
: nativeMin(index, length - 1);
}
return baseFindIndex(array, getIteratee(predicate, 3), index, true);
}
/**
* Flattens `array` a single level deep.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flatten([1, [2, [3, [4]], 5]]);
* // => [1, 2, [3, [4]], 5]
*/
function flatten(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, 1) : [];
}
/**
* Recursively flattens `array`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flattenDeep([1, [2, [3, [4]], 5]]);
* // => [1, 2, 3, 4, 5]
*/
function flattenDeep(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, INFINITY) : [];
}
/**
* Recursively flatten `array` up to `depth` times.
*
* @static
* @memberOf _
* @since 4.4.0
* @category Array
* @param {Array} array The array to flatten.
* @param {number} [depth=1] The maximum recursion depth.
* @returns {Array} Returns the new flattened array.
* @example
*
* var array = [1, [2, [3, [4]], 5]];
*
* _.flattenDepth(array, 1);
* // => [1, 2, [3, [4]], 5]
*
* _.flattenDepth(array, 2);
* // => [1, 2, 3, [4], 5]
*/
function flattenDepth(array, depth) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
depth = depth === undefined ? 1 : toInteger(depth);
return baseFlatten(array, depth);
}
/**
* The inverse of `_.toPairs`; this method returns an object composed
* from key-value `pairs`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} pairs The key-value pairs.
* @returns {Object} Returns the new object.
* @example
*
* _.fromPairs([['a', 1], ['b', 2]]);
* // => { 'a': 1, 'b': 2 }
*/
function fromPairs(pairs) {
var index = -1,
length = pairs == null ? 0 : pairs.length,
result = {};
while (++index < length) {
var pair = pairs[index];
result[pair[0]] = pair[1];
}
return result;
}
/**
* Gets the first element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias first
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the first element of `array`.
* @example
*
* _.head([1, 2, 3]);
* // => 1
*
* _.head([]);
* // => undefined
*/
function head(array) {
return (array && array.length) ? array[0] : undefined;
}
/**
* Gets the index at which the first occurrence of `value` is found in `array`
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. If `fromIndex` is negative, it's used as the
* offset from the end of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.indexOf([1, 2, 1, 2], 2);
* // => 1
*
* // Search from the `fromIndex`.
* _.indexOf([1, 2, 1, 2], 2, 2);
* // => 3
*/
function indexOf(array, value, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseIndexOf(array, value, index);
}
/**
* Gets all but the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.initial([1, 2, 3]);
* // => [1, 2]
*/
function initial(array) {
var length = array == null ? 0 : array.length;
return length ? baseSlice(array, 0, -1) : [];
}
/**
* Creates an array of unique values that are included in all given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. The order and references of result values are
* determined by the first array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* _.intersection([2, 1], [2, 3]);
* // => [2]
*/
var intersection = baseRest(function(arrays) {
var mapped = arrayMap(arrays, castArrayLikeObject);
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped)
: [];
});
/**
* This method is like `_.intersection` except that it accepts `iteratee`
* which is invoked for each element of each `arrays` to generate the criterion
* by which they're compared. The order and references of result values are
* determined by the first array. The iteratee is invoked with one argument:
* (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
* // => [2.1]
*
* // The `_.property` iteratee shorthand.
* _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }]
*/
var intersectionBy = baseRest(function(arrays) {
var iteratee = last(arrays),
mapped = arrayMap(arrays, castArrayLikeObject);
if (iteratee === last(mapped)) {
iteratee = undefined;
} else {
mapped.pop();
}
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped, getIteratee(iteratee, 2))
: [];
});
/**
* This method is like `_.intersection` except that it accepts `comparator`
* which is invoked to compare elements of `arrays`. The order and references
* of result values are determined by the first array. The comparator is
* invoked with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.intersectionWith(objects, others, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }]
*/
var intersectionWith = baseRest(function(arrays) {
var comparator = last(arrays),
mapped = arrayMap(arrays, castArrayLikeObject);
comparator = typeof comparator == 'function' ? comparator : undefined;
if (comparator) {
mapped.pop();
}
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped, undefined, comparator)
: [];
});
/**
* Converts all elements in `array` into a string separated by `separator`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to convert.
* @param {string} [separator=','] The element separator.
* @returns {string} Returns the joined string.
* @example
*
* _.join(['a', 'b', 'c'], '~');
* // => 'a~b~c'
*/
function join(array, separator) {
return array == null ? '' : nativeJoin.call(array, separator);
}
/**
* Gets the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the last element of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*/
function last(array) {
var length = array == null ? 0 : array.length;
return length ? array[length - 1] : undefined;
}
/**
* This method is like `_.indexOf` except that it iterates over elements of
* `array` from right to left.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=array.length-1] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.lastIndexOf([1, 2, 1, 2], 2);
* // => 3
*
* // Search from the `fromIndex`.
* _.lastIndexOf([1, 2, 1, 2], 2, 2);
* // => 1
*/
function lastIndexOf(array, value, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = length;
if (fromIndex !== undefined) {
index = toInteger(fromIndex);
index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
}
return value === value
? strictLastIndexOf(array, value, index)
: baseFindIndex(array, baseIsNaN, index, true);
}
/**
* Gets the element at index `n` of `array`. If `n` is negative, the nth
* element from the end is returned.
*
* @static
* @memberOf _
* @since 4.11.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=0] The index of the element to return.
* @returns {*} Returns the nth element of `array`.
* @example
*
* var array = ['a', 'b', 'c', 'd'];
*
* _.nth(array, 1);
* // => 'b'
*
* _.nth(array, -2);
* // => 'c';
*/
function nth(array, n) {
return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
}
/**
* Removes all given values from `array` using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
* to remove elements from an array by predicate.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {...*} [values] The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = ['a', 'b', 'c', 'a', 'b', 'c'];
*
* _.pull(array, 'a', 'c');
* console.log(array);
* // => ['b', 'b']
*/
var pull = baseRest(pullAll);
/**
* This method is like `_.pull` except that it accepts an array of values to remove.
*
* **Note:** Unlike `_.difference`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = ['a', 'b', 'c', 'a', 'b', 'c'];
*
* _.pullAll(array, ['a', 'c']);
* console.log(array);
* // => ['b', 'b']
*/
function pullAll(array, values) {
return (array && array.length && values && values.length)
? basePullAll(array, values)
: array;
}
/**
* This method is like `_.pullAll` except that it accepts `iteratee` which is
* invoked for each element of `array` and `values` to generate the criterion
* by which they're compared. The iteratee is invoked with one argument: (value).
*
* **Note:** Unlike `_.differenceBy`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns `array`.
* @example
*
* var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
*
* _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
* console.log(array);
* // => [{ 'x': 2 }]
*/
function pullAllBy(array, values, iteratee) {
return (array && array.length && values && values.length)
? basePullAll(array, values, getIteratee(iteratee, 2))
: array;
}
/**
* This method is like `_.pullAll` except that it accepts `comparator` which
* is invoked to compare elements of `array` to `values`. The comparator is
* invoked with two arguments: (arrVal, othVal).
*
* **Note:** Unlike `_.differenceWith`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns `array`.
* @example
*
* var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
*
* _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
* console.log(array);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
*/
function pullAllWith(array, values, comparator) {
return (array && array.length && values && values.length)
? basePullAll(array, values, undefined, comparator)
: array;
}
/**
* Removes elements from `array` corresponding to `indexes` and returns an
* array of removed elements.
*
* **Note:** Unlike `_.at`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {...(number|number[])} [indexes] The indexes of elements to remove.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = ['a', 'b', 'c', 'd'];
* var pulled = _.pullAt(array, [1, 3]);
*
* console.log(array);
* // => ['a', 'c']
*
* console.log(pulled);
* // => ['b', 'd']
*/
var pullAt = flatRest(function(array, indexes) {
var length = array == null ? 0 : array.length,
result = baseAt(array, indexes);
basePullAt(array, arrayMap(indexes, function(index) {
return isIndex(index, length) ? +index : index;
}).sort(compareAscending));
return result;
});
/**
* Removes all elements from `array` that `predicate` returns truthy for
* and returns an array of the removed elements. The predicate is invoked
* with three arguments: (value, index, array).
*
* **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
* to pull elements from an array by value.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = [1, 2, 3, 4];
* var evens = _.remove(array, function(n) {
* return n % 2 == 0;
* });
*
* console.log(array);
* // => [1, 3]
*
* console.log(evens);
* // => [2, 4]
*/
function remove(array, predicate) {
var result = [];
if (!(array && array.length)) {
return result;
}
var index = -1,
indexes = [],
length = array.length;
predicate = getIteratee(predicate, 3);
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result.push(value);
indexes.push(index);
}
}
basePullAt(array, indexes);
return result;
}
/**
* Reverses `array` so that the first element becomes the last, the second
* element becomes the second to last, and so on.
*
* **Note:** This method mutates `array` and is based on
* [`Array#reverse`](https://mdn.io/Array/reverse).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3];
*
* _.reverse(array);
* // => [3, 2, 1]
*
* console.log(array);
* // => [3, 2, 1]
*/
function reverse(array) {
return array == null ? array : nativeReverse.call(array);
}
/**
* Creates a slice of `array` from `start` up to, but not including, `end`.
*
* **Note:** This method is used instead of
* [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
* returned.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function slice(array, start, end) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
start = 0;
end = length;
}
else {
start = start == null ? 0 : toInteger(start);
end = end === undefined ? length : toInteger(end);
}
return baseSlice(array, start, end);
}
/**
* Uses a binary search to determine the lowest index at which `value`
* should be inserted into `array` in order to maintain its sort order.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedIndex([30, 50], 40);
* // => 1
*/
function sortedIndex(array, value) {
return baseSortedIndex(array, value);
}
/**
* This method is like `_.sortedIndex` except that it accepts `iteratee`
* which is invoked for `value` and each element of `array` to compute their
* sort ranking. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* var objects = [{ 'x': 4 }, { 'x': 5 }];
*
* _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.sortedIndexBy(objects, { 'x': 4 }, 'x');
* // => 0
*/
function sortedIndexBy(array, value, iteratee) {
return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
}
/**
* This method is like `_.indexOf` except that it performs a binary
* search on a sorted `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.sortedIndexOf([4, 5, 5, 5, 6], 5);
* // => 1
*/
function sortedIndexOf(array, value) {
var length = array == null ? 0 : array.length;
if (length) {
var index = baseSortedIndex(array, value);
if (index < length && eq(array[index], value)) {
return index;
}
}
return -1;
}
/**
* This method is like `_.sortedIndex` except that it returns the highest
* index at which `value` should be inserted into `array` in order to
* maintain its sort order.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedLastIndex([4, 5, 5, 5, 6], 5);
* // => 4
*/
function sortedLastIndex(array, value) {
return baseSortedIndex(array, value, true);
}
/**
* This method is like `_.sortedLastIndex` except that it accepts `iteratee`
* which is invoked for `value` and each element of `array` to compute their
* sort ranking. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* var objects = [{ 'x': 4 }, { 'x': 5 }];
*
* _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
* // => 1
*
* // The `_.property` iteratee shorthand.
* _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
* // => 1
*/
function sortedLastIndexBy(array, value, iteratee) {
return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
}
/**
* This method is like `_.lastIndexOf` except that it performs a binary
* search on a sorted `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
* // => 3
*/
function sortedLastIndexOf(array, value) {
var length = array == null ? 0 : array.length;
if (length) {
var index = baseSortedIndex(array, value, true) - 1;
if (eq(array[index], value)) {
return index;
}
}
return -1;
}
/**
* This method is like `_.uniq` except that it's designed and optimized
* for sorted arrays.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.sortedUniq([1, 1, 2]);
* // => [1, 2]
*/
function sortedUniq(array) {
return (array && array.length)
? baseSortedUniq(array)
: [];
}
/**
* This method is like `_.uniqBy` except that it's designed and optimized
* for sorted arrays.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
* // => [1.1, 2.3]
*/
function sortedUniqBy(array, iteratee) {
return (array && array.length)
? baseSortedUniq(array, getIteratee(iteratee, 2))
: [];
}
/**
* Gets all but the first element of `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to query.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.tail([1, 2, 3]);
* // => [2, 3]
*/
function tail(array) {
var length = array == null ? 0 : array.length;
return length ? baseSlice(array, 1, length) : [];
}
/**
* Creates a slice of `array` with `n` elements taken from the beginning.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to take.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.take([1, 2, 3]);
* // => [1]
*
* _.take([1, 2, 3], 2);
* // => [1, 2]
*
* _.take([1, 2, 3], 5);
* // => [1, 2, 3]
*
* _.take([1, 2, 3], 0);
* // => []
*/
function take(array, n, guard) {
if (!(array && array.length)) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
return baseSlice(array, 0, n < 0 ? 0 : n);
}
/**
* Creates a slice of `array` with `n` elements taken from the end.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to take.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.takeRight([1, 2, 3]);
* // => [3]
*
* _.takeRight([1, 2, 3], 2);
* // => [2, 3]
*
* _.takeRight([1, 2, 3], 5);
* // => [1, 2, 3]
*
* _.takeRight([1, 2, 3], 0);
* // => []
*/
function takeRight(array, n, guard) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
n = length - n;
return baseSlice(array, n < 0 ? 0 : n, length);
}
/**
* Creates a slice of `array` with elements taken from the end. Elements are
* taken until `predicate` returns falsey. The predicate is invoked with
* three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.takeRightWhile(users, function(o) { return !o.active; });
* // => objects for ['fred', 'pebbles']
*
* // The `_.matches` iteratee shorthand.
* _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
* // => objects for ['pebbles']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.takeRightWhile(users, ['active', false]);
* // => objects for ['fred', 'pebbles']
*
* // The `_.property` iteratee shorthand.
* _.takeRightWhile(users, 'active');
* // => []
*/
function takeRightWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3), false, true)
: [];
}
/**
* Creates a slice of `array` with elements taken from the beginning. Elements
* are taken until `predicate` returns falsey. The predicate is invoked with
* three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.takeWhile(users, function(o) { return !o.active; });
* // => objects for ['barney', 'fred']
*
* // The `_.matches` iteratee shorthand.
* _.takeWhile(users, { 'user': 'barney', 'active': false });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.takeWhile(users, ['active', false]);
* // => objects for ['barney', 'fred']
*
* // The `_.property` iteratee shorthand.
* _.takeWhile(users, 'active');
* // => []
*/
function takeWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3))
: [];
}
/**
* Creates an array of unique values, in order, from all given arrays using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.union([2], [1, 2]);
* // => [2, 1]
*/
var union = baseRest(function(arrays) {
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
});
/**
* This method is like `_.union` except that it accepts `iteratee` which is
* invoked for each element of each `arrays` to generate the criterion by
* which uniqueness is computed. Result values are chosen from the first
* array in which the value occurs. The iteratee is invoked with one argument:
* (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.unionBy([2.1], [1.2, 2.3], Math.floor);
* // => [2.1, 1.2]
*
* // The `_.property` iteratee shorthand.
* _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
var unionBy = baseRest(function(arrays) {
var iteratee = last(arrays);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
});
/**
* This method is like `_.union` except that it accepts `comparator` which
* is invoked to compare elements of `arrays`. Result values are chosen from
* the first array in which the value occurs. The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of combined values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.unionWith(objects, others, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
*/
var unionWith = baseRest(function(arrays) {
var comparator = last(arrays);
comparator = typeof comparator == 'function' ? comparator : undefined;
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
});
/**
* Creates a duplicate-free version of an array, using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons, in which only the first occurrence of each element
* is kept. The order of result values is determined by the order they occur
* in the array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.uniq([2, 1, 2]);
* // => [2, 1]
*/
function uniq(array) {
return (array && array.length) ? baseUniq(array) : [];
}
/**
* This method is like `_.uniq` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the criterion by which
* uniqueness is computed. The order of result values is determined by the
* order they occur in the array. The iteratee is invoked with one argument:
* (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.uniqBy([2.1, 1.2, 2.3], Math.floor);
* // => [2.1, 1.2]
*
* // The `_.property` iteratee shorthand.
* _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
function uniqBy(array, iteratee) {
return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
}
/**
* This method is like `_.uniq` except that it accepts `comparator` which
* is invoked to compare elements of `array`. The order of result values is
* determined by the order they occur in the array.The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.uniqWith(objects, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
*/
function uniqWith(array, comparator) {
comparator = typeof comparator == 'function' ? comparator : undefined;
return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
}
/**
* This method is like `_.zip` except that it accepts an array of grouped
* elements and creates an array regrouping the elements to their pre-zip
* configuration.
*
* @static
* @memberOf _
* @since 1.2.0
* @category Array
* @param {Array} array The array of grouped elements to process.
* @returns {Array} Returns the new array of regrouped elements.
* @example
*
* var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
* // => [['a', 1, true], ['b', 2, false]]
*
* _.unzip(zipped);
* // => [['a', 'b'], [1, 2], [true, false]]
*/
function unzip(array) {
if (!(array && array.length)) {
return [];
}
var length = 0;
array = arrayFilter(array, function(group) {
if (isArrayLikeObject(group)) {
length = nativeMax(group.length, length);
return true;
}
});
return baseTimes(length, function(index) {
return arrayMap(array, baseProperty(index));
});
}
/**
* This method is like `_.unzip` except that it accepts `iteratee` to specify
* how regrouped values should be combined. The iteratee is invoked with the
* elements of each group: (...group).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Array
* @param {Array} array The array of grouped elements to process.
* @param {Function} [iteratee=_.identity] The function to combine
* regrouped values.
* @returns {Array} Returns the new array of regrouped elements.
* @example
*
* var zipped = _.zip([1, 2], [10, 20], [100, 200]);
* // => [[1, 10, 100], [2, 20, 200]]
*
* _.unzipWith(zipped, _.add);
* // => [3, 30, 300]
*/
function unzipWith(array, iteratee) {
if (!(array && array.length)) {
return [];
}
var result = unzip(array);
if (iteratee == null) {
return result;
}
return arrayMap(result, function(group) {
return apply(iteratee, undefined, group);
});
}
/**
* Creates an array excluding all given values using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `_.pull`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...*} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.difference, _.xor
* @example
*
* _.without([2, 1, 2, 3], 1, 2);
* // => [3]
*/
var without = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, values)
: [];
});
/**
* Creates an array of unique values that is the
* [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
* of the given arrays. The order of result values is determined by the order
* they occur in the arrays.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of filtered values.
* @see _.difference, _.without
* @example
*
* _.xor([2, 1], [2, 3]);
* // => [1, 3]
*/
var xor = baseRest(function(arrays) {
return baseXor(arrayFilter(arrays, isArrayLikeObject));
});
/**
* This method is like `_.xor` except that it accepts `iteratee` which is
* invoked for each element of each `arrays` to generate the criterion by
* which by which they're compared. The order of result values is determined
* by the order they occur in the arrays. The iteratee is invoked with one
* argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
* // => [1.2, 3.4]
*
* // The `_.property` iteratee shorthand.
* _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 2 }]
*/
var xorBy = baseRest(function(arrays) {
var iteratee = last(arrays);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
});
/**
* This method is like `_.xor` except that it accepts `comparator` which is
* invoked to compare elements of `arrays`. The order of result values is
* determined by the order they occur in the arrays. The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.xorWith(objects, others, _.isEqual);
* // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
*/
var xorWith = baseRest(function(arrays) {
var comparator = last(arrays);
comparator = typeof comparator == 'function' ? comparator : undefined;
return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
});
/**
* Creates an array of grouped elements, the first of which contains the
* first elements of the given arrays, the second of which contains the
* second elements of the given arrays, and so on.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to process.
* @returns {Array} Returns the new array of grouped elements.
* @example
*
* _.zip(['a', 'b'], [1, 2], [true, false]);
* // => [['a', 1, true], ['b', 2, false]]
*/
var zip = baseRest(unzip);
/**
* This method is like `_.fromPairs` except that it accepts two arrays,
* one of property identifiers and one of corresponding values.
*
* @static
* @memberOf _
* @since 0.4.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObject(['a', 'b'], [1, 2]);
* // => { 'a': 1, 'b': 2 }
*/
function zipObject(props, values) {
return baseZipObject(props || [], values || [], assignValue);
}
/**
* This method is like `_.zipObject` except that it supports property paths.
*
* @static
* @memberOf _
* @since 4.1.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
* // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
*/
function zipObjectDeep(props, values) {
return baseZipObject(props || [], values || [], baseSet);
}
/**
* This method is like `_.zip` except that it accepts `iteratee` to specify
* how grouped values should be combined. The iteratee is invoked with the
* elements of each group: (...group).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Array
* @param {...Array} [arrays] The arrays to process.
* @param {Function} [iteratee=_.identity] The function to combine
* grouped values.
* @returns {Array} Returns the new array of grouped elements.
* @example
*
* _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
* return a + b + c;
* });
* // => [111, 222]
*/
var zipWith = baseRest(function(arrays) {
var length = arrays.length,
iteratee = length > 1 ? arrays[length - 1] : undefined;
iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
return unzipWith(arrays, iteratee);
});
/*------------------------------------------------------------------------*/
/**
* Creates a `lodash` wrapper instance that wraps `value` with explicit method
* chain sequences enabled. The result of such sequences must be unwrapped
* with `_#value`.
*
* @static
* @memberOf _
* @since 1.3.0
* @category Seq
* @param {*} value The value to wrap.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'pebbles', 'age': 1 }
* ];
*
* var youngest = _
* .chain(users)
* .sortBy('age')
* .map(function(o) {
* return o.user + ' is ' + o.age;
* })
* .head()
* .value();
* // => 'pebbles is 1'
*/
function chain(value) {
var result = lodash(value);
result.__chain__ = true;
return result;
}
/**
* This method invokes `interceptor` and returns `value`. The interceptor
* is invoked with one argument; (value). The purpose of this method is to
* "tap into" a method chain sequence in order to modify intermediate results.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Seq
* @param {*} value The value to provide to `interceptor`.
* @param {Function} interceptor The function to invoke.
* @returns {*} Returns `value`.
* @example
*
* _([1, 2, 3])
* .tap(function(array) {
* // Mutate input array.
* array.pop();
* })
* .reverse()
* .value();
* // => [2, 1]
*/
function tap(value, interceptor) {
interceptor(value);
return value;
}
/**
* This method is like `_.tap` except that it returns the result of `interceptor`.
* The purpose of this method is to "pass thru" values replacing intermediate
* results in a method chain sequence.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Seq
* @param {*} value The value to provide to `interceptor`.
* @param {Function} interceptor The function to invoke.
* @returns {*} Returns the result of `interceptor`.
* @example
*
* _(' abc ')
* .chain()
* .trim()
* .thru(function(value) {
* return [value];
* })
* .value();
* // => ['abc']
*/
function thru(value, interceptor) {
return interceptor(value);
}
/**
* This method is the wrapper version of `_.at`.
*
* @name at
* @memberOf _
* @since 1.0.0
* @category Seq
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
*
* _(object).at(['a[0].b.c', 'a[1]']).value();
* // => [3, 4]
*/
var wrapperAt = flatRest(function(paths) {
var length = paths.length,
start = length ? paths[0] : 0,
value = this.__wrapped__,
interceptor = function(object) { return baseAt(object, paths); };
if (length > 1 || this.__actions__.length ||
!(value instanceof LazyWrapper) || !isIndex(start)) {
return this.thru(interceptor);
}
value = value.slice(start, +start + (length ? 1 : 0));
value.__actions__.push({
'func': thru,
'args': [interceptor],
'thisArg': undefined
});
return new LodashWrapper(value, this.__chain__).thru(function(array) {
if (length && !array.length) {
array.push(undefined);
}
return array;
});
});
/**
* Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
*
* @name chain
* @memberOf _
* @since 0.1.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 }
* ];
*
* // A sequence without explicit chaining.
* _(users).head();
* // => { 'user': 'barney', 'age': 36 }
*
* // A sequence with explicit chaining.
* _(users)
* .chain()
* .head()
* .pick('user')
* .value();
* // => { 'user': 'barney' }
*/
function wrapperChain() {
return chain(this);
}
/**
* Executes the chain sequence and returns the wrapped result.
*
* @name commit
* @memberOf _
* @since 3.2.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var array = [1, 2];
* var wrapped = _(array).push(3);
*
* console.log(array);
* // => [1, 2]
*
* wrapped = wrapped.commit();
* console.log(array);
* // => [1, 2, 3]
*
* wrapped.last();
* // => 3
*
* console.log(array);
* // => [1, 2, 3]
*/
function wrapperCommit() {
return new LodashWrapper(this.value(), this.__chain__);
}
/**
* Gets the next value on a wrapped object following the
* [iterator protocol](https://mdn.io/iteration_protocols#iterator).
*
* @name next
* @memberOf _
* @since 4.0.0
* @category Seq
* @returns {Object} Returns the next iterator value.
* @example
*
* var wrapped = _([1, 2]);
*
* wrapped.next();
* // => { 'done': false, 'value': 1 }
*
* wrapped.next();
* // => { 'done': false, 'value': 2 }
*
* wrapped.next();
* // => { 'done': true, 'value': undefined }
*/
function wrapperNext() {
if (this.__values__ === undefined) {
this.__values__ = toArray(this.value());
}
var done = this.__index__ >= this.__values__.length,
value = done ? undefined : this.__values__[this.__index__++];
return { 'done': done, 'value': value };
}
/**
* Enables the wrapper to be iterable.
*
* @name Symbol.iterator
* @memberOf _
* @since 4.0.0
* @category Seq
* @returns {Object} Returns the wrapper object.
* @example
*
* var wrapped = _([1, 2]);
*
* wrapped[Symbol.iterator]() === wrapped;
* // => true
*
* Array.from(wrapped);
* // => [1, 2]
*/
function wrapperToIterator() {
return this;
}
/**
* Creates a clone of the chain sequence planting `value` as the wrapped value.
*
* @name plant
* @memberOf _
* @since 3.2.0
* @category Seq
* @param {*} value The value to plant.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2]).map(square);
* var other = wrapped.plant([3, 4]);
*
* other.value();
* // => [9, 16]
*
* wrapped.value();
* // => [1, 4]
*/
function wrapperPlant(value) {
var result,
parent = this;
while (parent instanceof baseLodash) {
var clone = wrapperClone(parent);
clone.__index__ = 0;
clone.__values__ = undefined;
if (result) {
previous.__wrapped__ = clone;
} else {
result = clone;
}
var previous = clone;
parent = parent.__wrapped__;
}
previous.__wrapped__ = value;
return result;
}
/**
* This method is the wrapper version of `_.reverse`.
*
* **Note:** This method mutates the wrapped array.
*
* @name reverse
* @memberOf _
* @since 0.1.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var array = [1, 2, 3];
*
* _(array).reverse().value()
* // => [3, 2, 1]
*
* console.log(array);
* // => [3, 2, 1]
*/
function wrapperReverse() {
var value = this.__wrapped__;
if (value instanceof LazyWrapper) {
var wrapped = value;
if (this.__actions__.length) {
wrapped = new LazyWrapper(this);
}
wrapped = wrapped.reverse();
wrapped.__actions__.push({
'func': thru,
'args': [reverse],
'thisArg': undefined
});
return new LodashWrapper(wrapped, this.__chain__);
}
return this.thru(reverse);
}
/**
* Executes the chain sequence to resolve the unwrapped value.
*
* @name value
* @memberOf _
* @since 0.1.0
* @alias toJSON, valueOf
* @category Seq
* @returns {*} Returns the resolved unwrapped value.
* @example
*
* _([1, 2, 3]).value();
* // => [1, 2, 3]
*/
function wrapperValue() {
return baseWrapperValue(this.__wrapped__, this.__actions__);
}
/*------------------------------------------------------------------------*/
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` thru `iteratee`. The corresponding value of
* each key is the number of times the key was returned by `iteratee`. The
* iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.5.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee to transform keys.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* _.countBy([6.1, 4.2, 6.3], Math.floor);
* // => { '4': 1, '6': 2 }
*
* // The `_.property` iteratee shorthand.
* _.countBy(['one', 'two', 'three'], 'length');
* // => { '3': 2, '5': 1 }
*/
var countBy = createAggregator(function(result, value, key) {
if (hasOwnProperty.call(result, key)) {
++result[key];
} else {
baseAssignValue(result, key, 1);
}
});
/**
* Checks if `predicate` returns truthy for **all** elements of `collection`.
* Iteration is stopped once `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* **Note:** This method returns `true` for
* [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
* [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
* elements of empty collections.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
* @example
*
* _.every([true, 1, null, 'yes'], Boolean);
* // => false
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.every(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.every(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.every(users, 'active');
* // => false
*/
function every(collection, predicate, guard) {
var func = isArray(collection) ? arrayEvery : baseEvery;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, getIteratee(predicate, 3));
}
/**
* Iterates over elements of `collection`, returning an array of all elements
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* **Note:** Unlike `_.remove`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
* @see _.reject
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* _.filter(users, function(o) { return !o.active; });
* // => objects for ['fred']
*
* // The `_.matches` iteratee shorthand.
* _.filter(users, { 'age': 36, 'active': true });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.filter(users, ['active', false]);
* // => objects for ['fred']
*
* // The `_.property` iteratee shorthand.
* _.filter(users, 'active');
* // => objects for ['barney']
*/
function filter(collection, predicate) {
var func = isArray(collection) ? arrayFilter : baseFilter;
return func(collection, getIteratee(predicate, 3));
}
/**
* Iterates over elements of `collection`, returning the first element
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false },
* { 'user': 'pebbles', 'age': 1, 'active': true }
* ];
*
* _.find(users, function(o) { return o.age < 40; });
* // => object for 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.find(users, { 'age': 1, 'active': true });
* // => object for 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.find(users, ['active', false]);
* // => object for 'fred'
*
* // The `_.property` iteratee shorthand.
* _.find(users, 'active');
* // => object for 'barney'
*/
var find = createFind(findIndex);
/**
* This method is like `_.find` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=collection.length-1] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* _.findLast([1, 2, 3, 4], function(n) {
* return n % 2 == 1;
* });
* // => 3
*/
var findLast = createFind(findLastIndex);
/**
* Creates a flattened array of values by running each element in `collection`
* thru `iteratee` and flattening the mapped results. The iteratee is invoked
* with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [n, n];
* }
*
* _.flatMap([1, 2], duplicate);
* // => [1, 1, 2, 2]
*/
function flatMap(collection, iteratee) {
return baseFlatten(map(collection, iteratee), 1);
}
/**
* This method is like `_.flatMap` except that it recursively flattens the
* mapped results.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [[[n, n]]];
* }
*
* _.flatMapDeep([1, 2], duplicate);
* // => [1, 1, 2, 2]
*/
function flatMapDeep(collection, iteratee) {
return baseFlatten(map(collection, iteratee), INFINITY);
}
/**
* This method is like `_.flatMap` except that it recursively flattens the
* mapped results up to `depth` times.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {number} [depth=1] The maximum recursion depth.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [[[n, n]]];
* }
*
* _.flatMapDepth([1, 2], duplicate, 2);
* // => [[1, 1], [2, 2]]
*/
function flatMapDepth(collection, iteratee, depth) {
depth = depth === undefined ? 1 : toInteger(depth);
return baseFlatten(map(collection, iteratee), depth);
}
/**
* Iterates over elements of `collection` and invokes `iteratee` for each element.
* The iteratee is invoked with three arguments: (value, index|key, collection).
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* **Note:** As with other "Collections" methods, objects with a "length"
* property are iterated like arrays. To avoid this behavior use `_.forIn`
* or `_.forOwn` for object iteration.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias each
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
* @see _.forEachRight
* @example
*
* _.forEach([1, 2], function(value) {
* console.log(value);
* });
* // => Logs `1` then `2`.
*
* _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
* console.log(key);
* });
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forEach(collection, iteratee) {
var func = isArray(collection) ? arrayEach : baseEach;
return func(collection, getIteratee(iteratee, 3));
}
/**
* This method is like `_.forEach` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @alias eachRight
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
* @see _.forEach
* @example
*
* _.forEachRight([1, 2], function(value) {
* console.log(value);
* });
* // => Logs `2` then `1`.
*/
function forEachRight(collection, iteratee) {
var func = isArray(collection) ? arrayEachRight : baseEachRight;
return func(collection, getIteratee(iteratee, 3));
}
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` thru `iteratee`. The order of grouped values
* is determined by the order they occur in `collection`. The corresponding
* value of each key is an array of elements responsible for generating the
* key. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee to transform keys.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* _.groupBy([6.1, 4.2, 6.3], Math.floor);
* // => { '4': [4.2], '6': [6.1, 6.3] }
*
* // The `_.property` iteratee shorthand.
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
var groupBy = createAggregator(function(result, value, key) {
if (hasOwnProperty.call(result, key)) {
result[key].push(value);
} else {
baseAssignValue(result, key, [value]);
}
});
/**
* Checks if `value` is in `collection`. If `collection` is a string, it's
* checked for a substring of `value`, otherwise
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* is used for equality comparisons. If `fromIndex` is negative, it's used as
* the offset from the end of `collection`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object|string} collection The collection to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
* @returns {boolean} Returns `true` if `value` is found, else `false`.
* @example
*
* _.includes([1, 2, 3], 1);
* // => true
*
* _.includes([1, 2, 3], 1, 2);
* // => false
*
* _.includes({ 'a': 1, 'b': 2 }, 1);
* // => true
*
* _.includes('abcd', 'bc');
* // => true
*/
function includes(collection, value, fromIndex, guard) {
collection = isArrayLike(collection) ? collection : values(collection);
fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
var length = collection.length;
if (fromIndex < 0) {
fromIndex = nativeMax(length + fromIndex, 0);
}
return isString(collection)
? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
: (!!length && baseIndexOf(collection, value, fromIndex) > -1);
}
/**
* Invokes the method at `path` of each element in `collection`, returning
* an array of the results of each invoked method. Any additional arguments
* are provided to each invoked method. If `path` is a function, it's invoked
* for, and `this` bound to, each element in `collection`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Array|Function|string} path The path of the method to invoke or
* the function invoked per iteration.
* @param {...*} [args] The arguments to invoke each method with.
* @returns {Array} Returns the array of results.
* @example
*
* _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
* // => [[1, 5, 7], [1, 2, 3]]
*
* _.invokeMap([123, 456], String.prototype.split, '');
* // => [['1', '2', '3'], ['4', '5', '6']]
*/
var invokeMap = baseRest(function(collection, path, args) {
var index = -1,
isFunc = typeof path == 'function',
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value) {
result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
});
return result;
});
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` thru `iteratee`. The corresponding value of
* each key is the last element responsible for generating the key. The
* iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee to transform keys.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* var array = [
* { 'dir': 'left', 'code': 97 },
* { 'dir': 'right', 'code': 100 }
* ];
*
* _.keyBy(array, function(o) {
* return String.fromCharCode(o.code);
* });
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*
* _.keyBy(array, 'dir');
* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
*/
var keyBy = createAggregator(function(result, value, key) {
baseAssignValue(result, key, value);
});
/**
* Creates an array of values by running each element in `collection` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
*
* The guarded methods are:
* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
* `template`, `trim`, `trimEnd`, `trimStart`, and `words`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
* @example
*
* function square(n) {
* return n * n;
* }
*
* _.map([4, 8], square);
* // => [16, 64]
*
* _.map({ 'a': 4, 'b': 8 }, square);
* // => [16, 64] (iteration order is not guaranteed)
*
* var users = [
* { 'user': 'barney' },
* { 'user': 'fred' }
* ];
*
* // The `_.property` iteratee shorthand.
* _.map(users, 'user');
* // => ['barney', 'fred']
*/
function map(collection, iteratee) {
var func = isArray(collection) ? arrayMap : baseMap;
return func(collection, getIteratee(iteratee, 3));
}
/**
* This method is like `_.sortBy` except that it allows specifying the sort
* orders of the iteratees to sort by. If `orders` is unspecified, all values
* are sorted in ascending order. Otherwise, specify an order of "desc" for
* descending or "asc" for ascending sort order of corresponding values.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
* The iteratees to sort by.
* @param {string[]} [orders] The sort orders of `iteratees`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 34 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 36 }
* ];
*
* // Sort by `user` in ascending order and by `age` in descending order.
* _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*/
function orderBy(collection, iteratees, orders, guard) {
if (collection == null) {
return [];
}
if (!isArray(iteratees)) {
iteratees = iteratees == null ? [] : [iteratees];
}
orders = guard ? undefined : orders;
if (!isArray(orders)) {
orders = orders == null ? [] : [orders];
}
return baseOrderBy(collection, iteratees, orders);
}
/**
* Creates an array of elements split into two groups, the first of which
* contains elements `predicate` returns truthy for, the second of which
* contains elements `predicate` returns falsey for. The predicate is
* invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the array of grouped elements.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': true },
* { 'user': 'pebbles', 'age': 1, 'active': false }
* ];
*
* _.partition(users, function(o) { return o.active; });
* // => objects for [['fred'], ['barney', 'pebbles']]
*
* // The `_.matches` iteratee shorthand.
* _.partition(users, { 'age': 1, 'active': false });
* // => objects for [['pebbles'], ['barney', 'fred']]
*
* // The `_.matchesProperty` iteratee shorthand.
* _.partition(users, ['active', false]);
* // => objects for [['barney', 'pebbles'], ['fred']]
*
* // The `_.property` iteratee shorthand.
* _.partition(users, 'active');
* // => objects for [['fred'], ['barney', 'pebbles']]
*/
var partition = createAggregator(function(result, value, key) {
result[key ? 0 : 1].push(value);
}, function() { return [[], []]; });
/**
* Reduces `collection` to a value which is the accumulated result of running
* each element in `collection` thru `iteratee`, where each successive
* invocation is supplied the return value of the previous. If `accumulator`
* is not given, the first element of `collection` is used as the initial
* value. The iteratee is invoked with four arguments:
* (accumulator, value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.reduce`, `_.reduceRight`, and `_.transform`.
*
* The guarded methods are:
* `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
* and `sortBy`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @see _.reduceRight
* @example
*
* _.reduce([1, 2], function(sum, n) {
* return sum + n;
* }, 0);
* // => 3
*
* _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* return result;
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
*/
function reduce(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduce : baseReduce,
initAccum = arguments.length < 3;
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
}
/**
* This method is like `_.reduce` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @see _.reduce
* @example
*
* var array = [[0, 1], [2, 3], [4, 5]];
*
* _.reduceRight(array, function(flattened, other) {
* return flattened.concat(other);
* }, []);
* // => [4, 5, 2, 3, 0, 1]
*/
function reduceRight(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduceRight : baseReduce,
initAccum = arguments.length < 3;
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
}
/**
* The opposite of `_.filter`; this method returns the elements of `collection`
* that `predicate` does **not** return truthy for.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
* @see _.filter
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': true }
* ];
*
* _.reject(users, function(o) { return !o.active; });
* // => objects for ['fred']
*
* // The `_.matches` iteratee shorthand.
* _.reject(users, { 'age': 40, 'active': true });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.reject(users, ['active', false]);
* // => objects for ['fred']
*
* // The `_.property` iteratee shorthand.
* _.reject(users, 'active');
* // => objects for ['barney']
*/
function reject(collection, predicate) {
var func = isArray(collection) ? arrayFilter : baseFilter;
return func(collection, negate(getIteratee(predicate, 3)));
}
/**
* Gets a random element from `collection`.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Collection
* @param {Array|Object} collection The collection to sample.
* @returns {*} Returns the random element.
* @example
*
* _.sample([1, 2, 3, 4]);
* // => 2
*/
function sample(collection) {
var func = isArray(collection) ? arraySample : baseSample;
return func(collection);
}
/**
* Gets `n` random elements at unique keys from `collection` up to the
* size of `collection`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to sample.
* @param {number} [n=1] The number of elements to sample.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the random elements.
* @example
*
* _.sampleSize([1, 2, 3], 2);
* // => [3, 1]
*
* _.sampleSize([1, 2, 3], 4);
* // => [2, 3, 1]
*/
function sampleSize(collection, n, guard) {
if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
n = 1;
} else {
n = toInteger(n);
}
var func = isArray(collection) ? arraySampleSize : baseSampleSize;
return func(collection, n);
}
/**
* Creates an array of shuffled values, using a version of the
* [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to shuffle.
* @returns {Array} Returns the new shuffled array.
* @example
*
* _.shuffle([1, 2, 3, 4]);
* // => [4, 1, 3, 2]
*/
function shuffle(collection) {
var func = isArray(collection) ? arrayShuffle : baseShuffle;
return func(collection);
}
/**
* Gets the size of `collection` by returning its length for array-like
* values or the number of own enumerable string keyed properties for objects.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object|string} collection The collection to inspect.
* @returns {number} Returns the collection size.
* @example
*
* _.size([1, 2, 3]);
* // => 3
*
* _.size({ 'a': 1, 'b': 2 });
* // => 2
*
* _.size('pebbles');
* // => 7
*/
function size(collection) {
if (collection == null) {
return 0;
}
if (isArrayLike(collection)) {
return isString(collection) ? stringSize(collection) : collection.length;
}
var tag = getTag(collection);
if (tag == mapTag || tag == setTag) {
return collection.size;
}
return baseKeys(collection).length;
}
/**
* Checks if `predicate` returns truthy for **any** element of `collection`.
* Iteration is stopped once `predicate` returns truthy. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
* @example
*
* _.some([null, 0, 'yes', false], Boolean);
* // => true
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.some(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.some(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.some(users, 'active');
* // => true
*/
function some(collection, predicate, guard) {
var func = isArray(collection) ? arraySome : baseSome;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, getIteratee(predicate, 3));
}
/**
* Creates an array of elements, sorted in ascending order by the results of
* running each element in a collection thru each iteratee. This method
* performs a stable sort, that is, it preserves the original sort order of
* equal elements. The iteratees are invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {...(Function|Function[])} [iteratees=[_.identity]]
* The iteratees to sort by.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 34 }
* ];
*
* _.sortBy(users, [function(o) { return o.user; }]);
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*
* _.sortBy(users, ['user', 'age']);
* // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
*/
var sortBy = baseRest(function(collection, iteratees) {
if (collection == null) {
return [];
}
var length = iteratees.length;
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
iteratees = [];
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
iteratees = [iteratees[0]];
}
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
});
/*------------------------------------------------------------------------*/
/**
* Gets the timestamp of the number of milliseconds that have elapsed since
* the Unix epoch (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Date
* @returns {number} Returns the timestamp.
* @example
*
* _.defer(function(stamp) {
* console.log(_.now() - stamp);
* }, _.now());
* // => Logs the number of milliseconds it took for the deferred invocation.
*/
var now = ctxNow || function() {
return root.Date.now();
};
/*------------------------------------------------------------------------*/
/**
* The opposite of `_.before`; this method creates a function that invokes
* `func` once it's called `n` or more times.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {number} n The number of calls before `func` is invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var saves = ['profile', 'settings'];
*
* var done = _.after(saves.length, function() {
* console.log('done saving!');
* });
*
* _.forEach(saves, function(type) {
* asyncSave({ 'type': type, 'complete': done });
* });
* // => Logs 'done saving!' after the two async saves have completed.
*/
function after(n, func) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
return function() {
if (--n < 1) {
return func.apply(this, arguments);
}
};
}
/**
* Creates a function that invokes `func`, with up to `n` arguments,
* ignoring any additional arguments.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to cap arguments for.
* @param {number} [n=func.length] The arity cap.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new capped function.
* @example
*
* _.map(['6', '8', '10'], _.ary(parseInt, 1));
* // => [6, 8, 10]
*/
function ary(func, n, guard) {
n = guard ? undefined : n;
n = (func && n == null) ? func.length : n;
return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
}
/**
* Creates a function that invokes `func`, with the `this` binding and arguments
* of the created function, while it's called less than `n` times. Subsequent
* calls to the created function return the result of the last `func` invocation.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {number} n The number of calls at which `func` is no longer invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* jQuery(element).on('click', _.before(5, addContactToList));
* // => Allows adding up to 4 contacts to the list.
*/
function before(n, func) {
var result;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
return function() {
if (--n > 0) {
result = func.apply(this, arguments);
}
if (n <= 1) {
func = undefined;
}
return result;
};
}
/**
* Creates a function that invokes `func` with the `this` binding of `thisArg`
* and `partials` prepended to the arguments it receives.
*
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for partially applied arguments.
*
* **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
* property of bound functions.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to bind.
* @param {*} thisArg The `this` binding of `func`.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* function greet(greeting, punctuation) {
* return greeting + ' ' + this.user + punctuation;
* }
*
* var object = { 'user': 'fred' };
*
* var bound = _.bind(greet, object, 'hi');
* bound('!');
* // => 'hi fred!'
*
* // Bound with placeholders.
* var bound = _.bind(greet, object, _, '!');
* bound('hi');
* // => 'hi fred!'
*/
var bind = baseRest(function(func, thisArg, partials) {
var bitmask = WRAP_BIND_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, getHolder(bind));
bitmask |= WRAP_PARTIAL_FLAG;
}
return createWrap(func, bitmask, thisArg, partials, holders);
});
/**
* Creates a function that invokes the method at `object[key]` with `partials`
* prepended to the arguments it receives.
*
* This method differs from `_.bind` by allowing bound functions to reference
* methods that may be redefined or don't yet exist. See
* [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
* for more details.
*
* The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* @static
* @memberOf _
* @since 0.10.0
* @category Function
* @param {Object} object The object to invoke the method on.
* @param {string} key The key of the method.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* var object = {
* 'user': 'fred',
* 'greet': function(greeting, punctuation) {
* return greeting + ' ' + this.user + punctuation;
* }
* };
*
* var bound = _.bindKey(object, 'greet', 'hi');
* bound('!');
* // => 'hi fred!'
*
* object.greet = function(greeting, punctuation) {
* return greeting + 'ya ' + this.user + punctuation;
* };
*
* bound('!');
* // => 'hiya fred!'
*
* // Bound with placeholders.
* var bound = _.bindKey(object, 'greet', _, '!');
* bound('hi');
* // => 'hiya fred!'
*/
var bindKey = baseRest(function(object, key, partials) {
var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, getHolder(bindKey));
bitmask |= WRAP_PARTIAL_FLAG;
}
return createWrap(key, bitmask, object, partials, holders);
});
/**
* Creates a function that accepts arguments of `func` and either invokes
* `func` returning its result, if at least `arity` number of arguments have
* been provided, or returns a function that accepts the remaining `func`
* arguments, and so on. The arity of `func` may be specified if `func.length`
* is not sufficient.
*
* The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curry(abc);
*
* curried(1)(2)(3);
* // => [1, 2, 3]
*
* curried(1, 2)(3);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // Curried with placeholders.
* curried(1)(_, 3)(2);
* // => [1, 2, 3]
*/
function curry(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curry.placeholder;
return result;
}
/**
* This method is like `_.curry` except that arguments are applied to `func`
* in the manner of `_.partialRight` instead of `_.partial`.
*
* The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curryRight(abc);
*
* curried(3)(2)(1);
* // => [1, 2, 3]
*
* curried(2, 3)(1);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // Curried with placeholders.
* curried(3)(1, _)(2);
* // => [1, 2, 3]
*/
function curryRight(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curryRight.placeholder;
return result;
}
/**
* Creates a debounced function that delays invoking `func` until after `wait`
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide `options` to indicate whether `func` should be invoked on the
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent
* calls to the debounced function return the result of the last `func`
* invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the debounced function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to debounce.
* @param {number} [wait=0] The number of milliseconds to delay.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=false]
* Specify invoking on the leading edge of the timeout.
* @param {number} [options.maxWait]
* The maximum time `func` is allowed to be delayed before it's invoked.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* // Avoid costly calculations while the window size is in flux.
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
*
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
* jQuery(element).on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* }));
*
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
* var source = new EventSource('/stream');
* jQuery(source).on('message', debounced);
*
* // Cancel the trailing debounced invocation.
* jQuery(window).on('popstate', debounced.cancel);
*/
function debounce(func, wait, options) {
var lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime,
lastInvokeTime = 0,
leading = false,
maxing = false,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber(wait) || 0;
if (isObject(options)) {
leading = !!options.leading;
maxing = 'maxWait' in options;
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs,
thisArg = lastThis;
lastArgs = lastThis = undefined;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
// Reset any `maxWait` timer.
lastInvokeTime = time;
// Start the timer for the trailing edge.
timerId = setTimeout(timerExpired, wait);
// Invoke the leading edge.
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime,
result = wait - timeSinceLastCall;
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime;
// Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit.
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
}
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
// Restart the timer.
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = undefined;
// Only invoke if we have `lastArgs` which means `func` has been
// debounced at least once.
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = undefined;
return result;
}
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = undefined;
}
function flush() {
return timerId === undefined ? result : trailingEdge(now());
}
function debounced() {
var time = now(),
isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === undefined) {
return leadingEdge(lastCallTime);
}
if (maxing) {
// Handle invocations in a tight loop.
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === undefined) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
/**
* Defers invoking the `func` until the current call stack has cleared. Any
* additional arguments are provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to defer.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {number} Returns the timer id.
* @example
*
* _.defer(function(text) {
* console.log(text);
* }, 'deferred');
* // => Logs 'deferred' after one millisecond.
*/
var defer = baseRest(function(func, args) {
return baseDelay(func, 1, args);
});
/**
* Invokes `func` after `wait` milliseconds. Any additional arguments are
* provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {number} Returns the timer id.
* @example
*
* _.delay(function(text) {
* console.log(text);
* }, 1000, 'later');
* // => Logs 'later' after one second.
*/
var delay = baseRest(function(func, wait, args) {
return baseDelay(func, toNumber(wait) || 0, args);
});
/**
* Creates a function that invokes `func` with arguments reversed.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to flip arguments for.
* @returns {Function} Returns the new flipped function.
* @example
*
* var flipped = _.flip(function() {
* return _.toArray(arguments);
* });
*
* flipped('a', 'b', 'c', 'd');
* // => ['d', 'c', 'b', 'a']
*/
function flip(func) {
return createWrap(func, WRAP_FLIP_FLAG);
}
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoized function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // Modify the result cache.
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // Replace `_.memoize.Cache`.
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result) || cache;
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Expose `MapCache`.
memoize.Cache = MapCache;
/**
* Creates a function that negates the result of the predicate `func`. The
* `func` predicate is invoked with the `this` binding and arguments of the
* created function.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} predicate The predicate to negate.
* @returns {Function} Returns the new negated function.
* @example
*
* function isEven(n) {
* return n % 2 == 0;
* }
*
* _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
* // => [1, 3, 5]
*/
function negate(predicate) {
if (typeof predicate != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return function() {
var args = arguments;
switch (args.length) {
case 0: return !predicate.call(this);
case 1: return !predicate.call(this, args[0]);
case 2: return !predicate.call(this, args[0], args[1]);
case 3: return !predicate.call(this, args[0], args[1], args[2]);
}
return !predicate.apply(this, args);
};
}
/**
* Creates a function that is restricted to invoking `func` once. Repeat calls
* to the function return the value of the first invocation. The `func` is
* invoked with the `this` binding and arguments of the created function.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var initialize = _.once(createApplication);
* initialize();
* initialize();
* // => `createApplication` is invoked once
*/
function once(func) {
return before(2, func);
}
/**
* Creates a function that invokes `func` with its arguments transformed.
*
* @static
* @since 4.0.0
* @memberOf _
* @category Function
* @param {Function} func The function to wrap.
* @param {...(Function|Function[])} [transforms=[_.identity]]
* The argument transforms.
* @returns {Function} Returns the new function.
* @example
*
* function doubled(n) {
* return n * 2;
* }
*
* function square(n) {
* return n * n;
* }
*
* var func = _.overArgs(function(x, y) {
* return [x, y];
* }, [square, doubled]);
*
* func(9, 3);
* // => [81, 6]
*
* func(10, 5);
* // => [100, 10]
*/
var overArgs = castRest(function(func, transforms) {
transforms = (transforms.length == 1 && isArray(transforms[0]))
? arrayMap(transforms[0], baseUnary(getIteratee()))
: arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
var funcsLength = transforms.length;
return baseRest(function(args) {
var index = -1,
length = nativeMin(args.length, funcsLength);
while (++index < length) {
args[index] = transforms[index].call(this, args[index]);
}
return apply(func, this, args);
});
});
/**
* Creates a function that invokes `func` with `partials` prepended to the
* arguments it receives. This method is like `_.bind` except it does **not**
* alter the `this` binding.
*
* The `_.partial.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* **Note:** This method doesn't set the "length" property of partially
* applied functions.
*
* @static
* @memberOf _
* @since 0.2.0
* @category Function
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* function greet(greeting, name) {
* return greeting + ' ' + name;
* }
*
* var sayHelloTo = _.partial(greet, 'hello');
* sayHelloTo('fred');
* // => 'hello fred'
*
* // Partially applied with placeholders.
* var greetFred = _.partial(greet, _, 'fred');
* greetFred('hi');
* // => 'hi fred'
*/
var partial = baseRest(function(func, partials) {
var holders = replaceHolders(partials, getHolder(partial));
return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
});
/**
* This method is like `_.partial` except that partially applied arguments
* are appended to the arguments it receives.
*
* The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* **Note:** This method doesn't set the "length" property of partially
* applied functions.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Function
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* function greet(greeting, name) {
* return greeting + ' ' + name;
* }
*
* var greetFred = _.partialRight(greet, 'fred');
* greetFred('hi');
* // => 'hi fred'
*
* // Partially applied with placeholders.
* var sayHelloTo = _.partialRight(greet, 'hello', _);
* sayHelloTo('fred');
* // => 'hello fred'
*/
var partialRight = baseRest(function(func, partials) {
var holders = replaceHolders(partials, getHolder(partialRight));
return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
});
/**
* Creates a function that invokes `func` with arguments arranged according
* to the specified `indexes` where the argument value at the first index is
* provided as the first argument, the argument value at the second index is
* provided as the second argument, and so on.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to rearrange arguments for.
* @param {...(number|number[])} indexes The arranged argument indexes.
* @returns {Function} Returns the new function.
* @example
*
* var rearged = _.rearg(function(a, b, c) {
* return [a, b, c];
* }, [2, 0, 1]);
*
* rearged('b', 'c', 'a')
* // => ['a', 'b', 'c']
*/
var rearg = flatRest(function(func, indexes) {
return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
});
/**
* Creates a function that invokes `func` with the `this` binding of the
* created function and arguments from `start` and beyond provided as
* an array.
*
* **Note:** This method is based on the
* [rest parameter](https://mdn.io/rest_parameters).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.rest(function(what, names) {
* return what + ' ' + _.initial(names).join(', ') +
* (_.size(names) > 1 ? ', & ' : '') + _.last(names);
* });
*
* say('hello', 'fred', 'barney', 'pebbles');
* // => 'hello fred, barney, & pebbles'
*/
function rest(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = start === undefined ? start : toInteger(start);
return baseRest(func, start);
}
/**
* Creates a function that invokes `func` with the `this` binding of the
* create function and an array of arguments much like
* [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
*
* **Note:** This method is based on the
* [spread operator](https://mdn.io/spread_operator).
*
* @static
* @memberOf _
* @since 3.2.0
* @category Function
* @param {Function} func The function to spread arguments over.
* @param {number} [start=0] The start position of the spread.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.spread(function(who, what) {
* return who + ' says ' + what;
* });
*
* say(['fred', 'hello']);
* // => 'fred says hello'
*
* var numbers = Promise.all([
* Promise.resolve(40),
* Promise.resolve(36)
* ]);
*
* numbers.then(_.spread(function(x, y) {
* return x + y;
* }));
* // => a Promise of 76
*/
function spread(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = start == null ? 0 : nativeMax(toInteger(start), 0);
return baseRest(function(args) {
var array = args[start],
otherArgs = castSlice(args, 0, start);
if (array) {
arrayPush(otherArgs, array);
}
return apply(func, this, otherArgs);
});
}
/**
* Creates a throttled function that only invokes `func` at most once per
* every `wait` milliseconds. The throttled function comes with a `cancel`
* method to cancel delayed `func` invocations and a `flush` method to
* immediately invoke them. Provide `options` to indicate whether `func`
* should be invoked on the leading and/or trailing edge of the `wait`
* timeout. The `func` is invoked with the last arguments provided to the
* throttled function. Subsequent calls to the throttled function return the
* result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the throttled function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.throttle` and `_.debounce`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to throttle.
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=true]
* Specify invoking on the leading edge of the timeout.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new throttled function.
* @example
*
* // Avoid excessively updating the position while scrolling.
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
*
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
* jQuery(element).on('click', throttled);
*
* // Cancel the trailing throttled invocation.
* jQuery(window).on('popstate', throttled.cancel);
*/
function throttle(func, wait, options) {
var leading = true,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (isObject(options)) {
leading = 'leading' in options ? !!options.leading : leading;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
return debounce(func, wait, {
'leading': leading,
'maxWait': wait,
'trailing': trailing
});
}
/**
* Creates a function that accepts up to one argument, ignoring any
* additional arguments.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
* @example
*
* _.map(['6', '8', '10'], _.unary(parseInt));
* // => [6, 8, 10]
*/
function unary(func) {
return ary(func, 1);
}
/**
* Creates a function that provides `value` to `wrapper` as its first
* argument. Any additional arguments provided to the function are appended
* to those provided to the `wrapper`. The wrapper is invoked with the `this`
* binding of the created function.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {*} value The value to wrap.
* @param {Function} [wrapper=identity] The wrapper function.
* @returns {Function} Returns the new function.
* @example
*
* var p = _.wrap(_.escape, function(func, text) {
* return '' + func(text) + '
';
* });
*
* p('fred, barney, & pebbles');
* // => 'fred, barney, & pebbles
'
*/
function wrap(value, wrapper) {
return partial(castFunction(wrapper), value);
}
/*------------------------------------------------------------------------*/
/**
* Casts `value` as an array if it's not one.
*
* @static
* @memberOf _
* @since 4.4.0
* @category Lang
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast array.
* @example
*
* _.castArray(1);
* // => [1]
*
* _.castArray({ 'a': 1 });
* // => [{ 'a': 1 }]
*
* _.castArray('abc');
* // => ['abc']
*
* _.castArray(null);
* // => [null]
*
* _.castArray(undefined);
* // => [undefined]
*
* _.castArray();
* // => []
*
* var array = [1, 2, 3];
* console.log(_.castArray(array) === array);
* // => true
*/
function castArray() {
if (!arguments.length) {
return [];
}
var value = arguments[0];
return isArray(value) ? value : [value];
}
/**
* Creates a shallow clone of `value`.
*
* **Note:** This method is loosely based on the
* [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
* and supports cloning arrays, array buffers, booleans, date objects, maps,
* numbers, `Object` objects, regexes, sets, strings, symbols, and typed
* arrays. The own enumerable properties of `arguments` objects are cloned
* as plain objects. An empty object is returned for uncloneable values such
* as error objects, functions, DOM nodes, and WeakMaps.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to clone.
* @returns {*} Returns the cloned value.
* @see _.cloneDeep
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var shallow = _.clone(objects);
* console.log(shallow[0] === objects[0]);
* // => true
*/
function clone(value) {
return baseClone(value, CLONE_SYMBOLS_FLAG);
}
/**
* This method is like `_.clone` except that it accepts `customizer` which
* is invoked to produce the cloned value. If `customizer` returns `undefined`,
* cloning is handled by the method instead. The `customizer` is invoked with
* up to four arguments; (value [, index|key, object, stack]).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to clone.
* @param {Function} [customizer] The function to customize cloning.
* @returns {*} Returns the cloned value.
* @see _.cloneDeepWith
* @example
*
* function customizer(value) {
* if (_.isElement(value)) {
* return value.cloneNode(false);
* }
* }
*
* var el = _.cloneWith(document.body, customizer);
*
* console.log(el === document.body);
* // => false
* console.log(el.nodeName);
* // => 'BODY'
* console.log(el.childNodes.length);
* // => 0
*/
function cloneWith(value, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
}
/**
* This method is like `_.clone` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Lang
* @param {*} value The value to recursively clone.
* @returns {*} Returns the deep cloned value.
* @see _.clone
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var deep = _.cloneDeep(objects);
* console.log(deep[0] === objects[0]);
* // => false
*/
function cloneDeep(value) {
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
}
/**
* This method is like `_.cloneWith` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to recursively clone.
* @param {Function} [customizer] The function to customize cloning.
* @returns {*} Returns the deep cloned value.
* @see _.cloneWith
* @example
*
* function customizer(value) {
* if (_.isElement(value)) {
* return value.cloneNode(true);
* }
* }
*
* var el = _.cloneDeepWith(document.body, customizer);
*
* console.log(el === document.body);
* // => false
* console.log(el.nodeName);
* // => 'BODY'
* console.log(el.childNodes.length);
* // => 20
*/
function cloneDeepWith(value, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
}
/**
* Checks if `object` conforms to `source` by invoking the predicate
* properties of `source` with the corresponding property values of `object`.
*
* **Note:** This method is equivalent to `_.conforms` when `source` is
* partially applied.
*
* @static
* @memberOf _
* @since 4.14.0
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property predicates to conform to.
* @returns {boolean} Returns `true` if `object` conforms, else `false`.
* @example
*
* var object = { 'a': 1, 'b': 2 };
*
* _.conformsTo(object, { 'b': function(n) { return n > 1; } });
* // => true
*
* _.conformsTo(object, { 'b': function(n) { return n > 2; } });
* // => false
*/
function conformsTo(object, source) {
return source == null || baseConformsTo(object, source, keys(source));
}
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is greater than `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than `other`,
* else `false`.
* @see _.lt
* @example
*
* _.gt(3, 1);
* // => true
*
* _.gt(3, 3);
* // => false
*
* _.gt(1, 3);
* // => false
*/
var gt = createRelationalOperation(baseGt);
/**
* Checks if `value` is greater than or equal to `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than or equal to
* `other`, else `false`.
* @see _.lte
* @example
*
* _.gte(3, 1);
* // => true
*
* _.gte(3, 3);
* // => true
*
* _.gte(1, 3);
* // => false
*/
var gte = createRelationalOperation(function(value, other) {
return value >= other;
});
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee');
};
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* Checks if `value` is classified as an `ArrayBuffer` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
* @example
*
* _.isArrayBuffer(new ArrayBuffer(2));
* // => true
*
* _.isArrayBuffer(new Array(2));
* // => false
*/
var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
/**
* Checks if `value` is classified as a boolean primitive or object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
* @example
*
* _.isBoolean(false);
* // => true
*
* _.isBoolean(null);
* // => false
*/
function isBoolean(value) {
return value === true || value === false ||
(isObjectLike(value) && baseGetTag(value) == boolTag);
}
/**
* Checks if `value` is a buffer.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
* @example
*
* _.isBuffer(new Buffer(2));
* // => true
*
* _.isBuffer(new Uint8Array(2));
* // => false
*/
var isBuffer = nativeIsBuffer || stubFalse;
/**
* Checks if `value` is classified as a `Date` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a date object, else `false`.
* @example
*
* _.isDate(new Date);
* // => true
*
* _.isDate('Mon April 23 2012');
* // => false
*/
var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
/**
* Checks if `value` is likely a DOM element.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
* @example
*
* _.isElement(document.body);
* // => true
*
* _.isElement('');
* // => false
*/
function isElement(value) {
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
}
/**
* Checks if `value` is an empty object, collection, map, or set.
*
* Objects are considered empty if they have no own enumerable string keyed
* properties.
*
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
* jQuery-like collections are considered empty if they have a `length` of `0`.
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
* @example
*
* _.isEmpty(null);
* // => true
*
* _.isEmpty(true);
* // => true
*
* _.isEmpty(1);
* // => true
*
* _.isEmpty([1, 2, 3]);
* // => false
*
* _.isEmpty({ 'a': 1 });
* // => false
*/
function isEmpty(value) {
if (value == null) {
return true;
}
if (isArrayLike(value) &&
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
isBuffer(value) || isTypedArray(value) || isArguments(value))) {
return !value.length;
}
var tag = getTag(value);
if (tag == mapTag || tag == setTag) {
return !value.size;
}
if (isPrototype(value)) {
return !baseKeys(value).length;
}
for (var key in value) {
if (hasOwnProperty.call(value, key)) {
return false;
}
}
return true;
}
/**
* Performs a deep comparison between two values to determine if they are
* equivalent.
*
* **Note:** This method supports comparing arrays, array buffers, booleans,
* date objects, error objects, maps, numbers, `Object` objects, regexes,
* sets, strings, symbols, and typed arrays. `Object` objects are compared
* by their own, not inherited, enumerable properties. Functions and DOM
* nodes are compared by strict equality, i.e. `===`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.isEqual(object, other);
* // => true
*
* object === other;
* // => false
*/
function isEqual(value, other) {
return baseIsEqual(value, other);
}
/**
* This method is like `_.isEqual` except that it accepts `customizer` which
* is invoked to compare values. If `customizer` returns `undefined`, comparisons
* are handled by the method instead. The `customizer` is invoked with up to
* six arguments: (objValue, othValue [, index|key, object, other, stack]).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* function isGreeting(value) {
* return /^h(?:i|ello)$/.test(value);
* }
*
* function customizer(objValue, othValue) {
* if (isGreeting(objValue) && isGreeting(othValue)) {
* return true;
* }
* }
*
* var array = ['hello', 'goodbye'];
* var other = ['hi', 'goodbye'];
*
* _.isEqualWith(array, other, customizer);
* // => true
*/
function isEqualWith(value, other, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
var result = customizer ? customizer(value, other) : undefined;
return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
}
/**
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
* `SyntaxError`, `TypeError`, or `URIError` object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an error object, else `false`.
* @example
*
* _.isError(new Error);
* // => true
*
* _.isError(Error);
* // => false
*/
function isError(value) {
if (!isObjectLike(value)) {
return false;
}
var tag = baseGetTag(value);
return tag == errorTag || tag == domExcTag ||
(typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
}
/**
* Checks if `value` is a finite primitive number.
*
* **Note:** This method is based on
* [`Number.isFinite`](https://mdn.io/Number/isFinite).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
* @example
*
* _.isFinite(3);
* // => true
*
* _.isFinite(Number.MIN_VALUE);
* // => true
*
* _.isFinite(Infinity);
* // => false
*
* _.isFinite('3');
* // => false
*/
function isFinite(value) {
return typeof value == 'number' && nativeIsFinite(value);
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
if (!isObject(value)) {
return false;
}
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
/**
* Checks if `value` is an integer.
*
* **Note:** This method is based on
* [`Number.isInteger`](https://mdn.io/Number/isInteger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an integer, else `false`.
* @example
*
* _.isInteger(3);
* // => true
*
* _.isInteger(Number.MIN_VALUE);
* // => false
*
* _.isInteger(Infinity);
* // => false
*
* _.isInteger('3');
* // => false
*/
function isInteger(value) {
return typeof value == 'number' && value == toInteger(value);
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
/**
* Checks if `value` is classified as a `Map` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
* @example
*
* _.isMap(new Map);
* // => true
*
* _.isMap(new WeakMap);
* // => false
*/
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
/**
* Performs a partial deep comparison between `object` and `source` to
* determine if `object` contains equivalent property values.
*
* **Note:** This method is equivalent to `_.matches` when `source` is
* partially applied.
*
* Partial comparisons will match empty array and empty object `source`
* values against any array or object value, respectively. See `_.isEqual`
* for a list of supported value comparisons.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
* @example
*
* var object = { 'a': 1, 'b': 2 };
*
* _.isMatch(object, { 'b': 2 });
* // => true
*
* _.isMatch(object, { 'b': 1 });
* // => false
*/
function isMatch(object, source) {
return object === source || baseIsMatch(object, source, getMatchData(source));
}
/**
* This method is like `_.isMatch` except that it accepts `customizer` which
* is invoked to compare values. If `customizer` returns `undefined`, comparisons
* are handled by the method instead. The `customizer` is invoked with five
* arguments: (objValue, srcValue, index|key, object, source).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
* @example
*
* function isGreeting(value) {
* return /^h(?:i|ello)$/.test(value);
* }
*
* function customizer(objValue, srcValue) {
* if (isGreeting(objValue) && isGreeting(srcValue)) {
* return true;
* }
* }
*
* var object = { 'greeting': 'hello' };
* var source = { 'greeting': 'hi' };
*
* _.isMatchWith(object, source, customizer);
* // => true
*/
function isMatchWith(object, source, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return baseIsMatch(object, source, getMatchData(source), customizer);
}
/**
* Checks if `value` is `NaN`.
*
* **Note:** This method is based on
* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
* `undefined` and other non-number values.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
* @example
*
* _.isNaN(NaN);
* // => true
*
* _.isNaN(new Number(NaN));
* // => true
*
* isNaN(undefined);
* // => true
*
* _.isNaN(undefined);
* // => false
*/
function isNaN(value) {
// An `NaN` primitive is the only value that is not equal to itself.
// Perform the `toStringTag` check first to avoid errors with some
// ActiveX objects in IE.
return isNumber(value) && value != +value;
}
/**
* Checks if `value` is a pristine native function.
*
* **Note:** This method can't reliably detect native functions in the presence
* of the core-js package because core-js circumvents this kind of detection.
* Despite multiple requests, the core-js maintainer has made it clear: any
* attempt to fix the detection will be obstructed. As a result, we're left
* with little choice but to throw an error. Unfortunately, this also affects
* packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
* which rely on core-js.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
* @example
*
* _.isNative(Array.prototype.push);
* // => true
*
* _.isNative(_);
* // => false
*/
function isNative(value) {
if (isMaskable(value)) {
throw new Error(CORE_ERROR_TEXT);
}
return baseIsNative(value);
}
/**
* Checks if `value` is `null`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `null`, else `false`.
* @example
*
* _.isNull(null);
* // => true
*
* _.isNull(void 0);
* // => false
*/
function isNull(value) {
return value === null;
}
/**
* Checks if `value` is `null` or `undefined`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is nullish, else `false`.
* @example
*
* _.isNil(null);
* // => true
*
* _.isNil(void 0);
* // => true
*
* _.isNil(NaN);
* // => false
*/
function isNil(value) {
return value == null;
}
/**
* Checks if `value` is classified as a `Number` primitive or object.
*
* **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
* classified as numbers, use the `_.isFinite` method.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a number, else `false`.
* @example
*
* _.isNumber(3);
* // => true
*
* _.isNumber(Number.MIN_VALUE);
* // => true
*
* _.isNumber(Infinity);
* // => true
*
* _.isNumber('3');
* // => false
*/
function isNumber(value) {
return typeof value == 'number' ||
(isObjectLike(value) && baseGetTag(value) == numberTag);
}
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString;
}
/**
* Checks if `value` is classified as a `RegExp` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
* @example
*
* _.isRegExp(/abc/);
* // => true
*
* _.isRegExp('/abc/');
* // => false
*/
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
/**
* Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
* double precision number which isn't the result of a rounded unsafe integer.
*
* **Note:** This method is based on
* [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
* @example
*
* _.isSafeInteger(3);
* // => true
*
* _.isSafeInteger(Number.MIN_VALUE);
* // => false
*
* _.isSafeInteger(Infinity);
* // => false
*
* _.isSafeInteger('3');
* // => false
*/
function isSafeInteger(value) {
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is classified as a `Set` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
* @example
*
* _.isSet(new Set);
* // => true
*
* _.isSet(new WeakSet);
* // => false
*/
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
}
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && baseGetTag(value) == symbolTag);
}
/**
* Checks if `value` is classified as a typed array.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
* @example
*
* _.isTypedArray(new Uint8Array);
* // => true
*
* _.isTypedArray([]);
* // => false
*/
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
/**
* Checks if `value` is `undefined`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
* @example
*
* _.isUndefined(void 0);
* // => true
*
* _.isUndefined(null);
* // => false
*/
function isUndefined(value) {
return value === undefined;
}
/**
* Checks if `value` is classified as a `WeakMap` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
* @example
*
* _.isWeakMap(new WeakMap);
* // => true
*
* _.isWeakMap(new Map);
* // => false
*/
function isWeakMap(value) {
return isObjectLike(value) && getTag(value) == weakMapTag;
}
/**
* Checks if `value` is classified as a `WeakSet` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
* @example
*
* _.isWeakSet(new WeakSet);
* // => true
*
* _.isWeakSet(new Set);
* // => false
*/
function isWeakSet(value) {
return isObjectLike(value) && baseGetTag(value) == weakSetTag;
}
/**
* Checks if `value` is less than `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than `other`,
* else `false`.
* @see _.gt
* @example
*
* _.lt(1, 3);
* // => true
*
* _.lt(3, 3);
* // => false
*
* _.lt(3, 1);
* // => false
*/
var lt = createRelationalOperation(baseLt);
/**
* Checks if `value` is less than or equal to `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than or equal to
* `other`, else `false`.
* @see _.gte
* @example
*
* _.lte(1, 3);
* // => true
*
* _.lte(3, 3);
* // => true
*
* _.lte(3, 1);
* // => false
*/
var lte = createRelationalOperation(function(value, other) {
return value <= other;
});
/**
* Converts `value` to an array.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to convert.
* @returns {Array} Returns the converted array.
* @example
*
* _.toArray({ 'a': 1, 'b': 2 });
* // => [1, 2]
*
* _.toArray('abc');
* // => ['a', 'b', 'c']
*
* _.toArray(1);
* // => []
*
* _.toArray(null);
* // => []
*/
function toArray(value) {
if (!value) {
return [];
}
if (isArrayLike(value)) {
return isString(value) ? stringToArray(value) : copyArray(value);
}
if (symIterator && value[symIterator]) {
return iteratorToArray(value[symIterator]());
}
var tag = getTag(value),
func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
return func(value);
}
/**
* Converts `value` to a finite number.
*
* @static
* @memberOf _
* @since 4.12.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted number.
* @example
*
* _.toFinite(3.2);
* // => 3.2
*
* _.toFinite(Number.MIN_VALUE);
* // => 5e-324
*
* _.toFinite(Infinity);
* // => 1.7976931348623157e+308
*
* _.toFinite('3.2');
* // => 3.2
*/
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3.2);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
* // => 0
*
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3.2');
* // => 3
*/
function toInteger(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? (remainder ? result - remainder : result) : 0;
}
/**
* Converts `value` to an integer suitable for use as the length of an
* array-like object.
*
* **Note:** This method is based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toLength(3.2);
* // => 3
*
* _.toLength(Number.MIN_VALUE);
* // => 0
*
* _.toLength(Infinity);
* // => 4294967295
*
* _.toLength('3.2');
* // => 3
*/
function toLength(value) {
return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
}
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value);
}
/**
* Converts `value` to a plain object flattening inherited enumerable string
* keyed properties of `value` to own properties of the plain object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {Object} Returns the converted plain object.
* @example
*
* function Foo() {
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.assign({ 'a': 1 }, new Foo);
* // => { 'a': 1, 'b': 2 }
*
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
* // => { 'a': 1, 'b': 2, 'c': 3 }
*/
function toPlainObject(value) {
return copyObject(value, keysIn(value));
}
/**
* Converts `value` to a safe integer. A safe integer can be compared and
* represented correctly.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toSafeInteger(3.2);
* // => 3
*
* _.toSafeInteger(Number.MIN_VALUE);
* // => 0
*
* _.toSafeInteger(Infinity);
* // => 9007199254740991
*
* _.toSafeInteger('3.2');
* // => 3
*/
function toSafeInteger(value) {
return value
? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
: (value === 0 ? value : 0);
}
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
/*------------------------------------------------------------------------*/
/**
* Assigns own enumerable string keyed properties of source objects to the
* destination object. Source objects are applied from left to right.
* Subsequent sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object` and is loosely based on
* [`Object.assign`](https://mdn.io/Object/assign).
*
* @static
* @memberOf _
* @since 0.10.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.assignIn
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* function Bar() {
* this.c = 3;
* }
*
* Foo.prototype.b = 2;
* Bar.prototype.d = 4;
*
* _.assign({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'c': 3 }
*/
var assign = createAssigner(function(object, source) {
if (isPrototype(source) || isArrayLike(source)) {
copyObject(source, keys(source), object);
return;
}
for (var key in source) {
if (hasOwnProperty.call(source, key)) {
assignValue(object, key, source[key]);
}
}
});
/**
* This method is like `_.assign` except that it iterates over own and
* inherited source properties.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias extend
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.assign
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* function Bar() {
* this.c = 3;
* }
*
* Foo.prototype.b = 2;
* Bar.prototype.d = 4;
*
* _.assignIn({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
*/
var assignIn = createAssigner(function(object, source) {
copyObject(source, keysIn(source), object);
});
/**
* This method is like `_.assignIn` except that it accepts `customizer`
* which is invoked to produce the assigned values. If `customizer` returns
* `undefined`, assignment is handled by the method instead. The `customizer`
* is invoked with five arguments: (objValue, srcValue, key, object, source).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias extendWith
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @see _.assignWith
* @example
*
* function customizer(objValue, srcValue) {
* return _.isUndefined(objValue) ? srcValue : objValue;
* }
*
* var defaults = _.partialRight(_.assignInWith, customizer);
*
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
copyObject(source, keysIn(source), object, customizer);
});
/**
* This method is like `_.assign` except that it accepts `customizer`
* which is invoked to produce the assigned values. If `customizer` returns
* `undefined`, assignment is handled by the method instead. The `customizer`
* is invoked with five arguments: (objValue, srcValue, key, object, source).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @see _.assignInWith
* @example
*
* function customizer(objValue, srcValue) {
* return _.isUndefined(objValue) ? srcValue : objValue;
* }
*
* var defaults = _.partialRight(_.assignWith, customizer);
*
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
copyObject(source, keys(source), object, customizer);
});
/**
* Creates an array of values corresponding to `paths` of `object`.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Array} Returns the picked values.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
*
* _.at(object, ['a[0].b.c', 'a[1]']);
* // => [3, 4]
*/
var at = flatRest(baseAt);
/**
* Creates an object that inherits from the `prototype` object. If a
* `properties` object is given, its own enumerable string keyed properties
* are assigned to the created object.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Object
* @param {Object} prototype The object to inherit from.
* @param {Object} [properties] The properties to assign to the object.
* @returns {Object} Returns the new object.
* @example
*
* function Shape() {
* this.x = 0;
* this.y = 0;
* }
*
* function Circle() {
* Shape.call(this);
* }
*
* Circle.prototype = _.create(Shape.prototype, {
* 'constructor': Circle
* });
*
* var circle = new Circle;
* circle instanceof Circle;
* // => true
*
* circle instanceof Shape;
* // => true
*/
function create(prototype, properties) {
var result = baseCreate(prototype);
return properties == null ? result : baseAssign(result, properties);
}
/**
* Assigns own and inherited enumerable string keyed properties of source
* objects to the destination object for all destination properties that
* resolve to `undefined`. Source objects are applied from left to right.
* Once a property is set, additional values of the same property are ignored.
*
* **Note:** This method mutates `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.defaultsDeep
* @example
*
* _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var defaults = baseRest(function(args) {
args.push(undefined, customDefaultsAssignIn);
return apply(assignInWith, undefined, args);
});
/**
* This method is like `_.defaults` except that it recursively assigns
* default properties.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.defaults
* @example
*
* _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
* // => { 'a': { 'b': 2, 'c': 3 } }
*/
var defaultsDeep = baseRest(function(args) {
args.push(undefined, customDefaultsMerge);
return apply(mergeWith, undefined, args);
});
/**
* This method is like `_.find` except that it returns the key of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Object
* @param {Object} object The object to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element,
* else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findKey(users, function(o) { return o.age < 40; });
* // => 'barney' (iteration order is not guaranteed)
*
* // The `_.matches` iteratee shorthand.
* _.findKey(users, { 'age': 1, 'active': true });
* // => 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findKey(users, ['active', false]);
* // => 'fred'
*
* // The `_.property` iteratee shorthand.
* _.findKey(users, 'active');
* // => 'barney'
*/
function findKey(object, predicate) {
return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
}
/**
* This method is like `_.findKey` except that it iterates over elements of
* a collection in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element,
* else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findLastKey(users, function(o) { return o.age < 40; });
* // => returns 'pebbles' assuming `_.findKey` returns 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.findLastKey(users, { 'age': 36, 'active': true });
* // => 'barney'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findLastKey(users, ['active', false]);
* // => 'fred'
*
* // The `_.property` iteratee shorthand.
* _.findLastKey(users, 'active');
* // => 'pebbles'
*/
function findLastKey(object, predicate) {
return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
}
/**
* Iterates over own and inherited enumerable string keyed properties of an
* object and invokes `iteratee` for each property. The iteratee is invoked
* with three arguments: (value, key, object). Iteratee functions may exit
* iteration early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 0.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forInRight
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forIn(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
*/
function forIn(object, iteratee) {
return object == null
? object
: baseFor(object, getIteratee(iteratee, 3), keysIn);
}
/**
* This method is like `_.forIn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forIn
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forInRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
*/
function forInRight(object, iteratee) {
return object == null
? object
: baseForRight(object, getIteratee(iteratee, 3), keysIn);
}
/**
* Iterates over own enumerable string keyed properties of an object and
* invokes `iteratee` for each property. The iteratee is invoked with three
* arguments: (value, key, object). Iteratee functions may exit iteration
* early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 0.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forOwnRight
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forOwn(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forOwn(object, iteratee) {
return object && baseForOwn(object, getIteratee(iteratee, 3));
}
/**
* This method is like `_.forOwn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forOwn
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forOwnRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
*/
function forOwnRight(object, iteratee) {
return object && baseForOwnRight(object, getIteratee(iteratee, 3));
}
/**
* Creates an array of function property names from own enumerable properties
* of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to inspect.
* @returns {Array} Returns the function names.
* @see _.functionsIn
* @example
*
* function Foo() {
* this.a = _.constant('a');
* this.b = _.constant('b');
* }
*
* Foo.prototype.c = _.constant('c');
*
* _.functions(new Foo);
* // => ['a', 'b']
*/
function functions(object) {
return object == null ? [] : baseFunctions(object, keys(object));
}
/**
* Creates an array of function property names from own and inherited
* enumerable properties of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to inspect.
* @returns {Array} Returns the function names.
* @see _.functions
* @example
*
* function Foo() {
* this.a = _.constant('a');
* this.b = _.constant('b');
* }
*
* Foo.prototype.c = _.constant('c');
*
* _.functionsIn(new Foo);
* // => ['a', 'b', 'c']
*/
function functionsIn(object) {
return object == null ? [] : baseFunctions(object, keysIn(object));
}
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
/**
* Checks if `path` is a direct property of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = { 'a': { 'b': 2 } };
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.has(object, 'a');
* // => true
*
* _.has(object, 'a.b');
* // => true
*
* _.has(object, ['a', 'b']);
* // => true
*
* _.has(other, 'a');
* // => false
*/
function has(object, path) {
return object != null && hasPath(object, path, baseHas);
}
/**
* Checks if `path` is a direct or inherited property of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.hasIn(object, 'a');
* // => true
*
* _.hasIn(object, 'a.b');
* // => true
*
* _.hasIn(object, ['a', 'b']);
* // => true
*
* _.hasIn(object, 'b');
* // => false
*/
function hasIn(object, path) {
return object != null && hasPath(object, path, baseHasIn);
}
/**
* Creates an object composed of the inverted keys and values of `object`.
* If `object` contains duplicate values, subsequent values overwrite
* property assignments of previous values.
*
* @static
* @memberOf _
* @since 0.7.0
* @category Object
* @param {Object} object The object to invert.
* @returns {Object} Returns the new inverted object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 1 };
*
* _.invert(object);
* // => { '1': 'c', '2': 'b' }
*/
var invert = createInverter(function(result, value, key) {
result[value] = key;
}, constant(identity));
/**
* This method is like `_.invert` except that the inverted object is generated
* from the results of running each element of `object` thru `iteratee`. The
* corresponding inverted value of each inverted key is an array of keys
* responsible for generating the inverted value. The iteratee is invoked
* with one argument: (value).
*
* @static
* @memberOf _
* @since 4.1.0
* @category Object
* @param {Object} object The object to invert.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Object} Returns the new inverted object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 1 };
*
* _.invertBy(object);
* // => { '1': ['a', 'c'], '2': ['b'] }
*
* _.invertBy(object, function(value) {
* return 'group' + value;
* });
* // => { 'group1': ['a', 'c'], 'group2': ['b'] }
*/
var invertBy = createInverter(function(result, value, key) {
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}, getIteratee);
/**
* Invokes the method at `path` of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
* @example
*
* var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
*
* _.invoke(object, 'a[0].b.c.slice', 1, 3);
* // => [2, 3]
*/
var invoke = baseRest(baseInvoke);
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
function keys(object) {
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}
/**
* The opposite of `_.mapValues`; this method creates an object with the
* same values as `object` and keys generated by running each own enumerable
* string keyed property of `object` thru `iteratee`. The iteratee is invoked
* with three arguments: (value, key, object).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @see _.mapValues
* @example
*
* _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
* return key + value;
* });
* // => { 'a1': 1, 'b2': 2 }
*/
function mapKeys(object, iteratee) {
var result = {};
iteratee = getIteratee(iteratee, 3);
baseForOwn(object, function(value, key, object) {
baseAssignValue(result, iteratee(value, key, object), value);
});
return result;
}
/**
* Creates an object with the same keys as `object` and values generated
* by running each own enumerable string keyed property of `object` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, key, object).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @see _.mapKeys
* @example
*
* var users = {
* 'fred': { 'user': 'fred', 'age': 40 },
* 'pebbles': { 'user': 'pebbles', 'age': 1 }
* };
*
* _.mapValues(users, function(o) { return o.age; });
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*
* // The `_.property` iteratee shorthand.
* _.mapValues(users, 'age');
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*/
function mapValues(object, iteratee) {
var result = {};
iteratee = getIteratee(iteratee, 3);
baseForOwn(object, function(value, key, object) {
baseAssignValue(result, key, iteratee(value, key, object));
});
return result;
}
/**
* This method is like `_.assign` except that it recursively merges own and
* inherited enumerable string keyed properties of source objects into the
* destination object. Source properties that resolve to `undefined` are
* skipped if a destination value exists. Array and plain object properties
* are merged recursively. Other objects and value types are overridden by
* assignment. Source objects are applied from left to right. Subsequent
* sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* var object = {
* 'a': [{ 'b': 2 }, { 'd': 4 }]
* };
*
* var other = {
* 'a': [{ 'c': 3 }, { 'e': 5 }]
* };
*
* _.merge(object, other);
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
*/
var merge = createAssigner(function(object, source, srcIndex) {
baseMerge(object, source, srcIndex);
});
/**
* This method is like `_.merge` except that it accepts `customizer` which
* is invoked to produce the merged values of the destination and source
* properties. If `customizer` returns `undefined`, merging is handled by the
* method instead. The `customizer` is invoked with six arguments:
* (objValue, srcValue, key, object, source, stack).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} customizer The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* function customizer(objValue, srcValue) {
* if (_.isArray(objValue)) {
* return objValue.concat(srcValue);
* }
* }
*
* var object = { 'a': [1], 'b': [2] };
* var other = { 'a': [3], 'b': [4] };
*
* _.mergeWith(object, other, customizer);
* // => { 'a': [1, 3], 'b': [2, 4] }
*/
var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
baseMerge(object, source, srcIndex, customizer);
});
/**
* The opposite of `_.pick`; this method creates an object composed of the
* own and inherited enumerable property paths of `object` that are not omitted.
*
* **Note:** This method is considerably slower than `_.pick`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to omit.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omit(object, ['a', 'c']);
* // => { 'b': '2' }
*/
var omit = flatRest(function(object, paths) {
var result = {};
if (object == null) {
return result;
}
var isDeep = false;
paths = arrayMap(paths, function(path) {
path = castPath(path, object);
isDeep || (isDeep = path.length > 1);
return path;
});
copyObject(object, getAllKeysIn(object), result);
if (isDeep) {
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
}
var length = paths.length;
while (length--) {
baseUnset(result, paths[length]);
}
return result;
});
/**
* The opposite of `_.pickBy`; this method creates an object composed of
* the own and inherited enumerable string keyed properties of `object` that
* `predicate` doesn't return truthy for. The predicate is invoked with two
* arguments: (value, key).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The source object.
* @param {Function} [predicate=_.identity] The function invoked per property.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omitBy(object, _.isNumber);
* // => { 'b': '2' }
*/
function omitBy(object, predicate) {
return pickBy(object, negate(getIteratee(predicate)));
}
/**
* Creates an object composed of the picked `object` properties.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.pick(object, ['a', 'c']);
* // => { 'a': 1, 'c': 3 }
*/
var pick = flatRest(function(object, paths) {
return object == null ? {} : basePick(object, paths);
});
/**
* Creates an object composed of the `object` properties `predicate` returns
* truthy for. The predicate is invoked with two arguments: (value, key).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The source object.
* @param {Function} [predicate=_.identity] The function invoked per property.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.pickBy(object, _.isNumber);
* // => { 'a': 1, 'c': 3 }
*/
function pickBy(object, predicate) {
if (object == null) {
return {};
}
var props = arrayMap(getAllKeysIn(object), function(prop) {
return [prop];
});
predicate = getIteratee(predicate);
return basePickBy(object, props, function(value, path) {
return predicate(value, path[0]);
});
}
/**
* This method is like `_.get` except that if the resolved value is a
* function it's invoked with the `this` binding of its parent object and
* its result is returned.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to resolve.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
*
* _.result(object, 'a[0].b.c1');
* // => 3
*
* _.result(object, 'a[0].b.c2');
* // => 4
*
* _.result(object, 'a[0].b.c3', 'default');
* // => 'default'
*
* _.result(object, 'a[0].b.c3', _.constant('default'));
* // => 'default'
*/
function result(object, path, defaultValue) {
path = castPath(path, object);
var index = -1,
length = path.length;
// Ensure the loop is entered when path is empty.
if (!length) {
length = 1;
object = undefined;
}
while (++index < length) {
var value = object == null ? undefined : object[toKey(path[index])];
if (value === undefined) {
index = length;
value = defaultValue;
}
object = isFunction(value) ? value.call(object) : value;
}
return object;
}
/**
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
* it's created. Arrays are created for missing index properties while objects
* are created for all other missing properties. Use `_.setWith` to customize
* `path` creation.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.set(object, 'a[0].b.c', 4);
* console.log(object.a[0].b.c);
* // => 4
*
* _.set(object, ['x', '0', 'y', 'z'], 5);
* console.log(object.x[0].y.z);
* // => 5
*/
function set(object, path, value) {
return object == null ? object : baseSet(object, path, value);
}
/**
* This method is like `_.set` except that it accepts `customizer` which is
* invoked to produce the objects of `path`. If `customizer` returns `undefined`
* path creation is handled by the method instead. The `customizer` is invoked
* with three arguments: (nsValue, key, nsObject).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* var object = {};
*
* _.setWith(object, '[0][1]', 'a', Object);
* // => { '0': { '1': 'a' } }
*/
function setWith(object, path, value, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return object == null ? object : baseSet(object, path, value, customizer);
}
/**
* Creates an array of own enumerable string keyed-value pairs for `object`
* which can be consumed by `_.fromPairs`. If `object` is a map or set, its
* entries are returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias entries
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the key-value pairs.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.toPairs(new Foo);
* // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
*/
var toPairs = createToPairs(keys);
/**
* Creates an array of own and inherited enumerable string keyed-value pairs
* for `object` which can be consumed by `_.fromPairs`. If `object` is a map
* or set, its entries are returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias entriesIn
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the key-value pairs.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.toPairsIn(new Foo);
* // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
*/
var toPairsIn = createToPairs(keysIn);
/**
* An alternative to `_.reduce`; this method transforms `object` to a new
* `accumulator` object which is the result of running each of its own
* enumerable string keyed properties thru `iteratee`, with each invocation
* potentially mutating the `accumulator` object. If `accumulator` is not
* provided, a new object with the same `[[Prototype]]` will be used. The
* iteratee is invoked with four arguments: (accumulator, value, key, object).
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 1.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The custom accumulator value.
* @returns {*} Returns the accumulated value.
* @example
*
* _.transform([2, 3, 4], function(result, n) {
* result.push(n *= n);
* return n % 2 == 0;
* }, []);
* // => [4, 9]
*
* _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] }
*/
function transform(object, iteratee, accumulator) {
var isArr = isArray(object),
isArrLike = isArr || isBuffer(object) || isTypedArray(object);
iteratee = getIteratee(iteratee, 4);
if (accumulator == null) {
var Ctor = object && object.constructor;
if (isArrLike) {
accumulator = isArr ? new Ctor : [];
}
else if (isObject(object)) {
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
}
else {
accumulator = {};
}
}
(isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
return iteratee(accumulator, value, index, object);
});
return accumulator;
}
/**
* Removes the property at `path` of `object`.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 7 } }] };
* _.unset(object, 'a[0].b.c');
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*
* _.unset(object, ['a', '0', 'b', 'c']);
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*/
function unset(object, path) {
return object == null ? true : baseUnset(object, path);
}
/**
* This method is like `_.set` except that accepts `updater` to produce the
* value to set. Use `_.updateWith` to customize `path` creation. The `updater`
* is invoked with one argument: (value).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {Function} updater The function to produce the updated value.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.update(object, 'a[0].b.c', function(n) { return n * n; });
* console.log(object.a[0].b.c);
* // => 9
*
* _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
* console.log(object.x[0].y.z);
* // => 0
*/
function update(object, path, updater) {
return object == null ? object : baseUpdate(object, path, castFunction(updater));
}
/**
* This method is like `_.update` except that it accepts `customizer` which is
* invoked to produce the objects of `path`. If `customizer` returns `undefined`
* path creation is handled by the method instead. The `customizer` is invoked
* with three arguments: (nsValue, key, nsObject).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {Function} updater The function to produce the updated value.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* var object = {};
*
* _.updateWith(object, '[0][1]', _.constant('a'), Object);
* // => { '0': { '1': 'a' } }
*/
function updateWith(object, path, updater, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
}
/**
* Creates an array of the own enumerable string keyed property values of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property values.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.values(new Foo);
* // => [1, 2] (iteration order is not guaranteed)
*
* _.values('hi');
* // => ['h', 'i']
*/
function values(object) {
return object == null ? [] : baseValues(object, keys(object));
}
/**
* Creates an array of the own and inherited enumerable string keyed property
* values of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property values.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.valuesIn(new Foo);
* // => [1, 2, 3] (iteration order is not guaranteed)
*/
function valuesIn(object) {
return object == null ? [] : baseValues(object, keysIn(object));
}
/*------------------------------------------------------------------------*/
/**
* Clamps `number` within the inclusive `lower` and `upper` bounds.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Number
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
* @example
*
* _.clamp(-10, -5, 5);
* // => -5
*
* _.clamp(10, -5, 5);
* // => 5
*/
function clamp(number, lower, upper) {
if (upper === undefined) {
upper = lower;
lower = undefined;
}
if (upper !== undefined) {
upper = toNumber(upper);
upper = upper === upper ? upper : 0;
}
if (lower !== undefined) {
lower = toNumber(lower);
lower = lower === lower ? lower : 0;
}
return baseClamp(toNumber(number), lower, upper);
}
/**
* Checks if `n` is between `start` and up to, but not including, `end`. If
* `end` is not specified, it's set to `start` with `start` then set to `0`.
* If `start` is greater than `end` the params are swapped to support
* negative ranges.
*
* @static
* @memberOf _
* @since 3.3.0
* @category Number
* @param {number} number The number to check.
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
* @see _.range, _.rangeRight
* @example
*
* _.inRange(3, 2, 4);
* // => true
*
* _.inRange(4, 8);
* // => true
*
* _.inRange(4, 2);
* // => false
*
* _.inRange(2, 2);
* // => false
*
* _.inRange(1.2, 2);
* // => true
*
* _.inRange(5.2, 4);
* // => false
*
* _.inRange(-3, -2, -6);
* // => true
*/
function inRange(number, start, end) {
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toFinite(end);
}
number = toNumber(number);
return baseInRange(number, start, end);
}
/**
* Produces a random number between the inclusive `lower` and `upper` bounds.
* If only one argument is provided a number between `0` and the given number
* is returned. If `floating` is `true`, or either `lower` or `upper` are
* floats, a floating-point number is returned instead of an integer.
*
* **Note:** JavaScript follows the IEEE-754 standard for resolving
* floating-point values which can produce unexpected results.
*
* @static
* @memberOf _
* @since 0.7.0
* @category Number
* @param {number} [lower=0] The lower bound.
* @param {number} [upper=1] The upper bound.
* @param {boolean} [floating] Specify returning a floating-point number.
* @returns {number} Returns the random number.
* @example
*
* _.random(0, 5);
* // => an integer between 0 and 5
*
* _.random(5);
* // => also an integer between 0 and 5
*
* _.random(5, true);
* // => a floating-point number between 0 and 5
*
* _.random(1.2, 5.2);
* // => a floating-point number between 1.2 and 5.2
*/
function random(lower, upper, floating) {
if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
upper = floating = undefined;
}
if (floating === undefined) {
if (typeof upper == 'boolean') {
floating = upper;
upper = undefined;
}
else if (typeof lower == 'boolean') {
floating = lower;
lower = undefined;
}
}
if (lower === undefined && upper === undefined) {
lower = 0;
upper = 1;
}
else {
lower = toFinite(lower);
if (upper === undefined) {
upper = lower;
lower = 0;
} else {
upper = toFinite(upper);
}
}
if (lower > upper) {
var temp = lower;
lower = upper;
upper = temp;
}
if (floating || lower % 1 || upper % 1) {
var rand = nativeRandom();
return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
}
return baseRandom(lower, upper);
}
/*------------------------------------------------------------------------*/
/**
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the camel cased string.
* @example
*
* _.camelCase('Foo Bar');
* // => 'fooBar'
*
* _.camelCase('--foo-bar--');
* // => 'fooBar'
*
* _.camelCase('__FOO_BAR__');
* // => 'fooBar'
*/
var camelCase = createCompounder(function(result, word, index) {
word = word.toLowerCase();
return result + (index ? capitalize(word) : word);
});
/**
* Converts the first character of `string` to upper case and the remaining
* to lower case.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to capitalize.
* @returns {string} Returns the capitalized string.
* @example
*
* _.capitalize('FRED');
* // => 'Fred'
*/
function capitalize(string) {
return upperFirst(toString(string).toLowerCase());
}
/**
* Deburrs `string` by converting
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
* letters to basic Latin letters and removing
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to deburr.
* @returns {string} Returns the deburred string.
* @example
*
* _.deburr('déjà vu');
* // => 'deja vu'
*/
function deburr(string) {
string = toString(string);
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
}
/**
* Checks if `string` ends with the given target string.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {string} [target] The string to search for.
* @param {number} [position=string.length] The position to search up to.
* @returns {boolean} Returns `true` if `string` ends with `target`,
* else `false`.
* @example
*
* _.endsWith('abc', 'c');
* // => true
*
* _.endsWith('abc', 'b');
* // => false
*
* _.endsWith('abc', 'b', 2);
* // => true
*/
function endsWith(string, target, position) {
string = toString(string);
target = baseToString(target);
var length = string.length;
position = position === undefined
? length
: baseClamp(toInteger(position), 0, length);
var end = position;
position -= target.length;
return position >= 0 && string.slice(position, end) == target;
}
/**
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their
* corresponding HTML entities.
*
* **Note:** No other characters are escaped. To escape additional
* characters use a third-party library like [_he_](https://mths.be/he).
*
* Though the ">" character is escaped for symmetry, characters like
* ">" and "/" don't need escaping in HTML and have no special meaning
* unless they're part of a tag or unquoted attribute value. See
* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
* (under "semi-related fun fact") for more details.
*
* When working with HTML you should always
* [quote attribute values](http://wonko.com/post/html-escaping) to reduce
* XSS vectors.
*
* @static
* @since 0.1.0
* @memberOf _
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escape('fred, barney, & pebbles');
* // => 'fred, barney, & pebbles'
*/
function escape(string) {
string = toString(string);
return (string && reHasUnescapedHtml.test(string))
? string.replace(reUnescapedHtml, escapeHtmlChar)
: string;
}
/**
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escapeRegExp('[lodash](https://lodash.com/)');
* // => '\[lodash\]\(https://lodash\.com/\)'
*/
function escapeRegExp(string) {
string = toString(string);
return (string && reHasRegExpChar.test(string))
? string.replace(reRegExpChar, '\\$&')
: string;
}
/**
* Converts `string` to
* [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the kebab cased string.
* @example
*
* _.kebabCase('Foo Bar');
* // => 'foo-bar'
*
* _.kebabCase('fooBar');
* // => 'foo-bar'
*
* _.kebabCase('__FOO_BAR__');
* // => 'foo-bar'
*/
var kebabCase = createCompounder(function(result, word, index) {
return result + (index ? '-' : '') + word.toLowerCase();
});
/**
* Converts `string`, as space separated words, to lower case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the lower cased string.
* @example
*
* _.lowerCase('--Foo-Bar--');
* // => 'foo bar'
*
* _.lowerCase('fooBar');
* // => 'foo bar'
*
* _.lowerCase('__FOO_BAR__');
* // => 'foo bar'
*/
var lowerCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + word.toLowerCase();
});
/**
* Converts the first character of `string` to lower case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.lowerFirst('Fred');
* // => 'fred'
*
* _.lowerFirst('FRED');
* // => 'fRED'
*/
var lowerFirst = createCaseFirst('toLowerCase');
/**
* Pads `string` on the left and right sides if it's shorter than `length`.
* Padding characters are truncated if they can't be evenly divided by `length`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.pad('abc', 8);
* // => ' abc '
*
* _.pad('abc', 8, '_-');
* // => '_-abc_-_'
*
* _.pad('abc', 3);
* // => 'abc'
*/
function pad(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
if (!length || strLength >= length) {
return string;
}
var mid = (length - strLength) / 2;
return (
createPadding(nativeFloor(mid), chars) +
string +
createPadding(nativeCeil(mid), chars)
);
}
/**
* Pads `string` on the right side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.padEnd('abc', 6);
* // => 'abc '
*
* _.padEnd('abc', 6, '_-');
* // => 'abc_-_'
*
* _.padEnd('abc', 3);
* // => 'abc'
*/
function padEnd(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
return (length && strLength < length)
? (string + createPadding(length - strLength, chars))
: string;
}
/**
* Pads `string` on the left side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.padStart('abc', 6);
* // => ' abc'
*
* _.padStart('abc', 6, '_-');
* // => '_-_abc'
*
* _.padStart('abc', 3);
* // => 'abc'
*/
function padStart(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
return (length && strLength < length)
? (createPadding(length - strLength, chars) + string)
: string;
}
/**
* Converts `string` to an integer of the specified radix. If `radix` is
* `undefined` or `0`, a `radix` of `10` is used unless `value` is a
* hexadecimal, in which case a `radix` of `16` is used.
*
* **Note:** This method aligns with the
* [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
*
* @static
* @memberOf _
* @since 1.1.0
* @category String
* @param {string} string The string to convert.
* @param {number} [radix=10] The radix to interpret `value` by.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {number} Returns the converted integer.
* @example
*
* _.parseInt('08');
* // => 8
*
* _.map(['6', '08', '10'], _.parseInt);
* // => [6, 8, 10]
*/
function parseInt(string, radix, guard) {
if (guard || radix == null) {
radix = 0;
} else if (radix) {
radix = +radix;
}
return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
}
/**
* Repeats the given string `n` times.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to repeat.
* @param {number} [n=1] The number of times to repeat the string.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the repeated string.
* @example
*
* _.repeat('*', 3);
* // => '***'
*
* _.repeat('abc', 2);
* // => 'abcabc'
*
* _.repeat('abc', 0);
* // => ''
*/
function repeat(string, n, guard) {
if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
n = 1;
} else {
n = toInteger(n);
}
return baseRepeat(toString(string), n);
}
/**
* Replaces matches for `pattern` in `string` with `replacement`.
*
* **Note:** This method is based on
* [`String#replace`](https://mdn.io/String/replace).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to modify.
* @param {RegExp|string} pattern The pattern to replace.
* @param {Function|string} replacement The match replacement.
* @returns {string} Returns the modified string.
* @example
*
* _.replace('Hi Fred', 'Fred', 'Barney');
* // => 'Hi Barney'
*/
function replace() {
var args = arguments,
string = toString(args[0]);
return args.length < 3 ? string : string.replace(args[1], args[2]);
}
/**
* Converts `string` to
* [snake case](https://en.wikipedia.org/wiki/Snake_case).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the snake cased string.
* @example
*
* _.snakeCase('Foo Bar');
* // => 'foo_bar'
*
* _.snakeCase('fooBar');
* // => 'foo_bar'
*
* _.snakeCase('--FOO-BAR--');
* // => 'foo_bar'
*/
var snakeCase = createCompounder(function(result, word, index) {
return result + (index ? '_' : '') + word.toLowerCase();
});
/**
* Splits `string` by `separator`.
*
* **Note:** This method is based on
* [`String#split`](https://mdn.io/String/split).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to split.
* @param {RegExp|string} separator The separator pattern to split by.
* @param {number} [limit] The length to truncate results to.
* @returns {Array} Returns the string segments.
* @example
*
* _.split('a-b-c', '-', 2);
* // => ['a', 'b']
*/
function split(string, separator, limit) {
if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
separator = limit = undefined;
}
limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
if (!limit) {
return [];
}
string = toString(string);
if (string && (
typeof separator == 'string' ||
(separator != null && !isRegExp(separator))
)) {
separator = baseToString(separator);
if (!separator && hasUnicode(string)) {
return castSlice(stringToArray(string), 0, limit);
}
}
return string.split(separator, limit);
}
/**
* Converts `string` to
* [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
*
* @static
* @memberOf _
* @since 3.1.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the start cased string.
* @example
*
* _.startCase('--foo-bar--');
* // => 'Foo Bar'
*
* _.startCase('fooBar');
* // => 'Foo Bar'
*
* _.startCase('__FOO_BAR__');
* // => 'FOO BAR'
*/
var startCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + upperFirst(word);
});
/**
* Checks if `string` starts with the given target string.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {string} [target] The string to search for.
* @param {number} [position=0] The position to search from.
* @returns {boolean} Returns `true` if `string` starts with `target`,
* else `false`.
* @example
*
* _.startsWith('abc', 'a');
* // => true
*
* _.startsWith('abc', 'b');
* // => false
*
* _.startsWith('abc', 'b', 1);
* // => true
*/
function startsWith(string, target, position) {
string = toString(string);
position = position == null
? 0
: baseClamp(toInteger(position), 0, string.length);
target = baseToString(target);
return string.slice(position, position + target.length) == target;
}
/**
* Creates a compiled template function that can interpolate data properties
* in "interpolate" delimiters, HTML-escape interpolated data properties in
* "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
* properties may be accessed as free variables in the template. If a setting
* object is given, it takes precedence over `_.templateSettings` values.
*
* **Note:** In the development build `_.template` utilizes
* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
* for easier debugging.
*
* For more information on precompiling templates see
* [lodash's custom builds documentation](https://lodash.com/custom-builds).
*
* For more information on Chrome extension sandboxes see
* [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
*
* @static
* @since 0.1.0
* @memberOf _
* @category String
* @param {string} [string=''] The template string.
* @param {Object} [options={}] The options object.
* @param {RegExp} [options.escape=_.templateSettings.escape]
* The HTML "escape" delimiter.
* @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
* The "evaluate" delimiter.
* @param {Object} [options.imports=_.templateSettings.imports]
* An object to import into the template as free variables.
* @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
* The "interpolate" delimiter.
* @param {string} [options.sourceURL='lodash.templateSources[n]']
* The sourceURL of the compiled template.
* @param {string} [options.variable='obj']
* The data object variable name.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the compiled template function.
* @example
*
* // Use the "interpolate" delimiter to create a compiled template.
* var compiled = _.template('hello <%= user %>!');
* compiled({ 'user': 'fred' });
* // => 'hello fred!'
*
* // Use the HTML "escape" delimiter to escape data property values.
* var compiled = _.template('<%- value %> ');
* compiled({ 'value': '