-
Notifications
You must be signed in to change notification settings - Fork 90
feat: implement a new version of HTSConnector for Stargate v2 OFT contract #4195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: implement a new version of HTSConnector for Stargate v2 OFT contract #4195
Conversation
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Test Results 20 files ±0 265 suites ±0 26m 59s ⏱️ + 8m 29s For more details on these failures, see this check. Results for commit 4d67e4c. ± Comparison against base commit 68c2469. ♻️ This comment has been updated with latest results. |
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
quiet-node
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG but left a nit and a question
tools/layer-zero-example/contracts/stargate/interfaces/ICreditMessaging.sol
Outdated
Show resolved
Hide resolved
|
Also Codacy seems to fail with one item https://github.com/hiero-ledger/hiero-json-rpc-relay/pull/4195/checks?check_run_id=48407035874 |
|
should we move this to the smart-contracts repo? I may be late to the party, but here we are not testing any Relay specific functionality, so maybe the smart-contracts repo is a better place for this. |
It's tightly coupled with the LayerZero example, and that's why we put it here. We need to duplicate almost the entire LayerZero example into smart-contracts to make it work for the Stargate contracts. That's the main reason. Another question might be why we don't move the LZ example within the smart-contracts? - Hardhat projects support only one version of ethers within it. In the smart-contracts repo, we're using ethers v6 while the LZ example requires ethers v5. It's a known issue, and as far as I know, they're working on bumping it (here is the discussion - LayerZero-Labs/LayerZero-v2#22). Once they fix it, we can move the LZ example in the smart-contracts and make the relay repo cleaner. |
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
quiet-node
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks cleaner now but seems like it's breaking the flow.
tools/layer-zero-example/contracts/stargate/StargateHTSConnectorExistingToken.sol
Show resolved
Hide resolved
Signed-off-by: nikolay <n.atanasow94@gmail.com>
quiet-node
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work as always!
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #4195 +/- ##
==========================================
+ Coverage 95.46% 95.59% +0.13%
==========================================
Files 121 121
Lines 20106 19911 -195
Branches 1732 1732
==========================================
- Hits 19194 19034 -160
+ Misses 886 851 -35
Partials 26 26
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Description
Stargate has released a new version v2, and a concept of Hydra tokens. To be able to bridge WEth, USDC, and USDT (called hydra tokens), we need to implement the
StargateHTSConnector.The difference between the existing connector and the new connector is that we need to implement
inflowandoutflow.The idea is to release a Stargate Connector, which includes this extra function, and implement an end-to-end test with an HTS token in Testnet, following the cross-chain bridge strategy we did for Stargate.
The methods to implement and adapt to HTS https://github.com/stargate-protocol/stargate-v2/blob/main/packages/stg-evm-v2/src/StargateOFT.sol
PS: All new contracts are inherited from the official stargate v2 contracts repo https://github.com/stargate-protocol/stargate-v2. Only
StargateHTSConnectorExistingTokenandExampleStargateHTSConnectorExistingTokenare introduced in this PR.Related issue(s)
Fixes #3957
Testing Guide
Changes from original design (optional)
N/A
Additional work needed (optional)
N/A
Checklist