I am preparing to create a smart-contract
on Astar using ink! programming language. The contract's main logic involves modifying the cross-chain
asset USDT on the statemint chain. After going through all the libraries provided by ink!, I haven't found any relevant interface to modify cross-chain
assets, specifically the USDT asset with ID 4294969280 on Astar. How can I modify the USDT asset within the ink! contract?
1 Answer
Those are two different things,
1. Interacting with Local USDT Asset (4294969280) on Astar
If you want to interact with pallet-assets assets like USDT, you can use ink! Chain Extension. We have the chain extension for pallet-assets and it's only available on Shibuya Testnet.
- Docs - https://use.ink/macros-attributes/chain-extension
- Example ink! contract - https://github.com/swankyhub/chain-extension-contracts/blob/main/examples/assets/lib.rs
Note:- There is a high probability that Chain Extensions might be deprecated and replace with something else, that has same functionality in future, just keep that in mind.
2. Interacting with Remote USDT Asset on Statemint (via XCM)
This will require sending XCM from ink! contracts to Statemint and currently under-development and will be available soon. Once we have the capability to send XCM messages from ink! contracts, you can not only send/swap assets across parachains but also complex remote transact operations (executing tx on other parachains)