# Enact Global Freeze If you [issue tokens](/docs/concepts/tokens) in the XRP Ledger, can enact a [Global Freeze](/docs/concepts/tokens/fungible-tokens/freezes#global-freeze) to prevent users from sending your tokens to each other and trading your token in the [decentralized exchange](/docs/concepts/tokens/decentralized-exchange). This tutorial shows how to enact and end a Global Freeze. You might want to do this, for example, if you see signs of suspicious activity related to your issuing address in the ledger, or to off-ledger systems you use to manage your token. (For example, if your token is a stablecoin and you process withdrawals and deposits from the ledger, you may want to freeze your token while you investigate if you suspect your systems have been hacked.) You can later disable the Global Freeze setting unless you have also enabled the [No Freeze setting](/docs/concepts/tokens/fungible-tokens/freezes#no-freeze). As a reminder, freezes only apply to issued tokens, not XRP, and do not prevent users from sending the tokens *directly* back to the issuer. ## Prerequisites - You need a connection to the XRP Ledger network. As shown in this tutorial, you can use public servers for testing. - You should be familiar with the Getting Started instructions for your preferred client library. This page provides examples for the following: - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](/docs/tutorials/javascript/build-apps/get-started) for setup steps. - You don't need to have [issued a token](/docs/tutorials/how-tos/use-tokens/issue-a-fungible-token) in the XRP Ledger to enact a Global Freeze, but the main reason you would do so is if you have already issued such a token. script script ## Example Code Complete sample code for all of the steps of this tutorial is available under the [MIT license](https://github.com/XRPLF/xrpl-dev-portal/blob/master/LICENSE). - See [Code Samples: Freeze](https://github.com/XRPLF/xrpl-dev-portal/tree/master/_code-samples/freeze/) in the source repository for this website. ## Steps ### 1. Get Credentials To transact on the XRP Ledger, you need an address and secret key, and some XRP. If you use the best practice of having separate ["cold" and "hot" addresses](/docs/concepts/accounts/account-types), you need the keys to the *cold address*, which is the **issuer** of the token. Only the issuer's Global Freeze setting has any effect on a token. Unlike the No Freeze setting, you *can* enable and disable a Global Freeze using a [regular key pair](/docs/concepts/accounts/cryptographic-keys) or [multi-signing](/docs/concepts/accounts/multi-signing). For this tutorial, you can get credentials from the following interface: Get Testnet credentials div Ripple provides the [Testnet and Devnet](/docs/concepts/networks-and-servers/parallel-networks) for testing purposes only, and sometimes resets the state of these test networks along with all balances. As a precaution, **do not** use the same addresses on Testnet/Devnet and Mainnet. When you're building production-ready software, you should use an existing account, and manage your keys using a [secure signing configuration](/docs/concepts/transactions/secure-signing). ### 2. Connect to the Network You must be connected to the network to submit transactions to it. The following code shows how to connect to a public XRP Ledger Testnet server a supported [client library](/docs/references/client-libraries): JavaScript // You can also use a