Skip to content

Commit

Permalink
Emit event on Bepolia recover
Browse files Browse the repository at this point in the history
  • Loading branch information
vp4242 committed Feb 21, 2024
1 parent 7536ba8 commit 2480651
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions contracts/0.8.9/SepoliaDepositAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ contract SepoliaDepositAdapter is IDepositContract, Ownable {

event EthRecovered(uint256 amount);

event BepoliaRecovered(uint256 amount);

error EthRecoverFailed();

error BepoliaRecoverFailed();
Expand Down Expand Up @@ -83,6 +85,7 @@ contract SepoliaDepositAdapter is IDepositContract, Ownable {
if (!success) {
revert BepoliaRecoverFailed();
}
emit BepoliaRecovered(bepoliaOwnTokens);
}

function deposit(
Expand Down
3 changes: 2 additions & 1 deletion test/0.8.9/sepolia-deposit-adapter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ contract('SepoliaDepositAdapter', ([deployer]) => {
log('bepoliaHolderEndBalance', bepoliaHolderEndBalance)

// Recover Bepolia tokens
await depositAdapter.recoverBepolia()
const receipt = await depositAdapter.recoverBepolia()
assert.emits(receipt, 'BepoliaRecovered', { amount: BEPOLIA_TO_TRANSFER })

const bepoliaTokensOnAdapter = await bepoliaToken.balanceOf(adapterAddr)
assert.equals(bepoliaTokensOnAdapter, 0)
Expand Down

0 comments on commit 2480651

Please sign in to comment.