📦Wrap Tokens
To interact with the Soroban smart contract, Stellar assets have to be wrapped so that they are compatible with the Soroban token interface. Each wrap will deploy a new token contract on Soroban, with the original issuer of the asset set as administrator. Wrapping a token requires the asset code and asset issuer ID, and anyone can wrap them on Soroban.
Wrap NFT token:
Please ensure you change the --asset
param accordingly.
Wrap Payment token:
Again, be sure to adjust the --asset
param as required.
When you run a wrap command, it will return a contract_id
(e.g. 38f2fb24a53d4ee70dabf456b0f13789b0fd825921ea31754d4f561c54362b87
). To use this contract_id as an Address in the smart contract, you'll need to convert the contract ID to hex using Address Conversion.
Address Conversion:
Address Conversion allows you to convert a contract ID into an address, which can then be used in the smart contract. For example, when we wrap the NFT token in Soroban, we receive a contract ID. We need to convert this ID into an address so that we can store it in the rental smart contract.
You can use the following Javascript snippet:
Last updated