Emergency Shutdown (ES) CLI
Level: Intermediate
Estimated-Time: 30 minutes
Description
Emergency Shutdown (ES) is the last resort to protect the Maker Protocol against a serious threat, such as but not limited to governance attacks, long-term market irrationality, hacks and security breaches. The Emergency Shutdown Module (ESM) is responsible for coordinating emergency shutdown, the process used to gracefully shutdown the Maker Protocol and properly allocate collateral to both Vault users and Dai holders. This guide outlines the steps and procedures necessary to check, interact with and trigger the ESM.
Learning Objectives: To be able to Check, Deposit and Trigger Emergency Shutdown.
Table of Contents
Installation
Contract Address Setup
Commands and Explanations
Checking your MKR balance
Checking and setting your MKR approval
Checking the live() flag
Checking the ESM threshold
Deposit a trial amount of MKR into the ESM
Depositing MKR into the ESM
Checking how much MKR is in the ESM
Checking whether the ESM has been triggered
Triggering the ESM
1. Installation
In order to interface with the Ethereum blockchain, the user needs to install seth, a command line tool as part of the Dapp.Tools toolset. We also provide further installation information here. Once the user has installed and configured seth
correctly to use the main Ethereum network and the address which holds their MKR they can query contract balances, approvals and transfers.
2. Contract Address Setup
3. Commands and Explanations
Checking your MKR balance
Before depositing your MKR into the ESM contract, first check your address MKR balance:
Checking and setting your MKR approval
In order to execute the contract functions of the MKR token it is required that approvals be set on the token. The first step is to check if the ESM contract is allowed to withdraw from your address:
If the ESM contract is not allowed to withdraw from your address, the following can be used to set the allowance on the MKR token. This will approve the ESM to withdraw from the user's wallet:
Following which we again check to confirm that the ESM is allowed to withdraw from the user's account. This action will return uint256 to confirm the allowance to withdraw.
Reference contract information.
Checking the live flag
Live contracts have live
= 1, indicating that the system is running normally. Thus when cage()
is invoked, it sets the flag to 0.
Checking the ESM threshold
In order to check the min
value, you can call:
Deposit a small amount (0.1 MKR) into the ESM
To deposit a small amount of MKR into the esm contract to test correct deposit function, we use the join
function and specify a small amount.
Checking how much MKR is in the ESM
To check for the total amount of MKR that has been added to the ESM we call the Sum()
function
Checking how much MKR you have included in the ESM
To check how much MKR you have included in the ESM we can call lowercase sum()
with the user address as an argument:
Depositing e.g. 50,000 MKR into the ESM
To deposit MKR into the esm contract we use the join
function and specify the amount.
Please specify the amount of MKR that you intend to deposit into the ESM.
Checking whether the ESM has been triggered
To validate that the Emergency Shutdown has been triggered, the fired()
function can be called which will return a boolean.
Triggering the ESM
In order for the emergency shutdown to trigger, it is required that the Sum()
is greater than the min()
. Only then can the fire()
function be executed successfully.
Note: If triggering the ESM is not successful, ensure gas is set at an appropriate level
Note: The triggering of the ESM is not to be taken lightly; for a full explanation of the implications please review the below documentation.
Links
Last updated