UNPKG

solidity-cron

Version:

[![Build Status](https://travis-ci.com/Frontier-project/cron.svg?token=DJeMzxJJncp3nRaEUuxH&branch=master)](https://travis-ci.com/Frontier-project/cron) [![codecov](https://codecov.io/gh/Frontier-project/cron/branch/master/graph/badge.svg?token=BGbU5Q6IRV

1,230 lines (1,229 loc) 56.7 kB
{ "contractName": "Daily", "abi": [ { "constant": true, "inputs": [], "name": "creationBlock", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "creationTimestamp", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "getLength", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "_timestamp", "type": "uint256" } ], "name": "heightOf", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "height", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "bytecode": "0x60806040524260008190555043600181905550610326806100216000396000f30060806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630ef2674314610072578063176345141461009d578063b3311086146100c8578063be1c766b146100f3578063c23c39d31461011e575b600080fd5b34801561007e57600080fd5b5061008761015f565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b261016f565b6040518082815260200191505060405180910390f35b3480156100d457600080fd5b506100dd610179565b6040518082815260200191505060405180910390f35b3480156100ff57600080fd5b50610108610182565b6040518082815260200191505060405180910390f35b34801561012a57600080fd5b506101496004803603810190808035906020019092919050505061018b565b6040518082815260200191505060405180910390f35b600061016a4261018b565b905090565b6000600154905090565b60008054905090565b60006001905090565b600073__DateTime______________________________63c9d346226101af610179565b60006040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b15801561020857600080fd5b505af415801561021c573d6000803e3d6000fd5b505050506040513d602081101561023257600080fd5b810190808051906020019092919050505073__DateTime______________________________63c9d346228460006040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156102b757600080fd5b505af41580156102cb573d6000803e3d6000fd5b505050506040513d60208110156102e157600080fd5b81019080805190602001909291905050500390509190505600a165627a7a7230582058fe6fe53ca489635619baa7c9656d1f19e2aa91c05e52a98c0d1c4f8bd46c7c0029", "deployedBytecode": "0x60806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630ef2674314610072578063176345141461009d578063b3311086146100c8578063be1c766b146100f3578063c23c39d31461011e575b600080fd5b34801561007e57600080fd5b5061008761015f565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b261016f565b6040518082815260200191505060405180910390f35b3480156100d457600080fd5b506100dd610179565b6040518082815260200191505060405180910390f35b3480156100ff57600080fd5b50610108610182565b6040518082815260200191505060405180910390f35b34801561012a57600080fd5b506101496004803603810190808035906020019092919050505061018b565b6040518082815260200191505060405180910390f35b600061016a4261018b565b905090565b6000600154905090565b60008054905090565b60006001905090565b600073__DateTime______________________________63c9d346226101af610179565b60006040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b15801561020857600080fd5b505af415801561021c573d6000803e3d6000fd5b505050506040513d602081101561023257600080fd5b810190808051906020019092919050505073__DateTime______________________________63c9d346228460006040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156102b757600080fd5b505af41580156102cb573d6000803e3d6000fd5b505050506040513d60208110156102e157600080fd5b81019080805190602001909291905050500390509190505600a165627a7a7230582058fe6fe53ca489635619baa7c9656d1f19e2aa91c05e52a98c0d1c4f8bd46c7c0029", "sourceMap": "203:775:2:-;;;366:15:1;345:18;:36;;;;408:12;391:14;:29;;;;203:775:2;;;;;;", "deployedSourceMap": "203:775:2:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;879:97;;8:9:-1;5:2;;;30:1;27;20:12;5:2;879:97:2;;;;;;;;;;;;;;;;;;;;;;;543:94:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;543:94:1;;;;;;;;;;;;;;;;;;;;;;;435:102;;8:9:-1;5:2;;;30:1;27;20:12;5:2;435:102:1;;;;;;;;;;;;;;;;;;;;;;;365:75:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;365:75:2;;;;;;;;;;;;;;;;;;;;;;;610:168;;8:9:-1;5:2;;;30:1;27;20:12;5:2;610:168:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;879:97;918:7;944:25;953:15;944:8;:25::i;:::-;937:32;;879:97;:::o;543:94:1:-;589:7;615:14;;608:21;;543:94;:::o;435:102::-;485:7;512:18;;505:25;;435:102;:::o;365:75:2:-;406:7;432:1;425:8;;365:75;:::o;610:168::-;669:7;730:8;:17;748:19;:17;:19::i;:::-;769:1;730:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;730:41:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;730:41:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;730:41:2;;;;;;;;;;;;;;;;695:8;:17;713:10;725:1;695:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;695:32:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;695:32:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;695:32:2;;;;;;;;;;;;;;;;:76;688:83;;610:168;;;:::o", "source": "pragma solidity 0.4.24;\n\nimport \"./DateTime.sol\";\nimport \"../IPeriod.sol\";\nimport \"../Traceable.sol\";\n\n/**\n * A particular case of a periodic contract where the height increased by one every period\n */\n\ncontract Daily is IPeriod, Traceable {\n using DateTime for *;\n\n /**\n * @return 1 as this contract is set to be changing every single day. \n */\n function getLength() public view returns(uint256) {\n return 1;\n }\n\n /**\n * @param _timestamp unix epoch seconds \n * @return Number of days that happened since this contract was deployed to the target timestamp\n */\n\n function heightOf(uint256 _timestamp) public view returns (uint256) {\n return DateTime.diffDays(_timestamp, 0) - DateTime.diffDays(creationTimestamp(), 0);\n }\n \n /**\n * @return A particular case of heightOf, using the current timestamp\n */\n\n function height() public view returns (uint256) {\n return heightOf(block.timestamp);\n }\n}", "sourcePath": "/Users/carlosbuendia/Documents/Projects/consensys/Frontier/cron/contracts/calendar/Daily.sol", "ast": { "absolutePath": "/Users/carlosbuendia/Documents/Projects/consensys/Frontier/cron/contracts/calendar/Daily.sol", "exportedSymbols": { "Daily": [ 110 ] }, "id": 111, "nodeType": "SourceUnit", "nodes": [ { "id": 60, "literals": [ "solidity", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:23:2" }, { "absolutePath": "/Users/carlosbuendia/Documents/Projects/consensys/Frontier/cron/contracts/calendar/DateTime.sol", "file": "./DateTime.sol", "id": 61, "nodeType": "ImportDirective", "scope": 111, "sourceUnit": 777, "src": "25:24:2", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/carlosbuendia/Documents/Projects/consensys/Frontier/cron/contracts/IPeriod.sol", "file": "../IPeriod.sol", "id": 62, "nodeType": "ImportDirective", "scope": 111, "sourceUnit": 20, "src": "50:24:2", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/carlosbuendia/Documents/Projects/consensys/Frontier/cron/contracts/Traceable.sol", "file": "../Traceable.sol", "id": 63, "nodeType": "ImportDirective", "scope": 111, "sourceUnit": 59, "src": "75:26:2", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 64, "name": "IPeriod", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 19, "src": "221:7:2", "typeDescriptions": { "typeIdentifier": "t_contract$_IPeriod_$19", "typeString": "contract IPeriod" } }, "id": 65, "nodeType": "InheritanceSpecifier", "src": "221:7:2" }, { "arguments": null, "baseName": { "contractScope": null, "id": 66, "name": "Traceable", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 58, "src": "230:9:2", "typeDescriptions": { "typeIdentifier": "t_contract$_Traceable_$58", "typeString": "contract Traceable" } }, "id": 67, "nodeType": "InheritanceSpecifier", "src": "230:9:2" } ], "contractDependencies": [ 19, 58 ], "contractKind": "contract", "documentation": "A particular case of a periodic contract where the height increased by one every period", "fullyImplemented": true, "id": 110, "linearizedBaseContracts": [ 110, 58, 19 ], "name": "Daily", "nodeType": "ContractDefinition", "nodes": [ { "id": 69, "libraryName": { "contractScope": null, "id": 68, "name": "DateTime", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 776, "src": "252:8:2", "typeDescriptions": { "typeIdentifier": "t_contract$_DateTime_$776", "typeString": "library DateTime" } }, "nodeType": "UsingForDirective", "src": "246:21:2", "typeName": null }, { "body": { "id": 76, "nodeType": "Block", "src": "415:25:2", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "31", "id": 74, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "432:1:2", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "functionReturnParameters": 73, "id": 75, "nodeType": "Return", "src": "425:8:2" } ] }, "documentation": "@return 1 as this contract is set to be changing every single day. ", "id": 77, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "getLength", "nodeType": "FunctionDefinition", "parameters": { "id": 70, "nodeType": "ParameterList", "parameters": [], "src": "383:2:2" }, "payable": false, "returnParameters": { "id": 73, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 72, "name": "", "nodeType": "VariableDeclaration", "scope": 77, "src": "406:7:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 71, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "406:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "405:9:2" }, "scope": 110, "src": "365:75:2", "stateMutability": "view", "superFunction": 6, "visibility": "public" }, { "body": { "id": 97, "nodeType": "Block", "src": "678:100:2", "statements": [ { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 95, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 86, "name": "_timestamp", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 79, "src": "713:10:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "30", "id": 87, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "725:1:2", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" } ], "expression": { "argumentTypes": null, "id": 84, "name": "DateTime", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 776, "src": "695:8:2", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_DateTime_$776_$", "typeString": "type(library DateTime)" } }, "id": 85, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diffDays", "nodeType": "MemberAccess", "referencedDeclaration": 494, "src": "695:17:2", "typeDescriptions": { "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (uint256)" } }, "id": 88, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "695:32:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 91, "name": "creationTimestamp", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 49, "src": "748:17:2", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", "typeString": "function () view returns (uint256)" } }, "id": 92, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "748:19:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "30", "id": 93, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "769:1:2", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" } ], "expression": { "argumentTypes": null, "id": 89, "name": "DateTime", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 776, "src": "730:8:2", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_DateTime_$776_$", "typeString": "type(library DateTime)" } }, "id": 90, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diffDays", "nodeType": "MemberAccess", "referencedDeclaration": 494, "src": "730:17:2", "typeDescriptions": { "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (uint256)" } }, "id": 94, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "730:41:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "695:76:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 83, "id": 96, "nodeType": "Return", "src": "688:83:2" } ] }, "documentation": "@param _timestamp unix epoch seconds \n@return Number of days that happened since this contract was deployed to the target timestamp", "id": 98, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "heightOf", "nodeType": "FunctionDefinition", "parameters": { "id": 80, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 79, "name": "_timestamp", "nodeType": "VariableDeclaration", "scope": 98, "src": "628:18:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 78, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "628:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "627:20:2" }, "payable": false, "returnParameters": { "id": 83, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 82, "name": "", "nodeType": "VariableDeclaration", "scope": 98, "src": "669:7:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 81, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "669:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "668:9:2" }, "scope": 110, "src": "610:168:2", "stateMutability": "view", "superFunction": 13, "visibility": "public" }, { "body": { "id": 108, "nodeType": "Block", "src": "927:49:2", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 104, "name": "block", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1803, "src": "953:5:2", "typeDescriptions": { "typeIdentifier": "t_magic_block", "typeString": "block" } }, "id": 105, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "timestamp", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "953:15:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 103, "name": "heightOf", "nodeType": "Identifier", "overloadedDeclarations": [ 98 ], "referencedDeclaration": 98, "src": "944:8:2", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) view returns (uint256)" } }, "id": 106, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "944:25:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 102, "id": 107, "nodeType": "Return", "src": "937:32:2" } ] }, "documentation": "@return A particular case of heightOf, using the current timestamp", "id": 109, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "height", "nodeType": "FunctionDefinition", "parameters": { "id": 99, "nodeType": "ParameterList", "parameters": [], "src": "894:2:2" }, "payable": false, "returnParameters": { "id": 102, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 101, "name": "", "nodeType": "VariableDeclaration", "scope": 109, "src": "918:7:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 100, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "918:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "917:9:2" }, "scope": 110, "src": "879:97:2", "stateMutability": "view", "superFunction": 18, "visibility": "public" } ], "scope": 111, "src": "203:775:2" } ], "src": "0:978:2" }, "legacyAST": { "absolutePath": "/Users/carlosbuendia/Documents/Projects/consensys/Frontier/cron/contracts/calendar/Daily.sol", "exportedSymbols": { "Daily": [ 110 ] }, "id": 111, "nodeType": "SourceUnit", "nodes": [ { "id": 60, "literals": [ "solidity", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:23:2" }, { "absolutePath": "/Users/carlosbuendia/Documents/Projects/consensys/Frontier/cron/contracts/calendar/DateTime.sol", "file": "./DateTime.sol", "id": 61, "nodeType": "ImportDirective", "scope": 111, "sourceUnit": 777, "src": "25:24:2", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/carlosbuendia/Documents/Projects/consensys/Frontier/cron/contracts/IPeriod.sol", "file": "../IPeriod.sol", "id": 62, "nodeType": "ImportDirective", "scope": 111, "sourceUnit": 20, "src": "50:24:2", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/carlosbuendia/Documents/Projects/consensys/Frontier/cron/contracts/Traceable.sol", "file": "../Traceable.sol", "id": 63, "nodeType": "ImportDirective", "scope": 111, "sourceUnit": 59, "src": "75:26:2", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 64, "name": "IPeriod", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 19, "src": "221:7:2", "typeDescriptions": { "typeIdentifier": "t_contract$_IPeriod_$19", "typeString": "contract IPeriod" } }, "id": 65, "nodeType": "InheritanceSpecifier", "src": "221:7:2" }, { "arguments": null, "baseName": { "contractScope": null, "id": 66, "name": "Traceable", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 58, "src": "230:9:2", "typeDescriptions": { "typeIdentifier": "t_contract$_Traceable_$58", "typeString": "contract Traceable" } }, "id": 67, "nodeType": "InheritanceSpecifier", "src": "230:9:2" } ], "contractDependencies": [ 19, 58 ], "contractKind": "contract", "documentation": "A particular case of a periodic contract where the height increased by one every period", "fullyImplemented": true, "id": 110, "linearizedBaseContracts": [ 110, 58, 19 ], "name": "Daily", "nodeType": "ContractDefinition", "nodes": [ { "id": 69, "libraryName": { "contractScope": null, "id": 68, "name": "DateTime", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 776, "src": "252:8:2", "typeDescriptions": { "typeIdentifier": "t_contract$_DateTime_$776", "typeString": "library DateTime" } }, "nodeType": "UsingForDirective", "src": "246:21:2", "typeName": null }, { "body": { "id": 76, "nodeType": "Block", "src": "415:25:2", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "31", "id": 74, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "432:1:2", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "functionReturnParameters": 73, "id": 75, "nodeType": "Return", "src": "425:8:2" } ] }, "documentation": "@return 1 as this contract is set to be changing every single day. ", "id": 77, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "getLength", "nodeType": "FunctionDefinition", "parameters": { "id": 70, "nodeType": "ParameterList", "parameters": [], "src": "383:2:2" }, "payable": false, "returnParameters": { "id": 73, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 72, "name": "", "nodeType": "VariableDeclaration", "scope": 77, "src": "406:7:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 71, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "406:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "405:9:2" }, "scope": 110, "src": "365:75:2", "stateMutability": "view", "superFunction": 6, "visibility": "public" }, { "body": { "id": 97, "nodeType": "Block", "src": "678:100:2", "statements": [ { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 95, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 86, "name": "_timestamp", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 79, "src": "713:10:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "30", "id": 87, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "725:1:2", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" } ], "expression": { "argumentTypes": null, "id": 84, "name": "DateTime", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 776, "src": "695:8:2", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_DateTime_$776_$", "typeString": "type(library DateTime)" } }, "id": 85, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diffDays", "nodeType": "MemberAccess", "referencedDeclaration": 494, "src": "695:17:2", "typeDescriptions": { "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (uint256)" } }, "id": 88, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "695:32:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 91, "name": "creationTimestamp", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 49, "src": "748:17:2", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$", "typeString": "function () view returns (uint256)" } }, "id": 92, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "748:19:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "30", "id": 93, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "769:1:2", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" } ], "expression": { "argumentTypes": null, "id": 89, "name": "DateTime", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 776, "src": "730:8:2", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_DateTime_$776_$", "typeString": "type(library DateTime)" } }, "id": 90, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diffDays", "nodeType": "MemberAccess", "referencedDeclaration": 494, "src": "730:17:2", "typeDescriptions": { "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (uint256)" } }, "id": 94, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "730:41:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "695:76:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 83, "id": 96, "nodeType": "Return", "src": "688:83:2" } ] }, "documentation": "@param _timestamp unix epoch seconds \n@return Number of days that happened since this contract was deployed to the target timestamp", "id": 98, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "heightOf", "nodeType": "FunctionDefinition", "parameters": { "id": 80, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 79, "name": "_timestamp", "nodeType": "VariableDeclaration", "scope": 98, "src": "628:18:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 78, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "628:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "627:20:2" }, "payable": false, "returnParameters": { "id": 83, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 82,