# Summary

{% hint style="warning" %}
Note: This is a draft. Everything in this document is expected to be expanded, changed, modified, substituted or removed until the official launch date which hasn't been set yet. No provision in this document should be interpreted as an agreement between you, us or any of our partners.
{% endhint %}

Collats is a new decentralized platform that provides NFTs the ability to hold Collateral value.&#x20;

So far, crypto assets' prices are a function of market conditions and buzz. With Collats, NFTs can have a new standardized way to add and compare real intrinsic value.

The Collats token is the medium by which we are able to have a constant value pegged to the US Dollar thanks to the one-to-one reserves of pre-approved Stable Coins.

NFTs that are backed by Collats can be hypothecated, lent or insured and their Collats value can be redeemed anytime one-to-one by USD pegged Stable Coins.&#x20;

Collats is govern by the Collats DAO which purpose is to allocate decentralized ownership of the algorithms and its profits. It is owned and managed by the Collats DAO Governance Token holders and by the Collats DAO Liquidity holders.&#x20;

Collats is available on Ethereum, Polygon and Binance Smart Chain. More to come soon!

## Motivation

The idea behind Collats is for crypto assets to have an intrinsic value that is independent from the market value. People looking to hold crypto assets can now expect some recoverable value regardless of the fluctuations of the market or the price changes of the underlying coins. So the market value of the asset can go up or down, the value of coins can go up or down but the collateral value will remain the same.&#x20;

## How we do it?

The process of adding Collats to an NFT is very simple.&#x20;

1. Go to [www.collats.com](http://www.collats.com)
2. Connect your Wallet
3. Search for the NFT or choose from yours.
4. Click the Add Collats button.
5. Choose the amount you want to buy.
6. Choose the coin to use.

That's it. That NFT now has collateral value!

## Benefits&#x20;

* Instant liquidity while preserving ownership. &#x20;
* Can convert Collats into other Stable Coins immediately.&#x20;
* Creates intrinsic value.
* Solves the pyramid scheme problem.
* Adds credibility for NFT projects.
* Enhances Marketability
* Transparency when evaluating crypto assets.
* The underlying NFT can be used as collateral itself for any crypto lending project.
* Can help to distinguish from pirated assets.
* Collats can be used to purchase anything on the blockchain.

## To learn more visit any of the following sections

* [How To](/how-to/connect-to-metamask)
* [Tokenomics](/tokenomics/collats-dao-governance-token)
* [Collats DAO](/collats-dao/purpose)
* [Technical](/technical/networks)
* [Smart Contracts](/smart-contract-modules/collats-token)
* [Resources](/resources/branding)
* Or visit us in [Discord](https://discord.gg/hbM5bkyBaa), [Twitter](https://twitter.com/CollatsToken), Github or the official [website](https://collats.com).&#x20;

## Disclaimers&#x20;

#### No Investment Advice

The information provided on this website does not constitute investment advice, financial advice, trading advice, or any other sort of advice and you should not treat any of the website's content as such. Collats does not recommend that any cryptocurrency should be bought, sold, or held by you. Do conduct your own due diligence and consult your financial advisor before making any investment decisions.

#### Transfer Restrictions

The information provided on this website does not constitute an offer or sale of securities in or into the United States, or to or for the account or benefit of U.S. persons, or in any other jurisdictions where it is unlawful to do so. The transfer of Collats tokens may be subject to legal restrictions under applicable laws. Under no circumstances shall Collats tokens be reoffered, resold or transferred within the United States or to, or for the account or benefit of, U.S. persons, except pursuant to an exemption from, or in a transaction not subject to, the registration requirements of the U.S. Securities Act of 1933, as amended.

#### Accuracy of Information

Collats will strive to ensure accuracy of information listed on this website although it will not hold any responsibility for any missing or wrong information. Collats provides all information *as is*. You understand that you are using any and all information available here at your own risk.

#### Non Endorsement

The appearance of third party advertisements and hyperlinks on Collats does not constitute an endorsement, guarantee, warranty, or recommendation by Collats. Do conduct your own due diligence before deciding to use any third party services.


# Connect To Metamask

### You can visit the official site

{% embed url="<https://metamask.io>" %}

### or check the following video

{% embed url="<https://youtu.be/iDtbBTvkGxU>" %}


# Connect To BSC

### You can visit the official site

{% embed url="<https://academy.binance.com/en/articles/connecting-metamask-to-binance-smart-chain>" %}

### or check the following video

{% embed url="<https://www.youtube.com/watch?t=328s&v=iDtbBTvkGxU>" %}


# Connect To Polygon

### You can visit the official site

{% embed url="<https://docs.polygon.technology/docs/develop/metamask/config-polygon-on-metamask#polygon-scan>" %}

### or check the following video

{% embed url="<https://youtu.be/RXIsf2coCZk>" %}


# Buy Collats

Collacts are available to purchase in Ethereum, Polygon and Binance Smart Chain. Make sure that you buy them in the network where your NFTs are located.&#x20;

1. Go to [www.collats.com](https://docs.collats.com/how-to/www.collats.com)
2. [Connect your Wallet](/how-to/connect-to-metamask)
3. Click the Buy Collats button
4. Choose the amount of Collats to buy or enter the amount of tokens to use to buy.
5. Confirm the transaction.
6. Approve the transaction.

### or check the following video

{% embed url="<https://www.youtube.com/watch?v=PP9uSwSJCjM>" %}
How to buy and redeem Collats
{% endembed %}

That's it now you have Collats in your wallet. If you can not see the token in your wallet, follow these steps to add the Collats token to your network

1. Go to your wallet
2. Select your network
3. Go to the Asset section
4. Click on Import Token
5. Paste the Collats token address 0xEB7C8695c4E127b4237D1B7168124d3db72C1FB9


# Add Collats To NFT

{% embed url="<https://youtu.be/izfS76rcg8c>" %}
How to add value to your NFT
{% endembed %}

When you connect your Metamask to [collats.com](https://docs.collats.com/how-to/www.collats.com) we are able to automatically pull all your NFTs for the specific account. You can also use the search functionality to find any NFT that you like. After selecting the desired NFT follow these steps to add Collats.

1. [Buy Collats](/how-to/buy-collats)
2. Click on the Add Collats button
3. Select the amount to add to the NFT
4. Click confirm

That is it! Now your NFT has collateral value. Spread the word!!!


# Withdraw Collats From NFT

{% embed url="<https://youtu.be/izfS76rcg8c>" %}
How to add and withdraw Collats from an NFT
{% endembed %}

When you connect your Metamask to [collats.com](https://docs.collats.com/how-to/www.collats.com) we are able to automatically pull all your NFTs for the specific account. You can also use the search functionality to find any NFT that you like. After selecting the desired NFT follow these steps to withdraw Collats.

1. Click on the Withdraw Collats button
2. Select the amount to withdraw from the NFT
3. Click confirm

That is it! Now you should have that amount of Collats in your account.


# Redeem Collats For Stable Coins

To redeem Collats, connect your wallet to [collats.com](https://docs.collats.com/how-to/www.collats.com) and choose the desired network.

1. Click on Redeem Collats.
2. Enter the amount to redeem.
3. Choose the token that you want to receive.
4. Click Redeem.
5. Confirm the transaction on your Wallet.

### or check the following video

{% embed url="<https://www.youtube.com/watch?v=PP9uSwSJCjM>" %}
How to buy and redeem Collats
{% endembed %}


# Invest

TBA


# Vote

TBA


# Earn Governance Tokens

There are few ways to earn Collats DAO Governance Tokens.

#### Transferring

#### Contributing

#### Staking

#### Auction

#### Airdrop

The details of each will be determined by the Collats DAO Governance Token holders as priority once lauched. A sample proposal can be seen in the [CDGT tokenomics](/tokenomics/collats-dao-governance-token) section.


# Collats DAO Governance Token

Collats DAO Governance Token (CDGT) allow holders to have the ultimate saying in the governance of the Collats DAO and its finances. CDGT holders don't have a direct claim to the assets of the Collats DAO but are the ones that can vote for actions that should be beneficial to all the members of the Collats DAO.&#x20;

### Name

Collats DAO Governance Token

### Symbol

CDGT

### Decimals

18

### Total Supply

1,000

### Network

Binance Smart Chain

### Contract Address

0xC44ACB99ca783437ce7FC6029F63e9214d95828D

### Vesting

Immediate

### **Distribution**&#x20;

<table><thead><tr><th width="247.22258893300705">Category</th><th width="150">Supply</th><th>Available at Launch</th></tr></thead><tbody><tr><td>ODs</td><td>300</td><td>100%</td></tr><tr><td>Stakers</td><td>100</td><td>0%</td></tr><tr><td>Monthly Collaborators</td><td>15</td><td>0%</td></tr><tr><td>Monthly Auction</td><td>5</td><td>0%</td></tr><tr><td>Monthly AirDrop</td><td>5</td><td>0%</td></tr></tbody></table>

## Minting

### ODs

300 CDGT distributed between the Original Development team.

### Staking

100 CDGT available for the Staking program

### Collaborators

There will be 15 monthly tokens minted for 24 months. They will be granted to specific members of the community which amongst many other things have proved to hold the best interest for the DAO.&#x20;

### Auction

TBA

### Airdrop

TBA

## Burning

Burns could be forced or be voluntary.

CDGT Holders can voluntarily submit their tokens to be removed from the total supply.

CDGT Holders taking actions that are detrimental to the Collats DAO or its members could see their CDGTs reclaimed and their Staking Funds confiscated.&#x20;

CDGT Holders that don't vote for 5 consecutive times will lose 1 CDGT.


# Collats DAO Liquidity Token

The Collats DAO Liquidity Token holders have a direct claim to the assets under management (AUM) of the DAO.

The value of issuance will be (AUM / CDLT Total Supply) or a predefined ratio of the current market value. Whatever is higher.

### Name

Collats DAO Liquidity Token

### Symbol

CDLT

### Decimals

18

### Total Supply

500,000,000,000

### Network

Binance Smart Chain

### Contract Address

0x4ee4A9020e5D447B26631D56BB0380E5f81F4C7F

### **Distribution and Vesting**

<table><thead><tr><th>Category</th><th>Supply</th><th width="171">Available at Launch</th><th>Vesting</th><th>Cliff</th></tr></thead><tbody><tr><td>ODs</td><td>250,000,000,000</td><td>10%</td><td>365 days linear</td><td>3 months</td></tr><tr><td>Treasury </td><td>50,000,000,000</td><td>100%</td><td>N/A</td><td>N/A</td></tr><tr><td>Private Offering</td><td>50,000,000,000</td><td>0%</td><td>365 days linear</td><td>None</td></tr><tr><td>Launch Partners</td><td>25,000,000,000</td><td>0%</td><td>365 days linear</td><td>3 months</td></tr><tr><td>AirDrop</td><td>25,000,000,000</td><td>0%</td><td>365 days linear</td><td>None</td></tr><tr><td>IDO</td><td>100,000,000,000</td><td>100%</td><td>N/A</td><td>N/A</td></tr></tbody></table>


# Collats Token

Collats are mainly used to provide a standard collateral value to crypto assets.&#x20;

Collats are backed by Stable Coins or other assets that can guarantee a one to one exchange rate with the US Dollar.&#x20;

Collats are immune to the swings or fluctuations of the Crypto Currency's market and are minted when a user deposits the same amount of an accepted back up asset. They are locked in vault and have no immediate exposure to the market's movements. In other words we don not speculate with any percentage of the backup assets tied to the Collats' total supply.

Collats follow the ERC20 standard and can be traded peer to peer, exchanged on any DEX or any approved Centralized Exchange where it is listed.

* There will be no gambling with the backup assets.
* Collats are issued independently in each chain.
* Each chain independently manage its own vault.&#x20;
* Anyone can mint coins at anytime and any amount.
* A 0.9% fee is charged to mint coins.
* The underlying asset is defined by the smart contract.
* The redeeming asset is defined by the smart contract.

### Minting

The process of minting begins when the smart contracts receives the native network coin. That coin will purchase as much of the underlying asset as possible. The equivalent amount of the underlying asset will be minted. The fee will be transferred to the owner of the contract and the remaining amount will be transferred to the current user.

### Redeeming

The user will transfer the amount of Collats to be exchanged. The equivalent amount of underlying assets will be used to be transferred to the current user. The amount of Collats will be burned.

### Underlying Asset

The smart contract manages the relationship between backup assets and total supply. The backup assets can be added or removed to maintain the stability of the one-to-one relationship. The user can choose between the underlying assets approved or the preferred Current Asset to either mint or redeem Collats.

### Name

Collats

### Symbol

Collats

### Decimals

18

### Total Supply

Paired to the backup assets

### Vesting

Immediate

### Blockchains

<table><thead><tr><th width="242">Network</th><th width="598.4285714285713">Contract Address</th></tr></thead><tbody><tr><td>Ethereum</td><td>0xEB7C8695c4E127b4237D1B7168124d3db72C1FB9</td></tr><tr><td>Polygon</td><td>0xEB7C8695c4E127b4237D1B7168124d3db72C1FB9</td></tr><tr><td>Binance Smart Chain</td><td>0xEB7C8695c4E127b4237D1B7168124d3db72C1FB9</td></tr></tbody></table>


# Purpose

The purpose of the Collats DAO is to allocate decentralized ownership of the algorithms and its profits. It is owned and managed by the Collats DAO Governance Token holders and by the Collats DAO Liquidity holders .&#x20;

Decisions are governed by proposals and voting to ensure everyone in the organization has a voice.

There are no CEO, CFO, officers nor owners. Everything is out in the open and the rules around spending are baked into the DAO via its code.

Voting is required by members for any changes to be implemented.

Votes tallied, and outcome implemented automatically without trusted intermediary.

Services offered are handled automatically in a decentralized manner.

All activity is transparent and fully public.

Profits are redistributed amongst the Collats DAO Liquidity Token holders.

Smart contract code can’t be modified once live, even by its owners. This allows the DAO to run by the rules it was programmed with.


# Members

The idea behind the CDGT is that the most committed and productive members can become the final DAO governors.

Community members should contribute to the ongoing operations and success.


# Voting

There are different levels of voting and each have different consequences.

## Community Voting

This is where most of the new ideas will be considered. These types of votes do not tend to have an immediate economic or catastrophic impact. They could be initiated by specific members of our Discord community. The results can become part of action items for other initiatives.&#x20;

### Who can vote?

Any member of our Discord server.

### Where to vote?

Each poll is hosted in the Poll section of the server.

### Results

The voting can be seen realtime and the final tally will be posted immediately in the proper channel.

### Consequences

Administrators and/or Pollmaster can decide the next level of consideration.

## Technical Voting

Improvements, additions, enhancements or any technical consideration regarding any aspect of the project can be channeled through these types of votes.&#x20;

### Who can vote?

Any member of our Discord server with the Tech Role.

### Where to vote?

Each poll is hosted in the Technical Poll section of the server.

### Results

The voting can be seen realtime and the final tally will be posted immediately in the proper channel.

### Consequences

Administrators and/or Governors can decide the next level of consideration.

## Investors Voting

These types of votes could be related to any type of topics but mostly directed to anything that could have a financial impact on the organization.

### Who can vote?

Any account that holds Collats DAO Liquidity Tokens (CDLT). One account equals one vote.

### Where to vote?

Each poll is hosted in the Poll section of the server.

### Results

The voting can be seen realtime and the final tally will be posted immediately in the proper channel.

### Consequences

Administrators and/or Governors can decide the next level of consideration.

## Governors Voting

Structural and strategic voting that could have permanent and/or destructive consequences. This decisions encompass technical and/or financial considerations and are not subject to approval of any other governing power. Any account that holds Collats DAO Governance Tokens (CDGT) can initiate the voting process. Technical knowledge is expected from voters since decisions could be tied to a myriad of smart contracts.&#x20;

### Who can vote?

Any account that holds Collats DAO Governance Tokens (CDGT). One token equals one vote.

### Where can vote?

In our DAO's site.

### Results

The decision needs 51% of votes and quorum to pass within 3 days of initialization.

### Consequences

The contracts associated with the vote should be executed as directed.


# Finance

The backbone of a DAO is its smart contract. The contract defines the rules of the organization and holds the group's treasury. Once the contract is live, no one can change the rules except by a vote. If anyone tries to do something that's not covered by the rules and logic in the code, it will fail. And because the treasury is defined by the smart contract too that means no one can spend the money without the group's approval either.

## Income

#### Collats Minting

The main source of income comes from the issuance of Collats token. There is an adjustable fee of  0.9% for minting the Collats token.

#### AUM Reinvestment&#x20;

TBD

#### NFT Vault

For the foreseeable future is not considered but a withdraw fee could be added to each transaction.

#### Loan

Variable interest rate depending on loan term.&#x20;

#### Auction

TBA

#### Insurance

TBA

#### Liquidations

TBA

#### Marketplace

0.3% transaction fee

## Expenses

#### Fixed

Backend Infrastructure&#x20;

#### Variable

Collaborators


# Funding

The money raised through investment will be used to enhance our offerings and capabilities, supercharge product development and increase our marketing efforts. It should fuel growth and network effect.

* **Private Offering**
* **Direct Investment**&#x20;
* **IDO**

Details will be released soon. Follow us on our [Discord](https://discord.gg/hbM5bkyBaa) server or on [Twitter](https://twitter.com/CollatsToken) for more details.


# Networks

## Ethereum&#x20;

## Polygon

## Binance Smart Chain


# Roadmap

* [x] **Blockchain Development**
* [x] **Front End Development**&#x20;
* [x] **Testing**
* [x] **Blockchains Deployment**
* [ ] **Awareness**
* [ ] **Official Launch**
* [ ] **IDO**
* [ ] **Hiring**
* [ ] **New Product Release**
* [ ] **Repeat...**


# Contributors

Join our [Discord](https://discord.gg/hbM5bkyBaa) to get started.


# Collats Token

#### Ethereum Mainnet

0xEB7C8695c4E127b4237D1B7168124d3db72C1FB9

#### Polygon Mainnet

0xEB7C8695c4E127b4237D1B7168124d3db72C1FB9

#### Binance Smart Chain Mainnet

0xEB7C8695c4E127b4237D1B7168124d3db72C1FB9


# Collats NFT Vault

## Details

The vault is the contract that manages the amount of Collats backing an ERC721 asset. It keeps track of the amount of Collats that an NFT has assigned.

#### Ethereum Mainnet

0x157CD665f569E916A38d9607D7fB28D3083c203b

#### Polygon Mainnet

0x157CD665f569E916A38d9607D7fB28D3083c203b

#### Binance Smart Chain Mainnet

0x157CD665f569E916A38d9607D7fB28D3083c203b

### Interface

```solidity
// SPDX-License-Identifier: MIT
pragma solidity 0.8.14;

interface ICollatsNFTVault {
    function buyAndAddCollats(address nftAddress, uint256 tokenId)
        external
        payable
        returns (uint256 collatsBought);

    function buyAndAddCollatsWithERC20(
        address nftAddress,
        uint256 tokenId,
        address token,
        uint256 amount
    ) external returns (uint256 collatsBought);

    function addCollats(
        address nftAddress,
        uint256 tokenId,
        uint256 amount
    ) external;

    function addCollatsInBulk(
        address[] memory nftAddresses,
        uint256[] memory tokenIds,
        uint256[] memory amounts
    ) external;

    function withdrawCollats(
        address to,
        address nftAddress,
        uint256 tokenId,
        uint256 amount
    ) external returns (bool);

    function balanceOf(address nftAddress, uint256 tokenId)
        external
        view
        returns (uint256);
}

```

The `ICollatsNFTVault` interface defines a contract that allows users to buy and add "collats" to a specific non-fungible token (NFT) identified by its address and token ID. It also allows users to add collats to an NFT in bulk, withdraw collats from an NFT, and check the balance of collats for a specific NFT.

The `buyAndAddCollats` function allows users to buy and add collats to an NFT by paying with Ether. The `buyAndAddCollatsWithERC20` function allows users to buy and add collats to an NFT by paying with a specific ERC20 token. The `addCollats` function allows users to add a specific amount of collats to an NFT. The `addCollatsInBulk` function allows users to add collats to multiple NFTs in a single transaction. The `withdrawCollats` function allows users to withdraw a specific amount of collats from an NFT and send them to a specified address. The `balanceOf` function allows users to check the balance of collats for a specific NFT.

#### Contract to contract example

Here is sample code in Solidity 8 that demonstrates how to call the functions of the `ICollatsNFTVault` interface from another contract:

```solidity
pragma solidity 0.8.14;

//The import will depend on the location of your file system 
import "./ICollatsNFTVault.sol";

// Replace "CollatsNFTVault" with the actual contract address of the deployed ICollatsNFTVault contract
contract MyContract {
    ICollatsNFTVault private collatsNFTVault = ICollatsNFTVault("CollatsNFTVault");

    function buyAndAddCollats(address nftAddress, uint256 tokenId) external payable {
        uint256 collatsBought = collatsNFTVault.buyAndAddCollats(nftAddress, tokenId).value;
        // Do something with the returned value "collatsBought"
    }

    function buyAndAddCollatsWithERC20(
        address nftAddress,
        uint256 tokenId,
        address token,
        uint256 amount
    ) external {
        uint256 collatsBought = collatsNFTVault.buyAndAddCollatsWithERC20(nftAddress, tokenId, token, amount);
        // Do something with the returned value "collatsBought"
    }

    function addCollats(
        address nftAddress,
        uint256 tokenId,
        uint256 amount
    ) external {
        collatsNFTVault.addCollats(nftAddress, tokenId, amount);
        // No return value to use
    }

    function addCollatsInBulk(
        address[] memory nftAddresses,
        uint256[] memory tokenIds,
        uint256[] memory amounts
    ) external {
        collatsNFTVault.addCollatsInBulk(nftAddresses, tokenIds, amounts);
        // No return value to use
    }

    function withdrawCollats(
        address to,
        address nftAddress,
        uint256 tokenId,
        uint256 amount
    ) external returns (bool) {
        bool success = collatsNFTVault.withdrawCollats(to, nftAddress, tokenId, amount);
        if (success) {
            // Withdrawal successful
        } else {
            // Withdrawal failed
        }
    }

    function balanceOf(address nftAddress, uint256 tokenId) external view returns (uint256) {
        uint256 balance = collatsNFTVault.balanceOf(nftAddress, tokenId);
        // Do something with the returned value "balance"
    }
}

```

In this example, the contract `MyContract` calls the functions of the `ICollatsNFTVault` contract by calling the corresponding functions on an instance of the `ICollatsNFTVault` contract, which is stored in the `collatsNFTVault` variable. The contract address of the deployed `ICollatsNFTVault` contract needs to be provided when the `collatsNFTVault` variable is initialized.

The return values of the `buyAndAddCollats` and `buyAndAddCollatsWithERC20` functions are stored in the variables `collatsBought`, which can then be used for further processing. The `withdrawCollats` function returns a boolean value indicating whether the withdrawal was successful or not, which can be checked in an `if` statement. The `balanceOf` function returns the balance of the specified NFT for the given token ID, which can be stored in the `balance` variable and used for further processing.

Note that the `buyAndAddCollats` function is marked `payable`, which means that it can accept Ether as a payment. Make sure to provide enough Ether when calling the function, or the transaction will fail.

### ICollatsNFTVault ABI

```json
[
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "nftAddress",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "tokenId",
          "type": "uint256"
        },
        {
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "addCollats",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address[]",
          "name": "nftAddresses",
          "type": "address[]"
        },
        {
          "internalType": "uint256[]",
          "name": "tokenIds",
          "type": "uint256[]"
        },
        {
          "internalType": "uint256[]",
          "name": "amounts",
          "type": "uint256[]"
        }
      ],
      "name": "addCollatsInBulk",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "nftAddress",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "tokenId",
          "type": "uint256"
        }
      ],
      "name": "balanceOf",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "nftAddress",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "tokenId",
          "type": "uint256"
        }
      ],
      "name": "buyAndAddCollats",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "collatsBought",
          "type": "uint256"
        }
      ],
      "stateMutability": "payable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "nftAddress",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "tokenId",
          "type": "uint256"
        },
        {
          "internalType": "address",
          "name": "token",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "buyAndAddCollatsWithERC20",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "collatsBought",
          "type": "uint256"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "to",
          "type": "address"
        },
        {
          "internalType": "address",
          "name": "nftAddress",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "tokenId",
          "type": "uint256"
        },
        {
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "withdrawCollats",
      "outputs": [
        {
          "internalType": "bool",
          "name": "",
          "type": "bool"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
    }
  ]
```

### JavaScript

#### Web3.js

Here is an example of how you can call the functions of the `CollatsNFTVault` contract from JavaScript using Web3:

```javascript
const Web3 = require('web3');
const collatsNFTVaultAbi = require('collatsNFTVaultAbi.json'); // Replace with the actual ABI of the ICollatsNFTVault contract
const tokenAbi = require('./ERC20Abi.json');

// Replace "http://localhost:7545" with the actual RPC endpoint of your Ethereum network
const web3 = new Web3('http://localhost:7545');

// Replace "CollatsNFTVault" with the actual contract address of the deployed CollatsNFTVault contract
const collatsNFTVaultAddress = "CollatsNFTVault";
const collatsNFTVault = new web3.eth.Contract(collatsNFTVaultAbi, collatsNFTVaultAddress);

// Replace "MyToken" with the actual contract address of the ERC20 token contract
const tokenAddress = "MyToken";
const token = new web3.eth.Contract(tokenAbi, tokenAddress);

async function buyAndAddCollats(nftAddress, tokenId, value) {
  const collatsBought = await collatsNFTVault.methods.buyAndAddCollats(nftAddress, tokenId).send({ value: value });
  console.log(collatsBought);
}

async function requestApprovalAndBuyCollatsWithERC20(nftAddress, tokenId, token, amount) {
  // Check the current allowance for the ERC20 tokens
  const allowance = await token.methods.allowance(web3.eth.defaultAccount, collatsNFTVaultAddress).call();
  if (allowance < amount) {
    // Request approval for the desired amount of tokens
    await token.methods.approve(collatsNFTVaultAddress, amount).send({ from: web3.eth.defaultAccount });
  }

  // Call the buyAndAddCollatsWithERC20 function
  const collatsBought = await collatsNFTVault.methods.buyAndAddCollatsWithERC20(nftAddress, tokenId, token, amount).send({ from: web3.eth.defaultAccount });
  console.log(collatsBought);
}

async function addCollats(nftAddress, tokenId, amount) {
  await collatsNFTVault.methods.addCollats(nftAddress, tokenId, amount).send({ from: web3.eth.defaultAccount });
}

async function addCollatsInBulk(nftAddresses, tokenIds, amounts) {
  await collatsNFTVault.methods.addCollatsInBulk(nftAddresses, tokenIds, amounts).send({ from: web3.eth.defaultAccount });
}

async function withdrawCollats(to, nftAddress, tokenId, amount) {
  const success = await collatsNFTVault.methods.withdrawCollats(to, nftAddress, tokenId, amount).send({ from: web3.eth.defaultAccount });
  if (success) {
    console.log('Withdrawal successful');
  } else {
    console.log('Withdrawal failed');
  }
}

async function balanceOf(nftAddress, tokenId) {
  const balance = await collatsNFTVault.methods.balanceOf(nftAddress, tokenId).call();
  console.log(balance);
}


```

In this example, the functions of the `CollatsNFTVault` contract are called using the `send` method of the `Contract` object, which sends a transaction to the Ethereum network. The `buyAndAddCollats` function is marked `payable`, which means that it can accept Ether as a payment.&#x20;

The `addCollats`, `addCollatsInBulk`, and `withdrawCollats` functions do not have any return values, so the returned value of the `send` method can be used to check the status of the transaction (e.g. whether it was mined successfully or not). The `balanceOf` function is a view function, which means that it does not modify the state of the contract and does not need to be called with the `send` method. Instead, it can be called with the `call` method, which returns the value of the function without sending a transaction.

You can call these functions in your code by passing the required parameters. For example:

```javascript
buyAndAddCollats('0x123456...', 1, '100000000000000000');
requestApprovalAndBuyCollatsWithERC20('0x123456...', 1, '0x987654...', '1000000000000000000');
addCollats('0x123456...', 1, '1000000000000000000');
addCollatsInBulk(['0x123456...', '0x654321...'], [1, 2], ['1000000000000000000', '50000000000000000000']);
withdrawCollats('0x123456...', '0x654321...', 1, '50000000000000000000');
balanceOf('0x123456...', 1);

```

#### Ethers.js

Here is an example of how you can call the functions of the `CollatsNFTVault` contract from JavaScript using Ethers.js:

<pre class="language-javascript"><code class="lang-javascript"><strong>const { Contract, ethers } = require('ethers');
</strong>const collatsNFTVaultAbi = require('collatsNFTVaultAbi.json'); // Replace with the actual ABI of the ICollatsNFTVault contract
const tokenAbi = require('./ERC20Abi.json');

// Replace "http://localhost:7545" with the actual RPC endpoint of your Ethereum network
const provider = new ethers.providers.JsonRpcProvider('http://localhost:7545');

// Replace "CollatsNFTVault" with the actual contract address of the deployed ICollatsNFTVault contract
const collatsNFTVaultAddress = "CollatsNFTVault";
const collatsNFTVault = new Contract(collatsNFTVaultAddress, collatsNFTVaultAbi, provider);

// Replace "MyToken" with the actual contract address of the ERC20 token contract
const tokenAddress = "MyToken";
const token = new Contract(tokenAddress, tokenAbi, provider);

async function buyAndAddCollats(nftAddress, tokenId, value) {
  const collatsBought = await collatsNFTVault.buyAndAddCollats(nftAddress, tokenId, { value: value });
  console.log(`Bought ${collatsBought} collats for NFT ${nftAddress} with token ID ${tokenId}`);
}

async function requestApprovalAndBuyCollatsWithERC20(nftAddress, tokenId, token, amount) {
  // Check the current allowance for the ERC20 tokens
  const allowance = await token.allowance(provider.getSigner().getAddress(), collatsNFTVaultAddress);
  if (allowance.lt(amount)) {
    // Request approval for the desired amount of tokens
    await token.approve(collatsNFTVaultAddress, amount).send();
  }

  // Call the buyAndAddCollatsWithERC20 function
  const collatsBought = await collatsNFTVault.buyAndAddCollatsWithERC20(nftAddress, tokenId, token, amount);
  console.log(`Bought ${collatsBought} collats for NFT ${nftAddress} with token ID ${tokenId} using an ERC20`);

}

async function addCollats(nftAddress, tokenId, amount) {
  await collatsNFTVault.addCollats(nftAddress, tokenId, amount);
  console.log(`Added ${amount} collats to NFT ${nftAddress} with token ID ${tokenId}`);
}

async function addCollatsInBulk(nftAddresses, tokenIds, amounts) {
  await collatsNFTVault.addCollatsInBulk(nftAddresses, tokenIds, amounts);
  console.log(`Added collats to NFTs ${nftAddresses} with token IDs ${tokenIds}`);
}

async function withdrawCollats(to, nftAddress, tokenId, amount) {
  const success = await collatsNFTVault.withdrawCollats(to, nftAddress, tokenId, amount);
  if (success) {
    console.log(`Withdrew ${amount} collats from NFT ${nftAddress} with token ID ${tokenId} and sent them to ${to}`);
  } else {
    console.log(`Failed to withdraw collats from NFT ${nftAddress} with token ID ${tokenId}`);
  }
}

async function balanceOf(nftAddress, tokenId) {
  const balance = await collatsNFTVault.balanceOf(nftAddress, tokenId);
  console.log(`Balance of collats for NFT ${nftAddress} with token ID ${tokenId}: ${balance}`);
}


</code></pre>

You can call these functions in your code by passing the required parameters. For example:

```javascript
buyAndAddCollats('0x123456...', 1, '100000000000000000');
requestApprovalAndBuyCollatsWithERC20('0x123456...', 1, '0x987654...', '100000000000000000');
addCollats('0x123456...', 1, '100000000000000000');
addCollatsInBulk(['0x123456...', '0x654321...'], [1, 2], ['100000000000000000', '5000000000000000000']);
withdrawCollats('0x123456...', '0x654321...', 1, '5000000000000000000');
balanceOf('0x123456...', 1);

```

This script calls all the functions of the `CollatsNFTVault` contract and logs the results to the console. It calls the `buyAndAddCollats` function, the `buyAndAddCollatsWithERC20` function, the `addCollats` function, the `addCollatsInBulk` function, the `withdrawCollats` function, and the `balanceOf` function.

Keep in mind that this script is just an example, and you may need to modify it to fit your specific needs. You will also need to handle errors and handle the case where the `JsonRpcProvider` is not available.


# Collats NFT Loan

#### Ethereum Mainnet

tba

#### Polygon Mainnet

tba

#### Binance Smart Chain Mainnet

tba


# Collats NFT Auction

#### Ethereum Mainnet

tba

#### Polygon Mainnet

tba

#### Binance Smart Chain Mainnet

tba


# Collats NFT Insurance

#### Ethereum Mainnet

tba

#### Polygon Mainnet

tba

#### Binance Smart Chain Mainnet

tba


# Collats NFT Liquidation

#### Ethereum Mainnet

tba

#### Polygon Mainnet

tba

#### Binance Smart Chain Mainnet

tba


# Collats NFT Marketplace

#### Ethereum Mainnet

tba

#### Polygon Mainnet

tba

#### Binance Smart Chain Mainnet

tba


# Collats DAO

#### Binance Smart Chain Mainnet

tba


# Branding

TBA


# Partnerships

TBA


# Online Presence

* [Twitter](https://twitter.com/CollatsToken)
* [Discord](https://discord.gg/hbM5bkyBaa)
* [Website](https://collats.com)
* [Dao](< https://www.xdao.app/56/dao/0xC44ACB99ca783437ce7FC6029F63e9214d95828D>)


