@dolomite-exchange/dolomite-margin
Version:
Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol
481 lines • 23.6 kB
JSON
{
"contractName": "IAccountRiskOverrideSetter",
"abi": [
{
"constant": true,
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "uint256",
"name": "number",
"type": "uint256"
}
],
"internalType": "struct Account.Info",
"name": "_account",
"type": "tuple"
}
],
"name": "getAccountRiskOverride",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"internalType": "struct Decimal.D256",
"name": "marginRatioOverride",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"internalType": "struct Decimal.D256",
"name": "liquidationSpreadOverride",
"type": "tuple"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"internalType\":\"struct Account.Info\",\"name\":\"_account\",\"type\":\"tuple\"}],\"name\":\"getAccountRiskOverride\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"internalType\":\"struct Decimal.D256\",\"name\":\"marginRatioOverride\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"internalType\":\"struct Decimal.D256\",\"name\":\"liquidationSpreadOverride\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Dolomite\",\"methods\":{\"getAccountRiskOverride((address,uint256))\":{\"params\":{\"_account\":\"The account whose risk override should be retrieved.\"},\"return\":\"marginRatioOverride The margin ratio override for this account.liquidationSpreadOverride The liquidation spread override for this account.\"}},\"title\":\"IAccountRiskOverrideSetter\"},\"userdoc\":{\"methods\":{\"getAccountRiskOverride((address,uint256))\":{\"notice\":\"Gets the risk overrides for a given account owner. In the context of an operation, this function is called within `_verifyFinalState`, after all of the operation's actions have occurred. Thus, it is safe to read the account's state from Dolomite Margin's storage.\"}},\"notice\":\"Interface that can be implemented by any contract that needs to implement risk overrides for an account.\"}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/interfaces/IAccountRiskOverrideSetter.sol\":\"IAccountRiskOverrideSetter\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/interfaces/IAccountRiskOverrideSetter.sol\":{\"keccak256\":\"0x5b9fde139ddfdaae7b650b3c3f6699e0e44605f0d9d3daadc1622eb06ad4c3f8\",\"urls\":[\"bzz-raw://2dfd5af24b6de63f94519c99fd8777a264d7cd11266fa2d525c7d72d96a9c7cf\",\"dweb:/ipfs/QmPg9fjhbnmBayZMh6yTG79xsK1PWSoAHA5pfwSXfnKKjF\"]},\"/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/Decimal.sol\":{\"keccak256\":\"0xd9a348c2b1eec076609ba12bbec6b9c2e4ea135790a7ef4f5411feb050af2144\",\"urls\":[\"bzz-raw://d5bcff29e47d5cd02d7a9966e9f44c46ccbb4f0e4adfc4b0b86646880677db39\",\"dweb:/ipfs/QmRKfJD4FFM1AvTynSFNx1NcDg94o9SAcjz7dvMaJCfecp\"]},\"/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 2023 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.0;\npragma experimental ABIEncoderV2;\n\nimport { Account } from \"../lib/Account.sol\";\nimport { Decimal } from \"../lib/Decimal.sol\";\n\n\n/**\n * @title IAccountRiskOverrideSetter\n * @author Dolomite\n *\n * @notice Interface that can be implemented by any contract that needs to implement risk overrides for an account.\n */\ninterface IAccountRiskOverrideSetter {\n\n /**\n * @notice Gets the risk overrides for a given account owner. In the context of an operation, this function is\n * called within `_verifyFinalState`, after all of the operation's actions have occurred. Thus, it is safe\n * to read the account's state from Dolomite Margin's storage.\n *\n * @param _account The account whose risk override should be retrieved.\n * @return marginRatioOverride The margin ratio override for this account.\n * @return liquidationSpreadOverride The liquidation spread override for this account.\n */\n function getAccountRiskOverride(\n Account.Info calldata _account\n )\n external\n view\n returns\n (\n Decimal.D256 memory marginRatioOverride,\n Decimal.D256 memory liquidationSpreadOverride\n );\n}\n",
"sourcePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/interfaces/IAccountRiskOverrideSetter.sol",
"ast": {
"absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/interfaces/IAccountRiskOverrideSetter.sol",
"exportedSymbols": {
"IAccountRiskOverrideSetter": [
24029
]
},
"id": 24030,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 24014,
"literals": [
"solidity",
">=",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "595:24:77"
},
{
"id": 24015,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "620:33:77"
},
{
"absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/lib/Account.sol",
"file": "../lib/Account.sol",
"id": 24017,
"nodeType": "ImportDirective",
"scope": 24030,
"sourceUnit": 24886,
"src": "655:45:77",
"symbolAliases": [
{
"foreign": 24016,
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/lib/Decimal.sol",
"file": "../lib/Decimal.sol",
"id": 24019,
"nodeType": "ImportDirective",
"scope": 24030,
"sourceUnit": 26024,
"src": "701:45:77",
"symbolAliases": [
{
"foreign": 24018,
"local": null
}
],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": "@title IAccountRiskOverrideSetter\n@author Dolomite\n * @notice Interface that can be implemented by any contract that needs to implement risk overrides for an account.",
"fullyImplemented": false,
"id": 24029,
"linearizedBaseContracts": [
24029
],
"name": "IAccountRiskOverrideSetter",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": "@notice Gets the risk overrides for a given account owner. In the context of an operation, this function is\n called within `_verifyFinalState`, after all of the operation's actions have occurred. Thus, it is safe\n to read the account's state from Dolomite Margin's storage.\n * @param _account The account whose risk override should be retrieved.\n@return marginRatioOverride The margin ratio override for this account.\n@return liquidationSpreadOverride The liquidation spread override for this account.",
"id": 24028,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getAccountRiskOverride",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 24022,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 24021,
"name": "_account",
"nodeType": "VariableDeclaration",
"scope": 24028,
"src": "1632:30:77",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_calldata_ptr",
"typeString": "struct Account.Info"
},
"typeName": {
"contractScope": null,
"id": 24020,
"name": "Account.Info",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 24851,
"src": "1632:12:77",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1622:46:77"
},
"returnParameters": {
"id": 24027,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 24024,
"name": "marginRatioOverride",
"nodeType": "VariableDeclaration",
"scope": 24028,
"src": "1729:39:77",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_D256_$25950_memory_ptr",
"typeString": "struct Decimal.D256"
},
"typeName": {
"contractScope": null,
"id": 24023,
"name": "Decimal.D256",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 25950,
"src": "1729:12:77",
"typeDescriptions": {
"typeIdentifier": "t_struct$_D256_$25950_storage_ptr",
"typeString": "struct Decimal.D256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24026,
"name": "liquidationSpreadOverride",
"nodeType": "VariableDeclaration",
"scope": 24028,
"src": "1778:45:77",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_D256_$25950_memory_ptr",
"typeString": "struct Decimal.D256"
},
"typeName": {
"contractScope": null,
"id": 24025,
"name": "Decimal.D256",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 25950,
"src": "1778:12:77",
"typeDescriptions": {
"typeIdentifier": "t_struct$_D256_$25950_storage_ptr",
"typeString": "struct Decimal.D256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1719:110:77"
},
"scope": 24029,
"src": "1591:239:77",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
}
],
"scope": 24030,
"src": "933:899:77"
}
],
"src": "595:1238:77"
},
"legacyAST": {
"absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/interfaces/IAccountRiskOverrideSetter.sol",
"exportedSymbols": {
"IAccountRiskOverrideSetter": [
24029
]
},
"id": 24030,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 24014,
"literals": [
"solidity",
">=",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "595:24:77"
},
{
"id": 24015,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "620:33:77"
},
{
"absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/lib/Account.sol",
"file": "../lib/Account.sol",
"id": 24017,
"nodeType": "ImportDirective",
"scope": 24030,
"sourceUnit": 24886,
"src": "655:45:77",
"symbolAliases": [
{
"foreign": 24016,
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/protocol/lib/Decimal.sol",
"file": "../lib/Decimal.sol",
"id": 24019,
"nodeType": "ImportDirective",
"scope": 24030,
"sourceUnit": 26024,
"src": "701:45:77",
"symbolAliases": [
{
"foreign": 24018,
"local": null
}
],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": "@title IAccountRiskOverrideSetter\n@author Dolomite\n * @notice Interface that can be implemented by any contract that needs to implement risk overrides for an account.",
"fullyImplemented": false,
"id": 24029,
"linearizedBaseContracts": [
24029
],
"name": "IAccountRiskOverrideSetter",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": "@notice Gets the risk overrides for a given account owner. In the context of an operation, this function is\n called within `_verifyFinalState`, after all of the operation's actions have occurred. Thus, it is safe\n to read the account's state from Dolomite Margin's storage.\n * @param _account The account whose risk override should be retrieved.\n@return marginRatioOverride The margin ratio override for this account.\n@return liquidationSpreadOverride The liquidation spread override for this account.",
"id": 24028,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getAccountRiskOverride",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 24022,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 24021,
"name": "_account",
"nodeType": "VariableDeclaration",
"scope": 24028,
"src": "1632:30:77",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_calldata_ptr",
"typeString": "struct Account.Info"
},
"typeName": {
"contractScope": null,
"id": 24020,
"name": "Account.Info",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 24851,
"src": "1632:12:77",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1622:46:77"
},
"returnParameters": {
"id": 24027,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 24024,
"name": "marginRatioOverride",
"nodeType": "VariableDeclaration",
"scope": 24028,
"src": "1729:39:77",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_D256_$25950_memory_ptr",
"typeString": "struct Decimal.D256"
},
"typeName": {
"contractScope": null,
"id": 24023,
"name": "Decimal.D256",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 25950,
"src": "1729:12:77",
"typeDescriptions": {
"typeIdentifier": "t_struct$_D256_$25950_storage_ptr",
"typeString": "struct Decimal.D256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24026,
"name": "liquidationSpreadOverride",
"nodeType": "VariableDeclaration",
"scope": 24028,
"src": "1778:45:77",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_D256_$25950_memory_ptr",
"typeString": "struct Decimal.D256"
},
"typeName": {
"contractScope": null,
"id": 24025,
"name": "Decimal.D256",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 25950,
"src": "1778:12:77",
"typeDescriptions": {
"typeIdentifier": "t_struct$_D256_$25950_storage_ptr",
"typeString": "struct Decimal.D256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1719:110:77"
},
"scope": 24029,
"src": "1591:239:77",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
}
],
"scope": 24030,
"src": "933:899:77"
}
],
"src": "595:1238:77"
},
"compiler": {
"name": "solc",
"version": "0.5.16+commit.9c3226ce.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.0.23",
"updatedAt": "2026-03-02T16:38:28.895Z",
"devdoc": {
"author": "Dolomite",
"methods": {
"getAccountRiskOverride((address,uint256))": {
"params": {
"_account": "The account whose risk override should be retrieved."
},
"return": "marginRatioOverride The margin ratio override for this account.liquidationSpreadOverride The liquidation spread override for this account."
}
},
"title": "IAccountRiskOverrideSetter"
},
"userdoc": {
"methods": {
"getAccountRiskOverride((address,uint256))": {
"notice": "Gets the risk overrides for a given account owner. In the context of an operation, this function is called within `_verifyFinalState`, after all of the operation's actions have occurred. Thus, it is safe to read the account's state from Dolomite Margin's storage."
}
},
"notice": "Interface that can be implemented by any contract that needs to implement risk overrides for an account."
}
}