From 7bec257a1c2ea3cd61e21c39f17e1eea11ff89a9 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Wed, 3 Jul 2024 12:02:56 +0800 Subject: [PATCH] pnpm test --- packages/protocol/contracts/L1/ITaikoL1.sol | 8 ++++++++ packages/protocol/contracts/team/proving/ProverSet.sol | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/packages/protocol/contracts/L1/ITaikoL1.sol b/packages/protocol/contracts/L1/ITaikoL1.sol index b758d4a710..b4bec95896 100644 --- a/packages/protocol/contracts/L1/ITaikoL1.sol +++ b/packages/protocol/contracts/L1/ITaikoL1.sol @@ -34,6 +34,14 @@ interface ITaikoL1 { /// @param _pause True if paused. function pauseProving(bool _pause) external; + /// @notice Deposits Taiko token to be used as bonds. + /// @param _amount The amount of Taiko token to deposit. + function depositBond(uint256 _amount) external; + + /// @notice Withdraws Taiko token. + /// @param _amount The amount of Taiko token to withdraw. + function withdrawBond(uint256 _amount) external; + /// @notice Gets the configuration of the TaikoL1 contract. /// @return Config struct containing configuration parameters. function getConfig() external pure returns (TaikoData.Config memory); diff --git a/packages/protocol/contracts/team/proving/ProverSet.sol b/packages/protocol/contracts/team/proving/ProverSet.sol index fda520e724..7eb1537a22 100644 --- a/packages/protocol/contracts/team/proving/ProverSet.sol +++ b/packages/protocol/contracts/team/proving/ProverSet.sol @@ -95,6 +95,16 @@ contract ProverSet is EssentialContract, IERC1271 { ITaikoL1(taikoL1()).proveBlock(_blockId, _input); } + /// @notice Deposits Taiko token to TaikoL1 contract. + function depositBond(uint256 _amount) external onlyAuthorized nonReentrant { + ITaikoL1(taikoL1()).depositBond(_amount); + } + + /// @notice Withdraws Taiko token from TaikoL1 contract. + function withdrawBond(uint256 _amount) external onlyAuthorized nonReentrant { + ITaikoL1(taikoL1()).withdrawBond(_amount); + } + /// @notice Delegates token voting right to a delegatee. /// @param _delegatee The delegatee to receive the voting right. function delegate(address _delegatee) external onlyAuthorized nonReentrant {