diff --git a/src/abi/CoolerClearingHouseV3.json b/src/abi/CoolerClearingHouseV3.json
new file mode 100644
index 0000000000..375b1c8002
--- /dev/null
+++ b/src/abi/CoolerClearingHouseV3.json
@@ -0,0 +1,780 @@
+{
+ "abi": [
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "ohm_",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "gohm_",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "staking_",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "sReserve_",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "coolerFactory_",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "kernel_",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "constructor"
+ },
+ {
+ "inputs": [],
+ "name": "BadEscrow",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "DurationMaximum",
+ "type": "error"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "caller_",
+ "type": "address"
+ }
+ ],
+ "name": "KernelAdapter_OnlyKernel",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "LengthDiscrepancy",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "NotLender",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "OnlyBorrower",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "OnlyBurnable",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "OnlyFromFactory",
+ "type": "error"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "Keycode",
+ "name": "keycode_",
+ "type": "bytes5"
+ }
+ ],
+ "name": "Policy_ModuleDoesNotExist",
+ "type": "error"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes",
+ "name": "expected_",
+ "type": "bytes"
+ }
+ ],
+ "name": "Policy_WrongModuleVersion",
+ "type": "error"
+ },
+ {
+ "inputs": [],
+ "name": "TooEarlyToFund",
+ "type": "error"
+ },
+ {
+ "anonymous": false,
+ "inputs": [],
+ "name": "Activate",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [],
+ "name": "Deactivate",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": false,
+ "internalType": "address",
+ "name": "token",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "amount",
+ "type": "uint256"
+ }
+ ],
+ "name": "Defund",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": false,
+ "internalType": "bool",
+ "name": "defund",
+ "type": "bool"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint256",
+ "name": "reserveAmount",
+ "type": "uint256"
+ }
+ ],
+ "name": "Rebalance",
+ "type": "event"
+ },
+ {
+ "inputs": [],
+ "name": "CHREG",
+ "outputs": [
+ {
+ "internalType": "contract CHREGv1",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "DURATION",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "FUND_AMOUNT",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "FUND_CADENCE",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "INTEREST_RATE",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "LOAN_TO_COLLATERAL",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "MAX_REWARD",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "MINTR",
+ "outputs": [
+ {
+ "internalType": "contract MINTRv1",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "ROLES",
+ "outputs": [
+ {
+ "internalType": "contract ROLESv1",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "TRSRY",
+ "outputs": [
+ {
+ "internalType": "contract TRSRYv1",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "VERSION",
+ "outputs": [
+ {
+ "internalType": "uint8",
+ "name": "major",
+ "type": "uint8"
+ },
+ {
+ "internalType": "uint8",
+ "name": "minor",
+ "type": "uint8"
+ }
+ ],
+ "stateMutability": "pure",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "activate",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "active",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "burn",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "contract Kernel",
+ "name": "newKernel_",
+ "type": "address"
+ }
+ ],
+ "name": "changeKernel",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address[]",
+ "name": "coolers_",
+ "type": "address[]"
+ },
+ {
+ "internalType": "uint256[]",
+ "name": "loans_",
+ "type": "uint256[]"
+ }
+ ],
+ "name": "claimDefaulted",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "configureDependencies",
+ "outputs": [
+ {
+ "internalType": "Keycode[]",
+ "name": "dependencies",
+ "type": "bytes5[]"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "contract ERC20",
+ "name": "token_",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "amount_",
+ "type": "uint256"
+ }
+ ],
+ "name": "defund",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "emergencyShutdown",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "contract Cooler",
+ "name": "cooler_",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "loanID_",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint8",
+ "name": "times_",
+ "type": "uint8"
+ }
+ ],
+ "name": "extendLoan",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "factory",
+ "outputs": [
+ {
+ "internalType": "contract CoolerFactory",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "fundTime",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "principal_",
+ "type": "uint256"
+ }
+ ],
+ "name": "getCollateralForLoan",
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+ "stateMutability": "pure",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "collateral_",
+ "type": "uint256"
+ }
+ ],
+ "name": "getLoanForCollateral",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "pure",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "getTotalReceivables",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "gohm",
+ "outputs": [
+ {
+ "internalType": "contract ERC20",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "principal_",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "duration_",
+ "type": "uint256"
+ }
+ ],
+ "name": "interestForLoan",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "pure",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "interestReceivables",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "isActive",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "isCoolerCallback",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "pure",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "kernel",
+ "outputs": [
+ {
+ "internalType": "contract Kernel",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "contract Cooler",
+ "name": "cooler_",
+ "type": "address"
+ },
+ {
+ "internalType": "uint256",
+ "name": "amount_",
+ "type": "uint256"
+ }
+ ],
+ "name": "lendToCooler",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "ohm",
+ "outputs": [
+ {
+ "internalType": "contract ERC20",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "loanID_",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "principle",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "interest",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "collateral",
+ "type": "uint256"
+ }
+ ],
+ "name": "onDefault",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "loanID_",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "principlePaid_",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "interestPaid_",
+ "type": "uint256"
+ }
+ ],
+ "name": "onRepay",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "principalReceivables",
+ "outputs": [
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "rebalance",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "requestPermissions",
+ "outputs": [
+ {
+ "components": [
+ {
+ "internalType": "Keycode",
+ "name": "keycode",
+ "type": "bytes5"
+ },
+ {
+ "internalType": "bytes4",
+ "name": "funcSelector",
+ "type": "bytes4"
+ }
+ ],
+ "internalType": "struct Permissions[]",
+ "name": "requests",
+ "type": "tuple[]"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "reserve",
+ "outputs": [
+ {
+ "internalType": "contract ERC20",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "sReserve",
+ "outputs": [
+ {
+ "internalType": "contract ERC4626",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "staking",
+ "outputs": [
+ {
+ "internalType": "contract IStaking",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "sweepIntoSavingsVault",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ }
+ ]
+}
diff --git a/src/abi/CoolerFactoryV2.json b/src/abi/CoolerFactoryV2.json
index 221815ef9f..13849d98bf 100644
--- a/src/abi/CoolerFactoryV2.json
+++ b/src/abi/CoolerFactoryV2.json
@@ -1,434 +1,434 @@
{
- "abi": [
- {
- "inputs": [],
- "stateMutability": "nonpayable",
- "type": "constructor"
- },
- {
- "inputs": [],
- "type": "error",
- "name": "CreateFail"
- },
- {
- "inputs": [],
- "type": "error",
- "name": "DecimalsNot18"
- },
- {
- "inputs": [],
- "type": "error",
- "name": "NotFromFactory"
- },
- {
- "inputs": [
- {
- "internalType": "address",
- "name": "cooler",
- "type": "address",
- "indexed": true
- },
- {
- "internalType": "uint256",
- "name": "reqID",
- "type": "uint256",
- "indexed": false
- },
- {
- "internalType": "uint256",
- "name": "loanID",
- "type": "uint256",
- "indexed": false
- }
- ],
- "type": "event",
- "name": "ClearRequest",
- "anonymous": false
- },
- {
- "inputs": [
- {
- "internalType": "address",
- "name": "cooler",
- "type": "address",
- "indexed": true
- },
- {
- "internalType": "uint256",
- "name": "loanID",
- "type": "uint256",
- "indexed": false
- },
- {
- "internalType": "uint256",
- "name": "amount",
- "type": "uint256",
- "indexed": false
- }
- ],
- "type": "event",
- "name": "DefaultLoan",
- "anonymous": false
- },
- {
- "inputs": [
- {
- "internalType": "address",
- "name": "cooler",
- "type": "address",
- "indexed": true
- },
- {
- "internalType": "uint256",
- "name": "loanID",
- "type": "uint256",
- "indexed": false
- },
- {
- "internalType": "uint8",
- "name": "times",
- "type": "uint8",
- "indexed": false
- }
- ],
- "type": "event",
- "name": "ExtendLoan",
- "anonymous": false
- },
- {
- "inputs": [
- {
- "internalType": "address",
- "name": "cooler",
- "type": "address",
- "indexed": true
- },
- {
- "internalType": "uint256",
- "name": "loanID",
- "type": "uint256",
- "indexed": false
- },
- {
- "internalType": "uint256",
- "name": "amount",
- "type": "uint256",
- "indexed": false
- }
- ],
- "type": "event",
- "name": "RepayLoan",
- "anonymous": false
- },
- {
- "inputs": [
- {
- "internalType": "address",
- "name": "cooler",
- "type": "address",
- "indexed": true
- },
- {
- "internalType": "address",
- "name": "collateral",
- "type": "address",
- "indexed": false
- },
- {
- "internalType": "address",
- "name": "debt",
- "type": "address",
- "indexed": false
- },
- {
- "internalType": "uint256",
- "name": "reqID",
- "type": "uint256",
- "indexed": false
- }
- ],
- "type": "event",
- "name": "RequestLoan",
- "anonymous": false
- },
- {
- "inputs": [
- {
- "internalType": "address",
- "name": "cooler",
- "type": "address",
- "indexed": true
- },
- {
- "internalType": "uint256",
- "name": "reqID",
- "type": "uint256",
- "indexed": false
- }
- ],
- "type": "event",
- "name": "RescindRequest",
- "anonymous": false
- },
- {
- "inputs": [],
- "stateMutability": "view",
- "type": "function",
- "name": "coolerImplementation",
- "outputs": [
- {
- "internalType": "contract Cooler",
- "name": "",
- "type": "address"
- }
- ]
- },
- {
- "inputs": [
- {
- "internalType": "contract ERC20",
- "name": "",
- "type": "address"
- },
- {
- "internalType": "contract ERC20",
- "name": "",
- "type": "address"
- },
- {
- "internalType": "uint256",
- "name": "",
- "type": "uint256"
- }
- ],
- "stateMutability": "view",
- "type": "function",
- "name": "coolersFor",
- "outputs": [
- {
- "internalType": "address",
- "name": "",
- "type": "address"
- }
- ]
- },
- {
- "inputs": [
- {
- "internalType": "address",
- "name": "",
- "type": "address"
- }
- ],
- "stateMutability": "view",
- "type": "function",
- "name": "created",
- "outputs": [
- {
- "internalType": "bool",
- "name": "",
- "type": "bool"
- }
- ]
- },
- {
- "inputs": [
- {
- "internalType": "contract ERC20",
- "name": "collateral_",
- "type": "address"
- },
- {
- "internalType": "contract ERC20",
- "name": "debt_",
- "type": "address"
- }
- ],
- "stateMutability": "nonpayable",
- "type": "function",
- "name": "generateCooler",
- "outputs": [
- {
- "internalType": "address",
- "name": "cooler",
- "type": "address"
- }
- ]
- },
- {
- "inputs": [
- {
- "internalType": "address",
- "name": "user_",
- "type": "address"
- },
- {
- "internalType": "address",
- "name": "collateral_",
- "type": "address"
- },
- {
- "internalType": "address",
- "name": "debt_",
- "type": "address"
- }
- ],
- "stateMutability": "view",
- "type": "function",
- "name": "getCoolerFor",
- "outputs": [
- {
- "internalType": "address",
- "name": "",
- "type": "address"
- }
- ]
- },
- {
- "inputs": [
- {
- "internalType": "uint256",
- "name": "reqID_",
- "type": "uint256"
- },
- {
- "internalType": "uint256",
- "name": "loanID_",
- "type": "uint256"
- }
- ],
- "stateMutability": "nonpayable",
- "type": "function",
- "name": "logClearRequest"
- },
- {
- "inputs": [
- {
- "internalType": "uint256",
- "name": "loanID_",
- "type": "uint256"
- },
- {
- "internalType": "uint256",
- "name": "collateral_",
- "type": "uint256"
- }
- ],
- "stateMutability": "nonpayable",
- "type": "function",
- "name": "logDefaultLoan"
- },
- {
- "inputs": [
- {
- "internalType": "uint256",
- "name": "loanID_",
- "type": "uint256"
- },
- {
- "internalType": "uint8",
- "name": "times_",
- "type": "uint8"
- }
- ],
- "stateMutability": "nonpayable",
- "type": "function",
- "name": "logExtendLoan"
- },
- {
- "inputs": [
- {
- "internalType": "uint256",
- "name": "loanID_",
- "type": "uint256"
- },
- {
- "internalType": "uint256",
- "name": "repayment_",
- "type": "uint256"
- }
- ],
- "stateMutability": "nonpayable",
- "type": "function",
- "name": "logRepayLoan"
- },
- {
- "inputs": [
- {
- "internalType": "uint256",
- "name": "reqID_",
- "type": "uint256"
- }
- ],
- "stateMutability": "nonpayable",
- "type": "function",
- "name": "logRequestLoan"
- },
- {
- "inputs": [
- {
- "internalType": "uint256",
- "name": "reqID_",
- "type": "uint256"
- }
- ],
- "stateMutability": "nonpayable",
- "type": "function",
- "name": "logRescindRequest"
- }
- ],
- "devdoc": {
- "kind": "dev",
- "methods": {
- "generateCooler(address,address)": {
- "params": {
- "collateral_": "the token given as collateral.",
- "debt_": "the token to be lent. Interest is denominated in debt tokens."
- },
- "returns": {
- "cooler": "address of the contract."
- }
+ "abi": [
+ {
+ "inputs": [],
+ "stateMutability": "nonpayable",
+ "type": "constructor"
+ },
+ {
+ "inputs": [],
+ "type": "error",
+ "name": "CreateFail"
+ },
+ {
+ "inputs": [],
+ "type": "error",
+ "name": "DecimalsNot18"
+ },
+ {
+ "inputs": [],
+ "type": "error",
+ "name": "NotFromFactory"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "cooler",
+ "type": "address",
+ "indexed": true
+ },
+ {
+ "internalType": "uint256",
+ "name": "reqID",
+ "type": "uint256",
+ "indexed": false
+ },
+ {
+ "internalType": "uint256",
+ "name": "loanID",
+ "type": "uint256",
+ "indexed": false
}
- },
- "version": 1
+ ],
+ "type": "event",
+ "name": "ClearRequest",
+ "anonymous": false
},
- "userdoc": {
- "kind": "user",
- "methods": {
- "coolerImplementation()": {
- "notice": "Cooler reference implementation (deployed on creation to clone from)."
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "cooler",
+ "type": "address",
+ "indexed": true
},
- "coolersFor(address,address,uint256)": {
- "notice": "Mapping to query Coolers for Collateral-Debt pair."
+ {
+ "internalType": "uint256",
+ "name": "loanID",
+ "type": "uint256",
+ "indexed": false
},
- "created(address)": {
- "notice": "Mapping to validate deployed coolers."
+ {
+ "internalType": "uint256",
+ "name": "amount",
+ "type": "uint256",
+ "indexed": false
+ }
+ ],
+ "type": "event",
+ "name": "DefaultLoan",
+ "anonymous": false
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "cooler",
+ "type": "address",
+ "indexed": true
+ },
+ {
+ "internalType": "uint256",
+ "name": "loanID",
+ "type": "uint256",
+ "indexed": false
+ },
+ {
+ "internalType": "uint8",
+ "name": "times",
+ "type": "uint8",
+ "indexed": false
+ }
+ ],
+ "type": "event",
+ "name": "ExtendLoan",
+ "anonymous": false
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "cooler",
+ "type": "address",
+ "indexed": true
},
- "generateCooler(address,address)": {
- "notice": "creates a new Escrow contract for collateral and debt tokens."
+ {
+ "internalType": "uint256",
+ "name": "loanID",
+ "type": "uint256",
+ "indexed": false
},
- "getCoolerFor(address,address,address)": {
- "notice": "Getter function to get an existing cooler for a given user <> collateral <> debt combination."
+ {
+ "internalType": "uint256",
+ "name": "amount",
+ "type": "uint256",
+ "indexed": false
+ }
+ ],
+ "type": "event",
+ "name": "RepayLoan",
+ "anonymous": false
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "cooler",
+ "type": "address",
+ "indexed": true
},
- "logClearRequest(uint256,uint256)": {
- "notice": "Emit a global event when a loan request is fulfilled."
+ {
+ "internalType": "address",
+ "name": "collateral",
+ "type": "address",
+ "indexed": false
},
- "logDefaultLoan(uint256,uint256)": {
- "notice": "Emit a global event when the collateral of defaulted loan is claimed."
+ {
+ "internalType": "address",
+ "name": "debt",
+ "type": "address",
+ "indexed": false
},
- "logExtendLoan(uint256,uint8)": {
- "notice": "Emit a global event when a loan is extended."
+ {
+ "internalType": "uint256",
+ "name": "reqID",
+ "type": "uint256",
+ "indexed": false
+ }
+ ],
+ "type": "event",
+ "name": "RequestLoan",
+ "anonymous": false
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "cooler",
+ "type": "address",
+ "indexed": true
},
- "logRepayLoan(uint256,uint256)": {
- "notice": "Emit a global event when a loan is repaid."
+ {
+ "internalType": "uint256",
+ "name": "reqID",
+ "type": "uint256",
+ "indexed": false
+ }
+ ],
+ "type": "event",
+ "name": "RescindRequest",
+ "anonymous": false
+ },
+ {
+ "inputs": [],
+ "stateMutability": "view",
+ "type": "function",
+ "name": "coolerImplementation",
+ "outputs": [
+ {
+ "internalType": "contract Cooler",
+ "name": "",
+ "type": "address"
+ }
+ ]
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "contract ERC20",
+ "name": "",
+ "type": "address"
},
- "logRequestLoan(uint256)": {
- "notice": "Emit a global event when a new loan request is created."
+ {
+ "internalType": "contract ERC20",
+ "name": "",
+ "type": "address"
},
- "logRescindRequest(uint256)": {
- "notice": "Emit a global event when a loan request is rescinded."
+ {
+ "internalType": "uint256",
+ "name": "",
+ "type": "uint256"
}
- },
- "version": 1
+ ],
+ "stateMutability": "view",
+ "type": "function",
+ "name": "coolersFor",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ]
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function",
+ "name": "created",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ]
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "contract ERC20",
+ "name": "collateral_",
+ "type": "address"
+ },
+ {
+ "internalType": "contract ERC20",
+ "name": "debt_",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function",
+ "name": "generateCooler",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "cooler",
+ "type": "address"
+ }
+ ]
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "user_",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "collateral_",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "debt_",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function",
+ "name": "getCoolerFor",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ]
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "reqID_",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "loanID_",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function",
+ "name": "logClearRequest"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "loanID_",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "collateral_",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function",
+ "name": "logDefaultLoan"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "loanID_",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint8",
+ "name": "times_",
+ "type": "uint8"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function",
+ "name": "logExtendLoan"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "loanID_",
+ "type": "uint256"
+ },
+ {
+ "internalType": "uint256",
+ "name": "repayment_",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function",
+ "name": "logRepayLoan"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "reqID_",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function",
+ "name": "logRequestLoan"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint256",
+ "name": "reqID_",
+ "type": "uint256"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "function",
+ "name": "logRescindRequest"
}
- }
\ No newline at end of file
+ ],
+ "devdoc": {
+ "kind": "dev",
+ "methods": {
+ "generateCooler(address,address)": {
+ "params": {
+ "collateral_": "the token given as collateral.",
+ "debt_": "the token to be lent. Interest is denominated in debt tokens."
+ },
+ "returns": {
+ "cooler": "address of the contract."
+ }
+ }
+ },
+ "version": 1
+ },
+ "userdoc": {
+ "kind": "user",
+ "methods": {
+ "coolerImplementation()": {
+ "notice": "Cooler reference implementation (deployed on creation to clone from)."
+ },
+ "coolersFor(address,address,uint256)": {
+ "notice": "Mapping to query Coolers for Collateral-Debt pair."
+ },
+ "created(address)": {
+ "notice": "Mapping to validate deployed coolers."
+ },
+ "generateCooler(address,address)": {
+ "notice": "creates a new Escrow contract for collateral and debt tokens."
+ },
+ "getCoolerFor(address,address,address)": {
+ "notice": "Getter function to get an existing cooler for a given user <> collateral <> debt combination."
+ },
+ "logClearRequest(uint256,uint256)": {
+ "notice": "Emit a global event when a loan request is fulfilled."
+ },
+ "logDefaultLoan(uint256,uint256)": {
+ "notice": "Emit a global event when the collateral of defaulted loan is claimed."
+ },
+ "logExtendLoan(uint256,uint8)": {
+ "notice": "Emit a global event when a loan is extended."
+ },
+ "logRepayLoan(uint256,uint256)": {
+ "notice": "Emit a global event when a loan is repaid."
+ },
+ "logRequestLoan(uint256)": {
+ "notice": "Emit a global event when a new loan request is created."
+ },
+ "logRescindRequest(uint256)": {
+ "notice": "Emit a global event when a loan request is rescinded."
+ }
+ },
+ "version": 1
+ }
+}
diff --git a/src/assets/tokens/usds.svg b/src/assets/tokens/usds.svg
new file mode 100644
index 0000000000..6b0b3139bd
--- /dev/null
+++ b/src/assets/tokens/usds.svg
@@ -0,0 +1,11 @@
+
+
diff --git a/src/components/Migration/MigrationModal.tsx b/src/components/Migration/MigrationModal.tsx
index 19070f651e..4dbfa27d0d 100644
--- a/src/components/Migration/MigrationModal.tsx
+++ b/src/components/Migration/MigrationModal.tsx
@@ -112,8 +112,8 @@ function MigrationModal({ open, handleClose }: { open: boolean; handleClose: any
isMigrationComplete || !oldAssetsDetected
? `Migration complete`
: isAllApproved
- ? `You are now ready to migrate`
- : `You have assets ready to migrate to v2`
+ ? `You are now ready to migrate`
+ : `You have assets ready to migrate to v2`
}
>
<>
diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts
index a0cde0a4ed..e02363fa40 100644
--- a/src/constants/addresses.ts
+++ b/src/constants/addresses.ts
@@ -283,6 +283,11 @@ export const COOLER_CLEARING_HOUSE_V2_ADDRESSES = {
[NetworkId.TESTNET_GOERLI]: "0xbfe14B5950a530A5CE572Cd2FaC6d44c718A3C47",
};
+export const COOLER_CLEARING_HOUSE_V3_ADDRESSES = {
+ [NetworkId.MAINNET]: "0x1e094fE00E13Fd06D64EeA4FB3cD912893606fE0",
+ [NetworkId.TESTNET_GOERLI]: "",
+};
+
export const OLYMPUS_GOVERNANCE_ADDRESSES = {
[NetworkId.MAINNET]: "0x0941233c964e7d7Efeb05D253176E5E634cEFfcD",
[NetworkId.TESTNET_GOERLI]: "0x0941233c964e7d7Efeb05D253176E5E634cEFfcD",
diff --git a/src/constants/contracts.ts b/src/constants/contracts.ts
index b6557a9a9c..54d511ec3b 100644
--- a/src/constants/contracts.ts
+++ b/src/constants/contracts.ts
@@ -6,6 +6,7 @@ import {
BOND_FIXED_TERM_TELLER_ADDRESSES,
COOLER_CLEARING_HOUSE_V1_ADDRESSES,
COOLER_CLEARING_HOUSE_V2_ADDRESSES,
+ COOLER_CLEARING_HOUSE_V3_ADDRESSES,
COOLER_CONSOLIDATION_ADDRESSES,
CROSS_CHAIN_BRIDGE_ADDRESSES,
CROSS_CHAIN_BRIDGE_ADDRESSES_TESTNET,
@@ -29,6 +30,7 @@ import {
BondFixedExpiryTeller__factory,
BondFixedTermTeller__factory,
CoolerClearingHouse__factory,
+ CoolerClearingHouseV3__factory,
CoolerConsolidation__factory,
CrossChainBridge__factory,
CrossChainBridgeTestnet__factory,
@@ -167,6 +169,12 @@ export const COOLER_CLEARING_HOUSE_CONTRACT_V2 = new Contract({
addresses: COOLER_CLEARING_HOUSE_V2_ADDRESSES,
});
+export const COOLER_CLEARING_HOUSE_CONTRACT_V3 = new Contract({
+ factory: CoolerClearingHouseV3__factory,
+ name: "Cooler Clearing House Contract V3",
+ addresses: COOLER_CLEARING_HOUSE_V3_ADDRESSES,
+});
+
export const GOVERNANCE_CONTRACT = new Contract({
factory: OlympusGovernorBravo__factory,
name: "Governance Contract",
diff --git a/src/generated/coolerLoans.ts b/src/generated/coolerLoans.ts
index 7de9ad75f5..1ecc6c669c 100644
--- a/src/generated/coolerLoans.ts
+++ b/src/generated/coolerLoans.ts
@@ -46,12 +46,18 @@ export type GetSnapshotsParams = {
* Represents the state of the Treasury at the time of the snapshot.
*/
export type SnapshotTreasury = {
- /** Total balance of DAI in the active treasury */
+ /** Total balance of the DAI token in the active treasury */
daiBalance: number;
- /** Total balance of sDAI in the active treasury */
+ /** Total balance of the sDAI token in the active treasury */
sDaiBalance: number;
- /** Total balance of sDAI in terms of DAI in the active treasury */
+ /** Total balance of the sDAI token in terms of DAI in the active treasury */
sDaiInDaiBalance: number;
+ /** Total balance of the sUSDS token in the active treasury */
+ sUsdsBalance: number;
+ /** Total balance of the sUSDS token in terms of USDS in the active treasury */
+ sUsdsInUsdsBalance: number;
+ /** Total balance of the USDS token in the active treasury */
+ usdsBalance: number;
};
/**
@@ -86,12 +92,18 @@ export type SnapshotExpiryBuckets = {
* Totals for the Clearinghouses at the time of the snapshot.
*/
export type SnapshotClearinghouseTotals = {
- /** Total balance of DAI across all Clearinghouses */
+ /** Total balance of the DAI token across all Clearinghouses */
daiBalance: number;
- /** Total balance of sDAI across all Clearinghouses */
+ /** Total balance of the sDAI token across all Clearinghouses */
sDaiBalance: number;
- /** Total balance of sDAI in terms of DAI across all Clearinghouses */
+ /** Total balance of the sDAI token in terms of DAI across all Clearinghouses */
sDaiInDaiBalance: number;
+ /** Total balance of the sUSDS token across all Clearinghouses */
+ sUsdsBalance: number;
+ /** Total balance of the sUSDS token in terms of USDS across all Clearinghouses */
+ sUsdsInUsdsBalance: number;
+ /** Total balance of the USDS token across all Clearinghouses */
+ usdsBalance: number;
};
export type SnapshotClearinghousesItem = {
@@ -101,18 +113,18 @@ export type SnapshotClearinghousesItem = {
collateralAddress: string;
/** The address of the CoolerFactory */
coolerFactoryAddress: string;
- /** Balance of DAI */
- daiBalance: number;
/** The address of the debt */
debtAddress: string;
- /** Amount of DAI that the Clearinghouse should be funded with */
+ /** Amount of the reserve token that the Clearinghouse should be funded with */
fundAmount: number;
/** The cadence of the funding */
fundCadence: number;
- /** Balance of sDAI */
- sDaiBalance: number;
- /** Balance of sDAI in terms of DAI */
- sDaiInDaiBalance: number;
+ /** Balance of the reserve token */
+ reserveBalance: number;
+ /** Balance of the sReserve token */
+ sReserveBalance: number;
+ /** Balance of the sReserve token in terms of the reserve token */
+ sReserveInReserveBalance: number;
};
export type Snapshot = {
diff --git a/src/helpers/index.tsx b/src/helpers/index.tsx
index 9ee68b87ad..ed64c6897b 100644
--- a/src/helpers/index.tsx
+++ b/src/helpers/index.tsx
@@ -49,7 +49,7 @@ export function formatCurrency(c: number, precision = 0, currency = "USD") {
minimumFractionDigits: precision,
}).format(c);
if (currency === "OHM") return `${formatted} Ω`;
- if (currency === "DAI") return `${formatted} DAI`;
+ if (currency) return `${formatted} ${currency}`;
return formatted;
}
diff --git a/src/hooks/useScreenSize.ts b/src/hooks/useScreenSize.ts
index cec601193d..c99985ee35 100644
--- a/src/hooks/useScreenSize.ts
+++ b/src/hooks/useScreenSize.ts
@@ -5,14 +5,14 @@ export const useScreenSize = (size: "xs" | "sm" | "md" | "lg" | "xl") => {
size === "xs"
? "(max-width: 0px)"
: size === "sm"
- ? "(max-width: 600px)"
- : size === "md"
- ? "(max-width: 900px)"
- : size === "lg"
- ? "(max-width: 1200px)"
- : size === "xl"
- ? "(max-width: 153600px)"
- : "";
+ ? "(max-width: 600px)"
+ : size === "md"
+ ? "(max-width: 900px)"
+ : size === "lg"
+ ? "(max-width: 1200px)"
+ : size === "xl"
+ ? "(max-width: 153600px)"
+ : "";
return useMediaQuery(breakpoint);
};
diff --git a/src/hooks/useTheme.ts b/src/hooks/useTheme.ts
index 5193887e60..d182270f82 100644
--- a/src/hooks/useTheme.ts
+++ b/src/hooks/useTheme.ts
@@ -26,8 +26,8 @@ const useTheme = (): [string, (e: KeyboardEvent) => void, boolean] => {
window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches && !localTheme
? setMode("dark")
: localTheme
- ? setTheme(localTheme)
- : setMode("dark");
+ ? setTheme(localTheme)
+ : setMode("dark");
setMounted(true);
}, []);
diff --git a/src/views/Bond/components/BondModal/BondModal.tsx b/src/views/Bond/components/BondModal/BondModal.tsx
index f9a2a126cb..738c466abb 100644
--- a/src/views/Bond/components/BondModal/BondModal.tsx
+++ b/src/views/Bond/components/BondModal/BondModal.tsx
@@ -159,8 +159,8 @@ const TokenPrice: React.VFC<{ token: Token; isInverseBond?: boolean; baseSymbol:
const price = sameToken
? formatNumber(1, 2)
: isInverseBond
- ? formatNumber(ohmPrice, 2)
- : `${formatNumber(Number(priceToken.toString({ decimals: 2, format: true, trim: false })), 2)}`;
+ ? formatNumber(ohmPrice, 2)
+ : `${formatNumber(Number(priceToken.toString({ decimals: 2, format: true, trim: false })), 2)}`;
return price ? (
<>
{price} {isInverseBond ? baseSymbol : quoteSymbol}
diff --git a/src/views/Bond/components/BondModal/components/BondInputArea/BondInputArea.tsx b/src/views/Bond/components/BondModal/components/BondInputArea/BondInputArea.tsx
index 5d38d42a6b..eed5abc2d0 100644
--- a/src/views/Bond/components/BondModal/components/BondInputArea/BondInputArea.tsx
+++ b/src/views/Bond/components/BondModal/components/BondInputArea/BondInputArea.tsx
@@ -195,8 +195,8 @@ export const BondInputArea: React.VFC<{
{isInverseBond
? `${quoteTokenString} (≈${baseTokenString})`
: props.bond.baseToken === props.bond.quoteToken
- ? `${baseTokenString}`
- : `${baseTokenString} (≈${quoteTokenString})`}
+ ? `${baseTokenString}`
+ : `${baseTokenString} (≈${quoteTokenString})`}
}
/>
diff --git a/src/views/Bridge/components/BridgeConfirmModal.tsx b/src/views/Bridge/components/BridgeConfirmModal.tsx
index dec91af54c..b4f0efcc9b 100644
--- a/src/views/Bridge/components/BridgeConfirmModal.tsx
+++ b/src/views/Bridge/components/BridgeConfirmModal.tsx
@@ -118,12 +118,14 @@ export const BridgeConfirmModal = (props: {
{props.amountExceedsBalance
? "Amount exceeds balance"
: !props.amount || parseFloat(props.amount) === 0
- ? "Enter an amount"
- : !isValidAddress
- ? `Invalid recipient address: ${shorten(props.recipientAddress)}`
- : props.bridgeMutation.isLoading
- ? "Confirming Bridging in your wallet"
- : `Bridge OHM to ${BRIDGE_CHAINS[props.destinationChainId as keyof typeof BRIDGE_CHAINS].name}`}
+ ? "Enter an amount"
+ : !isValidAddress
+ ? `Invalid recipient address: ${shorten(props.recipientAddress)}`
+ : props.bridgeMutation.isLoading
+ ? "Confirming Bridging in your wallet"
+ : `Bridge OHM to ${
+ BRIDGE_CHAINS[props.destinationChainId as keyof typeof BRIDGE_CHAINS].name
+ }`}
>
diff --git a/src/views/Governance/Components/Status.tsx b/src/views/Governance/Components/Status.tsx
index ddebf01b36..b74c20226e 100644
--- a/src/views/Governance/Components/Status.tsx
+++ b/src/views/Governance/Components/Status.tsx
@@ -55,10 +55,12 @@ export const Status = ({ proposalId }: { proposalId: number }) => {