diff --git a/.solcover.js b/.solcover.js new file mode 100644 index 00000000..97dfff4d --- /dev/null +++ b/.solcover.js @@ -0,0 +1,4 @@ +module.exports = { + skipFiles: ['test/'], + istanbulReporter: ['html'] +}; diff --git a/coverage/base.css b/coverage/base.css new file mode 100644 index 00000000..29737bcb --- /dev/null +++ b/coverage/base.css @@ -0,0 +1,213 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.medium .chart { border:1px solid #f9cd0b; } +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } +/* light gray */ +span.cline-neutral { background: #eaeaea; } + +.cbranch-no { background: yellow !important; color: #111; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/coverage/controller/Avatar.sol.html b/coverage/controller/Avatar.sol.html new file mode 100644 index 00000000..86a54974 --- /dev/null +++ b/coverage/controller/Avatar.sol.html @@ -0,0 +1,476 @@ + + + + Code coverage report for controller/Avatar.sol + + + + + + + +
+
+

+ all files / controller/ Avatar.sol +

+
+
+ 100% + Statements + 20/20 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 8/8 +
+
+ 100% + Lines + 20/20 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +383× +383× +383× +  +  +  +  +  +  +45× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× +23× +  +  +  +  +  +  +  +  +  +24× +22× +22× +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +291× +291× +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/Reputation.sol";
+import "./DAOToken.sol";
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
+import "../libs/SafeERC20.sol";
+ 
+ 
+/**
+ * @title An Avatar holds tokens, reputation and ether for a controller
+ */
+contract Avatar is Ownable {
+    using SafeERC20 for address;
+ 
+    string public orgName;
+    DAOToken public nativeToken;
+    Reputation public nativeReputation;
+ 
+    event GenericCall(address indexed _contract, bytes _data, uint _value, bool _success);
+    event SendEther(uint256 _amountInWei, address indexed _to);
+    event ExternalTokenTransfer(address indexed _externalToken, address indexed _to, uint256 _value);
+    event ExternalTokenTransferFrom(address indexed _externalToken, address _from, address _to, uint256 _value);
+    event ExternalTokenApproval(address indexed _externalToken, address _spender, uint256 _value);
+    event ReceiveEther(address indexed _sender, uint256 _value);
+    event MetaData(string _metaData);
+ 
+    /**
+    * @dev the constructor takes organization name, native token and reputation system
+    and creates an avatar for a controller
+    */
+    constructor(string memory _orgName, DAOToken _nativeToken, Reputation _nativeReputation) public {
+        orgName = _orgName;
+        nativeToken = _nativeToken;
+        nativeReputation = _nativeReputation;
+    }
+ 
+    /**
+    * @dev enables an avatar to receive ethers
+    */
+    function() external payable {
+        emit ReceiveEther(msg.sender, msg.value);
+    }
+ 
+    /**
+    * @dev perform a generic call to an arbitrary contract
+    * @param _contract  the contract's address to call
+    * @param _data ABI-encoded contract call to call `_contract` address.
+    * @param _value value (ETH) to transfer with the transaction
+    * @return bool    success or fail
+    *         bytes - the return bytes of the called contract's function.
+    */
+    function genericCall(address _contract, bytes memory _data, uint256 _value)
+    public
+    onlyOwner
+    returns(bool success, bytes memory returnValue) {
+      // solhint-disable-next-line avoid-call-value
+        (success, returnValue) = _contract.call.value(_value)(_data);
+        emit GenericCall(_contract, _data, _value, success);
+    }
+ 
+    /**
+    * @dev send ethers from the avatar's wallet
+    * @param _amountInWei amount to send in Wei units
+    * @param _to send the ethers to this address
+    * @return bool which represents success
+    */
+    function sendEther(uint256 _amountInWei, address payable _to) public onlyOwner returns(bool) {
+        _to.transfer(_amountInWei);
+        emit SendEther(_amountInWei, _to);
+        return true;
+    }
+ 
+    /**
+    * @dev external token transfer
+    * @param _externalToken the token contract
+    * @param _to the destination address
+    * @param _value the amount of tokens to transfer
+    * @return bool which represents success
+    */
+    function externalTokenTransfer(IERC20 _externalToken, address _to, uint256 _value)
+    public onlyOwner returns(bool)
+    {
+        address(_externalToken).safeTransfer(_to, _value);
+        emit ExternalTokenTransfer(address(_externalToken), _to, _value);
+        return true;
+    }
+ 
+    /**
+    * @dev external token transfer from a specific account
+    * @param _externalToken the token contract
+    * @param _from the account to spend token from
+    * @param _to the destination address
+    * @param _value the amount of tokens to transfer
+    * @return bool which represents success
+    */
+    function externalTokenTransferFrom(
+        IERC20 _externalToken,
+        address _from,
+        address _to,
+        uint256 _value
+    )
+    public onlyOwner returns(bool)
+    {
+        address(_externalToken).safeTransferFrom(_from, _to, _value);
+        emit ExternalTokenTransferFrom(address(_externalToken), _from, _to, _value);
+        return true;
+    }
+ 
+    /**
+    * @dev externalTokenApproval approve the spender address to spend a specified amount of tokens
+    *      on behalf of msg.sender.
+    * @param _externalToken the address of the Token Contract
+    * @param _spender address
+    * @param _value the amount of ether (in Wei) which the approval is referring to.
+    * @return bool which represents a success
+    */
+    function externalTokenApproval(IERC20 _externalToken, address _spender, uint256 _value)
+    public onlyOwner returns(bool)
+    {
+        address(_externalToken).safeApprove(_spender, _value);
+        emit ExternalTokenApproval(address(_externalToken), _spender, _value);
+        return true;
+    }
+ 
+    /**
+    * @dev metaData emits an event with a string, should contain the hash of some meta data.
+    * @param _metaData a string representing a hash of the meta data
+    * @return bool which represents a success
+    */
+    function metaData(string memory _metaData) public onlyOwner returns(bool) {
+        emit MetaData(_metaData);
+        return true;
+    }
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/controller/Controller.sol.html b/coverage/controller/Controller.sol.html new file mode 100644 index 00000000..d2cd048b --- /dev/null +++ b/coverage/controller/Controller.sol.html @@ -0,0 +1,1739 @@ + + + + Code coverage report for controller/Controller.sol + + + + + + + +
+
+

+ all files / controller/ Controller.sol +

+
+
+ 99.07% + Statements + 107/108 +
+
+ 73.53% + Branches + 50/68 +
+
+ 96.97% + Functions + 32/33 +
+
+ 99.18% + Lines + 121/122 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +354× +354× +354× +354× +354× +  +  +  +  +  +  +  +  +  +  +316× +316× +  +  +  +1887× +1885× +  +  +  +37× +37× +  +  +  + + +  +  +  +21× +21× +  +  +  +290× +290× +  +  +  +2222× +2222× +16× +  +  +  +2207× +1979× + +  +  +  +  +  +  +2778× +2776× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +168× +168× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +79× +79× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +923× +  +  +  +  +  +923× +  +  +923× +  +  +923× +923× +923× +923× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +956× + +  +  +955× +  +  +731× +731× +731× +  +  +  +  +  +  +  +33× + +  +32× +32× +32× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +25× +  +22× +20× +20× +  +  + +  +  +25× +  +21× +19× +19× +  +  + +  +  +25× +25× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +12× +12× +  +12× +  +12× +12× +12× + + + +  +12× +12× +12× +  +  +12× +  +11× +11× +11× + + + +  +11× +11× +11× +  +  +12× +12× +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + + + + + +  + + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +11× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +290× +  +  +  +  +  +  +  +  + +  +  +  +90× +  +  +  +  +  +  +  +  +57× +  +  +  +  +  +  +  +  + +  +  +  +  + +  + + +  +  + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +38× +  +  +  +  +  +  +  +  +14× +  +  +  +  +1079× +  +  + 
pragma solidity 0.5.17;
+ 
+import "./Avatar.sol";
+import "../globalConstraints/GlobalConstraintInterface.sol";
+ 
+/**
+ * @title Controller contract
+ * @dev A controller controls the organizations tokens, reputation and avatar.
+ * It is subject to a set of schemes and constraints that determine its behavior.
+ * Each scheme has it own parameters and operation permissions.
+ */
+contract Controller {
+ 
+    struct Scheme {
+        bytes32 paramsHash;  // a hash "configuration" of the scheme
+        bytes4  permissions; // A bitwise flags of permissions,
+                             // All 0: Not registered,
+                             // 1st bit: Flag if the scheme is registered,
+                             // 2nd bit: Scheme can register other schemes
+                             // 3rd bit: Scheme can add/remove global constraints
+                             // 4th bit: Scheme can upgrade the controller
+                             // 5th bit: Scheme can call genericCall on behalf of
+                             //          the organization avatar
+    }
+ 
+    struct GlobalConstraint {
+        address gcAddress;
+        bytes32 params;
+    }
+ 
+    struct GlobalConstraintRegister {
+        bool isRegistered; //is registered
+        uint256 index;    //index at globalConstraints
+    }
+ 
+    mapping(address=>Scheme) public schemes;
+ 
+    Avatar public avatar;
+    DAOToken public nativeToken;
+    Reputation public nativeReputation;
+  // newController will point to the new controller after the present controller is upgraded
+    address public newController;
+  // globalConstraintsPre that determine pre conditions for all actions on the controller
+ 
+    GlobalConstraint[] public globalConstraintsPre;
+  // globalConstraintsPost that determine post conditions for all actions on the controller
+    GlobalConstraint[] public globalConstraintsPost;
+  // globalConstraintsRegisterPre indicate if a globalConstraints is registered as a pre global constraint
+    mapping(address=>GlobalConstraintRegister) public globalConstraintsRegisterPre;
+  // globalConstraintsRegisterPost indicate if a globalConstraints is registered as a post global constraint
+    mapping(address=>GlobalConstraintRegister) public globalConstraintsRegisterPost;
+ 
+    event MintReputation (address indexed _sender, address indexed _to, uint256 _amount);
+    event BurnReputation (address indexed _sender, address indexed _from, uint256 _amount);
+    event MintTokens (address indexed _sender, address indexed _beneficiary, uint256 _amount);
+    event RegisterScheme (address indexed _sender, address indexed _scheme);
+    event UnregisterScheme (address indexed _sender, address indexed _scheme);
+    event UpgradeController(address indexed _oldController, address _newController);
+ 
+    event AddGlobalConstraint(
+        address indexed _globalConstraint,
+        bytes32 _params,
+        GlobalConstraintInterface.CallPhase _when);
+ 
+    event RemoveGlobalConstraint(address indexed _globalConstraint, uint256 _index, bool _isPre);
+ 
+    constructor( Avatar _avatar) public {
+        avatar = _avatar;
+        nativeToken = avatar.nativeToken();
+        nativeReputation = avatar.nativeReputation();
+        schemes[msg.sender] = Scheme({paramsHash: bytes32(0), permissions: bytes4(0x0000001F)});
+        emit RegisterScheme (msg.sender, msg.sender);
+    }
+ 
+  // Do not allow mistaken calls:
+   // solhint-disable-next-line payable-fallback
+    function() external {
+        revert();
+    }
+ 
+  // Modifiers:
+    modifier onlyRegisteredScheme() {
+        Erequire(schemes[msg.sender].permissions&bytes4(0x00000001) == bytes4(0x00000001));
+        _;
+    }
+ 
+    modifier onlyRegisteringSchemes() {
+        require(schemes[msg.sender].permissions&bytes4(0x00000002) == bytes4(0x00000002));
+        _;
+    }
+ 
+    modifier onlyGlobalConstraintsScheme() {
+        Erequire(schemes[msg.sender].permissions&bytes4(0x00000004) == bytes4(0x00000004));
+        _;
+    }
+ 
+    modifier onlyUpgradingScheme() {
+        require(schemes[msg.sender].permissions&bytes4(0x00000008) == bytes4(0x00000008));
+        _;
+    }
+ 
+    modifier onlyGenericCallScheme() {
+        Erequire(schemes[msg.sender].permissions&bytes4(0x00000010) == bytes4(0x00000010));
+        _;
+    }
+ 
+    modifier onlyMetaDataScheme() {
+        Erequire(schemes[msg.sender].permissions&bytes4(0x00000010) == bytes4(0x00000010));
+        _;
+    }
+ 
+    modifier onlySubjectToConstraint(bytes32 func) {
+        uint256 idx;
+        for (idx = 0; idx < globalConstraintsPre.length; idx++) {
+            require(
+            (GlobalConstraintInterface(globalConstraintsPre[idx].gcAddress))
+            .pre(msg.sender, globalConstraintsPre[idx].params, func));
+        }
+        _;
+        for (idx = 0; idx < globalConstraintsPost.length; idx++) {
+            require(
+            (GlobalConstraintInterface(globalConstraintsPost[idx].gcAddress))
+            .post(msg.sender, globalConstraintsPost[idx].params, func));
+        }
+    }
+ 
+    modifier isAvatarValid(address _avatar) {
+        require(_avatar == address(avatar));
+        _;
+    }
+ 
+    /**
+     * @dev Mint `_amount` of reputation that are assigned to `_to` .
+     * @param  _amount amount of reputation to mint
+     * @param _to beneficiary address
+     * @return bool which represents a success
+     */
+    function mintReputation(uint256 _amount, address _to, address _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("mintReputation")
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+        emit MintReputation(msg.sender, _to, _amount);
+        return nativeReputation.mint(_to, _amount);
+    }
+ 
+    /**
+     * @dev Burns `_amount` of reputation from `_from`
+     * @param _amount amount of reputation to burn
+     * @param _from The address that will lose the reputation
+     * @return bool which represents a success
+     */
+    function burnReputation(uint256 _amount, address _from, address _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("burnReputation")
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+        emit BurnReputation(msg.sender, _from, _amount);
+        return nativeReputation.burn(_from, _amount);
+    }
+ 
+    /**
+     * @dev mint tokens .
+     * @param  _amount amount of token to mint
+     * @param _beneficiary beneficiary address
+     * @return bool which represents a success
+     */
+    function mintTokens(uint256 _amount, address _beneficiary, address _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("mintTokens")
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+        emit MintTokens(msg.sender, _beneficiary, _amount);
+        return nativeToken.mint(_beneficiary, _amount);
+    }
+ 
+  /**
+   * @dev register a scheme
+   * @param _scheme the address of the scheme
+   * @param _paramsHash a hashed configuration of the usage of the scheme
+   * @param _permissions the permissions the new scheme will have
+   * @return bool which represents a success
+   */
+    function registerScheme(address _scheme, bytes32 _paramsHash, bytes4 _permissions, address _avatar)
+    external
+    onlyRegisteringSchemes
+    onlySubjectToConstraint("registerScheme")
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+ 
+        Scheme memory scheme = schemes[_scheme];
+ 
+    // Check scheme has at least the permissions it is changing, and at least the current permissions:
+    // Implementation is a bit messy. One must recall logic-circuits ^^
+ 
+    // produces non-zero if sender does not have all of the perms that are changing between old and new
+        Erequire(bytes4(0x0000001f)&(_permissions^scheme.permissions)&(~schemes[msg.sender].permissions) == bytes4(0));
+ 
+    // produces non-zero if sender does not have all of the perms in the old scheme
+        Erequire(bytes4(0x0000001f)&(scheme.permissions&(~schemes[msg.sender].permissions)) == bytes4(0));
+ 
+    // Add or change the scheme:
+        schemes[_scheme].paramsHash = _paramsHash;
+        schemes[_scheme].permissions = _permissions|bytes4(0x00000001);
+        emit RegisterScheme(msg.sender, _scheme);
+        return true;
+    }
+ 
+    /**
+     * @dev unregister a scheme
+     * @param _scheme the address of the scheme
+     * @return bool which represents a success
+     */
+    function unregisterScheme( address _scheme, address _avatar)
+    external
+    onlyRegisteringSchemes
+    onlySubjectToConstraint("unregisterScheme")
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+    //check if the scheme is registered
+        if (_isSchemeRegistered(_scheme) == false) {
+            return false;
+        }
+    // Check the unregistering scheme has enough permissions:
+        require(bytes4(0x0000001f)&(schemes[_scheme].permissions&(~schemes[msg.sender].permissions)) == bytes4(0));
+ 
+    // Unregister:
+        emit UnregisterScheme(msg.sender, _scheme);
+        delete schemes[_scheme];
+        return true;
+    }
+ 
+    /**
+     * @dev unregister the caller's scheme
+     * @return bool which represents a success
+     */
+    function unregisterSelf(address _avatar) external isAvatarValid(_avatar) returns(bool) {
+        if (_isSchemeRegistered(msg.sender) == false) {
+            return false;
+        }
+        delete schemes[msg.sender];
+        emit UnregisterScheme(msg.sender, msg.sender);
+        return true;
+    }
+ 
+    /**
+     * @dev add or update Global Constraint
+     * @param _globalConstraint the address of the global constraint to be added.
+     * @param _params the constraint parameters hash.
+     * @return bool which represents a success
+     */
+    function addGlobalConstraint(address _globalConstraint, bytes32 _params, address _avatar)
+    external
+    onlyGlobalConstraintsScheme
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+        GlobalConstraintInterface.CallPhase when = GlobalConstraintInterface(_globalConstraint).when();
+        if ((when == GlobalConstraintInterface.CallPhase.Pre)||
+            (when == GlobalConstraintInterface.CallPhase.PreAndPost)) {
+            if (!globalConstraintsRegisterPre[_globalConstraint].isRegistered) {
+                globalConstraintsPre.push(GlobalConstraint(_globalConstraint, _params));
+                globalConstraintsRegisterPre[_globalConstraint] =
+                GlobalConstraintRegister(true, globalConstraintsPre.length-1);
+            }else {
+                globalConstraintsPre[globalConstraintsRegisterPre[_globalConstraint].index].params = _params;
+            }
+        }
+        if ((when == GlobalConstraintInterface.CallPhase.Post)||
+            (when == GlobalConstraintInterface.CallPhase.PreAndPost)) {
+            if (!globalConstraintsRegisterPost[_globalConstraint].isRegistered) {
+                globalConstraintsPost.push(GlobalConstraint(_globalConstraint, _params));
+                globalConstraintsRegisterPost[_globalConstraint] =
+                GlobalConstraintRegister(true, globalConstraintsPost.length-1);
+            }else {
+                globalConstraintsPost[globalConstraintsRegisterPost[_globalConstraint].index].params = _params;
+            }
+        }
+        emit AddGlobalConstraint(_globalConstraint, _params, when);
+        return true;
+    }
+ 
+    /**
+     * @dev remove Global Constraint
+     * @param _globalConstraint the address of the global constraint to be remove.
+     * @return bool which represents a success
+     */
+     // solhint-disable-next-line code-complexity
+    function removeGlobalConstraint (address _globalConstraint, address _avatar)
+    external
+    onlyGlobalConstraintsScheme
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+        GlobalConstraintRegister memory globalConstraintRegister;
+        GlobalConstraint memory globalConstraint;
+        GlobalConstraintInterface.CallPhase when = GlobalConstraintInterface(_globalConstraint).when();
+        bool retVal = false;
+ 
+        Eif ((when == GlobalConstraintInterface.CallPhase.Pre)||
+            (when == GlobalConstraintInterface.CallPhase.PreAndPost)) {
+            globalConstraintRegister = globalConstraintsRegisterPre[_globalConstraint];
+            Eif (globalConstraintRegister.isRegistered) {
+                if (globalConstraintRegister.index < globalConstraintsPre.length-1) {
+                    globalConstraint = globalConstraintsPre[globalConstraintsPre.length-1];
+                    globalConstraintsPre[globalConstraintRegister.index] = globalConstraint;
+                    globalConstraintsRegisterPre[globalConstraint.gcAddress].index = globalConstraintRegister.index;
+                }
+                globalConstraintsPre.length--;
+                delete globalConstraintsRegisterPre[_globalConstraint];
+                retVal = true;
+            }
+        }
+        if ((when == GlobalConstraintInterface.CallPhase.Post)||
+            (when == GlobalConstraintInterface.CallPhase.PreAndPost)) {
+            globalConstraintRegister = globalConstraintsRegisterPost[_globalConstraint];
+            Eif (globalConstraintRegister.isRegistered) {
+                if (globalConstraintRegister.index < globalConstraintsPost.length-1) {
+                    globalConstraint = globalConstraintsPost[globalConstraintsPost.length-1];
+                    globalConstraintsPost[globalConstraintRegister.index] = globalConstraint;
+                    globalConstraintsRegisterPost[globalConstraint.gcAddress].index = globalConstraintRegister.index;
+                }
+                globalConstraintsPost.length--;
+                delete globalConstraintsRegisterPost[_globalConstraint];
+                retVal = true;
+            }
+        }
+        Eif (retVal) {
+            emit RemoveGlobalConstraint(
+            _globalConstraint,
+            globalConstraintRegister.index,
+            when == GlobalConstraintInterface.CallPhase.Pre
+            );
+        }
+        return retVal;
+    }
+ 
+  /**
+    * @dev upgrade the Controller
+    *      The function will trigger an event 'UpgradeController'.
+    * @param  _newController the address of the new controller.
+    * @return bool which represents a success
+    */
+    function upgradeController(address _newController, Avatar _avatar)
+    external
+    onlyUpgradingScheme
+    isAvatarValid(address(_avatar))
+    returns(bool)
+    {
+        Erequire(newController == address(0));   // so the upgrade could be done once for a contract.
+        Erequire(_newController != address(0));
+        newController = _newController;
+        avatar.transferOwnership(_newController);
+        Erequire(avatar.owner() == _newController);
+        Eif (nativeToken.owner() == address(this)) {
+            nativeToken.transferOwnership(_newController);
+            Erequire(nativeToken.owner() == _newController);
+        }
+        Eif (nativeReputation.owner() == address(this)) {
+            nativeReputation.transferOwnership(_newController);
+            Erequire(nativeReputation.owner() == _newController);
+        }
+        emit UpgradeController(address(this), newController);
+        return true;
+    }
+ 
+    /**
+    * @dev perform a generic call to an arbitrary contract
+    * @param _contract  the contract's address to call
+    * @param _data ABI-encoded contract call to call `_contract` address.
+    * @param _avatar the controller's avatar address
+    * @param _value value (ETH) to transfer with the transaction
+    * @return bool -success
+    *         bytes  - the return value of the called _contract's function.
+    */
+    function genericCall(address _contract, bytes calldata _data, Avatar _avatar, uint256 _value)
+    external
+    onlyGenericCallScheme
+    onlySubjectToConstraint("genericCall")
+    isAvatarValid(address(_avatar))
+    returns (bool, bytes memory)
+    {
+        return avatar.genericCall(_contract, _data, _value);
+    }
+ 
+  /**
+   * @dev send some ether
+   * @param _amountInWei the amount of ether (in Wei) to send
+   * @param _to address of the beneficiary
+   * @return bool which represents a success
+   */
+    function sendEther(uint256 _amountInWei, address payable _to, Avatar _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("sendEther")
+    isAvatarValid(address(_avatar))
+    returns(bool)
+    {
+        return avatar.sendEther(_amountInWei, _to);
+    }
+ 
+    /**
+    * @dev send some amount of arbitrary ERC20 Tokens
+    * @param _externalToken the address of the Token Contract
+    * @param _to address of the beneficiary
+    * @param _value the amount of ether (in Wei) to send
+    * @return bool which represents a success
+    */
+    function externalTokenTransfer(IERC20 _externalToken, address _to, uint256 _value, Avatar _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("externalTokenTransfer")
+    isAvatarValid(address(_avatar))
+    returns(bool)
+    {
+        return avatar.externalTokenTransfer(_externalToken, _to, _value);
+    }
+ 
+    /**
+    * @dev transfer token "from" address "to" address
+    *      One must to approve the amount of tokens which can be spend from the
+    *      "from" account.This can be done using externalTokenApprove.
+    * @param _externalToken the address of the Token Contract
+    * @param _from address of the account to send from
+    * @param _to address of the beneficiary
+    * @param _value the amount of ether (in Wei) to send
+    * @return bool which represents a success
+    */
+    function externalTokenTransferFrom(
+    IERC20 _externalToken,
+    address _from,
+    address _to,
+    uint256 _value,
+    Avatar _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("externalTokenTransferFrom")
+    isAvatarValid(address(_avatar))
+    returns(bool)
+    {
+        return avatar.externalTokenTransferFrom(_externalToken, _from, _to, _value);
+    }
+ 
+    /**
+    * @dev externalTokenApproval approve the spender address to spend a specified amount of tokens
+    *      on behalf of msg.sender.
+    * @param _externalToken the address of the Token Contract
+    * @param _spender address
+    * @param _value the amount of ether (in Wei) which the approval is referring to.
+    * @return bool which represents a success
+    */
+    function externalTokenApproval(IERC20 _externalToken, address _spender, uint256 _value, Avatar _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("externalTokenIncreaseApproval")
+    isAvatarValid(address(_avatar))
+    returns(bool)
+    {
+        return avatar.externalTokenApproval(_externalToken, _spender, _value);
+    }
+ 
+    /**
+    * @dev metaData emits an event with a string, should contain the hash of some meta data.
+    * @param _metaData a string representing a hash of the meta data
+    * @param _avatar Avatar
+    * @return bool which represents a success
+    */
+    function metaData(string calldata _metaData, Avatar _avatar)
+        external
+        onlyMetaDataScheme
+        isAvatarValid(address(_avatar))
+        returns(bool)
+        {
+        return avatar.metaData(_metaData);
+    }
+ 
+    /**
+     * @dev getNativeReputation
+     * @param _avatar the organization avatar.
+     * @return organization native reputation
+     */
+    function getNativeReputation(address _avatar) external isAvatarValid(_avatar) view returns(address) {
+        return address(nativeReputation);
+    }
+ 
+    function isSchemeRegistered(address _scheme, address _avatar) external isAvatarValid(_avatar) view returns(bool) {
+        return _isSchemeRegistered(_scheme);
+    }
+ 
+    function getSchemeParameters(address _scheme, address _avatar)
+    external
+    isAvatarValid(_avatar)
+    view
+    returns(bytes32)
+    {
+        return schemes[_scheme].paramsHash;
+    }
+ 
+    function getSchemePermissions(address _scheme, address _avatar)
+    external
+    isAvatarValid(_avatar)
+    view
+    returns(bytes4)
+    {
+        return schemes[_scheme].permissions;
+    }
+ 
+    function getGlobalConstraintParameters(address _globalConstraint, address) external view returns(bytes32) {
+ 
+        GlobalConstraintRegister memory register = globalConstraintsRegisterPre[_globalConstraint];
+ 
+        if (register.isRegistered) {
+            return globalConstraintsPre[register.index].params;
+        }
+ 
+        register = globalConstraintsRegisterPost[_globalConstraint];
+ 
+        Eif (register.isRegistered) {
+            return globalConstraintsPost[register.index].params;
+        }
+    }
+ 
+   /**
+    * @dev globalConstraintsCount return the global constraint pre and post count
+    * @return uint256 globalConstraintsPre count.
+    * @return uint256 globalConstraintsPost count.
+    */
+    function globalConstraintsCount(address _avatar)
+        external
+        isAvatarValid(_avatar)
+        view
+        returns(uint, uint)
+        {
+        return (globalConstraintsPre.length, globalConstraintsPost.length);
+    }
+ 
+    function isGlobalConstraintRegistered(address _globalConstraint, address _avatar)
+        external
+        isAvatarValid(_avatar)
+        view
+        returns(bool)
+        {
+        return (globalConstraintsRegisterPre[_globalConstraint].isRegistered ||
+                globalConstraintsRegisterPost[_globalConstraint].isRegistered);
+    }
+ 
+    function _isSchemeRegistered(address _scheme) private view returns(bool) {
+        return (schemes[_scheme].permissions&bytes4(0x00000001) != bytes4(0));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/controller/DAOToken.sol.html b/coverage/controller/DAOToken.sol.html new file mode 100644 index 00000000..ca0faf55 --- /dev/null +++ b/coverage/controller/DAOToken.sol.html @@ -0,0 +1,200 @@ + + + + Code coverage report for controller/DAOToken.sol + + + + + + + +
+
+

+ all files / controller/ DAOToken.sol +

+
+
+ 100% + Statements + 7/7 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 7/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +371× +371× +371× +  +  +  +  +  +  +  +  +462× + +460× +460× +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol";
+import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+ 
+ 
+/**
+ * @title DAOToken, base on zeppelin contract.
+ * @dev ERC20 compatible token. It is a mintable, burnable token.
+ */
+ 
+contract DAOToken is ERC20, ERC20Burnable, Ownable {
+ 
+    string public name;
+    string public symbol;
+    // solhint-disable-next-line const-name-snakecase
+    uint8 public constant decimals = 18;
+    uint256 public cap;
+ 
+    /**
+    * @dev Constructor
+    * @param _name - token name
+    * @param _symbol - token symbol
+    * @param _cap - token cap - 0 value means no cap
+    */
+    constructor(string memory _name, string memory _symbol, uint256 _cap)
+    public {
+        name = _name;
+        symbol = _symbol;
+        cap = _cap;
+    }
+ 
+    /**
+     * @dev Function to mint tokens
+     * @param _to The address that will receive the minted tokens.
+     * @param _amount The amount of tokens to mint.
+     */
+    function mint(address _to, uint256 _amount) public onlyOwner returns (bool) {
+        if (cap > 0)
+            require(totalSupply().add(_amount) <= cap);
+        _mint(_to, _amount);
+        return true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/controller/index.html b/coverage/controller/index.html new file mode 100644 index 00000000..96f3765f --- /dev/null +++ b/coverage/controller/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for controller/ + + + + + + + +
+
+

+ all files controller/ +

+
+
+ 99.26% + Statements + 134/135 +
+
+ 75% + Branches + 54/72 +
+
+ 97.67% + Functions + 42/43 +
+
+ 99.33% + Lines + 148/149 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Avatar.sol
100%20/20100%0/0100%8/8100%20/20
Controller.sol
99.07%107/10873.53%50/6896.97%32/3399.18%121/122
DAOToken.sol
100%7/7100%4/4100%2/2100%7/7
+
+
+ + + + + + + diff --git a/coverage/coverage-final.json b/coverage/coverage-final.json new file mode 100644 index 00000000..9e607915 --- /dev/null +++ b/coverage/coverage-final.json @@ -0,0 +1,39 @@ +{ +"contracts/controller/Avatar.sol":{"l":{"33":383,"34":383,"35":383,"42":45,"58":23,"59":23,"69":24,"70":22,"71":22,"84":12,"85":12,"86":12,"105":2,"106":2,"107":2,"121":3,"122":3,"123":3,"132":291,"133":291},"path":"/home/blackjak/Projects/DXdao/arc/contracts/controller/Avatar.sol","s":{"1":383,"2":383,"3":383,"4":45,"5":23,"6":23,"7":24,"8":22,"9":22,"10":12,"11":12,"12":12,"13":2,"14":2,"15":2,"16":3,"17":3,"18":3,"19":291,"20":291},"b":{},"f":{"1":383,"2":45,"3":23,"4":24,"5":12,"6":2,"7":3,"8":291},"fnMap":{"1":{"name":"constructor","line":32,"loc":{"start":{"line":32,"column":4},"end":{"line":32,"column":97}}},"2":{"name":"","line":41,"loc":{"start":{"line":41,"column":4},"end":{"line":41,"column":29}}},"3":{"name":"genericCall","line":55,"loc":{"start":{"line":55,"column":12},"end":{"line":56,"column":53}}},"4":{"name":"sendEther","line":68,"loc":{"start":{"line":68,"column":81},"end":{"line":68,"column":17}}},"5":{"name":"externalTokenTransfer","line":82,"loc":{"start":{"line":82,"column":19},"end":{"line":83,"column":5}}},"6":{"name":"externalTokenTransferFrom","line":103,"loc":{"start":{"line":103,"column":19},"end":{"line":104,"column":5}}},"7":{"name":"externalTokenApproval","line":119,"loc":{"start":{"line":119,"column":19},"end":{"line":120,"column":5}}},"8":{"name":"metaData","line":131,"loc":{"start":{"line":131,"column":62},"end":{"line":131,"column":17}}}},"statementMap":{"1":{"start":{"line":33,"column":8},"end":{"line":33,"column":25}},"2":{"start":{"line":34,"column":8},"end":{"line":34,"column":33}},"3":{"start":{"line":35,"column":8},"end":{"line":35,"column":43}},"4":{"start":{"line":42,"column":8},"end":{"line":42,"column":48}},"5":{"start":{"line":58,"column":8},"end":{"line":58,"column":67}},"6":{"start":{"line":59,"column":8},"end":{"line":59,"column":59}},"7":{"start":{"line":69,"column":8},"end":{"line":69,"column":33}},"8":{"start":{"line":70,"column":8},"end":{"line":70,"column":41}},"9":{"start":{"line":71,"column":8},"end":{"line":71,"column":19}},"10":{"start":{"line":84,"column":8},"end":{"line":84,"column":56}},"11":{"start":{"line":85,"column":8},"end":{"line":85,"column":72}},"12":{"start":{"line":86,"column":8},"end":{"line":86,"column":19}},"13":{"start":{"line":105,"column":8},"end":{"line":105,"column":67}},"14":{"start":{"line":106,"column":8},"end":{"line":106,"column":83}},"15":{"start":{"line":107,"column":8},"end":{"line":107,"column":19}},"16":{"start":{"line":121,"column":8},"end":{"line":121,"column":60}},"17":{"start":{"line":122,"column":8},"end":{"line":122,"column":77}},"18":{"start":{"line":123,"column":8},"end":{"line":123,"column":19}},"19":{"start":{"line":132,"column":8},"end":{"line":132,"column":32}},"20":{"start":{"line":133,"column":8},"end":{"line":133,"column":19}}},"branchMap":{}}, +"contracts/controller/Controller.sol":{"l":{"68":354,"69":354,"70":354,"71":354,"72":354,"78":0,"83":316,"84":316,"88":1887,"89":1885,"93":37,"94":37,"98":4,"99":2,"103":21,"104":21,"108":290,"109":290,"113":2222,"114":2222,"115":16,"119":2207,"120":1979,"121":3,"128":2778,"129":2776,"145":168,"146":168,"162":22,"163":22,"179":79,"180":79,"198":923,"204":923,"207":923,"210":923,"211":923,"212":923,"213":923,"229":956,"230":1,"233":955,"236":731,"237":731,"238":731,"246":33,"247":1,"249":32,"250":32,"251":32,"266":25,"267":25,"269":22,"270":20,"271":20,"274":2,"277":25,"279":21,"280":19,"281":19,"284":2,"287":25,"288":25,"303":12,"304":12,"305":12,"306":12,"308":12,"310":12,"311":12,"312":12,"313":2,"314":2,"315":2,"317":12,"318":12,"319":12,"322":12,"324":11,"325":11,"326":11,"327":2,"328":2,"329":2,"331":11,"332":11,"333":11,"336":12,"337":12,"343":12,"358":2,"359":2,"360":2,"361":2,"362":2,"363":2,"364":2,"365":2,"367":2,"368":2,"369":2,"371":2,"372":2,"391":20,"407":23,"424":11,"449":1,"467":2,"482":290,"491":1,"495":90,"504":57,"513":9,"518":2,"520":2,"521":1,"524":1,"526":1,"527":1,"542":38,"551":14,"556":1079},"path":"/home/blackjak/Projects/DXdao/arc/contracts/controller/Controller.sol","s":{"1":354,"2":354,"3":354,"4":354,"5":354,"6":0,"7":316,"8":1887,"9":37,"10":4,"11":21,"12":290,"13":2222,"14":2222,"15":16,"16":1979,"17":3,"18":2778,"19":168,"20":168,"21":22,"22":22,"23":79,"24":79,"25":923,"26":923,"27":923,"28":923,"29":923,"30":923,"31":923,"32":956,"33":1,"34":955,"35":731,"36":731,"37":33,"38":1,"39":32,"40":32,"41":25,"42":25,"43":22,"44":20,"45":20,"46":2,"47":25,"48":21,"49":19,"50":19,"51":2,"52":25,"53":25,"54":12,"55":12,"56":12,"57":12,"58":12,"59":12,"60":12,"61":12,"62":2,"63":2,"64":2,"65":12,"66":12,"67":11,"68":11,"69":11,"70":2,"71":2,"72":2,"73":11,"74":12,"75":12,"76":12,"77":2,"78":2,"79":2,"80":2,"81":2,"82":2,"83":2,"84":2,"85":2,"86":2,"87":2,"88":2,"89":2,"90":20,"91":23,"92":11,"93":1,"94":2,"95":290,"96":1,"97":90,"98":57,"99":9,"100":2,"101":2,"102":1,"103":1,"104":1,"105":1,"106":38,"107":14,"108":1079},"b":{"1":[316,0],"2":[1885,2],"3":[37,0],"4":[2,2],"5":[21,0],"6":[290,0],"7":[1,15],"8":[1,2],"9":[2776,2],"10":[923,0],"11":[923,0],"12":[1,955],"13":[731,224],"14":[1,32],"15":[22,3],"16":[20,2],"17":[21,4],"18":[19,2],"19":[12,0],"20":[12,0],"21":[2,10],"22":[11,1],"23":[11,0],"24":[2,9],"25":[12,0],"26":[2,0],"27":[2,0],"28":[2,0],"29":[2,0],"30":[2,0],"31":[2,0],"32":[2,0],"33":[1,1],"34":[1,0]},"f":{"1":354,"2":0,"3":316,"4":1887,"5":37,"6":4,"7":21,"8":290,"9":2222,"10":2778,"11":168,"12":22,"13":79,"14":923,"15":956,"16":33,"17":25,"18":12,"19":2,"20":20,"21":23,"22":11,"23":1,"24":2,"25":290,"26":1,"27":90,"28":57,"29":9,"30":2,"31":38,"32":14,"33":1079},"fnMap":{"1":{"name":"constructor","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":67,"column":37}}},"2":{"name":"","line":77,"loc":{"start":{"line":77,"column":4},"end":{"line":77,"column":21}}},"3":{"name":"onlyRegisteredScheme","line":82,"loc":{"start":{"line":82,"column":4},"end":{"line":82,"column":33}}},"4":{"name":"onlyRegisteringSchemes","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":87,"column":35}}},"5":{"name":"onlyGlobalConstraintsScheme","line":92,"loc":{"start":{"line":92,"column":4},"end":{"line":92,"column":40}}},"6":{"name":"onlyUpgradingScheme","line":97,"loc":{"start":{"line":97,"column":4},"end":{"line":97,"column":32}}},"7":{"name":"onlyGenericCallScheme","line":102,"loc":{"start":{"line":102,"column":4},"end":{"line":102,"column":34}}},"8":{"name":"onlyMetaDataScheme","line":107,"loc":{"start":{"line":107,"column":4},"end":{"line":107,"column":31}}},"9":{"name":"onlySubjectToConstraint","line":112,"loc":{"start":{"line":112,"column":4},"end":{"line":112,"column":48}}},"10":{"name":"isAvatarValid","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":127,"column":41}}},"11":{"name":"mintReputation","line":142,"loc":{"start":{"line":142,"column":25},"end":{"line":144,"column":5}}},"12":{"name":"burnReputation","line":159,"loc":{"start":{"line":159,"column":25},"end":{"line":161,"column":5}}},"13":{"name":"mintTokens","line":176,"loc":{"start":{"line":176,"column":25},"end":{"line":178,"column":5}}},"14":{"name":"registerScheme","line":194,"loc":{"start":{"line":194,"column":25},"end":{"line":196,"column":5}}},"15":{"name":"unregisterScheme","line":225,"loc":{"start":{"line":225,"column":25},"end":{"line":227,"column":5}}},"16":{"name":"unregisterSelf","line":245,"loc":{"start":{"line":245,"column":75},"end":{"line":245,"column":17}}},"17":{"name":"addGlobalConstraint","line":263,"loc":{"start":{"line":263,"column":25},"end":{"line":265,"column":5}}},"18":{"name":"removeGlobalConstraint","line":300,"loc":{"start":{"line":300,"column":25},"end":{"line":302,"column":5}}},"19":{"name":"upgradeController","line":355,"loc":{"start":{"line":355,"column":34},"end":{"line":357,"column":5}}},"20":{"name":"genericCall","line":388,"loc":{"start":{"line":388,"column":34},"end":{"line":390,"column":5}}},"21":{"name":"sendEther","line":404,"loc":{"start":{"line":404,"column":34},"end":{"line":406,"column":5}}},"22":{"name":"externalTokenTransfer","line":421,"loc":{"start":{"line":421,"column":34},"end":{"line":423,"column":5}}},"23":{"name":"externalTokenTransferFrom","line":446,"loc":{"start":{"line":446,"column":34},"end":{"line":448,"column":5}}},"24":{"name":"externalTokenApproval","line":464,"loc":{"start":{"line":464,"column":34},"end":{"line":466,"column":5}}},"25":{"name":"metaData","line":479,"loc":{"start":{"line":479,"column":38},"end":{"line":481,"column":9}}},"26":{"name":"getNativeReputation","line":490,"loc":{"start":{"line":490,"column":80},"end":{"line":490,"column":25}}},"27":{"name":"isSchemeRegistered","line":494,"loc":{"start":{"line":494,"column":96},"end":{"line":494,"column":22}}},"28":{"name":"getSchemeParameters","line":500,"loc":{"start":{"line":500,"column":25},"end":{"line":503,"column":5}}},"29":{"name":"getSchemePermissions","line":509,"loc":{"start":{"line":509,"column":25},"end":{"line":512,"column":5}}},"30":{"name":"getGlobalConstraintParameters","line":516,"loc":{"start":{"line":516,"column":4},"end":{"line":516,"column":107}}},"31":{"name":"globalConstraintsCount","line":538,"loc":{"start":{"line":538,"column":29},"end":{"line":541,"column":9}}},"32":{"name":"isGlobalConstraintRegistered","line":547,"loc":{"start":{"line":547,"column":29},"end":{"line":550,"column":9}}},"33":{"name":"_isSchemeRegistered","line":555,"loc":{"start":{"line":555,"column":4},"end":{"line":555,"column":74}}}},"statementMap":{"1":{"start":{"line":68,"column":8},"end":{"line":68,"column":23}},"2":{"start":{"line":69,"column":8},"end":{"line":69,"column":41}},"3":{"start":{"line":70,"column":8},"end":{"line":70,"column":51}},"4":{"start":{"line":71,"column":8},"end":{"line":71,"column":94}},"5":{"start":{"line":72,"column":8},"end":{"line":72,"column":52}},"6":{"start":{"line":78,"column":8},"end":{"line":78,"column":15}},"7":{"start":{"line":83,"column":8},"end":{"line":83,"column":88}},"8":{"start":{"line":88,"column":8},"end":{"line":88,"column":88}},"9":{"start":{"line":93,"column":8},"end":{"line":93,"column":88}},"10":{"start":{"line":98,"column":8},"end":{"line":98,"column":88}},"11":{"start":{"line":103,"column":8},"end":{"line":103,"column":88}},"12":{"start":{"line":108,"column":8},"end":{"line":108,"column":88}},"13":{"start":{"line":113,"column":8},"end":{"line":113,"column":19}},"14":{"start":{"line":114,"column":8},"end":{"line":114,"column":4466}},"15":{"start":{"line":115,"column":12},"end":{"line":115,"column":4596}},"16":{"start":{"line":120,"column":8},"end":{"line":120,"column":4722}},"17":{"start":{"line":121,"column":12},"end":{"line":121,"column":4855}},"18":{"start":{"line":128,"column":8},"end":{"line":128,"column":42}},"19":{"start":{"line":145,"column":8},"end":{"line":145,"column":53}},"20":{"start":{"line":146,"column":8},"end":{"line":146,"column":50}},"21":{"start":{"line":162,"column":8},"end":{"line":162,"column":55}},"22":{"start":{"line":163,"column":8},"end":{"line":163,"column":52}},"23":{"start":{"line":179,"column":8},"end":{"line":179,"column":58}},"24":{"start":{"line":180,"column":8},"end":{"line":180,"column":54}},"25":{"start":{"line":198,"column":8},"end":{"line":198,"column":47}},"26":{"start":{"line":204,"column":8},"end":{"line":204,"column":116}},"27":{"start":{"line":207,"column":8},"end":{"line":207,"column":103}},"28":{"start":{"line":210,"column":8},"end":{"line":210,"column":48}},"29":{"start":{"line":211,"column":8},"end":{"line":211,"column":69}},"30":{"start":{"line":212,"column":8},"end":{"line":212,"column":48}},"31":{"start":{"line":213,"column":8},"end":{"line":213,"column":19}},"32":{"start":{"line":229,"column":8},"end":{"line":229,"column":8487}},"33":{"start":{"line":230,"column":12},"end":{"line":230,"column":24}},"34":{"start":{"line":233,"column":8},"end":{"line":233,"column":113}},"35":{"start":{"line":236,"column":8},"end":{"line":236,"column":50}},"36":{"start":{"line":238,"column":8},"end":{"line":238,"column":19}},"37":{"start":{"line":246,"column":8},"end":{"line":246,"column":9086}},"38":{"start":{"line":247,"column":12},"end":{"line":247,"column":24}},"39":{"start":{"line":250,"column":8},"end":{"line":250,"column":53}},"40":{"start":{"line":251,"column":8},"end":{"line":251,"column":19}},"41":{"start":{"line":266,"column":8},"end":{"line":266,"column":102}},"42":{"start":{"line":267,"column":8},"end":{"line":267,"column":9834}},"43":{"start":{"line":269,"column":12},"end":{"line":269,"column":9978}},"44":{"start":{"line":270,"column":16},"end":{"line":270,"column":86}},"45":{"start":{"line":271,"column":16},"end":{"line":271,"column":10216}},"46":{"start":{"line":274,"column":16},"end":{"line":274,"column":107}},"47":{"start":{"line":277,"column":8},"end":{"line":277,"column":10439}},"48":{"start":{"line":279,"column":12},"end":{"line":279,"column":10584}},"49":{"start":{"line":280,"column":16},"end":{"line":280,"column":87}},"50":{"start":{"line":281,"column":16},"end":{"line":281,"column":10825}},"51":{"start":{"line":284,"column":16},"end":{"line":284,"column":109}},"52":{"start":{"line":287,"column":8},"end":{"line":287,"column":66}},"53":{"start":{"line":288,"column":8},"end":{"line":288,"column":19}},"54":{"start":{"line":303,"column":8},"end":{"line":303,"column":64}},"55":{"start":{"line":304,"column":8},"end":{"line":304,"column":48}},"56":{"start":{"line":305,"column":8},"end":{"line":305,"column":102}},"57":{"start":{"line":306,"column":8},"end":{"line":306,"column":27}},"58":{"start":{"line":308,"column":8},"end":{"line":308,"column":11807}},"59":{"start":{"line":310,"column":12},"end":{"line":310,"column":85}},"60":{"start":{"line":311,"column":12},"end":{"line":311,"column":12039}},"61":{"start":{"line":312,"column":16},"end":{"line":312,"column":12104}},"62":{"start":{"line":313,"column":20},"end":{"line":313,"column":89}},"63":{"start":{"line":314,"column":20},"end":{"line":314,"column":90}},"64":{"start":{"line":315,"column":20},"end":{"line":315,"column":114}},"65":{"start":{"line":319,"column":16},"end":{"line":319,"column":28}},"66":{"start":{"line":322,"column":8},"end":{"line":322,"column":12668}},"67":{"start":{"line":324,"column":12},"end":{"line":324,"column":86}},"68":{"start":{"line":325,"column":12},"end":{"line":325,"column":12902}},"69":{"start":{"line":326,"column":16},"end":{"line":326,"column":12967}},"70":{"start":{"line":327,"column":20},"end":{"line":327,"column":91}},"71":{"start":{"line":328,"column":20},"end":{"line":328,"column":91}},"72":{"start":{"line":329,"column":20},"end":{"line":329,"column":115}},"73":{"start":{"line":333,"column":16},"end":{"line":333,"column":28}},"74":{"start":{"line":336,"column":8},"end":{"line":336,"column":13538}},"75":{"start":{"line":337,"column":12},"end":{"line":337,"column":13569}},"76":{"start":{"line":343,"column":8},"end":{"line":343,"column":21}},"77":{"start":{"line":358,"column":8},"end":{"line":358,"column":43}},"78":{"start":{"line":359,"column":8},"end":{"line":359,"column":44}},"79":{"start":{"line":360,"column":8},"end":{"line":360,"column":37}},"80":{"start":{"line":361,"column":8},"end":{"line":361,"column":47}},"81":{"start":{"line":362,"column":8},"end":{"line":362,"column":48}},"82":{"start":{"line":363,"column":8},"end":{"line":363,"column":14472}},"83":{"start":{"line":364,"column":12},"end":{"line":364,"column":56}},"84":{"start":{"line":365,"column":12},"end":{"line":365,"column":57}},"85":{"start":{"line":367,"column":8},"end":{"line":367,"column":14653}},"86":{"start":{"line":368,"column":12},"end":{"line":368,"column":61}},"87":{"start":{"line":369,"column":12},"end":{"line":369,"column":62}},"88":{"start":{"line":371,"column":8},"end":{"line":371,"column":60}},"89":{"start":{"line":372,"column":8},"end":{"line":372,"column":19}},"90":{"start":{"line":391,"column":8},"end":{"line":391,"column":59}},"91":{"start":{"line":407,"column":8},"end":{"line":407,"column":50}},"92":{"start":{"line":424,"column":8},"end":{"line":424,"column":72}},"93":{"start":{"line":449,"column":8},"end":{"line":449,"column":83}},"94":{"start":{"line":467,"column":8},"end":{"line":467,"column":77}},"95":{"start":{"line":482,"column":8},"end":{"line":482,"column":41}},"96":{"start":{"line":491,"column":8},"end":{"line":491,"column":40}},"97":{"start":{"line":495,"column":8},"end":{"line":495,"column":43}},"98":{"start":{"line":504,"column":8},"end":{"line":504,"column":42}},"99":{"start":{"line":513,"column":8},"end":{"line":513,"column":43}},"100":{"start":{"line":518,"column":8},"end":{"line":518,"column":98}},"101":{"start":{"line":520,"column":8},"end":{"line":520,"column":19920}},"102":{"start":{"line":521,"column":12},"end":{"line":521,"column":62}},"103":{"start":{"line":524,"column":8},"end":{"line":524,"column":66}},"104":{"start":{"line":526,"column":8},"end":{"line":526,"column":20102}},"105":{"start":{"line":527,"column":12},"end":{"line":527,"column":63}},"106":{"start":{"line":542,"column":8},"end":{"line":542,"column":74}},"107":{"start":{"line":551,"column":8},"end":{"line":551,"column":20902}},"108":{"start":{"line":556,"column":8},"end":{"line":556,"column":77}}},"branchMap":{"1":{"line":83,"type":"if","locations":[{"start":{"line":83,"column":8},"end":{"line":83,"column":8}},{"start":{"line":83,"column":8},"end":{"line":83,"column":8}}]},"2":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":8},"end":{"line":88,"column":8}},{"start":{"line":88,"column":8},"end":{"line":88,"column":8}}]},"3":{"line":93,"type":"if","locations":[{"start":{"line":93,"column":8},"end":{"line":93,"column":8}},{"start":{"line":93,"column":8},"end":{"line":93,"column":8}}]},"4":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":8},"end":{"line":98,"column":8}},{"start":{"line":98,"column":8},"end":{"line":98,"column":8}}]},"5":{"line":103,"type":"if","locations":[{"start":{"line":103,"column":8},"end":{"line":103,"column":8}},{"start":{"line":103,"column":8},"end":{"line":103,"column":8}}]},"6":{"line":108,"type":"if","locations":[{"start":{"line":108,"column":8},"end":{"line":108,"column":8}},{"start":{"line":108,"column":8},"end":{"line":108,"column":8}}]},"7":{"line":115,"type":"if","locations":[{"start":{"line":115,"column":12},"end":{"line":115,"column":12}},{"start":{"line":115,"column":12},"end":{"line":115,"column":12}}]},"8":{"line":121,"type":"if","locations":[{"start":{"line":121,"column":12},"end":{"line":121,"column":12}},{"start":{"line":121,"column":12},"end":{"line":121,"column":12}}]},"9":{"line":128,"type":"if","locations":[{"start":{"line":128,"column":8},"end":{"line":128,"column":8}},{"start":{"line":128,"column":8},"end":{"line":128,"column":8}}]},"10":{"line":204,"type":"if","locations":[{"start":{"line":204,"column":8},"end":{"line":204,"column":8}},{"start":{"line":204,"column":8},"end":{"line":204,"column":8}}]},"11":{"line":207,"type":"if","locations":[{"start":{"line":207,"column":8},"end":{"line":207,"column":8}},{"start":{"line":207,"column":8},"end":{"line":207,"column":8}}]},"12":{"line":229,"type":"if","locations":[{"start":{"line":229,"column":8},"end":{"line":229,"column":8}},{"start":{"line":229,"column":8},"end":{"line":229,"column":8}}]},"13":{"line":233,"type":"if","locations":[{"start":{"line":233,"column":8},"end":{"line":233,"column":8}},{"start":{"line":233,"column":8},"end":{"line":233,"column":8}}]},"14":{"line":246,"type":"if","locations":[{"start":{"line":246,"column":8},"end":{"line":246,"column":8}},{"start":{"line":246,"column":8},"end":{"line":246,"column":8}}]},"15":{"line":267,"type":"if","locations":[{"start":{"line":267,"column":8},"end":{"line":267,"column":8}},{"start":{"line":267,"column":8},"end":{"line":267,"column":8}}]},"16":{"line":269,"type":"if","locations":[{"start":{"line":269,"column":12},"end":{"line":269,"column":12}},{"start":{"line":269,"column":12},"end":{"line":269,"column":12}}]},"17":{"line":277,"type":"if","locations":[{"start":{"line":277,"column":8},"end":{"line":277,"column":8}},{"start":{"line":277,"column":8},"end":{"line":277,"column":8}}]},"18":{"line":279,"type":"if","locations":[{"start":{"line":279,"column":12},"end":{"line":279,"column":12}},{"start":{"line":279,"column":12},"end":{"line":279,"column":12}}]},"19":{"line":308,"type":"if","locations":[{"start":{"line":308,"column":8},"end":{"line":308,"column":8}},{"start":{"line":308,"column":8},"end":{"line":308,"column":8}}]},"20":{"line":311,"type":"if","locations":[{"start":{"line":311,"column":12},"end":{"line":311,"column":12}},{"start":{"line":311,"column":12},"end":{"line":311,"column":12}}]},"21":{"line":312,"type":"if","locations":[{"start":{"line":312,"column":16},"end":{"line":312,"column":16}},{"start":{"line":312,"column":16},"end":{"line":312,"column":16}}]},"22":{"line":322,"type":"if","locations":[{"start":{"line":322,"column":8},"end":{"line":322,"column":8}},{"start":{"line":322,"column":8},"end":{"line":322,"column":8}}]},"23":{"line":325,"type":"if","locations":[{"start":{"line":325,"column":12},"end":{"line":325,"column":12}},{"start":{"line":325,"column":12},"end":{"line":325,"column":12}}]},"24":{"line":326,"type":"if","locations":[{"start":{"line":326,"column":16},"end":{"line":326,"column":16}},{"start":{"line":326,"column":16},"end":{"line":326,"column":16}}]},"25":{"line":336,"type":"if","locations":[{"start":{"line":336,"column":8},"end":{"line":336,"column":8}},{"start":{"line":336,"column":8},"end":{"line":336,"column":8}}]},"26":{"line":358,"type":"if","locations":[{"start":{"line":358,"column":8},"end":{"line":358,"column":8}},{"start":{"line":358,"column":8},"end":{"line":358,"column":8}}]},"27":{"line":359,"type":"if","locations":[{"start":{"line":359,"column":8},"end":{"line":359,"column":8}},{"start":{"line":359,"column":8},"end":{"line":359,"column":8}}]},"28":{"line":362,"type":"if","locations":[{"start":{"line":362,"column":8},"end":{"line":362,"column":8}},{"start":{"line":362,"column":8},"end":{"line":362,"column":8}}]},"29":{"line":363,"type":"if","locations":[{"start":{"line":363,"column":8},"end":{"line":363,"column":8}},{"start":{"line":363,"column":8},"end":{"line":363,"column":8}}]},"30":{"line":365,"type":"if","locations":[{"start":{"line":365,"column":12},"end":{"line":365,"column":12}},{"start":{"line":365,"column":12},"end":{"line":365,"column":12}}]},"31":{"line":367,"type":"if","locations":[{"start":{"line":367,"column":8},"end":{"line":367,"column":8}},{"start":{"line":367,"column":8},"end":{"line":367,"column":8}}]},"32":{"line":369,"type":"if","locations":[{"start":{"line":369,"column":12},"end":{"line":369,"column":12}},{"start":{"line":369,"column":12},"end":{"line":369,"column":12}}]},"33":{"line":520,"type":"if","locations":[{"start":{"line":520,"column":8},"end":{"line":520,"column":8}},{"start":{"line":520,"column":8},"end":{"line":520,"column":8}}]},"34":{"line":526,"type":"if","locations":[{"start":{"line":526,"column":8},"end":{"line":526,"column":8}},{"start":{"line":526,"column":8},"end":{"line":526,"column":8}}]}}}, +"contracts/controller/DAOToken.sol":{"l":{"29":371,"30":371,"31":371,"40":462,"41":4,"42":460,"43":460},"path":"/home/blackjak/Projects/DXdao/arc/contracts/controller/DAOToken.sol","s":{"1":371,"2":371,"3":371,"4":462,"5":4,"6":460,"7":460},"b":{"1":[4,458],"2":[2,2]},"f":{"1":371,"2":462},"fnMap":{"1":{"name":"constructor","line":27,"loc":{"start":{"line":27,"column":4},"end":{"line":28,"column":12}}},"2":{"name":"mint","line":39,"loc":{"start":{"line":39,"column":63},"end":{"line":39,"column":18}}}},"statementMap":{"1":{"start":{"line":29,"column":8},"end":{"line":29,"column":19}},"2":{"start":{"line":30,"column":8},"end":{"line":30,"column":23}},"3":{"start":{"line":31,"column":8},"end":{"line":31,"column":17}},"4":{"start":{"line":40,"column":8},"end":{"line":40,"column":1211}},"5":{"start":{"line":41,"column":12},"end":{"line":41,"column":53}},"6":{"start":{"line":42,"column":8},"end":{"line":42,"column":26}},"7":{"start":{"line":43,"column":8},"end":{"line":43,"column":19}}},"branchMap":{"1":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":8},"end":{"line":40,"column":8}},{"start":{"line":40,"column":8},"end":{"line":40,"column":8}}]},"2":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":12},"end":{"line":41,"column":12}},{"start":{"line":41,"column":12},"end":{"line":41,"column":12}}]}}}, +"contracts/globalConstraints/GlobalConstraintInterface.sol":{"l":{},"path":"/home/blackjak/Projects/DXdao/arc/contracts/globalConstraints/GlobalConstraintInterface.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/globalConstraints/TokenCapGC.sol":{"l":{"29":4,"30":4,"31":4,"32":4,"42":8,"51":1,"60":7,"62":3,"64":4,"72":1},"path":"/home/blackjak/Projects/DXdao/arc/contracts/globalConstraints/TokenCapGC.sol","s":{"1":4,"2":4,"3":4,"4":4,"5":8,"6":1,"7":7,"8":3,"9":4,"10":1},"b":{"1":[3,4]},"f":{"1":4,"2":8,"3":1,"4":7,"5":1},"fnMap":{"1":{"name":"setParameters","line":28,"loc":{"start":{"line":28,"column":4},"end":{"line":28,"column":77}}},"2":{"name":"getParametersHash","line":41,"loc":{"start":{"line":41,"column":4},"end":{"line":41,"column":86}}},"3":{"name":"pre","line":50,"loc":{"start":{"line":50,"column":4},"end":{"line":50,"column":67}}},"4":{"name":"post","line":59,"loc":{"start":{"line":59,"column":4},"end":{"line":59,"column":80}}},"5":{"name":"when","line":71,"loc":{"start":{"line":71,"column":4},"end":{"line":71,"column":74}}}},"statementMap":{"1":{"start":{"line":29,"column":8},"end":{"line":29,"column":60}},"2":{"start":{"line":30,"column":8},"end":{"line":30,"column":44}},"3":{"start":{"line":31,"column":8},"end":{"line":31,"column":40}},"4":{"start":{"line":32,"column":8},"end":{"line":32,"column":25}},"5":{"start":{"line":42,"column":8},"end":{"line":42,"column":58}},"6":{"start":{"line":51,"column":8},"end":{"line":51,"column":19}},"7":{"start":{"line":60,"column":8},"end":{"line":60,"column":2003}},"8":{"start":{"line":62,"column":12},"end":{"line":62,"column":24}},"9":{"start":{"line":64,"column":8},"end":{"line":64,"column":19}},"10":{"start":{"line":72,"column":8},"end":{"line":72,"column":55}}},"branchMap":{"1":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":8},"end":{"line":60,"column":8}},{"start":{"line":60,"column":8},"end":{"line":60,"column":8}}]}}}, +"contracts/libs/SafeERC20.sol":{"l":{"30":45,"32":45,"36":45,"38":45,"44":70,"46":70,"50":70,"52":70,"58":7,"62":7,"64":7,"68":7,"70":7},"path":"/home/blackjak/Projects/DXdao/arc/contracts/libs/SafeERC20.sol","s":{"1":45,"2":45,"3":45,"4":45,"5":70,"6":70,"7":70,"8":70,"9":7,"10":7,"11":7,"12":7,"13":7},"b":{"1":[45,0],"2":[45,0],"3":[45,0],"4":[70,0],"5":[70,0],"6":[70,0],"7":[7,0],"8":[7,0],"9":[7,0],"10":[7,0]},"f":{"1":45,"2":70,"3":7},"fnMap":{"1":{"name":"safeTransfer","line":27,"loc":{"start":{"line":27,"column":4},"end":{"line":27,"column":81}}},"2":{"name":"safeTransferFrom","line":41,"loc":{"start":{"line":41,"column":4},"end":{"line":41,"column":100}}},"3":{"name":"safeApprove","line":55,"loc":{"start":{"line":55,"column":4},"end":{"line":55,"column":85}}}},"statementMap":{"1":{"start":{"line":30,"column":8},"end":{"line":30,"column":39}},"2":{"start":{"line":32,"column":8},"end":{"line":32,"column":1249}},"3":{"start":{"line":36,"column":8},"end":{"line":36,"column":23}},"4":{"start":{"line":38,"column":8},"end":{"line":38,"column":95}},"5":{"start":{"line":44,"column":8},"end":{"line":44,"column":39}},"6":{"start":{"line":46,"column":8},"end":{"line":46,"column":1852}},"7":{"start":{"line":50,"column":8},"end":{"line":50,"column":23}},"8":{"start":{"line":52,"column":8},"end":{"line":52,"column":95}},"9":{"start":{"line":58,"column":8},"end":{"line":58,"column":39}},"10":{"start":{"line":62,"column":8},"end":{"line":62,"column":93}},"11":{"start":{"line":64,"column":8},"end":{"line":64,"column":2651}},"12":{"start":{"line":68,"column":8},"end":{"line":68,"column":23}},"13":{"start":{"line":70,"column":8},"end":{"line":70,"column":95}}},"branchMap":{"1":{"line":30,"type":"if","locations":[{"start":{"line":30,"column":8},"end":{"line":30,"column":8}},{"start":{"line":30,"column":8},"end":{"line":30,"column":8}}]},"2":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":8},"end":{"line":36,"column":8}},{"start":{"line":36,"column":8},"end":{"line":36,"column":8}}]},"3":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":8},"end":{"line":38,"column":8}},{"start":{"line":38,"column":8},"end":{"line":38,"column":8}}]},"4":{"line":44,"type":"if","locations":[{"start":{"line":44,"column":8},"end":{"line":44,"column":8}},{"start":{"line":44,"column":8},"end":{"line":44,"column":8}}]},"5":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":8},"end":{"line":50,"column":8}},{"start":{"line":50,"column":8},"end":{"line":50,"column":8}}]},"6":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":8},"end":{"line":52,"column":8}},{"start":{"line":52,"column":8},"end":{"line":52,"column":8}}]},"7":{"line":58,"type":"if","locations":[{"start":{"line":58,"column":8},"end":{"line":58,"column":8}},{"start":{"line":58,"column":8},"end":{"line":58,"column":8}}]},"8":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":8},"end":{"line":62,"column":8}},{"start":{"line":62,"column":8},"end":{"line":62,"column":8}}]},"9":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":8},"end":{"line":68,"column":8}},{"start":{"line":68,"column":8},"end":{"line":68,"column":8}}]},"10":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":8},"end":{"line":70,"column":8}},{"start":{"line":70,"column":8},"end":{"line":70,"column":8}}]}}}, +"contracts/schemes/Agreement.sol":{"l":{"13":151,"14":130,"23":6,"32":117,"33":115},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/Agreement.sol","s":{"1":151,"2":6,"3":117,"4":115},"b":{"1":[130,21],"2":[115,2]},"f":{"1":151,"2":6,"3":117},"fnMap":{"1":{"name":"onlyAgree","line":12,"loc":{"start":{"line":12,"column":4},"end":{"line":12,"column":44}}},"2":{"name":"getAgreementHash","line":21,"loc":{"start":{"line":21,"column":4},"end":{"line":22,"column":5}}},"3":{"name":"setAgreementHash","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":31,"column":5}}}},"statementMap":{"1":{"start":{"line":13,"column":8},"end":{"line":13,"column":91}},"2":{"start":{"line":23,"column":8},"end":{"line":23,"column":28}},"3":{"start":{"line":32,"column":8},"end":{"line":32,"column":74}},"4":{"start":{"line":33,"column":8},"end":{"line":33,"column":37}}},"branchMap":{"1":{"line":13,"type":"if","locations":[{"start":{"line":13,"column":8},"end":{"line":13,"column":8}},{"start":{"line":13,"column":8},"end":{"line":13,"column":8}}]},"2":{"line":32,"type":"if","locations":[{"start":{"line":32,"column":8},"end":{"line":32,"column":8}},{"start":{"line":32,"column":8},"end":{"line":32,"column":8}}]}}}, +"contracts/schemes/Auction4Reputation.sol":{"l":{"70":28,"71":26,"72":26,"74":24,"75":22,"76":22,"77":22,"78":16,"79":16,"80":16,"81":16,"82":16,"83":16,"84":16,"85":16,"86":16,"97":16,"98":12,"99":12,"100":12,"101":10,"102":10,"103":10,"105":10,"106":10,"109":10,"123":20,"125":18,"127":16,"128":16,"130":16,"131":16,"132":14,"133":14,"134":14,"135":14,"144":3,"145":1,"146":1,"156":2},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/Auction4Reputation.sol","s":{"1":28,"2":26,"3":26,"4":24,"5":22,"6":22,"7":22,"8":16,"9":16,"10":16,"11":16,"12":16,"13":16,"14":16,"15":16,"16":16,"17":16,"18":12,"19":12,"20":12,"21":10,"22":10,"23":10,"24":10,"25":10,"26":10,"27":20,"28":18,"29":16,"30":16,"31":16,"32":16,"33":14,"34":14,"35":14,"36":14,"37":3,"38":1,"39":1,"40":2},"b":{"1":[26,2],"2":[26,0],"3":[24,2],"4":[22,2],"5":[16,6],"6":[12,4],"7":[10,2],"8":[10,0],"9":[18,2],"10":[16,2],"11":[16,0],"12":[14,2],"13":[1,2]},"f":{"1":28,"2":16,"3":20,"4":3,"5":2},"fnMap":{"1":{"name":"initialize","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":69,"column":5}}},"2":{"name":"redeem","line":95,"loc":{"start":{"line":95,"column":4},"end":{"line":95,"column":94}}},"3":{"name":"bid","line":120,"loc":{"start":{"line":120,"column":28},"end":{"line":122,"column":5}}},"4":{"name":"transferToWallet","line":142,"loc":{"start":{"line":142,"column":4},"end":{"line":142,"column":36}}},"5":{"name":"getBid","line":155,"loc":{"start":{"line":155,"column":4},"end":{"line":155,"column":83}}}},"statementMap":{"1":{"start":{"line":70,"column":8},"end":{"line":70,"column":66}},"2":{"start":{"line":71,"column":8},"end":{"line":71,"column":61}},"3":{"start":{"line":72,"column":8},"end":{"line":72,"column":74}},"4":{"start":{"line":74,"column":8},"end":{"line":74,"column":67}},"5":{"start":{"line":75,"column":8},"end":{"line":75,"column":37}},"6":{"start":{"line":76,"column":8},"end":{"line":76,"column":83}},"7":{"start":{"line":77,"column":8},"end":{"line":77,"column":92}},"8":{"start":{"line":78,"column":8},"end":{"line":78,"column":21}},"9":{"start":{"line":79,"column":8},"end":{"line":79,"column":23}},"10":{"start":{"line":80,"column":8},"end":{"line":80,"column":45}},"11":{"start":{"line":81,"column":8},"end":{"line":81,"column":43}},"12":{"start":{"line":82,"column":8},"end":{"line":82,"column":23}},"13":{"start":{"line":83,"column":8},"end":{"line":83,"column":57}},"14":{"start":{"line":84,"column":8},"end":{"line":84,"column":77}},"15":{"start":{"line":85,"column":8},"end":{"line":85,"column":43}},"16":{"start":{"line":86,"column":8},"end":{"line":86,"column":45}},"17":{"start":{"line":97,"column":8},"end":{"line":97,"column":64}},"18":{"start":{"line":98,"column":8},"end":{"line":98,"column":54}},"19":{"start":{"line":99,"column":8},"end":{"line":99,"column":48}},"20":{"start":{"line":100,"column":8},"end":{"line":100,"column":55}},"21":{"start":{"line":101,"column":8},"end":{"line":101,"column":37}},"22":{"start":{"line":102,"column":8},"end":{"line":102,"column":62}},"23":{"start":{"line":103,"column":8},"end":{"line":103,"column":53}},"24":{"start":{"line":105,"column":8},"end":{"line":105,"column":66}},"25":{"start":{"line":106,"column":8},"end":{"line":106,"column":4452}},"26":{"start":{"line":109,"column":8},"end":{"line":109,"column":57}},"27":{"start":{"line":123,"column":8},"end":{"line":123,"column":59}},"28":{"start":{"line":125,"column":8},"end":{"line":125,"column":92}},"29":{"start":{"line":127,"column":8},"end":{"line":127,"column":98}},"30":{"start":{"line":128,"column":8},"end":{"line":128,"column":74}},"31":{"start":{"line":130,"column":8},"end":{"line":130,"column":60}},"32":{"start":{"line":131,"column":8},"end":{"line":131,"column":64}},"33":{"start":{"line":132,"column":8},"end":{"line":132,"column":53}},"34":{"start":{"line":133,"column":8},"end":{"line":133,"column":55}},"35":{"start":{"line":134,"column":8},"end":{"line":134,"column":71}},"36":{"start":{"line":135,"column":8},"end":{"line":135,"column":48}},"37":{"start":{"line":144,"column":8},"end":{"line":144,"column":62}},"38":{"start":{"line":145,"column":8},"end":{"line":145,"column":61}},"39":{"start":{"line":146,"column":8},"end":{"line":146,"column":56}},"40":{"start":{"line":156,"column":8},"end":{"line":156,"column":49}}},"branchMap":{"1":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":8},"end":{"line":70,"column":8}},{"start":{"line":70,"column":8},"end":{"line":70,"column":8}}]},"2":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":8},"end":{"line":71,"column":8}},{"start":{"line":71,"column":8},"end":{"line":71,"column":8}}]},"3":{"line":72,"type":"if","locations":[{"start":{"line":72,"column":8},"end":{"line":72,"column":8}},{"start":{"line":72,"column":8},"end":{"line":72,"column":8}}]},"4":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":8},"end":{"line":74,"column":8}},{"start":{"line":74,"column":8},"end":{"line":74,"column":8}}]},"5":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":8},"end":{"line":77,"column":8}},{"start":{"line":77,"column":8},"end":{"line":77,"column":8}}]},"6":{"line":97,"type":"if","locations":[{"start":{"line":97,"column":8},"end":{"line":97,"column":8}},{"start":{"line":97,"column":8},"end":{"line":97,"column":8}}]},"7":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":8},"end":{"line":100,"column":8}},{"start":{"line":100,"column":8},"end":{"line":100,"column":8}}]},"8":{"line":106,"type":"if","locations":[{"start":{"line":106,"column":8},"end":{"line":106,"column":8}},{"start":{"line":106,"column":8},"end":{"line":106,"column":8}}]},"9":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":8},"end":{"line":123,"column":8}},{"start":{"line":123,"column":8},"end":{"line":123,"column":8}}]},"10":{"line":125,"type":"if","locations":[{"start":{"line":125,"column":8},"end":{"line":125,"column":8}},{"start":{"line":125,"column":8},"end":{"line":125,"column":8}}]},"11":{"line":127,"type":"if","locations":[{"start":{"line":127,"column":8},"end":{"line":127,"column":8}},{"start":{"line":127,"column":8},"end":{"line":127,"column":8}}]},"12":{"line":131,"type":"if","locations":[{"start":{"line":131,"column":8},"end":{"line":131,"column":8}},{"start":{"line":131,"column":8},"end":{"line":131,"column":8}}]},"13":{"line":144,"type":"if","locations":[{"start":{"line":144,"column":8},"end":{"line":144,"column":8}},{"start":{"line":144,"column":8},"end":{"line":144,"column":8}}]}}}, +"contracts/schemes/Competition.sol":{"l":{"91":15,"92":15,"93":15,"131":27,"132":27,"133":27,"135":0,"138":27,"139":25,"140":23,"141":23,"142":21,"143":19,"145":19,"146":19,"147":19,"149":19,"150":17,"151":17,"152":65,"154":17,"155":15,"157":15,"158":15,"159":15,"160":15,"161":15,"162":15,"163":15,"164":15,"165":15,"166":15,"167":15,"168":15,"169":15,"170":1,"172":15,"201":73,"202":3,"205":71,"207":69,"208":65,"209":65,"210":65,"211":65,"212":64,"214":1,"216":65,"217":65,"218":65,"230":33,"231":33,"232":31,"233":29,"234":29,"235":29,"236":29,"238":29,"239":29,"240":29,"241":27,"243":25,"244":25,"245":3,"248":25,"249":25,"250":25,"251":25,"252":25,"253":25,"263":31,"264":29,"265":29,"266":8,"267":8,"277":3,"278":3,"279":3,"280":3,"281":3,"282":9,"285":1,"291":1,"293":1,"296":1,"299":1,"308":12,"309":12,"310":12,"311":12,"313":12,"314":8,"315":8,"317":8,"318":8,"319":8,"320":8,"321":8,"322":8,"323":8,"325":8,"326":8,"328":8,"329":8,"330":8,"333":5,"334":8,"336":5,"339":8,"340":8,"341":8,"344":8,"345":8,"348":8,"349":8,"352":8,"353":8,"355":8,"368":17,"369":17,"370":15,"372":15,"373":45,"374":20,"388":25,"389":25,"390":25,"391":25,"392":23,"393":23,"394":3,"397":20,"400":2,"401":2,"402":8,"404":4,"407":0,"411":2,"412":0},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/Competition.sol","s":{"1":15,"2":15,"3":15,"4":27,"5":27,"6":27,"7":0,"8":27,"9":25,"10":23,"11":23,"12":21,"13":19,"14":19,"15":19,"16":19,"17":19,"18":17,"19":17,"20":65,"21":17,"22":15,"23":15,"24":15,"25":15,"26":15,"27":15,"28":15,"29":15,"30":15,"31":15,"32":15,"33":15,"34":15,"35":15,"36":1,"37":15,"38":73,"39":3,"40":71,"41":69,"42":65,"43":65,"44":65,"45":65,"46":64,"47":1,"48":65,"49":65,"50":65,"51":33,"52":33,"53":31,"54":29,"55":29,"56":29,"57":29,"58":29,"59":29,"60":29,"61":27,"62":25,"63":25,"64":3,"65":25,"66":25,"67":25,"68":25,"69":25,"70":25,"71":31,"72":29,"73":29,"74":8,"75":8,"76":3,"77":3,"78":3,"79":3,"80":3,"81":9,"82":1,"83":1,"84":1,"85":1,"86":1,"87":12,"88":12,"89":12,"90":12,"91":12,"92":8,"93":8,"94":8,"95":8,"96":8,"97":8,"98":8,"99":8,"100":8,"101":8,"102":8,"103":8,"104":8,"105":8,"106":5,"107":8,"108":5,"109":8,"110":8,"111":8,"112":8,"113":8,"114":8,"115":8,"116":8,"117":8,"118":8,"119":17,"120":17,"121":15,"122":15,"123":45,"124":25,"125":25,"126":25,"127":25,"128":23,"129":23,"130":3,"131":20,"132":2,"133":2,"134":8,"135":4,"136":4,"137":0,"138":2,"139":0},"b":{"1":[15,0],"2":[15,0],"3":[0,27],"4":[25,2],"5":[23,2],"6":[23,0],"7":[21,2],"8":[19,2],"9":[19,0],"10":[19,0],"11":[19,0],"12":[19,0],"13":[17,2],"14":[15,2],"15":[1,14],"16":[3,70],"17":[1,2],"18":[69,2],"19":[65,4],"20":[64,1],"21":[31,2],"22":[29,0],"23":[29,0],"24":[27,2],"25":[25,2],"26":[3,22],"27":[29,2],"28":[29,0],"29":[8,21],"30":[3,0],"31":[3,0],"32":[3,0],"33":[7,2],"34":[12,0],"35":[12,0],"36":[8,4],"37":[8,0],"38":[8,0],"39":[8,0],"40":[5,3],"41":[15,2],"42":[20,25],"43":[23,2],"44":[3,20],"45":[4,4],"46":[0,4],"47":[0,2]},"f":{"1":15,"2":27,"3":73,"4":33,"5":31,"6":3,"7":12,"8":17,"9":25},"fnMap":{"1":{"name":"initialize","line":90,"loc":{"start":{"line":90,"column":4},"end":{"line":90,"column":70}}},"2":{"name":"proposeCompetition","line":119,"loc":{"start":{"line":119,"column":4},"end":{"line":130,"column":33}}},"3":{"name":"suggest","line":193,"loc":{"start":{"line":193,"column":4},"end":{"line":200,"column":5}}},"4":{"name":"vote","line":226,"loc":{"start":{"line":226,"column":4},"end":{"line":229,"column":5}}},"5":{"name":"setSnapshotBlock","line":261,"loc":{"start":{"line":261,"column":4},"end":{"line":261,"column":55}}},"6":{"name":"sendLeftOverFunds","line":275,"loc":{"start":{"line":275,"column":4},"end":{"line":275,"column":56}}},"7":{"name":"redeem","line":307,"loc":{"start":{"line":307,"column":4},"end":{"line":307,"column":47}}},"8":{"name":"getOrderedIndexOfSuggestion","line":364,"loc":{"start":{"line":364,"column":4},"end":{"line":367,"column":28}}},"9":{"name":"refreshTopSuggestions","line":387,"loc":{"start":{"line":387,"column":4},"end":{"line":387,"column":84}}}},"statementMap":{"1":{"start":{"line":91,"column":8},"end":{"line":91,"column":82}},"2":{"start":{"line":92,"column":8},"end":{"line":92,"column":92}},"3":{"start":{"line":93,"column":8},"end":{"line":93,"column":53}},"4":{"start":{"line":131,"column":8},"end":{"line":131,"column":53}},"5":{"start":{"line":132,"column":8},"end":{"line":132,"column":49}},"6":{"start":{"line":133,"column":8},"end":{"line":133,"column":4857}},"7":{"start":{"line":135,"column":12},"end":{"line":135,"column":26}},"8":{"start":{"line":138,"column":8},"end":{"line":138,"column":83}},"9":{"start":{"line":139,"column":8},"end":{"line":139,"column":102}},"10":{"start":{"line":140,"column":8},"end":{"line":140,"column":104}},"11":{"start":{"line":141,"column":8},"end":{"line":141,"column":95}},"12":{"start":{"line":142,"column":8},"end":{"line":142,"column":94}},"13":{"start":{"line":143,"column":8},"end":{"line":143,"column":5590}},"14":{"start":{"line":145,"column":8},"end":{"line":145,"column":112}},"15":{"start":{"line":146,"column":8},"end":{"line":146,"column":5780}},"16":{"start":{"line":147,"column":12},"end":{"line":147,"column":78}},"17":{"start":{"line":149,"column":8},"end":{"line":149,"column":101}},"18":{"start":{"line":150,"column":8},"end":{"line":150,"column":32}},"19":{"start":{"line":151,"column":8},"end":{"line":151,"column":6040}},"20":{"start":{"line":152,"column":12},"end":{"line":152,"column":67}},"21":{"start":{"line":154,"column":8},"end":{"line":154,"column":74}},"22":{"start":{"line":155,"column":8},"end":{"line":155,"column":6357}},"23":{"start":{"line":157,"column":8},"end":{"line":157,"column":62}},"24":{"start":{"line":158,"column":8},"end":{"line":158,"column":55}},"25":{"start":{"line":159,"column":8},"end":{"line":159,"column":50}},"26":{"start":{"line":160,"column":8},"end":{"line":160,"column":68}},"27":{"start":{"line":161,"column":8},"end":{"line":161,"column":60}},"28":{"start":{"line":162,"column":8},"end":{"line":162,"column":77}},"29":{"start":{"line":163,"column":8},"end":{"line":163,"column":71}},"30":{"start":{"line":164,"column":8},"end":{"line":164,"column":74}},"31":{"start":{"line":165,"column":8},"end":{"line":165,"column":60}},"32":{"start":{"line":166,"column":8},"end":{"line":166,"column":52}},"33":{"start":{"line":167,"column":8},"end":{"line":167,"column":62}},"34":{"start":{"line":168,"column":8},"end":{"line":168,"column":46}},"35":{"start":{"line":169,"column":8},"end":{"line":169,"column":7234}},"36":{"start":{"line":170,"column":12},"end":{"line":170,"column":51}},"37":{"start":{"line":172,"column":8},"end":{"line":172,"column":7331}},"38":{"start":{"line":201,"column":8},"end":{"line":201,"column":8283}},"39":{"start":{"line":202,"column":12},"end":{"line":202,"column":88}},"40":{"start":{"line":205,"column":8},"end":{"line":205,"column":86}},"41":{"start":{"line":207,"column":8},"end":{"line":207,"column":102}},"42":{"start":{"line":208,"column":8},"end":{"line":208,"column":53}},"43":{"start":{"line":209,"column":8},"end":{"line":209,"column":63}},"44":{"start":{"line":210,"column":8},"end":{"line":210,"column":35}},"45":{"start":{"line":211,"column":8},"end":{"line":211,"column":8903}},"46":{"start":{"line":212,"column":12},"end":{"line":212,"column":35}},"47":{"start":{"line":214,"column":12},"end":{"line":214,"column":37}},"48":{"start":{"line":216,"column":8},"end":{"line":216,"column":64}},"49":{"start":{"line":217,"column":8},"end":{"line":217,"column":90}},"50":{"start":{"line":218,"column":8},"end":{"line":218,"column":33}},"51":{"start":{"line":230,"column":8},"end":{"line":230,"column":66}},"52":{"start":{"line":231,"column":8},"end":{"line":231,"column":69}},"53":{"start":{"line":232,"column":8},"end":{"line":232,"column":35}},"54":{"start":{"line":233,"column":8},"end":{"line":233,"column":77}},"55":{"start":{"line":234,"column":8},"end":{"line":234,"column":115}},"56":{"start":{"line":235,"column":8},"end":{"line":235,"column":81}},"57":{"start":{"line":236,"column":8},"end":{"line":236,"column":57}},"58":{"start":{"line":238,"column":8},"end":{"line":238,"column":59}},"59":{"start":{"line":239,"column":8},"end":{"line":239,"column":66}},"60":{"start":{"line":240,"column":8},"end":{"line":240,"column":85}},"61":{"start":{"line":241,"column":8},"end":{"line":241,"column":10256}},"62":{"start":{"line":243,"column":8},"end":{"line":243,"column":85}},"63":{"start":{"line":244,"column":8},"end":{"line":244,"column":10443}},"64":{"start":{"line":245,"column":12},"end":{"line":245,"column":10548}},"65":{"start":{"line":248,"column":8},"end":{"line":248,"column":68}},"66":{"start":{"line":249,"column":8},"end":{"line":249,"column":117}},"67":{"start":{"line":250,"column":8},"end":{"line":250,"column":48}},"68":{"start":{"line":251,"column":8},"end":{"line":251,"column":55}},"69":{"start":{"line":252,"column":8},"end":{"line":252,"column":71}},"70":{"start":{"line":253,"column":8},"end":{"line":253,"column":19}},"71":{"start":{"line":263,"column":8},"end":{"line":263,"column":93}},"72":{"start":{"line":264,"column":8},"end":{"line":264,"column":94}},"73":{"start":{"line":265,"column":8},"end":{"line":265,"column":11572}},"74":{"start":{"line":266,"column":12},"end":{"line":266,"column":62}},"75":{"start":{"line":267,"column":12},"end":{"line":267,"column":57}},"76":{"start":{"line":277,"column":8},"end":{"line":277,"column":79}},"77":{"start":{"line":278,"column":8},"end":{"line":278,"column":94}},"78":{"start":{"line":279,"column":8},"end":{"line":279,"column":63}},"79":{"start":{"line":280,"column":8},"end":{"line":280,"column":79}},"80":{"start":{"line":281,"column":8},"end":{"line":281,"column":12332}},"81":{"start":{"line":282,"column":12},"end":{"line":282,"column":116}},"82":{"start":{"line":285,"column":8},"end":{"line":285,"column":12605}},"83":{"start":{"line":291,"column":8},"end":{"line":291,"column":77}},"84":{"start":{"line":293,"column":8},"end":{"line":293,"column":12884}},"85":{"start":{"line":296,"column":8},"end":{"line":296,"column":13023}},"86":{"start":{"line":299,"column":8},"end":{"line":299,"column":13162}},"87":{"start":{"line":308,"column":8},"end":{"line":308,"column":66}},"88":{"start":{"line":309,"column":8},"end":{"line":309,"column":62}},"89":{"start":{"line":310,"column":8},"end":{"line":310,"column":57}},"90":{"start":{"line":311,"column":8},"end":{"line":311,"column":57}},"91":{"start":{"line":313,"column":8},"end":{"line":313,"column":65}},"92":{"start":{"line":314,"column":8},"end":{"line":314,"column":80}},"93":{"start":{"line":315,"column":8},"end":{"line":315,"column":13905}},"94":{"start":{"line":317,"column":8},"end":{"line":317,"column":76}},"95":{"start":{"line":318,"column":8},"end":{"line":318,"column":71}},"96":{"start":{"line":319,"column":8},"end":{"line":319,"column":96}},"97":{"start":{"line":320,"column":8},"end":{"line":320,"column":58}},"98":{"start":{"line":321,"column":8},"end":{"line":321,"column":36}},"99":{"start":{"line":322,"column":8},"end":{"line":322,"column":107}},"100":{"start":{"line":323,"column":8},"end":{"line":323,"column":17}},"101":{"start":{"line":325,"column":8},"end":{"line":325,"column":14520}},"102":{"start":{"line":326,"column":12},"end":{"line":326,"column":75}},"103":{"start":{"line":328,"column":8},"end":{"line":328,"column":70}},"104":{"start":{"line":329,"column":8},"end":{"line":329,"column":40}},"105":{"start":{"line":330,"column":8},"end":{"line":330,"column":14832}},"106":{"start":{"line":333,"column":12},"end":{"line":333,"column":15067}},"107":{"start":{"line":334,"column":16},"end":{"line":334,"column":87}},"108":{"start":{"line":336,"column":12},"end":{"line":336,"column":15338}},"109":{"start":{"line":339,"column":8},"end":{"line":339,"column":22}},"110":{"start":{"line":340,"column":8},"end":{"line":340,"column":75}},"111":{"start":{"line":341,"column":8},"end":{"line":341,"column":15519}},"112":{"start":{"line":344,"column":8},"end":{"line":344,"column":72}},"113":{"start":{"line":345,"column":8},"end":{"line":345,"column":15721}},"114":{"start":{"line":348,"column":8},"end":{"line":348,"column":65}},"115":{"start":{"line":349,"column":8},"end":{"line":349,"column":15913}},"116":{"start":{"line":352,"column":8},"end":{"line":352,"column":73}},"117":{"start":{"line":353,"column":8},"end":{"line":353,"column":16108}},"118":{"start":{"line":355,"column":8},"end":{"line":355,"column":64}},"119":{"start":{"line":368,"column":8},"end":{"line":368,"column":66}},"120":{"start":{"line":369,"column":8},"end":{"line":369,"column":69}},"121":{"start":{"line":370,"column":8},"end":{"line":370,"column":78}},"122":{"start":{"line":372,"column":8},"end":{"line":372,"column":16951}},"123":{"start":{"line":373,"column":12},"end":{"line":373,"column":17021}},"124":{"start":{"line":388,"column":8},"end":{"line":388,"column":80}},"125":{"start":{"line":389,"column":8},"end":{"line":389,"column":60}},"126":{"start":{"line":390,"column":8},"end":{"line":390,"column":17}},"127":{"start":{"line":391,"column":8},"end":{"line":391,"column":17768}},"128":{"start":{"line":392,"column":12},"end":{"line":392,"column":17853}},"129":{"start":{"line":393,"column":16},"end":{"line":393,"column":17918}},"130":{"start":{"line":394,"column":20},"end":{"line":394,"column":26}},"131":{"start":{"line":397,"column":12},"end":{"line":397,"column":45}},"132":{"start":{"line":400,"column":12},"end":{"line":400,"column":32}},"133":{"start":{"line":401,"column":12},"end":{"line":401,"column":18182}},"134":{"start":{"line":402,"column":16},"end":{"line":402,"column":18265}},"135":{"start":{"line":404,"column":20},"end":{"line":404,"column":31}},"136":{"start":{"line":405,"column":23},"end":{"line":405,"column":18442}},"137":{"start":{"line":407,"column":20},"end":{"line":407,"column":26}},"138":{"start":{"line":411,"column":12},"end":{"line":411,"column":18626}},"139":{"start":{"line":412,"column":16},"end":{"line":412,"column":55}}},"branchMap":{"1":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":8},"end":{"line":91,"column":8}},{"start":{"line":91,"column":8},"end":{"line":91,"column":8}}]},"2":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":8},"end":{"line":92,"column":8}},{"start":{"line":92,"column":8},"end":{"line":92,"column":8}}]},"3":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":8},"end":{"line":133,"column":8}},{"start":{"line":133,"column":8},"end":{"line":133,"column":8}}]},"4":{"line":138,"type":"if","locations":[{"start":{"line":138,"column":8},"end":{"line":138,"column":8}},{"start":{"line":138,"column":8},"end":{"line":138,"column":8}}]},"5":{"line":139,"type":"if","locations":[{"start":{"line":139,"column":8},"end":{"line":139,"column":8}},{"start":{"line":139,"column":8},"end":{"line":139,"column":8}}]},"6":{"line":140,"type":"if","locations":[{"start":{"line":140,"column":8},"end":{"line":140,"column":8}},{"start":{"line":140,"column":8},"end":{"line":140,"column":8}}]},"7":{"line":141,"type":"if","locations":[{"start":{"line":141,"column":8},"end":{"line":141,"column":8}},{"start":{"line":141,"column":8},"end":{"line":141,"column":8}}]},"8":{"line":142,"type":"if","locations":[{"start":{"line":142,"column":8},"end":{"line":142,"column":8}},{"start":{"line":142,"column":8},"end":{"line":142,"column":8}}]},"9":{"line":143,"type":"if","locations":[{"start":{"line":143,"column":8},"end":{"line":143,"column":8}},{"start":{"line":143,"column":8},"end":{"line":143,"column":8}}]},"10":{"line":145,"type":"if","locations":[{"start":{"line":145,"column":8},"end":{"line":145,"column":8}},{"start":{"line":145,"column":8},"end":{"line":145,"column":8}}]},"11":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":8},"end":{"line":146,"column":8}},{"start":{"line":146,"column":8},"end":{"line":146,"column":8}}]},"12":{"line":147,"type":"if","locations":[{"start":{"line":147,"column":12},"end":{"line":147,"column":12}},{"start":{"line":147,"column":12},"end":{"line":147,"column":12}}]},"13":{"line":149,"type":"if","locations":[{"start":{"line":149,"column":8},"end":{"line":149,"column":8}},{"start":{"line":149,"column":8},"end":{"line":149,"column":8}}]},"14":{"line":154,"type":"if","locations":[{"start":{"line":154,"column":8},"end":{"line":154,"column":8}},{"start":{"line":154,"column":8},"end":{"line":154,"column":8}}]},"15":{"line":169,"type":"if","locations":[{"start":{"line":169,"column":8},"end":{"line":169,"column":8}},{"start":{"line":169,"column":8},"end":{"line":169,"column":8}}]},"16":{"line":201,"type":"if","locations":[{"start":{"line":201,"column":8},"end":{"line":201,"column":8}},{"start":{"line":201,"column":8},"end":{"line":201,"column":8}}]},"17":{"line":202,"type":"if","locations":[{"start":{"line":202,"column":12},"end":{"line":202,"column":12}},{"start":{"line":202,"column":12},"end":{"line":202,"column":12}}]},"18":{"line":205,"type":"if","locations":[{"start":{"line":205,"column":8},"end":{"line":205,"column":8}},{"start":{"line":205,"column":8},"end":{"line":205,"column":8}}]},"19":{"line":207,"type":"if","locations":[{"start":{"line":207,"column":8},"end":{"line":207,"column":8}},{"start":{"line":207,"column":8},"end":{"line":207,"column":8}}]},"20":{"line":211,"type":"if","locations":[{"start":{"line":211,"column":8},"end":{"line":211,"column":8}},{"start":{"line":211,"column":8},"end":{"line":211,"column":8}}]},"21":{"line":231,"type":"if","locations":[{"start":{"line":231,"column":8},"end":{"line":231,"column":8}},{"start":{"line":231,"column":8},"end":{"line":231,"column":8}}]},"22":{"line":235,"type":"if","locations":[{"start":{"line":235,"column":8},"end":{"line":235,"column":8}},{"start":{"line":235,"column":8},"end":{"line":235,"column":8}}]},"23":{"line":238,"type":"if","locations":[{"start":{"line":238,"column":8},"end":{"line":238,"column":8}},{"start":{"line":238,"column":8},"end":{"line":238,"column":8}}]},"24":{"line":240,"type":"if","locations":[{"start":{"line":240,"column":8},"end":{"line":240,"column":8}},{"start":{"line":240,"column":8},"end":{"line":240,"column":8}}]},"25":{"line":241,"type":"if","locations":[{"start":{"line":241,"column":8},"end":{"line":241,"column":8}},{"start":{"line":241,"column":8},"end":{"line":241,"column":8}}]},"26":{"line":244,"type":"if","locations":[{"start":{"line":244,"column":8},"end":{"line":244,"column":8}},{"start":{"line":244,"column":8},"end":{"line":244,"column":8}}]},"27":{"line":263,"type":"if","locations":[{"start":{"line":263,"column":8},"end":{"line":263,"column":8}},{"start":{"line":263,"column":8},"end":{"line":263,"column":8}}]},"28":{"line":264,"type":"if","locations":[{"start":{"line":264,"column":8},"end":{"line":264,"column":8}},{"start":{"line":264,"column":8},"end":{"line":264,"column":8}}]},"29":{"line":265,"type":"if","locations":[{"start":{"line":265,"column":8},"end":{"line":265,"column":8}},{"start":{"line":265,"column":8},"end":{"line":265,"column":8}}]},"30":{"line":277,"type":"if","locations":[{"start":{"line":277,"column":8},"end":{"line":277,"column":8}},{"start":{"line":277,"column":8},"end":{"line":277,"column":8}}]},"31":{"line":278,"type":"if","locations":[{"start":{"line":278,"column":8},"end":{"line":278,"column":8}},{"start":{"line":278,"column":8},"end":{"line":278,"column":8}}]},"32":{"line":279,"type":"if","locations":[{"start":{"line":279,"column":8},"end":{"line":279,"column":8}},{"start":{"line":279,"column":8},"end":{"line":279,"column":8}}]},"33":{"line":282,"type":"if","locations":[{"start":{"line":282,"column":12},"end":{"line":282,"column":12}},{"start":{"line":282,"column":12},"end":{"line":282,"column":12}}]},"34":{"line":309,"type":"if","locations":[{"start":{"line":309,"column":8},"end":{"line":309,"column":8}},{"start":{"line":309,"column":8},"end":{"line":309,"column":8}}]},"35":{"line":311,"type":"if","locations":[{"start":{"line":311,"column":8},"end":{"line":311,"column":8}},{"start":{"line":311,"column":8},"end":{"line":311,"column":8}}]},"36":{"line":313,"type":"if","locations":[{"start":{"line":313,"column":8},"end":{"line":313,"column":8}},{"start":{"line":313,"column":8},"end":{"line":313,"column":8}}]},"37":{"line":314,"type":"if","locations":[{"start":{"line":314,"column":8},"end":{"line":314,"column":8}},{"start":{"line":314,"column":8},"end":{"line":314,"column":8}}]},"38":{"line":315,"type":"if","locations":[{"start":{"line":315,"column":8},"end":{"line":315,"column":8}},{"start":{"line":315,"column":8},"end":{"line":315,"column":8}}]},"39":{"line":319,"type":"if","locations":[{"start":{"line":319,"column":8},"end":{"line":319,"column":8}},{"start":{"line":319,"column":8},"end":{"line":319,"column":8}}]},"40":{"line":330,"type":"if","locations":[{"start":{"line":330,"column":8},"end":{"line":330,"column":8}},{"start":{"line":330,"column":8},"end":{"line":330,"column":8}}]},"41":{"line":369,"type":"if","locations":[{"start":{"line":369,"column":8},"end":{"line":369,"column":8}},{"start":{"line":369,"column":8},"end":{"line":369,"column":8}}]},"42":{"line":373,"type":"if","locations":[{"start":{"line":373,"column":12},"end":{"line":373,"column":12}},{"start":{"line":373,"column":12},"end":{"line":373,"column":12}}]},"43":{"line":391,"type":"if","locations":[{"start":{"line":391,"column":8},"end":{"line":391,"column":8}},{"start":{"line":391,"column":8},"end":{"line":391,"column":8}}]},"44":{"line":393,"type":"if","locations":[{"start":{"line":393,"column":16},"end":{"line":393,"column":16}},{"start":{"line":393,"column":16},"end":{"line":393,"column":16}}]},"45":{"line":402,"type":"if","locations":[{"start":{"line":402,"column":16},"end":{"line":402,"column":16}},{"start":{"line":402,"column":16},"end":{"line":402,"column":16}}]},"46":{"line":405,"type":"if","locations":[{"start":{"line":405,"column":23},"end":{"line":405,"column":23}},{"start":{"line":405,"column":23},"end":{"line":405,"column":23}}]},"47":{"line":411,"type":"if","locations":[{"start":{"line":411,"column":12},"end":{"line":411,"column":12}},{"start":{"line":411,"column":12},"end":{"line":411,"column":12}}]}}}, +"contracts/schemes/ContinuousLocking4Reputation.sol":{"l":{"98":33,"99":31,"101":31,"102":29,"104":29,"106":27,"107":25,"108":25,"109":25,"110":25,"111":25,"112":25,"113":25,"114":25,"115":25,"116":23,"117":23,"118":23,"119":23,"130":16,"131":14,"132":14,"133":14,"135":14,"136":14,"137":14,"138":149,"139":149,"140":149,"141":144,"142":144,"143":144,"144":144,"145":144,"146":144,"149":14,"150":14,"152":12,"153":12,"171":27,"173":23,"174":23,"175":23,"176":23,"178":21,"179":21,"181":21,"182":21,"183":21,"185":21,"187":21,"189":21,"190":21,"193":19,"194":107,"195":107,"196":107,"197":107,"200":19,"201":19,"218":13,"219":13,"221":11,"223":11,"224":11,"225":9,"226":9,"229":9,"230":9,"232":9,"233":100,"234":100,"235":100,"236":100,"238":9,"239":9,"249":12,"250":12,"251":10,"252":10,"254":10,"256":4,"257":4,"258":4,"269":146,"270":145,"282":2,"291":289,"292":289,"293":289,"300":311,"307":158,"316":144},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/ContinuousLocking4Reputation.sol","s":{"1":33,"2":31,"3":31,"4":29,"5":29,"6":27,"7":25,"8":25,"9":25,"10":25,"11":25,"12":25,"13":25,"14":25,"15":25,"16":23,"17":23,"18":23,"19":23,"20":16,"21":14,"22":14,"23":14,"24":14,"25":14,"26":14,"27":149,"28":149,"29":149,"30":144,"31":144,"32":144,"33":144,"34":144,"35":144,"36":14,"37":14,"38":12,"39":12,"40":27,"41":23,"42":23,"43":23,"44":23,"45":21,"46":21,"47":21,"48":21,"49":21,"50":21,"51":21,"52":21,"53":21,"54":19,"55":107,"56":107,"57":107,"58":107,"59":19,"60":19,"61":13,"62":13,"63":11,"64":11,"65":11,"66":9,"67":9,"68":9,"69":9,"70":9,"71":100,"72":100,"73":100,"74":100,"75":9,"76":9,"77":12,"78":12,"79":10,"80":10,"81":10,"82":4,"83":4,"84":4,"85":146,"86":145,"87":2,"88":289,"89":289,"90":289,"91":311,"92":158,"93":144},"b":{"1":[31,2],"2":[31,0],"3":[29,2],"4":[29,0],"5":[27,2],"6":[25,2],"7":[25,0],"8":[23,2],"9":[14,2],"10":[14,0],"11":[144,5],"12":[12,2],"13":[12,0],"14":[23,4],"15":[23,0],"16":[23,0],"17":[23,0],"18":[21,2],"19":[19,2],"20":[11,2],"21":[9,2],"22":[9,0],"23":[9,0],"24":[9,0],"25":[10,2],"26":[4,6],"27":[145,1],"28":[289,0]},"f":{"1":33,"2":16,"3":27,"4":13,"5":12,"6":146,"7":2,"8":289,"9":311,"10":158,"11":144},"fnMap":{"1":{"name":"initialize","line":84,"loc":{"start":{"line":84,"column":4},"end":{"line":97,"column":5}}},"2":{"name":"redeem","line":128,"loc":{"start":{"line":128,"column":4},"end":{"line":128,"column":94}}},"3":{"name":"lock","line":168,"loc":{"start":{"line":168,"column":28},"end":{"line":170,"column":5}}},"4":{"name":"extendLocking","line":216,"loc":{"start":{"line":216,"column":28},"end":{"line":217,"column":5}}},"5":{"name":"release","line":248,"loc":{"start":{"line":248,"column":4},"end":{"line":248,"column":91}}},"6":{"name":"getRepRewardPerBatch","line":268,"loc":{"start":{"line":268,"column":4},"end":{"line":268,"column":92}}},"7":{"name":"getLockingIdScore","line":281,"loc":{"start":{"line":281,"column":4},"end":{"line":281,"column":99}}},"8":{"name":"mul","line":288,"loc":{"start":{"line":288,"column":4},"end":{"line":288,"column":75}}},"9":{"name":"toReal","line":299,"loc":{"start":{"line":299,"column":4},"end":{"line":299,"column":63}}},"10":{"name":"fromReal","line":306,"loc":{"start":{"line":306,"column":4},"end":{"line":306,"column":70}}},"11":{"name":"div","line":313,"loc":{"start":{"line":313,"column":4},"end":{"line":313,"column":93}}}},"statementMap":{"1":{"start":{"line":98,"column":8},"end":{"line":98,"column":66}},"2":{"start":{"line":99,"column":8},"end":{"line":99,"column":61}},"3":{"start":{"line":101,"column":8},"end":{"line":101,"column":59}},"4":{"start":{"line":102,"column":8},"end":{"line":102,"column":4436}},"5":{"start":{"line":104,"column":8},"end":{"line":104,"column":4558}},"6":{"start":{"line":106,"column":8},"end":{"line":106,"column":101}},"7":{"start":{"line":107,"column":8},"end":{"line":107,"column":21}},"8":{"start":{"line":108,"column":8},"end":{"line":108,"column":23}},"9":{"start":{"line":109,"column":8},"end":{"line":109,"column":29}},"10":{"start":{"line":110,"column":8},"end":{"line":110,"column":47}},"11":{"start":{"line":111,"column":8},"end":{"line":111,"column":43}},"12":{"start":{"line":112,"column":8},"end":{"line":112,"column":45}},"13":{"start":{"line":113,"column":8},"end":{"line":113,"column":29}},"14":{"start":{"line":114,"column":8},"end":{"line":114,"column":76}},"15":{"start":{"line":115,"column":8},"end":{"line":115,"column":101}},"16":{"start":{"line":116,"column":8},"end":{"line":116,"column":58}},"17":{"start":{"line":117,"column":8},"end":{"line":117,"column":74}},"18":{"start":{"line":118,"column":8},"end":{"line":118,"column":41}},"19":{"start":{"line":119,"column":8},"end":{"line":119,"column":45}},"20":{"start":{"line":130,"column":8},"end":{"line":130,"column":64}},"21":{"start":{"line":131,"column":8},"end":{"line":131,"column":63}},"22":{"start":{"line":132,"column":8},"end":{"line":132,"column":68}},"23":{"start":{"line":133,"column":8},"end":{"line":133,"column":85}},"24":{"start":{"line":135,"column":8},"end":{"line":135,"column":60}},"25":{"start":{"line":136,"column":8},"end":{"line":136,"column":101}},"26":{"start":{"line":137,"column":8},"end":{"line":137,"column":6285}},"27":{"start":{"line":138,"column":12},"end":{"line":138,"column":67}},"28":{"start":{"line":139,"column":12},"end":{"line":139,"column":54}},"29":{"start":{"line":140,"column":12},"end":{"line":140,"column":6532}},"30":{"start":{"line":141,"column":16},"end":{"line":141,"column":45}},"31":{"start":{"line":142,"column":16},"end":{"line":142,"column":92}},"32":{"start":{"line":143,"column":16},"end":{"line":143,"column":88}},"33":{"start":{"line":144,"column":16},"end":{"line":144,"column":94}},"34":{"start":{"line":145,"column":16},"end":{"line":145,"column":58}},"35":{"start":{"line":146,"column":16},"end":{"line":146,"column":112}},"36":{"start":{"line":149,"column":8},"end":{"line":149,"column":49}},"37":{"start":{"line":150,"column":8},"end":{"line":150,"column":59}},"38":{"start":{"line":152,"column":8},"end":{"line":152,"column":66}},"39":{"start":{"line":153,"column":8},"end":{"line":153,"column":7404}},"40":{"start":{"line":171,"column":8},"end":{"line":171,"column":52}},"41":{"start":{"line":173,"column":8},"end":{"line":173,"column":87}},"42":{"start":{"line":174,"column":8},"end":{"line":174,"column":82}},"43":{"start":{"line":175,"column":8},"end":{"line":175,"column":50}},"44":{"start":{"line":176,"column":8},"end":{"line":176,"column":8377}},"45":{"start":{"line":178,"column":8},"end":{"line":178,"column":39}},"46":{"start":{"line":179,"column":8},"end":{"line":179,"column":30}},"47":{"start":{"line":181,"column":8},"end":{"line":181,"column":60}},"48":{"start":{"line":182,"column":8},"end":{"line":182,"column":30}},"49":{"start":{"line":183,"column":8},"end":{"line":183,"column":30}},"50":{"start":{"line":185,"column":8},"end":{"line":185,"column":31}},"51":{"start":{"line":187,"column":8},"end":{"line":187,"column":74}},"52":{"start":{"line":189,"column":8},"end":{"line":189,"column":66}},"53":{"start":{"line":190,"column":8},"end":{"line":190,"column":9021}},"54":{"start":{"line":193,"column":8},"end":{"line":193,"column":9134}},"55":{"start":{"line":194,"column":12},"end":{"line":194,"column":65}},"56":{"start":{"line":195,"column":12},"end":{"line":195,"column":54}},"57":{"start":{"line":196,"column":12},"end":{"line":196,"column":57}},"58":{"start":{"line":197,"column":12},"end":{"line":197,"column":42}},"59":{"start":{"line":200,"column":8},"end":{"line":200,"column":53}},"60":{"start":{"line":201,"column":8},"end":{"line":201,"column":63}},"61":{"start":{"line":218,"column":8},"end":{"line":218,"column":61}},"62":{"start":{"line":219,"column":8},"end":{"line":219,"column":68}},"63":{"start":{"line":221,"column":8},"end":{"line":221,"column":10343}},"64":{"start":{"line":223,"column":8},"end":{"line":223,"column":74}},"65":{"start":{"line":224,"column":8},"end":{"line":224,"column":106}},"66":{"start":{"line":225,"column":8},"end":{"line":225,"column":62}},"67":{"start":{"line":226,"column":8},"end":{"line":226,"column":10677}},"68":{"start":{"line":229,"column":8},"end":{"line":229,"column":66}},"69":{"start":{"line":230,"column":8},"end":{"line":230,"column":82}},"70":{"start":{"line":232,"column":8},"end":{"line":232,"column":11023}},"71":{"start":{"line":233,"column":12},"end":{"line":233,"column":65}},"72":{"start":{"line":234,"column":12},"end":{"line":234,"column":76}},"73":{"start":{"line":235,"column":12},"end":{"line":235,"column":87}},"74":{"start":{"line":236,"column":12},"end":{"line":236,"column":43}},"75":{"start":{"line":238,"column":8},"end":{"line":238,"column":55}},"76":{"start":{"line":239,"column":8},"end":{"line":239,"column":65}},"77":{"start":{"line":249,"column":8},"end":{"line":249,"column":63}},"78":{"start":{"line":250,"column":8},"end":{"line":250,"column":61}},"79":{"start":{"line":251,"column":8},"end":{"line":251,"column":29}},"80":{"start":{"line":252,"column":8},"end":{"line":252,"column":24}},"81":{"start":{"line":254,"column":8},"end":{"line":254,"column":12055}},"82":{"start":{"line":256,"column":8},"end":{"line":256,"column":52}},"83":{"start":{"line":257,"column":8},"end":{"line":257,"column":56}},"84":{"start":{"line":258,"column":8},"end":{"line":258,"column":54}},"85":{"start":{"line":269,"column":8},"end":{"line":269,"column":12700}},"86":{"start":{"line":270,"column":12},"end":{"line":270,"column":77}},"87":{"start":{"line":282,"column":8},"end":{"line":282,"column":54}},"88":{"start":{"line":291,"column":8},"end":{"line":291,"column":35}},"89":{"start":{"line":292,"column":8},"end":{"line":292,"column":59}},"90":{"start":{"line":293,"column":8},"end":{"line":293,"column":34}},"91":{"start":{"line":300,"column":8},"end":{"line":300,"column":40}},"92":{"start":{"line":307,"column":8},"end":{"line":307,"column":45}},"93":{"start":{"line":316,"column":8},"end":{"line":316,"column":86}}},"branchMap":{"1":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":8},"end":{"line":98,"column":8}},{"start":{"line":98,"column":8},"end":{"line":98,"column":8}}]},"2":{"line":99,"type":"if","locations":[{"start":{"line":99,"column":8},"end":{"line":99,"column":8}},{"start":{"line":99,"column":8},"end":{"line":99,"column":8}}]},"3":{"line":101,"type":"if","locations":[{"start":{"line":101,"column":8},"end":{"line":101,"column":8}},{"start":{"line":101,"column":8},"end":{"line":101,"column":8}}]},"4":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"5":{"line":104,"type":"if","locations":[{"start":{"line":104,"column":8},"end":{"line":104,"column":8}},{"start":{"line":104,"column":8},"end":{"line":104,"column":8}}]},"6":{"line":106,"type":"if","locations":[{"start":{"line":106,"column":8},"end":{"line":106,"column":8}},{"start":{"line":106,"column":8},"end":{"line":106,"column":8}}]},"7":{"line":114,"type":"if","locations":[{"start":{"line":114,"column":8},"end":{"line":114,"column":8}},{"start":{"line":114,"column":8},"end":{"line":114,"column":8}}]},"8":{"line":115,"type":"if","locations":[{"start":{"line":115,"column":8},"end":{"line":115,"column":8}},{"start":{"line":115,"column":8},"end":{"line":115,"column":8}}]},"9":{"line":130,"type":"if","locations":[{"start":{"line":130,"column":8},"end":{"line":130,"column":8}},{"start":{"line":130,"column":8},"end":{"line":130,"column":8}}]},"10":{"line":132,"type":"if","locations":[{"start":{"line":132,"column":8},"end":{"line":132,"column":8}},{"start":{"line":132,"column":8},"end":{"line":132,"column":8}}]},"11":{"line":140,"type":"if","locations":[{"start":{"line":140,"column":12},"end":{"line":140,"column":12}},{"start":{"line":140,"column":12},"end":{"line":140,"column":12}}]},"12":{"line":150,"type":"if","locations":[{"start":{"line":150,"column":8},"end":{"line":150,"column":8}},{"start":{"line":150,"column":8},"end":{"line":150,"column":8}}]},"13":{"line":153,"type":"if","locations":[{"start":{"line":153,"column":8},"end":{"line":153,"column":8}},{"start":{"line":153,"column":8},"end":{"line":153,"column":8}}]},"14":{"line":171,"type":"if","locations":[{"start":{"line":171,"column":8},"end":{"line":171,"column":8}},{"start":{"line":171,"column":8},"end":{"line":171,"column":8}}]},"15":{"line":173,"type":"if","locations":[{"start":{"line":173,"column":8},"end":{"line":173,"column":8}},{"start":{"line":173,"column":8},"end":{"line":173,"column":8}}]},"16":{"line":174,"type":"if","locations":[{"start":{"line":174,"column":8},"end":{"line":174,"column":8}},{"start":{"line":174,"column":8},"end":{"line":174,"column":8}}]},"17":{"line":175,"type":"if","locations":[{"start":{"line":175,"column":8},"end":{"line":175,"column":8}},{"start":{"line":175,"column":8},"end":{"line":175,"column":8}}]},"18":{"line":176,"type":"if","locations":[{"start":{"line":176,"column":8},"end":{"line":176,"column":8}},{"start":{"line":176,"column":8},"end":{"line":176,"column":8}}]},"19":{"line":190,"type":"if","locations":[{"start":{"line":190,"column":8},"end":{"line":190,"column":8}},{"start":{"line":190,"column":8},"end":{"line":190,"column":8}}]},"20":{"line":219,"type":"if","locations":[{"start":{"line":219,"column":8},"end":{"line":219,"column":8}},{"start":{"line":219,"column":8},"end":{"line":219,"column":8}}]},"21":{"line":224,"type":"if","locations":[{"start":{"line":224,"column":8},"end":{"line":224,"column":8}},{"start":{"line":224,"column":8},"end":{"line":224,"column":8}}]},"22":{"line":225,"type":"if","locations":[{"start":{"line":225,"column":8},"end":{"line":225,"column":8}},{"start":{"line":225,"column":8},"end":{"line":225,"column":8}}]},"23":{"line":226,"type":"if","locations":[{"start":{"line":226,"column":8},"end":{"line":226,"column":8}},{"start":{"line":226,"column":8},"end":{"line":226,"column":8}}]},"24":{"line":230,"type":"if","locations":[{"start":{"line":230,"column":8},"end":{"line":230,"column":8}},{"start":{"line":230,"column":8},"end":{"line":230,"column":8}}]},"25":{"line":250,"type":"if","locations":[{"start":{"line":250,"column":8},"end":{"line":250,"column":8}},{"start":{"line":250,"column":8},"end":{"line":250,"column":8}}]},"26":{"line":254,"type":"if","locations":[{"start":{"line":254,"column":8},"end":{"line":254,"column":8}},{"start":{"line":254,"column":8},"end":{"line":254,"column":8}}]},"27":{"line":269,"type":"if","locations":[{"start":{"line":269,"column":8},"end":{"line":269,"column":8}},{"start":{"line":269,"column":8},"end":{"line":269,"column":8}}]},"28":{"line":292,"type":"if","locations":[{"start":{"line":292,"column":8},"end":{"line":292,"column":8}},{"start":{"line":292,"column":8},"end":{"line":292,"column":8}}]}}}, +"contracts/schemes/ContributionRewardExt.sol":{"l":{"72":59,"73":51,"105":36,"106":34,"107":34,"108":34,"109":34,"110":34,"111":34,"123":18,"124":18,"125":18,"126":15,"128":18,"129":18,"155":34,"156":34,"157":19,"159":34,"160":34,"161":34,"162":1,"164":34,"165":19,"168":32,"181":32,"183":32,"195":32,"207":15,"208":15,"213":13,"214":5,"215":5,"216":5,"219":8,"221":8,"223":8,"224":6,"228":1,"232":8,"233":7,"245":10,"246":10,"248":10,"250":5,"251":5,"254":10,"256":10,"257":10,"258":10,"259":10,"269":10,"270":10,"272":10,"273":5,"274":5,"277":10,"279":10,"280":10,"281":10,"282":10,"292":6,"293":6,"296":6,"297":5,"298":5,"302":6,"303":6,"305":6,"306":6,"310":6,"325":12,"326":12,"329":12,"332":10,"335":10,"336":10,"350":13,"351":13,"354":13,"358":11,"359":11,"360":11,"374":13,"375":13,"378":13,"381":11,"382":11,"383":11,"396":13,"397":13,"400":13,"404":11,"405":11,"406":11,"407":11,"427":18,"428":15,"431":16,"432":10,"435":16,"436":10,"439":16,"440":6,"445":4,"449":4,"453":4,"457":0,"461":0,"465":6},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/ContributionRewardExt.sol","s":{"1":59,"2":36,"3":34,"4":34,"5":34,"6":34,"7":34,"8":34,"9":18,"10":18,"11":18,"12":15,"13":18,"14":18,"15":34,"16":34,"17":19,"18":34,"19":34,"20":34,"21":1,"22":34,"23":19,"24":32,"25":32,"26":32,"27":32,"28":15,"29":15,"30":13,"31":5,"32":5,"33":5,"34":8,"35":8,"36":8,"37":6,"38":2,"39":1,"40":8,"41":7,"42":10,"43":10,"44":10,"45":5,"46":5,"47":10,"48":10,"49":10,"50":10,"51":10,"52":10,"53":10,"54":10,"55":5,"56":5,"57":10,"58":10,"59":10,"60":10,"61":10,"62":6,"63":6,"64":6,"65":5,"66":5,"67":6,"68":6,"69":6,"70":6,"71":6,"72":12,"73":12,"74":12,"75":10,"76":10,"77":10,"78":13,"79":13,"80":13,"81":11,"82":11,"83":11,"84":13,"85":13,"86":13,"87":11,"88":11,"89":11,"90":13,"91":13,"92":13,"93":11,"94":11,"95":11,"96":11,"97":18,"98":15,"99":16,"100":10,"101":16,"102":10,"103":16,"104":6,"105":4,"106":4,"107":4,"108":0,"109":0,"110":6},"b":{"1":[51,8],"2":[34,2],"3":[34,0],"4":[34,0],"5":[18,0],"6":[18,0],"7":[15,3],"8":[19,15],"9":[1,33],"10":[19,15],"11":[17,2],"12":[13,2],"13":[5,8],"14":[5,0],"15":[6,2],"16":[6,0],"17":[1,1],"18":[1,0],"19":[7,1],"20":[10,0],"21":[5,5],"22":[5,0],"23":[10,0],"24":[10,0],"25":[10,0],"26":[5,5],"27":[5,0],"28":[10,0],"29":[10,0],"30":[6,0],"31":[5,1],"32":[5,0],"33":[6,0],"34":[6,0],"35":[12,0],"36":[10,0],"37":[10,0],"38":[13,0],"39":[11,0],"40":[13,0],"41":[11,0],"42":[13,0],"43":[11,0],"44":[11,0],"45":[15,3],"46":[10,6],"47":[10,6],"48":[6,10]},"f":{"1":59,"2":5,"3":36,"4":18,"5":34,"6":15,"7":10,"8":10,"9":6,"10":12,"11":13,"12":13,"13":13,"14":18,"15":4,"16":4,"17":4,"18":0,"19":0,"20":6},"fnMap":{"1":{"name":"onlyRewarder","line":71,"loc":{"start":{"line":71,"column":4},"end":{"line":71,"column":25}}},"2":{"name":"","line":86,"loc":{"start":{"line":86,"column":4},"end":{"line":86,"column":29}}},"3":{"name":"initialize","line":97,"loc":{"start":{"line":97,"column":4},"end":{"line":104,"column":5}}},"4":{"name":"executeProposal","line":121,"loc":{"start":{"line":121,"column":33},"end":{"line":122,"column":19}}},"5":{"name":"proposeContributionReward","line":144,"loc":{"start":{"line":144,"column":4},"end":{"line":154,"column":5}}},"6":{"name":"redeemReputation","line":206,"loc":{"start":{"line":206,"column":4},"end":{"line":206,"column":82}}},"7":{"name":"redeemNativeToken","line":243,"loc":{"start":{"line":243,"column":4},"end":{"line":243,"column":80}}},"8":{"name":"redeemEther","line":268,"loc":{"start":{"line":268,"column":4},"end":{"line":268,"column":74}}},"9":{"name":"redeemExternalToken","line":291,"loc":{"start":{"line":291,"column":4},"end":{"line":291,"column":82}}},"10":{"name":"redeemReputationByRewarder","line":323,"loc":{"start":{"line":323,"column":15},"end":{"line":324,"column":5}}},"11":{"name":"redeemNativeTokenByRewarder","line":348,"loc":{"start":{"line":348,"column":15},"end":{"line":349,"column":5}}},"12":{"name":"redeemEtherByRewarder","line":372,"loc":{"start":{"line":372,"column":15},"end":{"line":373,"column":5}}},"13":{"name":"redeemExternalTokenByRewarder","line":395,"loc":{"start":{"line":395,"column":15},"end":{"line":395,"column":3}}},"14":{"name":"redeem","line":422,"loc":{"start":{"line":422,"column":4},"end":{"line":425,"column":5}}},"15":{"name":"getProposalEthReward","line":444,"loc":{"start":{"line":444,"column":4},"end":{"line":444,"column":82}}},"16":{"name":"getProposalExternalTokenReward","line":448,"loc":{"start":{"line":448,"column":4},"end":{"line":448,"column":92}}},"17":{"name":"getProposalExternalToken","line":452,"loc":{"start":{"line":452,"column":4},"end":{"line":452,"column":86}}},"18":{"name":"getProposalReputationReward","line":456,"loc":{"start":{"line":456,"column":4},"end":{"line":456,"column":88}}},"19":{"name":"getProposalNativeTokenReward","line":460,"loc":{"start":{"line":460,"column":4},"end":{"line":460,"column":90}}},"20":{"name":"getProposalAcceptedByVotingMachine","line":464,"loc":{"start":{"line":464,"column":4},"end":{"line":464,"column":93}}}},"statementMap":{"1":{"start":{"line":72,"column":8},"end":{"line":72,"column":70}},"2":{"start":{"line":105,"column":8},"end":{"line":105,"column":66}},"3":{"start":{"line":106,"column":8},"end":{"line":106,"column":61}},"4":{"start":{"line":107,"column":8},"end":{"line":107,"column":85}},"5":{"start":{"line":108,"column":8},"end":{"line":108,"column":23}},"6":{"start":{"line":109,"column":8},"end":{"line":109,"column":37}},"7":{"start":{"line":110,"column":8},"end":{"line":110,"column":31}},"8":{"start":{"line":111,"column":8},"end":{"line":111,"column":27}},"9":{"start":{"line":123,"column":8},"end":{"line":123,"column":83}},"10":{"start":{"line":124,"column":8},"end":{"line":124,"column":76}},"11":{"start":{"line":125,"column":8},"end":{"line":125,"column":4388}},"12":{"start":{"line":126,"column":12},"end":{"line":126,"column":76}},"13":{"start":{"line":128,"column":8},"end":{"line":128,"column":70}},"14":{"start":{"line":129,"column":8},"end":{"line":129,"column":19}},"15":{"start":{"line":155,"column":8},"end":{"line":155,"column":36}},"16":{"start":{"line":156,"column":8},"end":{"line":156,"column":5633}},"17":{"start":{"line":157,"column":12},"end":{"line":157,"column":32}},"18":{"start":{"line":159,"column":8},"end":{"line":159,"column":83}},"19":{"start":{"line":160,"column":8},"end":{"line":160,"column":50}},"20":{"start":{"line":161,"column":8},"end":{"line":161,"column":5854}},"21":{"start":{"line":162,"column":12},"end":{"line":162,"column":35}},"22":{"start":{"line":164,"column":8},"end":{"line":164,"column":5943}},"23":{"start":{"line":165,"column":12},"end":{"line":165,"column":91}},"24":{"start":{"line":168,"column":8},"end":{"line":168,"column":6094}},"25":{"start":{"line":181,"column":8},"end":{"line":181,"column":51}},"26":{"start":{"line":183,"column":8},"end":{"line":183,"column":6674}},"27":{"start":{"line":195,"column":8},"end":{"line":195,"column":6970}},"28":{"start":{"line":207,"column":8},"end":{"line":207,"column":82}},"29":{"start":{"line":208,"column":8},"end":{"line":208,"column":99}},"30":{"start":{"line":213,"column":8},"end":{"line":213,"column":7805}},"31":{"start":{"line":214,"column":12},"end":{"line":214,"column":7866}},"32":{"start":{"line":215,"column":16},"end":{"line":215,"column":81}},"33":{"start":{"line":216,"column":16},"end":{"line":216,"column":44}},"34":{"start":{"line":219,"column":12},"end":{"line":219,"column":49}},"35":{"start":{"line":221,"column":12},"end":{"line":221,"column":40}},"36":{"start":{"line":223,"column":12},"end":{"line":223,"column":8310}},"37":{"start":{"line":224,"column":16},"end":{"line":224,"column":8439}},"38":{"start":{"line":227,"column":19},"end":{"line":227,"column":8510}},"39":{"start":{"line":228,"column":16},"end":{"line":228,"column":8644}},"40":{"start":{"line":232,"column":12},"end":{"line":232,"column":8722}},"41":{"start":{"line":233,"column":16},"end":{"line":233,"column":101}},"42":{"start":{"line":245,"column":8},"end":{"line":245,"column":82}},"43":{"start":{"line":246,"column":8},"end":{"line":246,"column":99}},"44":{"start":{"line":248,"column":8},"end":{"line":248,"column":9335}},"45":{"start":{"line":250,"column":12},"end":{"line":250,"column":9464}},"46":{"start":{"line":251,"column":16},"end":{"line":251,"column":74}},"47":{"start":{"line":254,"column":8},"end":{"line":254,"column":42}},"48":{"start":{"line":256,"column":8},"end":{"line":256,"column":37}},"49":{"start":{"line":257,"column":8},"end":{"line":257,"column":9766}},"50":{"start":{"line":258,"column":12},"end":{"line":258,"column":104}},"51":{"start":{"line":259,"column":12},"end":{"line":259,"column":94}},"52":{"start":{"line":269,"column":8},"end":{"line":269,"column":82}},"53":{"start":{"line":270,"column":8},"end":{"line":270,"column":99}},"54":{"start":{"line":272,"column":8},"end":{"line":272,"column":10447}},"55":{"start":{"line":273,"column":12},"end":{"line":273,"column":10508}},"56":{"start":{"line":274,"column":16},"end":{"line":274,"column":58}},"57":{"start":{"line":277,"column":8},"end":{"line":277,"column":34}},"58":{"start":{"line":279,"column":8},"end":{"line":279,"column":29}},"59":{"start":{"line":280,"column":8},"end":{"line":280,"column":10770}},"60":{"start":{"line":281,"column":12},"end":{"line":281,"column":94}},"61":{"start":{"line":282,"column":12},"end":{"line":282,"column":88}},"62":{"start":{"line":292,"column":8},"end":{"line":292,"column":82}},"63":{"start":{"line":293,"column":8},"end":{"line":293,"column":99}},"64":{"start":{"line":296,"column":8},"end":{"line":296,"column":11463}},"65":{"start":{"line":297,"column":12},"end":{"line":297,"column":11524}},"66":{"start":{"line":298,"column":16},"end":{"line":298,"column":78}},"67":{"start":{"line":302,"column":8},"end":{"line":302,"column":11679}},"68":{"start":{"line":303,"column":12},"end":{"line":303,"column":48}},"69":{"start":{"line":305,"column":12},"end":{"line":305,"column":43}},"70":{"start":{"line":306,"column":12},"end":{"line":306,"column":12028}},"71":{"start":{"line":310,"column":12},"end":{"line":310,"column":96}},"72":{"start":{"line":325,"column":8},"end":{"line":325,"column":82}},"73":{"start":{"line":326,"column":8},"end":{"line":326,"column":99}},"74":{"start":{"line":329,"column":8},"end":{"line":329,"column":13108}},"75":{"start":{"line":332,"column":8},"end":{"line":332,"column":13288}},"76":{"start":{"line":335,"column":8},"end":{"line":335,"column":13336}},"77":{"start":{"line":336,"column":12},"end":{"line":336,"column":98}},"78":{"start":{"line":350,"column":8},"end":{"line":350,"column":82}},"79":{"start":{"line":351,"column":8},"end":{"line":351,"column":99}},"80":{"start":{"line":354,"column":8},"end":{"line":354,"column":14284}},"81":{"start":{"line":358,"column":8},"end":{"line":358,"column":14389}},"82":{"start":{"line":359,"column":12},"end":{"line":359,"column":76}},"83":{"start":{"line":360,"column":12},"end":{"line":360,"column":87}},"84":{"start":{"line":374,"column":8},"end":{"line":374,"column":82}},"85":{"start":{"line":375,"column":8},"end":{"line":375,"column":99}},"86":{"start":{"line":378,"column":8},"end":{"line":378,"column":15374}},"87":{"start":{"line":381,"column":8},"end":{"line":381,"column":15455}},"88":{"start":{"line":382,"column":12},"end":{"line":382,"column":41}},"89":{"start":{"line":383,"column":12},"end":{"line":383,"column":81}},"90":{"start":{"line":396,"column":8},"end":{"line":396,"column":82}},"91":{"start":{"line":397,"column":8},"end":{"line":397,"column":99}},"92":{"start":{"line":400,"column":8},"end":{"line":400,"column":16453}},"93":{"start":{"line":404,"column":8},"end":{"line":404,"column":16562}},"94":{"start":{"line":405,"column":12},"end":{"line":405,"column":16621}},"95":{"start":{"line":406,"column":16},"end":{"line":406,"column":82}},"96":{"start":{"line":407,"column":16},"end":{"line":407,"column":93}},"97":{"start":{"line":427,"column":8},"end":{"line":427,"column":17480}},"98":{"start":{"line":428,"column":12},"end":{"line":428,"column":59}},"99":{"start":{"line":431,"column":8},"end":{"line":431,"column":17585}},"100":{"start":{"line":432,"column":12},"end":{"line":432,"column":61}},"101":{"start":{"line":435,"column":8},"end":{"line":435,"column":17692}},"102":{"start":{"line":436,"column":12},"end":{"line":436,"column":49}},"103":{"start":{"line":439,"column":8},"end":{"line":439,"column":17787}},"104":{"start":{"line":440,"column":12},"end":{"line":440,"column":65}},"105":{"start":{"line":445,"column":8},"end":{"line":445,"column":59}},"106":{"start":{"line":449,"column":8},"end":{"line":449,"column":69}},"107":{"start":{"line":453,"column":8},"end":{"line":453,"column":72}},"108":{"start":{"line":457,"column":8},"end":{"line":457,"column":66}},"109":{"start":{"line":461,"column":8},"end":{"line":461,"column":67}},"110":{"start":{"line":465,"column":8},"end":{"line":465,"column":73}}},"branchMap":{"1":{"line":72,"type":"if","locations":[{"start":{"line":72,"column":8},"end":{"line":72,"column":8}},{"start":{"line":72,"column":8},"end":{"line":72,"column":8}}]},"2":{"line":105,"type":"if","locations":[{"start":{"line":105,"column":8},"end":{"line":105,"column":8}},{"start":{"line":105,"column":8},"end":{"line":105,"column":8}}]},"3":{"line":106,"type":"if","locations":[{"start":{"line":106,"column":8},"end":{"line":106,"column":8}},{"start":{"line":106,"column":8},"end":{"line":106,"column":8}}]},"4":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":8},"end":{"line":107,"column":8}},{"start":{"line":107,"column":8},"end":{"line":107,"column":8}}]},"5":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":8},"end":{"line":123,"column":8}},{"start":{"line":123,"column":8},"end":{"line":123,"column":8}}]},"6":{"line":124,"type":"if","locations":[{"start":{"line":124,"column":8},"end":{"line":124,"column":8}},{"start":{"line":124,"column":8},"end":{"line":124,"column":8}}]},"7":{"line":125,"type":"if","locations":[{"start":{"line":125,"column":8},"end":{"line":125,"column":8}},{"start":{"line":125,"column":8},"end":{"line":125,"column":8}}]},"8":{"line":156,"type":"if","locations":[{"start":{"line":156,"column":8},"end":{"line":156,"column":8}},{"start":{"line":156,"column":8},"end":{"line":156,"column":8}}]},"9":{"line":161,"type":"if","locations":[{"start":{"line":161,"column":8},"end":{"line":161,"column":8}},{"start":{"line":161,"column":8},"end":{"line":161,"column":8}}]},"10":{"line":164,"type":"if","locations":[{"start":{"line":164,"column":8},"end":{"line":164,"column":8}},{"start":{"line":164,"column":8},"end":{"line":164,"column":8}}]},"11":{"line":165,"type":"if","locations":[{"start":{"line":165,"column":12},"end":{"line":165,"column":12}},{"start":{"line":165,"column":12},"end":{"line":165,"column":12}}]},"12":{"line":208,"type":"if","locations":[{"start":{"line":208,"column":8},"end":{"line":208,"column":8}},{"start":{"line":208,"column":8},"end":{"line":208,"column":8}}]},"13":{"line":213,"type":"if","locations":[{"start":{"line":213,"column":8},"end":{"line":213,"column":8}},{"start":{"line":213,"column":8},"end":{"line":213,"column":8}}]},"14":{"line":214,"type":"if","locations":[{"start":{"line":214,"column":12},"end":{"line":214,"column":12}},{"start":{"line":214,"column":12},"end":{"line":214,"column":12}}]},"15":{"line":223,"type":"if","locations":[{"start":{"line":223,"column":12},"end":{"line":223,"column":12}},{"start":{"line":223,"column":12},"end":{"line":223,"column":12}}]},"16":{"line":224,"type":"if","locations":[{"start":{"line":224,"column":16},"end":{"line":224,"column":16}},{"start":{"line":224,"column":16},"end":{"line":224,"column":16}}]},"17":{"line":227,"type":"if","locations":[{"start":{"line":227,"column":19},"end":{"line":227,"column":19}},{"start":{"line":227,"column":19},"end":{"line":227,"column":19}}]},"18":{"line":228,"type":"if","locations":[{"start":{"line":228,"column":16},"end":{"line":228,"column":16}},{"start":{"line":228,"column":16},"end":{"line":228,"column":16}}]},"19":{"line":232,"type":"if","locations":[{"start":{"line":232,"column":12},"end":{"line":232,"column":12}},{"start":{"line":232,"column":12},"end":{"line":232,"column":12}}]},"20":{"line":246,"type":"if","locations":[{"start":{"line":246,"column":8},"end":{"line":246,"column":8}},{"start":{"line":246,"column":8},"end":{"line":246,"column":8}}]},"21":{"line":248,"type":"if","locations":[{"start":{"line":248,"column":8},"end":{"line":248,"column":8}},{"start":{"line":248,"column":8},"end":{"line":248,"column":8}}]},"22":{"line":250,"type":"if","locations":[{"start":{"line":250,"column":12},"end":{"line":250,"column":12}},{"start":{"line":250,"column":12},"end":{"line":250,"column":12}}]},"23":{"line":257,"type":"if","locations":[{"start":{"line":257,"column":8},"end":{"line":257,"column":8}},{"start":{"line":257,"column":8},"end":{"line":257,"column":8}}]},"24":{"line":258,"type":"if","locations":[{"start":{"line":258,"column":12},"end":{"line":258,"column":12}},{"start":{"line":258,"column":12},"end":{"line":258,"column":12}}]},"25":{"line":270,"type":"if","locations":[{"start":{"line":270,"column":8},"end":{"line":270,"column":8}},{"start":{"line":270,"column":8},"end":{"line":270,"column":8}}]},"26":{"line":272,"type":"if","locations":[{"start":{"line":272,"column":8},"end":{"line":272,"column":8}},{"start":{"line":272,"column":8},"end":{"line":272,"column":8}}]},"27":{"line":273,"type":"if","locations":[{"start":{"line":273,"column":12},"end":{"line":273,"column":12}},{"start":{"line":273,"column":12},"end":{"line":273,"column":12}}]},"28":{"line":280,"type":"if","locations":[{"start":{"line":280,"column":8},"end":{"line":280,"column":8}},{"start":{"line":280,"column":8},"end":{"line":280,"column":8}}]},"29":{"line":281,"type":"if","locations":[{"start":{"line":281,"column":12},"end":{"line":281,"column":12}},{"start":{"line":281,"column":12},"end":{"line":281,"column":12}}]},"30":{"line":293,"type":"if","locations":[{"start":{"line":293,"column":8},"end":{"line":293,"column":8}},{"start":{"line":293,"column":8},"end":{"line":293,"column":8}}]},"31":{"line":296,"type":"if","locations":[{"start":{"line":296,"column":8},"end":{"line":296,"column":8}},{"start":{"line":296,"column":8},"end":{"line":296,"column":8}}]},"32":{"line":297,"type":"if","locations":[{"start":{"line":297,"column":12},"end":{"line":297,"column":12}},{"start":{"line":297,"column":12},"end":{"line":297,"column":12}}]},"33":{"line":302,"type":"if","locations":[{"start":{"line":302,"column":8},"end":{"line":302,"column":8}},{"start":{"line":302,"column":8},"end":{"line":302,"column":8}}]},"34":{"line":306,"type":"if","locations":[{"start":{"line":306,"column":12},"end":{"line":306,"column":12}},{"start":{"line":306,"column":12},"end":{"line":306,"column":12}}]},"35":{"line":326,"type":"if","locations":[{"start":{"line":326,"column":8},"end":{"line":326,"column":8}},{"start":{"line":326,"column":8},"end":{"line":326,"column":8}}]},"36":{"line":332,"type":"if","locations":[{"start":{"line":332,"column":8},"end":{"line":332,"column":8}},{"start":{"line":332,"column":8},"end":{"line":332,"column":8}}]},"37":{"line":335,"type":"if","locations":[{"start":{"line":335,"column":8},"end":{"line":335,"column":8}},{"start":{"line":335,"column":8},"end":{"line":335,"column":8}}]},"38":{"line":351,"type":"if","locations":[{"start":{"line":351,"column":8},"end":{"line":351,"column":8}},{"start":{"line":351,"column":8},"end":{"line":351,"column":8}}]},"39":{"line":358,"type":"if","locations":[{"start":{"line":358,"column":8},"end":{"line":358,"column":8}},{"start":{"line":358,"column":8},"end":{"line":358,"column":8}}]},"40":{"line":375,"type":"if","locations":[{"start":{"line":375,"column":8},"end":{"line":375,"column":8}},{"start":{"line":375,"column":8},"end":{"line":375,"column":8}}]},"41":{"line":381,"type":"if","locations":[{"start":{"line":381,"column":8},"end":{"line":381,"column":8}},{"start":{"line":381,"column":8},"end":{"line":381,"column":8}}]},"42":{"line":397,"type":"if","locations":[{"start":{"line":397,"column":8},"end":{"line":397,"column":8}},{"start":{"line":397,"column":8},"end":{"line":397,"column":8}}]},"43":{"line":404,"type":"if","locations":[{"start":{"line":404,"column":8},"end":{"line":404,"column":8}},{"start":{"line":404,"column":8},"end":{"line":404,"column":8}}]},"44":{"line":405,"type":"if","locations":[{"start":{"line":405,"column":12},"end":{"line":405,"column":12}},{"start":{"line":405,"column":12},"end":{"line":405,"column":12}}]},"45":{"line":427,"type":"if","locations":[{"start":{"line":427,"column":8},"end":{"line":427,"column":8}},{"start":{"line":427,"column":8},"end":{"line":427,"column":8}}]},"46":{"line":431,"type":"if","locations":[{"start":{"line":431,"column":8},"end":{"line":431,"column":8}},{"start":{"line":431,"column":8},"end":{"line":431,"column":8}}]},"47":{"line":435,"type":"if","locations":[{"start":{"line":435,"column":8},"end":{"line":435,"column":8}},{"start":{"line":435,"column":8},"end":{"line":435,"column":8}}]},"48":{"line":439,"type":"if","locations":[{"start":{"line":439,"column":8},"end":{"line":439,"column":8}},{"start":{"line":439,"column":8},"end":{"line":439,"column":8}}]}}}, +"contracts/schemes/CurveInterface.sol":{"l":{},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/CurveInterface.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/schemes/ExternalLocking4Reputation.sol":{"l":{"46":23,"47":23,"48":23,"49":23,"66":24,"67":22,"68":22,"69":19,"71":3,"72":1,"74":20,"75":18,"76":18,"79":18,"80":18,"82":18,"85":18,"93":1,"94":1},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/ExternalLocking4Reputation.sol","s":{"1":23,"2":23,"3":23,"4":23,"5":24,"6":22,"7":22,"8":19,"9":3,"10":1,"11":20,"12":18,"13":18,"14":18,"15":18,"16":18,"17":1,"18":1},"b":{"1":[23,0],"2":[22,2],"3":[19,3],"4":[1,2],"5":[18,2],"6":[18,0]},"f":{"1":23,"2":24,"3":1},"fnMap":{"1":{"name":"initialize","line":35,"loc":{"start":{"line":35,"column":4},"end":{"line":45,"column":5}}},"2":{"name":"claim","line":65,"loc":{"start":{"line":65,"column":4},"end":{"line":65,"column":86}}},"3":{"name":"register","line":92,"loc":{"start":{"line":92,"column":77},"end":{"line":92,"column":3}}}},"statementMap":{"1":{"start":{"line":46,"column":8},"end":{"line":46,"column":115}},"2":{"start":{"line":47,"column":8},"end":{"line":47,"column":57}},"3":{"start":{"line":48,"column":8},"end":{"line":48,"column":57}},"4":{"start":{"line":49,"column":8},"end":{"line":49,"column":1779}},"5":{"start":{"line":66,"column":8},"end":{"line":66,"column":62}},"6":{"start":{"line":67,"column":8},"end":{"line":67,"column":27}},"7":{"start":{"line":68,"column":8},"end":{"line":68,"column":2348}},"8":{"start":{"line":69,"column":12},"end":{"line":69,"column":35}},"9":{"start":{"line":71,"column":12},"end":{"line":71,"column":77}},"10":{"start":{"line":72,"column":12},"end":{"line":72,"column":37}},"11":{"start":{"line":74,"column":8},"end":{"line":74,"column":111}},"12":{"start":{"line":75,"column":8},"end":{"line":75,"column":42}},"13":{"start":{"line":76,"column":8},"end":{"line":76,"column":2825}},"14":{"start":{"line":79,"column":8},"end":{"line":79,"column":66}},"15":{"start":{"line":80,"column":8},"end":{"line":80,"column":28}},"16":{"start":{"line":85,"column":8},"end":{"line":85,"column":78}},"17":{"start":{"line":93,"column":8},"end":{"line":93,"column":35}},"18":{"start":{"line":94,"column":8},"end":{"line":94,"column":33}}},"branchMap":{"1":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":8},"end":{"line":46,"column":8}},{"start":{"line":46,"column":8},"end":{"line":46,"column":8}}]},"2":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":66,"column":8}},{"start":{"line":66,"column":8},"end":{"line":66,"column":8}}]},"3":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":8},"end":{"line":68,"column":8}},{"start":{"line":68,"column":8},"end":{"line":68,"column":8}}]},"4":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":12},"end":{"line":71,"column":12}},{"start":{"line":71,"column":12},"end":{"line":71,"column":12}}]},"5":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":8},"end":{"line":74,"column":8}},{"start":{"line":74,"column":8},"end":{"line":74,"column":8}}]},"6":{"line":79,"type":"if","locations":[{"start":{"line":79,"column":8},"end":{"line":79,"column":8}},{"start":{"line":79,"column":8},"end":{"line":79,"column":8}}]}}}, +"contracts/schemes/FixedReputationAllocation.sol":{"l":{"35":14,"36":12,"37":12,"38":12,"39":12,"48":31,"49":29,"50":25,"52":25,"53":23,"58":21,"60":21,"68":63,"70":63,"71":63,"72":63,"74":63,"83":6,"84":60,"92":5,"94":5},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/FixedReputationAllocation.sol","s":{"1":14,"2":12,"3":12,"4":12,"5":12,"6":31,"7":29,"8":25,"9":25,"10":23,"11":21,"12":21,"13":63,"14":63,"15":63,"16":63,"17":6,"18":60,"19":5,"20":5},"b":{"1":[12,2],"2":[12,0],"3":[29,2],"4":[25,4],"5":[23,2],"6":[21,2],"7":[63,0],"8":[63,0]},"f":{"1":14,"2":31,"3":63,"4":6,"5":5},"fnMap":{"1":{"name":"initialize","line":34,"loc":{"start":{"line":34,"column":111},"end":{"line":34,"column":3}}},"2":{"name":"redeem","line":47,"loc":{"start":{"line":47,"column":4},"end":{"line":47,"column":60}}},"3":{"name":"addBeneficiary","line":67,"loc":{"start":{"line":67,"column":65},"end":{"line":67,"column":3}}},"4":{"name":"addBeneficiaries","line":82,"loc":{"start":{"line":82,"column":78},"end":{"line":82,"column":3}}},"5":{"name":"enable","line":91,"loc":{"start":{"line":91,"column":37},"end":{"line":91,"column":3}}}},"statementMap":{"1":{"start":{"line":35,"column":8},"end":{"line":35,"column":66}},"2":{"start":{"line":36,"column":8},"end":{"line":36,"column":61}},"3":{"start":{"line":37,"column":8},"end":{"line":37,"column":43}},"4":{"start":{"line":38,"column":8},"end":{"line":38,"column":43}},"5":{"start":{"line":39,"column":8},"end":{"line":39,"column":23}},"6":{"start":{"line":48,"column":8},"end":{"line":48,"column":48}},"7":{"start":{"line":49,"column":8},"end":{"line":49,"column":101}},"8":{"start":{"line":50,"column":8},"end":{"line":50,"column":42}},"9":{"start":{"line":52,"column":8},"end":{"line":52,"column":72}},"10":{"start":{"line":53,"column":8},"end":{"line":53,"column":2030}},"11":{"start":{"line":58,"column":8},"end":{"line":58,"column":52}},"12":{"start":{"line":60,"column":8},"end":{"line":60,"column":19}},"13":{"start":{"line":68,"column":8},"end":{"line":68,"column":75}},"14":{"start":{"line":70,"column":8},"end":{"line":70,"column":2431}},"15":{"start":{"line":71,"column":12},"end":{"line":71,"column":45}},"16":{"start":{"line":74,"column":12},"end":{"line":74,"column":54}},"17":{"start":{"line":83,"column":8},"end":{"line":83,"column":2813}},"18":{"start":{"line":84,"column":12},"end":{"line":84,"column":44}},"19":{"start":{"line":92,"column":8},"end":{"line":92,"column":22}},"20":{"start":{"line":94,"column":8},"end":{"line":94,"column":70}}},"branchMap":{"1":{"line":35,"type":"if","locations":[{"start":{"line":35,"column":8},"end":{"line":35,"column":8}},{"start":{"line":35,"column":8},"end":{"line":35,"column":8}}]},"2":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":8},"end":{"line":36,"column":8}},{"start":{"line":36,"column":8},"end":{"line":36,"column":8}}]},"3":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":8},"end":{"line":48,"column":8}},{"start":{"line":48,"column":8},"end":{"line":48,"column":8}}]},"4":{"line":49,"type":"if","locations":[{"start":{"line":49,"column":8},"end":{"line":49,"column":8}},{"start":{"line":49,"column":8},"end":{"line":49,"column":8}}]},"5":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":8},"end":{"line":52,"column":8}},{"start":{"line":52,"column":8},"end":{"line":52,"column":8}}]},"6":{"line":53,"type":"if","locations":[{"start":{"line":53,"column":8},"end":{"line":53,"column":8}},{"start":{"line":53,"column":8},"end":{"line":53,"column":8}}]},"7":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":8},"end":{"line":68,"column":8}},{"start":{"line":68,"column":8},"end":{"line":68,"column":8}}]},"8":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":8},"end":{"line":70,"column":8}},{"start":{"line":70,"column":8},"end":{"line":70,"column":8}}]}}}, +"contracts/schemes/Forwarder.sol":{"l":{"23":2,"25":1,"26":1,"35":12,"36":10,"37":10,"38":10,"47":3,"48":1},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/Forwarder.sol","s":{"1":2,"2":1,"3":1,"4":12,"5":10,"6":10,"7":10,"8":3,"9":1},"b":{"1":[1,1],"2":[1,0],"3":[10,2],"4":[10,0],"5":[1,2]},"f":{"1":2,"2":12,"3":3},"fnMap":{"1":{"name":"","line":21,"loc":{"start":{"line":21,"column":33},"end":{"line":21,"column":3}}},"2":{"name":"initialize","line":34,"loc":{"start":{"line":34,"column":82},"end":{"line":34,"column":3}}},"3":{"name":"unregisterSelf","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":45,"column":48}}}},"statementMap":{"1":{"start":{"line":23,"column":8},"end":{"line":23,"column":60}},"2":{"start":{"line":25,"column":8},"end":{"line":25,"column":54}},"3":{"start":{"line":26,"column":8},"end":{"line":26,"column":22}},"4":{"start":{"line":35,"column":8},"end":{"line":35,"column":66}},"5":{"start":{"line":36,"column":8},"end":{"line":36,"column":61}},"6":{"start":{"line":37,"column":8},"end":{"line":37,"column":23}},"7":{"start":{"line":38,"column":8},"end":{"line":38,"column":39}},"8":{"start":{"line":47,"column":8},"end":{"line":47,"column":62}},"9":{"start":{"line":48,"column":8},"end":{"line":48,"column":73}}},"branchMap":{"1":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":8},"end":{"line":23,"column":8}},{"start":{"line":23,"column":8},"end":{"line":23,"column":8}}]},"2":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":8},"end":{"line":26,"column":8}},{"start":{"line":26,"column":8},"end":{"line":26,"column":8}}]},"3":{"line":35,"type":"if","locations":[{"start":{"line":35,"column":8},"end":{"line":35,"column":8}},{"start":{"line":35,"column":8},"end":{"line":35,"column":8}}]},"4":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":8},"end":{"line":36,"column":8}},{"start":{"line":36,"column":8},"end":{"line":36,"column":8}}]},"5":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":8},"end":{"line":47,"column":8}},{"start":{"line":47,"column":8},"end":{"line":47,"column":8}}]}}}, +"contracts/schemes/GenericScheme.sol":{"l":{"66":13,"67":11,"68":11,"69":11,"70":11,"71":11,"84":8,"85":8,"86":8,"88":8,"89":6,"90":6,"92":2,"93":2,"96":8,"97":8,"105":14,"106":14,"107":12,"108":10,"109":10,"110":10,"111":10,"112":10,"114":10,"115":4,"116":4,"117":4,"119":6,"135":10,"137":10,"143":10,"147":10,"148":10},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/GenericScheme.sol","s":{"1":13,"2":11,"3":11,"4":11,"5":11,"6":11,"7":8,"8":8,"9":8,"10":8,"11":6,"12":6,"13":2,"14":8,"15":8,"16":14,"17":14,"18":12,"19":10,"20":10,"21":10,"22":10,"23":10,"24":10,"25":4,"26":4,"27":6,"28":10,"29":10,"30":10,"31":10,"32":10},"b":{"1":[11,2],"2":[11,0],"3":[8,0],"4":[8,0],"5":[6,2],"6":[12,2],"7":[10,2],"8":[4,6]},"f":{"1":13,"2":8,"3":14,"4":10},"fnMap":{"1":{"name":"initialize","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":65,"column":5}}},"2":{"name":"executeProposal","line":82,"loc":{"start":{"line":82,"column":33},"end":{"line":83,"column":19}}},"3":{"name":"execute","line":104,"loc":{"start":{"line":104,"column":4},"end":{"line":104,"column":46}}},"4":{"name":"proposeCall","line":131,"loc":{"start":{"line":131,"column":4},"end":{"line":134,"column":5}}}},"statementMap":{"1":{"start":{"line":66,"column":8},"end":{"line":66,"column":66}},"2":{"start":{"line":67,"column":8},"end":{"line":67,"column":61}},"3":{"start":{"line":68,"column":8},"end":{"line":68,"column":23}},"4":{"start":{"line":69,"column":8},"end":{"line":69,"column":37}},"5":{"start":{"line":70,"column":8},"end":{"line":70,"column":31}},"6":{"start":{"line":71,"column":8},"end":{"line":71,"column":39}},"7":{"start":{"line":84,"column":8},"end":{"line":84,"column":74}},"8":{"start":{"line":85,"column":8},"end":{"line":85,"column":57}},"9":{"start":{"line":86,"column":8},"end":{"line":86,"column":64}},"10":{"start":{"line":88,"column":8},"end":{"line":88,"column":2798}},"11":{"start":{"line":89,"column":12},"end":{"line":89,"column":33}},"12":{"start":{"line":90,"column":12},"end":{"line":90,"column":31}},"13":{"start":{"line":93,"column":12},"end":{"line":93,"column":62}},"14":{"start":{"line":96,"column":8},"end":{"line":96,"column":85}},"15":{"start":{"line":97,"column":8},"end":{"line":97,"column":19}},"16":{"start":{"line":105,"column":8},"end":{"line":105,"column":74}},"17":{"start":{"line":106,"column":8},"end":{"line":106,"column":57}},"18":{"start":{"line":107,"column":8},"end":{"line":107,"column":73}},"19":{"start":{"line":108,"column":8},"end":{"line":108,"column":29}},"20":{"start":{"line":109,"column":8},"end":{"line":109,"column":43}},"21":{"start":{"line":110,"column":8},"end":{"line":110,"column":20}},"22":{"start":{"line":111,"column":8},"end":{"line":111,"column":58}},"23":{"start":{"line":112,"column":8},"end":{"line":112,"column":3827}},"24":{"start":{"line":114,"column":8},"end":{"line":114,"column":3882}},"25":{"start":{"line":116,"column":12},"end":{"line":116,"column":62}},"26":{"start":{"line":117,"column":12},"end":{"line":117,"column":87}},"27":{"start":{"line":119,"column":12},"end":{"line":119,"column":32}},"28":{"start":{"line":135,"column":8},"end":{"line":135,"column":94}},"29":{"start":{"line":137,"column":8},"end":{"line":137,"column":4757}},"30":{"start":{"line":143,"column":8},"end":{"line":143,"column":4939}},"31":{"start":{"line":147,"column":8},"end":{"line":147,"column":94}},"32":{"start":{"line":148,"column":8},"end":{"line":148,"column":25}}},"branchMap":{"1":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":66,"column":8}},{"start":{"line":66,"column":8},"end":{"line":66,"column":8}}]},"2":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":8},"end":{"line":67,"column":8}},{"start":{"line":67,"column":8},"end":{"line":67,"column":8}}]},"3":{"line":85,"type":"if","locations":[{"start":{"line":85,"column":8},"end":{"line":85,"column":8}},{"start":{"line":85,"column":8},"end":{"line":85,"column":8}}]},"4":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":8},"end":{"line":86,"column":8}},{"start":{"line":86,"column":8},"end":{"line":86,"column":8}}]},"5":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":8},"end":{"line":88,"column":8}},{"start":{"line":88,"column":8},"end":{"line":88,"column":8}}]},"6":{"line":106,"type":"if","locations":[{"start":{"line":106,"column":8},"end":{"line":106,"column":8}},{"start":{"line":106,"column":8},"end":{"line":106,"column":8}}]},"7":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":8},"end":{"line":107,"column":8}},{"start":{"line":107,"column":8},"end":{"line":107,"column":8}}]},"8":{"line":114,"type":"if","locations":[{"start":{"line":114,"column":8},"end":{"line":114,"column":8}},{"start":{"line":114,"column":8},"end":{"line":114,"column":8}}]}}}, +"contracts/schemes/Locking4Reputation.sol":{"l":{"47":37,"48":25,"49":19,"50":19,"51":19,"52":19,"55":19,"56":19,"61":19,"71":13,"72":13,"73":9,"74":9,"76":9,"77":5,"79":5,"102":64,"103":58,"104":54,"106":48,"108":42,"110":38,"111":38,"113":38,"114":38,"116":38,"117":38,"118":38,"119":38,"120":38,"121":38,"123":38,"125":37,"127":37,"152":75,"153":69,"154":69,"155":69,"157":63,"158":63,"159":63,"160":63,"161":63,"162":63,"163":63,"164":63},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/Locking4Reputation.sol","s":{"1":37,"2":25,"3":19,"4":19,"5":19,"6":19,"7":19,"8":19,"9":19,"10":13,"11":13,"12":9,"13":9,"14":9,"15":5,"16":5,"17":64,"18":58,"19":54,"20":48,"21":42,"22":38,"23":38,"24":38,"25":38,"26":38,"27":38,"28":38,"29":38,"30":38,"31":38,"32":38,"33":37,"34":37,"35":75,"36":69,"37":69,"38":69,"39":63,"40":63,"41":63,"42":63,"43":63,"44":63,"45":63,"46":63},"b":{"1":[25,12],"2":[19,6],"3":[19,0],"4":[9,4],"5":[5,4],"6":[58,6],"7":[54,4],"8":[48,6],"9":[42,6],"10":[38,4],"11":[38,0],"12":[37,1],"13":[69,6],"14":[69,0],"15":[69,0],"16":[63,6]},"f":{"1":37,"2":13,"3":64,"4":75},"fnMap":{"1":{"name":"redeem","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":45,"column":74}}},"2":{"name":"_release","line":70,"loc":{"start":{"line":70,"column":4},"end":{"line":70,"column":94}}},"3":{"name":"_lock","line":99,"loc":{"start":{"line":99,"column":32},"end":{"line":101,"column":9}}},"4":{"name":"_initialize","line":142,"loc":{"start":{"line":142,"column":4},"end":{"line":151,"column":5}}}},"statementMap":{"1":{"start":{"line":47,"column":8},"end":{"line":47,"column":76}},"2":{"start":{"line":48,"column":8},"end":{"line":48,"column":63}},"3":{"start":{"line":49,"column":8},"end":{"line":49,"column":44}},"4":{"start":{"line":50,"column":8},"end":{"line":50,"column":31}},"5":{"start":{"line":51,"column":8},"end":{"line":51,"column":57}},"6":{"start":{"line":52,"column":8},"end":{"line":52,"column":47}},"7":{"start":{"line":55,"column":8},"end":{"line":55,"column":66}},"8":{"start":{"line":56,"column":8},"end":{"line":56,"column":2041}},"9":{"start":{"line":61,"column":8},"end":{"line":61,"column":45}},"10":{"start":{"line":71,"column":8},"end":{"line":71,"column":65}},"11":{"start":{"line":72,"column":8},"end":{"line":72,"column":57}},"12":{"start":{"line":73,"column":8},"end":{"line":73,"column":29}},"13":{"start":{"line":74,"column":8},"end":{"line":74,"column":24}},"14":{"start":{"line":76,"column":8},"end":{"line":76,"column":82}},"15":{"start":{"line":77,"column":8},"end":{"line":77,"column":52}},"16":{"start":{"line":79,"column":8},"end":{"line":79,"column":54}},"17":{"start":{"line":102,"column":8},"end":{"line":102,"column":59}},"18":{"start":{"line":103,"column":8},"end":{"line":103,"column":91}},"19":{"start":{"line":104,"column":8},"end":{"line":104,"column":59}},"20":{"start":{"line":106,"column":8},"end":{"line":106,"column":89}},"21":{"start":{"line":108,"column":8},"end":{"line":108,"column":83}},"22":{"start":{"line":110,"column":8},"end":{"line":110,"column":78}},"23":{"start":{"line":111,"column":8},"end":{"line":111,"column":47}},"24":{"start":{"line":113,"column":8},"end":{"line":113,"column":59}},"25":{"start":{"line":114,"column":8},"end":{"line":114,"column":30}},"26":{"start":{"line":116,"column":8},"end":{"line":116,"column":41}},"27":{"start":{"line":117,"column":8},"end":{"line":117,"column":45}},"28":{"start":{"line":118,"column":8},"end":{"line":118,"column":53}},"29":{"start":{"line":119,"column":8},"end":{"line":119,"column":78}},"30":{"start":{"line":120,"column":8},"end":{"line":120,"column":46}},"31":{"start":{"line":121,"column":8},"end":{"line":121,"column":51}},"32":{"start":{"line":123,"column":8},"end":{"line":123,"column":4633}},"33":{"start":{"line":125,"column":8},"end":{"line":125,"column":41}},"34":{"start":{"line":127,"column":8},"end":{"line":127,"column":55}},"35":{"start":{"line":152,"column":8},"end":{"line":152,"column":66}},"36":{"start":{"line":153,"column":8},"end":{"line":153,"column":61}},"37":{"start":{"line":154,"column":8},"end":{"line":154,"column":113}},"38":{"start":{"line":155,"column":8},"end":{"line":155,"column":90}},"39":{"start":{"line":157,"column":8},"end":{"line":157,"column":43}},"40":{"start":{"line":158,"column":8},"end":{"line":158,"column":47}},"41":{"start":{"line":159,"column":8},"end":{"line":159,"column":39}},"42":{"start":{"line":160,"column":8},"end":{"line":160,"column":43}},"43":{"start":{"line":161,"column":8},"end":{"line":161,"column":23}},"44":{"start":{"line":162,"column":8},"end":{"line":162,"column":43}},"45":{"start":{"line":163,"column":8},"end":{"line":163,"column":43}},"46":{"start":{"line":164,"column":8},"end":{"line":164,"column":45}}},"branchMap":{"1":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":8},"end":{"line":47,"column":8}},{"start":{"line":47,"column":8},"end":{"line":47,"column":8}}]},"2":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":8},"end":{"line":48,"column":8}},{"start":{"line":48,"column":8},"end":{"line":48,"column":8}}]},"3":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":8},"end":{"line":56,"column":8}},{"start":{"line":56,"column":8},"end":{"line":56,"column":8}}]},"4":{"line":72,"type":"if","locations":[{"start":{"line":72,"column":8},"end":{"line":72,"column":8}},{"start":{"line":72,"column":8},"end":{"line":72,"column":8}}]},"5":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]},"6":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"7":{"line":103,"type":"if","locations":[{"start":{"line":103,"column":8},"end":{"line":103,"column":8}},{"start":{"line":103,"column":8},"end":{"line":103,"column":8}}]},"8":{"line":104,"type":"if","locations":[{"start":{"line":104,"column":8},"end":{"line":104,"column":8}},{"start":{"line":104,"column":8},"end":{"line":104,"column":8}}]},"9":{"line":106,"type":"if","locations":[{"start":{"line":106,"column":8},"end":{"line":106,"column":8}},{"start":{"line":106,"column":8},"end":{"line":106,"column":8}}]},"10":{"line":108,"type":"if","locations":[{"start":{"line":108,"column":8},"end":{"line":108,"column":8}},{"start":{"line":108,"column":8},"end":{"line":108,"column":8}}]},"11":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":8},"end":{"line":120,"column":8}},{"start":{"line":120,"column":8},"end":{"line":120,"column":8}}]},"12":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":8},"end":{"line":123,"column":8}},{"start":{"line":123,"column":8},"end":{"line":123,"column":8}}]},"13":{"line":152,"type":"if","locations":[{"start":{"line":152,"column":8},"end":{"line":152,"column":8}},{"start":{"line":152,"column":8},"end":{"line":152,"column":8}}]},"14":{"line":153,"type":"if","locations":[{"start":{"line":153,"column":8},"end":{"line":153,"column":8}},{"start":{"line":153,"column":8},"end":{"line":153,"column":8}}]},"15":{"line":154,"type":"if","locations":[{"start":{"line":154,"column":8},"end":{"line":154,"column":8}},{"start":{"line":154,"column":8},"end":{"line":154,"column":8}}]},"16":{"line":155,"type":"if","locations":[{"start":{"line":155,"column":8},"end":{"line":155,"column":8}},{"start":{"line":155,"column":8},"end":{"line":155,"column":8}}]}}}, +"contracts/schemes/LockingEth4Reputation.sol":{"l":{"33":25,"50":7,"51":3,"53":3,"62":29},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/LockingEth4Reputation.sol","s":{"1":25,"2":7,"3":3,"4":3,"5":29},"b":{},"f":{"1":25,"2":7,"3":29},"fnMap":{"1":{"name":"initialize","line":23,"loc":{"start":{"line":23,"column":4},"end":{"line":32,"column":5}}},"2":{"name":"release","line":49,"loc":{"start":{"line":49,"column":4},"end":{"line":49,"column":89}}},"3":{"name":"lock","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":61,"column":98}}}},"statementMap":{"1":{"start":{"line":33,"column":8},"end":{"line":33,"column":1028}},"2":{"start":{"line":50,"column":8},"end":{"line":50,"column":65}},"3":{"start":{"line":51,"column":8},"end":{"line":51,"column":36}},"4":{"start":{"line":53,"column":8},"end":{"line":53,"column":19}},"5":{"start":{"line":62,"column":8},"end":{"line":62,"column":80}}},"branchMap":{}}, +"contracts/schemes/LockingToken4Reputation.sol":{"l":{"46":27,"47":27,"64":6,"65":2,"67":2,"83":31,"84":31,"86":31,"88":29,"89":27,"91":25,"93":25,"95":13,"97":13},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/LockingToken4Reputation.sol","s":{"1":27,"2":27,"3":6,"4":2,"5":2,"6":31,"7":31,"8":31,"9":29,"10":27,"11":25,"12":25,"13":13,"14":13},"b":{"1":[27,2],"2":[25,2]},"f":{"1":27,"2":6,"3":31},"fnMap":{"1":{"name":"initialize","line":35,"loc":{"start":{"line":35,"column":4},"end":{"line":45,"column":5}}},"2":{"name":"release","line":63,"loc":{"start":{"line":63,"column":4},"end":{"line":63,"column":81}}},"3":{"name":"lock","line":77,"loc":{"start":{"line":77,"column":4},"end":{"line":81,"column":39}}}},"statementMap":{"1":{"start":{"line":46,"column":8},"end":{"line":46,"column":49}},"2":{"start":{"line":47,"column":8},"end":{"line":47,"column":1630}},"3":{"start":{"line":64,"column":8},"end":{"line":64,"column":65}},"4":{"start":{"line":65,"column":8},"end":{"line":65,"column":66}},"5":{"start":{"line":67,"column":8},"end":{"line":67,"column":19}},"6":{"start":{"line":83,"column":8},"end":{"line":83,"column":25}},"7":{"start":{"line":84,"column":8},"end":{"line":84,"column":27}},"8":{"start":{"line":86,"column":8},"end":{"line":86,"column":70}},"9":{"start":{"line":88,"column":8},"end":{"line":88,"column":56}},"10":{"start":{"line":89,"column":8},"end":{"line":89,"column":60}},"11":{"start":{"line":91,"column":8},"end":{"line":91,"column":66}},"12":{"start":{"line":93,"column":8},"end":{"line":93,"column":100}},"13":{"start":{"line":95,"column":8},"end":{"line":95,"column":39}},"14":{"start":{"line":97,"column":8},"end":{"line":97,"column":65}}},"branchMap":{"1":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":8},"end":{"line":88,"column":8}},{"start":{"line":88,"column":8},"end":{"line":88,"column":8}}]},"2":{"line":89,"type":"if","locations":[{"start":{"line":89,"column":8},"end":{"line":89,"column":8}},{"start":{"line":89,"column":8},"end":{"line":89,"column":8}}]}}}, +"contracts/schemes/PriceOracleInterface.sol":{"l":{},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/PriceOracleInterface.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/schemes/RageQuitWithToken.sol":{"l":{"35":2,"36":2,"37":2,"38":2,"47":3,"48":3,"49":3,"51":3,"52":1,"55":1},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/RageQuitWithToken.sol","s":{"1":2,"2":2,"3":2,"4":2,"5":3,"6":3,"7":3,"8":3,"9":1,"10":1},"b":{"1":[2,0],"2":[2,0],"3":[1,0]},"f":{"1":2,"2":3},"fnMap":{"1":{"name":"initialize","line":29,"loc":{"start":{"line":29,"column":4},"end":{"line":34,"column":5}}},"2":{"name":"rageQuit","line":46,"loc":{"start":{"line":46,"column":4},"end":{"line":46,"column":83}}}},"statementMap":{"1":{"start":{"line":35,"column":8},"end":{"line":35,"column":61}},"2":{"start":{"line":36,"column":8},"end":{"line":36,"column":62}},"3":{"start":{"line":37,"column":8},"end":{"line":37,"column":23}},"4":{"start":{"line":38,"column":8},"end":{"line":38,"column":37}},"5":{"start":{"line":47,"column":8},"end":{"line":47,"column":69}},"6":{"start":{"line":48,"column":8},"end":{"line":48,"column":83}},"7":{"start":{"line":49,"column":8},"end":{"line":49,"column":89}},"8":{"start":{"line":51,"column":8},"end":{"line":51,"column":71}},"9":{"start":{"line":52,"column":8},"end":{"line":52,"column":1938}},"10":{"start":{"line":55,"column":8},"end":{"line":55,"column":58}}},"branchMap":{"1":{"line":35,"type":"if","locations":[{"start":{"line":35,"column":8},"end":{"line":35,"column":8}},{"start":{"line":35,"column":8},"end":{"line":35,"column":8}}]},"2":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":8},"end":{"line":36,"column":8}},{"start":{"line":36,"column":8},"end":{"line":36,"column":8}}]},"3":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":8},"end":{"line":52,"column":8}},{"start":{"line":52,"column":8},"end":{"line":52,"column":8}}]}}}, +"contracts/schemes/ReputationAdmin.sol":{"l":{"33":15,"34":13,"35":13,"36":11,"37":11,"38":11,"39":11,"40":11,"49":11,"50":11,"51":11,"61":3,"62":3,"63":3,"74":11,"76":9,"78":5,"79":4,"82":3,"95":3,"97":3,"99":3,"100":3,"101":1,"104":1},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/ReputationAdmin.sol","s":{"1":15,"2":13,"3":13,"4":11,"5":11,"6":11,"7":11,"8":11,"9":11,"10":11,"11":11,"12":3,"13":3,"14":3,"15":11,"16":9,"17":5,"18":4,"19":3,"20":3,"21":3,"22":3,"23":3,"24":1,"25":1},"b":{"1":[13,2],"2":[13,0],"3":[11,2],"4":[11,0],"5":[3,0],"6":[9,2],"7":[5,4],"8":[4,1],"9":[3,0],"10":[3,0],"11":[3,0],"12":[3,0],"13":[1,2],"14":[1,0]},"f":{"1":15,"2":11,"3":3,"4":11,"5":3},"fnMap":{"1":{"name":"initialize","line":32,"loc":{"start":{"line":32,"column":23},"end":{"line":32,"column":3}}},"2":{"name":"reputationMint","line":48,"loc":{"start":{"line":48,"column":109},"end":{"line":48,"column":3}}},"3":{"name":"reputationBurn","line":60,"loc":{"start":{"line":60,"column":109},"end":{"line":60,"column":3}}},"4":{"name":"_reputationMint","line":72,"loc":{"start":{"line":72,"column":4},"end":{"line":72,"column":73}}},"5":{"name":"_reputationBurn","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":93,"column":73}}}},"statementMap":{"1":{"start":{"line":33,"column":8},"end":{"line":33,"column":66}},"2":{"start":{"line":34,"column":8},"end":{"line":34,"column":61}},"3":{"start":{"line":35,"column":8},"end":{"line":35,"column":102}},"4":{"start":{"line":36,"column":8},"end":{"line":36,"column":23}},"5":{"start":{"line":37,"column":8},"end":{"line":37,"column":49}},"6":{"start":{"line":38,"column":8},"end":{"line":38,"column":45}},"7":{"start":{"line":39,"column":8},"end":{"line":39,"column":36}},"8":{"start":{"line":40,"column":8},"end":{"line":40,"column":37}},"9":{"start":{"line":49,"column":8},"end":{"line":49,"column":82}},"10":{"start":{"line":50,"column":8},"end":{"line":50,"column":1866}},"11":{"start":{"line":51,"column":12},"end":{"line":51,"column":58}},"12":{"start":{"line":61,"column":8},"end":{"line":61,"column":82}},"13":{"start":{"line":62,"column":8},"end":{"line":62,"column":2408}},"14":{"start":{"line":63,"column":12},"end":{"line":63,"column":58}},"15":{"start":{"line":74,"column":8},"end":{"line":74,"column":78}},"16":{"start":{"line":76,"column":8},"end":{"line":76,"column":64}},"17":{"start":{"line":78,"column":8},"end":{"line":78,"column":3083}},"18":{"start":{"line":79,"column":12},"end":{"line":79,"column":53}},"19":{"start":{"line":82,"column":8},"end":{"line":82,"column":3184}},"20":{"start":{"line":95,"column":8},"end":{"line":95,"column":78}},"21":{"start":{"line":97,"column":8},"end":{"line":97,"column":64}},"22":{"start":{"line":99,"column":8},"end":{"line":99,"column":3898}},"23":{"start":{"line":100,"column":12},"end":{"line":100,"column":96}},"24":{"start":{"line":101,"column":12},"end":{"line":101,"column":53}},"25":{"start":{"line":104,"column":8},"end":{"line":104,"column":4098}}},"branchMap":{"1":{"line":33,"type":"if","locations":[{"start":{"line":33,"column":8},"end":{"line":33,"column":8}},{"start":{"line":33,"column":8},"end":{"line":33,"column":8}}]},"2":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":8},"end":{"line":34,"column":8}},{"start":{"line":34,"column":8},"end":{"line":34,"column":8}}]},"3":{"line":35,"type":"if","locations":[{"start":{"line":35,"column":8},"end":{"line":35,"column":8}},{"start":{"line":35,"column":8},"end":{"line":35,"column":8}}]},"4":{"line":49,"type":"if","locations":[{"start":{"line":49,"column":8},"end":{"line":49,"column":8}},{"start":{"line":49,"column":8},"end":{"line":49,"column":8}}]},"5":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":8},"end":{"line":61,"column":8}},{"start":{"line":61,"column":8},"end":{"line":61,"column":8}}]},"6":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":8},"end":{"line":74,"column":8}},{"start":{"line":74,"column":8},"end":{"line":74,"column":8}}]},"7":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]},"8":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":8},"end":{"line":78,"column":8}},{"start":{"line":78,"column":8},"end":{"line":78,"column":8}}]},"9":{"line":82,"type":"if","locations":[{"start":{"line":82,"column":8},"end":{"line":82,"column":8}},{"start":{"line":82,"column":8},"end":{"line":82,"column":8}}]},"10":{"line":95,"type":"if","locations":[{"start":{"line":95,"column":8},"end":{"line":95,"column":8}},{"start":{"line":95,"column":8},"end":{"line":95,"column":8}}]},"11":{"line":97,"type":"if","locations":[{"start":{"line":97,"column":8},"end":{"line":97,"column":8}},{"start":{"line":97,"column":8},"end":{"line":97,"column":8}}]},"12":{"line":99,"type":"if","locations":[{"start":{"line":99,"column":8},"end":{"line":99,"column":8}},{"start":{"line":99,"column":8},"end":{"line":99,"column":8}}]},"13":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":12},"end":{"line":100,"column":12}},{"start":{"line":100,"column":12},"end":{"line":100,"column":12}}]},"14":{"line":104,"type":"if","locations":[{"start":{"line":104,"column":8},"end":{"line":104,"column":8}},{"start":{"line":104,"column":8},"end":{"line":104,"column":8}}]}}}, +"contracts/schemes/ReputationFromToken.sol":{"l":{"44":12,"45":10,"46":10,"47":10,"48":10,"49":10,"59":5,"81":1,"82":1,"83":0,"94":1,"101":1,"102":1,"103":1,"116":4,"117":4,"118":4,"119":4,"120":4,"121":3,"123":4,"124":1,"126":4,"130":4,"131":4},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/ReputationFromToken.sol","s":{"1":12,"2":10,"3":10,"4":10,"5":10,"6":10,"7":5,"8":1,"9":1,"10":0,"11":1,"12":1,"13":1,"14":1,"15":4,"16":4,"17":4,"18":4,"19":4,"20":3,"21":4,"22":1,"23":4,"24":4,"25":4},"b":{"1":[10,2],"2":[10,0],"3":[0,1],"4":[1,0],"5":[4,0],"6":[4,0],"7":[3,1],"8":[1,3],"9":[4,0]},"f":{"1":12,"2":5,"3":1,"4":4},"fnMap":{"1":{"name":"initialize","line":42,"loc":{"start":{"line":42,"column":4},"end":{"line":43,"column":5}}},"2":{"name":"redeem","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":58,"column":89}}},"3":{"name":"redeemWithSignature","line":71,"loc":{"start":{"line":71,"column":4},"end":{"line":79,"column":9}}},"4":{"name":"_redeem","line":114,"loc":{"start":{"line":114,"column":28},"end":{"line":115,"column":22}}}},"statementMap":{"1":{"start":{"line":44,"column":8},"end":{"line":44,"column":66}},"2":{"start":{"line":45,"column":8},"end":{"line":45,"column":61}},"3":{"start":{"line":46,"column":8},"end":{"line":46,"column":37}},"4":{"start":{"line":47,"column":8},"end":{"line":47,"column":23}},"5":{"start":{"line":48,"column":8},"end":{"line":48,"column":21}},"6":{"start":{"line":49,"column":8},"end":{"line":49,"column":45}},"7":{"start":{"line":59,"column":8},"end":{"line":59,"column":64}},"8":{"start":{"line":81,"column":8},"end":{"line":81,"column":32}},"9":{"start":{"line":82,"column":8},"end":{"line":82,"column":2878}},"10":{"start":{"line":83,"column":12},"end":{"line":83,"column":2921}},"11":{"start":{"line":94,"column":12},"end":{"line":94,"column":3316}},"12":{"start":{"line":101,"column":8},"end":{"line":101,"column":63}},"13":{"start":{"line":102,"column":8},"end":{"line":102,"column":70}},"14":{"start":{"line":103,"column":8},"end":{"line":103,"column":62}},"15":{"start":{"line":116,"column":8},"end":{"line":116,"column":62}},"16":{"start":{"line":117,"column":8},"end":{"line":117,"column":99}},"17":{"start":{"line":118,"column":8},"end":{"line":118,"column":32}},"18":{"start":{"line":119,"column":8},"end":{"line":119,"column":64}},"19":{"start":{"line":120,"column":8},"end":{"line":120,"column":4357}},"20":{"start":{"line":121,"column":12},"end":{"line":121,"column":48}},"21":{"start":{"line":123,"column":8},"end":{"line":123,"column":4460}},"22":{"start":{"line":124,"column":12},"end":{"line":124,"column":35}},"23":{"start":{"line":126,"column":8},"end":{"line":126,"column":4643}},"24":{"start":{"line":130,"column":8},"end":{"line":130,"column":57}},"25":{"start":{"line":131,"column":8},"end":{"line":131,"column":26}}},"branchMap":{"1":{"line":44,"type":"if","locations":[{"start":{"line":44,"column":8},"end":{"line":44,"column":8}},{"start":{"line":44,"column":8},"end":{"line":44,"column":8}}]},"2":{"line":45,"type":"if","locations":[{"start":{"line":45,"column":8},"end":{"line":45,"column":8}},{"start":{"line":45,"column":8},"end":{"line":45,"column":8}}]},"3":{"line":82,"type":"if","locations":[{"start":{"line":82,"column":8},"end":{"line":82,"column":8}},{"start":{"line":82,"column":8},"end":{"line":82,"column":8}}]},"4":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"5":{"line":116,"type":"if","locations":[{"start":{"line":116,"column":8},"end":{"line":116,"column":8}},{"start":{"line":116,"column":8},"end":{"line":116,"column":8}}]},"6":{"line":117,"type":"if","locations":[{"start":{"line":117,"column":8},"end":{"line":117,"column":8}},{"start":{"line":117,"column":8},"end":{"line":117,"column":8}}]},"7":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":8},"end":{"line":120,"column":8}},{"start":{"line":120,"column":8},"end":{"line":120,"column":8}}]},"8":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":8},"end":{"line":123,"column":8}},{"start":{"line":123,"column":8},"end":{"line":123,"column":8}}]},"9":{"line":126,"type":"if","locations":[{"start":{"line":126,"column":8},"end":{"line":126,"column":8}},{"start":{"line":126,"column":8},"end":{"line":126,"column":8}}]}}}, +"contracts/schemes/SignalScheme.sol":{"l":{"57":6,"58":4,"59":4,"77":3,"80":3,"87":3,"89":3,"96":3,"100":3,"109":2,"110":2,"112":2,"113":1,"118":2},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/SignalScheme.sol","s":{"1":6,"2":4,"3":4,"4":3,"5":3,"6":3,"7":3,"8":3,"9":3,"10":2,"11":2,"12":2,"13":1,"14":2},"b":{"1":[4,2],"2":[4,0],"3":[3,0],"4":[2,0],"5":[1,1]},"f":{"1":6,"2":3,"3":2},"fnMap":{"1":{"name":"initialize","line":52,"loc":{"start":{"line":52,"column":4},"end":{"line":56,"column":14}}},"2":{"name":"proposeSignal","line":71,"loc":{"start":{"line":71,"column":4},"end":{"line":76,"column":5}}},"3":{"name":"executeProposal","line":108,"loc":{"start":{"line":108,"column":103},"end":{"line":108,"column":17}}}},"statementMap":{"1":{"start":{"line":57,"column":8},"end":{"line":57,"column":73}},"2":{"start":{"line":58,"column":8},"end":{"line":58,"column":61}},"3":{"start":{"line":59,"column":8},"end":{"line":59,"column":1678}},"4":{"start":{"line":77,"column":8},"end":{"line":77,"column":2142}},"5":{"start":{"line":80,"column":8},"end":{"line":80,"column":2264}},"6":{"start":{"line":87,"column":8},"end":{"line":87,"column":63}},"7":{"start":{"line":89,"column":8},"end":{"line":89,"column":2492}},"8":{"start":{"line":96,"column":8},"end":{"line":96,"column":2656}},"9":{"start":{"line":100,"column":8},"end":{"line":100,"column":25}},"10":{"start":{"line":109,"column":8},"end":{"line":109,"column":48}},"11":{"start":{"line":110,"column":8},"end":{"line":110,"column":45}},"12":{"start":{"line":112,"column":8},"end":{"line":112,"column":3368}},"13":{"start":{"line":113,"column":12},"end":{"line":113,"column":3454}},"14":{"start":{"line":118,"column":8},"end":{"line":118,"column":19}}},"branchMap":{"1":{"line":57,"type":"if","locations":[{"start":{"line":57,"column":8},"end":{"line":57,"column":8}},{"start":{"line":57,"column":8},"end":{"line":57,"column":8}}]},"2":{"line":58,"type":"if","locations":[{"start":{"line":58,"column":8},"end":{"line":58,"column":8}},{"start":{"line":58,"column":8},"end":{"line":58,"column":8}}]},"3":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":8},"end":{"line":77,"column":8}},{"start":{"line":77,"column":8},"end":{"line":77,"column":8}}]},"4":{"line":109,"type":"if","locations":[{"start":{"line":109,"column":8},"end":{"line":109,"column":8}},{"start":{"line":109,"column":8},"end":{"line":109,"column":8}}]},"5":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":8},"end":{"line":112,"column":8}},{"start":{"line":112,"column":8},"end":{"line":112,"column":8}}]}}}, +"contracts/schemes/WalletScheme.sol":{"l":{"65":13,"66":11,"67":11,"68":11,"69":11,"70":11,"71":11,"89":8,"90":8,"91":8,"93":8,"94":6,"95":6,"97":2,"98":2,"101":8,"102":8,"110":14,"111":14,"112":12,"113":10,"114":10,"115":10,"116":10,"117":10,"118":10,"120":10,"122":10,"123":3,"124":3,"125":3,"127":7,"144":10,"145":10,"147":10,"148":10,"150":10,"152":10,"159":10,"163":10,"164":10,"170":6},"path":"/home/blackjak/Projects/DXdao/arc/contracts/schemes/WalletScheme.sol","s":{"1":13,"2":11,"3":11,"4":11,"5":11,"6":11,"7":11,"8":8,"9":8,"10":8,"11":8,"12":6,"13":6,"14":2,"15":8,"16":8,"17":14,"18":14,"19":12,"20":10,"21":10,"22":10,"23":10,"24":10,"25":10,"26":10,"27":10,"28":3,"29":3,"30":7,"31":10,"32":10,"33":10,"34":10,"35":10,"36":10,"37":10,"38":10,"39":10,"40":6},"b":{"1":[11,2],"2":[11,0],"3":[11,0],"4":[8,0],"5":[8,0],"6":[6,2],"7":[12,2],"8":[10,2],"9":[3,7],"10":[10,0],"11":[10,0],"12":[10,0]},"f":{"1":13,"2":1,"3":8,"4":14,"5":10,"6":6},"fnMap":{"1":{"name":"initialize","line":57,"loc":{"start":{"line":57,"column":4},"end":{"line":64,"column":5}}},"2":{"name":"","line":77,"loc":{"start":{"line":77,"column":4},"end":{"line":77,"column":29}}},"3":{"name":"executeProposal","line":87,"loc":{"start":{"line":87,"column":33},"end":{"line":88,"column":19}}},"4":{"name":"execute","line":109,"loc":{"start":{"line":109,"column":4},"end":{"line":109,"column":46}}},"5":{"name":"proposeCalls","line":140,"loc":{"start":{"line":140,"column":4},"end":{"line":143,"column":5}}},"6":{"name":"getOrganizationProposal","line":167,"loc":{"start":{"line":167,"column":4},"end":{"line":169,"column":5}}}},"statementMap":{"1":{"start":{"line":65,"column":8},"end":{"line":65,"column":66}},"2":{"start":{"line":66,"column":8},"end":{"line":66,"column":61}},"3":{"start":{"line":67,"column":8},"end":{"line":67,"column":70}},"4":{"start":{"line":68,"column":8},"end":{"line":68,"column":23}},"5":{"start":{"line":69,"column":8},"end":{"line":69,"column":31}},"6":{"start":{"line":70,"column":8},"end":{"line":70,"column":37}},"7":{"start":{"line":71,"column":8},"end":{"line":71,"column":31}},"8":{"start":{"line":89,"column":8},"end":{"line":89,"column":74}},"9":{"start":{"line":90,"column":8},"end":{"line":90,"column":57}},"10":{"start":{"line":91,"column":8},"end":{"line":91,"column":64}},"11":{"start":{"line":93,"column":8},"end":{"line":93,"column":2854}},"12":{"start":{"line":94,"column":12},"end":{"line":94,"column":33}},"13":{"start":{"line":95,"column":12},"end":{"line":95,"column":31}},"14":{"start":{"line":98,"column":12},"end":{"line":98,"column":45}},"15":{"start":{"line":101,"column":8},"end":{"line":101,"column":68}},"16":{"start":{"line":102,"column":8},"end":{"line":102,"column":19}},"17":{"start":{"line":110,"column":8},"end":{"line":110,"column":74}},"18":{"start":{"line":111,"column":8},"end":{"line":111,"column":57}},"19":{"start":{"line":112,"column":8},"end":{"line":112,"column":73}},"20":{"start":{"line":113,"column":8},"end":{"line":113,"column":29}},"21":{"start":{"line":114,"column":8},"end":{"line":114,"column":80}},"22":{"start":{"line":115,"column":8},"end":{"line":115,"column":43}},"23":{"start":{"line":116,"column":8},"end":{"line":116,"column":20}},"24":{"start":{"line":117,"column":8},"end":{"line":117,"column":3791}},"25":{"start":{"line":118,"column":10},"end":{"line":118,"column":3925}},"26":{"start":{"line":120,"column":10},"end":{"line":120,"column":60}},"27":{"start":{"line":122,"column":8},"end":{"line":122,"column":4053}},"28":{"start":{"line":124,"column":12},"end":{"line":124,"column":45}},"29":{"start":{"line":125,"column":12},"end":{"line":125,"column":71}},"30":{"start":{"line":127,"column":12},"end":{"line":127,"column":32}},"31":{"start":{"line":144,"column":8},"end":{"line":144,"column":4860}},"32":{"start":{"line":145,"column":10},"end":{"line":145,"column":92}},"33":{"start":{"line":147,"column":8},"end":{"line":147,"column":73}},"34":{"start":{"line":148,"column":8},"end":{"line":148,"column":68}},"35":{"start":{"line":150,"column":8},"end":{"line":150,"column":85}},"36":{"start":{"line":152,"column":8},"end":{"line":152,"column":5258}},"37":{"start":{"line":159,"column":8},"end":{"line":159,"column":5461}},"38":{"start":{"line":163,"column":8},"end":{"line":163,"column":82}},"39":{"start":{"line":164,"column":8},"end":{"line":164,"column":25}},"40":{"start":{"line":170,"column":6},"end":{"line":170,"column":5918}}},"branchMap":{"1":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":8},"end":{"line":65,"column":8}},{"start":{"line":65,"column":8},"end":{"line":65,"column":8}}]},"2":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":66,"column":8}},{"start":{"line":66,"column":8},"end":{"line":66,"column":8}}]},"3":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":8},"end":{"line":67,"column":8}},{"start":{"line":67,"column":8},"end":{"line":67,"column":8}}]},"4":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":8},"end":{"line":90,"column":8}},{"start":{"line":90,"column":8},"end":{"line":90,"column":8}}]},"5":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":8},"end":{"line":91,"column":8}},{"start":{"line":91,"column":8},"end":{"line":91,"column":8}}]},"6":{"line":93,"type":"if","locations":[{"start":{"line":93,"column":8},"end":{"line":93,"column":8}},{"start":{"line":93,"column":8},"end":{"line":93,"column":8}}]},"7":{"line":111,"type":"if","locations":[{"start":{"line":111,"column":8},"end":{"line":111,"column":8}},{"start":{"line":111,"column":8},"end":{"line":111,"column":8}}]},"8":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":8},"end":{"line":112,"column":8}},{"start":{"line":112,"column":8},"end":{"line":112,"column":8}}]},"9":{"line":122,"type":"if","locations":[{"start":{"line":122,"column":8},"end":{"line":122,"column":8}},{"start":{"line":122,"column":8},"end":{"line":122,"column":8}}]},"10":{"line":145,"type":"if","locations":[{"start":{"line":145,"column":10},"end":{"line":145,"column":10}},{"start":{"line":145,"column":10},"end":{"line":145,"column":10}}]},"11":{"line":147,"type":"if","locations":[{"start":{"line":147,"column":8},"end":{"line":147,"column":8}},{"start":{"line":147,"column":8},"end":{"line":147,"column":8}}]},"12":{"line":148,"type":"if","locations":[{"start":{"line":148,"column":8},"end":{"line":148,"column":8}},{"start":{"line":148,"column":8},"end":{"line":148,"column":8}}]}}}, +"contracts/universalSchemes/ContributionReward.sol":{"l":{"84":14,"85":14,"86":14,"88":14,"90":11,"92":14,"93":14,"104":20,"108":20,"109":20,"110":20,"138":27,"139":17,"141":17,"148":17,"149":17,"150":1,"153":17,"165":17,"167":17,"178":17,"182":17,"193":10,"194":10,"195":10,"196":8,"199":8,"200":8,"201":8,"202":6,"206":1,"210":8,"211":7,"212":7,"215":8,"226":5,"227":5,"228":5,"229":5,"231":5,"233":5,"234":5,"235":5,"236":5,"237":5,"241":5,"252":13,"253":13,"254":13,"255":13,"257":13,"258":13,"260":13,"261":11,"262":9,"263":9,"267":11,"278":1,"279":1,"280":1,"281":1,"283":1,"285":1,"286":1,"287":1,"288":1,"292":1,"293":1,"297":1,"316":21,"317":10,"320":19,"321":5,"324":19,"325":13,"328":17,"329":1,"346":75,"347":75,"348":75,"349":8,"350":67,"351":67,"353":55,"355":67,"356":67,"357":47,"359":20,"361":67,"379":40,"383":4,"387":4,"391":4,"395":6,"409":40,"425":27,"426":25,"428":22,"431":22,"434":20,"437":18,"440":16},"path":"/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/ContributionReward.sol","s":{"1":14,"2":14,"3":14,"4":14,"5":11,"6":14,"7":14,"8":20,"9":20,"10":20,"11":20,"12":27,"13":17,"14":17,"15":17,"16":17,"17":1,"18":17,"19":17,"20":17,"21":17,"22":17,"23":10,"24":10,"25":10,"26":8,"27":8,"28":8,"29":8,"30":6,"31":2,"32":1,"33":8,"34":7,"35":7,"36":8,"37":5,"38":5,"39":5,"40":5,"41":5,"42":5,"43":5,"44":5,"45":5,"46":5,"47":5,"48":13,"49":13,"50":13,"51":13,"52":13,"53":13,"54":13,"55":11,"56":9,"57":9,"58":11,"59":1,"60":1,"61":1,"62":1,"63":1,"64":1,"65":1,"66":1,"67":1,"68":1,"69":1,"70":1,"71":21,"72":10,"73":19,"74":5,"75":19,"76":13,"77":17,"78":1,"79":75,"80":75,"81":75,"82":8,"83":67,"84":67,"85":55,"86":67,"87":67,"88":47,"89":20,"90":67,"91":40,"92":4,"93":4,"94":4,"95":6,"96":40,"97":27,"98":25,"99":22,"100":22,"101":20,"102":18,"103":16},"b":{"1":[14,0],"2":[14,0],"3":[11,3],"4":[1,16],"5":[8,2],"6":[6,2],"7":[6,0],"8":[1,1],"9":[1,0],"10":[7,1],"11":[5,0],"12":[5,0],"13":[5,0],"14":[13,0],"15":[11,2],"16":[9,2],"17":[1,0],"18":[1,0],"19":[1,0],"20":[1,0],"21":[10,11],"22":[5,14],"23":[13,6],"24":[1,16],"25":[75,0],"26":[8,67],"27":[55,12],"28":[47,20],"29":[25,2],"30":[22,3],"31":[22,0],"32":[20,2],"33":[18,2],"34":[16,2],"35":[14,2]},"f":{"1":14,"2":20,"3":27,"4":10,"5":5,"6":13,"7":1,"8":21,"9":75,"10":40,"11":4,"12":4,"13":4,"14":6,"15":40,"16":27},"fnMap":{"1":{"name":"executeProposal","line":83,"loc":{"start":{"line":83,"column":103},"end":{"line":83,"column":17}}},"2":{"name":"setParameters","line":99,"loc":{"start":{"line":99,"column":4},"end":{"line":103,"column":5}}},"3":{"name":"proposeContributionReward","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":137,"column":5}}},"4":{"name":"redeemReputation","line":191,"loc":{"start":{"line":191,"column":4},"end":{"line":191,"column":98}}},"5":{"name":"redeemNativeToken","line":224,"loc":{"start":{"line":224,"column":4},"end":{"line":224,"column":96}}},"6":{"name":"redeemEther","line":250,"loc":{"start":{"line":250,"column":4},"end":{"line":250,"column":90}}},"7":{"name":"redeemExternalToken","line":276,"loc":{"start":{"line":276,"column":4},"end":{"line":276,"column":98}}},"8":{"name":"redeem","line":311,"loc":{"start":{"line":311,"column":4},"end":{"line":314,"column":5}}},"9":{"name":"getPeriodsToPay","line":345,"loc":{"start":{"line":345,"column":4},"end":{"line":345,"column":115}}},"10":{"name":"getRedeemedPeriods","line":375,"loc":{"start":{"line":375,"column":4},"end":{"line":378,"column":23}}},"11":{"name":"getProposalEthReward","line":382,"loc":{"start":{"line":382,"column":4},"end":{"line":382,"column":99}}},"12":{"name":"getProposalExternalTokenReward","line":386,"loc":{"start":{"line":386,"column":4},"end":{"line":386,"column":109}}},"13":{"name":"getProposalExternalToken","line":390,"loc":{"start":{"line":390,"column":4},"end":{"line":390,"column":103}}},"14":{"name":"getProposalExecutionTime","line":394,"loc":{"start":{"line":394,"column":4},"end":{"line":394,"column":103}}},"15":{"name":"getParametersHash","line":404,"loc":{"start":{"line":404,"column":4},"end":{"line":408,"column":5}}},"16":{"name":"validateProposalParams","line":424,"loc":{"start":{"line":424,"column":4},"end":{"line":424,"column":97}}}},"statementMap":{"1":{"start":{"line":84,"column":8},"end":{"line":84,"column":77}},"2":{"start":{"line":85,"column":8},"end":{"line":85,"column":96}},"3":{"start":{"line":86,"column":8},"end":{"line":86,"column":103}},"4":{"start":{"line":88,"column":8},"end":{"line":88,"column":3458}},"5":{"start":{"line":90,"column":12},"end":{"line":90,"column":92}},"6":{"start":{"line":92,"column":8},"end":{"line":92,"column":76}},"7":{"start":{"line":93,"column":8},"end":{"line":93,"column":19}},"8":{"start":{"line":104,"column":8},"end":{"line":104,"column":3984}},"9":{"start":{"line":108,"column":8},"end":{"line":108,"column":68}},"10":{"start":{"line":109,"column":8},"end":{"line":109,"column":48}},"11":{"start":{"line":110,"column":8},"end":{"line":110,"column":25}},"12":{"start":{"line":138,"column":8},"end":{"line":138,"column":58}},"13":{"start":{"line":139,"column":8},"end":{"line":139,"column":93}},"14":{"start":{"line":141,"column":8},"end":{"line":141,"column":5527}},"15":{"start":{"line":148,"column":8},"end":{"line":148,"column":50}},"16":{"start":{"line":149,"column":8},"end":{"line":149,"column":5757}},"17":{"start":{"line":150,"column":12},"end":{"line":150,"column":35}},"18":{"start":{"line":153,"column":8},"end":{"line":153,"column":5849}},"19":{"start":{"line":165,"column":8},"end":{"line":165,"column":74}},"20":{"start":{"line":167,"column":8},"end":{"line":167,"column":6440}},"21":{"start":{"line":178,"column":8},"end":{"line":178,"column":6730}},"22":{"start":{"line":182,"column":8},"end":{"line":182,"column":29}},"23":{"start":{"line":193,"column":8},"end":{"line":193,"column":101}},"24":{"start":{"line":194,"column":8},"end":{"line":194,"column":101}},"25":{"start":{"line":195,"column":8},"end":{"line":195,"column":43}},"26":{"start":{"line":196,"column":8},"end":{"line":196,"column":80}},"27":{"start":{"line":199,"column":8},"end":{"line":199,"column":36}},"28":{"start":{"line":200,"column":8},"end":{"line":200,"column":66}},"29":{"start":{"line":201,"column":8},"end":{"line":201,"column":7777}},"30":{"start":{"line":202,"column":12},"end":{"line":202,"column":7905}},"31":{"start":{"line":205,"column":15},"end":{"line":205,"column":7964}},"32":{"start":{"line":206,"column":12},"end":{"line":206,"column":8097}},"33":{"start":{"line":210,"column":8},"end":{"line":210,"column":8159}},"34":{"start":{"line":211,"column":12},"end":{"line":211,"column":86}},"35":{"start":{"line":212,"column":12},"end":{"line":212,"column":99}},"36":{"start":{"line":215,"column":8},"end":{"line":215,"column":61}},"37":{"start":{"line":226,"column":8},"end":{"line":226,"column":101}},"38":{"start":{"line":227,"column":8},"end":{"line":227,"column":101}},"39":{"start":{"line":228,"column":8},"end":{"line":228,"column":43}},"40":{"start":{"line":229,"column":8},"end":{"line":229,"column":80}},"41":{"start":{"line":231,"column":8},"end":{"line":231,"column":37}},"42":{"start":{"line":233,"column":8},"end":{"line":233,"column":61}},"43":{"start":{"line":234,"column":8},"end":{"line":234,"column":9332}},"44":{"start":{"line":235,"column":12},"end":{"line":235,"column":107}},"45":{"start":{"line":236,"column":12},"end":{"line":236,"column":86}},"46":{"start":{"line":237,"column":12},"end":{"line":237,"column":96}},"47":{"start":{"line":241,"column":8},"end":{"line":241,"column":63}},"48":{"start":{"line":252,"column":8},"end":{"line":252,"column":101}},"49":{"start":{"line":253,"column":8},"end":{"line":253,"column":101}},"50":{"start":{"line":254,"column":8},"end":{"line":254,"column":43}},"51":{"start":{"line":255,"column":8},"end":{"line":255,"column":80}},"52":{"start":{"line":257,"column":8},"end":{"line":257,"column":29}},"53":{"start":{"line":258,"column":8},"end":{"line":258,"column":53}},"54":{"start":{"line":260,"column":8},"end":{"line":260,"column":10578}},"55":{"start":{"line":261,"column":12},"end":{"line":261,"column":97}},"56":{"start":{"line":262,"column":12},"end":{"line":262,"column":86}},"57":{"start":{"line":263,"column":12},"end":{"line":263,"column":90}},"58":{"start":{"line":267,"column":8},"end":{"line":267,"column":47}},"59":{"start":{"line":278,"column":8},"end":{"line":278,"column":101}},"60":{"start":{"line":279,"column":8},"end":{"line":279,"column":101}},"61":{"start":{"line":280,"column":8},"end":{"line":280,"column":43}},"62":{"start":{"line":281,"column":8},"end":{"line":281,"column":80}},"63":{"start":{"line":283,"column":8},"end":{"line":283,"column":39}},"64":{"start":{"line":285,"column":8},"end":{"line":285,"column":11773}},"65":{"start":{"line":286,"column":12},"end":{"line":286,"column":67}},"66":{"start":{"line":287,"column":12},"end":{"line":287,"column":11939}},"67":{"start":{"line":288,"column":16},"end":{"line":288,"column":12064}},"68":{"start":{"line":292,"column":16},"end":{"line":292,"column":90}},"69":{"start":{"line":293,"column":16},"end":{"line":293,"column":102}},"70":{"start":{"line":297,"column":8},"end":{"line":297,"column":67}},"71":{"start":{"line":316,"column":8},"end":{"line":316,"column":13156}},"72":{"start":{"line":317,"column":12},"end":{"line":317,"column":68}},"73":{"start":{"line":320,"column":8},"end":{"line":320,"column":13270}},"74":{"start":{"line":321,"column":12},"end":{"line":321,"column":70}},"75":{"start":{"line":324,"column":8},"end":{"line":324,"column":13386}},"76":{"start":{"line":325,"column":12},"end":{"line":325,"column":58}},"77":{"start":{"line":328,"column":8},"end":{"line":328,"column":13490}},"78":{"start":{"line":329,"column":12},"end":{"line":329,"column":74}},"79":{"start":{"line":346,"column":8},"end":{"line":346,"column":74}},"80":{"start":{"line":347,"column":8},"end":{"line":347,"column":92}},"81":{"start":{"line":348,"column":8},"end":{"line":348,"column":14452}},"82":{"start":{"line":349,"column":12},"end":{"line":349,"column":20}},"83":{"start":{"line":350,"column":8},"end":{"line":350,"column":36}},"84":{"start":{"line":351,"column":8},"end":{"line":351,"column":14542}},"85":{"start":{"line":353,"column":12},"end":{"line":353,"column":93}},"86":{"start":{"line":355,"column":8},"end":{"line":355,"column":28}},"87":{"start":{"line":356,"column":8},"end":{"line":356,"column":14776}},"88":{"start":{"line":357,"column":12},"end":{"line":357,"column":95}},"89":{"start":{"line":359,"column":12},"end":{"line":359,"column":90}},"90":{"start":{"line":361,"column":8},"end":{"line":361,"column":27}},"91":{"start":{"line":379,"column":8},"end":{"line":379,"column":88}},"92":{"start":{"line":383,"column":8},"end":{"line":383,"column":69}},"93":{"start":{"line":387,"column":8},"end":{"line":387,"column":79}},"94":{"start":{"line":391,"column":8},"end":{"line":391,"column":82}},"95":{"start":{"line":395,"column":8},"end":{"line":395,"column":73}},"96":{"start":{"line":409,"column":8},"end":{"line":409,"column":74}},"97":{"start":{"line":425,"column":8},"end":{"line":425,"column":113}},"98":{"start":{"line":426,"column":8},"end":{"line":426,"column":17999}},"99":{"start":{"line":428,"column":12},"end":{"line":428,"column":18170}},"100":{"start":{"line":431,"column":12},"end":{"line":431,"column":18394}},"101":{"start":{"line":434,"column":12},"end":{"line":434,"column":18627}},"102":{"start":{"line":437,"column":12},"end":{"line":437,"column":18834}},"103":{"start":{"line":440,"column":12},"end":{"line":440,"column":19063}}},"branchMap":{"1":{"line":85,"type":"if","locations":[{"start":{"line":85,"column":8},"end":{"line":85,"column":8}},{"start":{"line":85,"column":8},"end":{"line":85,"column":8}}]},"2":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":8},"end":{"line":86,"column":8}},{"start":{"line":86,"column":8},"end":{"line":86,"column":8}}]},"3":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":8},"end":{"line":88,"column":8}},{"start":{"line":88,"column":8},"end":{"line":88,"column":8}}]},"4":{"line":149,"type":"if","locations":[{"start":{"line":149,"column":8},"end":{"line":149,"column":8}},{"start":{"line":149,"column":8},"end":{"line":149,"column":8}}]},"5":{"line":195,"type":"if","locations":[{"start":{"line":195,"column":8},"end":{"line":195,"column":8}},{"start":{"line":195,"column":8},"end":{"line":195,"column":8}}]},"6":{"line":201,"type":"if","locations":[{"start":{"line":201,"column":8},"end":{"line":201,"column":8}},{"start":{"line":201,"column":8},"end":{"line":201,"column":8}}]},"7":{"line":202,"type":"if","locations":[{"start":{"line":202,"column":12},"end":{"line":202,"column":12}},{"start":{"line":202,"column":12},"end":{"line":202,"column":12}}]},"8":{"line":205,"type":"if","locations":[{"start":{"line":205,"column":15},"end":{"line":205,"column":15}},{"start":{"line":205,"column":15},"end":{"line":205,"column":15}}]},"9":{"line":206,"type":"if","locations":[{"start":{"line":206,"column":12},"end":{"line":206,"column":12}},{"start":{"line":206,"column":12},"end":{"line":206,"column":12}}]},"10":{"line":210,"type":"if","locations":[{"start":{"line":210,"column":8},"end":{"line":210,"column":8}},{"start":{"line":210,"column":8},"end":{"line":210,"column":8}}]},"11":{"line":228,"type":"if","locations":[{"start":{"line":228,"column":8},"end":{"line":228,"column":8}},{"start":{"line":228,"column":8},"end":{"line":228,"column":8}}]},"12":{"line":234,"type":"if","locations":[{"start":{"line":234,"column":8},"end":{"line":234,"column":8}},{"start":{"line":234,"column":8},"end":{"line":234,"column":8}}]},"13":{"line":235,"type":"if","locations":[{"start":{"line":235,"column":12},"end":{"line":235,"column":12}},{"start":{"line":235,"column":12},"end":{"line":235,"column":12}}]},"14":{"line":254,"type":"if","locations":[{"start":{"line":254,"column":8},"end":{"line":254,"column":8}},{"start":{"line":254,"column":8},"end":{"line":254,"column":8}}]},"15":{"line":260,"type":"if","locations":[{"start":{"line":260,"column":8},"end":{"line":260,"column":8}},{"start":{"line":260,"column":8},"end":{"line":260,"column":8}}]},"16":{"line":261,"type":"if","locations":[{"start":{"line":261,"column":12},"end":{"line":261,"column":12}},{"start":{"line":261,"column":12},"end":{"line":261,"column":12}}]},"17":{"line":280,"type":"if","locations":[{"start":{"line":280,"column":8},"end":{"line":280,"column":8}},{"start":{"line":280,"column":8},"end":{"line":280,"column":8}}]},"18":{"line":285,"type":"if","locations":[{"start":{"line":285,"column":8},"end":{"line":285,"column":8}},{"start":{"line":285,"column":8},"end":{"line":285,"column":8}}]},"19":{"line":287,"type":"if","locations":[{"start":{"line":287,"column":12},"end":{"line":287,"column":12}},{"start":{"line":287,"column":12},"end":{"line":287,"column":12}}]},"20":{"line":288,"type":"if","locations":[{"start":{"line":288,"column":16},"end":{"line":288,"column":16}},{"start":{"line":288,"column":16},"end":{"line":288,"column":16}}]},"21":{"line":316,"type":"if","locations":[{"start":{"line":316,"column":8},"end":{"line":316,"column":8}},{"start":{"line":316,"column":8},"end":{"line":316,"column":8}}]},"22":{"line":320,"type":"if","locations":[{"start":{"line":320,"column":8},"end":{"line":320,"column":8}},{"start":{"line":320,"column":8},"end":{"line":320,"column":8}}]},"23":{"line":324,"type":"if","locations":[{"start":{"line":324,"column":8},"end":{"line":324,"column":8}},{"start":{"line":324,"column":8},"end":{"line":324,"column":8}}]},"24":{"line":328,"type":"if","locations":[{"start":{"line":328,"column":8},"end":{"line":328,"column":8}},{"start":{"line":328,"column":8},"end":{"line":328,"column":8}}]},"25":{"line":346,"type":"if","locations":[{"start":{"line":346,"column":8},"end":{"line":346,"column":8}},{"start":{"line":346,"column":8},"end":{"line":346,"column":8}}]},"26":{"line":348,"type":"if","locations":[{"start":{"line":348,"column":8},"end":{"line":348,"column":8}},{"start":{"line":348,"column":8},"end":{"line":348,"column":8}}]},"27":{"line":351,"type":"if","locations":[{"start":{"line":351,"column":8},"end":{"line":351,"column":8}},{"start":{"line":351,"column":8},"end":{"line":351,"column":8}}]},"28":{"line":356,"type":"if","locations":[{"start":{"line":356,"column":8},"end":{"line":356,"column":8}},{"start":{"line":356,"column":8},"end":{"line":356,"column":8}}]},"29":{"line":425,"type":"if","locations":[{"start":{"line":425,"column":8},"end":{"line":425,"column":8}},{"start":{"line":425,"column":8},"end":{"line":425,"column":8}}]},"30":{"line":426,"type":"if","locations":[{"start":{"line":426,"column":8},"end":{"line":426,"column":8}},{"start":{"line":426,"column":8},"end":{"line":426,"column":8}}]},"31":{"line":428,"type":"if","locations":[{"start":{"line":428,"column":12},"end":{"line":428,"column":12}},{"start":{"line":428,"column":12},"end":{"line":428,"column":12}}]},"32":{"line":431,"type":"if","locations":[{"start":{"line":431,"column":12},"end":{"line":431,"column":12}},{"start":{"line":431,"column":12},"end":{"line":431,"column":12}}]},"33":{"line":434,"type":"if","locations":[{"start":{"line":434,"column":12},"end":{"line":434,"column":12}},{"start":{"line":434,"column":12},"end":{"line":434,"column":12}}]},"34":{"line":437,"type":"if","locations":[{"start":{"line":437,"column":12},"end":{"line":437,"column":12}},{"start":{"line":437,"column":12},"end":{"line":437,"column":12}}]},"35":{"line":440,"type":"if","locations":[{"start":{"line":440,"column":12},"end":{"line":440,"column":12}},{"start":{"line":440,"column":12},"end":{"line":440,"column":12}}]}}}, +"contracts/universalSchemes/DaoCreator.sol":{"l":{"14":294,"15":294,"16":294,"17":294,"35":296,"36":296,"37":296,"38":296,"61":3,"62":3,"63":3,"64":3,"66":1,"67":60,"68":60,"69":60,"72":60,"73":60,"77":1,"106":298,"135":294,"137":290,"138":290,"139":313,"141":290,"143":290,"145":290,"146":290,"173":298,"174":298,"175":296,"176":296,"177":296,"178":296,"182":296,"183":536,"184":534,"185":370,"187":534,"188":508,"192":294,"195":294,"198":294,"199":294,"200":294,"202":294,"204":294,"205":294},"path":"/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/DaoCreator.sol","s":{"1":294,"2":294,"3":294,"4":294,"5":296,"6":296,"7":296,"8":296,"9":3,"10":3,"11":3,"12":3,"13":1,"14":60,"15":60,"16":60,"17":60,"18":60,"19":1,"20":298,"21":294,"22":290,"23":290,"24":313,"25":290,"26":290,"27":290,"28":298,"29":298,"30":296,"31":296,"32":296,"33":296,"34":296,"35":536,"36":534,"37":370,"38":534,"39":508,"40":294,"41":294,"42":294,"43":294,"44":294,"45":294,"46":294,"47":294},"b":{"1":[296,0],"2":[296,0],"3":[3,0],"4":[3,0],"5":[3,0],"6":[1,2],"7":[60,0],"8":[60,0],"9":[60,0],"10":[290,4],"11":[298,0],"12":[296,2],"13":[296,0],"14":[534,2],"15":[370,164],"16":[508,26]},"f":{"1":294,"2":296,"3":3,"4":298,"5":294,"6":298},"fnMap":{"1":{"name":"create","line":13,"loc":{"start":{"line":13,"column":4},"end":{"line":13,"column":57}}},"2":{"name":"constructor","line":34,"loc":{"start":{"line":34,"column":4},"end":{"line":34,"column":82}}},"3":{"name":"addFounders","line":52,"loc":{"start":{"line":52,"column":4},"end":{"line":60,"column":5}}},"4":{"name":"forgeOrg","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":104,"column":5}}},"5":{"name":"setSchemes","line":124,"loc":{"start":{"line":124,"column":4},"end":{"line":132,"column":5}}},"6":{"name":"_forgeOrg","line":162,"loc":{"start":{"line":162,"column":4},"end":{"line":171,"column":5}}}},"statementMap":{"1":{"start":{"line":14,"column":8},"end":{"line":14,"column":55}},"2":{"start":{"line":15,"column":8},"end":{"line":15,"column":94}},"3":{"start":{"line":16,"column":8},"end":{"line":16,"column":67}},"4":{"start":{"line":17,"column":8},"end":{"line":17,"column":34}},"5":{"start":{"line":35,"column":8},"end":{"line":35,"column":58}},"6":{"start":{"line":36,"column":8},"end":{"line":36,"column":44}},"7":{"start":{"line":37,"column":8},"end":{"line":37,"column":45}},"8":{"start":{"line":38,"column":8},"end":{"line":38,"column":31}},"9":{"start":{"line":61,"column":8},"end":{"line":61,"column":63}},"10":{"start":{"line":62,"column":8},"end":{"line":62,"column":68}},"11":{"start":{"line":63,"column":8},"end":{"line":63,"column":36}},"12":{"start":{"line":64,"column":8},"end":{"line":64,"column":53}},"13":{"start":{"line":66,"column":8},"end":{"line":66,"column":2260}},"14":{"start":{"line":67,"column":12},"end":{"line":67,"column":46}},"15":{"start":{"line":68,"column":12},"end":{"line":68,"column":2374}},"16":{"start":{"line":69,"column":16},"end":{"line":69,"column":2512}},"17":{"start":{"line":72,"column":12},"end":{"line":72,"column":2565}},"18":{"start":{"line":73,"column":16},"end":{"line":73,"column":2717}},"19":{"start":{"line":77,"column":8},"end":{"line":77,"column":19}},"20":{"start":{"line":106,"column":8},"end":{"line":106,"column":3901}},"21":{"start":{"line":135,"column":8},"end":{"line":135,"column":53}},"22":{"start":{"line":137,"column":8},"end":{"line":137,"column":59}},"23":{"start":{"line":138,"column":8},"end":{"line":138,"column":4952}},"24":{"start":{"line":139,"column":12},"end":{"line":139,"column":96}},"25":{"start":{"line":141,"column":8},"end":{"line":141,"column":46}},"26":{"start":{"line":143,"column":8},"end":{"line":143,"column":67}},"27":{"start":{"line":146,"column":8},"end":{"line":146,"column":48}},"28":{"start":{"line":173,"column":8},"end":{"line":173,"column":63}},"29":{"start":{"line":174,"column":8},"end":{"line":174,"column":68}},"30":{"start":{"line":175,"column":8},"end":{"line":175,"column":36}},"31":{"start":{"line":176,"column":8},"end":{"line":176,"column":75}},"32":{"start":{"line":177,"column":8},"end":{"line":177,"column":54}},"33":{"start":{"line":178,"column":8},"end":{"line":178,"column":75}},"34":{"start":{"line":182,"column":8},"end":{"line":182,"column":6874}},"35":{"start":{"line":183,"column":12},"end":{"line":183,"column":46}},"36":{"start":{"line":184,"column":12},"end":{"line":184,"column":6988}},"37":{"start":{"line":185,"column":16},"end":{"line":185,"column":70}},"38":{"start":{"line":187,"column":12},"end":{"line":187,"column":7122}},"39":{"start":{"line":188,"column":16},"end":{"line":188,"column":80}},"40":{"start":{"line":192,"column":8},"end":{"line":192,"column":76}},"41":{"start":{"line":195,"column":8},"end":{"line":195,"column":47}},"42":{"start":{"line":198,"column":8},"end":{"line":198,"column":52}},"43":{"start":{"line":199,"column":8},"end":{"line":199,"column":57}},"44":{"start":{"line":200,"column":8},"end":{"line":200,"column":62}},"45":{"start":{"line":202,"column":8},"end":{"line":202,"column":42}},"46":{"start":{"line":204,"column":8},"end":{"line":204,"column":37}},"47":{"start":{"line":205,"column":8},"end":{"line":205,"column":32}}},"branchMap":{"1":{"line":35,"type":"if","locations":[{"start":{"line":35,"column":8},"end":{"line":35,"column":8}},{"start":{"line":35,"column":8},"end":{"line":35,"column":8}}]},"2":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":8},"end":{"line":36,"column":8}},{"start":{"line":36,"column":8},"end":{"line":36,"column":8}}]},"3":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":8},"end":{"line":61,"column":8}},{"start":{"line":61,"column":8},"end":{"line":61,"column":8}}]},"4":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":8},"end":{"line":62,"column":8}},{"start":{"line":62,"column":8},"end":{"line":62,"column":8}}]},"5":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":8},"end":{"line":63,"column":8}},{"start":{"line":63,"column":8},"end":{"line":63,"column":8}}]},"6":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"7":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":12},"end":{"line":67,"column":12}},{"start":{"line":67,"column":12},"end":{"line":67,"column":12}}]},"8":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":12},"end":{"line":68,"column":12}},{"start":{"line":68,"column":12},"end":{"line":68,"column":12}}]},"9":{"line":72,"type":"if","locations":[{"start":{"line":72,"column":12},"end":{"line":72,"column":12}},{"start":{"line":72,"column":12},"end":{"line":72,"column":12}}]},"10":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":8},"end":{"line":135,"column":8}},{"start":{"line":135,"column":8},"end":{"line":135,"column":8}}]},"11":{"line":173,"type":"if","locations":[{"start":{"line":173,"column":8},"end":{"line":173,"column":8}},{"start":{"line":173,"column":8},"end":{"line":173,"column":8}}]},"12":{"line":174,"type":"if","locations":[{"start":{"line":174,"column":8},"end":{"line":174,"column":8}},{"start":{"line":174,"column":8},"end":{"line":174,"column":8}}]},"13":{"line":175,"type":"if","locations":[{"start":{"line":175,"column":8},"end":{"line":175,"column":8}},{"start":{"line":175,"column":8},"end":{"line":175,"column":8}}]},"14":{"line":183,"type":"if","locations":[{"start":{"line":183,"column":12},"end":{"line":183,"column":12}},{"start":{"line":183,"column":12},"end":{"line":183,"column":12}}]},"15":{"line":184,"type":"if","locations":[{"start":{"line":184,"column":12},"end":{"line":184,"column":12}},{"start":{"line":184,"column":12},"end":{"line":184,"column":12}}]},"16":{"line":187,"type":"if","locations":[{"start":{"line":187,"column":12},"end":{"line":187,"column":12}},{"start":{"line":187,"column":12},"end":{"line":187,"column":12}}]}}}, +"contracts/universalSchemes/GlobalConstraintRegistrar.sol":{"l":{"65":8,"66":8,"68":8,"69":8,"70":8,"71":8,"73":8,"76":7,"79":7,"80":5,"81":5,"84":7,"85":2,"88":8,"89":8,"103":11,"104":11,"105":11,"106":11,"128":8,"130":8,"131":8,"133":8,"140":8,"141":8,"150":8,"154":8,"165":5,"166":5,"167":3,"168":3,"169":3,"176":3,"183":3,"184":3,"185":3,"189":3,"203":22},"path":"/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/GlobalConstraintRegistrar.sol","s":{"1":8,"2":8,"3":8,"4":8,"5":8,"6":8,"7":7,"8":7,"9":5,"10":5,"11":7,"12":2,"13":8,"14":8,"15":11,"16":11,"17":11,"18":11,"19":8,"20":8,"21":8,"22":8,"23":8,"24":8,"25":8,"26":8,"27":5,"28":5,"29":3,"30":3,"31":3,"32":3,"33":3,"34":3,"35":3,"36":3,"37":22},"b":{"1":[8,0],"2":[7,1],"3":[5,2],"4":[2,5],"5":[3,2]},"f":{"1":8,"2":11,"3":8,"4":5,"5":22},"fnMap":{"1":{"name":"executeProposal","line":64,"loc":{"start":{"line":64,"column":103},"end":{"line":64,"column":17}}},"2":{"name":"setParameters","line":98,"loc":{"start":{"line":98,"column":4},"end":{"line":102,"column":5}}},"3":{"name":"proposeGlobalConstraint","line":119,"loc":{"start":{"line":119,"column":4},"end":{"line":127,"column":5}}},"4":{"name":"proposeToRemoveGC","line":164,"loc":{"start":{"line":164,"column":4},"end":{"line":164,"column":113}}},"5":{"name":"getParametersHash","line":198,"loc":{"start":{"line":198,"column":4},"end":{"line":202,"column":5}}}},"statementMap":{"1":{"start":{"line":65,"column":8},"end":{"line":65,"column":69}},"2":{"start":{"line":66,"column":8},"end":{"line":66,"column":26}},"3":{"start":{"line":68,"column":8},"end":{"line":68,"column":89}},"4":{"start":{"line":69,"column":8},"end":{"line":69,"column":41}},"5":{"start":{"line":71,"column":8},"end":{"line":71,"column":58}},"6":{"start":{"line":73,"column":8},"end":{"line":73,"column":2982}},"7":{"start":{"line":76,"column":12},"end":{"line":76,"column":62}},"8":{"start":{"line":79,"column":12},"end":{"line":79,"column":3155}},"9":{"start":{"line":80,"column":16},"end":{"line":80,"column":101}},"10":{"start":{"line":81,"column":16},"end":{"line":81,"column":93}},"11":{"start":{"line":84,"column":12},"end":{"line":84,"column":3428}},"12":{"start":{"line":85,"column":16},"end":{"line":85,"column":87}},"13":{"start":{"line":88,"column":8},"end":{"line":88,"column":67}},"14":{"start":{"line":89,"column":8},"end":{"line":89,"column":21}},"15":{"start":{"line":103,"column":8},"end":{"line":103,"column":77}},"16":{"start":{"line":104,"column":8},"end":{"line":104,"column":70}},"17":{"start":{"line":105,"column":8},"end":{"line":105,"column":48}},"18":{"start":{"line":106,"column":8},"end":{"line":106,"column":25}},"19":{"start":{"line":128,"column":8},"end":{"line":128,"column":89}},"20":{"start":{"line":130,"column":8},"end":{"line":130,"column":55}},"21":{"start":{"line":131,"column":8},"end":{"line":131,"column":110}},"22":{"start":{"line":133,"column":8},"end":{"line":133,"column":5400}},"23":{"start":{"line":140,"column":8},"end":{"line":140,"column":70}},"24":{"start":{"line":141,"column":8},"end":{"line":141,"column":5662}},"25":{"start":{"line":150,"column":8},"end":{"line":150,"column":5900}},"26":{"start":{"line":154,"column":8},"end":{"line":154,"column":25}},"27":{"start":{"line":165,"column":8},"end":{"line":165,"column":59}},"28":{"start":{"line":166,"column":8},"end":{"line":166,"column":78}},"29":{"start":{"line":167,"column":8},"end":{"line":167,"column":83}},"30":{"start":{"line":168,"column":8},"end":{"line":168,"column":49}},"31":{"start":{"line":169,"column":8},"end":{"line":169,"column":6803}},"32":{"start":{"line":176,"column":8},"end":{"line":176,"column":6969}},"33":{"start":{"line":183,"column":8},"end":{"line":183,"column":70}},"34":{"start":{"line":184,"column":8},"end":{"line":184,"column":115}},"35":{"start":{"line":185,"column":8},"end":{"line":185,"column":7325}},"36":{"start":{"line":189,"column":8},"end":{"line":189,"column":25}},"37":{"start":{"line":203,"column":8},"end":{"line":203,"column":75}}},"branchMap":{"1":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":8},"end":{"line":69,"column":8}},{"start":{"line":69,"column":8},"end":{"line":69,"column":8}}]},"2":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":8},"end":{"line":73,"column":8}},{"start":{"line":73,"column":8},"end":{"line":73,"column":8}}]},"3":{"line":79,"type":"if","locations":[{"start":{"line":79,"column":12},"end":{"line":79,"column":12}},{"start":{"line":79,"column":12},"end":{"line":79,"column":12}}]},"4":{"line":84,"type":"if","locations":[{"start":{"line":84,"column":12},"end":{"line":84,"column":12}},{"start":{"line":84,"column":12},"end":{"line":84,"column":12}}]},"5":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":8},"end":{"line":166,"column":8}},{"start":{"line":166,"column":8},"end":{"line":166,"column":8}}]}}}, +"contracts/universalSchemes/OrganizationRegister.sol":{"l":{"38":3,"39":3,"40":3,"41":3,"42":3,"44":3,"59":4,"61":4,"63":2,"64":2,"65":1,"67":2,"69":2,"82":6},"path":"/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/OrganizationRegister.sol","s":{"1":3,"2":3,"3":3,"4":3,"5":3,"6":3,"7":4,"8":4,"9":2,"10":2,"11":1,"12":2,"13":2,"14":6},"b":{"1":[3,0],"2":[2,2],"3":[1,1]},"f":{"1":3,"2":4,"3":6},"fnMap":{"1":{"name":"setParameters","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":37,"column":99}}},"2":{"name":"addOrPromoteAddress","line":56,"loc":{"start":{"line":56,"column":4},"end":{"line":58,"column":5}}},"3":{"name":"getParametersHash","line":79,"loc":{"start":{"line":79,"column":4},"end":{"line":81,"column":5}}}},"statementMap":{"1":{"start":{"line":38,"column":8},"end":{"line":38,"column":74}},"2":{"start":{"line":39,"column":8},"end":{"line":39,"column":1407}},"3":{"start":{"line":40,"column":12},"end":{"line":40,"column":48}},"4":{"start":{"line":41,"column":12},"end":{"line":41,"column":44}},"5":{"start":{"line":42,"column":12},"end":{"line":42,"column":60}},"6":{"start":{"line":44,"column":8},"end":{"line":44,"column":25}},"7":{"start":{"line":59,"column":8},"end":{"line":59,"column":83}},"8":{"start":{"line":61,"column":8},"end":{"line":61,"column":97}},"9":{"start":{"line":63,"column":8},"end":{"line":63,"column":86}},"10":{"start":{"line":64,"column":8},"end":{"line":64,"column":2689}},"11":{"start":{"line":65,"column":12},"end":{"line":65,"column":52}},"12":{"start":{"line":67,"column":8},"end":{"line":67,"column":2882}},"13":{"start":{"line":69,"column":8},"end":{"line":69,"column":58}},"14":{"start":{"line":82,"column":8},"end":{"line":82,"column":72}}},"branchMap":{"1":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":8},"end":{"line":39,"column":8}},{"start":{"line":39,"column":8},"end":{"line":39,"column":8}}]},"2":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":8},"end":{"line":61,"column":8}},{"start":{"line":61,"column":8},"end":{"line":61,"column":8}}]},"3":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]}}}, +"contracts/universalSchemes/SchemeRegistrar.sol":{"l":{"61":11,"62":11,"63":11,"64":11,"65":11,"66":11,"69":10,"72":10,"73":9,"81":10,"82":1,"85":11,"86":11,"98":15,"99":15,"100":15,"101":15,"102":15,"126":11,"127":11,"129":11,"136":11,"142":11,"150":11,"151":11,"155":11,"169":2,"170":2,"171":2,"173":2,"174":2,"175":2,"176":2,"177":2,"181":2,"190":30},"path":"/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/SchemeRegistrar.sol","s":{"1":11,"2":11,"3":11,"4":11,"5":11,"6":10,"7":10,"8":9,"9":10,"10":1,"11":11,"12":11,"13":15,"14":15,"15":15,"16":15,"17":15,"18":11,"19":11,"20":11,"21":11,"22":11,"23":11,"24":11,"25":11,"26":2,"27":2,"28":2,"29":2,"30":2,"31":2,"32":2,"33":2,"34":2,"35":30},"b":{"1":[11,0],"2":[10,1],"3":[9,1],"4":[9,0],"5":[1,9],"6":[1,0],"7":[11,0],"8":[2,0]},"f":{"1":11,"2":15,"3":11,"4":2,"5":30},"fnMap":{"1":{"name":"executeProposal","line":60,"loc":{"start":{"line":60,"column":103},"end":{"line":60,"column":17}}},"2":{"name":"setParameters","line":92,"loc":{"start":{"line":92,"column":4},"end":{"line":97,"column":5}}},"3":{"name":"proposeScheme","line":115,"loc":{"start":{"line":115,"column":4},"end":{"line":124,"column":5}}},"4":{"name":"proposeToRemoveScheme","line":165,"loc":{"start":{"line":165,"column":4},"end":{"line":168,"column":5}}},"5":{"name":"getParametersHash","line":184,"loc":{"start":{"line":184,"column":4},"end":{"line":189,"column":5}}}},"statementMap":{"1":{"start":{"line":61,"column":8},"end":{"line":61,"column":69}},"2":{"start":{"line":62,"column":8},"end":{"line":62,"column":93}},"3":{"start":{"line":63,"column":8},"end":{"line":63,"column":45}},"4":{"start":{"line":65,"column":8},"end":{"line":65,"column":58}},"5":{"start":{"line":66,"column":8},"end":{"line":66,"column":2673}},"6":{"start":{"line":69,"column":12},"end":{"line":69,"column":62}},"7":{"start":{"line":72,"column":12},"end":{"line":72,"column":2852}},"8":{"start":{"line":73,"column":16},"end":{"line":73,"column":2898}},"9":{"start":{"line":81,"column":12},"end":{"line":81,"column":3181}},"10":{"start":{"line":82,"column":16},"end":{"line":82,"column":85}},"11":{"start":{"line":85,"column":8},"end":{"line":85,"column":67}},"12":{"start":{"line":86,"column":8},"end":{"line":86,"column":19}},"13":{"start":{"line":98,"column":8},"end":{"line":98,"column":96}},"14":{"start":{"line":99,"column":8},"end":{"line":99,"column":70}},"15":{"start":{"line":100,"column":8},"end":{"line":100,"column":66}},"16":{"start":{"line":101,"column":8},"end":{"line":101,"column":48}},"17":{"start":{"line":102,"column":8},"end":{"line":102,"column":25}},"18":{"start":{"line":126,"column":8},"end":{"line":126,"column":62}},"19":{"start":{"line":127,"column":8},"end":{"line":127,"column":93}},"20":{"start":{"line":129,"column":8},"end":{"line":129,"column":4927}},"21":{"start":{"line":136,"column":8},"end":{"line":136,"column":5120}},"22":{"start":{"line":142,"column":8},"end":{"line":142,"column":5330}},"23":{"start":{"line":150,"column":8},"end":{"line":150,"column":70}},"24":{"start":{"line":151,"column":8},"end":{"line":151,"column":5640}},"25":{"start":{"line":155,"column":8},"end":{"line":155,"column":25}},"26":{"start":{"line":169,"column":8},"end":{"line":169,"column":62}},"27":{"start":{"line":170,"column":8},"end":{"line":170,"column":65}},"28":{"start":{"line":171,"column":8},"end":{"line":171,"column":57}},"29":{"start":{"line":173,"column":8},"end":{"line":173,"column":49}},"30":{"start":{"line":174,"column":8},"end":{"line":174,"column":102}},"31":{"start":{"line":175,"column":8},"end":{"line":175,"column":76}},"32":{"start":{"line":176,"column":8},"end":{"line":176,"column":108}},"33":{"start":{"line":177,"column":8},"end":{"line":177,"column":6856}},"34":{"start":{"line":181,"column":8},"end":{"line":181,"column":25}},"35":{"start":{"line":190,"column":8},"end":{"line":190,"column":92}}},"branchMap":{"1":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":8},"end":{"line":63,"column":8}},{"start":{"line":63,"column":8},"end":{"line":63,"column":8}}]},"2":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":66,"column":8}},{"start":{"line":66,"column":8},"end":{"line":66,"column":8}}]},"3":{"line":72,"type":"if","locations":[{"start":{"line":72,"column":12},"end":{"line":72,"column":12}},{"start":{"line":72,"column":12},"end":{"line":72,"column":12}}]},"4":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":16},"end":{"line":73,"column":16}},{"start":{"line":73,"column":16},"end":{"line":73,"column":16}}]},"5":{"line":81,"type":"if","locations":[{"start":{"line":81,"column":12},"end":{"line":81,"column":12}},{"start":{"line":81,"column":12},"end":{"line":81,"column":12}}]},"6":{"line":82,"type":"if","locations":[{"start":{"line":82,"column":16},"end":{"line":82,"column":16}},{"start":{"line":82,"column":16},"end":{"line":82,"column":16}}]},"7":{"line":126,"type":"if","locations":[{"start":{"line":126,"column":8},"end":{"line":126,"column":8}},{"start":{"line":126,"column":8},"end":{"line":126,"column":8}}]},"8":{"line":169,"type":"if","locations":[{"start":{"line":169,"column":8},"end":{"line":169,"column":8}},{"start":{"line":169,"column":8},"end":{"line":169,"column":8}}]}}}, +"contracts/universalSchemes/UniversalScheme.sol":{"l":{"13":57,"15":57},"path":"/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/UniversalScheme.sol","s":{"1":57,"2":57},"b":{"1":[57,0]},"f":{"1":57},"fnMap":{"1":{"name":"getParametersFromController","line":12,"loc":{"start":{"line":12,"column":4},"end":{"line":12,"column":85}}}},"statementMap":{"1":{"start":{"line":13,"column":8},"end":{"line":13,"column":419}},"2":{"start":{"line":15,"column":8},"end":{"line":15,"column":95}}},"branchMap":{"1":{"line":13,"type":"if","locations":[{"start":{"line":13,"column":8},"end":{"line":13,"column":8}},{"start":{"line":13,"column":8},"end":{"line":13,"column":8}}]}}}, +"contracts/universalSchemes/UniversalSchemeInterface.sol":{"l":{},"path":"/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/UniversalSchemeInterface.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/universalSchemes/UpgradeScheme.sol":{"l":{"60":5,"61":5,"62":5,"63":5,"64":5,"66":5,"69":4,"71":4,"72":1,"76":4,"77":3,"78":3,"81":3,"82":2,"86":5,"87":5,"98":9,"99":9,"100":9,"101":9,"115":3,"116":3,"117":3,"122":3,"123":3,"130":3,"134":3,"154":4,"155":4,"156":4,"157":4,"159":4,"164":4,"166":4,"174":4,"178":4,"189":18},"path":"/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/UpgradeScheme.sol","s":{"1":5,"2":5,"3":5,"4":5,"5":5,"6":4,"7":4,"8":1,"9":4,"10":3,"11":3,"12":3,"13":2,"14":5,"15":5,"16":9,"17":9,"18":9,"19":9,"20":3,"21":3,"22":3,"23":3,"24":3,"25":3,"26":3,"27":4,"28":4,"29":4,"30":4,"31":4,"32":4,"33":4,"34":4,"35":4,"36":18},"b":{"1":[5,0],"2":[4,1],"3":[1,3],"4":[1,0],"5":[3,1],"6":[3,0],"7":[2,1],"8":[2,0],"9":[4,0]},"f":{"1":5,"2":9,"3":3,"4":4,"5":18},"fnMap":{"1":{"name":"executeProposal","line":59,"loc":{"start":{"line":59,"column":103},"end":{"line":59,"column":17}}},"2":{"name":"setParameters","line":93,"loc":{"start":{"line":93,"column":4},"end":{"line":97,"column":5}}},"3":{"name":"proposeUpgrade","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":114,"column":5}}},"4":{"name":"proposeChangeUpgradingScheme","line":145,"loc":{"start":{"line":145,"column":4},"end":{"line":153,"column":5}}},"5":{"name":"getParametersHash","line":184,"loc":{"start":{"line":184,"column":4},"end":{"line":188,"column":5}}}},"statementMap":{"1":{"start":{"line":60,"column":8},"end":{"line":60,"column":69}},"2":{"start":{"line":61,"column":8},"end":{"line":61,"column":94}},"3":{"start":{"line":62,"column":8},"end":{"line":62,"column":42}},"4":{"start":{"line":64,"column":8},"end":{"line":64,"column":58}},"5":{"start":{"line":66,"column":8},"end":{"line":66,"column":2710}},"6":{"start":{"line":69,"column":12},"end":{"line":69,"column":62}},"7":{"start":{"line":71,"column":12},"end":{"line":71,"column":2892}},"8":{"start":{"line":72,"column":16},"end":{"line":72,"column":86}},"9":{"start":{"line":76,"column":12},"end":{"line":76,"column":3078}},"10":{"start":{"line":77,"column":16},"end":{"line":77,"column":100}},"11":{"start":{"line":78,"column":16},"end":{"line":78,"column":3234}},"12":{"start":{"line":81,"column":16},"end":{"line":81,"column":3393}},"13":{"start":{"line":82,"column":20},"end":{"line":82,"column":70}},"14":{"start":{"line":86,"column":8},"end":{"line":86,"column":67}},"15":{"start":{"line":87,"column":8},"end":{"line":87,"column":19}},"16":{"start":{"line":98,"column":8},"end":{"line":98,"column":69}},"17":{"start":{"line":99,"column":8},"end":{"line":99,"column":54}},"18":{"start":{"line":100,"column":8},"end":{"line":100,"column":48}},"19":{"start":{"line":101,"column":8},"end":{"line":101,"column":25}},"20":{"start":{"line":115,"column":8},"end":{"line":115,"column":83}},"21":{"start":{"line":116,"column":8},"end":{"line":116,"column":103}},"22":{"start":{"line":117,"column":8},"end":{"line":117,"column":4742}},"23":{"start":{"line":122,"column":8},"end":{"line":122,"column":70}},"24":{"start":{"line":123,"column":8},"end":{"line":123,"column":4991}},"25":{"start":{"line":130,"column":8},"end":{"line":130,"column":5163}},"26":{"start":{"line":134,"column":8},"end":{"line":134,"column":25}},"27":{"start":{"line":154,"column":8},"end":{"line":154,"column":83}},"28":{"start":{"line":155,"column":8},"end":{"line":155,"column":49}},"29":{"start":{"line":156,"column":8},"end":{"line":156,"column":96}},"30":{"start":{"line":157,"column":8},"end":{"line":157,"column":86}},"31":{"start":{"line":159,"column":8},"end":{"line":159,"column":6243}},"32":{"start":{"line":164,"column":8},"end":{"line":164,"column":70}},"33":{"start":{"line":166,"column":8},"end":{"line":166,"column":6483}},"34":{"start":{"line":174,"column":8},"end":{"line":174,"column":6698}},"35":{"start":{"line":178,"column":8},"end":{"line":178,"column":25}},"36":{"start":{"line":189,"column":8},"end":{"line":189,"column":68}}},"branchMap":{"1":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":8},"end":{"line":62,"column":8}},{"start":{"line":62,"column":8},"end":{"line":62,"column":8}}]},"2":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":66,"column":8}},{"start":{"line":66,"column":8},"end":{"line":66,"column":8}}]},"3":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":12},"end":{"line":71,"column":12}},{"start":{"line":71,"column":12},"end":{"line":71,"column":12}}]},"4":{"line":72,"type":"if","locations":[{"start":{"line":72,"column":16},"end":{"line":72,"column":16}},{"start":{"line":72,"column":16},"end":{"line":72,"column":16}}]},"5":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":12},"end":{"line":76,"column":12}},{"start":{"line":76,"column":12},"end":{"line":76,"column":12}}]},"6":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":16},"end":{"line":78,"column":16}},{"start":{"line":78,"column":16},"end":{"line":78,"column":16}}]},"7":{"line":81,"type":"if","locations":[{"start":{"line":81,"column":16},"end":{"line":81,"column":16}},{"start":{"line":81,"column":16},"end":{"line":81,"column":16}}]},"8":{"line":82,"type":"if","locations":[{"start":{"line":82,"column":20},"end":{"line":82,"column":20}},{"start":{"line":82,"column":20},"end":{"line":82,"column":20}}]},"9":{"line":157,"type":"if","locations":[{"start":{"line":157,"column":8},"end":{"line":157,"column":8}},{"start":{"line":157,"column":8},"end":{"line":157,"column":8}}]}}}, +"contracts/universalSchemes/VoteInOrganizationScheme.sol":{"l":{"53":4,"55":4,"56":4,"57":4,"58":4,"59":4,"60":4,"62":4,"64":3,"65":3,"75":3,"77":4,"78":4,"92":11,"93":11,"94":11,"95":11,"117":5,"118":5,"119":5,"120":5,"121":5,"124":5,"126":5,"132":5,"141":5,"145":5,"159":22},"path":"/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/VoteInOrganizationScheme.sol","s":{"1":4,"2":4,"3":4,"4":4,"5":4,"6":4,"7":4,"8":3,"9":3,"10":3,"11":4,"12":4,"13":11,"14":11,"15":11,"16":11,"17":5,"18":5,"19":5,"20":5,"21":5,"22":5,"23":5,"24":5,"25":5,"26":5,"27":22},"b":{"1":[4,0],"2":[3,1],"3":[3,0],"4":[5,0],"5":[5,0]},"f":{"1":4,"2":11,"3":5,"4":22},"fnMap":{"1":{"name":"executeProposal","line":52,"loc":{"start":{"line":52,"column":103},"end":{"line":52,"column":17}}},"2":{"name":"setParameters","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":91,"column":5}}},"3":{"name":"proposeVote","line":108,"loc":{"start":{"line":108,"column":4},"end":{"line":116,"column":5}}},"4":{"name":"getParametersHash","line":154,"loc":{"start":{"line":154,"column":4},"end":{"line":158,"column":5}}}},"statementMap":{"1":{"start":{"line":53,"column":8},"end":{"line":53,"column":69}},"2":{"start":{"line":55,"column":8},"end":{"line":55,"column":91}},"3":{"start":{"line":56,"column":8},"end":{"line":56,"column":30}},"4":{"start":{"line":58,"column":8},"end":{"line":58,"column":58}},"5":{"start":{"line":59,"column":8},"end":{"line":59,"column":36}},"6":{"start":{"line":60,"column":8},"end":{"line":60,"column":20}},"7":{"start":{"line":62,"column":8},"end":{"line":62,"column":2538}},"8":{"start":{"line":64,"column":12},"end":{"line":64,"column":62}},"9":{"start":{"line":65,"column":12},"end":{"line":65,"column":2638}},"10":{"start":{"line":75,"column":12},"end":{"line":75,"column":27}},"11":{"start":{"line":77,"column":8},"end":{"line":77,"column":84}},"12":{"start":{"line":78,"column":8},"end":{"line":78,"column":19}},"13":{"start":{"line":92,"column":8},"end":{"line":92,"column":69}},"14":{"start":{"line":93,"column":8},"end":{"line":93,"column":54}},"15":{"start":{"line":94,"column":8},"end":{"line":94,"column":48}},"16":{"start":{"line":95,"column":8},"end":{"line":95,"column":25}},"17":{"start":{"line":117,"column":8},"end":{"line":117,"column":83}},"18":{"start":{"line":118,"column":8},"end":{"line":118,"column":49}},"19":{"start":{"line":119,"column":8},"end":{"line":119,"column":88}},"20":{"start":{"line":120,"column":8},"end":{"line":120,"column":91}},"21":{"start":{"line":121,"column":8},"end":{"line":121,"column":4776}},"22":{"start":{"line":124,"column":8},"end":{"line":124,"column":96}},"23":{"start":{"line":126,"column":8},"end":{"line":126,"column":4971}},"24":{"start":{"line":132,"column":8},"end":{"line":132,"column":5209}},"25":{"start":{"line":141,"column":8},"end":{"line":141,"column":5452}},"26":{"start":{"line":145,"column":8},"end":{"line":145,"column":25}},"27":{"start":{"line":159,"column":8},"end":{"line":159,"column":65}}},"branchMap":{"1":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":8},"end":{"line":56,"column":8}},{"start":{"line":56,"column":8},"end":{"line":56,"column":8}}]},"2":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":8},"end":{"line":62,"column":8}},{"start":{"line":62,"column":8},"end":{"line":62,"column":8}}]},"3":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":12},"end":{"line":75,"column":12}},{"start":{"line":75,"column":12},"end":{"line":75,"column":12}}]},"4":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":8},"end":{"line":120,"column":8}},{"start":{"line":120,"column":8},"end":{"line":120,"column":8}}]},"5":{"line":121,"type":"if","locations":[{"start":{"line":121,"column":8},"end":{"line":121,"column":8}},{"start":{"line":121,"column":8},"end":{"line":121,"column":8}}]}}}, +"contracts/utils/DAOTracker.sol":{"l":{"39":302,"41":298,"45":298,"47":298,"67":298,"68":298,"70":296,"90":4,"91":2,"92":2,"103":1,"104":1,"105":1},"path":"/home/blackjak/Projects/DXdao/arc/contracts/utils/DAOTracker.sol","s":{"1":302,"2":298,"3":298,"4":298,"5":296,"6":4,"7":2,"8":2,"9":1,"10":1,"11":1},"b":{"1":[298,4],"2":[298,0],"3":[298,0],"4":[296,2],"5":[2,2],"6":[1,0]},"f":{"1":302,"2":298,"3":298,"4":4,"5":1},"fnMap":{"1":{"name":"onlyAvatarOwner","line":38,"loc":{"start":{"line":38,"column":4},"end":{"line":38,"column":41}}},"2":{"name":"notBlacklisted","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":44,"column":40}}},"3":{"name":"track","line":64,"loc":{"start":{"line":64,"column":26},"end":{"line":64,"column":3}}},"4":{"name":"blacklist","line":89,"loc":{"start":{"line":89,"column":12},"end":{"line":89,"column":3}}},"5":{"name":"reset","line":102,"loc":{"start":{"line":102,"column":12},"end":{"line":102,"column":3}}}},"statementMap":{"1":{"start":{"line":39,"column":8},"end":{"line":39,"column":1065}},"2":{"start":{"line":45,"column":8},"end":{"line":45,"column":1227}},"3":{"start":{"line":67,"column":8},"end":{"line":67,"column":36}},"4":{"start":{"line":68,"column":8},"end":{"line":68,"column":44}},"5":{"start":{"line":70,"column":8},"end":{"line":70,"column":2453}},"6":{"start":{"line":90,"column":8},"end":{"line":90,"column":36}},"7":{"start":{"line":91,"column":8},"end":{"line":91,"column":43}},"8":{"start":{"line":92,"column":8},"end":{"line":92,"column":61}},"9":{"start":{"line":103,"column":8},"end":{"line":103,"column":36}},"10":{"start":{"line":104,"column":8},"end":{"line":104,"column":44}},"11":{"start":{"line":105,"column":8},"end":{"line":105,"column":57}}},"branchMap":{"1":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":8},"end":{"line":39,"column":8}},{"start":{"line":39,"column":8},"end":{"line":39,"column":8}}]},"2":{"line":45,"type":"if","locations":[{"start":{"line":45,"column":8},"end":{"line":45,"column":8}},{"start":{"line":45,"column":8},"end":{"line":45,"column":8}}]},"3":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":8},"end":{"line":67,"column":8}},{"start":{"line":67,"column":8},"end":{"line":67,"column":8}}]},"4":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":8},"end":{"line":68,"column":8}},{"start":{"line":68,"column":8},"end":{"line":68,"column":8}}]},"5":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":8},"end":{"line":90,"column":8}},{"start":{"line":90,"column":8},"end":{"line":90,"column":8}}]},"6":{"line":103,"type":"if","locations":[{"start":{"line":103,"column":8},"end":{"line":103,"column":8}},{"start":{"line":103,"column":8},"end":{"line":103,"column":8}}]}}}, +"contracts/utils/Redeemer.sol":{"l":{"57":6,"58":6,"60":6,"62":6,"63":4,"112":6,"113":6,"115":6,"117":6,"118":4,"133":12,"135":12,"139":6,"141":12,"142":12,"144":12,"145":12,"146":10,"149":12,"150":12,"158":4,"159":4,"160":4,"161":4,"162":4,"163":4,"164":4,"165":4,"166":4,"167":0,"169":4,"171":4,"172":4,"173":4,"175":4,"177":0,"179":4,"186":4,"187":4,"188":4,"189":4,"190":4,"191":4,"192":4,"193":0,"195":4,"197":4,"199":4,"201":0,"203":4},"path":"/home/blackjak/Projects/DXdao/arc/contracts/utils/Redeemer.sol","s":{"1":6,"2":6,"3":6,"4":6,"5":4,"6":6,"7":6,"8":6,"9":6,"10":4,"11":12,"12":12,"13":6,"14":12,"15":12,"16":12,"17":12,"18":10,"19":12,"20":12,"21":4,"22":4,"23":4,"24":4,"25":4,"26":4,"27":4,"28":4,"29":4,"30":0,"31":4,"32":4,"33":4,"34":4,"35":4,"36":0,"37":4,"38":4,"39":4,"40":4,"41":4,"42":4,"43":4,"44":4,"45":0,"46":4,"47":4,"48":4,"49":0,"50":4},"b":{"1":[6,0],"2":[4,2],"3":[6,0],"4":[4,2],"5":[6,6],"6":[12,0],"7":[10,2],"8":[0,4],"9":[4,0],"10":[0,4],"11":[4,0]},"f":{"1":6,"2":6,"3":12,"4":4,"5":4},"fnMap":{"1":{"name":"redeem","line":42,"loc":{"start":{"line":42,"column":4},"end":{"line":56,"column":5}}},"2":{"name":"redeemFromCRExt","line":98,"loc":{"start":{"line":98,"column":4},"end":{"line":111,"column":5}}},"3":{"name":"genesisProtocolRedeem","line":124,"loc":{"start":{"line":124,"column":4},"end":{"line":132,"column":42}}},"4":{"name":"contributionRewardRedeem","line":154,"loc":{"start":{"line":154,"column":4},"end":{"line":157,"column":5}}},"5":{"name":"contributionRewardExtRedeem","line":182,"loc":{"start":{"line":182,"column":4},"end":{"line":185,"column":5}}}},"statementMap":{"1":{"start":{"line":57,"column":8},"end":{"line":57,"column":35}},"2":{"start":{"line":58,"column":8},"end":{"line":58,"column":2693}},"3":{"start":{"line":60,"column":8},"end":{"line":60,"column":2792}},"4":{"start":{"line":62,"column":12},"end":{"line":62,"column":2903}},"5":{"start":{"line":63,"column":16},"end":{"line":63,"column":3076}},"6":{"start":{"line":112,"column":8},"end":{"line":112,"column":35}},"7":{"start":{"line":113,"column":8},"end":{"line":113,"column":5596}},"8":{"start":{"line":115,"column":8},"end":{"line":115,"column":5695}},"9":{"start":{"line":117,"column":12},"end":{"line":117,"column":5809}},"10":{"start":{"line":118,"column":16},"end":{"line":118,"column":5970}},"11":{"start":{"line":133,"column":8},"end":{"line":133,"column":82}},"12":{"start":{"line":135,"column":8},"end":{"line":135,"column":6568}},"13":{"start":{"line":139,"column":12},"end":{"line":139,"column":59}},"14":{"start":{"line":141,"column":8},"end":{"line":141,"column":51}},"15":{"start":{"line":142,"column":8},"end":{"line":142,"column":6983}},"16":{"start":{"line":144,"column":12},"end":{"line":144,"column":73}},"17":{"start":{"line":145,"column":12},"end":{"line":145,"column":7215}},"18":{"start":{"line":146,"column":16},"end":{"line":146,"column":7354}},"19":{"start":{"line":149,"column":12},"end":{"line":149,"column":66}},"20":{"start":{"line":150,"column":12},"end":{"line":150,"column":40}},"21":{"start":{"line":158,"column":8},"end":{"line":158,"column":35}},"22":{"start":{"line":159,"column":8},"end":{"line":159,"column":29}},"23":{"start":{"line":160,"column":8},"end":{"line":160,"column":29}},"24":{"start":{"line":161,"column":8},"end":{"line":161,"column":100}},"25":{"start":{"line":162,"column":8},"end":{"line":162,"column":99}},"26":{"start":{"line":163,"column":8},"end":{"line":163,"column":119}},"27":{"start":{"line":164,"column":8},"end":{"line":164,"column":114}},"28":{"start":{"line":165,"column":8},"end":{"line":165,"column":46}},"29":{"start":{"line":166,"column":8},"end":{"line":166,"column":8402}},"30":{"start":{"line":167,"column":12},"end":{"line":167,"column":34}},"31":{"start":{"line":169,"column":12},"end":{"line":169,"column":33}},"32":{"start":{"line":171,"column":8},"end":{"line":171,"column":91}},"33":{"start":{"line":172,"column":8},"end":{"line":172,"column":66}},"34":{"start":{"line":173,"column":8},"end":{"line":173,"column":8739}},"35":{"start":{"line":175,"column":12},"end":{"line":175,"column":34}},"36":{"start":{"line":177,"column":12},"end":{"line":177,"column":33}},"37":{"start":{"line":179,"column":8},"end":{"line":179,"column":117}},"38":{"start":{"line":186,"column":8},"end":{"line":186,"column":35}},"39":{"start":{"line":187,"column":8},"end":{"line":187,"column":29}},"40":{"start":{"line":188,"column":8},"end":{"line":188,"column":29}},"41":{"start":{"line":189,"column":8},"end":{"line":189,"column":84}},"42":{"start":{"line":190,"column":8},"end":{"line":190,"column":104}},"43":{"start":{"line":191,"column":8},"end":{"line":191,"column":99}},"44":{"start":{"line":192,"column":8},"end":{"line":192,"column":9740}},"45":{"start":{"line":193,"column":12},"end":{"line":193,"column":34}},"46":{"start":{"line":195,"column":12},"end":{"line":195,"column":33}},"47":{"start":{"line":197,"column":8},"end":{"line":197,"column":9938}},"48":{"start":{"line":199,"column":12},"end":{"line":199,"column":34}},"49":{"start":{"line":201,"column":12},"end":{"line":201,"column":33}},"50":{"start":{"line":203,"column":8},"end":{"line":203,"column":111}}},"branchMap":{"1":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":8},"end":{"line":60,"column":8}},{"start":{"line":60,"column":8},"end":{"line":60,"column":8}}]},"2":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":12},"end":{"line":62,"column":12}},{"start":{"line":62,"column":12},"end":{"line":62,"column":12}}]},"3":{"line":115,"type":"if","locations":[{"start":{"line":115,"column":8},"end":{"line":115,"column":8}},{"start":{"line":115,"column":8},"end":{"line":115,"column":8}}]},"4":{"line":117,"type":"if","locations":[{"start":{"line":117,"column":12},"end":{"line":117,"column":12}},{"start":{"line":117,"column":12},"end":{"line":117,"column":12}}]},"5":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":8},"end":{"line":135,"column":8}},{"start":{"line":135,"column":8},"end":{"line":135,"column":8}}]},"6":{"line":142,"type":"if","locations":[{"start":{"line":142,"column":8},"end":{"line":142,"column":8}},{"start":{"line":142,"column":8},"end":{"line":142,"column":8}}]},"7":{"line":145,"type":"if","locations":[{"start":{"line":145,"column":12},"end":{"line":145,"column":12}},{"start":{"line":145,"column":12},"end":{"line":145,"column":12}}]},"8":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":8},"end":{"line":166,"column":8}},{"start":{"line":166,"column":8},"end":{"line":166,"column":8}}]},"9":{"line":173,"type":"if","locations":[{"start":{"line":173,"column":8},"end":{"line":173,"column":8}},{"start":{"line":173,"column":8},"end":{"line":173,"column":8}}]},"10":{"line":192,"type":"if","locations":[{"start":{"line":192,"column":8},"end":{"line":192,"column":8}},{"start":{"line":192,"column":8},"end":{"line":192,"column":8}}]},"11":{"line":197,"type":"if","locations":[{"start":{"line":197,"column":8},"end":{"line":197,"column":8}},{"start":{"line":197,"column":8},"end":{"line":197,"column":8}}]}}}, +"contracts/utils/RepAllocation.sol":{"l":{"26":33,"28":31,"29":30,"30":30,"39":1,"40":1,"41":2,"50":1,"58":5},"path":"/home/blackjak/Projects/DXdao/arc/contracts/utils/RepAllocation.sol","s":{"1":33,"2":31,"3":30,"4":30,"5":1,"6":1,"7":2,"8":1,"9":5},"b":{"1":[31,2],"2":[30,1],"3":[1,0]},"f":{"1":33,"2":1,"3":1,"4":5},"fnMap":{"1":{"name":"addBeneficiary","line":25,"loc":{"start":{"line":25,"column":82},"end":{"line":25,"column":3}}},"2":{"name":"addBeneficiaries","line":38,"loc":{"start":{"line":38,"column":105},"end":{"line":38,"column":3}}},"3":{"name":"freeze","line":49,"loc":{"start":{"line":49,"column":37},"end":{"line":49,"column":3}}},"4":{"name":"balanceOf","line":57,"loc":{"start":{"line":57,"column":4},"end":{"line":57,"column":71}}}},"statementMap":{"1":{"start":{"line":26,"column":8},"end":{"line":26,"column":68}},"2":{"start":{"line":28,"column":8},"end":{"line":28,"column":864}},"3":{"start":{"line":29,"column":12},"end":{"line":29,"column":56}},"4":{"start":{"line":30,"column":12},"end":{"line":30,"column":63}},"5":{"start":{"line":39,"column":8},"end":{"line":39,"column":56}},"6":{"start":{"line":40,"column":8},"end":{"line":40,"column":1326}},"7":{"start":{"line":41,"column":12},"end":{"line":41,"column":57}},"8":{"start":{"line":50,"column":8},"end":{"line":50,"column":22}},"9":{"start":{"line":58,"column":8},"end":{"line":58,"column":50}}},"branchMap":{"1":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":8},"end":{"line":26,"column":8}},{"start":{"line":26,"column":8},"end":{"line":26,"column":8}}]},"2":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":8},"end":{"line":28,"column":8}},{"start":{"line":28,"column":8},"end":{"line":28,"column":8}}]},"3":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":8},"end":{"line":39,"column":8}},{"start":{"line":39,"column":8},"end":{"line":39,"column":8}}]}}}, +"contracts/votingMachines/VotingMachineCallbacks.sol":{"l":{"15":120,"16":110,"27":13,"28":13,"29":0,"31":13,"39":18,"40":18,"41":0,"43":18,"55":1,"56":1,"57":0,"59":1,"63":5,"64":5,"65":0,"67":5,"71":108,"72":108,"73":0,"75":108,"79":81,"80":81,"81":0,"83":81},"path":"/home/blackjak/Projects/DXdao/arc/contracts/votingMachines/VotingMachineCallbacks.sol","s":{"1":120,"2":13,"3":13,"4":0,"5":13,"6":18,"7":18,"8":0,"9":18,"10":1,"11":1,"12":0,"13":1,"14":5,"15":5,"16":0,"17":5,"18":108,"19":108,"20":0,"21":108,"22":81,"23":81,"24":0,"25":81},"b":{"1":[110,10],"2":[0,13],"3":[0,18],"4":[0,1],"5":[0,5],"6":[0,108],"7":[0,81]},"f":{"1":120,"2":13,"3":18,"4":1,"5":5,"6":108,"7":81},"fnMap":{"1":{"name":"onlyVotingMachine","line":14,"loc":{"start":{"line":14,"column":4},"end":{"line":14,"column":49}}},"2":{"name":"mintReputation","line":24,"loc":{"start":{"line":24,"column":33},"end":{"line":26,"column":5}}},"3":{"name":"burnReputation","line":36,"loc":{"start":{"line":36,"column":33},"end":{"line":38,"column":5}}},"4":{"name":"stakingTokenTransfer","line":52,"loc":{"start":{"line":52,"column":33},"end":{"line":54,"column":5}}},"5":{"name":"balanceOfStakingToken","line":62,"loc":{"start":{"line":62,"column":4},"end":{"line":62,"column":106}}},"6":{"name":"getTotalReputationSupply","line":70,"loc":{"start":{"line":70,"column":4},"end":{"line":70,"column":87}}},"7":{"name":"reputationOf","line":78,"loc":{"start":{"line":78,"column":4},"end":{"line":78,"column":91}}}},"statementMap":{"1":{"start":{"line":15,"column":8},"end":{"line":15,"column":105}},"2":{"start":{"line":27,"column":8},"end":{"line":27,"column":69}},"3":{"start":{"line":28,"column":8},"end":{"line":28,"column":922}},"4":{"start":{"line":29,"column":12},"end":{"line":29,"column":24}},"5":{"start":{"line":31,"column":8},"end":{"line":31,"column":96}},"6":{"start":{"line":39,"column":8},"end":{"line":39,"column":69}},"7":{"start":{"line":40,"column":8},"end":{"line":40,"column":1329}},"8":{"start":{"line":41,"column":12},"end":{"line":41,"column":24}},"9":{"start":{"line":43,"column":8},"end":{"line":43,"column":96}},"10":{"start":{"line":55,"column":8},"end":{"line":55,"column":69}},"11":{"start":{"line":56,"column":8},"end":{"line":56,"column":1797}},"12":{"start":{"line":57,"column":12},"end":{"line":57,"column":24}},"13":{"start":{"line":59,"column":8},"end":{"line":59,"column":109}},"14":{"start":{"line":63,"column":8},"end":{"line":63,"column":69}},"15":{"start":{"line":64,"column":8},"end":{"line":64,"column":2168}},"16":{"start":{"line":65,"column":12},"end":{"line":65,"column":20}},"17":{"start":{"line":67,"column":8},"end":{"line":67,"column":55}},"18":{"start":{"line":71,"column":8},"end":{"line":71,"column":77}},"19":{"start":{"line":72,"column":8},"end":{"line":72,"column":2509}},"20":{"start":{"line":73,"column":12},"end":{"line":73,"column":20}},"21":{"start":{"line":75,"column":8},"end":{"line":75,"column":85}},"22":{"start":{"line":79,"column":8},"end":{"line":79,"column":77}},"23":{"start":{"line":80,"column":8},"end":{"line":80,"column":2854}},"24":{"start":{"line":81,"column":12},"end":{"line":81,"column":20}},"25":{"start":{"line":83,"column":8},"end":{"line":83,"column":91}}},"branchMap":{"1":{"line":15,"type":"if","locations":[{"start":{"line":15,"column":8},"end":{"line":15,"column":8}},{"start":{"line":15,"column":8},"end":{"line":15,"column":8}}]},"2":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":8},"end":{"line":28,"column":8}},{"start":{"line":28,"column":8},"end":{"line":28,"column":8}}]},"3":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":8},"end":{"line":40,"column":8}},{"start":{"line":40,"column":8},"end":{"line":40,"column":8}}]},"4":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":8},"end":{"line":56,"column":8}},{"start":{"line":56,"column":8},"end":{"line":56,"column":8}}]},"5":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"6":{"line":72,"type":"if","locations":[{"start":{"line":72,"column":8},"end":{"line":72,"column":8}},{"start":{"line":72,"column":8},"end":{"line":72,"column":8}}]},"7":{"line":80,"type":"if","locations":[{"start":{"line":80,"column":8},"end":{"line":80,"column":8}},{"start":{"line":80,"column":8},"end":{"line":80,"column":8}}]}}}} diff --git a/coverage/globalConstraints/GlobalConstraintInterface.sol.html b/coverage/globalConstraints/GlobalConstraintInterface.sol.html new file mode 100644 index 00000000..4e998f06 --- /dev/null +++ b/coverage/globalConstraints/GlobalConstraintInterface.sol.html @@ -0,0 +1,110 @@ + + + + Code coverage report for globalConstraints/GlobalConstraintInterface.sol + + + + + + + +
+
+

+ all files / globalConstraints/ GlobalConstraintInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+ 
+contract GlobalConstraintInterface {
+ 
+    enum CallPhase { Pre, Post, PreAndPost }
+ 
+    function pre( address _scheme, bytes32 _params, bytes32 _method ) public returns(bool);
+    function post( address _scheme, bytes32 _params, bytes32 _method ) public returns(bool);
+    /**
+     * @dev when return if this globalConstraints is pre, post or both.
+     * @return CallPhase enum indication  Pre, Post or PreAndPost.
+     */
+    function when() public returns(CallPhase);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/globalConstraints/TokenCapGC.sol.html b/coverage/globalConstraints/TokenCapGC.sol.html new file mode 100644 index 00000000..4c814d51 --- /dev/null +++ b/coverage/globalConstraints/TokenCapGC.sol.html @@ -0,0 +1,287 @@ + + + + Code coverage report for globalConstraints/TokenCapGC.sol + + + + + + + +
+
+

+ all files / globalConstraints/ TokenCapGC.sol +

+
+
+ 100% + Statements + 10/10 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  + +  + +  +  +  +  +  +  +  + +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
+import "./GlobalConstraintInterface.sol";
+ 
+ 
+/**
+ * @title Token Cap Global Constraint
+ * @dev A simple global constraint to cap the number of tokens.
+ */
+ 
+contract TokenCapGC {
+    // A set of parameters, on which the cap will be checked:
+    struct Parameters {
+        IERC20 token;
+        uint256 cap;
+    }
+ 
+    // Mapping from the hash of the parameters to the parameters themselves:
+    mapping (bytes32=>Parameters) public parameters;
+ 
+    /**
+     * @dev adding a new set of parameters
+     * @param  _token the token to add to the params.
+     * @param _cap the cap to check the total supply against.
+     * @return the calculated parameters hash
+     */
+    function setParameters(IERC20 _token, uint256 _cap) public returns(bytes32) {
+        bytes32 paramsHash = getParametersHash(_token, _cap);
+        parameters[paramsHash].token = _token;
+        parameters[paramsHash].cap = _cap;
+        return paramsHash;
+    }
+ 
+    /**
+     * @dev calculate and returns the hash of the given parameters
+     * @param  _token the token to add to the params.
+     * @param _cap the cap to check the total supply against.
+     * @return the calculated parameters hash
+     */
+    function getParametersHash(IERC20 _token, uint256 _cap) public pure returns(bytes32) {
+        return (keccak256(abi.encodePacked(_token, _cap)));
+    }
+ 
+    /**
+     * @dev check the constraint after the action.
+     * This global constraint only checks the state after the action, so here we just return true:
+     * @return true
+     */
+    function pre(address, bytes32, bytes32) public pure returns(bool) {
+        return true;
+    }
+ 
+    /**
+     * @dev check the total supply cap.
+     * @param  _paramsHash the parameters hash to check the total supply cap against.
+     * @return bool which represents a success
+     */
+    function post(address, bytes32 _paramsHash, bytes32) public view returns(bool) {
+        if ((parameters[_paramsHash].token != IERC20(0)) &&
+            (parameters[_paramsHash].token.totalSupply() > parameters[_paramsHash].cap)) {
+            return false;
+        }
+        return true;
+    }
+ 
+    /**
+     * @dev when return if this globalConstraints is pre, post or both.
+     * @return CallPhase enum indication  Pre, Post or PreAndPost.
+     */
+    function when() public pure returns(GlobalConstraintInterface.CallPhase) {
+        return GlobalConstraintInterface.CallPhase.Post;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/globalConstraints/index.html b/coverage/globalConstraints/index.html new file mode 100644 index 00000000..2e2826cb --- /dev/null +++ b/coverage/globalConstraints/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for globalConstraints/ + + + + + + + +
+
+

+ all files globalConstraints/ +

+
+
+ 100% + Statements + 10/10 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 10/10 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
GlobalConstraintInterface.sol
100%0/0100%0/0100%0/0100%0/0
TokenCapGC.sol
100%10/10100%2/2100%5/5100%10/10
+
+
+ + + + + + + diff --git a/coverage/index.html b/coverage/index.html new file mode 100644 index 00000000..7a0d012b --- /dev/null +++ b/coverage/index.html @@ -0,0 +1,171 @@ + + + + Code coverage report for All files + + + + + + + +
+
+

+ / +

+
+
+ 98.58% + Statements + 1181/1198 +
+
+ 74.87% + Branches + 572/764 +
+
+ 98.57% + Functions + 207/210 +
+
+ 98.61% + Lines + 1209/1226 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
controller/
99.26%134/13575%54/7297.67%42/4399.33%148/149
globalConstraints/
100%10/10100%2/2100%5/5100%10/10
libs/
100%13/1350%10/20100%3/3100%13/13
schemes/
99.07%638/64476.55%346/45297.85%91/9399.08%645/651
universalSchemes/
100%301/30175%123/164100%45/45100%305/305
utils/
94.29%66/7072.5%29/40100%14/1494.44%68/72
votingMachines/
76%19/2557.14%8/14100%7/776.92%20/26
+
+
+ + + + + + + diff --git a/coverage/lcov-report/base.css b/coverage/lcov-report/base.css new file mode 100644 index 00000000..29737bcb --- /dev/null +++ b/coverage/lcov-report/base.css @@ -0,0 +1,213 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.medium .chart { border:1px solid #f9cd0b; } +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } +/* light gray */ +span.cline-neutral { background: #eaeaea; } + +.cbranch-no { background: yellow !important; color: #111; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/coverage/lcov-report/controller/Avatar.sol.html b/coverage/lcov-report/controller/Avatar.sol.html new file mode 100644 index 00000000..86a54974 --- /dev/null +++ b/coverage/lcov-report/controller/Avatar.sol.html @@ -0,0 +1,476 @@ + + + + Code coverage report for controller/Avatar.sol + + + + + + + +
+
+

+ all files / controller/ Avatar.sol +

+
+
+ 100% + Statements + 20/20 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 8/8 +
+
+ 100% + Lines + 20/20 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +383× +383× +383× +  +  +  +  +  +  +45× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× +23× +  +  +  +  +  +  +  +  +  +24× +22× +22× +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +291× +291× +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/Reputation.sol";
+import "./DAOToken.sol";
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
+import "../libs/SafeERC20.sol";
+ 
+ 
+/**
+ * @title An Avatar holds tokens, reputation and ether for a controller
+ */
+contract Avatar is Ownable {
+    using SafeERC20 for address;
+ 
+    string public orgName;
+    DAOToken public nativeToken;
+    Reputation public nativeReputation;
+ 
+    event GenericCall(address indexed _contract, bytes _data, uint _value, bool _success);
+    event SendEther(uint256 _amountInWei, address indexed _to);
+    event ExternalTokenTransfer(address indexed _externalToken, address indexed _to, uint256 _value);
+    event ExternalTokenTransferFrom(address indexed _externalToken, address _from, address _to, uint256 _value);
+    event ExternalTokenApproval(address indexed _externalToken, address _spender, uint256 _value);
+    event ReceiveEther(address indexed _sender, uint256 _value);
+    event MetaData(string _metaData);
+ 
+    /**
+    * @dev the constructor takes organization name, native token and reputation system
+    and creates an avatar for a controller
+    */
+    constructor(string memory _orgName, DAOToken _nativeToken, Reputation _nativeReputation) public {
+        orgName = _orgName;
+        nativeToken = _nativeToken;
+        nativeReputation = _nativeReputation;
+    }
+ 
+    /**
+    * @dev enables an avatar to receive ethers
+    */
+    function() external payable {
+        emit ReceiveEther(msg.sender, msg.value);
+    }
+ 
+    /**
+    * @dev perform a generic call to an arbitrary contract
+    * @param _contract  the contract's address to call
+    * @param _data ABI-encoded contract call to call `_contract` address.
+    * @param _value value (ETH) to transfer with the transaction
+    * @return bool    success or fail
+    *         bytes - the return bytes of the called contract's function.
+    */
+    function genericCall(address _contract, bytes memory _data, uint256 _value)
+    public
+    onlyOwner
+    returns(bool success, bytes memory returnValue) {
+      // solhint-disable-next-line avoid-call-value
+        (success, returnValue) = _contract.call.value(_value)(_data);
+        emit GenericCall(_contract, _data, _value, success);
+    }
+ 
+    /**
+    * @dev send ethers from the avatar's wallet
+    * @param _amountInWei amount to send in Wei units
+    * @param _to send the ethers to this address
+    * @return bool which represents success
+    */
+    function sendEther(uint256 _amountInWei, address payable _to) public onlyOwner returns(bool) {
+        _to.transfer(_amountInWei);
+        emit SendEther(_amountInWei, _to);
+        return true;
+    }
+ 
+    /**
+    * @dev external token transfer
+    * @param _externalToken the token contract
+    * @param _to the destination address
+    * @param _value the amount of tokens to transfer
+    * @return bool which represents success
+    */
+    function externalTokenTransfer(IERC20 _externalToken, address _to, uint256 _value)
+    public onlyOwner returns(bool)
+    {
+        address(_externalToken).safeTransfer(_to, _value);
+        emit ExternalTokenTransfer(address(_externalToken), _to, _value);
+        return true;
+    }
+ 
+    /**
+    * @dev external token transfer from a specific account
+    * @param _externalToken the token contract
+    * @param _from the account to spend token from
+    * @param _to the destination address
+    * @param _value the amount of tokens to transfer
+    * @return bool which represents success
+    */
+    function externalTokenTransferFrom(
+        IERC20 _externalToken,
+        address _from,
+        address _to,
+        uint256 _value
+    )
+    public onlyOwner returns(bool)
+    {
+        address(_externalToken).safeTransferFrom(_from, _to, _value);
+        emit ExternalTokenTransferFrom(address(_externalToken), _from, _to, _value);
+        return true;
+    }
+ 
+    /**
+    * @dev externalTokenApproval approve the spender address to spend a specified amount of tokens
+    *      on behalf of msg.sender.
+    * @param _externalToken the address of the Token Contract
+    * @param _spender address
+    * @param _value the amount of ether (in Wei) which the approval is referring to.
+    * @return bool which represents a success
+    */
+    function externalTokenApproval(IERC20 _externalToken, address _spender, uint256 _value)
+    public onlyOwner returns(bool)
+    {
+        address(_externalToken).safeApprove(_spender, _value);
+        emit ExternalTokenApproval(address(_externalToken), _spender, _value);
+        return true;
+    }
+ 
+    /**
+    * @dev metaData emits an event with a string, should contain the hash of some meta data.
+    * @param _metaData a string representing a hash of the meta data
+    * @return bool which represents a success
+    */
+    function metaData(string memory _metaData) public onlyOwner returns(bool) {
+        emit MetaData(_metaData);
+        return true;
+    }
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/controller/Controller.sol.html b/coverage/lcov-report/controller/Controller.sol.html new file mode 100644 index 00000000..d2cd048b --- /dev/null +++ b/coverage/lcov-report/controller/Controller.sol.html @@ -0,0 +1,1739 @@ + + + + Code coverage report for controller/Controller.sol + + + + + + + +
+
+

+ all files / controller/ Controller.sol +

+
+
+ 99.07% + Statements + 107/108 +
+
+ 73.53% + Branches + 50/68 +
+
+ 96.97% + Functions + 32/33 +
+
+ 99.18% + Lines + 121/122 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +354× +354× +354× +354× +354× +  +  +  +  +  +  +  +  +  +  +316× +316× +  +  +  +1887× +1885× +  +  +  +37× +37× +  +  +  + + +  +  +  +21× +21× +  +  +  +290× +290× +  +  +  +2222× +2222× +16× +  +  +  +2207× +1979× + +  +  +  +  +  +  +2778× +2776× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +168× +168× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +22× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +79× +79× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +923× +  +  +  +  +  +923× +  +  +923× +  +  +923× +923× +923× +923× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +956× + +  +  +955× +  +  +731× +731× +731× +  +  +  +  +  +  +  +33× + +  +32× +32× +32× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +25× +  +22× +20× +20× +  +  + +  +  +25× +  +21× +19× +19× +  +  + +  +  +25× +25× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +12× +12× +  +12× +  +12× +12× +12× + + + +  +12× +12× +12× +  +  +12× +  +11× +11× +11× + + + +  +11× +11× +11× +  +  +12× +12× +  +  +  +  +  +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + + + + + +  + + + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +11× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +290× +  +  +  +  +  +  +  +  + +  +  +  +90× +  +  +  +  +  +  +  +  +57× +  +  +  +  +  +  +  +  + +  +  +  +  + +  + + +  +  + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +38× +  +  +  +  +  +  +  +  +14× +  +  +  +  +1079× +  +  + 
pragma solidity 0.5.17;
+ 
+import "./Avatar.sol";
+import "../globalConstraints/GlobalConstraintInterface.sol";
+ 
+/**
+ * @title Controller contract
+ * @dev A controller controls the organizations tokens, reputation and avatar.
+ * It is subject to a set of schemes and constraints that determine its behavior.
+ * Each scheme has it own parameters and operation permissions.
+ */
+contract Controller {
+ 
+    struct Scheme {
+        bytes32 paramsHash;  // a hash "configuration" of the scheme
+        bytes4  permissions; // A bitwise flags of permissions,
+                             // All 0: Not registered,
+                             // 1st bit: Flag if the scheme is registered,
+                             // 2nd bit: Scheme can register other schemes
+                             // 3rd bit: Scheme can add/remove global constraints
+                             // 4th bit: Scheme can upgrade the controller
+                             // 5th bit: Scheme can call genericCall on behalf of
+                             //          the organization avatar
+    }
+ 
+    struct GlobalConstraint {
+        address gcAddress;
+        bytes32 params;
+    }
+ 
+    struct GlobalConstraintRegister {
+        bool isRegistered; //is registered
+        uint256 index;    //index at globalConstraints
+    }
+ 
+    mapping(address=>Scheme) public schemes;
+ 
+    Avatar public avatar;
+    DAOToken public nativeToken;
+    Reputation public nativeReputation;
+  // newController will point to the new controller after the present controller is upgraded
+    address public newController;
+  // globalConstraintsPre that determine pre conditions for all actions on the controller
+ 
+    GlobalConstraint[] public globalConstraintsPre;
+  // globalConstraintsPost that determine post conditions for all actions on the controller
+    GlobalConstraint[] public globalConstraintsPost;
+  // globalConstraintsRegisterPre indicate if a globalConstraints is registered as a pre global constraint
+    mapping(address=>GlobalConstraintRegister) public globalConstraintsRegisterPre;
+  // globalConstraintsRegisterPost indicate if a globalConstraints is registered as a post global constraint
+    mapping(address=>GlobalConstraintRegister) public globalConstraintsRegisterPost;
+ 
+    event MintReputation (address indexed _sender, address indexed _to, uint256 _amount);
+    event BurnReputation (address indexed _sender, address indexed _from, uint256 _amount);
+    event MintTokens (address indexed _sender, address indexed _beneficiary, uint256 _amount);
+    event RegisterScheme (address indexed _sender, address indexed _scheme);
+    event UnregisterScheme (address indexed _sender, address indexed _scheme);
+    event UpgradeController(address indexed _oldController, address _newController);
+ 
+    event AddGlobalConstraint(
+        address indexed _globalConstraint,
+        bytes32 _params,
+        GlobalConstraintInterface.CallPhase _when);
+ 
+    event RemoveGlobalConstraint(address indexed _globalConstraint, uint256 _index, bool _isPre);
+ 
+    constructor( Avatar _avatar) public {
+        avatar = _avatar;
+        nativeToken = avatar.nativeToken();
+        nativeReputation = avatar.nativeReputation();
+        schemes[msg.sender] = Scheme({paramsHash: bytes32(0), permissions: bytes4(0x0000001F)});
+        emit RegisterScheme (msg.sender, msg.sender);
+    }
+ 
+  // Do not allow mistaken calls:
+   // solhint-disable-next-line payable-fallback
+    function() external {
+        revert();
+    }
+ 
+  // Modifiers:
+    modifier onlyRegisteredScheme() {
+        Erequire(schemes[msg.sender].permissions&bytes4(0x00000001) == bytes4(0x00000001));
+        _;
+    }
+ 
+    modifier onlyRegisteringSchemes() {
+        require(schemes[msg.sender].permissions&bytes4(0x00000002) == bytes4(0x00000002));
+        _;
+    }
+ 
+    modifier onlyGlobalConstraintsScheme() {
+        Erequire(schemes[msg.sender].permissions&bytes4(0x00000004) == bytes4(0x00000004));
+        _;
+    }
+ 
+    modifier onlyUpgradingScheme() {
+        require(schemes[msg.sender].permissions&bytes4(0x00000008) == bytes4(0x00000008));
+        _;
+    }
+ 
+    modifier onlyGenericCallScheme() {
+        Erequire(schemes[msg.sender].permissions&bytes4(0x00000010) == bytes4(0x00000010));
+        _;
+    }
+ 
+    modifier onlyMetaDataScheme() {
+        Erequire(schemes[msg.sender].permissions&bytes4(0x00000010) == bytes4(0x00000010));
+        _;
+    }
+ 
+    modifier onlySubjectToConstraint(bytes32 func) {
+        uint256 idx;
+        for (idx = 0; idx < globalConstraintsPre.length; idx++) {
+            require(
+            (GlobalConstraintInterface(globalConstraintsPre[idx].gcAddress))
+            .pre(msg.sender, globalConstraintsPre[idx].params, func));
+        }
+        _;
+        for (idx = 0; idx < globalConstraintsPost.length; idx++) {
+            require(
+            (GlobalConstraintInterface(globalConstraintsPost[idx].gcAddress))
+            .post(msg.sender, globalConstraintsPost[idx].params, func));
+        }
+    }
+ 
+    modifier isAvatarValid(address _avatar) {
+        require(_avatar == address(avatar));
+        _;
+    }
+ 
+    /**
+     * @dev Mint `_amount` of reputation that are assigned to `_to` .
+     * @param  _amount amount of reputation to mint
+     * @param _to beneficiary address
+     * @return bool which represents a success
+     */
+    function mintReputation(uint256 _amount, address _to, address _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("mintReputation")
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+        emit MintReputation(msg.sender, _to, _amount);
+        return nativeReputation.mint(_to, _amount);
+    }
+ 
+    /**
+     * @dev Burns `_amount` of reputation from `_from`
+     * @param _amount amount of reputation to burn
+     * @param _from The address that will lose the reputation
+     * @return bool which represents a success
+     */
+    function burnReputation(uint256 _amount, address _from, address _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("burnReputation")
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+        emit BurnReputation(msg.sender, _from, _amount);
+        return nativeReputation.burn(_from, _amount);
+    }
+ 
+    /**
+     * @dev mint tokens .
+     * @param  _amount amount of token to mint
+     * @param _beneficiary beneficiary address
+     * @return bool which represents a success
+     */
+    function mintTokens(uint256 _amount, address _beneficiary, address _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("mintTokens")
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+        emit MintTokens(msg.sender, _beneficiary, _amount);
+        return nativeToken.mint(_beneficiary, _amount);
+    }
+ 
+  /**
+   * @dev register a scheme
+   * @param _scheme the address of the scheme
+   * @param _paramsHash a hashed configuration of the usage of the scheme
+   * @param _permissions the permissions the new scheme will have
+   * @return bool which represents a success
+   */
+    function registerScheme(address _scheme, bytes32 _paramsHash, bytes4 _permissions, address _avatar)
+    external
+    onlyRegisteringSchemes
+    onlySubjectToConstraint("registerScheme")
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+ 
+        Scheme memory scheme = schemes[_scheme];
+ 
+    // Check scheme has at least the permissions it is changing, and at least the current permissions:
+    // Implementation is a bit messy. One must recall logic-circuits ^^
+ 
+    // produces non-zero if sender does not have all of the perms that are changing between old and new
+        Erequire(bytes4(0x0000001f)&(_permissions^scheme.permissions)&(~schemes[msg.sender].permissions) == bytes4(0));
+ 
+    // produces non-zero if sender does not have all of the perms in the old scheme
+        Erequire(bytes4(0x0000001f)&(scheme.permissions&(~schemes[msg.sender].permissions)) == bytes4(0));
+ 
+    // Add or change the scheme:
+        schemes[_scheme].paramsHash = _paramsHash;
+        schemes[_scheme].permissions = _permissions|bytes4(0x00000001);
+        emit RegisterScheme(msg.sender, _scheme);
+        return true;
+    }
+ 
+    /**
+     * @dev unregister a scheme
+     * @param _scheme the address of the scheme
+     * @return bool which represents a success
+     */
+    function unregisterScheme( address _scheme, address _avatar)
+    external
+    onlyRegisteringSchemes
+    onlySubjectToConstraint("unregisterScheme")
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+    //check if the scheme is registered
+        if (_isSchemeRegistered(_scheme) == false) {
+            return false;
+        }
+    // Check the unregistering scheme has enough permissions:
+        require(bytes4(0x0000001f)&(schemes[_scheme].permissions&(~schemes[msg.sender].permissions)) == bytes4(0));
+ 
+    // Unregister:
+        emit UnregisterScheme(msg.sender, _scheme);
+        delete schemes[_scheme];
+        return true;
+    }
+ 
+    /**
+     * @dev unregister the caller's scheme
+     * @return bool which represents a success
+     */
+    function unregisterSelf(address _avatar) external isAvatarValid(_avatar) returns(bool) {
+        if (_isSchemeRegistered(msg.sender) == false) {
+            return false;
+        }
+        delete schemes[msg.sender];
+        emit UnregisterScheme(msg.sender, msg.sender);
+        return true;
+    }
+ 
+    /**
+     * @dev add or update Global Constraint
+     * @param _globalConstraint the address of the global constraint to be added.
+     * @param _params the constraint parameters hash.
+     * @return bool which represents a success
+     */
+    function addGlobalConstraint(address _globalConstraint, bytes32 _params, address _avatar)
+    external
+    onlyGlobalConstraintsScheme
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+        GlobalConstraintInterface.CallPhase when = GlobalConstraintInterface(_globalConstraint).when();
+        if ((when == GlobalConstraintInterface.CallPhase.Pre)||
+            (when == GlobalConstraintInterface.CallPhase.PreAndPost)) {
+            if (!globalConstraintsRegisterPre[_globalConstraint].isRegistered) {
+                globalConstraintsPre.push(GlobalConstraint(_globalConstraint, _params));
+                globalConstraintsRegisterPre[_globalConstraint] =
+                GlobalConstraintRegister(true, globalConstraintsPre.length-1);
+            }else {
+                globalConstraintsPre[globalConstraintsRegisterPre[_globalConstraint].index].params = _params;
+            }
+        }
+        if ((when == GlobalConstraintInterface.CallPhase.Post)||
+            (when == GlobalConstraintInterface.CallPhase.PreAndPost)) {
+            if (!globalConstraintsRegisterPost[_globalConstraint].isRegistered) {
+                globalConstraintsPost.push(GlobalConstraint(_globalConstraint, _params));
+                globalConstraintsRegisterPost[_globalConstraint] =
+                GlobalConstraintRegister(true, globalConstraintsPost.length-1);
+            }else {
+                globalConstraintsPost[globalConstraintsRegisterPost[_globalConstraint].index].params = _params;
+            }
+        }
+        emit AddGlobalConstraint(_globalConstraint, _params, when);
+        return true;
+    }
+ 
+    /**
+     * @dev remove Global Constraint
+     * @param _globalConstraint the address of the global constraint to be remove.
+     * @return bool which represents a success
+     */
+     // solhint-disable-next-line code-complexity
+    function removeGlobalConstraint (address _globalConstraint, address _avatar)
+    external
+    onlyGlobalConstraintsScheme
+    isAvatarValid(_avatar)
+    returns(bool)
+    {
+        GlobalConstraintRegister memory globalConstraintRegister;
+        GlobalConstraint memory globalConstraint;
+        GlobalConstraintInterface.CallPhase when = GlobalConstraintInterface(_globalConstraint).when();
+        bool retVal = false;
+ 
+        Eif ((when == GlobalConstraintInterface.CallPhase.Pre)||
+            (when == GlobalConstraintInterface.CallPhase.PreAndPost)) {
+            globalConstraintRegister = globalConstraintsRegisterPre[_globalConstraint];
+            Eif (globalConstraintRegister.isRegistered) {
+                if (globalConstraintRegister.index < globalConstraintsPre.length-1) {
+                    globalConstraint = globalConstraintsPre[globalConstraintsPre.length-1];
+                    globalConstraintsPre[globalConstraintRegister.index] = globalConstraint;
+                    globalConstraintsRegisterPre[globalConstraint.gcAddress].index = globalConstraintRegister.index;
+                }
+                globalConstraintsPre.length--;
+                delete globalConstraintsRegisterPre[_globalConstraint];
+                retVal = true;
+            }
+        }
+        if ((when == GlobalConstraintInterface.CallPhase.Post)||
+            (when == GlobalConstraintInterface.CallPhase.PreAndPost)) {
+            globalConstraintRegister = globalConstraintsRegisterPost[_globalConstraint];
+            Eif (globalConstraintRegister.isRegistered) {
+                if (globalConstraintRegister.index < globalConstraintsPost.length-1) {
+                    globalConstraint = globalConstraintsPost[globalConstraintsPost.length-1];
+                    globalConstraintsPost[globalConstraintRegister.index] = globalConstraint;
+                    globalConstraintsRegisterPost[globalConstraint.gcAddress].index = globalConstraintRegister.index;
+                }
+                globalConstraintsPost.length--;
+                delete globalConstraintsRegisterPost[_globalConstraint];
+                retVal = true;
+            }
+        }
+        Eif (retVal) {
+            emit RemoveGlobalConstraint(
+            _globalConstraint,
+            globalConstraintRegister.index,
+            when == GlobalConstraintInterface.CallPhase.Pre
+            );
+        }
+        return retVal;
+    }
+ 
+  /**
+    * @dev upgrade the Controller
+    *      The function will trigger an event 'UpgradeController'.
+    * @param  _newController the address of the new controller.
+    * @return bool which represents a success
+    */
+    function upgradeController(address _newController, Avatar _avatar)
+    external
+    onlyUpgradingScheme
+    isAvatarValid(address(_avatar))
+    returns(bool)
+    {
+        Erequire(newController == address(0));   // so the upgrade could be done once for a contract.
+        Erequire(_newController != address(0));
+        newController = _newController;
+        avatar.transferOwnership(_newController);
+        Erequire(avatar.owner() == _newController);
+        Eif (nativeToken.owner() == address(this)) {
+            nativeToken.transferOwnership(_newController);
+            Erequire(nativeToken.owner() == _newController);
+        }
+        Eif (nativeReputation.owner() == address(this)) {
+            nativeReputation.transferOwnership(_newController);
+            Erequire(nativeReputation.owner() == _newController);
+        }
+        emit UpgradeController(address(this), newController);
+        return true;
+    }
+ 
+    /**
+    * @dev perform a generic call to an arbitrary contract
+    * @param _contract  the contract's address to call
+    * @param _data ABI-encoded contract call to call `_contract` address.
+    * @param _avatar the controller's avatar address
+    * @param _value value (ETH) to transfer with the transaction
+    * @return bool -success
+    *         bytes  - the return value of the called _contract's function.
+    */
+    function genericCall(address _contract, bytes calldata _data, Avatar _avatar, uint256 _value)
+    external
+    onlyGenericCallScheme
+    onlySubjectToConstraint("genericCall")
+    isAvatarValid(address(_avatar))
+    returns (bool, bytes memory)
+    {
+        return avatar.genericCall(_contract, _data, _value);
+    }
+ 
+  /**
+   * @dev send some ether
+   * @param _amountInWei the amount of ether (in Wei) to send
+   * @param _to address of the beneficiary
+   * @return bool which represents a success
+   */
+    function sendEther(uint256 _amountInWei, address payable _to, Avatar _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("sendEther")
+    isAvatarValid(address(_avatar))
+    returns(bool)
+    {
+        return avatar.sendEther(_amountInWei, _to);
+    }
+ 
+    /**
+    * @dev send some amount of arbitrary ERC20 Tokens
+    * @param _externalToken the address of the Token Contract
+    * @param _to address of the beneficiary
+    * @param _value the amount of ether (in Wei) to send
+    * @return bool which represents a success
+    */
+    function externalTokenTransfer(IERC20 _externalToken, address _to, uint256 _value, Avatar _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("externalTokenTransfer")
+    isAvatarValid(address(_avatar))
+    returns(bool)
+    {
+        return avatar.externalTokenTransfer(_externalToken, _to, _value);
+    }
+ 
+    /**
+    * @dev transfer token "from" address "to" address
+    *      One must to approve the amount of tokens which can be spend from the
+    *      "from" account.This can be done using externalTokenApprove.
+    * @param _externalToken the address of the Token Contract
+    * @param _from address of the account to send from
+    * @param _to address of the beneficiary
+    * @param _value the amount of ether (in Wei) to send
+    * @return bool which represents a success
+    */
+    function externalTokenTransferFrom(
+    IERC20 _externalToken,
+    address _from,
+    address _to,
+    uint256 _value,
+    Avatar _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("externalTokenTransferFrom")
+    isAvatarValid(address(_avatar))
+    returns(bool)
+    {
+        return avatar.externalTokenTransferFrom(_externalToken, _from, _to, _value);
+    }
+ 
+    /**
+    * @dev externalTokenApproval approve the spender address to spend a specified amount of tokens
+    *      on behalf of msg.sender.
+    * @param _externalToken the address of the Token Contract
+    * @param _spender address
+    * @param _value the amount of ether (in Wei) which the approval is referring to.
+    * @return bool which represents a success
+    */
+    function externalTokenApproval(IERC20 _externalToken, address _spender, uint256 _value, Avatar _avatar)
+    external
+    onlyRegisteredScheme
+    onlySubjectToConstraint("externalTokenIncreaseApproval")
+    isAvatarValid(address(_avatar))
+    returns(bool)
+    {
+        return avatar.externalTokenApproval(_externalToken, _spender, _value);
+    }
+ 
+    /**
+    * @dev metaData emits an event with a string, should contain the hash of some meta data.
+    * @param _metaData a string representing a hash of the meta data
+    * @param _avatar Avatar
+    * @return bool which represents a success
+    */
+    function metaData(string calldata _metaData, Avatar _avatar)
+        external
+        onlyMetaDataScheme
+        isAvatarValid(address(_avatar))
+        returns(bool)
+        {
+        return avatar.metaData(_metaData);
+    }
+ 
+    /**
+     * @dev getNativeReputation
+     * @param _avatar the organization avatar.
+     * @return organization native reputation
+     */
+    function getNativeReputation(address _avatar) external isAvatarValid(_avatar) view returns(address) {
+        return address(nativeReputation);
+    }
+ 
+    function isSchemeRegistered(address _scheme, address _avatar) external isAvatarValid(_avatar) view returns(bool) {
+        return _isSchemeRegistered(_scheme);
+    }
+ 
+    function getSchemeParameters(address _scheme, address _avatar)
+    external
+    isAvatarValid(_avatar)
+    view
+    returns(bytes32)
+    {
+        return schemes[_scheme].paramsHash;
+    }
+ 
+    function getSchemePermissions(address _scheme, address _avatar)
+    external
+    isAvatarValid(_avatar)
+    view
+    returns(bytes4)
+    {
+        return schemes[_scheme].permissions;
+    }
+ 
+    function getGlobalConstraintParameters(address _globalConstraint, address) external view returns(bytes32) {
+ 
+        GlobalConstraintRegister memory register = globalConstraintsRegisterPre[_globalConstraint];
+ 
+        if (register.isRegistered) {
+            return globalConstraintsPre[register.index].params;
+        }
+ 
+        register = globalConstraintsRegisterPost[_globalConstraint];
+ 
+        Eif (register.isRegistered) {
+            return globalConstraintsPost[register.index].params;
+        }
+    }
+ 
+   /**
+    * @dev globalConstraintsCount return the global constraint pre and post count
+    * @return uint256 globalConstraintsPre count.
+    * @return uint256 globalConstraintsPost count.
+    */
+    function globalConstraintsCount(address _avatar)
+        external
+        isAvatarValid(_avatar)
+        view
+        returns(uint, uint)
+        {
+        return (globalConstraintsPre.length, globalConstraintsPost.length);
+    }
+ 
+    function isGlobalConstraintRegistered(address _globalConstraint, address _avatar)
+        external
+        isAvatarValid(_avatar)
+        view
+        returns(bool)
+        {
+        return (globalConstraintsRegisterPre[_globalConstraint].isRegistered ||
+                globalConstraintsRegisterPost[_globalConstraint].isRegistered);
+    }
+ 
+    function _isSchemeRegistered(address _scheme) private view returns(bool) {
+        return (schemes[_scheme].permissions&bytes4(0x00000001) != bytes4(0));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/controller/DAOToken.sol.html b/coverage/lcov-report/controller/DAOToken.sol.html new file mode 100644 index 00000000..ca0faf55 --- /dev/null +++ b/coverage/lcov-report/controller/DAOToken.sol.html @@ -0,0 +1,200 @@ + + + + Code coverage report for controller/DAOToken.sol + + + + + + + +
+
+

+ all files / controller/ DAOToken.sol +

+
+
+ 100% + Statements + 7/7 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 7/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +371× +371× +371× +  +  +  +  +  +  +  +  +462× + +460× +460× +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol";
+import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+ 
+ 
+/**
+ * @title DAOToken, base on zeppelin contract.
+ * @dev ERC20 compatible token. It is a mintable, burnable token.
+ */
+ 
+contract DAOToken is ERC20, ERC20Burnable, Ownable {
+ 
+    string public name;
+    string public symbol;
+    // solhint-disable-next-line const-name-snakecase
+    uint8 public constant decimals = 18;
+    uint256 public cap;
+ 
+    /**
+    * @dev Constructor
+    * @param _name - token name
+    * @param _symbol - token symbol
+    * @param _cap - token cap - 0 value means no cap
+    */
+    constructor(string memory _name, string memory _symbol, uint256 _cap)
+    public {
+        name = _name;
+        symbol = _symbol;
+        cap = _cap;
+    }
+ 
+    /**
+     * @dev Function to mint tokens
+     * @param _to The address that will receive the minted tokens.
+     * @param _amount The amount of tokens to mint.
+     */
+    function mint(address _to, uint256 _amount) public onlyOwner returns (bool) {
+        if (cap > 0)
+            require(totalSupply().add(_amount) <= cap);
+        _mint(_to, _amount);
+        return true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/controller/index.html b/coverage/lcov-report/controller/index.html new file mode 100644 index 00000000..96f3765f --- /dev/null +++ b/coverage/lcov-report/controller/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for controller/ + + + + + + + +
+
+

+ all files controller/ +

+
+
+ 99.26% + Statements + 134/135 +
+
+ 75% + Branches + 54/72 +
+
+ 97.67% + Functions + 42/43 +
+
+ 99.33% + Lines + 148/149 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Avatar.sol
100%20/20100%0/0100%8/8100%20/20
Controller.sol
99.07%107/10873.53%50/6896.97%32/3399.18%121/122
DAOToken.sol
100%7/7100%4/4100%2/2100%7/7
+
+
+ + + + + + + diff --git a/coverage/lcov-report/globalConstraints/GlobalConstraintInterface.sol.html b/coverage/lcov-report/globalConstraints/GlobalConstraintInterface.sol.html new file mode 100644 index 00000000..4e998f06 --- /dev/null +++ b/coverage/lcov-report/globalConstraints/GlobalConstraintInterface.sol.html @@ -0,0 +1,110 @@ + + + + Code coverage report for globalConstraints/GlobalConstraintInterface.sol + + + + + + + +
+
+

+ all files / globalConstraints/ GlobalConstraintInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+ 
+contract GlobalConstraintInterface {
+ 
+    enum CallPhase { Pre, Post, PreAndPost }
+ 
+    function pre( address _scheme, bytes32 _params, bytes32 _method ) public returns(bool);
+    function post( address _scheme, bytes32 _params, bytes32 _method ) public returns(bool);
+    /**
+     * @dev when return if this globalConstraints is pre, post or both.
+     * @return CallPhase enum indication  Pre, Post or PreAndPost.
+     */
+    function when() public returns(CallPhase);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/globalConstraints/TokenCapGC.sol.html b/coverage/lcov-report/globalConstraints/TokenCapGC.sol.html new file mode 100644 index 00000000..4c814d51 --- /dev/null +++ b/coverage/lcov-report/globalConstraints/TokenCapGC.sol.html @@ -0,0 +1,287 @@ + + + + Code coverage report for globalConstraints/TokenCapGC.sol + + + + + + + +
+
+

+ all files / globalConstraints/ TokenCapGC.sol +

+
+
+ 100% + Statements + 10/10 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  + +  + +  +  +  +  +  +  +  + +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
+import "./GlobalConstraintInterface.sol";
+ 
+ 
+/**
+ * @title Token Cap Global Constraint
+ * @dev A simple global constraint to cap the number of tokens.
+ */
+ 
+contract TokenCapGC {
+    // A set of parameters, on which the cap will be checked:
+    struct Parameters {
+        IERC20 token;
+        uint256 cap;
+    }
+ 
+    // Mapping from the hash of the parameters to the parameters themselves:
+    mapping (bytes32=>Parameters) public parameters;
+ 
+    /**
+     * @dev adding a new set of parameters
+     * @param  _token the token to add to the params.
+     * @param _cap the cap to check the total supply against.
+     * @return the calculated parameters hash
+     */
+    function setParameters(IERC20 _token, uint256 _cap) public returns(bytes32) {
+        bytes32 paramsHash = getParametersHash(_token, _cap);
+        parameters[paramsHash].token = _token;
+        parameters[paramsHash].cap = _cap;
+        return paramsHash;
+    }
+ 
+    /**
+     * @dev calculate and returns the hash of the given parameters
+     * @param  _token the token to add to the params.
+     * @param _cap the cap to check the total supply against.
+     * @return the calculated parameters hash
+     */
+    function getParametersHash(IERC20 _token, uint256 _cap) public pure returns(bytes32) {
+        return (keccak256(abi.encodePacked(_token, _cap)));
+    }
+ 
+    /**
+     * @dev check the constraint after the action.
+     * This global constraint only checks the state after the action, so here we just return true:
+     * @return true
+     */
+    function pre(address, bytes32, bytes32) public pure returns(bool) {
+        return true;
+    }
+ 
+    /**
+     * @dev check the total supply cap.
+     * @param  _paramsHash the parameters hash to check the total supply cap against.
+     * @return bool which represents a success
+     */
+    function post(address, bytes32 _paramsHash, bytes32) public view returns(bool) {
+        if ((parameters[_paramsHash].token != IERC20(0)) &&
+            (parameters[_paramsHash].token.totalSupply() > parameters[_paramsHash].cap)) {
+            return false;
+        }
+        return true;
+    }
+ 
+    /**
+     * @dev when return if this globalConstraints is pre, post or both.
+     * @return CallPhase enum indication  Pre, Post or PreAndPost.
+     */
+    function when() public pure returns(GlobalConstraintInterface.CallPhase) {
+        return GlobalConstraintInterface.CallPhase.Post;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/globalConstraints/index.html b/coverage/lcov-report/globalConstraints/index.html new file mode 100644 index 00000000..2e2826cb --- /dev/null +++ b/coverage/lcov-report/globalConstraints/index.html @@ -0,0 +1,106 @@ + + + + Code coverage report for globalConstraints/ + + + + + + + +
+
+

+ all files globalConstraints/ +

+
+
+ 100% + Statements + 10/10 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 10/10 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
GlobalConstraintInterface.sol
100%0/0100%0/0100%0/0100%0/0
TokenCapGC.sol
100%10/10100%2/2100%5/5100%10/10
+
+
+ + + + + + + diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html new file mode 100644 index 00000000..7a0d012b --- /dev/null +++ b/coverage/lcov-report/index.html @@ -0,0 +1,171 @@ + + + + Code coverage report for All files + + + + + + + +
+
+

+ / +

+
+
+ 98.58% + Statements + 1181/1198 +
+
+ 74.87% + Branches + 572/764 +
+
+ 98.57% + Functions + 207/210 +
+
+ 98.61% + Lines + 1209/1226 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
controller/
99.26%134/13575%54/7297.67%42/4399.33%148/149
globalConstraints/
100%10/10100%2/2100%5/5100%10/10
libs/
100%13/1350%10/20100%3/3100%13/13
schemes/
99.07%638/64476.55%346/45297.85%91/9399.08%645/651
universalSchemes/
100%301/30175%123/164100%45/45100%305/305
utils/
94.29%66/7072.5%29/40100%14/1494.44%68/72
votingMachines/
76%19/2557.14%8/14100%7/776.92%20/26
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libs/SafeERC20.sol.html b/coverage/lcov-report/libs/SafeERC20.sol.html new file mode 100644 index 00000000..f07c9d4c --- /dev/null +++ b/coverage/lcov-report/libs/SafeERC20.sol.html @@ -0,0 +1,281 @@ + + + + Code coverage report for libs/SafeERC20.sol + + + + + + + +
+
+

+ all files / libs/ SafeERC20.sol +

+
+
+ 100% + Statements + 13/13 +
+
+ 50% + Branches + 10/20 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 13/13 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +45× +  +45× +  +  +  +45× +  +45× +  +  +  +  +  +70× +  +70× +  +  +  +70× +  +70× +  +  +  +  +  + +  +  +  + +  + +  +  +  + +  + +  +  + 
/*
+ 
+SafeERC20 by daostack.
+The code is based on a fix by SECBIT Team.
+ 
+USE WITH CAUTION & NO WARRANTY
+ 
+REFERENCE & RELATED READING
+- https://github.com/ethereum/solidity/issues/4116
+- https://medium.com/@chris_77367/explaining-unexpected-reverts-starting-with-solidity-0-4-22-3ada6e82308c
+- https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
+- https://gist.github.com/BrendanChou/88a2eeb80947ff00bcf58ffdafeaeb61
+ 
+*/
+pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/utils/Address.sol";
+import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
+ 
+library SafeERC20 {
+    using Address for address;
+ 
+    bytes4 constant private TRANSFER_SELECTOR = bytes4(keccak256(bytes("transfer(address,uint256)")));
+    bytes4 constant private TRANSFERFROM_SELECTOR = bytes4(keccak256(bytes("transferFrom(address,address,uint256)")));
+    bytes4 constant private APPROVE_SELECTOR = bytes4(keccak256(bytes("approve(address,uint256)")));
+ 
+    function safeTransfer(address _erc20Addr, address _to, uint256 _value) internal {
+ 
+        // Must be a contract addr first!
+        Erequire(_erc20Addr.isContract());
+ 
+        (bool success, bytes memory returnValue) =
+        // solhint-disable-next-line avoid-low-level-calls
+        _erc20Addr.call(abi.encodeWithSelector(TRANSFER_SELECTOR, _to, _value));
+        // call return false when something wrong
+        Erequire(success);
+        //check return value
+        Erequire(returnValue.length == 0 || (returnValue.length == 32 && (returnValue[31] != 0)));
+    }
+ 
+    function safeTransferFrom(address _erc20Addr, address _from, address _to, uint256 _value) internal {
+ 
+        // Must be a contract addr first!
+        Erequire(_erc20Addr.isContract());
+ 
+        (bool success, bytes memory returnValue) =
+        // solhint-disable-next-line avoid-low-level-calls
+        _erc20Addr.call(abi.encodeWithSelector(TRANSFERFROM_SELECTOR, _from, _to, _value));
+        // call return false when something wrong
+        Erequire(success);
+        //check return value
+        Erequire(returnValue.length == 0 || (returnValue.length == 32 && (returnValue[31] != 0)));
+    }
+ 
+    function safeApprove(address _erc20Addr, address _spender, uint256 _value) internal {
+ 
+        // Must be a contract addr first!
+        Erequire(_erc20Addr.isContract());
+ 
+        // safeApprove should only be called when setting an initial allowance,
+        // or when resetting it to zero.
+        Erequire((_value == 0) || (IERC20(_erc20Addr).allowance(address(this), _spender) == 0));
+ 
+        (bool success, bytes memory returnValue) =
+        // solhint-disable-next-line avoid-low-level-calls
+        _erc20Addr.call(abi.encodeWithSelector(APPROVE_SELECTOR, _spender, _value));
+        // call return false when something wrong
+        Erequire(success);
+        //check return value
+        Erequire(returnValue.length == 0 || (returnValue.length == 32 && (returnValue[31] != 0)));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/libs/index.html b/coverage/lcov-report/libs/index.html new file mode 100644 index 00000000..40479824 --- /dev/null +++ b/coverage/lcov-report/libs/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for libs/ + + + + + + + +
+
+

+ all files libs/ +

+
+
+ 100% + Statements + 13/13 +
+
+ 50% + Branches + 10/20 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 13/13 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
SafeERC20.sol
100%13/1350%10/20100%3/3100%13/13
+
+
+ + + + + + + diff --git a/coverage/lcov-report/prettify.css b/coverage/lcov-report/prettify.css new file mode 100644 index 00000000..b317a7cd --- /dev/null +++ b/coverage/lcov-report/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/lcov-report/prettify.js b/coverage/lcov-report/prettify.js new file mode 100644 index 00000000..ef51e038 --- /dev/null +++ b/coverage/lcov-report/prettify.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/lcov-report/schemes/Agreement.sol.html b/coverage/lcov-report/schemes/Agreement.sol.html new file mode 100644 index 00000000..71f3029f --- /dev/null +++ b/coverage/lcov-report/schemes/Agreement.sol.html @@ -0,0 +1,176 @@ + + + + Code coverage report for schemes/Agreement.sol + + + + + + + +
+
+

+ all files / schemes/ Agreement.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 5/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38  +  +  +  +  +  +  +  +  +  +  +  +151× +130× +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +117× +115× +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+/**
+ * @title A scheme for conduct ERC20 Tokens auction for reputation
+ */
+ 
+ 
+contract Agreement {
+ 
+    bytes32 private agreementHash;
+ 
+    modifier onlyAgree(bytes32 _agreementHash) {
+        require(_agreementHash == agreementHash, "Sender must send the right agreementHash");
+        _;
+    }
+ 
+    /**
+     * @dev getAgreementHash
+     * @return bytes32 agreementHash
+     */
+    function getAgreementHash() external  view returns(bytes32)
+    {
+        return agreementHash;
+    }
+ 
+    /**
+     * @dev setAgreementHash
+     * @param _agreementHash is a hash of agreement required to be added to the TX by participants
+     */
+    function setAgreementHash(bytes32 _agreementHash) internal
+    {
+        require(agreementHash == bytes32(0), "Can not set agreement twice");
+        agreementHash = _agreementHash;
+    }
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/Auction4Reputation.sol.html b/coverage/lcov-report/schemes/Auction4Reputation.sol.html new file mode 100644 index 00000000..7481fb4e --- /dev/null +++ b/coverage/lcov-report/schemes/Auction4Reputation.sol.html @@ -0,0 +1,542 @@ + + + + Code coverage report for schemes/Auction4Reputation.sol + + + + + + + +
+
+

+ all files / schemes/ Auction4Reputation.sol +

+
+
+ 100% + Statements + 40/40 +
+
+ 88.46% + Branches + 23/26 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 40/40 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +26× +26× +  +24× +22× +22× +22× +16× +16× +16× +16× +16× +16× +16× +16× +16× +  +  +  +  +  +  +  +  +  +  +16× +12× +12× +12× +10× +10× +10× +  +10× +10× +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +20× +  +18× +  +16× +16× +  +16× +16× +14× +14× +14× +14× +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  + +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/math/SafeMath.sol";
+import "../controller/Controller.sol";
+import "../libs/SafeERC20.sol";
+import "./Agreement.sol";
+ 
+/**
+ * @title A scheme for conduct ERC20 Tokens auction for reputation
+ */
+ 
+ 
+contract Auction4Reputation is Agreement {
+    using SafeMath for uint256;
+    using SafeERC20 for address;
+ 
+    event Bid(address indexed _bidder, uint256 indexed _auctionId, uint256 _amount);
+    event Redeem(uint256 indexed _auctionId, address indexed _beneficiary, uint256 _amount);
+ 
+    struct Auction {
+        uint256 totalBid;
+        // A mapping from bidder addresses to their bids.
+        mapping(address=>uint) bids;
+    }
+ 
+    // A mapping from auction index to auction.
+    mapping(uint=>Auction) public auctions;
+ 
+    Avatar public avatar;
+    uint256 public reputationRewardLeft;
+    uint256 public auctionsEndTime;
+    uint256 public auctionsStartTime;
+    uint256 public numberOfAuctions;
+    uint256 public auctionReputationReward;
+    uint256 public auctionPeriod;
+    uint256 public redeemEnableTime;
+    IERC20 public token;
+    address public wallet;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _auctionReputationReward the reputation reward per auction this contract will reward
+     *        for the token locking
+     * @param _auctionsStartTime auctions period start time
+     * @param _auctionPeriod auctions period time.
+     *        auctionsEndTime is set to _auctionsStartTime + _auctionPeriod*_numberOfAuctions
+     *        bidding is disable after auctionsEndTime.
+     * @param _numberOfAuctions number of auctions.
+     * @param _redeemEnableTime redeem enable time .
+     *        redeem reputation can be done after this time.
+     * @param _token the bidding token
+     * @param  _wallet the address of the wallet the token will be transfer to.
+     *         Please note that _wallet address should be a trusted account.
+     *         Normally this address should be set as the DAO's avatar address.
+     * @param _agreementHash is a hash of agreement required to be added to the TX by participants
+     */
+    function initialize(
+        Avatar _avatar,
+        uint256 _auctionReputationReward,
+        uint256 _auctionsStartTime,
+        uint256 _auctionPeriod,
+        uint256 _numberOfAuctions,
+        uint256 _redeemEnableTime,
+        IERC20 _token,
+        address _wallet,
+        bytes32 _agreementHash )
+    external
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        require(_numberOfAuctions > 0, "number of auctions cannot be zero");
+        //_auctionPeriod should be greater than block interval
+        require(_auctionPeriod > 15, "auctionPeriod should be > 15");
+        auctionPeriod = _auctionPeriod;
+        auctionsEndTime = _auctionsStartTime + _auctionPeriod.mul(_numberOfAuctions);
+        require(_redeemEnableTime >= auctionsEndTime, "_redeemEnableTime >= auctionsEndTime");
+        token = _token;
+        avatar = _avatar;
+        auctionsStartTime = _auctionsStartTime;
+        numberOfAuctions = _numberOfAuctions;
+        wallet = _wallet;
+        auctionReputationReward = _auctionReputationReward;
+        reputationRewardLeft = _auctionReputationReward.mul(_numberOfAuctions);
+        redeemEnableTime = _redeemEnableTime;
+        super.setAgreementHash(_agreementHash);
+    }
+ 
+    /**
+     * @dev redeem reputation function
+     * @param _beneficiary the beneficiary to redeem.
+     * @param _auctionId the auction id to redeem from.
+     * @return uint256 reputation rewarded
+     */
+    function redeem(address _beneficiary, uint256 _auctionId) public returns(uint256 reputation) {
+        // solhint-disable-next-line not-rely-on-time
+        require(now > redeemEnableTime, "now > redeemEnableTime");
+        Auction storage auction = auctions[_auctionId];
+        uint256 bid = auction.bids[_beneficiary];
+        require(bid > 0, "bidding amount should be > 0");
+        auction.bids[_beneficiary] = 0;
+        uint256 repRelation = bid.mul(auctionReputationReward);
+        reputation = repRelation.div(auction.totalBid);
+        // check that the reputation is sum zero
+        reputationRewardLeft = reputationRewardLeft.sub(reputation);
+        Erequire(
+        Controller(avatar.owner())
+        .mintReputation(reputation, _beneficiary, address(avatar)), "mint reputation should succeed");
+        emit Redeem(_auctionId, _beneficiary, reputation);
+    }
+ 
+    /**
+     * @dev bid function
+     * @param _amount the amount to bid with
+     * @param _auctionId the auction id to bid at .
+     * @return auctionId
+     */
+    function bid(uint256 _amount, uint256 _auctionId, bytes32 _agreementHash)
+    public
+    onlyAgree(_agreementHash)
+    returns(uint256 auctionId)
+    {
+        require(_amount > 0, "bidding amount should be > 0");
+        // solhint-disable-next-line not-rely-on-time
+        require(now < auctionsEndTime, "bidding should be within the allowed bidding period");
+        // solhint-disable-next-line not-rely-on-time
+        Erequire(now >= auctionsStartTime, "bidding is enable only after bidding auctionsStartTime");
+        address(token).safeTransferFrom(msg.sender, address(this), _amount);
+        // solhint-disable-next-line not-rely-on-time
+        auctionId = (now - auctionsStartTime) / auctionPeriod;
+        require(auctionId == _auctionId, "auction is not active");
+        Auction storage auction = auctions[auctionId];
+        auction.totalBid = auction.totalBid.add(_amount);
+        auction.bids[msg.sender] = auction.bids[msg.sender].add(_amount);
+        emit Bid(msg.sender, auctionId, _amount);
+    }
+ 
+    /**
+     * @dev transferToWallet transfer the tokens to the wallet.
+     *      can be called only after auctionsEndTime
+     */
+    function transferToWallet() public {
+      // solhint-disable-next-line not-rely-on-time
+        require(now > auctionsEndTime, "now > auctionsEndTime");
+        uint256 tokenBalance = token.balanceOf(address(this));
+        address(token).safeTransfer(wallet, tokenBalance);
+    }
+ 
+    /**
+     * @dev getBid get bid for specific bidder and _auctionId
+     * @param _bidder the bidder
+     * @param _auctionId auction id
+     * @return uint
+     */
+    function getBid(address _bidder, uint256 _auctionId) public view returns(uint256) {
+        return auctions[_auctionId].bids[_bidder];
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/Competition.sol.html b/coverage/lcov-report/schemes/Competition.sol.html new file mode 100644 index 00000000..9f69aa11 --- /dev/null +++ b/coverage/lcov-report/schemes/Competition.sol.html @@ -0,0 +1,1316 @@ + + + + Code coverage report for schemes/Competition.sol + + + + + + + +
+
+

+ all files / schemes/ Competition.sol +

+
+
+ 97.84% + Statements + 136/139 +
+
+ 77.66% + Branches + 73/94 +
+
+ 100% + Functions + 9/9 +
+
+ 97.84% + Lines + 136/139 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +15× +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +27× +27× +  +  +  +  +27× +25× +23× +23× +21× +19× +  +19× +19× +19× +  +19× +17× +17× +65× +  +17× +15× +  +15× +15× +15× +15× +15× +15× +15× +15× +15× +15× +15× +15× +15× + +  +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +73× + +  +  +71× +  +69× +65× +65× +65× +65× +64× +  + +  +65× +65× +65× +  +  +  +  +  +  +  +  +  +  +  +33× +33× +31× +29× +29× +29× +29× +  +29× +29× +29× +27× +  +25× +25× + +  +  +25× +25× +25× +25× +25× +25× +  +  +  +  +  +  +  +  +  +31× +29× +29× + + +  +  +  +  +  +  +  +  +  + + + + + + +  +  + +  +  +  +  +  + +  + +  +  + +  +  + +  +  +  +  +  +  +  +  +12× +12× +12× +12× +  +12× + + +  + + + + + + + +  + + +  + + + +  +  + + +  + +  +  + + + +  +  + + +  +  + + +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +17× +17× +15× +  +15× +45× +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +25× +25× +25× +23× +23× + +  +  +20× +  +  + + + +  + +  +  +  +  +  +  + +  +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "./ContributionRewardExt.sol";
+ 
+ 
+contract Competition {
+    using SafeMath for uint256;
+ 
+    uint256 constant public MAX_NUMBER_OF_WINNERS = 100;
+ 
+    event NewCompetitionProposal(
+        bytes32 indexed _proposalId,
+        uint256 _numberOfWinners,
+        uint256[] _rewardSplit,
+        uint256 _startTime,
+        uint256 _votingStartTime,
+        uint256 _suggestionsEndTime,
+        uint256 _endTime,
+        uint256 _maxNumberOfVotesPerVoter,
+        address payable _contributionRewardExt, //address of the contract to redeem from.
+        address _admin
+    );
+ 
+    event Redeem(
+        bytes32 indexed _proposalId,
+        uint256 indexed _suggestionId,
+        uint256 _rewardPercentage
+    );
+ 
+    event NewSuggestion(
+        bytes32 indexed _proposalId,
+        uint256 indexed _suggestionId,
+        string _descriptionHash,
+        address payable indexed _beneficiary
+    );
+ 
+    event NewVote(
+        bytes32 indexed _proposalId,
+        uint256 indexed _suggestionId,
+        address indexed _voter,
+        uint256 _reputation
+    );
+ 
+    event SnapshotBlock(
+        bytes32 indexed _proposalId,
+        uint256 _snapshotBlock
+    );
+ 
+    // A struct holding the data for a competition proposal
+    struct Proposal {
+        uint256 numberOfWinners;
+        uint256[] rewardSplit;
+        uint256 startTime;
+        uint256 votingStartTime;
+        uint256 suggestionsEndTime;
+        uint256 endTime;
+        uint256 maxNumberOfVotesPerVoter;
+        address payable contributionRewardExt;
+        uint256 snapshotBlock;
+        uint256 reputationReward;
+        uint256 ethReward;
+        uint256 nativeTokenReward;
+        uint256 externalTokenReward;
+        uint256[] topSuggestions;
+        address admin;
+        //mapping from suggestions totalVotes to the number of suggestions with the same totalVotes.
+        mapping(uint256=>uint256) suggestionsPerVote;
+        mapping(address=>uint256) votesPerVoter;
+    }
+ 
+    struct Suggestion {
+        uint256 totalVotes;
+        bytes32 proposalId;
+        address payable beneficiary;
+        mapping(address=>uint256) votes;
+    }
+ 
+    //mapping from proposalID to Proposal
+    mapping(bytes32=>Proposal) public proposals;
+    //mapping from suggestionId to Suggestion
+    mapping(uint256=>Suggestion) public suggestions;
+    uint256 public suggestionsCounter;
+    address payable public contributionRewardExt; //address of the contract to redeem from.
+ 
+    /**
+     * @dev initialize
+     * @param _contributionRewardExt the contributionRewardExt scheme which
+     *        manage and allocate the rewards for the competition.
+     */
+    function initialize(address payable _contributionRewardExt) external {
+        Erequire(contributionRewardExt == address(0), "can be called only one time");
+        Erequire(_contributionRewardExt != address(0), "contributionRewardExt cannot be zero");
+        contributionRewardExt = _contributionRewardExt;
+    }
+ 
+    /**
+    * @dev Submit a competion proposal
+    * @param _descriptionHash A hash of the proposal's description
+    * @param _reputationChange - Amount of reputation change requested.
+    * @param _rewards rewards array:
+    *         rewards[0] - Amount of tokens requested per period
+    *         rewards[1] - Amount of ETH requested per period
+    *         rewards[2] - Amount of external tokens requested per period
+    * @param _externalToken Address of external token, if reward is requested there
+    * @param _rewardSplit an array of precentages which specify how to split the rewards
+    *         between the winning suggestions
+    * @param _competitionParams competition parameters :
+    *         _competitionParams[0] - competition startTime
+    *         _competitionParams[1] - _votingStartTime competition voting start time
+    *         _competitionParams[2] - _endTime competition end time
+    *         _competitionParams[3] - _maxNumberOfVotesPerVoter on how many suggestions a voter can vote
+    *         _competitionParams[4] - _suggestionsEndTime suggestion submission end time
+    *        _proposerIsAdmin -
+    *          true -  proposer is an admin.
+    *          false no admin.
+    *          if admin is set, so only admin can suggest on this proposal.
+    * @return proposalId the proposal id.
+    */
+    function proposeCompetition(
+            string calldata _descriptionHash,
+            int256 _reputationChange,
+            uint[3] calldata _rewards,
+            IERC20 _externalToken,
+            uint256[] calldata _rewardSplit,
+            uint256[5] calldata _competitionParams,
+            bool _proposerIsAdmin
+    )
+    external
+    // solhint-disable-next-line function-max-lines
+    returns(bytes32 proposalId) {
+        uint256 numberOfWinners = _rewardSplit.length;
+        uint256 startTime = _competitionParams[0];
+        Iif (startTime == 0) {
+          // solhint-disable-next-line not-rely-on-time
+            startTime = now;
+        }
+        // solhint-disable-next-line not-rely-on-time
+        require(startTime >= now, "startTime should be greater than proposing time");
+        require(numberOfWinners <= MAX_NUMBER_OF_WINNERS, "number of winners greater than max allowed");
+        Erequire(_competitionParams[1] < _competitionParams[2], "voting start time greater than end time");
+        require(_competitionParams[1] >= startTime, "voting start time smaller than start time");
+        require(_competitionParams[3] > 0, "maxNumberOfVotesPerVoter should be greater than 0");
+        Erequire(_competitionParams[4] <= _competitionParams[2],
+        "suggestionsEndTime should be earlier than proposal end time");
+        Erequire(_competitionParams[4] > startTime, "suggestionsEndTime should be later than proposal start time");
+        Eif (_rewards[2] > 0) {
+            Erequire(_externalToken != ERC20(0), "extenal token cannot be zero");
+        }
+        require(_reputationChange >= 0, "negative reputation change is not allowed for a competition");
+        uint256 totalRewardSplit;
+        for (uint256 i = 0; i < numberOfWinners; i++) {
+            totalRewardSplit = totalRewardSplit.add(_rewardSplit[i]);
+        }
+        require(totalRewardSplit == 100, "total rewards split is not 100%");
+        proposalId = ContributionRewardExt(contributionRewardExt).proposeContributionReward(
+                _descriptionHash, _reputationChange, _rewards, _externalToken, contributionRewardExt, msg.sender);
+        proposals[proposalId].numberOfWinners = numberOfWinners;
+        proposals[proposalId].rewardSplit = _rewardSplit;
+        proposals[proposalId].startTime = startTime;
+        proposals[proposalId].votingStartTime = _competitionParams[1];
+        proposals[proposalId].endTime = _competitionParams[2];
+        proposals[proposalId].maxNumberOfVotesPerVoter = _competitionParams[3];
+        proposals[proposalId].suggestionsEndTime = _competitionParams[4];
+        proposals[proposalId].reputationReward = uint256(_reputationChange);
+        proposals[proposalId].nativeTokenReward = _rewards[0];
+        proposals[proposalId].ethReward = _rewards[1];
+        proposals[proposalId].externalTokenReward = _rewards[2];
+        proposals[proposalId].snapshotBlock = 0;
+        if (_proposerIsAdmin) {
+            proposals[proposalId].admin = msg.sender;
+        }
+        emit NewCompetitionProposal(
+            proposalId,
+            numberOfWinners,
+            proposals[proposalId].rewardSplit,
+            startTime,
+            proposals[proposalId].votingStartTime,
+            proposals[proposalId].suggestionsEndTime,
+            proposals[proposalId].endTime,
+            proposals[proposalId].maxNumberOfVotesPerVoter,
+            contributionRewardExt,
+            proposals[proposalId].admin
+        );
+    }
+ 
+    /**
+    * @dev submit a competion suggestion
+    * @param _proposalId the proposal id this suggestion is referring to.
+    * @param _descriptionHash a descriptionHash of the suggestion.
+    * @param _beneficiary the beneficiary of this suggestion.
+    * @return suggestionId the suggestionId.
+    */
+    function suggest(
+            bytes32 _proposalId,
+            string calldata _descriptionHash,
+            address payable _beneficiary
+    )
+    external
+    returns(uint256)
+    {
+        if (proposals[_proposalId].admin != address(0)) {
+            require(proposals[_proposalId].admin == msg.sender, "only admin can suggest");
+        }
+        // solhint-disable-next-line not-rely-on-time
+        require(proposals[_proposalId].startTime <= now, "competition not started yet");
+        // solhint-disable-next-line not-rely-on-time
+        require(proposals[_proposalId].suggestionsEndTime > now, "suggestions submission time is over");
+        suggestionsCounter = suggestionsCounter.add(1);
+        suggestions[suggestionsCounter].proposalId = _proposalId;
+        address payable beneficiary;
+        if (_beneficiary == address(0)) {
+            beneficiary = msg.sender;
+        } else {
+            beneficiary = _beneficiary;
+        }
+        suggestions[suggestionsCounter].beneficiary = beneficiary;
+        emit NewSuggestion(_proposalId, suggestionsCounter, _descriptionHash, beneficiary);
+        return suggestionsCounter;
+    }
+ 
+    /**
+    * @dev vote on a suggestion
+    * @param _suggestionId suggestionId
+    * @return bool
+    */
+    function vote(uint256 _suggestionId)
+    external
+    returns(bool)
+    {
+        bytes32 proposalId = suggestions[_suggestionId].proposalId;
+        require(proposalId != bytes32(0), "suggestion does not exist");
+        setSnapshotBlock(proposalId);
+        Avatar avatar = ContributionRewardExt(contributionRewardExt).avatar();
+        uint256 reputation = avatar.nativeReputation().balanceOfAt(msg.sender, proposals[proposalId].snapshotBlock);
+        Erequire(reputation > 0, "voter had no reputation when snapshot was taken");
+        Proposal storage proposal = proposals[proposalId];
+        // solhint-disable-next-line not-rely-on-time
+        Erequire(proposal.endTime > now, "competition ended");
+        Suggestion storage suggestion = suggestions[_suggestionId];
+        require(suggestion.votes[msg.sender] == 0, "already voted on this suggestion");
+        require(proposal.votesPerVoter[msg.sender] < proposal.maxNumberOfVotesPerVoter,
+        "exceed number of votes allowed");
+        proposal.votesPerVoter[msg.sender] = proposal.votesPerVoter[msg.sender].add(1);
+        if (suggestion.totalVotes > 0) {
+            proposal.suggestionsPerVote[suggestion.totalVotes] =
+            proposal.suggestionsPerVote[suggestion.totalVotes].sub(1);
+        }
+        suggestion.totalVotes = suggestion.totalVotes.add(reputation);
+        proposal.suggestionsPerVote[suggestion.totalVotes] = proposal.suggestionsPerVote[suggestion.totalVotes].add(1);
+        suggestion.votes[msg.sender] = reputation;
+        refreshTopSuggestions(proposalId, _suggestionId);
+        emit NewVote(proposalId, _suggestionId, msg.sender, reputation);
+        return true;
+    }
+ 
+    /**
+    * @dev setSnapshotBlock set the block for the reputaion snapshot
+    * this function is public in order to externaly set snapshot block regardless of the first voting event.
+    * @param _proposalId the proposal id
+    */
+    function setSnapshotBlock(bytes32 _proposalId) public {
+        // solhint-disable-next-line not-rely-on-time
+        require(proposals[_proposalId].votingStartTime < now, "voting period not started yet");
+        Erequire(proposals[_proposalId].maxNumberOfVotesPerVoter > 0, "proposal does not exist");
+        if (proposals[_proposalId].snapshotBlock == 0) {
+            proposals[_proposalId].snapshotBlock = block.number;
+            emit SnapshotBlock(_proposalId, block.number);
+        }
+    }
+ 
+    /**
+    * @dev sendLeftOverFund send leftover funds back to the dao.
+    * @param _proposalId the proposal id
+    */
+    function sendLeftOverFunds(bytes32 _proposalId) public {
+        // solhint-disable-next-line not-rely-on-time
+        Erequire(proposals[_proposalId].endTime < now, "competition is still on");
+        Erequire(proposals[_proposalId].maxNumberOfVotesPerVoter > 0, "proposal does not exist");
+        Erequire(_proposalId != bytes32(0), "proposalId is zero");
+        uint256[] memory topSuggestions = proposals[_proposalId].topSuggestions;
+        for (uint256 i = 0; i < topSuggestions.length; i++) {
+            require(suggestions[topSuggestions[i]].beneficiary == address(0), "not all winning suggestions redeemed");
+        }
+ 
+        (, , , , , ,
+        uint256 nativeTokenRewardLeft, ,
+        uint256 ethRewardLeft,
+        uint256 externalTokenRewardLeft,)
+        = ContributionRewardExt(contributionRewardExt).organizationProposals(_proposalId);
+ 
+        Avatar avatar = ContributionRewardExt(contributionRewardExt).avatar();
+ 
+        ContributionRewardExt(contributionRewardExt).redeemExternalTokenByRewarder(
+        _proposalId, address(avatar), externalTokenRewardLeft);
+ 
+        ContributionRewardExt(contributionRewardExt).redeemEtherByRewarder(
+        _proposalId, address(avatar), ethRewardLeft);
+ 
+        ContributionRewardExt(contributionRewardExt).redeemNativeTokenByRewarder(
+        _proposalId, address(avatar), nativeTokenRewardLeft);
+    }
+ 
+    /**
+    * @dev redeem a winning suggestion reward
+    * @param _suggestionId suggestionId
+    */
+    function redeem(uint256 _suggestionId) public {
+        bytes32 proposalId = suggestions[_suggestionId].proposalId;
+        Erequire(proposalId != bytes32(0), "proposalId is zero");
+        Proposal storage proposal = proposals[proposalId];
+        Erequire(_suggestionId > 0, "suggestionId is zero");
+        // solhint-disable-next-line not-rely-on-time
+        require(proposal.endTime < now, "competition is still on");
+        Erequire(proposal.maxNumberOfVotesPerVoter > 0, "proposal does not exist");
+        Erequire(suggestions[_suggestionId].beneficiary != address(0),
+        "suggestion was already redeemed");
+        address payable beneficiary = suggestions[_suggestionId].beneficiary;
+        uint256 orderIndex = getOrderedIndexOfSuggestion(_suggestionId);
+        Erequire(orderIndex < proposal.topSuggestions.length, "suggestion is not in winners list");
+        suggestions[_suggestionId].beneficiary = address(0);
+        uint256 rewardPercentage = 0;
+        uint256 numberOfTieSuggestions = proposal.suggestionsPerVote[suggestions[_suggestionId].totalVotes];
+        uint256 j;
+        //calc the reward percentage for this suggestion
+        for (j = orderIndex; j < (orderIndex+numberOfTieSuggestions) && j < proposal.numberOfWinners; j++) {
+            rewardPercentage = rewardPercentage.add(proposal.rewardSplit[j]);
+        }
+        rewardPercentage = rewardPercentage.div(numberOfTieSuggestions);
+        uint256 rewardPercentageLeft = 0;
+        if (proposal.topSuggestions.length < proposal.numberOfWinners) {
+          //if there are less winners than the proposal number of winners so divide the pre allocated
+          //left reward equally between the winners
+            for (j = proposal.topSuggestions.length; j < proposal.numberOfWinners; j++) {
+                rewardPercentageLeft = rewardPercentageLeft.add(proposal.rewardSplit[j]);
+            }
+            rewardPercentage =
+            rewardPercentage.add(rewardPercentageLeft.div(proposal.topSuggestions.length));
+        }
+        uint256 amount;
+        amount = proposal.externalTokenReward.mul(rewardPercentage).div(100);
+        ContributionRewardExt(contributionRewardExt).redeemExternalTokenByRewarder(
+        proposalId, beneficiary, amount);
+ 
+        amount = proposal.reputationReward.mul(rewardPercentage).div(100);
+        ContributionRewardExt(contributionRewardExt).redeemReputationByRewarder(
+        proposalId, beneficiary, amount);
+ 
+        amount = proposal.ethReward.mul(rewardPercentage).div(100);
+        ContributionRewardExt(contributionRewardExt).redeemEtherByRewarder(
+        proposalId, beneficiary, amount);
+ 
+        amount = proposal.nativeTokenReward.mul(rewardPercentage).div(100);
+        ContributionRewardExt(contributionRewardExt).redeemNativeTokenByRewarder(
+        proposalId, beneficiary, amount);
+        emit Redeem(proposalId, _suggestionId, rewardPercentage);
+    }
+ 
+    /**
+    * @dev getOrderedIndexOfSuggestion return the index of specific suggestion in the winners list.
+    * for the case when the suggestion is NOT in the winners list,
+    * this method will return topSuggestions.length
+    * @param _suggestionId suggestion id
+    */
+    function getOrderedIndexOfSuggestion(uint256 _suggestionId)
+    public
+    view
+    returns(uint256 index) {
+        bytes32 proposalId = suggestions[_suggestionId].proposalId;
+        require(proposalId != bytes32(0), "suggestion does not exist");
+        uint256[] memory topSuggestions = proposals[proposalId].topSuggestions;
+        /** get how many elements are greater than a given element*/
+        for (uint256 i = 0; i < topSuggestions.length; i++) {
+            if (suggestions[topSuggestions[i]].totalVotes > suggestions[_suggestionId].totalVotes) {
+                index++;
+            }
+        }
+    }
+ 
+    /**
+    * @dev refreshTopSuggestions this function maintain a winners list array.
+    * it will check if the given suggestion is among the top suggestions, and if so,
+    * update the list of top suggestions
+    * @param _proposalId proposal id
+    * @param _suggestionId suggestion id
+    */
+    // solhint-disable-next-line code-complexity
+    function refreshTopSuggestions(bytes32 _proposalId, uint256 _suggestionId) private {
+        uint256[] storage topSuggestions = proposals[_proposalId].topSuggestions;
+        uint256 topSuggestionsLength = topSuggestions.length;
+        uint256 i;
+        if (topSuggestionsLength < proposals[_proposalId].numberOfWinners) {
+            for (i = 0; i < topSuggestionsLength; i++) {
+                if (topSuggestions[i] == _suggestionId) {
+                    return;
+                }
+            }
+            topSuggestions.push(_suggestionId);
+        } else {
+         /** get the index of the smallest element **/
+            uint256 smallest = 0;
+            for (i = 0; i < proposals[_proposalId].numberOfWinners; i++) {
+                if (suggestions[topSuggestions[i]].totalVotes <
+                    suggestions[topSuggestions[smallest]].totalVotes) {
+                    smallest = i;
+                } else Iif (topSuggestions[i] == _suggestionId) {
+                  //the suggestion is already in the topSuggestions list
+                    return;
+                }
+            }
+ 
+            Iif (suggestions[topSuggestions[smallest]].totalVotes < suggestions[_suggestionId].totalVotes) {
+                topSuggestions[smallest] = _suggestionId;
+            }
+        }
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/ContinuousLocking4Reputation.sol.html b/coverage/lcov-report/schemes/ContinuousLocking4Reputation.sol.html new file mode 100644 index 00000000..07d383b5 --- /dev/null +++ b/coverage/lcov-report/schemes/ContinuousLocking4Reputation.sol.html @@ -0,0 +1,1022 @@ + + + + Code coverage report for schemes/ContinuousLocking4Reputation.sol + + + + + + + +
+
+

+ all files / schemes/ ContinuousLocking4Reputation.sol +

+
+
+ 100% + Statements + 93/93 +
+
+ 78.57% + Branches + 44/56 +
+
+ 100% + Functions + 11/11 +
+
+ 100% + Lines + 93/93 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +33× +31× +  +31× +29× +  +29× +  +27× +25× +25× +25× +25× +25× +25× +25× +25× +25× +23× +23× +23× +23× +  +  +  +  +  +  +  +  +  +  +16× +14× +14× +14× +  +14× +14× +14× +149× +149× +149× +144× +144× +144× +144× +144× +144× +  +  +14× +14× +  +12× +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +23× +23× +23× +23× +  +21× +21× +  +21× +21× +21× +  +21× +  +21× +  +21× +21× +  +  +19× +107× +107× +107× +107× +  +  +19× +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +13× +  +11× +  +11× +11× + + +  +  + + +  + +100× +100× +100× +100× +  + + +  +  +  +  +  +  +  +  +  +12× +12× +10× +10× +  +10× +  + + + +  +  +  +  +  +  +  +  +  +  +146× +145× +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +289× +289× +289× +  +  +  +  +  +  +311× +  +  +  +  +  +  +158× +  +  +  +  +  +  +  +  +144× +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/math/SafeMath.sol";
+import "openzeppelin-solidity/contracts/math/Math.sol";
+import "../controller/Controller.sol";
+import "../libs/SafeERC20.sol";
+import "./Agreement.sol";
+import { RealMath } from "@daostack/infra/contracts/libs/RealMath.sol";
+ 
+/**
+ * @title A scheme for continuous locking ERC20 Token for reputation
+ */
+ 
+contract ContinuousLocking4Reputation is Agreement {
+    using SafeMath for uint256;
+    using SafeERC20 for address;
+    using RealMath for uint216;
+    using RealMath for uint256;
+    using Math for uint256;
+ 
+    event Redeem(uint256 indexed _lockingId, address indexed _beneficiary, uint256 _amount, uint256 _batchIndex);
+    event Release(uint256 indexed _lockingId, address indexed _beneficiary, uint256 _amount);
+    event LockToken(address indexed _locker, uint256 indexed _lockingId, uint256 _amount, uint256 _period);
+    event ExtendLocking(address indexed _locker, uint256 indexed _lockingId, uint256 _extendPeriod);
+ 
+    struct Batch {
+        uint256 totalScore;
+        // A mapping from lockingId to its score
+        mapping(uint256=>uint) scores;
+    }
+ 
+    struct Lock {
+        uint256 amount;
+        uint256 lockingTime;
+        uint256 period;
+    }
+ 
+    // A mapping from lockers addresses to their locks
+    mapping(address => mapping(uint256=>Lock)) public lockers;
+    // A mapping from batch index to batch
+    mapping(uint256 => Batch) public batches;
+ 
+    Avatar public avatar;
+    uint256 public reputationRewardLeft; // the amount of reputation that is still left to distribute
+    uint256 public startTime; // the time (in secs since epoch) that locking can start (is enable)
+    uint256 public redeemEnableTime;
+    uint256 public maxLockingBatches;
+    uint256 public batchTime; // the length of a batch, in seconds
+    IERC20 public token; // the token to be locked
+    uint256 public lockCounter; // Total number of locks
+    uint256 public totalLockedLeft; // the amount of reputation  that is still left to distribute
+    uint256 public repRewardConstA;
+    uint256 public repRewardConstB;
+    uint256 public batchesIndexCap;
+ 
+    uint256 constant private REAL_FBITS = 40;
+    /**
+     * What's the first non-fractional bit
+     */
+ 
+    uint256 constant private REAL_ONE = uint256(1) << REAL_FBITS;
+    uint256 constant private BATCHES_INDEX_HARDCAP = 100;
+    uint256 constant public MAX_LOCKING_BATCHES_HARDCAP = 24;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _reputationReward the total amount of reputation that can be minted by this contract
+     * @param _startTime locking period start time, in seconds since epoch
+     * @param _redeemEnableTime redeem enable time
+     * @param _batchTime batch time (in seconds)
+     * @param _redeemEnableTime redeem enable time, in seconds since epoch
+     *        redeem reputation can be done after this time.
+     * @param _maxLockingBatches - maximum number of locking batches that a user can lock (or extend) her tokens for
+     * @param _repRewardConstA - the total amount of reputation allocation per batch is calculated by :
+     *   _repRewardConstA * ((_repRewardConstB/1000) ** batchIndex)
+     * @param _repRewardConstB - the total amount of reputation allocation per batch is calculated by :
+     *   _repRewardConstA * ((_repRewardConstB/1000) ** batchIndex). _repRewardConstB must be < 1000
+     * @param _batchesIndexCap the length of the locking period (in batches).
+     *        This value capped by BATCHES_HARDCAP .
+     * @param _token the locking token
+     * @param _agreementHash is a hash of agreement required to be added to the TX by participants
+     */
+    function initialize(
+        Avatar _avatar,
+        uint256 _reputationReward,
+        uint256 _startTime,
+        uint256 _batchTime,
+        uint256 _redeemEnableTime,
+        uint256 _maxLockingBatches,
+        uint256 _repRewardConstA,
+        uint256 _repRewardConstB,
+        uint256 _batchesIndexCap,
+        IERC20 _token,
+        bytes32 _agreementHash )
+    external
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        // _batchTime should be greater than block interval
+        require(_batchTime > 15, "batchTime should be > 15");
+        Erequire(_maxLockingBatches <= MAX_LOCKING_BATCHES_HARDCAP,
+        "maxLockingBatches should be <= MAX_LOCKING_BATCHES_HARDCAP");
+        require(_redeemEnableTime >= _startTime.add(_batchTime),
+        "_redeemEnableTime >= _startTime+_batchTime");
+        require(_batchesIndexCap <= BATCHES_INDEX_HARDCAP, "_batchesIndexCap > BATCHES_INDEX_HARDCAP");
+        token = _token;
+        avatar = _avatar;
+        startTime = _startTime;
+        reputationRewardLeft = _reputationReward;
+        redeemEnableTime = _redeemEnableTime;
+        maxLockingBatches = _maxLockingBatches;
+        batchTime = _batchTime;
+        Erequire(_repRewardConstB < 1000, "_repRewardConstB should be < 1000");
+        require(_repRewardConstA < _reputationReward, "repRewardConstA should be < _reputationReward");
+        repRewardConstA = toReal(uint216(_repRewardConstA));
+        repRewardConstB = uint216(_repRewardConstB).fraction(uint216(1000));
+        batchesIndexCap = _batchesIndexCap;
+        super.setAgreementHash(_agreementHash);
+    }
+ 
+    /**
+     * @dev redeem reputation function
+     * @param _beneficiary the beneficiary to redeem.
+     * @param _lockingId the lockingId to redeem from.
+     * @return uint256 reputation rewarded
+     */
+    function redeem(address _beneficiary, uint256 _lockingId) public returns(uint256 reputation) {
+        // solhint-disable-next-line not-rely-on-time
+        require(now > redeemEnableTime, "now > redeemEnableTime");
+        Lock storage locker = lockers[_beneficiary][_lockingId];
+        Erequire(locker.lockingTime != 0, "_lockingId does not exist");
+        uint256 batchIndexToRedeemFrom = (locker.lockingTime - startTime) / batchTime;
+        // solhint-disable-next-line not-rely-on-time
+        uint256 currentBatch = (now - startTime) / batchTime;
+        uint256 lastBatchIndexToRedeem =  currentBatch.min(batchIndexToRedeemFrom.add(locker.period));
+        for (batchIndexToRedeemFrom; batchIndexToRedeemFrom < lastBatchIndexToRedeem; batchIndexToRedeemFrom++) {
+            Batch storage locking = batches[batchIndexToRedeemFrom];
+            uint256 score = locking.scores[_lockingId];
+            if (score > 0) {
+                locking.scores[_lockingId] = 0;
+                uint256 batchReputationReward = getRepRewardPerBatch(batchIndexToRedeemFrom);
+                uint256 repRelation = mul(toReal(uint216(score)), batchReputationReward);
+                uint256 redeemForBatch = div(repRelation, toReal(uint216(locking.totalScore)));
+                reputation = reputation.add(redeemForBatch);
+                emit Redeem(_lockingId, _beneficiary, uint256(fromReal(redeemForBatch)), batchIndexToRedeemFrom);
+            }
+        }
+        reputation = uint256(fromReal(reputation));
+        require(reputation > 0, "reputation to redeem is 0");
+        // check that the reputation is sum zero
+        reputationRewardLeft = reputationRewardLeft.sub(reputation);
+        Erequire(
+        Controller(avatar.owner())
+        .mintReputation(reputation, _beneficiary, address(avatar)), "mint reputation should succeed");
+    }
+ 
+    /**
+     * @dev lock function
+     * @param _amount the amount of token to lock
+     * @param _period the number of batches that the tokens will be locked for
+     * @param _batchIndexToLockIn the batch index in which the locking period starts.
+     * Must be the currently active batch.
+     * @return lockingId
+     */
+    function lock(uint256 _amount, uint256 _period, uint256 _batchIndexToLockIn, bytes32 _agreementHash)
+    public
+    onlyAgree(_agreementHash)
+    returns(uint256 lockingId)
+    {
+        require(_amount > 0, "_amount should be > 0");
+        // solhint-disable-next-line not-rely-on-time
+        Erequire(now >= startTime, "locking is not enabled yet (it starts at startTime)");
+        Erequire(_period <= maxLockingBatches, "_period exceed the maximum allowed");
+        Erequire(_period > 0, "_period must be > 0");
+        require((_batchIndexToLockIn.add(_period)) <= batchesIndexCap,
+        "_batchIndexToLockIn + _period exceed max allowed batches");
+        lockCounter = lockCounter.add(1);
+        lockingId = lockCounter;
+ 
+        Lock storage locker = lockers[msg.sender][lockingId];
+        locker.amount = _amount;
+        locker.period = _period;
+        // solhint-disable-next-line not-rely-on-time
+        locker.lockingTime = now;
+ 
+        address(token).safeTransferFrom(msg.sender, address(this), _amount);
+        // solhint-disable-next-line not-rely-on-time
+        uint256 batchIndexToLockIn = (now - startTime) / batchTime;
+        require(batchIndexToLockIn == _batchIndexToLockIn,
+        "_batchIndexToLockIn must be the one corresponding to the current one");
+        //fill in the next batches scores.
+        for (uint256 p = 0; p < _period; p++) {
+            Batch storage batch = batches[batchIndexToLockIn + p];
+            uint256 score = (_period - p).mul(_amount);
+            batch.totalScore = batch.totalScore.add(score);
+            batch.scores[lockingId] = score;
+        }
+ 
+        totalLockedLeft = totalLockedLeft.add(_amount);
+        emit LockToken(msg.sender, lockingId, _amount, _period);
+    }
+ 
+    /**
+     * @dev extendLocking function
+     * @param _extendPeriod the period to extend the locking. in batchTime.
+     * @param _batchIndexToLockIn index of the batch in which to start locking.
+     * @param _lockingId the locking id to extend
+     */
+    function extendLocking(
+        uint256 _extendPeriod,
+        uint256 _batchIndexToLockIn,
+        uint256 _lockingId,
+        bytes32 _agreementHash)
+    public
+    onlyAgree(_agreementHash)
+    {
+        Lock storage locker = lockers[msg.sender][_lockingId];
+        require(locker.lockingTime != 0, "_lockingId does not exist");
+        // remainBatchs is the number of future batches that are part of the currently active lock
+        uint256 remainBatches =
+        ((locker.lockingTime.add(locker.period*batchTime).sub(startTime))/batchTime).sub(_batchIndexToLockIn);
+        uint256 batchesCountFromCurrent = remainBatches.add(_extendPeriod);
+        require(batchesCountFromCurrent <= maxLockingBatches, "locking period exceeds the maximum allowed");
+        Erequire(_extendPeriod > 0, "_extendPeriod must be > 0");
+        Erequire((_batchIndexToLockIn.add(batchesCountFromCurrent)) <= batchesIndexCap,
+        "_extendPeriod exceed max allowed batches");
+        // solhint-disable-next-line not-rely-on-time
+        uint256 batchIndexToLockIn = (now - startTime) / batchTime;
+        Erequire(batchIndexToLockIn == _batchIndexToLockIn, "locking is not active");
+        //fill in the next batch scores.
+        for (uint256 p = 0; p < batchesCountFromCurrent; p++) {
+            Batch storage batch = batches[batchIndexToLockIn + p];
+            uint256 score = (batchesCountFromCurrent - p).mul(locker.amount);
+            batch.totalScore = batch.totalScore.add(score).sub(batch.scores[_lockingId]);
+            batch.scores[_lockingId] = score;
+        }
+        locker.period = locker.period.add(_extendPeriod);
+        emit ExtendLocking(msg.sender, _lockingId, _extendPeriod);
+    }
+ 
+    /**
+     * @dev release function
+     * @param _beneficiary the beneficiary for the release
+     * @param _lockingId the locking id to release
+     * @return bool
+     */
+    function release(address _beneficiary, uint256 _lockingId) public returns(uint256 amount) {
+        Lock storage locker = lockers[_beneficiary][_lockingId];
+        require(locker.amount > 0, "no amount left to unlock");
+        amount = locker.amount;
+        locker.amount = 0;
+        // solhint-disable-next-line not-rely-on-time
+        require(block.timestamp > locker.lockingTime.add(locker.period*batchTime),
+        "locking period is still active");
+        totalLockedLeft = totalLockedLeft.sub(amount);
+        address(token).safeTransfer(_beneficiary, amount);
+        emit Release(_lockingId, _beneficiary, amount);
+    }
+ 
+    /**
+     * @dev getRepRewardPerBatch function
+     * the calculation is done the following formula:
+     * RepReward =  repRewardConstA * (repRewardConstB**_batchIndex)
+     * @param _batchIndex the index of the batch to calc rep reward of
+     * @return repReward
+     */
+    function getRepRewardPerBatch(uint256  _batchIndex) public view returns(uint256 repReward) {
+        if (_batchIndex <= batchesIndexCap) {
+            repReward = mul(repRewardConstA, repRewardConstB.pow(_batchIndex));
+        }
+    }
+ 
+    /**
+     * @dev getLockingIdScore function
+     * return score of lockingId at specific bach index
+     * @param _batchIndex batch index
+     * @param _lockingId lockingId
+     * @return score
+     */
+    function getLockingIdScore(uint256  _batchIndex, uint256 _lockingId) public view returns(uint256) {
+        return batches[_batchIndex].scores[_lockingId];
+    }
+ 
+    /**
+     * Multiply one real by another. Truncates overflows.
+     */
+    function mul(uint256 realA, uint256 realB) private pure returns (uint256) {
+        // When multiplying fixed point in x.y and z.w formats we get (x+z).(y+w) format.
+        // So we just have to clip off the extra REAL_FBITS fractional bits.
+        uint256 res = realA * realB;
+        Erequire(res/realA == realB, "RealMath mul overflow");
+        return (res >> REAL_FBITS);
+    }
+ 
+    /**
+     * Convert an integer to a real. Preserves sign.
+     */
+    function toReal(uint216 ipart) private pure returns (uint256) {
+        return uint256(ipart) * REAL_ONE;
+    }
+ 
+    /**
+     * Convert a real to an integer. Preserves sign.
+     */
+    function fromReal(uint256 _realValue) private pure returns (uint216) {
+        return uint216(_realValue / REAL_ONE);
+    }
+ 
+    /**
+     * Divide one real by another real. Truncates overflows.
+     */
+    function div(uint256 realNumerator, uint256 realDenominator) private pure returns (uint256) {
+        // We use the reverse of the multiplication trick: convert numerator from
+        // x.y to (x+z).(y+w) fixed point, then divide by denom in z.w fixed point.
+        return uint256((uint256(realNumerator) * REAL_ONE) / uint256(realDenominator));
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/ContributionRewardExt.sol.html b/coverage/lcov-report/schemes/ContributionRewardExt.sol.html new file mode 100644 index 00000000..904b2de0 --- /dev/null +++ b/coverage/lcov-report/schemes/ContributionRewardExt.sol.html @@ -0,0 +1,1469 @@ + + + + Code coverage report for schemes/ContributionRewardExt.sol + + + + + + + +
+
+

+ all files / schemes/ ContributionRewardExt.sol +

+
+
+ 98.18% + Statements + 108/110 +
+
+ 69.79% + Branches + 67/96 +
+
+ 90% + Functions + 18/20 +
+
+ 98.18% + Lines + 108/110 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +59× +51× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +36× +34× +34× +34× +34× +34× +34× +  +  +  +  +  +  +  +  +  +  +  +18× +18× +18× +15× +  +18× +18× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +34× +34× +19× +  +34× +34× +34× + +  +34× +19× +  +  +32× +  +  +  +  +  +  +  +  +  +  +  +  +32× +  +32× +  +  +  +  +  +  +  +  +  +  +  +32× +  +  +  +  +  +  +  +  +  +  +  +15× +15× +  +  +  +  +13× + + + +  +  + +  + +  + + +  +  +  + +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +10× +10× +  +10× +  + + +  +  +10× +  +10× +10× +10× +10× +  +  +  +  +  +  +  +  +  +10× +10× +  +10× + + +  +  +10× +  +10× +10× +10× +10× +  +  +  +  +  +  +  +  +  + + +  +  + + + +  +  +  + + +  + + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +  +  +12× +  +  +10× +  +  +10× +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +13× +  +  +13× +  +  +  +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +13× +  +  +13× +  +  +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  +13× +13× +  +  +13× +  +  +  +11× +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +18× +15× +  +  +16× +10× +  +  +16× +10× +  +  +16× + +  +  +  +  + +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+import "../libs/SafeERC20.sol";
+ 
+ 
+/**
+ * @title A scheme for proposing and rewarding contributions to an organization
+ * @dev An agent can ask an organization to recognize a contribution and reward
+ * him with token, reputation, ether or any combination.
+ * This scheme extend the functionality of the ContributionReward scheme.
+ * It enable to assign a rewarder, which, after the contributionreward has been accepted,
+ * can then later distribute the assets as it would like.
+ */
+contract ContributionRewardExt is VotingMachineCallbacks, ProposalExecuteInterface {
+    using SafeMath for uint;
+    using SafeERC20 for address;
+ 
+    event NewContributionProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        string _descriptionHash,
+        int256 _reputationChange,
+        uint[3]  _rewards,
+        IERC20 _externalToken,
+        address _beneficiary,
+        address _proposer
+    );
+ 
+    event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param);
+ 
+    event RedeemReputation(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        int256 _amount);
+ 
+    event RedeemEther(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        uint256 _amount);
+ 
+    event RedeemNativeToken(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        uint256 _amount);
+ 
+    event RedeemExternalToken(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        uint256 _amount);
+ 
+    // A struct holding the data for a contribution proposal
+    struct ContributionProposal {
+        uint256 nativeTokenReward; // Reward asked in the native token of the organization.
+        int256 reputationChange; // Organization reputation reward requested.
+        uint256 ethReward;
+        IERC20 externalToken;
+        uint256 externalTokenReward;
+        address payable beneficiary;
+        uint256 nativeTokenRewardLeft;
+        uint256 reputationChangeLeft;
+        uint256 ethRewardLeft;
+        uint256 externalTokenRewardLeft;
+        bool acceptedByVotingMachine;
+    }
+ 
+    modifier onlyRewarder() {
+        require(msg.sender == rewarder, "msg.sender is not authorized");
+        _;
+    }
+ 
+    mapping(bytes32=>ContributionProposal) public organizationProposals;
+ 
+    IntVoteInterface public votingMachine;
+    bytes32 public voteParams;
+    Avatar public avatar;
+    address public rewarder;
+ 
+    /**
+    * @dev enables this contract to receive ethers
+    */
+    function() external payable {
+    }
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _votingMachine the voting machines address
+     * @param _voteParams voting machine parameters
+     * @param _rewarder an address which allowed to redeem the contribution.
+       if _rewarder is 0 this param is agnored.
+     */
+    function initialize(
+        Avatar _avatar,
+        IntVoteInterface _votingMachine,
+        bytes32 _voteParams,
+        address _rewarder
+    )
+    external
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        Erequire(_votingMachine != IntVoteInterface(0), "votingMachine cannot be zero");
+        avatar = _avatar;
+        votingMachine = _votingMachine;
+        voteParams = _voteParams;
+        rewarder = _rewarder;
+    }
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the proposal in the voting machine
+    * @param _decision a parameter of the voting result, 1 yes and 2 is no.
+    */
+    function executeProposal(bytes32 _proposalId, int256 _decision)
+    external
+    onlyVotingMachine(_proposalId)
+    returns(bool) {
+        Erequire(organizationProposals[_proposalId].acceptedByVotingMachine == false);
+        Erequire(organizationProposals[_proposalId].beneficiary != address(0));
+        if (_decision == 1) {
+            organizationProposals[_proposalId].acceptedByVotingMachine = true;
+        }
+        emit ProposalExecuted(address(avatar), _proposalId, _decision);
+        return true;
+    }
+ 
+    /**
+    * @dev Submit a proposal for a reward for a contribution:
+    * @param _descriptionHash A hash of the proposal's description
+    * @param _reputationChange - Amount of reputation change requested .Can be negative.
+    * @param _rewards rewards array:
+    *         rewards[0] - Amount of tokens requested
+    *         rewards[1] - Amount of ETH requested
+    *         rewards[2] - Amount of external tokens
+    * @param _externalToken Address of external token, if reward is requested there
+    * @param _beneficiary Who gets the rewards. if equal to 0 the beneficiary will be msg.sender.
+    * @param _proposer proposer . if equal to 0 the proposer will be msg.sender.
+    */
+    function proposeContributionReward(
+        string memory _descriptionHash,
+        int256 _reputationChange,
+        uint[3] memory _rewards,
+        IERC20 _externalToken,
+        address payable _beneficiary,
+        address _proposer
+    )
+    public
+    returns(bytes32 proposalId)
+    {
+        address proposer = _proposer;
+        if (proposer == address(0)) {
+            proposer = msg.sender;
+        }
+        proposalId = votingMachine.propose(2, voteParams, proposer, address(avatar));
+        address payable beneficiary = _beneficiary;
+        if (beneficiary == address(0)) {
+            beneficiary = msg.sender;
+        }
+        if (beneficiary == address(this)) {
+            require(_reputationChange >= 0, "negative rep change not allowed for this case");
+        }
+ 
+        ContributionProposal memory proposal = ContributionProposal({
+            nativeTokenReward: _rewards[0],
+            reputationChange: _reputationChange,
+            ethReward: _rewards[1],
+            externalToken: _externalToken,
+            externalTokenReward: _rewards[2],
+            beneficiary: beneficiary,
+            nativeTokenRewardLeft: 0,
+            reputationChangeLeft: 0,
+            ethRewardLeft: 0,
+            externalTokenRewardLeft: 0,
+            acceptedByVotingMachine: false
+        });
+        organizationProposals[proposalId] = proposal;
+ 
+        emit NewContributionProposal(
+            address(avatar),
+            proposalId,
+            address(votingMachine),
+            _descriptionHash,
+            _reputationChange,
+            _rewards,
+            _externalToken,
+            beneficiary,
+            proposer
+        );
+ 
+        proposalsInfo[address(votingMachine)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:avatar
+        });
+    }
+ 
+    /**
+    * @dev RedeemReputation reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @return reputation the redeemed reputation.
+    */
+    function redeemReputation(bytes32 _proposalId) public returns(int256 reputation) {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        require(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+ 
+        //if the beneficiary is the current contract, we are not minting the rep to it
+        //but instead refer to a mechanism in which the rep can be minted by the current contract
+        //per request of the rewarder
+        if (proposal.beneficiary == address(this)) {
+            Eif (proposal.reputationChangeLeft == 0) {//for now only mint(not burn) rep allowed from ext contract.
+                proposal.reputationChangeLeft = uint256(proposal.reputationChange);
+                proposal.reputationChange = 0;
+            }
+        } else {
+            reputation = proposal.reputationChange;
+            //set proposal reward to zero to prevent reentrancy attack.
+            proposal.reputationChange = 0;
+ 
+            if (reputation > 0) {
+                Erequire(
+                Controller(
+                avatar.owner()).mintReputation(uint(reputation), proposal.beneficiary, address(avatar)));
+            } else if (reputation < 0) {
+                Erequire(
+                Controller(
+                avatar.owner()).burnReputation(uint(reputation*(-1)), proposal.beneficiary, address(avatar)));
+            }
+            if (reputation != 0) {
+                emit RedeemReputation(address(avatar), _proposalId, proposal.beneficiary, reputation);
+            }
+        }
+    }
+ 
+    /**
+    * @dev RedeemNativeToken reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @return amount the redeemed nativeToken.
+    */
+    function redeemNativeToken(bytes32 _proposalId) public returns(uint256 amount) {
+ 
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+ 
+        if (proposal.beneficiary == address(this)) {
+            //ensure nativeTokenRewardLeft can be set only one time
+            Eif (proposal.nativeTokenRewardLeft == 0) {
+                proposal.nativeTokenRewardLeft = proposal.nativeTokenReward;
+            }
+        }
+        amount = proposal.nativeTokenReward;
+        //set proposal rewards to zero to prevent reentrancy attack.
+        proposal.nativeTokenReward = 0;
+        Eif (amount > 0) {
+            Erequire(Controller(avatar.owner()).mintTokens(amount, proposal.beneficiary, address(avatar)));
+            emit RedeemNativeToken(address(avatar), _proposalId, proposal.beneficiary, amount);
+        }
+    }
+ 
+    /**
+    * @dev RedeemEther reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @return amount ether redeemed amount
+    */
+    function redeemEther(bytes32 _proposalId) public returns(uint256 amount) {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+ 
+        if (proposal.beneficiary == address(this)) {
+            Eif (proposal.ethRewardLeft == 0) {
+                proposal.ethRewardLeft = proposal.ethReward;
+            }
+        }
+        amount = proposal.ethReward;
+        //set proposal rewards to zero to prevent reentrancy attack.
+        proposal.ethReward = 0;
+        Eif (amount > 0) {
+            Erequire(Controller(avatar.owner()).sendEther(amount, proposal.beneficiary, avatar));
+            emit RedeemEther(address(avatar), _proposalId, proposal.beneficiary, amount);
+        }
+    }
+ 
+    /**
+    * @dev RedeemNativeToken reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @return amount the external token redeemed amount
+    */
+    function redeemExternalToken(bytes32 _proposalId) public returns(uint256 amount) {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+ 
+ 
+        if (proposal.beneficiary == address(this)) {
+            Eif (proposal.externalTokenRewardLeft == 0) {
+                proposal.externalTokenRewardLeft = proposal.externalTokenReward;
+            }
+        }
+ 
+        Eif (proposal.externalToken != IERC20(0) && proposal.externalTokenReward > 0) {
+            amount = proposal.externalTokenReward;
+            //set proposal rewards to zero to prevent reentrancy attack.
+            proposal.externalTokenReward = 0;
+            Erequire(
+            Controller(
+            avatar.owner())
+            .externalTokenTransfer(proposal.externalToken, proposal.beneficiary, amount, avatar));
+            emit RedeemExternalToken(address(avatar), _proposalId, proposal.beneficiary, amount);
+        }
+    }
+ 
+    /**
+    * @dev redeemReputationByRewarder redeem reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _beneficiary the beneficiary to mint reputation to.
+    * @param _reputation the reputation amount to mint
+    *        note: burn reputation is not supported via this function
+    */
+    function redeemReputationByRewarder(bytes32 _proposalId, address _beneficiary, uint256 _reputation)
+    public
+    onlyRewarder
+    {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+        //this will ensure sum zero of reputation
+        //and that there was a privious call to redeemReputation function.
+        proposal.reputationChangeLeft =
+        proposal.reputationChangeLeft.sub(_reputation,
+        "cannot redeem more reputation than allocated for this proposal or no redeemReputation was called");
+        Erequire(
+        Controller(
+        avatar.owner()).mintReputation(_reputation, _beneficiary, address(avatar)));
+        Eif (_reputation != 0) {
+            emit RedeemReputation(address(avatar), _proposalId, _beneficiary, int256(_reputation));
+        }
+    }
+ 
+    /**
+    * @dev redeemNativeTokenByRewarder redeem reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _beneficiary the beneficiary to mint tokens to.
+    * @param _amount the tokens amount to mint
+    */
+    function redeemNativeTokenByRewarder(bytes32 _proposalId, address _beneficiary, uint256 _amount)
+    public
+    onlyRewarder
+    {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+        //this will ensure sum zero of reputation
+        //and that there was a privious call to redeemNativeToken function.
+        proposal.nativeTokenRewardLeft =
+        proposal.nativeTokenRewardLeft.sub(_amount,
+        "cannot redeem more tokens than allocated for this proposal or no redeemNativeToken was called");
+ 
+        Eif (_amount > 0) {
+            address(avatar.nativeToken()).safeTransfer(_beneficiary, _amount);
+            emit RedeemNativeToken(address(avatar), _proposalId, _beneficiary, _amount);
+        }
+    }
+ 
+    /**
+    * @dev redeemEtherByRewarder redeem reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _beneficiary the beneficiary to send eth to.
+    * @param _amount eth amount to send
+    */
+    function redeemEtherByRewarder(bytes32 _proposalId, address payable _beneficiary, uint256 _amount)
+    public
+    onlyRewarder
+    {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+        //this will ensure sum zero of reputation.
+        //and that there was a privious call to redeemEther function.
+        proposal.ethRewardLeft = proposal.ethRewardLeft.sub(_amount,
+        "cannot redeem more Ether than allocated for this proposal or no redeemEther was called");
+ 
+        Eif (_amount > 0) {
+            _beneficiary.transfer(_amount);
+            emit RedeemEther(address(avatar), _proposalId, _beneficiary, _amount);
+        }
+    }
+ 
+    /**
+    * @dev redeemExternalTokenByRewarder redeem reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _beneficiary the beneficiary to send the external token to.
+    * @param _amount the amount of external token to send
+    */
+    function redeemExternalTokenByRewarder(bytes32 _proposalId, address _beneficiary, uint256 _amount)
+    public
+    onlyRewarder {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+        //this will ensure sum zero of reputation.
+        //and that there was a privious call to redeemExternalToken function.
+        proposal.externalTokenRewardLeft =
+        proposal.externalTokenRewardLeft.sub(_amount,
+        "cannot redeem more tokens than allocated for this proposal or no redeemExternalToken was called");
+ 
+        Eif (proposal.externalToken != IERC20(0)) {
+            Eif (_amount > 0) {
+                address(proposal.externalToken).safeTransfer(_beneficiary, _amount);
+                emit RedeemExternalToken(address(avatar), _proposalId, _beneficiary, _amount);
+            }
+        }
+    }
+ 
+    /**
+    * @dev redeem rewards for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _whatToRedeem whatToRedeem array of boolean values:
+    *         whatToRedeem[0] - reputation
+    *         whatToRedeem[1] - nativeTokenReward
+    *         whatToRedeem[2] - Ether
+    *         whatToRedeem[3] - ExternalToken
+    * @return  result boolean array for each redeem type.
+    */
+    function redeem(bytes32 _proposalId, bool[4] memory _whatToRedeem)
+    public
+    returns(int256 reputationReward, uint256 nativeTokenReward, uint256 etherReward, uint256 externalTokenReward)
+    {
+ 
+        if (_whatToRedeem[0]) {
+            reputationReward = redeemReputation(_proposalId);
+        }
+ 
+        if (_whatToRedeem[1]) {
+            nativeTokenReward = redeemNativeToken(_proposalId);
+        }
+ 
+        if (_whatToRedeem[2]) {
+            etherReward = redeemEther(_proposalId);
+        }
+ 
+        if (_whatToRedeem[3]) {
+            externalTokenReward = redeemExternalToken(_proposalId);
+        }
+    }
+ 
+    function getProposalEthReward(bytes32 _proposalId) public view returns (uint256) {
+        return organizationProposals[_proposalId].ethReward;
+    }
+ 
+    function getProposalExternalTokenReward(bytes32 _proposalId) public view returns (uint256) {
+        return organizationProposals[_proposalId].externalTokenReward;
+    }
+ 
+    function getProposalExternalToken(bytes32 _proposalId) public view returns (address) {
+        return address(organizationProposals[_proposalId].externalToken);
+    }
+ 
+    function getProposalReputationReward(bytes32 _proposalId) public view returns (int256) {
+        return organizationProposals[_proposalId].reputationChange;
+    }
+ 
+    function getProposalNativeTokenReward(bytes32 _proposalId) public view returns (uint256) {
+        return organizationProposals[_proposalId].nativeTokenReward;
+    }
+ 
+    function getProposalAcceptedByVotingMachine(bytes32 _proposalId) public view returns (bool) {
+        return organizationProposals[_proposalId].acceptedByVotingMachine;
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/CurveInterface.sol.html b/coverage/lcov-report/schemes/CurveInterface.sol.html new file mode 100644 index 00000000..f0ba6db2 --- /dev/null +++ b/coverage/lcov-report/schemes/CurveInterface.sol.html @@ -0,0 +1,86 @@ + + + + Code coverage report for schemes/CurveInterface.sol + + + + + + + +
+
+

+ all files / schemes/ CurveInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8  +  +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+interface CurveInterface {
+ 
+    function calc(uint) external pure returns (uint);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/ExternalLocking4Reputation.sol.html b/coverage/lcov-report/schemes/ExternalLocking4Reputation.sol.html new file mode 100644 index 00000000..a7f70bdc --- /dev/null +++ b/coverage/lcov-report/schemes/ExternalLocking4Reputation.sol.html @@ -0,0 +1,353 @@ + + + + Code coverage report for schemes/ExternalLocking4Reputation.sol + + + + + + + +
+
+

+ all files / schemes/ ExternalLocking4Reputation.sol +

+
+
+ 100% + Statements + 18/18 +
+
+ 83.33% + Branches + 10/12 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 19/19 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× +23× +23× +23× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +22× +22× +19× +  + + +  +20× +18× +18× +  +  +18× +18× +  +18× +  +  +18× +  +  +  +  +  +  +  + + +  +  + 
pragma solidity 0.5.17;
+ 
+import "./Locking4Reputation.sol";
+ 
+/**
+ * @title A scheme for external locking Tokens for reputation
+ */
+ 
+contract ExternalLocking4Reputation is Locking4Reputation {
+ 
+    event Register(address indexed _beneficiary);
+ 
+    address public externalLockingContract;
+    string public getBalanceFuncSignature;
+ 
+    // locker -> bool
+    mapping(address => bool) public externalLockers;
+    //      beneficiary -> bool
+    mapping(address     => bool) public registrar;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _reputationReward the total reputation this contract will reward
+     *        for the token locking
+     * @param _claimingStartTime claiming starting period time.
+     * @param _claimingEndTime the claiming end time.
+     *        claiming is disable after this time.
+     * @param _redeemEnableTime redeem enable time .
+     *        redeem reputation can be done after this time.
+     * @param _externalLockingContract the contract which lock the token.
+     * @param _getBalanceFuncSignature get balance function signature
+     *        e.g "lockedTokenBalances(address)"
+     */
+    function initialize(
+        Avatar _avatar,
+        uint256 _reputationReward,
+        uint256 _claimingStartTime,
+        uint256 _claimingEndTime,
+        uint256 _redeemEnableTime,
+        address _externalLockingContract,
+        string calldata _getBalanceFuncSignature,
+        bytes32 _agreementHash)
+    external
+    {
+        Erequire(_claimingEndTime > _claimingStartTime, "_claimingEndTime should be greater than _claimingStartTime");
+        externalLockingContract = _externalLockingContract;
+        getBalanceFuncSignature = _getBalanceFuncSignature;
+        super._initialize(
+        _avatar,
+        _reputationReward,
+        _claimingStartTime,
+        _claimingEndTime,
+        _redeemEnableTime,
+        1,
+        _agreementHash);
+    }
+ 
+    /**
+     * @dev claim function
+     * @param _beneficiary the beneficiary address to claim for
+     *        if _beneficiary == 0 the claim will be for the msg.sender.
+     * @return claimId
+     */
+    function claim(address _beneficiary, bytes32 _agreementHash) public returns(bytes32) {
+        require(avatar != Avatar(0), "should initialize first");
+        address beneficiary;
+        if (_beneficiary == address(0)) {
+            beneficiary = msg.sender;
+        } else {
+            require(registrar[_beneficiary], "beneficiary should be register");
+            beneficiary = _beneficiary;
+        }
+        require(externalLockers[beneficiary] == false, "claiming twice for the same beneficiary is not allowed");
+        externalLockers[beneficiary] = true;
+        (bool result, bytes memory returnValue) =
+        // solhint-disable-next-line avoid-call-value,avoid-low-level-calls
+        externalLockingContract.call(abi.encodeWithSignature(getBalanceFuncSignature, beneficiary));
+        Erequire(result, "call to external contract should succeed");
+        uint256 lockedAmount;
+        // solhint-disable-next-line no-inline-assembly
+        assembly {
+            lockedAmount := mload(add(returnValue, 0x20))
+        }
+        return super._lock(lockedAmount, 1, beneficiary, 1, 1, _agreementHash);
+    }
+ 
+   /**
+    * @dev register function
+    *      register for external locking claim
+    */
+    function register(bytes32 _agreementHash) public onlyAgree(_agreementHash) {
+        registrar[msg.sender] = true;
+        emit Register(msg.sender);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/FixedReputationAllocation.sol.html b/coverage/lcov-report/schemes/FixedReputationAllocation.sol.html new file mode 100644 index 00000000..46391248 --- /dev/null +++ b/coverage/lcov-report/schemes/FixedReputationAllocation.sol.html @@ -0,0 +1,353 @@ + + + + Code coverage report for schemes/FixedReputationAllocation.sol + + + + + + + +
+
+

+ all files / schemes/ FixedReputationAllocation.sol +

+
+
+ 100% + Statements + 20/20 +
+
+ 81.25% + Branches + 13/16 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 21/21 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +14× +12× +12× +12× +12× +  +  +  +  +  +  +  +  +31× +29× +25× +  +25× +23× +  +  +  +  +21× +  +21× +  +  +  +  +  +  +  +63× +  +63× +63× +63× +  +63× +  +  +  +  +  +  +  +  + +60× +  +  +  +  +  +  +  + +  + +  +  + 
pragma solidity 0.5.17;
+ 
+import "../controller/Controller.sol";
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+ 
+ 
+/**
+ * @title A fixed reputation allocation contract
+ * This scheme can be used to allocate a pre define amount of reputation to whitelisted
+ * beneficiaries.
+ */
+contract FixedReputationAllocation is Ownable {
+    using SafeMath for uint256;
+ 
+    event Redeem(address indexed _beneficiary, uint256 _amount);
+    event BeneficiaryAddressAdded(address indexed _beneficiary);
+ 
+    // beneficiary -> exist
+    mapping(address => bool) public beneficiaries;
+ 
+    Avatar public avatar;
+    uint256 public reputationReward;
+    bool public isEnable;
+    uint256 public numberOfBeneficiaries;
+    uint256 public beneficiaryReward;
+    uint256 public redeemEnableTime;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _reputationReward the total reputation this contract will reward
+     * @param _redeemEnableTime time to enable redeem
+     */
+    function initialize(Avatar _avatar, uint256 _reputationReward, uint256 _redeemEnableTime) external onlyOwner {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        reputationReward = _reputationReward;
+        redeemEnableTime = _redeemEnableTime;
+        avatar = _avatar;
+    }
+ 
+    /**
+     * @dev redeem reputation function
+     * @param _beneficiary the beneficiary for the release
+     * @return bool
+     */
+    function redeem(address _beneficiary) public returns(bool) {
+        require(isEnable, "require to be enable");
+        require(beneficiaries[_beneficiary], "require _beneficiary to exist in the beneficiaries map");
+        beneficiaries[_beneficiary] = false;
+        // solhint-disable-next-line not-rely-on-time
+        require(now > redeemEnableTime, "require now > redeemEnableTime");
+        require(
+        Controller(
+        avatar.owner())
+        .mintReputation(beneficiaryReward, _beneficiary, address(avatar)), "mint reputation failed");
+ 
+        emit Redeem(_beneficiary, beneficiaryReward);
+ 
+        return true;
+    }
+ 
+    /**
+     * @dev addBeneficiary function
+     * @param _beneficiary to be whitelisted
+     */
+    function addBeneficiary(address _beneficiary) public onlyOwner {
+        Erequire(!isEnable, "can add beneficiary only if not already enable");
+ 
+        Eif (!beneficiaries[_beneficiary]) {
+            beneficiaries[_beneficiary] = true;
+            numberOfBeneficiaries++;
+ 
+            emit BeneficiaryAddressAdded(_beneficiary);
+        }
+    }
+ 
+    /**
+     * @dev add addBeneficiaries function
+     * @param _beneficiaries addresses
+     */
+    function addBeneficiaries(address[] memory _beneficiaries) public onlyOwner {
+        for (uint256 i = 0; i < _beneficiaries.length; i++) {
+            addBeneficiary(_beneficiaries[i]);
+        }
+    }
+ 
+    /**
+     * @dev enable function
+     */
+    function enable() public onlyOwner {
+        isEnable = true;
+        // Calculate beneficiary reward
+        beneficiaryReward = reputationReward.div(numberOfBeneficiaries);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/Forwarder.sol.html b/coverage/lcov-report/schemes/Forwarder.sol.html new file mode 100644 index 00000000..121d8221 --- /dev/null +++ b/coverage/lcov-report/schemes/Forwarder.sol.html @@ -0,0 +1,215 @@ + + + + Code coverage report for schemes/Forwarder.sol + + + + + + + +
+
+

+ all files / schemes/ Forwarder.sol +

+
+
+ 100% + Statements + 9/9 +
+
+ 80% + Branches + 8/10 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 9/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + + +  +  +  +  +  +  +  +  +12× +10× +10× +10× +  +  +  +  +  +  +  +  + + +  +  + 
pragma solidity 0.5.17;
+ 
+import "../controller/Controller.sol";
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+ 
+/**
+ * @title A scheme to forward a call to a dao.
+ *        The scheme can unregister itself when its expirationTime reached.
+ */
+ 
+ 
+contract Forwarder is Ownable {
+ 
+    Avatar public avatar;
+    uint256 public expirationTime;
+ 
+    /**
+     * @dev forwardCall forward a call to the dao controller
+     */
+    // solhint-disable-next-line no-complex-fallback,payable-fallback
+    function () external onlyOwner {
+        // solhint-disable-next-line not-rely-on-time
+        require(expirationTime > now, "expirationTime > now");
+        // solhint-disable-next-line avoid-low-level-calls
+        (bool result,) = avatar.owner().call(msg.data);
+        Erequire(result);
+    }
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar of the dao to forward the call to
+     * @param _expirationTime the expirationTime to forwardCall
+     */
+    function initialize(Avatar _avatar, uint256 _expirationTime) external onlyOwner {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        avatar = _avatar;
+        expirationTime = _expirationTime;
+    }
+ 
+    /**
+     * @dev unregisterSelf function
+     * @return bool
+     */
+    function unregisterSelf() public returns(bool) {
+       // solhint-disable-next-line not-rely-on-time
+        require(expirationTime <= now, "expirationTime <= now");
+        return Controller(avatar.owner()).unregisterSelf(address(avatar));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/GenericScheme.sol.html b/coverage/lcov-report/schemes/GenericScheme.sol.html new file mode 100644 index 00000000..8e8045af --- /dev/null +++ b/coverage/lcov-report/schemes/GenericScheme.sol.html @@ -0,0 +1,518 @@ + + + + Code coverage report for schemes/GenericScheme.sol + + + + + + + +
+
+

+ all files / schemes/ GenericScheme.sol +

+
+
+ 100% + Statements + 32/32 +
+
+ 81.25% + Branches + 13/16 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 34/34 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +11× +11× +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + + + +  + + +  +  + + +  +  +  +  +  +  +  +14× +14× +12× +10× +10× +10× +10× +10× +  +10× + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +10× +  +  +  +  +  +10× +  +  +  +10× +10× +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+/**
+ * @title GenericScheme.
+ * @dev  A scheme for proposing and executing calls to an arbitrary function
+ * on a specific contract on behalf of the organization avatar.
+ */
+contract GenericScheme is VotingMachineCallbacks, ProposalExecuteInterface {
+    event NewCallProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        bytes   _callData,
+        uint256 _value,
+        string  _descriptionHash
+    );
+ 
+    event ProposalExecuted(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        bytes _genericCallReturnValue
+    );
+ 
+    event ProposalExecutedByVotingMachine(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        int256 _param
+    );
+ 
+    event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId);
+ 
+    // Details of a voting proposal:
+    struct CallProposal {
+        bytes callData;
+        uint256 value;
+        bool exist;
+        bool passed;
+    }
+ 
+    mapping(bytes32=>CallProposal) public organizationProposals;
+ 
+    IntVoteInterface public votingMachine;
+    bytes32 public voteParams;
+    address public contractToCall;
+    Avatar public avatar;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _votingMachine the voting machines address to
+     * @param _voteParams voting machine parameters.
+     * @param _contractToCall the target contract this scheme will call to
+     */
+    function initialize(
+        Avatar _avatar,
+        IntVoteInterface _votingMachine,
+        bytes32 _voteParams,
+        address _contractToCall
+    )
+    external
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        avatar = _avatar;
+        votingMachine = _votingMachine;
+        voteParams = _voteParams;
+        contractToCall = _contractToCall;
+    }
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _decision a parameter of the voting result, 1 yes and 2 is no.
+    * @return bool success
+    */
+    function executeProposal(bytes32 _proposalId, int256 _decision)
+    external
+    onlyVotingMachine(_proposalId)
+    returns(bool) {
+        CallProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.exist, "must be a live proposal");
+        Erequire(proposal.passed == false, "cannot execute twice");
+ 
+        if (_decision == 1) {
+            proposal.passed = true;
+            execute(_proposalId);
+        } else {
+            delete organizationProposals[_proposalId];
+            emit ProposalDeleted(address(avatar), _proposalId);
+        }
+ 
+        emit ProposalExecutedByVotingMachine(address(avatar), _proposalId, _decision);
+        return true;
+    }
+ 
+    /**
+    * @dev execution of proposals after it has been decided by the voting machine
+    * @param _proposalId the ID of the voting in the voting machine
+    */
+    function execute(bytes32 _proposalId) public {
+        CallProposal storage proposal = organizationProposals[_proposalId];
+        require(proposal.exist, "must be a live proposal");
+        require(proposal.passed, "proposal must passed by voting machine");
+        proposal.exist = false;
+        bytes memory genericCallReturnValue;
+        bool success;
+        Controller controller = Controller(avatar.owner());
+        (success, genericCallReturnValue) =
+        controller.genericCall(contractToCall, proposal.callData, avatar, proposal.value);
+        if (success) {
+            delete organizationProposals[_proposalId];
+            emit ProposalDeleted(address(avatar), _proposalId);
+            emit ProposalExecuted(address(avatar), _proposalId, genericCallReturnValue);
+        } else {
+            proposal.exist = true;
+        }
+    }
+ 
+    /**
+    * @dev propose to call on behalf of the _avatar
+    *      The function trigger NewCallProposal event
+    * @param _callData - The abi encode data for the call
+    * @param _value value(ETH) to transfer with the call
+    * @param _descriptionHash proposal description hash
+    * @return an id which represents the proposal
+    */
+    function proposeCall(bytes memory _callData, uint256 _value, string memory _descriptionHash)
+    public
+    returns(bytes32)
+    {
+        bytes32 proposalId = votingMachine.propose(2, voteParams, msg.sender, address(avatar));
+ 
+        organizationProposals[proposalId] = CallProposal({
+            callData: _callData,
+            value: _value,
+            exist: true,
+            passed: false
+        });
+        proposalsInfo[address(votingMachine)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:avatar
+        });
+        emit NewCallProposal(address(avatar), proposalId, _callData, _value, _descriptionHash);
+        return proposalId;
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/Locking4Reputation.sol.html b/coverage/lcov-report/schemes/Locking4Reputation.sol.html new file mode 100644 index 00000000..4c795511 --- /dev/null +++ b/coverage/lcov-report/schemes/Locking4Reputation.sol.html @@ -0,0 +1,566 @@ + + + + Code coverage report for schemes/Locking4Reputation.sol + + + + + + + +
+
+

+ all files / schemes/ Locking4Reputation.sol +

+
+
+ 100% + Statements + 46/46 +
+
+ 87.5% + Branches + 28/32 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 46/46 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +37× +25× +19× +19× +19× +19× +  +  +19× +19× +  +  +  +  +19× +  +  +  +  +  +  +  +  +  +13× +13× + + +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +64× +58× +54× +  +48× +  +42× +  +38× +38× +  +38× +38× +  +38× +38× +38× +38× +38× +38× +  +38× +  +37× +  +37× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +75× +69× +69× +69× +  +63× +63× +63× +63× +63× +63× +63× +63× +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "../controller/Controller.sol";
+import "./Agreement.sol";
+ 
+/**
+ * @title A locker contract
+ */
+ 
+contract Locking4Reputation is Agreement {
+    using SafeMath for uint256;
+ 
+    event Redeem(address indexed _beneficiary, uint256 _amount);
+    event Release(bytes32 indexed _lockingId, address indexed _beneficiary, uint256 _amount);
+    event Lock(address indexed _locker, bytes32 indexed _lockingId, uint256 _amount, uint256 _period);
+ 
+    struct Locker {
+        uint256 amount;
+        uint256 releaseTime;
+    }
+ 
+    Avatar public avatar;
+ 
+    // A mapping from lockers addresses their lock balances.
+    mapping(address => mapping(bytes32=>Locker)) public lockers;
+    // A mapping from lockers addresses to their scores.
+    mapping(address => uint) public scores;
+ 
+    uint256 public totalLocked;
+    uint256 public totalLockedLeft;
+    uint256 public totalScore;
+    uint256 public lockingsCounter; // Total number of lockings
+    uint256 public reputationReward;
+    uint256 public reputationRewardLeft;
+    uint256 public lockingEndTime;
+    uint256 public maxLockingPeriod;
+    uint256 public lockingStartTime;
+    uint256 public redeemEnableTime;
+ 
+    /**
+     * @dev redeem reputation function
+     * @param _beneficiary the beneficiary for the release
+     * @return uint256 reputation rewarded
+     */
+    function redeem(address _beneficiary) public returns(uint256 reputation) {
+        // solhint-disable-next-line not-rely-on-time
+        require(block.timestamp > redeemEnableTime, "now > redeemEnableTime");
+        require(scores[_beneficiary] > 0, "score should be > 0");
+        uint256 score = scores[_beneficiary];
+        scores[_beneficiary] = 0;
+        uint256 repRelation = score.mul(reputationReward);
+        reputation = repRelation.div(totalScore);
+ 
+        //check that the reputation is sum zero
+        reputationRewardLeft = reputationRewardLeft.sub(reputation);
+        Erequire(
+        Controller(
+        avatar.owner())
+        .mintReputation(reputation, _beneficiary, address(avatar)), "mint reputation should succeed");
+ 
+        emit Redeem(_beneficiary, reputation);
+    }
+ 
+    /**
+     * @dev release function
+     * @param _beneficiary the beneficiary for the release
+     * @param _lockingId the locking id to release
+     * @return bool
+     */
+    function _release(address _beneficiary, bytes32 _lockingId) internal returns(uint256 amount) {
+        Locker storage locker = lockers[_beneficiary][_lockingId];
+        require(locker.amount > 0, "amount should be > 0");
+        amount = locker.amount;
+        locker.amount = 0;
+        // solhint-disable-next-line not-rely-on-time
+        require(block.timestamp > locker.releaseTime, "check the lock period pass");
+        totalLockedLeft = totalLockedLeft.sub(amount);
+ 
+        emit Release(_lockingId, _beneficiary, amount);
+    }
+ 
+    /**
+     * @dev lock function
+     * @param _amount the amount to lock
+     * @param _period the locking period
+     * @param _locker the locker
+     * @param _numerator price numerator
+     * @param _denominator price denominator
+     * @return lockingId
+     */
+    function _lock(
+        uint256 _amount,
+        uint256 _period,
+        address _locker,
+        uint256 _numerator,
+        uint256 _denominator,
+        bytes32 _agreementHash)
+        internal
+        onlyAgree(_agreementHash)
+        returns(bytes32 lockingId)
+        {
+        require(_amount > 0, "locking amount should be > 0");
+        require(_period <= maxLockingPeriod, "locking period should be <= maxLockingPeriod");
+        require(_period > 0, "locking period should be > 0");
+        // solhint-disable-next-line not-rely-on-time
+        require(now <= lockingEndTime, "lock should be within the allowed locking period");
+        // solhint-disable-next-line not-rely-on-time
+        require(now >= lockingStartTime, "lock should start after lockingStartTime");
+ 
+        lockingId = keccak256(abi.encodePacked(address(this), lockingsCounter));
+        lockingsCounter = lockingsCounter.add(1);
+ 
+        Locker storage locker = lockers[_locker][lockingId];
+        locker.amount = _amount;
+        // solhint-disable-next-line not-rely-on-time
+        locker.releaseTime = now + _period;
+        totalLocked = totalLocked.add(_amount);
+        totalLockedLeft = totalLockedLeft.add(_amount);
+        uint256 score = _period.mul(_amount).mul(_numerator).div(_denominator);
+        Erequire(score > 0, "score must me > 0");
+        scores[_locker] = scores[_locker].add(score);
+        //verify that redeem will not overflow for this locker
+        require((scores[_locker] * reputationReward)/scores[_locker] == reputationReward,
+        "score is too high");
+        totalScore = totalScore.add(score);
+ 
+        emit Lock(_locker, lockingId, _amount, _period);
+    }
+ 
+    /**
+     * @dev _initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _reputationReward the total reputation this contract will reward
+     *        for eth/token locking
+     * @param _lockingStartTime the locking start time.
+     * @param _lockingEndTime the locking end time.
+     *        locking is disable after this time.
+     * @param _redeemEnableTime redeem enable time .
+     *        redeem reputation can be done after this time.
+     * @param _maxLockingPeriod maximum locking period allowed.
+     */
+    function _initialize(
+        Avatar _avatar,
+        uint256 _reputationReward,
+        uint256 _lockingStartTime,
+        uint256 _lockingEndTime,
+        uint256 _redeemEnableTime,
+        uint256 _maxLockingPeriod,
+        bytes32 _agreementHash )
+    internal
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        Erequire(_lockingEndTime > _lockingStartTime, "locking end time should be greater than locking start time");
+        require(_redeemEnableTime >= _lockingEndTime, "redeemEnableTime >= lockingEndTime");
+ 
+        reputationReward = _reputationReward;
+        reputationRewardLeft = _reputationReward;
+        lockingEndTime = _lockingEndTime;
+        maxLockingPeriod = _maxLockingPeriod;
+        avatar = _avatar;
+        lockingStartTime = _lockingStartTime;
+        redeemEnableTime = _redeemEnableTime;
+        super.setAgreementHash(_agreementHash);
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/LockingEth4Reputation.sol.html b/coverage/lcov-report/schemes/LockingEth4Reputation.sol.html new file mode 100644 index 00000000..d312e0af --- /dev/null +++ b/coverage/lcov-report/schemes/LockingEth4Reputation.sol.html @@ -0,0 +1,260 @@ + + + + Code coverage report for schemes/LockingEth4Reputation.sol + + + + + + + +
+
+

+ all files / schemes/ LockingEth4Reputation.sol +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 5/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  +  +  +  +  +  +  +  +29× +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "./Locking4Reputation.sol";
+ 
+/**
+ * @title A scheme for locking ETH for reputation
+ */
+ 
+contract LockingEth4Reputation is Locking4Reputation {
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _reputationReward the total reputation this contract will reward
+     *        for eth locking
+     * @param _lockingStartTime locking starting period time.
+     * @param _lockingEndTime the locking end time.
+     *        locking is disable after this time.
+     * @param _redeemEnableTime redeem enable time .
+     *        redeem reputation can be done after this time.
+     * @param _maxLockingPeriod maximum locking period allowed.
+     */
+    function initialize(
+        Avatar _avatar,
+        uint256 _reputationReward,
+        uint256 _lockingStartTime,
+        uint256 _lockingEndTime,
+        uint256 _redeemEnableTime,
+        uint256 _maxLockingPeriod,
+        bytes32 _agreementHash )
+    external
+    {
+        super._initialize(
+        _avatar,
+        _reputationReward,
+        _lockingStartTime,
+        _lockingEndTime,
+        _redeemEnableTime,
+        _maxLockingPeriod,
+        _agreementHash);
+    }
+ 
+    /**
+     * @dev release locked eth
+     * @param _beneficiary the release _beneficiary
+     * @param _lockingId the locking id
+     * @return bool
+     */
+    function release(address payable _beneficiary, bytes32 _lockingId) public returns(bool) {
+        uint256 amount = super._release(_beneficiary, _lockingId);
+        _beneficiary.transfer(amount);
+ 
+        return true;
+    }
+ 
+    /**
+     * @dev lock function
+     * @param _period the locking period
+     * @return lockingId the unique Id
+     */
+    function lock(uint256 _period, bytes32 _agreementHash) public payable returns(bytes32 lockingId) {
+        return super._lock(msg.value, _period, msg.sender, 1, 1, _agreementHash);
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/LockingToken4Reputation.sol.html b/coverage/lcov-report/schemes/LockingToken4Reputation.sol.html new file mode 100644 index 00000000..02ef1045 --- /dev/null +++ b/coverage/lcov-report/schemes/LockingToken4Reputation.sol.html @@ -0,0 +1,362 @@ + + + + Code coverage report for schemes/LockingToken4Reputation.sol + + + + + + + +
+
+

+ all files / schemes/ LockingToken4Reputation.sol +

+
+
+ 100% + Statements + 14/14 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 14/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +31× +  +31× +  +29× +27× +  +25× +  +25× +  +13× +  +13× +  +  + 
pragma solidity 0.5.17;
+ 
+import "./Locking4Reputation.sol";
+import "./PriceOracleInterface.sol";
+import "../libs/SafeERC20.sol";
+ 
+ 
+/**
+ * @title A scheme for locking ERC20 Tokens for reputation
+ */
+ 
+contract LockingToken4Reputation is Locking4Reputation {
+    using SafeERC20 for address;
+ 
+    PriceOracleInterface public priceOracleContract;
+    //      lockingId => token
+    mapping(bytes32   => address) public lockedTokens;
+ 
+    event LockToken(bytes32 indexed _lockingId, address indexed _token, uint256 _numerator, uint256 _denominator);
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _reputationReward the total reputation this contract will reward
+     *        for the token locking
+     * @param _lockingStartTime locking starting period time.
+     * @param _lockingEndTime the locking end time.
+     *        locking is disable after this time.
+     * @param _redeemEnableTime redeem enable time .
+     *        redeem reputation can be done after this time.
+     * @param _maxLockingPeriod maximum locking period allowed.
+     * @param _priceOracleContract the price oracle contract which the locked token will be
+     *        validated against
+     */
+    function initialize(
+        Avatar _avatar,
+        uint256 _reputationReward,
+        uint256 _lockingStartTime,
+        uint256 _lockingEndTime,
+        uint256 _redeemEnableTime,
+        uint256 _maxLockingPeriod,
+        PriceOracleInterface _priceOracleContract,
+        bytes32 _agreementHash)
+    external
+    {
+        priceOracleContract = _priceOracleContract;
+        super._initialize(
+        _avatar,
+        _reputationReward,
+        _lockingStartTime,
+        _lockingEndTime,
+        _redeemEnableTime,
+        _maxLockingPeriod,
+        _agreementHash);
+    }
+ 
+    /**
+     * @dev release locked tokens
+     * @param _beneficiary the release _beneficiary
+     * @param _lockingId the locking id
+     * @return bool
+     */
+    function release(address _beneficiary, bytes32 _lockingId) public returns(bool) {
+        uint256 amount = super._release(_beneficiary, _lockingId);
+        lockedTokens[_lockingId].safeTransfer(_beneficiary, amount);
+ 
+        return true;
+    }
+ 
+    /**
+     * @dev lock function
+     * @param _amount the amount to lock
+     * @param _period the locking period
+     * @param _token the token to lock - this should be whitelisted at the priceOracleContract
+     * @return lockingId
+     */
+    function lock(uint256 _amount,
+        uint256 _period,
+        address _token,
+        bytes32 _agreementHash)
+    public returns(bytes32 lockingId) {
+ 
+        uint256 numerator;
+        uint256 denominator;
+ 
+        (numerator, denominator) = priceOracleContract.getPrice(_token);
+ 
+        require(numerator > 0, "numerator should be > 0");
+        require(denominator > 0, "denominator should be > 0");
+ 
+        _token.safeTransferFrom(msg.sender, address(this), _amount);
+ 
+        lockingId = super._lock(_amount, _period, msg.sender, numerator, denominator, _agreementHash);
+ 
+        lockedTokens[lockingId] = _token;
+ 
+        emit LockToken(lockingId, _token, numerator, denominator);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/PriceOracleInterface.sol.html b/coverage/lcov-report/schemes/PriceOracleInterface.sol.html new file mode 100644 index 00000000..8677cf1c --- /dev/null +++ b/coverage/lcov-report/schemes/PriceOracleInterface.sol.html @@ -0,0 +1,86 @@ + + + + Code coverage report for schemes/PriceOracleInterface.sol + + + + + + + +
+
+

+ all files / schemes/ PriceOracleInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8  +  +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+interface PriceOracleInterface {
+ 
+    function getPrice(address token) external view returns (uint, uint);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/RageQuitWithToken.sol.html b/coverage/lcov-report/schemes/RageQuitWithToken.sol.html new file mode 100644 index 00000000..b369f2bf --- /dev/null +++ b/coverage/lcov-report/schemes/RageQuitWithToken.sol.html @@ -0,0 +1,239 @@ + + + + Code coverage report for schemes/RageQuitWithToken.sol + + + + + + + +
+
+

+ all files / schemes/ RageQuitWithToken.sol +

+
+
+ 100% + Statements + 10/10 +
+
+ 50% + Branches + 3/6 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  +  +  +  +  +  +  +  + + + +  + + +  +  + +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/math/SafeMath.sol";
+import "../controller/Controller.sol";
+ 
+ 
+/**
+ * @title A scheme to rage quit from a dao with token.
+ * by sending the dao native token to the RageQuit function the sender will get is proportional share of the dao
+ * rageQuitToken (DAI in most case)
+ */
+contract RageQuitWithToken {
+    using SafeMath for uint256;
+ 
+    event RageQuit(
+        address indexed _avatar,
+        address indexed _rageQuitter,
+        uint256 indexed _refund
+    );
+ 
+    Avatar public avatar;
+    IERC20 public rageQuitToken; //the token which is given back for rageQuit - DAI in most cases
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar this scheme referring to.
+     * @param _rageQuitToken the token which is given back for rageQuit - DAI in most
+     */
+    function initialize(
+        Avatar _avatar,
+        IERC20 _rageQuitToken
+    )
+    external
+    {
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        Erequire(avatar == Avatar(0), "cannot initialize twice");
+        avatar = _avatar;
+        rageQuitToken = _rageQuitToken;
+    }
+ 
+    /**
+    * @dev rageQuit quit from the dao.
+    * @param _amountToRageQuitWith amount of native token to rageQuit with.
+    * @return refund the refund amount
+    */
+    function rageQuit(uint256 _amountToRageQuitWith) external returns(uint256 refund) {
+        uint256 totalTokenSupply = avatar.nativeToken().totalSupply();
+        uint256 rageQuitTokenTotalSupply = rageQuitToken.balanceOf(address(avatar));
+        refund = _amountToRageQuitWith.mul(rageQuitTokenTotalSupply).div(totalTokenSupply);
+        //this will revert if the msg.sender token balance is less than _amountToRageQuitWith.
+        avatar.nativeToken().burnFrom(msg.sender, _amountToRageQuitWith);
+        Erequire(
+        Controller(
+        avatar.owner()).externalTokenTransfer(rageQuitToken, msg.sender, refund, avatar), "send token failed");
+        emit RageQuit(address(avatar), msg.sender, refund);
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/ReputationAdmin.sol.html b/coverage/lcov-report/schemes/ReputationAdmin.sol.html new file mode 100644 index 00000000..b6341e00 --- /dev/null +++ b/coverage/lcov-report/schemes/ReputationAdmin.sol.html @@ -0,0 +1,392 @@ + + + + Code coverage report for schemes/ReputationAdmin.sol + + + + + + + +
+
+

+ all files / schemes/ ReputationAdmin.sol +

+
+
+ 100% + Statements + 25/25 +
+
+ 71.43% + Branches + 20/28 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 25/25 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +13× +13× +11× +11× +11× +11× +11× +  +  +  +  +  +  +  +  +11× +11× +11× +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +11× +  + +  + + +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  + + + +  +  + +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+import "openzeppelin-solidity/contracts/math/SafeMath.sol";
+import "../controller/Controller.sol";
+ 
+/**
+ * @title A scheme for reputation minting/burning by an authorized account
+ */
+ 
+contract ReputationAdmin is Ownable {
+    using SafeMath for uint256;
+ 
+    Avatar public avatar;
+    uint256 public activationStartTime;
+    uint256 public activationEndTime;
+    uint256 public repRewardLeft;
+    uint256 public limitRepReward;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _activationStartTime start time for allowing minting
+     * @param _activationEndTime end time for allowing minting
+     * @param _maxRepReward maximum reputation mintable by this scheme
+     */
+    function initialize(
+        Avatar _avatar,
+        uint256 _activationStartTime,
+        uint256 _activationEndTime,
+        uint256 _maxRepReward
+    ) external onlyOwner {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        require(_activationStartTime < _activationEndTime, "_activationStartTime < _activationEndTime");
+        avatar = _avatar;
+        activationStartTime = _activationStartTime;
+        activationEndTime = _activationEndTime;
+        repRewardLeft = _maxRepReward;
+        limitRepReward = _maxRepReward;
+    }
+ 
+    /**
+     * @dev reputationBurn function
+     * @param _beneficiaries the beneficiaries address to mint reputation from
+     * @param _amounts the amounts of reputation to mint for beneficiaries
+     */
+    function reputationMint(address[] calldata _beneficiaries, uint256[] calldata _amounts) external onlyOwner {
+        Erequire(_beneficiaries.length == _amounts.length, "Arrays length mismatch");
+        for (uint256 i=0; i < _beneficiaries.length; i++) {
+            _reputationMint(_beneficiaries[i], _amounts[i]);
+        }
+    }
+ 
+    /**
+     * @dev reputationBurn function
+     * @param _beneficiaries the beneficiaries address to burm reputation from
+     * @param _amounts the amounts of reputation to burn for beneficiaries
+     */
+    function reputationBurn(address[] calldata _beneficiaries, uint256[] calldata _amounts) external onlyOwner {
+        Erequire(_beneficiaries.length == _amounts.length, "Arrays length mismatch");
+        for (uint256 i=0; i < _beneficiaries.length; i++) {
+            _reputationBurn(_beneficiaries[i], _amounts[i]);
+        }
+    }
+ 
+    /**
+     * @dev reputationMint function
+     * @param _beneficiary the beneficiary address to mint reputation for
+     * @param _amount the amount of reputation to mint the the beneficirary
+     */
+    function _reputationMint(address _beneficiary, uint256 _amount) private {
+        // solhint-disable-next-line not-rely-on-time
+        require(now >= activationStartTime, "Minting period did not start yet");
+        // solhint-disable-next-line not-rely-on-time
+        require(now < activationEndTime, "Minting period ended.");
+ 
+        if (limitRepReward > 0) {
+            repRewardLeft = repRewardLeft.sub(_amount);
+        }
+ 
+        Erequire(
+            Controller(avatar.owner()).mintReputation(_amount, _beneficiary, address(avatar)),
+            "Minting reputation should succeed"
+        );
+    }
+ 
+    /**
+     * @dev reputationBurn function
+     * @param _beneficiary the beneficiary address to burm reputation from
+     * @param _amount the amount of reputation to burn for a beneficirary
+     */
+    function _reputationBurn(address _beneficiary, uint256 _amount) private {
+        // solhint-disable-next-line not-rely-on-time
+        Erequire(now >= activationStartTime, "Burning period did not start yet");
+        // solhint-disable-next-line not-rely-on-time
+        Erequire(now < activationEndTime, "Burning period ended.");
+ 
+        Eif (limitRepReward > 0) {
+            require(_amount <= limitRepReward.sub(repRewardLeft), "Cannot burn more than minted");
+            repRewardLeft = repRewardLeft.add(_amount);
+        }
+ 
+        Erequire(
+            Controller(avatar.owner()).burnReputation(_amount, _beneficiary, address(avatar)),
+            "Burn reputation should succeed"
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/ReputationFromToken.sol.html b/coverage/lcov-report/schemes/ReputationFromToken.sol.html new file mode 100644 index 00000000..c9d7bf5e --- /dev/null +++ b/coverage/lcov-report/schemes/ReputationFromToken.sol.html @@ -0,0 +1,464 @@ + + + + Code coverage report for schemes/ReputationFromToken.sol + + + + + + + +
+
+

+ all files / schemes/ ReputationFromToken.sol +

+
+
+ 96% + Statements + 24/25 +
+
+ 66.67% + Branches + 12/18 +
+
+ 100% + Functions + 4/4 +
+
+ 96% + Lines + 24/25 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +10× +10× +10× +10× +10× +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +  +  + + + + + + +  + + +  + +  +  +  + + +  +  + 
pragma solidity 0.5.17;
+ 
+import "../controller/Controller.sol";
+import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
+import "./CurveInterface.sol";
+import "openzeppelin-solidity/contracts/cryptography/ECDSA.sol";
+import "openzeppelin-solidity/contracts/math/SafeMath.sol";
+import "./Agreement.sol";
+ 
+/**
+ * @title A scheme for reputation allocation according to token balances
+ *        This contract is assuming that the token contract is paused, and one cannot transfer its tokens.
+ */
+ 
+contract ReputationFromToken is Agreement {
+    using ECDSA for bytes32;
+    using SafeMath for uint256;
+ 
+    IERC20 public tokenContract;
+    CurveInterface public curve;
+    //      beneficiary -> bool
+    mapping(address     => bool) public redeems;
+    Avatar public avatar;
+ 
+    // Digest describing the data the user signs according EIP 712.
+    // Needs to match what is passed to Metamask.
+    bytes32 public constant DELEGATION_HASH_EIP712 =
+    keccak256(abi.encodePacked(
+    "address ReputationFromTokenAddress",
+    "address Beneficiary",
+    "bytes32 AgreementHash"
+    ));
+ 
+    event Redeem(address indexed _beneficiary, address indexed _sender, uint256 _amount);
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _tokenContract the token contract
+     * @param _agreementHash is a hash of agreement required to be added to the TX by participants
+     */
+    function initialize(Avatar _avatar, IERC20 _tokenContract, CurveInterface _curve, bytes32 _agreementHash) external
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        tokenContract = _tokenContract;
+        avatar = _avatar;
+        curve = _curve;
+        super.setAgreementHash(_agreementHash);
+    }
+ 
+    /**
+     * @dev redeem function
+     * @param _beneficiary the beneficiary address to redeem for
+     * @param _agreementHash the agreementHash hash
+     * @return uint256 minted reputation
+     */
+    function redeem(address _beneficiary, bytes32 _agreementHash) external returns(uint256) {
+        return _redeem(_beneficiary, msg.sender, _agreementHash);
+    }
+ 
+    /**
+     * @dev redeemWithSignature function
+     * @param _beneficiary the beneficiary address to redeem for
+     * @param _signatureType signature type
+              1 - for web3.eth.sign
+              2 - for eth_signTypedData according to EIP #712.
+     * @param _signature  - signed data by the staker
+     * @return uint256 minted reputation
+     */
+    function redeemWithSignature(
+        address _beneficiary,
+        bytes32 _agreementHash,
+        uint256 _signatureType,
+        bytes calldata _signature
+        )
+        external
+        returns(uint256)
+        {
+        // Recreate the digest the user signed
+        bytes32 delegationDigest;
+        Iif (_signatureType == 2) {
+            delegationDigest = keccak256(
+                abi.encodePacked(
+                    DELEGATION_HASH_EIP712, keccak256(
+                        abi.encodePacked(
+                        address(this),
+                        _beneficiary,
+                        _agreementHash)
+                    )
+                )
+            );
+        } else {
+            delegationDigest = keccak256(
+                        abi.encodePacked(
+                        address(this),
+                        _beneficiary,
+                        _agreementHash)
+                    ).toEthSignedMessageHash();
+        }
+        address redeemer = delegationDigest.recover(_signature);
+        Erequire(redeemer != address(0), "redeemer address cannot be 0");
+        return _redeem(_beneficiary, redeemer, _agreementHash);
+    }
+ 
+    /**
+     * @dev redeem function
+     * @param _beneficiary the beneficiary address to redeem for
+     * @param _redeemer the redeemer address
+     * @return uint256 minted reputation
+     */
+    function _redeem(address _beneficiary, address _redeemer, bytes32 _agreementHash)
+    private
+    onlyAgree(_agreementHash)
+    returns(uint256) {
+        Erequire(avatar != Avatar(0), "should initialize first");
+        Erequire(redeems[_redeemer] == false, "redeeming twice from the same account is not allowed");
+        redeems[_redeemer] = true;
+        uint256 tokenAmount = tokenContract.balanceOf(_redeemer);
+        if (curve != CurveInterface(0)) {
+            tokenAmount = curve.calc(tokenAmount);
+        }
+        if (_beneficiary == address(0)) {
+            _beneficiary = _redeemer;
+        }
+        Erequire(
+        Controller(
+        avatar.owner())
+        .mintReputation(tokenAmount, _beneficiary, address(avatar)), "mint reputation should succeed");
+        emit Redeem(_beneficiary, _redeemer, tokenAmount);
+        return tokenAmount;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/SignalScheme.sol.html b/coverage/lcov-report/schemes/SignalScheme.sol.html new file mode 100644 index 00000000..83ca7988 --- /dev/null +++ b/coverage/lcov-report/schemes/SignalScheme.sol.html @@ -0,0 +1,425 @@ + + + + Code coverage report for schemes/SignalScheme.sol + + + + + + + +
+
+

+ all files / schemes/ SignalScheme.sol +

+
+
+ 100% + Statements + 14/14 +
+
+ 70% + Branches + 7/10 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 14/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  + +  + +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  + + +  + + +  +  +  +  + +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+import "../controller/Avatar.sol";
+ 
+ 
+/**
+ * @title A scheme for proposing a signal on behalkf of the daoCreator
+ */
+ 
+contract SignalScheme is VotingMachineCallbacks, ProposalExecuteInterface {
+ 
+    event NewSignalProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        uint256 indexed _signalType,
+        string _descriptionHash
+    );
+ 
+    event Signal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        uint256 indexed _signalType,
+        string _descriptionHash
+    );
+ 
+    struct Proposal {
+        string descriptionHash;
+        bool executed;
+    }
+ 
+    struct Parameters {
+        bytes32 voteApproveParams;
+        IntVoteInterface intVote;
+        uint256 signalType;
+        Avatar avatar;
+    }
+ 
+    mapping(bytes32  =>  Proposal) public proposals;
+ 
+    Parameters public params;
+ 
+    /**
+     * @dev initialize
+     * @param  _avatar the scheme avatar
+     * @param _signalType - signal types
+     * @param _voteApproveParams voting machine params
+     * @param _intVote  voting machine address
+     */
+    function initialize(Avatar _avatar,
+                        uint256 _signalType,
+                        bytes32 _voteApproveParams,
+                        IntVoteInterface _intVote)
+    external {
+        require(params.avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        params = Parameters({
+            voteApproveParams: _voteApproveParams,
+            signalType: _signalType,
+            intVote: _intVote,
+            avatar: _avatar
+        });
+    }
+ 
+    /**
+    * @dev Submit a proposal for a dao signal
+    * @param _descriptionHash A hash of the proposal's description
+    */
+    function proposeSignal(
+        string calldata _descriptionHash
+    )
+    external
+    returns(bytes32)
+    {
+        Erequire(Controller(params.avatar.owner()).isSchemeRegistered(address(this), address(params.avatar)),
+        "scheme is not registered");
+ 
+        bytes32 proposalId = params.intVote.propose(
+        2,
+        params.voteApproveParams,
+        msg.sender,
+        address(params.avatar)
+        );
+ 
+        proposals[proposalId].descriptionHash = _descriptionHash;
+ 
+        emit NewSignalProposal(
+            address(params.avatar),
+            proposalId,
+            params.signalType,
+            _descriptionHash
+        );
+ 
+        proposalsInfo[address(params.intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:params.avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _param a parameter of the voting result, 1 yes and 2 is no.
+    */
+    function executeProposal(bytes32 _proposalId, int256 _param) external onlyVotingMachine(_proposalId) returns(bool) {
+        Erequire(!proposals[_proposalId].executed);
+        proposals[_proposalId].executed = true;
+        // Check if vote was successful:
+        if (_param == 1) {
+            emit Signal(address(params.avatar),
+                        _proposalId,
+                        params.signalType,
+                        proposals[_proposalId].descriptionHash);
+        }
+        return true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/WalletScheme.sol.html b/coverage/lcov-report/schemes/WalletScheme.sol.html new file mode 100644 index 00000000..565826d3 --- /dev/null +++ b/coverage/lcov-report/schemes/WalletScheme.sol.html @@ -0,0 +1,602 @@ + + + + Code coverage report for schemes/WalletScheme.sol + + + + + + + +
+
+

+ all files / schemes/ WalletScheme.sol +

+
+
+ 100% + Statements + 40/40 +
+
+ 70.83% + Branches + 17/24 +
+
+ 100% + Functions + 6/6 +
+
+ 100% + Lines + 42/42 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +11× +11× +11× +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + + + +  + + +  +  + + +  +  +  +  +  +  +  +14× +14× +12× +10× +10× +10× +10× +10× +10× +  +10× +  +10× + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +10× +  +10× +10× +  +10× +  +10× +  +  +  +  +  +  +10× +  +  +  +10× +10× +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.5.17;
+pragma experimental ABIEncoderV2;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+/**
+ * @title WalletScheme.
+ * @dev  A scheme for proposing and executing calls to any contract except itself and controller
+ */
+contract WalletScheme is VotingMachineCallbacks, ProposalExecuteInterface {
+    event NewCallProposal(
+        address[] _to,
+        bytes32 indexed _proposalId,
+        bytes[]   _callData,
+        uint256[] _value,
+        string  _descriptionHash
+    );
+ 
+    event ProposalExecuted(
+        bytes32 indexed _proposalId,
+        bytes[] _genericCallReturnValue
+    );
+ 
+    event ProposalExecutedByVotingMachine(
+        bytes32 indexed _proposalId,
+        int256 _param
+    );
+ 
+    event ProposalDeleted(bytes32 indexed _proposalId);
+ 
+    // Details of a voting proposal:
+    struct CallProposal {
+        address[] to;
+        bytes[] callData;
+        uint256[] value;
+        bool exist;
+        bool passed;
+    }
+ 
+    mapping(bytes32=>CallProposal) public organizationProposals;
+ 
+    IntVoteInterface public votingMachine;
+    bytes32 public voteParams;
+    Avatar public avatar;
+    address public controller;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar address
+     * @param _controller the controller address
+     * @param _votingMachine the voting machines address to
+     * @param _voteParams voting machine parameters.
+     */
+    function initialize(
+        Avatar _avatar,
+        address _controller,
+        IntVoteInterface _votingMachine,
+        bytes32 _voteParams
+    )
+    external
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        Erequire(_controller != address(0), "controller cannot be zero");
+        avatar = _avatar;
+        controller = _controller;
+        votingMachine = _votingMachine;
+        voteParams = _voteParams;
+    }
+    
+    /**
+    * @dev Fallback function that allows the wallet to receive ETH
+    */
+    function() external payable {}
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _decision a parameter of the voting result, 1 yes and 2 is no.
+    * @return bool success
+    */
+    function executeProposal(bytes32 _proposalId, int256 _decision)
+    external
+    onlyVotingMachine(_proposalId)
+    returns(bool) {
+        CallProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.exist, "must be a live proposal");
+        Erequire(proposal.passed == false, "cannot execute twice");
+ 
+        if (_decision == 1) {
+            proposal.passed = true;
+            execute(_proposalId);
+        } else {
+            delete organizationProposals[_proposalId];
+            emit ProposalDeleted(_proposalId);
+        }
+ 
+        emit ProposalExecutedByVotingMachine(_proposalId, _decision);
+        return true;
+    }
+ 
+    /**
+    * @dev execution of proposals after it has been decided by the voting machine
+    * @param _proposalId the ID of the voting in the voting machine
+    */
+    function execute(bytes32 _proposalId) public {
+        CallProposal storage proposal = organizationProposals[_proposalId];
+        require(proposal.exist, "must be a live proposal");
+        require(proposal.passed, "proposal must passed by voting machine");
+        proposal.exist = false;
+        bytes[] memory genericCallReturnValues = new bytes[](proposal.to.length);
+        bytes memory genericCallReturnValue;
+        bool success;
+        for(uint i = 0; i < proposal.to.length; i ++) {
+          (success, genericCallReturnValue) =
+          address(proposal.to[i]).call.value(proposal.value[i])(proposal.callData[i]);
+          genericCallReturnValues[i] = genericCallReturnValue;
+        }
+        if (success) {
+            delete organizationProposals[_proposalId];
+            emit ProposalDeleted(_proposalId);
+            emit ProposalExecuted(_proposalId, genericCallReturnValues);
+        } else {
+            proposal.exist = true;
+        }
+    }
+ 
+    /**
+    * @dev propose to call an address
+    *      The function trigger NewCallProposal event
+    * @param _to - The addresses to call
+    * @param _callData - The abi encode data for the calls
+    * @param _value value(ETH) to transfer with the calls
+    * @param _descriptionHash proposal description hash
+    * @return an id which represents the proposal
+    */
+    function proposeCalls(address[] memory _to, bytes[] memory _callData, uint256[] memory _value, string memory _descriptionHash)
+    public
+    returns(bytes32)
+    {
+        for(uint i = 0; i < _to.length; i ++) {
+          Erequire(_to[i] != controller && _to[i] != address(this), 'invalid proposal caller');
+        }
+        Erequire(_to.length == _callData.length, 'invalid callData length');
+        Erequire(_to.length == _value.length, 'invalid _value length');
+        
+        bytes32 proposalId = votingMachine.propose(2, voteParams, msg.sender, _to[0]);
+ 
+        organizationProposals[proposalId] = CallProposal({
+            to: _to,
+            callData: _callData,
+            value: _value,
+            exist: true,
+            passed: false
+        });
+        proposalsInfo[address(votingMachine)][proposalId] = ProposalInfo({
+            blockNumber: block.number,
+            avatar: avatar
+        });
+        emit NewCallProposal(_to, proposalId, _callData, _value, _descriptionHash);
+        return proposalId;
+    }
+    
+    function getOrganizationProposal(bytes32 proposalId) public view 
+      returns (address[] memory to, bytes[] memory callData, uint256[] memory value, bool exist, bool passed)
+    {
+      return (
+        organizationProposals[proposalId].to,
+        organizationProposals[proposalId].callData,
+        organizationProposals[proposalId].value,
+        organizationProposals[proposalId].exist,
+        organizationProposals[proposalId].passed
+      );
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/schemes/index.html b/coverage/lcov-report/schemes/index.html new file mode 100644 index 00000000..950e6433 --- /dev/null +++ b/coverage/lcov-report/schemes/index.html @@ -0,0 +1,327 @@ + + + + Code coverage report for schemes/ + + + + + + + +
+
+

+ all files schemes/ +

+
+
+ 99.07% + Statements + 638/644 +
+
+ 76.55% + Branches + 346/452 +
+
+ 97.85% + Functions + 91/93 +
+
+ 99.08% + Lines + 645/651 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Agreement.sol
100%4/4100%4/4100%3/3100%5/5
Auction4Reputation.sol
100%40/4088.46%23/26100%5/5100%40/40
Competition.sol
97.84%136/13977.66%73/94100%9/997.84%136/139
ContinuousLocking4Reputation.sol
100%93/9378.57%44/56100%11/11100%93/93
ContributionRewardExt.sol
98.18%108/11069.79%67/9690%18/2098.18%108/110
CurveInterface.sol
100%0/0100%0/0100%0/0100%0/0
ExternalLocking4Reputation.sol
100%18/1883.33%10/12100%3/3100%19/19
FixedReputationAllocation.sol
100%20/2081.25%13/16100%5/5100%21/21
Forwarder.sol
100%9/980%8/10100%3/3100%9/9
GenericScheme.sol
100%32/3281.25%13/16100%4/4100%34/34
Locking4Reputation.sol
100%46/4687.5%28/32100%4/4100%46/46
LockingEth4Reputation.sol
100%5/5100%0/0100%3/3100%5/5
LockingToken4Reputation.sol
100%14/14100%4/4100%3/3100%14/14
PriceOracleInterface.sol
100%0/0100%0/0100%0/0100%0/0
RageQuitWithToken.sol
100%10/1050%3/6100%2/2100%10/10
ReputationAdmin.sol
100%25/2571.43%20/28100%5/5100%25/25
ReputationFromToken.sol
96%24/2566.67%12/18100%4/496%24/25
SignalScheme.sol
100%14/1470%7/10100%3/3100%14/14
WalletScheme.sol
100%40/4070.83%17/24100%6/6100%42/42
+
+
+ + + + + + + diff --git a/coverage/lcov-report/sort-arrow-sprite.png b/coverage/lcov-report/sort-arrow-sprite.png new file mode 100644 index 00000000..03f704a6 Binary files /dev/null and b/coverage/lcov-report/sort-arrow-sprite.png differ diff --git a/coverage/lcov-report/sorter.js b/coverage/lcov-report/sorter.js new file mode 100644 index 00000000..6c5034e4 --- /dev/null +++ b/coverage/lcov-report/sorter.js @@ -0,0 +1,158 @@ +var addSorting = (function () { + "use strict"; + var cols, + currentSort = { + index: 0, + desc: false + }; + + // returns the summary table element + function getTable() { return document.querySelector('.coverage-summary'); } + // returns the thead element of the summary table + function getTableHeader() { return getTable().querySelector('thead tr'); } + // returns the tbody element of the summary table + function getTableBody() { return getTable().querySelector('tbody'); } + // returns the th element for nth column + function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; } + + // loads all columns + function loadColumns() { + var colNodes = getTableHeader().querySelectorAll('th'), + colNode, + cols = [], + col, + i; + + for (i = 0; i < colNodes.length; i += 1) { + colNode = colNodes[i]; + col = { + key: colNode.getAttribute('data-col'), + sortable: !colNode.getAttribute('data-nosort'), + type: colNode.getAttribute('data-type') || 'string' + }; + cols.push(col); + if (col.sortable) { + col.defaultDescSort = col.type === 'number'; + colNode.innerHTML = colNode.innerHTML + ''; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function (a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function (a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function () { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i =0 ; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function () { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(cols); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/coverage/lcov-report/universalSchemes/ContributionReward.sol.html b/coverage/lcov-report/universalSchemes/ContributionReward.sol.html new file mode 100644 index 00000000..cc15a8b4 --- /dev/null +++ b/coverage/lcov-report/universalSchemes/ContributionReward.sol.html @@ -0,0 +1,1400 @@ + + + + Code coverage report for universalSchemes/ContributionReward.sol + + + + + + + +
+
+

+ all files / universalSchemes/ ContributionReward.sol +

+
+
+ 100% + Statements + 103/103 +
+
+ 80% + Branches + 56/70 +
+
+ 100% + Functions + 16/16 +
+
+ 100% + Lines + 102/102 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +14× +14× +14× +  +14× +  +11× +  +14× +14× +  +  +  +  +  +  +  +  +  +  +20× +  +  +  +20× +20× +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +17× +  +17× +  +  +  +  +  +  +17× +17× + +  +  +17× +  +  +  +  +  +  +  +  +  +  +  +17× +  +17× +  +  +  +  +  +  +  +  +  +  +17× +  +  +  +17× +  +  +  +  +  +  +  +  +  +  +10× +10× +10× + +  +  + + + + +  +  +  + +  +  +  + + + +  +  + +  +  +  +  +  +  +  +  +  +  + + + + +  + +  + + + + + +  +  +  + +  +  +  +  +  +  +  +  +  +  +13× +13× +13× +13× +  +13× +13× +  +13× +11× + + +  +  +  +11× +  +  +  +  +  +  +  +  +  +  + + + + +  + +  + + + + +  +  +  + + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +10× +  +  +19× + +  +  +19× +13× +  +  +17× + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +75× +75× +75× + +67× +67× +  +55× +  +67× +67× +47× +  +20× +  +67× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +40× +  +  +  + +  +  +  + +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +40× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +25× +  +22× +  +  +22× +  +  +20× +  +  +18× +  +  +16× +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "./UniversalScheme.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+/**
+ * @title A scheme for proposing and rewarding contributions to an organization
+ * @dev An agent can ask an organization to recognize a contribution and reward
+ * him with token, reputation, ether or any combination.
+ */
+ 
+contract ContributionReward is UniversalScheme, VotingMachineCallbacks, ProposalExecuteInterface {
+    using SafeMath for uint;
+ 
+    event NewContributionProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        string _descriptionHash,
+        int256 _reputationChange,
+        uint[5]  _rewards,
+        IERC20 _externalToken,
+        address _beneficiary
+    );
+ 
+    event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param);
+ 
+    event RedeemReputation(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        int256 _amount);
+ 
+    event RedeemEther(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        uint256 _amount);
+ 
+    event RedeemNativeToken(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        uint256 _amount);
+ 
+    event RedeemExternalToken(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        uint256 _amount);
+ 
+    // A struct holding the data for a contribution proposal
+    struct ContributionProposal {
+        uint256 nativeTokenReward; // Reward asked in the native token of the organization.
+        int256 reputationChange; // Organization reputation reward requested.
+        uint256 ethReward;
+        IERC20 externalToken;
+        uint256 externalTokenReward;
+        address payable beneficiary;
+        uint256 periodLength;
+        uint256 numberOfPeriods;
+        uint256 executionTime;
+        uint[4] redeemedPeriods;
+    }
+ 
+    // A mapping from the organization (Avatar) address to the saved data of the organization:
+    mapping(address=>mapping(bytes32=>ContributionProposal)) public organizationsProposals;
+ 
+    // A mapping from hashes to parameters (use to store a particular configuration on the controller)
+    struct Parameters {
+        bytes32 voteApproveParams;
+        IntVoteInterface intVote;
+    }
+ 
+    // A mapping from hashes to parameters (use to store a particular configuration on the controller)
+    mapping(bytes32=>Parameters) public parameters;
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _param a parameter of the voting result, 1 yes and 2 is no.
+    */
+    function executeProposal(bytes32 _proposalId, int256 _param) external onlyVotingMachine(_proposalId) returns(bool) {
+        ProposalInfo memory proposal = proposalsInfo[msg.sender][_proposalId];
+        Erequire(organizationsProposals[address(proposal.avatar)][_proposalId].executionTime == 0);
+        Erequire(organizationsProposals[address(proposal.avatar)][_proposalId].beneficiary != address(0));
+        // Check if vote was successful:
+        if (_param == 1) {
+          // solhint-disable-next-line not-rely-on-time
+            organizationsProposals[address(proposal.avatar)][_proposalId].executionTime = now;
+        }
+        emit ProposalExecuted(address(proposal.avatar), _proposalId, _param);
+        return true;
+    }
+ 
+    /**
+    * @dev hash the parameters, save them if necessary, and return the hash value
+    */
+    function setParameters(
+        bytes32 _voteApproveParams,
+        IntVoteInterface _intVote
+    ) public returns(bytes32)
+    {
+        bytes32 paramsHash = getParametersHash(
+            _voteApproveParams,
+            _intVote
+        );
+        parameters[paramsHash].voteApproveParams = _voteApproveParams;
+        parameters[paramsHash].intVote = _intVote;
+        return paramsHash;
+    }
+ 
+    /**
+    * @dev Submit a proposal for a reward for a contribution:
+    * @param _avatar Avatar of the organization that the contribution was made for
+    * @param _descriptionHash A hash of the proposal's description
+    * @param _reputationChange - Amount of reputation change requested .Can be negative.
+    * @param _rewards rewards array:
+    *         rewards[0] - Amount of tokens requested per period
+    *         rewards[1] - Amount of ETH requested per period
+    *         rewards[2] - Amount of external tokens requested per period
+    *         rewards[3] - Period length - if set to zero it allows immediate redeeming after execution.
+    *         rewards[4] - Number of periods
+    * @param _externalToken Address of external token, if reward is requested there
+    * @param _beneficiary Who gets the rewards
+    */
+    function proposeContributionReward(
+        Avatar _avatar,
+        string memory _descriptionHash,
+        int256 _reputationChange,
+        uint[5] memory _rewards,
+        IERC20 _externalToken,
+        address payable _beneficiary
+    )
+    public
+    returns(bytes32)
+    {
+        validateProposalParams(_reputationChange, _rewards);
+        Parameters memory controllerParams = parameters[getParametersFromController(_avatar)];
+ 
+        bytes32 contributionId = controllerParams.intVote.propose(
+        2,
+        controllerParams.voteApproveParams,
+        msg.sender,
+        address(_avatar)
+        );
+ 
+        address payable beneficiary = _beneficiary;
+        if (beneficiary == address(0)) {
+            beneficiary = msg.sender;
+        }
+ 
+        ContributionProposal memory proposal = ContributionProposal({
+            nativeTokenReward: _rewards[0],
+            reputationChange: _reputationChange,
+            ethReward: _rewards[1],
+            externalToken: _externalToken,
+            externalTokenReward: _rewards[2],
+            beneficiary: beneficiary,
+            periodLength: _rewards[3],
+            numberOfPeriods: _rewards[4],
+            executionTime: 0,
+            redeemedPeriods:[uint(0), uint(0), uint(0), uint(0)]
+        });
+        organizationsProposals[address(_avatar)][contributionId] = proposal;
+ 
+        emit NewContributionProposal(
+            address(_avatar),
+            contributionId,
+            address(controllerParams.intVote),
+            _descriptionHash,
+            _reputationChange,
+            _rewards,
+            _externalToken,
+            beneficiary
+        );
+ 
+        proposalsInfo[address(controllerParams.intVote)][contributionId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return contributionId;
+    }
+ 
+    /**
+    * @dev RedeemReputation reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @return reputation the redeemed reputation.
+    */
+    function redeemReputation(bytes32 _proposalId, Avatar _avatar) public returns(int256 reputation) {
+ 
+        ContributionProposal memory _proposal = organizationsProposals[address(_avatar)][_proposalId];
+        ContributionProposal storage proposal = organizationsProposals[address(_avatar)][_proposalId];
+        require(proposal.executionTime != 0);
+        uint256 periodsToPay = getPeriodsToPay(_proposalId, address(_avatar), 0);
+ 
+        //set proposal reward to zero to prevent reentrancy attack.
+        proposal.reputationChange = 0;
+        reputation = int(periodsToPay) * _proposal.reputationChange;
+        if (reputation > 0) {
+            Erequire(
+            Controller(
+            _avatar.owner()).mintReputation(uint(reputation), _proposal.beneficiary, address(_avatar)));
+        } else if (reputation < 0) {
+            Erequire(
+            Controller(
+            _avatar.owner()).burnReputation(uint(reputation*(-1)), _proposal.beneficiary, address(_avatar)));
+        }
+        if (reputation != 0) {
+            proposal.redeemedPeriods[0] = proposal.redeemedPeriods[0].add(periodsToPay);
+            emit RedeemReputation(address(_avatar), _proposalId, _proposal.beneficiary, reputation);
+        }
+        //restore proposal reward.
+        proposal.reputationChange = _proposal.reputationChange;
+    }
+ 
+    /**
+    * @dev RedeemNativeToken reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @return amount the redeemed nativeToken.
+    */
+    function redeemNativeToken(bytes32 _proposalId, Avatar _avatar) public returns(uint256 amount) {
+ 
+        ContributionProposal memory _proposal = organizationsProposals[address(_avatar)][_proposalId];
+        ContributionProposal storage proposal = organizationsProposals[address(_avatar)][_proposalId];
+        Erequire(proposal.executionTime != 0);
+        uint256 periodsToPay = getPeriodsToPay(_proposalId, address(_avatar), 1);
+        //set proposal rewards to zero to prevent reentrancy attack.
+        proposal.nativeTokenReward = 0;
+ 
+        amount = periodsToPay.mul(_proposal.nativeTokenReward);
+        Eif (amount > 0) {
+            Erequire(Controller(_avatar.owner()).mintTokens(amount, _proposal.beneficiary, address(_avatar)));
+            proposal.redeemedPeriods[1] = proposal.redeemedPeriods[1].add(periodsToPay);
+            emit RedeemNativeToken(address(_avatar), _proposalId, _proposal.beneficiary, amount);
+        }
+ 
+        //restore proposal reward.
+        proposal.nativeTokenReward = _proposal.nativeTokenReward;
+    }
+ 
+    /**
+    * @dev RedeemEther reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @return amount ether redeemed amount
+    */
+    function redeemEther(bytes32 _proposalId, Avatar _avatar) public returns(uint256 amount) {
+ 
+        ContributionProposal memory _proposal = organizationsProposals[address(_avatar)][_proposalId];
+        ContributionProposal storage proposal = organizationsProposals[address(_avatar)][_proposalId];
+        Erequire(proposal.executionTime != 0);
+        uint256 periodsToPay = getPeriodsToPay(_proposalId, address(_avatar), 2);
+        //set proposal rewards to zero to prevent reentrancy attack.
+        proposal.ethReward = 0;
+        amount = periodsToPay.mul(_proposal.ethReward);
+ 
+        if (amount > 0) {
+            require(Controller(_avatar.owner()).sendEther(amount, _proposal.beneficiary, _avatar));
+            proposal.redeemedPeriods[2] = proposal.redeemedPeriods[2].add(periodsToPay);
+            emit RedeemEther(address(_avatar), _proposalId, _proposal.beneficiary, amount);
+        }
+ 
+        //restore proposal reward.
+        proposal.ethReward = _proposal.ethReward;
+    }
+ 
+    /**
+    * @dev RedeemNativeToken reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @return amount the external token redeemed amount
+    */
+    function redeemExternalToken(bytes32 _proposalId, Avatar _avatar) public returns(uint256 amount) {
+ 
+        ContributionProposal memory _proposal = organizationsProposals[address(_avatar)][_proposalId];
+        ContributionProposal storage proposal = organizationsProposals[address(_avatar)][_proposalId];
+        Erequire(proposal.executionTime != 0);
+        uint256 periodsToPay = getPeriodsToPay(_proposalId, address(_avatar), 3);
+        //set proposal rewards to zero to prevent reentrancy attack.
+        proposal.externalTokenReward = 0;
+ 
+        Eif (proposal.externalToken != IERC20(0) && _proposal.externalTokenReward > 0) {
+            amount = periodsToPay.mul(_proposal.externalTokenReward);
+            Eif (amount > 0) {
+                Erequire(
+                Controller(
+                _avatar.owner())
+                .externalTokenTransfer(_proposal.externalToken, _proposal.beneficiary, amount, _avatar));
+                proposal.redeemedPeriods[3] = proposal.redeemedPeriods[3].add(periodsToPay);
+                emit RedeemExternalToken(address(_avatar), _proposalId, _proposal.beneficiary, amount);
+            }
+        }
+        //restore proposal reward.
+        proposal.externalTokenReward = _proposal.externalTokenReward;
+    }
+ 
+    /**
+    * @dev redeem rewards for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @param _whatToRedeem whatToRedeem array:
+    *         whatToRedeem[0] - reputation
+    *         whatToRedeem[1] - nativeTokenReward
+    *         whatToRedeem[2] - Ether
+    *         whatToRedeem[3] - ExternalToken
+    * @return  result boolean array for each redeem type.
+    */
+    function redeem(bytes32 _proposalId, Avatar _avatar, bool[4] memory _whatToRedeem)
+    public
+    returns(int256 reputationReward, uint256 nativeTokenReward, uint256 etherReward, uint256 externalTokenReward)
+    {
+ 
+        if (_whatToRedeem[0]) {
+            reputationReward = redeemReputation(_proposalId, _avatar);
+        }
+ 
+        if (_whatToRedeem[1]) {
+            nativeTokenReward = redeemNativeToken(_proposalId, _avatar);
+        }
+ 
+        if (_whatToRedeem[2]) {
+            etherReward = redeemEther(_proposalId, _avatar);
+        }
+ 
+        if (_whatToRedeem[3]) {
+            externalTokenReward = redeemExternalToken(_proposalId, _avatar);
+        }
+    }
+ 
+    /**
+    * @dev getPeriodsToPay return the periods left to be paid for reputation,nativeToken,ether or externalToken.
+    * The function ignore the reward amount to be paid (which can be zero).
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @param _redeemType - the type of the reward  :
+    *         0 - reputation
+    *         1 - nativeTokenReward
+    *         2 - Ether
+    *         3 - ExternalToken
+    * @return  periods left to be paid.
+    */
+    function getPeriodsToPay(bytes32 _proposalId, address _avatar, uint256 _redeemType) public view returns (uint256) {
+        Erequire(_redeemType <= 3, "should be in the redeemedPeriods range");
+        ContributionProposal memory _proposal = organizationsProposals[_avatar][_proposalId];
+        if (_proposal.executionTime == 0)
+            return 0;
+        uint256 periodsFromExecution;
+        if (_proposal.periodLength > 0) {
+          // solhint-disable-next-line not-rely-on-time
+            periodsFromExecution = (now.sub(_proposal.executionTime))/(_proposal.periodLength);
+        }
+        uint256 periodsToPay;
+        if ((_proposal.periodLength == 0) || (periodsFromExecution >= _proposal.numberOfPeriods)) {
+            periodsToPay = _proposal.numberOfPeriods.sub(_proposal.redeemedPeriods[_redeemType]);
+        } else {
+            periodsToPay = periodsFromExecution.sub(_proposal.redeemedPeriods[_redeemType]);
+        }
+        return periodsToPay;
+    }
+ 
+    /**
+    * @dev getRedeemedPeriods return the already redeemed periods for reputation, nativeToken, ether or externalToken.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @param _redeemType - the type of the reward  :
+    *         0 - reputation
+    *         1 - nativeTokenReward
+    *         2 - Ether
+    *         3 - ExternalToken
+    * @return redeemed period.
+    */
+    function getRedeemedPeriods(bytes32 _proposalId, address _avatar, uint256 _redeemType)
+    public
+    view
+    returns (uint256) {
+        return organizationsProposals[_avatar][_proposalId].redeemedPeriods[_redeemType];
+    }
+ 
+    function getProposalEthReward(bytes32 _proposalId, address _avatar) public view returns (uint256) {
+        return organizationsProposals[_avatar][_proposalId].ethReward;
+    }
+ 
+    function getProposalExternalTokenReward(bytes32 _proposalId, address _avatar) public view returns (uint256) {
+        return organizationsProposals[_avatar][_proposalId].externalTokenReward;
+    }
+ 
+    function getProposalExternalToken(bytes32 _proposalId, address _avatar) public view returns (address) {
+        return address(organizationsProposals[_avatar][_proposalId].externalToken);
+    }
+ 
+    function getProposalExecutionTime(bytes32 _proposalId, address _avatar) public view returns (uint256) {
+        return organizationsProposals[_avatar][_proposalId].executionTime;
+    }
+ 
+    /**
+    * @dev return a hash of the given parameters
+    * @param _voteApproveParams parameters for the voting machine used to approve a contribution
+    * @param _intVote the voting machine used to approve a contribution
+    * @return a hash of the parameters
+    */
+    function getParametersHash(
+        bytes32 _voteApproveParams,
+        IntVoteInterface _intVote
+    ) public pure returns(bytes32)
+    {
+        return (keccak256(abi.encodePacked(_voteApproveParams, _intVote)));
+    }
+ 
+    /**
+    * @dev validateProposalParams validate proposal's rewards parameters.
+    * The function check for potential overflow upon proposal's redeem.
+    * The function reverts if the params are not valid.
+    * @param _reputationChange - Amount of reputation change requested .Can be negative.
+    * @param _rewards rewards array:
+    *         rewards[0] - Amount of tokens requested per period
+    *         rewards[1] - Amount of ETH requested per period
+    *         rewards[2] - Amount of external tokens requested per period
+    *         rewards[3] - Period length - if set to zero it allows immediate redeeming after execution.
+    *         rewards[4] - Number of periods
+    */
+    function validateProposalParams(int256 _reputationChange, uint[5] memory _rewards) private pure {
+        require(((_rewards[3] > 0) || (_rewards[4] == 1)), "periodLength equal 0 require numberOfPeriods to be 1");
+        if (_rewards[4] > 0) {
+            // This is the only case of overflow not detected by the check below
+            Erequire(!(int(_rewards[4]) == -1 && _reputationChange == (-2**255)),
+            "numberOfPeriods * _reputationChange will overflow");
+           //check that numberOfPeriods * _reputationChange will not overflow
+            require((int(_rewards[4]) * _reputationChange) / int(_rewards[4]) == _reputationChange,
+            "numberOfPeriods * reputationChange will overflow");
+            //check that numberOfPeriods * tokenReward will not overflow
+            require((_rewards[4] * _rewards[0]) / _rewards[4] == _rewards[0],
+            "numberOfPeriods * tokenReward will overflow");
+            //check that numberOfPeriods * ethReward will not overflow
+            require((_rewards[4] * _rewards[1]) / _rewards[4] == _rewards[1],
+            "numberOfPeriods * ethReward will overflow");
+            //check that numberOfPeriods * texternalTokenReward will not overflow
+            require((_rewards[4] * _rewards[2]) / _rewards[4] == _rewards[2],
+            "numberOfPeriods * texternalTokenReward will overflow");
+        }
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/universalSchemes/DaoCreator.sol.html b/coverage/lcov-report/universalSchemes/DaoCreator.sol.html new file mode 100644 index 00000000..00788cc9 --- /dev/null +++ b/coverage/lcov-report/universalSchemes/DaoCreator.sol.html @@ -0,0 +1,686 @@ + + + + Code coverage report for universalSchemes/DaoCreator.sol + + + + + + + +
+
+

+ all files / universalSchemes/ DaoCreator.sol +

+
+
+ 100% + Statements + 47/47 +
+
+ 68.75% + Branches + 22/32 +
+
+ 100% + Functions + 6/6 +
+
+ 100% + Lines + 48/48 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208  +  +  +  +  +  +  +  +  +  +  +  +  +294× +294× +294× +294× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +296× +296× +296× +296× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  + +60× +60× +60× +  +  +60× +60× +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +298× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +294× +  +290× +290× +313× +  +290× +  +290× +  +290× +290× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +298× +298× +296× +296× +296× +296× +  +  +  +296× +536× +534× +370× +  +534× +508× +  +  +  +294× +  +  +294× +  +  +294× +294× +294× +  +294× +  +294× +294× +  +  + 
pragma solidity 0.5.17;
+ 
+import "./UniversalScheme.sol";
+import "../controller/Controller.sol";
+import "../utils/DAOTracker.sol";
+ 
+ 
+/**
+ * @title ControllerCreator for creating a single controller.
+ */
+contract ControllerCreator {
+ 
+    function create(Avatar _avatar) public returns(address) {
+        Controller controller = new Controller(_avatar);
+        controller.registerScheme(msg.sender, bytes32(0), bytes4(0x0000001f), address(_avatar));
+        controller.unregisterScheme(address(this), address(_avatar));
+        return address(controller);
+    }
+}
+ 
+/**
+ * @title Genesis Scheme that creates organizations
+ */
+contract DaoCreator {
+ 
+    mapping(address=>address) public locks;
+ 
+    event NewOrg (address _avatar);
+    event InitialSchemesSet (address _avatar);
+ 
+    ControllerCreator private controllerCreator;
+    DAOTracker private daoTracker;
+ 
+    constructor(ControllerCreator _controllerCreator, DAOTracker _daoTracker) public {
+        Erequire(_controllerCreator != ControllerCreator(0));
+        Erequire(_daoTracker != DAOTracker(0));
+        controllerCreator = _controllerCreator;
+        daoTracker = _daoTracker;
+    }
+ 
+    /**
+      * @dev addFounders add founders to the organization.
+      *      this function can be called only after forgeOrg and before setSchemes
+      * @param _avatar the organization avatar
+      * @param _founders An array with the addresses of the founders of the organization
+      * @param _foundersTokenAmount An array of amount of tokens that the founders
+      *  receive in the new organization
+      * @param _foundersReputationAmount An array of amount of reputation that the
+      *   founders receive in the new organization
+      * @return bool true or false
+      */
+    function addFounders (
+        Avatar _avatar,
+        address[] calldata _founders,
+        uint[] calldata _foundersTokenAmount,
+        uint[] calldata _foundersReputationAmount
+    )
+    external
+    returns(bool)
+    {
+        Erequire(_founders.length == _foundersTokenAmount.length);
+        Erequire(_founders.length == _foundersReputationAmount.length);
+        Erequire(_founders.length > 0);
+        require(locks[address(_avatar)] == msg.sender);
+        // Mint token and reputation for founders:
+        for (uint256 i = 0; i < _founders.length; i++) {
+            Erequire(_founders[i] != address(0));
+            Eif (_foundersTokenAmount[i] > 0) {
+                Controller(
+                _avatar.owner()).mintTokens(_foundersTokenAmount[i], _founders[i], address(_avatar));
+            }
+            Eif (_foundersReputationAmount[i] > 0) {
+                Controller(
+                _avatar.owner()).mintReputation(_foundersReputationAmount[i], _founders[i], address(_avatar));
+            }
+        }
+        return true;
+    }
+ 
+  /**
+    * @dev Create a new organization
+    * @param _orgName The name of the new organization
+    * @param _tokenName The name of the token associated with the organization
+    * @param _tokenSymbol The symbol of the token
+    * @param _founders An array with the addresses of the founders of the organization
+    * @param _foundersTokenAmount An array of amount of tokens that the founders
+    *  receive in the new organization
+    * @param _foundersReputationAmount An array of amount of reputation that the
+    *   founders receive in the new organization
+    * @param  _cap token cap - 0 for no cap.
+    * @return The address of the avatar of the controller
+    */
+    function forgeOrg (
+        string calldata _orgName,
+        string calldata _tokenName,
+        string calldata _tokenSymbol,
+        address[] calldata _founders,
+        uint[] calldata _foundersTokenAmount,
+        uint[] calldata _foundersReputationAmount,
+        uint256 _cap
+    )
+    external
+    returns(address)
+    {
+        //The call for the private function is needed to bypass a deep stack issues
+        return _forgeOrg(
+            _orgName,
+            _tokenName,
+            _tokenSymbol,
+            _founders,
+            _foundersTokenAmount,
+            _foundersReputationAmount,
+            _cap);
+    }
+ 
+     /**
+      * @dev Set initial schemes for the organization.
+      * @param _avatar organization avatar (returns from forgeOrg)
+      * @param _schemes the schemes to register for the organization
+      * @param _params the schemes's params
+      * @param _permissions the schemes permissions.
+      * @param _metaData dao meta data hash
+      */
+    function setSchemes (
+        Avatar _avatar,
+        address[] calldata _schemes,
+        bytes32[] calldata _params,
+        bytes4[] calldata _permissions,
+        string calldata _metaData
+    )
+        external
+    {
+        // this action can only be executed by the account that holds the lock
+        // for this controller
+        require(locks[address(_avatar)] == msg.sender);
+        // register initial schemes:
+        Controller controller = Controller(_avatar.owner());
+        for (uint256 i = 0; i < _schemes.length; i++) {
+            controller.registerScheme(_schemes[i], _params[i], _permissions[i], address(_avatar));
+        }
+        controller.metaData(_metaData, _avatar);
+        // Unregister self:
+        controller.unregisterScheme(address(this), address(_avatar));
+        // Remove lock:
+        delete locks[address(_avatar)];
+        emit InitialSchemesSet(address(_avatar));
+    }
+ 
+    /**
+     * @dev Create a new organization
+     * @param _orgName The name of the new organization
+     * @param _tokenName The name of the token associated with the organization
+     * @param _tokenSymbol The symbol of the token
+     * @param _founders An array with the addresses of the founders of the organization
+     * @param _foundersTokenAmount An array of amount of tokens that the founders
+     *  receive in the new organization
+     * @param _foundersReputationAmount An array of amount of reputation that the
+     *   founders receive in the new organization
+     * @param  _cap token cap - 0 for no cap.
+     * @return The address of the avatar of the controller
+     */
+    function _forgeOrg (
+        string memory _orgName,
+        string memory _tokenName,
+        string memory _tokenSymbol,
+        address[] memory _founders,
+        uint[] memory _foundersTokenAmount,
+        uint[] memory _foundersReputationAmount,
+        uint256 _cap
+    ) private returns(address)
+    {
+        // Create Token, Reputation and Avatar:
+        Erequire(_founders.length == _foundersTokenAmount.length);
+        require(_founders.length == _foundersReputationAmount.length);
+        Erequire(_founders.length > 0);
+        DAOToken nativeToken = new DAOToken(_tokenName, _tokenSymbol, _cap);
+        Reputation nativeReputation = new Reputation();
+        Avatar avatar = new Avatar(_orgName, nativeToken, nativeReputation);
+ 
+ 
+        // Mint token and reputation for founders:
+        for (uint256 i = 0; i < _founders.length; i++) {
+            require(_founders[i] != address(0));
+            if (_foundersTokenAmount[i] > 0) {
+                nativeToken.mint(_founders[i], _foundersTokenAmount[i]);
+            }
+            if (_foundersReputationAmount[i] > 0) {
+                nativeReputation.mint(_founders[i], _foundersReputationAmount[i]);
+            }
+        }
+ 
+        Controller controller = Controller(controllerCreator.create(avatar));
+ 
+        // Add the DAO to the tracking registry
+        daoTracker.track(avatar, controller, "");
+ 
+        // Transfer ownership:
+        avatar.transferOwnership(address(controller));
+        nativeToken.transferOwnership(address(controller));
+        nativeReputation.transferOwnership(address(controller));
+ 
+        locks[address(avatar)] = msg.sender;
+ 
+        emit NewOrg (address(avatar));
+        return (address(avatar));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/universalSchemes/GlobalConstraintRegistrar.sol.html b/coverage/lcov-report/universalSchemes/GlobalConstraintRegistrar.sol.html new file mode 100644 index 00000000..90751ae1 --- /dev/null +++ b/coverage/lcov-report/universalSchemes/GlobalConstraintRegistrar.sol.html @@ -0,0 +1,680 @@ + + + + Code coverage report for universalSchemes/GlobalConstraintRegistrar.sol + + + + + + + +
+
+

+ all files / universalSchemes/ GlobalConstraintRegistrar.sol +

+
+
+ 100% + Statements + 37/37 +
+
+ 90% + Branches + 9/10 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 38/38 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + + + + +  + +  +  + +  +  + + + +  +  + + +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +11× +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + + +  + +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  + + + + + +  +  +  +  +  +  + +  +  +  +  +  +  + + + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "./UniversalScheme.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+ 
+/**
+ * @title A scheme to manage global constraint for organizations
+ * @dev The scheme is used to register or remove new global constraints
+ */
+contract GlobalConstraintRegistrar is UniversalScheme, VotingMachineCallbacks, ProposalExecuteInterface {
+    event NewGlobalConstraintsProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        address _gc,
+        bytes32 _params,
+        bytes32 _voteToRemoveParams,
+        string _descriptionHash
+    );
+ 
+    event RemoveGlobalConstraintsProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        address _gc,
+        string _descriptionHash
+    );
+ 
+    event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param);
+    event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId);
+ 
+    // The struct that holds the information of a global constraint proposed to be added or removed.
+    struct GCProposal {
+        address gc; // The address of the global constraint contract.
+        bool addGC; // true: add a GC, false: remove a GC.
+        bytes32 params; // Parameters for global constraint.
+        bytes32 voteToRemoveParams; // Voting parameters for removing this GC.
+    }
+ 
+    // GCProposal by avatar and proposalId
+    mapping(address=>mapping(bytes32=>GCProposal)) public organizationsProposals;
+ 
+    // voteToRemoveParams hash by avatar and proposal.gc
+    mapping(address=>mapping(address=>bytes32)) public voteToRemoveParams;
+ 
+    // A mapping from hashes to parameters (use to store a particular configuration on the controller)
+    struct Parameters {
+        bytes32 voteRegisterParams;
+        IntVoteInterface intVote;
+    }
+ 
+    mapping(bytes32=>Parameters) public parameters;
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _param a parameter of the voting result, 1 yes and 2 is no.
+    * @return bool which represents a successful of the function.
+    */
+    function executeProposal(bytes32 _proposalId, int256 _param) external onlyVotingMachine(_proposalId) returns(bool) {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        bool retVal = true;
+        // Check if vote was successful:
+        GCProposal memory proposal = organizationsProposals[address(avatar)][_proposalId];
+        Erequire(proposal.gc != address(0));
+        delete organizationsProposals[address(avatar)][_proposalId];
+        emit ProposalDeleted(address(avatar), _proposalId);
+ 
+        if (_param == 1) {
+ 
+        // Define controller and get the params:
+            Controller controller = Controller(avatar.owner());
+ 
+        // Adding a GC
+            if (proposal.addGC) {
+                retVal = controller.addGlobalConstraint(proposal.gc, proposal.params, address(avatar));
+                voteToRemoveParams[address(avatar)][proposal.gc] = proposal.voteToRemoveParams;
+            }
+        // Removing a GC
+            if (!proposal.addGC) {
+                retVal = controller.removeGlobalConstraint(proposal.gc, address(avatar));
+            }
+        }
+        emit ProposalExecuted(address(avatar), _proposalId, _param);
+        return retVal;
+    }
+ 
+    /**
+    * @dev Hash the parameters, save them if necessary, and return the hash value
+    * @param _voteRegisterParams -  voting parameters for register global constraint
+    * @param _intVote  - voting machine contract.
+    * @return bytes32 -the parameters hash
+    */
+    function setParameters(
+        bytes32 _voteRegisterParams,
+        IntVoteInterface _intVote
+    ) public returns(bytes32)
+    {
+        bytes32 paramsHash = getParametersHash(_voteRegisterParams, _intVote);
+        parameters[paramsHash].voteRegisterParams = _voteRegisterParams;
+        parameters[paramsHash].intVote = _intVote;
+        return paramsHash;
+    }
+ 
+    /**
+    * @dev propose to add a new global constraint:
+    * @param _avatar the avatar of the organization that the constraint is proposed for
+    * @param _gc the address of the global constraint that is being proposed
+    * @param _params the parameters for the global constraint
+    * @param _voteToRemoveParams the conditions (on the voting machine) for removing this global constraint
+    * @param _descriptionHash proposal's description hash
+    * @return bytes32 -the proposal id
+    */
+    // TODO: do some checks on _voteToRemoveParams - it is very easy to make a mistake and not be able to remove the GC
+    function proposeGlobalConstraint(
+    Avatar _avatar,
+    address _gc,
+    bytes32 _params,
+    bytes32 _voteToRemoveParams,
+    string memory _descriptionHash)
+    public
+    returns(bytes32)
+    {
+        Parameters memory votingParams = parameters[getParametersFromController(_avatar)];
+ 
+        IntVoteInterface intVote = votingParams.intVote;
+        bytes32 proposalId = intVote.propose(2, votingParams.voteRegisterParams, msg.sender, address(_avatar));
+ 
+        GCProposal memory proposal = GCProposal({
+            gc: _gc,
+            params: _params,
+            addGC: true,
+            voteToRemoveParams: _voteToRemoveParams
+        });
+ 
+        organizationsProposals[address(_avatar)][proposalId] = proposal;
+        emit NewGlobalConstraintsProposal(
+            address(_avatar),
+            proposalId,
+            address(intVote),
+            _gc,
+            _params,
+            _voteToRemoveParams,
+            _descriptionHash
+        );
+        proposalsInfo[address(intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev propose to remove a global constraint:
+    * @param _avatar the avatar of the organization that the constraint is proposed for
+    * @param _gc the address of the global constraint that is being proposed
+    * @param _descriptionHash proposal's description hash
+    * @return bytes32 -the proposal id
+    */
+    function proposeToRemoveGC(Avatar _avatar, address _gc, string memory _descriptionHash) public returns(bytes32) {
+        Controller controller = Controller(_avatar.owner());
+        require(controller.isGlobalConstraintRegistered(_gc, address(_avatar)));
+        Parameters memory params = parameters[getParametersFromController(_avatar)];
+        IntVoteInterface intVote = params.intVote;
+        bytes32 proposalId = intVote.propose(
+        2,
+        voteToRemoveParams[address(_avatar)][_gc],
+        msg.sender,
+        address(_avatar)
+        );
+ 
+        GCProposal memory proposal = GCProposal({
+            gc: _gc,
+            params: 0,
+            addGC: false,
+            voteToRemoveParams: 0
+        });
+ 
+        organizationsProposals[address(_avatar)][proposalId] = proposal;
+        emit RemoveGlobalConstraintsProposal(address(_avatar), proposalId, address(intVote), _gc, _descriptionHash);
+        proposalsInfo[address(intVote)][proposalId] = ProposalInfo({
+            blockNumber: block.number,
+            avatar: _avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev Hash the parameters and return the hash value
+    * @param _voteRegisterParams -  voting parameters
+    * @param _intVote  - voting machine contract.
+    * @return bytes32 -the parameters hash
+    */
+    function getParametersHash(
+        bytes32 _voteRegisterParams,
+        IntVoteInterface _intVote
+    ) public pure returns(bytes32)
+    {
+        return (keccak256(abi.encodePacked(_voteRegisterParams, _intVote)));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/universalSchemes/OrganizationRegister.sol.html b/coverage/lcov-report/universalSchemes/OrganizationRegister.sol.html new file mode 100644 index 00000000..89c4ced2 --- /dev/null +++ b/coverage/lcov-report/universalSchemes/OrganizationRegister.sol.html @@ -0,0 +1,317 @@ + + + + Code coverage report for universalSchemes/OrganizationRegister.sol + + + + + + + +
+
+

+ all files / universalSchemes/ OrganizationRegister.sol +

+
+
+ 100% + Statements + 14/14 +
+
+ 83.33% + Branches + 5/6 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 14/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  + + + +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
pragma solidity 0.5.17;
+ 
+import "./UniversalScheme.sol";
+import "../libs/SafeERC20.sol";
+ 
+/**
+ * @title A universal organization registry.
+ * @dev Organizations can use this scheme to open a registry.
+ * Other organizations can then add and promote themselves on this registry.
+ */
+ 
+contract OrganizationRegister is UniversalScheme {
+    using SafeMath for uint;
+    using SafeERC20 for address;
+ 
+    struct Parameters {
+        uint256 fee;
+        IERC20 token;
+        address beneficiary;
+    }
+ 
+    // A mapping from the organization (Avatar) address to the saved data of the organization:
+    mapping(address=>mapping(address=>uint)) public organizationsRegistry;
+ 
+    mapping(bytes32=>Parameters) public parameters;
+ 
+    event OrgAdded( address indexed _registry, address indexed _org);
+    event Promotion( address indexed _registry, address indexed _org, uint256 _amount);
+ 
+    /**
+    * @dev Hash the parameters, save if needed and return the hash value
+    * @param _token -  the token to pay for register or promotion an address.
+    * @param _fee  - fee needed for register an address.
+    * @param _beneficiary  - the beneficiary payment address
+    * @return bytes32 -the parameters hash
+    */
+    function setParameters(IERC20 _token, uint256 _fee, address _beneficiary) public returns(bytes32) {
+        bytes32 paramsHash = getParametersHash(_token, _fee, _beneficiary);
+        Eif (parameters[paramsHash].token == ERC20(0)) {
+            parameters[paramsHash].token = _token;
+            parameters[paramsHash].fee = _fee;
+            parameters[paramsHash].beneficiary = _beneficiary;
+        }
+        return paramsHash;
+    }
+ 
+    /**
+     * @dev Adding or promoting an address on the registry.
+     *      An address(record) to add or promote can be organization address or any contract address.
+     *      Adding a record is done by paying at least the minimum required by the registry params.
+     *      Promoting a record is done by paying(adding)amount of token to the registry beneficiary.
+     * @param _avatar The _avatar of the organization which own the registry.
+     * @param _record The address to add or promote.
+     * @param _amount amount to pay for adding or promoting
+     */
+    function addOrPromoteAddress(Avatar _avatar, address _record, uint256 _amount)
+    public
+    {
+        Parameters memory params = parameters[getParametersFromController(_avatar)];
+        // Pay promotion, if the org was not listed the minimum is the fee:
+        require((organizationsRegistry[address(_avatar)][_record] > 0) || (_amount >= params.fee));
+ 
+        address(params.token).safeTransferFrom(msg.sender, params.beneficiary, _amount);
+        if (organizationsRegistry[address(_avatar)][_record] == 0) {
+            emit OrgAdded(address(_avatar), _record);
+        }
+        organizationsRegistry[address(_avatar)][_record] =
+        organizationsRegistry[address(_avatar)][_record].add(_amount);
+        emit Promotion(address(_avatar), _record, _amount);
+    }
+ 
+    /**
+    * @dev Hash the parameters ,and return the hash value
+    * @param _token -  the token to pay for register or promotion an address.
+    * @param _fee  - fee needed for register an address.
+    * @param _beneficiary  - the beneficiary payment address
+    * @return bytes32 -the parameters hash
+    */
+    function getParametersHash(IERC20 _token, uint256 _fee, address _beneficiary)
+    public pure returns(bytes32)
+    {
+        return (keccak256(abi.encodePacked(_token, _fee, _beneficiary)));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/universalSchemes/SchemeRegistrar.sol.html b/coverage/lcov-report/universalSchemes/SchemeRegistrar.sol.html new file mode 100644 index 00000000..797b146b --- /dev/null +++ b/coverage/lcov-report/universalSchemes/SchemeRegistrar.sol.html @@ -0,0 +1,641 @@ + + + + Code coverage report for universalSchemes/SchemeRegistrar.sol + + + + + + + +
+
+

+ all files / universalSchemes/ SchemeRegistrar.sol +

+
+
+ 100% + Statements + 35/35 +
+
+ 68.75% + Branches + 11/16 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 36/36 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +11× +11× +11× +11× +11× +11× +  +  +10× +  +  +10× + +  +  +  +  +  +  +  +10× + +  +  +11× +11× +  +  +  +  +  +  +  +  +  +  +  +15× +15× +15× +15× +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +11× +11× +  +11× +  +  +  +  +  +  +11× +  +  +  +  +  +11× +  +  +  +  +  +  +  +11× +11× +  +  +  +11× +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + + + + + +  +  +  + +  +  +  +  +  +  +  +  +30× +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "./UniversalScheme.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+/**
+ * @title A registrar for Schemes for organizations
+ * @dev The SchemeRegistrar is used for registering and unregistering schemes at organizations
+ */
+ 
+contract SchemeRegistrar is UniversalScheme, VotingMachineCallbacks, ProposalExecuteInterface {
+    event NewSchemeProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        address _scheme,
+        bytes32 _parametersHash,
+        bytes4 _permissions,
+        string _descriptionHash
+    );
+ 
+    event RemoveSchemeProposal(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        address _scheme,
+        string _descriptionHash
+    );
+ 
+    event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param);
+    event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId);
+ 
+    // a SchemeProposal is a  proposal to add or remove a scheme to/from the an organization
+    struct SchemeProposal {
+        address scheme; //
+        bool addScheme; // true: add a scheme, false: remove a scheme.
+        bytes32 parametersHash;
+        bytes4 permissions;
+    }
+ 
+    // A mapping from the organization (Avatar) address to the saved data of the organization:
+    mapping(address=>mapping(bytes32=>SchemeProposal)) public organizationsProposals;
+ 
+    // A mapping from hashes to parameters (use to store a particular configuration on the controller)
+    struct Parameters {
+        bytes32 voteRegisterParams;
+        bytes32 voteRemoveParams;
+        IntVoteInterface intVote;
+    }
+ 
+    mapping(bytes32=>Parameters) public parameters;
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _param a parameter of the voting result, 1 yes and 2 is no.
+    */
+    function executeProposal(bytes32 _proposalId, int256 _param) external onlyVotingMachine(_proposalId) returns(bool) {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        SchemeProposal memory proposal = organizationsProposals[address(avatar)][_proposalId];
+        Erequire(proposal.scheme != address(0));
+        delete organizationsProposals[address(avatar)][_proposalId];
+        emit ProposalDeleted(address(avatar), _proposalId);
+        if (_param == 1) {
+ 
+          // Define controller and get the params:
+            Controller controller = Controller(avatar.owner());
+ 
+          // Add a scheme:
+            if (proposal.addScheme) {
+                Erequire(controller.registerScheme(
+                        proposal.scheme,
+                        proposal.parametersHash,
+                        proposal.permissions,
+                        address(avatar))
+                );
+            }
+          // Remove a scheme:
+            if (!proposal.addScheme) {
+                Erequire(controller.unregisterScheme(proposal.scheme, address(avatar)));
+            }
+        }
+        emit ProposalExecuted(address(avatar), _proposalId, _param);
+        return true;
+    }
+ 
+    /**
+    * @dev hash the parameters, save them if necessary, and return the hash value
+    */
+    function setParameters(
+        bytes32 _voteRegisterParams,
+        bytes32 _voteRemoveParams,
+        IntVoteInterface _intVote
+    ) public returns(bytes32)
+    {
+        bytes32 paramsHash = getParametersHash(_voteRegisterParams, _voteRemoveParams, _intVote);
+        parameters[paramsHash].voteRegisterParams = _voteRegisterParams;
+        parameters[paramsHash].voteRemoveParams = _voteRemoveParams;
+        parameters[paramsHash].intVote = _intVote;
+        return paramsHash;
+    }
+ 
+    /**
+    * @dev create a proposal to register a scheme
+    * @param _avatar the address of the organization the scheme will be registered for
+    * @param _scheme the address of the scheme to be registered
+    * @param _parametersHash a hash of the configuration of the _scheme
+    * @param _permissions the permission of the scheme to be registered
+    * @param _descriptionHash proposal's description hash
+    * @return a proposal Id
+    * @dev NB: not only proposes the vote, but also votes for it
+    */
+    function proposeScheme(
+        Avatar _avatar,
+        address _scheme,
+        bytes32 _parametersHash,
+        bytes4 _permissions,
+        string memory _descriptionHash
+    )
+    public
+    returns(bytes32)
+    {
+        // propose
+        Erequire(_scheme != address(0), "scheme cannot be zero");
+        Parameters memory controllerParams = parameters[getParametersFromController(_avatar)];
+ 
+        bytes32 proposalId = controllerParams.intVote.propose(
+            2,
+            controllerParams.voteRegisterParams,
+            msg.sender,
+            address(_avatar)
+        );
+ 
+        SchemeProposal memory proposal = SchemeProposal({
+            scheme: _scheme,
+            parametersHash: _parametersHash,
+            addScheme: true,
+            permissions: _permissions
+        });
+        emit NewSchemeProposal(
+            address(_avatar),
+            proposalId,
+            address(controllerParams.intVote),
+            _scheme, _parametersHash,
+            _permissions,
+            _descriptionHash
+        );
+        organizationsProposals[address(_avatar)][proposalId] = proposal;
+        proposalsInfo[address(controllerParams.intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev propose to remove a scheme for a controller
+    * @param _avatar the address of the controller from which we want to remove a scheme
+    * @param _scheme the address of the scheme we want to remove
+    * @param _descriptionHash proposal description hash
+    * NB: not only registers the proposal, but also votes for it
+    */
+    function proposeToRemoveScheme(Avatar _avatar, address _scheme, string memory _descriptionHash)
+    public
+    returns(bytes32)
+    {
+        Erequire(_scheme != address(0), "scheme cannot be zero");
+        bytes32 paramsHash = getParametersFromController(_avatar);
+        Parameters memory params = parameters[paramsHash];
+ 
+        IntVoteInterface intVote = params.intVote;
+        bytes32 proposalId = intVote.propose(2, params.voteRemoveParams, msg.sender, address(_avatar));
+        organizationsProposals[address(_avatar)][proposalId].scheme = _scheme;
+        emit RemoveSchemeProposal(address(_avatar), proposalId, address(intVote), _scheme, _descriptionHash);
+        proposalsInfo[address(params.intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return proposalId;
+    }
+ 
+    function getParametersHash(
+        bytes32 _voteRegisterParams,
+        bytes32 _voteRemoveParams,
+        IntVoteInterface _intVote
+    ) public pure returns(bytes32)
+    {
+        return keccak256(abi.encodePacked(_voteRegisterParams, _voteRemoveParams, _intVote));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/universalSchemes/UniversalScheme.sol.html b/coverage/lcov-report/universalSchemes/UniversalScheme.sol.html new file mode 100644 index 00000000..53bfcd62 --- /dev/null +++ b/coverage/lcov-report/universalSchemes/UniversalScheme.sol.html @@ -0,0 +1,116 @@ + + + + Code coverage report for universalSchemes/UniversalScheme.sol + + + + + + + +
+
+

+ all files / universalSchemes/ UniversalScheme.sol +

+
+
+ 100% + Statements + 2/2 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 2/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18  +  +  +  +  +  +  +  +  +  +  +  +57× +  +57× +  +  + 
pragma solidity 0.5.17;
+ 
+import "./UniversalSchemeInterface.sol";
+import "../controller/Controller.sol";
+import "../controller/Avatar.sol";
+ 
+ 
+contract UniversalScheme is UniversalSchemeInterface {
+    /**
+    *  @dev get the parameters for the current scheme from the controller
+    */
+    function getParametersFromController(Avatar _avatar) internal view returns(bytes32) {
+        Erequire(Controller(_avatar.owner()).isSchemeRegistered(address(this), address(_avatar)),
+        "scheme is not registered");
+        return Controller(_avatar.owner()).getSchemeParameters(address(this), address(_avatar));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/universalSchemes/UniversalSchemeInterface.sol.html b/coverage/lcov-report/universalSchemes/UniversalSchemeInterface.sol.html new file mode 100644 index 00000000..58f02b59 --- /dev/null +++ b/coverage/lcov-report/universalSchemes/UniversalSchemeInterface.sol.html @@ -0,0 +1,92 @@ + + + + Code coverage report for universalSchemes/UniversalSchemeInterface.sol + + + + + + + +
+
+

+ all files / universalSchemes/ UniversalSchemeInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10  +  +  +  +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "../controller/Avatar.sol";
+ 
+contract UniversalSchemeInterface {
+ 
+    function getParametersFromController(Avatar _avatar) internal view returns(bytes32);
+    
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/universalSchemes/UpgradeScheme.sol.html b/coverage/lcov-report/universalSchemes/UpgradeScheme.sol.html new file mode 100644 index 00000000..38ebda51 --- /dev/null +++ b/coverage/lcov-report/universalSchemes/UpgradeScheme.sol.html @@ -0,0 +1,638 @@ + + + + Code coverage report for universalSchemes/UpgradeScheme.sol + + + + + + + +
+
+

+ all files / universalSchemes/ UpgradeScheme.sol +

+
+
+ 100% + Statements + 36/36 +
+
+ 72.22% + Branches + 13/18 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 37/37 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + + +  + +  +  + +  + + +  +  +  + + + +  +  + + +  +  +  + + +  +  +  +  +  +  +  +  +  +  + + + + +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  + + +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  + +  +  +  +  + +  + +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +18× +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/ProposalExecuteInterface.sol";
+import "./UniversalScheme.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+/**
+ * @title A scheme to manage the upgrade of an organization.
+ * @dev The scheme is used to upgrade the controller of an organization to a new controller.
+ */
+ 
+contract UpgradeScheme is UniversalScheme, VotingMachineCallbacks, ProposalExecuteInterface {
+ 
+    event NewUpgradeProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        address _newController,
+        string _descriptionHash
+    );
+ 
+    event ChangeUpgradeSchemeProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        address _newUpgradeScheme,
+        bytes32 _params,
+        string _descriptionHash
+    );
+ 
+    event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param);
+    event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId);
+ 
+    // Details of an upgrade proposal:
+    struct UpgradeProposal {
+        address upgradeContract; // Either the new controller we upgrade to, or the new upgrading scheme.
+        bytes32 params; // Params for the new upgrading scheme.
+        uint256 proposalType; // 1: Upgrade controller, 2: change upgrade scheme.
+    }
+ 
+    // A mapping from the organization's (Avatar) address to the saved data of the organization:
+    mapping(address=>mapping(bytes32=>UpgradeProposal)) public organizationsProposals;
+ 
+    // A mapping from hashes to parameters (use to store a particular configuration on the controller)
+    struct Parameters {
+        bytes32 voteParams;
+        IntVoteInterface intVote;
+    }
+ 
+    mapping(bytes32=>Parameters) public parameters;
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _param a parameter of the voting result, 1 yes and 2 is no.
+    */
+    function executeProposal(bytes32 _proposalId, int256 _param) external onlyVotingMachine(_proposalId) returns(bool) {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        UpgradeProposal memory proposal = organizationsProposals[address(avatar)][_proposalId];
+        Erequire(proposal.proposalType != 0);
+        delete organizationsProposals[address(avatar)][_proposalId];
+        emit ProposalDeleted(address(avatar), _proposalId);
+        // Check if vote was successful:
+        if (_param == 1) {
+ 
+        // Define controller and get the params:
+            Controller controller = Controller(avatar.owner());
+        // Upgrading controller:
+            if (proposal.proposalType == 1) {
+                Erequire(controller.upgradeController(proposal.upgradeContract, avatar));
+            }
+ 
+        // Changing upgrade scheme:
+            if (proposal.proposalType == 2) {
+                bytes4 permissions = controller.getSchemePermissions(address(this), address(avatar));
+                Erequire(
+                controller.registerScheme(proposal.upgradeContract, proposal.params, permissions, address(avatar))
+                );
+                if (proposal.upgradeContract != address(this)) {
+                    Erequire(controller.unregisterSelf(address(avatar)));
+                }
+            }
+        }
+        emit ProposalExecuted(address(avatar), _proposalId, _param);
+        return true;
+    }
+ 
+    /**
+    * @dev hash the parameters, save them if necessary, and return the hash value
+    */
+    function setParameters(
+        bytes32 _voteParams,
+        IntVoteInterface _intVote
+    ) public returns(bytes32)
+    {
+        bytes32 paramsHash = getParametersHash(_voteParams, _intVote);
+        parameters[paramsHash].voteParams = _voteParams;
+        parameters[paramsHash].intVote = _intVote;
+        return paramsHash;
+    }
+ 
+    /**
+    * @dev propose an upgrade of the organization's controller
+    * @param _avatar avatar of the organization
+    * @param _newController address of the new controller that is being proposed
+    * @param _descriptionHash proposal description hash
+    * @return an id which represents the proposal
+    */
+    function proposeUpgrade(Avatar _avatar, address _newController, string memory _descriptionHash)
+        public
+        returns(bytes32)
+    {
+        Parameters memory params = parameters[getParametersFromController(_avatar)];
+        bytes32 proposalId = params.intVote.propose(2, params.voteParams, msg.sender, address(_avatar));
+        UpgradeProposal memory proposal = UpgradeProposal({
+            proposalType: 1,
+            upgradeContract: _newController,
+            params: bytes32(0)
+        });
+        organizationsProposals[address(_avatar)][proposalId] = proposal;
+        emit NewUpgradeProposal(
+        address(_avatar),
+        proposalId,
+        address(params.intVote),
+        _newController,
+        _descriptionHash
+        );
+        proposalsInfo[address(params.intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev propose to replace this scheme by another upgrading scheme
+    * @param _avatar avatar of the organization
+    * @param _scheme address of the new upgrading scheme
+    * @param _params the parameters of the new upgrading scheme
+    * @param _descriptionHash proposal description hash
+    * @return an id which represents the proposal
+    */
+    function proposeChangeUpgradingScheme(
+        Avatar _avatar,
+        address _scheme,
+        bytes32 _params,
+        string memory _descriptionHash
+    )
+        public
+        returns(bytes32)
+    {
+        Parameters memory params = parameters[getParametersFromController(_avatar)];
+        IntVoteInterface intVote = params.intVote;
+        bytes32 proposalId = intVote.propose(2, params.voteParams, msg.sender, address(_avatar));
+        Erequire(organizationsProposals[address(_avatar)][proposalId].proposalType == 0);
+ 
+        UpgradeProposal memory proposal = UpgradeProposal({
+            proposalType: 2,
+            upgradeContract: _scheme,
+            params: _params
+        });
+        organizationsProposals[address(_avatar)][proposalId] = proposal;
+ 
+        emit ChangeUpgradeSchemeProposal(
+            address(_avatar),
+            proposalId,
+            address(params.intVote),
+            _scheme,
+            _params,
+            _descriptionHash
+        );
+        proposalsInfo[address(intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev return a hash of the given parameters
+    */
+    function getParametersHash(
+        bytes32 _voteParams,
+        IntVoteInterface _intVote
+    ) public pure returns(bytes32)
+    {
+        return  (keccak256(abi.encodePacked(_voteParams, _intVote)));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/universalSchemes/VoteInOrganizationScheme.sol.html b/coverage/lcov-report/universalSchemes/VoteInOrganizationScheme.sol.html new file mode 100644 index 00000000..ef35f780 --- /dev/null +++ b/coverage/lcov-report/universalSchemes/VoteInOrganizationScheme.sol.html @@ -0,0 +1,548 @@ + + + + Code coverage report for universalSchemes/VoteInOrganizationScheme.sol + + + + + + + +
+
+

+ all files / universalSchemes/ VoteInOrganizationScheme.sol +

+
+
+ 100% + Statements + 27/27 +
+
+ 60% + Branches + 6/10 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 28/28 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + + + + + + +  + +  + + +  +  +  +  +  +  +  +  +  + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +11× +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + + +  +  + +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "./UniversalScheme.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+/**
+ * @title VoteInOrganizationScheme.
+ * @dev A scheme to allow an organization to vote in a proposal.
+ */
+contract VoteInOrganizationScheme is UniversalScheme, VotingMachineCallbacks, ProposalExecuteInterface {
+    event NewVoteProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        IntVoteInterface _originalIntVote,
+        bytes32 _originalProposalId,
+        uint256 _vote,
+        string _descriptionHash
+    );
+ 
+    event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param, bytes _callReturnValue);
+    event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId);
+ 
+    // Details of a voting proposal:
+    struct VoteProposal {
+        IntVoteInterface originalIntVote;
+        bytes32 originalProposalId;
+        uint256 vote;
+        bool exist;
+    }
+ 
+    // A mapping from the organization (Avatar) address to the saved data of the organization:
+    mapping(address=>mapping(bytes32=>VoteProposal)) public organizationsProposals;
+ 
+    struct Parameters {
+        IntVoteInterface intVote;
+        bytes32 voteParams;
+    }
+ 
+    // A mapping from hashes to parameters (use to store a particular configuration on the controller)
+    mapping(bytes32=>Parameters) public parameters;
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _param a parameter of the voting result, 1 yes and 2 is no.
+    * @return bool which represents a successful of the function
+    */
+    function executeProposal(bytes32 _proposalId, int256 _param) external onlyVotingMachine(_proposalId) returns(bool) {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        // Save proposal to memory and delete from storage:
+        VoteProposal memory proposal = organizationsProposals[address(avatar)][_proposalId];
+        Erequire(proposal.exist);
+        delete organizationsProposals[address(avatar)][_proposalId];
+        emit ProposalDeleted(address(avatar), _proposalId);
+        bytes memory callReturnValue;
+        bool success;
+        // If no decision do nothing:
+        if (_param == 1) {
+ 
+            Controller controller = Controller(avatar.owner());
+            (success, callReturnValue) = controller.genericCall(
+            address(proposal.originalIntVote),
+            abi.encodeWithSignature("vote(bytes32,uint256,uint256,address)",
+            proposal.originalProposalId,
+            proposal.vote,
+            0,
+            address(this)),
+            avatar,
+            0
+            );
+            Erequire(success);
+        }
+        emit ProposalExecuted(address(avatar), _proposalId, _param, callReturnValue);
+        return true;
+    }
+ 
+    /**
+    * @dev Hash the parameters, save them if necessary, and return the hash value
+    * @param _voteParams -  voting parameters
+    * @param _intVote  - voting machine contract.
+    * @return bytes32 -the parameters hash
+    */
+    function setParameters(
+        bytes32 _voteParams,
+        IntVoteInterface _intVote
+    ) public returns(bytes32)
+    {
+        bytes32 paramsHash = getParametersHash(_voteParams, _intVote);
+        parameters[paramsHash].voteParams = _voteParams;
+        parameters[paramsHash].intVote = _intVote;
+        return paramsHash;
+    }
+ 
+    /**
+    * @dev propose to vote in other organization
+    *      The function trigger NewVoteProposal event
+    * @param _avatar avatar of the organization
+    * @param _originalIntVote the other organization voting machine
+    * @param _originalProposalId the other organization proposal id
+    * @param _vote - which value to vote in the destination organization
+    * @param _descriptionHash proposal description hash
+    * @return an id which represents the proposal
+    */
+    function proposeVote(
+    Avatar _avatar,
+    IntVoteInterface _originalIntVote,
+    bytes32 _originalProposalId,
+    uint256 _vote,
+    string memory _descriptionHash)
+    public
+    returns(bytes32)
+    {
+        Parameters memory params = parameters[getParametersFromController(_avatar)];
+        IntVoteInterface intVote = params.intVote;
+        (uint256 minVote, uint256 maxVote) = _originalIntVote.getAllowedRangeOfChoices();
+        Erequire(_vote <= maxVote && _vote >= minVote, "vote should be in the allowed range");
+        Erequire(_vote <= _originalIntVote.getNumberOfChoices(_originalProposalId),
+        "vote should be <= original proposal number of choices");
+ 
+        bytes32 proposalId = intVote.propose(2, params.voteParams, msg.sender, address(_avatar));
+ 
+        organizationsProposals[address(_avatar)][proposalId] = VoteProposal({
+            originalIntVote: _originalIntVote,
+            originalProposalId: _originalProposalId,
+            vote:_vote,
+            exist: true
+        });
+        emit NewVoteProposal(
+            address(_avatar),
+            proposalId,
+            address(params.intVote),
+            _originalIntVote,
+            _originalProposalId,
+            _vote,
+            _descriptionHash
+        );
+        proposalsInfo[address(intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev Hash the parameters, and return the hash value
+    * @param _voteParams -  voting parameters
+    * @param _intVote  - voting machine contract.
+    * @return bytes32 -the parameters hash
+    */
+    function getParametersHash(
+        bytes32 _voteParams,
+        IntVoteInterface _intVote
+    ) public pure returns(bytes32)
+    {
+        return keccak256(abi.encodePacked(_voteParams, _intVote));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/universalSchemes/index.html b/coverage/lcov-report/universalSchemes/index.html new file mode 100644 index 00000000..88ec5e6c --- /dev/null +++ b/coverage/lcov-report/universalSchemes/index.html @@ -0,0 +1,197 @@ + + + + Code coverage report for universalSchemes/ + + + + + + + +
+
+

+ all files universalSchemes/ +

+
+
+ 100% + Statements + 301/301 +
+
+ 75% + Branches + 123/164 +
+
+ 100% + Functions + 45/45 +
+
+ 100% + Lines + 305/305 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ContributionReward.sol
100%103/10380%56/70100%16/16100%102/102
DaoCreator.sol
100%47/4768.75%22/32100%6/6100%48/48
GlobalConstraintRegistrar.sol
100%37/3790%9/10100%5/5100%38/38
OrganizationRegister.sol
100%14/1483.33%5/6100%3/3100%14/14
SchemeRegistrar.sol
100%35/3568.75%11/16100%5/5100%36/36
UniversalScheme.sol
100%2/250%1/2100%1/1100%2/2
UniversalSchemeInterface.sol
100%0/0100%0/0100%0/0100%0/0
UpgradeScheme.sol
100%36/3672.22%13/18100%5/5100%37/37
VoteInOrganizationScheme.sol
100%27/2760%6/10100%4/4100%28/28
+
+
+ + + + + + + diff --git a/coverage/lcov-report/utils/DAOTracker.sol.html b/coverage/lcov-report/utils/DAOTracker.sol.html new file mode 100644 index 00000000..9385ee8a --- /dev/null +++ b/coverage/lcov-report/utils/DAOTracker.sol.html @@ -0,0 +1,386 @@ + + + + Code coverage report for utils/DAOTracker.sol + + + + + + + +
+
+

+ all files / utils/ DAOTracker.sol +

+
+
+ 100% + Statements + 11/11 +
+
+ 75% + Branches + 9/12 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 13/13 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +302× +  +298× +  +  +  +298× +  +298× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +298× +298× +  +296× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  + + + +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/Reputation.sol";
+import "../controller/DAOToken.sol";
+import "../controller/Avatar.sol";
+import "../controller/Controller.sol";
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+ 
+/**
+ * @title An on-chain "source of truth" for what DAOs
+ *        should be index into DAOstack's subgraph.
+ */
+contract DAOTracker is Ownable {
+ 
+    // `blacklist` the DAO from the subgraph's cache.
+    // Only able to be set by the owner of the DAOTracker.
+    mapping(address=>bool) public blacklisted;
+ 
+    event TrackDAO(
+        address indexed _avatar,
+        address _controller,
+        address _reputation,
+        address _daoToken,
+        address _sender,
+        string _arcVersion
+    );
+ 
+    event BlacklistDAO(
+        address indexed _avatar,
+        string _explanationHash
+    );
+ 
+    event ResetDAO(
+        address indexed _avatar,
+        string _explanationHash
+    );
+ 
+    modifier onlyAvatarOwner(Avatar avatar) {
+        require(avatar.owner() == msg.sender,
+                "The caller must be the owner of the Avatar.");
+        _;
+    }
+ 
+    modifier notBlacklisted(Avatar avatar) {
+        Erequire(blacklisted[address(avatar)] == false,
+                "The avatar has been blacklisted.");
+        _;
+    }
+ 
+    /**
+    * @dev track a new organization. This function will tell the subgraph
+    *      to start ingesting events from the DAO's contracts.
+    *      NOTE: This function should be called as early as possible in the DAO deployment
+    *      process. **Smart Contract Events that are emitted from blocks prior to this function's
+    *      event being emitted WILL NOT be ingested into the subgraph**, leading to an incorrect
+    *      cache. If this happens to you, please contact the subgraph maintainer. Your DAO will
+    *      need to be added to the subgraph's startup config, and the cache will need to be rebuilt.
+    * @param _avatar the organization avatar
+    * @param _controller the organization controller
+    */
+    function track(Avatar _avatar, Controller _controller, string memory _arcVersion)
+    public
+    onlyAvatarOwner(_avatar)
+    notBlacklisted(_avatar) {
+        // Only allow the information to be set once. In the case of a controller upgrades,
+        // the subgraph will be updated via the UpgradeController event.
+        Erequire(_avatar != Avatar(0));
+        require(_controller != Controller(0));
+ 
+        emit TrackDAO(
+            address(_avatar),
+            address(_controller),
+            address(_avatar.nativeReputation()),
+            address(_avatar.nativeToken()),
+            msg.sender,
+            _arcVersion
+        );
+    }
+ 
+    /**
+    * @dev blacklist a DAO from the cache. This should be callable by maintainer of the cache.
+    *      Blacklisting can be used to defend against DoS attacks, or to remove spam. In order
+    *      for this blacklisting to take affect within the cache, it would need to be rebuilt.
+    * @param _avatar the organization avatar
+    * @param _explanationHash A hash of a document explaining why this DAO was blacklisted
+    */
+    function blacklist(Avatar _avatar, string memory _explanationHash)
+    public
+    onlyOwner {
+        require(_avatar != Avatar(0));
+        blacklisted[address(_avatar)] = true;
+        emit BlacklistDAO(address(_avatar), _explanationHash);
+    }
+ 
+    /**
+    * @dev reset a DAO in the cache. This should be callable by the maintainer of the cache.
+    * @param _avatar the organization avatar
+    * @param _explanationHash A hash of a document explaining why this DAO was reset
+    */
+    function reset(Avatar _avatar, string memory _explanationHash)
+    public
+    onlyOwner {
+        Erequire(_avatar != Avatar(0));
+        blacklisted[address(_avatar)] = false;
+        emit ResetDAO(address(_avatar), _explanationHash);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/utils/Redeemer.sol.html b/coverage/lcov-report/utils/Redeemer.sol.html new file mode 100644 index 00000000..b2b07d6b --- /dev/null +++ b/coverage/lcov-report/utils/Redeemer.sol.html @@ -0,0 +1,680 @@ + + + + Code coverage report for utils/Redeemer.sol + + + + + + + +
+
+

+ all files / utils/ Redeemer.sol +

+
+
+ 92% + Statements + 46/50 +
+
+ 68.18% + Branches + 15/22 +
+
+ 100% + Functions + 5/5 +
+
+ 92% + Lines + 46/50 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +12× +  +  +  + +  +12× +12× +  +12× +12× +10× +  +  +12× +12× +  +  +  +  +  +  +  + + + + + + + + + +  +  + +  + + + +  + +  +  +  + +  +  +  +  +  +  + + + + + + + +  +  + +  + +  + +  +  +  + +  +  + 
pragma solidity 0.5.17;
+ 
+import "../universalSchemes/ContributionReward.sol";
+import "../schemes/ContributionRewardExt.sol";
+import "@daostack/infra/contracts/votingMachines/GenesisProtocol.sol";
+import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
+ 
+ 
+contract Redeemer {
+    using SafeMath for uint;
+ 
+   /**
+    * @dev helper to redeem rewards for a proposal
+    * It calls execute on the proposal if it is not yet executed.
+    * It tries to redeem reputation and stake from the GenesisProtocol.
+    * It tries to redeem proposal rewards from the contribution rewards scheme.
+    * This function does not emit events.
+    * A client should listen to GenesisProtocol and ContributionReward redemption events
+    * to monitor redemption operations.
+    * @param _contributionReward contributionReward
+    * @param _genesisProtocol genesisProtocol
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @param _beneficiary beneficiary
+    * @return gpRewards array
+    *          gpRewards[0] - stakerTokenAmount
+    *          gpRewards[1] - voterReputationAmount
+    *          gpRewards[2] - proposerReputationAmount
+    * @return gpDaoBountyReward array
+    *         gpDaoBountyReward[0] - staker dao bounty reward -
+    *                                will be zero for the case there is not enough tokens in avatar for the reward.
+    *         gpDaoBountyReward[1] - staker potential dao bounty reward.
+    * @return executed  bool true or false
+    * @return winningVote
+    *                   1 - executed or closed and the winning vote is YES
+    *                   2 - executed or closed and the winning vote is NO
+    * @return int256 crReputationReward Reputation - from ContributionReward
+    * @return int256 crNativeTokenReward NativeTokenReward - from ContributionReward
+    * @return int256 crEthReward Ether - from ContributionReward
+    * @return int256 crExternalTokenReward ExternalToken - from ContributionReward
+    */
+    function redeem(ContributionReward _contributionReward,
+                    GenesisProtocol _genesisProtocol,
+                    bytes32 _proposalId,
+                    Avatar _avatar,
+                    address _beneficiary)
+    external
+    returns(uint[3] memory gpRewards,
+            uint[2] memory gpDaoBountyReward,
+            bool executed,
+            uint256 winningVote,
+            int256 crReputationReward,
+            uint256 crNativeTokenReward,
+            uint256 crEthReward,
+            uint256 crExternalTokenReward)
+    {
+        bool callContributionReward;
+        (gpRewards, gpDaoBountyReward, executed, winningVote, callContributionReward) =
+        genesisProtocolRedeem(_genesisProtocol, _proposalId, _beneficiary);
+        Eif (callContributionReward) {
+            //redeem from contributionReward only if it executed
+            if (_contributionReward.getProposalExecutionTime(_proposalId, address(_avatar)) > 0) {
+                (crReputationReward, crNativeTokenReward, crEthReward, crExternalTokenReward) =
+                contributionRewardRedeem(_contributionReward, _proposalId, _avatar);
+            }
+        }
+    }
+ 
+    /**
+     * @dev helper to redeem rewards for a proposal
+     * It calls execute on the proposal if it is not yet executed.
+     * It tries to redeem reputation and stake from the GenesisProtocol.
+     * It tries to redeem proposal rewards from the contribution rewards scheme.
+     * This function does not emit events.
+     * A client should listen to GenesisProtocol and ContributionReward redemption events
+     * to monitor redemption operations.
+     * @param _contributionRewardExt contributionRewardExt
+     * @param _genesisProtocol genesisProtocol
+     * @param _proposalId the ID of the voting in the voting machine
+     * @param _beneficiary beneficiary
+     * @return gpRewards array
+     *          gpRewards[0] - stakerTokenAmount
+     *          gpRewards[1] - voterReputationAmount
+     *          gpRewards[2] - proposerReputationAmount
+     * @return gpDaoBountyReward array
+     *         gpDaoBountyReward[0] - staker dao bounty reward -
+     *                                will be zero for the case there is not enough tokens in avatar for the reward.
+     *         gpDaoBountyReward[1] - staker potential dao bounty reward.
+     * @return executed  bool true or false
+     * @return winningVote
+     *                   1 - executed or closed and the winning vote is YES
+     *                   2 - executed or closed and the winning vote is NO
+     * @return int256 crReputationReward Reputation - from ContributionReward
+     * @return int256 crNativeTokenReward NativeTokenReward - from ContributionReward
+     * @return int256 crEthReward Ether - from ContributionReward
+     * @return int256 crExternalTokenReward ExternalToken - from ContributionReward
+     */
+    function redeemFromCRExt(ContributionRewardExt _contributionRewardExt,
+                            GenesisProtocol _genesisProtocol,
+                            bytes32 _proposalId,
+                            address _beneficiary)
+        external
+        returns(uint[3] memory gpRewards,
+                uint[2] memory gpDaoBountyReward,
+                bool executed,
+                uint256 winningVote,
+                int256 crReputationReward,
+                uint256 crNativeTokenReward,
+                uint256 crEthReward,
+                uint256 crExternalTokenReward)
+    {
+        bool callContributionReward;
+        (gpRewards, gpDaoBountyReward, executed, winningVote, callContributionReward) =
+        genesisProtocolRedeem(_genesisProtocol, _proposalId, _beneficiary);
+        Eif (callContributionReward) {
+               //redeem from contributionReward only if it executed
+            if (_contributionRewardExt.getProposalAcceptedByVotingMachine(_proposalId)) {
+                (crReputationReward, crNativeTokenReward, crEthReward, crExternalTokenReward) =
+                contributionRewardExtRedeem(_contributionRewardExt, _proposalId);
+            }
+        }
+    }
+ 
+    function genesisProtocolRedeem(GenesisProtocol _genesisProtocol,
+                                    bytes32 _proposalId,
+                                    address _beneficiary)
+    private
+    returns(uint[3] memory gpRewards,
+            uint[2] memory gpDaoBountyReward,
+            bool executed,
+            uint256 winningVote,
+            bool callContributionReward) {
+        GenesisProtocol.ProposalState pState = _genesisProtocol.state(_proposalId);
+ 
+        if ((pState == GenesisProtocolLogic.ProposalState.Queued)||
+            (pState == GenesisProtocolLogic.ProposalState.PreBoosted)||
+            (pState == GenesisProtocolLogic.ProposalState.Boosted)||
+            (pState == GenesisProtocolLogic.ProposalState.QuietEndingPeriod)) {
+            executed = _genesisProtocol.execute(_proposalId);
+        }
+        pState = _genesisProtocol.state(_proposalId);
+        Eif ((pState == GenesisProtocolLogic.ProposalState.Executed) ||
+            (pState == GenesisProtocolLogic.ProposalState.ExpiredInQueue)) {
+            gpRewards = _genesisProtocol.redeem(_proposalId, _beneficiary);
+            if (pState == GenesisProtocolLogic.ProposalState.Executed) {
+                (gpDaoBountyReward[0], gpDaoBountyReward[1]) =
+                _genesisProtocol.redeemDaoBounty(_proposalId, _beneficiary);
+            }
+            winningVote = _genesisProtocol.winningVote(_proposalId);
+            callContributionReward = true;
+        }
+    }
+ 
+    function contributionRewardRedeem(ContributionReward _contributionReward, bytes32 _proposalId, Avatar _avatar)
+    private
+    returns (int256 reputation, uint256 nativeToken, uint256 eth, uint256 externalToken)
+    {
+        bool[4] memory whatToRedeem;
+        whatToRedeem[0] = true; //reputation
+        whatToRedeem[1] = true; //nativeToken
+        uint256 periodsToPay = _contributionReward.getPeriodsToPay(_proposalId, address(_avatar), 2);
+        uint256 ethReward = _contributionReward.getProposalEthReward(_proposalId, address(_avatar));
+        uint256 externalTokenReward = _contributionReward.getProposalExternalTokenReward(_proposalId, address(_avatar));
+        address externalTokenAddress = _contributionReward.getProposalExternalToken(_proposalId, address(_avatar));
+        ethReward = periodsToPay.mul(ethReward);
+        Iif ((ethReward == 0) || (address(_avatar).balance < ethReward)) {
+            whatToRedeem[2] = false;
+        } else {
+            whatToRedeem[2] = true;
+        }
+        periodsToPay = _contributionReward.getPeriodsToPay(_proposalId, address(_avatar), 3);
+        externalTokenReward = periodsToPay.mul(externalTokenReward);
+        Eif ((externalTokenReward == 0) ||
+            (IERC20(externalTokenAddress).balanceOf(address(_avatar)) < externalTokenReward)) {
+            whatToRedeem[3] = false;
+        } else {
+            whatToRedeem[3] = true;
+        }
+        (reputation, nativeToken, eth, externalToken) = _contributionReward.redeem(_proposalId, _avatar, whatToRedeem);
+    }
+ 
+    function contributionRewardExtRedeem(ContributionRewardExt _contributionRewardExt, bytes32 _proposalId)
+    private
+    returns (int256 reputation, uint256 nativeToken, uint256 eth, uint256 externalToken)
+    {
+        bool[4] memory whatToRedeem;
+        whatToRedeem[0] = true; //reputation
+        whatToRedeem[1] = true; //nativeToken
+        uint256 ethReward = _contributionRewardExt.getProposalEthReward(_proposalId);
+        uint256 externalTokenReward = _contributionRewardExt.getProposalExternalTokenReward(_proposalId);
+        address externalTokenAddress = _contributionRewardExt.getProposalExternalToken(_proposalId);
+        Iif ((ethReward == 0) || (address(_contributionRewardExt.avatar()).balance < ethReward)) {
+            whatToRedeem[2] = false;
+        } else {
+            whatToRedeem[2] = true;
+        }
+        Eif ((externalTokenReward == 0) ||
+            (IERC20(externalTokenAddress).balanceOf(address(_contributionRewardExt.avatar())) < externalTokenReward)) {
+            whatToRedeem[3] = false;
+        } else {
+            whatToRedeem[3] = true;
+        }
+        (reputation, nativeToken, eth, externalToken) = _contributionRewardExt.redeem(_proposalId, whatToRedeem);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/utils/RepAllocation.sol.html b/coverage/lcov-report/utils/RepAllocation.sol.html new file mode 100644 index 00000000..518b6159 --- /dev/null +++ b/coverage/lcov-report/utils/RepAllocation.sol.html @@ -0,0 +1,248 @@ + + + + Code coverage report for utils/RepAllocation.sol + + + + + + + +
+
+

+ all files / utils/ RepAllocation.sol +

+
+
+ 100% + Statements + 9/9 +
+
+ 83.33% + Branches + 5/6 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 9/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +33× +  +31× +30× +30× +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+ 
+ 
+/**
+ * @title reputation allocation contract
+ * This scheme can be used to allocate a pre define amount of reputation to whitelisted
+ * beneficiaries.
+ * this contract can be used as the rep mapping contract for  RepitationFromToken contract.
+ */
+contract RepAllocation is Ownable {
+ 
+ 
+       // beneficiary -> amount
+    mapping(address   =>   uint256) public reputationAllocations;
+    bool public isFreeze;
+ 
+    event BeneficiaryAddressAdded(address indexed _beneficiary, uint256 indexed _amount);
+ 
+    /**
+     * @dev addBeneficiary function
+     * @param _beneficiary to be whitelisted
+     */
+    function addBeneficiary(address _beneficiary, uint256 _amount) public onlyOwner {
+        require(!isFreeze, "can add beneficiary only if not disable");
+ 
+        if (reputationAllocations[_beneficiary] == 0) {
+            reputationAllocations[_beneficiary] = _amount;
+            emit BeneficiaryAddressAdded(_beneficiary, _amount);
+        }
+    }
+ 
+    /**
+     * @dev add addBeneficiaries function
+     * @param _beneficiaries addresses
+     */
+    function addBeneficiaries(address[] memory _beneficiaries, uint256[] memory _amounts) public onlyOwner {
+        Erequire(_beneficiaries.length == _amounts.length);
+        for (uint256 i = 0; i < _beneficiaries.length; i++) {
+            addBeneficiary(_beneficiaries[i], _amounts[i]);
+        }
+    }
+ 
+    /**
+     * @dev freeze function
+     * cannot defreeze
+     */
+    function freeze() public onlyOwner {
+        isFreeze = true;
+    }
+ 
+    /**
+     * @dev get balanceOf _beneficiary function
+     * @param _beneficiary addresses
+     */
+    function balanceOf(address _beneficiary) public view returns(uint256) {
+        return reputationAllocations[_beneficiary];
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/utils/index.html b/coverage/lcov-report/utils/index.html new file mode 100644 index 00000000..7ab2e965 --- /dev/null +++ b/coverage/lcov-report/utils/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for utils/ + + + + + + + +
+
+

+ all files utils/ +

+
+
+ 94.29% + Statements + 66/70 +
+
+ 72.5% + Branches + 29/40 +
+
+ 100% + Functions + 14/14 +
+
+ 94.44% + Lines + 68/72 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
DAOTracker.sol
100%11/1175%9/12100%5/5100%13/13
Redeemer.sol
92%46/5068.18%15/22100%5/592%46/50
RepAllocation.sol
100%9/983.33%5/6100%4/4100%9/9
+
+
+ + + + + + + diff --git a/coverage/lcov-report/votingMachines/VotingMachineCallbacks.sol.html b/coverage/lcov-report/votingMachines/VotingMachineCallbacks.sol.html new file mode 100644 index 00000000..a0d6e115 --- /dev/null +++ b/coverage/lcov-report/votingMachines/VotingMachineCallbacks.sol.html @@ -0,0 +1,320 @@ + + + + Code coverage report for votingMachines/VotingMachineCallbacks.sol + + + + + + + +
+
+

+ all files / votingMachines/ VotingMachineCallbacks.sol +

+
+
+ 76% + Statements + 19/25 +
+
+ 57.14% + Branches + 8/14 +
+
+ 100% + Functions + 7/7 +
+
+ 76.92% + Lines + 20/26 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86  +  +  +  +  +  +  +  +  +  +  +  +  +  +120× +110× +  +  +  +  +  +  +  +  +  +  +13× +13× +  +  +13× +  +  +  +  +  +  +  +18× +18× +  +  +18× +  +  +  +  +  +  +  +  +  +  +  + + +  +  + +  +  +  + + +  +  + +  +  +  +108× +108× +  +  +108× +  +  +  +81× +81× +  +  +81× +  +  + 
pragma solidity 0.5.17;
+ 
+import "../universalSchemes/UniversalScheme.sol";
+import "@daostack/infra/contracts/votingMachines/GenesisProtocol.sol";
+ 
+ 
+contract VotingMachineCallbacks is VotingMachineCallbacksInterface {
+ 
+    struct ProposalInfo {
+        uint256 blockNumber; // the proposal's block number
+        Avatar avatar; // the proposal's avatar
+    }
+ 
+    modifier onlyVotingMachine(bytes32 _proposalId) {
+        require(proposalsInfo[msg.sender][_proposalId].avatar != Avatar(address(0)), "only VotingMachine");
+        _;
+    }
+ 
+    // VotingMaching  ->  proposalId  ->  ProposalInfo
+    mapping(address => mapping(bytes32 => ProposalInfo)) public proposalsInfo;
+ 
+    function mintReputation(uint256 _amount, address _beneficiary, bytes32 _proposalId)
+    external
+    onlyVotingMachine(_proposalId)
+    returns(bool)
+    {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        Iif (avatar == Avatar(0)) {
+            return false;
+        }
+        return Controller(avatar.owner()).mintReputation(_amount, _beneficiary, address(avatar));
+    }
+ 
+    function burnReputation(uint256 _amount, address _beneficiary, bytes32 _proposalId)
+    external
+    onlyVotingMachine(_proposalId)
+    returns(bool)
+    {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        Iif (avatar == Avatar(0)) {
+            return false;
+        }
+        return Controller(avatar.owner()).burnReputation(_amount, _beneficiary, address(avatar));
+    }
+ 
+    function stakingTokenTransfer(
+        IERC20 _stakingToken,
+        address _beneficiary,
+        uint256 _amount,
+        bytes32 _proposalId)
+    external
+    onlyVotingMachine(_proposalId)
+    returns(bool)
+    {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        Iif (avatar == Avatar(0)) {
+            return false;
+        }
+        return Controller(avatar.owner()).externalTokenTransfer(_stakingToken, _beneficiary, _amount, avatar);
+    }
+ 
+    function balanceOfStakingToken(IERC20 _stakingToken, bytes32 _proposalId) external view returns(uint256) {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        Iif (proposalsInfo[msg.sender][_proposalId].avatar == Avatar(0)) {
+            return 0;
+        }
+        return _stakingToken.balanceOf(address(avatar));
+    }
+ 
+    function getTotalReputationSupply(bytes32 _proposalId) external view returns(uint256) {
+        ProposalInfo memory proposal = proposalsInfo[msg.sender][_proposalId];
+        Iif (proposal.avatar == Avatar(0)) {
+            return 0;
+        }
+        return proposal.avatar.nativeReputation().totalSupplyAt(proposal.blockNumber);
+    }
+ 
+    function reputationOf(address _owner, bytes32 _proposalId) external view returns(uint256) {
+        ProposalInfo memory proposal = proposalsInfo[msg.sender][_proposalId];
+        Iif (proposal.avatar == Avatar(0)) {
+            return 0;
+        }
+        return proposal.avatar.nativeReputation().balanceOfAt(_owner, proposal.blockNumber);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/votingMachines/index.html b/coverage/lcov-report/votingMachines/index.html new file mode 100644 index 00000000..7299c323 --- /dev/null +++ b/coverage/lcov-report/votingMachines/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for votingMachines/ + + + + + + + +
+
+

+ all files votingMachines/ +

+
+
+ 76% + Statements + 19/25 +
+
+ 57.14% + Branches + 8/14 +
+
+ 100% + Functions + 7/7 +
+
+ 76.92% + Lines + 20/26 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
VotingMachineCallbacks.sol
76%19/2557.14%8/14100%7/776.92%20/26
+
+
+ + + + + + + diff --git a/coverage/lcov.info b/coverage/lcov.info new file mode 100644 index 00000000..9feccb91 --- /dev/null +++ b/coverage/lcov.info @@ -0,0 +1,2752 @@ +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/controller/Avatar.sol +FN:32,constructor +FN:41, +FN:55,genericCall +FN:68,sendEther +FN:82,externalTokenTransfer +FN:103,externalTokenTransferFrom +FN:119,externalTokenApproval +FN:131,metaData +FNF:8 +FNH:8 +FNDA:383,constructor +FNDA:45, +FNDA:23,genericCall +FNDA:24,sendEther +FNDA:12,externalTokenTransfer +FNDA:2,externalTokenTransferFrom +FNDA:3,externalTokenApproval +FNDA:291,metaData +DA:33,383 +DA:34,383 +DA:35,383 +DA:42,45 +DA:58,23 +DA:59,23 +DA:69,24 +DA:70,22 +DA:71,22 +DA:84,12 +DA:85,12 +DA:86,12 +DA:105,2 +DA:106,2 +DA:107,2 +DA:121,3 +DA:122,3 +DA:123,3 +DA:132,291 +DA:133,291 +LF:20 +LH:20 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/controller/Controller.sol +FN:67,constructor +FN:77, +FN:82,onlyRegisteredScheme +FN:87,onlyRegisteringSchemes +FN:92,onlyGlobalConstraintsScheme +FN:97,onlyUpgradingScheme +FN:102,onlyGenericCallScheme +FN:107,onlyMetaDataScheme +FN:112,onlySubjectToConstraint +FN:127,isAvatarValid +FN:142,mintReputation +FN:159,burnReputation +FN:176,mintTokens +FN:194,registerScheme +FN:225,unregisterScheme +FN:245,unregisterSelf +FN:263,addGlobalConstraint +FN:300,removeGlobalConstraint +FN:355,upgradeController +FN:388,genericCall +FN:404,sendEther +FN:421,externalTokenTransfer +FN:446,externalTokenTransferFrom +FN:464,externalTokenApproval +FN:479,metaData +FN:490,getNativeReputation +FN:494,isSchemeRegistered +FN:500,getSchemeParameters +FN:509,getSchemePermissions +FN:516,getGlobalConstraintParameters +FN:538,globalConstraintsCount +FN:547,isGlobalConstraintRegistered +FN:555,_isSchemeRegistered +FNF:33 +FNH:32 +FNDA:354,constructor +FNDA:0, +FNDA:316,onlyRegisteredScheme +FNDA:1887,onlyRegisteringSchemes +FNDA:37,onlyGlobalConstraintsScheme +FNDA:4,onlyUpgradingScheme +FNDA:21,onlyGenericCallScheme +FNDA:290,onlyMetaDataScheme +FNDA:2222,onlySubjectToConstraint +FNDA:2778,isAvatarValid +FNDA:168,mintReputation +FNDA:22,burnReputation +FNDA:79,mintTokens +FNDA:923,registerScheme +FNDA:956,unregisterScheme +FNDA:33,unregisterSelf +FNDA:25,addGlobalConstraint +FNDA:12,removeGlobalConstraint +FNDA:2,upgradeController +FNDA:20,genericCall +FNDA:23,sendEther +FNDA:11,externalTokenTransfer +FNDA:1,externalTokenTransferFrom +FNDA:2,externalTokenApproval +FNDA:290,metaData +FNDA:1,getNativeReputation +FNDA:90,isSchemeRegistered +FNDA:57,getSchemeParameters +FNDA:9,getSchemePermissions +FNDA:2,getGlobalConstraintParameters +FNDA:38,globalConstraintsCount +FNDA:14,isGlobalConstraintRegistered +FNDA:1079,_isSchemeRegistered +DA:68,354 +DA:69,354 +DA:70,354 +DA:71,354 +DA:72,354 +DA:78,0 +DA:83,316 +DA:84,316 +DA:88,1887 +DA:89,1885 +DA:93,37 +DA:94,37 +DA:98,4 +DA:99,2 +DA:103,21 +DA:104,21 +DA:108,290 +DA:109,290 +DA:113,2222 +DA:114,2222 +DA:115,16 +DA:119,2207 +DA:120,1979 +DA:121,3 +DA:128,2778 +DA:129,2776 +DA:145,168 +DA:146,168 +DA:162,22 +DA:163,22 +DA:179,79 +DA:180,79 +DA:198,923 +DA:204,923 +DA:207,923 +DA:210,923 +DA:211,923 +DA:212,923 +DA:213,923 +DA:229,956 +DA:230,1 +DA:233,955 +DA:236,731 +DA:237,731 +DA:238,731 +DA:246,33 +DA:247,1 +DA:249,32 +DA:250,32 +DA:251,32 +DA:266,25 +DA:267,25 +DA:269,22 +DA:270,20 +DA:271,20 +DA:274,2 +DA:277,25 +DA:279,21 +DA:280,19 +DA:281,19 +DA:284,2 +DA:287,25 +DA:288,25 +DA:303,12 +DA:304,12 +DA:305,12 +DA:306,12 +DA:308,12 +DA:310,12 +DA:311,12 +DA:312,12 +DA:313,2 +DA:314,2 +DA:315,2 +DA:317,12 +DA:318,12 +DA:319,12 +DA:322,12 +DA:324,11 +DA:325,11 +DA:326,11 +DA:327,2 +DA:328,2 +DA:329,2 +DA:331,11 +DA:332,11 +DA:333,11 +DA:336,12 +DA:337,12 +DA:343,12 +DA:358,2 +DA:359,2 +DA:360,2 +DA:361,2 +DA:362,2 +DA:363,2 +DA:364,2 +DA:365,2 +DA:367,2 +DA:368,2 +DA:369,2 +DA:371,2 +DA:372,2 +DA:391,20 +DA:407,23 +DA:424,11 +DA:449,1 +DA:467,2 +DA:482,290 +DA:491,1 +DA:495,90 +DA:504,57 +DA:513,9 +DA:518,2 +DA:520,2 +DA:521,1 +DA:524,1 +DA:526,1 +DA:527,1 +DA:542,38 +DA:551,14 +DA:556,1079 +LF:122 +LH:121 +BRDA:83,1,0,316 +BRDA:83,1,1,0 +BRDA:88,2,0,1885 +BRDA:88,2,1,2 +BRDA:93,3,0,37 +BRDA:93,3,1,0 +BRDA:98,4,0,2 +BRDA:98,4,1,2 +BRDA:103,5,0,21 +BRDA:103,5,1,0 +BRDA:108,6,0,290 +BRDA:108,6,1,0 +BRDA:115,7,0,1 +BRDA:115,7,1,15 +BRDA:121,8,0,1 +BRDA:121,8,1,2 +BRDA:128,9,0,2776 +BRDA:128,9,1,2 +BRDA:204,10,0,923 +BRDA:204,10,1,0 +BRDA:207,11,0,923 +BRDA:207,11,1,0 +BRDA:229,12,0,1 +BRDA:229,12,1,955 +BRDA:233,13,0,731 +BRDA:233,13,1,224 +BRDA:246,14,0,1 +BRDA:246,14,1,32 +BRDA:267,15,0,22 +BRDA:267,15,1,3 +BRDA:269,16,0,20 +BRDA:269,16,1,2 +BRDA:277,17,0,21 +BRDA:277,17,1,4 +BRDA:279,18,0,19 +BRDA:279,18,1,2 +BRDA:308,19,0,12 +BRDA:308,19,1,0 +BRDA:311,20,0,12 +BRDA:311,20,1,0 +BRDA:312,21,0,2 +BRDA:312,21,1,10 +BRDA:322,22,0,11 +BRDA:322,22,1,1 +BRDA:325,23,0,11 +BRDA:325,23,1,0 +BRDA:326,24,0,2 +BRDA:326,24,1,9 +BRDA:336,25,0,12 +BRDA:336,25,1,0 +BRDA:358,26,0,2 +BRDA:358,26,1,0 +BRDA:359,27,0,2 +BRDA:359,27,1,0 +BRDA:362,28,0,2 +BRDA:362,28,1,0 +BRDA:363,29,0,2 +BRDA:363,29,1,0 +BRDA:365,30,0,2 +BRDA:365,30,1,0 +BRDA:367,31,0,2 +BRDA:367,31,1,0 +BRDA:369,32,0,2 +BRDA:369,32,1,0 +BRDA:520,33,0,1 +BRDA:520,33,1,1 +BRDA:526,34,0,1 +BRDA:526,34,1,0 +BRF:68 +BRH:50 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/controller/DAOToken.sol +FN:27,constructor +FN:39,mint +FNF:2 +FNH:2 +FNDA:371,constructor +FNDA:462,mint +DA:29,371 +DA:30,371 +DA:31,371 +DA:40,462 +DA:41,4 +DA:42,460 +DA:43,460 +LF:7 +LH:7 +BRDA:40,1,0,4 +BRDA:40,1,1,458 +BRDA:41,2,0,2 +BRDA:41,2,1,2 +BRF:4 +BRH:4 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/globalConstraints/GlobalConstraintInterface.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/globalConstraints/TokenCapGC.sol +FN:28,setParameters +FN:41,getParametersHash +FN:50,pre +FN:59,post +FN:71,when +FNF:5 +FNH:5 +FNDA:4,setParameters +FNDA:8,getParametersHash +FNDA:1,pre +FNDA:7,post +FNDA:1,when +DA:29,4 +DA:30,4 +DA:31,4 +DA:32,4 +DA:42,8 +DA:51,1 +DA:60,7 +DA:62,3 +DA:64,4 +DA:72,1 +LF:10 +LH:10 +BRDA:60,1,0,3 +BRDA:60,1,1,4 +BRF:2 +BRH:2 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/libs/SafeERC20.sol +FN:27,safeTransfer +FN:41,safeTransferFrom +FN:55,safeApprove +FNF:3 +FNH:3 +FNDA:45,safeTransfer +FNDA:70,safeTransferFrom +FNDA:7,safeApprove +DA:30,45 +DA:32,45 +DA:36,45 +DA:38,45 +DA:44,70 +DA:46,70 +DA:50,70 +DA:52,70 +DA:58,7 +DA:62,7 +DA:64,7 +DA:68,7 +DA:70,7 +LF:13 +LH:13 +BRDA:30,1,0,45 +BRDA:30,1,1,0 +BRDA:36,2,0,45 +BRDA:36,2,1,0 +BRDA:38,3,0,45 +BRDA:38,3,1,0 +BRDA:44,4,0,70 +BRDA:44,4,1,0 +BRDA:50,5,0,70 +BRDA:50,5,1,0 +BRDA:52,6,0,70 +BRDA:52,6,1,0 +BRDA:58,7,0,7 +BRDA:58,7,1,0 +BRDA:62,8,0,7 +BRDA:62,8,1,0 +BRDA:68,9,0,7 +BRDA:68,9,1,0 +BRDA:70,10,0,7 +BRDA:70,10,1,0 +BRF:20 +BRH:10 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/Agreement.sol +FN:12,onlyAgree +FN:21,getAgreementHash +FN:30,setAgreementHash +FNF:3 +FNH:3 +FNDA:151,onlyAgree +FNDA:6,getAgreementHash +FNDA:117,setAgreementHash +DA:13,151 +DA:14,130 +DA:23,6 +DA:32,117 +DA:33,115 +LF:5 +LH:5 +BRDA:13,1,0,130 +BRDA:13,1,1,21 +BRDA:32,2,0,115 +BRDA:32,2,1,2 +BRF:4 +BRH:4 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/Auction4Reputation.sol +FN:58,initialize +FN:95,redeem +FN:120,bid +FN:142,transferToWallet +FN:155,getBid +FNF:5 +FNH:5 +FNDA:28,initialize +FNDA:16,redeem +FNDA:20,bid +FNDA:3,transferToWallet +FNDA:2,getBid +DA:70,28 +DA:71,26 +DA:72,26 +DA:74,24 +DA:75,22 +DA:76,22 +DA:77,22 +DA:78,16 +DA:79,16 +DA:80,16 +DA:81,16 +DA:82,16 +DA:83,16 +DA:84,16 +DA:85,16 +DA:86,16 +DA:97,16 +DA:98,12 +DA:99,12 +DA:100,12 +DA:101,10 +DA:102,10 +DA:103,10 +DA:105,10 +DA:106,10 +DA:109,10 +DA:123,20 +DA:125,18 +DA:127,16 +DA:128,16 +DA:130,16 +DA:131,16 +DA:132,14 +DA:133,14 +DA:134,14 +DA:135,14 +DA:144,3 +DA:145,1 +DA:146,1 +DA:156,2 +LF:40 +LH:40 +BRDA:70,1,0,26 +BRDA:70,1,1,2 +BRDA:71,2,0,26 +BRDA:71,2,1,0 +BRDA:72,3,0,24 +BRDA:72,3,1,2 +BRDA:74,4,0,22 +BRDA:74,4,1,2 +BRDA:77,5,0,16 +BRDA:77,5,1,6 +BRDA:97,6,0,12 +BRDA:97,6,1,4 +BRDA:100,7,0,10 +BRDA:100,7,1,2 +BRDA:106,8,0,10 +BRDA:106,8,1,0 +BRDA:123,9,0,18 +BRDA:123,9,1,2 +BRDA:125,10,0,16 +BRDA:125,10,1,2 +BRDA:127,11,0,16 +BRDA:127,11,1,0 +BRDA:131,12,0,14 +BRDA:131,12,1,2 +BRDA:144,13,0,1 +BRDA:144,13,1,2 +BRF:26 +BRH:23 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/Competition.sol +FN:90,initialize +FN:119,proposeCompetition +FN:193,suggest +FN:226,vote +FN:261,setSnapshotBlock +FN:275,sendLeftOverFunds +FN:307,redeem +FN:364,getOrderedIndexOfSuggestion +FN:387,refreshTopSuggestions +FNF:9 +FNH:9 +FNDA:15,initialize +FNDA:27,proposeCompetition +FNDA:73,suggest +FNDA:33,vote +FNDA:31,setSnapshotBlock +FNDA:3,sendLeftOverFunds +FNDA:12,redeem +FNDA:17,getOrderedIndexOfSuggestion +FNDA:25,refreshTopSuggestions +DA:91,15 +DA:92,15 +DA:93,15 +DA:131,27 +DA:132,27 +DA:133,27 +DA:135,0 +DA:138,27 +DA:139,25 +DA:140,23 +DA:141,23 +DA:142,21 +DA:143,19 +DA:145,19 +DA:146,19 +DA:147,19 +DA:149,19 +DA:150,17 +DA:151,17 +DA:152,65 +DA:154,17 +DA:155,15 +DA:157,15 +DA:158,15 +DA:159,15 +DA:160,15 +DA:161,15 +DA:162,15 +DA:163,15 +DA:164,15 +DA:165,15 +DA:166,15 +DA:167,15 +DA:168,15 +DA:169,15 +DA:170,1 +DA:172,15 +DA:201,73 +DA:202,3 +DA:205,71 +DA:207,69 +DA:208,65 +DA:209,65 +DA:210,65 +DA:211,65 +DA:212,64 +DA:214,1 +DA:216,65 +DA:217,65 +DA:218,65 +DA:230,33 +DA:231,33 +DA:232,31 +DA:233,29 +DA:234,29 +DA:235,29 +DA:236,29 +DA:238,29 +DA:239,29 +DA:240,29 +DA:241,27 +DA:243,25 +DA:244,25 +DA:245,3 +DA:248,25 +DA:249,25 +DA:250,25 +DA:251,25 +DA:252,25 +DA:253,25 +DA:263,31 +DA:264,29 +DA:265,29 +DA:266,8 +DA:267,8 +DA:277,3 +DA:278,3 +DA:279,3 +DA:280,3 +DA:281,3 +DA:282,9 +DA:285,1 +DA:291,1 +DA:293,1 +DA:296,1 +DA:299,1 +DA:308,12 +DA:309,12 +DA:310,12 +DA:311,12 +DA:313,12 +DA:314,8 +DA:315,8 +DA:317,8 +DA:318,8 +DA:319,8 +DA:320,8 +DA:321,8 +DA:322,8 +DA:323,8 +DA:325,8 +DA:326,8 +DA:328,8 +DA:329,8 +DA:330,8 +DA:333,5 +DA:334,8 +DA:336,5 +DA:339,8 +DA:340,8 +DA:341,8 +DA:344,8 +DA:345,8 +DA:348,8 +DA:349,8 +DA:352,8 +DA:353,8 +DA:355,8 +DA:368,17 +DA:369,17 +DA:370,15 +DA:372,15 +DA:373,45 +DA:374,20 +DA:388,25 +DA:389,25 +DA:390,25 +DA:391,25 +DA:392,23 +DA:393,23 +DA:394,3 +DA:397,20 +DA:400,2 +DA:401,2 +DA:402,8 +DA:404,4 +DA:407,0 +DA:411,2 +DA:412,0 +LF:139 +LH:136 +BRDA:91,1,0,15 +BRDA:91,1,1,0 +BRDA:92,2,0,15 +BRDA:92,2,1,0 +BRDA:133,3,0,0 +BRDA:133,3,1,27 +BRDA:138,4,0,25 +BRDA:138,4,1,2 +BRDA:139,5,0,23 +BRDA:139,5,1,2 +BRDA:140,6,0,23 +BRDA:140,6,1,0 +BRDA:141,7,0,21 +BRDA:141,7,1,2 +BRDA:142,8,0,19 +BRDA:142,8,1,2 +BRDA:143,9,0,19 +BRDA:143,9,1,0 +BRDA:145,10,0,19 +BRDA:145,10,1,0 +BRDA:146,11,0,19 +BRDA:146,11,1,0 +BRDA:147,12,0,19 +BRDA:147,12,1,0 +BRDA:149,13,0,17 +BRDA:149,13,1,2 +BRDA:154,14,0,15 +BRDA:154,14,1,2 +BRDA:169,15,0,1 +BRDA:169,15,1,14 +BRDA:201,16,0,3 +BRDA:201,16,1,70 +BRDA:202,17,0,1 +BRDA:202,17,1,2 +BRDA:205,18,0,69 +BRDA:205,18,1,2 +BRDA:207,19,0,65 +BRDA:207,19,1,4 +BRDA:211,20,0,64 +BRDA:211,20,1,1 +BRDA:231,21,0,31 +BRDA:231,21,1,2 +BRDA:235,22,0,29 +BRDA:235,22,1,0 +BRDA:238,23,0,29 +BRDA:238,23,1,0 +BRDA:240,24,0,27 +BRDA:240,24,1,2 +BRDA:241,25,0,25 +BRDA:241,25,1,2 +BRDA:244,26,0,3 +BRDA:244,26,1,22 +BRDA:263,27,0,29 +BRDA:263,27,1,2 +BRDA:264,28,0,29 +BRDA:264,28,1,0 +BRDA:265,29,0,8 +BRDA:265,29,1,21 +BRDA:277,30,0,3 +BRDA:277,30,1,0 +BRDA:278,31,0,3 +BRDA:278,31,1,0 +BRDA:279,32,0,3 +BRDA:279,32,1,0 +BRDA:282,33,0,7 +BRDA:282,33,1,2 +BRDA:309,34,0,12 +BRDA:309,34,1,0 +BRDA:311,35,0,12 +BRDA:311,35,1,0 +BRDA:313,36,0,8 +BRDA:313,36,1,4 +BRDA:314,37,0,8 +BRDA:314,37,1,0 +BRDA:315,38,0,8 +BRDA:315,38,1,0 +BRDA:319,39,0,8 +BRDA:319,39,1,0 +BRDA:330,40,0,5 +BRDA:330,40,1,3 +BRDA:369,41,0,15 +BRDA:369,41,1,2 +BRDA:373,42,0,20 +BRDA:373,42,1,25 +BRDA:391,43,0,23 +BRDA:391,43,1,2 +BRDA:393,44,0,3 +BRDA:393,44,1,20 +BRDA:402,45,0,4 +BRDA:402,45,1,4 +BRDA:405,46,0,0 +BRDA:405,46,1,4 +BRDA:411,47,0,0 +BRDA:411,47,1,2 +BRF:94 +BRH:73 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/ContinuousLocking4Reputation.sol +FN:84,initialize +FN:128,redeem +FN:168,lock +FN:216,extendLocking +FN:248,release +FN:268,getRepRewardPerBatch +FN:281,getLockingIdScore +FN:288,mul +FN:299,toReal +FN:306,fromReal +FN:313,div +FNF:11 +FNH:11 +FNDA:33,initialize +FNDA:16,redeem +FNDA:27,lock +FNDA:13,extendLocking +FNDA:12,release +FNDA:146,getRepRewardPerBatch +FNDA:2,getLockingIdScore +FNDA:289,mul +FNDA:311,toReal +FNDA:158,fromReal +FNDA:144,div +DA:98,33 +DA:99,31 +DA:101,31 +DA:102,29 +DA:104,29 +DA:106,27 +DA:107,25 +DA:108,25 +DA:109,25 +DA:110,25 +DA:111,25 +DA:112,25 +DA:113,25 +DA:114,25 +DA:115,25 +DA:116,23 +DA:117,23 +DA:118,23 +DA:119,23 +DA:130,16 +DA:131,14 +DA:132,14 +DA:133,14 +DA:135,14 +DA:136,14 +DA:137,14 +DA:138,149 +DA:139,149 +DA:140,149 +DA:141,144 +DA:142,144 +DA:143,144 +DA:144,144 +DA:145,144 +DA:146,144 +DA:149,14 +DA:150,14 +DA:152,12 +DA:153,12 +DA:171,27 +DA:173,23 +DA:174,23 +DA:175,23 +DA:176,23 +DA:178,21 +DA:179,21 +DA:181,21 +DA:182,21 +DA:183,21 +DA:185,21 +DA:187,21 +DA:189,21 +DA:190,21 +DA:193,19 +DA:194,107 +DA:195,107 +DA:196,107 +DA:197,107 +DA:200,19 +DA:201,19 +DA:218,13 +DA:219,13 +DA:221,11 +DA:223,11 +DA:224,11 +DA:225,9 +DA:226,9 +DA:229,9 +DA:230,9 +DA:232,9 +DA:233,100 +DA:234,100 +DA:235,100 +DA:236,100 +DA:238,9 +DA:239,9 +DA:249,12 +DA:250,12 +DA:251,10 +DA:252,10 +DA:254,10 +DA:256,4 +DA:257,4 +DA:258,4 +DA:269,146 +DA:270,145 +DA:282,2 +DA:291,289 +DA:292,289 +DA:293,289 +DA:300,311 +DA:307,158 +DA:316,144 +LF:93 +LH:93 +BRDA:98,1,0,31 +BRDA:98,1,1,2 +BRDA:99,2,0,31 +BRDA:99,2,1,0 +BRDA:101,3,0,29 +BRDA:101,3,1,2 +BRDA:102,4,0,29 +BRDA:102,4,1,0 +BRDA:104,5,0,27 +BRDA:104,5,1,2 +BRDA:106,6,0,25 +BRDA:106,6,1,2 +BRDA:114,7,0,25 +BRDA:114,7,1,0 +BRDA:115,8,0,23 +BRDA:115,8,1,2 +BRDA:130,9,0,14 +BRDA:130,9,1,2 +BRDA:132,10,0,14 +BRDA:132,10,1,0 +BRDA:140,11,0,144 +BRDA:140,11,1,5 +BRDA:150,12,0,12 +BRDA:150,12,1,2 +BRDA:153,13,0,12 +BRDA:153,13,1,0 +BRDA:171,14,0,23 +BRDA:171,14,1,4 +BRDA:173,15,0,23 +BRDA:173,15,1,0 +BRDA:174,16,0,23 +BRDA:174,16,1,0 +BRDA:175,17,0,23 +BRDA:175,17,1,0 +BRDA:176,18,0,21 +BRDA:176,18,1,2 +BRDA:190,19,0,19 +BRDA:190,19,1,2 +BRDA:219,20,0,11 +BRDA:219,20,1,2 +BRDA:224,21,0,9 +BRDA:224,21,1,2 +BRDA:225,22,0,9 +BRDA:225,22,1,0 +BRDA:226,23,0,9 +BRDA:226,23,1,0 +BRDA:230,24,0,9 +BRDA:230,24,1,0 +BRDA:250,25,0,10 +BRDA:250,25,1,2 +BRDA:254,26,0,4 +BRDA:254,26,1,6 +BRDA:269,27,0,145 +BRDA:269,27,1,1 +BRDA:292,28,0,289 +BRDA:292,28,1,0 +BRF:56 +BRH:44 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/ContributionRewardExt.sol +FN:71,onlyRewarder +FN:86, +FN:97,initialize +FN:121,executeProposal +FN:144,proposeContributionReward +FN:206,redeemReputation +FN:243,redeemNativeToken +FN:268,redeemEther +FN:291,redeemExternalToken +FN:323,redeemReputationByRewarder +FN:348,redeemNativeTokenByRewarder +FN:372,redeemEtherByRewarder +FN:395,redeemExternalTokenByRewarder +FN:422,redeem +FN:444,getProposalEthReward +FN:448,getProposalExternalTokenReward +FN:452,getProposalExternalToken +FN:456,getProposalReputationReward +FN:460,getProposalNativeTokenReward +FN:464,getProposalAcceptedByVotingMachine +FNF:20 +FNH:18 +FNDA:59,onlyRewarder +FNDA:5, +FNDA:36,initialize +FNDA:18,executeProposal +FNDA:34,proposeContributionReward +FNDA:15,redeemReputation +FNDA:10,redeemNativeToken +FNDA:10,redeemEther +FNDA:6,redeemExternalToken +FNDA:12,redeemReputationByRewarder +FNDA:13,redeemNativeTokenByRewarder +FNDA:13,redeemEtherByRewarder +FNDA:13,redeemExternalTokenByRewarder +FNDA:18,redeem +FNDA:4,getProposalEthReward +FNDA:4,getProposalExternalTokenReward +FNDA:4,getProposalExternalToken +FNDA:0,getProposalReputationReward +FNDA:0,getProposalNativeTokenReward +FNDA:6,getProposalAcceptedByVotingMachine +DA:72,59 +DA:73,51 +DA:105,36 +DA:106,34 +DA:107,34 +DA:108,34 +DA:109,34 +DA:110,34 +DA:111,34 +DA:123,18 +DA:124,18 +DA:125,18 +DA:126,15 +DA:128,18 +DA:129,18 +DA:155,34 +DA:156,34 +DA:157,19 +DA:159,34 +DA:160,34 +DA:161,34 +DA:162,1 +DA:164,34 +DA:165,19 +DA:168,32 +DA:181,32 +DA:183,32 +DA:195,32 +DA:207,15 +DA:208,15 +DA:213,13 +DA:214,5 +DA:215,5 +DA:216,5 +DA:219,8 +DA:221,8 +DA:223,8 +DA:224,6 +DA:228,1 +DA:232,8 +DA:233,7 +DA:245,10 +DA:246,10 +DA:248,10 +DA:250,5 +DA:251,5 +DA:254,10 +DA:256,10 +DA:257,10 +DA:258,10 +DA:259,10 +DA:269,10 +DA:270,10 +DA:272,10 +DA:273,5 +DA:274,5 +DA:277,10 +DA:279,10 +DA:280,10 +DA:281,10 +DA:282,10 +DA:292,6 +DA:293,6 +DA:296,6 +DA:297,5 +DA:298,5 +DA:302,6 +DA:303,6 +DA:305,6 +DA:306,6 +DA:310,6 +DA:325,12 +DA:326,12 +DA:329,12 +DA:332,10 +DA:335,10 +DA:336,10 +DA:350,13 +DA:351,13 +DA:354,13 +DA:358,11 +DA:359,11 +DA:360,11 +DA:374,13 +DA:375,13 +DA:378,13 +DA:381,11 +DA:382,11 +DA:383,11 +DA:396,13 +DA:397,13 +DA:400,13 +DA:404,11 +DA:405,11 +DA:406,11 +DA:407,11 +DA:427,18 +DA:428,15 +DA:431,16 +DA:432,10 +DA:435,16 +DA:436,10 +DA:439,16 +DA:440,6 +DA:445,4 +DA:449,4 +DA:453,4 +DA:457,0 +DA:461,0 +DA:465,6 +LF:110 +LH:108 +BRDA:72,1,0,51 +BRDA:72,1,1,8 +BRDA:105,2,0,34 +BRDA:105,2,1,2 +BRDA:106,3,0,34 +BRDA:106,3,1,0 +BRDA:107,4,0,34 +BRDA:107,4,1,0 +BRDA:123,5,0,18 +BRDA:123,5,1,0 +BRDA:124,6,0,18 +BRDA:124,6,1,0 +BRDA:125,7,0,15 +BRDA:125,7,1,3 +BRDA:156,8,0,19 +BRDA:156,8,1,15 +BRDA:161,9,0,1 +BRDA:161,9,1,33 +BRDA:164,10,0,19 +BRDA:164,10,1,15 +BRDA:165,11,0,17 +BRDA:165,11,1,2 +BRDA:208,12,0,13 +BRDA:208,12,1,2 +BRDA:213,13,0,5 +BRDA:213,13,1,8 +BRDA:214,14,0,5 +BRDA:214,14,1,0 +BRDA:223,15,0,6 +BRDA:223,15,1,2 +BRDA:224,16,0,6 +BRDA:224,16,1,0 +BRDA:227,17,0,1 +BRDA:227,17,1,1 +BRDA:228,18,0,1 +BRDA:228,18,1,0 +BRDA:232,19,0,7 +BRDA:232,19,1,1 +BRDA:246,20,0,10 +BRDA:246,20,1,0 +BRDA:248,21,0,5 +BRDA:248,21,1,5 +BRDA:250,22,0,5 +BRDA:250,22,1,0 +BRDA:257,23,0,10 +BRDA:257,23,1,0 +BRDA:258,24,0,10 +BRDA:258,24,1,0 +BRDA:270,25,0,10 +BRDA:270,25,1,0 +BRDA:272,26,0,5 +BRDA:272,26,1,5 +BRDA:273,27,0,5 +BRDA:273,27,1,0 +BRDA:280,28,0,10 +BRDA:280,28,1,0 +BRDA:281,29,0,10 +BRDA:281,29,1,0 +BRDA:293,30,0,6 +BRDA:293,30,1,0 +BRDA:296,31,0,5 +BRDA:296,31,1,1 +BRDA:297,32,0,5 +BRDA:297,32,1,0 +BRDA:302,33,0,6 +BRDA:302,33,1,0 +BRDA:306,34,0,6 +BRDA:306,34,1,0 +BRDA:326,35,0,12 +BRDA:326,35,1,0 +BRDA:332,36,0,10 +BRDA:332,36,1,0 +BRDA:335,37,0,10 +BRDA:335,37,1,0 +BRDA:351,38,0,13 +BRDA:351,38,1,0 +BRDA:358,39,0,11 +BRDA:358,39,1,0 +BRDA:375,40,0,13 +BRDA:375,40,1,0 +BRDA:381,41,0,11 +BRDA:381,41,1,0 +BRDA:397,42,0,13 +BRDA:397,42,1,0 +BRDA:404,43,0,11 +BRDA:404,43,1,0 +BRDA:405,44,0,11 +BRDA:405,44,1,0 +BRDA:427,45,0,15 +BRDA:427,45,1,3 +BRDA:431,46,0,10 +BRDA:431,46,1,6 +BRDA:435,47,0,10 +BRDA:435,47,1,6 +BRDA:439,48,0,6 +BRDA:439,48,1,10 +BRF:96 +BRH:67 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/CurveInterface.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/ExternalLocking4Reputation.sol +FN:35,initialize +FN:65,claim +FN:92,register +FNF:3 +FNH:3 +FNDA:23,initialize +FNDA:24,claim +FNDA:1,register +DA:46,23 +DA:47,23 +DA:48,23 +DA:49,23 +DA:66,24 +DA:67,22 +DA:68,22 +DA:69,19 +DA:71,3 +DA:72,1 +DA:74,20 +DA:75,18 +DA:76,18 +DA:79,18 +DA:80,18 +DA:82,18 +DA:85,18 +DA:93,1 +DA:94,1 +LF:19 +LH:19 +BRDA:46,1,0,23 +BRDA:46,1,1,0 +BRDA:66,2,0,22 +BRDA:66,2,1,2 +BRDA:68,3,0,19 +BRDA:68,3,1,3 +BRDA:71,4,0,1 +BRDA:71,4,1,2 +BRDA:74,5,0,18 +BRDA:74,5,1,2 +BRDA:79,6,0,18 +BRDA:79,6,1,0 +BRF:12 +BRH:10 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/FixedReputationAllocation.sol +FN:34,initialize +FN:47,redeem +FN:67,addBeneficiary +FN:82,addBeneficiaries +FN:91,enable +FNF:5 +FNH:5 +FNDA:14,initialize +FNDA:31,redeem +FNDA:63,addBeneficiary +FNDA:6,addBeneficiaries +FNDA:5,enable +DA:35,14 +DA:36,12 +DA:37,12 +DA:38,12 +DA:39,12 +DA:48,31 +DA:49,29 +DA:50,25 +DA:52,25 +DA:53,23 +DA:58,21 +DA:60,21 +DA:68,63 +DA:70,63 +DA:71,63 +DA:72,63 +DA:74,63 +DA:83,6 +DA:84,60 +DA:92,5 +DA:94,5 +LF:21 +LH:21 +BRDA:35,1,0,12 +BRDA:35,1,1,2 +BRDA:36,2,0,12 +BRDA:36,2,1,0 +BRDA:48,3,0,29 +BRDA:48,3,1,2 +BRDA:49,4,0,25 +BRDA:49,4,1,4 +BRDA:52,5,0,23 +BRDA:52,5,1,2 +BRDA:53,6,0,21 +BRDA:53,6,1,2 +BRDA:68,7,0,63 +BRDA:68,7,1,0 +BRDA:70,8,0,63 +BRDA:70,8,1,0 +BRF:16 +BRH:13 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/Forwarder.sol +FN:21, +FN:34,initialize +FN:45,unregisterSelf +FNF:3 +FNH:3 +FNDA:2, +FNDA:12,initialize +FNDA:3,unregisterSelf +DA:23,2 +DA:25,1 +DA:26,1 +DA:35,12 +DA:36,10 +DA:37,10 +DA:38,10 +DA:47,3 +DA:48,1 +LF:9 +LH:9 +BRDA:23,1,0,1 +BRDA:23,1,1,1 +BRDA:26,2,0,1 +BRDA:26,2,1,0 +BRDA:35,3,0,10 +BRDA:35,3,1,2 +BRDA:36,4,0,10 +BRDA:36,4,1,0 +BRDA:47,5,0,1 +BRDA:47,5,1,2 +BRF:10 +BRH:8 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/GenericScheme.sol +FN:58,initialize +FN:82,executeProposal +FN:104,execute +FN:131,proposeCall +FNF:4 +FNH:4 +FNDA:13,initialize +FNDA:8,executeProposal +FNDA:14,execute +FNDA:10,proposeCall +DA:66,13 +DA:67,11 +DA:68,11 +DA:69,11 +DA:70,11 +DA:71,11 +DA:84,8 +DA:85,8 +DA:86,8 +DA:88,8 +DA:89,6 +DA:90,6 +DA:92,2 +DA:93,2 +DA:96,8 +DA:97,8 +DA:105,14 +DA:106,14 +DA:107,12 +DA:108,10 +DA:109,10 +DA:110,10 +DA:111,10 +DA:112,10 +DA:114,10 +DA:115,4 +DA:116,4 +DA:117,4 +DA:119,6 +DA:135,10 +DA:137,10 +DA:143,10 +DA:147,10 +DA:148,10 +LF:34 +LH:34 +BRDA:66,1,0,11 +BRDA:66,1,1,2 +BRDA:67,2,0,11 +BRDA:67,2,1,0 +BRDA:85,3,0,8 +BRDA:85,3,1,0 +BRDA:86,4,0,8 +BRDA:86,4,1,0 +BRDA:88,5,0,6 +BRDA:88,5,1,2 +BRDA:106,6,0,12 +BRDA:106,6,1,2 +BRDA:107,7,0,10 +BRDA:107,7,1,2 +BRDA:114,8,0,4 +BRDA:114,8,1,6 +BRF:16 +BRH:13 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/Locking4Reputation.sol +FN:45,redeem +FN:70,_release +FN:99,_lock +FN:142,_initialize +FNF:4 +FNH:4 +FNDA:37,redeem +FNDA:13,_release +FNDA:64,_lock +FNDA:75,_initialize +DA:47,37 +DA:48,25 +DA:49,19 +DA:50,19 +DA:51,19 +DA:52,19 +DA:55,19 +DA:56,19 +DA:61,19 +DA:71,13 +DA:72,13 +DA:73,9 +DA:74,9 +DA:76,9 +DA:77,5 +DA:79,5 +DA:102,64 +DA:103,58 +DA:104,54 +DA:106,48 +DA:108,42 +DA:110,38 +DA:111,38 +DA:113,38 +DA:114,38 +DA:116,38 +DA:117,38 +DA:118,38 +DA:119,38 +DA:120,38 +DA:121,38 +DA:123,38 +DA:125,37 +DA:127,37 +DA:152,75 +DA:153,69 +DA:154,69 +DA:155,69 +DA:157,63 +DA:158,63 +DA:159,63 +DA:160,63 +DA:161,63 +DA:162,63 +DA:163,63 +DA:164,63 +LF:46 +LH:46 +BRDA:47,1,0,25 +BRDA:47,1,1,12 +BRDA:48,2,0,19 +BRDA:48,2,1,6 +BRDA:56,3,0,19 +BRDA:56,3,1,0 +BRDA:72,4,0,9 +BRDA:72,4,1,4 +BRDA:76,5,0,5 +BRDA:76,5,1,4 +BRDA:102,6,0,58 +BRDA:102,6,1,6 +BRDA:103,7,0,54 +BRDA:103,7,1,4 +BRDA:104,8,0,48 +BRDA:104,8,1,6 +BRDA:106,9,0,42 +BRDA:106,9,1,6 +BRDA:108,10,0,38 +BRDA:108,10,1,4 +BRDA:120,11,0,38 +BRDA:120,11,1,0 +BRDA:123,12,0,37 +BRDA:123,12,1,1 +BRDA:152,13,0,69 +BRDA:152,13,1,6 +BRDA:153,14,0,69 +BRDA:153,14,1,0 +BRDA:154,15,0,69 +BRDA:154,15,1,0 +BRDA:155,16,0,63 +BRDA:155,16,1,6 +BRF:32 +BRH:28 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/LockingEth4Reputation.sol +FN:23,initialize +FN:49,release +FN:61,lock +FNF:3 +FNH:3 +FNDA:25,initialize +FNDA:7,release +FNDA:29,lock +DA:33,25 +DA:50,7 +DA:51,3 +DA:53,3 +DA:62,29 +LF:5 +LH:5 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/LockingToken4Reputation.sol +FN:35,initialize +FN:63,release +FN:77,lock +FNF:3 +FNH:3 +FNDA:27,initialize +FNDA:6,release +FNDA:31,lock +DA:46,27 +DA:47,27 +DA:64,6 +DA:65,2 +DA:67,2 +DA:83,31 +DA:84,31 +DA:86,31 +DA:88,29 +DA:89,27 +DA:91,25 +DA:93,25 +DA:95,13 +DA:97,13 +LF:14 +LH:14 +BRDA:88,1,0,27 +BRDA:88,1,1,2 +BRDA:89,2,0,25 +BRDA:89,2,1,2 +BRF:4 +BRH:4 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/PriceOracleInterface.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/RageQuitWithToken.sol +FN:29,initialize +FN:46,rageQuit +FNF:2 +FNH:2 +FNDA:2,initialize +FNDA:3,rageQuit +DA:35,2 +DA:36,2 +DA:37,2 +DA:38,2 +DA:47,3 +DA:48,3 +DA:49,3 +DA:51,3 +DA:52,1 +DA:55,1 +LF:10 +LH:10 +BRDA:35,1,0,2 +BRDA:35,1,1,0 +BRDA:36,2,0,2 +BRDA:36,2,1,0 +BRDA:52,3,0,1 +BRDA:52,3,1,0 +BRF:6 +BRH:3 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/ReputationAdmin.sol +FN:32,initialize +FN:48,reputationMint +FN:60,reputationBurn +FN:72,_reputationMint +FN:93,_reputationBurn +FNF:5 +FNH:5 +FNDA:15,initialize +FNDA:11,reputationMint +FNDA:3,reputationBurn +FNDA:11,_reputationMint +FNDA:3,_reputationBurn +DA:33,15 +DA:34,13 +DA:35,13 +DA:36,11 +DA:37,11 +DA:38,11 +DA:39,11 +DA:40,11 +DA:49,11 +DA:50,11 +DA:51,11 +DA:61,3 +DA:62,3 +DA:63,3 +DA:74,11 +DA:76,9 +DA:78,5 +DA:79,4 +DA:82,3 +DA:95,3 +DA:97,3 +DA:99,3 +DA:100,3 +DA:101,1 +DA:104,1 +LF:25 +LH:25 +BRDA:33,1,0,13 +BRDA:33,1,1,2 +BRDA:34,2,0,13 +BRDA:34,2,1,0 +BRDA:35,3,0,11 +BRDA:35,3,1,2 +BRDA:49,4,0,11 +BRDA:49,4,1,0 +BRDA:61,5,0,3 +BRDA:61,5,1,0 +BRDA:74,6,0,9 +BRDA:74,6,1,2 +BRDA:76,7,0,5 +BRDA:76,7,1,4 +BRDA:78,8,0,4 +BRDA:78,8,1,1 +BRDA:82,9,0,3 +BRDA:82,9,1,0 +BRDA:95,10,0,3 +BRDA:95,10,1,0 +BRDA:97,11,0,3 +BRDA:97,11,1,0 +BRDA:99,12,0,3 +BRDA:99,12,1,0 +BRDA:100,13,0,1 +BRDA:100,13,1,2 +BRDA:104,14,0,1 +BRDA:104,14,1,0 +BRF:28 +BRH:20 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/ReputationFromToken.sol +FN:42,initialize +FN:58,redeem +FN:71,redeemWithSignature +FN:114,_redeem +FNF:4 +FNH:4 +FNDA:12,initialize +FNDA:5,redeem +FNDA:1,redeemWithSignature +FNDA:4,_redeem +DA:44,12 +DA:45,10 +DA:46,10 +DA:47,10 +DA:48,10 +DA:49,10 +DA:59,5 +DA:81,1 +DA:82,1 +DA:83,0 +DA:94,1 +DA:101,1 +DA:102,1 +DA:103,1 +DA:116,4 +DA:117,4 +DA:118,4 +DA:119,4 +DA:120,4 +DA:121,3 +DA:123,4 +DA:124,1 +DA:126,4 +DA:130,4 +DA:131,4 +LF:25 +LH:24 +BRDA:44,1,0,10 +BRDA:44,1,1,2 +BRDA:45,2,0,10 +BRDA:45,2,1,0 +BRDA:82,3,0,0 +BRDA:82,3,1,1 +BRDA:102,4,0,1 +BRDA:102,4,1,0 +BRDA:116,5,0,4 +BRDA:116,5,1,0 +BRDA:117,6,0,4 +BRDA:117,6,1,0 +BRDA:120,7,0,3 +BRDA:120,7,1,1 +BRDA:123,8,0,1 +BRDA:123,8,1,3 +BRDA:126,9,0,4 +BRDA:126,9,1,0 +BRF:18 +BRH:12 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/SignalScheme.sol +FN:52,initialize +FN:71,proposeSignal +FN:108,executeProposal +FNF:3 +FNH:3 +FNDA:6,initialize +FNDA:3,proposeSignal +FNDA:2,executeProposal +DA:57,6 +DA:58,4 +DA:59,4 +DA:77,3 +DA:80,3 +DA:87,3 +DA:89,3 +DA:96,3 +DA:100,3 +DA:109,2 +DA:110,2 +DA:112,2 +DA:113,1 +DA:118,2 +LF:14 +LH:14 +BRDA:57,1,0,4 +BRDA:57,1,1,2 +BRDA:58,2,0,4 +BRDA:58,2,1,0 +BRDA:77,3,0,3 +BRDA:77,3,1,0 +BRDA:109,4,0,2 +BRDA:109,4,1,0 +BRDA:112,5,0,1 +BRDA:112,5,1,1 +BRF:10 +BRH:7 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/schemes/WalletScheme.sol +FN:57,initialize +FN:77, +FN:87,executeProposal +FN:109,execute +FN:140,proposeCalls +FN:167,getOrganizationProposal +FNF:6 +FNH:6 +FNDA:13,initialize +FNDA:1, +FNDA:8,executeProposal +FNDA:14,execute +FNDA:10,proposeCalls +FNDA:6,getOrganizationProposal +DA:65,13 +DA:66,11 +DA:67,11 +DA:68,11 +DA:69,11 +DA:70,11 +DA:71,11 +DA:89,8 +DA:90,8 +DA:91,8 +DA:93,8 +DA:94,6 +DA:95,6 +DA:97,2 +DA:98,2 +DA:101,8 +DA:102,8 +DA:110,14 +DA:111,14 +DA:112,12 +DA:113,10 +DA:114,10 +DA:115,10 +DA:116,10 +DA:117,10 +DA:118,10 +DA:120,10 +DA:122,10 +DA:123,3 +DA:124,3 +DA:125,3 +DA:127,7 +DA:144,10 +DA:145,10 +DA:147,10 +DA:148,10 +DA:150,10 +DA:152,10 +DA:159,10 +DA:163,10 +DA:164,10 +DA:170,6 +LF:42 +LH:42 +BRDA:65,1,0,11 +BRDA:65,1,1,2 +BRDA:66,2,0,11 +BRDA:66,2,1,0 +BRDA:67,3,0,11 +BRDA:67,3,1,0 +BRDA:90,4,0,8 +BRDA:90,4,1,0 +BRDA:91,5,0,8 +BRDA:91,5,1,0 +BRDA:93,6,0,6 +BRDA:93,6,1,2 +BRDA:111,7,0,12 +BRDA:111,7,1,2 +BRDA:112,8,0,10 +BRDA:112,8,1,2 +BRDA:122,9,0,3 +BRDA:122,9,1,7 +BRDA:145,10,0,10 +BRDA:145,10,1,0 +BRDA:147,11,0,10 +BRDA:147,11,1,0 +BRDA:148,12,0,10 +BRDA:148,12,1,0 +BRF:24 +BRH:17 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/ContributionReward.sol +FN:83,executeProposal +FN:99,setParameters +FN:127,proposeContributionReward +FN:191,redeemReputation +FN:224,redeemNativeToken +FN:250,redeemEther +FN:276,redeemExternalToken +FN:311,redeem +FN:345,getPeriodsToPay +FN:375,getRedeemedPeriods +FN:382,getProposalEthReward +FN:386,getProposalExternalTokenReward +FN:390,getProposalExternalToken +FN:394,getProposalExecutionTime +FN:404,getParametersHash +FN:424,validateProposalParams +FNF:16 +FNH:16 +FNDA:14,executeProposal +FNDA:20,setParameters +FNDA:27,proposeContributionReward +FNDA:10,redeemReputation +FNDA:5,redeemNativeToken +FNDA:13,redeemEther +FNDA:1,redeemExternalToken +FNDA:21,redeem +FNDA:75,getPeriodsToPay +FNDA:40,getRedeemedPeriods +FNDA:4,getProposalEthReward +FNDA:4,getProposalExternalTokenReward +FNDA:4,getProposalExternalToken +FNDA:6,getProposalExecutionTime +FNDA:40,getParametersHash +FNDA:27,validateProposalParams +DA:84,14 +DA:85,14 +DA:86,14 +DA:88,14 +DA:90,11 +DA:92,14 +DA:93,14 +DA:104,20 +DA:108,20 +DA:109,20 +DA:110,20 +DA:138,27 +DA:139,17 +DA:141,17 +DA:148,17 +DA:149,17 +DA:150,1 +DA:153,17 +DA:165,17 +DA:167,17 +DA:178,17 +DA:182,17 +DA:193,10 +DA:194,10 +DA:195,10 +DA:196,8 +DA:199,8 +DA:200,8 +DA:201,8 +DA:202,6 +DA:206,1 +DA:210,8 +DA:211,7 +DA:212,7 +DA:215,8 +DA:226,5 +DA:227,5 +DA:228,5 +DA:229,5 +DA:231,5 +DA:233,5 +DA:234,5 +DA:235,5 +DA:236,5 +DA:237,5 +DA:241,5 +DA:252,13 +DA:253,13 +DA:254,13 +DA:255,13 +DA:257,13 +DA:258,13 +DA:260,13 +DA:261,11 +DA:262,9 +DA:263,9 +DA:267,11 +DA:278,1 +DA:279,1 +DA:280,1 +DA:281,1 +DA:283,1 +DA:285,1 +DA:286,1 +DA:287,1 +DA:288,1 +DA:292,1 +DA:293,1 +DA:297,1 +DA:316,21 +DA:317,10 +DA:320,19 +DA:321,5 +DA:324,19 +DA:325,13 +DA:328,17 +DA:329,1 +DA:346,75 +DA:347,75 +DA:348,75 +DA:349,8 +DA:350,67 +DA:351,67 +DA:353,55 +DA:355,67 +DA:356,67 +DA:357,47 +DA:359,20 +DA:361,67 +DA:379,40 +DA:383,4 +DA:387,4 +DA:391,4 +DA:395,6 +DA:409,40 +DA:425,27 +DA:426,25 +DA:428,22 +DA:431,22 +DA:434,20 +DA:437,18 +DA:440,16 +LF:102 +LH:102 +BRDA:85,1,0,14 +BRDA:85,1,1,0 +BRDA:86,2,0,14 +BRDA:86,2,1,0 +BRDA:88,3,0,11 +BRDA:88,3,1,3 +BRDA:149,4,0,1 +BRDA:149,4,1,16 +BRDA:195,5,0,8 +BRDA:195,5,1,2 +BRDA:201,6,0,6 +BRDA:201,6,1,2 +BRDA:202,7,0,6 +BRDA:202,7,1,0 +BRDA:205,8,0,1 +BRDA:205,8,1,1 +BRDA:206,9,0,1 +BRDA:206,9,1,0 +BRDA:210,10,0,7 +BRDA:210,10,1,1 +BRDA:228,11,0,5 +BRDA:228,11,1,0 +BRDA:234,12,0,5 +BRDA:234,12,1,0 +BRDA:235,13,0,5 +BRDA:235,13,1,0 +BRDA:254,14,0,13 +BRDA:254,14,1,0 +BRDA:260,15,0,11 +BRDA:260,15,1,2 +BRDA:261,16,0,9 +BRDA:261,16,1,2 +BRDA:280,17,0,1 +BRDA:280,17,1,0 +BRDA:285,18,0,1 +BRDA:285,18,1,0 +BRDA:287,19,0,1 +BRDA:287,19,1,0 +BRDA:288,20,0,1 +BRDA:288,20,1,0 +BRDA:316,21,0,10 +BRDA:316,21,1,11 +BRDA:320,22,0,5 +BRDA:320,22,1,14 +BRDA:324,23,0,13 +BRDA:324,23,1,6 +BRDA:328,24,0,1 +BRDA:328,24,1,16 +BRDA:346,25,0,75 +BRDA:346,25,1,0 +BRDA:348,26,0,8 +BRDA:348,26,1,67 +BRDA:351,27,0,55 +BRDA:351,27,1,12 +BRDA:356,28,0,47 +BRDA:356,28,1,20 +BRDA:425,29,0,25 +BRDA:425,29,1,2 +BRDA:426,30,0,22 +BRDA:426,30,1,3 +BRDA:428,31,0,22 +BRDA:428,31,1,0 +BRDA:431,32,0,20 +BRDA:431,32,1,2 +BRDA:434,33,0,18 +BRDA:434,33,1,2 +BRDA:437,34,0,16 +BRDA:437,34,1,2 +BRDA:440,35,0,14 +BRDA:440,35,1,2 +BRF:70 +BRH:56 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/DaoCreator.sol +FN:13,create +FN:34,constructor +FN:52,addFounders +FN:93,forgeOrg +FN:124,setSchemes +FN:162,_forgeOrg +FNF:6 +FNH:6 +FNDA:294,create +FNDA:296,constructor +FNDA:3,addFounders +FNDA:298,forgeOrg +FNDA:294,setSchemes +FNDA:298,_forgeOrg +DA:14,294 +DA:15,294 +DA:16,294 +DA:17,294 +DA:35,296 +DA:36,296 +DA:37,296 +DA:38,296 +DA:61,3 +DA:62,3 +DA:63,3 +DA:64,3 +DA:66,1 +DA:67,60 +DA:68,60 +DA:69,60 +DA:72,60 +DA:73,60 +DA:77,1 +DA:106,298 +DA:135,294 +DA:137,290 +DA:138,290 +DA:139,313 +DA:141,290 +DA:143,290 +DA:145,290 +DA:146,290 +DA:173,298 +DA:174,298 +DA:175,296 +DA:176,296 +DA:177,296 +DA:178,296 +DA:182,296 +DA:183,536 +DA:184,534 +DA:185,370 +DA:187,534 +DA:188,508 +DA:192,294 +DA:195,294 +DA:198,294 +DA:199,294 +DA:200,294 +DA:202,294 +DA:204,294 +DA:205,294 +LF:48 +LH:48 +BRDA:35,1,0,296 +BRDA:35,1,1,0 +BRDA:36,2,0,296 +BRDA:36,2,1,0 +BRDA:61,3,0,3 +BRDA:61,3,1,0 +BRDA:62,4,0,3 +BRDA:62,4,1,0 +BRDA:63,5,0,3 +BRDA:63,5,1,0 +BRDA:64,6,0,1 +BRDA:64,6,1,2 +BRDA:67,7,0,60 +BRDA:67,7,1,0 +BRDA:68,8,0,60 +BRDA:68,8,1,0 +BRDA:72,9,0,60 +BRDA:72,9,1,0 +BRDA:135,10,0,290 +BRDA:135,10,1,4 +BRDA:173,11,0,298 +BRDA:173,11,1,0 +BRDA:174,12,0,296 +BRDA:174,12,1,2 +BRDA:175,13,0,296 +BRDA:175,13,1,0 +BRDA:183,14,0,534 +BRDA:183,14,1,2 +BRDA:184,15,0,370 +BRDA:184,15,1,164 +BRDA:187,16,0,508 +BRDA:187,16,1,26 +BRF:32 +BRH:22 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/GlobalConstraintRegistrar.sol +FN:64,executeProposal +FN:98,setParameters +FN:119,proposeGlobalConstraint +FN:164,proposeToRemoveGC +FN:198,getParametersHash +FNF:5 +FNH:5 +FNDA:8,executeProposal +FNDA:11,setParameters +FNDA:8,proposeGlobalConstraint +FNDA:5,proposeToRemoveGC +FNDA:22,getParametersHash +DA:65,8 +DA:66,8 +DA:68,8 +DA:69,8 +DA:70,8 +DA:71,8 +DA:73,8 +DA:76,7 +DA:79,7 +DA:80,5 +DA:81,5 +DA:84,7 +DA:85,2 +DA:88,8 +DA:89,8 +DA:103,11 +DA:104,11 +DA:105,11 +DA:106,11 +DA:128,8 +DA:130,8 +DA:131,8 +DA:133,8 +DA:140,8 +DA:141,8 +DA:150,8 +DA:154,8 +DA:165,5 +DA:166,5 +DA:167,3 +DA:168,3 +DA:169,3 +DA:176,3 +DA:183,3 +DA:184,3 +DA:185,3 +DA:189,3 +DA:203,22 +LF:38 +LH:38 +BRDA:69,1,0,8 +BRDA:69,1,1,0 +BRDA:73,2,0,7 +BRDA:73,2,1,1 +BRDA:79,3,0,5 +BRDA:79,3,1,2 +BRDA:84,4,0,2 +BRDA:84,4,1,5 +BRDA:166,5,0,3 +BRDA:166,5,1,2 +BRF:10 +BRH:9 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/OrganizationRegister.sol +FN:37,setParameters +FN:56,addOrPromoteAddress +FN:79,getParametersHash +FNF:3 +FNH:3 +FNDA:3,setParameters +FNDA:4,addOrPromoteAddress +FNDA:6,getParametersHash +DA:38,3 +DA:39,3 +DA:40,3 +DA:41,3 +DA:42,3 +DA:44,3 +DA:59,4 +DA:61,4 +DA:63,2 +DA:64,2 +DA:65,1 +DA:67,2 +DA:69,2 +DA:82,6 +LF:14 +LH:14 +BRDA:39,1,0,3 +BRDA:39,1,1,0 +BRDA:61,2,0,2 +BRDA:61,2,1,2 +BRDA:64,3,0,1 +BRDA:64,3,1,1 +BRF:6 +BRH:5 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/SchemeRegistrar.sol +FN:60,executeProposal +FN:92,setParameters +FN:115,proposeScheme +FN:165,proposeToRemoveScheme +FN:184,getParametersHash +FNF:5 +FNH:5 +FNDA:11,executeProposal +FNDA:15,setParameters +FNDA:11,proposeScheme +FNDA:2,proposeToRemoveScheme +FNDA:30,getParametersHash +DA:61,11 +DA:62,11 +DA:63,11 +DA:64,11 +DA:65,11 +DA:66,11 +DA:69,10 +DA:72,10 +DA:73,9 +DA:81,10 +DA:82,1 +DA:85,11 +DA:86,11 +DA:98,15 +DA:99,15 +DA:100,15 +DA:101,15 +DA:102,15 +DA:126,11 +DA:127,11 +DA:129,11 +DA:136,11 +DA:142,11 +DA:150,11 +DA:151,11 +DA:155,11 +DA:169,2 +DA:170,2 +DA:171,2 +DA:173,2 +DA:174,2 +DA:175,2 +DA:176,2 +DA:177,2 +DA:181,2 +DA:190,30 +LF:36 +LH:36 +BRDA:63,1,0,11 +BRDA:63,1,1,0 +BRDA:66,2,0,10 +BRDA:66,2,1,1 +BRDA:72,3,0,9 +BRDA:72,3,1,1 +BRDA:73,4,0,9 +BRDA:73,4,1,0 +BRDA:81,5,0,1 +BRDA:81,5,1,9 +BRDA:82,6,0,1 +BRDA:82,6,1,0 +BRDA:126,7,0,11 +BRDA:126,7,1,0 +BRDA:169,8,0,2 +BRDA:169,8,1,0 +BRF:16 +BRH:11 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/UniversalScheme.sol +FN:12,getParametersFromController +FNF:1 +FNH:1 +FNDA:57,getParametersFromController +DA:13,57 +DA:15,57 +LF:2 +LH:2 +BRDA:13,1,0,57 +BRDA:13,1,1,0 +BRF:2 +BRH:1 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/UniversalSchemeInterface.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/UpgradeScheme.sol +FN:59,executeProposal +FN:93,setParameters +FN:111,proposeUpgrade +FN:145,proposeChangeUpgradingScheme +FN:184,getParametersHash +FNF:5 +FNH:5 +FNDA:5,executeProposal +FNDA:9,setParameters +FNDA:3,proposeUpgrade +FNDA:4,proposeChangeUpgradingScheme +FNDA:18,getParametersHash +DA:60,5 +DA:61,5 +DA:62,5 +DA:63,5 +DA:64,5 +DA:66,5 +DA:69,4 +DA:71,4 +DA:72,1 +DA:76,4 +DA:77,3 +DA:78,3 +DA:81,3 +DA:82,2 +DA:86,5 +DA:87,5 +DA:98,9 +DA:99,9 +DA:100,9 +DA:101,9 +DA:115,3 +DA:116,3 +DA:117,3 +DA:122,3 +DA:123,3 +DA:130,3 +DA:134,3 +DA:154,4 +DA:155,4 +DA:156,4 +DA:157,4 +DA:159,4 +DA:164,4 +DA:166,4 +DA:174,4 +DA:178,4 +DA:189,18 +LF:37 +LH:37 +BRDA:62,1,0,5 +BRDA:62,1,1,0 +BRDA:66,2,0,4 +BRDA:66,2,1,1 +BRDA:71,3,0,1 +BRDA:71,3,1,3 +BRDA:72,4,0,1 +BRDA:72,4,1,0 +BRDA:76,5,0,3 +BRDA:76,5,1,1 +BRDA:78,6,0,3 +BRDA:78,6,1,0 +BRDA:81,7,0,2 +BRDA:81,7,1,1 +BRDA:82,8,0,2 +BRDA:82,8,1,0 +BRDA:157,9,0,4 +BRDA:157,9,1,0 +BRF:18 +BRH:13 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/universalSchemes/VoteInOrganizationScheme.sol +FN:52,executeProposal +FN:87,setParameters +FN:108,proposeVote +FN:154,getParametersHash +FNF:4 +FNH:4 +FNDA:4,executeProposal +FNDA:11,setParameters +FNDA:5,proposeVote +FNDA:22,getParametersHash +DA:53,4 +DA:55,4 +DA:56,4 +DA:57,4 +DA:58,4 +DA:59,4 +DA:60,4 +DA:62,4 +DA:64,3 +DA:65,3 +DA:75,3 +DA:77,4 +DA:78,4 +DA:92,11 +DA:93,11 +DA:94,11 +DA:95,11 +DA:117,5 +DA:118,5 +DA:119,5 +DA:120,5 +DA:121,5 +DA:124,5 +DA:126,5 +DA:132,5 +DA:141,5 +DA:145,5 +DA:159,22 +LF:28 +LH:28 +BRDA:56,1,0,4 +BRDA:56,1,1,0 +BRDA:62,2,0,3 +BRDA:62,2,1,1 +BRDA:75,3,0,3 +BRDA:75,3,1,0 +BRDA:120,4,0,5 +BRDA:120,4,1,0 +BRDA:121,5,0,5 +BRDA:121,5,1,0 +BRF:10 +BRH:6 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/utils/DAOTracker.sol +FN:38,onlyAvatarOwner +FN:44,notBlacklisted +FN:64,track +FN:89,blacklist +FN:102,reset +FNF:5 +FNH:5 +FNDA:302,onlyAvatarOwner +FNDA:298,notBlacklisted +FNDA:298,track +FNDA:4,blacklist +FNDA:1,reset +DA:39,302 +DA:41,298 +DA:45,298 +DA:47,298 +DA:67,298 +DA:68,298 +DA:70,296 +DA:90,4 +DA:91,2 +DA:92,2 +DA:103,1 +DA:104,1 +DA:105,1 +LF:13 +LH:13 +BRDA:39,1,0,298 +BRDA:39,1,1,4 +BRDA:45,2,0,298 +BRDA:45,2,1,0 +BRDA:67,3,0,298 +BRDA:67,3,1,0 +BRDA:68,4,0,296 +BRDA:68,4,1,2 +BRDA:90,5,0,2 +BRDA:90,5,1,2 +BRDA:103,6,0,1 +BRDA:103,6,1,0 +BRF:12 +BRH:9 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/utils/Redeemer.sol +FN:42,redeem +FN:98,redeemFromCRExt +FN:124,genesisProtocolRedeem +FN:154,contributionRewardRedeem +FN:182,contributionRewardExtRedeem +FNF:5 +FNH:5 +FNDA:6,redeem +FNDA:6,redeemFromCRExt +FNDA:12,genesisProtocolRedeem +FNDA:4,contributionRewardRedeem +FNDA:4,contributionRewardExtRedeem +DA:57,6 +DA:58,6 +DA:60,6 +DA:62,6 +DA:63,4 +DA:112,6 +DA:113,6 +DA:115,6 +DA:117,6 +DA:118,4 +DA:133,12 +DA:135,12 +DA:139,6 +DA:141,12 +DA:142,12 +DA:144,12 +DA:145,12 +DA:146,10 +DA:149,12 +DA:150,12 +DA:158,4 +DA:159,4 +DA:160,4 +DA:161,4 +DA:162,4 +DA:163,4 +DA:164,4 +DA:165,4 +DA:166,4 +DA:167,0 +DA:169,4 +DA:171,4 +DA:172,4 +DA:173,4 +DA:175,4 +DA:177,0 +DA:179,4 +DA:186,4 +DA:187,4 +DA:188,4 +DA:189,4 +DA:190,4 +DA:191,4 +DA:192,4 +DA:193,0 +DA:195,4 +DA:197,4 +DA:199,4 +DA:201,0 +DA:203,4 +LF:50 +LH:46 +BRDA:60,1,0,6 +BRDA:60,1,1,0 +BRDA:62,2,0,4 +BRDA:62,2,1,2 +BRDA:115,3,0,6 +BRDA:115,3,1,0 +BRDA:117,4,0,4 +BRDA:117,4,1,2 +BRDA:135,5,0,6 +BRDA:135,5,1,6 +BRDA:142,6,0,12 +BRDA:142,6,1,0 +BRDA:145,7,0,10 +BRDA:145,7,1,2 +BRDA:166,8,0,0 +BRDA:166,8,1,4 +BRDA:173,9,0,4 +BRDA:173,9,1,0 +BRDA:192,10,0,0 +BRDA:192,10,1,4 +BRDA:197,11,0,4 +BRDA:197,11,1,0 +BRF:22 +BRH:15 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/utils/RepAllocation.sol +FN:25,addBeneficiary +FN:38,addBeneficiaries +FN:49,freeze +FN:57,balanceOf +FNF:4 +FNH:4 +FNDA:33,addBeneficiary +FNDA:1,addBeneficiaries +FNDA:1,freeze +FNDA:5,balanceOf +DA:26,33 +DA:28,31 +DA:29,30 +DA:30,30 +DA:39,1 +DA:40,1 +DA:41,2 +DA:50,1 +DA:58,5 +LF:9 +LH:9 +BRDA:26,1,0,31 +BRDA:26,1,1,2 +BRDA:28,2,0,30 +BRDA:28,2,1,1 +BRDA:39,3,0,1 +BRDA:39,3,1,0 +BRF:6 +BRH:5 +end_of_record +TN: +SF:/home/blackjak/Projects/DXdao/arc/contracts/votingMachines/VotingMachineCallbacks.sol +FN:14,onlyVotingMachine +FN:24,mintReputation +FN:36,burnReputation +FN:52,stakingTokenTransfer +FN:62,balanceOfStakingToken +FN:70,getTotalReputationSupply +FN:78,reputationOf +FNF:7 +FNH:7 +FNDA:120,onlyVotingMachine +FNDA:13,mintReputation +FNDA:18,burnReputation +FNDA:1,stakingTokenTransfer +FNDA:5,balanceOfStakingToken +FNDA:108,getTotalReputationSupply +FNDA:81,reputationOf +DA:15,120 +DA:16,110 +DA:27,13 +DA:28,13 +DA:29,0 +DA:31,13 +DA:39,18 +DA:40,18 +DA:41,0 +DA:43,18 +DA:55,1 +DA:56,1 +DA:57,0 +DA:59,1 +DA:63,5 +DA:64,5 +DA:65,0 +DA:67,5 +DA:71,108 +DA:72,108 +DA:73,0 +DA:75,108 +DA:79,81 +DA:80,81 +DA:81,0 +DA:83,81 +LF:26 +LH:20 +BRDA:15,1,0,110 +BRDA:15,1,1,10 +BRDA:28,2,0,0 +BRDA:28,2,1,13 +BRDA:40,3,0,0 +BRDA:40,3,1,18 +BRDA:56,4,0,0 +BRDA:56,4,1,1 +BRDA:64,5,0,0 +BRDA:64,5,1,5 +BRDA:72,6,0,0 +BRDA:72,6,1,108 +BRDA:80,7,0,0 +BRDA:80,7,1,81 +BRF:14 +BRH:8 +end_of_record diff --git a/coverage/libs/SafeERC20.sol.html b/coverage/libs/SafeERC20.sol.html new file mode 100644 index 00000000..f07c9d4c --- /dev/null +++ b/coverage/libs/SafeERC20.sol.html @@ -0,0 +1,281 @@ + + + + Code coverage report for libs/SafeERC20.sol + + + + + + + +
+
+

+ all files / libs/ SafeERC20.sol +

+
+
+ 100% + Statements + 13/13 +
+
+ 50% + Branches + 10/20 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 13/13 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +45× +  +45× +  +  +  +45× +  +45× +  +  +  +  +  +70× +  +70× +  +  +  +70× +  +70× +  +  +  +  +  + +  +  +  + +  + +  +  +  + +  + +  +  + 
/*
+ 
+SafeERC20 by daostack.
+The code is based on a fix by SECBIT Team.
+ 
+USE WITH CAUTION & NO WARRANTY
+ 
+REFERENCE & RELATED READING
+- https://github.com/ethereum/solidity/issues/4116
+- https://medium.com/@chris_77367/explaining-unexpected-reverts-starting-with-solidity-0-4-22-3ada6e82308c
+- https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
+- https://gist.github.com/BrendanChou/88a2eeb80947ff00bcf58ffdafeaeb61
+ 
+*/
+pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/utils/Address.sol";
+import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
+ 
+library SafeERC20 {
+    using Address for address;
+ 
+    bytes4 constant private TRANSFER_SELECTOR = bytes4(keccak256(bytes("transfer(address,uint256)")));
+    bytes4 constant private TRANSFERFROM_SELECTOR = bytes4(keccak256(bytes("transferFrom(address,address,uint256)")));
+    bytes4 constant private APPROVE_SELECTOR = bytes4(keccak256(bytes("approve(address,uint256)")));
+ 
+    function safeTransfer(address _erc20Addr, address _to, uint256 _value) internal {
+ 
+        // Must be a contract addr first!
+        Erequire(_erc20Addr.isContract());
+ 
+        (bool success, bytes memory returnValue) =
+        // solhint-disable-next-line avoid-low-level-calls
+        _erc20Addr.call(abi.encodeWithSelector(TRANSFER_SELECTOR, _to, _value));
+        // call return false when something wrong
+        Erequire(success);
+        //check return value
+        Erequire(returnValue.length == 0 || (returnValue.length == 32 && (returnValue[31] != 0)));
+    }
+ 
+    function safeTransferFrom(address _erc20Addr, address _from, address _to, uint256 _value) internal {
+ 
+        // Must be a contract addr first!
+        Erequire(_erc20Addr.isContract());
+ 
+        (bool success, bytes memory returnValue) =
+        // solhint-disable-next-line avoid-low-level-calls
+        _erc20Addr.call(abi.encodeWithSelector(TRANSFERFROM_SELECTOR, _from, _to, _value));
+        // call return false when something wrong
+        Erequire(success);
+        //check return value
+        Erequire(returnValue.length == 0 || (returnValue.length == 32 && (returnValue[31] != 0)));
+    }
+ 
+    function safeApprove(address _erc20Addr, address _spender, uint256 _value) internal {
+ 
+        // Must be a contract addr first!
+        Erequire(_erc20Addr.isContract());
+ 
+        // safeApprove should only be called when setting an initial allowance,
+        // or when resetting it to zero.
+        Erequire((_value == 0) || (IERC20(_erc20Addr).allowance(address(this), _spender) == 0));
+ 
+        (bool success, bytes memory returnValue) =
+        // solhint-disable-next-line avoid-low-level-calls
+        _erc20Addr.call(abi.encodeWithSelector(APPROVE_SELECTOR, _spender, _value));
+        // call return false when something wrong
+        Erequire(success);
+        //check return value
+        Erequire(returnValue.length == 0 || (returnValue.length == 32 && (returnValue[31] != 0)));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/libs/index.html b/coverage/libs/index.html new file mode 100644 index 00000000..40479824 --- /dev/null +++ b/coverage/libs/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for libs/ + + + + + + + +
+
+

+ all files libs/ +

+
+
+ 100% + Statements + 13/13 +
+
+ 50% + Branches + 10/20 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 13/13 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
SafeERC20.sol
100%13/1350%10/20100%3/3100%13/13
+
+
+ + + + + + + diff --git a/coverage/prettify.css b/coverage/prettify.css new file mode 100644 index 00000000..b317a7cd --- /dev/null +++ b/coverage/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/prettify.js b/coverage/prettify.js new file mode 100644 index 00000000..ef51e038 --- /dev/null +++ b/coverage/prettify.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/schemes/Agreement.sol.html b/coverage/schemes/Agreement.sol.html new file mode 100644 index 00000000..71f3029f --- /dev/null +++ b/coverage/schemes/Agreement.sol.html @@ -0,0 +1,176 @@ + + + + Code coverage report for schemes/Agreement.sol + + + + + + + +
+
+

+ all files / schemes/ Agreement.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 5/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38  +  +  +  +  +  +  +  +  +  +  +  +151× +130× +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +117× +115× +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+/**
+ * @title A scheme for conduct ERC20 Tokens auction for reputation
+ */
+ 
+ 
+contract Agreement {
+ 
+    bytes32 private agreementHash;
+ 
+    modifier onlyAgree(bytes32 _agreementHash) {
+        require(_agreementHash == agreementHash, "Sender must send the right agreementHash");
+        _;
+    }
+ 
+    /**
+     * @dev getAgreementHash
+     * @return bytes32 agreementHash
+     */
+    function getAgreementHash() external  view returns(bytes32)
+    {
+        return agreementHash;
+    }
+ 
+    /**
+     * @dev setAgreementHash
+     * @param _agreementHash is a hash of agreement required to be added to the TX by participants
+     */
+    function setAgreementHash(bytes32 _agreementHash) internal
+    {
+        require(agreementHash == bytes32(0), "Can not set agreement twice");
+        agreementHash = _agreementHash;
+    }
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/Auction4Reputation.sol.html b/coverage/schemes/Auction4Reputation.sol.html new file mode 100644 index 00000000..7481fb4e --- /dev/null +++ b/coverage/schemes/Auction4Reputation.sol.html @@ -0,0 +1,542 @@ + + + + Code coverage report for schemes/Auction4Reputation.sol + + + + + + + +
+
+

+ all files / schemes/ Auction4Reputation.sol +

+
+
+ 100% + Statements + 40/40 +
+
+ 88.46% + Branches + 23/26 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 40/40 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +28× +26× +26× +  +24× +22× +22× +22× +16× +16× +16× +16× +16× +16× +16× +16× +16× +  +  +  +  +  +  +  +  +  +  +16× +12× +12× +12× +10× +10× +10× +  +10× +10× +  +  +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +20× +  +18× +  +16× +16× +  +16× +16× +14× +14× +14× +14× +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  + +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/math/SafeMath.sol";
+import "../controller/Controller.sol";
+import "../libs/SafeERC20.sol";
+import "./Agreement.sol";
+ 
+/**
+ * @title A scheme for conduct ERC20 Tokens auction for reputation
+ */
+ 
+ 
+contract Auction4Reputation is Agreement {
+    using SafeMath for uint256;
+    using SafeERC20 for address;
+ 
+    event Bid(address indexed _bidder, uint256 indexed _auctionId, uint256 _amount);
+    event Redeem(uint256 indexed _auctionId, address indexed _beneficiary, uint256 _amount);
+ 
+    struct Auction {
+        uint256 totalBid;
+        // A mapping from bidder addresses to their bids.
+        mapping(address=>uint) bids;
+    }
+ 
+    // A mapping from auction index to auction.
+    mapping(uint=>Auction) public auctions;
+ 
+    Avatar public avatar;
+    uint256 public reputationRewardLeft;
+    uint256 public auctionsEndTime;
+    uint256 public auctionsStartTime;
+    uint256 public numberOfAuctions;
+    uint256 public auctionReputationReward;
+    uint256 public auctionPeriod;
+    uint256 public redeemEnableTime;
+    IERC20 public token;
+    address public wallet;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _auctionReputationReward the reputation reward per auction this contract will reward
+     *        for the token locking
+     * @param _auctionsStartTime auctions period start time
+     * @param _auctionPeriod auctions period time.
+     *        auctionsEndTime is set to _auctionsStartTime + _auctionPeriod*_numberOfAuctions
+     *        bidding is disable after auctionsEndTime.
+     * @param _numberOfAuctions number of auctions.
+     * @param _redeemEnableTime redeem enable time .
+     *        redeem reputation can be done after this time.
+     * @param _token the bidding token
+     * @param  _wallet the address of the wallet the token will be transfer to.
+     *         Please note that _wallet address should be a trusted account.
+     *         Normally this address should be set as the DAO's avatar address.
+     * @param _agreementHash is a hash of agreement required to be added to the TX by participants
+     */
+    function initialize(
+        Avatar _avatar,
+        uint256 _auctionReputationReward,
+        uint256 _auctionsStartTime,
+        uint256 _auctionPeriod,
+        uint256 _numberOfAuctions,
+        uint256 _redeemEnableTime,
+        IERC20 _token,
+        address _wallet,
+        bytes32 _agreementHash )
+    external
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        require(_numberOfAuctions > 0, "number of auctions cannot be zero");
+        //_auctionPeriod should be greater than block interval
+        require(_auctionPeriod > 15, "auctionPeriod should be > 15");
+        auctionPeriod = _auctionPeriod;
+        auctionsEndTime = _auctionsStartTime + _auctionPeriod.mul(_numberOfAuctions);
+        require(_redeemEnableTime >= auctionsEndTime, "_redeemEnableTime >= auctionsEndTime");
+        token = _token;
+        avatar = _avatar;
+        auctionsStartTime = _auctionsStartTime;
+        numberOfAuctions = _numberOfAuctions;
+        wallet = _wallet;
+        auctionReputationReward = _auctionReputationReward;
+        reputationRewardLeft = _auctionReputationReward.mul(_numberOfAuctions);
+        redeemEnableTime = _redeemEnableTime;
+        super.setAgreementHash(_agreementHash);
+    }
+ 
+    /**
+     * @dev redeem reputation function
+     * @param _beneficiary the beneficiary to redeem.
+     * @param _auctionId the auction id to redeem from.
+     * @return uint256 reputation rewarded
+     */
+    function redeem(address _beneficiary, uint256 _auctionId) public returns(uint256 reputation) {
+        // solhint-disable-next-line not-rely-on-time
+        require(now > redeemEnableTime, "now > redeemEnableTime");
+        Auction storage auction = auctions[_auctionId];
+        uint256 bid = auction.bids[_beneficiary];
+        require(bid > 0, "bidding amount should be > 0");
+        auction.bids[_beneficiary] = 0;
+        uint256 repRelation = bid.mul(auctionReputationReward);
+        reputation = repRelation.div(auction.totalBid);
+        // check that the reputation is sum zero
+        reputationRewardLeft = reputationRewardLeft.sub(reputation);
+        Erequire(
+        Controller(avatar.owner())
+        .mintReputation(reputation, _beneficiary, address(avatar)), "mint reputation should succeed");
+        emit Redeem(_auctionId, _beneficiary, reputation);
+    }
+ 
+    /**
+     * @dev bid function
+     * @param _amount the amount to bid with
+     * @param _auctionId the auction id to bid at .
+     * @return auctionId
+     */
+    function bid(uint256 _amount, uint256 _auctionId, bytes32 _agreementHash)
+    public
+    onlyAgree(_agreementHash)
+    returns(uint256 auctionId)
+    {
+        require(_amount > 0, "bidding amount should be > 0");
+        // solhint-disable-next-line not-rely-on-time
+        require(now < auctionsEndTime, "bidding should be within the allowed bidding period");
+        // solhint-disable-next-line not-rely-on-time
+        Erequire(now >= auctionsStartTime, "bidding is enable only after bidding auctionsStartTime");
+        address(token).safeTransferFrom(msg.sender, address(this), _amount);
+        // solhint-disable-next-line not-rely-on-time
+        auctionId = (now - auctionsStartTime) / auctionPeriod;
+        require(auctionId == _auctionId, "auction is not active");
+        Auction storage auction = auctions[auctionId];
+        auction.totalBid = auction.totalBid.add(_amount);
+        auction.bids[msg.sender] = auction.bids[msg.sender].add(_amount);
+        emit Bid(msg.sender, auctionId, _amount);
+    }
+ 
+    /**
+     * @dev transferToWallet transfer the tokens to the wallet.
+     *      can be called only after auctionsEndTime
+     */
+    function transferToWallet() public {
+      // solhint-disable-next-line not-rely-on-time
+        require(now > auctionsEndTime, "now > auctionsEndTime");
+        uint256 tokenBalance = token.balanceOf(address(this));
+        address(token).safeTransfer(wallet, tokenBalance);
+    }
+ 
+    /**
+     * @dev getBid get bid for specific bidder and _auctionId
+     * @param _bidder the bidder
+     * @param _auctionId auction id
+     * @return uint
+     */
+    function getBid(address _bidder, uint256 _auctionId) public view returns(uint256) {
+        return auctions[_auctionId].bids[_bidder];
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/Competition.sol.html b/coverage/schemes/Competition.sol.html new file mode 100644 index 00000000..9f69aa11 --- /dev/null +++ b/coverage/schemes/Competition.sol.html @@ -0,0 +1,1316 @@ + + + + Code coverage report for schemes/Competition.sol + + + + + + + +
+
+

+ all files / schemes/ Competition.sol +

+
+
+ 97.84% + Statements + 136/139 +
+
+ 77.66% + Branches + 73/94 +
+
+ 100% + Functions + 9/9 +
+
+ 97.84% + Lines + 136/139 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +15× +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +27× +27× +  +  +  +  +27× +25× +23× +23× +21× +19× +  +19× +19× +19× +  +19× +17× +17× +65× +  +17× +15× +  +15× +15× +15× +15× +15× +15× +15× +15× +15× +15× +15× +15× +15× + +  +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +73× + +  +  +71× +  +69× +65× +65× +65× +65× +64× +  + +  +65× +65× +65× +  +  +  +  +  +  +  +  +  +  +  +33× +33× +31× +29× +29× +29× +29× +  +29× +29× +29× +27× +  +25× +25× + +  +  +25× +25× +25× +25× +25× +25× +  +  +  +  +  +  +  +  +  +31× +29× +29× + + +  +  +  +  +  +  +  +  +  + + + + + + +  +  + +  +  +  +  +  + +  + +  +  + +  +  + +  +  +  +  +  +  +  +  +12× +12× +12× +12× +  +12× + + +  + + + + + + + +  + + +  + + + +  +  + + +  + +  +  + + + +  +  + + +  +  + + +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +17× +17× +15× +  +15× +45× +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +25× +25× +25× +23× +23× + +  +  +20× +  +  + + + +  + +  +  +  +  +  +  + +  +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "./ContributionRewardExt.sol";
+ 
+ 
+contract Competition {
+    using SafeMath for uint256;
+ 
+    uint256 constant public MAX_NUMBER_OF_WINNERS = 100;
+ 
+    event NewCompetitionProposal(
+        bytes32 indexed _proposalId,
+        uint256 _numberOfWinners,
+        uint256[] _rewardSplit,
+        uint256 _startTime,
+        uint256 _votingStartTime,
+        uint256 _suggestionsEndTime,
+        uint256 _endTime,
+        uint256 _maxNumberOfVotesPerVoter,
+        address payable _contributionRewardExt, //address of the contract to redeem from.
+        address _admin
+    );
+ 
+    event Redeem(
+        bytes32 indexed _proposalId,
+        uint256 indexed _suggestionId,
+        uint256 _rewardPercentage
+    );
+ 
+    event NewSuggestion(
+        bytes32 indexed _proposalId,
+        uint256 indexed _suggestionId,
+        string _descriptionHash,
+        address payable indexed _beneficiary
+    );
+ 
+    event NewVote(
+        bytes32 indexed _proposalId,
+        uint256 indexed _suggestionId,
+        address indexed _voter,
+        uint256 _reputation
+    );
+ 
+    event SnapshotBlock(
+        bytes32 indexed _proposalId,
+        uint256 _snapshotBlock
+    );
+ 
+    // A struct holding the data for a competition proposal
+    struct Proposal {
+        uint256 numberOfWinners;
+        uint256[] rewardSplit;
+        uint256 startTime;
+        uint256 votingStartTime;
+        uint256 suggestionsEndTime;
+        uint256 endTime;
+        uint256 maxNumberOfVotesPerVoter;
+        address payable contributionRewardExt;
+        uint256 snapshotBlock;
+        uint256 reputationReward;
+        uint256 ethReward;
+        uint256 nativeTokenReward;
+        uint256 externalTokenReward;
+        uint256[] topSuggestions;
+        address admin;
+        //mapping from suggestions totalVotes to the number of suggestions with the same totalVotes.
+        mapping(uint256=>uint256) suggestionsPerVote;
+        mapping(address=>uint256) votesPerVoter;
+    }
+ 
+    struct Suggestion {
+        uint256 totalVotes;
+        bytes32 proposalId;
+        address payable beneficiary;
+        mapping(address=>uint256) votes;
+    }
+ 
+    //mapping from proposalID to Proposal
+    mapping(bytes32=>Proposal) public proposals;
+    //mapping from suggestionId to Suggestion
+    mapping(uint256=>Suggestion) public suggestions;
+    uint256 public suggestionsCounter;
+    address payable public contributionRewardExt; //address of the contract to redeem from.
+ 
+    /**
+     * @dev initialize
+     * @param _contributionRewardExt the contributionRewardExt scheme which
+     *        manage and allocate the rewards for the competition.
+     */
+    function initialize(address payable _contributionRewardExt) external {
+        Erequire(contributionRewardExt == address(0), "can be called only one time");
+        Erequire(_contributionRewardExt != address(0), "contributionRewardExt cannot be zero");
+        contributionRewardExt = _contributionRewardExt;
+    }
+ 
+    /**
+    * @dev Submit a competion proposal
+    * @param _descriptionHash A hash of the proposal's description
+    * @param _reputationChange - Amount of reputation change requested.
+    * @param _rewards rewards array:
+    *         rewards[0] - Amount of tokens requested per period
+    *         rewards[1] - Amount of ETH requested per period
+    *         rewards[2] - Amount of external tokens requested per period
+    * @param _externalToken Address of external token, if reward is requested there
+    * @param _rewardSplit an array of precentages which specify how to split the rewards
+    *         between the winning suggestions
+    * @param _competitionParams competition parameters :
+    *         _competitionParams[0] - competition startTime
+    *         _competitionParams[1] - _votingStartTime competition voting start time
+    *         _competitionParams[2] - _endTime competition end time
+    *         _competitionParams[3] - _maxNumberOfVotesPerVoter on how many suggestions a voter can vote
+    *         _competitionParams[4] - _suggestionsEndTime suggestion submission end time
+    *        _proposerIsAdmin -
+    *          true -  proposer is an admin.
+    *          false no admin.
+    *          if admin is set, so only admin can suggest on this proposal.
+    * @return proposalId the proposal id.
+    */
+    function proposeCompetition(
+            string calldata _descriptionHash,
+            int256 _reputationChange,
+            uint[3] calldata _rewards,
+            IERC20 _externalToken,
+            uint256[] calldata _rewardSplit,
+            uint256[5] calldata _competitionParams,
+            bool _proposerIsAdmin
+    )
+    external
+    // solhint-disable-next-line function-max-lines
+    returns(bytes32 proposalId) {
+        uint256 numberOfWinners = _rewardSplit.length;
+        uint256 startTime = _competitionParams[0];
+        Iif (startTime == 0) {
+          // solhint-disable-next-line not-rely-on-time
+            startTime = now;
+        }
+        // solhint-disable-next-line not-rely-on-time
+        require(startTime >= now, "startTime should be greater than proposing time");
+        require(numberOfWinners <= MAX_NUMBER_OF_WINNERS, "number of winners greater than max allowed");
+        Erequire(_competitionParams[1] < _competitionParams[2], "voting start time greater than end time");
+        require(_competitionParams[1] >= startTime, "voting start time smaller than start time");
+        require(_competitionParams[3] > 0, "maxNumberOfVotesPerVoter should be greater than 0");
+        Erequire(_competitionParams[4] <= _competitionParams[2],
+        "suggestionsEndTime should be earlier than proposal end time");
+        Erequire(_competitionParams[4] > startTime, "suggestionsEndTime should be later than proposal start time");
+        Eif (_rewards[2] > 0) {
+            Erequire(_externalToken != ERC20(0), "extenal token cannot be zero");
+        }
+        require(_reputationChange >= 0, "negative reputation change is not allowed for a competition");
+        uint256 totalRewardSplit;
+        for (uint256 i = 0; i < numberOfWinners; i++) {
+            totalRewardSplit = totalRewardSplit.add(_rewardSplit[i]);
+        }
+        require(totalRewardSplit == 100, "total rewards split is not 100%");
+        proposalId = ContributionRewardExt(contributionRewardExt).proposeContributionReward(
+                _descriptionHash, _reputationChange, _rewards, _externalToken, contributionRewardExt, msg.sender);
+        proposals[proposalId].numberOfWinners = numberOfWinners;
+        proposals[proposalId].rewardSplit = _rewardSplit;
+        proposals[proposalId].startTime = startTime;
+        proposals[proposalId].votingStartTime = _competitionParams[1];
+        proposals[proposalId].endTime = _competitionParams[2];
+        proposals[proposalId].maxNumberOfVotesPerVoter = _competitionParams[3];
+        proposals[proposalId].suggestionsEndTime = _competitionParams[4];
+        proposals[proposalId].reputationReward = uint256(_reputationChange);
+        proposals[proposalId].nativeTokenReward = _rewards[0];
+        proposals[proposalId].ethReward = _rewards[1];
+        proposals[proposalId].externalTokenReward = _rewards[2];
+        proposals[proposalId].snapshotBlock = 0;
+        if (_proposerIsAdmin) {
+            proposals[proposalId].admin = msg.sender;
+        }
+        emit NewCompetitionProposal(
+            proposalId,
+            numberOfWinners,
+            proposals[proposalId].rewardSplit,
+            startTime,
+            proposals[proposalId].votingStartTime,
+            proposals[proposalId].suggestionsEndTime,
+            proposals[proposalId].endTime,
+            proposals[proposalId].maxNumberOfVotesPerVoter,
+            contributionRewardExt,
+            proposals[proposalId].admin
+        );
+    }
+ 
+    /**
+    * @dev submit a competion suggestion
+    * @param _proposalId the proposal id this suggestion is referring to.
+    * @param _descriptionHash a descriptionHash of the suggestion.
+    * @param _beneficiary the beneficiary of this suggestion.
+    * @return suggestionId the suggestionId.
+    */
+    function suggest(
+            bytes32 _proposalId,
+            string calldata _descriptionHash,
+            address payable _beneficiary
+    )
+    external
+    returns(uint256)
+    {
+        if (proposals[_proposalId].admin != address(0)) {
+            require(proposals[_proposalId].admin == msg.sender, "only admin can suggest");
+        }
+        // solhint-disable-next-line not-rely-on-time
+        require(proposals[_proposalId].startTime <= now, "competition not started yet");
+        // solhint-disable-next-line not-rely-on-time
+        require(proposals[_proposalId].suggestionsEndTime > now, "suggestions submission time is over");
+        suggestionsCounter = suggestionsCounter.add(1);
+        suggestions[suggestionsCounter].proposalId = _proposalId;
+        address payable beneficiary;
+        if (_beneficiary == address(0)) {
+            beneficiary = msg.sender;
+        } else {
+            beneficiary = _beneficiary;
+        }
+        suggestions[suggestionsCounter].beneficiary = beneficiary;
+        emit NewSuggestion(_proposalId, suggestionsCounter, _descriptionHash, beneficiary);
+        return suggestionsCounter;
+    }
+ 
+    /**
+    * @dev vote on a suggestion
+    * @param _suggestionId suggestionId
+    * @return bool
+    */
+    function vote(uint256 _suggestionId)
+    external
+    returns(bool)
+    {
+        bytes32 proposalId = suggestions[_suggestionId].proposalId;
+        require(proposalId != bytes32(0), "suggestion does not exist");
+        setSnapshotBlock(proposalId);
+        Avatar avatar = ContributionRewardExt(contributionRewardExt).avatar();
+        uint256 reputation = avatar.nativeReputation().balanceOfAt(msg.sender, proposals[proposalId].snapshotBlock);
+        Erequire(reputation > 0, "voter had no reputation when snapshot was taken");
+        Proposal storage proposal = proposals[proposalId];
+        // solhint-disable-next-line not-rely-on-time
+        Erequire(proposal.endTime > now, "competition ended");
+        Suggestion storage suggestion = suggestions[_suggestionId];
+        require(suggestion.votes[msg.sender] == 0, "already voted on this suggestion");
+        require(proposal.votesPerVoter[msg.sender] < proposal.maxNumberOfVotesPerVoter,
+        "exceed number of votes allowed");
+        proposal.votesPerVoter[msg.sender] = proposal.votesPerVoter[msg.sender].add(1);
+        if (suggestion.totalVotes > 0) {
+            proposal.suggestionsPerVote[suggestion.totalVotes] =
+            proposal.suggestionsPerVote[suggestion.totalVotes].sub(1);
+        }
+        suggestion.totalVotes = suggestion.totalVotes.add(reputation);
+        proposal.suggestionsPerVote[suggestion.totalVotes] = proposal.suggestionsPerVote[suggestion.totalVotes].add(1);
+        suggestion.votes[msg.sender] = reputation;
+        refreshTopSuggestions(proposalId, _suggestionId);
+        emit NewVote(proposalId, _suggestionId, msg.sender, reputation);
+        return true;
+    }
+ 
+    /**
+    * @dev setSnapshotBlock set the block for the reputaion snapshot
+    * this function is public in order to externaly set snapshot block regardless of the first voting event.
+    * @param _proposalId the proposal id
+    */
+    function setSnapshotBlock(bytes32 _proposalId) public {
+        // solhint-disable-next-line not-rely-on-time
+        require(proposals[_proposalId].votingStartTime < now, "voting period not started yet");
+        Erequire(proposals[_proposalId].maxNumberOfVotesPerVoter > 0, "proposal does not exist");
+        if (proposals[_proposalId].snapshotBlock == 0) {
+            proposals[_proposalId].snapshotBlock = block.number;
+            emit SnapshotBlock(_proposalId, block.number);
+        }
+    }
+ 
+    /**
+    * @dev sendLeftOverFund send leftover funds back to the dao.
+    * @param _proposalId the proposal id
+    */
+    function sendLeftOverFunds(bytes32 _proposalId) public {
+        // solhint-disable-next-line not-rely-on-time
+        Erequire(proposals[_proposalId].endTime < now, "competition is still on");
+        Erequire(proposals[_proposalId].maxNumberOfVotesPerVoter > 0, "proposal does not exist");
+        Erequire(_proposalId != bytes32(0), "proposalId is zero");
+        uint256[] memory topSuggestions = proposals[_proposalId].topSuggestions;
+        for (uint256 i = 0; i < topSuggestions.length; i++) {
+            require(suggestions[topSuggestions[i]].beneficiary == address(0), "not all winning suggestions redeemed");
+        }
+ 
+        (, , , , , ,
+        uint256 nativeTokenRewardLeft, ,
+        uint256 ethRewardLeft,
+        uint256 externalTokenRewardLeft,)
+        = ContributionRewardExt(contributionRewardExt).organizationProposals(_proposalId);
+ 
+        Avatar avatar = ContributionRewardExt(contributionRewardExt).avatar();
+ 
+        ContributionRewardExt(contributionRewardExt).redeemExternalTokenByRewarder(
+        _proposalId, address(avatar), externalTokenRewardLeft);
+ 
+        ContributionRewardExt(contributionRewardExt).redeemEtherByRewarder(
+        _proposalId, address(avatar), ethRewardLeft);
+ 
+        ContributionRewardExt(contributionRewardExt).redeemNativeTokenByRewarder(
+        _proposalId, address(avatar), nativeTokenRewardLeft);
+    }
+ 
+    /**
+    * @dev redeem a winning suggestion reward
+    * @param _suggestionId suggestionId
+    */
+    function redeem(uint256 _suggestionId) public {
+        bytes32 proposalId = suggestions[_suggestionId].proposalId;
+        Erequire(proposalId != bytes32(0), "proposalId is zero");
+        Proposal storage proposal = proposals[proposalId];
+        Erequire(_suggestionId > 0, "suggestionId is zero");
+        // solhint-disable-next-line not-rely-on-time
+        require(proposal.endTime < now, "competition is still on");
+        Erequire(proposal.maxNumberOfVotesPerVoter > 0, "proposal does not exist");
+        Erequire(suggestions[_suggestionId].beneficiary != address(0),
+        "suggestion was already redeemed");
+        address payable beneficiary = suggestions[_suggestionId].beneficiary;
+        uint256 orderIndex = getOrderedIndexOfSuggestion(_suggestionId);
+        Erequire(orderIndex < proposal.topSuggestions.length, "suggestion is not in winners list");
+        suggestions[_suggestionId].beneficiary = address(0);
+        uint256 rewardPercentage = 0;
+        uint256 numberOfTieSuggestions = proposal.suggestionsPerVote[suggestions[_suggestionId].totalVotes];
+        uint256 j;
+        //calc the reward percentage for this suggestion
+        for (j = orderIndex; j < (orderIndex+numberOfTieSuggestions) && j < proposal.numberOfWinners; j++) {
+            rewardPercentage = rewardPercentage.add(proposal.rewardSplit[j]);
+        }
+        rewardPercentage = rewardPercentage.div(numberOfTieSuggestions);
+        uint256 rewardPercentageLeft = 0;
+        if (proposal.topSuggestions.length < proposal.numberOfWinners) {
+          //if there are less winners than the proposal number of winners so divide the pre allocated
+          //left reward equally between the winners
+            for (j = proposal.topSuggestions.length; j < proposal.numberOfWinners; j++) {
+                rewardPercentageLeft = rewardPercentageLeft.add(proposal.rewardSplit[j]);
+            }
+            rewardPercentage =
+            rewardPercentage.add(rewardPercentageLeft.div(proposal.topSuggestions.length));
+        }
+        uint256 amount;
+        amount = proposal.externalTokenReward.mul(rewardPercentage).div(100);
+        ContributionRewardExt(contributionRewardExt).redeemExternalTokenByRewarder(
+        proposalId, beneficiary, amount);
+ 
+        amount = proposal.reputationReward.mul(rewardPercentage).div(100);
+        ContributionRewardExt(contributionRewardExt).redeemReputationByRewarder(
+        proposalId, beneficiary, amount);
+ 
+        amount = proposal.ethReward.mul(rewardPercentage).div(100);
+        ContributionRewardExt(contributionRewardExt).redeemEtherByRewarder(
+        proposalId, beneficiary, amount);
+ 
+        amount = proposal.nativeTokenReward.mul(rewardPercentage).div(100);
+        ContributionRewardExt(contributionRewardExt).redeemNativeTokenByRewarder(
+        proposalId, beneficiary, amount);
+        emit Redeem(proposalId, _suggestionId, rewardPercentage);
+    }
+ 
+    /**
+    * @dev getOrderedIndexOfSuggestion return the index of specific suggestion in the winners list.
+    * for the case when the suggestion is NOT in the winners list,
+    * this method will return topSuggestions.length
+    * @param _suggestionId suggestion id
+    */
+    function getOrderedIndexOfSuggestion(uint256 _suggestionId)
+    public
+    view
+    returns(uint256 index) {
+        bytes32 proposalId = suggestions[_suggestionId].proposalId;
+        require(proposalId != bytes32(0), "suggestion does not exist");
+        uint256[] memory topSuggestions = proposals[proposalId].topSuggestions;
+        /** get how many elements are greater than a given element*/
+        for (uint256 i = 0; i < topSuggestions.length; i++) {
+            if (suggestions[topSuggestions[i]].totalVotes > suggestions[_suggestionId].totalVotes) {
+                index++;
+            }
+        }
+    }
+ 
+    /**
+    * @dev refreshTopSuggestions this function maintain a winners list array.
+    * it will check if the given suggestion is among the top suggestions, and if so,
+    * update the list of top suggestions
+    * @param _proposalId proposal id
+    * @param _suggestionId suggestion id
+    */
+    // solhint-disable-next-line code-complexity
+    function refreshTopSuggestions(bytes32 _proposalId, uint256 _suggestionId) private {
+        uint256[] storage topSuggestions = proposals[_proposalId].topSuggestions;
+        uint256 topSuggestionsLength = topSuggestions.length;
+        uint256 i;
+        if (topSuggestionsLength < proposals[_proposalId].numberOfWinners) {
+            for (i = 0; i < topSuggestionsLength; i++) {
+                if (topSuggestions[i] == _suggestionId) {
+                    return;
+                }
+            }
+            topSuggestions.push(_suggestionId);
+        } else {
+         /** get the index of the smallest element **/
+            uint256 smallest = 0;
+            for (i = 0; i < proposals[_proposalId].numberOfWinners; i++) {
+                if (suggestions[topSuggestions[i]].totalVotes <
+                    suggestions[topSuggestions[smallest]].totalVotes) {
+                    smallest = i;
+                } else Iif (topSuggestions[i] == _suggestionId) {
+                  //the suggestion is already in the topSuggestions list
+                    return;
+                }
+            }
+ 
+            Iif (suggestions[topSuggestions[smallest]].totalVotes < suggestions[_suggestionId].totalVotes) {
+                topSuggestions[smallest] = _suggestionId;
+            }
+        }
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/ContinuousLocking4Reputation.sol.html b/coverage/schemes/ContinuousLocking4Reputation.sol.html new file mode 100644 index 00000000..07d383b5 --- /dev/null +++ b/coverage/schemes/ContinuousLocking4Reputation.sol.html @@ -0,0 +1,1022 @@ + + + + Code coverage report for schemes/ContinuousLocking4Reputation.sol + + + + + + + +
+
+

+ all files / schemes/ ContinuousLocking4Reputation.sol +

+
+
+ 100% + Statements + 93/93 +
+
+ 78.57% + Branches + 44/56 +
+
+ 100% + Functions + 11/11 +
+
+ 100% + Lines + 93/93 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +33× +31× +  +31× +29× +  +29× +  +27× +25× +25× +25× +25× +25× +25× +25× +25× +25× +23× +23× +23× +23× +  +  +  +  +  +  +  +  +  +  +16× +14× +14× +14× +  +14× +14× +14× +149× +149× +149× +144× +144× +144× +144× +144× +144× +  +  +14× +14× +  +12× +12× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +  +23× +23× +23× +23× +  +21× +21× +  +21× +21× +21× +  +21× +  +21× +  +21× +21× +  +  +19× +107× +107× +107× +107× +  +  +19× +19× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +13× +  +11× +  +11× +11× + + +  +  + + +  + +100× +100× +100× +100× +  + + +  +  +  +  +  +  +  +  +  +12× +12× +10× +10× +  +10× +  + + + +  +  +  +  +  +  +  +  +  +  +146× +145× +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +289× +289× +289× +  +  +  +  +  +  +311× +  +  +  +  +  +  +158× +  +  +  +  +  +  +  +  +144× +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/math/SafeMath.sol";
+import "openzeppelin-solidity/contracts/math/Math.sol";
+import "../controller/Controller.sol";
+import "../libs/SafeERC20.sol";
+import "./Agreement.sol";
+import { RealMath } from "@daostack/infra/contracts/libs/RealMath.sol";
+ 
+/**
+ * @title A scheme for continuous locking ERC20 Token for reputation
+ */
+ 
+contract ContinuousLocking4Reputation is Agreement {
+    using SafeMath for uint256;
+    using SafeERC20 for address;
+    using RealMath for uint216;
+    using RealMath for uint256;
+    using Math for uint256;
+ 
+    event Redeem(uint256 indexed _lockingId, address indexed _beneficiary, uint256 _amount, uint256 _batchIndex);
+    event Release(uint256 indexed _lockingId, address indexed _beneficiary, uint256 _amount);
+    event LockToken(address indexed _locker, uint256 indexed _lockingId, uint256 _amount, uint256 _period);
+    event ExtendLocking(address indexed _locker, uint256 indexed _lockingId, uint256 _extendPeriod);
+ 
+    struct Batch {
+        uint256 totalScore;
+        // A mapping from lockingId to its score
+        mapping(uint256=>uint) scores;
+    }
+ 
+    struct Lock {
+        uint256 amount;
+        uint256 lockingTime;
+        uint256 period;
+    }
+ 
+    // A mapping from lockers addresses to their locks
+    mapping(address => mapping(uint256=>Lock)) public lockers;
+    // A mapping from batch index to batch
+    mapping(uint256 => Batch) public batches;
+ 
+    Avatar public avatar;
+    uint256 public reputationRewardLeft; // the amount of reputation that is still left to distribute
+    uint256 public startTime; // the time (in secs since epoch) that locking can start (is enable)
+    uint256 public redeemEnableTime;
+    uint256 public maxLockingBatches;
+    uint256 public batchTime; // the length of a batch, in seconds
+    IERC20 public token; // the token to be locked
+    uint256 public lockCounter; // Total number of locks
+    uint256 public totalLockedLeft; // the amount of reputation  that is still left to distribute
+    uint256 public repRewardConstA;
+    uint256 public repRewardConstB;
+    uint256 public batchesIndexCap;
+ 
+    uint256 constant private REAL_FBITS = 40;
+    /**
+     * What's the first non-fractional bit
+     */
+ 
+    uint256 constant private REAL_ONE = uint256(1) << REAL_FBITS;
+    uint256 constant private BATCHES_INDEX_HARDCAP = 100;
+    uint256 constant public MAX_LOCKING_BATCHES_HARDCAP = 24;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _reputationReward the total amount of reputation that can be minted by this contract
+     * @param _startTime locking period start time, in seconds since epoch
+     * @param _redeemEnableTime redeem enable time
+     * @param _batchTime batch time (in seconds)
+     * @param _redeemEnableTime redeem enable time, in seconds since epoch
+     *        redeem reputation can be done after this time.
+     * @param _maxLockingBatches - maximum number of locking batches that a user can lock (or extend) her tokens for
+     * @param _repRewardConstA - the total amount of reputation allocation per batch is calculated by :
+     *   _repRewardConstA * ((_repRewardConstB/1000) ** batchIndex)
+     * @param _repRewardConstB - the total amount of reputation allocation per batch is calculated by :
+     *   _repRewardConstA * ((_repRewardConstB/1000) ** batchIndex). _repRewardConstB must be < 1000
+     * @param _batchesIndexCap the length of the locking period (in batches).
+     *        This value capped by BATCHES_HARDCAP .
+     * @param _token the locking token
+     * @param _agreementHash is a hash of agreement required to be added to the TX by participants
+     */
+    function initialize(
+        Avatar _avatar,
+        uint256 _reputationReward,
+        uint256 _startTime,
+        uint256 _batchTime,
+        uint256 _redeemEnableTime,
+        uint256 _maxLockingBatches,
+        uint256 _repRewardConstA,
+        uint256 _repRewardConstB,
+        uint256 _batchesIndexCap,
+        IERC20 _token,
+        bytes32 _agreementHash )
+    external
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        // _batchTime should be greater than block interval
+        require(_batchTime > 15, "batchTime should be > 15");
+        Erequire(_maxLockingBatches <= MAX_LOCKING_BATCHES_HARDCAP,
+        "maxLockingBatches should be <= MAX_LOCKING_BATCHES_HARDCAP");
+        require(_redeemEnableTime >= _startTime.add(_batchTime),
+        "_redeemEnableTime >= _startTime+_batchTime");
+        require(_batchesIndexCap <= BATCHES_INDEX_HARDCAP, "_batchesIndexCap > BATCHES_INDEX_HARDCAP");
+        token = _token;
+        avatar = _avatar;
+        startTime = _startTime;
+        reputationRewardLeft = _reputationReward;
+        redeemEnableTime = _redeemEnableTime;
+        maxLockingBatches = _maxLockingBatches;
+        batchTime = _batchTime;
+        Erequire(_repRewardConstB < 1000, "_repRewardConstB should be < 1000");
+        require(_repRewardConstA < _reputationReward, "repRewardConstA should be < _reputationReward");
+        repRewardConstA = toReal(uint216(_repRewardConstA));
+        repRewardConstB = uint216(_repRewardConstB).fraction(uint216(1000));
+        batchesIndexCap = _batchesIndexCap;
+        super.setAgreementHash(_agreementHash);
+    }
+ 
+    /**
+     * @dev redeem reputation function
+     * @param _beneficiary the beneficiary to redeem.
+     * @param _lockingId the lockingId to redeem from.
+     * @return uint256 reputation rewarded
+     */
+    function redeem(address _beneficiary, uint256 _lockingId) public returns(uint256 reputation) {
+        // solhint-disable-next-line not-rely-on-time
+        require(now > redeemEnableTime, "now > redeemEnableTime");
+        Lock storage locker = lockers[_beneficiary][_lockingId];
+        Erequire(locker.lockingTime != 0, "_lockingId does not exist");
+        uint256 batchIndexToRedeemFrom = (locker.lockingTime - startTime) / batchTime;
+        // solhint-disable-next-line not-rely-on-time
+        uint256 currentBatch = (now - startTime) / batchTime;
+        uint256 lastBatchIndexToRedeem =  currentBatch.min(batchIndexToRedeemFrom.add(locker.period));
+        for (batchIndexToRedeemFrom; batchIndexToRedeemFrom < lastBatchIndexToRedeem; batchIndexToRedeemFrom++) {
+            Batch storage locking = batches[batchIndexToRedeemFrom];
+            uint256 score = locking.scores[_lockingId];
+            if (score > 0) {
+                locking.scores[_lockingId] = 0;
+                uint256 batchReputationReward = getRepRewardPerBatch(batchIndexToRedeemFrom);
+                uint256 repRelation = mul(toReal(uint216(score)), batchReputationReward);
+                uint256 redeemForBatch = div(repRelation, toReal(uint216(locking.totalScore)));
+                reputation = reputation.add(redeemForBatch);
+                emit Redeem(_lockingId, _beneficiary, uint256(fromReal(redeemForBatch)), batchIndexToRedeemFrom);
+            }
+        }
+        reputation = uint256(fromReal(reputation));
+        require(reputation > 0, "reputation to redeem is 0");
+        // check that the reputation is sum zero
+        reputationRewardLeft = reputationRewardLeft.sub(reputation);
+        Erequire(
+        Controller(avatar.owner())
+        .mintReputation(reputation, _beneficiary, address(avatar)), "mint reputation should succeed");
+    }
+ 
+    /**
+     * @dev lock function
+     * @param _amount the amount of token to lock
+     * @param _period the number of batches that the tokens will be locked for
+     * @param _batchIndexToLockIn the batch index in which the locking period starts.
+     * Must be the currently active batch.
+     * @return lockingId
+     */
+    function lock(uint256 _amount, uint256 _period, uint256 _batchIndexToLockIn, bytes32 _agreementHash)
+    public
+    onlyAgree(_agreementHash)
+    returns(uint256 lockingId)
+    {
+        require(_amount > 0, "_amount should be > 0");
+        // solhint-disable-next-line not-rely-on-time
+        Erequire(now >= startTime, "locking is not enabled yet (it starts at startTime)");
+        Erequire(_period <= maxLockingBatches, "_period exceed the maximum allowed");
+        Erequire(_period > 0, "_period must be > 0");
+        require((_batchIndexToLockIn.add(_period)) <= batchesIndexCap,
+        "_batchIndexToLockIn + _period exceed max allowed batches");
+        lockCounter = lockCounter.add(1);
+        lockingId = lockCounter;
+ 
+        Lock storage locker = lockers[msg.sender][lockingId];
+        locker.amount = _amount;
+        locker.period = _period;
+        // solhint-disable-next-line not-rely-on-time
+        locker.lockingTime = now;
+ 
+        address(token).safeTransferFrom(msg.sender, address(this), _amount);
+        // solhint-disable-next-line not-rely-on-time
+        uint256 batchIndexToLockIn = (now - startTime) / batchTime;
+        require(batchIndexToLockIn == _batchIndexToLockIn,
+        "_batchIndexToLockIn must be the one corresponding to the current one");
+        //fill in the next batches scores.
+        for (uint256 p = 0; p < _period; p++) {
+            Batch storage batch = batches[batchIndexToLockIn + p];
+            uint256 score = (_period - p).mul(_amount);
+            batch.totalScore = batch.totalScore.add(score);
+            batch.scores[lockingId] = score;
+        }
+ 
+        totalLockedLeft = totalLockedLeft.add(_amount);
+        emit LockToken(msg.sender, lockingId, _amount, _period);
+    }
+ 
+    /**
+     * @dev extendLocking function
+     * @param _extendPeriod the period to extend the locking. in batchTime.
+     * @param _batchIndexToLockIn index of the batch in which to start locking.
+     * @param _lockingId the locking id to extend
+     */
+    function extendLocking(
+        uint256 _extendPeriod,
+        uint256 _batchIndexToLockIn,
+        uint256 _lockingId,
+        bytes32 _agreementHash)
+    public
+    onlyAgree(_agreementHash)
+    {
+        Lock storage locker = lockers[msg.sender][_lockingId];
+        require(locker.lockingTime != 0, "_lockingId does not exist");
+        // remainBatchs is the number of future batches that are part of the currently active lock
+        uint256 remainBatches =
+        ((locker.lockingTime.add(locker.period*batchTime).sub(startTime))/batchTime).sub(_batchIndexToLockIn);
+        uint256 batchesCountFromCurrent = remainBatches.add(_extendPeriod);
+        require(batchesCountFromCurrent <= maxLockingBatches, "locking period exceeds the maximum allowed");
+        Erequire(_extendPeriod > 0, "_extendPeriod must be > 0");
+        Erequire((_batchIndexToLockIn.add(batchesCountFromCurrent)) <= batchesIndexCap,
+        "_extendPeriod exceed max allowed batches");
+        // solhint-disable-next-line not-rely-on-time
+        uint256 batchIndexToLockIn = (now - startTime) / batchTime;
+        Erequire(batchIndexToLockIn == _batchIndexToLockIn, "locking is not active");
+        //fill in the next batch scores.
+        for (uint256 p = 0; p < batchesCountFromCurrent; p++) {
+            Batch storage batch = batches[batchIndexToLockIn + p];
+            uint256 score = (batchesCountFromCurrent - p).mul(locker.amount);
+            batch.totalScore = batch.totalScore.add(score).sub(batch.scores[_lockingId]);
+            batch.scores[_lockingId] = score;
+        }
+        locker.period = locker.period.add(_extendPeriod);
+        emit ExtendLocking(msg.sender, _lockingId, _extendPeriod);
+    }
+ 
+    /**
+     * @dev release function
+     * @param _beneficiary the beneficiary for the release
+     * @param _lockingId the locking id to release
+     * @return bool
+     */
+    function release(address _beneficiary, uint256 _lockingId) public returns(uint256 amount) {
+        Lock storage locker = lockers[_beneficiary][_lockingId];
+        require(locker.amount > 0, "no amount left to unlock");
+        amount = locker.amount;
+        locker.amount = 0;
+        // solhint-disable-next-line not-rely-on-time
+        require(block.timestamp > locker.lockingTime.add(locker.period*batchTime),
+        "locking period is still active");
+        totalLockedLeft = totalLockedLeft.sub(amount);
+        address(token).safeTransfer(_beneficiary, amount);
+        emit Release(_lockingId, _beneficiary, amount);
+    }
+ 
+    /**
+     * @dev getRepRewardPerBatch function
+     * the calculation is done the following formula:
+     * RepReward =  repRewardConstA * (repRewardConstB**_batchIndex)
+     * @param _batchIndex the index of the batch to calc rep reward of
+     * @return repReward
+     */
+    function getRepRewardPerBatch(uint256  _batchIndex) public view returns(uint256 repReward) {
+        if (_batchIndex <= batchesIndexCap) {
+            repReward = mul(repRewardConstA, repRewardConstB.pow(_batchIndex));
+        }
+    }
+ 
+    /**
+     * @dev getLockingIdScore function
+     * return score of lockingId at specific bach index
+     * @param _batchIndex batch index
+     * @param _lockingId lockingId
+     * @return score
+     */
+    function getLockingIdScore(uint256  _batchIndex, uint256 _lockingId) public view returns(uint256) {
+        return batches[_batchIndex].scores[_lockingId];
+    }
+ 
+    /**
+     * Multiply one real by another. Truncates overflows.
+     */
+    function mul(uint256 realA, uint256 realB) private pure returns (uint256) {
+        // When multiplying fixed point in x.y and z.w formats we get (x+z).(y+w) format.
+        // So we just have to clip off the extra REAL_FBITS fractional bits.
+        uint256 res = realA * realB;
+        Erequire(res/realA == realB, "RealMath mul overflow");
+        return (res >> REAL_FBITS);
+    }
+ 
+    /**
+     * Convert an integer to a real. Preserves sign.
+     */
+    function toReal(uint216 ipart) private pure returns (uint256) {
+        return uint256(ipart) * REAL_ONE;
+    }
+ 
+    /**
+     * Convert a real to an integer. Preserves sign.
+     */
+    function fromReal(uint256 _realValue) private pure returns (uint216) {
+        return uint216(_realValue / REAL_ONE);
+    }
+ 
+    /**
+     * Divide one real by another real. Truncates overflows.
+     */
+    function div(uint256 realNumerator, uint256 realDenominator) private pure returns (uint256) {
+        // We use the reverse of the multiplication trick: convert numerator from
+        // x.y to (x+z).(y+w) fixed point, then divide by denom in z.w fixed point.
+        return uint256((uint256(realNumerator) * REAL_ONE) / uint256(realDenominator));
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/ContributionRewardExt.sol.html b/coverage/schemes/ContributionRewardExt.sol.html new file mode 100644 index 00000000..904b2de0 --- /dev/null +++ b/coverage/schemes/ContributionRewardExt.sol.html @@ -0,0 +1,1469 @@ + + + + Code coverage report for schemes/ContributionRewardExt.sol + + + + + + + +
+
+

+ all files / schemes/ ContributionRewardExt.sol +

+
+
+ 98.18% + Statements + 108/110 +
+
+ 69.79% + Branches + 67/96 +
+
+ 90% + Functions + 18/20 +
+
+ 98.18% + Lines + 108/110 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +59× +51× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +36× +34× +34× +34× +34× +34× +34× +  +  +  +  +  +  +  +  +  +  +  +18× +18× +18× +15× +  +18× +18× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +34× +34× +19× +  +34× +34× +34× + +  +34× +19× +  +  +32× +  +  +  +  +  +  +  +  +  +  +  +  +32× +  +32× +  +  +  +  +  +  +  +  +  +  +  +32× +  +  +  +  +  +  +  +  +  +  +  +15× +15× +  +  +  +  +13× + + + +  +  + +  + +  + + +  +  +  + +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  +10× +10× +  +10× +  + + +  +  +10× +  +10× +10× +10× +10× +  +  +  +  +  +  +  +  +  +10× +10× +  +10× + + +  +  +10× +  +10× +10× +10× +10× +  +  +  +  +  +  +  +  +  + + +  +  + + + +  +  +  + + +  + + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +  +  +12× +  +  +10× +  +  +10× +10× +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +13× +  +  +13× +  +  +  +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +13× +  +  +13× +  +  +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  +13× +13× +  +  +13× +  +  +  +11× +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +18× +15× +  +  +16× +10× +  +  +16× +10× +  +  +16× + +  +  +  +  + +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+import "../libs/SafeERC20.sol";
+ 
+ 
+/**
+ * @title A scheme for proposing and rewarding contributions to an organization
+ * @dev An agent can ask an organization to recognize a contribution and reward
+ * him with token, reputation, ether or any combination.
+ * This scheme extend the functionality of the ContributionReward scheme.
+ * It enable to assign a rewarder, which, after the contributionreward has been accepted,
+ * can then later distribute the assets as it would like.
+ */
+contract ContributionRewardExt is VotingMachineCallbacks, ProposalExecuteInterface {
+    using SafeMath for uint;
+    using SafeERC20 for address;
+ 
+    event NewContributionProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        string _descriptionHash,
+        int256 _reputationChange,
+        uint[3]  _rewards,
+        IERC20 _externalToken,
+        address _beneficiary,
+        address _proposer
+    );
+ 
+    event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param);
+ 
+    event RedeemReputation(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        int256 _amount);
+ 
+    event RedeemEther(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        uint256 _amount);
+ 
+    event RedeemNativeToken(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        uint256 _amount);
+ 
+    event RedeemExternalToken(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        uint256 _amount);
+ 
+    // A struct holding the data for a contribution proposal
+    struct ContributionProposal {
+        uint256 nativeTokenReward; // Reward asked in the native token of the organization.
+        int256 reputationChange; // Organization reputation reward requested.
+        uint256 ethReward;
+        IERC20 externalToken;
+        uint256 externalTokenReward;
+        address payable beneficiary;
+        uint256 nativeTokenRewardLeft;
+        uint256 reputationChangeLeft;
+        uint256 ethRewardLeft;
+        uint256 externalTokenRewardLeft;
+        bool acceptedByVotingMachine;
+    }
+ 
+    modifier onlyRewarder() {
+        require(msg.sender == rewarder, "msg.sender is not authorized");
+        _;
+    }
+ 
+    mapping(bytes32=>ContributionProposal) public organizationProposals;
+ 
+    IntVoteInterface public votingMachine;
+    bytes32 public voteParams;
+    Avatar public avatar;
+    address public rewarder;
+ 
+    /**
+    * @dev enables this contract to receive ethers
+    */
+    function() external payable {
+    }
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _votingMachine the voting machines address
+     * @param _voteParams voting machine parameters
+     * @param _rewarder an address which allowed to redeem the contribution.
+       if _rewarder is 0 this param is agnored.
+     */
+    function initialize(
+        Avatar _avatar,
+        IntVoteInterface _votingMachine,
+        bytes32 _voteParams,
+        address _rewarder
+    )
+    external
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        Erequire(_votingMachine != IntVoteInterface(0), "votingMachine cannot be zero");
+        avatar = _avatar;
+        votingMachine = _votingMachine;
+        voteParams = _voteParams;
+        rewarder = _rewarder;
+    }
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the proposal in the voting machine
+    * @param _decision a parameter of the voting result, 1 yes and 2 is no.
+    */
+    function executeProposal(bytes32 _proposalId, int256 _decision)
+    external
+    onlyVotingMachine(_proposalId)
+    returns(bool) {
+        Erequire(organizationProposals[_proposalId].acceptedByVotingMachine == false);
+        Erequire(organizationProposals[_proposalId].beneficiary != address(0));
+        if (_decision == 1) {
+            organizationProposals[_proposalId].acceptedByVotingMachine = true;
+        }
+        emit ProposalExecuted(address(avatar), _proposalId, _decision);
+        return true;
+    }
+ 
+    /**
+    * @dev Submit a proposal for a reward for a contribution:
+    * @param _descriptionHash A hash of the proposal's description
+    * @param _reputationChange - Amount of reputation change requested .Can be negative.
+    * @param _rewards rewards array:
+    *         rewards[0] - Amount of tokens requested
+    *         rewards[1] - Amount of ETH requested
+    *         rewards[2] - Amount of external tokens
+    * @param _externalToken Address of external token, if reward is requested there
+    * @param _beneficiary Who gets the rewards. if equal to 0 the beneficiary will be msg.sender.
+    * @param _proposer proposer . if equal to 0 the proposer will be msg.sender.
+    */
+    function proposeContributionReward(
+        string memory _descriptionHash,
+        int256 _reputationChange,
+        uint[3] memory _rewards,
+        IERC20 _externalToken,
+        address payable _beneficiary,
+        address _proposer
+    )
+    public
+    returns(bytes32 proposalId)
+    {
+        address proposer = _proposer;
+        if (proposer == address(0)) {
+            proposer = msg.sender;
+        }
+        proposalId = votingMachine.propose(2, voteParams, proposer, address(avatar));
+        address payable beneficiary = _beneficiary;
+        if (beneficiary == address(0)) {
+            beneficiary = msg.sender;
+        }
+        if (beneficiary == address(this)) {
+            require(_reputationChange >= 0, "negative rep change not allowed for this case");
+        }
+ 
+        ContributionProposal memory proposal = ContributionProposal({
+            nativeTokenReward: _rewards[0],
+            reputationChange: _reputationChange,
+            ethReward: _rewards[1],
+            externalToken: _externalToken,
+            externalTokenReward: _rewards[2],
+            beneficiary: beneficiary,
+            nativeTokenRewardLeft: 0,
+            reputationChangeLeft: 0,
+            ethRewardLeft: 0,
+            externalTokenRewardLeft: 0,
+            acceptedByVotingMachine: false
+        });
+        organizationProposals[proposalId] = proposal;
+ 
+        emit NewContributionProposal(
+            address(avatar),
+            proposalId,
+            address(votingMachine),
+            _descriptionHash,
+            _reputationChange,
+            _rewards,
+            _externalToken,
+            beneficiary,
+            proposer
+        );
+ 
+        proposalsInfo[address(votingMachine)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:avatar
+        });
+    }
+ 
+    /**
+    * @dev RedeemReputation reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @return reputation the redeemed reputation.
+    */
+    function redeemReputation(bytes32 _proposalId) public returns(int256 reputation) {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        require(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+ 
+        //if the beneficiary is the current contract, we are not minting the rep to it
+        //but instead refer to a mechanism in which the rep can be minted by the current contract
+        //per request of the rewarder
+        if (proposal.beneficiary == address(this)) {
+            Eif (proposal.reputationChangeLeft == 0) {//for now only mint(not burn) rep allowed from ext contract.
+                proposal.reputationChangeLeft = uint256(proposal.reputationChange);
+                proposal.reputationChange = 0;
+            }
+        } else {
+            reputation = proposal.reputationChange;
+            //set proposal reward to zero to prevent reentrancy attack.
+            proposal.reputationChange = 0;
+ 
+            if (reputation > 0) {
+                Erequire(
+                Controller(
+                avatar.owner()).mintReputation(uint(reputation), proposal.beneficiary, address(avatar)));
+            } else if (reputation < 0) {
+                Erequire(
+                Controller(
+                avatar.owner()).burnReputation(uint(reputation*(-1)), proposal.beneficiary, address(avatar)));
+            }
+            if (reputation != 0) {
+                emit RedeemReputation(address(avatar), _proposalId, proposal.beneficiary, reputation);
+            }
+        }
+    }
+ 
+    /**
+    * @dev RedeemNativeToken reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @return amount the redeemed nativeToken.
+    */
+    function redeemNativeToken(bytes32 _proposalId) public returns(uint256 amount) {
+ 
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+ 
+        if (proposal.beneficiary == address(this)) {
+            //ensure nativeTokenRewardLeft can be set only one time
+            Eif (proposal.nativeTokenRewardLeft == 0) {
+                proposal.nativeTokenRewardLeft = proposal.nativeTokenReward;
+            }
+        }
+        amount = proposal.nativeTokenReward;
+        //set proposal rewards to zero to prevent reentrancy attack.
+        proposal.nativeTokenReward = 0;
+        Eif (amount > 0) {
+            Erequire(Controller(avatar.owner()).mintTokens(amount, proposal.beneficiary, address(avatar)));
+            emit RedeemNativeToken(address(avatar), _proposalId, proposal.beneficiary, amount);
+        }
+    }
+ 
+    /**
+    * @dev RedeemEther reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @return amount ether redeemed amount
+    */
+    function redeemEther(bytes32 _proposalId) public returns(uint256 amount) {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+ 
+        if (proposal.beneficiary == address(this)) {
+            Eif (proposal.ethRewardLeft == 0) {
+                proposal.ethRewardLeft = proposal.ethReward;
+            }
+        }
+        amount = proposal.ethReward;
+        //set proposal rewards to zero to prevent reentrancy attack.
+        proposal.ethReward = 0;
+        Eif (amount > 0) {
+            Erequire(Controller(avatar.owner()).sendEther(amount, proposal.beneficiary, avatar));
+            emit RedeemEther(address(avatar), _proposalId, proposal.beneficiary, amount);
+        }
+    }
+ 
+    /**
+    * @dev RedeemNativeToken reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @return amount the external token redeemed amount
+    */
+    function redeemExternalToken(bytes32 _proposalId) public returns(uint256 amount) {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+ 
+ 
+        if (proposal.beneficiary == address(this)) {
+            Eif (proposal.externalTokenRewardLeft == 0) {
+                proposal.externalTokenRewardLeft = proposal.externalTokenReward;
+            }
+        }
+ 
+        Eif (proposal.externalToken != IERC20(0) && proposal.externalTokenReward > 0) {
+            amount = proposal.externalTokenReward;
+            //set proposal rewards to zero to prevent reentrancy attack.
+            proposal.externalTokenReward = 0;
+            Erequire(
+            Controller(
+            avatar.owner())
+            .externalTokenTransfer(proposal.externalToken, proposal.beneficiary, amount, avatar));
+            emit RedeemExternalToken(address(avatar), _proposalId, proposal.beneficiary, amount);
+        }
+    }
+ 
+    /**
+    * @dev redeemReputationByRewarder redeem reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _beneficiary the beneficiary to mint reputation to.
+    * @param _reputation the reputation amount to mint
+    *        note: burn reputation is not supported via this function
+    */
+    function redeemReputationByRewarder(bytes32 _proposalId, address _beneficiary, uint256 _reputation)
+    public
+    onlyRewarder
+    {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+        //this will ensure sum zero of reputation
+        //and that there was a privious call to redeemReputation function.
+        proposal.reputationChangeLeft =
+        proposal.reputationChangeLeft.sub(_reputation,
+        "cannot redeem more reputation than allocated for this proposal or no redeemReputation was called");
+        Erequire(
+        Controller(
+        avatar.owner()).mintReputation(_reputation, _beneficiary, address(avatar)));
+        Eif (_reputation != 0) {
+            emit RedeemReputation(address(avatar), _proposalId, _beneficiary, int256(_reputation));
+        }
+    }
+ 
+    /**
+    * @dev redeemNativeTokenByRewarder redeem reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _beneficiary the beneficiary to mint tokens to.
+    * @param _amount the tokens amount to mint
+    */
+    function redeemNativeTokenByRewarder(bytes32 _proposalId, address _beneficiary, uint256 _amount)
+    public
+    onlyRewarder
+    {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+        //this will ensure sum zero of reputation
+        //and that there was a privious call to redeemNativeToken function.
+        proposal.nativeTokenRewardLeft =
+        proposal.nativeTokenRewardLeft.sub(_amount,
+        "cannot redeem more tokens than allocated for this proposal or no redeemNativeToken was called");
+ 
+        Eif (_amount > 0) {
+            address(avatar.nativeToken()).safeTransfer(_beneficiary, _amount);
+            emit RedeemNativeToken(address(avatar), _proposalId, _beneficiary, _amount);
+        }
+    }
+ 
+    /**
+    * @dev redeemEtherByRewarder redeem reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _beneficiary the beneficiary to send eth to.
+    * @param _amount eth amount to send
+    */
+    function redeemEtherByRewarder(bytes32 _proposalId, address payable _beneficiary, uint256 _amount)
+    public
+    onlyRewarder
+    {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+        //this will ensure sum zero of reputation.
+        //and that there was a privious call to redeemEther function.
+        proposal.ethRewardLeft = proposal.ethRewardLeft.sub(_amount,
+        "cannot redeem more Ether than allocated for this proposal or no redeemEther was called");
+ 
+        Eif (_amount > 0) {
+            _beneficiary.transfer(_amount);
+            emit RedeemEther(address(avatar), _proposalId, _beneficiary, _amount);
+        }
+    }
+ 
+    /**
+    * @dev redeemExternalTokenByRewarder redeem reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _beneficiary the beneficiary to send the external token to.
+    * @param _amount the amount of external token to send
+    */
+    function redeemExternalTokenByRewarder(bytes32 _proposalId, address _beneficiary, uint256 _amount)
+    public
+    onlyRewarder {
+        ContributionProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.acceptedByVotingMachine, "proposal was not accepted by the voting machine");
+        //this will ensure sum zero of reputation.
+        //and that there was a privious call to redeemExternalToken function.
+        proposal.externalTokenRewardLeft =
+        proposal.externalTokenRewardLeft.sub(_amount,
+        "cannot redeem more tokens than allocated for this proposal or no redeemExternalToken was called");
+ 
+        Eif (proposal.externalToken != IERC20(0)) {
+            Eif (_amount > 0) {
+                address(proposal.externalToken).safeTransfer(_beneficiary, _amount);
+                emit RedeemExternalToken(address(avatar), _proposalId, _beneficiary, _amount);
+            }
+        }
+    }
+ 
+    /**
+    * @dev redeem rewards for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _whatToRedeem whatToRedeem array of boolean values:
+    *         whatToRedeem[0] - reputation
+    *         whatToRedeem[1] - nativeTokenReward
+    *         whatToRedeem[2] - Ether
+    *         whatToRedeem[3] - ExternalToken
+    * @return  result boolean array for each redeem type.
+    */
+    function redeem(bytes32 _proposalId, bool[4] memory _whatToRedeem)
+    public
+    returns(int256 reputationReward, uint256 nativeTokenReward, uint256 etherReward, uint256 externalTokenReward)
+    {
+ 
+        if (_whatToRedeem[0]) {
+            reputationReward = redeemReputation(_proposalId);
+        }
+ 
+        if (_whatToRedeem[1]) {
+            nativeTokenReward = redeemNativeToken(_proposalId);
+        }
+ 
+        if (_whatToRedeem[2]) {
+            etherReward = redeemEther(_proposalId);
+        }
+ 
+        if (_whatToRedeem[3]) {
+            externalTokenReward = redeemExternalToken(_proposalId);
+        }
+    }
+ 
+    function getProposalEthReward(bytes32 _proposalId) public view returns (uint256) {
+        return organizationProposals[_proposalId].ethReward;
+    }
+ 
+    function getProposalExternalTokenReward(bytes32 _proposalId) public view returns (uint256) {
+        return organizationProposals[_proposalId].externalTokenReward;
+    }
+ 
+    function getProposalExternalToken(bytes32 _proposalId) public view returns (address) {
+        return address(organizationProposals[_proposalId].externalToken);
+    }
+ 
+    function getProposalReputationReward(bytes32 _proposalId) public view returns (int256) {
+        return organizationProposals[_proposalId].reputationChange;
+    }
+ 
+    function getProposalNativeTokenReward(bytes32 _proposalId) public view returns (uint256) {
+        return organizationProposals[_proposalId].nativeTokenReward;
+    }
+ 
+    function getProposalAcceptedByVotingMachine(bytes32 _proposalId) public view returns (bool) {
+        return organizationProposals[_proposalId].acceptedByVotingMachine;
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/CurveInterface.sol.html b/coverage/schemes/CurveInterface.sol.html new file mode 100644 index 00000000..f0ba6db2 --- /dev/null +++ b/coverage/schemes/CurveInterface.sol.html @@ -0,0 +1,86 @@ + + + + Code coverage report for schemes/CurveInterface.sol + + + + + + + +
+
+

+ all files / schemes/ CurveInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8  +  +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+interface CurveInterface {
+ 
+    function calc(uint) external pure returns (uint);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/ExternalLocking4Reputation.sol.html b/coverage/schemes/ExternalLocking4Reputation.sol.html new file mode 100644 index 00000000..a7f70bdc --- /dev/null +++ b/coverage/schemes/ExternalLocking4Reputation.sol.html @@ -0,0 +1,353 @@ + + + + Code coverage report for schemes/ExternalLocking4Reputation.sol + + + + + + + +
+
+

+ all files / schemes/ ExternalLocking4Reputation.sol +

+
+
+ 100% + Statements + 18/18 +
+
+ 83.33% + Branches + 10/12 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 19/19 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +23× +23× +23× +23× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +24× +22× +22× +19× +  + + +  +20× +18× +18× +  +  +18× +18× +  +18× +  +  +18× +  +  +  +  +  +  +  + + +  +  + 
pragma solidity 0.5.17;
+ 
+import "./Locking4Reputation.sol";
+ 
+/**
+ * @title A scheme for external locking Tokens for reputation
+ */
+ 
+contract ExternalLocking4Reputation is Locking4Reputation {
+ 
+    event Register(address indexed _beneficiary);
+ 
+    address public externalLockingContract;
+    string public getBalanceFuncSignature;
+ 
+    // locker -> bool
+    mapping(address => bool) public externalLockers;
+    //      beneficiary -> bool
+    mapping(address     => bool) public registrar;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _reputationReward the total reputation this contract will reward
+     *        for the token locking
+     * @param _claimingStartTime claiming starting period time.
+     * @param _claimingEndTime the claiming end time.
+     *        claiming is disable after this time.
+     * @param _redeemEnableTime redeem enable time .
+     *        redeem reputation can be done after this time.
+     * @param _externalLockingContract the contract which lock the token.
+     * @param _getBalanceFuncSignature get balance function signature
+     *        e.g "lockedTokenBalances(address)"
+     */
+    function initialize(
+        Avatar _avatar,
+        uint256 _reputationReward,
+        uint256 _claimingStartTime,
+        uint256 _claimingEndTime,
+        uint256 _redeemEnableTime,
+        address _externalLockingContract,
+        string calldata _getBalanceFuncSignature,
+        bytes32 _agreementHash)
+    external
+    {
+        Erequire(_claimingEndTime > _claimingStartTime, "_claimingEndTime should be greater than _claimingStartTime");
+        externalLockingContract = _externalLockingContract;
+        getBalanceFuncSignature = _getBalanceFuncSignature;
+        super._initialize(
+        _avatar,
+        _reputationReward,
+        _claimingStartTime,
+        _claimingEndTime,
+        _redeemEnableTime,
+        1,
+        _agreementHash);
+    }
+ 
+    /**
+     * @dev claim function
+     * @param _beneficiary the beneficiary address to claim for
+     *        if _beneficiary == 0 the claim will be for the msg.sender.
+     * @return claimId
+     */
+    function claim(address _beneficiary, bytes32 _agreementHash) public returns(bytes32) {
+        require(avatar != Avatar(0), "should initialize first");
+        address beneficiary;
+        if (_beneficiary == address(0)) {
+            beneficiary = msg.sender;
+        } else {
+            require(registrar[_beneficiary], "beneficiary should be register");
+            beneficiary = _beneficiary;
+        }
+        require(externalLockers[beneficiary] == false, "claiming twice for the same beneficiary is not allowed");
+        externalLockers[beneficiary] = true;
+        (bool result, bytes memory returnValue) =
+        // solhint-disable-next-line avoid-call-value,avoid-low-level-calls
+        externalLockingContract.call(abi.encodeWithSignature(getBalanceFuncSignature, beneficiary));
+        Erequire(result, "call to external contract should succeed");
+        uint256 lockedAmount;
+        // solhint-disable-next-line no-inline-assembly
+        assembly {
+            lockedAmount := mload(add(returnValue, 0x20))
+        }
+        return super._lock(lockedAmount, 1, beneficiary, 1, 1, _agreementHash);
+    }
+ 
+   /**
+    * @dev register function
+    *      register for external locking claim
+    */
+    function register(bytes32 _agreementHash) public onlyAgree(_agreementHash) {
+        registrar[msg.sender] = true;
+        emit Register(msg.sender);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/FixedReputationAllocation.sol.html b/coverage/schemes/FixedReputationAllocation.sol.html new file mode 100644 index 00000000..46391248 --- /dev/null +++ b/coverage/schemes/FixedReputationAllocation.sol.html @@ -0,0 +1,353 @@ + + + + Code coverage report for schemes/FixedReputationAllocation.sol + + + + + + + +
+
+

+ all files / schemes/ FixedReputationAllocation.sol +

+
+
+ 100% + Statements + 20/20 +
+
+ 81.25% + Branches + 13/16 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 21/21 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +14× +12× +12× +12× +12× +  +  +  +  +  +  +  +  +31× +29× +25× +  +25× +23× +  +  +  +  +21× +  +21× +  +  +  +  +  +  +  +63× +  +63× +63× +63× +  +63× +  +  +  +  +  +  +  +  + +60× +  +  +  +  +  +  +  + +  + +  +  + 
pragma solidity 0.5.17;
+ 
+import "../controller/Controller.sol";
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+ 
+ 
+/**
+ * @title A fixed reputation allocation contract
+ * This scheme can be used to allocate a pre define amount of reputation to whitelisted
+ * beneficiaries.
+ */
+contract FixedReputationAllocation is Ownable {
+    using SafeMath for uint256;
+ 
+    event Redeem(address indexed _beneficiary, uint256 _amount);
+    event BeneficiaryAddressAdded(address indexed _beneficiary);
+ 
+    // beneficiary -> exist
+    mapping(address => bool) public beneficiaries;
+ 
+    Avatar public avatar;
+    uint256 public reputationReward;
+    bool public isEnable;
+    uint256 public numberOfBeneficiaries;
+    uint256 public beneficiaryReward;
+    uint256 public redeemEnableTime;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _reputationReward the total reputation this contract will reward
+     * @param _redeemEnableTime time to enable redeem
+     */
+    function initialize(Avatar _avatar, uint256 _reputationReward, uint256 _redeemEnableTime) external onlyOwner {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        reputationReward = _reputationReward;
+        redeemEnableTime = _redeemEnableTime;
+        avatar = _avatar;
+    }
+ 
+    /**
+     * @dev redeem reputation function
+     * @param _beneficiary the beneficiary for the release
+     * @return bool
+     */
+    function redeem(address _beneficiary) public returns(bool) {
+        require(isEnable, "require to be enable");
+        require(beneficiaries[_beneficiary], "require _beneficiary to exist in the beneficiaries map");
+        beneficiaries[_beneficiary] = false;
+        // solhint-disable-next-line not-rely-on-time
+        require(now > redeemEnableTime, "require now > redeemEnableTime");
+        require(
+        Controller(
+        avatar.owner())
+        .mintReputation(beneficiaryReward, _beneficiary, address(avatar)), "mint reputation failed");
+ 
+        emit Redeem(_beneficiary, beneficiaryReward);
+ 
+        return true;
+    }
+ 
+    /**
+     * @dev addBeneficiary function
+     * @param _beneficiary to be whitelisted
+     */
+    function addBeneficiary(address _beneficiary) public onlyOwner {
+        Erequire(!isEnable, "can add beneficiary only if not already enable");
+ 
+        Eif (!beneficiaries[_beneficiary]) {
+            beneficiaries[_beneficiary] = true;
+            numberOfBeneficiaries++;
+ 
+            emit BeneficiaryAddressAdded(_beneficiary);
+        }
+    }
+ 
+    /**
+     * @dev add addBeneficiaries function
+     * @param _beneficiaries addresses
+     */
+    function addBeneficiaries(address[] memory _beneficiaries) public onlyOwner {
+        for (uint256 i = 0; i < _beneficiaries.length; i++) {
+            addBeneficiary(_beneficiaries[i]);
+        }
+    }
+ 
+    /**
+     * @dev enable function
+     */
+    function enable() public onlyOwner {
+        isEnable = true;
+        // Calculate beneficiary reward
+        beneficiaryReward = reputationReward.div(numberOfBeneficiaries);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/Forwarder.sol.html b/coverage/schemes/Forwarder.sol.html new file mode 100644 index 00000000..121d8221 --- /dev/null +++ b/coverage/schemes/Forwarder.sol.html @@ -0,0 +1,215 @@ + + + + Code coverage report for schemes/Forwarder.sol + + + + + + + +
+
+

+ all files / schemes/ Forwarder.sol +

+
+
+ 100% + Statements + 9/9 +
+
+ 80% + Branches + 8/10 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 9/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + + +  +  +  +  +  +  +  +  +12× +10× +10× +10× +  +  +  +  +  +  +  +  + + +  +  + 
pragma solidity 0.5.17;
+ 
+import "../controller/Controller.sol";
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+ 
+/**
+ * @title A scheme to forward a call to a dao.
+ *        The scheme can unregister itself when its expirationTime reached.
+ */
+ 
+ 
+contract Forwarder is Ownable {
+ 
+    Avatar public avatar;
+    uint256 public expirationTime;
+ 
+    /**
+     * @dev forwardCall forward a call to the dao controller
+     */
+    // solhint-disable-next-line no-complex-fallback,payable-fallback
+    function () external onlyOwner {
+        // solhint-disable-next-line not-rely-on-time
+        require(expirationTime > now, "expirationTime > now");
+        // solhint-disable-next-line avoid-low-level-calls
+        (bool result,) = avatar.owner().call(msg.data);
+        Erequire(result);
+    }
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar of the dao to forward the call to
+     * @param _expirationTime the expirationTime to forwardCall
+     */
+    function initialize(Avatar _avatar, uint256 _expirationTime) external onlyOwner {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        avatar = _avatar;
+        expirationTime = _expirationTime;
+    }
+ 
+    /**
+     * @dev unregisterSelf function
+     * @return bool
+     */
+    function unregisterSelf() public returns(bool) {
+       // solhint-disable-next-line not-rely-on-time
+        require(expirationTime <= now, "expirationTime <= now");
+        return Controller(avatar.owner()).unregisterSelf(address(avatar));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/GenericScheme.sol.html b/coverage/schemes/GenericScheme.sol.html new file mode 100644 index 00000000..8e8045af --- /dev/null +++ b/coverage/schemes/GenericScheme.sol.html @@ -0,0 +1,518 @@ + + + + Code coverage report for schemes/GenericScheme.sol + + + + + + + +
+
+

+ all files / schemes/ GenericScheme.sol +

+
+
+ 100% + Statements + 32/32 +
+
+ 81.25% + Branches + 13/16 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 34/34 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +11× +11× +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + + + +  + + +  +  + + +  +  +  +  +  +  +  +14× +14× +12× +10× +10× +10× +10× +10× +  +10× + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +  +10× +  +  +  +  +  +10× +  +  +  +10× +10× +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+/**
+ * @title GenericScheme.
+ * @dev  A scheme for proposing and executing calls to an arbitrary function
+ * on a specific contract on behalf of the organization avatar.
+ */
+contract GenericScheme is VotingMachineCallbacks, ProposalExecuteInterface {
+    event NewCallProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        bytes   _callData,
+        uint256 _value,
+        string  _descriptionHash
+    );
+ 
+    event ProposalExecuted(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        bytes _genericCallReturnValue
+    );
+ 
+    event ProposalExecutedByVotingMachine(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        int256 _param
+    );
+ 
+    event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId);
+ 
+    // Details of a voting proposal:
+    struct CallProposal {
+        bytes callData;
+        uint256 value;
+        bool exist;
+        bool passed;
+    }
+ 
+    mapping(bytes32=>CallProposal) public organizationProposals;
+ 
+    IntVoteInterface public votingMachine;
+    bytes32 public voteParams;
+    address public contractToCall;
+    Avatar public avatar;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _votingMachine the voting machines address to
+     * @param _voteParams voting machine parameters.
+     * @param _contractToCall the target contract this scheme will call to
+     */
+    function initialize(
+        Avatar _avatar,
+        IntVoteInterface _votingMachine,
+        bytes32 _voteParams,
+        address _contractToCall
+    )
+    external
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        avatar = _avatar;
+        votingMachine = _votingMachine;
+        voteParams = _voteParams;
+        contractToCall = _contractToCall;
+    }
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _decision a parameter of the voting result, 1 yes and 2 is no.
+    * @return bool success
+    */
+    function executeProposal(bytes32 _proposalId, int256 _decision)
+    external
+    onlyVotingMachine(_proposalId)
+    returns(bool) {
+        CallProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.exist, "must be a live proposal");
+        Erequire(proposal.passed == false, "cannot execute twice");
+ 
+        if (_decision == 1) {
+            proposal.passed = true;
+            execute(_proposalId);
+        } else {
+            delete organizationProposals[_proposalId];
+            emit ProposalDeleted(address(avatar), _proposalId);
+        }
+ 
+        emit ProposalExecutedByVotingMachine(address(avatar), _proposalId, _decision);
+        return true;
+    }
+ 
+    /**
+    * @dev execution of proposals after it has been decided by the voting machine
+    * @param _proposalId the ID of the voting in the voting machine
+    */
+    function execute(bytes32 _proposalId) public {
+        CallProposal storage proposal = organizationProposals[_proposalId];
+        require(proposal.exist, "must be a live proposal");
+        require(proposal.passed, "proposal must passed by voting machine");
+        proposal.exist = false;
+        bytes memory genericCallReturnValue;
+        bool success;
+        Controller controller = Controller(avatar.owner());
+        (success, genericCallReturnValue) =
+        controller.genericCall(contractToCall, proposal.callData, avatar, proposal.value);
+        if (success) {
+            delete organizationProposals[_proposalId];
+            emit ProposalDeleted(address(avatar), _proposalId);
+            emit ProposalExecuted(address(avatar), _proposalId, genericCallReturnValue);
+        } else {
+            proposal.exist = true;
+        }
+    }
+ 
+    /**
+    * @dev propose to call on behalf of the _avatar
+    *      The function trigger NewCallProposal event
+    * @param _callData - The abi encode data for the call
+    * @param _value value(ETH) to transfer with the call
+    * @param _descriptionHash proposal description hash
+    * @return an id which represents the proposal
+    */
+    function proposeCall(bytes memory _callData, uint256 _value, string memory _descriptionHash)
+    public
+    returns(bytes32)
+    {
+        bytes32 proposalId = votingMachine.propose(2, voteParams, msg.sender, address(avatar));
+ 
+        organizationProposals[proposalId] = CallProposal({
+            callData: _callData,
+            value: _value,
+            exist: true,
+            passed: false
+        });
+        proposalsInfo[address(votingMachine)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:avatar
+        });
+        emit NewCallProposal(address(avatar), proposalId, _callData, _value, _descriptionHash);
+        return proposalId;
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/Locking4Reputation.sol.html b/coverage/schemes/Locking4Reputation.sol.html new file mode 100644 index 00000000..4c795511 --- /dev/null +++ b/coverage/schemes/Locking4Reputation.sol.html @@ -0,0 +1,566 @@ + + + + Code coverage report for schemes/Locking4Reputation.sol + + + + + + + +
+
+

+ all files / schemes/ Locking4Reputation.sol +

+
+
+ 100% + Statements + 46/46 +
+
+ 87.5% + Branches + 28/32 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 46/46 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +37× +25× +19× +19× +19× +19× +  +  +19× +19× +  +  +  +  +19× +  +  +  +  +  +  +  +  +  +13× +13× + + +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +64× +58× +54× +  +48× +  +42× +  +38× +38× +  +38× +38× +  +38× +38× +38× +38× +38× +38× +  +38× +  +37× +  +37× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +75× +69× +69× +69× +  +63× +63× +63× +63× +63× +63× +63× +63× +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "../controller/Controller.sol";
+import "./Agreement.sol";
+ 
+/**
+ * @title A locker contract
+ */
+ 
+contract Locking4Reputation is Agreement {
+    using SafeMath for uint256;
+ 
+    event Redeem(address indexed _beneficiary, uint256 _amount);
+    event Release(bytes32 indexed _lockingId, address indexed _beneficiary, uint256 _amount);
+    event Lock(address indexed _locker, bytes32 indexed _lockingId, uint256 _amount, uint256 _period);
+ 
+    struct Locker {
+        uint256 amount;
+        uint256 releaseTime;
+    }
+ 
+    Avatar public avatar;
+ 
+    // A mapping from lockers addresses their lock balances.
+    mapping(address => mapping(bytes32=>Locker)) public lockers;
+    // A mapping from lockers addresses to their scores.
+    mapping(address => uint) public scores;
+ 
+    uint256 public totalLocked;
+    uint256 public totalLockedLeft;
+    uint256 public totalScore;
+    uint256 public lockingsCounter; // Total number of lockings
+    uint256 public reputationReward;
+    uint256 public reputationRewardLeft;
+    uint256 public lockingEndTime;
+    uint256 public maxLockingPeriod;
+    uint256 public lockingStartTime;
+    uint256 public redeemEnableTime;
+ 
+    /**
+     * @dev redeem reputation function
+     * @param _beneficiary the beneficiary for the release
+     * @return uint256 reputation rewarded
+     */
+    function redeem(address _beneficiary) public returns(uint256 reputation) {
+        // solhint-disable-next-line not-rely-on-time
+        require(block.timestamp > redeemEnableTime, "now > redeemEnableTime");
+        require(scores[_beneficiary] > 0, "score should be > 0");
+        uint256 score = scores[_beneficiary];
+        scores[_beneficiary] = 0;
+        uint256 repRelation = score.mul(reputationReward);
+        reputation = repRelation.div(totalScore);
+ 
+        //check that the reputation is sum zero
+        reputationRewardLeft = reputationRewardLeft.sub(reputation);
+        Erequire(
+        Controller(
+        avatar.owner())
+        .mintReputation(reputation, _beneficiary, address(avatar)), "mint reputation should succeed");
+ 
+        emit Redeem(_beneficiary, reputation);
+    }
+ 
+    /**
+     * @dev release function
+     * @param _beneficiary the beneficiary for the release
+     * @param _lockingId the locking id to release
+     * @return bool
+     */
+    function _release(address _beneficiary, bytes32 _lockingId) internal returns(uint256 amount) {
+        Locker storage locker = lockers[_beneficiary][_lockingId];
+        require(locker.amount > 0, "amount should be > 0");
+        amount = locker.amount;
+        locker.amount = 0;
+        // solhint-disable-next-line not-rely-on-time
+        require(block.timestamp > locker.releaseTime, "check the lock period pass");
+        totalLockedLeft = totalLockedLeft.sub(amount);
+ 
+        emit Release(_lockingId, _beneficiary, amount);
+    }
+ 
+    /**
+     * @dev lock function
+     * @param _amount the amount to lock
+     * @param _period the locking period
+     * @param _locker the locker
+     * @param _numerator price numerator
+     * @param _denominator price denominator
+     * @return lockingId
+     */
+    function _lock(
+        uint256 _amount,
+        uint256 _period,
+        address _locker,
+        uint256 _numerator,
+        uint256 _denominator,
+        bytes32 _agreementHash)
+        internal
+        onlyAgree(_agreementHash)
+        returns(bytes32 lockingId)
+        {
+        require(_amount > 0, "locking amount should be > 0");
+        require(_period <= maxLockingPeriod, "locking period should be <= maxLockingPeriod");
+        require(_period > 0, "locking period should be > 0");
+        // solhint-disable-next-line not-rely-on-time
+        require(now <= lockingEndTime, "lock should be within the allowed locking period");
+        // solhint-disable-next-line not-rely-on-time
+        require(now >= lockingStartTime, "lock should start after lockingStartTime");
+ 
+        lockingId = keccak256(abi.encodePacked(address(this), lockingsCounter));
+        lockingsCounter = lockingsCounter.add(1);
+ 
+        Locker storage locker = lockers[_locker][lockingId];
+        locker.amount = _amount;
+        // solhint-disable-next-line not-rely-on-time
+        locker.releaseTime = now + _period;
+        totalLocked = totalLocked.add(_amount);
+        totalLockedLeft = totalLockedLeft.add(_amount);
+        uint256 score = _period.mul(_amount).mul(_numerator).div(_denominator);
+        Erequire(score > 0, "score must me > 0");
+        scores[_locker] = scores[_locker].add(score);
+        //verify that redeem will not overflow for this locker
+        require((scores[_locker] * reputationReward)/scores[_locker] == reputationReward,
+        "score is too high");
+        totalScore = totalScore.add(score);
+ 
+        emit Lock(_locker, lockingId, _amount, _period);
+    }
+ 
+    /**
+     * @dev _initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _reputationReward the total reputation this contract will reward
+     *        for eth/token locking
+     * @param _lockingStartTime the locking start time.
+     * @param _lockingEndTime the locking end time.
+     *        locking is disable after this time.
+     * @param _redeemEnableTime redeem enable time .
+     *        redeem reputation can be done after this time.
+     * @param _maxLockingPeriod maximum locking period allowed.
+     */
+    function _initialize(
+        Avatar _avatar,
+        uint256 _reputationReward,
+        uint256 _lockingStartTime,
+        uint256 _lockingEndTime,
+        uint256 _redeemEnableTime,
+        uint256 _maxLockingPeriod,
+        bytes32 _agreementHash )
+    internal
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        Erequire(_lockingEndTime > _lockingStartTime, "locking end time should be greater than locking start time");
+        require(_redeemEnableTime >= _lockingEndTime, "redeemEnableTime >= lockingEndTime");
+ 
+        reputationReward = _reputationReward;
+        reputationRewardLeft = _reputationReward;
+        lockingEndTime = _lockingEndTime;
+        maxLockingPeriod = _maxLockingPeriod;
+        avatar = _avatar;
+        lockingStartTime = _lockingStartTime;
+        redeemEnableTime = _redeemEnableTime;
+        super.setAgreementHash(_agreementHash);
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/LockingEth4Reputation.sol.html b/coverage/schemes/LockingEth4Reputation.sol.html new file mode 100644 index 00000000..d312e0af --- /dev/null +++ b/coverage/schemes/LockingEth4Reputation.sol.html @@ -0,0 +1,260 @@ + + + + Code coverage report for schemes/LockingEth4Reputation.sol + + + + + + + +
+
+

+ all files / schemes/ LockingEth4Reputation.sol +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 5/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +25× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  +  +  +  +  +  +  +  +29× +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "./Locking4Reputation.sol";
+ 
+/**
+ * @title A scheme for locking ETH for reputation
+ */
+ 
+contract LockingEth4Reputation is Locking4Reputation {
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _reputationReward the total reputation this contract will reward
+     *        for eth locking
+     * @param _lockingStartTime locking starting period time.
+     * @param _lockingEndTime the locking end time.
+     *        locking is disable after this time.
+     * @param _redeemEnableTime redeem enable time .
+     *        redeem reputation can be done after this time.
+     * @param _maxLockingPeriod maximum locking period allowed.
+     */
+    function initialize(
+        Avatar _avatar,
+        uint256 _reputationReward,
+        uint256 _lockingStartTime,
+        uint256 _lockingEndTime,
+        uint256 _redeemEnableTime,
+        uint256 _maxLockingPeriod,
+        bytes32 _agreementHash )
+    external
+    {
+        super._initialize(
+        _avatar,
+        _reputationReward,
+        _lockingStartTime,
+        _lockingEndTime,
+        _redeemEnableTime,
+        _maxLockingPeriod,
+        _agreementHash);
+    }
+ 
+    /**
+     * @dev release locked eth
+     * @param _beneficiary the release _beneficiary
+     * @param _lockingId the locking id
+     * @return bool
+     */
+    function release(address payable _beneficiary, bytes32 _lockingId) public returns(bool) {
+        uint256 amount = super._release(_beneficiary, _lockingId);
+        _beneficiary.transfer(amount);
+ 
+        return true;
+    }
+ 
+    /**
+     * @dev lock function
+     * @param _period the locking period
+     * @return lockingId the unique Id
+     */
+    function lock(uint256 _period, bytes32 _agreementHash) public payable returns(bytes32 lockingId) {
+        return super._lock(msg.value, _period, msg.sender, 1, 1, _agreementHash);
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/LockingToken4Reputation.sol.html b/coverage/schemes/LockingToken4Reputation.sol.html new file mode 100644 index 00000000..02ef1045 --- /dev/null +++ b/coverage/schemes/LockingToken4Reputation.sol.html @@ -0,0 +1,362 @@ + + + + Code coverage report for schemes/LockingToken4Reputation.sol + + + + + + + +
+
+

+ all files / schemes/ LockingToken4Reputation.sol +

+
+
+ 100% + Statements + 14/14 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 14/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +27× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +31× +31× +  +31× +  +29× +27× +  +25× +  +25× +  +13× +  +13× +  +  + 
pragma solidity 0.5.17;
+ 
+import "./Locking4Reputation.sol";
+import "./PriceOracleInterface.sol";
+import "../libs/SafeERC20.sol";
+ 
+ 
+/**
+ * @title A scheme for locking ERC20 Tokens for reputation
+ */
+ 
+contract LockingToken4Reputation is Locking4Reputation {
+    using SafeERC20 for address;
+ 
+    PriceOracleInterface public priceOracleContract;
+    //      lockingId => token
+    mapping(bytes32   => address) public lockedTokens;
+ 
+    event LockToken(bytes32 indexed _lockingId, address indexed _token, uint256 _numerator, uint256 _denominator);
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _reputationReward the total reputation this contract will reward
+     *        for the token locking
+     * @param _lockingStartTime locking starting period time.
+     * @param _lockingEndTime the locking end time.
+     *        locking is disable after this time.
+     * @param _redeemEnableTime redeem enable time .
+     *        redeem reputation can be done after this time.
+     * @param _maxLockingPeriod maximum locking period allowed.
+     * @param _priceOracleContract the price oracle contract which the locked token will be
+     *        validated against
+     */
+    function initialize(
+        Avatar _avatar,
+        uint256 _reputationReward,
+        uint256 _lockingStartTime,
+        uint256 _lockingEndTime,
+        uint256 _redeemEnableTime,
+        uint256 _maxLockingPeriod,
+        PriceOracleInterface _priceOracleContract,
+        bytes32 _agreementHash)
+    external
+    {
+        priceOracleContract = _priceOracleContract;
+        super._initialize(
+        _avatar,
+        _reputationReward,
+        _lockingStartTime,
+        _lockingEndTime,
+        _redeemEnableTime,
+        _maxLockingPeriod,
+        _agreementHash);
+    }
+ 
+    /**
+     * @dev release locked tokens
+     * @param _beneficiary the release _beneficiary
+     * @param _lockingId the locking id
+     * @return bool
+     */
+    function release(address _beneficiary, bytes32 _lockingId) public returns(bool) {
+        uint256 amount = super._release(_beneficiary, _lockingId);
+        lockedTokens[_lockingId].safeTransfer(_beneficiary, amount);
+ 
+        return true;
+    }
+ 
+    /**
+     * @dev lock function
+     * @param _amount the amount to lock
+     * @param _period the locking period
+     * @param _token the token to lock - this should be whitelisted at the priceOracleContract
+     * @return lockingId
+     */
+    function lock(uint256 _amount,
+        uint256 _period,
+        address _token,
+        bytes32 _agreementHash)
+    public returns(bytes32 lockingId) {
+ 
+        uint256 numerator;
+        uint256 denominator;
+ 
+        (numerator, denominator) = priceOracleContract.getPrice(_token);
+ 
+        require(numerator > 0, "numerator should be > 0");
+        require(denominator > 0, "denominator should be > 0");
+ 
+        _token.safeTransferFrom(msg.sender, address(this), _amount);
+ 
+        lockingId = super._lock(_amount, _period, msg.sender, numerator, denominator, _agreementHash);
+ 
+        lockedTokens[lockingId] = _token;
+ 
+        emit LockToken(lockingId, _token, numerator, denominator);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/PriceOracleInterface.sol.html b/coverage/schemes/PriceOracleInterface.sol.html new file mode 100644 index 00000000..8677cf1c --- /dev/null +++ b/coverage/schemes/PriceOracleInterface.sol.html @@ -0,0 +1,86 @@ + + + + Code coverage report for schemes/PriceOracleInterface.sol + + + + + + + +
+
+

+ all files / schemes/ PriceOracleInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8  +  +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+interface PriceOracleInterface {
+ 
+    function getPrice(address token) external view returns (uint, uint);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/RageQuitWithToken.sol.html b/coverage/schemes/RageQuitWithToken.sol.html new file mode 100644 index 00000000..b369f2bf --- /dev/null +++ b/coverage/schemes/RageQuitWithToken.sol.html @@ -0,0 +1,239 @@ + + + + Code coverage report for schemes/RageQuitWithToken.sol + + + + + + + +
+
+

+ all files / schemes/ RageQuitWithToken.sol +

+
+
+ 100% + Statements + 10/10 +
+
+ 50% + Branches + 3/6 +
+
+ 100% + Functions + 2/2 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  +  +  +  +  +  +  +  + + + +  + + +  +  + +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/math/SafeMath.sol";
+import "../controller/Controller.sol";
+ 
+ 
+/**
+ * @title A scheme to rage quit from a dao with token.
+ * by sending the dao native token to the RageQuit function the sender will get is proportional share of the dao
+ * rageQuitToken (DAI in most case)
+ */
+contract RageQuitWithToken {
+    using SafeMath for uint256;
+ 
+    event RageQuit(
+        address indexed _avatar,
+        address indexed _rageQuitter,
+        uint256 indexed _refund
+    );
+ 
+    Avatar public avatar;
+    IERC20 public rageQuitToken; //the token which is given back for rageQuit - DAI in most cases
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar this scheme referring to.
+     * @param _rageQuitToken the token which is given back for rageQuit - DAI in most
+     */
+    function initialize(
+        Avatar _avatar,
+        IERC20 _rageQuitToken
+    )
+    external
+    {
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        Erequire(avatar == Avatar(0), "cannot initialize twice");
+        avatar = _avatar;
+        rageQuitToken = _rageQuitToken;
+    }
+ 
+    /**
+    * @dev rageQuit quit from the dao.
+    * @param _amountToRageQuitWith amount of native token to rageQuit with.
+    * @return refund the refund amount
+    */
+    function rageQuit(uint256 _amountToRageQuitWith) external returns(uint256 refund) {
+        uint256 totalTokenSupply = avatar.nativeToken().totalSupply();
+        uint256 rageQuitTokenTotalSupply = rageQuitToken.balanceOf(address(avatar));
+        refund = _amountToRageQuitWith.mul(rageQuitTokenTotalSupply).div(totalTokenSupply);
+        //this will revert if the msg.sender token balance is less than _amountToRageQuitWith.
+        avatar.nativeToken().burnFrom(msg.sender, _amountToRageQuitWith);
+        Erequire(
+        Controller(
+        avatar.owner()).externalTokenTransfer(rageQuitToken, msg.sender, refund, avatar), "send token failed");
+        emit RageQuit(address(avatar), msg.sender, refund);
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/ReputationAdmin.sol.html b/coverage/schemes/ReputationAdmin.sol.html new file mode 100644 index 00000000..b6341e00 --- /dev/null +++ b/coverage/schemes/ReputationAdmin.sol.html @@ -0,0 +1,392 @@ + + + + Code coverage report for schemes/ReputationAdmin.sol + + + + + + + +
+
+

+ all files / schemes/ ReputationAdmin.sol +

+
+
+ 100% + Statements + 25/25 +
+
+ 71.43% + Branches + 20/28 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 25/25 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +15× +13× +13× +11× +11× +11× +11× +11× +  +  +  +  +  +  +  +  +11× +11× +11× +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +11× +  + +  + + +  +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  + + + +  +  + +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+import "openzeppelin-solidity/contracts/math/SafeMath.sol";
+import "../controller/Controller.sol";
+ 
+/**
+ * @title A scheme for reputation minting/burning by an authorized account
+ */
+ 
+contract ReputationAdmin is Ownable {
+    using SafeMath for uint256;
+ 
+    Avatar public avatar;
+    uint256 public activationStartTime;
+    uint256 public activationEndTime;
+    uint256 public repRewardLeft;
+    uint256 public limitRepReward;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _activationStartTime start time for allowing minting
+     * @param _activationEndTime end time for allowing minting
+     * @param _maxRepReward maximum reputation mintable by this scheme
+     */
+    function initialize(
+        Avatar _avatar,
+        uint256 _activationStartTime,
+        uint256 _activationEndTime,
+        uint256 _maxRepReward
+    ) external onlyOwner {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        require(_activationStartTime < _activationEndTime, "_activationStartTime < _activationEndTime");
+        avatar = _avatar;
+        activationStartTime = _activationStartTime;
+        activationEndTime = _activationEndTime;
+        repRewardLeft = _maxRepReward;
+        limitRepReward = _maxRepReward;
+    }
+ 
+    /**
+     * @dev reputationBurn function
+     * @param _beneficiaries the beneficiaries address to mint reputation from
+     * @param _amounts the amounts of reputation to mint for beneficiaries
+     */
+    function reputationMint(address[] calldata _beneficiaries, uint256[] calldata _amounts) external onlyOwner {
+        Erequire(_beneficiaries.length == _amounts.length, "Arrays length mismatch");
+        for (uint256 i=0; i < _beneficiaries.length; i++) {
+            _reputationMint(_beneficiaries[i], _amounts[i]);
+        }
+    }
+ 
+    /**
+     * @dev reputationBurn function
+     * @param _beneficiaries the beneficiaries address to burm reputation from
+     * @param _amounts the amounts of reputation to burn for beneficiaries
+     */
+    function reputationBurn(address[] calldata _beneficiaries, uint256[] calldata _amounts) external onlyOwner {
+        Erequire(_beneficiaries.length == _amounts.length, "Arrays length mismatch");
+        for (uint256 i=0; i < _beneficiaries.length; i++) {
+            _reputationBurn(_beneficiaries[i], _amounts[i]);
+        }
+    }
+ 
+    /**
+     * @dev reputationMint function
+     * @param _beneficiary the beneficiary address to mint reputation for
+     * @param _amount the amount of reputation to mint the the beneficirary
+     */
+    function _reputationMint(address _beneficiary, uint256 _amount) private {
+        // solhint-disable-next-line not-rely-on-time
+        require(now >= activationStartTime, "Minting period did not start yet");
+        // solhint-disable-next-line not-rely-on-time
+        require(now < activationEndTime, "Minting period ended.");
+ 
+        if (limitRepReward > 0) {
+            repRewardLeft = repRewardLeft.sub(_amount);
+        }
+ 
+        Erequire(
+            Controller(avatar.owner()).mintReputation(_amount, _beneficiary, address(avatar)),
+            "Minting reputation should succeed"
+        );
+    }
+ 
+    /**
+     * @dev reputationBurn function
+     * @param _beneficiary the beneficiary address to burm reputation from
+     * @param _amount the amount of reputation to burn for a beneficirary
+     */
+    function _reputationBurn(address _beneficiary, uint256 _amount) private {
+        // solhint-disable-next-line not-rely-on-time
+        Erequire(now >= activationStartTime, "Burning period did not start yet");
+        // solhint-disable-next-line not-rely-on-time
+        Erequire(now < activationEndTime, "Burning period ended.");
+ 
+        Eif (limitRepReward > 0) {
+            require(_amount <= limitRepReward.sub(repRewardLeft), "Cannot burn more than minted");
+            repRewardLeft = repRewardLeft.add(_amount);
+        }
+ 
+        Erequire(
+            Controller(avatar.owner()).burnReputation(_amount, _beneficiary, address(avatar)),
+            "Burn reputation should succeed"
+        );
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/ReputationFromToken.sol.html b/coverage/schemes/ReputationFromToken.sol.html new file mode 100644 index 00000000..c9d7bf5e --- /dev/null +++ b/coverage/schemes/ReputationFromToken.sol.html @@ -0,0 +1,464 @@ + + + + Code coverage report for schemes/ReputationFromToken.sol + + + + + + + +
+
+

+ all files / schemes/ ReputationFromToken.sol +

+
+
+ 96% + Statements + 24/25 +
+
+ 66.67% + Branches + 12/18 +
+
+ 100% + Functions + 4/4 +
+
+ 96% + Lines + 24/25 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +10× +10× +10× +10× +10× +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  +  +  +  + +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +  +  + + + + + + +  + + +  + +  +  +  + + +  +  + 
pragma solidity 0.5.17;
+ 
+import "../controller/Controller.sol";
+import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
+import "./CurveInterface.sol";
+import "openzeppelin-solidity/contracts/cryptography/ECDSA.sol";
+import "openzeppelin-solidity/contracts/math/SafeMath.sol";
+import "./Agreement.sol";
+ 
+/**
+ * @title A scheme for reputation allocation according to token balances
+ *        This contract is assuming that the token contract is paused, and one cannot transfer its tokens.
+ */
+ 
+contract ReputationFromToken is Agreement {
+    using ECDSA for bytes32;
+    using SafeMath for uint256;
+ 
+    IERC20 public tokenContract;
+    CurveInterface public curve;
+    //      beneficiary -> bool
+    mapping(address     => bool) public redeems;
+    Avatar public avatar;
+ 
+    // Digest describing the data the user signs according EIP 712.
+    // Needs to match what is passed to Metamask.
+    bytes32 public constant DELEGATION_HASH_EIP712 =
+    keccak256(abi.encodePacked(
+    "address ReputationFromTokenAddress",
+    "address Beneficiary",
+    "bytes32 AgreementHash"
+    ));
+ 
+    event Redeem(address indexed _beneficiary, address indexed _sender, uint256 _amount);
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar to mint reputation from
+     * @param _tokenContract the token contract
+     * @param _agreementHash is a hash of agreement required to be added to the TX by participants
+     */
+    function initialize(Avatar _avatar, IERC20 _tokenContract, CurveInterface _curve, bytes32 _agreementHash) external
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        tokenContract = _tokenContract;
+        avatar = _avatar;
+        curve = _curve;
+        super.setAgreementHash(_agreementHash);
+    }
+ 
+    /**
+     * @dev redeem function
+     * @param _beneficiary the beneficiary address to redeem for
+     * @param _agreementHash the agreementHash hash
+     * @return uint256 minted reputation
+     */
+    function redeem(address _beneficiary, bytes32 _agreementHash) external returns(uint256) {
+        return _redeem(_beneficiary, msg.sender, _agreementHash);
+    }
+ 
+    /**
+     * @dev redeemWithSignature function
+     * @param _beneficiary the beneficiary address to redeem for
+     * @param _signatureType signature type
+              1 - for web3.eth.sign
+              2 - for eth_signTypedData according to EIP #712.
+     * @param _signature  - signed data by the staker
+     * @return uint256 minted reputation
+     */
+    function redeemWithSignature(
+        address _beneficiary,
+        bytes32 _agreementHash,
+        uint256 _signatureType,
+        bytes calldata _signature
+        )
+        external
+        returns(uint256)
+        {
+        // Recreate the digest the user signed
+        bytes32 delegationDigest;
+        Iif (_signatureType == 2) {
+            delegationDigest = keccak256(
+                abi.encodePacked(
+                    DELEGATION_HASH_EIP712, keccak256(
+                        abi.encodePacked(
+                        address(this),
+                        _beneficiary,
+                        _agreementHash)
+                    )
+                )
+            );
+        } else {
+            delegationDigest = keccak256(
+                        abi.encodePacked(
+                        address(this),
+                        _beneficiary,
+                        _agreementHash)
+                    ).toEthSignedMessageHash();
+        }
+        address redeemer = delegationDigest.recover(_signature);
+        Erequire(redeemer != address(0), "redeemer address cannot be 0");
+        return _redeem(_beneficiary, redeemer, _agreementHash);
+    }
+ 
+    /**
+     * @dev redeem function
+     * @param _beneficiary the beneficiary address to redeem for
+     * @param _redeemer the redeemer address
+     * @return uint256 minted reputation
+     */
+    function _redeem(address _beneficiary, address _redeemer, bytes32 _agreementHash)
+    private
+    onlyAgree(_agreementHash)
+    returns(uint256) {
+        Erequire(avatar != Avatar(0), "should initialize first");
+        Erequire(redeems[_redeemer] == false, "redeeming twice from the same account is not allowed");
+        redeems[_redeemer] = true;
+        uint256 tokenAmount = tokenContract.balanceOf(_redeemer);
+        if (curve != CurveInterface(0)) {
+            tokenAmount = curve.calc(tokenAmount);
+        }
+        if (_beneficiary == address(0)) {
+            _beneficiary = _redeemer;
+        }
+        Erequire(
+        Controller(
+        avatar.owner())
+        .mintReputation(tokenAmount, _beneficiary, address(avatar)), "mint reputation should succeed");
+        emit Redeem(_beneficiary, _redeemer, tokenAmount);
+        return tokenAmount;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/SignalScheme.sol.html b/coverage/schemes/SignalScheme.sol.html new file mode 100644 index 00000000..83ca7988 --- /dev/null +++ b/coverage/schemes/SignalScheme.sol.html @@ -0,0 +1,425 @@ + + + + Code coverage report for schemes/SignalScheme.sol + + + + + + + +
+
+

+ all files / schemes/ SignalScheme.sol +

+
+
+ 100% + Statements + 14/14 +
+
+ 70% + Branches + 7/10 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 14/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + +  +  +  +  +  +  + +  + +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  + + +  + + +  +  +  +  + +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+import "../controller/Avatar.sol";
+ 
+ 
+/**
+ * @title A scheme for proposing a signal on behalkf of the daoCreator
+ */
+ 
+contract SignalScheme is VotingMachineCallbacks, ProposalExecuteInterface {
+ 
+    event NewSignalProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        uint256 indexed _signalType,
+        string _descriptionHash
+    );
+ 
+    event Signal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        uint256 indexed _signalType,
+        string _descriptionHash
+    );
+ 
+    struct Proposal {
+        string descriptionHash;
+        bool executed;
+    }
+ 
+    struct Parameters {
+        bytes32 voteApproveParams;
+        IntVoteInterface intVote;
+        uint256 signalType;
+        Avatar avatar;
+    }
+ 
+    mapping(bytes32  =>  Proposal) public proposals;
+ 
+    Parameters public params;
+ 
+    /**
+     * @dev initialize
+     * @param  _avatar the scheme avatar
+     * @param _signalType - signal types
+     * @param _voteApproveParams voting machine params
+     * @param _intVote  voting machine address
+     */
+    function initialize(Avatar _avatar,
+                        uint256 _signalType,
+                        bytes32 _voteApproveParams,
+                        IntVoteInterface _intVote)
+    external {
+        require(params.avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        params = Parameters({
+            voteApproveParams: _voteApproveParams,
+            signalType: _signalType,
+            intVote: _intVote,
+            avatar: _avatar
+        });
+    }
+ 
+    /**
+    * @dev Submit a proposal for a dao signal
+    * @param _descriptionHash A hash of the proposal's description
+    */
+    function proposeSignal(
+        string calldata _descriptionHash
+    )
+    external
+    returns(bytes32)
+    {
+        Erequire(Controller(params.avatar.owner()).isSchemeRegistered(address(this), address(params.avatar)),
+        "scheme is not registered");
+ 
+        bytes32 proposalId = params.intVote.propose(
+        2,
+        params.voteApproveParams,
+        msg.sender,
+        address(params.avatar)
+        );
+ 
+        proposals[proposalId].descriptionHash = _descriptionHash;
+ 
+        emit NewSignalProposal(
+            address(params.avatar),
+            proposalId,
+            params.signalType,
+            _descriptionHash
+        );
+ 
+        proposalsInfo[address(params.intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:params.avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _param a parameter of the voting result, 1 yes and 2 is no.
+    */
+    function executeProposal(bytes32 _proposalId, int256 _param) external onlyVotingMachine(_proposalId) returns(bool) {
+        Erequire(!proposals[_proposalId].executed);
+        proposals[_proposalId].executed = true;
+        // Check if vote was successful:
+        if (_param == 1) {
+            emit Signal(address(params.avatar),
+                        _proposalId,
+                        params.signalType,
+                        proposals[_proposalId].descriptionHash);
+        }
+        return true;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/WalletScheme.sol.html b/coverage/schemes/WalletScheme.sol.html new file mode 100644 index 00000000..565826d3 --- /dev/null +++ b/coverage/schemes/WalletScheme.sol.html @@ -0,0 +1,602 @@ + + + + Code coverage report for schemes/WalletScheme.sol + + + + + + + +
+
+

+ all files / schemes/ WalletScheme.sol +

+
+
+ 100% + Statements + 40/40 +
+
+ 70.83% + Branches + 17/24 +
+
+ 100% + Functions + 6/6 +
+
+ 100% + Lines + 42/42 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +13× +11× +11× +11× +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + + + +  + + +  +  + + +  +  +  +  +  +  +  +14× +14× +12× +10× +10× +10× +10× +10× +10× +  +10× +  +10× + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +10× +10× +  +10× +10× +  +10× +  +10× +  +  +  +  +  +  +10× +  +  +  +10× +10× +  +  +  +  +  + +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.5.17;
+pragma experimental ABIEncoderV2;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+/**
+ * @title WalletScheme.
+ * @dev  A scheme for proposing and executing calls to any contract except itself and controller
+ */
+contract WalletScheme is VotingMachineCallbacks, ProposalExecuteInterface {
+    event NewCallProposal(
+        address[] _to,
+        bytes32 indexed _proposalId,
+        bytes[]   _callData,
+        uint256[] _value,
+        string  _descriptionHash
+    );
+ 
+    event ProposalExecuted(
+        bytes32 indexed _proposalId,
+        bytes[] _genericCallReturnValue
+    );
+ 
+    event ProposalExecutedByVotingMachine(
+        bytes32 indexed _proposalId,
+        int256 _param
+    );
+ 
+    event ProposalDeleted(bytes32 indexed _proposalId);
+ 
+    // Details of a voting proposal:
+    struct CallProposal {
+        address[] to;
+        bytes[] callData;
+        uint256[] value;
+        bool exist;
+        bool passed;
+    }
+ 
+    mapping(bytes32=>CallProposal) public organizationProposals;
+ 
+    IntVoteInterface public votingMachine;
+    bytes32 public voteParams;
+    Avatar public avatar;
+    address public controller;
+ 
+    /**
+     * @dev initialize
+     * @param _avatar the avatar address
+     * @param _controller the controller address
+     * @param _votingMachine the voting machines address to
+     * @param _voteParams voting machine parameters.
+     */
+    function initialize(
+        Avatar _avatar,
+        address _controller,
+        IntVoteInterface _votingMachine,
+        bytes32 _voteParams
+    )
+    external
+    {
+        require(avatar == Avatar(0), "can be called only one time");
+        Erequire(_avatar != Avatar(0), "avatar cannot be zero");
+        Erequire(_controller != address(0), "controller cannot be zero");
+        avatar = _avatar;
+        controller = _controller;
+        votingMachine = _votingMachine;
+        voteParams = _voteParams;
+    }
+    
+    /**
+    * @dev Fallback function that allows the wallet to receive ETH
+    */
+    function() external payable {}
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _decision a parameter of the voting result, 1 yes and 2 is no.
+    * @return bool success
+    */
+    function executeProposal(bytes32 _proposalId, int256 _decision)
+    external
+    onlyVotingMachine(_proposalId)
+    returns(bool) {
+        CallProposal storage proposal = organizationProposals[_proposalId];
+        Erequire(proposal.exist, "must be a live proposal");
+        Erequire(proposal.passed == false, "cannot execute twice");
+ 
+        if (_decision == 1) {
+            proposal.passed = true;
+            execute(_proposalId);
+        } else {
+            delete organizationProposals[_proposalId];
+            emit ProposalDeleted(_proposalId);
+        }
+ 
+        emit ProposalExecutedByVotingMachine(_proposalId, _decision);
+        return true;
+    }
+ 
+    /**
+    * @dev execution of proposals after it has been decided by the voting machine
+    * @param _proposalId the ID of the voting in the voting machine
+    */
+    function execute(bytes32 _proposalId) public {
+        CallProposal storage proposal = organizationProposals[_proposalId];
+        require(proposal.exist, "must be a live proposal");
+        require(proposal.passed, "proposal must passed by voting machine");
+        proposal.exist = false;
+        bytes[] memory genericCallReturnValues = new bytes[](proposal.to.length);
+        bytes memory genericCallReturnValue;
+        bool success;
+        for(uint i = 0; i < proposal.to.length; i ++) {
+          (success, genericCallReturnValue) =
+          address(proposal.to[i]).call.value(proposal.value[i])(proposal.callData[i]);
+          genericCallReturnValues[i] = genericCallReturnValue;
+        }
+        if (success) {
+            delete organizationProposals[_proposalId];
+            emit ProposalDeleted(_proposalId);
+            emit ProposalExecuted(_proposalId, genericCallReturnValues);
+        } else {
+            proposal.exist = true;
+        }
+    }
+ 
+    /**
+    * @dev propose to call an address
+    *      The function trigger NewCallProposal event
+    * @param _to - The addresses to call
+    * @param _callData - The abi encode data for the calls
+    * @param _value value(ETH) to transfer with the calls
+    * @param _descriptionHash proposal description hash
+    * @return an id which represents the proposal
+    */
+    function proposeCalls(address[] memory _to, bytes[] memory _callData, uint256[] memory _value, string memory _descriptionHash)
+    public
+    returns(bytes32)
+    {
+        for(uint i = 0; i < _to.length; i ++) {
+          Erequire(_to[i] != controller && _to[i] != address(this), 'invalid proposal caller');
+        }
+        Erequire(_to.length == _callData.length, 'invalid callData length');
+        Erequire(_to.length == _value.length, 'invalid _value length');
+        
+        bytes32 proposalId = votingMachine.propose(2, voteParams, msg.sender, _to[0]);
+ 
+        organizationProposals[proposalId] = CallProposal({
+            to: _to,
+            callData: _callData,
+            value: _value,
+            exist: true,
+            passed: false
+        });
+        proposalsInfo[address(votingMachine)][proposalId] = ProposalInfo({
+            blockNumber: block.number,
+            avatar: avatar
+        });
+        emit NewCallProposal(_to, proposalId, _callData, _value, _descriptionHash);
+        return proposalId;
+    }
+    
+    function getOrganizationProposal(bytes32 proposalId) public view 
+      returns (address[] memory to, bytes[] memory callData, uint256[] memory value, bool exist, bool passed)
+    {
+      return (
+        organizationProposals[proposalId].to,
+        organizationProposals[proposalId].callData,
+        organizationProposals[proposalId].value,
+        organizationProposals[proposalId].exist,
+        organizationProposals[proposalId].passed
+      );
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/schemes/index.html b/coverage/schemes/index.html new file mode 100644 index 00000000..950e6433 --- /dev/null +++ b/coverage/schemes/index.html @@ -0,0 +1,327 @@ + + + + Code coverage report for schemes/ + + + + + + + +
+
+

+ all files schemes/ +

+
+
+ 99.07% + Statements + 638/644 +
+
+ 76.55% + Branches + 346/452 +
+
+ 97.85% + Functions + 91/93 +
+
+ 99.08% + Lines + 645/651 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
Agreement.sol
100%4/4100%4/4100%3/3100%5/5
Auction4Reputation.sol
100%40/4088.46%23/26100%5/5100%40/40
Competition.sol
97.84%136/13977.66%73/94100%9/997.84%136/139
ContinuousLocking4Reputation.sol
100%93/9378.57%44/56100%11/11100%93/93
ContributionRewardExt.sol
98.18%108/11069.79%67/9690%18/2098.18%108/110
CurveInterface.sol
100%0/0100%0/0100%0/0100%0/0
ExternalLocking4Reputation.sol
100%18/1883.33%10/12100%3/3100%19/19
FixedReputationAllocation.sol
100%20/2081.25%13/16100%5/5100%21/21
Forwarder.sol
100%9/980%8/10100%3/3100%9/9
GenericScheme.sol
100%32/3281.25%13/16100%4/4100%34/34
Locking4Reputation.sol
100%46/4687.5%28/32100%4/4100%46/46
LockingEth4Reputation.sol
100%5/5100%0/0100%3/3100%5/5
LockingToken4Reputation.sol
100%14/14100%4/4100%3/3100%14/14
PriceOracleInterface.sol
100%0/0100%0/0100%0/0100%0/0
RageQuitWithToken.sol
100%10/1050%3/6100%2/2100%10/10
ReputationAdmin.sol
100%25/2571.43%20/28100%5/5100%25/25
ReputationFromToken.sol
96%24/2566.67%12/18100%4/496%24/25
SignalScheme.sol
100%14/1470%7/10100%3/3100%14/14
WalletScheme.sol
100%40/4070.83%17/24100%6/6100%42/42
+
+
+ + + + + + + diff --git a/coverage/sort-arrow-sprite.png b/coverage/sort-arrow-sprite.png new file mode 100644 index 00000000..03f704a6 Binary files /dev/null and b/coverage/sort-arrow-sprite.png differ diff --git a/coverage/sorter.js b/coverage/sorter.js new file mode 100644 index 00000000..6c5034e4 --- /dev/null +++ b/coverage/sorter.js @@ -0,0 +1,158 @@ +var addSorting = (function () { + "use strict"; + var cols, + currentSort = { + index: 0, + desc: false + }; + + // returns the summary table element + function getTable() { return document.querySelector('.coverage-summary'); } + // returns the thead element of the summary table + function getTableHeader() { return getTable().querySelector('thead tr'); } + // returns the tbody element of the summary table + function getTableBody() { return getTable().querySelector('tbody'); } + // returns the th element for nth column + function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; } + + // loads all columns + function loadColumns() { + var colNodes = getTableHeader().querySelectorAll('th'), + colNode, + cols = [], + col, + i; + + for (i = 0; i < colNodes.length; i += 1) { + colNode = colNodes[i]; + col = { + key: colNode.getAttribute('data-col'), + sortable: !colNode.getAttribute('data-nosort'), + type: colNode.getAttribute('data-type') || 'string' + }; + cols.push(col); + if (col.sortable) { + col.defaultDescSort = col.type === 'number'; + colNode.innerHTML = colNode.innerHTML + ''; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function (a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function (a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function () { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i =0 ; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function () { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(cols); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/coverage/universalSchemes/ContributionReward.sol.html b/coverage/universalSchemes/ContributionReward.sol.html new file mode 100644 index 00000000..cc15a8b4 --- /dev/null +++ b/coverage/universalSchemes/ContributionReward.sol.html @@ -0,0 +1,1400 @@ + + + + Code coverage report for universalSchemes/ContributionReward.sol + + + + + + + +
+
+

+ all files / universalSchemes/ ContributionReward.sol +

+
+
+ 100% + Statements + 103/103 +
+
+ 80% + Branches + 56/70 +
+
+ 100% + Functions + 16/16 +
+
+ 100% + Lines + 102/102 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +14× +14× +14× +  +14× +  +11× +  +14× +14× +  +  +  +  +  +  +  +  +  +  +20× +  +  +  +20× +20× +20× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +17× +  +17× +  +  +  +  +  +  +17× +17× + +  +  +17× +  +  +  +  +  +  +  +  +  +  +  +17× +  +17× +  +  +  +  +  +  +  +  +  +  +17× +  +  +  +17× +  +  +  +  +  +  +  +  +  +  +10× +10× +10× + +  +  + + + + +  +  +  + +  +  +  + + + +  +  + +  +  +  +  +  +  +  +  +  +  + + + + +  + +  + + + + + +  +  +  + +  +  +  +  +  +  +  +  +  +  +13× +13× +13× +13× +  +13× +13× +  +13× +11× + + +  +  +  +11× +  +  +  +  +  +  +  +  +  +  + + + + +  + +  + + + + +  +  +  + + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +10× +  +  +19× + +  +  +19× +13× +  +  +17× + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +75× +75× +75× + +67× +67× +  +55× +  +67× +67× +47× +  +20× +  +67× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +40× +  +  +  + +  +  +  + +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +40× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× +25× +  +22× +  +  +22× +  +  +20× +  +  +18× +  +  +16× +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "./UniversalScheme.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+/**
+ * @title A scheme for proposing and rewarding contributions to an organization
+ * @dev An agent can ask an organization to recognize a contribution and reward
+ * him with token, reputation, ether or any combination.
+ */
+ 
+contract ContributionReward is UniversalScheme, VotingMachineCallbacks, ProposalExecuteInterface {
+    using SafeMath for uint;
+ 
+    event NewContributionProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        string _descriptionHash,
+        int256 _reputationChange,
+        uint[5]  _rewards,
+        IERC20 _externalToken,
+        address _beneficiary
+    );
+ 
+    event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param);
+ 
+    event RedeemReputation(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        int256 _amount);
+ 
+    event RedeemEther(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        uint256 _amount);
+ 
+    event RedeemNativeToken(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        uint256 _amount);
+ 
+    event RedeemExternalToken(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _beneficiary,
+        uint256 _amount);
+ 
+    // A struct holding the data for a contribution proposal
+    struct ContributionProposal {
+        uint256 nativeTokenReward; // Reward asked in the native token of the organization.
+        int256 reputationChange; // Organization reputation reward requested.
+        uint256 ethReward;
+        IERC20 externalToken;
+        uint256 externalTokenReward;
+        address payable beneficiary;
+        uint256 periodLength;
+        uint256 numberOfPeriods;
+        uint256 executionTime;
+        uint[4] redeemedPeriods;
+    }
+ 
+    // A mapping from the organization (Avatar) address to the saved data of the organization:
+    mapping(address=>mapping(bytes32=>ContributionProposal)) public organizationsProposals;
+ 
+    // A mapping from hashes to parameters (use to store a particular configuration on the controller)
+    struct Parameters {
+        bytes32 voteApproveParams;
+        IntVoteInterface intVote;
+    }
+ 
+    // A mapping from hashes to parameters (use to store a particular configuration on the controller)
+    mapping(bytes32=>Parameters) public parameters;
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _param a parameter of the voting result, 1 yes and 2 is no.
+    */
+    function executeProposal(bytes32 _proposalId, int256 _param) external onlyVotingMachine(_proposalId) returns(bool) {
+        ProposalInfo memory proposal = proposalsInfo[msg.sender][_proposalId];
+        Erequire(organizationsProposals[address(proposal.avatar)][_proposalId].executionTime == 0);
+        Erequire(organizationsProposals[address(proposal.avatar)][_proposalId].beneficiary != address(0));
+        // Check if vote was successful:
+        if (_param == 1) {
+          // solhint-disable-next-line not-rely-on-time
+            organizationsProposals[address(proposal.avatar)][_proposalId].executionTime = now;
+        }
+        emit ProposalExecuted(address(proposal.avatar), _proposalId, _param);
+        return true;
+    }
+ 
+    /**
+    * @dev hash the parameters, save them if necessary, and return the hash value
+    */
+    function setParameters(
+        bytes32 _voteApproveParams,
+        IntVoteInterface _intVote
+    ) public returns(bytes32)
+    {
+        bytes32 paramsHash = getParametersHash(
+            _voteApproveParams,
+            _intVote
+        );
+        parameters[paramsHash].voteApproveParams = _voteApproveParams;
+        parameters[paramsHash].intVote = _intVote;
+        return paramsHash;
+    }
+ 
+    /**
+    * @dev Submit a proposal for a reward for a contribution:
+    * @param _avatar Avatar of the organization that the contribution was made for
+    * @param _descriptionHash A hash of the proposal's description
+    * @param _reputationChange - Amount of reputation change requested .Can be negative.
+    * @param _rewards rewards array:
+    *         rewards[0] - Amount of tokens requested per period
+    *         rewards[1] - Amount of ETH requested per period
+    *         rewards[2] - Amount of external tokens requested per period
+    *         rewards[3] - Period length - if set to zero it allows immediate redeeming after execution.
+    *         rewards[4] - Number of periods
+    * @param _externalToken Address of external token, if reward is requested there
+    * @param _beneficiary Who gets the rewards
+    */
+    function proposeContributionReward(
+        Avatar _avatar,
+        string memory _descriptionHash,
+        int256 _reputationChange,
+        uint[5] memory _rewards,
+        IERC20 _externalToken,
+        address payable _beneficiary
+    )
+    public
+    returns(bytes32)
+    {
+        validateProposalParams(_reputationChange, _rewards);
+        Parameters memory controllerParams = parameters[getParametersFromController(_avatar)];
+ 
+        bytes32 contributionId = controllerParams.intVote.propose(
+        2,
+        controllerParams.voteApproveParams,
+        msg.sender,
+        address(_avatar)
+        );
+ 
+        address payable beneficiary = _beneficiary;
+        if (beneficiary == address(0)) {
+            beneficiary = msg.sender;
+        }
+ 
+        ContributionProposal memory proposal = ContributionProposal({
+            nativeTokenReward: _rewards[0],
+            reputationChange: _reputationChange,
+            ethReward: _rewards[1],
+            externalToken: _externalToken,
+            externalTokenReward: _rewards[2],
+            beneficiary: beneficiary,
+            periodLength: _rewards[3],
+            numberOfPeriods: _rewards[4],
+            executionTime: 0,
+            redeemedPeriods:[uint(0), uint(0), uint(0), uint(0)]
+        });
+        organizationsProposals[address(_avatar)][contributionId] = proposal;
+ 
+        emit NewContributionProposal(
+            address(_avatar),
+            contributionId,
+            address(controllerParams.intVote),
+            _descriptionHash,
+            _reputationChange,
+            _rewards,
+            _externalToken,
+            beneficiary
+        );
+ 
+        proposalsInfo[address(controllerParams.intVote)][contributionId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return contributionId;
+    }
+ 
+    /**
+    * @dev RedeemReputation reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @return reputation the redeemed reputation.
+    */
+    function redeemReputation(bytes32 _proposalId, Avatar _avatar) public returns(int256 reputation) {
+ 
+        ContributionProposal memory _proposal = organizationsProposals[address(_avatar)][_proposalId];
+        ContributionProposal storage proposal = organizationsProposals[address(_avatar)][_proposalId];
+        require(proposal.executionTime != 0);
+        uint256 periodsToPay = getPeriodsToPay(_proposalId, address(_avatar), 0);
+ 
+        //set proposal reward to zero to prevent reentrancy attack.
+        proposal.reputationChange = 0;
+        reputation = int(periodsToPay) * _proposal.reputationChange;
+        if (reputation > 0) {
+            Erequire(
+            Controller(
+            _avatar.owner()).mintReputation(uint(reputation), _proposal.beneficiary, address(_avatar)));
+        } else if (reputation < 0) {
+            Erequire(
+            Controller(
+            _avatar.owner()).burnReputation(uint(reputation*(-1)), _proposal.beneficiary, address(_avatar)));
+        }
+        if (reputation != 0) {
+            proposal.redeemedPeriods[0] = proposal.redeemedPeriods[0].add(periodsToPay);
+            emit RedeemReputation(address(_avatar), _proposalId, _proposal.beneficiary, reputation);
+        }
+        //restore proposal reward.
+        proposal.reputationChange = _proposal.reputationChange;
+    }
+ 
+    /**
+    * @dev RedeemNativeToken reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @return amount the redeemed nativeToken.
+    */
+    function redeemNativeToken(bytes32 _proposalId, Avatar _avatar) public returns(uint256 amount) {
+ 
+        ContributionProposal memory _proposal = organizationsProposals[address(_avatar)][_proposalId];
+        ContributionProposal storage proposal = organizationsProposals[address(_avatar)][_proposalId];
+        Erequire(proposal.executionTime != 0);
+        uint256 periodsToPay = getPeriodsToPay(_proposalId, address(_avatar), 1);
+        //set proposal rewards to zero to prevent reentrancy attack.
+        proposal.nativeTokenReward = 0;
+ 
+        amount = periodsToPay.mul(_proposal.nativeTokenReward);
+        Eif (amount > 0) {
+            Erequire(Controller(_avatar.owner()).mintTokens(amount, _proposal.beneficiary, address(_avatar)));
+            proposal.redeemedPeriods[1] = proposal.redeemedPeriods[1].add(periodsToPay);
+            emit RedeemNativeToken(address(_avatar), _proposalId, _proposal.beneficiary, amount);
+        }
+ 
+        //restore proposal reward.
+        proposal.nativeTokenReward = _proposal.nativeTokenReward;
+    }
+ 
+    /**
+    * @dev RedeemEther reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @return amount ether redeemed amount
+    */
+    function redeemEther(bytes32 _proposalId, Avatar _avatar) public returns(uint256 amount) {
+ 
+        ContributionProposal memory _proposal = organizationsProposals[address(_avatar)][_proposalId];
+        ContributionProposal storage proposal = organizationsProposals[address(_avatar)][_proposalId];
+        Erequire(proposal.executionTime != 0);
+        uint256 periodsToPay = getPeriodsToPay(_proposalId, address(_avatar), 2);
+        //set proposal rewards to zero to prevent reentrancy attack.
+        proposal.ethReward = 0;
+        amount = periodsToPay.mul(_proposal.ethReward);
+ 
+        if (amount > 0) {
+            require(Controller(_avatar.owner()).sendEther(amount, _proposal.beneficiary, _avatar));
+            proposal.redeemedPeriods[2] = proposal.redeemedPeriods[2].add(periodsToPay);
+            emit RedeemEther(address(_avatar), _proposalId, _proposal.beneficiary, amount);
+        }
+ 
+        //restore proposal reward.
+        proposal.ethReward = _proposal.ethReward;
+    }
+ 
+    /**
+    * @dev RedeemNativeToken reward for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @return amount the external token redeemed amount
+    */
+    function redeemExternalToken(bytes32 _proposalId, Avatar _avatar) public returns(uint256 amount) {
+ 
+        ContributionProposal memory _proposal = organizationsProposals[address(_avatar)][_proposalId];
+        ContributionProposal storage proposal = organizationsProposals[address(_avatar)][_proposalId];
+        Erequire(proposal.executionTime != 0);
+        uint256 periodsToPay = getPeriodsToPay(_proposalId, address(_avatar), 3);
+        //set proposal rewards to zero to prevent reentrancy attack.
+        proposal.externalTokenReward = 0;
+ 
+        Eif (proposal.externalToken != IERC20(0) && _proposal.externalTokenReward > 0) {
+            amount = periodsToPay.mul(_proposal.externalTokenReward);
+            Eif (amount > 0) {
+                Erequire(
+                Controller(
+                _avatar.owner())
+                .externalTokenTransfer(_proposal.externalToken, _proposal.beneficiary, amount, _avatar));
+                proposal.redeemedPeriods[3] = proposal.redeemedPeriods[3].add(periodsToPay);
+                emit RedeemExternalToken(address(_avatar), _proposalId, _proposal.beneficiary, amount);
+            }
+        }
+        //restore proposal reward.
+        proposal.externalTokenReward = _proposal.externalTokenReward;
+    }
+ 
+    /**
+    * @dev redeem rewards for proposal
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @param _whatToRedeem whatToRedeem array:
+    *         whatToRedeem[0] - reputation
+    *         whatToRedeem[1] - nativeTokenReward
+    *         whatToRedeem[2] - Ether
+    *         whatToRedeem[3] - ExternalToken
+    * @return  result boolean array for each redeem type.
+    */
+    function redeem(bytes32 _proposalId, Avatar _avatar, bool[4] memory _whatToRedeem)
+    public
+    returns(int256 reputationReward, uint256 nativeTokenReward, uint256 etherReward, uint256 externalTokenReward)
+    {
+ 
+        if (_whatToRedeem[0]) {
+            reputationReward = redeemReputation(_proposalId, _avatar);
+        }
+ 
+        if (_whatToRedeem[1]) {
+            nativeTokenReward = redeemNativeToken(_proposalId, _avatar);
+        }
+ 
+        if (_whatToRedeem[2]) {
+            etherReward = redeemEther(_proposalId, _avatar);
+        }
+ 
+        if (_whatToRedeem[3]) {
+            externalTokenReward = redeemExternalToken(_proposalId, _avatar);
+        }
+    }
+ 
+    /**
+    * @dev getPeriodsToPay return the periods left to be paid for reputation,nativeToken,ether or externalToken.
+    * The function ignore the reward amount to be paid (which can be zero).
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @param _redeemType - the type of the reward  :
+    *         0 - reputation
+    *         1 - nativeTokenReward
+    *         2 - Ether
+    *         3 - ExternalToken
+    * @return  periods left to be paid.
+    */
+    function getPeriodsToPay(bytes32 _proposalId, address _avatar, uint256 _redeemType) public view returns (uint256) {
+        Erequire(_redeemType <= 3, "should be in the redeemedPeriods range");
+        ContributionProposal memory _proposal = organizationsProposals[_avatar][_proposalId];
+        if (_proposal.executionTime == 0)
+            return 0;
+        uint256 periodsFromExecution;
+        if (_proposal.periodLength > 0) {
+          // solhint-disable-next-line not-rely-on-time
+            periodsFromExecution = (now.sub(_proposal.executionTime))/(_proposal.periodLength);
+        }
+        uint256 periodsToPay;
+        if ((_proposal.periodLength == 0) || (periodsFromExecution >= _proposal.numberOfPeriods)) {
+            periodsToPay = _proposal.numberOfPeriods.sub(_proposal.redeemedPeriods[_redeemType]);
+        } else {
+            periodsToPay = periodsFromExecution.sub(_proposal.redeemedPeriods[_redeemType]);
+        }
+        return periodsToPay;
+    }
+ 
+    /**
+    * @dev getRedeemedPeriods return the already redeemed periods for reputation, nativeToken, ether or externalToken.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @param _redeemType - the type of the reward  :
+    *         0 - reputation
+    *         1 - nativeTokenReward
+    *         2 - Ether
+    *         3 - ExternalToken
+    * @return redeemed period.
+    */
+    function getRedeemedPeriods(bytes32 _proposalId, address _avatar, uint256 _redeemType)
+    public
+    view
+    returns (uint256) {
+        return organizationsProposals[_avatar][_proposalId].redeemedPeriods[_redeemType];
+    }
+ 
+    function getProposalEthReward(bytes32 _proposalId, address _avatar) public view returns (uint256) {
+        return organizationsProposals[_avatar][_proposalId].ethReward;
+    }
+ 
+    function getProposalExternalTokenReward(bytes32 _proposalId, address _avatar) public view returns (uint256) {
+        return organizationsProposals[_avatar][_proposalId].externalTokenReward;
+    }
+ 
+    function getProposalExternalToken(bytes32 _proposalId, address _avatar) public view returns (address) {
+        return address(organizationsProposals[_avatar][_proposalId].externalToken);
+    }
+ 
+    function getProposalExecutionTime(bytes32 _proposalId, address _avatar) public view returns (uint256) {
+        return organizationsProposals[_avatar][_proposalId].executionTime;
+    }
+ 
+    /**
+    * @dev return a hash of the given parameters
+    * @param _voteApproveParams parameters for the voting machine used to approve a contribution
+    * @param _intVote the voting machine used to approve a contribution
+    * @return a hash of the parameters
+    */
+    function getParametersHash(
+        bytes32 _voteApproveParams,
+        IntVoteInterface _intVote
+    ) public pure returns(bytes32)
+    {
+        return (keccak256(abi.encodePacked(_voteApproveParams, _intVote)));
+    }
+ 
+    /**
+    * @dev validateProposalParams validate proposal's rewards parameters.
+    * The function check for potential overflow upon proposal's redeem.
+    * The function reverts if the params are not valid.
+    * @param _reputationChange - Amount of reputation change requested .Can be negative.
+    * @param _rewards rewards array:
+    *         rewards[0] - Amount of tokens requested per period
+    *         rewards[1] - Amount of ETH requested per period
+    *         rewards[2] - Amount of external tokens requested per period
+    *         rewards[3] - Period length - if set to zero it allows immediate redeeming after execution.
+    *         rewards[4] - Number of periods
+    */
+    function validateProposalParams(int256 _reputationChange, uint[5] memory _rewards) private pure {
+        require(((_rewards[3] > 0) || (_rewards[4] == 1)), "periodLength equal 0 require numberOfPeriods to be 1");
+        if (_rewards[4] > 0) {
+            // This is the only case of overflow not detected by the check below
+            Erequire(!(int(_rewards[4]) == -1 && _reputationChange == (-2**255)),
+            "numberOfPeriods * _reputationChange will overflow");
+           //check that numberOfPeriods * _reputationChange will not overflow
+            require((int(_rewards[4]) * _reputationChange) / int(_rewards[4]) == _reputationChange,
+            "numberOfPeriods * reputationChange will overflow");
+            //check that numberOfPeriods * tokenReward will not overflow
+            require((_rewards[4] * _rewards[0]) / _rewards[4] == _rewards[0],
+            "numberOfPeriods * tokenReward will overflow");
+            //check that numberOfPeriods * ethReward will not overflow
+            require((_rewards[4] * _rewards[1]) / _rewards[4] == _rewards[1],
+            "numberOfPeriods * ethReward will overflow");
+            //check that numberOfPeriods * texternalTokenReward will not overflow
+            require((_rewards[4] * _rewards[2]) / _rewards[4] == _rewards[2],
+            "numberOfPeriods * texternalTokenReward will overflow");
+        }
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/universalSchemes/DaoCreator.sol.html b/coverage/universalSchemes/DaoCreator.sol.html new file mode 100644 index 00000000..00788cc9 --- /dev/null +++ b/coverage/universalSchemes/DaoCreator.sol.html @@ -0,0 +1,686 @@ + + + + Code coverage report for universalSchemes/DaoCreator.sol + + + + + + + +
+
+

+ all files / universalSchemes/ DaoCreator.sol +

+
+
+ 100% + Statements + 47/47 +
+
+ 68.75% + Branches + 22/32 +
+
+ 100% + Functions + 6/6 +
+
+ 100% + Lines + 48/48 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208  +  +  +  +  +  +  +  +  +  +  +  +  +294× +294× +294× +294× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +296× +296× +296× +296× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  + +60× +60× +60× +  +  +60× +60× +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +298× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +294× +  +290× +290× +313× +  +290× +  +290× +  +290× +290× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +298× +298× +296× +296× +296× +296× +  +  +  +296× +536× +534× +370× +  +534× +508× +  +  +  +294× +  +  +294× +  +  +294× +294× +294× +  +294× +  +294× +294× +  +  + 
pragma solidity 0.5.17;
+ 
+import "./UniversalScheme.sol";
+import "../controller/Controller.sol";
+import "../utils/DAOTracker.sol";
+ 
+ 
+/**
+ * @title ControllerCreator for creating a single controller.
+ */
+contract ControllerCreator {
+ 
+    function create(Avatar _avatar) public returns(address) {
+        Controller controller = new Controller(_avatar);
+        controller.registerScheme(msg.sender, bytes32(0), bytes4(0x0000001f), address(_avatar));
+        controller.unregisterScheme(address(this), address(_avatar));
+        return address(controller);
+    }
+}
+ 
+/**
+ * @title Genesis Scheme that creates organizations
+ */
+contract DaoCreator {
+ 
+    mapping(address=>address) public locks;
+ 
+    event NewOrg (address _avatar);
+    event InitialSchemesSet (address _avatar);
+ 
+    ControllerCreator private controllerCreator;
+    DAOTracker private daoTracker;
+ 
+    constructor(ControllerCreator _controllerCreator, DAOTracker _daoTracker) public {
+        Erequire(_controllerCreator != ControllerCreator(0));
+        Erequire(_daoTracker != DAOTracker(0));
+        controllerCreator = _controllerCreator;
+        daoTracker = _daoTracker;
+    }
+ 
+    /**
+      * @dev addFounders add founders to the organization.
+      *      this function can be called only after forgeOrg and before setSchemes
+      * @param _avatar the organization avatar
+      * @param _founders An array with the addresses of the founders of the organization
+      * @param _foundersTokenAmount An array of amount of tokens that the founders
+      *  receive in the new organization
+      * @param _foundersReputationAmount An array of amount of reputation that the
+      *   founders receive in the new organization
+      * @return bool true or false
+      */
+    function addFounders (
+        Avatar _avatar,
+        address[] calldata _founders,
+        uint[] calldata _foundersTokenAmount,
+        uint[] calldata _foundersReputationAmount
+    )
+    external
+    returns(bool)
+    {
+        Erequire(_founders.length == _foundersTokenAmount.length);
+        Erequire(_founders.length == _foundersReputationAmount.length);
+        Erequire(_founders.length > 0);
+        require(locks[address(_avatar)] == msg.sender);
+        // Mint token and reputation for founders:
+        for (uint256 i = 0; i < _founders.length; i++) {
+            Erequire(_founders[i] != address(0));
+            Eif (_foundersTokenAmount[i] > 0) {
+                Controller(
+                _avatar.owner()).mintTokens(_foundersTokenAmount[i], _founders[i], address(_avatar));
+            }
+            Eif (_foundersReputationAmount[i] > 0) {
+                Controller(
+                _avatar.owner()).mintReputation(_foundersReputationAmount[i], _founders[i], address(_avatar));
+            }
+        }
+        return true;
+    }
+ 
+  /**
+    * @dev Create a new organization
+    * @param _orgName The name of the new organization
+    * @param _tokenName The name of the token associated with the organization
+    * @param _tokenSymbol The symbol of the token
+    * @param _founders An array with the addresses of the founders of the organization
+    * @param _foundersTokenAmount An array of amount of tokens that the founders
+    *  receive in the new organization
+    * @param _foundersReputationAmount An array of amount of reputation that the
+    *   founders receive in the new organization
+    * @param  _cap token cap - 0 for no cap.
+    * @return The address of the avatar of the controller
+    */
+    function forgeOrg (
+        string calldata _orgName,
+        string calldata _tokenName,
+        string calldata _tokenSymbol,
+        address[] calldata _founders,
+        uint[] calldata _foundersTokenAmount,
+        uint[] calldata _foundersReputationAmount,
+        uint256 _cap
+    )
+    external
+    returns(address)
+    {
+        //The call for the private function is needed to bypass a deep stack issues
+        return _forgeOrg(
+            _orgName,
+            _tokenName,
+            _tokenSymbol,
+            _founders,
+            _foundersTokenAmount,
+            _foundersReputationAmount,
+            _cap);
+    }
+ 
+     /**
+      * @dev Set initial schemes for the organization.
+      * @param _avatar organization avatar (returns from forgeOrg)
+      * @param _schemes the schemes to register for the organization
+      * @param _params the schemes's params
+      * @param _permissions the schemes permissions.
+      * @param _metaData dao meta data hash
+      */
+    function setSchemes (
+        Avatar _avatar,
+        address[] calldata _schemes,
+        bytes32[] calldata _params,
+        bytes4[] calldata _permissions,
+        string calldata _metaData
+    )
+        external
+    {
+        // this action can only be executed by the account that holds the lock
+        // for this controller
+        require(locks[address(_avatar)] == msg.sender);
+        // register initial schemes:
+        Controller controller = Controller(_avatar.owner());
+        for (uint256 i = 0; i < _schemes.length; i++) {
+            controller.registerScheme(_schemes[i], _params[i], _permissions[i], address(_avatar));
+        }
+        controller.metaData(_metaData, _avatar);
+        // Unregister self:
+        controller.unregisterScheme(address(this), address(_avatar));
+        // Remove lock:
+        delete locks[address(_avatar)];
+        emit InitialSchemesSet(address(_avatar));
+    }
+ 
+    /**
+     * @dev Create a new organization
+     * @param _orgName The name of the new organization
+     * @param _tokenName The name of the token associated with the organization
+     * @param _tokenSymbol The symbol of the token
+     * @param _founders An array with the addresses of the founders of the organization
+     * @param _foundersTokenAmount An array of amount of tokens that the founders
+     *  receive in the new organization
+     * @param _foundersReputationAmount An array of amount of reputation that the
+     *   founders receive in the new organization
+     * @param  _cap token cap - 0 for no cap.
+     * @return The address of the avatar of the controller
+     */
+    function _forgeOrg (
+        string memory _orgName,
+        string memory _tokenName,
+        string memory _tokenSymbol,
+        address[] memory _founders,
+        uint[] memory _foundersTokenAmount,
+        uint[] memory _foundersReputationAmount,
+        uint256 _cap
+    ) private returns(address)
+    {
+        // Create Token, Reputation and Avatar:
+        Erequire(_founders.length == _foundersTokenAmount.length);
+        require(_founders.length == _foundersReputationAmount.length);
+        Erequire(_founders.length > 0);
+        DAOToken nativeToken = new DAOToken(_tokenName, _tokenSymbol, _cap);
+        Reputation nativeReputation = new Reputation();
+        Avatar avatar = new Avatar(_orgName, nativeToken, nativeReputation);
+ 
+ 
+        // Mint token and reputation for founders:
+        for (uint256 i = 0; i < _founders.length; i++) {
+            require(_founders[i] != address(0));
+            if (_foundersTokenAmount[i] > 0) {
+                nativeToken.mint(_founders[i], _foundersTokenAmount[i]);
+            }
+            if (_foundersReputationAmount[i] > 0) {
+                nativeReputation.mint(_founders[i], _foundersReputationAmount[i]);
+            }
+        }
+ 
+        Controller controller = Controller(controllerCreator.create(avatar));
+ 
+        // Add the DAO to the tracking registry
+        daoTracker.track(avatar, controller, "");
+ 
+        // Transfer ownership:
+        avatar.transferOwnership(address(controller));
+        nativeToken.transferOwnership(address(controller));
+        nativeReputation.transferOwnership(address(controller));
+ 
+        locks[address(avatar)] = msg.sender;
+ 
+        emit NewOrg (address(avatar));
+        return (address(avatar));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/universalSchemes/GlobalConstraintRegistrar.sol.html b/coverage/universalSchemes/GlobalConstraintRegistrar.sol.html new file mode 100644 index 00000000..90751ae1 --- /dev/null +++ b/coverage/universalSchemes/GlobalConstraintRegistrar.sol.html @@ -0,0 +1,680 @@ + + + + Code coverage report for universalSchemes/GlobalConstraintRegistrar.sol + + + + + + + +
+
+

+ all files / universalSchemes/ GlobalConstraintRegistrar.sol +

+
+
+ 100% + Statements + 37/37 +
+
+ 90% + Branches + 9/10 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 38/38 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + + + + +  + +  +  + +  +  + + + +  +  + + +  +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +11× +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + + +  + +  +  +  +  +  +  + + +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  + + + + + +  +  +  +  +  +  + +  +  +  +  +  +  + + + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "./UniversalScheme.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+ 
+/**
+ * @title A scheme to manage global constraint for organizations
+ * @dev The scheme is used to register or remove new global constraints
+ */
+contract GlobalConstraintRegistrar is UniversalScheme, VotingMachineCallbacks, ProposalExecuteInterface {
+    event NewGlobalConstraintsProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        address _gc,
+        bytes32 _params,
+        bytes32 _voteToRemoveParams,
+        string _descriptionHash
+    );
+ 
+    event RemoveGlobalConstraintsProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        address _gc,
+        string _descriptionHash
+    );
+ 
+    event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param);
+    event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId);
+ 
+    // The struct that holds the information of a global constraint proposed to be added or removed.
+    struct GCProposal {
+        address gc; // The address of the global constraint contract.
+        bool addGC; // true: add a GC, false: remove a GC.
+        bytes32 params; // Parameters for global constraint.
+        bytes32 voteToRemoveParams; // Voting parameters for removing this GC.
+    }
+ 
+    // GCProposal by avatar and proposalId
+    mapping(address=>mapping(bytes32=>GCProposal)) public organizationsProposals;
+ 
+    // voteToRemoveParams hash by avatar and proposal.gc
+    mapping(address=>mapping(address=>bytes32)) public voteToRemoveParams;
+ 
+    // A mapping from hashes to parameters (use to store a particular configuration on the controller)
+    struct Parameters {
+        bytes32 voteRegisterParams;
+        IntVoteInterface intVote;
+    }
+ 
+    mapping(bytes32=>Parameters) public parameters;
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _param a parameter of the voting result, 1 yes and 2 is no.
+    * @return bool which represents a successful of the function.
+    */
+    function executeProposal(bytes32 _proposalId, int256 _param) external onlyVotingMachine(_proposalId) returns(bool) {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        bool retVal = true;
+        // Check if vote was successful:
+        GCProposal memory proposal = organizationsProposals[address(avatar)][_proposalId];
+        Erequire(proposal.gc != address(0));
+        delete organizationsProposals[address(avatar)][_proposalId];
+        emit ProposalDeleted(address(avatar), _proposalId);
+ 
+        if (_param == 1) {
+ 
+        // Define controller and get the params:
+            Controller controller = Controller(avatar.owner());
+ 
+        // Adding a GC
+            if (proposal.addGC) {
+                retVal = controller.addGlobalConstraint(proposal.gc, proposal.params, address(avatar));
+                voteToRemoveParams[address(avatar)][proposal.gc] = proposal.voteToRemoveParams;
+            }
+        // Removing a GC
+            if (!proposal.addGC) {
+                retVal = controller.removeGlobalConstraint(proposal.gc, address(avatar));
+            }
+        }
+        emit ProposalExecuted(address(avatar), _proposalId, _param);
+        return retVal;
+    }
+ 
+    /**
+    * @dev Hash the parameters, save them if necessary, and return the hash value
+    * @param _voteRegisterParams -  voting parameters for register global constraint
+    * @param _intVote  - voting machine contract.
+    * @return bytes32 -the parameters hash
+    */
+    function setParameters(
+        bytes32 _voteRegisterParams,
+        IntVoteInterface _intVote
+    ) public returns(bytes32)
+    {
+        bytes32 paramsHash = getParametersHash(_voteRegisterParams, _intVote);
+        parameters[paramsHash].voteRegisterParams = _voteRegisterParams;
+        parameters[paramsHash].intVote = _intVote;
+        return paramsHash;
+    }
+ 
+    /**
+    * @dev propose to add a new global constraint:
+    * @param _avatar the avatar of the organization that the constraint is proposed for
+    * @param _gc the address of the global constraint that is being proposed
+    * @param _params the parameters for the global constraint
+    * @param _voteToRemoveParams the conditions (on the voting machine) for removing this global constraint
+    * @param _descriptionHash proposal's description hash
+    * @return bytes32 -the proposal id
+    */
+    // TODO: do some checks on _voteToRemoveParams - it is very easy to make a mistake and not be able to remove the GC
+    function proposeGlobalConstraint(
+    Avatar _avatar,
+    address _gc,
+    bytes32 _params,
+    bytes32 _voteToRemoveParams,
+    string memory _descriptionHash)
+    public
+    returns(bytes32)
+    {
+        Parameters memory votingParams = parameters[getParametersFromController(_avatar)];
+ 
+        IntVoteInterface intVote = votingParams.intVote;
+        bytes32 proposalId = intVote.propose(2, votingParams.voteRegisterParams, msg.sender, address(_avatar));
+ 
+        GCProposal memory proposal = GCProposal({
+            gc: _gc,
+            params: _params,
+            addGC: true,
+            voteToRemoveParams: _voteToRemoveParams
+        });
+ 
+        organizationsProposals[address(_avatar)][proposalId] = proposal;
+        emit NewGlobalConstraintsProposal(
+            address(_avatar),
+            proposalId,
+            address(intVote),
+            _gc,
+            _params,
+            _voteToRemoveParams,
+            _descriptionHash
+        );
+        proposalsInfo[address(intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev propose to remove a global constraint:
+    * @param _avatar the avatar of the organization that the constraint is proposed for
+    * @param _gc the address of the global constraint that is being proposed
+    * @param _descriptionHash proposal's description hash
+    * @return bytes32 -the proposal id
+    */
+    function proposeToRemoveGC(Avatar _avatar, address _gc, string memory _descriptionHash) public returns(bytes32) {
+        Controller controller = Controller(_avatar.owner());
+        require(controller.isGlobalConstraintRegistered(_gc, address(_avatar)));
+        Parameters memory params = parameters[getParametersFromController(_avatar)];
+        IntVoteInterface intVote = params.intVote;
+        bytes32 proposalId = intVote.propose(
+        2,
+        voteToRemoveParams[address(_avatar)][_gc],
+        msg.sender,
+        address(_avatar)
+        );
+ 
+        GCProposal memory proposal = GCProposal({
+            gc: _gc,
+            params: 0,
+            addGC: false,
+            voteToRemoveParams: 0
+        });
+ 
+        organizationsProposals[address(_avatar)][proposalId] = proposal;
+        emit RemoveGlobalConstraintsProposal(address(_avatar), proposalId, address(intVote), _gc, _descriptionHash);
+        proposalsInfo[address(intVote)][proposalId] = ProposalInfo({
+            blockNumber: block.number,
+            avatar: _avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev Hash the parameters and return the hash value
+    * @param _voteRegisterParams -  voting parameters
+    * @param _intVote  - voting machine contract.
+    * @return bytes32 -the parameters hash
+    */
+    function getParametersHash(
+        bytes32 _voteRegisterParams,
+        IntVoteInterface _intVote
+    ) public pure returns(bytes32)
+    {
+        return (keccak256(abi.encodePacked(_voteRegisterParams, _intVote)));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/universalSchemes/OrganizationRegister.sol.html b/coverage/universalSchemes/OrganizationRegister.sol.html new file mode 100644 index 00000000..89c4ced2 --- /dev/null +++ b/coverage/universalSchemes/OrganizationRegister.sol.html @@ -0,0 +1,317 @@ + + + + Code coverage report for universalSchemes/OrganizationRegister.sol + + + + + + + +
+
+

+ all files / universalSchemes/ OrganizationRegister.sol +

+
+
+ 100% + Statements + 14/14 +
+
+ 83.33% + Branches + 5/6 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 14/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + + +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + +  + + + +  + +  + +  +  +  +  +  +  +  +  +  +  +  +  + +  +  + 
pragma solidity 0.5.17;
+ 
+import "./UniversalScheme.sol";
+import "../libs/SafeERC20.sol";
+ 
+/**
+ * @title A universal organization registry.
+ * @dev Organizations can use this scheme to open a registry.
+ * Other organizations can then add and promote themselves on this registry.
+ */
+ 
+contract OrganizationRegister is UniversalScheme {
+    using SafeMath for uint;
+    using SafeERC20 for address;
+ 
+    struct Parameters {
+        uint256 fee;
+        IERC20 token;
+        address beneficiary;
+    }
+ 
+    // A mapping from the organization (Avatar) address to the saved data of the organization:
+    mapping(address=>mapping(address=>uint)) public organizationsRegistry;
+ 
+    mapping(bytes32=>Parameters) public parameters;
+ 
+    event OrgAdded( address indexed _registry, address indexed _org);
+    event Promotion( address indexed _registry, address indexed _org, uint256 _amount);
+ 
+    /**
+    * @dev Hash the parameters, save if needed and return the hash value
+    * @param _token -  the token to pay for register or promotion an address.
+    * @param _fee  - fee needed for register an address.
+    * @param _beneficiary  - the beneficiary payment address
+    * @return bytes32 -the parameters hash
+    */
+    function setParameters(IERC20 _token, uint256 _fee, address _beneficiary) public returns(bytes32) {
+        bytes32 paramsHash = getParametersHash(_token, _fee, _beneficiary);
+        Eif (parameters[paramsHash].token == ERC20(0)) {
+            parameters[paramsHash].token = _token;
+            parameters[paramsHash].fee = _fee;
+            parameters[paramsHash].beneficiary = _beneficiary;
+        }
+        return paramsHash;
+    }
+ 
+    /**
+     * @dev Adding or promoting an address on the registry.
+     *      An address(record) to add or promote can be organization address or any contract address.
+     *      Adding a record is done by paying at least the minimum required by the registry params.
+     *      Promoting a record is done by paying(adding)amount of token to the registry beneficiary.
+     * @param _avatar The _avatar of the organization which own the registry.
+     * @param _record The address to add or promote.
+     * @param _amount amount to pay for adding or promoting
+     */
+    function addOrPromoteAddress(Avatar _avatar, address _record, uint256 _amount)
+    public
+    {
+        Parameters memory params = parameters[getParametersFromController(_avatar)];
+        // Pay promotion, if the org was not listed the minimum is the fee:
+        require((organizationsRegistry[address(_avatar)][_record] > 0) || (_amount >= params.fee));
+ 
+        address(params.token).safeTransferFrom(msg.sender, params.beneficiary, _amount);
+        if (organizationsRegistry[address(_avatar)][_record] == 0) {
+            emit OrgAdded(address(_avatar), _record);
+        }
+        organizationsRegistry[address(_avatar)][_record] =
+        organizationsRegistry[address(_avatar)][_record].add(_amount);
+        emit Promotion(address(_avatar), _record, _amount);
+    }
+ 
+    /**
+    * @dev Hash the parameters ,and return the hash value
+    * @param _token -  the token to pay for register or promotion an address.
+    * @param _fee  - fee needed for register an address.
+    * @param _beneficiary  - the beneficiary payment address
+    * @return bytes32 -the parameters hash
+    */
+    function getParametersHash(IERC20 _token, uint256 _fee, address _beneficiary)
+    public pure returns(bytes32)
+    {
+        return (keccak256(abi.encodePacked(_token, _fee, _beneficiary)));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/universalSchemes/SchemeRegistrar.sol.html b/coverage/universalSchemes/SchemeRegistrar.sol.html new file mode 100644 index 00000000..797b146b --- /dev/null +++ b/coverage/universalSchemes/SchemeRegistrar.sol.html @@ -0,0 +1,641 @@ + + + + Code coverage report for universalSchemes/SchemeRegistrar.sol + + + + + + + +
+
+

+ all files / universalSchemes/ SchemeRegistrar.sol +

+
+
+ 100% + Statements + 35/35 +
+
+ 68.75% + Branches + 11/16 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 36/36 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +11× +11× +11× +11× +11× +11× +  +  +10× +  +  +10× + +  +  +  +  +  +  +  +10× + +  +  +11× +11× +  +  +  +  +  +  +  +  +  +  +  +15× +15× +15× +15× +15× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +11× +11× +  +11× +  +  +  +  +  +  +11× +  +  +  +  +  +11× +  +  +  +  +  +  +  +11× +11× +  +  +  +11× +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  + + + + + +  +  +  + +  +  +  +  +  +  +  +  +30× +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "./UniversalScheme.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+/**
+ * @title A registrar for Schemes for organizations
+ * @dev The SchemeRegistrar is used for registering and unregistering schemes at organizations
+ */
+ 
+contract SchemeRegistrar is UniversalScheme, VotingMachineCallbacks, ProposalExecuteInterface {
+    event NewSchemeProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        address _scheme,
+        bytes32 _parametersHash,
+        bytes4 _permissions,
+        string _descriptionHash
+    );
+ 
+    event RemoveSchemeProposal(address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        address _scheme,
+        string _descriptionHash
+    );
+ 
+    event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param);
+    event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId);
+ 
+    // a SchemeProposal is a  proposal to add or remove a scheme to/from the an organization
+    struct SchemeProposal {
+        address scheme; //
+        bool addScheme; // true: add a scheme, false: remove a scheme.
+        bytes32 parametersHash;
+        bytes4 permissions;
+    }
+ 
+    // A mapping from the organization (Avatar) address to the saved data of the organization:
+    mapping(address=>mapping(bytes32=>SchemeProposal)) public organizationsProposals;
+ 
+    // A mapping from hashes to parameters (use to store a particular configuration on the controller)
+    struct Parameters {
+        bytes32 voteRegisterParams;
+        bytes32 voteRemoveParams;
+        IntVoteInterface intVote;
+    }
+ 
+    mapping(bytes32=>Parameters) public parameters;
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _param a parameter of the voting result, 1 yes and 2 is no.
+    */
+    function executeProposal(bytes32 _proposalId, int256 _param) external onlyVotingMachine(_proposalId) returns(bool) {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        SchemeProposal memory proposal = organizationsProposals[address(avatar)][_proposalId];
+        Erequire(proposal.scheme != address(0));
+        delete organizationsProposals[address(avatar)][_proposalId];
+        emit ProposalDeleted(address(avatar), _proposalId);
+        if (_param == 1) {
+ 
+          // Define controller and get the params:
+            Controller controller = Controller(avatar.owner());
+ 
+          // Add a scheme:
+            if (proposal.addScheme) {
+                Erequire(controller.registerScheme(
+                        proposal.scheme,
+                        proposal.parametersHash,
+                        proposal.permissions,
+                        address(avatar))
+                );
+            }
+          // Remove a scheme:
+            if (!proposal.addScheme) {
+                Erequire(controller.unregisterScheme(proposal.scheme, address(avatar)));
+            }
+        }
+        emit ProposalExecuted(address(avatar), _proposalId, _param);
+        return true;
+    }
+ 
+    /**
+    * @dev hash the parameters, save them if necessary, and return the hash value
+    */
+    function setParameters(
+        bytes32 _voteRegisterParams,
+        bytes32 _voteRemoveParams,
+        IntVoteInterface _intVote
+    ) public returns(bytes32)
+    {
+        bytes32 paramsHash = getParametersHash(_voteRegisterParams, _voteRemoveParams, _intVote);
+        parameters[paramsHash].voteRegisterParams = _voteRegisterParams;
+        parameters[paramsHash].voteRemoveParams = _voteRemoveParams;
+        parameters[paramsHash].intVote = _intVote;
+        return paramsHash;
+    }
+ 
+    /**
+    * @dev create a proposal to register a scheme
+    * @param _avatar the address of the organization the scheme will be registered for
+    * @param _scheme the address of the scheme to be registered
+    * @param _parametersHash a hash of the configuration of the _scheme
+    * @param _permissions the permission of the scheme to be registered
+    * @param _descriptionHash proposal's description hash
+    * @return a proposal Id
+    * @dev NB: not only proposes the vote, but also votes for it
+    */
+    function proposeScheme(
+        Avatar _avatar,
+        address _scheme,
+        bytes32 _parametersHash,
+        bytes4 _permissions,
+        string memory _descriptionHash
+    )
+    public
+    returns(bytes32)
+    {
+        // propose
+        Erequire(_scheme != address(0), "scheme cannot be zero");
+        Parameters memory controllerParams = parameters[getParametersFromController(_avatar)];
+ 
+        bytes32 proposalId = controllerParams.intVote.propose(
+            2,
+            controllerParams.voteRegisterParams,
+            msg.sender,
+            address(_avatar)
+        );
+ 
+        SchemeProposal memory proposal = SchemeProposal({
+            scheme: _scheme,
+            parametersHash: _parametersHash,
+            addScheme: true,
+            permissions: _permissions
+        });
+        emit NewSchemeProposal(
+            address(_avatar),
+            proposalId,
+            address(controllerParams.intVote),
+            _scheme, _parametersHash,
+            _permissions,
+            _descriptionHash
+        );
+        organizationsProposals[address(_avatar)][proposalId] = proposal;
+        proposalsInfo[address(controllerParams.intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev propose to remove a scheme for a controller
+    * @param _avatar the address of the controller from which we want to remove a scheme
+    * @param _scheme the address of the scheme we want to remove
+    * @param _descriptionHash proposal description hash
+    * NB: not only registers the proposal, but also votes for it
+    */
+    function proposeToRemoveScheme(Avatar _avatar, address _scheme, string memory _descriptionHash)
+    public
+    returns(bytes32)
+    {
+        Erequire(_scheme != address(0), "scheme cannot be zero");
+        bytes32 paramsHash = getParametersFromController(_avatar);
+        Parameters memory params = parameters[paramsHash];
+ 
+        IntVoteInterface intVote = params.intVote;
+        bytes32 proposalId = intVote.propose(2, params.voteRemoveParams, msg.sender, address(_avatar));
+        organizationsProposals[address(_avatar)][proposalId].scheme = _scheme;
+        emit RemoveSchemeProposal(address(_avatar), proposalId, address(intVote), _scheme, _descriptionHash);
+        proposalsInfo[address(params.intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return proposalId;
+    }
+ 
+    function getParametersHash(
+        bytes32 _voteRegisterParams,
+        bytes32 _voteRemoveParams,
+        IntVoteInterface _intVote
+    ) public pure returns(bytes32)
+    {
+        return keccak256(abi.encodePacked(_voteRegisterParams, _voteRemoveParams, _intVote));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/universalSchemes/UniversalScheme.sol.html b/coverage/universalSchemes/UniversalScheme.sol.html new file mode 100644 index 00000000..53bfcd62 --- /dev/null +++ b/coverage/universalSchemes/UniversalScheme.sol.html @@ -0,0 +1,116 @@ + + + + Code coverage report for universalSchemes/UniversalScheme.sol + + + + + + + +
+
+

+ all files / universalSchemes/ UniversalScheme.sol +

+
+
+ 100% + Statements + 2/2 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 2/2 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18  +  +  +  +  +  +  +  +  +  +  +  +57× +  +57× +  +  + 
pragma solidity 0.5.17;
+ 
+import "./UniversalSchemeInterface.sol";
+import "../controller/Controller.sol";
+import "../controller/Avatar.sol";
+ 
+ 
+contract UniversalScheme is UniversalSchemeInterface {
+    /**
+    *  @dev get the parameters for the current scheme from the controller
+    */
+    function getParametersFromController(Avatar _avatar) internal view returns(bytes32) {
+        Erequire(Controller(_avatar.owner()).isSchemeRegistered(address(this), address(_avatar)),
+        "scheme is not registered");
+        return Controller(_avatar.owner()).getSchemeParameters(address(this), address(_avatar));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/universalSchemes/UniversalSchemeInterface.sol.html b/coverage/universalSchemes/UniversalSchemeInterface.sol.html new file mode 100644 index 00000000..58f02b59 --- /dev/null +++ b/coverage/universalSchemes/UniversalSchemeInterface.sol.html @@ -0,0 +1,92 @@ + + + + Code coverage report for universalSchemes/UniversalSchemeInterface.sol + + + + + + + +
+
+

+ all files / universalSchemes/ UniversalSchemeInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10  +  +  +  +  +  +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "../controller/Avatar.sol";
+ 
+contract UniversalSchemeInterface {
+ 
+    function getParametersFromController(Avatar _avatar) internal view returns(bytes32);
+    
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/universalSchemes/UpgradeScheme.sol.html b/coverage/universalSchemes/UpgradeScheme.sol.html new file mode 100644 index 00000000..38ebda51 --- /dev/null +++ b/coverage/universalSchemes/UpgradeScheme.sol.html @@ -0,0 +1,638 @@ + + + + Code coverage report for universalSchemes/UpgradeScheme.sol + + + + + + + +
+
+

+ all files / universalSchemes/ UpgradeScheme.sol +

+
+
+ 100% + Statements + 36/36 +
+
+ 72.22% + Branches + 13/18 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 37/37 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + + +  + +  +  + +  + + +  +  +  + + + +  +  + + +  +  +  + + +  +  +  +  +  +  +  +  +  +  + + + + +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  + + +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + +  + +  +  +  +  + +  + +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +18× +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/ProposalExecuteInterface.sol";
+import "./UniversalScheme.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+/**
+ * @title A scheme to manage the upgrade of an organization.
+ * @dev The scheme is used to upgrade the controller of an organization to a new controller.
+ */
+ 
+contract UpgradeScheme is UniversalScheme, VotingMachineCallbacks, ProposalExecuteInterface {
+ 
+    event NewUpgradeProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        address _newController,
+        string _descriptionHash
+    );
+ 
+    event ChangeUpgradeSchemeProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        address _newUpgradeScheme,
+        bytes32 _params,
+        string _descriptionHash
+    );
+ 
+    event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param);
+    event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId);
+ 
+    // Details of an upgrade proposal:
+    struct UpgradeProposal {
+        address upgradeContract; // Either the new controller we upgrade to, or the new upgrading scheme.
+        bytes32 params; // Params for the new upgrading scheme.
+        uint256 proposalType; // 1: Upgrade controller, 2: change upgrade scheme.
+    }
+ 
+    // A mapping from the organization's (Avatar) address to the saved data of the organization:
+    mapping(address=>mapping(bytes32=>UpgradeProposal)) public organizationsProposals;
+ 
+    // A mapping from hashes to parameters (use to store a particular configuration on the controller)
+    struct Parameters {
+        bytes32 voteParams;
+        IntVoteInterface intVote;
+    }
+ 
+    mapping(bytes32=>Parameters) public parameters;
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _param a parameter of the voting result, 1 yes and 2 is no.
+    */
+    function executeProposal(bytes32 _proposalId, int256 _param) external onlyVotingMachine(_proposalId) returns(bool) {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        UpgradeProposal memory proposal = organizationsProposals[address(avatar)][_proposalId];
+        Erequire(proposal.proposalType != 0);
+        delete organizationsProposals[address(avatar)][_proposalId];
+        emit ProposalDeleted(address(avatar), _proposalId);
+        // Check if vote was successful:
+        if (_param == 1) {
+ 
+        // Define controller and get the params:
+            Controller controller = Controller(avatar.owner());
+        // Upgrading controller:
+            if (proposal.proposalType == 1) {
+                Erequire(controller.upgradeController(proposal.upgradeContract, avatar));
+            }
+ 
+        // Changing upgrade scheme:
+            if (proposal.proposalType == 2) {
+                bytes4 permissions = controller.getSchemePermissions(address(this), address(avatar));
+                Erequire(
+                controller.registerScheme(proposal.upgradeContract, proposal.params, permissions, address(avatar))
+                );
+                if (proposal.upgradeContract != address(this)) {
+                    Erequire(controller.unregisterSelf(address(avatar)));
+                }
+            }
+        }
+        emit ProposalExecuted(address(avatar), _proposalId, _param);
+        return true;
+    }
+ 
+    /**
+    * @dev hash the parameters, save them if necessary, and return the hash value
+    */
+    function setParameters(
+        bytes32 _voteParams,
+        IntVoteInterface _intVote
+    ) public returns(bytes32)
+    {
+        bytes32 paramsHash = getParametersHash(_voteParams, _intVote);
+        parameters[paramsHash].voteParams = _voteParams;
+        parameters[paramsHash].intVote = _intVote;
+        return paramsHash;
+    }
+ 
+    /**
+    * @dev propose an upgrade of the organization's controller
+    * @param _avatar avatar of the organization
+    * @param _newController address of the new controller that is being proposed
+    * @param _descriptionHash proposal description hash
+    * @return an id which represents the proposal
+    */
+    function proposeUpgrade(Avatar _avatar, address _newController, string memory _descriptionHash)
+        public
+        returns(bytes32)
+    {
+        Parameters memory params = parameters[getParametersFromController(_avatar)];
+        bytes32 proposalId = params.intVote.propose(2, params.voteParams, msg.sender, address(_avatar));
+        UpgradeProposal memory proposal = UpgradeProposal({
+            proposalType: 1,
+            upgradeContract: _newController,
+            params: bytes32(0)
+        });
+        organizationsProposals[address(_avatar)][proposalId] = proposal;
+        emit NewUpgradeProposal(
+        address(_avatar),
+        proposalId,
+        address(params.intVote),
+        _newController,
+        _descriptionHash
+        );
+        proposalsInfo[address(params.intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev propose to replace this scheme by another upgrading scheme
+    * @param _avatar avatar of the organization
+    * @param _scheme address of the new upgrading scheme
+    * @param _params the parameters of the new upgrading scheme
+    * @param _descriptionHash proposal description hash
+    * @return an id which represents the proposal
+    */
+    function proposeChangeUpgradingScheme(
+        Avatar _avatar,
+        address _scheme,
+        bytes32 _params,
+        string memory _descriptionHash
+    )
+        public
+        returns(bytes32)
+    {
+        Parameters memory params = parameters[getParametersFromController(_avatar)];
+        IntVoteInterface intVote = params.intVote;
+        bytes32 proposalId = intVote.propose(2, params.voteParams, msg.sender, address(_avatar));
+        Erequire(organizationsProposals[address(_avatar)][proposalId].proposalType == 0);
+ 
+        UpgradeProposal memory proposal = UpgradeProposal({
+            proposalType: 2,
+            upgradeContract: _scheme,
+            params: _params
+        });
+        organizationsProposals[address(_avatar)][proposalId] = proposal;
+ 
+        emit ChangeUpgradeSchemeProposal(
+            address(_avatar),
+            proposalId,
+            address(params.intVote),
+            _scheme,
+            _params,
+            _descriptionHash
+        );
+        proposalsInfo[address(intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev return a hash of the given parameters
+    */
+    function getParametersHash(
+        bytes32 _voteParams,
+        IntVoteInterface _intVote
+    ) public pure returns(bytes32)
+    {
+        return  (keccak256(abi.encodePacked(_voteParams, _intVote)));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/universalSchemes/VoteInOrganizationScheme.sol.html b/coverage/universalSchemes/VoteInOrganizationScheme.sol.html new file mode 100644 index 00000000..ef35f780 --- /dev/null +++ b/coverage/universalSchemes/VoteInOrganizationScheme.sol.html @@ -0,0 +1,548 @@ + + + + Code coverage report for universalSchemes/VoteInOrganizationScheme.sol + + + + + + + +
+
+

+ all files / universalSchemes/ VoteInOrganizationScheme.sol +

+
+
+ 100% + Statements + 27/27 +
+
+ 60% + Branches + 6/10 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 28/28 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + +  + + + + + + +  + +  + + +  +  +  +  +  +  +  +  +  + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +11× +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + + + +  +  + +  + +  +  +  +  +  + +  +  +  +  +  +  +  +  + +  +  +  + +  +  +  +  +  +  +  +  +  +  +  +  +  +22× +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/votingMachines/IntVoteInterface.sol";
+import "@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol";
+import "./UniversalScheme.sol";
+import "../votingMachines/VotingMachineCallbacks.sol";
+ 
+ 
+/**
+ * @title VoteInOrganizationScheme.
+ * @dev A scheme to allow an organization to vote in a proposal.
+ */
+contract VoteInOrganizationScheme is UniversalScheme, VotingMachineCallbacks, ProposalExecuteInterface {
+    event NewVoteProposal(
+        address indexed _avatar,
+        bytes32 indexed _proposalId,
+        address indexed _intVoteInterface,
+        IntVoteInterface _originalIntVote,
+        bytes32 _originalProposalId,
+        uint256 _vote,
+        string _descriptionHash
+    );
+ 
+    event ProposalExecuted(address indexed _avatar, bytes32 indexed _proposalId, int256 _param, bytes _callReturnValue);
+    event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId);
+ 
+    // Details of a voting proposal:
+    struct VoteProposal {
+        IntVoteInterface originalIntVote;
+        bytes32 originalProposalId;
+        uint256 vote;
+        bool exist;
+    }
+ 
+    // A mapping from the organization (Avatar) address to the saved data of the organization:
+    mapping(address=>mapping(bytes32=>VoteProposal)) public organizationsProposals;
+ 
+    struct Parameters {
+        IntVoteInterface intVote;
+        bytes32 voteParams;
+    }
+ 
+    // A mapping from hashes to parameters (use to store a particular configuration on the controller)
+    mapping(bytes32=>Parameters) public parameters;
+ 
+    /**
+    * @dev execution of proposals, can only be called by the voting machine in which the vote is held.
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _param a parameter of the voting result, 1 yes and 2 is no.
+    * @return bool which represents a successful of the function
+    */
+    function executeProposal(bytes32 _proposalId, int256 _param) external onlyVotingMachine(_proposalId) returns(bool) {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        // Save proposal to memory and delete from storage:
+        VoteProposal memory proposal = organizationsProposals[address(avatar)][_proposalId];
+        Erequire(proposal.exist);
+        delete organizationsProposals[address(avatar)][_proposalId];
+        emit ProposalDeleted(address(avatar), _proposalId);
+        bytes memory callReturnValue;
+        bool success;
+        // If no decision do nothing:
+        if (_param == 1) {
+ 
+            Controller controller = Controller(avatar.owner());
+            (success, callReturnValue) = controller.genericCall(
+            address(proposal.originalIntVote),
+            abi.encodeWithSignature("vote(bytes32,uint256,uint256,address)",
+            proposal.originalProposalId,
+            proposal.vote,
+            0,
+            address(this)),
+            avatar,
+            0
+            );
+            Erequire(success);
+        }
+        emit ProposalExecuted(address(avatar), _proposalId, _param, callReturnValue);
+        return true;
+    }
+ 
+    /**
+    * @dev Hash the parameters, save them if necessary, and return the hash value
+    * @param _voteParams -  voting parameters
+    * @param _intVote  - voting machine contract.
+    * @return bytes32 -the parameters hash
+    */
+    function setParameters(
+        bytes32 _voteParams,
+        IntVoteInterface _intVote
+    ) public returns(bytes32)
+    {
+        bytes32 paramsHash = getParametersHash(_voteParams, _intVote);
+        parameters[paramsHash].voteParams = _voteParams;
+        parameters[paramsHash].intVote = _intVote;
+        return paramsHash;
+    }
+ 
+    /**
+    * @dev propose to vote in other organization
+    *      The function trigger NewVoteProposal event
+    * @param _avatar avatar of the organization
+    * @param _originalIntVote the other organization voting machine
+    * @param _originalProposalId the other organization proposal id
+    * @param _vote - which value to vote in the destination organization
+    * @param _descriptionHash proposal description hash
+    * @return an id which represents the proposal
+    */
+    function proposeVote(
+    Avatar _avatar,
+    IntVoteInterface _originalIntVote,
+    bytes32 _originalProposalId,
+    uint256 _vote,
+    string memory _descriptionHash)
+    public
+    returns(bytes32)
+    {
+        Parameters memory params = parameters[getParametersFromController(_avatar)];
+        IntVoteInterface intVote = params.intVote;
+        (uint256 minVote, uint256 maxVote) = _originalIntVote.getAllowedRangeOfChoices();
+        Erequire(_vote <= maxVote && _vote >= minVote, "vote should be in the allowed range");
+        Erequire(_vote <= _originalIntVote.getNumberOfChoices(_originalProposalId),
+        "vote should be <= original proposal number of choices");
+ 
+        bytes32 proposalId = intVote.propose(2, params.voteParams, msg.sender, address(_avatar));
+ 
+        organizationsProposals[address(_avatar)][proposalId] = VoteProposal({
+            originalIntVote: _originalIntVote,
+            originalProposalId: _originalProposalId,
+            vote:_vote,
+            exist: true
+        });
+        emit NewVoteProposal(
+            address(_avatar),
+            proposalId,
+            address(params.intVote),
+            _originalIntVote,
+            _originalProposalId,
+            _vote,
+            _descriptionHash
+        );
+        proposalsInfo[address(intVote)][proposalId] = ProposalInfo({
+            blockNumber:block.number,
+            avatar:_avatar
+        });
+        return proposalId;
+    }
+ 
+    /**
+    * @dev Hash the parameters, and return the hash value
+    * @param _voteParams -  voting parameters
+    * @param _intVote  - voting machine contract.
+    * @return bytes32 -the parameters hash
+    */
+    function getParametersHash(
+        bytes32 _voteParams,
+        IntVoteInterface _intVote
+    ) public pure returns(bytes32)
+    {
+        return keccak256(abi.encodePacked(_voteParams, _intVote));
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/universalSchemes/index.html b/coverage/universalSchemes/index.html new file mode 100644 index 00000000..88ec5e6c --- /dev/null +++ b/coverage/universalSchemes/index.html @@ -0,0 +1,197 @@ + + + + Code coverage report for universalSchemes/ + + + + + + + +
+
+

+ all files universalSchemes/ +

+
+
+ 100% + Statements + 301/301 +
+
+ 75% + Branches + 123/164 +
+
+ 100% + Functions + 45/45 +
+
+ 100% + Lines + 305/305 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ContributionReward.sol
100%103/10380%56/70100%16/16100%102/102
DaoCreator.sol
100%47/4768.75%22/32100%6/6100%48/48
GlobalConstraintRegistrar.sol
100%37/3790%9/10100%5/5100%38/38
OrganizationRegister.sol
100%14/1483.33%5/6100%3/3100%14/14
SchemeRegistrar.sol
100%35/3568.75%11/16100%5/5100%36/36
UniversalScheme.sol
100%2/250%1/2100%1/1100%2/2
UniversalSchemeInterface.sol
100%0/0100%0/0100%0/0100%0/0
UpgradeScheme.sol
100%36/3672.22%13/18100%5/5100%37/37
VoteInOrganizationScheme.sol
100%27/2760%6/10100%4/4100%28/28
+
+
+ + + + + + + diff --git a/coverage/utils/DAOTracker.sol.html b/coverage/utils/DAOTracker.sol.html new file mode 100644 index 00000000..9385ee8a --- /dev/null +++ b/coverage/utils/DAOTracker.sol.html @@ -0,0 +1,386 @@ + + + + Code coverage report for utils/DAOTracker.sol + + + + + + + +
+
+

+ all files / utils/ DAOTracker.sol +

+
+
+ 100% + Statements + 11/11 +
+
+ 75% + Branches + 9/12 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 13/13 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +302× +  +298× +  +  +  +298× +  +298× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +298× +298× +  +296× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  +  +  + + + +  +  + 
pragma solidity 0.5.17;
+ 
+import "@daostack/infra/contracts/Reputation.sol";
+import "../controller/DAOToken.sol";
+import "../controller/Avatar.sol";
+import "../controller/Controller.sol";
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+ 
+/**
+ * @title An on-chain "source of truth" for what DAOs
+ *        should be index into DAOstack's subgraph.
+ */
+contract DAOTracker is Ownable {
+ 
+    // `blacklist` the DAO from the subgraph's cache.
+    // Only able to be set by the owner of the DAOTracker.
+    mapping(address=>bool) public blacklisted;
+ 
+    event TrackDAO(
+        address indexed _avatar,
+        address _controller,
+        address _reputation,
+        address _daoToken,
+        address _sender,
+        string _arcVersion
+    );
+ 
+    event BlacklistDAO(
+        address indexed _avatar,
+        string _explanationHash
+    );
+ 
+    event ResetDAO(
+        address indexed _avatar,
+        string _explanationHash
+    );
+ 
+    modifier onlyAvatarOwner(Avatar avatar) {
+        require(avatar.owner() == msg.sender,
+                "The caller must be the owner of the Avatar.");
+        _;
+    }
+ 
+    modifier notBlacklisted(Avatar avatar) {
+        Erequire(blacklisted[address(avatar)] == false,
+                "The avatar has been blacklisted.");
+        _;
+    }
+ 
+    /**
+    * @dev track a new organization. This function will tell the subgraph
+    *      to start ingesting events from the DAO's contracts.
+    *      NOTE: This function should be called as early as possible in the DAO deployment
+    *      process. **Smart Contract Events that are emitted from blocks prior to this function's
+    *      event being emitted WILL NOT be ingested into the subgraph**, leading to an incorrect
+    *      cache. If this happens to you, please contact the subgraph maintainer. Your DAO will
+    *      need to be added to the subgraph's startup config, and the cache will need to be rebuilt.
+    * @param _avatar the organization avatar
+    * @param _controller the organization controller
+    */
+    function track(Avatar _avatar, Controller _controller, string memory _arcVersion)
+    public
+    onlyAvatarOwner(_avatar)
+    notBlacklisted(_avatar) {
+        // Only allow the information to be set once. In the case of a controller upgrades,
+        // the subgraph will be updated via the UpgradeController event.
+        Erequire(_avatar != Avatar(0));
+        require(_controller != Controller(0));
+ 
+        emit TrackDAO(
+            address(_avatar),
+            address(_controller),
+            address(_avatar.nativeReputation()),
+            address(_avatar.nativeToken()),
+            msg.sender,
+            _arcVersion
+        );
+    }
+ 
+    /**
+    * @dev blacklist a DAO from the cache. This should be callable by maintainer of the cache.
+    *      Blacklisting can be used to defend against DoS attacks, or to remove spam. In order
+    *      for this blacklisting to take affect within the cache, it would need to be rebuilt.
+    * @param _avatar the organization avatar
+    * @param _explanationHash A hash of a document explaining why this DAO was blacklisted
+    */
+    function blacklist(Avatar _avatar, string memory _explanationHash)
+    public
+    onlyOwner {
+        require(_avatar != Avatar(0));
+        blacklisted[address(_avatar)] = true;
+        emit BlacklistDAO(address(_avatar), _explanationHash);
+    }
+ 
+    /**
+    * @dev reset a DAO in the cache. This should be callable by the maintainer of the cache.
+    * @param _avatar the organization avatar
+    * @param _explanationHash A hash of a document explaining why this DAO was reset
+    */
+    function reset(Avatar _avatar, string memory _explanationHash)
+    public
+    onlyOwner {
+        Erequire(_avatar != Avatar(0));
+        blacklisted[address(_avatar)] = false;
+        emit ResetDAO(address(_avatar), _explanationHash);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/utils/Redeemer.sol.html b/coverage/utils/Redeemer.sol.html new file mode 100644 index 00000000..b2b07d6b --- /dev/null +++ b/coverage/utils/Redeemer.sol.html @@ -0,0 +1,680 @@ + + + + Code coverage report for utils/Redeemer.sol + + + + + + + +
+
+

+ all files / utils/ Redeemer.sol +

+
+
+ 92% + Statements + 46/50 +
+
+ 68.18% + Branches + 15/22 +
+
+ 100% + Functions + 5/5 +
+
+ 92% + Lines + 46/50 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + + +  + +  + + +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +  +12× +  +  +  + +  +12× +12× +  +12× +12× +10× +  +  +12× +12× +  +  +  +  +  +  +  + + + + + + + + + +  +  + +  + + + +  + +  +  +  + +  +  +  +  +  +  + + + + + + + +  +  + +  + +  + +  +  +  + +  +  + 
pragma solidity 0.5.17;
+ 
+import "../universalSchemes/ContributionReward.sol";
+import "../schemes/ContributionRewardExt.sol";
+import "@daostack/infra/contracts/votingMachines/GenesisProtocol.sol";
+import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
+ 
+ 
+contract Redeemer {
+    using SafeMath for uint;
+ 
+   /**
+    * @dev helper to redeem rewards for a proposal
+    * It calls execute on the proposal if it is not yet executed.
+    * It tries to redeem reputation and stake from the GenesisProtocol.
+    * It tries to redeem proposal rewards from the contribution rewards scheme.
+    * This function does not emit events.
+    * A client should listen to GenesisProtocol and ContributionReward redemption events
+    * to monitor redemption operations.
+    * @param _contributionReward contributionReward
+    * @param _genesisProtocol genesisProtocol
+    * @param _proposalId the ID of the voting in the voting machine
+    * @param _avatar address of the controller
+    * @param _beneficiary beneficiary
+    * @return gpRewards array
+    *          gpRewards[0] - stakerTokenAmount
+    *          gpRewards[1] - voterReputationAmount
+    *          gpRewards[2] - proposerReputationAmount
+    * @return gpDaoBountyReward array
+    *         gpDaoBountyReward[0] - staker dao bounty reward -
+    *                                will be zero for the case there is not enough tokens in avatar for the reward.
+    *         gpDaoBountyReward[1] - staker potential dao bounty reward.
+    * @return executed  bool true or false
+    * @return winningVote
+    *                   1 - executed or closed and the winning vote is YES
+    *                   2 - executed or closed and the winning vote is NO
+    * @return int256 crReputationReward Reputation - from ContributionReward
+    * @return int256 crNativeTokenReward NativeTokenReward - from ContributionReward
+    * @return int256 crEthReward Ether - from ContributionReward
+    * @return int256 crExternalTokenReward ExternalToken - from ContributionReward
+    */
+    function redeem(ContributionReward _contributionReward,
+                    GenesisProtocol _genesisProtocol,
+                    bytes32 _proposalId,
+                    Avatar _avatar,
+                    address _beneficiary)
+    external
+    returns(uint[3] memory gpRewards,
+            uint[2] memory gpDaoBountyReward,
+            bool executed,
+            uint256 winningVote,
+            int256 crReputationReward,
+            uint256 crNativeTokenReward,
+            uint256 crEthReward,
+            uint256 crExternalTokenReward)
+    {
+        bool callContributionReward;
+        (gpRewards, gpDaoBountyReward, executed, winningVote, callContributionReward) =
+        genesisProtocolRedeem(_genesisProtocol, _proposalId, _beneficiary);
+        Eif (callContributionReward) {
+            //redeem from contributionReward only if it executed
+            if (_contributionReward.getProposalExecutionTime(_proposalId, address(_avatar)) > 0) {
+                (crReputationReward, crNativeTokenReward, crEthReward, crExternalTokenReward) =
+                contributionRewardRedeem(_contributionReward, _proposalId, _avatar);
+            }
+        }
+    }
+ 
+    /**
+     * @dev helper to redeem rewards for a proposal
+     * It calls execute on the proposal if it is not yet executed.
+     * It tries to redeem reputation and stake from the GenesisProtocol.
+     * It tries to redeem proposal rewards from the contribution rewards scheme.
+     * This function does not emit events.
+     * A client should listen to GenesisProtocol and ContributionReward redemption events
+     * to monitor redemption operations.
+     * @param _contributionRewardExt contributionRewardExt
+     * @param _genesisProtocol genesisProtocol
+     * @param _proposalId the ID of the voting in the voting machine
+     * @param _beneficiary beneficiary
+     * @return gpRewards array
+     *          gpRewards[0] - stakerTokenAmount
+     *          gpRewards[1] - voterReputationAmount
+     *          gpRewards[2] - proposerReputationAmount
+     * @return gpDaoBountyReward array
+     *         gpDaoBountyReward[0] - staker dao bounty reward -
+     *                                will be zero for the case there is not enough tokens in avatar for the reward.
+     *         gpDaoBountyReward[1] - staker potential dao bounty reward.
+     * @return executed  bool true or false
+     * @return winningVote
+     *                   1 - executed or closed and the winning vote is YES
+     *                   2 - executed or closed and the winning vote is NO
+     * @return int256 crReputationReward Reputation - from ContributionReward
+     * @return int256 crNativeTokenReward NativeTokenReward - from ContributionReward
+     * @return int256 crEthReward Ether - from ContributionReward
+     * @return int256 crExternalTokenReward ExternalToken - from ContributionReward
+     */
+    function redeemFromCRExt(ContributionRewardExt _contributionRewardExt,
+                            GenesisProtocol _genesisProtocol,
+                            bytes32 _proposalId,
+                            address _beneficiary)
+        external
+        returns(uint[3] memory gpRewards,
+                uint[2] memory gpDaoBountyReward,
+                bool executed,
+                uint256 winningVote,
+                int256 crReputationReward,
+                uint256 crNativeTokenReward,
+                uint256 crEthReward,
+                uint256 crExternalTokenReward)
+    {
+        bool callContributionReward;
+        (gpRewards, gpDaoBountyReward, executed, winningVote, callContributionReward) =
+        genesisProtocolRedeem(_genesisProtocol, _proposalId, _beneficiary);
+        Eif (callContributionReward) {
+               //redeem from contributionReward only if it executed
+            if (_contributionRewardExt.getProposalAcceptedByVotingMachine(_proposalId)) {
+                (crReputationReward, crNativeTokenReward, crEthReward, crExternalTokenReward) =
+                contributionRewardExtRedeem(_contributionRewardExt, _proposalId);
+            }
+        }
+    }
+ 
+    function genesisProtocolRedeem(GenesisProtocol _genesisProtocol,
+                                    bytes32 _proposalId,
+                                    address _beneficiary)
+    private
+    returns(uint[3] memory gpRewards,
+            uint[2] memory gpDaoBountyReward,
+            bool executed,
+            uint256 winningVote,
+            bool callContributionReward) {
+        GenesisProtocol.ProposalState pState = _genesisProtocol.state(_proposalId);
+ 
+        if ((pState == GenesisProtocolLogic.ProposalState.Queued)||
+            (pState == GenesisProtocolLogic.ProposalState.PreBoosted)||
+            (pState == GenesisProtocolLogic.ProposalState.Boosted)||
+            (pState == GenesisProtocolLogic.ProposalState.QuietEndingPeriod)) {
+            executed = _genesisProtocol.execute(_proposalId);
+        }
+        pState = _genesisProtocol.state(_proposalId);
+        Eif ((pState == GenesisProtocolLogic.ProposalState.Executed) ||
+            (pState == GenesisProtocolLogic.ProposalState.ExpiredInQueue)) {
+            gpRewards = _genesisProtocol.redeem(_proposalId, _beneficiary);
+            if (pState == GenesisProtocolLogic.ProposalState.Executed) {
+                (gpDaoBountyReward[0], gpDaoBountyReward[1]) =
+                _genesisProtocol.redeemDaoBounty(_proposalId, _beneficiary);
+            }
+            winningVote = _genesisProtocol.winningVote(_proposalId);
+            callContributionReward = true;
+        }
+    }
+ 
+    function contributionRewardRedeem(ContributionReward _contributionReward, bytes32 _proposalId, Avatar _avatar)
+    private
+    returns (int256 reputation, uint256 nativeToken, uint256 eth, uint256 externalToken)
+    {
+        bool[4] memory whatToRedeem;
+        whatToRedeem[0] = true; //reputation
+        whatToRedeem[1] = true; //nativeToken
+        uint256 periodsToPay = _contributionReward.getPeriodsToPay(_proposalId, address(_avatar), 2);
+        uint256 ethReward = _contributionReward.getProposalEthReward(_proposalId, address(_avatar));
+        uint256 externalTokenReward = _contributionReward.getProposalExternalTokenReward(_proposalId, address(_avatar));
+        address externalTokenAddress = _contributionReward.getProposalExternalToken(_proposalId, address(_avatar));
+        ethReward = periodsToPay.mul(ethReward);
+        Iif ((ethReward == 0) || (address(_avatar).balance < ethReward)) {
+            whatToRedeem[2] = false;
+        } else {
+            whatToRedeem[2] = true;
+        }
+        periodsToPay = _contributionReward.getPeriodsToPay(_proposalId, address(_avatar), 3);
+        externalTokenReward = periodsToPay.mul(externalTokenReward);
+        Eif ((externalTokenReward == 0) ||
+            (IERC20(externalTokenAddress).balanceOf(address(_avatar)) < externalTokenReward)) {
+            whatToRedeem[3] = false;
+        } else {
+            whatToRedeem[3] = true;
+        }
+        (reputation, nativeToken, eth, externalToken) = _contributionReward.redeem(_proposalId, _avatar, whatToRedeem);
+    }
+ 
+    function contributionRewardExtRedeem(ContributionRewardExt _contributionRewardExt, bytes32 _proposalId)
+    private
+    returns (int256 reputation, uint256 nativeToken, uint256 eth, uint256 externalToken)
+    {
+        bool[4] memory whatToRedeem;
+        whatToRedeem[0] = true; //reputation
+        whatToRedeem[1] = true; //nativeToken
+        uint256 ethReward = _contributionRewardExt.getProposalEthReward(_proposalId);
+        uint256 externalTokenReward = _contributionRewardExt.getProposalExternalTokenReward(_proposalId);
+        address externalTokenAddress = _contributionRewardExt.getProposalExternalToken(_proposalId);
+        Iif ((ethReward == 0) || (address(_contributionRewardExt.avatar()).balance < ethReward)) {
+            whatToRedeem[2] = false;
+        } else {
+            whatToRedeem[2] = true;
+        }
+        Eif ((externalTokenReward == 0) ||
+            (IERC20(externalTokenAddress).balanceOf(address(_contributionRewardExt.avatar())) < externalTokenReward)) {
+            whatToRedeem[3] = false;
+        } else {
+            whatToRedeem[3] = true;
+        }
+        (reputation, nativeToken, eth, externalToken) = _contributionRewardExt.redeem(_proposalId, whatToRedeem);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/utils/RepAllocation.sol.html b/coverage/utils/RepAllocation.sol.html new file mode 100644 index 00000000..518b6159 --- /dev/null +++ b/coverage/utils/RepAllocation.sol.html @@ -0,0 +1,248 @@ + + + + Code coverage report for utils/RepAllocation.sol + + + + + + + +
+
+

+ all files / utils/ RepAllocation.sol +

+
+
+ 100% + Statements + 9/9 +
+
+ 83.33% + Branches + 5/6 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 9/9 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +33× +  +31× +30× +30× +  +  +  +  +  +  +  +  + + + +  +  +  +  +  +  +  +  + +  +  +  +  +  +  +  + +  +  +  + 
pragma solidity 0.5.17;
+ 
+import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
+ 
+ 
+/**
+ * @title reputation allocation contract
+ * This scheme can be used to allocate a pre define amount of reputation to whitelisted
+ * beneficiaries.
+ * this contract can be used as the rep mapping contract for  RepitationFromToken contract.
+ */
+contract RepAllocation is Ownable {
+ 
+ 
+       // beneficiary -> amount
+    mapping(address   =>   uint256) public reputationAllocations;
+    bool public isFreeze;
+ 
+    event BeneficiaryAddressAdded(address indexed _beneficiary, uint256 indexed _amount);
+ 
+    /**
+     * @dev addBeneficiary function
+     * @param _beneficiary to be whitelisted
+     */
+    function addBeneficiary(address _beneficiary, uint256 _amount) public onlyOwner {
+        require(!isFreeze, "can add beneficiary only if not disable");
+ 
+        if (reputationAllocations[_beneficiary] == 0) {
+            reputationAllocations[_beneficiary] = _amount;
+            emit BeneficiaryAddressAdded(_beneficiary, _amount);
+        }
+    }
+ 
+    /**
+     * @dev add addBeneficiaries function
+     * @param _beneficiaries addresses
+     */
+    function addBeneficiaries(address[] memory _beneficiaries, uint256[] memory _amounts) public onlyOwner {
+        Erequire(_beneficiaries.length == _amounts.length);
+        for (uint256 i = 0; i < _beneficiaries.length; i++) {
+            addBeneficiary(_beneficiaries[i], _amounts[i]);
+        }
+    }
+ 
+    /**
+     * @dev freeze function
+     * cannot defreeze
+     */
+    function freeze() public onlyOwner {
+        isFreeze = true;
+    }
+ 
+    /**
+     * @dev get balanceOf _beneficiary function
+     * @param _beneficiary addresses
+     */
+    function balanceOf(address _beneficiary) public view returns(uint256) {
+        return reputationAllocations[_beneficiary];
+    }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/utils/index.html b/coverage/utils/index.html new file mode 100644 index 00000000..7ab2e965 --- /dev/null +++ b/coverage/utils/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for utils/ + + + + + + + +
+
+

+ all files utils/ +

+
+
+ 94.29% + Statements + 66/70 +
+
+ 72.5% + Branches + 29/40 +
+
+ 100% + Functions + 14/14 +
+
+ 94.44% + Lines + 68/72 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
DAOTracker.sol
100%11/1175%9/12100%5/5100%13/13
Redeemer.sol
92%46/5068.18%15/22100%5/592%46/50
RepAllocation.sol
100%9/983.33%5/6100%4/4100%9/9
+
+
+ + + + + + + diff --git a/coverage/votingMachines/VotingMachineCallbacks.sol.html b/coverage/votingMachines/VotingMachineCallbacks.sol.html new file mode 100644 index 00000000..a0d6e115 --- /dev/null +++ b/coverage/votingMachines/VotingMachineCallbacks.sol.html @@ -0,0 +1,320 @@ + + + + Code coverage report for votingMachines/VotingMachineCallbacks.sol + + + + + + + +
+
+

+ all files / votingMachines/ VotingMachineCallbacks.sol +

+
+
+ 76% + Statements + 19/25 +
+
+ 57.14% + Branches + 8/14 +
+
+ 100% + Functions + 7/7 +
+
+ 76.92% + Lines + 20/26 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86  +  +  +  +  +  +  +  +  +  +  +  +  +  +120× +110× +  +  +  +  +  +  +  +  +  +  +13× +13× +  +  +13× +  +  +  +  +  +  +  +18× +18× +  +  +18× +  +  +  +  +  +  +  +  +  +  +  + + +  +  + +  +  +  + + +  +  + +  +  +  +108× +108× +  +  +108× +  +  +  +81× +81× +  +  +81× +  +  + 
pragma solidity 0.5.17;
+ 
+import "../universalSchemes/UniversalScheme.sol";
+import "@daostack/infra/contracts/votingMachines/GenesisProtocol.sol";
+ 
+ 
+contract VotingMachineCallbacks is VotingMachineCallbacksInterface {
+ 
+    struct ProposalInfo {
+        uint256 blockNumber; // the proposal's block number
+        Avatar avatar; // the proposal's avatar
+    }
+ 
+    modifier onlyVotingMachine(bytes32 _proposalId) {
+        require(proposalsInfo[msg.sender][_proposalId].avatar != Avatar(address(0)), "only VotingMachine");
+        _;
+    }
+ 
+    // VotingMaching  ->  proposalId  ->  ProposalInfo
+    mapping(address => mapping(bytes32 => ProposalInfo)) public proposalsInfo;
+ 
+    function mintReputation(uint256 _amount, address _beneficiary, bytes32 _proposalId)
+    external
+    onlyVotingMachine(_proposalId)
+    returns(bool)
+    {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        Iif (avatar == Avatar(0)) {
+            return false;
+        }
+        return Controller(avatar.owner()).mintReputation(_amount, _beneficiary, address(avatar));
+    }
+ 
+    function burnReputation(uint256 _amount, address _beneficiary, bytes32 _proposalId)
+    external
+    onlyVotingMachine(_proposalId)
+    returns(bool)
+    {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        Iif (avatar == Avatar(0)) {
+            return false;
+        }
+        return Controller(avatar.owner()).burnReputation(_amount, _beneficiary, address(avatar));
+    }
+ 
+    function stakingTokenTransfer(
+        IERC20 _stakingToken,
+        address _beneficiary,
+        uint256 _amount,
+        bytes32 _proposalId)
+    external
+    onlyVotingMachine(_proposalId)
+    returns(bool)
+    {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        Iif (avatar == Avatar(0)) {
+            return false;
+        }
+        return Controller(avatar.owner()).externalTokenTransfer(_stakingToken, _beneficiary, _amount, avatar);
+    }
+ 
+    function balanceOfStakingToken(IERC20 _stakingToken, bytes32 _proposalId) external view returns(uint256) {
+        Avatar avatar = proposalsInfo[msg.sender][_proposalId].avatar;
+        Iif (proposalsInfo[msg.sender][_proposalId].avatar == Avatar(0)) {
+            return 0;
+        }
+        return _stakingToken.balanceOf(address(avatar));
+    }
+ 
+    function getTotalReputationSupply(bytes32 _proposalId) external view returns(uint256) {
+        ProposalInfo memory proposal = proposalsInfo[msg.sender][_proposalId];
+        Iif (proposal.avatar == Avatar(0)) {
+            return 0;
+        }
+        return proposal.avatar.nativeReputation().totalSupplyAt(proposal.blockNumber);
+    }
+ 
+    function reputationOf(address _owner, bytes32 _proposalId) external view returns(uint256) {
+        ProposalInfo memory proposal = proposalsInfo[msg.sender][_proposalId];
+        Iif (proposal.avatar == Avatar(0)) {
+            return 0;
+        }
+        return proposal.avatar.nativeReputation().balanceOfAt(_owner, proposal.blockNumber);
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/votingMachines/index.html b/coverage/votingMachines/index.html new file mode 100644 index 00000000..7299c323 --- /dev/null +++ b/coverage/votingMachines/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for votingMachines/ + + + + + + + +
+
+

+ all files votingMachines/ +

+
+
+ 76% + Statements + 19/25 +
+
+ 57.14% + Branches + 8/14 +
+
+ 100% + Functions + 7/7 +
+
+ 76.92% + Lines + 20/26 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
VotingMachineCallbacks.sol
76%19/2557.14%8/14100%7/776.92%20/26
+
+
+ + + + + + + diff --git a/package-lock.json b/package-lock.json index ae83e662..b0d2d241 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@babel/cli": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.8.4.tgz", - "integrity": "sha512-XXLgAm6LBbaNxaGhMAznXXaxtCWfuv6PIDJ9Alsy9JYTOh+j2jJz+L/162kkfU1j/pTSxK1xGmlwI4pdIMkoag==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.10.1.tgz", + "integrity": "sha512-cVB+dXeGhMOqViIaZs3A9OUAe4pKw4SBNdMw6yHJMYR7s4TB+Cei7ThquV/84O19PdIFWuwe03vxxES0BHUm5g==", "dev": true, "requires": { "chokidar": "^2.1.8", @@ -31,46 +31,52 @@ } }, "@babel/generator": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz", - "integrity": "sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.2.tgz", + "integrity": "sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==", "dev": true, "requires": { - "@babel/types": "^7.8.3", + "@babel/types": "^7.10.2", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" } }, "@babel/helper-function-name": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz", - "integrity": "sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.1.tgz", + "integrity": "sha512-fcpumwhs3YyZ/ttd5Rz0xn0TpIwVkN7X0V38B9TWNfVF42KEkhkAAuPCQ3oXmtTRtiPJrmZ0TrfS0GKF0eMaRQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/helper-get-function-arity": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.1.tgz", + "integrity": "sha512-F5qdXkYGOQUb0hpRaPoetF9AnsXknKjWMZ+wmsIRsp5ge5sFh4c3h1eH2pRTTuy9KKAA2+TTYomGXAtEL2fQEw==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.1.tgz", + "integrity": "sha512-UQ1LVBPrYdbchNhLwj6fetj46BcFwfS4NllJo/1aJsT+1dLTEnXJL0qHqtY7gPzF8S2fXBJamf1biAXV3X077g==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, + "@babel/helper-validator-identifier": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz", + "integrity": "sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==", + "dev": true + }, "@babel/highlight": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", @@ -83,39 +89,99 @@ } }, "@babel/parser": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz", - "integrity": "sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz", + "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ==", "dev": true }, + "@babel/runtime-corejs3": { + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.10.2.tgz", + "integrity": "sha512-+a2M/u7r15o3dV1NEizr9bRi+KUVnrs/qYxF0Z06DAPx/4VCWaz1WA7EcbE+uqGgt39lp5akWGmHsTseIkHkHg==", + "dev": true, + "requires": { + "core-js-pure": "^3.0.0", + "regenerator-runtime": "^0.13.4" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.13.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true + } + } + }, "@babel/template": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz", - "integrity": "sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz", + "integrity": "sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/code-frame": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", + "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.1" + } + }, + "@babel/highlight": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", + "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.1", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + } } }, "@babel/traverse": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz", - "integrity": "sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.1.tgz", + "integrity": "sha512-C/cTuXeKt85K+p08jN6vMDz8vSV0vZcI0wmQ36o6mjbuo++kPMdpOYw23W2XH04dbRt9/nMEfA4W3eR21CD+TQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.4", - "@babel/helper-function-name": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.8.4", - "@babel/types": "^7.8.3", + "@babel/code-frame": "^7.10.1", + "@babel/generator": "^7.10.1", + "@babel/helper-function-name": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" }, "dependencies": { + "@babel/code-frame": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", + "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.1" + } + }, + "@babel/highlight": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", + "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.1", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -128,12 +194,12 @@ } }, "@babel/types": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz", - "integrity": "sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz", + "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==", "dev": true, "requires": { - "esutils": "^2.0.2", + "@babel/helper-validator-identifier": "^7.10.1", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } @@ -154,6 +220,32 @@ } } }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, "@resolver-engine/core": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/@resolver-engine/core/-/core-0.2.1.tgz", @@ -192,6 +284,438 @@ "debug": "^3.1.0" } }, + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true + }, + "@solidity-parser/parser": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.6.1.tgz", + "integrity": "sha512-MUA5kP9LdeTILeOsaz/k/qA4MdTNUxrn6q6HMYsMzQN5crU9bWKND2DaoWZhzofQM0VaTOaD8GFkCw1BYbNj5w==" + }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "requires": { + "defer-to-connect": "^1.0.1" + } + }, + "@truffle/error": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.7.tgz", + "integrity": "sha512-UIfVKsXSXocKnn5+RNklUXNoGd/JVj7V8KmC48TQzmjU33HQI86PX0JDS7SpHMHasI3w9X//1q7Lu7nZtj3Zzg==", + "dev": true + }, + "@truffle/interface-adapter": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.3.3.tgz", + "integrity": "sha512-l3I4WFTfnBSIfG96IOBRtAIE6AHDAxcOUJE7W5zh9hocQwzQlGWc2yEyyTcLa0656TTM8RxaZZ2S/KdHHMvCaw==", + "dev": true, + "requires": { + "bn.js": "^4.11.8", + "ethers": "^4.0.32", + "lodash": "^4.17.13", + "web3": "1.2.2" + }, + "dependencies": { + "@types/node": { + "version": "12.12.42", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.42.tgz", + "integrity": "sha512-R/9QdYFLL9dE9l5cWWzWIZByVGFd7lk7JVOJ7KD+E1SJ4gni7XJRLz9QTjyYQiHIqEAgku9VgxdLjMlhhUaAFg==", + "dev": true + }, + "web3": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.2.tgz", + "integrity": "sha512-/ChbmB6qZpfGx6eNpczt5YSUBHEA5V2+iUCbn85EVb3Zv6FVxrOo5Tv7Lw0gE2tW7EEjASbCyp3mZeiZaCCngg==", + "dev": true, + "requires": { + "@types/node": "^12.6.1", + "web3-bzz": "1.2.2", + "web3-core": "1.2.2", + "web3-eth": "1.2.2", + "web3-eth-personal": "1.2.2", + "web3-net": "1.2.2", + "web3-shh": "1.2.2", + "web3-utils": "1.2.2" + } + } + } + }, + "@truffle/provider": { + "version": "0.1.19", + "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.1.19.tgz", + "integrity": "sha512-ke8iQmzW4Y99+8iff8xQcc+mCNU4AkwtaZ/iSpmVD8qpLytw8/DSNCm0RiEz9/+I93Q1zqI4Jnij/rXnkS2Njw==", + "dev": true, + "requires": { + "@truffle/error": "^0.0.7", + "@truffle/interface-adapter": "^0.3.0", + "web3": "1.2.1" + }, + "dependencies": { + "@types/node": { + "version": "10.17.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.24.tgz", + "integrity": "sha512-5SCfvCxV74kzR3uWgTYiGxrd69TbT1I6+cMx1A5kEly/IVveJBimtAMlXiEyVFn5DvUFewQWxOOiJhlxeQwxgA==", + "dev": true + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "ethers": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.3.tgz", + "integrity": "sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog==", + "dev": true, + "requires": { + "@types/node": "^10.3.2", + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.3.3", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.3", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + }, + "dependencies": { + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" + } + } + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "scrypt-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", + "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=", + "dev": true + }, + "semver": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", + "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==", + "dev": true + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", + "dev": true + }, + "web3": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.1.tgz", + "integrity": "sha512-nNMzeCK0agb5i/oTWNdQ1aGtwYfXzHottFP2Dz0oGIzavPMGSKyVlr8ibVb1yK5sJBjrWVnTdGaOC2zKDFuFRw==", + "dev": true, + "requires": { + "web3-bzz": "1.2.1", + "web3-core": "1.2.1", + "web3-eth": "1.2.1", + "web3-eth-personal": "1.2.1", + "web3-net": "1.2.1", + "web3-shh": "1.2.1", + "web3-utils": "1.2.1" + } + }, + "web3-bzz": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.1.tgz", + "integrity": "sha512-LdOO44TuYbGIPfL4ilkuS89GQovxUpmLz6C1UC7VYVVRILeZS740FVB3j9V4P4FHUk1RenaDfKhcntqgVCHtjw==", + "dev": true, + "requires": { + "got": "9.6.0", + "swarm-js": "0.1.39", + "underscore": "1.9.1" + } + }, + "web3-core": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.1.tgz", + "integrity": "sha512-5ODwIqgl8oIg/0+Ai4jsLxkKFWJYE0uLuE1yUKHNVCL4zL6n3rFjRMpKPokd6id6nJCNgeA64KdWQ4XfpnjdMg==", + "dev": true, + "requires": { + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-core-requestmanager": "1.2.1", + "web3-utils": "1.2.1" + } + }, + "web3-core-helpers": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.1.tgz", + "integrity": "sha512-Gx3sTEajD5r96bJgfuW377PZVFmXIH4TdqDhgGwd2lZQCcMi+DA4TgxJNJGxn0R3aUVzyyE76j4LBrh412mXrw==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-eth-iban": "1.2.1", + "web3-utils": "1.2.1" + } + }, + "web3-core-method": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.1.tgz", + "integrity": "sha512-Ghg2WS23qi6Xj8Od3VCzaImLHseEA7/usvnOItluiIc5cKs00WYWsNy2YRStzU9a2+z8lwQywPYp0nTzR/QXdQ==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.1", + "web3-core-promievent": "1.2.1", + "web3-core-subscriptions": "1.2.1", + "web3-utils": "1.2.1" + } + }, + "web3-core-promievent": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.1.tgz", + "integrity": "sha512-IVUqgpIKoeOYblwpex4Hye6npM0aMR+kU49VP06secPeN0rHMyhGF0ZGveWBrGvf8WDPI7jhqPBFIC6Jf3Q3zw==", + "dev": true, + "requires": { + "any-promise": "1.3.0", + "eventemitter3": "3.1.2" + } + }, + "web3-core-requestmanager": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.1.tgz", + "integrity": "sha512-xfknTC69RfYmLKC+83Jz73IC3/sS2ZLhGtX33D4Q5nQ8yc39ElyAolxr9sJQS8kihOcM6u4J+8gyGMqsLcpIBg==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.1", + "web3-providers-http": "1.2.1", + "web3-providers-ipc": "1.2.1", + "web3-providers-ws": "1.2.1" + } + }, + "web3-core-subscriptions": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.1.tgz", + "integrity": "sha512-nmOwe3NsB8V8UFsY1r+sW6KjdOS68h8nuh7NzlWxBQT/19QSUGiERRTaZXWu5BYvo1EoZRMxCKyCQpSSXLc08g==", + "dev": true, + "requires": { + "eventemitter3": "3.1.2", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.1" + } + }, + "web3-eth": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.1.tgz", + "integrity": "sha512-/2xly4Yry5FW1i+uygPjhfvgUP/MS/Dk+PDqmzp5M88tS86A+j8BzKc23GrlA8sgGs0645cpZK/999LpEF5UdA==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-core-subscriptions": "1.2.1", + "web3-eth-abi": "1.2.1", + "web3-eth-accounts": "1.2.1", + "web3-eth-contract": "1.2.1", + "web3-eth-ens": "1.2.1", + "web3-eth-iban": "1.2.1", + "web3-eth-personal": "1.2.1", + "web3-net": "1.2.1", + "web3-utils": "1.2.1" + } + }, + "web3-eth-abi": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.1.tgz", + "integrity": "sha512-jI/KhU2a/DQPZXHjo2GW0myEljzfiKOn+h1qxK1+Y9OQfTcBMxrQJyH5AP89O6l6NZ1QvNdq99ThAxBFoy5L+g==", + "dev": true, + "requires": { + "ethers": "4.0.0-beta.3", + "underscore": "1.9.1", + "web3-utils": "1.2.1" + } + }, + "web3-eth-accounts": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.1.tgz", + "integrity": "sha512-26I4qq42STQ8IeKUyur3MdQ1NzrzCqPsmzqpux0j6X/XBD7EjZ+Cs0lhGNkSKH5dI3V8CJasnQ5T1mNKeWB7nQ==", + "dev": true, + "requires": { + "any-promise": "1.3.0", + "crypto-browserify": "3.12.0", + "eth-lib": "0.2.7", + "scryptsy": "2.1.0", + "semver": "6.2.0", + "underscore": "1.9.1", + "uuid": "3.3.2", + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-utils": "1.2.1" + }, + "dependencies": { + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + } + } + }, + "web3-eth-contract": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.1.tgz", + "integrity": "sha512-kYFESbQ3boC9bl2rYVghj7O8UKMiuKaiMkxvRH5cEDHil8V7MGEGZNH0slSdoyeftZVlaWSMqkRP/chfnKND0g==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-core-promievent": "1.2.1", + "web3-core-subscriptions": "1.2.1", + "web3-eth-abi": "1.2.1", + "web3-utils": "1.2.1" + } + }, + "web3-eth-ens": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.1.tgz", + "integrity": "sha512-lhP1kFhqZr2nnbu3CGIFFrAnNxk2veXpOXBY48Tub37RtobDyHijHgrj+xTh+mFiPokyrapVjpFsbGa+Xzye4Q==", + "dev": true, + "requires": { + "eth-ens-namehash": "2.0.8", + "underscore": "1.9.1", + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-promievent": "1.2.1", + "web3-eth-abi": "1.2.1", + "web3-eth-contract": "1.2.1", + "web3-utils": "1.2.1" + } + }, + "web3-eth-iban": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.1.tgz", + "integrity": "sha512-9gkr4QPl1jCU+wkgmZ8EwODVO3ovVj6d6JKMos52ggdT2YCmlfvFVF6wlGLwi0VvNa/p+0BjJzaqxnnG/JewjQ==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "web3-utils": "1.2.1" + } + }, + "web3-eth-personal": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.1.tgz", + "integrity": "sha512-RNDVSiaSoY4aIp8+Hc7z+X72H7lMb3fmAChuSBADoEc7DsJrY/d0R5qQDK9g9t2BO8oxgLrLNyBP/9ub2Hc6Bg==", + "dev": true, + "requires": { + "web3-core": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-method": "1.2.1", + "web3-net": "1.2.1", + "web3-utils": "1.2.1" + } + }, + "web3-net": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.1.tgz", + "integrity": "sha512-Yt1Bs7WgnLESPe0rri/ZoPWzSy55ovioaP35w1KZydrNtQ5Yq4WcrAdhBzcOW7vAkIwrsLQsvA+hrOCy7mNauw==", + "dev": true, + "requires": { + "web3-core": "1.2.1", + "web3-core-method": "1.2.1", + "web3-utils": "1.2.1" + } + }, + "web3-providers-http": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.1.tgz", + "integrity": "sha512-BDtVUVolT9b3CAzeGVA/np1hhn7RPUZ6YYGB/sYky+GjeO311Yoq8SRDUSezU92x8yImSC2B+SMReGhd1zL+bQ==", + "dev": true, + "requires": { + "web3-core-helpers": "1.2.1", + "xhr2-cookies": "1.1.0" + } + }, + "web3-providers-ipc": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.1.tgz", + "integrity": "sha512-oPEuOCwxVx8L4CPD0TUdnlOUZwGBSRKScCz/Ws2YHdr9Ium+whm+0NLmOZjkjQp5wovQbyBzNa6zJz1noFRvFA==", + "dev": true, + "requires": { + "oboe": "2.1.4", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.1" + } + }, + "web3-providers-ws": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.1.tgz", + "integrity": "sha512-oqsQXzu+ejJACVHy864WwIyw+oB21nw/pI65/sD95Zi98+/HQzFfNcIFneF1NC4bVF3VNX4YHTNq2I2o97LAiA==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.1", + "websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis" + } + }, + "web3-shh": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.1.tgz", + "integrity": "sha512-/3Cl04nza5kuFn25bV3FJWa0s3Vafr5BlT933h26xovQ6HIIz61LmvNQlvX1AhFL+SNJOTcQmK1SM59vcyC8bA==", + "dev": true, + "requires": { + "web3-core": "1.2.1", + "web3-core-method": "1.2.1", + "web3-core-subscriptions": "1.2.1", + "web3-net": "1.2.1" + } + }, + "web3-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz", + "integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randomhex": "0.1.5", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } + } + }, "@types/babel-types": { "version": "7.0.7", "resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.7.tgz", @@ -215,11 +739,98 @@ "@types/node": "*" } }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, "@types/node": { "version": "13.7.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-13.7.0.tgz", "integrity": "sha512-GnZbirvmqZUzMgkFn70c74OQpTTUcCzlhQliTzYjQMqg+hVKcDnxdL19Ne3UdYzdMA/+W3eb646FWn/ZaT1NfQ==" }, + "@web3-js/scrypt-shim": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@web3-js/scrypt-shim/-/scrypt-shim-0.1.0.tgz", + "integrity": "sha512-ZtZeWCc/s0nMcdx/+rZwY1EcuRdemOK9ag21ty9UsHkFxsNb/AaoucUz0iPuyGe0Ku+PFuRmWZG7Z7462p9xPw==", + "dev": true, + "requires": { + "scryptsy": "^2.1.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@web3-js/websocket": { + "version": "1.0.30", + "resolved": "https://registry.npmjs.org/@web3-js/websocket/-/websocket-1.0.30.tgz", + "integrity": "sha512-fDwrD47MiDrzcJdSeTLF75aCcxVVt8B1N74rA+vh2XCAvFy4tEWJjtnUtj2QG7/zlQ6g9cQ88bZFBxwd9/FmtA==", + "dev": true, + "requires": { + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "nan": "^2.14.0", + "typedarray-to-buffer": "^3.1.5", + "yaeti": "^0.0.6" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, "acorn": { "version": "6.4.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", @@ -249,10 +860,22 @@ "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==", "dev": true }, - "ajv": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz", - "integrity": "sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==", + "address": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/address/-/address-1.1.2.tgz", + "integrity": "sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA==", + "dev": true + }, + "aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=", + "dev": true + }, + "ajv": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz", + "integrity": "sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==", "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -282,6 +905,13 @@ } } }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true, + "optional": true + }, "amp": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/amp/-/amp-0.3.1.tgz", @@ -324,6 +954,12 @@ "integrity": "sha512-haHyTW7Y9joE5MVs37P2lNYfU2RWBLfcRDD8OWldcdZm5TiCE91B5Xl1oWSwiDUSd4rlExpt2pu1fksYQjRBYQ==", "dev": true }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", + "dev": true + }, "anymatch": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", @@ -378,6 +1014,12 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true + }, "array-includes": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", @@ -389,6 +1031,12 @@ "is-string": "^1.0.5" } }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", @@ -419,6 +1067,17 @@ "safer-buffer": "~2.1.0" } }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", @@ -451,6 +1110,12 @@ "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", "dev": true }, + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "dev": true + }, "async-listener": { "version": "0.6.10", "resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.6.10.tgz", @@ -577,15 +1242,15 @@ } }, "babel-eslint": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.0.3.tgz", - "integrity": "sha512-z3U7eMY6r/3f3/JB9mTsLjyxrv0Yb1zb8PCWCLpguxfCzBIZUwy23R1t/XKewP+8mEN2Ck8Dtr4q20z6ce6SoA==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", + "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.0.0", - "@babel/traverse": "^7.0.0", - "@babel/types": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0", "eslint-visitor-keys": "^1.0.0", "resolve": "^1.12.0" } @@ -1209,6 +1874,12 @@ } } }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", + "dev": true + }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -1245,17 +1916,74 @@ "safe-buffer": "^5.0.1" } }, + "bl": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", + "dev": true, + "requires": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, "blessed": { "version": "0.1.81", "resolved": "https://registry.npmjs.org/blessed/-/blessed-0.1.81.tgz", "integrity": "sha1-+WLWh+wsNpVwrnGvhDJW5tDKESk=", "dev": true }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true + } + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1319,17 +2047,136 @@ "safe-buffer": "^5.0.1" } }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.0.tgz", + "integrity": "sha512-hEZC1KEeYuoHRqhGhTy6gWrpJA3ZDjFWv0DE61643ZnOXAKJb3u7yWcrU0mMc9SwAqK1n7myPGndkp0dFG7NFA==", + "dev": true, + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.2", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "bn.js": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz", + "integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==", + "dev": true + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "buffer": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "buffer-alloc": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "dev": true, + "requires": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "dev": true + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, + "buffer-fill": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", + "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", + "dev": true + }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, + "buffer-to-arraybuffer": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz", + "integrity": "sha1-YGSkD6dutDxyOrqe+PbhIW0QURo=", + "dev": true + }, "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + }, "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -1347,6 +2194,38 @@ "unset-value": "^1.0.0" } }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "dependencies": { + "get-stream": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", + "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true + } + } + }, "caller-callsite": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", @@ -1452,6 +2331,12 @@ "upath": "^1.1.1" } }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -1563,6 +2448,15 @@ "wordwrap": "0.0.2" } }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -1638,6 +2532,29 @@ "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true + }, "continuation-local-storage": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/continuation-local-storage/-/continuation-local-storage-3.2.1.tgz", @@ -1665,6 +2582,24 @@ } } }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "dev": true + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", + "dev": true + }, "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", @@ -1677,11 +2612,27 @@ "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==", "dev": true }, + "core-js-pure": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", + "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==", + "dev": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, "cosmiconfig": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", @@ -1722,6 +2673,16 @@ } } }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, "create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -1776,6 +2737,35 @@ "which": "^1.2.9" } }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -1784,6 +2774,12 @@ "assert-plus": "^1.0.0" } }, + "death": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/death/-/death-1.1.0.tgz", + "integrity": "sha1-AaqcQB7dknUFFEcLgmY5DGbGcxg=", + "dev": true + }, "debug": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", @@ -1804,50 +2800,185 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true + "decompress": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.1.tgz", + "integrity": "sha512-e48kc2IjU+2Zw8cTb6VZcJQ3lgVbS4uuB1TfCHbiZIP/haNXm+SVyhu+87jts5/3ROpd82GSVCoNs/z8l4ZOaQ==", + "dev": true, + "requires": { + "decompress-tar": "^4.0.0", + "decompress-tarbz2": "^4.0.0", + "decompress-targz": "^4.0.0", + "decompress-unzip": "^4.0.1", + "graceful-fs": "^4.1.10", + "make-dir": "^1.0.0", + "pify": "^2.3.0", + "strip-dirs": "^2.0.0" + }, + "dependencies": { + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } }, - "deep-metrics": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/deep-metrics/-/deep-metrics-0.0.1.tgz", - "integrity": "sha512-732WmZgCWxOkf4QBvrCjPPuT6wTEzaGye/4JqYsU/sO0J53UNX4PBwK0JV262BZ5cxgLmKhU+NlrtKdPDgybkg==", + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", "dev": true, "requires": { - "semver": "^5.3.0" + "mimic-response": "^1.0.0" } }, - "default-options": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-options/-/default-options-1.0.0.tgz", - "integrity": "sha1-ZiRmWprA0JiCr3Tm5Eyx2sWMqyo=", + "decompress-tar": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", + "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", "dev": true, "requires": { - "lodash": "^4.0.0" + "file-type": "^5.2.0", + "is-stream": "^1.1.0", + "tar-stream": "^1.5.2" } }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "decompress-tarbz2": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", + "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", "dev": true, "requires": { - "object-keys": "^1.0.12" + "decompress-tar": "^4.1.0", + "file-type": "^6.1.0", + "is-stream": "^1.1.0", + "seek-bzip": "^1.0.5", + "unbzip2-stream": "^1.0.9" + }, + "dependencies": { + "file-type": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz", + "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==", + "dev": true + } } }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "decompress-targz": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", + "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", "dev": true, "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" + "decompress-tar": "^4.1.1", + "file-type": "^5.2.0", + "is-stream": "^1.1.0" + } + }, + "decompress-unzip": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", + "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", + "dev": true, + "requires": { + "file-type": "^3.8.0", + "get-stream": "^2.2.0", + "pify": "^2.3.0", + "yauzl": "^2.4.2" }, "dependencies": { - "is-accessor-descriptor": { + "file-type": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", + "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=", + "dev": true + }, + "get-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", + "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "deep-metrics": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/deep-metrics/-/deep-metrics-0.0.1.tgz", + "integrity": "sha512-732WmZgCWxOkf4QBvrCjPPuT6wTEzaGye/4JqYsU/sO0J53UNX4PBwK0JV262BZ5cxgLmKhU+NlrtKdPDgybkg==", + "dev": true, + "requires": { + "semver": "^5.3.0" + } + }, + "default-options": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-options/-/default-options-1.0.0.tgz", + "integrity": "sha1-ZiRmWprA0JiCr3Tm5Eyx2sWMqyo=", + "dev": true, + "requires": { + "lodash": "^4.0.0" + } + }, + "defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", @@ -1883,6 +3014,28 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, "detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", @@ -1892,12 +3045,67 @@ "repeating": "^2.0.0" } }, + "detect-port": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.3.0.tgz", + "integrity": "sha512-E+B1gzkl2gqxt1IhUzwjrxBKRqx1UzC3WLONHinn8S3T6lwV/agVCyitiFOsGJ/eYuEUBvD71MZHy3Pv1G9doQ==", + "dev": true, + "requires": { + "address": "^1.0.1", + "debug": "^2.6.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + }, + "dependencies": { + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + } + } + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -1913,6 +3121,12 @@ "integrity": "sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk=", "dev": true }, + "dom-walk": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", + "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==", + "dev": true + }, "drbg.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", @@ -1923,6 +3137,12 @@ "create-hmac": "^1.1.4" } }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -1932,6 +3152,12 @@ "safer-buffer": "^2.1.0" } }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, "elliptic": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", @@ -1961,6 +3187,21 @@ "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -1971,9 +3212,9 @@ } }, "es-abstract": { - "version": "1.17.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.4.tgz", - "integrity": "sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ==", + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", @@ -2000,6 +3241,44 @@ "is-symbol": "^1.0.2" } }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "dev": true, + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dev": true, + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, "escape-regexp": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/escape-regexp/-/escape-regexp-0.0.1.tgz", @@ -2012,6 +3291,43 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "requires": { + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true + }, + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, "eslint": { "version": "5.16.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", @@ -2135,9 +3451,9 @@ } }, "eslint-module-utils": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.5.2.tgz", - "integrity": "sha512-LGScZ/JSlqGKiT8OC+cYRxseMjyqt6QO54nl281CK93unD89ijSeRV6An8Ci/2nvWVKe8K/Tqdm75RQoIOCr+Q==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", "dev": true, "requires": { "debug": "^2.6.9", @@ -2162,9 +3478,9 @@ } }, "eslint-plugin-import": { - "version": "2.20.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.20.1.tgz", - "integrity": "sha512-qQHgFOTjguR+LnYRoToeZWT62XM55MBVXObHM6SKFd1VzDcX/vqT1kAz8ssqigh5eMj8qXcRoXXGZpPP6RfdCw==", + "version": "2.20.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.20.2.tgz", + "integrity": "sha512-FObidqpXrR8OnCh4iNsxy+WACztJLXAHBO5hK79T1Hc77PgQZkyDGA5Ag9xAvRpglvLNxhH/zSmZ70/pZ31dHg==", "dev": true, "requires": { "array-includes": "^3.0.3", @@ -2241,9 +3557,9 @@ "dev": true }, "eslint-plugin-react": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.18.3.tgz", - "integrity": "sha512-Bt56LNHAQCoou88s8ViKRjMB2+36XRejCQ1VoLj716KI1MoE99HpTVvIThJ0rvFmG4E4Gsq+UgToEjn+j044Bg==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.20.0.tgz", + "integrity": "sha512-rqe1abd0vxMjmbPngo4NaYxTcR3Y4Hrmc/jg4T+sYz63yqlmJRknpEQfmWY+eDWPuMmix6iUIK+mv0zExjeLgA==", "dev": true, "requires": { "array-includes": "^3.1.1", @@ -2254,8 +3570,9 @@ "object.fromentries": "^2.0.2", "object.values": "^1.1.1", "prop-types": "^15.7.2", - "resolve": "^1.14.2", - "string.prototype.matchall": "^4.0.2" + "resolve": "^1.15.1", + "string.prototype.matchall": "^4.0.2", + "xregexp": "^4.3.0" }, "dependencies": { "doctrine": { @@ -2347,6 +3664,53 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, + "eth-ens-namehash": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", + "integrity": "sha1-IprEbsqG1S4MmR58sq74P/D2i88=", + "dev": true, + "requires": { + "idna-uts46-hx": "^2.3.1", + "js-sha3": "^0.5.7" + } + }, + "eth-lib": { + "version": "0.1.29", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.29.tgz", + "integrity": "sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "nano-json-stream-parser": "^0.1.2", + "servify": "^0.1.12", + "ws": "^3.0.0", + "xhr-request-promise": "^0.1.2" + } + }, + "ethereum-bloom-filters": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.7.tgz", + "integrity": "sha512-cDcJJSJ9GMAcURiAWO3DxIEhTL/uWqlQnvgKpuYQzYPrt/izuGU+1ntQmHt0IRq6ADoSYHFnB+aCEFIldjhkMQ==", + "dev": true, + "requires": { + "js-sha3": "^0.8.0" + }, + "dependencies": { + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true + } + } + }, "ethereumjs-abi": { "version": "0.6.8", "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", @@ -2356,6 +3720,22 @@ "ethereumjs-util": "^6.0.0" } }, + "ethereumjs-common": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.1.tgz", + "integrity": "sha512-aVUPRLgmXORGXXEVkFYgPhr9TGtpBY2tGhZ9Uh0A3lIUzUDr1x6kQx33SbjPUkLkX3eniPQnIL/2psjkjrOfcQ==", + "dev": true + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "dev": true, + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + } + }, "ethereumjs-util": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", @@ -2370,6 +3750,59 @@ "secp256k1": "^3.0.1" } }, + "ethers": { + "version": "4.0.47", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.47.tgz", + "integrity": "sha512-hssRYhngV4hiDNeZmVU/k5/E8xmLG8UpcNUzg6mb7lqhgpFPH/t7nuv20RjRrEf0gblzvi2XwR5Te+V3ZFc9pQ==", + "dev": true, + "requires": { + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.5.2", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.4", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + }, + "dependencies": { + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", + "dev": true + } + } + }, + "ethjs-unit": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", + "integrity": "sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk=", + "dev": true, + "requires": { + "bn.js": "4.11.6", + "number-to-bn": "1.7.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", + "dev": true + } + } + }, "ethjs-util": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", @@ -2385,6 +3818,12 @@ "integrity": "sha1-+YNhBRexc3wLncZDvsqTiTwE3xg=", "dev": true }, + "eventemitter3": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", + "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==", + "dev": true + }, "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -2444,6 +3883,90 @@ } } }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "dev": true, + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==", + "dev": true + } + } + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -2562,7 +4085,75 @@ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, - "fast-json-stable-stringify": { + "fast-glob": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", + "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" @@ -2573,12 +4164,30 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fastq": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", + "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "fclone": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/fclone/-/fclone-1.0.11.tgz", "integrity": "sha1-EOhdo4v+p/xZk0HClu4ddyZu5kA=", "dev": true }, + "fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "dev": true, + "requires": { + "pend": "~1.2.0" + } + }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", @@ -2597,6 +4206,12 @@ "flat-cache": "^2.0.1" } }, + "file-type": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", + "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=", + "dev": true + }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -2625,6 +4240,38 @@ } } }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -2682,6 +4329,12 @@ "mime-types": "^2.1.12" } }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "dev": true + }, "fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", @@ -2691,6 +4344,38 @@ "map-cache": "^0.2.2" } }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-minipass": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "dev": true, + "requires": { + "minipass": "^2.6.0" + } + }, "fs-readdir-recursive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", @@ -3946,6 +5631,15 @@ } } }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -3960,6 +5654,16 @@ "assert-plus": "^1.0.0" } }, + "ghost-testrpc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz", + "integrity": "sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "node-emoji": "^1.10.0" + } + }, "gkt": { "version": "https://tgz.pm2.io/gkt-1.0.0.tgz", "integrity": "sha512-zr6QQnzLt3Ja0t0XI8gws2kn7zV2p0l/D3kreNvS6hFZhVU5g+uY/30l42jbgt0XGcNBEmBDGJR71J692V92tA==", @@ -4001,24 +5705,159 @@ } } }, + "global": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", + "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", + "dev": true, + "requires": { + "min-document": "^2.19.0", + "process": "~0.5.1" + } + }, + "global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "requires": { + "global-prefix": "^3.0.0" + } + }, + "global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "requires": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + } + }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, + "globby": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", + "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + }, + "dependencies": { + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + } + } + }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + } + }, "graceful-fs": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", "dev": true }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true + }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, + "handlebars": { + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", + "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "optional": true + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "uglify-js": { + "version": "3.9.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.4.tgz", + "integrity": "sha512-8RZBJq5smLOa7KslsNsVcSH+KOXf1uDU8yqLeNuVKwmT0T3FA0ZoXlinQfRad7SDcbZZRZE4ov+2v71EnxNyCA==", + "dev": true, + "optional": true, + "requires": { + "commander": "~2.20.3" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + } + } + }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -4057,12 +5896,27 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "has-symbol-support-x": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", + "dev": true + }, "has-symbols": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "dev": true, + "requires": { + "has-symbol-support-x": "^1.4.1" + } + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -4140,9 +5994,42 @@ } }, "hosted-git-info": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", - "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==" + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" + }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } + } + }, + "http-https": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", + "integrity": "sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs=", + "dev": true }, "http-signature": { "version": "1.2.0", @@ -4163,6 +6050,29 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "idna-uts46-hx": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz", + "integrity": "sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==", + "dev": true, + "requires": { + "punycode": "2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", + "integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0=", + "dev": true + } + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -4200,6 +6110,12 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, "inquirer": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", @@ -4264,6 +6180,12 @@ "loose-envify": "^1.0.0" } }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true + }, "is": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", @@ -4410,6 +6332,12 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, + "is-function": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", + "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==", + "dev": true + }, "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", @@ -4424,6 +6352,12 @@ "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, + "is-natural-number": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", + "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=", + "dev": true + }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -4444,6 +6378,18 @@ } } }, + "is-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", + "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -4468,6 +6414,18 @@ "has": "^1.0.3" } }, + "is-retry-allowed": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", + "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, "is-string": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", @@ -4517,6 +6475,22 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "isurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "dev": true, + "requires": { + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true + }, "js-stringify": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz", @@ -4550,6 +6524,12 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -4583,6 +6563,21 @@ "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", "dev": true }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonschema": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.6.tgz", + "integrity": "sha512-SqhURKZG07JyKKeo/ir24QnS4/BV7a6gQy93bUSe4lUdNp0QNpIz2c9elWJQ9dpc5cQYY6cvCzgRwy0MQCLyqA==", + "dev": true + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -4605,12 +6600,12 @@ } }, "jsx-ast-utils": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.3.tgz", - "integrity": "sha512-EdIHFMm+1BPynpKOpdPqiOsvnIrInRGJD7bzPZdPkjitQEqpdpUuFpq4T0npZFKTiB3RhWFdGN+oqOJIdhDhQA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.3.0.tgz", + "integrity": "sha512-3HNoc7nZ1hpZIKB3hJ7BlFRkzCx2BynRtfSwbkqZdpRdvAPsGMnzclPwrvDBS7/lalHTj21NwIeaEpysHBOudg==", "dev": true, "requires": { - "array-includes": "^3.0.3", + "array-includes": "^3.1.1", "object.assign": "^4.1.0" } }, @@ -4625,6 +6620,15 @@ "safe-buffer": "^5.2.0" } }, + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -4706,6 +6710,12 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "lodash.toarray": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz", + "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=", + "dev": true + }, "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", @@ -4721,6 +6731,12 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, "lru-cache": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", @@ -4771,6 +6787,24 @@ "safe-buffer": "^5.1.2" } }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "merge2": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", + "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", + "dev": true + }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -4798,8 +6832,24 @@ "to-regex": "^3.0.2" } }, - "mime-db": { - "version": "1.43.0", + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "mime-db": { + "version": "1.43.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" }, @@ -4817,6 +6867,21 @@ "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "min-document": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "dev": true, + "requires": { + "dom-walk": "^0.1.0" + } + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -4839,7 +6904,35 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + }, + "dependencies": { + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "minizlib": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "dev": true, + "requires": { + "minipass": "^2.9.0" + } }, "mixin-deep": { "version": "1.3.2", @@ -4866,10 +6959,20 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, "requires": { "minimist": "0.0.8" } }, + "mkdirp-promise": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", + "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", + "dev": true, + "requires": { + "mkdirp": "*" + } + }, "mocha": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", @@ -4935,6 +7038,12 @@ } } }, + "mock-fs": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.12.0.tgz", + "integrity": "sha512-/P/HtrlvBxY4o/PzXY9cCNBrdylDNxg7gnrv2sMNxj+UJ2m8jSpl0/A6fuJeNAWr99ZvGWH8XCbE0vmnM5KupQ==", + "dev": true + }, "moment": { "version": "2.24.0", "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", @@ -4966,6 +7075,12 @@ "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" }, + "nano-json-stream-parser": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", + "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=", + "dev": true + }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -5002,12 +7117,48 @@ "sax": "^1.2.4" } }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true + }, + "neo-async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", + "dev": true + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node-emoji": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.10.0.tgz", + "integrity": "sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw==", + "dev": true, + "requires": { + "lodash.toarray": "^4.4.0" + } + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -5026,6 +7177,12 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, + "normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "dev": true + }, "nssocket": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/nssocket/-/nssocket-0.6.0.tgz", @@ -5044,6 +7201,24 @@ } } }, + "number-to-bn": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", + "integrity": "sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA=", + "dev": true, + "requires": { + "bn.js": "4.11.6", + "strip-hex-prefix": "1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", + "dev": true + } + } + }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -5120,14 +7295,13 @@ } }, "object.entries": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.1.tgz", - "integrity": "sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.2.tgz", + "integrity": "sha512-BQdB9qKmb/HyNdMNWVr7O3+z5MUIx3aiegEIJqjMBbBf0YT9RRxTJSim4mzFqtyr7PDAHigq0N9dO0m0tRakQA==", "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1", - "function-bind": "^1.1.1", + "es-abstract": "^1.17.5", "has": "^1.0.3" } }, @@ -5164,6 +7338,24 @@ "has": "^1.0.3" } }, + "oboe": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.4.tgz", + "integrity": "sha1-IMiM2wwVNxuwQRklfU/dNLCqSfY=", + "dev": true, + "requires": { + "http-https": "^1.0.0" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -5219,6 +7411,18 @@ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -5235,6 +7439,15 @@ "p-limit": "^1.1.0" } }, + "p-timeout": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", + "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", + "dev": true, + "requires": { + "p-finally": "^1.0.0" + } + }, "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", @@ -5249,6 +7462,26 @@ "callsites": "^3.0.0" } }, + "parse-asn1": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", + "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", + "dev": true, + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "parse-headers": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.3.tgz", + "integrity": "sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA==", + "dev": true + }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -5258,6 +7491,12 @@ "error-ex": "^1.2.0" } }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", @@ -5299,6 +7538,12 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "dev": true + }, "path-type": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", @@ -5316,11 +7561,36 @@ } } }, + "pbkdf2": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, "pidusage": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pidusage/-/pidusage-1.2.0.tgz", @@ -5333,6 +7603,21 @@ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, "pkg-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", @@ -5499,6 +7784,12 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, "prettier": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", @@ -5512,6 +7803,12 @@ "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", "dev": true }, + "process": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", + "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=", + "dev": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -5562,6 +7859,16 @@ "react-is": "^16.8.1" } }, + "proxy-addr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", + "dev": true, + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.1" + } + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -5573,6 +7880,20 @@ "resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz", "integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==" }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, "pug": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pug/-/pug-2.0.4.tgz", @@ -5699,6 +8020,16 @@ "integrity": "sha512-GMu3M5nUL3fju4/egXwZO0XLi6fW/K3T3VTgFQ14GxNi8btlxgT5qZL//JwZFm/2Fa64J/PNS8AZeys3wiMkVA==", "dev": true }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -5709,10 +8040,64 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, + "query-string": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "dev": true, + "requires": { + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "randomhex": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/randomhex/-/randomhex-0.1.5.tgz", + "integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU=", + "dev": true + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, "react-is": { - "version": "16.12.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.12.0.tgz", - "integrity": "sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==", + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true }, "read": { @@ -5788,6 +8173,15 @@ "resolve": "^1.1.6" } }, + "recursive-readdir": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", + "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", + "dev": true, + "requires": { + "minimatch": "3.0.4" + } + }, "regenerate": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", @@ -5946,6 +8340,15 @@ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", @@ -5962,6 +8365,12 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "right-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", @@ -6006,6 +8415,12 @@ "is-promise": "^2.1.0" } }, + "run-parallel": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "dev": true + }, "run-with-ganache": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/run-with-ganache/-/run-with-ganache-0.1.1.tgz", @@ -6050,6 +8465,111 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true }, + "sc-istanbul": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/sc-istanbul/-/sc-istanbul-0.4.5.tgz", + "integrity": "sha512-7wR5EZFLsC4w0wSm9BUuCgW+OGKAU7PNlW5L0qwVPbh+Q1sfVn2fyzfMXYCm6rkNA5ipaCOt94nApcguQwF5Gg==", + "dev": true, + "requires": { + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + } + } + }, + "scrypt-js": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", + "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==", + "dev": true + }, + "scrypt-shim": { + "version": "github:web3-js/scrypt-shim#aafdadda13e660e25e1c525d1f5b2443f5eb1ebb", + "from": "github:web3-js/scrypt-shim", + "dev": true, + "requires": { + "scryptsy": "^2.1.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "scryptsy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz", + "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==", + "dev": true + }, "secp256k1": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", @@ -6065,12 +8585,103 @@ "safe-buffer": "^5.1.2" } }, - "semver": { + "seek-bzip": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", + "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", + "dev": true, + "requires": { + "commander": "~2.8.1" + }, + "dependencies": { + "commander": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", + "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", + "dev": true, + "requires": { + "graceful-readlink": ">= 1.0.0" + } + } + } + }, + "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "dev": true, + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, + "servify": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", + "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", + "dev": true, + "requires": { + "body-parser": "^1.16.0", + "cors": "^2.8.1", + "express": "^4.14.0", + "request": "^2.79.0", + "xhr": "^2.3.3" + } + }, "set-value": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", @@ -6094,6 +8705,18 @@ } } }, + "setimmediate": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "dev": true + }, "sha.js": { "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", @@ -6151,6 +8774,23 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "simple-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", + "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", + "dev": true + }, + "simple-get": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", + "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", + "dev": true, + "requires": { + "decompress-response": "^3.3.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "slash": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", @@ -6291,9 +8931,9 @@ } }, "solhint": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/solhint/-/solhint-2.3.0.tgz", - "integrity": "sha512-2yiELLp+MsDtuOTrjc14lgsYmlMchp++SicvqCBu01VXsi9Mk2uynhyN3nBfbGzYq1YfmOEBpUqJfFYXVAR/Ig==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/solhint/-/solhint-2.3.1.tgz", + "integrity": "sha512-wP/G+Dqj8LNWlCI9Mt6XiQRWQfZwv1rkZe/V+HKtip5SAZJVvp144PdH28KE45ZvR99Hhrp/Mujt74fSmXsFiw==", "dev": true, "requires": { "ajv": "^6.6.1", @@ -6325,10 +8965,44 @@ } } }, - "solidity-parser-antlr": { - "version": "0.4.11", - "resolved": "https://registry.npmjs.org/solidity-parser-antlr/-/solidity-parser-antlr-0.4.11.tgz", - "integrity": "sha512-4jtxasNGmyC0midtjH/lTFPZYvTTUMy6agYcF+HoMnzW8+cqo3piFrINb4ZCzpPW+7tTVFCGa5ubP34zOzeuMg==" + "solidity-coverage": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.7.5.tgz", + "integrity": "sha512-UaNwVhK7I1ULYK3qDTATs7Hz0YKhJnE+rm5aU9ufUBowOImB2dWYXox2l/tMbSkHfTMWwHE/6TNqn0/ec0rwOw==", + "dev": true, + "requires": { + "@solidity-parser/parser": "^0.6.0", + "@truffle/provider": "^0.1.17", + "chalk": "^2.4.2", + "death": "^1.1.0", + "detect-port": "^1.3.0", + "fs-extra": "^8.1.0", + "ganache-cli": "6.9.0", + "ghost-testrpc": "^0.0.2", + "global-modules": "^2.0.0", + "globby": "^10.0.1", + "jsonschema": "^1.2.4", + "lodash": "^4.17.15", + "node-emoji": "^1.10.0", + "pify": "^4.0.1", + "recursive-readdir": "^2.2.2", + "sc-istanbul": "^0.4.5", + "shelljs": "^0.8.3", + "web3": "1.2.6" + }, + "dependencies": { + "shelljs": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + } + } }, "source-map": { "version": "0.5.7", @@ -6365,9 +9039,9 @@ "dev": true }, "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -6375,15 +9049,15 @@ } }, "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -6448,6 +9122,18 @@ } } }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -6489,24 +9175,46 @@ "side-channel": "^1.0.2" } }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "string.prototype.trimleft": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", - "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", "dev": true, "requires": { "define-properties": "^1.1.3", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" } }, "string.prototype.trimright": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", - "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", "dev": true, "requires": { "define-properties": "^1.1.3", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" } }, "string_decoder": { @@ -6541,6 +9249,15 @@ "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, + "strip-dirs": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", + "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", + "dev": true, + "requires": { + "is-natural-number": "^4.0.1" + } + }, "strip-hex-prefix": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", @@ -6564,6 +9281,94 @@ "has-flag": "^3.0.0" } }, + "swarm-js": { + "version": "0.1.39", + "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.39.tgz", + "integrity": "sha512-QLMqL2rzF6n5s50BptyD6Oi0R1aWlJC5Y17SRIVXRj6OR1DRIPM7nepvrxxkjA1zNzFz6mUOMjfeqeDaWB7OOg==", + "dev": true, + "requires": { + "bluebird": "^3.5.0", + "buffer": "^5.0.5", + "decompress": "^4.0.0", + "eth-lib": "^0.1.26", + "fs-extra": "^4.0.2", + "got": "^7.1.0", + "mime-types": "^2.1.16", + "mkdirp-promise": "^5.0.1", + "mock-fs": "^4.1.0", + "setimmediate": "^1.0.5", + "tar": "^4.0.2", + "xhr-request-promise": "^0.1.2" + }, + "dependencies": { + "fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "got": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "dev": true, + "requires": { + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" + } + }, + "p-cancelable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", + "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", + "dev": true + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "requires": { + "prepend-http": "^1.0.1" + } + } + } + }, "table": { "version": "5.4.6", "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", @@ -6604,6 +9409,44 @@ } } }, + "tar": { + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "dev": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + }, + "dependencies": { + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "tar-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", + "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", + "dev": true, + "requires": { + "bl": "^1.0.0", + "buffer-alloc": "^1.2.0", + "end-of-stream": "^1.0.0", + "fs-constants": "^1.0.0", + "readable-stream": "^2.3.0", + "to-buffer": "^1.1.1", + "xtend": "^4.0.0" + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -6616,6 +9459,12 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "dev": true + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -6625,6 +9474,12 @@ "os-tmpdir": "~1.0.2" } }, + "to-buffer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", + "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", + "dev": true + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -6651,6 +9506,12 @@ } } }, + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true + }, "to-regex": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", @@ -6673,6 +9534,12 @@ "repeat-string": "^1.6.1" } }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "dev": true + }, "token-stream": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/token-stream/-/token-stream-0.0.1.tgz", @@ -6702,9 +9569,9 @@ "dev": true }, "truffle": { - "version": "5.0.34", - "resolved": "https://registry.npmjs.org/truffle/-/truffle-5.0.34.tgz", - "integrity": "sha512-fSA3JjaIjFrgn4BGfoATg2ATVWS51240L8mEQdtqLUncOcFnMLTBEaVRujO/f97XW+ew0hUg13oS4H/2Z4dwtg==", + "version": "5.1.28", + "resolved": "https://registry.npmjs.org/truffle/-/truffle-5.1.28.tgz", + "integrity": "sha512-MNcfjVn+Wiz/bjn5iKopdaANZg63GNR5V6WGzjdugWrtgZLBcyS7MnXK7vadcMpQSSMeTJS/2VGVj4jcq96B0Q==", "dev": true, "requires": { "app-module-path": "^2.2.0", @@ -6713,15 +9580,22 @@ } }, "truffle-flattener": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/truffle-flattener/-/truffle-flattener-1.4.2.tgz", - "integrity": "sha512-7qUIzaW8a4vI4nui14wsytht2oaqvqnZ1Iet2wRq2T0bCJ0wb6HByMKQhZKpU46R+n5BMTY4K5n+0ITyeNlmuQ==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/truffle-flattener/-/truffle-flattener-1.4.4.tgz", + "integrity": "sha512-S/WmvubzlUj1mn56wEI6yo1bmPpKDNdEe5rtyVC1C5iNfZWobD/V69pAYI15IBDJrDqUyh+iXgpTkzov50zpQw==", "requires": { "@resolver-engine/imports-fs": "^0.2.2", + "@solidity-parser/parser": "^0.6.0", "find-up": "^2.1.0", - "mkdirp": "^0.5.1", - "solidity-parser-antlr": "^0.4.11", + "mkdirp": "^1.0.4", "tsort": "0.0.1" + }, + "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + } } }, "tslib": { @@ -6754,6 +9628,12 @@ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -6763,6 +9643,25 @@ "prelude-ls": "~1.1.2" } }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, "uglify-js": { "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", @@ -6787,6 +9686,28 @@ "integrity": "sha1-5hjYAtf//Si3CPzOzHMVYIusR/I=", "dev": true }, + "ultron": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", + "dev": true + }, + "unbzip2-stream": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", + "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "dev": true, + "requires": { + "buffer": "^5.2.1", + "through": "^2.3.8" + } + }, + "underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", + "dev": true + }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -6799,6 +9720,18 @@ "set-value": "^2.0.1" } }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, "unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", @@ -6859,18 +9792,51 @@ "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", "dev": true }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } + }, + "url-set-query": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz", + "integrity": "sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk=", + "dev": true + }, + "url-to-options": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", + "dev": true + }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, + "utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", + "dev": true + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -6892,6 +9858,12 @@ "spdx-expression-parse": "^3.0.0" } }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -6961,55 +9933,850 @@ } } }, - "when": { - "version": "3.7.8", - "resolved": "https://registry.npmjs.org/when/-/when-3.7.8.tgz", - "integrity": "sha1-xxMLan6gRpPoQs3J56Hyqjmjn4I=", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true - }, - "with": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/with/-/with-5.1.1.tgz", - "integrity": "sha1-+k2qktrzLE6pTtRTyB8EaGtXXf4=", + "web3": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.6.tgz", + "integrity": "sha512-tpu9fLIComgxGrFsD8LUtA4s4aCZk7px8UfcdEy6kS2uDi/ZfR07KJqpXZMij7Jvlq+cQrTAhsPSiBVvoMaivA==", "dev": true, "requires": { - "acorn": "^3.1.0", - "acorn-globals": "^3.0.0" + "@types/node": "^12.6.1", + "web3-bzz": "1.2.6", + "web3-core": "1.2.6", + "web3-eth": "1.2.6", + "web3-eth-personal": "1.2.6", + "web3-net": "1.2.6", + "web3-shh": "1.2.6", + "web3-utils": "1.2.6" }, "dependencies": { - "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "@types/node": { + "version": "12.12.42", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.42.tgz", + "integrity": "sha512-R/9QdYFLL9dE9l5cWWzWIZByVGFd7lk7JVOJ7KD+E1SJ4gni7XJRLz9QTjyYQiHIqEAgku9VgxdLjMlhhUaAFg==", "dev": true - } - } - }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true - }, - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "ethers": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.3.tgz", + "integrity": "sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog==", + "dev": true, + "requires": { + "@types/node": "^10.3.2", + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.3.3", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.3", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + }, + "dependencies": { + "@types/node": { + "version": "10.17.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.24.tgz", + "integrity": "sha512-5SCfvCxV74kzR3uWgTYiGxrd69TbT1I6+cMx1A5kEly/IVveJBimtAMlXiEyVFn5DvUFewQWxOOiJhlxeQwxgA==", + "dev": true + }, + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" + } + } + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "scrypt-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", + "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=", + "dev": true + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", + "dev": true + }, + "web3-bzz": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.6.tgz", + "integrity": "sha512-9NiHLlxdI1XeFtbPJAmi2jnnIHVF+GNy517wvOS72P7ZfuJTPwZaSNXfT01vWgPPE9R96/uAHDWHOg+T4WaDQQ==", + "dev": true, + "requires": { + "@types/node": "^10.12.18", + "got": "9.6.0", + "swarm-js": "0.1.39", + "underscore": "1.9.1" + }, + "dependencies": { + "@types/node": { + "version": "10.17.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.24.tgz", + "integrity": "sha512-5SCfvCxV74kzR3uWgTYiGxrd69TbT1I6+cMx1A5kEly/IVveJBimtAMlXiEyVFn5DvUFewQWxOOiJhlxeQwxgA==", + "dev": true + } + } + }, + "web3-core": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.6.tgz", + "integrity": "sha512-y/QNBFtr5cIR8vxebnotbjWJpOnO8LDYEAzZjeRRUJh2ijmhjoYk7dSNx9ExgC0UCfNFRoNCa9dGRu/GAxwRlw==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.4", + "@types/node": "^12.6.1", + "web3-core-helpers": "1.2.6", + "web3-core-method": "1.2.6", + "web3-core-requestmanager": "1.2.6", + "web3-utils": "1.2.6" + } + }, + "web3-core-helpers": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.6.tgz", + "integrity": "sha512-gYKWmC2HmO7RcDzpo4L1K8EIoy5L8iubNDuTC6q69UxczwqKF/Io0kbK/1Z10Av++NlzOSiuyGp2gc4t4UOsDw==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-eth-iban": "1.2.6", + "web3-utils": "1.2.6" + } + }, + "web3-core-method": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.6.tgz", + "integrity": "sha512-r2dzyPEonqkBg7Mugq5dknhV5PGaZTHBZlS/C+aMxNyQs3T3eaAsCTqlQDitwNUh/sUcYPEGF0Vo7ahYK4k91g==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.6", + "web3-core-promievent": "1.2.6", + "web3-core-subscriptions": "1.2.6", + "web3-utils": "1.2.6" + } + }, + "web3-core-promievent": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.6.tgz", + "integrity": "sha512-km72kJef/qtQNiSjDJJVHIZvoVOm6ytW3FCYnOcCs7RIkviAb5JYlPiye0o4pJOLzCXYID7DK7Q9bhY8qWb1lw==", + "dev": true, + "requires": { + "any-promise": "1.3.0", + "eventemitter3": "3.1.2" + } + }, + "web3-core-requestmanager": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.6.tgz", + "integrity": "sha512-QU2cbsj9Dm0r6om40oSwk8Oqbp3wTa08tXuMpSmeOTkGZ3EMHJ1/4LiJ8shwg1AvPMrKVU0Nri6+uBNCdReZ+g==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.6", + "web3-providers-http": "1.2.6", + "web3-providers-ipc": "1.2.6", + "web3-providers-ws": "1.2.6" + } + }, + "web3-core-subscriptions": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.6.tgz", + "integrity": "sha512-M0PzRrP2Ct13x3wPulFtc5kENH4UtnPxO9YxkfQlX2WRKENWjt4Rfq+BCVGYEk3rTutDfWrjfzjmqMRvXqEY5Q==", + "dev": true, + "requires": { + "eventemitter3": "3.1.2", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.6" + } + }, + "web3-eth": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.6.tgz", + "integrity": "sha512-ROWlDPzh4QX6tlGGGlAK6X4kA2n0/cNj/4kb0nNVWkRouGmYO0R8k6s47YxYHvGiXt0s0++FUUv5vAbWovtUQw==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core": "1.2.6", + "web3-core-helpers": "1.2.6", + "web3-core-method": "1.2.6", + "web3-core-subscriptions": "1.2.6", + "web3-eth-abi": "1.2.6", + "web3-eth-accounts": "1.2.6", + "web3-eth-contract": "1.2.6", + "web3-eth-ens": "1.2.6", + "web3-eth-iban": "1.2.6", + "web3-eth-personal": "1.2.6", + "web3-net": "1.2.6", + "web3-utils": "1.2.6" + } + }, + "web3-eth-abi": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.6.tgz", + "integrity": "sha512-w9GAyyikn8nSifSDZxAvU9fxtQSX+W2xQWMmrtTXmBGCaE4/ywKOSPAO78gq8AoU4Wq5yqVGKZLLbfpt7/sHlA==", + "dev": true, + "requires": { + "ethers": "4.0.0-beta.3", + "underscore": "1.9.1", + "web3-utils": "1.2.6" + } + }, + "web3-eth-accounts": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.6.tgz", + "integrity": "sha512-cDVtonHRgzqi/ZHOOf8kfCQWFEipcfQNAMzXIaKZwc0UUD9mgSI5oJrN45a89Ze+E6Lz9m77cDG5Ax9zscSkcw==", + "dev": true, + "requires": { + "@web3-js/scrypt-shim": "^0.1.0", + "any-promise": "1.3.0", + "crypto-browserify": "3.12.0", + "eth-lib": "^0.2.8", + "ethereumjs-common": "^1.3.2", + "ethereumjs-tx": "^2.1.1", + "underscore": "1.9.1", + "uuid": "3.3.2", + "web3-core": "1.2.6", + "web3-core-helpers": "1.2.6", + "web3-core-method": "1.2.6", + "web3-utils": "1.2.6" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", + "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + } + } + }, + "web3-eth-contract": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.6.tgz", + "integrity": "sha512-ak4xbHIhWgsbdPCkSN+HnQc1SH4c856y7Ly+S57J/DQVzhFZemK5HvWdpwadJrQTcHET3ZeId1vq3kmW7UYodw==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.4", + "underscore": "1.9.1", + "web3-core": "1.2.6", + "web3-core-helpers": "1.2.6", + "web3-core-method": "1.2.6", + "web3-core-promievent": "1.2.6", + "web3-core-subscriptions": "1.2.6", + "web3-eth-abi": "1.2.6", + "web3-utils": "1.2.6" + } + }, + "web3-eth-ens": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.6.tgz", + "integrity": "sha512-8UEqt6fqR/dji/jBGPFAyBs16OJjwi0t2dPWXPyGXmty/fH+osnXwWXE4HRUyj4xuafiM5P1YkXMsPhKEadjiw==", + "dev": true, + "requires": { + "eth-ens-namehash": "2.0.8", + "underscore": "1.9.1", + "web3-core": "1.2.6", + "web3-core-helpers": "1.2.6", + "web3-core-promievent": "1.2.6", + "web3-eth-abi": "1.2.6", + "web3-eth-contract": "1.2.6", + "web3-utils": "1.2.6" + } + }, + "web3-eth-iban": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.6.tgz", + "integrity": "sha512-TPMc3BW9Iso7H+9w+ytbqHK9wgOmtocyCD3PaAe5Eie50KQ/j7ThA60dGJnxItVo6yyRv5pZAYxPVob9x/fJlg==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "web3-utils": "1.2.6" + } + }, + "web3-eth-personal": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.6.tgz", + "integrity": "sha512-T2NUkh1plY8d7wePXSoHnaiKOd8dLNFaQfgBl9JHU6S7IJrG9jnYD9bVxLEgRUfHs9gKf9tQpDf7AcPFdq/A8g==", + "dev": true, + "requires": { + "@types/node": "^12.6.1", + "web3-core": "1.2.6", + "web3-core-helpers": "1.2.6", + "web3-core-method": "1.2.6", + "web3-net": "1.2.6", + "web3-utils": "1.2.6" + } + }, + "web3-net": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.6.tgz", + "integrity": "sha512-hsNHAPddrhgjWLmbESW0KxJi2GnthPcow0Sqpnf4oB6+/+ZnQHU9OsIyHb83bnC1OmunrK2vf9Ye2mLPdFIu3A==", + "dev": true, + "requires": { + "web3-core": "1.2.6", + "web3-core-method": "1.2.6", + "web3-utils": "1.2.6" + } + }, + "web3-providers-http": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.6.tgz", + "integrity": "sha512-2+SaFCspb5f82QKuHB3nEPQOF9iSWxRf7c18fHtmnLNVkfG9SwLN1zh67bYn3tZGUdOI3gj8aX4Uhfpwx9Ezpw==", + "dev": true, + "requires": { + "web3-core-helpers": "1.2.6", + "xhr2-cookies": "1.1.0" + } + }, + "web3-providers-ipc": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.6.tgz", + "integrity": "sha512-b0Es+/GTZyk5FG3SgUDW+2/mBwJAXWt5LuppODptiOas8bB2khLjG6+Gm1K4uwOb+1NJGPt5mZZ8Wi7vibtQ+A==", + "dev": true, + "requires": { + "oboe": "2.1.4", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.6" + } + }, + "web3-providers-ws": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.6.tgz", + "integrity": "sha512-20waSYX+gb5M5yKhug5FIwxBBvkKzlJH7sK6XEgdOx6BZ9YYamLmvg9wcRVtnSZO8hV/3cWenO/tRtTrHVvIgQ==", + "dev": true, + "requires": { + "@web3-js/websocket": "^1.0.29", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.6" + } + }, + "web3-shh": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.6.tgz", + "integrity": "sha512-rouWyOOM6YMbLQd65grpj8BBezQfgNeRRX+cGyW4xsn6Xgu+B73Zvr6OtA/ftJwwa9bqHGpnLrrLMeWyy4YLUw==", + "dev": true, + "requires": { + "web3-core": "1.2.6", + "web3-core-method": "1.2.6", + "web3-core-subscriptions": "1.2.6", + "web3-net": "1.2.6" + } + }, + "web3-utils": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.6.tgz", + "integrity": "sha512-8/HnqG/l7dGmKMgEL9JeKPTtjScxOePTzopv5aaKFExPfaBrYRkgoMqhoowCiAl/s16QaTn4DoIF1QC4YsT7Mg==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } + } + }, + "web3-bzz": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.2.tgz", + "integrity": "sha512-b1O2ObsqUN1lJxmFSjvnEC4TsaCbmh7Owj3IAIWTKqL9qhVgx7Qsu5O9cD13pBiSPNZJ68uJPaKq380QB4NWeA==", + "dev": true, + "requires": { + "@types/node": "^10.12.18", + "got": "9.6.0", + "swarm-js": "0.1.39", + "underscore": "1.9.1" + }, + "dependencies": { + "@types/node": { + "version": "10.17.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.24.tgz", + "integrity": "sha512-5SCfvCxV74kzR3uWgTYiGxrd69TbT1I6+cMx1A5kEly/IVveJBimtAMlXiEyVFn5DvUFewQWxOOiJhlxeQwxgA==", + "dev": true + } + } + }, + "web3-core": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.2.tgz", + "integrity": "sha512-miHAX3qUgxV+KYfaOY93Hlc3kLW2j5fH8FJy6kSxAv+d4d5aH0wwrU2IIoJylQdT+FeenQ38sgsCnFu9iZ1hCQ==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.4", + "@types/node": "^12.6.1", + "web3-core-helpers": "1.2.2", + "web3-core-method": "1.2.2", + "web3-core-requestmanager": "1.2.2", + "web3-utils": "1.2.2" + }, + "dependencies": { + "@types/node": { + "version": "12.12.42", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.42.tgz", + "integrity": "sha512-R/9QdYFLL9dE9l5cWWzWIZByVGFd7lk7JVOJ7KD+E1SJ4gni7XJRLz9QTjyYQiHIqEAgku9VgxdLjMlhhUaAFg==", + "dev": true + } + } + }, + "web3-core-helpers": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.2.tgz", + "integrity": "sha512-HJrRsIGgZa1jGUIhvGz4S5Yh6wtOIo/TMIsSLe+Xay+KVnbseJpPprDI5W3s7H2ODhMQTbogmmUFquZweW2ImQ==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-eth-iban": "1.2.2", + "web3-utils": "1.2.2" + } + }, + "web3-core-method": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.2.tgz", + "integrity": "sha512-szR4fDSBxNHaF1DFqE+j6sFR/afv9Aa36OW93saHZnrh+iXSrYeUUDfugeNcRlugEKeUCkd4CZylfgbK2SKYJA==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.2", + "web3-core-promievent": "1.2.2", + "web3-core-subscriptions": "1.2.2", + "web3-utils": "1.2.2" + } + }, + "web3-core-promievent": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.2.tgz", + "integrity": "sha512-tKvYeT8bkUfKABcQswK6/X79blKTKYGk949urZKcLvLDEaWrM3uuzDwdQT3BNKzQ3vIvTggFPX9BwYh0F1WwqQ==", + "dev": true, + "requires": { + "any-promise": "1.3.0", + "eventemitter3": "3.1.2" + } + }, + "web3-core-requestmanager": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.2.tgz", + "integrity": "sha512-a+gSbiBRHtHvkp78U2bsntMGYGF2eCb6219aMufuZWeAZGXJ63Wc2321PCbA8hF9cQrZI4EoZ4kVLRI4OF15Hw==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.2", + "web3-providers-http": "1.2.2", + "web3-providers-ipc": "1.2.2", + "web3-providers-ws": "1.2.2" + } + }, + "web3-core-subscriptions": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.2.tgz", + "integrity": "sha512-QbTgigNuT4eicAWWr7ahVpJyM8GbICsR1Ys9mJqzBEwpqS+RXTRVSkwZ2IsxO+iqv6liMNwGregbJLq4urMFcQ==", + "dev": true, + "requires": { + "eventemitter3": "3.1.2", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.2" + } + }, + "web3-eth": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.2.tgz", + "integrity": "sha512-UXpC74mBQvZzd4b+baD4Ocp7g+BlwxhBHumy9seyE/LMIcMlePXwCKzxve9yReNpjaU16Mmyya6ZYlyiKKV8UA==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core": "1.2.2", + "web3-core-helpers": "1.2.2", + "web3-core-method": "1.2.2", + "web3-core-subscriptions": "1.2.2", + "web3-eth-abi": "1.2.2", + "web3-eth-accounts": "1.2.2", + "web3-eth-contract": "1.2.2", + "web3-eth-ens": "1.2.2", + "web3-eth-iban": "1.2.2", + "web3-eth-personal": "1.2.2", + "web3-net": "1.2.2", + "web3-utils": "1.2.2" + } + }, + "web3-eth-abi": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.2.tgz", + "integrity": "sha512-Yn/ZMgoOLxhTVxIYtPJ0eS6pnAnkTAaJgUJh1JhZS4ekzgswMfEYXOwpMaD5eiqPJLpuxmZFnXnBZlnQ1JMXsw==", + "dev": true, + "requires": { + "ethers": "4.0.0-beta.3", + "underscore": "1.9.1", + "web3-utils": "1.2.2" + }, + "dependencies": { + "@types/node": { + "version": "10.17.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.24.tgz", + "integrity": "sha512-5SCfvCxV74kzR3uWgTYiGxrd69TbT1I6+cMx1A5kEly/IVveJBimtAMlXiEyVFn5DvUFewQWxOOiJhlxeQwxgA==", + "dev": true + }, + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "ethers": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.0-beta.3.tgz", + "integrity": "sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog==", + "dev": true, + "requires": { + "@types/node": "^10.3.2", + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.3.3", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.3", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "scrypt-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", + "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=", + "dev": true + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", + "dev": true + } + } + }, + "web3-eth-accounts": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.2.tgz", + "integrity": "sha512-KzHOEyXOEZ13ZOkWN3skZKqSo5f4Z1ogPFNn9uZbKCz+kSp+gCAEKxyfbOsB/JMAp5h7o7pb6eYsPCUBJmFFiA==", + "dev": true, + "requires": { + "any-promise": "1.3.0", + "crypto-browserify": "3.12.0", + "eth-lib": "0.2.7", + "ethereumjs-common": "^1.3.2", + "ethereumjs-tx": "^2.1.1", + "scrypt-shim": "github:web3-js/scrypt-shim", + "underscore": "1.9.1", + "uuid": "3.3.2", + "web3-core": "1.2.2", + "web3-core-helpers": "1.2.2", + "web3-core-method": "1.2.2", + "web3-utils": "1.2.2" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + } + } + }, + "web3-eth-contract": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.2.tgz", + "integrity": "sha512-EKT2yVFws3FEdotDQoNsXTYL798+ogJqR2//CaGwx3p0/RvQIgfzEwp8nbgA6dMxCsn9KOQi7OtklzpnJMkjtA==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.4", + "underscore": "1.9.1", + "web3-core": "1.2.2", + "web3-core-helpers": "1.2.2", + "web3-core-method": "1.2.2", + "web3-core-promievent": "1.2.2", + "web3-core-subscriptions": "1.2.2", + "web3-eth-abi": "1.2.2", + "web3-utils": "1.2.2" + } + }, + "web3-eth-ens": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.2.tgz", + "integrity": "sha512-CFjkr2HnuyMoMFBoNUWojyguD4Ef+NkyovcnUc/iAb9GP4LHohKrODG4pl76R5u61TkJGobC2ij6TyibtsyVYg==", + "dev": true, + "requires": { + "eth-ens-namehash": "2.0.8", + "underscore": "1.9.1", + "web3-core": "1.2.2", + "web3-core-helpers": "1.2.2", + "web3-core-promievent": "1.2.2", + "web3-eth-abi": "1.2.2", + "web3-eth-contract": "1.2.2", + "web3-utils": "1.2.2" + } + }, + "web3-eth-iban": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.2.tgz", + "integrity": "sha512-gxKXBoUhaTFHr0vJB/5sd4i8ejF/7gIsbM/VvemHT3tF5smnmY6hcwSMmn7sl5Gs+83XVb/BngnnGkf+I/rsrQ==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "web3-utils": "1.2.2" + } + }, + "web3-eth-personal": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.2.tgz", + "integrity": "sha512-4w+GLvTlFqW3+q4xDUXvCEMU7kRZ+xm/iJC8gm1Li1nXxwwFbs+Y+KBK6ZYtoN1qqAnHR+plYpIoVo27ixI5Rg==", + "dev": true, + "requires": { + "@types/node": "^12.6.1", + "web3-core": "1.2.2", + "web3-core-helpers": "1.2.2", + "web3-core-method": "1.2.2", + "web3-net": "1.2.2", + "web3-utils": "1.2.2" + }, + "dependencies": { + "@types/node": { + "version": "12.12.42", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.42.tgz", + "integrity": "sha512-R/9QdYFLL9dE9l5cWWzWIZByVGFd7lk7JVOJ7KD+E1SJ4gni7XJRLz9QTjyYQiHIqEAgku9VgxdLjMlhhUaAFg==", + "dev": true + } + } + }, + "web3-net": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.2.tgz", + "integrity": "sha512-K07j2DXq0x4UOJgae65rWZKraOznhk8v5EGSTdFqASTx7vWE/m+NqBijBYGEsQY1lSMlVaAY9UEQlcXK5HzXTw==", + "dev": true, + "requires": { + "web3-core": "1.2.2", + "web3-core-method": "1.2.2", + "web3-utils": "1.2.2" + } + }, + "web3-providers-http": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.2.tgz", + "integrity": "sha512-BNZ7Hguy3eBszsarH5gqr9SIZNvqk9eKwqwmGH1LQS1FL3NdoOn7tgPPdddrXec4fL94CwgNk4rCU+OjjZRNDg==", + "dev": true, + "requires": { + "web3-core-helpers": "1.2.2", + "xhr2-cookies": "1.1.0" + } + }, + "web3-providers-ipc": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.2.tgz", + "integrity": "sha512-t97w3zi5Kn/LEWGA6D9qxoO0LBOG+lK2FjlEdCwDQatffB/+vYrzZ/CLYVQSoyFZAlsDoBasVoYSWZK1n39aHA==", + "dev": true, + "requires": { + "oboe": "2.1.4", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.2" + } + }, + "web3-providers-ws": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.2.tgz", + "integrity": "sha512-Wb1mrWTGMTXOpJkL0yGvL/WYLt8fUIXx8k/l52QB2IiKzvyd42dTWn4+j8IKXGSYYzOm7NMqv6nhA5VDk12VfA==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.2", + "websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis" + } + }, + "web3-shh": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.2.tgz", + "integrity": "sha512-og258NPhlBn8yYrDWjoWBBb6zo1OlBgoWGT+LL5/LPqRbjPe09hlOYHgscAAr9zZGtohTOty7RrxYw6Z6oDWCg==", + "dev": true, + "requires": { + "web3-core": "1.2.2", + "web3-core-method": "1.2.2", + "web3-core-subscriptions": "1.2.2", + "web3-net": "1.2.2" + } + }, + "web3-utils": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", + "integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + } + } + }, + "websocket": { + "version": "github:web3-js/WebSocket-Node#ef5ea2f41daf4a2113b80c9223df884b4d56c400", + "from": "github:web3-js/WebSocket-Node#polyfill/globalThis", + "dev": true, + "requires": { + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "nan": "^2.14.0", + "typedarray-to-buffer": "^3.1.5", + "yaeti": "^0.0.6" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "when": { + "version": "3.7.8", + "resolved": "https://registry.npmjs.org/when/-/when-3.7.8.tgz", + "integrity": "sha1-xxMLan6gRpPoQs3J56Hyqjmjn4I=", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true + }, + "with": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/with/-/with-5.1.1.tgz", + "integrity": "sha1-+k2qktrzLE6pTtRTyB8EaGtXXf4=", + "dev": true, + "requires": { + "acorn": "^3.1.0", + "acorn-globals": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", "dev": true }, "wrappy": { @@ -7027,6 +10794,97 @@ "mkdirp": "^0.5.1" } }, + "ws": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", + "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "xhr": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.5.0.tgz", + "integrity": "sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ==", + "dev": true, + "requires": { + "global": "~4.3.0", + "is-function": "^1.0.1", + "parse-headers": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "xhr-request": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz", + "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", + "dev": true, + "requires": { + "buffer-to-arraybuffer": "^0.0.5", + "object-assign": "^4.1.1", + "query-string": "^5.0.1", + "simple-get": "^2.7.0", + "timed-out": "^4.0.1", + "url-set-query": "^1.0.0", + "xhr": "^2.0.4" + } + }, + "xhr-request-promise": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz", + "integrity": "sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg==", + "dev": true, + "requires": { + "xhr-request": "^1.1.0" + } + }, + "xhr2-cookies": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz", + "integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=", + "dev": true, + "requires": { + "cookiejar": "^2.1.1" + } + }, + "xmlhttprequest": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=", + "dev": true + }, + "xregexp": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.3.0.tgz", + "integrity": "sha512-7jXDIFXh5yJ/orPn4SXjuVrWWoi4Cr8jfV1eHv9CixKSbU+jY4mxfrBwAuDvupPNKpMUY+FeIqsVw/JLT9+B8g==", + "dev": true, + "requires": { + "@babel/runtime-corejs3": "^7.8.3" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=", + "dev": true + }, "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", @@ -7054,6 +10912,16 @@ "decamelize": "^1.0.0", "window-size": "0.1.0" } + }, + "yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "dev": true, + "requires": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } } } } diff --git a/package.json b/package.json index 1f9593c8..6e627381 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "gasLimit": "6200000" }, "scripts": { - "test": "cross-conf-env run-with-ganache --ganache-cmd 'npm run ganache' 'npm run truffle compile && npm run truffle migrate && npm run truffle test'", - "ganache": "cross-conf-env ganache-cli --gasLimit npm_package_config_gasLimit --account=\"0x0191ecbd1b150b8a3c27c27010ba51b45521689611e669109e034fd66ae69621,0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\" --account=\"0x00f360233e89c65970a41d4a85990ec6669526b2230e867c352130151453180d,9999999999999999999999999999999999999999999\" --account=\"0x987a26abca7432016104ce2f24ce639340e25afe06ac69f68791399e7a5d1028,9999999999999999999999999999999999999999999\" --account=\"0x89af34b1b7347834048b99423dad174a14bf14540d720d72c16ae92e94b987cb,9999999999999999999999999999999999999999999\" --account=\"0xc867be647eb2bc51e4c0d61066859875cf3634fe949b6f5f85c69ab90e485b37,9999999999999999999999999999999999999999999\" --account=\"0xefabcc2377dee5e51b5a9e65a3854aec85fbbec3cb584d8ad4f9679869fb33c6,9999999999999999999999999999999999999999999\"", + "test": "./scripts/test.sh", + "coverage": "./scripts/coverage.sh", "start": "pm2 start truffle -- serve", "lint": "eslint .", "lint --fix": "eslint --fix .", @@ -25,8 +25,8 @@ "build": "rimraf build && truffle compile" }, "devDependencies": { - "@babel/cli": "^7.2.3", - "babel-eslint": "^10.0.1", + "@babel/cli": "^7.10.1", + "babel-eslint": "^10.1.0", "babel-plugin-syntax-async-functions": "^6.13.0", "babel-polyfill": "^6.26.0", "babel-preset-es2015": "^6.24.1", @@ -37,10 +37,10 @@ "eslint": "^5.16.0", "eslint-config-defaults": "^9.0.0", "eslint-config-standard": "^11.0.0-beta.0", - "eslint-plugin-import": "^2.8.0", + "eslint-plugin-import": "^2.20.2", "eslint-plugin-node": "^5.2.1", "eslint-plugin-promise": "^3.6.0", - "eslint-plugin-react": "^7.6.1", + "eslint-plugin-react": "^7.20.0", "eslint-plugin-standard": "^3.0.1", "ethereumjs-abi": "^0.6.5", "pm2": "^2.9.3", @@ -48,8 +48,9 @@ "pug": "^2.0.0-rc.4", "rimraf": "^2.6.2", "run-with-ganache": "^0.1.1", - "solhint": "^2.2.0", - "truffle": "5.0.34", + "solhint": "^2.3.1", + "solidity-coverage": "^0.7.5", + "truffle": "^5.1.28", "uint32": "^0.2.1" }, "repository": { @@ -78,7 +79,7 @@ "@daostack/infra": "0.0.1-rc.15", "math": "0.0.3", "openzeppelin-solidity": "2.4.0", - "truffle-flattener": "^1.4.2" + "truffle-flattener": "^1.4.4" }, "peerDependencies": { "ganache-cli": "^6.4.1" diff --git a/scripts/coverage.sh b/scripts/coverage.sh new file mode 100755 index 00000000..34581c5d --- /dev/null +++ b/scripts/coverage.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Exit script as soon as a command fails. +set -o errexit + +NODE_OPTIONS=--max-old-space-size=4096 OVERRIDE_ARC_GAS_LIMIT=0xfffffffffff npx truffle run coverage diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 00000000..8879ecb6 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +# Exit script as soon as a command fails. +set -o errexit + +# Executes cleanup function at script exit. +trap cleanup EXIT + +cleanup() { + # Kill the ganache instance that we started (if we started one and if it's still running). + if [ -n "$ganache_pid" ] && ps -p $ganache_pid > /dev/null; then + kill -9 $ganache_pid + fi +} + +ganache_running() { + nc -z localhost 8545 +} + +start_ganache() { + + # Using 9000000 as gas limit and 10Gwei as gas price + npx ganache-cli --gasLimit 9000000 --gasPrice 1 -e 1000 --account="0x0191ecbd1b150b8a3c27c27010ba51b45521689611e669109e034fd66ae69621,0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" --account="0x00f360233e89c65970a41d4a85990ec6669526b2230e867c352130151453180d,9999999999999999999999999999999999999999999" --account="0x987a26abca7432016104ce2f24ce639340e25afe06ac69f68791399e7a5d1028,9999999999999999999999999999999999999999999" --account="0x89af34b1b7347834048b99423dad174a14bf14540d720d72c16ae92e94b987cb,9999999999999999999999999999999999999999999" --account="0xc867be647eb2bc51e4c0d61066859875cf3634fe949b6f5f85c69ab90e485b37,9999999999999999999999999999999999999999999\" --account=\"0xefabcc2377dee5e51b5a9e65a3854aec85fbbec3cb584d8ad4f9679869fb33c6,9999999999999999999999999999999999999999999"> /dev/null & + + ganache_pid=$! + + echo "Waiting for ganache to launch..." + + while ! ganache_running; do + sleep 0.1 # wait for 1/10 of the second before check again + done + + echo "Ganache launched!" +} + +if ganache_running; then + echo "Using existing ganache instance" +else + echo "Starting our own ganache instance" + start_ganache +fi + +npx truffle version +npx truffle compile +npx truffle test diff --git a/test/constants.js b/test/constants.js index 04c7b377..9bc753eb 100644 --- a/test/constants.js +++ b/test/constants.js @@ -1,3 +1,3 @@ -const ARC_GAS_LIMIT = 6200000; +const ARC_GAS_LIMIT = process.env.OVERRIDE_ARC_GAS_LIMIT || 6200000; module.exports = { ARC_GAS_LIMIT }; diff --git a/test/daotoken.js b/test/daotoken.js index 4300c66b..cf405a31 100644 --- a/test/daotoken.js +++ b/test/daotoken.js @@ -18,8 +18,6 @@ contract('DAOToken', accounts => { }); it("should mint tokens to owner account", async () => { - await helpers.etherForEveryone(accounts); - let owner, totalSupply, userSupply; const token = await DAOToken.new(testTokenName,testTokenSymbol,0); totalSupply = await token.totalSupply(); @@ -43,7 +41,6 @@ contract('DAOToken', accounts => { }); it("should allow minting tokens only by owner", async () => { - await helpers.etherForEveryone(accounts); const token = await DAOToken.new(testTokenName,testTokenSymbol,0); let owner = await token.owner(); let totalSupply = await token.totalSupply(); diff --git a/test/genericscheme.js b/test/genericscheme.js index 28576408..2c6159c7 100644 --- a/test/genericscheme.js +++ b/test/genericscheme.js @@ -71,9 +71,6 @@ const createCallToActionMock = async function(_avatar,_actionMock) { }; contract('GenericScheme', function(accounts) { - before(function() { - helpers.etherForEveryone(accounts); - }); it("proposeCall log", async function() { diff --git a/test/organizationregister.js b/test/organizationregister.js index 2a1a980b..6c804287 100644 --- a/test/organizationregister.js +++ b/test/organizationregister.js @@ -41,9 +41,6 @@ const setup = async function (accounts) { }; contract('OrganizationRegister',accounts => { - before(function() { - helpers.etherForEveryone(accounts); - }); it("setParameters", async() => { var organizationRegister = await OrganizationRegister.new(); diff --git a/test/upgradescheme.js b/test/upgradescheme.js index 74cceba2..8d6bbbf1 100644 --- a/test/upgradescheme.js +++ b/test/upgradescheme.js @@ -67,9 +67,6 @@ const setup = async function (accounts) { }; contract('UpgradeScheme', accounts => { - before(function() { - helpers.etherForEveryone(accounts); - }); it("setParameters", async() => { var upgradeScheme = await UpgradeScheme.new(); diff --git a/test/voteinorganization.js b/test/voteinorganization.js index d98d8889..15df72dc 100644 --- a/test/voteinorganization.js +++ b/test/voteinorganization.js @@ -76,9 +76,7 @@ const setup = async function (accounts,reputationAccount=0,genesisProtocol = fal }; contract('VoteInOrganizationScheme', accounts => { - before(function() { - helpers.etherForEveryone(accounts); - }); + it("setParameters", async() => { var voteInOrganization = await VoteInOrganizationScheme.new(); var absoluteVote = await AbsoluteVote.new(); diff --git a/truffle.js b/truffle-config.js similarity index 94% rename from truffle.js rename to truffle-config.js index 01bd33dc..1694cd1c 100644 --- a/truffle.js +++ b/truffle-config.js @@ -36,7 +36,7 @@ module.exports = { port: 8545, gas: 4543760 }, - coverage: { + soliditycoverage: { host: 'localhost', network_id: '*', // eslint-disable-line camelcase port: 8555, @@ -61,6 +61,7 @@ module.exports = { enabled: true, runs: 200 } - } - } + } + }, + plugins: ["solidity-coverage"] };