# ABI

* <https://coinsbench.com/solidity-tutorial-all-about-abi-46da8b517e7>
* <https://blog.ricmoo.com/human-readable-contract-abis-in-ethers-js-141902f4d917>

{% embed url="<https://github.com/EridianAlpha/ethereum-direct-deploy-contract>" %}

### ABI with ethers.js

* <https://docs.ethers.io/v4/api-contract.html>

```solidity
// Contract ABI copied directly from Remix
let abi = [
    {
        inputs: [],
        name: "consecutiveWins",
        outputs: [
            {
                internalType: "uint256",
                name: "",
                type: "uint256",
            },
        ],
        stateMutability: "view",
        type: "function",
    },
]

let coinFlipContractAddress = "0xa0714D4539ADcfD7855B811382c49D7185D32977"

// Connect to the Contract
let coinFlipContract = new ethers.Contract(
    coinFlipContractAddress,
    abi,
    rinkebyHttpProvider
)

// Check current consecutiveWins value
let consecutiveWins = await coinFlipContract.consecutiveWins()
```


---

# 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.eridian.xyz/ethereum-dev/solidity-notes/abi.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.
