# Blockchain Smart-Contract

Stage Meta TPAs smart-contract public methods documentation:

{% hint style="success" %}
you can get our latest smart-contract details from [`Latest contract API`](https://dev.stagemeta.world/reference/api-reference/latest-contract-api).
{% endhint %}

## Plaque price method:

The `plaquePrice()` is a `public` method that allows users to get the current TPA price.

{% content-ref url="blockchain-smart-contract/plaque-price-method" %}
[plaque-price-method](https://dev.stagemeta.world/reference/blockchain-smart-contract/plaque-price-method)
{% endcontent-ref %}

## Check mintTransfer method:

The `checkMintTransfer()` is a `public` method that allows users to check whether the given TPA names are available for purchase or have already been minted. It takes two input parameters: `_names`, an array of `bytes32` representing the TPA names to be checked, and `_amounts`, an array of `uint32` representing the amount of TPAs to be checked.

{% content-ref url="blockchain-smart-contract/check-minttranfer-method" %}
[check-minttranfer-method](https://dev.stagemeta.world/reference/blockchain-smart-contract/check-minttranfer-method)
{% endcontent-ref %}

## MintTransfer method:

The `mintTransfer()` is a `payable` method that allows users to buy newly minted TPAs. To use this method, you need to send `plaquePrice * _names.length` amount of `value` in Wei to this transaction as TPAs price.

{% content-ref url="blockchain-smart-contract/minttransfer-method" %}
[minttransfer-method](https://dev.stagemeta.world/reference/blockchain-smart-contract/minttransfer-method)
{% endcontent-ref %}

## Token owners method:

The `tokenOwners()` is a `public` method that takes a plaque ID `_plaqueId` as input and returns an array of addresses of token owners who own the plaque with the given ID.

{% content-ref url="blockchain-smart-contract/token-owners-method" %}
[token-owners-method](https://dev.stagemeta.world/reference/blockchain-smart-contract/token-owners-method)
{% endcontent-ref %}

{% hint style="info" %}
If you're using `typescript` code examples in methods page, before every example use this code here to prepare your provider to web3, ethereum wallet, smart-contract instance and abi.
{% endhint %}

<pre class="language-typescript"><code class="lang-typescript"><strong>import axios from "axios";
</strong>import { ethers, providers, utils } from "ethers";

const provider = new providers.WebSocketProvider(
    "wss://eth-sepolia.g.alchemy.com/v2/ATnZ4...." // provider
);

const signer = new ethers.Wallet(
  "aab5433a31f1bb3e...", // your ethereum wallet private key
  provider
);

const res = await axios.get(
  "https://cdn.stagemeta.dev/contracts/2.0.0.json" // StageMeta smart-contract contract abi
);
const abi = JSON.stringify(res.data);
const inter = new utils.Interface(abi);

const stageMetaContract = new ethers.Contract(
  "0x4b39ceb401769e3e...", // StageMeta smart-contract address
  abi,
  signer
);
</code></pre>
