Skip to content

Commit

Permalink
add back the trasnsfer call
Browse files Browse the repository at this point in the history
  • Loading branch information
WalidOfNow committed Jun 26, 2024
1 parent 0087cb3 commit 84397e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mainnet-contracts/src/PufToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ contract PufToken is IPufStakingPool, ERC20, ERC20Permit {
function withdraw(address recipient, uint256 amount) external validateAddressAndAmount(recipient, amount) {
_burn(msg.sender, amount);

TOKEN.safeTransfer(recipient, amount);

emit Withdrawn(msg.sender, recipient, amount);
}

Expand Down
4 changes: 4 additions & 0 deletions mainnet-contracts/test/unit/PufferL2Staking.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ contract PufferL2Staking is UnitTestHelper {
vm.expectEmit(true, true, true, true);
emit IPufStakingPool.Withdrawn(bob, bob, amount); // original deposit amount
pufToken.withdraw(bob, amount);

assertEq(sixDecimal.balanceOf(bob), amount, "bob got same amount");
}

// Deposit & withdraw 22 decimal token
Expand Down Expand Up @@ -205,6 +207,8 @@ contract PufferL2Staking is UnitTestHelper {
vm.expectEmit(true, true, true, true);
emit IPufStakingPool.Withdrawn(bob, bob, amount); // original deposit amount
pufToken.withdraw(bob, amount);

assertEq(twentyTwoDecimal.balanceOf(bob), amount, "bob got same amount");
}

// Good Permit signature signature
Expand Down

0 comments on commit 84397e2

Please sign in to comment.