Skip to content
This repository was archived by the owner on Jul 31, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4847f3f
feat: init track 1-xcm-hyperbridge
0xharryriddle Dec 31, 2025
f130d9e
feat: modified the TokenBridge contract and added frontend by dotui
0xharryriddle Jan 1, 2026
e98f4ef
feat: updated the tokenBridge contract implementation and built succe…
0xharryriddle Jan 1, 2026
c6130a1
feat: updated contracts implementations, tested TokenBridge and expla…
0xharryriddle Jan 1, 2026
95a0fd0
feat: updated the UI for hyperbridge frontend
0xharryriddle Jan 2, 2026
72358fe
minor: update README.md to check the frontend step 1
0xharryriddle Jan 2, 2026
9c8dcfa
feat: deployed contracts in Sepolia & OP Sepolia, added Faucet tokens…
0xharryriddle Jan 3, 2026
2730964
feat: updated and redeployed TokenBridge in OP Sepolia and Bridged su…
0xharryriddle Jan 4, 2026
17f064f
feat: updated bridge config in frontend
0xharryriddle Jan 5, 2026
ad569b8
feat: added frontend for agent kit
0xharryriddle Jan 5, 2026
e232fb1
feat: added scripts and tests for contracts
0xharryriddle Jan 5, 2026
8898418
feat: finished writing sripts to deploy and run passed test cases
0xharryriddle Jan 6, 2026
2935e0b
feat: finished frontend UI for Uniswap V2 in Polkadot and built next …
0xharryriddle Jan 7, 2026
5493431
feat: updated the requirement steps in README and fixed the duplicate…
0xharryriddle Jan 7, 2026
c52b9a7
feat: integrated the LunoKit to connect Wallets and updated the agent…
0xharryriddle Jan 7, 2026
ce2ba3f
feat: cloned scaffold-dot, fixed resolc compiler version issue by ass…
0xharryriddle Jan 8, 2026
539c455
feat: updated contracts and testing
0xharryriddle Jan 9, 2026
fdad962
feat: removed Create Wallet button
0xharryriddle Jan 9, 2026
2390e7c
feat: updated UI and contract
0xharryriddle Jan 16, 2026
d73b425
feat: updated deployed contract address
0xharryriddle Jan 16, 2026
e4e6117
faet: updated dependencies
0xharryriddle Jan 16, 2026
98e71ea
Merge pull request #1 from 0xharryriddle/1-xcm-hyperbridge
0xharryriddle Jan 16, 2026
5d143ae
Merge pull request #2 from 0xharryriddle/3-fullstack-scaffold-dot
0xharryriddle Jan 16, 2026
6d794c0
Merge pull request #3 from 0xharryriddle/4-uniswapv2
0xharryriddle Jan 16, 2026
a455619
minor: tick finished challenges
0xharryriddle Jan 16, 2026
11ee02e
feat: updated the Agent action tools
0xharryriddle Feb 8, 2026
c538366
feat: added openai models on agents and fixed not supported chains issue
0xharryriddle Feb 9, 2026
96a3471
feat: finished challenge 2
0xharryriddle Feb 11, 2026
96c7c65
Merge pull request #4 from 0xharryriddle/2-polkadot-agent-kit
0xharryriddle Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "1-xcm-hyperbridge/hyperbridge-token-bridge/lib/openzeppelin-contracts"]
path = 1-xcm-hyperbridge/hyperbridge-token-bridge/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
20 changes: 10 additions & 10 deletions 1-xcm-hyperbridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,22 @@ Create a basic UI to interact with your bridge:
Your submission should include:

1. **Smart Contracts**
- [ ] `TokenBridge.sol` - Bridge logic contract
- [ ] Deployment scripts
- [ ] Bridge token script
- [x] `TokenBridge.sol` - Bridge logic contract
- [x] Deployment scripts
- [x] Bridge token script

2. **Documentation**
- [ ] README explaining your implementation
- [ ] Deployment addresses
- [x] README explaining your implementation
- [x] Deployment addresses

3. **Testing**
- [ ] Unit tests for `TokenBridge.sol` contract
- [x] Unit tests for `TokenBridge.sol` contract

4. **Frontend**
- [ ] Basic UI for bridging tokens
- [ ] Screenshots of your UI in action
- [ ] Accessible Recording Link
- [ ] Minimum supported network pairs (pick at least one)
- [x] Basic UI for bridging tokens
- [x] Screenshots of your UI in action
- [x] Accessible Recording Link
- [x] Minimum supported network pairs (pick at least one)

## 🔗 Resources

Expand Down
11 changes: 11 additions & 0 deletions 1-xcm-hyperbridge/docs/CONTRACT_ADDRESSES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Contract Addresses

| Network | WETH | FeeToken | Bridge |
| ------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
| Optimistic Sepolia | 0x4200000000000000000000000000000000000006 | 0xA801da100bF16D07F668F4A49E1f71fc54D05177 | 0x8903331DfE3dcFd8E23bBA2D716B692f1510491e |
| Sepolia | 0x4200000000000000000000000000000000000006 | 0xA801da100bF16D07F668F4A49E1f71fc54D05177 | 0x5169Fc3372a06375c6B1C4E47d00AeEd42b1b80F |

Notes:

- Addresses were taken from the previous sections and consolidated into a table for easier copy-paste.
- If you want automated writes from the deployment script, run the script and update this file or deployments.toml accordingly.
205 changes: 205 additions & 0 deletions 1-xcm-hyperbridge/docs/DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
# Deployment Guide

This guide covers deployment and interaction with the Hyperbridge Token Bridge contracts.

## Security: Managing Private Keys

We use `cast wallet` to securely manage private keys instead of `.env` files.

### Import Your Private Key

```bash
cast wallet import defaultKey --interactive
```

You'll be prompted to enter your private key and set a password. The key will be encrypted and stored securely.

## Prerequisites

1. **Configure Token Gateway Addresses**: Update `deployments.toml` with the TokenGateway addresses for each chain:

```toml
[sepolia]
endpoint_url = "https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY"

[sepolia.address]
token_gateway = "0xYourTokenGatewayAddress"

[bsc-testnet]
endpoint_url = "https://data-seed-prebsc-1-s1.binance.org:8545"

[bsc-testnet.address]
token_gateway = "0xYourTokenGatewayAddress"

[optimism-sepolia]
endpoint_url = "https://sepolia.optimism.io"

[optimism-sepolia.address]
token_gateway = "0xYourTokenGatewayAddress"
```

2. **Get Testnet Funds**: Ensure your wallet has native tokens for gas fees on each chain.

## Step 1: Deploy Contracts

Deploy the contracts on each chain where you want to enable bridging.

### Deploy on Sepolia

```bash
ETH_FROM=0x5984A519fFfE5aFc5e8bBA233DCc01AC774f4301 forge script script/Deployment.s.sol:DeploymentScript \
--rpc-url https://1rpc.io/sepolia \
--account defaultKey \
--sender 0x5984A519fFfE5aFc5e8bBA233DCc01AC774f4301 \
--broadcast \
--verifier etherscan \
--etherscan-api-key <API_KEY> \
-vvvvv
```

### Deploy on BSC Testnet

```bash
ETH_FROM=0x5984A519fFfE5aFc5e8bBA233DCc01AC774f4301 forge script script/Deployment.s.sol:DeploymentScript \
--rpc-url bsc-testnet \
--account defaultKey \
--sender <YOUR_ADDRESS> \
--broadcast \
--verifier etherscan \
--etherscan-api-key <API_KEY> \
-vvvvv
```

### Deploy on Optimism Sepolia

```bash
ETH_FROM=0x5984A519fFfE5aFc5e8bBA233DCc01AC774f4301 forge script script/Deployment.s.sol:DeploymentScript \
--rpc-url https://sepolia.optimism.io \
--account defaultKey \
--sender 0x5984A519fFfE5aFc5e8bBA233DCc01AC774f4301 \
--broadcast \
--verifier etherscan \
--etherscan-api-key <API_KEY> \
-vvvvv
```

**Note**: Deployment addresses will be automatically saved to `deployments.toml` after each deployment.

## Step 2: Configure Bridge Parameters

After deployment, configure the bridge parameters in `bridge.toml`:

```toml
[sepolia]
endpoint_url = "https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY"

[sepolia.address]
token_gateway = "0xYourTokenGatewayAddress"
bridgeable_token = "0xDeployedBridgeableTokenAddress"
fee_token = "0xDeployedFeeTokenAddress"
token_bridge = "0xDeployedTokenBridgeAddress"

[sepolia.bridge_params]
amount = "1000000000000000000000" # 1000 tokens (with 18 decimals)
recipient = "0xRecipientAddressOnDestinationChain"
dest_chain = "optimism-sepolia" # Destination chain name
native_cost = "1000000000000000" # 0.001 ETH (in wei) for gas
```

Repeat for all chains (`bsc-testnet`, `optimism-sepolia`, etc.).

## Step 3: Mint Test Tokens (Optional)

Before bridging, you may want to mint some test tokens to your address:

```bash
# Mint BridgeableTokens
cast send <BRIDGEABLE_TOKEN_ADDRESS> \
"mint(address,uint256)" \
<YOUR_ADDRESS> \
1000000000000000000000 \
--rpc-url sepolia \
--account defaultKey

# Mint FeeTokens
cast send <FEE_TOKEN_ADDRESS> \
"mint(address,uint256)" \
<YOUR_ADDRESS> \
1000000000000000000000 \
--rpc-url sepolia \
--account defaultKey
```

## Step 4: Bridge Tokens

Execute the bridge transaction using the configured parameters in `bridge.toml`.

### Bridge from Sepolia to Optimism Sepolia

```bash
forge script script/BridgeToken.s.sol:BridgeTokenScript \
--rpc-url sepolia \
--account defaultKey \
--sender <YOUR_ADDRESS> \
--broadcast \
-vvvvv
```

### Bridge from BSC Testnet to Sepolia

First, update `bridge.toml` to set the correct `dest_chain` for BSC Testnet, then:

```bash
forge script script/BridgeToken.s.sol:BridgeTokenScript \
--rpc-url bsc-testnet \
--account defaultKey \
--sender <YOUR_ADDRESS> \
--broadcast \
-vvvvv
```

### Bridge from Optimism Sepolia to Sepolia

```bash
forge script script/BridgeToken.s.sol:BridgeTokenScript \
--rpc-url optimism-sepolia \
--account defaultKey \
--sender <YOUR_ADDRESS> \
--broadcast \
-vvvvv
```

## Step 5: Verify Bridge Transaction

After bridging, you can verify:

1. **Check token balance on destination chain**:
```bash
cast call <BRIDGEABLE_TOKEN_ADDRESS> \
"balanceOf(address)(uint256)" \
<RECIPIENT_ADDRESS> \
--rpc-url <DESTINATION_RPC_URL>
```

2. **Monitor transaction status** through the Hyperbridge explorer or chain explorer.

## Configuration Files

- **`deployments.toml`**: Stores deployment addresses (auto-updated by deployment script)
- **`bridge.toml`**: Stores bridge parameters and deployed contract addresses for bridging operations

## Troubleshooting

### Insufficient Balance Error
- Ensure you have minted enough tokens
- Check your token balance: `cast call <TOKEN_ADDRESS> "balanceOf(address)(uint256)" <YOUR_ADDRESS> --rpc-url <RPC_URL>`

### Transaction Reverts
- Verify TokenGateway address is correct
- Ensure you have enough native tokens for gas
- Check that bridge parameters in `bridge.toml` are valid

### Script Fails to Load Config
- Verify TOML file paths are correct
- Ensure addresses are properly formatted with `0x` prefix
- Check that all required fields are populated
Loading