Option 4: Buy Sentry Key via Node License Contract on Arbiscan

## Mint with ETH:

### 1. Get the Price

1. Open the NodeLicense **Read Proxy** page: https://arbiscan.io/address/0xbc14d8563b248B79689ECbc43bBa53290e0b6b66#readProxyContract

2. Locate and call the function **"24. price"**.

- Input the amount of keys you want to mint.

- Input a `promoCode` (any string; if valid, it will return a discounted price; if not, you'll still get a correct price quote).

- After calling, copy the returned ETH amount.

3. Call `mint` or `mintTo` to mint with ETH where the `_expectedCostInUSDC` is the calcualted price in USDC (6 decimals). Any excess value will not be charged, the NodeLicense will use the same price oracle to calcualte the price.

--- ## Mint with USDC

1. Open the NodeLicense **Read Proxy** page: https://arbiscan.io/address/0xbc14d8563b248B79689ECbc43bBa53290e0b6b66#readProxyContract

2. Locate and call the function **"24. price"**.

- Input the amount of keys you want to mint.

- Input a `promoCode` (any string; if valid, it will return a discounted price; if not, you'll still get a correct price quote).

- After calling, copy the returned ETH amount.

3. Get the latest quote for ETH / USD

- The NodeLicense will use the price oracle at https://arbiscan.io/address/0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612#readContract

- Use `latestAnswer` to get the current ETH / USD value (Note this is with 8 decimals)

4. Call `mintToWithUSDC` on NodeLicense to mint with USDC

## Step-by-Step Guide to Minting Keys with XAI/esXAI

Follow the steps below to get the cost, approve spending, and then mint your keys. Make sure you have the required tokens and are connected with the wallet that will pay for the minting transaction.

---

### 1. Get the Price

1. Open the NodeLicense **Read Proxy** page: https://arbiscan.io/address/0xbc14d8563b248B79689ECbc43bBa53290e0b6b66#readProxyContract

2. Locate and call the function **"24. price"**.

- Input the amount of keys you want to mint.

- Input a `promoCode` (any string; if valid, it will return a discounted price; if not, you'll still get a correct price quote).

- After calling, copy the returned ETH amount.

3. Next, locate and call the function **"10. ethToXai"**.

- Paste the ETH amount you copied from the previous step into this call.

- Copy the returned value, which is the cost in XAI/esXAI.

**At this point, you have the total XAI/esXAI amount required to mint your keys.**

---

### 2. Approve the NodeLicense Contract as a Spender

You need to allow the NodeLicense contract to spend your XAI or esXAI tokens before minting. You can do this either directly from the key sale page (if available) or via Arbiscan.

#### Approving XAI

1. Go to the XAI contract **Write Proxy** page: https://arbiscan.io/address/0x4Cb9a7AE498CEDcBb5EAe9f25736aE7d428C9D66#writeProxyContract

2. Connect your wallet.

3. Find the **"1. approve"** function.

- **spender**: `0xbc14d8563b248B79689ECbc43bBa53290e0b6b66` (NodeLicense address)

- **amount**: The XAI amount you got from Step 1.

4. Submit the transaction to approve spending.

#### Approving esXAI

1. Go to the esXAI contract **Write Proxy** page: https://arbiscan.io/address/0x4C749d097832DE2FEcc989ce18fDc5f1BD76700c#writeProxyContract

2. Connect your wallet.

3. Find the **"2. approve"** function.

- **spender**: `0xbc14d8563b248B79689ECbc43bBa53290e0b6b66` (NodeLicense address)

- **amount**: The esXAI amount you got from Step 1.

4. Submit the transaction to approve spending.

---

### 3. Mint Your Keys

1. Return to the NodeLicense **Write Proxy** page: https://arbiscan.io/address/0xbc14d8563b248B79689ECbc43bBa53290e0b6b66#readProxyContract

*(Note: After opening this page, you may need to switch to the "Write Proxy" tab.)*

2. Connect your wallet.

3. Find the function **"13. mintWithXai"** and enter the following arguments:

- **to**: The address that should receive the minted keys.

- **amount**: The number of keys to mint (same as used in the "price" function).

- **promoCode**: The same `promoCode` you used in Step 1. - **useEsXai**:

- `true` if you're using esXAI for payment

- `false` if you're using XAI

- **expectedCost**: The cost you calculated in Step 1.

*(Tip: You can input a slightly higher amount to cover any slight price changes between steps. Any excess will be refunded.)*

4. Submit the transaction.

---

**You've now successfully minted your keys using XAI/esXAI.**

Last updated