Payment Splitter 2.0

I’m trying to develop a version 2.0 of payment splitter since v1.0 has been deprecated
in that version, I would like to use an ERC20 as shares and make it dynamic (on v1.0 the share distribution is static at deployment time)

I have the naive algorithm looping all stakeholders when a payment arrives. This should be unacceptable since will be O(n)

Can you help me develop the O(1) withdraw algorithm?


Hi, maybe take a look at this. It’s called staking but it’s the same thing, ERC20 as shares and O(1) withdrawals and ETH deposits.

1 Like