@dolomite-exchange/dolomite-margin
Version:
Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol
662 lines • 33.9 kB
JSON
{
"contractName": "IExternalCallback",
"abi": [
{
"constant": false,
"inputs": [
{
"internalType": "uint256",
"name": "_primaryAccountNumber",
"type": "uint256"
},
{
"components": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "uint256",
"name": "number",
"type": "uint256"
}
],
"internalType": "struct Account.Info",
"name": "_secondaryAccount",
"type": "tuple"
},
{
"internalType": "uint256",
"name": "_primaryMarketId",
"type": "uint256"
},
{
"components": [
{
"internalType": "bool",
"name": "sign",
"type": "bool"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"internalType": "struct Types.Wei",
"name": "_primaryDeltaWei",
"type": "tuple"
},
{
"internalType": "uint256",
"name": "_secondaryMarketId",
"type": "uint256"
},
{
"components": [
{
"internalType": "bool",
"name": "sign",
"type": "bool"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"internalType": "struct Types.Wei",
"name": "_secondaryDeltaWei",
"type": "tuple"
}
],
"name": "onInternalBalanceChange",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_primaryAccountNumber\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"internalType\":\"struct Account.Info\",\"name\":\"_secondaryAccount\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"_primaryMarketId\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"sign\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"internalType\":\"struct Types.Wei\",\"name\":\"_primaryDeltaWei\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"_secondaryMarketId\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"bool\",\"name\":\"sign\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"internalType\":\"struct Types.Wei\",\"name\":\"_secondaryDeltaWei\",\"type\":\"tuple\"}],\"name\":\"onInternalBalanceChange\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Dolomite * Interface that smart contract users can implement to be notified of their balance(s) changing.\",\"methods\":{\"onInternalBalanceChange(uint256,(address,uint256),uint256,(bool,uint256),uint256,(bool,uint256))\":{\"params\":{\"_primaryAccountNumber\":\"The account number of the account being operated on\",\"_primaryDeltaWei\":\"The amount of primary market that was received or paid\",\"_primaryMarketId\":\"The market that was positive for this account, whose collateral is being seized\",\"_secondaryAccount\":\"The account that is receiving the primary account's assets. To calculate the value received by the secondary account, negate primary/secondary delta wei.\",\"_secondaryDeltaWei\":\"The amount of borrowed assets to be repaid. Always 0 or positive, since the user's balance is going from negative to 0.\",\"_secondaryMarketId\":\"The borrowed balance that is being forcefully repaid\"}}},\"title\":\"IExternalCallback\"},\"userdoc\":{\"methods\":{\"onInternalBalanceChange(uint256,(address,uint256),uint256,(bool,uint256),uint256,(bool,uint256))\":{\"notice\":\"A callback function to notify the smart contract user that their balance is changing. This function is called after the new balances are set in state, so calling `getAccountPar/Wei` will return each account's balance after `primaryDeltaWei` and `secondaryDeltaWei` are applied. * The `_accountOwner` isn't a parameter because technically it is the implementing contract. So, to construct the `Account.Info` object for the primary account, use the following in the implementation: `Account.Info({ owner: address(this), number: _accountNumber })`.\"}}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IExternalCallback.sol\":\"IExternalCallback\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IExternalCallback.sol\":{\"keccak256\":\"0xd8134eac006b0a59b71cbcca82dfce7ce092a57c13a8383ebf0e8bc90c0df3e7\",\"urls\":[\"bzz-raw://ccead8bdcc71402ae7b1d8fb9bc1527081a5eb14f98a5157f5c6f27f21f8ad31\",\"dweb:/ipfs/QmdnDvTiX3EDm93ahjnZabNNgoyQzGtKpfbQUNtJe7t8Ts\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Account.sol\":{\"keccak256\":\"0x2059276ea5e478bd5ac7f2712e7b1b6c85d291c647a54b264909044844828e67\",\"urls\":[\"bzz-raw://f153777051d12131b13a57e5c3af10a2670927cfc7d22c9519ab20c9b4b9bc89\",\"dweb:/ipfs/QmQMP3qS5xDAVGYKDfNkbkSqBKozQGQsGqX4e8VyjRtxPS\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/DolomiteMarginMath.sol\":{\"keccak256\":\"0x53f205f6a779d579be29faa9412c806a892b3e605fff092dfd9d14d936fa019f\",\"urls\":[\"bzz-raw://0ff936f89602a63b8e6a4eb4ce8f87673c0f45b7ce29694920905a3f0b5a6a69\",\"dweb:/ipfs/QmbYME9BeEvPC1ndV8EaUDX5fDMghLc3rocNUxFtgHmg8m\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/EnumerableSet.sol\":{\"keccak256\":\"0x41a3460e34b7b8635d936e35e6568ceb5354b638f53b884530e0d4875fa0f151\",\"urls\":[\"bzz-raw://d1a5ba866ee95d455afe5075dadd91fc71c2806371f2c1b358a1f67c632bb0df\",\"dweb:/ipfs/QmW4qCjmsG8J3UJv97GwDLDM7wt1K4yLDKAwzWMY7TFYi5\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Require.sol\":{\"keccak256\":\"0x05a2a90b41b6a5f42f0a72da63d015fb0b406a9ba2172823352e522e8bf3a606\",\"urls\":[\"bzz-raw://19883f0c6d33266f756ec5c3d17539524aa24b993c46c33f8400801d09373a6c\",\"dweb:/ipfs/QmYX2fwK3vQQDSZLMrc5wMfeb8RWrcC9CGX8XECLty8QDk\"]},\"/home/cdc218/projects/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 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.0;\npragma experimental ABIEncoderV2;\n\nimport { Account } from \"../lib/Account.sol\";\nimport { Types } from \"../lib/Types.sol\";\n\n\n/**\n * @title IExternalCallback\n * @author Dolomite\n *\n * Interface that smart contract users can implement to be notified of their balance(s) changing.\n */\ninterface IExternalCallback {\n\n /**\n * A callback function to notify the smart contract user that their balance is changing. This function is called\n * after the new balances are set in state, so calling `getAccountPar/Wei` will return each account's balance\n * after `primaryDeltaWei` and `secondaryDeltaWei` are applied.\n *\n * The `_accountOwner` isn't a parameter because technically it is the implementing contract. So, to construct the\n * `Account.Info` object for the primary account, use the following in the implementation:\n * `Account.Info({ owner: address(this), number: _accountNumber })`.\n *\n * @param _primaryAccountNumber The account number of the account being operated on\n * @param _secondaryAccount The account that is receiving the primary account's assets. To calculate the value\n * received by the secondary account, negate primary/secondary delta wei.\n * @param _primaryMarketId The market that was positive for this account, whose collateral is being seized\n * @param _primaryDeltaWei The amount of primary market that was received or paid\n * @param _secondaryMarketId The borrowed balance that is being forcefully repaid\n * @param _secondaryDeltaWei The amount of borrowed assets to be repaid. Always 0 or positive, since the user's\n * balance is going from negative to 0.\n */\n function onInternalBalanceChange(\n uint256 _primaryAccountNumber,\n Account.Info calldata _secondaryAccount,\n uint256 _primaryMarketId,\n Types.Wei calldata _primaryDeltaWei,\n uint256 _secondaryMarketId,\n Types.Wei calldata _secondaryDeltaWei\n ) external;\n}\n",
"sourcePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IExternalCallback.sol",
"ast": {
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IExternalCallback.sol",
"exportedSymbols": {
"IExternalCallback": [
24772
]
},
"id": 24773,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 24751,
"literals": [
"solidity",
">=",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "595:24:83"
},
{
"id": 24752,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "620:33:83"
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Account.sol",
"file": "../lib/Account.sol",
"id": 24754,
"nodeType": "ImportDirective",
"scope": 24773,
"sourceUnit": 24886,
"src": "655:45:83",
"symbolAliases": [
{
"foreign": 24753,
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Types.sol",
"file": "../lib/Types.sol",
"id": 24756,
"nodeType": "ImportDirective",
"scope": 24773,
"sourceUnit": 31362,
"src": "701:41:83",
"symbolAliases": [
{
"foreign": 24755,
"local": null
}
],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": "@title IExternalCallback\n@author Dolomite\n * Interface that smart contract users can implement to be notified of their balance(s) changing.",
"fullyImplemented": false,
"id": 24772,
"linearizedBaseContracts": [
24772
],
"name": "IExternalCallback",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": "A callback function to notify the smart contract user that their balance is changing. This function is called\nafter the new balances are set in state, so calling `getAccountPar/Wei` will return each account's balance\nafter `primaryDeltaWei` and `secondaryDeltaWei` are applied.\n * The `_accountOwner` isn't a parameter because technically it is the implementing contract. So, to construct the\n`Account.Info` object for the primary account, use the following in the implementation:\n`Account.Info({ owner: address(this), number: _accountNumber })`.\n * @param _primaryAccountNumber The account number of the account being operated on\n@param _secondaryAccount The account that is receiving the primary account's assets. To calculate the value\n received by the secondary account, negate primary/secondary delta wei.\n@param _primaryMarketId The market that was positive for this account, whose collateral is being seized\n@param _primaryDeltaWei The amount of primary market that was received or paid\n@param _secondaryMarketId The borrowed balance that is being forcefully repaid\n@param _secondaryDeltaWei The amount of borrowed assets to be repaid. Always 0 or positive, since the user's\n balance is going from negative to 0.",
"id": 24771,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "onInternalBalanceChange",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 24769,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 24758,
"name": "_primaryAccountNumber",
"nodeType": "VariableDeclaration",
"scope": 24771,
"src": "2393:29:83",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24757,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2393:7:83",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24760,
"name": "_secondaryAccount",
"nodeType": "VariableDeclaration",
"scope": 24771,
"src": "2432:39:83",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_calldata_ptr",
"typeString": "struct Account.Info"
},
"typeName": {
"contractScope": null,
"id": 24759,
"name": "Account.Info",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 24851,
"src": "2432:12:83",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24762,
"name": "_primaryMarketId",
"nodeType": "VariableDeclaration",
"scope": 24771,
"src": "2481:24:83",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24761,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2481:7:83",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24764,
"name": "_primaryDeltaWei",
"nodeType": "VariableDeclaration",
"scope": 24771,
"src": "2515:35:83",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Wei_$31149_calldata_ptr",
"typeString": "struct Types.Wei"
},
"typeName": {
"contractScope": null,
"id": 24763,
"name": "Types.Wei",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 31149,
"src": "2515:9:83",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Wei_$31149_storage_ptr",
"typeString": "struct Types.Wei"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24766,
"name": "_secondaryMarketId",
"nodeType": "VariableDeclaration",
"scope": 24771,
"src": "2560:26:83",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24765,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2560:7:83",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24768,
"name": "_secondaryDeltaWei",
"nodeType": "VariableDeclaration",
"scope": 24771,
"src": "2596:37:83",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Wei_$31149_calldata_ptr",
"typeString": "struct Types.Wei"
},
"typeName": {
"contractScope": null,
"id": 24767,
"name": "Types.Wei",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 31149,
"src": "2596:9:83",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Wei_$31149_storage_ptr",
"typeString": "struct Types.Wei"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2383:256:83"
},
"returnParameters": {
"id": 24770,
"nodeType": "ParameterList",
"parameters": [],
"src": "2648:0:83"
},
"scope": 24772,
"src": "2351:298:83",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
}
],
"scope": 24773,
"src": "902:1749:83"
}
],
"src": "595:2057:83"
},
"legacyAST": {
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/interfaces/IExternalCallback.sol",
"exportedSymbols": {
"IExternalCallback": [
24772
]
},
"id": 24773,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 24751,
"literals": [
"solidity",
">=",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "595:24:83"
},
{
"id": 24752,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "620:33:83"
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Account.sol",
"file": "../lib/Account.sol",
"id": 24754,
"nodeType": "ImportDirective",
"scope": 24773,
"sourceUnit": 24886,
"src": "655:45:83",
"symbolAliases": [
{
"foreign": 24753,
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Types.sol",
"file": "../lib/Types.sol",
"id": 24756,
"nodeType": "ImportDirective",
"scope": 24773,
"sourceUnit": 31362,
"src": "701:41:83",
"symbolAliases": [
{
"foreign": 24755,
"local": null
}
],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": "@title IExternalCallback\n@author Dolomite\n * Interface that smart contract users can implement to be notified of their balance(s) changing.",
"fullyImplemented": false,
"id": 24772,
"linearizedBaseContracts": [
24772
],
"name": "IExternalCallback",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": "A callback function to notify the smart contract user that their balance is changing. This function is called\nafter the new balances are set in state, so calling `getAccountPar/Wei` will return each account's balance\nafter `primaryDeltaWei` and `secondaryDeltaWei` are applied.\n * The `_accountOwner` isn't a parameter because technically it is the implementing contract. So, to construct the\n`Account.Info` object for the primary account, use the following in the implementation:\n`Account.Info({ owner: address(this), number: _accountNumber })`.\n * @param _primaryAccountNumber The account number of the account being operated on\n@param _secondaryAccount The account that is receiving the primary account's assets. To calculate the value\n received by the secondary account, negate primary/secondary delta wei.\n@param _primaryMarketId The market that was positive for this account, whose collateral is being seized\n@param _primaryDeltaWei The amount of primary market that was received or paid\n@param _secondaryMarketId The borrowed balance that is being forcefully repaid\n@param _secondaryDeltaWei The amount of borrowed assets to be repaid. Always 0 or positive, since the user's\n balance is going from negative to 0.",
"id": 24771,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "onInternalBalanceChange",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 24769,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 24758,
"name": "_primaryAccountNumber",
"nodeType": "VariableDeclaration",
"scope": 24771,
"src": "2393:29:83",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24757,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2393:7:83",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24760,
"name": "_secondaryAccount",
"nodeType": "VariableDeclaration",
"scope": 24771,
"src": "2432:39:83",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_calldata_ptr",
"typeString": "struct Account.Info"
},
"typeName": {
"contractScope": null,
"id": 24759,
"name": "Account.Info",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 24851,
"src": "2432:12:83",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Info_$24851_storage_ptr",
"typeString": "struct Account.Info"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24762,
"name": "_primaryMarketId",
"nodeType": "VariableDeclaration",
"scope": 24771,
"src": "2481:24:83",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24761,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2481:7:83",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24764,
"name": "_primaryDeltaWei",
"nodeType": "VariableDeclaration",
"scope": 24771,
"src": "2515:35:83",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Wei_$31149_calldata_ptr",
"typeString": "struct Types.Wei"
},
"typeName": {
"contractScope": null,
"id": 24763,
"name": "Types.Wei",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 31149,
"src": "2515:9:83",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Wei_$31149_storage_ptr",
"typeString": "struct Types.Wei"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24766,
"name": "_secondaryMarketId",
"nodeType": "VariableDeclaration",
"scope": 24771,
"src": "2560:26:83",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24765,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2560:7:83",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24768,
"name": "_secondaryDeltaWei",
"nodeType": "VariableDeclaration",
"scope": 24771,
"src": "2596:37:83",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Wei_$31149_calldata_ptr",
"typeString": "struct Types.Wei"
},
"typeName": {
"contractScope": null,
"id": 24767,
"name": "Types.Wei",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 31149,
"src": "2596:9:83",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Wei_$31149_storage_ptr",
"typeString": "struct Types.Wei"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2383:256:83"
},
"returnParameters": {
"id": 24770,
"nodeType": "ParameterList",
"parameters": [],
"src": "2648:0:83"
},
"scope": 24772,
"src": "2351:298:83",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
}
],
"scope": 24773,
"src": "902:1749:83"
}
],
"src": "595:2057:83"
},
"compiler": {
"name": "solc",
"version": "0.5.16+commit.9c3226ce.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.0.23",
"updatedAt": "2025-06-22T04:01:53.957Z",
"devdoc": {
"author": "Dolomite * Interface that smart contract users can implement to be notified of their balance(s) changing.",
"methods": {
"onInternalBalanceChange(uint256,(address,uint256),uint256,(bool,uint256),uint256,(bool,uint256))": {
"params": {
"_primaryAccountNumber": "The account number of the account being operated on",
"_primaryDeltaWei": "The amount of primary market that was received or paid",
"_primaryMarketId": "The market that was positive for this account, whose collateral is being seized",
"_secondaryAccount": "The account that is receiving the primary account's assets. To calculate the value received by the secondary account, negate primary/secondary delta wei.",
"_secondaryDeltaWei": "The amount of borrowed assets to be repaid. Always 0 or positive, since the user's balance is going from negative to 0.",
"_secondaryMarketId": "The borrowed balance that is being forcefully repaid"
}
}
},
"title": "IExternalCallback"
},
"userdoc": {
"methods": {
"onInternalBalanceChange(uint256,(address,uint256),uint256,(bool,uint256),uint256,(bool,uint256))": {
"notice": "A callback function to notify the smart contract user that their balance is changing. This function is called after the new balances are set in state, so calling `getAccountPar/Wei` will return each account's balance after `primaryDeltaWei` and `secondaryDeltaWei` are applied. * The `_accountOwner` isn't a parameter because technically it is the implementing contract. So, to construct the `Account.Info` object for the primary account, use the following in the implementation: `Account.Info({ owner: address(this), number: _accountNumber })`."
}
}
}
}