Exchange ERC20 (Ethereum) with SPL (Solana) via DEX - ethereum

I've been searching for a while, but I can't seem to find an answer to this so it would be very helpful if someone can clarify this 😣.
Let's say i have TokenA as an ERC20 deployed to the Ethereum mainnet and I have TokenB as an SPL deployed in the Solana Blockchain.
Is there any way of exchanging those 2 Tokens?
I know with Uniswap I can create my own pool and put some liquidity for my Token, and then swap it with the Selected pair. Eg. TokenA/ETH
But in the case above, the 2 tokens are part of different Blockchains..
Thank you very much

The sol wallet will be different from the ERC wallet
You can create smart contract for recieve etherium and one for sol
And by the use of molaris server add watcher for event on the 2 contract when one of them recieve the token and the recieve wallet for the other blockchain run script from the molaris server for transfer token for the address from the other blockchain
Sorry for bad English

Related

How to recognize and interact with contract of other chains?

I am planning to issue erc20 token on ethereum and I want to use it as a payment for dapps on polygon.
How may I estublish the interaction between the contracts? A potential answer to that question might be bridging. But I tried to look for every platform to understand, how can I use my coin tokens after bridging, but failed to find any definite answer.
so my question is, if two contracts are on the same chain-
IERC20 token = IERC20(some_address);
We use the above line to call our coin token from our dapp. Since, our coin token is on different ethereum chain, after bridging, how do we call it feom a contract that will be deployed on polygon?
Will the above line of code work? Will I get a new address on polygon for my token contract?
(Recently I have seen a technique, but couldn't understand the underlying mechanism. So, there is a website called Coinvise, they let you deploy your coin airdrop contract on polygon and let you set the nft address (to know if user holds that particular nft) as eligibility condition that is deployed on ethereum. They do it on chain using something called 'sub-graph'. I do not know what this is but I'd like to know if it helps in my case.)
I am new to blockchain, please help

Multiple ERC20 tokens in a DeFi platform

I'm building a DeFi application on Ethereum, and I would like to implement the Deposit function. Everything works fine between ETH and a ERC20 token that I built, but I would like to add some tokens like aToken for AAVE or cTokens for Compound that the user will receive after a Deposit call.
So the question is: is it possible to add a function in my smart contract to create multiple tokens without creating a smart contract for each of them? If not, I have to create a different contract for each token I want to add in my app or there is a best method to do it?
Yes this is possible. You can transfer the tokens to the user's address after the Compound Protocol mint operation. This can be made generic using the ERC-20 transfer interface. Be sure to account the amounts users are due and beware of the reentrancy vulnerability.

How to get gas fee to send erc20 token at mass volume?

I am learning node JS developing a crypto currency exchanger as a homework project where user can deposit ERC-20 token and Ethereum. I am generating unique ethereum deposit address for every user, where they can deposit ERC-20 token and ethereum. but after sometime I want to move the received ethereum and ERC-20 token to another address (cold wallet).
If someone only send ERC-20 token to the address and no etherum, then how I'll get ethereum to pay as gas fee to transfer the received ERC-20 token to cold wallet?
If suppose, I am first paying etherum (for gas fee) from cold address to the user address, and then using that etherum to transfer received ERC-20 token, will it work at mass level ? means if 10000 users do the same thing at the same time, will not it create a problem ? or is there any better solution for this?
If there's no eth in that account, you can't take the ERC-20 token out.
Transfer some eth to the address and then get ERC-20 token out is the only way. The problem is how to save the gas as far as you can.
You can write a batch transfer contract to send eth to several hundred addresses in one go (the ceiling is determined by block gas limit), batch transfer saves gas. Then you can collect the ERC-20 tokens.
Of course, you can charge your user for compensation.

How can ethereum token use as payment gateway on ecommerce website

Everyone can create ethereum token by solidity codes but don't know how can this token integrate as payment gateway in ecommerce website.
For real project . This token need frontend web wallet /android wallet and integration to every website as payment.
Plz suggest me .how can find this way.
What need more to study.
Token is not a payment gateway. If i understand your question correctly, you are asking, how can you interact with a token that you have created through Solidity from frontend. One use case would be how people can use the token that you have created to purchase some item. For this the users should already be holding the tokens. This can be bought from an ICO or from an exchange. Basically there's a couple of functions in ERC20 token i.e., approve() and transfer() that will approve apps like exchanges to perform transactions on behalf of the owner of the token. Once the users have those tokens they can purchase items from it. Again, you have to write the logic how and what you expect users to do.
ERC20 Token is works likes Currency.And solidity is a programming language. which we used for write the smart contract. if you want to invoke your function then you need to create wallet account ,after that you can do transaction using with web3js. you can get ether for testing purpose from faucet.Basically these are functions in ERC20 token i.e., approve() and transfer() that will perform transactions
I don't suggest using ERC20 tokens as payment method.
Ethereum network is not fast enough,you need 30 confirmations to make sure you received the token, some times the delay can be 1 day
Cost is high, when you transfer token ,usually you have a smart contract, it costs lots of gas
Ether price is not stable, it drops 90% of value from Jan 2018 to Dec 2018. it will be hard for estore to maintain profit.
However if you still want to do that, yes, you can create your own gateway using tokens as your accepted currency.

Can a smart contract automatically send message to an user address in ethereum blockchain

I'm a new beginner in the ethereum Blockchain.
I want to implement a smart contract that verifies the authenticity of a user and then send a message to a cloud service (with is the smart contract creator) in case of positive verification to grant access to the user.
My question is it possible for a smart contract to return results of his methods invocation to another blockchain user and how we can do it?
A smart contract cannot make calls outside of the blockchain. i.e., you cannot have it call an http endpoint or something similar.
In ethereum, the usual way of achieving something like this is:
Have the user make a transaction passing relevant data to your smart contract
The smart contract runs whatever verification logic it must on that data
The smart contract logs an Event
You have an ethereum node that your code connects to and listens for these events.