# Deploying HRC20

#### Create your own HRC20 token

Let us first create a simple HRC20 token with name "Gold" and symbol "GLD" with default 18 decimals.

1\. Launch [Remix](https://remix.ethereum.org/) and create a new file with name GLDToken.sol and copy paste the code below.

![](https://3781397247-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlEOlYqEG_GKuO5Rehq%2F-Mc2rsXquHuTWVwmo-w1%2F-Mc2veLodiUOhrsH2LLo%2Fnew-file.png?alt=media\&token=f96047e4-b99d-4904-8cec-064093f6a398)

```
// contracts/GLDToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract GLDToken is ERC20 {
    constructor(uint256 initialSupply) ERC20("Gold", "GLD") {
        _mint(msg.sender, initialSupply);
    }
}
```

2\. Compile the GLDToken.sol

![](https://3781397247-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlEOlYqEG_GKuO5Rehq%2F-Mc2rsXquHuTWVwmo-w1%2F-Mc2vp2KgFfEZrn4CNuO%2Fcompile.png?alt=media\&token=758ed754-1cda-4bab-ad25-7cc31ac886bb)

3\. Deploy the GLDToken.sol

![](https://3781397247-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlEOlYqEG_GKuO5Rehq%2F-Mc2rsXquHuTWVwmo-w1%2F-Mc2vylG48dE3oQBSBpR%2Fdeploy.png?alt=media\&token=843e4410-e983-4e8c-a665-c3b070293e0d)

4\. Interacting with the deployed GLDToken.

![](https://3781397247-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlEOlYqEG_GKuO5Rehq%2F-Mc2rsXquHuTWVwmo-w1%2F-Mc2w911IoqL8Ty81HSs%2Fdeployed.png?alt=media\&token=d848444e-900e-4610-94c7-0647369102d4)

5\. Changing decimals from default 18 to e.g., 16 can be done by adding the following function to GLDToken.sol file and repeating steps 2-4.

```
function decimals() public view virtual override returns (uint8) {
    return 16;
}
```

6\. Deploying a Preset HRC20 contract: A preset HRC20 contract allow for token minting, stop all token transfers (pause), and allow holders to burn their tokens. More info [here](https://docs.openzeppelin.com/contracts/4.x/erc20#Presets). Copy and paste the code below to your GLDToken.sol and repeat the steps 2-4.

```
// contracts/GLDToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";

contract GLDToken is ERC20PresetMinterPauser {
    constructor(uint256 initialSupply) ERC20PresetMinterPauser("Gold", "GLD") {
        _mint(msg.sender, initialSupply);
    }
}
```
