getTokenPayout() issues #366
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
Lines of code
https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/PA1D.sol#L507
Vulnerability details
Impact
Will not work with some tokens.
Possibility of stealing funds.
Proof of Concept
enforcer/PA1D.sol
_validatePayoutRequestor() performs a simple check, msg.sender should be in payout address list.
_payoutToken loops over payout address list and transfer tokens accoring to their bps.
_payoutToken() will not work correctly with ERC20 tokens which does not return a value from transfer()
we could specify arbitrary tokenAddress and do a transfer from any ERC20 token where this contract has funds
getTokenPayout() is reentrant but I would like to see more test cases which are using this contract
Tools Used
vim
Recommended Mitigation Steps
The text was updated successfully, but these errors were encountered: