hop
hop copied to clipboard
Limit the bonder’s ability to bond transfers whose `amount` is greater than the expected hToken amount on the source chain
The bonder should not bond a transfer that sends more hTokens than have been deposited into the source chain. This would protect against the case where a chain has a bug and a malicious user was able to mint ETH/Tokens/etc. out of thin air, among other things.
An example is an attack where an attacker can somehow mint hTokens unexpectedly and try to send them to a chain. For example, imagine there are 1,500 hETH on Optimism at this time. The bonder software should not bond any transfer that is ≥1,500 ETH on any chain when the source is Optimism because, if they did, that would mean that the attacker was able to mint hTokens unexpectedly.
The implementation can likely use the chain balance and pending amount from the chain.
This old PR could use a review to handle this https://github.com/hop-protocol/hop/pull/413.
Handled with new redundant logic.