Skip to content

Instantly share code, notes, and snippets.

@tomrpl
Created October 26, 2023 09:18
Show Gist options
  • Save tomrpl/7b344a98b7b0e60d7cb52575ee312d17 to your computer and use it in GitHub Desktop.
Save tomrpl/7b344a98b7b0e60d7cb52575ee312d17 to your computer and use it in GitHub Desktop.
IRM.json
{
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "morpho",
"type": "address"
},
{
"internalType": "uint256",
"name": "lnJumpFactor",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "speedFactor",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "targetUtilization",
"type": "uint256"
},
{
"internalType": "uint128",
"name": "initialRate",
"type": "uint128"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "INITIAL_RATE",
"outputs": [
{
"internalType": "uint128",
"name": "",
"type": "uint128"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "LN_JUMP_FACTOR",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_RATE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MORPHO",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "SPEED_FACTOR",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "TARGET_UTILIZATION",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "borrowableToken",
"type": "address"
},
{
"internalType": "address",
"name": "collateralToken",
"type": "address"
},
{
"internalType": "address",
"name": "oracle",
"type": "address"
},
{
"internalType": "address",
"name": "irm",
"type": "address"
},
{
"internalType": "uint256",
"name": "lltv",
"type": "uint256"
}
],
"internalType": "struct MarketParams",
"name": "marketParams",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint128",
"name": "totalSupplyAssets",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "totalSupplyShares",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "totalBorrowAssets",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "totalBorrowShares",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "lastUpdate",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "fee",
"type": "uint128"
}
],
"internalType": "struct Market",
"name": "market",
"type": "tuple"
}
],
"name": "borrowRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "borrowableToken",
"type": "address"
},
{
"internalType": "address",
"name": "collateralToken",
"type": "address"
},
{
"internalType": "address",
"name": "oracle",
"type": "address"
},
{
"internalType": "address",
"name": "irm",
"type": "address"
},
{
"internalType": "uint256",
"name": "lltv",
"type": "uint256"
}
],
"internalType": "struct MarketParams",
"name": "marketParams",
"type": "tuple"
},
{
"components": [
{
"internalType": "uint128",
"name": "totalSupplyAssets",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "totalSupplyShares",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "totalBorrowAssets",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "totalBorrowShares",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "lastUpdate",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "fee",
"type": "uint128"
}
],
"internalType": "struct Market",
"name": "market",
"type": "tuple"
}
],
"name": "borrowRateView",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "Id",
"name": "",
"type": "bytes32"
}
],
"name": "marketIrm",
"outputs": [
{
"internalType": "uint128",
"name": "prevBorrowRate",
"type": "uint128"
},
{
"internalType": "int128",
"name": "prevErr",
"type": "int128"
}
],
"stateMutability": "view",
"type": "function"
}
],
"bytecode": {
"object": "0x6101203461013757601f610aaa38819003918201601f19168301916001600160401b0383118484101761013c5780849260a094604052833981010312610137578051906001600160a01b038216820361013757602081015160408201516060830151608090930151939091906001600160801b0385168503610137576100ad610086610152565b6001600160ff1b039061009c908286111561018d565b6100a4610152565b9085111561018d565b6100c96100b8610152565b670de0b6b3a764000086111561018d565b60805260a05260c05260e0526101009081526040516108b591826101f583396080518281816101280152610252015260a0518281816102d30152610621015260c0518281816101d8015261065a015260e05182818160c2015261056501525181818161021a01526107230152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b60408051919082016001600160401b0381118382101761013c57604052600f82526e696e70757420746f6f206c6172676560881b6020830152565b156101955750565b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b8285106101db575050604492506000838284010152601f80199101168101030190fd5b84810182015186860160440152938101938593506101b856fe60806040818152600436101561001457600080fd5b600091823560e01c9081631d1d9bb7146102bc57508063362c1f90146102815780633acb56241461023e5780634dbac733146101fb578063811f88bd146101c15780638c00bf6b1461018f5780639451fed4146100e55780639a1a14d9146100ab5763c24dbebd1461008557600080fd5b346100a757816003193601126100a757602090516801b80fcfcdb5d140088152f35b5080fd5b50346100a757816003193601126100a757602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346100a75760a0816020936101576100fd3661032c565b949061014f61010a6102f6565b600a8152696e6f74204d6f7270686f60b01b8a820152600180851b037f000000000000000000000000000000000000000000000000000000000000000016331461044a565b209384610520565b9483528287529490912060809190911b6fffffffffffffffffffffffffffffffff19166001600160801b039485161790555191168152f35b50346100a7576020906001600160801b036101b660a06101ae3661032c565b919020610520565b939150505191168152f35b50346100a757816003193601126100a757602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346100a757816003193601126100a757602090516001600160801b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346100a757816003193601126100a757517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50346100a75760203660031901126100a757809160043581528060205220548151906001600160801b038116825260801d600f0b6020820152f35b8390346100a757816003193601126100a7576020907f00000000000000000000000000000000000000000000000000000000000000008152f35b604051906040820182811067ffffffffffffffff82111761031657604052565b634e487b7160e01b600052604160045260246000fd5b90600319820161016081126104455760a013610445576040805167ffffffffffffffff919060a08101838111828210176103165782526001600160a01b0390600435828116810361044557815260243582811681036104455760208201526044358281168103610445578382015260643591821682036104455760c091606082015260843560808201529460a31901126104455780519160c08301908111838210176103165781526001600160801b039060a435828116810361044557835260c435828116810361044557602084015260e435908282168203610445578301526101043581811681036104455760608301526101243581811681036104455760808301526101443590811681036104455760a082015290565b600080fd5b156104525750565b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610498575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350610475565b818103929160001380158285131691841216176104ca57565b634e487b7160e01b600052601160045260246000fd5b90670de0b6b3a7640000918281029281840514901517156104ca57565b818102929160008212600160ff1b8214166104ca5781840514901517156104ca57565b916001600160801b038083511680156000811560001461076f57508260408601511690670de0b6b3a7640000918281029281840414901517156104ca5761075957045b7f0000000000000000000000000000000000000000000000000000000000000000908181111561074857670de0b6b3a7640000918083039283116104ca576105b26105b7916105bc94936104b1565b6104e0565b610864565b600f0b928460005260006020526040600020548281161561071c5760801d600f0b8403946f7fffffffffffffffffffffffffffffff1986126f7fffffffffffffffffffffffffffffff8713176104ca5761064f61064996670de0b6b3a76400009788917f000000000000000000000000000000000000000000000000000000000000000090600f0b6104fd565b0561078a565b958360808261067e897f00000000000000000000000000000000000000000000000000000000000000006104fd565b059401511642034281116104ca57816106be61069e6106c69388976104fd565b996106a88b61078a565b9560005260006020528660406000205416610777565b049283610777565b04958061070757505b6801b80fcfcdb5d140089580871087821802189581811090821802189394806001116001821802181692806001116001821802181690565b6105b76105b261071793896104b1565b6106cf565b50505091507f000000000000000000000000000000000000000000000000000000000000000090918190565b6105b76105b2836105bc94936104b1565b634e487b7160e01b600052601260045260246000fd5b915050610563565b818102929181159184041417156104ca57565b6107c16107956102f6565b600d81526c77457870206f766572666c6f7760981b602082015268099e8db03256ce5d6a83131561044a565b6107fe6107cc6102f6565b600e81526d7745787020756e646572666c6f7760901b60208201526704cf46d8192b672e600160ff1b0183121561044a565b6000811215610855576704cf46d8192b672d19905b67099e8db03256ce5d80928201059182029003670de0b6b3a76400009060028261083d83806104fd565b05050101906000811261084e571b90565b6000031c90565b6704cf46d8192b672e90610813565b811561075957600160ff1b81146000198314166104ca57059056fea2646970667358221220d9b10810c25d1750c05faba626ed69f1a0b93a1e3214741331786cd165695bed64736f6c63430008130033",
"sourceMap": "744:5449:24:-:0;;;;;;;;;;;;;-1:-1:-1;;744:5449:24;;;;-1:-1:-1;;;;;744:5449:24;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;744:5449:24;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;744:5449:24;;;;;;2327:76;744:5449;;:::i;:::-;-1:-1:-1;;;;;2272:16:24;2240:77;;2248:41;;;;2240:77;:::i;:::-;744:5449;;:::i;:::-;2335:40;;;;2327:76;:::i;:::-;2413:60;744:5449;;:::i;:::-;93:4:21;2421:24:24;;;2413:60;:::i;:::-;744:5449;2484:15;744:5449;2509:29;2548:26;;2584:38;;2632:26;;;;744:5449;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2548:26;744:5449;;;;;;;;;;2584:38;744:5449;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;744:5449:24;;;;;;-1:-1:-1;744:5449:24;;;;;-1:-1:-1;744:5449:24;;;;;;;;;-1:-1:-1;;;;;744:5449:24;;;;;;;;;;;;;-1:-1:-1;;;744:5449:24;;;;:::o;205:17:25:-;;;;;:::o;:::-;744:5449:24;;205:17:25;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;205:17:25;;;;;;;;;;;;-1:-1:-1;205:17:25;;;;;;744:5449:24;;;;;;205:17:25;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;205:17:25;",
"linkReferences": {}
},
"deployedBytecode": {
"object": "0x60806040818152600436101561001457600080fd5b600091823560e01c9081631d1d9bb7146102bc57508063362c1f90146102815780633acb56241461023e5780634dbac733146101fb578063811f88bd146101c15780638c00bf6b1461018f5780639451fed4146100e55780639a1a14d9146100ab5763c24dbebd1461008557600080fd5b346100a757816003193601126100a757602090516801b80fcfcdb5d140088152f35b5080fd5b50346100a757816003193601126100a757602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346100a75760a0816020936101576100fd3661032c565b949061014f61010a6102f6565b600a8152696e6f74204d6f7270686f60b01b8a820152600180851b037f000000000000000000000000000000000000000000000000000000000000000016331461044a565b209384610520565b9483528287529490912060809190911b6fffffffffffffffffffffffffffffffff19166001600160801b039485161790555191168152f35b50346100a7576020906001600160801b036101b660a06101ae3661032c565b919020610520565b939150505191168152f35b50346100a757816003193601126100a757602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346100a757816003193601126100a757602090516001600160801b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346100a757816003193601126100a757517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50346100a75760203660031901126100a757809160043581528060205220548151906001600160801b038116825260801d600f0b6020820152f35b8390346100a757816003193601126100a7576020907f00000000000000000000000000000000000000000000000000000000000000008152f35b604051906040820182811067ffffffffffffffff82111761031657604052565b634e487b7160e01b600052604160045260246000fd5b90600319820161016081126104455760a013610445576040805167ffffffffffffffff919060a08101838111828210176103165782526001600160a01b0390600435828116810361044557815260243582811681036104455760208201526044358281168103610445578382015260643591821682036104455760c091606082015260843560808201529460a31901126104455780519160c08301908111838210176103165781526001600160801b039060a435828116810361044557835260c435828116810361044557602084015260e435908282168203610445578301526101043581811681036104455760608301526101243581811681036104455760808301526101443590811681036104455760a082015290565b600080fd5b156104525750565b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610498575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350610475565b818103929160001380158285131691841216176104ca57565b634e487b7160e01b600052601160045260246000fd5b90670de0b6b3a7640000918281029281840514901517156104ca57565b818102929160008212600160ff1b8214166104ca5781840514901517156104ca57565b916001600160801b038083511680156000811560001461076f57508260408601511690670de0b6b3a7640000918281029281840414901517156104ca5761075957045b7f0000000000000000000000000000000000000000000000000000000000000000908181111561074857670de0b6b3a7640000918083039283116104ca576105b26105b7916105bc94936104b1565b6104e0565b610864565b600f0b928460005260006020526040600020548281161561071c5760801d600f0b8403946f7fffffffffffffffffffffffffffffff1986126f7fffffffffffffffffffffffffffffff8713176104ca5761064f61064996670de0b6b3a76400009788917f000000000000000000000000000000000000000000000000000000000000000090600f0b6104fd565b0561078a565b958360808261067e897f00000000000000000000000000000000000000000000000000000000000000006104fd565b059401511642034281116104ca57816106be61069e6106c69388976104fd565b996106a88b61078a565b9560005260006020528660406000205416610777565b049283610777565b04958061070757505b6801b80fcfcdb5d140089580871087821802189581811090821802189394806001116001821802181692806001116001821802181690565b6105b76105b261071793896104b1565b6106cf565b50505091507f000000000000000000000000000000000000000000000000000000000000000090918190565b6105b76105b2836105bc94936104b1565b634e487b7160e01b600052601260045260246000fd5b915050610563565b818102929181159184041417156104ca57565b6107c16107956102f6565b600d81526c77457870206f766572666c6f7760981b602082015268099e8db03256ce5d6a83131561044a565b6107fe6107cc6102f6565b600e81526d7745787020756e646572666c6f7760901b60208201526704cf46d8192b672e600160ff1b0183121561044a565b6000811215610855576704cf46d8192b672d19905b67099e8db03256ce5d80928201059182029003670de0b6b3a76400009060028261083d83806104fd565b05050101906000811261084e571b90565b6000031c90565b6704cf46d8192b672e90610813565b811561075957600160ff1b81146000198314166104ca57059056fea2646970667358221220d9b10810c25d1750c05faba626ed69f1a0b93a1e3214741331786cd165695bed64736f6c63430008130033",
"sourceMap": "744:5449:24:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1423:43;744:5449;;;;;;;;;;;;3247:23;744:5449;;;:::i;:::-;;;3088:51;744:5449;;:::i;:::-;;;;-1:-1:-1;;;744:5449:24;;;;;;;;;3110:6;744:5449;3096:10;:20;3088:51;:::i;:::-;463:102:20;3247:23:24;;;:::i;:::-;744:5449;;;;;;;;;;392:12:25;;;;;-1:-1:-1;;392:12:25;-1:-1:-1;;;;;744:5449:24;;;392:12:25;;;744:5449:24;;;;;;;;;;;;;-1:-1:-1;;;;;2869:38:24;463:102:20;744:5449:24;;;:::i;:::-;463:102:20;;;2869:38:24;:::i;:::-;744:5449;;;;;;;;;;;;;;;;;;;;;;;;;;1328:37;744:5449;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1518:37:24;744:5449;;;;;;;;;;;;;;;;;;1145:31;-1:-1:-1;;;;;744:5449:24;;;;;;;;;;;;;-1:-1:-1;;744:5449:24;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;744:5449:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;1237:39;;744:5449;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;-1:-1:-1;;744:5449:24;;;;;;;;-1:-1:-1;744:5449:24;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;744:5449:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;744:5449:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;-1:-1:-1;744:5449:24;;392:12:25;;;;;:::o;:::-;744:5449:24;;392:12:25;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;392:12:25;;;;;;;;;;;;-1:-1:-1;392:12:25;;;;;;744:5449:24;;;;;;392:12:25;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;392:12:25;;93:4:21;;;;;;;-1:-1:-1;93:4:21;;;;;;;;;;;;;:::o;:::-;744:5449:24;;;93:4:21;744:5449:24;;;;;93:4:21;744:5449:24;93:4:21;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;-1:-1:-1;;;93:4:21;;;;;;;;;;;;;;;:::o;3464:2727:24:-;;-1:-1:-1;;;;;744:5449:24;;;;3606:28;;-1:-1:-1;3606:28:24;;:94;:28;;;3637:24;;;;;744:5449;;93:4:21;;744:5449:24;;;;;;;;;;;;;;;;;;3606:94;3749:18;;3735:32;;;;;;93:4:21;;;;;;;;;;4029:48:24;1870:11:26;3735:80:24;1870:15:26;3735:80:24;;4029:48;:::i;:::-;1870:11:26;:::i;:::-;:15;:::i;:::-;744:5449:24;;;;-1:-1:-1;744:5449:24;-1:-1:-1;744:5449:24;;;-1:-1:-1;744:5449:24;;;;;4126:33;4122:79;;744:5449;;;;93:4:21;;;-1:-1:-1;;93:4:21;;;;;;;;4463:55:24;1756:5:26;93:4:21;;4501:14:24;;;;744:5449;;;1756:5:26;:::i;:::-;744:5449:24;4463:55;:::i;:::-;4625:12;;744:5449;4625:12;1756:5:26;4625:12:24;;1756:5:26;:::i;:::-;744:5449:24;4698:17;;744:5449;;4680:15;93:4:21;4680:15:24;93:4:21;;;;4819:23:24;887:5:21;4819:23:24;887:5:21;4819:23:24;;;;:::i;:::-;4882:29;;;;:::i;:::-;744:5449;-1:-1:-1;744:5449:24;-1:-1:-1;744:5449:24;;;;-1:-1:-1;744:5449:24;;;887:5:21;:::i;:::-;744:5449:24;887:5:21;;;:::i;:::-;744:5449:24;;5700:20;;;5722:35;5696:294;744:5449;317:195:27;;;;;;;;;;;;;;;;;;6086:98:24;317:195:27;;6127:1:24;317:195:27;6127:1:24;317:195:27;;;;744:5449:24;317:195:27;;6127:1:24;317:195:27;6127:1:24;317:195:27;;;;744:5449:24;3464:2727;:::o;5696:294::-;1870:11:26;5911:51:24;1870:15:26;5911:51:24;;;:::i;1870:15:26:-;5696:294:24;;4122:79;4174:12;;;;;;4161:40;;;;:::o;3735:80::-;1870:11:26;4029:48:24;3735:80;1870:15:26;3735:80:24;;4029:48;:::i;744:5449::-;;;;-1:-1:-1;744:5449:24;;;;;-1:-1:-1;744:5449:24;3606:94;;;;;;744:5449;;;;;;;;;;;;;;;;:::o;513:1151:26:-;651:66;744:5449:24;;:::i;:::-;;;;-1:-1:-1;;;744:5449:24;;;;664:27:26;659:32;;;651:66;:::i;:::-;785:70;744:5449:24;;:::i;:::-;434:26:26;744:5449:24;;-1:-1:-1;;;744:5449:24;434:26:26;;;-1:-1:-1;;;;;793:35:26;;;785:70;:::i;:::-;-1:-1:-1;1049:5:26;;-1:-1:-1;;;;;270:16:25;1048:40:26;434:26;;;;;;270:16:25;;;;;93:4:21;1756:5:26;827:1;1756:5;;;;;:::i;:::-;744:5449:24;434:26:26;;;;-1:-1:-1;1569:6:26;;-1:-1:-1;;215:11:26;1577:25;:::o;1565:82::-;-1:-1:-1;270:16:25;215:11:26;1621:26;:::o;1048:40::-;434:26;1048:40;;;744:5449:24;;;;;-1:-1:-1;;;744:5449:24;;-1:-1:-1;;744:5449:24;;;;;;;:::o",
"linkReferences": {},
"immutableReferences": {
"43990": [
{
"start": 296,
"length": 32
},
{
"start": 594,
"length": 32
}
],
"43993": [
{
"start": 723,
"length": 32
},
{
"start": 1569,
"length": 32
}
],
"43996": [
{
"start": 472,
"length": 32
},
{
"start": 1626,
"length": 32
}
],
"43999": [
{
"start": 194,
"length": 32
},
{
"start": 1381,
"length": 32
}
],
"44002": [
{
"start": 538,
"length": 32
},
{
"start": 1827,
"length": 32
}
]
}
},
"methodIdentifiers": {
"INITIAL_RATE()": "4dbac733",
"LN_JUMP_FACTOR()": "1d1d9bb7",
"MAX_RATE()": "c24dbebd",
"MORPHO()": "3acb5624",
"SPEED_FACTOR()": "811f88bd",
"TARGET_UTILIZATION()": "9a1a14d9",
"borrowRate((address,address,address,address,uint256),(uint128,uint128,uint128,uint128,uint128,uint128))": "9451fed4",
"borrowRateView((address,address,address,address,uint256),(uint128,uint128,uint128,uint128,uint128,uint128))": "8c00bf6b",
"marketIrm(bytes32)": "362c1f90"
},
"rawMetadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"morpho\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"lnJumpFactor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"speedFactor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"targetUtilization\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"initialRate\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"INITIAL_RATE\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LN_JUMP_FACTOR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_RATE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MORPHO\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SPEED_FACTOR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TARGET_UTILIZATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"borrowableToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"collateralToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"irm\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"lltv\",\"type\":\"uint256\"}],\"internalType\":\"struct MarketParams\",\"name\":\"marketParams\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint128\",\"name\":\"totalSupplyAssets\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"totalSupplyShares\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"totalBorrowAssets\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"totalBorrowShares\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"lastUpdate\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"fee\",\"type\":\"uint128\"}],\"internalType\":\"struct Market\",\"name\":\"market\",\"type\":\"tuple\"}],\"name\":\"borrowRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"borrowableToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"collateralToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"irm\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"lltv\",\"type\":\"uint256\"}],\"internalType\":\"struct MarketParams\",\"name\":\"marketParams\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint128\",\"name\":\"totalSupplyAssets\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"totalSupplyShares\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"totalBorrowAssets\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"totalBorrowShares\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"lastUpdate\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"fee\",\"type\":\"uint128\"}],\"internalType\":\"struct Market\",\"name\":\"market\",\"type\":\"tuple\"}],\"name\":\"borrowRateView\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"Id\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"marketIrm\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"prevBorrowRate\",\"type\":\"uint128\"},{\"internalType\":\"int128\",\"name\":\"prevErr\",\"type\":\"int128\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Morpho Labs\",\"kind\":\"dev\",\"methods\":{\"borrowRate((address,address,address,address,uint256),(uint128,uint128,uint128,uint128,uint128,uint128))\":{\"params\":{\"market\":\"The Market struct of the market.\",\"marketParams\":\"The MarketParams struct of the market.\"}},\"borrowRateView((address,address,address,address,uint256),(uint128,uint128,uint128,uint128,uint128,uint128))\":{\"params\":{\"market\":\"The Market struct of the market.\",\"marketParams\":\"The MarketParams struct of the market.\"}},\"constructor\":{\"params\":{\"initialRate\":\"The initial rate (scaled by WAD).\",\"lnJumpFactor\":\"The log of the jump factor (scaled by WAD).\",\"morpho\":\"The address of Morpho.\",\"speedFactor\":\"The speed factor (scaled by WAD).\",\"targetUtilization\":\"The target utilization (scaled by WAD). Should be between 0 and 1.\"}}},\"title\":\"Irm\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"INITIAL_RATE()\":{\"notice\":\"Initial rate (scaled by WAD).\"},\"LN_JUMP_FACTOR()\":{\"notice\":\"Ln of the jump factor (scaled by WAD).\"},\"MAX_RATE()\":{\"notice\":\"Max rate (1B% APR).\"},\"MORPHO()\":{\"notice\":\"Address of Morpho.\"},\"SPEED_FACTOR()\":{\"notice\":\"Speed factor (scaled by WAD).\"},\"TARGET_UTILIZATION()\":{\"notice\":\"Target utilization (scaled by WAD).\"},\"borrowRate((address,address,address,address,uint256),(uint128,uint128,uint128,uint128,uint128,uint128))\":{\"notice\":\"Returns the borrow rate of the market `marketParams`.\"},\"borrowRateView((address,address,address,address,uint256),(uint128,uint128,uint128,uint128,uint128,uint128))\":{\"notice\":\"Returns the borrow rate of the market `marketParams` without modifying any storage.\"},\"constructor\":{\"notice\":\"Constructor.\"},\"marketIrm(bytes32)\":{\"notice\":\"IRM storage for each market.\"}},\"notice\":\"Interest rate model.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/Irm.sol\":\"Irm\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/morpho-blue/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":morpho-blue/=lib/morpho-blue/src/\",\":openzeppelin-contracts/=lib/morpho-blue/lib/openzeppelin-contracts/\",\":openzeppelin/=lib/morpho-blue/lib/openzeppelin-contracts/contracts/\",\":solmate/=lib/solmate/src/\"],\"viaIR\":true},\"sources\":{\"lib/morpho-blue/src/interfaces/IIrm.sol\":{\"keccak256\":\"0xddaeaeea11e94d7c93b8d09f7daa3d63bf81bdae0275706e2ab17772985aef49\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://94aff1d90af4e24400261371b37eb13c45998307e9b3dc92542abfa68331626f\",\"dweb:/ipfs/QmXms3rqe7sQBExbYgA7e75AxUUnEn37E8BSTGYtpc8nQc\"]},\"lib/morpho-blue/src/interfaces/IMorpho.sol\":{\"keccak256\":\"0x1f6581a03d25d416df170b83c9d52e7015d503bc9721794482fba57746b53b5e\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://ac308e5e321bfad283b2a3b446a2fcb9e8471f598057854db4d5178edfcf0d06\",\"dweb:/ipfs/QmUHCJZkWsTGb6XAXm9F16DNxLXXEH8M67W44HhAv15GDx\"]},\"lib/morpho-blue/src/libraries/MarketParamsLib.sol\":{\"keccak256\":\"0x816c3f61b2d2f2cf7b3ad071b496318b463f56c9dcd01bdca3727a80ee43662a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://f50a724cc23d540d56cf95fcf673502bd9c1a5d435b89951ab9c286311022a80\",\"dweb:/ipfs/QmcJiLXw7BJGcYzCdpVajhDo6esHvu5fziaXje4ufX3G28\"]},\"lib/morpho-blue/src/libraries/MathLib.sol\":{\"keccak256\":\"0x1f86f8b6eea4487fbbfc206ecbbf904ddfce880f937d621d985e4e9487d8fddb\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://2f0020f26376b9015df50c1fc32ddf0a6a68601945213c34234cae3990ce33f8\",\"dweb:/ipfs/QmZcpP2wPeWmovaUNGvXQL6bkxtPzk5G5o356oNGJAEEZA\"]},\"src/Irm.sol\":{\"keccak256\":\"0x4595ea085d6656a3ece9fc0d02b2bb1943e3758a340e9b78a0c1c71c31f6540a\",\"license\":\"UNLICENSED\",\"urls\":[\"bzz-raw://0867554e6f5dcec611f5b02a3699820f8bd48da4b8015a09b2cf1ad8e946cb55\",\"dweb:/ipfs/QmeYwEf1yaApRt8saK747k5uhSJVHX8CuGi8dYaKccDDp1\"]},\"src/libraries/ErrorsLib.sol\":{\"keccak256\":\"0xf4bb4a4d2ff243dfa8be6eadca5a3187477e2b1a9313c1397eaca0b8f3b939a8\",\"license\":\"UNLICENSED\",\"urls\":[\"bzz-raw://1304aed6e3326c28645b77406bf41798cceeefe4020ca01edd2e9fa5b7d43635\",\"dweb:/ipfs/QmNNYTFGrVBpa2kUhzTgHDe1Z6NFvSf6RFGJzbZpWBTtU4\"]},\"src/libraries/MathLib.sol\":{\"keccak256\":\"0xa8f3cd5ec773d83631af2196ec330649bad162b308a8e4e1b2a4763e730c5caa\",\"license\":\"UNLICENSED\",\"urls\":[\"bzz-raw://fcd781441f67602628b8cf483d4677998e28d30f767f1d42755ce10904ba5b89\",\"dweb:/ipfs/QmT1pY5wgY3fPAiFxuqNV5ToXn76fcWX6oTmn5qwcnVW5s\"]},\"src/libraries/UtilsLib.sol\":{\"keccak256\":\"0xbd8e652bd8364bd52b779bb46dfa65d48d9ec21bc84f775f1dc678aaf418ae65\",\"license\":\"UNLICENCED\",\"urls\":[\"bzz-raw://019d739f7445cfaea289a573b64fc36e90fbc22367671561c2a765e71ba51116\",\"dweb:/ipfs/Qmdk7dAyndz4PfjoxSzyWgkeoK1BWkbLMnM63ttopdtMiG\"]}},\"version\":1}",
"metadata": {
"compiler": {
"version": "0.8.19+commit.7dd6d404"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "morpho",
"type": "address"
},
{
"internalType": "uint256",
"name": "lnJumpFactor",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "speedFactor",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "targetUtilization",
"type": "uint256"
},
{
"internalType": "uint128",
"name": "initialRate",
"type": "uint128"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "INITIAL_RATE",
"outputs": [
{
"internalType": "uint128",
"name": "",
"type": "uint128"
}
]
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "LN_JUMP_FACTOR",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "MAX_RATE",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "MORPHO",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
]
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "SPEED_FACTOR",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [],
"stateMutability": "view",
"type": "function",
"name": "TARGET_UTILIZATION",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [
{
"internalType": "struct MarketParams",
"name": "marketParams",
"type": "tuple",
"components": [
{
"internalType": "address",
"name": "borrowableToken",
"type": "address"
},
{
"internalType": "address",
"name": "collateralToken",
"type": "address"
},
{
"internalType": "address",
"name": "oracle",
"type": "address"
},
{
"internalType": "address",
"name": "irm",
"type": "address"
},
{
"internalType": "uint256",
"name": "lltv",
"type": "uint256"
}
]
},
{
"internalType": "struct Market",
"name": "market",
"type": "tuple",
"components": [
{
"internalType": "uint128",
"name": "totalSupplyAssets",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "totalSupplyShares",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "totalBorrowAssets",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "totalBorrowShares",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "lastUpdate",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "fee",
"type": "uint128"
}
]
}
],
"stateMutability": "nonpayable",
"type": "function",
"name": "borrowRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [
{
"internalType": "struct MarketParams",
"name": "marketParams",
"type": "tuple",
"components": [
{
"internalType": "address",
"name": "borrowableToken",
"type": "address"
},
{
"internalType": "address",
"name": "collateralToken",
"type": "address"
},
{
"internalType": "address",
"name": "oracle",
"type": "address"
},
{
"internalType": "address",
"name": "irm",
"type": "address"
},
{
"internalType": "uint256",
"name": "lltv",
"type": "uint256"
}
]
},
{
"internalType": "struct Market",
"name": "market",
"type": "tuple",
"components": [
{
"internalType": "uint128",
"name": "totalSupplyAssets",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "totalSupplyShares",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "totalBorrowAssets",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "totalBorrowShares",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "lastUpdate",
"type": "uint128"
},
{
"internalType": "uint128",
"name": "fee",
"type": "uint128"
}
]
}
],
"stateMutability": "view",
"type": "function",
"name": "borrowRateView",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
},
{
"inputs": [
{
"internalType": "Id",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function",
"name": "marketIrm",
"outputs": [
{
"internalType": "uint128",
"name": "prevBorrowRate",
"type": "uint128"
},
{
"internalType": "int128",
"name": "prevErr",
"type": "int128"
}
]
}
],
"devdoc": {
"kind": "dev",
"methods": {
"borrowRate((address,address,address,address,uint256),(uint128,uint128,uint128,uint128,uint128,uint128))": {
"params": {
"market": "The Market struct of the market.",
"marketParams": "The MarketParams struct of the market."
}
},
"borrowRateView((address,address,address,address,uint256),(uint128,uint128,uint128,uint128,uint128,uint128))": {
"params": {
"market": "The Market struct of the market.",
"marketParams": "The MarketParams struct of the market."
}
},
"constructor": {
"params": {
"initialRate": "The initial rate (scaled by WAD).",
"lnJumpFactor": "The log of the jump factor (scaled by WAD).",
"morpho": "The address of Morpho.",
"speedFactor": "The speed factor (scaled by WAD).",
"targetUtilization": "The target utilization (scaled by WAD). Should be between 0 and 1."
}
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"INITIAL_RATE()": {
"notice": "Initial rate (scaled by WAD)."
},
"LN_JUMP_FACTOR()": {
"notice": "Ln of the jump factor (scaled by WAD)."
},
"MAX_RATE()": {
"notice": "Max rate (1B% APR)."
},
"MORPHO()": {
"notice": "Address of Morpho."
},
"SPEED_FACTOR()": {
"notice": "Speed factor (scaled by WAD)."
},
"TARGET_UTILIZATION()": {
"notice": "Target utilization (scaled by WAD)."
},
"borrowRate((address,address,address,address,uint256),(uint128,uint128,uint128,uint128,uint128,uint128))": {
"notice": "Returns the borrow rate of the market `marketParams`."
},
"borrowRateView((address,address,address,address,uint256),(uint128,uint128,uint128,uint128,uint128,uint128))": {
"notice": "Returns the borrow rate of the market `marketParams` without modifying any storage."
},
"constructor": {
"notice": "Constructor."
},
"marketIrm(bytes32)": {
"notice": "IRM storage for each market."
}
},
"version": 1
}
},
"settings": {
"remappings": [
"ds-test/=lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/morpho-blue/lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"morpho-blue/=lib/morpho-blue/src/",
"openzeppelin-contracts/=lib/morpho-blue/lib/openzeppelin-contracts/",
"openzeppelin/=lib/morpho-blue/lib/openzeppelin-contracts/contracts/",
"solmate/=lib/solmate/src/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"bytecodeHash": "ipfs"
},
"compilationTarget": {
"src/Irm.sol": "Irm"
},
"libraries": {},
"viaIR": true
},
"sources": {
"lib/morpho-blue/src/interfaces/IIrm.sol": {
"keccak256": "0xddaeaeea11e94d7c93b8d09f7daa3d63bf81bdae0275706e2ab17772985aef49",
"urls": [
"bzz-raw://94aff1d90af4e24400261371b37eb13c45998307e9b3dc92542abfa68331626f",
"dweb:/ipfs/QmXms3rqe7sQBExbYgA7e75AxUUnEn37E8BSTGYtpc8nQc"
],
"license": "GPL-2.0-or-later"
},
"lib/morpho-blue/src/interfaces/IMorpho.sol": {
"keccak256": "0x1f6581a03d25d416df170b83c9d52e7015d503bc9721794482fba57746b53b5e",
"urls": [
"bzz-raw://ac308e5e321bfad283b2a3b446a2fcb9e8471f598057854db4d5178edfcf0d06",
"dweb:/ipfs/QmUHCJZkWsTGb6XAXm9F16DNxLXXEH8M67W44HhAv15GDx"
],
"license": "GPL-2.0-or-later"
},
"lib/morpho-blue/src/libraries/MarketParamsLib.sol": {
"keccak256": "0x816c3f61b2d2f2cf7b3ad071b496318b463f56c9dcd01bdca3727a80ee43662a",
"urls": [
"bzz-raw://f50a724cc23d540d56cf95fcf673502bd9c1a5d435b89951ab9c286311022a80",
"dweb:/ipfs/QmcJiLXw7BJGcYzCdpVajhDo6esHvu5fziaXje4ufX3G28"
],
"license": "GPL-2.0-or-later"
},
"lib/morpho-blue/src/libraries/MathLib.sol": {
"keccak256": "0x1f86f8b6eea4487fbbfc206ecbbf904ddfce880f937d621d985e4e9487d8fddb",
"urls": [
"bzz-raw://2f0020f26376b9015df50c1fc32ddf0a6a68601945213c34234cae3990ce33f8",
"dweb:/ipfs/QmZcpP2wPeWmovaUNGvXQL6bkxtPzk5G5o356oNGJAEEZA"
],
"license": "GPL-2.0-or-later"
},
"src/Irm.sol": {
"keccak256": "0x4595ea085d6656a3ece9fc0d02b2bb1943e3758a340e9b78a0c1c71c31f6540a",
"urls": [
"bzz-raw://0867554e6f5dcec611f5b02a3699820f8bd48da4b8015a09b2cf1ad8e946cb55",
"dweb:/ipfs/QmeYwEf1yaApRt8saK747k5uhSJVHX8CuGi8dYaKccDDp1"
],
"license": "UNLICENSED"
},
"src/libraries/ErrorsLib.sol": {
"keccak256": "0xf4bb4a4d2ff243dfa8be6eadca5a3187477e2b1a9313c1397eaca0b8f3b939a8",
"urls": [
"bzz-raw://1304aed6e3326c28645b77406bf41798cceeefe4020ca01edd2e9fa5b7d43635",
"dweb:/ipfs/QmNNYTFGrVBpa2kUhzTgHDe1Z6NFvSf6RFGJzbZpWBTtU4"
],
"license": "UNLICENSED"
},
"src/libraries/MathLib.sol": {
"keccak256": "0xa8f3cd5ec773d83631af2196ec330649bad162b308a8e4e1b2a4763e730c5caa",
"urls": [
"bzz-raw://fcd781441f67602628b8cf483d4677998e28d30f767f1d42755ce10904ba5b89",
"dweb:/ipfs/QmT1pY5wgY3fPAiFxuqNV5ToXn76fcWX6oTmn5qwcnVW5s"
],
"license": "UNLICENSED"
},
"src/libraries/UtilsLib.sol": {
"keccak256": "0xbd8e652bd8364bd52b779bb46dfa65d48d9ec21bc84f775f1dc678aaf418ae65",
"urls": [
"bzz-raw://019d739f7445cfaea289a573b64fc36e90fbc22367671561c2a765e71ba51116",
"dweb:/ipfs/Qmdk7dAyndz4PfjoxSzyWgkeoK1BWkbLMnM63ttopdtMiG"
],
"license": "UNLICENCED"
}
},
"version": 1
},
"ast": {
"absolutePath": "src/Irm.sol",
"id": 44363,
"exportedSymbols": {
"ErrorsLib": [
44380
],
"IIrm": [
42883
],
"Id": [
42887
],
"Irm": [
44362
],
"Market": [
42918
],
"MarketIrm": [
43956
],
"MarketParams": [
42898
],
"MarketParamsLib": [
43259
],
"MathLib": [
44545
],
"MorphoMathLib": [
43405
],
"UtilsLib": [
44562
],
"WAD": [
43264
],
"WAD_INT": [
44393
]
},
"nodeType": "SourceUnit",
"src": "39:6155:24",
"nodes": [
{
"id": 43933,
"nodeType": "PragmaDirective",
"src": "39:23:24",
"nodes": [],
"literals": [
"solidity",
"0.8",
".19"
]
},
{
"id": 43935,
"nodeType": "ImportDirective",
"src": "64:50:24",
"nodes": [],
"absolutePath": "src/libraries/UtilsLib.sol",
"file": "./libraries/UtilsLib.sol",
"nameLocation": "-1:-1:-1",
"scope": 44363,
"sourceUnit": 44563,
"symbolAliases": [
{
"foreign": {
"id": 43934,
"name": "UtilsLib",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44562,
"src": "72:8:24",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"id": 43937,
"nodeType": "ImportDirective",
"src": "115:52:24",
"nodes": [],
"absolutePath": "src/libraries/ErrorsLib.sol",
"file": "./libraries/ErrorsLib.sol",
"nameLocation": "-1:-1:-1",
"scope": 44363,
"sourceUnit": 44381,
"symbolAliases": [
{
"foreign": {
"id": 43936,
"name": "ErrorsLib",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44380,
"src": "123:9:24",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"id": 43939,
"nodeType": "ImportDirective",
"src": "168:53:24",
"nodes": [],
"absolutePath": "lib/morpho-blue/src/interfaces/IIrm.sol",
"file": "morpho-blue/interfaces/IIrm.sol",
"nameLocation": "-1:-1:-1",
"scope": 44363,
"sourceUnit": 42884,
"symbolAliases": [
{
"foreign": {
"id": 43938,
"name": "IIrm",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 42883,
"src": "176:4:24",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"id": 43942,
"nodeType": "ImportDirective",
"src": "222:80:24",
"nodes": [],
"absolutePath": "lib/morpho-blue/src/libraries/MathLib.sol",
"file": "morpho-blue/libraries/MathLib.sol",
"nameLocation": "-1:-1:-1",
"scope": 44363,
"sourceUnit": 43406,
"symbolAliases": [
{
"foreign": {
"id": 43940,
"name": "WAD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43264,
"src": "230:3:24",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
},
{
"foreign": {
"id": 43941,
"name": "MathLib",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43405,
"src": "235:7:24",
"typeDescriptions": {}
},
"local": "MorphoMathLib",
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"id": 43945,
"nodeType": "ImportDirective",
"src": "303:57:24",
"nodes": [],
"absolutePath": "src/libraries/MathLib.sol",
"file": "./libraries/MathLib.sol",
"nameLocation": "-1:-1:-1",
"scope": 44363,
"sourceUnit": 44546,
"symbolAliases": [
{
"foreign": {
"id": 43943,
"name": "WAD_INT",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44393,
"src": "311:7:24",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
},
{
"foreign": {
"id": 43944,
"name": "MathLib",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44545,
"src": "320:7:24",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"id": 43947,
"nodeType": "ImportDirective",
"src": "361:74:24",
"nodes": [],
"absolutePath": "lib/morpho-blue/src/libraries/MarketParamsLib.sol",
"file": "morpho-blue/libraries/MarketParamsLib.sol",
"nameLocation": "-1:-1:-1",
"scope": 44363,
"sourceUnit": 43260,
"symbolAliases": [
{
"foreign": {
"id": 43946,
"name": "MarketParamsLib",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43259,
"src": "369:15:24",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"id": 43951,
"nodeType": "ImportDirective",
"src": "436:76:24",
"nodes": [],
"absolutePath": "lib/morpho-blue/src/interfaces/IMorpho.sol",
"file": "morpho-blue/interfaces/IMorpho.sol",
"nameLocation": "-1:-1:-1",
"scope": 44363,
"sourceUnit": 43241,
"symbolAliases": [
{
"foreign": {
"id": 43948,
"name": "Id",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 42887,
"src": "444:2:24",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
},
{
"foreign": {
"id": 43949,
"name": "MarketParams",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 42898,
"src": "448:12:24",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
},
{
"foreign": {
"id": 43950,
"name": "Market",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 42918,
"src": "462:6:24",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"id": 43956,
"nodeType": "StructDefinition",
"src": "514:156:24",
"nodes": [],
"canonicalName": "MarketIrm",
"members": [
{
"constant": false,
"id": 43953,
"mutability": "mutable",
"name": "prevBorrowRate",
"nameLocation": "595:14:24",
"nodeType": "VariableDeclaration",
"scope": 43956,
"src": "587:22:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 43952,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "587:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 43955,
"mutability": "mutable",
"name": "prevErr",
"nameLocation": "660:7:24",
"nodeType": "VariableDeclaration",
"scope": 43956,
"src": "653:14:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
},
"typeName": {
"id": 43954,
"name": "int128",
"nodeType": "ElementaryTypeName",
"src": "653:6:24",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"visibility": "internal"
}
],
"name": "MarketIrm",
"nameLocation": "521:9:24",
"scope": 44363,
"visibility": "public"
},
{
"id": 44362,
"nodeType": "ContractDefinition",
"src": "744:5449:24",
"nodes": [
{
"id": 43962,
"nodeType": "UsingForDirective",
"src": "771:25:24",
"nodes": [],
"global": false,
"libraryName": {
"id": 43960,
"name": "MathLib",
"nameLocations": [
"777:7:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 44545,
"src": "777:7:24"
},
"typeName": {
"id": 43961,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "789:6:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
},
{
"id": 43965,
"nodeType": "UsingForDirective",
"src": "801:26:24",
"nodes": [],
"global": false,
"libraryName": {
"id": 43963,
"name": "MathLib",
"nameLocations": [
"807:7:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 44545,
"src": "807:7:24"
},
"typeName": {
"id": 43964,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "819:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"id": 43968,
"nodeType": "UsingForDirective",
"src": "832:27:24",
"nodes": [],
"global": false,
"libraryName": {
"id": 43966,
"name": "UtilsLib",
"nameLocations": [
"838:8:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 44562,
"src": "838:8:24"
},
"typeName": {
"id": 43967,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "851:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"id": 43971,
"nodeType": "UsingForDirective",
"src": "864:32:24",
"nodes": [],
"global": false,
"libraryName": {
"id": 43969,
"name": "MorphoMathLib",
"nameLocations": [
"870:13:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 43405,
"src": "870:13:24"
},
"typeName": {
"id": 43970,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "888:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
}
},
{
"id": 43974,
"nodeType": "UsingForDirective",
"src": "901:32:24",
"nodes": [],
"global": false,
"libraryName": {
"id": 43972,
"name": "MorphoMathLib",
"nameLocations": [
"907:13:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 43405,
"src": "907:13:24"
},
"typeName": {
"id": 43973,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "925:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"id": 43978,
"nodeType": "UsingForDirective",
"src": "938:39:24",
"nodes": [],
"global": false,
"libraryName": {
"id": 43975,
"name": "MarketParamsLib",
"nameLocations": [
"944:15:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 43259,
"src": "944:15:24"
},
"typeName": {
"id": 43977,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 43976,
"name": "MarketParams",
"nameLocations": [
"964:12:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 42898,
"src": "964:12:24"
},
"referencedDeclaration": 42898,
"src": "964:12:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MarketParams_$42898_storage_ptr",
"typeString": "struct MarketParams"
}
}
},
{
"id": 43987,
"nodeType": "VariableDeclaration",
"src": "1040:64:24",
"nodes": [],
"constant": true,
"documentation": {
"id": 43979,
"nodeType": "StructuredDocumentation",
"src": "1004:31:24",
"text": "@notice Max rate (1B% APR)."
},
"functionSelector": "c24dbebd",
"mutability": "constant",
"name": "MAX_RATE",
"nameLocation": "1064:8:24",
"scope": 44362,
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 43980,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1040:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 43986,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"hexValue": "316539",
"id": 43983,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1083:9:24",
"subdenomination": "ether",
"typeDescriptions": {
"typeIdentifier": "t_rational_1000000000000000000000000000_by_1",
"typeString": "int_const 1000000000000000000000000000"
},
"value": "1e9"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_1000000000000000000000000000_by_1",
"typeString": "int_const 1000000000000000000000000000"
}
],
"id": 43982,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1075:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 43981,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1075:7:24",
"typeDescriptions": {}
}
},
"id": 43984,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1075:18:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"hexValue": "333635",
"id": 43985,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1096:8:24",
"subdenomination": "days",
"typeDescriptions": {
"typeIdentifier": "t_rational_31536000_by_1",
"typeString": "int_const 31536000"
},
"value": "365"
},
"src": "1075:29:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "public"
},
{
"id": 43990,
"nodeType": "VariableDeclaration",
"src": "1145:31:24",
"nodes": [],
"constant": false,
"documentation": {
"id": 43988,
"nodeType": "StructuredDocumentation",
"src": "1110:30:24",
"text": "@notice Address of Morpho."
},
"functionSelector": "3acb5624",
"mutability": "immutable",
"name": "MORPHO",
"nameLocation": "1170:6:24",
"scope": 44362,
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 43989,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1145:7:24",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "public"
},
{
"id": 43993,
"nodeType": "VariableDeclaration",
"src": "1237:39:24",
"nodes": [],
"constant": false,
"documentation": {
"id": 43991,
"nodeType": "StructuredDocumentation",
"src": "1182:50:24",
"text": "@notice Ln of the jump factor (scaled by WAD)."
},
"functionSelector": "1d1d9bb7",
"mutability": "immutable",
"name": "LN_JUMP_FACTOR",
"nameLocation": "1262:14:24",
"scope": 44362,
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 43992,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1237:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "public"
},
{
"id": 43996,
"nodeType": "VariableDeclaration",
"src": "1328:37:24",
"nodes": [],
"constant": false,
"documentation": {
"id": 43994,
"nodeType": "StructuredDocumentation",
"src": "1282:41:24",
"text": "@notice Speed factor (scaled by WAD)."
},
"functionSelector": "811f88bd",
"mutability": "immutable",
"name": "SPEED_FACTOR",
"nameLocation": "1353:12:24",
"scope": 44362,
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 43995,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1328:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "public"
},
{
"id": 43999,
"nodeType": "VariableDeclaration",
"src": "1423:43:24",
"nodes": [],
"constant": false,
"documentation": {
"id": 43997,
"nodeType": "StructuredDocumentation",
"src": "1371:47:24",
"text": "@notice Target utilization (scaled by WAD)."
},
"functionSelector": "9a1a14d9",
"mutability": "immutable",
"name": "TARGET_UTILIZATION",
"nameLocation": "1448:18:24",
"scope": 44362,
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 43998,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1423:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "public"
},
{
"id": 44002,
"nodeType": "VariableDeclaration",
"src": "1518:37:24",
"nodes": [],
"constant": false,
"documentation": {
"id": 44000,
"nodeType": "StructuredDocumentation",
"src": "1472:41:24",
"text": "@notice Initial rate (scaled by WAD)."
},
"functionSelector": "4dbac733",
"mutability": "immutable",
"name": "INITIAL_RATE",
"nameLocation": "1543:12:24",
"scope": 44362,
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 44001,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "1518:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"visibility": "public"
},
{
"id": 44009,
"nodeType": "VariableDeclaration",
"src": "1626:41:24",
"nodes": [],
"constant": false,
"documentation": {
"id": 44003,
"nodeType": "StructuredDocumentation",
"src": "1581:40:24",
"text": "@notice IRM storage for each market."
},
"functionSelector": "362c1f90",
"mutability": "mutable",
"name": "marketIrm",
"nameLocation": "1658:9:24",
"scope": 44362,
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_userDefinedValueType$_Id_$42887_$_t_struct$_MarketIrm_$43956_storage_$",
"typeString": "mapping(Id => struct MarketIrm)"
},
"typeName": {
"id": 44008,
"keyName": "",
"keyNameLocation": "-1:-1:-1",
"keyType": {
"id": 44005,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 44004,
"name": "Id",
"nameLocations": [
"1634:2:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 42887,
"src": "1634:2:24"
},
"referencedDeclaration": 42887,
"src": "1634:2:24",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
}
},
"nodeType": "Mapping",
"src": "1626:24:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_userDefinedValueType$_Id_$42887_$_t_struct$_MarketIrm_$43956_storage_$",
"typeString": "mapping(Id => struct MarketIrm)"
},
"valueName": "",
"valueNameLocation": "-1:-1:-1",
"valueType": {
"id": 44007,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 44006,
"name": "MarketIrm",
"nameLocations": [
"1640:9:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 43956,
"src": "1640:9:24"
},
"referencedDeclaration": 43956,
"src": "1640:9:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MarketIrm_$43956_storage_ptr",
"typeString": "struct MarketIrm"
}
}
},
"visibility": "public"
},
{
"id": 44082,
"nodeType": "FunctionDefinition",
"src": "2065:600:24",
"nodes": [],
"body": {
"id": 44081,
"nodeType": "Block",
"src": "2230:435:24",
"nodes": [],
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 44033,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 44024,
"name": "lnJumpFactor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44014,
"src": "2248:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"arguments": [
{
"expression": {
"arguments": [
{
"id": 44029,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2277:6:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 44028,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "2277:6:24",
"typeDescriptions": {}
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
}
],
"id": 44027,
"name": "type",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -27,
"src": "2272:4:24",
"typeDescriptions": {
"typeIdentifier": "t_function_metatype_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 44030,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2272:12:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_magic_meta_type_t_int256",
"typeString": "type(int256)"
}
},
"id": 44031,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "2285:3:24",
"memberName": "max",
"nodeType": "MemberAccess",
"src": "2272:16:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"id": 44026,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2264:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 44025,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2264:7:24",
"typeDescriptions": {}
}
},
"id": 44032,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2264:25:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2248:41:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"expression": {
"id": 44034,
"name": "ErrorsLib",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44380,
"src": "2291:9:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ErrorsLib_$44380_$",
"typeString": "type(library ErrorsLib)"
}
},
"id": 44035,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "2301:15:24",
"memberName": "INPUT_TOO_LARGE",
"nodeType": "MemberAccess",
"referencedDeclaration": 44370,
"src": "2291:25:24",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 44023,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "2240:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 44036,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2240:77:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 44037,
"nodeType": "ExpressionStatement",
"src": "2240:77:24"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 44048,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 44039,
"name": "speedFactor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44016,
"src": "2335:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"arguments": [
{
"expression": {
"arguments": [
{
"id": 44044,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2363:6:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 44043,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "2363:6:24",
"typeDescriptions": {}
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
}
],
"id": 44042,
"name": "type",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -27,
"src": "2358:4:24",
"typeDescriptions": {
"typeIdentifier": "t_function_metatype_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 44045,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2358:12:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_magic_meta_type_t_int256",
"typeString": "type(int256)"
}
},
"id": 44046,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "2371:3:24",
"memberName": "max",
"nodeType": "MemberAccess",
"src": "2358:16:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"id": 44041,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2350:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 44040,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2350:7:24",
"typeDescriptions": {}
}
},
"id": 44047,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2350:25:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2335:40:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"expression": {
"id": 44049,
"name": "ErrorsLib",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44380,
"src": "2377:9:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ErrorsLib_$44380_$",
"typeString": "type(library ErrorsLib)"
}
},
"id": 44050,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "2387:15:24",
"memberName": "INPUT_TOO_LARGE",
"nodeType": "MemberAccess",
"referencedDeclaration": 44370,
"src": "2377:25:24",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 44038,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "2327:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 44051,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2327:76:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 44052,
"nodeType": "ExpressionStatement",
"src": "2327:76:24"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 44056,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 44054,
"name": "targetUtilization",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44018,
"src": "2421:17:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"id": 44055,
"name": "WAD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43264,
"src": "2442:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2421:24:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"expression": {
"id": 44057,
"name": "ErrorsLib",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44380,
"src": "2447:9:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ErrorsLib_$44380_$",
"typeString": "type(library ErrorsLib)"
}
},
"id": 44058,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "2457:15:24",
"memberName": "INPUT_TOO_LARGE",
"nodeType": "MemberAccess",
"referencedDeclaration": 44370,
"src": "2447:25:24",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 44053,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "2413:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 44059,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2413:60:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 44060,
"nodeType": "ExpressionStatement",
"src": "2413:60:24"
},
{
"expression": {
"id": 44063,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 44061,
"name": "MORPHO",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43990,
"src": "2484:6:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 44062,
"name": "morpho",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44012,
"src": "2493:6:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2484:15:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 44064,
"nodeType": "ExpressionStatement",
"src": "2484:15:24"
},
{
"expression": {
"id": 44067,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 44065,
"name": "LN_JUMP_FACTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43993,
"src": "2509:14:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 44066,
"name": "lnJumpFactor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44014,
"src": "2526:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2509:29:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 44068,
"nodeType": "ExpressionStatement",
"src": "2509:29:24"
},
{
"expression": {
"id": 44071,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 44069,
"name": "SPEED_FACTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43996,
"src": "2548:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 44070,
"name": "speedFactor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44016,
"src": "2563:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2548:26:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 44072,
"nodeType": "ExpressionStatement",
"src": "2548:26:24"
},
{
"expression": {
"id": 44075,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 44073,
"name": "TARGET_UTILIZATION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43999,
"src": "2584:18:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 44074,
"name": "targetUtilization",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44018,
"src": "2605:17:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2584:38:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 44076,
"nodeType": "ExpressionStatement",
"src": "2584:38:24"
},
{
"expression": {
"id": 44079,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 44077,
"name": "INITIAL_RATE",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44002,
"src": "2632:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 44078,
"name": "initialRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44020,
"src": "2647:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"src": "2632:26:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"id": 44080,
"nodeType": "ExpressionStatement",
"src": "2632:26:24"
}
]
},
"documentation": {
"id": 44010,
"nodeType": "StructuredDocumentation",
"src": "1697:363:24",
"text": "@notice Constructor.\n @param morpho The address of Morpho.\n @param lnJumpFactor The log of the jump factor (scaled by WAD).\n @param speedFactor The speed factor (scaled by WAD).\n @param targetUtilization The target utilization (scaled by WAD). Should be between 0 and 1.\n @param initialRate The initial rate (scaled by WAD)."
},
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nameLocation": "-1:-1:-1",
"parameters": {
"id": 44021,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 44012,
"mutability": "mutable",
"name": "morpho",
"nameLocation": "2094:6:24",
"nodeType": "VariableDeclaration",
"scope": 44082,
"src": "2086:14:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 44011,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2086:7:24",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 44014,
"mutability": "mutable",
"name": "lnJumpFactor",
"nameLocation": "2118:12:24",
"nodeType": "VariableDeclaration",
"scope": 44082,
"src": "2110:20:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44013,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2110:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 44016,
"mutability": "mutable",
"name": "speedFactor",
"nameLocation": "2148:11:24",
"nodeType": "VariableDeclaration",
"scope": 44082,
"src": "2140:19:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44015,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2140:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 44018,
"mutability": "mutable",
"name": "targetUtilization",
"nameLocation": "2177:17:24",
"nodeType": "VariableDeclaration",
"scope": 44082,
"src": "2169:25:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44017,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2169:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 44020,
"mutability": "mutable",
"name": "initialRate",
"nameLocation": "2212:11:24",
"nodeType": "VariableDeclaration",
"scope": 44082,
"src": "2204:19:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 44019,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "2204:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"visibility": "internal"
}
],
"src": "2076:153:24"
},
"returnParameters": {
"id": 44022,
"nodeType": "ParameterList",
"parameters": [],
"src": "2230:0:24"
},
"scope": 44362,
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"id": 44106,
"nodeType": "FunctionDefinition",
"src": "2720:224:24",
"nodes": [],
"body": {
"id": 44105,
"nodeType": "Block",
"src": "2830:114:24",
"nodes": [],
"statements": [
{
"assignments": [
null,
null,
44095
],
"declarations": [
null,
null,
{
"constant": false,
"id": 44095,
"mutability": "mutable",
"name": "avgBorrowRate",
"nameLocation": "2852:13:24",
"nodeType": "VariableDeclaration",
"scope": 44105,
"src": "2844:21:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44094,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2844:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 44102,
"initialValue": {
"arguments": [
{
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"id": 44097,
"name": "marketParams",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44086,
"src": "2881:12:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MarketParams_$42898_memory_ptr",
"typeString": "struct MarketParams memory"
}
},
"id": 44098,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberLocation": "2894:2:24",
"memberName": "id",
"nodeType": "MemberAccess",
"referencedDeclaration": 43258,
"src": "2881:15:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_struct$_MarketParams_$42898_memory_ptr_$returns$_t_userDefinedValueType$_Id_$42887_$attached_to$_t_struct$_MarketParams_$42898_memory_ptr_$",
"typeString": "function (struct MarketParams memory) pure returns (Id)"
}
},
"id": 44099,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2881:17:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
}
},
{
"id": 44100,
"name": "market",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44089,
"src": "2900:6:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Market_$42918_memory_ptr",
"typeString": "struct Market memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
},
{
"typeIdentifier": "t_struct$_Market_$42918_memory_ptr",
"typeString": "struct Market memory"
}
],
"id": 44096,
"name": "_borrowRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44361,
"src": "2869:11:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_userDefinedValueType$_Id_$42887_$_t_struct$_Market_$42918_memory_ptr_$returns$_t_int128_$_t_uint128_$_t_uint128_$",
"typeString": "function (Id,struct Market memory) view returns (int128,uint128,uint128)"
}
},
"id": 44101,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2869:38:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_int128_$_t_uint128_$_t_uint128_$",
"typeString": "tuple(int128,uint128,uint128)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2840:67:24"
},
{
"expression": {
"id": 44103,
"name": "avgBorrowRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44095,
"src": "2924:13:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 44093,
"id": 44104,
"nodeType": "Return",
"src": "2917:20:24"
}
]
},
"baseFunctions": [
42882
],
"documentation": {
"id": 44083,
"nodeType": "StructuredDocumentation",
"src": "2695:20:24",
"text": "@inheritdoc IIrm"
},
"functionSelector": "8c00bf6b",
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "borrowRateView",
"nameLocation": "2729:14:24",
"parameters": {
"id": 44090,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 44086,
"mutability": "mutable",
"name": "marketParams",
"nameLocation": "2764:12:24",
"nodeType": "VariableDeclaration",
"scope": 44106,
"src": "2744:32:24",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MarketParams_$42898_memory_ptr",
"typeString": "struct MarketParams"
},
"typeName": {
"id": 44085,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 44084,
"name": "MarketParams",
"nameLocations": [
"2744:12:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 42898,
"src": "2744:12:24"
},
"referencedDeclaration": 42898,
"src": "2744:12:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MarketParams_$42898_storage_ptr",
"typeString": "struct MarketParams"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 44089,
"mutability": "mutable",
"name": "market",
"nameLocation": "2792:6:24",
"nodeType": "VariableDeclaration",
"scope": 44106,
"src": "2778:20:24",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Market_$42918_memory_ptr",
"typeString": "struct Market"
},
"typeName": {
"id": 44088,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 44087,
"name": "Market",
"nameLocations": [
"2778:6:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 42918,
"src": "2778:6:24"
},
"referencedDeclaration": 42918,
"src": "2778:6:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Market_$42918_storage_ptr",
"typeString": "struct Market"
}
},
"visibility": "internal"
}
],
"src": "2743:56:24"
},
"returnParameters": {
"id": 44093,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 44092,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 44106,
"src": "2821:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44091,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2821:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "2820:9:24"
},
"scope": 44362,
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"id": 44162,
"nodeType": "FunctionDefinition",
"src": "2975:424:24",
"nodes": [],
"body": {
"id": 44161,
"nodeType": "Block",
"src": "3078:321:24",
"nodes": [],
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 44122,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 44119,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "3096:3:24",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 44120,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "3100:6:24",
"memberName": "sender",
"nodeType": "MemberAccess",
"src": "3096:10:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"id": 44121,
"name": "MORPHO",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43990,
"src": "3110:6:24",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "3096:20:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"expression": {
"id": 44123,
"name": "ErrorsLib",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44380,
"src": "3118:9:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ErrorsLib_$44380_$",
"typeString": "type(library ErrorsLib)"
}
},
"id": 44124,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "3128:10:24",
"memberName": "NOT_MORPHO",
"nodeType": "MemberAccess",
"referencedDeclaration": 44379,
"src": "3118:20:24",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 44118,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "3088:7:24",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 44125,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "3088:51:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 44126,
"nodeType": "ExpressionStatement",
"src": "3088:51:24"
},
{
"assignments": [
44129
],
"declarations": [
{
"constant": false,
"id": 44129,
"mutability": "mutable",
"name": "id",
"nameLocation": "3153:2:24",
"nodeType": "VariableDeclaration",
"scope": 44161,
"src": "3150:5:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
},
"typeName": {
"id": 44128,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 44127,
"name": "Id",
"nameLocations": [
"3150:2:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 42887,
"src": "3150:2:24"
},
"referencedDeclaration": 42887,
"src": "3150:2:24",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
}
},
"visibility": "internal"
}
],
"id": 44133,
"initialValue": {
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"id": 44130,
"name": "marketParams",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44110,
"src": "3158:12:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MarketParams_$42898_memory_ptr",
"typeString": "struct MarketParams memory"
}
},
"id": 44131,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberLocation": "3171:2:24",
"memberName": "id",
"nodeType": "MemberAccess",
"referencedDeclaration": 43258,
"src": "3158:15:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_struct$_MarketParams_$42898_memory_ptr_$returns$_t_userDefinedValueType$_Id_$42887_$attached_to$_t_struct$_MarketParams_$42898_memory_ptr_$",
"typeString": "function (struct MarketParams memory) pure returns (Id)"
}
},
"id": 44132,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "3158:17:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3150:25:24"
},
{
"assignments": [
44135,
44137,
44139
],
"declarations": [
{
"constant": false,
"id": 44135,
"mutability": "mutable",
"name": "err",
"nameLocation": "3194:3:24",
"nodeType": "VariableDeclaration",
"scope": 44161,
"src": "3187:10:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
},
"typeName": {
"id": 44134,
"name": "int128",
"nodeType": "ElementaryTypeName",
"src": "3187:6:24",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 44137,
"mutability": "mutable",
"name": "newBorrowRate",
"nameLocation": "3207:13:24",
"nodeType": "VariableDeclaration",
"scope": 44161,
"src": "3199:21:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 44136,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "3199:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 44139,
"mutability": "mutable",
"name": "avgBorrowRate",
"nameLocation": "3230:13:24",
"nodeType": "VariableDeclaration",
"scope": 44161,
"src": "3222:21:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44138,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3222:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 44144,
"initialValue": {
"arguments": [
{
"id": 44141,
"name": "id",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44129,
"src": "3259:2:24",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
}
},
{
"id": 44142,
"name": "market",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44113,
"src": "3263:6:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Market_$42918_memory_ptr",
"typeString": "struct Market memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
},
{
"typeIdentifier": "t_struct$_Market_$42918_memory_ptr",
"typeString": "struct Market memory"
}
],
"id": 44140,
"name": "_borrowRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44361,
"src": "3247:11:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_userDefinedValueType$_Id_$42887_$_t_struct$_Market_$42918_memory_ptr_$returns$_t_int128_$_t_uint128_$_t_uint128_$",
"typeString": "function (Id,struct Market memory) view returns (int128,uint128,uint128)"
}
},
"id": 44143,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "3247:23:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_int128_$_t_uint128_$_t_uint128_$",
"typeString": "tuple(int128,uint128,uint128)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3186:84:24"
},
{
"expression": {
"id": 44150,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"expression": {
"baseExpression": {
"id": 44145,
"name": "marketIrm",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44009,
"src": "3281:9:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_userDefinedValueType$_Id_$42887_$_t_struct$_MarketIrm_$43956_storage_$",
"typeString": "mapping(Id => struct MarketIrm storage ref)"
}
},
"id": 44147,
"indexExpression": {
"id": 44146,
"name": "id",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44129,
"src": "3291:2:24",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3281:13:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MarketIrm_$43956_storage",
"typeString": "struct MarketIrm storage ref"
}
},
"id": 44148,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberLocation": "3295:7:24",
"memberName": "prevErr",
"nodeType": "MemberAccess",
"referencedDeclaration": 43955,
"src": "3281:21:24",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 44149,
"name": "err",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44135,
"src": "3305:3:24",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"src": "3281:27:24",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"id": 44151,
"nodeType": "ExpressionStatement",
"src": "3281:27:24"
},
{
"expression": {
"id": 44157,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"expression": {
"baseExpression": {
"id": 44152,
"name": "marketIrm",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44009,
"src": "3318:9:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_userDefinedValueType$_Id_$42887_$_t_struct$_MarketIrm_$43956_storage_$",
"typeString": "mapping(Id => struct MarketIrm storage ref)"
}
},
"id": 44154,
"indexExpression": {
"id": 44153,
"name": "id",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44129,
"src": "3328:2:24",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "3318:13:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MarketIrm_$43956_storage",
"typeString": "struct MarketIrm storage ref"
}
},
"id": 44155,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberLocation": "3332:14:24",
"memberName": "prevBorrowRate",
"nodeType": "MemberAccess",
"referencedDeclaration": 43953,
"src": "3318:28:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 44156,
"name": "newBorrowRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44137,
"src": "3349:13:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"src": "3318:44:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"id": 44158,
"nodeType": "ExpressionStatement",
"src": "3318:44:24"
},
{
"expression": {
"id": 44159,
"name": "avgBorrowRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44139,
"src": "3379:13:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 44117,
"id": 44160,
"nodeType": "Return",
"src": "3372:20:24"
}
]
},
"baseFunctions": [
42870
],
"documentation": {
"id": 44107,
"nodeType": "StructuredDocumentation",
"src": "2950:20:24",
"text": "@inheritdoc IIrm"
},
"functionSelector": "9451fed4",
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "borrowRate",
"nameLocation": "2984:10:24",
"parameters": {
"id": 44114,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 44110,
"mutability": "mutable",
"name": "marketParams",
"nameLocation": "3015:12:24",
"nodeType": "VariableDeclaration",
"scope": 44162,
"src": "2995:32:24",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MarketParams_$42898_memory_ptr",
"typeString": "struct MarketParams"
},
"typeName": {
"id": 44109,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 44108,
"name": "MarketParams",
"nameLocations": [
"2995:12:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 42898,
"src": "2995:12:24"
},
"referencedDeclaration": 42898,
"src": "2995:12:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MarketParams_$42898_storage_ptr",
"typeString": "struct MarketParams"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 44113,
"mutability": "mutable",
"name": "market",
"nameLocation": "3043:6:24",
"nodeType": "VariableDeclaration",
"scope": 44162,
"src": "3029:20:24",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Market_$42918_memory_ptr",
"typeString": "struct Market"
},
"typeName": {
"id": 44112,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 44111,
"name": "Market",
"nameLocations": [
"3029:6:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 42918,
"src": "3029:6:24"
},
"referencedDeclaration": 42918,
"src": "3029:6:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Market_$42918_storage_ptr",
"typeString": "struct Market"
}
},
"visibility": "internal"
}
],
"src": "2994:56:24"
},
"returnParameters": {
"id": 44117,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 44116,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 44162,
"src": "3069:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44115,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3069:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "3068:9:24"
},
"scope": 44362,
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"id": 44361,
"nodeType": "FunctionDefinition",
"src": "3464:2727:24",
"nodes": [],
"body": {
"id": 44360,
"nodeType": "Block",
"src": "3562:2629:24",
"nodes": [],
"statements": [
{
"assignments": [
44179
],
"declarations": [
{
"constant": false,
"id": 44179,
"mutability": "mutable",
"name": "utilization",
"nameLocation": "3580:11:24",
"nodeType": "VariableDeclaration",
"scope": 44360,
"src": "3572:19:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44178,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3572:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 44192,
"initialValue": {
"condition": {
"commonType": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"id": 44183,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 44180,
"name": "market",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44169,
"src": "3606:6:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Market_$42918_memory_ptr",
"typeString": "struct Market memory"
}
},
"id": 44181,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberLocation": "3613:17:24",
"memberName": "totalSupplyAssets",
"nodeType": "MemberAccess",
"referencedDeclaration": 42907,
"src": "3606:24:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"hexValue": "30",
"id": 44182,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3633:1:24",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "3606:28:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseExpression": {
"hexValue": "30",
"id": 44190,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3699:1:24",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"id": 44191,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "Conditional",
"src": "3606:94:24",
"trueExpression": {
"arguments": [
{
"expression": {
"id": 44187,
"name": "market",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44169,
"src": "3671:6:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Market_$42918_memory_ptr",
"typeString": "struct Market memory"
}
},
"id": 44188,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberLocation": "3678:17:24",
"memberName": "totalSupplyAssets",
"nodeType": "MemberAccess",
"referencedDeclaration": 42907,
"src": "3671:24:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
],
"expression": {
"expression": {
"id": 44184,
"name": "market",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44169,
"src": "3637:6:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Market_$42918_memory_ptr",
"typeString": "struct Market memory"
}
},
"id": 44185,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberLocation": "3644:17:24",
"memberName": "totalBorrowAssets",
"nodeType": "MemberAccess",
"referencedDeclaration": 42911,
"src": "3637:24:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"id": 44186,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "3662:8:24",
"memberName": "wDivDown",
"nodeType": "MemberAccess",
"referencedDeclaration": 43299,
"src": "3637:33:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$attached_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 44189,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "3637:59:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3572:128:24"
},
{
"assignments": [
44194
],
"declarations": [
{
"constant": false,
"id": 44194,
"mutability": "mutable",
"name": "errNormFactor",
"nameLocation": "3719:13:24",
"nodeType": "VariableDeclaration",
"scope": 44360,
"src": "3711:21:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44193,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3711:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 44203,
"initialValue": {
"condition": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 44197,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 44195,
"name": "utilization",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44179,
"src": "3735:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"id": 44196,
"name": "TARGET_UTILIZATION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43999,
"src": "3749:18:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "3735:32:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseExpression": {
"id": 44201,
"name": "TARGET_UTILIZATION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43999,
"src": "3797:18:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 44202,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "Conditional",
"src": "3735:80:24",
"trueExpression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 44200,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 44198,
"name": "WAD",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43264,
"src": "3770:3:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"id": 44199,
"name": "TARGET_UTILIZATION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43999,
"src": "3776:18:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "3770:24:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3711:104:24"
},
{
"assignments": [
44205
],
"declarations": [
{
"constant": false,
"id": 44205,
"mutability": "mutable",
"name": "err",
"nameLocation": "4015:3:24",
"nodeType": "VariableDeclaration",
"scope": 44360,
"src": "4008:10:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
},
"typeName": {
"id": 44204,
"name": "int128",
"nodeType": "ElementaryTypeName",
"src": "4008:6:24",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"visibility": "internal"
}
],
"id": 44225,
"initialValue": {
"arguments": [
{
"arguments": [
{
"arguments": [
{
"id": 44221,
"name": "errNormFactor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44194,
"src": "4095:13:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 44220,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4088:6:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 44219,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "4088:6:24",
"typeDescriptions": {}
}
},
"id": 44222,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "4088:21:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"expression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 44216,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"id": 44210,
"name": "utilization",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44179,
"src": "4036:11:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 44209,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4029:6:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 44208,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "4029:6:24",
"typeDescriptions": {}
}
},
"id": 44211,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "4029:19:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"arguments": [
{
"id": 44214,
"name": "TARGET_UTILIZATION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43999,
"src": "4058:18:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 44213,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4051:6:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 44212,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "4051:6:24",
"typeDescriptions": {}
}
},
"id": 44215,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "4051:26:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"src": "4029:48:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"id": 44217,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "4028:50:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"id": 44218,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "4079:8:24",
"memberName": "wDivDown",
"nodeType": "MemberAccess",
"referencedDeclaration": 44544,
"src": "4028:59:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$attached_to$_t_int256_$",
"typeString": "function (int256,int256) pure returns (int256)"
}
},
"id": 44223,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "4028:82:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"id": 44207,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4021:6:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int128_$",
"typeString": "type(int128)"
},
"typeName": {
"id": 44206,
"name": "int128",
"nodeType": "ElementaryTypeName",
"src": "4021:6:24",
"typeDescriptions": {}
}
},
"id": 44224,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "4021:90:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4008:103:24"
},
{
"condition": {
"commonType": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"id": 44231,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"baseExpression": {
"id": 44226,
"name": "marketIrm",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44009,
"src": "4126:9:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_userDefinedValueType$_Id_$42887_$_t_struct$_MarketIrm_$43956_storage_$",
"typeString": "mapping(Id => struct MarketIrm storage ref)"
}
},
"id": 44228,
"indexExpression": {
"id": 44227,
"name": "id",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44166,
"src": "4136:2:24",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4126:13:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MarketIrm_$43956_storage",
"typeString": "struct MarketIrm storage ref"
}
},
"id": 44229,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberLocation": "4140:14:24",
"memberName": "prevBorrowRate",
"nodeType": "MemberAccess",
"referencedDeclaration": 43953,
"src": "4126:28:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"hexValue": "30",
"id": 44230,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "4158:1:24",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "4126:33:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 44237,
"nodeType": "IfStatement",
"src": "4122:79:24",
"trueBody": {
"expression": {
"components": [
{
"id": 44232,
"name": "err",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44205,
"src": "4169:3:24",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
{
"id": 44233,
"name": "INITIAL_RATE",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44002,
"src": "4174:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
{
"id": 44234,
"name": "INITIAL_RATE",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44002,
"src": "4188:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
}
],
"id": 44235,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "4168:33:24",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_int128_$_t_uint128_$_t_uint128_$",
"typeString": "tuple(int128,uint128,uint128)"
}
},
"functionReturnParameters": 44177,
"id": 44236,
"nodeType": "Return",
"src": "4161:40:24"
}
},
{
"assignments": [
44239
],
"declarations": [
{
"constant": false,
"id": 44239,
"mutability": "mutable",
"name": "errDelta",
"nameLocation": "4312:8:24",
"nodeType": "VariableDeclaration",
"scope": 44360,
"src": "4305:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 44238,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "4305:6:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
}
],
"id": 44246,
"initialValue": {
"commonType": {
"typeIdentifier": "t_int128",
"typeString": "int128"
},
"id": 44245,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 44240,
"name": "err",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44205,
"src": "4323:3:24",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"expression": {
"baseExpression": {
"id": 44241,
"name": "marketIrm",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44009,
"src": "4329:9:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_userDefinedValueType$_Id_$42887_$_t_struct$_MarketIrm_$43956_storage_$",
"typeString": "mapping(Id => struct MarketIrm storage ref)"
}
},
"id": 44243,
"indexExpression": {
"id": 44242,
"name": "id",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44166,
"src": "4339:2:24",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "4329:13:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MarketIrm_$43956_storage",
"typeString": "struct MarketIrm storage ref"
}
},
"id": 44244,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberLocation": "4343:7:24",
"memberName": "prevErr",
"nodeType": "MemberAccess",
"referencedDeclaration": 43955,
"src": "4329:21:24",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"src": "4323:27:24",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4305:45:24"
},
{
"assignments": [
44248
],
"declarations": [
{
"constant": false,
"id": 44248,
"mutability": "mutable",
"name": "jumpMultiplier",
"nameLocation": "4446:14:24",
"nodeType": "VariableDeclaration",
"scope": 44360,
"src": "4438:22:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44247,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4438:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 44259,
"initialValue": {
"arguments": [
{
"arguments": [
{
"arguments": [
{
"id": 44255,
"name": "LN_JUMP_FACTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43993,
"src": "4501:14:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 44254,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4494:6:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 44253,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "4494:6:24",
"typeDescriptions": {}
}
},
"id": 44256,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "4494:22:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"expression": {
"id": 44251,
"name": "errDelta",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44239,
"src": "4476:8:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"id": 44252,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "4485:8:24",
"memberName": "wMulDown",
"nodeType": "MemberAccess",
"referencedDeclaration": 44528,
"src": "4476:17:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$attached_to$_t_int256_$",
"typeString": "function (int256,int256) pure returns (int256)"
}
},
"id": 44257,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "4476:41:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"expression": {
"id": 44249,
"name": "MathLib",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44545,
"src": "4463:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_MathLib_$44545_$",
"typeString": "type(library MathLib)"
}
},
"id": 44250,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "4471:4:24",
"memberName": "wExp",
"nodeType": "MemberAccess",
"referencedDeclaration": 44512,
"src": "4463:12:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_int256_$returns$_t_uint256_$",
"typeString": "function (int256) pure returns (uint256)"
}
},
"id": 44258,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "4463:55:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4438:80:24"
},
{
"assignments": [
44261
],
"declarations": [
{
"constant": false,
"id": 44261,
"mutability": "mutable",
"name": "speed",
"nameLocation": "4610:5:24",
"nodeType": "VariableDeclaration",
"scope": 44360,
"src": "4603:12:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 44260,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "4603:6:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
}
],
"id": 44269,
"initialValue": {
"arguments": [
{
"id": 44267,
"name": "err",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44205,
"src": "4648:3:24",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int128",
"typeString": "int128"
}
],
"expression": {
"arguments": [
{
"id": 44264,
"name": "SPEED_FACTOR",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43996,
"src": "4625:12:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 44263,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4618:6:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 44262,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "4618:6:24",
"typeDescriptions": {}
}
},
"id": 44265,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "4618:20:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"id": 44266,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "4639:8:24",
"memberName": "wMulDown",
"nodeType": "MemberAccess",
"referencedDeclaration": 44528,
"src": "4618:29:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$attached_to$_t_int256_$",
"typeString": "function (int256,int256) pure returns (int256)"
}
},
"id": 44268,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "4618:34:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4603:49:24"
},
{
"assignments": [
44271
],
"declarations": [
{
"constant": false,
"id": 44271,
"mutability": "mutable",
"name": "elapsed",
"nameLocation": "4670:7:24",
"nodeType": "VariableDeclaration",
"scope": 44360,
"src": "4662:15:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44270,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4662:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 44277,
"initialValue": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 44276,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 44272,
"name": "block",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -4,
"src": "4680:5:24",
"typeDescriptions": {
"typeIdentifier": "t_magic_block",
"typeString": "block"
}
},
"id": 44273,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "4686:9:24",
"memberName": "timestamp",
"nodeType": "MemberAccess",
"src": "4680:15:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"expression": {
"id": 44274,
"name": "market",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44169,
"src": "4698:6:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Market_$42918_memory_ptr",
"typeString": "struct Market memory"
}
},
"id": 44275,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberLocation": "4705:10:24",
"memberName": "lastUpdate",
"nodeType": "MemberAccess",
"referencedDeclaration": 42915,
"src": "4698:17:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"src": "4680:35:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4662:53:24"
},
{
"assignments": [
44279
],
"declarations": [
{
"constant": false,
"id": 44279,
"mutability": "mutable",
"name": "linearVariation",
"nameLocation": "4801:15:24",
"nodeType": "VariableDeclaration",
"scope": 44360,
"src": "4794:22:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 44278,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "4794:6:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
}
],
"id": 44286,
"initialValue": {
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 44285,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 44280,
"name": "speed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44261,
"src": "4819:5:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"arguments": [
{
"id": 44283,
"name": "elapsed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44271,
"src": "4834:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 44282,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "4827:6:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 44281,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "4827:6:24",
"typeDescriptions": {}
}
},
"id": 44284,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "4827:15:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"src": "4819:23:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4794:48:24"
},
{
"assignments": [
44288
],
"declarations": [
{
"constant": false,
"id": 44288,
"mutability": "mutable",
"name": "variationMultiplier",
"nameLocation": "4860:19:24",
"nodeType": "VariableDeclaration",
"scope": 44360,
"src": "4852:27:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44287,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4852:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 44293,
"initialValue": {
"arguments": [
{
"id": 44291,
"name": "linearVariation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44279,
"src": "4895:15:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"expression": {
"id": 44289,
"name": "MathLib",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44545,
"src": "4882:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_MathLib_$44545_$",
"typeString": "type(library MathLib)"
}
},
"id": 44290,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "4890:4:24",
"memberName": "wExp",
"nodeType": "MemberAccess",
"referencedDeclaration": 44512,
"src": "4882:12:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_int256_$returns$_t_uint256_$",
"typeString": "function (int256) pure returns (uint256)"
}
},
"id": 44292,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "4882:29:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4852:59:24"
},
{
"assignments": [
44295
],
"declarations": [
{
"constant": false,
"id": 44295,
"mutability": "mutable",
"name": "borrowRateAfterJump",
"nameLocation": "5012:19:24",
"nodeType": "VariableDeclaration",
"scope": 44360,
"src": "5004:27:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44294,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5004:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 44303,
"initialValue": {
"arguments": [
{
"id": 44301,
"name": "jumpMultiplier",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44248,
"src": "5072:14:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"expression": {
"baseExpression": {
"id": 44296,
"name": "marketIrm",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44009,
"src": "5034:9:24",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_userDefinedValueType$_Id_$42887_$_t_struct$_MarketIrm_$43956_storage_$",
"typeString": "mapping(Id => struct MarketIrm storage ref)"
}
},
"id": 44298,
"indexExpression": {
"id": 44297,
"name": "id",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44166,
"src": "5044:2:24",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "5034:13:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_MarketIrm_$43956_storage",
"typeString": "struct MarketIrm storage ref"
}
},
"id": 44299,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberLocation": "5048:14:24",
"memberName": "prevBorrowRate",
"nodeType": "MemberAccess",
"referencedDeclaration": 43953,
"src": "5034:28:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"id": 44300,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "5063:8:24",
"memberName": "wMulDown",
"nodeType": "MemberAccess",
"referencedDeclaration": 43282,
"src": "5034:37:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$attached_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 44302,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "5034:53:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5004:83:24"
},
{
"assignments": [
44305
],
"declarations": [
{
"constant": false,
"id": 44305,
"mutability": "mutable",
"name": "newBorrowRate",
"nameLocation": "5105:13:24",
"nodeType": "VariableDeclaration",
"scope": 44360,
"src": "5097:21:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44304,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5097:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 44310,
"initialValue": {
"arguments": [
{
"id": 44308,
"name": "variationMultiplier",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44288,
"src": "5150:19:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"id": 44306,
"name": "borrowRateAfterJump",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44295,
"src": "5121:19:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 44307,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "5141:8:24",
"memberName": "wMulDown",
"nodeType": "MemberAccess",
"referencedDeclaration": 43282,
"src": "5121:28:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$attached_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 44309,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "5121:49:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5097:73:24"
},
{
"assignments": [
44312
],
"declarations": [
{
"constant": false,
"id": 44312,
"mutability": "mutable",
"name": "avgBorrowRate",
"nameLocation": "5673:13:24",
"nodeType": "VariableDeclaration",
"scope": 44360,
"src": "5665:21:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 44311,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5665:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 44313,
"nodeType": "VariableDeclarationStatement",
"src": "5665:21:24"
},
{
"condition": {
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 44316,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 44314,
"name": "linearVariation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44279,
"src": "5700:15:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"hexValue": "30",
"id": 44315,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "5719:1:24",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "5700:20:24",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"expression": {
"id": 44338,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 44321,
"name": "avgBorrowRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44312,
"src": "5886:13:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"arguments": [
{
"id": 44335,
"name": "linearVariation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44279,
"src": "5973:15:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"expression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 44332,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"id": 44326,
"name": "newBorrowRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44305,
"src": "5918:13:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 44325,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "5911:6:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 44324,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "5911:6:24",
"typeDescriptions": {}
}
},
"id": 44327,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "5911:21:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"arguments": [
{
"id": 44330,
"name": "borrowRateAfterJump",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44295,
"src": "5942:19:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 44329,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "5935:6:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 44328,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "5935:6:24",
"typeDescriptions": {}
}
},
"id": 44331,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "5935:27:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"src": "5911:51:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"id": 44333,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "5910:53:24",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"id": 44334,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "5964:8:24",
"memberName": "wDivDown",
"nodeType": "MemberAccess",
"referencedDeclaration": 44544,
"src": "5910:62:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_int256_$_t_int256_$returns$_t_int256_$attached_to$_t_int256_$",
"typeString": "function (int256,int256) pure returns (int256)"
}
},
"id": 44336,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "5910:79:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"id": 44323,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "5902:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 44322,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5902:7:24",
"typeDescriptions": {}
}
},
"id": 44337,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "5902:88:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "5886:104:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 44339,
"nodeType": "ExpressionStatement",
"src": "5886:104:24"
},
"id": 44340,
"nodeType": "IfStatement",
"src": "5696:294:24",
"trueBody": {
"expression": {
"id": 44319,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 44317,
"name": "avgBorrowRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44312,
"src": "5722:13:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 44318,
"name": "borrowRateAfterJump",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44295,
"src": "5738:19:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "5722:35:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 44320,
"nodeType": "ExpressionStatement",
"src": "5722:35:24"
}
},
{
"expression": {
"components": [
{
"id": 44341,
"name": "err",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44205,
"src": "6094:3:24",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
{
"arguments": [
{
"arguments": [
{
"hexValue": "31",
"id": 44346,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6127:1:24",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
{
"id": 44347,
"name": "MAX_RATE",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43987,
"src": "6130:8:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"id": 44344,
"name": "newBorrowRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44305,
"src": "6107:13:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 44345,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "6121:5:24",
"memberName": "bound",
"nodeType": "MemberAccess",
"referencedDeclaration": 44561,
"src": "6107:19:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$attached_to$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256)"
}
},
"id": 44348,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "6107:32:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 44343,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "6099:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint128_$",
"typeString": "type(uint128)"
},
"typeName": {
"id": 44342,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "6099:7:24",
"typeDescriptions": {}
}
},
"id": 44349,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "6099:41:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
{
"arguments": [
{
"arguments": [
{
"hexValue": "31",
"id": 44354,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "6170:1:24",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
{
"id": 44355,
"name": "MAX_RATE",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43987,
"src": "6173:8:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"id": 44352,
"name": "avgBorrowRate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44312,
"src": "6150:13:24",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 44353,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "6164:5:24",
"memberName": "bound",
"nodeType": "MemberAccess",
"referencedDeclaration": 44561,
"src": "6150:19:24",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$attached_to$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256)"
}
},
"id": 44356,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "6150:32:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 44351,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "6142:7:24",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint128_$",
"typeString": "type(uint128)"
},
"typeName": {
"id": 44350,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "6142:7:24",
"typeDescriptions": {}
}
},
"id": 44357,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "6142:41:24",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
}
],
"id": 44358,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "6093:91:24",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_int128_$_t_uint128_$_t_uint128_$",
"typeString": "tuple(int128,uint128,uint128)"
}
},
"functionReturnParameters": 44177,
"id": 44359,
"nodeType": "Return",
"src": "6086:98:24"
}
]
},
"documentation": {
"id": 44163,
"nodeType": "StructuredDocumentation",
"src": "3405:54:24",
"text": "@dev Returns err, newBorrowRate and avgBorrowRate."
},
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_borrowRate",
"nameLocation": "3473:11:24",
"parameters": {
"id": 44170,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 44166,
"mutability": "mutable",
"name": "id",
"nameLocation": "3488:2:24",
"nodeType": "VariableDeclaration",
"scope": 44361,
"src": "3485:5:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
},
"typeName": {
"id": 44165,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 44164,
"name": "Id",
"nameLocations": [
"3485:2:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 42887,
"src": "3485:2:24"
},
"referencedDeclaration": 42887,
"src": "3485:2:24",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_Id_$42887",
"typeString": "Id"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 44169,
"mutability": "mutable",
"name": "market",
"nameLocation": "3506:6:24",
"nodeType": "VariableDeclaration",
"scope": 44361,
"src": "3492:20:24",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Market_$42918_memory_ptr",
"typeString": "struct Market"
},
"typeName": {
"id": 44168,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 44167,
"name": "Market",
"nameLocations": [
"3492:6:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 42918,
"src": "3492:6:24"
},
"referencedDeclaration": 42918,
"src": "3492:6:24",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Market_$42918_storage_ptr",
"typeString": "struct Market"
}
},
"visibility": "internal"
}
],
"src": "3484:29:24"
},
"returnParameters": {
"id": 44177,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 44172,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 44361,
"src": "3536:6:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
},
"typeName": {
"id": 44171,
"name": "int128",
"nodeType": "ElementaryTypeName",
"src": "3536:6:24",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 44174,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 44361,
"src": "3544:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 44173,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "3544:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 44176,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 44361,
"src": "3553:7:24",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 44175,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "3553:7:24",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"visibility": "internal"
}
],
"src": "3535:26:24"
},
"scope": 44362,
"stateMutability": "view",
"virtual": false,
"visibility": "private"
}
],
"abstract": false,
"baseContracts": [
{
"baseName": {
"id": 43958,
"name": "IIrm",
"nameLocations": [
"760:4:24"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 42883,
"src": "760:4:24"
},
"id": 43959,
"nodeType": "InheritanceSpecifier",
"src": "760:4:24"
}
],
"canonicalName": "Irm",
"contractDependencies": [],
"contractKind": "contract",
"documentation": {
"id": 43957,
"nodeType": "StructuredDocumentation",
"src": "672:72:24",
"text": "@title Irm\n @author Morpho Labs\n @notice Interest rate model."
},
"fullyImplemented": true,
"linearizedBaseContracts": [
44362,
42883
],
"name": "Irm",
"nameLocation": "753:3:24",
"scope": 44363,
"usedErrors": []
}
],
"license": "UNLICENSED"
},
"id": 24
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment