How can ethereum token use as payment gateway on ecommerce website - ethereum

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.

Related

Is ETH needed for all accounts to support gas fees

I would like to have some enlightment on ERC20 token: If i create a token (let's say MTK ) to be use by a community and i send some of the tokens to each member of the community, does those members have to get ETH in order to use the MTK or they Can use the token whitout the need of having ETH?
I am thinking about using the admin address to get the necessary amount of ETH ( or other ERC20 token compatible crypto currencies) so that if that the that admin account will pay all occuring transactions fees (if needed).Therefore members won't have to deal with ETH and just use the community token.
If it is an ERC20 token on the public mainnet network, someone (else) needs to pay for gas fees executing a transaction, there is no way to circumvent gas costs on L1/mainnet entirely.
What you are looking for are "meta-transactions" or "feeless" transactions: https://ethereum.stackexchange.com/questions/38479/how-to-make-someone-else-pay-for-gas

ethereum private transaction with flashbots

I have a compromised wallet, where there are bots transferring deposit instantly, so i cant pay fees when trying to move tokens.
I saw a wallet use private transaction with flash-bots for token approvals and other smart contract related functions.
How can i interact with ERC20 tokens and pay fees privately to avoid deposit from being transferred by bots.
so far i have tried using 1inch flash-bots but without ether available i cant access the flash bot option.
Any help will be appreciated

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

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

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.