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 27, 2025
1 parent ecaff63 commit cf9e9b4
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) {
bEIGEN = _bEIGEN;
Expand Down Expand Up @@ -124,6 +128,7 @@ contract Eigen is OwnableUpgradeable, ERC20VotesUpgradeable {
function wrap(uint256 amount) 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 @@ -132,6 +137,7 @@ contract Eigen is OwnableUpgradeable, ERC20VotesUpgradeable {
function unwrap(uint256 amount) 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 cf9e9b4

Please sign in to comment.