feat: add receiver in event
This commit is contained in:
@@ -24,7 +24,7 @@ contract TychoRouter is AccessControl {
|
||||
bytes32 public constant FUND_RESCUER_ROLE =
|
||||
0x912e45d663a6f4cc1d0491d8f046e06c616f40352565ea1cdb86a0e1aaefa41b;
|
||||
|
||||
event Withdrawal(address indexed token, uint256 amount);
|
||||
event Withdrawal(address indexed token, uint256 amount, address indexed receiver);
|
||||
|
||||
constructor(address _permit2) {
|
||||
permit2 = IAllowanceTransfer(_permit2);
|
||||
@@ -82,7 +82,7 @@ contract TychoRouter is AccessControl {
|
||||
// slither-disable-next-line calls-loop
|
||||
uint256 tokenBalance = tokens[i].balanceOf(address(this));
|
||||
if (tokenBalance > 0) {
|
||||
emit Withdrawal(address(tokens[i]), tokenBalance);
|
||||
emit Withdrawal(address(tokens[i]), tokenBalance, receiver);
|
||||
tokens[i].safeTransfer(receiver, tokenBalance);
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ contract TychoRouter is AccessControl {
|
||||
|
||||
uint256 amount = address(this).balance;
|
||||
if (amount > 0) {
|
||||
emit Withdrawal(address(0), amount);
|
||||
emit Withdrawal(address(0), amount, receiver);
|
||||
// slither-disable-next-line arbitrary-send-eth
|
||||
bool success = payable(receiver).send(amount);
|
||||
if (!success) revert TychoRouter__WithdrawalFailed();
|
||||
|
||||
Reference in New Issue
Block a user