# Precompile Testing
### Ensure you can find the precompile implementation and it solidity interface contract are implemented.
Here is a table with the currently available precompiles and theirr interfaces:
| Pallet Name | Precompile Address | Solidity Interface | Precompile |
| -------- | -------- | -------- | -------- |
| currencies | 0x0000000000000000000000000000000000000000 |[here](https://github.com/chexware/Bit-Country-Blockchain/blob/feature/nft-pallet-precompile/pallets/currencies/CurrencyInterface.sol) | [here](https://github.com/bit-country/Metaverse-Network/blob/master/runtime/common/src/currencies.rs) |
| metaverse | 0x0101010101010101010000000000000000000000 | [here](https://github.com/chexware/Bit-Country-Blockchain/blob/feature/metaverse-pallet-precompile/pallets/metaverse/MetaverseInterface.sol) | [here](https://github.com/chexware/Bit-Country-Blockchain/blob/feature/metaverse-pallet-precompile/runtime/common/src/metaverse.rs)|
| nft | 0x0202020202020202020000000000000000000000 | [here](https://github.com/chexware/Bit-Country-Blockchain/blob/feature/nft-pallet-precompile/pallets/nft/NFTInterface.sol) | [here](https://github.com/chexware/Bit-Country-Blockchain/blob/feature/nft-pallet-precompile/runtime/common/src/nft.rs)|
#### !!! If you plan to test on a public testnet please make sure that the precompile is also included in its latest runtime.
### Run a local instance of the blockchain (if testing locally)
Inside a terminal instance on your machine enter `make run-dev` and wait until you see that the blockchain instance is running
### Log in to a funded metamask addresss
1. Ensure that your MetaMask extension is updated to it's latest version.
2. Inside MetaMask, open **Networks** tab and select **Add Network**.
2. Click **Add a network manually**.
3. Enter the following details and click **Save**.
* **For a local network** !
* **For our public test network**
4. Ensure that your address have enough tokens to perform transations. If not, transfer tokens from a funded account that you have access to.
### Open Remix IDE and compile the .sol interface that you created.
1. Go to https://remix.ethereum.org/ and select the **Solidity** featured plugin and create a blank workspace called **Precomile Tests**. Delete all deafult folders and files.
2. Create a solidity file named in the format **[name_of_pallet_you_want_to_test].sol** and paste the solidity interface contract code.
3. From the **Solidity Compiler** tab compile the interface that you've created and ensure there are no compilation errors. 
### Deploy the compiled interface on your local chain
1. Open the **Deploy & Run Transactions** tab in **Remix IDE**.
2. Select **Injected Provider - MetaMask** as deployment environment.
4. Select your funded account and the solidity contract that you've just
5. Enter the precompile address at the **At Address** field an click on it. 
#### !!! Ensure that you reset your funded MetaMask account every time you run a new local blockchain instance.

### Test if the interface calls work as expected
Ensure that all precompile functions are working as expected. You may need to pre-populate relevant information in the blockchain using Polkadot.js (e.g. create a metaverse and NFT when testing the auction precompile)