sygmaprotocol / sygma-sdk

A Typescript SDK to add cross-chain capabilities such as bridging tokens and sending messages across dApp projects.
https://docs.buildwithsygma.com/
GNU Lesser General Public License v3.0
31 stars 19 forks source link

Implement fungible Substrate transfer #372

Closed MakMuftic closed 1 month ago

MakMuftic commented 4 months ago

Following the proposed v3 SDK restructure, implement/restructure the necessary functions for creating deposit Substrate transactions for fungible assets.

Implementation details

Check packages/substrate/src/fungible.ts for the interface definitions.

Testing details

QA Details

Acceptance Criteria

MakMuftic commented 4 months ago

Hey team! Please add your planning poker estimate with Zenhub @Lykhoyda @mpetrunic @saadjhk @wainola

saadjhk commented 2 months ago

Marking this as closed as #378 is merged

LyonSsS commented 1 month ago

QA tests(Not Pass): The resourceID from the sourceID chain is not correct mapped to the shared config. Tested from Tangle to Sepolia `const DEST_EVM_CHAIN_ID = 11155111; const SOURCE_SUBSTRATE_CHAIN_ID = 5231;

const RESOURCE_ID_SYGMA_USD = "0x0000000000000000000000000000000000000000000000000000000000001000"; const recipient = "0x9A17FA0A2824EA855EC6aD3eAb3Aa2516EC6626d"; const SOURCE_CHAIN_RPC_URL = process.env.RHALA_RPC_URL ?? "wss://testnet-rpc.tangle.tools";`

and for resourceID: 0x0000000000000000000000000000000000000000000000000000000000001000 it did transfered tTNT token. In reality the _1000 ressID is for the PHA token

image.png

Actual on chain (tangle) hash created for this _1000 ressID: 0xfd028400cec3f9df482b8de041a81dae22a494a3446966fcf1fab4afbf4fc00028e914240172efd56fdb7c339219e7e33751b600873d13058721b358811e6f2ded08c73b645288e20e9d5e5f50eaf2642ff90b05facbdb5b4af84f3020b3f8a237302f1887e5014d0100003105000000130000c84e676dc11b000306057379676d61000000000000000000000000000000000000000000000000000000050806149a17fa0a2824ea855ec6ad3eab3aa2516ec6626d000000000000000000000000

Now using the other resourceIDs I get some error which I suspect they may be from this ressID mapping issue.

LyonSsS commented 1 month ago

It might be that there was an issue with the shared config - mismatching ressourceID. Retested on tangle after Tangle update and Sepolia Resource ID dest update and workd fine for tTNT tTNT execution hash 0xf9028400cec3f9df482b8de041a81dae22a494a3446966fcf1fab4afbf4fc00028e9142401c657cbf8730caab483e3826770323d0d8dba257249198419b1038afc244bb1783e154d58e47a1d44368cd8ecf412881a830a216148f046aa8605488f3999578555008c00003105000000130000d52ae311ea02000306057379676d610000000000000000000000000000000000000000000000000000000508061498729c03c4d5e820f5e8c45558ae07ae63f97461000000000000000000000000

image.png

https://sepolia.etherscan.io/tx/0xaa02f242cd0ff248ac75f8ad55d144e714ec3362321c63aaaa8ecb4b83c10343

LyonSsS commented 1 month ago

Retested with the new Tangle added - > works fine - only testable with tTNT atm. https://docs.google.com/spreadsheets/d/13SRvdjjrnSIjhD26eFG3xV0pcGsBtq9SV1Dc_lUkACM/edit?pli=1&gid=2049882071#gid=2049882071