Skip to content

Commit

Permalink
UX Improvements (#258)
Browse files Browse the repository at this point in the history
Co-authored-by: David Salami <[email protected]>
  • Loading branch information
seunlanlege and Wizdave97 committed Jul 18, 2024
1 parent bd07af8 commit d014520
Show file tree
Hide file tree
Showing 108 changed files with 3,306 additions and 1,930 deletions.
20 changes: 18 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ members = [

# simnode
"parachain/simtests",
# subxt subxt-utils
"modules/subxt/utils",

# Utilities
"modules/utils/subxt",
"modules/utils/serde",

# tesseract
"tesseract/primitives",
Expand Down Expand Up @@ -234,8 +236,9 @@ ismp = { version = "0.1.2", path = "./modules/ismp/core", default-features = fal
ismp-testsuite = { path = "./modules/ismp/testsuite" }
ismp-solidity-abi = { path = "./evm/abi", default-features = false }
simnode-tests = { path = "parachain/simtests" }
subxt-utils = { path = "modules/subxt/utils", default-features = false }
hyperclient = { path = "modules/hyperclient", default-features = false }
subxt-utils = { path = "modules/utils/subxt", default-features = false }
serde-utils = { path = "modules/utils/serde", default-features = false }

# consensus provers & verifiers
beefy-verifier-primitives = { path = "./modules/consensus/beefy/primitives", default-features = false }
Expand Down
60 changes: 58 additions & 2 deletions docs/pages/developers/evm/contract-addresses.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,67 @@
The ISMP solidity contracts are deployed on the following networks:


## Gargantua V3 (Paseo)

The current testnet environment for the Hyperbridge network.

## Gargantua V2 (Paseo)
### Ethereum Sepolia

The current testnet environment for the Hyperbridge network.
| `HandlerV1` | [`0xc449D4bc3fD5A434aC9e11a53f60c7efc908e638`](https://sepolia.etherscan.io/address/0xc449D4bc3fD5A434aC9e11a53f60c7efc908e638) |
|:------------|:-----|
| `IsmpHost` | [`0x4175a96bd787a2C196e732a1244630650607fdC2`](https://sepolia.etherscan.io/address/0x4175a96bd787a2C196e732a1244630650607fdC2) |
| `PingModule` | [`0x8E4Ca395cfAa033A71fC618792Fce99106633B90`](https://sepolia.etherscan.io/address/0x8E4Ca395cfAa033A71fC618792Fce99106633B90) |
| `TokenGateway` | [`0x5B39F339c24c6645cc47FEeFBb01b1f7fBA59751`](https://sepolia.etherscan.io/address/0x5B39F339c24c6645cc47FEeFBb01b1f7fBA59751) |
| `TokenFaucet` | [`0x5b90b886d302c7DEbA10a2E02c521B3bE930070B`](https://sepolia.etherscan.io/address/0x5b90b886d302c7DEbA10a2E02c521B3bE930070B) |
| `FeeToken (USD.h)` | [`0x83311D74692ce1A8859F908880b3EdEC67f05997`](https://sepolia.etherscan.io/address/0x83311D74692ce1A8859F908880b3EdEC67f05997) |

### Arbitrum Sepolia


| `HandlerV1` | [`0x47df392E8B8F80AFe8571159beA5D4904CdD2dd6`](https://sepolia.arbiscan.io/address/0x47df392E8B8F80AFe8571159beA5D4904CdD2dd6) |
|:------------|:-----|
| `IsmpHost` | [`0xC8A9288BF705A238c3d96C76499F4A4E1d96c800`](https://sepolia.arbiscan.io/address/0xC8A9288BF705A238c3d96C76499F4A4E1d96c800) |
| `PingModule` | [`0x8E4Ca395cfAa033A71fC618792Fce99106633B90`](https://sepolia.arbiscan.io/address/0x8E4Ca395cfAa033A71fC618792Fce99106633B90) |
| `TokenGateway` | [`0x5B39F339c24c6645cc47FEeFBb01b1f7fBA59751`](https://sepolia.arbiscan.io/address/0x5B39F339c24c6645cc47FEeFBb01b1f7fBA59751) |
| `TokenFaucet` | [`0x5b90b886d302c7DEbA10a2E02c521B3bE930070B`](https://sepolia.arbiscan.io/address/0x5b90b886d302c7DEbA10a2E02c521B3bE930070B) |
| `FeeToken (USD.h)` | [`0x83311D74692ce1A8859F908880b3EdEC67f05997`](https://sepolia.arbiscan.io/address/0x83311D74692ce1A8859F908880b3EdEC67f05997) |

### Optimism Sepolia


| `HandlerV1` | [`0xB9Ffd43C720A695d40C14896494c1461f3fBb8A7`](https://sepolia-optimism.etherscan.io/address/0xB9Ffd43C720A695d40C14896494c1461f3fBb8A7) |
|:------------|:-----|
| `IsmpHost` | [`0x265FafEb401ac6491da7344F01E724c38bC68FED`](https://sepolia-optimism.etherscan.io/address/0x265FafEb401ac6491da7344F01E724c38bC68FED) |
| `PingModule` | [`0x8E4Ca395cfAa033A71fC618792Fce99106633B90`](https://sepolia-optimism.etherscan.io/address/0x8E4Ca395cfAa033A71fC618792Fce99106633B90) |
| `TokenGateway` | [`0x5B39F339c24c6645cc47FEeFBb01b1f7fBA59751`](https://sepolia-optimism.etherscan.io/address/0x5B39F339c24c6645cc47FEeFBb01b1f7fBA59751) |
| `TokenFaucet` | [`0x5b90b886d302c7DEbA10a2E02c521B3bE930070B`](https://sepolia-optimism.etherscan.io/address/0x5b90b886d302c7DEbA10a2E02c521B3bE930070B) |
| `FeeToken (USD.h)` | [`0x83311D74692ce1A8859F908880b3EdEC67f05997`](https://sepolia-optimism.etherscan.io/address/0x83311D74692ce1A8859F908880b3EdEC67f05997) |

### Base Sepolia


| `HandlerV1` | [`0xc76c16539877C0c38c18E815E449Ff4855DA11d4`](https://sepolia.basescan.org/address/0xc76c16539877C0c38c18E815E449Ff4855DA11d4) |
|:------------|:-----|
| `IsmpHost` | [`0x42D2cd76413Df482156a135A54017c61AA612dA3`](https://sepolia.basescan.org/address/0x42D2cd76413Df482156a135A54017c61AA612dA3) |
| `PingModule` | [`0x8E4Ca395cfAa033A71fC618792Fce99106633B90`](https://sepolia.basescan.org/address/0x8E4Ca395cfAa033A71fC618792Fce99106633B90) |
| `TokenGateway` | [`0x5B39F339c24c6645cc47FEeFBb01b1f7fBA59751`](https://sepolia.basescan.org/address/0x5B39F339c24c6645cc47FEeFBb01b1f7fBA59751) |
| `TokenFaucet` | [`0x5b90b886d302c7DEbA10a2E02c521B3bE930070B`](https://sepolia.basescan.org/address/0x5b90b886d302c7DEbA10a2E02c521B3bE930070B) |
| `FeeToken (USD.h)` | [`0x83311D74692ce1A8859F908880b3EdEC67f05997`](https://sepolia.basescan.org/address/0x83311D74692ce1A8859F908880b3EdEC67f05997) |

### Bsc Testnet


| `HandlerV1` | [`0x698Ea102d14dF1F9a4C3A76fE5DCEEeFcfd27f85`](https://testnet.bscscan.com/address/0x698Ea102d14dF1F9a4C3A76fE5DCEEeFcfd27f85) |
|:------------|:-----|
| `IsmpHost` | [`0x9494400D1A8285F81604AC04ACFD839385B3b843`](https://testnet.bscscan.com/address/0x9494400D1A8285F81604AC04ACFD839385B3b843) |
| `PingModule` | [`0x8E4Ca395cfAa033A71fC618792Fce99106633B90`](https://testnet.bscscan.com/address/0x8E4Ca395cfAa033A71fC618792Fce99106633B90) |
| `TokenGateway` | [`0x5B39F339c24c6645cc47FEeFBb01b1f7fBA59751`](https://testnet.bscscan.com/address/0x5B39F339c24c6645cc47FEeFBb01b1f7fBA59751) |
| `TokenFaucet` | [`0x5b90b886d302c7DEbA10a2E02c521B3bE930070B`](https://testnet.bscscan.com/address/0x5b90b886d302c7DEbA10a2E02c521B3bE930070B) |
| `FeeToken (USD.h)` | [`0x83311D74692ce1A8859F908880b3EdEC67f05997`](https://testnet.bscscan.com/address/0x83311D74692ce1A8859F908880b3EdEC67f05997) |

## Gargantua V2 (Paseo) (Deprecated)

Deprecated testnet environment for Gargantua V2 (Paseo).

### Ethereum Sepolia

Expand Down
4 changes: 1 addition & 3 deletions docs/pages/developers/network/relayer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ consensus_state_id = "ETH0"
# Bsc on the other hand uses the BNB token and would need its own API key
# gotten from bscscan
etherscan_api_key = ""
# The Handler contract address on this chain
handler = ""
# The IsmpHost contract address on this chain
ismp_host = ""
# (Optional)
Expand Down Expand Up @@ -238,7 +236,7 @@ gas_price_buffer = 1
# client_type = Geth
# client_type = Erigon
# If this field is not set, the default is Geth
client_type = Erigon
client_type = "Erigon"

[substrate]
type = "substrate"
Expand Down
69 changes: 28 additions & 41 deletions evm/abi/src/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,24 +210,24 @@ impl From<router::PostResponse> for PostResponse {
}
}

impl From<router::Post> for PostRequest {
fn from(value: router::Post) -> Self {
impl From<router::PostRequest> for PostRequest {
fn from(value: router::PostRequest) -> Self {
PostRequest {
source: value.source.to_string().as_bytes().to_vec().into(),
dest: value.dest.to_string().as_bytes().to_vec().into(),
nonce: value.nonce.into(),
from: value.from.into(),
to: value.to.into(),
timeout_timestamp: value.timeout_timestamp.into(),
body: value.data.into(),
body: value.body.into(),
}
}
}

impl TryFrom<PostRequest> for router::Post {
impl TryFrom<PostRequest> for router::PostRequest {
type Error = anyhow::Error;
fn try_from(value: PostRequest) -> Result<Self, Self::Error> {
Ok(router::Post {
Ok(router::PostRequest {
source: StateMachine::from_str(&String::from_utf8(value.source.to_vec())?)
.map_err(|err| anyhow!("{err}"))?,
dest: StateMachine::from_str(&String::from_utf8(value.dest.to_vec())?)
Expand All @@ -236,7 +236,7 @@ impl TryFrom<PostRequest> for router::Post {
from: value.from.to_vec(),
to: value.to.to_vec(),
timeout_timestamp: value.timeout_timestamp.into(),
data: value.body.to_vec(),
body: value.body.to_vec(),
})
}
}
Expand Down Expand Up @@ -269,11 +269,9 @@ impl TryFrom<EvmHostEvents> for ismp::events::Event {
fn try_from(event: EvmHostEvents) -> Result<Self, Self::Error> {
match event {
EvmHostEvents::GetRequestEventFilter(get) =>
Ok(ismp::events::Event::GetRequest(router::Get {
source: StateMachine::from_str(&String::from_utf8(get.source.0.into())?)
.map_err(|e| anyhow!("{}", e))?,
dest: StateMachine::from_str(&String::from_utf8(get.dest.0.into())?)
.map_err(|e| anyhow!("{}", e))?,
Ok(ismp::events::Event::GetRequest(router::GetRequest {
source: StateMachine::from_str(&get.source).map_err(|e| anyhow!("{}", e))?,
dest: StateMachine::from_str(&get.dest).map_err(|e| anyhow!("{}", e))?,
nonce: get.nonce.low_u64(),
from: get.from.0.into(),
keys: get.keys.into_iter().map(|key| key.0.into()).collect(),
Expand All @@ -284,19 +282,17 @@ impl TryFrom<EvmHostEvents> for ismp::events::Event {
Ok(ismp::events::Event::PostRequest(post.try_into()?)),
EvmHostEvents::PostResponseEventFilter(resp) =>
Ok(ismp::events::Event::PostResponse(router::PostResponse {
post: router::Post {
source: StateMachine::from_str(&String::from_utf8(resp.source.0.into())?)
.map_err(|e| anyhow!("{}", e))?,
dest: StateMachine::from_str(&String::from_utf8(resp.dest.0.into())?)
.map_err(|e| anyhow!("{}", e))?,
post: router::PostRequest {
source: StateMachine::from_str(&resp.dest).map_err(|e| anyhow!("{}", e))?,
dest: StateMachine::from_str(&resp.source).map_err(|e| anyhow!("{}", e))?,
nonce: resp.nonce.low_u64(),
from: resp.from.0.into(),
to: resp.to.0.into(),
from: resp.to.0.into(),
to: resp.from.0.into(),
timeout_timestamp: resp.timeout_timestamp.low_u64(),
data: resp.data.0.into(),
body: resp.body.0.into(),
},
response: resp.response.0.into(),
timeout_timestamp: resp.res_timeout_timestamp.low_u64(),
timeout_timestamp: resp.response_timeout_timestamp.low_u64(),
})),
EvmHostEvents::PostRequestHandledFilter(handled) =>
Ok(ismp::events::Event::PostRequestHandled(ismp::events::RequestResponseHandled {
Expand All @@ -317,35 +313,30 @@ impl TryFrom<EvmHostEvents> for ismp::events::Event {
EvmHostEvents::StateMachineUpdatedFilter(filter) =>
Ok(ismp::events::Event::StateMachineUpdated(StateMachineUpdated {
state_machine_id: ismp::consensus::StateMachineId {
state_id: StateMachine::from_str(&String::from_utf8(
filter.state_machine_id.to_vec(),
)?)
.map_err(|e| anyhow!("{}", e))?,
state_id: StateMachine::from_str(&filter.state_machine_id)
.map_err(|e| anyhow!("{}", e))?,
consensus_state_id: Default::default(),
},
latest_height: filter.height.low_u64(),
})),
EvmHostEvents::PostRequestTimeoutHandledFilter(handled) => {
let dest = StateMachine::from_str(&String::from_utf8(handled.dest.to_vec())?)
.map_err(|e| anyhow!("{}", e))?;
let dest = StateMachine::from_str(&handled.dest).map_err(|e| anyhow!("{}", e))?;
Ok(ismp::events::Event::PostRequestTimeoutHandled(TimeoutHandled {
commitment: handled.commitment.into(),
dest: dest.clone(),
source: dest.clone(),
}))
},
EvmHostEvents::PostResponseTimeoutHandledFilter(handled) => {
let dest = StateMachine::from_str(&String::from_utf8(handled.dest.to_vec())?)
.map_err(|e| anyhow!("{}", e))?;
let dest = StateMachine::from_str(&handled.dest).map_err(|e| anyhow!("{}", e))?;
Ok(ismp::events::Event::PostResponseTimeoutHandled(TimeoutHandled {
commitment: handled.commitment.into(),
dest: dest.clone(),
source: dest.clone(),
}))
},
EvmHostEvents::GetRequestTimeoutHandledFilter(handled) => {
let dest = StateMachine::from_str(&String::from_utf8(handled.dest.to_vec())?)
.map_err(|e| anyhow!("{}", e))?;
let dest = StateMachine::from_str(&handled.dest).map_err(|e| anyhow!("{}", e))?;
Ok(ismp::events::Event::GetRequestTimeoutHandled(TimeoutHandled {
commitment: handled.commitment.into(),
dest: dest.clone(),
Expand All @@ -356,10 +347,8 @@ impl TryFrom<EvmHostEvents> for ismp::events::Event {
Ok(ismp::events::Event::StateCommitmentVetoed(StateCommitmentVetoed {
height: ismp::consensus::StateMachineHeight {
id: StateMachineId {
state_id: StateMachine::from_str(&String::from_utf8(
vetoed.state_machine_id.to_vec(),
)?)
.map_err(|e| anyhow!("{}", e))?,
state_id: StateMachine::from_str(&vetoed.state_machine_id)
.map_err(|e| anyhow!("{}", e))?,
consensus_state_id: Default::default(),
},
height: vetoed.height.low_u64(),
Expand All @@ -375,20 +364,18 @@ impl TryFrom<EvmHostEvents> for ismp::events::Event {
}
}

impl TryFrom<PostRequestEventFilter> for router::Post {
impl TryFrom<PostRequestEventFilter> for router::PostRequest {
type Error = anyhow::Error;

fn try_from(post: PostRequestEventFilter) -> Result<Self, Self::Error> {
Ok(router::Post {
source: StateMachine::from_str(&String::from_utf8(post.source.0.into())?)
.map_err(|e| anyhow!("{}", e))?,
dest: StateMachine::from_str(&String::from_utf8(post.dest.0.into())?)
.map_err(|e| anyhow!("{}", e))?,
Ok(router::PostRequest {
source: StateMachine::from_str(&post.source).map_err(|e| anyhow!("{}", e))?,
dest: StateMachine::from_str(&post.dest).map_err(|e| anyhow!("{}", e))?,
nonce: post.nonce.low_u64(),
from: post.from.0.into(),
to: post.to.0.into(),
timeout_timestamp: post.timeout_timestamp.low_u64(),
data: post.data.0.into(),
body: post.body.0.into(),
})
}
}
Expand Down
Loading

0 comments on commit d014520

Please sign in to comment.