UNPKG

@dolomite-exchange/dolomite-margin

Version:

Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol

962 lines 33.3 kB
{ "contractName": "IWETH", "abi": [ { "constant": false, "inputs": [], "name": "deposit", "outputs": [], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "transfer", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "withdraw", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" } ], "name": "approve", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IWETH.sol\":\"IWETH\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IWETH.sol\":{\"keccak256\":\"0xe85314496167d5a47ea89275d8cdbe53f00927bf933242f67f2acc4126edda0d\",\"urls\":[\"bzz-raw://5b16b1b7602e31c1243f2514bf4bff17d2fc0de0843ad7de6548545d954e4650\",\"dweb:/ipfs/QmcQWaEdqTfkDhHxbFdJX2ytwFtoUGNWCRk1w8DhFhsuf7\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "sourceMap": "", "deployedSourceMap": "", "source": "/*\n\n Copyright 2021 Dolomite.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.5.4;\n\n\ninterface IWETH {\n\n function deposit() external payable;\n\n function transfer(address to, uint value) external returns (bool);\n\n function withdraw(uint) external;\n\n function balanceOf(address) external view returns (uint);\n\n function approve(address spender, uint allowance) external returns (bool);\n}\n", "sourcePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IWETH.sol", "ast": { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IWETH.sol", "exportedSymbols": { "IWETH": [ 4964 ] }, "id": 4965, "nodeType": "SourceUnit", "nodes": [ { "id": 4930, "literals": [ "solidity", "^", "0.5", ".4" ], "nodeType": "PragmaDirective", "src": "595:23:33" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 4964, "linearizedBaseContracts": [ 4964 ], "name": "IWETH", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "id": 4933, "implemented": false, "kind": "function", "modifiers": [], "name": "deposit", "nodeType": "FunctionDefinition", "parameters": { "id": 4931, "nodeType": "ParameterList", "parameters": [], "src": "660:2:33" }, "returnParameters": { "id": 4932, "nodeType": "ParameterList", "parameters": [], "src": "679:0:33" }, "scope": 4964, "src": "644:36:33", "stateMutability": "payable", "superFunction": null, "visibility": "external" }, { "body": null, "documentation": null, "id": 4942, "implemented": false, "kind": "function", "modifiers": [], "name": "transfer", "nodeType": "FunctionDefinition", "parameters": { "id": 4938, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4935, "name": "to", "nodeType": "VariableDeclaration", "scope": 4942, "src": "704:10:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 4934, "name": "address", "nodeType": "ElementaryTypeName", "src": "704:7:33", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 4937, "name": "value", "nodeType": "VariableDeclaration", "scope": 4942, "src": "716:10:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4936, "name": "uint", "nodeType": "ElementaryTypeName", "src": "716:4:33", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "703:24:33" }, "returnParameters": { "id": 4941, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4940, "name": "", "nodeType": "VariableDeclaration", "scope": 4942, "src": "746:4:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 4939, "name": "bool", "nodeType": "ElementaryTypeName", "src": "746:4:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "745:6:33" }, "scope": 4964, "src": "686:66:33", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": null, "documentation": null, "id": 4947, "implemented": false, "kind": "function", "modifiers": [], "name": "withdraw", "nodeType": "FunctionDefinition", "parameters": { "id": 4945, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4944, "name": "", "nodeType": "VariableDeclaration", "scope": 4947, "src": "776:4:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4943, "name": "uint", "nodeType": "ElementaryTypeName", "src": "776:4:33", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "775:6:33" }, "returnParameters": { "id": 4946, "nodeType": "ParameterList", "parameters": [], "src": "790:0:33" }, "scope": 4964, "src": "758:33:33", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": null, "documentation": null, "id": 4954, "implemented": false, "kind": "function", "modifiers": [], "name": "balanceOf", "nodeType": "FunctionDefinition", "parameters": { "id": 4950, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4949, "name": "", "nodeType": "VariableDeclaration", "scope": 4954, "src": "816:7:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 4948, "name": "address", "nodeType": "ElementaryTypeName", "src": "816:7:33", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "815:9:33" }, "returnParameters": { "id": 4953, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4952, "name": "", "nodeType": "VariableDeclaration", "scope": 4954, "src": "848:4:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4951, "name": "uint", "nodeType": "ElementaryTypeName", "src": "848:4:33", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "847:6:33" }, "scope": 4964, "src": "797:57:33", "stateMutability": "view", "superFunction": null, "visibility": "external" }, { "body": null, "documentation": null, "id": 4963, "implemented": false, "kind": "function", "modifiers": [], "name": "approve", "nodeType": "FunctionDefinition", "parameters": { "id": 4959, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4956, "name": "spender", "nodeType": "VariableDeclaration", "scope": 4963, "src": "877:15:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 4955, "name": "address", "nodeType": "ElementaryTypeName", "src": "877:7:33", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 4958, "name": "allowance", "nodeType": "VariableDeclaration", "scope": 4963, "src": "894:14:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4957, "name": "uint", "nodeType": "ElementaryTypeName", "src": "894:4:33", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "876:33:33" }, "returnParameters": { "id": 4962, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4961, "name": "", "nodeType": "VariableDeclaration", "scope": 4963, "src": "928:4:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 4960, "name": "bool", "nodeType": "ElementaryTypeName", "src": "928:4:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "927:6:33" }, "scope": 4964, "src": "860:74:33", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" } ], "scope": 4965, "src": "621:315:33" } ], "src": "595:342:33" }, "legacyAST": { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IWETH.sol", "exportedSymbols": { "IWETH": [ 4964 ] }, "id": 4965, "nodeType": "SourceUnit", "nodes": [ { "id": 4930, "literals": [ "solidity", "^", "0.5", ".4" ], "nodeType": "PragmaDirective", "src": "595:23:33" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 4964, "linearizedBaseContracts": [ 4964 ], "name": "IWETH", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "id": 4933, "implemented": false, "kind": "function", "modifiers": [], "name": "deposit", "nodeType": "FunctionDefinition", "parameters": { "id": 4931, "nodeType": "ParameterList", "parameters": [], "src": "660:2:33" }, "returnParameters": { "id": 4932, "nodeType": "ParameterList", "parameters": [], "src": "679:0:33" }, "scope": 4964, "src": "644:36:33", "stateMutability": "payable", "superFunction": null, "visibility": "external" }, { "body": null, "documentation": null, "id": 4942, "implemented": false, "kind": "function", "modifiers": [], "name": "transfer", "nodeType": "FunctionDefinition", "parameters": { "id": 4938, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4935, "name": "to", "nodeType": "VariableDeclaration", "scope": 4942, "src": "704:10:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 4934, "name": "address", "nodeType": "ElementaryTypeName", "src": "704:7:33", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 4937, "name": "value", "nodeType": "VariableDeclaration", "scope": 4942, "src": "716:10:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4936, "name": "uint", "nodeType": "ElementaryTypeName", "src": "716:4:33", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "703:24:33" }, "returnParameters": { "id": 4941, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4940, "name": "", "nodeType": "VariableDeclaration", "scope": 4942, "src": "746:4:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 4939, "name": "bool", "nodeType": "ElementaryTypeName", "src": "746:4:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "745:6:33" }, "scope": 4964, "src": "686:66:33", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": null, "documentation": null, "id": 4947, "implemented": false, "kind": "function", "modifiers": [], "name": "withdraw", "nodeType": "FunctionDefinition", "parameters": { "id": 4945, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4944, "name": "", "nodeType": "VariableDeclaration", "scope": 4947, "src": "776:4:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4943, "name": "uint", "nodeType": "ElementaryTypeName", "src": "776:4:33", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "775:6:33" }, "returnParameters": { "id": 4946, "nodeType": "ParameterList", "parameters": [], "src": "790:0:33" }, "scope": 4964, "src": "758:33:33", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" }, { "body": null, "documentation": null, "id": 4954, "implemented": false, "kind": "function", "modifiers": [], "name": "balanceOf", "nodeType": "FunctionDefinition", "parameters": { "id": 4950, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4949, "name": "", "nodeType": "VariableDeclaration", "scope": 4954, "src": "816:7:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 4948, "name": "address", "nodeType": "ElementaryTypeName", "src": "816:7:33", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "815:9:33" }, "returnParameters": { "id": 4953, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4952, "name": "", "nodeType": "VariableDeclaration", "scope": 4954, "src": "848:4:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4951, "name": "uint", "nodeType": "ElementaryTypeName", "src": "848:4:33", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "847:6:33" }, "scope": 4964, "src": "797:57:33", "stateMutability": "view", "superFunction": null, "visibility": "external" }, { "body": null, "documentation": null, "id": 4963, "implemented": false, "kind": "function", "modifiers": [], "name": "approve", "nodeType": "FunctionDefinition", "parameters": { "id": 4959, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4956, "name": "spender", "nodeType": "VariableDeclaration", "scope": 4963, "src": "877:15:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 4955, "name": "address", "nodeType": "ElementaryTypeName", "src": "877:7:33", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 4958, "name": "allowance", "nodeType": "VariableDeclaration", "scope": 4963, "src": "894:14:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4957, "name": "uint", "nodeType": "ElementaryTypeName", "src": "894:4:33", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "876:33:33" }, "returnParameters": { "id": 4962, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4961, "name": "", "nodeType": "VariableDeclaration", "scope": 4963, "src": "928:4:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 4960, "name": "bool", "nodeType": "ElementaryTypeName", "src": "928:4:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "927:6:33" }, "scope": 4964, "src": "860:74:33", "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" } ], "scope": 4965, "src": "621:315:33" } ], "src": "595:342:33" }, "compiler": { "name": "solc", "version": "0.5.16+commit.9c3226ce.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.0.23", "updatedAt": "2025-06-22T04:01:53.534Z", "devdoc": { "methods": {} }, "userdoc": { "methods": {} } }