Skip to content

Commit

Permalink
feat: add EigenWrapped and EigenUnwrapped events
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenli86 committed Jan 13, 2025
1 parent 1427a85 commit 59c9629
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/contracts/token/Eigen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ contract Eigen is OwnableUpgradeable, ERC20VotesUpgradeable {
event Mint(address indexed minter, uint256 amount);
/// @notice event emitted when the transfer restrictions disabled
event TransferRestrictionsDisabled();
/// @notice event emitted when an initiator wraps bEIGEN into EIGEN
event EigenWrapped(address indexed initiator, uint256 amount);
/// @notice event emitted when an initiator unwraps EIGEN to bEIGEN
event EigenUnwrapped(address indexed initiator, uint256 amount);

constructor(
IERC20 _bEIGEN
Expand Down Expand Up @@ -128,6 +132,7 @@ contract Eigen is OwnableUpgradeable, ERC20VotesUpgradeable {
) external {
require(bEIGEN.transferFrom(msg.sender, address(this), amount), "Eigen.wrap: bEIGEN transfer failed");
_mint(msg.sender, amount);
emit EigenWrapped(msg.sender, amount);
}

/**
Expand All @@ -138,6 +143,7 @@ contract Eigen is OwnableUpgradeable, ERC20VotesUpgradeable {
) external {
_burn(msg.sender, amount);
require(bEIGEN.transfer(msg.sender, amount), "Eigen.unwrap: bEIGEN transfer failed");
emit EigenUnwrapped(msg.sender, amount);
}

/**
Expand Down

0 comments on commit 59c9629

Please sign in to comment.