UNPKG

@gooddollar/goodcontracts

Version:
1,019 lines 164 kB
{ "contractName": "ActivePeriod", "abi": [ { "inputs": [ { "internalType": "uint256", "name": "_periodStart", "type": "uint256" }, { "internalType": "uint256", "name": "_periodEnd", "type": "uint256" }, { "internalType": "contract Avatar", "name": "_avatar", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "by", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "time", "type": "uint256" } ], "name": "SchemeEnded", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "by", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "time", "type": "uint256" } ], "name": "SchemeStarted", "type": "event" }, { "constant": true, "inputs": [], "name": "isActive", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "periodEnd", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "periodStart", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "start", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [], "name": "end", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_periodStart\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periodEnd\",\"type\":\"uint256\"},{\"internalType\":\"contract Avatar\",\"name\":\"_avatar\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"by\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"time\",\"type\":\"uint256\"}],\"name\":\"SchemeEnded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"by\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"time\",\"type\":\"uint256\"}],\"name\":\"SchemeStarted\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[],\"name\":\"end\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"periodEnd\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"periodStart\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"start\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/ActivePeriod.sol\":\"ActivePeriod\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/ActivePeriod.sol\":{\"keccak256\":\"0xd6b17fe8c789a03e87c80046319caee9fc9c9b5ded9008b09a550027c205c5ab\",\"urls\":[\"bzz-raw://0f77e8dc5f6abeefc9a2e185c257516f7f0266ae2781dd67c18daf1aac667daf\",\"dweb:/ipfs/QmbeRqLP2MvTZifqPBSK3PUDh8TjC1RaTA8b1dRRAXahmJ\"]},\"@daostack/arc/contracts/controller/Avatar.sol\":{\"keccak256\":\"0x4e4fb9d3bc21f42fbfc6a01e9f8aa483a59e9f447b0d604f55b587a81ec09ef4\",\"urls\":[\"bzz-raw://9d3c1c7575cf6075ea1d89921f09b9b8e322b208dacaf0446cd4f64506c999f0\",\"dweb:/ipfs/QmVGDDHAR2ByuQpbgV7BBKXGEAcbaWvejpEZYzHgaagBFK\"]},\"@daostack/arc/contracts/controller/DAOToken.sol\":{\"keccak256\":\"0x9b213e4e3ceeffcfc1c962a43b70b8d763d8091a2dd713fc1989b97bb68786e6\",\"urls\":[\"bzz-raw://51d1d6e85fd90f45395a16b7a3c703c4636e836041f2a13f806e4222ef2e59c1\",\"dweb:/ipfs/QmQjeCeFf7TJzsYjT5scyZUDDixBA8Yy8YppgBuxcKPDnP\"]},\"@daostack/arc/contracts/libs/SafeERC20.sol\":{\"keccak256\":\"0xf6727d432f67046145b078f40c1cc4f6be7b0d12a6678ecaf457edf7550d244c\",\"urls\":[\"bzz-raw://5dba7734c4fed446c084a707761cbc66ba22b8b93ef53c8d4a22a76b6e271690\",\"dweb:/ipfs/QmP2VpPKUqLh4ZZs6LaxHVpCN1zCmiorygL9bMub4mbYCw\"]},\"@daostack/infra/contracts/Reputation.sol\":{\"keccak256\":\"0x3d226dac0fe7d758f0287fb28bc25fcec1f69d19888ae3a550fa49856d61c482\",\"urls\":[\"bzz-raw://8856852c8fe0ba1c9aab326f0a9a6e7f31a238de2778fa5188e6fc399f7eb352\",\"dweb:/ipfs/QmVH4ppR9Dk7v8yxaSgeArdMv9gBBVoQxEf4E3UsqQ4rY2\"]},\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x965012d27b4262d7a41f5028cbb30c51ebd9ecd4be8fb30380aaa7a3c64fbc8b\",\"urls\":[\"bzz-raw://1eb493553b27efd46c231a836a83ce50d215639feb97b4aac9f301d0fd034ff5\",\"dweb:/ipfs/QmbMdvSXcqGKxeeYvzF3VrWpoHQyVzMXBhzhAokF2Gdymv\"]},\"openzeppelin-solidity/contracts/ownership/Ownable.sol\":{\"keccak256\":\"0x980de387a1a020a498f53d00f89fecebb12c949a17e8f160093c0303ede2b786\",\"urls\":[\"bzz-raw://f07a2c393caa85f62f0aaa461e3edd50aa59371d4209778ba0558d7f8b4b856c\",\"dweb:/ipfs/QmeN3ZiYGSjCnQFeYaJNgoXjF9eDue1g3e9pqManRkeBtV\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol\":{\"keccak256\":\"0xba431353cb4fe70777ac026231eb5468e41aa1e81240a2b8136917acc5fff4dc\",\"urls\":[\"bzz-raw://f40c91ca270bdc9b156f339081a0fc2bbcf73cf5f62b8c73ba555df753ff6619\",\"dweb:/ipfs/QmT8y2VVjGaFdGphpcXrgvdPi2EgF9LuCDgJiJ89LvpFRV\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol\":{\"keccak256\":\"0xa3e68fd7f987c8fbdaf4867d428a69a15f3cf2f69709a5b0a0fbef750b0e6fbc\",\"urls\":[\"bzz-raw://50b1ff986d3b2793850a66c8429d9886fdfb134b1509b3e98714e3e2a71e24f5\",\"dweb:/ipfs/QmSQBYPeY9tbR3ciGRNQqvcWKnNiuxtVMq2MsPWpLwuGGm\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x079c4e23ee448f529e43bfa3c4e8fb4be52cd0318ee923a276835bedf45b93d8\",\"urls\":[\"bzz-raw://ee762ff5b7746e41d27dcbcea00c7a3034b58adb1b45ddadddb5b721aff450df\",\"dweb:/ipfs/QmdxqtgEFZjHCoiYyz6pUAQ5iBm7As25jcyEbZoTaAgyDa\"]},\"openzeppelin-solidity/contracts/utils/Address.sol\":{\"keccak256\":\"0x5c731061b804fa256fc8c05150eafe5d20b6bb94541a8f187912bf84f7033f34\",\"urls\":[\"bzz-raw://a3c2d9f046beebab7fb41b1b124a6a124a36f510f7c67365861402ac831bdc71\",\"dweb:/ipfs/QmUtASRgitregbKH83anopLtF9vFQe3BKeAjhUa6F7t9YV\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b506040516103c23803806103c28339818101604052606081101561003357600080fd5b50805160208201516040909201519091908183106100825760405162461bcd60e51b815260040180806020018281038252602681526020018061039c6026913960400191505060405180910390fd5b6000929092556001556002805460ff196001600160a01b0390931661010002610100600160a81b0319909116179190911690556102d8806100c46000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806322f3e2d41461005c578063506ec09514610078578063be9a655514610092578063eda4e6d61461009c578063efbe1c1c146100a4575b600080fd5b6100646100ac565b604080519115158252519081900360200190f35b6100806100b5565b60408051918252519081900360200190f35b61009a6100bb565b005b6100806101a1565b61009a6101a7565b60025460ff1681565b60015481565b60005442101580156100ce575060015442105b61010f576040805162461bcd60e51b815260206004820152600d60248201526c1b9bdd081a5b881c195c9a5bd9609a1b604482015290519081900360640190fd5b60025460ff161561015c576040805162461bcd60e51b815260206004820152601260248201527163616e6e6f7420737461727420747769636560701b604482015290519081900360640190fd5b6002805460ff1916600117905560408051428152905133917f727dd98701807c5fdf715b9f1fd7d87461a558e2ab3e05935add76e42e330fa3919081900360200190a2565b60005481565b6001544210156101f5576040805162461bcd60e51b81526020600482015260146024820152731c195c9a5bd9081a185cc81b9bdd08195b99195960621b604482015290519081900360640190fd5b60025461020f9061010090046001600160a01b0316610211565b565b60025460ff16610258576040805162461bcd60e51b815260206004820152600d60248201526c6973206e6f742061637469766560981b604482015290519081900360640190fd5b6002805460ff1916905560408051428152905133917ef689ee9beb942c1c9c0d6642687ace05a9000d5f2979d344163c57829fa779919081900360200190a2806001600160a01b0316fffea265627a7a723158208ad5b4e5c7d8d2330b471524ebcfc248c023b903323bdb5546f300761b9b61bb64736f6c6343000510003273746172742063616e6e6f74206265206166746572206e6f7220657175616c20746f20656e64", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c806322f3e2d41461005c578063506ec09514610078578063be9a655514610092578063eda4e6d61461009c578063efbe1c1c146100a4575b600080fd5b6100646100ac565b604080519115158252519081900360200190f35b6100806100b5565b60408051918252519081900360200190f35b61009a6100bb565b005b6100806101a1565b61009a6101a7565b60025460ff1681565b60015481565b60005442101580156100ce575060015442105b61010f576040805162461bcd60e51b815260206004820152600d60248201526c1b9bdd081a5b881c195c9a5bd9609a1b604482015290519081900360640190fd5b60025460ff161561015c576040805162461bcd60e51b815260206004820152601260248201527163616e6e6f7420737461727420747769636560701b604482015290519081900360640190fd5b6002805460ff1916600117905560408051428152905133917f727dd98701807c5fdf715b9f1fd7d87461a558e2ab3e05935add76e42e330fa3919081900360200190a2565b60005481565b6001544210156101f5576040805162461bcd60e51b81526020600482015260146024820152731c195c9a5bd9081a185cc81b9bdd08195b99195960621b604482015290519081900360640190fd5b60025461020f9061010090046001600160a01b0316610211565b565b60025460ff16610258576040805162461bcd60e51b815260206004820152600d60248201526c6973206e6f742061637469766560981b604482015290519081900360640190fd5b6002805460ff1916905560408051428152905133917ef689ee9beb942c1c9c0d6642687ace05a9000d5f2979d344163c57829fa779919081900360200190a2806001600160a01b0316fffea265627a7a723158208ad5b4e5c7d8d2330b471524ebcfc248c023b903323bdb5546f300761b9b61bb64736f6c63430005100032", "sourceMap": "183:2720:6:-;;;1504:322;8:9:-1;5:2;;;30:1;27;20:12;5:2;1504:322:6;;;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1504:322:6;;;;;;;;;;;;;;1629:25;;;1621:76;;;;-1:-1:-1;;;1621:76:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1708:11;:26;;;;1744:9;:22;1776:6;:16;;-1:-1:-1;;;;;;;1776:16:6;;;;;-1:-1:-1;;;;;;1776:16:6;;;;1803;;;;;;183:2720;;;;;;", "deployedSourceMap": "183:2720:6:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;183:2720:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;274:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;243:24;;;:::i;:::-;;;;;;;;;;;;;;;;2010:134;;;:::i;:::-;;211:26;;;:::i;2342:82::-;;;:::i;274:20::-;;;;;;:::o;243:24::-;;;;:::o;2010:134::-;918:11;;911:3;:18;;:37;;;;;939:9;;933:3;:15;911:37;903:63;;;;;-1:-1:-1;;;903:63:6;;;;;;;;;;;;-1:-1:-1;;;903:63:6;;;;;;;;;;;;;;;708:8;;;;707:9;699:40;;;;;-1:-1:-1;;;699:40:6;;;;;;;;;;;;-1:-1:-1;;;699:40:6;;;;;;;;;;;;;;;2077:8;:15;;-1:-1:-1;;2077:15:6;2088:4;2077:15;;;2107:30;;;2133:3;2107:30;;;;2121:10;;2107:30;;;;;;;;;;2010:134::o;211:26::-;;;;:::o;2342:82::-;1122:9;;1115:3;:16;;1107:49;;;;;-1:-1:-1;;;1107:49:6;;;;;;;;;;;;-1:-1:-1;;;1107:49:6;;;;;;;;;;;;;;;2410:6;;2398:19;;2410:6;;;-1:-1:-1;;;;;2410:6:6;2398:11;:19::i;:::-;2342:82::o;2725:176::-;544:8;;;;536:34;;;;;-1:-1:-1;;;536:34:6;;;;;;;;;;;;-1:-1:-1;;;536:34:6;;;;;;;;;;;;;;;2795:8;:16;;-1:-1:-1;;2795:16:6;;;2826:28;;;2850:3;2826:28;;;;2838:10;;2826:28;;;;;;;;;;2885:7;-1:-1:-1;;;;;2864:30:6;", "source": "pragma solidity >0.5.4;\n\nimport \"@daostack/arc/contracts/controller/Avatar.sol\";\n\n/* @title Abstract contract responsible for ensuring a scheme is only usable within a set period\n */\ncontract ActivePeriod {\n uint256 public periodStart;\n uint256 public periodEnd;\n\n bool public isActive;\n\n Avatar avatar;\n\n event SchemeStarted(address indexed by, uint256 time);\n event SchemeEnded(address indexed by, uint256 time);\n\n /* @dev modifier that requires scheme to be active\n */\n modifier requireActive() {\n require(isActive, \"is not active\");\n _;\n }\n\n /* @dev modifier that requires scheme to not be active\n */\n modifier requireNotActive() {\n require(!isActive, \"cannot start twice\");\n _;\n }\n\n /* @dev modifier that requires current time to be after period start and before period end\n */\n modifier requireInPeriod() {\n require(now >= periodStart && now < periodEnd, \"not in period\");\n _;\n }\n\n /* @dev modifier that requires current time to be after period end\n */\n modifier requirePeriodEnd() {\n require(now >= periodEnd, \"period has not ended\");\n _;\n }\n\n /* @dev Constructor. requires end period to be larger than start period\n * Sets local period parameters and sets isActive to false\n * @param _periodStart The time from when the contract can be started\n * @param _periodEnd The time from when the contract can be ended\n * @param _avatar DAO avatar\n */\n constructor(\n uint256 _periodStart,\n uint256 _periodEnd,\n Avatar _avatar\n ) public {\n require(_periodStart < _periodEnd, \"start cannot be after nor equal to end\");\n\n periodStart = _periodStart;\n periodEnd = _periodEnd;\n avatar = _avatar;\n\n isActive = false;\n }\n\n /* @dev Function to start scheme. Must be inactive and within period.\n * Sets isActive to true and emits event with address that started and\n * current time.\n */\n function start() public requireInPeriod requireNotActive {\n isActive = true;\n emit SchemeStarted(msg.sender, now);\n }\n\n /* @dev Function to end scheme. Must be after assigned period end.\n * Calls internal function internalEnd, passing along the avatar\n * @param _avatar the avatar of the dao\n */\n function end() public requirePeriodEnd {\n return internalEnd(avatar);\n }\n\n /* @dev internal end function. Must be active to run.\n * Sets contract to inactive, emits an event with caller and\n * current time, and self-destructs the contract, transferring any\n * eth in the contract to the avatar address\n * @param _avatar the avatar of the dao\n */\n function internalEnd(Avatar _avatar) internal requireActive {\n isActive = false;\n emit SchemeEnded(msg.sender, now);\n selfdestruct(address(_avatar));\n }\n}\n", "sourcePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/ActivePeriod.sol", "ast": { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/ActivePeriod.sol", "exportedSymbols": { "ActivePeriod": [ 2217 ] }, "id": 2218, "nodeType": "SourceUnit", "nodes": [ { "id": 2065, "literals": [ "solidity", ">", "0.5", ".4" ], "nodeType": "PragmaDirective", "src": "0:23:6" }, { "absolutePath": "@daostack/arc/contracts/controller/Avatar.sol", "file": "@daostack/arc/contracts/controller/Avatar.sol", "id": 2066, "nodeType": "ImportDirective", "scope": 2218, "sourceUnit": 8542, "src": "25:55:6", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 2217, "linearizedBaseContracts": [ 2217 ], "name": "ActivePeriod", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 2068, "name": "periodStart", "nodeType": "VariableDeclaration", "scope": 2217, "src": "211:26:6", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2067, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "211:7:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 2070, "name": "periodEnd", "nodeType": "VariableDeclaration", "scope": 2217, "src": "243:24:6", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2069, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "243:7:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 2072, "name": "isActive", "nodeType": "VariableDeclaration", "scope": 2217, "src": "274:20:6", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 2071, "name": "bool", "nodeType": "ElementaryTypeName", "src": "274:4:6", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 2074, "name": "avatar", "nodeType": "VariableDeclaration", "scope": 2217, "src": "301:13:6", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$8541", "typeString": "contract Avatar" }, "typeName": { "contractScope": null, "id": 2073, "name": "Avatar", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 8541, "src": "301:6:6", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$8541", "typeString": "contract Avatar" } }, "value": null, "visibility": "internal" }, { "anonymous": false, "documentation": null, "id": 2080, "name": "SchemeStarted", "nodeType": "EventDefinition", "parameters": { "id": 2079, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2076, "indexed": true, "name": "by", "nodeType": "VariableDeclaration", "scope": 2080, "src": "341:18:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2075, "name": "address", "nodeType": "ElementaryTypeName", "src": "341:7:6", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2078, "indexed": false, "name": "time", "nodeType": "VariableDeclaration", "scope": 2080, "src": "361:12:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2077, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "361:7:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "340:34:6" }, "src": "321:54:6" }, { "anonymous": false, "documentation": null, "id": 2086, "name": "SchemeEnded", "nodeType": "EventDefinition", "parameters": { "id": 2085, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2082, "indexed": true, "name": "by", "nodeType": "VariableDeclaration", "scope": 2086, "src": "398:18:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2081, "name": "address", "nodeType": "ElementaryTypeName", "src": "398:7:6", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2084, "indexed": false, "name": "time", "nodeType": "VariableDeclaration", "scope": 2086, "src": "418:12:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2083, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "418:7:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "397:34:6" }, "src": "380:52:6" }, { "body": { "id": 2094, "nodeType": "Block", "src": "526:62:6", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2089, "name": "isActive", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2072, "src": "544:8:6", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "6973206e6f7420616374697665", "id": 2090, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "554:15:6", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_5b0344c3f115f7cc355b10ac48b33a2f0d82a4d9cb849f61e4563d707795c54c", "typeString": "literal_string \"is not active\"" }, "value": "is not active" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_5b0344c3f115f7cc355b10ac48b33a2f0d82a4d9cb849f61e4563d707795c54c", "typeString": "literal_string \"is not active\"" } ], "id": 2088, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 18010, 18011 ], "referencedDeclaration": 18011, "src": "536:7:6", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 2091, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "536:34:6", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2092, "nodeType": "ExpressionStatement", "src": "536:34:6" }, { "id": 2093, "nodeType": "PlaceholderStatement", "src": "580:1:6" } ] }, "documentation": null, "id": 2095, "name": "requireActive", "nodeType": "ModifierDefinition", "parameters": { "id": 2087, "nodeType": "ParameterList", "parameters": [], "src": "523:2:6" }, "src": "501:87:6", "visibility": "internal" }, { "body": { "id": 2104, "nodeType": "Block", "src": "689:68:6", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2099, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "707:9:6", "subExpression": { "argumentTypes": null, "id": 2098, "name": "isActive", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2072, "src": "708:8:6", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "63616e6e6f74207374617274207477696365", "id": 2100, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "718:20:6", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_e2d04f56d529d92cbc577524693bf678392fe0be18d60f4dddcd82674b8475c1", "typeString": "literal_string \"cannot start twice\"" }, "value": "cannot start twice" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_e2d04f56d529d92cbc577524693bf678392fe0be18d60f4dddcd82674b8475c1", "typeString": "literal_string \"cannot start twice\"" } ], "id": 2097, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 18010, 18011 ], "referencedDeclaration": 18011, "src": "699:7:6", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 2101, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "699:40:6", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2102, "nodeType": "ExpressionStatement", "src": "699:40:6" }, { "id": 2103, "nodeType": "PlaceholderStatement", "src": "749:1:6" } ] }, "documentation": null, "id": 2105, "name": "requireNotActive", "nodeType": "ModifierDefinition", "parameters": { "id": 2096, "nodeType": "ParameterList", "parameters": [], "src": "686:2:6" }, "src": "661:96:6", "visibility": "internal" }, { "body": { "id": 2119, "nodeType": "Block", "src": "893:91:6", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 2114, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2110, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2108, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 18009, "src": "911:3:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 2109, "name": "periodStart", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2068, "src": "918:11:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "911:18:6", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2113, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2111, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 18009, "src": "933:3:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "argumentTypes": null, "id": 2112, "name": "periodEnd", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2070, "src": "939:9:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "933:15:6", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "911:37:6", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "6e6f7420696e20706572696f64", "id": 2115, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "950:15:6", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_9c630bb22e6e1cd8042137f52f5866623bb5bb0e1ed51180b738b081475a8824", "typeString": "literal_string \"not in period\"" }, "value": "not in period" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_9c630bb22e6e1cd8042137f52f5866623bb5bb0e1ed51180b738b081475a8824", "typeString": "literal_string \"not in period\"" } ], "id": 2107, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 18010, 18011 ], "referencedDeclaration": 18011, "src": "903:7:6", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 2116, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "903:63:6", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2117, "nodeType": "ExpressionStatement", "src": "903:63:6" }, { "id": 2118, "nodeType": "PlaceholderStatement", "src": "976:1:6" } ] }, "documentation": null, "id": 2120, "name": "requireInPeriod", "nodeType": "ModifierDefinition", "parameters": { "id": 2106, "nodeType": "ParameterList", "parameters": [], "src": "890:2:6" }, "src": "866:118:6", "visibility": "internal" }, { "body": { "id": 2130, "nodeType": "Block", "src": "1097:77:6", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2125, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2123, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 18009, "src": "1115:3:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 2124, "name": "periodEnd", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2070, "src": "1122:9:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1115:16:6", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "706572696f6420686173206e6f7420656e646564", "id": 2126, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1133:22:6", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_b6ca869ae15f894bf532db9113203b643723c1becc402ca746152154f0ea35f0", "typeString": "literal_string \"period has not ended\"" }, "value": "period has not ended" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_b6ca869ae15f894bf532db9113203b643723c1becc402ca746152154f0ea35f0", "typeString": "literal_string \"period has not ended\"" } ], "id": 2122, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 18010, 18011 ], "referencedDeclaration": 18011, "src": "1107:7:6", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 2127, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1107:49:6", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2128, "nodeType": "ExpressionStatement", "src": "1107:49:6" }, { "id": 2129, "nodeType": "PlaceholderStatement", "src": "1166:1:6" } ] }, "documentation": null, "id": 2131, "name": "requirePeriodEnd", "nodeType": "ModifierDefinition", "parameters": { "id": 2121, "nodeType": "ParameterList", "parameters": [], "src": "1094:2:6" }, "src": "1069:105:6", "visibility": "internal" }, { "body": { "id": 2163, "nodeType": "Block", "src": "1611:215:6", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2143, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2141, "name": "_periodStart", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2133, "src": "1629:12:6", "typ