@dolomite-exchange/dolomite-margin
Version:
Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol
274 lines • 10.4 kB
JSON
{
"contractName": "Monetary",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"dYdX * Library for types involving money\",\"methods\":{},\"title\":\"Monetary\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Monetary.sol\":\"Monetary\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Monetary.sol\":{\"keccak256\":\"0x5257274f2d4d3605f3e97ec45fb902111fe9a22506f0b4cf308ea933bc81bfe2\",\"urls\":[\"bzz-raw://85b8023b78805063a2ec8d376f1f5983994eabd96efd8ceadb0224dbb71c5678\",\"dweb:/ipfs/QmaDhzCzRqsuHuJfhToEC4pATQHwhh7yWWsjwfuRzFT1kG\"]}},\"version\":1}",
"bytecode": "0x60636023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea365627a7a72315820ef1aa1f109a49721a15aaf15ed2a781ab3ab21d7b0c8e8dff5ded042f3cf286c6c6578706572696d656e74616cf564736f6c63430005100040",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea365627a7a72315820ef1aa1f109a49721a15aaf15ed2a781ab3ab21d7b0c8e8dff5ded042f3cf286c6c6578706572696d656e74616cf564736f6c63430005100040",
"sourceMap": "746:322:98:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24",
"deployedSourceMap": "746:322:98:-;;;;;;;;",
"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\n\n/**\n * @title Monetary\n * @author dYdX\n *\n * Library for types involving money\n */\nlibrary Monetary {\n\n /*\n * The price of a base-unit of an asset. Has `36 - token.decimals` decimals\n */\n struct Price {\n uint256 value;\n }\n\n /*\n * Total value of an some amount of an asset. Equal to (price * amount). Has 36 decimals.\n */\n struct Value {\n uint256 value;\n }\n}\n",
"sourcePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Monetary.sol",
"ast": {
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Monetary.sol",
"exportedSymbols": {
"Monetary": [
27760
]
},
"id": 27761,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 27752,
"literals": [
"solidity",
"^",
"0.5",
".7"
],
"nodeType": "PragmaDirective",
"src": "603:23:98"
},
{
"id": 27753,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "627:33:98"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title Monetary\n@author dYdX\n * Library for types involving money",
"fullyImplemented": true,
"id": 27760,
"linearizedBaseContracts": [
27760
],
"name": "Monetary",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "Monetary.Price",
"id": 27756,
"members": [
{
"constant": false,
"id": 27755,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 27756,
"src": "888:13:98",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 27754,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "888:7:98",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Price",
"nodeType": "StructDefinition",
"scope": 27760,
"src": "865:43:98",
"visibility": "public"
},
{
"canonicalName": "Monetary.Value",
"id": 27759,
"members": [
{
"constant": false,
"id": 27758,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 27759,
"src": "1046:13:98",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 27757,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1046:7:98",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Value",
"nodeType": "StructDefinition",
"scope": 27760,
"src": "1023:43:98",
"visibility": "public"
}
],
"scope": 27761,
"src": "746:322:98"
}
],
"src": "603:466:98"
},
"legacyAST": {
"absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/protocol/lib/Monetary.sol",
"exportedSymbols": {
"Monetary": [
27760
]
},
"id": 27761,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 27752,
"literals": [
"solidity",
"^",
"0.5",
".7"
],
"nodeType": "PragmaDirective",
"src": "603:23:98"
},
{
"id": 27753,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "627:33:98"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title Monetary\n@author dYdX\n * Library for types involving money",
"fullyImplemented": true,
"id": 27760,
"linearizedBaseContracts": [
27760
],
"name": "Monetary",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "Monetary.Price",
"id": 27756,
"members": [
{
"constant": false,
"id": 27755,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 27756,
"src": "888:13:98",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 27754,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "888:7:98",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Price",
"nodeType": "StructDefinition",
"scope": 27760,
"src": "865:43:98",
"visibility": "public"
},
{
"canonicalName": "Monetary.Value",
"id": 27759,
"members": [
{
"constant": false,
"id": 27758,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 27759,
"src": "1046:13:98",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 27757,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1046:7:98",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Value",
"nodeType": "StructDefinition",
"scope": 27760,
"src": "1023:43:98",
"visibility": "public"
}
],
"scope": 27761,
"src": "746:322:98"
}
],
"src": "603:466:98"
},
"compiler": {
"name": "solc",
"version": "0.5.16+commit.9c3226ce.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.0.23",
"updatedAt": "2025-06-22T04:01:54.017Z",
"devdoc": {
"author": "dYdX * Library for types involving money",
"methods": {},
"title": "Monetary"
},
"userdoc": {
"methods": {}
}
}