Skip to content

Commit

Permalink
fixing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
etherhood committed Apr 21, 2024
1 parent 5be4043 commit fd509d6
Show file tree
Hide file tree
Showing 23 changed files with 8,382 additions and 6,164 deletions.
2 changes: 1 addition & 1 deletion app/src/db/morpho_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use ethers::prelude::*;
use eyre::{Ok, Result};
use log::info;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::{
collections::HashMap,
fs::{write, File},
io::{BufReader, Read},
};
Expand Down
3 changes: 1 addition & 2 deletions app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ use bindings::{
},
liquidator::Liquidator,
};
use ethers::prelude::*;
use ethers::{
abi::RawLog,
prelude::Middleware,
prelude::{Middleware, *},
providers::{Http, Provider, ProviderExt, StreamExt, Ws},
types::{Address, U64},
};
Expand Down
8 changes: 8 additions & 0 deletions contracts/test/Liquidator.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity 0.8.25;

import {Test} from "forge-std/Test.sol";

contract LiquidatorTest is Test {
function test_dummy() public {}
}
141 changes: 88 additions & 53 deletions crates/bindings/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub use address::*;
clippy::upper_case_acronyms,
clippy::type_complexity,
dead_code,
non_camel_case_types
non_camel_case_types,
)]
pub mod address {
#[allow(deprecated)]
Expand All @@ -19,55 +19,70 @@ pub mod address {
errors: ::core::convert::From::from([
(
::std::borrow::ToOwned::to_owned("AddressEmptyCode"),
::std::vec![::ethers::core::abi::ethabi::AbiError {
name: ::std::borrow::ToOwned::to_owned("AddressEmptyCode"),
inputs: ::std::vec![::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("target"),
kind: ::ethers::core::abi::ethabi::ParamType::Address,
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("address"),
),
},],
},],
::std::vec![
::ethers::core::abi::ethabi::AbiError {
name: ::std::borrow::ToOwned::to_owned("AddressEmptyCode"),
inputs: ::std::vec![
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("target"),
kind: ::ethers::core::abi::ethabi::ParamType::Address,
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("address"),
),
},
],
},
],
),
(
::std::borrow::ToOwned::to_owned("AddressInsufficientBalance"),
::std::vec![::ethers::core::abi::ethabi::AbiError {
name: ::std::borrow::ToOwned::to_owned("AddressInsufficientBalance",),
inputs: ::std::vec![::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("account"),
kind: ::ethers::core::abi::ethabi::ParamType::Address,
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("address"),
::std::vec![
::ethers::core::abi::ethabi::AbiError {
name: ::std::borrow::ToOwned::to_owned(
"AddressInsufficientBalance",
),
},],
},],
inputs: ::std::vec![
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("account"),
kind: ::ethers::core::abi::ethabi::ParamType::Address,
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("address"),
),
},
],
},
],
),
(
::std::borrow::ToOwned::to_owned("FailedInnerCall"),
::std::vec![::ethers::core::abi::ethabi::AbiError {
name: ::std::borrow::ToOwned::to_owned("FailedInnerCall"),
inputs: ::std::vec![],
},],
::std::vec![
::ethers::core::abi::ethabi::AbiError {
name: ::std::borrow::ToOwned::to_owned("FailedInnerCall"),
inputs: ::std::vec![],
},
],
),
]),
receive: false,
fallback: false,
}
}
///The parsed JSON ABI of the contract.
pub static ADDRESS_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> =
::ethers::contract::Lazy::new(__abi);
pub static ADDRESS_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = ::ethers::contract::Lazy::new(
__abi,
);
#[rustfmt::skip]
const __BYTECODE: &[u8] = b"`U`2`\x0B\x82\x82\x829\x80Q_\x1A`s\x14`&WcNH{q`\xE0\x1B_R_`\x04R`$_\xFD[0_R`s\x81S\x82\x81\xF3\xFEs\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R_\x80\xFD\xFE\xA2dipfsX\"\x12 \xFC\xF5\xD2\xF2\xA1\xC4:7\xC9\xEFK\xBA\xE1\x08EhY\xBB\x19N\xFB7w\xC4\x80\xB5\xFB]f\x80\xAE\x97dsolcC\0\x08\x19\x003";
/// The bytecode of the contract.
pub static ADDRESS_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__BYTECODE);
pub static ADDRESS_BYTECODE: ::ethers::core::types::Bytes = ::ethers::core::types::Bytes::from_static(
__BYTECODE,
);
#[rustfmt::skip]
const __DEPLOYED_BYTECODE: &[u8] = b"s\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R_\x80\xFD\xFE\xA2dipfsX\"\x12 \xFC\xF5\xD2\xF2\xA1\xC4:7\xC9\xEFK\xBA\xE1\x08EhY\xBB\x19N\xFB7w\xC4\x80\xB5\xFB]f\x80\xAE\x97dsolcC\0\x08\x19\x003";
/// The deployed bytecode of the contract.
pub static ADDRESS_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE);
pub static ADDRESS_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = ::ethers::core::types::Bytes::from_static(
__DEPLOYED_BYTECODE,
);
pub struct Address<M>(::ethers::contract::Contract<M>);
impl<M> ::core::clone::Clone for Address<M> {
fn clone(&self) -> Self {
Expand Down Expand Up @@ -97,7 +112,13 @@ pub mod address {
address: T,
client: ::std::sync::Arc<M>,
) -> Self {
Self(::ethers::contract::Contract::new(address.into(), ADDRESS_ABI.clone(), client))
Self(
::ethers::contract::Contract::new(
address.into(),
ADDRESS_ABI.clone(),
client,
),
)
}
/// Constructs the general purpose `Deployer` instance based on the provided constructor arguments and sends it.
/// Returns a new instance of a deployer that returns an instance of this contract after sending the transaction
Expand Down Expand Up @@ -139,7 +160,8 @@ pub mod address {
Ok(deployer)
}
}
impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>> for Address<M> {
impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>>
for Address<M> {
fn from(contract: ::ethers::contract::Contract<M>) -> Self {
Self::new(contract.address(), contract.client())
}
Expand All @@ -155,7 +177,7 @@ pub mod address {
Debug,
PartialEq,
Eq,
Hash,
Hash
)]
#[etherror(name = "AddressEmptyCode", abi = "AddressEmptyCode(address)")]
pub struct AddressEmptyCode {
Expand All @@ -172,9 +194,12 @@ pub mod address {
Debug,
PartialEq,
Eq,
Hash,
Hash
)]
#[etherror(
name = "AddressInsufficientBalance",
abi = "AddressInsufficientBalance(address)"
)]
#[etherror(name = "AddressInsufficientBalance", abi = "AddressInsufficientBalance(address)")]
pub struct AddressInsufficientBalance {
pub account: ::ethers::core::types::Address,
}
Expand All @@ -189,7 +214,7 @@ pub mod address {
Debug,
PartialEq,
Eq,
Hash,
Hash
)]
#[etherror(name = "FailedInnerCall", abi = "FailedInnerCall()")]
pub struct FailedInnerCall;
Expand All @@ -202,7 +227,7 @@ pub mod address {
Debug,
PartialEq,
Eq,
Hash,
Hash
)]
pub enum AddressErrors {
AddressEmptyCode(AddressEmptyCode),
Expand All @@ -217,21 +242,24 @@ pub mod address {
data: impl AsRef<[u8]>,
) -> ::core::result::Result<Self, ::ethers::core::abi::AbiError> {
let data = data.as_ref();
if let Ok(decoded) =
<::std::string::String as ::ethers::core::abi::AbiDecode>::decode(data)
{
if let Ok(decoded) = <::std::string::String as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::RevertString(decoded));
}
if let Ok(decoded) = <AddressEmptyCode as ::ethers::core::abi::AbiDecode>::decode(data)
{
if let Ok(decoded) = <AddressEmptyCode as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::AddressEmptyCode(decoded));
}
if let Ok(decoded) =
<AddressInsufficientBalance as ::ethers::core::abi::AbiDecode>::decode(data)
{
if let Ok(decoded) = <AddressInsufficientBalance as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::AddressInsufficientBalance(decoded));
}
if let Ok(decoded) = <FailedInnerCall as ::ethers::core::abi::AbiDecode>::decode(data) {
if let Ok(decoded) = <FailedInnerCall as ::ethers::core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::FailedInnerCall(decoded));
}
Err(::ethers::core::abi::Error::InvalidData.into())
Expand All @@ -240,11 +268,15 @@ pub mod address {
impl ::ethers::core::abi::AbiEncode for AddressErrors {
fn encode(self) -> ::std::vec::Vec<u8> {
match self {
Self::AddressEmptyCode(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::AddressEmptyCode(element) => {
::ethers::core::abi::AbiEncode::encode(element)
}
Self::AddressInsufficientBalance(element) => {
::ethers::core::abi::AbiEncode::encode(element)
}
Self::FailedInnerCall(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::FailedInnerCall(element) => {
::ethers::core::abi::AbiEncode::encode(element)
}
Self::RevertString(s) => ::ethers::core::abi::AbiEncode::encode(s),
}
}
Expand All @@ -253,15 +285,16 @@ pub mod address {
fn valid_selector(selector: [u8; 4]) -> bool {
match selector {
[0x08, 0xc3, 0x79, 0xa0] => true,
_ if selector == <AddressEmptyCode as ::ethers::contract::EthError>::selector() => {
_ if selector
== <AddressEmptyCode as ::ethers::contract::EthError>::selector() => {
true
}
_ if selector
== <AddressInsufficientBalance as ::ethers::contract::EthError>::selector() =>
{
== <AddressInsufficientBalance as ::ethers::contract::EthError>::selector() => {
true
}
_ if selector == <FailedInnerCall as ::ethers::contract::EthError>::selector() => {
_ if selector
== <FailedInnerCall as ::ethers::contract::EthError>::selector() => {
true
}
_ => false,
Expand All @@ -272,7 +305,9 @@ pub mod address {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::AddressEmptyCode(element) => ::core::fmt::Display::fmt(element, f),
Self::AddressInsufficientBalance(element) => ::core::fmt::Display::fmt(element, f),
Self::AddressInsufficientBalance(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::FailedInnerCall(element) => ::core::fmt::Display::fmt(element, f),
Self::RevertString(s) => ::core::fmt::Display::fmt(s, f),
}
Expand Down
Loading

0 comments on commit fd509d6

Please sign in to comment.