Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Stargate V2 Endpoints
STARGATE_ENDPOINT_ETHEREUM=0x1a44076050125825900e736c501f859c50fE728c
STARGATE_ENDPOINT_BASE=0x1a44076050125825900e736c501f859c50fE728c
STARGATE_ENDPOINT_BSC=0x1a44076050125825900e736c501f859c50fE728c
STARGATE_ENDPOINT_AVALANCHE=0x1a44076050125825900e736c501f859c50fE728c
STARGATE_ENDPOINT_POLYGON=0x1a44076050125825900e736c501f859c50fE728c
STARGATE_ENDPOINT_ARBITRUM=0x1a44076050125825900e736c501f859c50fE728c
STARGATE_ENDPOINT_OPTIMISM=0x1a44076050125825900e736c501f859c50fE728c

# RPC Endpoints
ETHEREUM_RPC_URL=https://ethereum.gemnodes.com
OPTIMISM_RPC_URL=https://optimism.gemnodes.com
BASE_RPC_URL=https://base.gemnodes.com
BSC_RPC_URL=https://smartchain.gemnodes.com
AVALANCHE_RPC_URL=https://avalanchec.gemnodes.com
POLYGON_RPC_URL=https://polygon.gemnode.com
ARBITRUM_RPC_URL=https://arbitrum.gemnodes.com

# Etherscan API Keys
ETHEREUM_SCAN_API_KEY=
OPTIMISM_SCAN_API_KEY=
BASE_SCAN_API_KEY=
BSC_SCAN_API_KEY=
# AVALANCHE_SCAN_API_KEY=
POLYGON_SCAN_API_KEY=
ARBITRUM_SCAN_API_KEY=

# Private Key for Deployment
PRIVATE_KEY=

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Compiler files
cache/
out/
zkout/

# Ignores development broadcast logs
!/broadcast
broadcast/
/broadcast/*/31337/
/broadcast/**/dry-run/

Expand Down
16 changes: 14 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
[submodule "bsc/hub_reader/lib/forge-std"]
path = bsc/hub_reader/lib/forge-std
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/layerzero-v2"]
path = lib/layerzero-v2
url = https://github.com/LayerZero-Labs/layerzero-v2
[submodule "lib/stargate-v2"]
path = lib/stargate-v2
url = https://github.com/stargate-protocol/stargate-v2
[submodule "lib/solidity-bytes-utils"]
path = lib/solidity-bytes-utils
url = https://github.com/GNSPS/solidity-bytes-utils
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

A collection of smart contracts for Gem Wallet.

- [bsc/hub_reader](bsc/hub_reader): A contract that simplify interacting with BSC Staking Hub
- [src/hub_reader](src/hub_reader): A contract that simplify interacting with BSC Staking Hub
- [src/stargate](src/stargate): A contract that allow to do onchain calls on destination chain after Stargate Bridge

## Development

1. Install [Foundry](https://book.getfoundry.sh/) and you're good to go.
2. Configure `.env` file with your `BSC_RPC_URL` and `BSCSCAN_API_KEY`, if you need to deploy the contract, you need to set `PRIVATE_KEY` as well.
2. Configure `.env` using `.env.example` rpcs (if needed) and etherscan values, if you need to deploy the contract, you need to set `PRIVATE_KEY` as well.

## Usage

Expand All @@ -27,6 +28,20 @@ forge test --rpc-url <your_rpc_url>

```shell
# deploy hub_reader
cd bsc/hub_reader
forge script script/HubReader.s.sol:HubReaderScript --rpc-url "$BSC_RPC_URL" --broadcast --verify -vvvv
just deploy-hub-reader
```

```shell
# deploy stargate to all supported chains
just deploy-stargate
```

```shell
# deploy stargate to specific chain
just deploy-stargate optimism
```





46 changes: 0 additions & 46 deletions bsc/hub_reader/broadcast/HubReader.s.sol/56/run-1715346908.json

This file was deleted.

46 changes: 0 additions & 46 deletions bsc/hub_reader/broadcast/HubReader.s.sol/56/run-1715388304.json

This file was deleted.

Loading