Ardor Lightweight Contracts Use Case. Credit image: Joey Huang from Unsplash

We can now solve the ARDR paradox using a simple contract

Lior Yaffe
Apr 24, 2018 · 2 min read

See all lightweight contracts articles

One of the most annoying problems for new users of Ardor is that you cannot buy the ARDR parent chain token unless you already own ARDR tokens to pay the transaction fee.

Until now, the only solution to this limitation explained in detail in this helpdesk article, was a manual exchange performed by our support team. But this approach, is of course, not a long-term solution.

The new ChildToParentExchange contract, provides a better solution, the contract listens for IGNIS deposits on a specific address, and when it identifies a deposit, it waits for 6 confirmations, calculates the ARDR per IGNIS exchange rate based on the existing buy orders on the decentralized coin exchange, and sends back the converted amount in ARDR to the sender’s account. This contract can be easily enhanced to support deposits in any other Child Chain coin.

The contract source code

ChildToParentExchange Contract

Note: a transaction fee of one ARDR is reduced from the returned amount.

This is a good example of how Ardor Lightweight Contracts are simple to implement, and can solve real-world problems.

See Also

Lior Yaffe

Written by

Co-Founder and Managing Director of Jelurida. Ardor and Nxt core-developer

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade