> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tenderly.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Editing Contract Source

> simulation बनाते समय contract source code, compiler settings, या ABI को inline edit करें, और संशोधित code को live network state के विरुद्ध चलाएँ।

एक बार जब आप [Simulator UI](/simulator-ui/overview) में एक simulation step में एक contract चुनते हैं, तो **Contract** field के आगे दो बटन दिखाई देते हैं: **Edit source** और **Edit ABI**। ये आपको deployed contract को छुए बिना यह बदलने देते हैं कि simulation क्या code execute करता है, ताकि आप bug fix का परीक्षण कर सकें, एक parameter को tweak कर सकें, या कुछ भी deploy करने से पहले live production state के विरुद्ध नए logic को आज़मा सकें।

जब आप फिर से simulate करते हैं तो वही controls उपलब्ध होते हैं: एक transaction detail पेज पर **Re-Simulate** पर क्लिक करने से इसके inputs builder में load होते हैं, जहाँ आप source को edit कर सकते हैं और फिर से चला सकते हैं।

## Edit source

source editor खोलने के लिए **Edit source** पर क्लिक करें।

<Frame caption="source editor: बाईं ओर contract सूची और Compiler Info, दाईं ओर file selector और editable source।">
  <img src="https://mintcdn.com/tenderly/5rOzguRoBTCVuzKW/images/simulator-ui/sim-edit-source-editor.webp?fit=max&auto=format&n=5rOzguRoBTCVuzKW&q=85&s=15671db8cbe7f26335252f3e10ac1afb" alt="Editing Source view showing the Dai contract address, a File dropdown with Dai.sol, the Solidity source in an editor, and a Select Contract Name dropdown, with Compiler Info, the Dai contract entry, Add contract source, and Apply Changes in the left panel" width="1600" height="1000" data-path="images/simulator-ui/sim-edit-source-editor.webp" />
</Frame>

editing pane दिखाता है:

| Element                  | Notes                                                                        |
| ------------------------ | ---------------------------------------------------------------------------- |
| **Address**              | वह address जिसका code आप edit कर रहे हैं।                                    |
| **File**                 | multi-file contracts के लिए source files के बीच switch करने के लिए Dropdown। |
| **Editor**               | पूरा source, line by line editable।                                          |
| **Select Contract Name** | file में कौन सा contract address पर deployed है।                             |

Edits केवल आपके simulation पर लागू होते हैं। deployed contract और अन्य project members की simulations अप्रभावित हैं।

edits को save करने के लिए नीचे-बाएँ कोने में **Apply Changes** पर क्लिक करें, फिर simulation चलाएँ। step बाकी network state को छुए बिना संशोधित code execute करता है।

### Compiler settings

edit किए गए source को कैसे compile किया जाता है इसे समायोजित करने के लिए बाएँ पैनल में **Compiler Info** चुनें:

<Frame caption="Compiler Info: compiler version, optimization settings, EVM version, और ViaIR toggle।">
  <img src="https://mintcdn.com/tenderly/5rOzguRoBTCVuzKW/images/simulator-ui/sim-edit-source-compiler.webp?fit=max&auto=format&n=5rOzguRoBTCVuzKW&q=85&s=45f4d47be54b42b9a177aaebbabee032" alt="Compiler Info pane showing Compiler Version solc v0.5.12, Optimization Used false, Optimization Count 200, EVM Version petersburg, and a ViaIR toggle" width="1600" height="470" data-path="images/simulator-ui/sim-edit-source-compiler.webp" />
</Frame>

* **Compiler Version**
* **Optimization Used** और **Optimization Count**
* **EVM Version**
* **ViaIR**

settings contract के verification metadata से load होती हैं, इसलिए एक सादा edit-and-run के लिए कोई compiler परिवर्तन नहीं चाहिए।

### Add contract source

एक ही simulation में अतिरिक्त contracts को edit करने के लिए बाएँ पैनल में **Add contract source** पर क्लिक करें। किसी भी deployed contract का address दर्ज करें और इसका source सूची में एक और entry के रूप में load हो जाता है। यह एक simulation को एक साथ कई contracts के लिए संशोधित code चलाने देता है, उदाहरण के लिए एक router और वह pool जिसमें यह call करता है।

## Edit ABI

**Edit ABI** पर क्लिक करके उस ABI पर एक JSON editor खोलें जिसका builder functions को decode करने और आपके inputs को encode करने के लिए उपयोग करता है।

<Frame caption="Edit ABI dialog: contract का ABI editable JSON के रूप में।">
  <img src="https://mintcdn.com/tenderly/5rOzguRoBTCVuzKW/images/simulator-ui/sim-edit-abi.webp?fit=max&auto=format&n=5rOzguRoBTCVuzKW&q=85&s=9219a4f3b81b1cf682be885ed66d6538" alt="Edit ABI dialog showing the contract ABI as JSON with constructor and function entries, and Cancel and Save buttons" width="660" height="580" data-path="images/simulator-ui/sim-edit-abi.webp" />
</Frame>

ABI को edit करना तब उपयोगी होता है जब कोई contract unverified हो या इसका interface published ABI से भिन्न हो: JSON को paste या समायोजित करें, **Save** पर क्लिक करें, और **Function** dropdown और argument fields अद्यतन परिभाषा का पालन करते हैं। वे inputs किसी simulation में कैसे मैप होते हैं, इसके लिए [simulation parameters](/simulator-ui/parameters) देखें।
