Skip to content

Commit

Permalink
fix issue with multisend ether
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Storm committed Aug 22, 2018
1 parent e7df12b commit 227e9d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class App extends React.Component {
}
render(){
let startedUrl = this.web3Store.startedUrl
console.log('fix tx queue')
console.log('fix eth multisend')
return (
<div>
<Header />
Expand Down
13 changes: 12 additions & 1 deletion src/stores/txStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,22 @@ class TxStore {
const token_address = this.tokenStore.tokenAddress
let {addresses_to_send, balances_to_send, proxyMultiSenderAddress, currentFee, totalBalance} = this.tokenStore;

let ethValue = token_address === "0x000000000000000000000000000000000000bEEF" ? new BN(currentFee).plus(new BN(totalBalance)) : new BN(currentFee)

const start = (slice - 1) * addPerTx;
const end = slice * addPerTx;
addresses_to_send = addresses_to_send.slice(start, end);
balances_to_send = balances_to_send.slice(start, end);
let ethValue;
if(token_address === "0x000000000000000000000000000000000000bEEF"){

const totalInWei = balances_to_send.reduce((total, num) => {
return (new BN(total).plus(new BN(num)))
})
const totalInEth = Web3Utils.fromWei(totalInWei.toString())
ethValue = new BN(currentFee).plus(totalInEth)
} else {
ethValue = new BN(currentFee)
}
console.log('slice', slice, addresses_to_send[0], balances_to_send[0], addPerTx)
const web3 = this.web3Store.web3;
const multisender = new web3.eth.Contract(MultiSenderAbi, proxyMultiSenderAddress);
Expand Down

0 comments on commit 227e9d4

Please sign in to comment.