From 601aa9ccee946e5cdb6ed87c26a33a1ca0e9b05f Mon Sep 17 00:00:00 2001 From: wangjj9219 <183318287@qq.com> Date: Fri, 12 Jul 2024 12:26:00 +0800 Subject: [PATCH] add Rebonded event --- contracts/docs/earning/Earning.md | 17 +++++++++++++++++ contracts/docs/earning/IEarning.md | 17 +++++++++++++++++ contracts/earning/Earning.sol | 2 +- contracts/earning/IEarning.sol | 5 +++++ 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/contracts/docs/earning/Earning.md b/contracts/docs/earning/Earning.md index 869eec1..c2eac5d 100644 --- a/contracts/docs/earning/Earning.md +++ b/contracts/docs/earning/Earning.md @@ -227,6 +227,23 @@ Bonded event. | sender `indexed` | address | The sender of the transaction. | | amount | uint256 | The bond amount. | +### Rebonded + +```solidity +event Rebonded(address indexed sender, uint256 amount) +``` + +Rebonded event. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| sender `indexed` | address | The sender of the transaction. | +| amount | uint256 | The rebond amount. | + ### Unbonded ```solidity diff --git a/contracts/docs/earning/IEarning.md b/contracts/docs/earning/IEarning.md index d807fa4..43c3024 100644 --- a/contracts/docs/earning/IEarning.md +++ b/contracts/docs/earning/IEarning.md @@ -227,6 +227,23 @@ Bonded event. | sender `indexed` | address | The sender of the transaction. | | amount | uint256 | The bond amount. | +### Rebonded + +```solidity +event Rebonded(address indexed sender, uint256 amount) +``` + +Rebonded event. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| sender `indexed` | address | The sender of the transaction. | +| amount | uint256 | The rebond amount. | + ### Unbonded ```solidity diff --git a/contracts/earning/Earning.sol b/contracts/earning/Earning.sol index 51797c9..0855286 100644 --- a/contracts/earning/Earning.sol +++ b/contracts/earning/Earning.sol @@ -64,7 +64,7 @@ contract Earning is IEarning { if eq(success, 0) { revert(add(returnData, 0x20), returndatasize()) } } - emit Bonded(msg.sender, abi.decode(returnData, (uint256))); + emit Rebonded(msg.sender, abi.decode(returnData, (uint256))); return true; } diff --git a/contracts/earning/IEarning.sol b/contracts/earning/IEarning.sol index 87e1179..fe9c164 100644 --- a/contracts/earning/IEarning.sol +++ b/contracts/earning/IEarning.sol @@ -33,6 +33,11 @@ interface IEarning { /// @param amount The unbond amount. event Unbonded(address indexed sender, uint256 amount); + /// @notice Rebonded event. + /// @param sender The sender of the transaction. + /// @param amount The rebond amount. + event Rebonded(address indexed sender, uint256 amount); + /// @notice Withdraw unbonded. /// @param sender The sender of the transaction. /// @param amount The withdrawn unbonded amount.