Skip to content

Commit

Permalink
fix: make transfer restrictions work with wrap/unwrap changes
Browse files Browse the repository at this point in the history
switch `address(this)` => `address(0)` to allow wrapping + unwrapping while transfer restrictions are in place

this aligns transfer restrictions with the modified wrap/unwrap behavior (where tokens are minted/burned instead of transferred from the token's own address)
  • Loading branch information
MinisculeTarantula committed Sep 9, 2024
1 parent 12917d9 commit c53aa74
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/contracts/token/Eigen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ contract Eigen is OwnableUpgradeable, ERC20VotesUpgradeable {
if (block.timestamp <= transferRestrictionsDisabledAfter) {
// if both from and to are not whitelisted
require(
from == address(0) || from == address(this) || to == address(this) || allowedFrom[from] || allowedTo[to],
from == address(0) || to == address(0) || allowedFrom[from] || allowedTo[to],
"Eigen._beforeTokenTransfer: from or to must be whitelisted"
);
}
Expand Down
1 change: 0 additions & 1 deletion src/test/token/EigenWrapping.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ contract EigenWrappingTests is Test {

vm.startPrank(minter1);
bEIGEN.setAllowedFrom(minter1, true);
eigen.setAllowedTo(address(0), true);
vm.stopPrank();

}
Expand Down

0 comments on commit c53aa74

Please sign in to comment.