How to transfer funds from an address to another in solidity #4994
Answered
by
alymurtazamemon
olaoyesalem
asked this question in
Q&A
-
I am working on crowdfunding website using the Ethereum blockchain that can create a campaign. I created an algorithm that creates a payable address, and it can be fundable. function createMyFunDity(string memory _addressName) public checkDuplicateName(_addressName) {
bytes32 hashedAddressName = keccak256(abi.encode(_addressName));
hashedAddressList.push(hashedAddressName);// added hashed to the array to comapre .
bytes32 hashedString = keccak256(abi.encode(_addressName, msg.sender,block.timestamp));
address castedAddress = address(uint160(uint256(hashedString)));
address payable funditeeAddress = payable(castedAddress);
funditees.push(FunDitees(funditeeAddress,_addressName));
} The problem right now is I can't withdraw from the address. |
Beta Was this translation helpful? Give feedback.
Answered by
alymurtazamemon
Mar 3, 2023
Replies: 1 comment 1 reply
-
@olaoyesalem You can send funds from smart contract to any address like this; (bool success, ) = address.call{value: balance}("");
require(success);
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
olaoyesalem
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@olaoyesalem You can send funds from smart contract to any address like this;
address
is the address of the user you want to send funds.balance
is the amount you want to send to the address.