Let's say I have a shared wallet where ethers are collected for me and my brother. We share 50% each other of this wallet.
if one ETH transaction comes to this wallet, is there an automated way to auto send received ethers to my personal wallet and to my brother's one, without us to do anything special?
Can it be done through a special smartcontract (with fallback) or any other way?
You can deploy this contract (don't forget change addresses)
When someone sends you ethers, he needs to put 100000 gas, this additional gas needs to send 2 transactions: for you and your bro
pragma solidity ^0.4.25;
contract Split {
address public constant MY_ADDRESS = 0x5Ac652E32b8064000a4ab34aF0AE24E4966E309E;
address public constant BRO_ADDRESS = 0x43CcDF0774813B6E14E64b18b34dE438B039663C;
function () external payable {
if (msg.value > 0) {
// msg.value - received ethers
MY_ADDRESS.transfer(msg.value / 2);
// address(this).balance - contract balance after transaction to MY_ADDRESS (half of received ethers)
BRO_ADDRESS.transfer(address(this).balance);
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With