# Smart contract repo setup

### COMMANDS

Make sure IDE is up to date. To upgrade node in the Windows powershell:&#x20;

```
winget install OpenJS.NodeJS.LTS
```

winget install OpenJS.NodeJS.LTS

```



npx hardhat compile
npx hardhat run scripts/deploy-convert.js --network sepolia
npx hardhat run scripts/deploy-convert-factory.js --network sepolia
npx hardhat run scripts/deploy-tokenized-convert.js --network sepolia
npx hardhat run scripts/deploy-tokenized-convert.js --network sepolia
npx hardhat run scripts/deploy-tokenized-stock-arbitrum-v2.js --network arbitrum_sepolia
npx hardhat run scripts/deploy-tokenized-stock-arbitrum-v3.js --network arbitrum_sepolia
npx hardhat run scripts/deploy-tokenized-stock-arbitrum-v4.js --network arbitrum_sepolia
npx hardhat run scripts/deploy-tokenized-stock-arbitrum-v4.js --network arbitrum_sepolia
npx hardhat run scripts/deploy-tokenized-stock-arbitrum-v4.js --network arbitrum_sepolia
clear
npx hardhat run scripts/deploy-tokenized-stock-arbitrum-v4.js --network arbitrum_sepolia
Get-History | ForEach-Object { $_.CommandLine } | Out-File all-commands.txt


Get-ChildItem -Recurse -File | Where-Object {$_.FullName -notmatch "node_modules|lib"} | Select-Object FullName
```

### HARDHAT \[[docs](https://v2.hardhat.org/hardhat-runner/docs/guides/project-setup)]

npm init -y\
npm install --save-dev hardhat\
npm install hardhat\
npx hardhat init\
npm pkg set type="module"

```
alexa@Alexs-Razer MINGW64 /c/XFT/prediction-mkts/prod
$ npx hardhat --init

WARNING: You are using Node.js 20.3.1 which is not supported by Hardhat.
Please upgrade to 22.10.0 or a later LTS version (even major version number)


 █████  █████                         ███  ███                  ███      ██████
░░███  ░░███                         ░███ ░███                 ░███     ███░░███
 ░███   ░███   ██████  ████████   ███████ ░███████    ██████  ███████  ░░░  ░███
 ░██████████  ░░░░░███░░███░░███ ███░░███ ░███░░███  ░░░░░███░░░███░      ████░
 ░███░░░░███   ███████ ░███ ░░░ ░███ ░███ ░███ ░███   ███████  ░███      ░░░░███
 ░███   ░███  ███░░███ ░███     ░███ ░███ ░███ ░███  ███░░███  ░███ ███ ███ ░███
 █████  █████░░███████ █████    ░░███████ ████ █████░░███████  ░░█████ ░░██████
░░░░░  ░░░░░  ░░░░░░░ ░░░░░      ░░░░░░░ ░░░░ ░░░░░  ░░░░░░░    ░░░░░   ░░░░░░

👷 Welcome to Hardhat v3.0.4 👷

? Which version of Hardhat would you like to use? ... 
> Hardhat 3 Beta (recommended for new projects)
  Hardhat 2 (older version)
```

Select Hardhat 2 (older version)\
Click enter for absolute project path\
Select an empty hardhat.config.js&#x20;

FILES

hardhat.config.js\
contracts/ConditionalToken.sol<br>

***

```javascript
// hardhat.config.js

require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");
require("@openzeppelin/hardhat-upgrades");
require("dotenv").config();

module.exports = {
  solidity: {
    compilers: [
      {
        version: "0.8.18",
        settings: {
          viaIR: true,
          optimizer: {
            enabled: true,
            runs: 200,
          }
        }
      },
      {
        version: "0.8.24",
        settings: {
          optimizer: {
            enabled: true,
            runs: 200
          },
          evmVersion: "paris"
        }
      }
    ]
  },
  networks: {
    sepolia: {
      url: process.env.SEPOLIA_RPC_URL,
      accounts: [process.env.ADMIN_PRIVATE_KEY]
    },
    arbitrum_sepolia: {
      url: process.env.ARBITRUM_SEPOLIA_RPC_URL,
      accounts: [process.env.ADMIN_PRIVATE_KEY]
    },
    arbitrum_mainnet: {
      url: process.env.ARBITRUM_MAINNET_RPC_URL,
      accounts: [process.env.ADMIN_PRIVATE_KEY]
    },
    base_sepolia: {
      url: process.env.BASE_SEPOLIA_RPC_URL,
      accounts: [process.env.ADMIN_PRIVATE_KEY]
    },
    xdc_apothem: {
      url: process.env.XDC_APOTHEM_RPC_URL,
      accounts: [process.env.ADMIN_PRIVATE_KEY]
    },
    avalanche_fuji: {
      url: process.env.AVALANCHE_FUJI_RPC_URL,
      accounts: [process.env.ADMIN_PRIVATE_KEY]
    },
    polygon_amoy: {
      url: process.env.POLYGON_AMOY_RPC_URL,
      accounts: [process.env.ADMIN_PRIVATE_KEY]
    }
  },
  etherscan: {
  apiKey: {
    sepolia: process.env.ETHERSCAN_API_KEY,
    arbitrum_sepolia: process.env.ETHERSCAN_V2_API_KEY
  },
  customChains: [
     {
       network: "arbitrum_sepolia",
       chainId: 421614,
       urls: {
         apiURL: "https://api.etherscan.io/v2/api?chainid=421614",
         browserURL: "https://sepolia.arbiscan.io"
       }
     }
   ]
}
};
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xft.finance/learn/smart-contract-repo-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
