Skip to content

SC: Implement Emergency Withdrawal #80

@Pvsaint

Description

@Pvsaint

Description
Implement an emergency exit mechanism for owner to withdraw all funds if contract is paused.

Tasks

Function emergency_withdraw(token: ContractAddress, to: ContractAddress):

Ensure contract is paused.

Use ERC20 balanceOf to get full balance of this contract.

Transfer full balance to to.

Emit EmergencyWithdrawal event.

Acceptance Criteria

Only callable by owner.

Only works when contract is paused.

Transfers full balance of given token to destination.

Event emitted with correct values.

Unit test verifying normal users cannot call this.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions