Skip to content

Commit

Permalink
fix distributor
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Mar 17, 2024
1 parent cc2c97d commit eeeff23
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/erc20_payment_lib/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ pub fn create_distribute_transaction(
recipients: &[Address],
amounts: &[U256],
) -> Result<TxDbObj, PaymentError> {
let sum_amounts = amounts.iter().fold(U256::zero(), |acc, x| acc + x);
Ok(TxDbObj {
method: "DISTRIBUTOR.distribute".to_string(),
from_addr: format!("{from:#x}"),
Expand All @@ -344,6 +345,7 @@ pub fn create_distribute_transaction(
call_data: Some(hex::encode(
encode_distribute(recipients, amounts).map_err(err_from!())?,
)),
val: sum_amounts.to_string(),
..Default::default()
})
}
Expand Down

0 comments on commit eeeff23

Please sign in to comment.