PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, September 25, 2022

[FIXED] How to make ERC20 smart contracts ask for ether as transaction fee using Remix

 September 25, 2022     blockchain, ethereum, smartcontracts, transactions     No comments   

Issue

please am a newbie in solidity I have been trying to make the transfer not to work if the wallet holding the token does not transfer ether to an address i will specify in my code thanks in advance.


Solution

  1. Smart contract cannot ask users to get tokens or eth, you should program your DApp or Front End for asking transaction fee.
  2. you can set something like require(msg.value==transactionFee) followed by payable(AddressToCollectFees).transfer(msg.value) in the function of smart contract


Answered By - 8nite
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing