A multi-currency payment system converts diverse tokens into stable currencies for user subscriptions. Funds are automatically deducted from users' accounts at regular intervals for merchant subscriptions, after user authorization.
This payment system accommodates multiple stable currencies for transactions. In cases where other tokens are utilized, they will be converted into a stable currency before supporting user subscriptions. When a user subscribes to a specific merchant, a scheduled program will automatically deduct funds from the user's address at regular intervals using subscription events. This process occurs once the user authorizes the contract during the subscription.
To enable subscription functions in smart contracts, as they lack an automatic triggering mechanism, we rely on other languages to periodically check for and execute deductions. In our demonstration, we've utilized JavaScript to achieve this functionality. However, in real-world scenarios, the process involves recording subscription event records in a database. Other languages like Go or Python can also be used for this purpose, expanding the versatility of managing subscription events beyond the capabilities of smart contracts.