suppose here i have three accounts and they have some balances!!
i want to transfer balance of 1st account into 2nd account when transfer function is called by the 3rd account!
if this is possible then let me know!!
Thanks!!
suppose here i have three accounts and they have some balances!!
i want to transfer balance of 1st account into 2nd account when transfer function is called by the 3rd account!
if this is possible then let me know!!
Thanks!!
From Solidity side it is not possible. The keywords call and transfer which are used to transfer ether function only takes 2 argument one is address and other is amount.
address.transfer(uint256 amount);
send given amount of Wei to Address, throws on failure, forwards 2300 gas stipend, not adjustable
Trasfer function
You should check web3 library. You can try raw transactions to get this.
Instead of accounts you can create 3 small and simple contracts and easily achieve what you want.
In order to answer the question we need to understand your needs better.
Here is why:
There are two types of accounts in Ethereum
Externally Owned Accounts
Contracts Accounts
The scenario which you've described is possible when:
1st account - Contract
2nd account - External or Contract
3rd account - External or Contract