diff --git a/packages/protocol/contracts/team/tokenunlock/TokenUnlock.sol b/packages/protocol/contracts/team/tokenunlock/TokenUnlock.sol index 88d716b63d5..a854cdc96cd 100644 --- a/packages/protocol/contracts/team/tokenunlock/TokenUnlock.sol +++ b/packages/protocol/contracts/team/tokenunlock/TokenUnlock.sol @@ -126,7 +126,7 @@ contract TokenUnlock is EssentialContract { IERC20(resolve(LibStrings.B_TAIKO_TOKEN, false)).safeTransfer(_proverSet, _amount); } - /// @notice Withdraws all withdrawable tokens. + /// @notice Withdraws tokens by the recipient. /// @param _to The address the token will be sent to. /// @param _amount The amount of tokens to withdraw. function withdraw( @@ -140,12 +140,17 @@ contract TokenUnlock is EssentialContract { nonReentrant { if (_amount > amountWithdrawable()) revert NOT_WITHDRAWABLE(); - emit TokenWithdrawn(_to, _amount); - IERC20(resolve(LibStrings.B_TAIKO_TOKEN, false)).safeTransfer(_to, _amount); } + /// @notice Withdraws all tokens to the recipient address. + function withdraw() external nonReentrant { + uint256 amount = amountWithdrawable(); + emit TokenWithdrawn(recipient, amount); + IERC20(resolve(LibStrings.B_TAIKO_TOKEN, false)).safeTransfer(recipient, amount); + } + function changeRecipient(address _newRecipient) external onlyRecipient { if (_newRecipient == address(0) || _newRecipient == recipient) { revert INVALID_PARAM(); diff --git a/packages/protocol/deployments/mainnet-contract-logs-L1.md b/packages/protocol/deployments/mainnet-contract-logs-L1.md index 4b554f33ccb..eae241f9d6a 100644 --- a/packages/protocol/deployments/mainnet-contract-logs-L1.md +++ b/packages/protocol/deployments/mainnet-contract-logs-L1.md @@ -336,6 +336,9 @@ - impl: `0x035AFfC82612de31E9Db2259B9482D0Dd53B7819` - logs: - deployed @commit`bca493f` @tx`0x0a4a63715257b766ca06e7e87ee25088d557c460e50120208b31666c83fc68bc` +- todo: + - deploy a new version with `withdrawToRecipient` function + - upgrade `0x2Bc21D70BDe29a8E6576F7aCD979029058f2eeF9` with the new implementation ### prover_set