witnet-solidity-bridge
Version:
Witnet Solidity Bridge contracts for EVM-compatible chains
684 lines • 28.2 kB
JSON
{
"contractName": "IWitAppliance",
"abi": [
{
"inputs": [],
"name": "class",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "specs",
"outputs": [
{
"internalType": "bytes4",
"name": "",
"type": "bytes4"
}
],
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.8.30+commit.73712a01\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"class\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"specs\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"class()\":{\"notice\":\"Returns the name of the actual contract implementing the logic of this Witnet appliance.\"},\"specs()\":{\"notice\":\"Returns the ERC-165 id of the minimal functionality expected for this appliance.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/interfaces/IWitAppliance.sol\":\"IWitAppliance\"},\"evmVersion\":\"prague\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/interfaces/IWitAppliance.sol\":{\"keccak256\":\"0xd207ca54a1049445a3d99eea497d9b34c6dbdd44d771eee825e4c031bd2f447e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f81de32d868ff2881ed6fe97cc897e40b4b11d23cbe53a0e23cf3e68f9c0f0a3\",\"dweb:/ipfs/QmeeXmzmK5MAzt7Hf5DB2L81efKtTzZg9VbQ8sUiTqEk5c\"]}},\"version\":1}",
"bytecode": "0x",
"deployedBytecode": "0x",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "",
"deployedSourceMap": "",
"source": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.0;\r\n\r\nabstract contract IWitAppliance {\r\n\r\n /// @notice Returns the name of the actual contract implementing the logic of this Witnet appliance.\r\n function class() virtual public view returns (string memory);\r\n\r\n /// @notice Returns the ERC-165 id of the minimal functionality expected for this appliance.\r\n function specs() virtual external view returns (bytes4);\r\n\r\n function _require(bool _condition, string memory _message) virtual internal view {\r\n if (!_condition) {\r\n _revert(_message);\r\n }\r\n }\r\n\r\n function _revert(string memory _message) virtual internal view {\r\n revert(\r\n string(abi.encodePacked(\r\n class(),\r\n \": \",\r\n _message\r\n ))\r\n );\r\n }\r\n\r\n}\r\n",
"sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\interfaces\\IWitAppliance.sol",
"ast": {
"absolutePath": "project:/contracts/interfaces/IWitAppliance.sol",
"exportedSymbols": {
"IWitAppliance": [
26514
]
},
"id": 26515,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 26466,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "35:23:63"
},
{
"abstract": true,
"baseContracts": [],
"canonicalName": "IWitAppliance",
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": false,
"id": 26514,
"linearizedBaseContracts": [
26514
],
"name": "IWitAppliance",
"nameLocation": "80:13:63",
"nodeType": "ContractDefinition",
"nodes": [
{
"documentation": {
"id": 26467,
"nodeType": "StructuredDocumentation",
"src": "103:100:63",
"text": "@notice Returns the name of the actual contract implementing the logic of this Witnet appliance."
},
"functionSelector": "bff852fa",
"id": 26472,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "class",
"nameLocation": "218:5:63",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 26468,
"nodeType": "ParameterList",
"parameters": [],
"src": "223:2:63"
},
"returnParameters": {
"id": 26471,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 26470,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 26472,
"src": "255:13:63",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 26469,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "255:6:63",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"visibility": "internal"
}
],
"src": "254:15:63"
},
"scope": 26514,
"src": "209:61:63",
"stateMutability": "view",
"virtual": true,
"visibility": "public"
},
{
"documentation": {
"id": 26473,
"nodeType": "StructuredDocumentation",
"src": "278:92:63",
"text": "@notice Returns the ERC-165 id of the minimal functionality expected for this appliance."
},
"functionSelector": "adb7c3f7",
"id": 26478,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "specs",
"nameLocation": "385:5:63",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 26474,
"nodeType": "ParameterList",
"parameters": [],
"src": "390:2:63"
},
"returnParameters": {
"id": 26477,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 26476,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 26478,
"src": "424:6:63",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 26475,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "424:6:63",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "internal"
}
],
"src": "423:8:63"
},
"scope": 26514,
"src": "376:56:63",
"stateMutability": "view",
"virtual": true,
"visibility": "external"
},
{
"body": {
"id": 26493,
"nodeType": "Block",
"src": "521:79:63",
"statements": [
{
"condition": {
"id": 26486,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "536:11:63",
"subExpression": {
"id": 26485,
"name": "_condition",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26480,
"src": "537:10:63",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 26492,
"nodeType": "IfStatement",
"src": "532:61:63",
"trueBody": {
"id": 26491,
"nodeType": "Block",
"src": "549:44:63",
"statements": [
{
"expression": {
"arguments": [
{
"id": 26488,
"name": "_message",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26482,
"src": "572:8:63",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 26487,
"name": "_revert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26513,
"src": "564:7:63",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_string_memory_ptr_$returns$__$",
"typeString": "function (string memory) view"
}
},
"id": 26489,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "564:17:63",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 26490,
"nodeType": "ExpressionStatement",
"src": "564:17:63"
}
]
}
}
]
},
"id": 26494,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_require",
"nameLocation": "449:8:63",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 26483,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 26480,
"mutability": "mutable",
"name": "_condition",
"nameLocation": "463:10:63",
"nodeType": "VariableDeclaration",
"scope": 26494,
"src": "458:15:63",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 26479,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "458:4:63",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 26482,
"mutability": "mutable",
"name": "_message",
"nameLocation": "489:8:63",
"nodeType": "VariableDeclaration",
"scope": 26494,
"src": "475:22:63",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 26481,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "475:6:63",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"visibility": "internal"
}
],
"src": "457:41:63"
},
"returnParameters": {
"id": 26484,
"nodeType": "ParameterList",
"parameters": [],
"src": "521:0:63"
},
"scope": 26514,
"src": "440:160:63",
"stateMutability": "view",
"virtual": true,
"visibility": "internal"
},
{
"body": {
"id": 26512,
"nodeType": "Block",
"src": "671:166:63",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [
{
"arguments": [
{
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 26504,
"name": "class",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26472,
"src": "745:5:63",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_string_memory_ptr_$",
"typeString": "function () view returns (string memory)"
}
},
"id": 26505,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "745:7:63",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"hexValue": "3a20",
"id": 26506,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "771:4:63",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_e64009107d042bdc478cc69a5433e4573ea2e8a23a46646c0ee241e30c888e73",
"typeString": "literal_string \": \""
},
"value": ": "
},
{
"id": 26507,
"name": "_message",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26496,
"src": "794:8:63",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_stringliteral_e64009107d042bdc478cc69a5433e4573ea2e8a23a46646c0ee241e30c888e73",
"typeString": "literal_string \": \""
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"expression": {
"id": 26502,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967295,
"src": "710:3:63",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 26503,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "714:12:63",
"memberName": "encodePacked",
"nodeType": "MemberAccess",
"src": "710:16:63",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$",
"typeString": "function () pure returns (bytes memory)"
}
},
"id": 26508,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "710:107:63",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"id": 26501,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "703:6:63",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_string_storage_ptr_$",
"typeString": "type(string storage pointer)"
},
"typeName": {
"id": 26500,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "703:6:63",
"typeDescriptions": {}
}
},
"id": 26509,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "703:115:63",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 26499,
"name": "revert",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967277,
4294967277
],
"referencedDeclaration": 4294967277,
"src": "682:6:63",
"typeDescriptions": {
"typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$",
"typeString": "function (string memory) pure"
}
},
"id": 26510,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "682:147:63",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 26511,
"nodeType": "ExpressionStatement",
"src": "682:147:63"
}
]
},
"id": 26513,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_revert",
"nameLocation": "617:7:63",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 26497,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 26496,
"mutability": "mutable",
"name": "_message",
"nameLocation": "639:8:63",
"nodeType": "VariableDeclaration",
"scope": 26513,
"src": "625:22:63",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 26495,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "625:6:63",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"visibility": "internal"
}
],
"src": "624:24:63"
},
"returnParameters": {
"id": 26498,
"nodeType": "ParameterList",
"parameters": [],
"src": "671:0:63"
},
"scope": 26514,
"src": "608:229:63",
"stateMutability": "view",
"virtual": true,
"visibility": "internal"
}
],
"scope": 26515,
"src": "62:780:63",
"usedErrors": [],
"usedEvents": []
}
],
"src": "35:809:63"
},
"compiler": {
"name": "solc",
"version": "0.8.30+commit.73712a01.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.4.16",
"updatedAt": "2025-10-15T14:34:45.890Z",
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"class()": {
"notice": "Returns the name of the actual contract implementing the logic of this Witnet appliance."
},
"specs()": {
"notice": "Returns the ERC-165 id of the minimal functionality expected for this appliance."
}
},
"version": 1
}
}