Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to disable safeMode #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions contracts/WalletSimple.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ contract WalletSimple is IERC721Receiver, ERC1155Receiver {
// Events
event Deposited(address from, uint256 value, bytes data);
event SafeModeActivated(address msgSender);
event SafeModeDeActivated(address msgSender);
event Transacted(
address msgSender, // Address of the sender of the message initiating the transaction
address otherSigner, // Address of the signer (second signature) used to initiate the transaction
Expand Down Expand Up @@ -500,9 +501,20 @@ contract WalletSimple is IERC721Receiver, ERC1155Receiver {
* Irrevocably puts contract into safe mode. When in this mode, transactions may only be sent to signing addresses.
*/
function activateSafeMode() external onlySigner {
require(bool(safeMode) == false, 'safeMode already activated');
safeMode = true;
emit SafeModeActivated(msg.sender);
}

/**
* deactivate safe-mode, transactions can be sent to any addresses.
*/
function deactivateSafeMode() external onlySigner {
require(bool(safeMode) == true, 'safeMode is not activated');
safeMode = true;
emit SafeModeActivated(msg.sender);
}


/**
* Gets signer's address using ecrecover
Expand Down