I have deployed a smart contract which basically splits the incoming funds to the specified addresses based on the entered ratio parameter.
Please find the code below:
pragma solidity ^0.4.23;
contract splitfund {
address admin;
constructor() public {
admin = msg.sender;
}
function splitFunds(address[] withdrawaddress, uint[] proration) public payable {
for(uint i = 0; i<withdrawaddress.length; i++) {
withdrawaddress[i].transfer(proration[i] * msg.value/100);
}
}
}
Right now, i want to access the split funds function in the above contract by passing 1 ether from an address and splitting it in a 60:40 ratio and send it to addresses 0x2e46E9A4542B28B39C21Ed859486147969CB949F and 0x16292759f5e37144E37effe9Ef41998B1DfC5Df0 respectively. I was able to achieve this from Remix in Ropsten test network (https://ropsten.etherscan.io/tx/0xf88696620eeb60cb64df6cedff2585ce65e5b6a3b0e896813394d920d0a133c5#internal)
Can someone please let me know on how to execute the same using Geth/Web3JS/Web3J?!