Switch to pull payments
juliangruber opened this issue · comments
Julian Gruber commented
- add state
mapping(address => uint) balances
- add function
balanceOf(address account) public view returns uint
- return state
- add function
withdraw(address target, uint value) public returns bool
- support f4/0x addresses
- support f1 addresses
- update state (optional gc)
- transfer funds
- emit event
Withdrawal(address indexed account, address to, uint value)
- add function
withdrawOnBehalf(address participant, bytes signature, address target, uint value) public
- verify signature
check(signature, from, to, amount)
- verify balance > 0.1 FIL
- send
0.1FIL
(adjustable) back to sender, to pay for gas -
withdraw()
with differentparticipant
address and0.1FIL
deducted
- verify signature
- change function
reward(address[] addresses, uint[] scores) private
- update state