{
  "fileName": "Counters.sol",
  "contractName": "Counters",
  "source": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.0;\n\nimport \"../math/SafeMath.sol\";\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath}\n * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never\n * directly accessed.\n */\nlibrary Counters {\n    using SafeMath for uint256;\n\n    struct Counter {\n        // This variable should never be directly accessed by users of the library: interactions must be restricted to\n        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n        // this feature: see https://github.com/ethereum/solidity/issues/4637\n        uint256 _value; // default: 0\n    }\n\n    function current(Counter storage counter) internal view returns (uint256) {\n        return counter._value;\n    }\n\n    function increment(Counter storage counter) internal {\n        // The {SafeMath} overflow check can be skipped here, see the comment at the top\n        counter._value += 1;\n    }\n\n    function decrement(Counter storage counter) internal {\n        counter._value = counter._value.sub(1);\n    }\n}\n",
  "sourcePath": "contracts/utils/Counters.sol",
  "sourceMap": "662:848:106:-:0;;;;;;;;;;;;;;;;;;;;;;;;;",
  "deployedSourceMap": "662:848:106:-:0;;;;;;;;",
  "abi": [],
  "ast": {
    "absolutePath": "contracts/utils/Counters.sol",
    "exportedSymbols": {
      "Counters": [
        12946
      ]
    },
    "id": 12947,
    "license": "MIT",
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 12898,
        "literals": [
          "solidity",
          "^",
          "0.7",
          ".0"
        ],
        "nodeType": "PragmaDirective",
        "src": "33:23:106"
      },
      {
        "absolutePath": "contracts/math/SafeMath.sol",
        "file": "../math/SafeMath.sol",
        "id": 12899,
        "nodeType": "ImportDirective",
        "scope": 12947,
        "sourceUnit": 2422,
        "src": "58:30:106",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "abstract": false,
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "library",
        "documentation": {
          "id": 12900,
          "nodeType": "StructuredDocumentation",
          "src": "90:571:106",
          "text": " @title Counters\n @author Matt Condon (@shrugs)\n @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number\n of elements in a mapping, issuing ERC721 ids, or counting request ids.\n Include with `using Counters for Counters.Counter;`\n Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath}\n overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never\n directly accessed."
        },
        "fullyImplemented": true,
        "id": 12946,
        "linearizedBaseContracts": [
          12946
        ],
        "name": "Counters",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "id": 12903,
            "libraryName": {
              "contractScope": null,
              "id": 12901,
              "name": "SafeMath",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 2421,
              "src": "691:8:106",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_SafeMath_$2421",
                "typeString": "library SafeMath"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "685:27:106",
            "typeName": {
              "id": 12902,
              "name": "uint256",
              "nodeType": "ElementaryTypeName",
              "src": "704:7:106",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            }
          },
          {
            "canonicalName": "Counters.Counter",
            "id": 12906,
            "members": [
              {
                "constant": false,
                "id": 12905,
                "mutability": "mutable",
                "name": "_value",
                "nodeType": "VariableDeclaration",
                "overrides": null,
                "scope": 12906,
                "src": "1057:14:106",
                "stateVariable": false,
                "storageLocation": "default",
                "typeDescriptions": {
                  "typeIdentifier": "t_uint256",
                  "typeString": "uint256"
                },
                "typeName": {
                  "id": 12904,
                  "name": "uint256",
                  "nodeType": "ElementaryTypeName",
                  "src": "1057:7:106",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  }
                },
                "value": null,
                "visibility": "internal"
              }
            ],
            "name": "Counter",
            "nodeType": "StructDefinition",
            "scope": 12946,
            "src": "718:374:106",
            "visibility": "public"
          },
          {
            "body": {
              "id": 12916,
              "nodeType": "Block",
              "src": "1172:38:106",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "expression": {
                      "argumentTypes": null,
                      "id": 12913,
                      "name": "counter",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 12908,
                      "src": "1189:7:106",
                      "typeDescriptions": {
                        "typeIdentifier": "t_struct$_Counter_$12906_storage_ptr",
                        "typeString": "struct Counters.Counter storage pointer"
                      }
                    },
                    "id": 12914,
                    "isConstant": false,
                    "isLValue": true,
                    "isPure": false,
                    "lValueRequested": false,
                    "memberName": "_value",
                    "nodeType": "MemberAccess",
                    "referencedDeclaration": 12905,
                    "src": "1189:14:106",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 12912,
                  "id": 12915,
                  "nodeType": "Return",
                  "src": "1182:21:106"
                }
              ]
            },
            "documentation": null,
            "id": 12917,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "current",
            "nodeType": "FunctionDefinition",
            "overrides": null,
            "parameters": {
              "id": 12909,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 12908,
                  "mutability": "mutable",
                  "name": "counter",
                  "nodeType": "VariableDeclaration",
                  "overrides": null,
                  "scope": 12917,
                  "src": "1115:23:106",
                  "stateVariable": false,
                  "storageLocation": "storage",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_Counter_$12906_storage_ptr",
                    "typeString": "struct Counters.Counter"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 12907,
                    "name": "Counter",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 12906,
                    "src": "1115:7:106",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_Counter_$12906_storage_ptr",
                      "typeString": "struct Counters.Counter"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1114:25:106"
            },
            "returnParameters": {
              "id": 12912,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 12911,
                  "mutability": "mutable",
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "overrides": null,
                  "scope": 12917,
                  "src": "1163:7:106",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 12910,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1163:7:106",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1162:9:106"
            },
            "scope": 12946,
            "src": "1098:112:106",
            "stateMutability": "view",
            "virtual": false,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 12928,
              "nodeType": "Block",
              "src": "1269:125:106",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 12926,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 12922,
                        "name": "counter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 12919,
                        "src": "1368:7:106",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_Counter_$12906_storage_ptr",
                          "typeString": "struct Counters.Counter storage pointer"
                        }
                      },
                      "id": 12924,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "_value",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 12905,
                      "src": "1368:14:106",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "+=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "hexValue": "31",
                      "id": 12925,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "1386:1:106",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_1_by_1",
                        "typeString": "int_const 1"
                      },
                      "value": "1"
                    },
                    "src": "1368:19:106",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 12927,
                  "nodeType": "ExpressionStatement",
                  "src": "1368:19:106"
                }
              ]
            },
            "documentation": null,
            "id": 12929,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "increment",
            "nodeType": "FunctionDefinition",
            "overrides": null,
            "parameters": {
              "id": 12920,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 12919,
                  "mutability": "mutable",
                  "name": "counter",
                  "nodeType": "VariableDeclaration",
                  "overrides": null,
                  "scope": 12929,
                  "src": "1235:23:106",
                  "stateVariable": false,
                  "storageLocation": "storage",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_Counter_$12906_storage_ptr",
                    "typeString": "struct Counters.Counter"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 12918,
                    "name": "Counter",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 12906,
                    "src": "1235:7:106",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_Counter_$12906_storage_ptr",
                      "typeString": "struct Counters.Counter"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1234:25:106"
            },
            "returnParameters": {
              "id": 12921,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "1269:0:106"
            },
            "scope": 12946,
            "src": "1216:178:106",
            "stateMutability": "nonpayable",
            "virtual": false,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 12944,
              "nodeType": "Block",
              "src": "1453:55:106",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 12942,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 12934,
                        "name": "counter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 12931,
                        "src": "1463:7:106",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_Counter_$12906_storage_ptr",
                          "typeString": "struct Counters.Counter storage pointer"
                        }
                      },
                      "id": 12936,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "_value",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 12905,
                      "src": "1463:14:106",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "hexValue": "31",
                          "id": 12940,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "1499:1:106",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          },
                          "value": "1"
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_rational_1_by_1",
                            "typeString": "int_const 1"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 12937,
                            "name": "counter",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 12931,
                            "src": "1480:7:106",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_Counter_$12906_storage_ptr",
                              "typeString": "struct Counters.Counter storage pointer"
                            }
                          },
                          "id": 12938,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "_value",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 12905,
                          "src": "1480:14:106",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 12939,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 2271,
                        "src": "1480:18:106",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                          "typeString": "function (uint256,uint256) pure returns (uint256)"
                        }
                      },
                      "id": 12941,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "1480:21:106",
                      "tryCall": false,
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1463:38:106",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 12943,
                  "nodeType": "ExpressionStatement",
                  "src": "1463:38:106"
                }
              ]
            },
            "documentation": null,
            "id": 12945,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "decrement",
            "nodeType": "FunctionDefinition",
            "overrides": null,
            "parameters": {
              "id": 12932,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 12931,
                  "mutability": "mutable",
                  "name": "counter",
                  "nodeType": "VariableDeclaration",
                  "overrides": null,
                  "scope": 12945,
                  "src": "1419:23:106",
                  "stateVariable": false,
                  "storageLocation": "storage",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_Counter_$12906_storage_ptr",
                    "typeString": "struct Counters.Counter"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 12930,
                    "name": "Counter",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 12906,
                    "src": "1419:7:106",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_Counter_$12906_storage_ptr",
                      "typeString": "struct Counters.Counter"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1418:25:106"
            },
            "returnParameters": {
              "id": 12933,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "1453:0:106"
            },
            "scope": 12946,
            "src": "1400:108:106",
            "stateMutability": "nonpayable",
            "virtual": false,
            "visibility": "internal"
          }
        ],
        "scope": 12947,
        "src": "662:848:106"
      }
    ],
    "src": "33:1478:106"
  },
  "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220bf5dbfd88e32fa3ae6c634d5bcee075e25eef104d3f2c1a22ecd18c9c35e699964736f6c63430007000033",
  "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220bf5dbfd88e32fa3ae6c634d5bcee075e25eef104d3f2c1a22ecd18c9c35e699964736f6c63430007000033",
  "compiler": {
    "name": "solc",
    "version": "0.7.0+commit.9e61f92b.Emscripten.clang",
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "evmVersion": "petersburg"
  }
}
