0

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!!

  • 2
    Amount is eth or erc20 token? – Ha ĐANG Oct 3 '18 at 15:38
  • it looks like you don't know what you really need (based on question and comment of answers). is it ether transfer or token transfer? what types of accounts? it would be better to re-think the question and ask more specific – Aquila Oct 4 '18 at 7:52
  • @Aquila !! In simple it is balance of account that to transfer!! I hope you got it! if not! then please let me know!! – Sunanda Sharma Oct 4 '18 at 10:10
0

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.

  • is any possibilty in other way except this one? @shubham – Sunanda Sharma Oct 4 '18 at 4:42
0

Instead of accounts you can create 3 small and simple contracts and easily achieve what you want.

  • i need only 3 accounts instead of contract!! so is there any possibility? @Xawery – Sunanda Sharma Oct 4 '18 at 4:37
0

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

  • 3rd account=> owner account , who deployed contract!! ** 1st and 2nd account =>** account addresses passed in constructor of that contract!!@Aquila – Sunanda Sharma Oct 4 '18 at 4:39

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.