Skip to content

Commit

Permalink
Add implementation to ProxyType (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideSilva authored Feb 5, 2025
1 parent 87a270c commit f3ce623
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ pub enum ProxyType {
Comptroller(Address),
}

impl ProxyType {
pub fn implementation(&self) -> Address {
match self {
ProxyType::Eip1167(addr)
| ProxyType::Eip1967Direct(addr)
| ProxyType::Eip1967Beacon(addr)
| ProxyType::OpenZeppelin(addr)
| ProxyType::Eip897(addr)
| ProxyType::Safe(addr)
| ProxyType::Comptroller(addr) => *addr,
}
}
}

pub async fn detect_proxy<N, P: Provider<N>>(
address: Address,
provider: &P,
Expand Down

0 comments on commit f3ce623

Please sign in to comment.