UNPKG

@dolomite-exchange/dolomite-margin

Version:

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

426 lines 18.9 kB
{ "contractName": "ICallee", "abi": [ { "constant": false, "inputs": [ { "internalType": "address", "name": "sender", "type": "address" }, { "components": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "number", "type": "uint256" } ], "internalType": "struct Account.Info", "name": "accountInfo", "type": "tuple" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "callFunction", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"internalType\":\"struct Account.Info\",\"name\":\"accountInfo\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"callFunction\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"dYdX * Interface that Callees for DolomiteMargin must implement in order to ingest data.\",\"methods\":{\"callFunction(address,(address,uint256),bytes)\":{\"params\":{\"accountInfo\":\"The account from which the data is being sent\",\"data\":\"Arbitrary data given by the sender\",\"sender\":\"The msg.sender to DolomiteMargin\"}}},\"title\":\"ICallee\"},\"userdoc\":{\"methods\":{\"callFunction(address,(address,uint256),bytes)\":{\"notice\":\"Allows users to send this contract arbitrary data.\"}}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/interfaces/ICallee.sol\":\"ICallee\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/interfaces/ICallee.sol\":{\"keccak256\":\"0x0b65209369307041e67c28634fc17a19e953199ac42a88198b76578f7fa9b0f8\",\"urls\":[\"bzz-raw://46618851882c2bc5a6212bb0a8ad095e0f38049f24ecf404163ad6b493c728a1\",\"dweb:/ipfs/QmRx4VabTaXTGSyMt8NCTZ7nMiWCHfrvqZjRaKNRir3zEe\"]},\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/lib/Account.sol\":{\"keccak256\":\"0x2059276ea5e478bd5ac7f2712e7b1b6c85d291c647a54b264909044844828e67\",\"urls\":[\"bzz-raw://f153777051d12131b13a57e5c3af10a2670927cfc7d22c9519ab20c9b4b9bc89\",\"dweb:/ipfs/QmQMP3qS5xDAVGYKDfNkbkSqBKozQGQsGqX4e8VyjRtxPS\"]},\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/lib/DolomiteMarginMath.sol\":{\"keccak256\":\"0x53f205f6a779d579be29faa9412c806a892b3e605fff092dfd9d14d936fa019f\",\"urls\":[\"bzz-raw://0ff936f89602a63b8e6a4eb4ce8f87673c0f45b7ce29694920905a3f0b5a6a69\",\"dweb:/ipfs/QmbYME9BeEvPC1ndV8EaUDX5fDMghLc3rocNUxFtgHmg8m\"]},\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/lib/EnumerableSet.sol\":{\"keccak256\":\"0x41a3460e34b7b8635d936e35e6568ceb5354b638f53b884530e0d4875fa0f151\",\"urls\":[\"bzz-raw://d1a5ba866ee95d455afe5075dadd91fc71c2806371f2c1b358a1f67c632bb0df\",\"dweb:/ipfs/QmW4qCjmsG8J3UJv97GwDLDM7wt1K4yLDKAwzWMY7TFYi5\"]},\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/lib/Require.sol\":{\"keccak256\":\"0x05a2a90b41b6a5f42f0a72da63d015fb0b406a9ba2172823352e522e8bf3a606\",\"urls\":[\"bzz-raw://19883f0c6d33266f756ec5c3d17539524aa24b993c46c33f8400801d09373a6c\",\"dweb:/ipfs/QmYX2fwK3vQQDSZLMrc5wMfeb8RWrcC9CGX8XECLty8QDk\"]},\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/lib/Types.sol\":{\"keccak256\":\"0xe1bab8c8799d83e86c7a49aaf815d8e3bc8d09562d46d44d921500db5e98de0e\",\"urls\":[\"bzz-raw://8ea3d0cc4fdab6dd9bba545a792170f939b342d8d1a7051c1c6365009af72658\",\"dweb:/ipfs/QmaLJgbavu88eEit6JPqfWnw6NmGBDZfveMXxumgWywBFG\"]},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x640b6dee7a4b830bdfd52b5031a07fc2b12209f5b2e29e5d364a7d37f69d8076\",\"urls\":[\"bzz-raw://31113152e1ddb78fe7a4197f247591ca894e93f916867beb708d8e747b6cc74f\",\"dweb:/ipfs/QmbZaJyXdpsYGykVhHH9qpVGQg9DGCxE2QufbCUy3daTgq\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "sourceMap": "", "deployedSourceMap": "", "source": "/*\n\n Copyright 2019 dYdX Trading Inc.\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.7;\npragma experimental ABIEncoderV2;\n\nimport { Account } from \"../lib/Account.sol\";\n\n\n/**\n * @title ICallee\n * @author dYdX\n *\n * Interface that Callees for DolomiteMargin must implement in order to ingest data.\n */\ncontract ICallee {\n\n // ============ Public Functions ============\n\n /**\n * Allows users to send this contract arbitrary data.\n *\n * @param sender The msg.sender to DolomiteMargin\n * @param accountInfo The account from which the data is being sent\n * @param data Arbitrary data given by the sender\n */\n function callFunction(\n address sender,\n Account.Info memory accountInfo,\n bytes memory data\n )\n public;\n}\n", "sourcePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/interfaces/ICallee.sol", "ast": { "absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/interfaces/ICallee.sol", "exportedSymbols": { "ICallee": [ 24073 ] }, "id": 24074, "nodeType": "SourceUnit", "nodes": [ { "id": 24060, "literals": [ "solidity", "^", "0.5", ".7" ], "nodeType": "PragmaDirective", "src": "603:23:79" }, { "id": 24061, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "627:33:79" }, { "absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/lib/Account.sol", "file": "../lib/Account.sol", "id": 24063, "nodeType": "ImportDirective", "scope": 24074, "sourceUnit": 24886, "src": "662:45:79", "symbolAliases": [ { "foreign": 24062, "local": null } ], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "@title ICallee\n@author dYdX\n * Interface that Callees for DolomiteMargin must implement in order to ingest data.", "fullyImplemented": false, "id": 24073, "linearizedBaseContracts": [ 24073 ], "name": "ICallee", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": "Allows users to send this contract arbitrary data.\n * @param sender The msg.sender to DolomiteMargin\n@param accountInfo The account from which the data is being sent\n@param data Arbitrary data given by the sender", "id": 24072, "implemented": false, "kind": "function", "modifiers": [], "name": "callFunction", "nodeType": "FunctionDefinition", "parameters": { "id": 24070, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24065, "name": "sender", "nodeType": "VariableDeclaration", "scope": 24072, "src": "1225:14:79", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 24064, "name": "address", "nodeType": "ElementaryTypeName", "src": "1225:7:79", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 24067, "name": "accountInfo", "nodeType": "VariableDeclaration", "scope": 24072, "src": "1249:31:79", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_struct$_Info_$24851_memory_ptr", "typeString": "struct Account.Info" }, "typeName": { "contractScope": null, "id": 24066, "name": "Account.Info", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 24851, "src": "1249:12:79", "typeDescriptions": { "typeIdentifier": "t_struct$_Info_$24851_storage_ptr", "typeString": "struct Account.Info" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 24069, "name": "data", "nodeType": "VariableDeclaration", "scope": 24072, "src": "1290:17:79", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 24068, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1290:5:79", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "1215:98:79" }, "returnParameters": { "id": 24071, "nodeType": "ParameterList", "parameters": [], "src": "1328:0:79" }, "scope": 24073, "src": "1194:135:79", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], "scope": 24074, "src": "840:491:79" } ], "src": "603:729:79" }, "legacyAST": { "absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/interfaces/ICallee.sol", "exportedSymbols": { "ICallee": [ 24073 ] }, "id": 24074, "nodeType": "SourceUnit", "nodes": [ { "id": 24060, "literals": [ "solidity", "^", "0.5", ".7" ], "nodeType": "PragmaDirective", "src": "603:23:79" }, { "id": 24061, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "627:33:79" }, { "absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/lib/Account.sol", "file": "../lib/Account.sol", "id": 24063, "nodeType": "ImportDirective", "scope": 24074, "sourceUnit": 24886, "src": "662:45:79", "symbolAliases": [ { "foreign": 24062, "local": null } ], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "@title ICallee\n@author dYdX\n * Interface that Callees for DolomiteMargin must implement in order to ingest data.", "fullyImplemented": false, "id": 24073, "linearizedBaseContracts": [ 24073 ], "name": "ICallee", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": "Allows users to send this contract arbitrary data.\n * @param sender The msg.sender to DolomiteMargin\n@param accountInfo The account from which the data is being sent\n@param data Arbitrary data given by the sender", "id": 24072, "implemented": false, "kind": "function", "modifiers": [], "name": "callFunction", "nodeType": "FunctionDefinition", "parameters": { "id": 24070, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24065, "name": "sender", "nodeType": "VariableDeclaration", "scope": 24072, "src": "1225:14:79", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 24064, "name": "address", "nodeType": "ElementaryTypeName", "src": "1225:7:79", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 24067, "name": "accountInfo", "nodeType": "VariableDeclaration", "scope": 24072, "src": "1249:31:79", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_struct$_Info_$24851_memory_ptr", "typeString": "struct Account.Info" }, "typeName": { "contractScope": null, "id": 24066, "name": "Account.Info", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 24851, "src": "1249:12:79", "typeDescriptions": { "typeIdentifier": "t_struct$_Info_$24851_storage_ptr", "typeString": "struct Account.Info" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 24069, "name": "data", "nodeType": "VariableDeclaration", "scope": 24072, "src": "1290:17:79", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 24068, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1290:5:79", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "1215:98:79" }, "returnParameters": { "id": 24071, "nodeType": "ParameterList", "parameters": [], "src": "1328:0:79" }, "scope": 24073, "src": "1194:135:79", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], "scope": 24074, "src": "840:491:79" } ], "src": "603:729:79" }, "compiler": { "name": "solc", "version": "0.5.16+commit.9c3226ce.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.0.23", "updatedAt": "2026-03-02T16:38:28.897Z", "devdoc": { "author": "dYdX * Interface that Callees for DolomiteMargin must implement in order to ingest data.", "methods": { "callFunction(address,(address,uint256),bytes)": { "params": { "accountInfo": "The account from which the data is being sent", "data": "Arbitrary data given by the sender", "sender": "The msg.sender to DolomiteMargin" } } }, "title": "ICallee" }, "userdoc": { "methods": { "callFunction(address,(address,uint256),bytes)": { "notice": "Allows users to send this contract arbitrary data." } } } }