pragma solidity ^0.5.2;

contract sendEther{

address payable rec= address(0xD694fab8b63BeF0149aa47b8333dFeAe7f55E9C7);
address public sender = msg.sender;

function send() public payable{




I need to send a specific value to that address mentioned. This is to be included in my Dapp. So i need to send a specific amount to any specific address and the input amount have to be injected by the user

  • What is the question? – Rick Park Dec 28 '18 at 13:34
  • How to send ether to a ethereum address with a specific amount? – stellar gold Dec 28 '18 at 13:34
  • Like the message sender have to send a specfic value of ether to the above address so what is the necesity – stellar gold Dec 28 '18 at 13:35
  • msg.value is the amount you would send to the contract first, then the contract address holds those ethers (virtually) and redistributes/sends the ethers with .transfer function. So the amount is dynamic here (as much as you send to the contract will be retransfered). You could of course hardcode the amount in msg.value. – AirUp Dec 28 '18 at 15:11

You do not need to use a contract for that, just send a transaction. Your app can generate a transaction with the value input by the user to the address and ask the user to sign it (metamask).

Hope this helps

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.