aibc
Version:
AIBC contract to mint NFTs
1,219 lines (1,218 loc) • 57.2 kB
JSON
{
"contractName": "Counters",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.8.0+commit.c7dfd78e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"Matt Condon (@shrugs)\",\"details\":\"Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number of elements in a mapping, issuing ERC721 ids, or counting request ids. Include with `using Counters for Counters.Counter;`\",\"kind\":\"dev\",\"methods\":{},\"title\":\"Counters\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/Counters.sol\":\"Counters\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Counters.sol\":{\"keccak256\":\"0x62d306ff0499a11913bc60b5939eec619509b5c67b30e86ebf8b8bda0b7a7fee\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6712ca27a06062db31465b1470e6207553553a9bb0b4358d918b35bdae5b4ffe\",\"dweb:/ipfs/QmZ92pU9DJ3h1qREMFvDQhArSy6fh6zA983NeLFHRs1qKJ\"]}},\"version\":1}",
"bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220fb7f3a1860005df7dfd3510a51c298c2aaf33c6297b88f13b947e7376cf7976664736f6c63430008000033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220fb7f3a1860005df7dfd3510a51c298c2aaf33c6297b88f13b947e7376cf7976664736f6c63430008000033",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "370:881:13:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "370:881:13:-:0;;;;;;;;",
"source": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\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 */\nlibrary Counters {\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 unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n}\n",
"sourcePath": "@openzeppelin/contracts/utils/Counters.sol",
"ast": {
"absolutePath": "@openzeppelin/contracts/utils/Counters.sol",
"exportedSymbols": {
"Counters": [
4081
]
},
"id": 4082,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 4022,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "33:23:13"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": {
"id": 4023,
"nodeType": "StructuredDocumentation",
"src": "58:311:13",
"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;`"
},
"fullyImplemented": true,
"id": 4081,
"linearizedBaseContracts": [
4081
],
"name": "Counters",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "Counters.Counter",
"id": 4026,
"members": [
{
"constant": false,
"id": 4025,
"mutability": "mutable",
"name": "_value",
"nodeType": "VariableDeclaration",
"scope": 4026,
"src": "732:14:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4024,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "732:7:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"name": "Counter",
"nodeType": "StructDefinition",
"scope": 4081,
"src": "393:374:13",
"visibility": "public"
},
{
"body": {
"id": 4037,
"nodeType": "Block",
"src": "847:38:13",
"statements": [
{
"expression": {
"expression": {
"id": 4034,
"name": "counter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4029,
"src": "864:7:13",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter storage pointer"
}
},
"id": 4035,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "_value",
"nodeType": "MemberAccess",
"referencedDeclaration": 4025,
"src": "864:14:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 4033,
"id": 4036,
"nodeType": "Return",
"src": "857:21:13"
}
]
},
"id": 4038,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "current",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 4030,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4029,
"mutability": "mutable",
"name": "counter",
"nodeType": "VariableDeclaration",
"scope": 4038,
"src": "790:23:13",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter"
},
"typeName": {
"id": 4028,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 4027,
"name": "Counter",
"nodeType": "IdentifierPath",
"referencedDeclaration": 4026,
"src": "790:7:13"
},
"referencedDeclaration": 4026,
"src": "790:7:13",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter"
}
},
"visibility": "internal"
}
],
"src": "789:25:13"
},
"returnParameters": {
"id": 4033,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4032,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 4038,
"src": "838:7:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4031,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "838:7:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "837:9:13"
},
"scope": 4081,
"src": "773:112:13",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 4051,
"nodeType": "Block",
"src": "944:70:13",
"statements": [
{
"id": 4050,
"nodeType": "UncheckedBlock",
"src": "954:54:13",
"statements": [
{
"expression": {
"id": 4048,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"expression": {
"id": 4044,
"name": "counter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4041,
"src": "978:7:13",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter storage pointer"
}
},
"id": 4046,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "_value",
"nodeType": "MemberAccess",
"referencedDeclaration": 4025,
"src": "978:14:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"hexValue": "31",
"id": 4047,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "996:1:13",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "978:19:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 4049,
"nodeType": "ExpressionStatement",
"src": "978:19:13"
}
]
}
]
},
"id": 4052,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "increment",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 4042,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4041,
"mutability": "mutable",
"name": "counter",
"nodeType": "VariableDeclaration",
"scope": 4052,
"src": "910:23:13",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter"
},
"typeName": {
"id": 4040,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 4039,
"name": "Counter",
"nodeType": "IdentifierPath",
"referencedDeclaration": 4026,
"src": "910:7:13"
},
"referencedDeclaration": 4026,
"src": "910:7:13",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter"
}
},
"visibility": "internal"
}
],
"src": "909:25:13"
},
"returnParameters": {
"id": 4043,
"nodeType": "ParameterList",
"parameters": [],
"src": "944:0:13"
},
"scope": 4081,
"src": "891:123:13",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 4079,
"nodeType": "Block",
"src": "1073:176:13",
"statements": [
{
"assignments": [
4059
],
"declarations": [
{
"constant": false,
"id": 4059,
"mutability": "mutable",
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 4079,
"src": "1083:13:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4058,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1083:7:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 4062,
"initialValue": {
"expression": {
"id": 4060,
"name": "counter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4055,
"src": "1099:7:13",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter storage pointer"
}
},
"id": 4061,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "_value",
"nodeType": "MemberAccess",
"referencedDeclaration": 4025,
"src": "1099:14:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1083:30:13"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 4066,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 4064,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4059,
"src": "1131:5:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"hexValue": "30",
"id": 4065,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1139:1:13",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1131:9:13",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "436f756e7465723a2064656372656d656e74206f766572666c6f77",
"id": 4067,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1142:29:13",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_1dfd0d5389474d871b8e8929aab9d4def041f55f90f625754fb5f9a9ba08af6f",
"typeString": "literal_string \"Counter: decrement overflow\""
},
"value": "Counter: decrement overflow"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_1dfd0d5389474d871b8e8929aab9d4def041f55f90f625754fb5f9a9ba08af6f",
"typeString": "literal_string \"Counter: decrement overflow\""
}
],
"id": 4063,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "1123:7:13",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 4068,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1123:49:13",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 4069,
"nodeType": "ExpressionStatement",
"src": "1123:49:13"
},
{
"id": 4078,
"nodeType": "UncheckedBlock",
"src": "1182:61:13",
"statements": [
{
"expression": {
"id": 4076,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"expression": {
"id": 4070,
"name": "counter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4055,
"src": "1206:7:13",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter storage pointer"
}
},
"id": 4072,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "_value",
"nodeType": "MemberAccess",
"referencedDeclaration": 4025,
"src": "1206:14:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 4075,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 4073,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4059,
"src": "1223:5:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"hexValue": "31",
"id": 4074,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1231:1:13",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1223:9:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1206:26:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 4077,
"nodeType": "ExpressionStatement",
"src": "1206:26:13"
}
]
}
]
},
"id": 4080,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "decrement",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 4056,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4055,
"mutability": "mutable",
"name": "counter",
"nodeType": "VariableDeclaration",
"scope": 4080,
"src": "1039:23:13",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter"
},
"typeName": {
"id": 4054,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 4053,
"name": "Counter",
"nodeType": "IdentifierPath",
"referencedDeclaration": 4026,
"src": "1039:7:13"
},
"referencedDeclaration": 4026,
"src": "1039:7:13",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter"
}
},
"visibility": "internal"
}
],
"src": "1038:25:13"
},
"returnParameters": {
"id": 4057,
"nodeType": "ParameterList",
"parameters": [],
"src": "1073:0:13"
},
"scope": 4081,
"src": "1020:229:13",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
}
],
"scope": 4082,
"src": "370:881:13"
}
],
"src": "33:1219:13"
},
"legacyAST": {
"absolutePath": "@openzeppelin/contracts/utils/Counters.sol",
"exportedSymbols": {
"Counters": [
4081
]
},
"id": 4082,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 4022,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "33:23:13"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": {
"id": 4023,
"nodeType": "StructuredDocumentation",
"src": "58:311:13",
"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;`"
},
"fullyImplemented": true,
"id": 4081,
"linearizedBaseContracts": [
4081
],
"name": "Counters",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "Counters.Counter",
"id": 4026,
"members": [
{
"constant": false,
"id": 4025,
"mutability": "mutable",
"name": "_value",
"nodeType": "VariableDeclaration",
"scope": 4026,
"src": "732:14:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4024,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "732:7:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"name": "Counter",
"nodeType": "StructDefinition",
"scope": 4081,
"src": "393:374:13",
"visibility": "public"
},
{
"body": {
"id": 4037,
"nodeType": "Block",
"src": "847:38:13",
"statements": [
{
"expression": {
"expression": {
"id": 4034,
"name": "counter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4029,
"src": "864:7:13",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter storage pointer"
}
},
"id": 4035,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "_value",
"nodeType": "MemberAccess",
"referencedDeclaration": 4025,
"src": "864:14:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 4033,
"id": 4036,
"nodeType": "Return",
"src": "857:21:13"
}
]
},
"id": 4038,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "current",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 4030,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4029,
"mutability": "mutable",
"name": "counter",
"nodeType": "VariableDeclaration",
"scope": 4038,
"src": "790:23:13",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter"
},
"typeName": {
"id": 4028,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 4027,
"name": "Counter",
"nodeType": "IdentifierPath",
"referencedDeclaration": 4026,
"src": "790:7:13"
},
"referencedDeclaration": 4026,
"src": "790:7:13",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter"
}
},
"visibility": "internal"
}
],
"src": "789:25:13"
},
"returnParameters": {
"id": 4033,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4032,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 4038,
"src": "838:7:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4031,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "838:7:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "837:9:13"
},
"scope": 4081,
"src": "773:112:13",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 4051,
"nodeType": "Block",
"src": "944:70:13",
"statements": [
{
"id": 4050,
"nodeType": "UncheckedBlock",
"src": "954:54:13",
"statements": [
{
"expression": {
"id": 4048,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"expression": {
"id": 4044,
"name": "counter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4041,
"src": "978:7:13",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter storage pointer"
}
},
"id": 4046,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "_value",
"nodeType": "MemberAccess",
"referencedDeclaration": 4025,
"src": "978:14:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"hexValue": "31",
"id": 4047,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "996:1:13",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "978:19:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 4049,
"nodeType": "ExpressionStatement",
"src": "978:19:13"
}
]
}
]
},
"id": 4052,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "increment",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 4042,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4041,
"mutability": "mutable",
"name": "counter",
"nodeType": "VariableDeclaration",
"scope": 4052,
"src": "910:23:13",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter"
},
"typeName": {
"id": 4040,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 4039,
"name": "Counter",
"nodeType": "IdentifierPath",
"referencedDeclaration": 4026,
"src": "910:7:13"
},
"referencedDeclaration": 4026,
"src": "910:7:13",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter"
}
},
"visibility": "internal"
}
],
"src": "909:25:13"
},
"returnParameters": {
"id": 4043,
"nodeType": "ParameterList",
"parameters": [],
"src": "944:0:13"
},
"scope": 4081,
"src": "891:123:13",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 4079,
"nodeType": "Block",
"src": "1073:176:13",
"statements": [
{
"assignments": [
4059
],
"declarations": [
{
"constant": false,
"id": 4059,
"mutability": "mutable",
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 4079,
"src": "1083:13:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4058,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1083:7:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 4062,
"initialValue": {
"expression": {
"id": 4060,
"name": "counter",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4055,
"src": "1099:7:13",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Counter_$4026_storage_ptr",
"typeString": "struct Counters.Counter storage pointer"
}
},
"id": 4061,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "_value",
"nodeType": "MemberAccess",
"referencedDeclaration": 4025,
"src": "1099:14:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1083:30:13"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 4066,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 4064,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4059,
"src": "1131:5:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"hexValue": "30",
"id": 4065,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1139:1:13",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1131:9:13",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "436f756e7465723a2064656372656d656e74206f766572666c6f77",
"id": 4067,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1142:29:13",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_1dfd0d5389474d871b8e8929aab9d4def041f55f90f625754fb5f9a9ba08af6f",
"typeString": "literal_string \"Counter: decrement overflow\""
},
"value": "Counter: decrement overflow"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_1dfd0d5389474d871b8e8929aab9d4def041f55f90f625754fb5f9a9ba08af6f",
"typeString": "literal_string \"Counter: decrement overflow\""
}
],
"id": 4063,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "1123:7:13",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 4068,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1123:49:13",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 4069,
"nodeType": "ExpressionStatement",
"src": "1123:49:13"
},
{
"id": 4078,
"nodeType": "UncheckedBlock",