[
    {
        "type": "impl",
        "name": "TroveImpl",
        "interface_name": "liquity::interfaces::itrove::ITrove"
    },
    {
        "type": "struct",
        "name": "core::integer::u256",
        "members": [
            {
                "name": "low",
                "type": "core::integer::u128"
            },
            {
                "name": "high",
                "type": "core::integer::u128"
            }
        ]
    },
    {
        "type": "struct",
        "name": "core::starknet::eth_address::EthAddress",
        "members": [
            {
                "name": "address",
                "type": "core::felt252"
            }
        ]
    },
    {
        "type": "interface",
        "name": "liquity::interfaces::itrove::ITrove",
        "items": [
            {
                "type": "function",
                "name": "get_batch_counter",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_batch_timestamp",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::integer::u64"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_gas_tank",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_user_amount_for_nonce",
                "inputs": [
                    {
                        "name": "nonce",
                        "type": "core::integer::u256"
                    },
                    {
                        "name": "user",
                        "type": "core::starknet::contract_address::ContractAddress"
                    }
                ],
                "outputs": [
                    {
                        "type": "(core::integer::u256, core::integer::u256)"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_user_gas_for_nonce",
                "inputs": [
                    {
                        "name": "nonce",
                        "type": "core::integer::u256"
                    },
                    {
                        "name": "user",
                        "type": "core::starknet::contract_address::ContractAddress"
                    }
                ],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_users_for_nonce",
                "inputs": [
                    {
                        "name": "nonce",
                        "type": "core::integer::u256"
                    }
                ],
                "outputs": [
                    {
                        "type": "(core::array::Array::<core::starknet::contract_address::ContractAddress>, core::array::Array::<core::starknet::contract_address::ContractAddress>)"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_user_debt",
                "inputs": [
                    {
                        "name": "user",
                        "type": "core::starknet::contract_address::ContractAddress"
                    }
                ],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_user_pending_debt",
                "inputs": [
                    {
                        "name": "user",
                        "type": "core::starknet::contract_address::ContractAddress"
                    }
                ],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_last_handled_batch",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "calculate_batch_gas_fee",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_l1_total_supply",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_l1_total_debt",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_fees_collector",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::starknet::contract_address::ContractAddress"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_timestamp_closed_batch",
                "inputs": [
                    {
                        "name": "nonce",
                        "type": "core::integer::u256"
                    }
                ],
                "outputs": [
                    {
                        "type": "core::integer::u64"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "set_relayer",
                "inputs": [
                    {
                        "name": "relayer",
                        "type": "core::starknet::contract_address::ContractAddress"
                    }
                ],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "set_batch_gas_unit_per_user",
                "inputs": [
                    {
                        "name": "gas_unit_per_user",
                        "type": "core::integer::u256"
                    }
                ],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "set_fees_collector",
                "inputs": [
                    {
                        "name": "fees_collector",
                        "type": "core::starknet::contract_address::ContractAddress"
                    }
                ],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "set_l1_gas_price_oracle_address",
                "inputs": [
                    {
                        "name": "l1_gas_price_oracle_address",
                        "type": "core::starknet::contract_address::ContractAddress"
                    }
                ],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "set_batch_gas_unit",
                "inputs": [
                    {
                        "name": "gas_unit",
                        "type": "core::integer::u256"
                    }
                ],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "set_l1_liquity_address",
                "inputs": [
                    {
                        "name": "new_l1_liquity",
                        "type": "core::starknet::eth_address::EthAddress"
                    }
                ],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "get_l1_liquity_address",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::starknet::eth_address::EthAddress"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_relayer",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::starknet::contract_address::ContractAddress"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_batch_gas_unit_per_user",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_l1_gas_price_oracle_address",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::starknet::contract_address::ContractAddress"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_l1_gas_price",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_l1_last_update",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::integer::u64"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_batch_gas_unit",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_batch_gas_fee_per_user",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_total_gas_batch",
                "inputs": [
                    {
                        "name": "nonce",
                        "type": "core::integer::u256"
                    }
                ],
                "outputs": [
                    {
                        "type": "core::integer::u256"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "get_owner",
                "inputs": [],
                "outputs": [
                    {
                        "type": "core::starknet::contract_address::ContractAddress"
                    }
                ],
                "state_mutability": "view"
            },
            {
                "type": "function",
                "name": "borrow",
                "inputs": [
                    {
                        "name": "eth_amount",
                        "type": "core::integer::u256"
                    },
                    {
                        "name": "paid_gas",
                        "type": "core::integer::u256"
                    }
                ],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "repay",
                "inputs": [
                    {
                        "name": "usd_amount",
                        "type": "core::integer::u256"
                    },
                    {
                        "name": "paid_gas",
                        "type": "core::integer::u256"
                    }
                ],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "batch",
                "inputs": [],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "pause",
                "inputs": [],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "unpause",
                "inputs": [],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "pause_borrow",
                "inputs": [],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "unpause_borrow",
                "inputs": [],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "pause_repay",
                "inputs": [],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "unpause_repay",
                "inputs": [],
                "outputs": [],
                "state_mutability": "external"
            },
            {
                "type": "function",
                "name": "update_class_hash",
                "inputs": [
                    {
                        "name": "class_hash",
                        "type": "core::felt252"
                    }
                ],
                "outputs": [],
                "state_mutability": "external"
            }
        ]
    },
    {
        "type": "struct",
        "name": "liquity::interfaces::iliquity_manager::ILiquityManagerDispatcher",
        "members": [
            {
                "name": "contract_address",
                "type": "core::starknet::contract_address::ContractAddress"
            }
        ]
    },
    {
        "type": "constructor",
        "name": "constructor",
        "inputs": [
            {
                "name": "owner",
                "type": "core::starknet::contract_address::ContractAddress"
            },
            {
                "name": "liquity_manager",
                "type": "liquity::interfaces::iliquity_manager::ILiquityManagerDispatcher"
            }
        ]
    },
    {
        "type": "l1_handler",
        "name": "handle_response",
        "inputs": [
            {
                "name": "from_address",
                "type": "core::felt252"
            },
            {
                "name": "nonce",
                "type": "core::integer::u256"
            },
            {
                "name": "usd_amount",
                "type": "core::integer::u256"
            },
            {
                "name": "total_supply",
                "type": "core::integer::u256"
            },
            {
                "name": "total_debt",
                "type": "core::integer::u256"
            },
            {
                "name": "eth_amount",
                "type": "core::integer::u256"
            },
            {
                "name": "closed",
                "type": "core::felt252"
            }
        ],
        "outputs": [],
        "state_mutability": "external"
    },
    {
        "type": "enum",
        "name": "liquity::action::Action",
        "variants": [
            {
                "name": "Borrow",
                "type": "()"
            },
            {
                "name": "Repay",
                "type": "()"
            }
        ]
    },
    {
        "type": "event",
        "name": "liquity::trove::Trove::ActionProcessed",
        "kind": "struct",
        "members": [
            {
                "name": "nonce",
                "type": "core::integer::u256",
                "kind": "data"
            },
            {
                "name": "action",
                "type": "liquity::action::Action",
                "kind": "data"
            },
            {
                "name": "user",
                "type": "core::starknet::contract_address::ContractAddress",
                "kind": "data"
            },
            {
                "name": "amount",
                "type": "core::integer::u256",
                "kind": "data"
            }
        ]
    },
    {
        "type": "event",
        "name": "liquity::trove::Trove::BatchRequest",
        "kind": "struct",
        "members": [
            {
                "name": "nonce",
                "type": "core::integer::u256",
                "kind": "data"
            },
            {
                "name": "total_borrowed_amount",
                "type": "core::integer::u256",
                "kind": "data"
            },
            {
                "name": "total_repaid_amount",
                "type": "core::integer::u256",
                "kind": "data"
            }
        ]
    },
    {
        "type": "event",
        "name": "liquity::trove::Trove::BatchResponse",
        "kind": "struct",
        "members": [
            {
                "name": "nonce",
                "type": "core::integer::u256",
                "kind": "data"
            },
            {
                "name": "usd_amount",
                "type": "core::integer::u256",
                "kind": "data"
            },
            {
                "name": "eth_amount",
                "type": "core::integer::u256",
                "kind": "data"
            }
        ]
    },
    {
        "type": "event",
        "name": "liquity::trove::Trove::TroveClosed",
        "kind": "struct",
        "members": []
    },
    {
        "type": "event",
        "name": "liquity::trove::Trove::RelayerSet",
        "kind": "struct",
        "members": [
            {
                "name": "address",
                "type": "core::starknet::contract_address::ContractAddress",
                "kind": "data"
            }
        ]
    },
    {
        "type": "event",
        "name": "liquity::trove::Trove::Event",
        "kind": "enum",
        "variants": [
            {
                "name": "ActionProcessed",
                "type": "liquity::trove::Trove::ActionProcessed",
                "kind": "nested"
            },
            {
                "name": "BatchRequest",
                "type": "liquity::trove::Trove::BatchRequest",
                "kind": "nested"
            },
            {
                "name": "BatchResponse",
                "type": "liquity::trove::Trove::BatchResponse",
                "kind": "nested"
            },
            {
                "name": "TroveClosed",
                "type": "liquity::trove::Trove::TroveClosed",
                "kind": "nested"
            },
            {
                "name": "RelayerSet",
                "type": "liquity::trove::Trove::RelayerSet",
                "kind": "nested"
            }
        ]
    }
]
