UNPKG

arc_dx

Version:

A platform for building DAOs

1,133 lines 513 kB
{ "contractName": "Locking4Reputation", "abi": [ { "constant": true, "inputs": [], "name": "redeemEnableTime", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "lockingStartTime", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "totalLocked", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "avatar", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "address" } ], "name": "scores", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "address" }, { "name": "", "type": "bytes32" } ], "name": "lockers", "outputs": [ { "name": "amount", "type": "uint256" }, { "name": "releaseTime", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "lockingEndTime", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "reputationRewardLeft", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "maxLockingPeriod", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "totalScore", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "lockingsCounter", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "totalLockedLeft", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "reputationReward", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "_beneficiary", "type": "address" }, { "indexed": false, "name": "_amount", "type": "uint256" } ], "name": "Redeem", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "_lockingId", "type": "bytes32" }, { "indexed": true, "name": "_beneficiary", "type": "address" }, { "indexed": false, "name": "_amount", "type": "uint256" } ], "name": "Release", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "_locker", "type": "address" }, { "indexed": true, "name": "_lockingId", "type": "bytes32" }, { "indexed": false, "name": "_amount", "type": "uint256" }, { "indexed": false, "name": "_period", "type": "uint256" } ], "name": "Lock", "type": "event" }, { "constant": false, "inputs": [ { "name": "_beneficiary", "type": "address" } ], "name": "redeem", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x608060405234801561001057600080fd5b506106f4806100206000396000f3006080604052600436106100cf5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633d1678f481146100d457806355bfec88146100fb57806356891412146101105780635aef7de61461012557806376dd110f14610156578063838057421461017757806395a2251f146101b4578063a8c33017146101e9578063afe0e33c146101fe578063bf0df44514610213578063c006719f14610228578063c3201add1461023d578063c348a24b14610252578063ed1ff6d814610267575b600080fd5b3480156100e057600080fd5b506100e961027c565b60408051918252519081900360200190f35b34801561010757600080fd5b506100e9610282565b34801561011c57600080fd5b506100e9610288565b34801561013157600080fd5b5061013a61028e565b60408051600160a060020a039092168252519081900360200190f35b34801561016257600080fd5b506100e9600160a060020a036004351661029d565b34801561018357600080fd5b5061019b600160a060020a03600435166024356102af565b6040805192835260208301919091528051918290030190f35b3480156101c057600080fd5b506101d5600160a060020a03600435166102d0565b604080519115158252519081900360200190f35b3480156101f557600080fd5b506100e9610648565b34801561020a57600080fd5b506100e961064e565b34801561021f57600080fd5b506100e9610654565b34801561023457600080fd5b506100e961065a565b34801561024957600080fd5b506100e9610660565b34801561025e57600080fd5b506100e9610666565b34801561027357600080fd5b506100e961066c565b600c5481565b600b5481565b60035481565b600054600160a060020a031681565b60026020526000908152604090205481565b60016020818152600093845260408085209091529183529120805491015482565b600080600080600c544211151561034857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6e6f77203e2072656465656d456e61626c6554696d6500000000000000000000604482015290519081900360640190fd5b600160a060020a038516600090815260026020526040812054116103cd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f73636f72652073686f756c64206265203e203000000000000000000000000000604482015290519081900360640190fd5b600160a060020a038516600090815260026020526040812080549190556007549093506104189061040090601a0b610672565b61040c85601a0b610672565b9063ffffffff61068016565b915061044061043b61042e600554601a0b610672565b849063ffffffff61068d16565b6106aa565b601a0b905061045a816008546106b690919063ffffffff16565b60085560008054604080517f8da5cb5b0000000000000000000000000000000000000000000000000000000081529051600160a060020a0390921692638da5cb5b926004808401936020939083900390910190829087803b1580156104be57600080fd5b505af11580156104d2573d6000803e3d6000fd5b505050506040513d60208110156104e857600080fd5b505160008054604080517feaf994b200000000000000000000000000000000000000000000000000000000815260048101869052600160a060020a038a8116602483015292831660448201529051919093169263eaf994b29260648083019360209390929083900390910190829087803b15801561056557600080fd5b505af1158015610579573d6000803e3d6000fd5b505050506040513d602081101561058f57600080fd5b505115156105fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f6d696e742072657075746174696f6e2073686f756c6420737563636573730000604482015290519081900360640190fd5b604080518281529051600160a060020a038716917f222838db2794d11532d940e8dec38ae307ed0b63cd97c233322e221f998767a6919081900360200190a2506001949350505050565b60095481565b60085481565b600a5481565b60055481565b60065481565b60045481565b60075481565b601a0b650100000000000290565b6501000000000091020590565b6000816501000000000084028115156106a257fe5b059392505050565b65010000000000900590565b6000828211156106c257fe5b509003905600a165627a7a72305820ed01e2b423b2c31cd01e791a00e732803e93215a3b98b76790066758d1adb54f0029", "deployedBytecode": "0x6080604052600436106100cf5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633d1678f481146100d457806355bfec88146100fb57806356891412146101105780635aef7de61461012557806376dd110f14610156578063838057421461017757806395a2251f146101b4578063a8c33017146101e9578063afe0e33c146101fe578063bf0df44514610213578063c006719f14610228578063c3201add1461023d578063c348a24b14610252578063ed1ff6d814610267575b600080fd5b3480156100e057600080fd5b506100e961027c565b60408051918252519081900360200190f35b34801561010757600080fd5b506100e9610282565b34801561011c57600080fd5b506100e9610288565b34801561013157600080fd5b5061013a61028e565b60408051600160a060020a039092168252519081900360200190f35b34801561016257600080fd5b506100e9600160a060020a036004351661029d565b34801561018357600080fd5b5061019b600160a060020a03600435166024356102af565b6040805192835260208301919091528051918290030190f35b3480156101c057600080fd5b506101d5600160a060020a03600435166102d0565b604080519115158252519081900360200190f35b3480156101f557600080fd5b506100e9610648565b34801561020a57600080fd5b506100e961064e565b34801561021f57600080fd5b506100e9610654565b34801561023457600080fd5b506100e961065a565b34801561024957600080fd5b506100e9610660565b34801561025e57600080fd5b506100e9610666565b34801561027357600080fd5b506100e961066c565b600c5481565b600b5481565b60035481565b600054600160a060020a031681565b60026020526000908152604090205481565b60016020818152600093845260408085209091529183529120805491015482565b600080600080600c544211151561034857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6e6f77203e2072656465656d456e61626c6554696d6500000000000000000000604482015290519081900360640190fd5b600160a060020a038516600090815260026020526040812054116103cd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f73636f72652073686f756c64206265203e203000000000000000000000000000604482015290519081900360640190fd5b600160a060020a038516600090815260026020526040812080549190556007549093506104189061040090601a0b610672565b61040c85601a0b610672565b9063ffffffff61068016565b915061044061043b61042e600554601a0b610672565b849063ffffffff61068d16565b6106aa565b601a0b905061045a816008546106b690919063ffffffff16565b60085560008054604080517f8da5cb5b0000000000000000000000000000000000000000000000000000000081529051600160a060020a0390921692638da5cb5b926004808401936020939083900390910190829087803b1580156104be57600080fd5b505af11580156104d2573d6000803e3d6000fd5b505050506040513d60208110156104e857600080fd5b505160008054604080517feaf994b200000000000000000000000000000000000000000000000000000000815260048101869052600160a060020a038a8116602483015292831660448201529051919093169263eaf994b29260648083019360209390929083900390910190829087803b15801561056557600080fd5b505af1158015610579573d6000803e3d6000fd5b505050506040513d602081101561058f57600080fd5b505115156105fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f6d696e742072657075746174696f6e2073686f756c6420737563636573730000604482015290519081900360640190fd5b604080518281529051600160a060020a038716917f222838db2794d11532d940e8dec38ae307ed0b63cd97c233322e221f998767a6919081900360200190a2506001949350505050565b60095481565b60085481565b600a5481565b60055481565b60065481565b60045481565b60075481565b601a0b650100000000000290565b6501000000000091020590565b6000816501000000000084028115156106a257fe5b059392505050565b65010000000000900590565b6000828211156106c257fe5b509003905600a165627a7a72305820ed01e2b423b2c31cd01e791a00e732803e93215a3b98b76790066758d1adb54f0029", "sourceMap": "162:5574:13:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;162:5574:13;;;;;;;", "deployedSourceMap": "162:5574:13:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1191:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1191:28:13;;;;;;;;;;;;;;;;;;;;1157;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1157:28:13;;;;868:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;868:23:13;;;;613:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;613:20:13;;;;;;;;-1:-1:-1;;;;;613:20:13;;;;;;;;;;;;;;823:38;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;823:38:13;-1:-1:-1;;;;;823:38:13;;;;;701:59;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;701:59:13;-1:-1:-1;;;;;701:59:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1360:859;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1360:859:13;-1:-1:-1;;;;;1360:859:13;;;;;;;;;;;;;;;;;;;;;;;1091:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1091:26:13;;;;1053:32;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1053:32:13;;;;1123:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1123:28:13;;;;930:22;;8:9:-1;5:2;;;30:1;27;20:12;5:2;930:22:13;;;;958:27;;8:9:-1;5:2;;;30:1;27;20:12;5:2;958:27:13;;;;897;;8:9:-1;5:2;;;30:1;27;20:12;5:2;897:27:13;;;;1019:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1019:28:13;;;;1191;;;;:::o;1157:::-;;;;:::o;868:23::-;;;;:::o;613:20::-;;;-1:-1:-1;;;;;613:20:13;;:::o;823:38::-;;;;;;;;;;;;;:::o;701:59::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1360:859::-;1413:4;1636:10;1713:18;1805:15;1517:16;;1499:15;:34;1491:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1578:20:13;;1601:1;1578:20;;;:6;:20;;;;;;:24;1570:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1649:20:13;;;;;;:6;:20;;;;;;;1679:24;;;1768:16;;1649:20;;-1:-1:-1;1734:61:13;;1761:33;;:31;;;:33::i;:::-;1734:22;1741:5;1734:20;;;:22::i;:::-;:26;:61;:26;:61;:::i;:::-;1713:82;;1831:55;:44;1847:27;1854:10;;1847:25;;;:27::i;:::-;1831:11;;:44;:15;:44;:::i;:::-;:53;:55::i;:::-;1823:64;;1805:82;;1969:36;1994:10;1969:20;;:24;;:36;;;;:::i;:::-;1946:20;:59;2043:6;;;:14;;;;;;;;-1:-1:-1;;;;;2043:6:13;;;;:12;;:14;;;;;;;;;;;;;;;;;:6;:14;;;5:2:-1;;;;30:1;27;20:12;5:2;2043:14:13;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2043:14:13;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2043:14:13;2100:6;;;2023:84;;;;;;;;;;;;-1:-1:-1;;;;;2023:84:13;;;;;;;2100:6;;;2023:84;;;;;;:50;;;;;;;:84;;;;;2043:14;;2023:84;;;;;;;;;;;;:50;:84;;;5:2:-1;;;;30:1;27;20:12;5:2;2023:84:13;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2023:84:13;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2023:84:13;2015:127;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2158:32;;;;;;;;-1:-1:-1;;;;;2158:32:13;;;;;;;;;;;;;-1:-1:-1;2208:4:13;;1360:859;-1:-1:-1;;;;1360:859:13:o;1091:26::-;;;;:::o;1053:32::-;;;;:::o;1123:28::-;;;;:::o;930:22::-;;;;:::o;958:27::-;;;;:::o;897:::-;;;;:::o;1019:28::-;;;;:::o;2123:109:8:-;2201:13;;1184:23;2201:24;;2123:109::o;4641:316::-;4904:45;4905:29;;4904:45;;4641:316::o;5040:348::-;5122:6;5364:15;1184:23;5321:32;;5320:60;;;;;;;;;5040:348;-1:-1:-1;;;5040:348:8:o;2307:119::-;1184:23;2398:20;;;2307:119::o;1060:116:54:-;1120:7;1142:8;;;;1135:16;;;;-1:-1:-1;1164:7:54;;;1060:116::o", "source": "pragma solidity ^0.4.25;\n\nimport \"../controller/ControllerInterface.sol\";\nimport { RealMath } from \"../libs/RealMath.sol\";\n\n\n/**\n * @title A locker contract\n */\n\ncontract Locking4Reputation {\n using SafeMath for uint;\n using RealMath for int216;\n using RealMath for int256;\n\n event Redeem(address indexed _beneficiary, uint _amount);\n event Release(bytes32 indexed _lockingId, address indexed _beneficiary, uint _amount);\n event Lock(address indexed _locker, bytes32 indexed _lockingId, uint _amount, uint _period);\n\n struct Locker {\n uint amount;\n uint releaseTime;\n }\n\n Avatar public avatar;\n\n // A mapping from lockers addresses their lock balances.\n mapping(address => mapping(bytes32=>Locker)) public lockers;\n // A mapping from lockers addresses to their scores.\n mapping(address => uint) public scores;\n\n uint public totalLocked;\n uint public totalLockedLeft;\n uint public totalScore;\n uint public lockingsCounter; // Total number of lockings\n uint public reputationReward;\n uint public reputationRewardLeft;\n uint public lockingEndTime;\n uint public maxLockingPeriod;\n uint public lockingStartTime;\n uint public redeemEnableTime;\n\n /**\n * @dev redeem reputation function\n * @param _beneficiary the beneficiary for the release\n * @return bool\n */\n function redeem(address _beneficiary) public returns(bool) {\n // solium-disable-next-line security/no-block-members\n require(block.timestamp > redeemEnableTime, \"now > redeemEnableTime\");\n require(scores[_beneficiary] > 0, \"score should be > 0\");\n uint score = scores[_beneficiary];\n scores[_beneficiary] = 0;\n int256 repRelation = int216(score).toReal().mul(int216(reputationReward).toReal());\n uint reputation = uint256(repRelation.div(int216(totalScore).toReal()).fromReal());\n\n //check that the reputation is sum zero\n reputationRewardLeft = reputationRewardLeft.sub(reputation);\n require(ControllerInterface(avatar.owner()).mintReputation(reputation, _beneficiary, avatar), \"mint reputation should success\");\n\n emit Redeem(_beneficiary, reputation);\n\n return true;\n }\n\n /**\n * @dev release function\n * @param _beneficiary the beneficiary for the release\n * @param _lockingId the locking id to release\n * @return bool\n */\n function _release(address _beneficiary, bytes32 _lockingId) internal returns(uint amount) {\n Locker storage locker = lockers[_beneficiary][_lockingId];\n require(locker.amount > 0, \"amount should be > 0\");\n amount = locker.amount;\n locker.amount = 0;\n // solium-disable-next-line security/no-block-members\n require(block.timestamp > locker.releaseTime, \"check the lock period pass\");\n totalLockedLeft = totalLockedLeft.sub(amount);\n\n emit Release(_lockingId, _beneficiary, amount);\n }\n\n /**\n * @dev lock function\n * @param _amount the amount to lock\n * @param _period the locking period\n * @param _locker the locker\n * @return lockingId\n */\n function _lock(uint _amount, uint _period, address _locker) internal returns(bytes32 lockingId) {\n require(_amount > 0, \"locking amount should be > 0\");\n require(_period <= maxLockingPeriod, \"locking period should be <= maxLockingPeriod\");\n require(_period > 0, \"locking period should be > 0\");\n // solium-disable-next-line security/no-block-members\n require(now <= lockingEndTime, \"lock should be within the allowed locking period\");\n // solium-disable-next-line security/no-block-members\n require(now >= lockingStartTime, \"lock should start after lockingStartTime\");\n\n lockingId = keccak256(abi.encodePacked(this, lockingsCounter));\n lockingsCounter++;\n\n Locker storage locker = lockers[_locker][lockingId];\n locker.amount = _amount;\n // solium-disable-next-line security/no-block-members\n locker.releaseTime = now + _period;\n totalLocked += _amount;\n totalLockedLeft = totalLocked;\n scores[_locker] = scores[_locker].add(_period.mul(_amount));\n totalScore = totalScore.add(scores[_locker]);\n\n emit Lock(_locker, lockingId, _amount, _period);\n }\n\n /**\n * @dev _initialize\n * @param _avatar the avatar to mint reputation from\n * @param _reputationReward the total reputation this contract will reward\n * for eth/token locking\n * @param _lockingStartTime the locking start time.\n * @param _lockingEndTime the locking end time.\n * locking is disable after this time.\n * @param _redeemEnableTime redeem enable time .\n * redeem reputation can be done after this time.\n * @param _maxLockingPeriod maximum locking period allowed.\n */\n function _initialize(\n Avatar _avatar,\n uint _reputationReward,\n uint _lockingStartTime,\n uint _lockingEndTime,\n uint _redeemEnableTime,\n uint _maxLockingPeriod)\n internal\n {\n require(avatar == Avatar(0), \"can be called only one time\");\n require(_avatar != Avatar(0), \"avatar cannot be zero\");\n require(_lockingEndTime > _lockingStartTime, \"locking end time should be greater than locking start time\");\n require(_redeemEnableTime >= _lockingEndTime, \"redeemEnableTime >= lockingEndTime\");\n\n reputationReward = _reputationReward;\n reputationRewardLeft = _reputationReward;\n lockingEndTime = _lockingEndTime;\n maxLockingPeriod = _maxLockingPeriod;\n avatar = _avatar;\n lockingStartTime = _lockingStartTime;\n redeemEnableTime = _redeemEnableTime;\n }\n\n}\n", "sourcePath": "/Users/oren/daostack/daostack2/daostack/contracts/schemes/Locking4Reputation.sol", "ast": { "absolutePath": "/Users/oren/daostack/daostack2/daostack/contracts/schemes/Locking4Reputation.sol", "exportedSymbols": { "Locking4Reputation": [ 6223 ] }, "id": 6224, "nodeType": "SourceUnit", "nodes": [ { "id": 5799, "literals": [ "solidity", "^", "0.4", ".25" ], "nodeType": "PragmaDirective", "src": "0:24:13" }, { "absolutePath": "/Users/oren/daostack/daostack2/daostack/contracts/controller/ControllerInterface.sol", "file": "../controller/ControllerInterface.sol", "id": 5800, "nodeType": "ImportDirective", "scope": 6224, "sourceUnit": 2007, "src": "26:47:13", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/oren/daostack/daostack2/daostack/contracts/libs/RealMath.sol", "file": "../libs/RealMath.sol", "id": 5802, "nodeType": "ImportDirective", "scope": 6224, "sourceUnit": 4958, "src": "74:48:13", "symbolAliases": [ { "foreign": 5801, "local": null } ], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "@title A locker contract", "fullyImplemented": true, "id": 6223, "linearizedBaseContracts": [ 6223 ], "name": "Locking4Reputation", "nodeType": "ContractDefinition", "nodes": [ { "id": 5805, "libraryName": { "contractScope": null, "id": 5803, "name": "SafeMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 20791, "src": "202:8:13", "typeDescriptions": { "typeIdentifier": "t_contract$_SafeMath_$20791", "typeString": "library SafeMath" } }, "nodeType": "UsingForDirective", "src": "196:24:13", "typeName": { "id": 5804, "name": "uint", "nodeType": "ElementaryTypeName", "src": "215:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, { "id": 5808, "libraryName": { "contractScope": null, "id": 5806, "name": "RealMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4957, "src": "231:8:13", "typeDescriptions": { "typeIdentifier": "t_contract$_RealMath_$4957", "typeString": "library RealMath" } }, "nodeType": "UsingForDirective", "src": "225:26:13", "typeName": { "id": 5807, "name": "int216", "nodeType": "ElementaryTypeName", "src": "244:6:13", "typeDescriptions": { "typeIdentifier": "t_int216", "typeString": "int216" } } }, { "id": 5811, "libraryName": { "contractScope": null, "id": 5809, "name": "RealMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4957, "src": "262:8:13", "typeDescriptions": { "typeIdentifier": "t_contract$_RealMath_$4957", "typeString": "library RealMath" } }, "nodeType": "UsingForDirective", "src": "256:26:13", "typeName": { "id": 5810, "name": "int256", "nodeType": "ElementaryTypeName", "src": "275:6:13", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } }, { "anonymous": false, "documentation": null, "id": 5817, "name": "Redeem", "nodeType": "EventDefinition", "parameters": { "id": 5816, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5813, "indexed": true, "name": "_beneficiary", "nodeType": "VariableDeclaration", "scope": 5817, "src": "301:28:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 5812, "name": "address", "nodeType": "ElementaryTypeName", "src": "301:7:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5815, "indexed": false, "name": "_amount", "nodeType": "VariableDeclaration", "scope": 5817, "src": "331:12:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5814, "name": "uint", "nodeType": "ElementaryTypeName", "src": "331:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "300:44:13" }, "src": "288:57:13" }, { "anonymous": false, "documentation": null, "id": 5825, "name": "Release", "nodeType": "EventDefinition", "parameters": { "id": 5824, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5819, "indexed": true, "name": "_lockingId", "nodeType": "VariableDeclaration", "scope": 5825, "src": "364:26:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 5818, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "364:7:13", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5821, "indexed": true, "name": "_beneficiary", "nodeType": "VariableDeclaration", "scope": 5825, "src": "392:28:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 5820, "name": "address", "nodeType": "ElementaryTypeName", "src": "392:7:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5823, "indexed": false, "name": "_amount", "nodeType": "VariableDeclaration", "scope": 5825, "src": "422:12:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5822, "name": "uint", "nodeType": "ElementaryTypeName", "src": "422:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "363:72:13" }, "src": "350:86:13" }, { "anonymous": false, "documentation": null, "id": 5835, "name": "Lock", "nodeType": "EventDefinition", "parameters": { "id": 5834, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 5827, "indexed": true, "name": "_locker", "nodeType": "VariableDeclaration", "scope": 5835, "src": "452:23:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 5826, "name": "address", "nodeType": "ElementaryTypeName", "src": "452:7:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5829, "indexed": true, "name": "_lockingId", "nodeType": "VariableDeclaration", "scope": 5835, "src": "477:26:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 5828, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "477:7:13", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5831, "indexed": false, "name": "_amount", "nodeType": "VariableDeclaration", "scope": 5835, "src": "505:12:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5830, "name": "uint", "nodeType": "ElementaryTypeName", "src": "505:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5833, "indexed": false, "name": "_period", "nodeType": "VariableDeclaration", "scope": 5835, "src": "519:12:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5832, "name": "uint", "nodeType": "ElementaryTypeName", "src": "519:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "451:81:13" }, "src": "441:92:13" }, { "canonicalName": "Locking4Reputation.Locker", "id": 5840, "members": [ { "constant": false, "id": 5837, "name": "amount", "nodeType": "VariableDeclaration", "scope": 5840, "src": "563:11:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5836, "name": "uint", "nodeType": "ElementaryTypeName", "src": "563:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 5839, "name": "releaseTime", "nodeType": "VariableDeclaration", "scope": 5840, "src": "584:16:13", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5838, "name": "uint", "nodeType": "ElementaryTypeName", "src": "584:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "name": "Locker", "nodeType": "StructDefinition", "scope": 6223, "src": "539:68:13", "visibility": "public" }, { "constant": false, "id": 5842, "name": "avatar", "nodeType": "VariableDeclaration", "scope": 6223, "src": "613:20:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$333", "typeString": "contract Avatar" }, "typeName": { "contractScope": null, "id": 5841, "name": "Avatar", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 333, "src": "613:6:13", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$333", "typeString": "contract Avatar" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 5848, "name": "lockers", "nodeType": "VariableDeclaration", "scope": 6223, "src": "701:59:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_struct$_Locker_$5840_storage_$_$", "typeString": "mapping(address => mapping(bytes32 => struct Locking4Reputation.Locker))" }, "typeName": { "id": 5847, "keyType": { "id": 5843, "name": "address", "nodeType": "ElementaryTypeName", "src": "709:7:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "701:44:13", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_bytes32_$_t_struct$_Locker_$5840_storage_$_$", "typeString": "mapping(address => mapping(bytes32 => struct Locking4Reputation.Locker))" }, "valueType": { "id": 5846, "keyType": { "id": 5844, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "728:7:13", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "720:24:13", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Locker_$5840_storage_$", "typeString": "mapping(bytes32 => struct Locking4Reputation.Locker)" }, "valueType": { "contractScope": null, "id": 5845, "name": "Locker", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5840, "src": "737:6:13", "typeDescriptions": { "typeIdentifier": "t_struct$_Locker_$5840_storage_ptr", "typeString": "struct Locking4Reputation.Locker" } } } }, "value": null, "visibility": "public" }, { "constant": false, "id": 5852, "name": "scores", "nodeType": "VariableDeclaration", "scope": 6223, "src": "823:38:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "typeName": { "id": 5851, "keyType": { "id": 5849, "name": "address", "nodeType": "ElementaryTypeName", "src": "831:7:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "823:24:13", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 5850, "name": "uint", "nodeType": "ElementaryTypeName", "src": "842:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "public" }, { "constant": false, "id": 5854, "name": "totalLocked", "nodeType": "VariableDeclaration", "scope": 6223, "src": "868:23:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5853, "name": "uint", "nodeType": "ElementaryTypeName", "src": "868:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 5856, "name": "totalLockedLeft", "nodeType": "VariableDeclaration", "scope": 6223, "src": "897:27:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5855, "name": "uint", "nodeType": "ElementaryTypeName", "src": "897:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 5858, "name": "totalScore", "nodeType": "VariableDeclaration", "scope": 6223, "src": "930:22:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5857, "name": "uint", "nodeType": "ElementaryTypeName", "src": "930:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 5860, "name": "lockingsCounter", "nodeType": "VariableDeclaration", "scope": 6223, "src": "958:27:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5859, "name": "uint", "nodeType": "ElementaryTypeName", "src": "958:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 5862, "name": "reputationReward", "nodeType": "VariableDeclaration", "scope": 6223, "src": "1019:28:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5861, "name": "uint", "nodeType": "ElementaryTypeName", "src": "1019:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 5864, "name": "reputationRewardLeft", "nodeType": "VariableDeclaration", "scope": 6223, "src": "1053:32:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5863, "name": "uint", "nodeType": "ElementaryTypeName", "src": "1053:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 5866, "name": "lockingEndTime", "nodeType": "VariableDeclaration", "scope": 6223, "src": "1091:26:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5865, "name": "uint", "nodeType": "ElementaryTypeName", "src": "1091:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 5868, "name": "maxLockingPeriod", "nodeType": "VariableDeclaration", "scope": 6223, "src": "1123:28:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5867, "name": "uint", "nodeType": "ElementaryTypeName", "src": "1123:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value"