We are working on creating an ERC20 smart contract using the below tutorial code on the Caspers-labs network with Rust. https://github.com/casper-ecosystem/erc20/blob/master/contract/src/main.rs
We have created two tokens, one token as "SDC" and another one as "CDS".
Looking for some help to add a function on the smart contract to swap the token between each other.
Ex: If an account holder has 100 SDC tokens on their account address they can be able to swap their SDC token with a CDS token with the same amount (100 SDC = 100 CDS tokens).
In another network, there is some default function that is available for swapping the token. We will call those functions for our contract and do the swap between the two tokens.
Sample contract for using near-sdk: ref-contracts/pool.rs at main · ref-finance/ref-contracts · GitHub
Can you please provide some pointers and help us know if that is achievable?
Appreciate the assistance in advance. Thanks!