core-artifacts
Version:
Consist artifacts of the maple protocol
621 lines (620 loc) • 23.2 kB
JSON
{
"id": "1301a1b652667598e7fa488902386cf0",
"_format": "hh-sol-build-info-1",
"solcVersion": "0.6.11",
"solcLongVersion": "0.6.11+commit.5ef660b1",
"input": {
"language": "Solidity",
"sources": {
"contracts/core/premium-calculator/v1/interfaces/IPremiumCalc.sol": {
"content": "// SPDX-License-Identifier: AGPL-3.0-or-later // hevm: flattened sources of contracts/core/premium-calculator/v1/interfaces/IPremiumCalc.sol\npragma solidity =0.6.11;\n\n////// contracts/core/calculator/v1/interfaces/ICalc.sol\n/* pragma solidity 0.6.11; */\n\n/// @title Calc calculates.\ninterface ICalc {\n\n /**\n @dev The Calculator type.\n */\n function calcType() external pure returns (uint8);\n\n /**\n @dev The Calculator name.\n */\n function name() external pure returns (bytes32);\n\n}\n\n////// contracts/core/premium-calculator/v1/interfaces/IPremiumCalc.sol\n/* pragma solidity 0.6.11; */\n\n/* import { ICalc } from \"../../../calculator/v1/interfaces/ICalc.sol\"; */\n\n/// @title PremiumCalc calculates premium fees on Loans.\ninterface IPremiumCalc is ICalc {\n\n /**\n @dev The flat percentage fee (in basis points) of principal to charge as a premium when calling a Loan.\n */\n function premiumFee() external view returns (uint256);\n\n /**\n @dev Calculates the premium payment for a Loan, when making a full payment.\n @param _loan The address of a Loan to calculate a premium payment for.\n @return total The principal + interest.\n @return principalOwed The principal.\n @return interest The interest.\n */\n function getPremiumPayment(address _loan) external view returns (uint256 total, uint256 principalOwed, uint256 interest);\n\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers"
],
"": [
"ast"
]
}
}
}
},
"output": {
"contracts": {
"contracts/core/premium-calculator/v1/interfaces/IPremiumCalc.sol": {
"ICalc": {
"abi": [
{
"inputs": [],
"name": "calcType",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "pure",
"type": "function"
}
],
"evm": {
"bytecode": {
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"methodIdentifiers": {
"calcType()": "9d8ae446",
"name()": "06fdde03"
}
}
},
"IPremiumCalc": {
"abi": [
{
"inputs": [],
"name": "calcType",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_loan",
"type": "address"
}
],
"name": "getPremiumPayment",
"outputs": [
{
"internalType": "uint256",
"name": "total",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "principalOwed",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "interest",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "premiumFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"evm": {
"bytecode": {
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"methodIdentifiers": {
"calcType()": "9d8ae446",
"getPremiumPayment(address)": "de6d72cb",
"name()": "06fdde03",
"premiumFee()": "209c9523"
}
}
}
}
},
"sources": {
"contracts/core/premium-calculator/v1/interfaces/IPremiumCalc.sol": {
"ast": {
"absolutePath": "contracts/core/premium-calculator/v1/interfaces/IPremiumCalc.sol",
"exportedSymbols": {
"ICalc": [
15
],
"IPremiumCalc": [
37
]
},
"id": 38,
"license": "AGPL-3.0-or-later",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"=",
"0.6",
".11"
],
"nodeType": "PragmaDirective",
"src": "141:24:0"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": {
"id": 2,
"nodeType": "StructuredDocumentation",
"src": "255:28:0",
"text": "@title Calc calculates."
},
"fullyImplemented": false,
"id": 15,
"linearizedBaseContracts": [
15
],
"name": "ICalc",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": {
"id": 3,
"nodeType": "StructuredDocumentation",
"src": "306:45:0",
"text": "@dev The Calculator type."
},
"functionSelector": "9d8ae446",
"id": 8,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "calcType",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 4,
"nodeType": "ParameterList",
"parameters": [],
"src": "373:2:0"
},
"returnParameters": {
"id": 7,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8,
"src": "399:5:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 5,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "399:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "398:7:0"
},
"scope": 15,
"src": "356:50:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "external"
},
{
"body": null,
"documentation": {
"id": 9,
"nodeType": "StructuredDocumentation",
"src": "412:45:0",
"text": "@dev The Calculator name."
},
"functionSelector": "06fdde03",
"id": 14,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "name",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 10,
"nodeType": "ParameterList",
"parameters": [],
"src": "475:2:0"
},
"returnParameters": {
"id": 13,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 12,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 14,
"src": "501:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 11,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "501:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "500:9:0"
},
"scope": 15,
"src": "462:48:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "external"
}
],
"scope": 38,
"src": "283:230:0"
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 17,
"name": "ICalc",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 15,
"src": "777:5:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ICalc_$15",
"typeString": "contract ICalc"
}
},
"id": 18,
"nodeType": "InheritanceSpecifier",
"src": "777:5:0"
}
],
"contractDependencies": [
15
],
"contractKind": "interface",
"documentation": {
"id": 16,
"nodeType": "StructuredDocumentation",
"src": "694:57:0",
"text": "@title PremiumCalc calculates premium fees on Loans."
},
"fullyImplemented": false,
"id": 37,
"linearizedBaseContracts": [
37,
15
],
"name": "IPremiumCalc",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": {
"id": 19,
"nodeType": "StructuredDocumentation",
"src": "790:123:0",
"text": "@dev The flat percentage fee (in basis points) of principal to charge as a premium when calling a Loan."
},
"functionSelector": "209c9523",
"id": 24,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "premiumFee",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 20,
"nodeType": "ParameterList",
"parameters": [],
"src": "937:2:0"
},
"returnParameters": {
"id": 23,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 22,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 24,
"src": "963:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 21,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "963:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "962:9:0"
},
"scope": 37,
"src": "918:54:0",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"body": null,
"documentation": {
"id": 25,
"nodeType": "StructuredDocumentation",
"src": "978:331:0",
"text": "@dev Calculates the premium payment for a Loan, when making a full payment.\n@param _loan The address of a Loan to calculate a premium payment for.\n@return total The principal + interest.\n@return principalOwed The principal.\n@return interest The interest."
},
"functionSelector": "de6d72cb",
"id": 36,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getPremiumPayment",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 28,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 27,
"mutability": "mutable",
"name": "_loan",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 36,
"src": "1341:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 26,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1341:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1340:15:0"
},
"returnParameters": {
"id": 35,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 30,
"mutability": "mutable",
"name": "total",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 36,
"src": "1379:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 29,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1379:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 32,
"mutability": "mutable",
"name": "principalOwed",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 36,
"src": "1394:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 31,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1394:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 34,
"mutability": "mutable",
"name": "interest",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 36,
"src": "1417:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 33,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1417:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1378:56:0"
},
"scope": 37,
"src": "1314:121:0",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 38,
"src": "751:687:0"
}
],
"src": "141:1298:0"
},
"id": 0
}
}
}
}