---
# System prepended metadata

title: Untitled

---

### Smart Contracts and Metadata
This project includes the following smart contracts and their metadata:
- [x] Smart Contracts
    - [x] Redistribution
    - [x] Staking Registry
    - [x] Price Oracle
    - [x] Postage Stamps
    - [x] Test Token

- [x] Metadata (Deployed Contracts)
    - [x] Chain ID  
        - Chain ID of the blockchain.
    - [x] Network ID
        - Network ID.
    - [x] ABI
        - Interface to communicate with smart contracts.
    - [x] Bytecode
        - Compiled object code that is executed during communication with smart contract.
    - [x] Address
        - Address of the deployed contract on blockchcain.
    - [x] Block
        - Block height in which the transaction is mined.
    - [x] URL
        - URL for analyzing the transaction.

### Scripts
- [x] Script for deploying all contracts
- [ ] Script for deploying individual contracts
- [ ] Script for interacting with smart contracts
- [ ] Script to deploy contracts and bee node with updated addresses
- [x] Script assigning roles/permissions for smart contracts
    - [x] Redistributor roles

### Tests
- [x] Unit Tests
    - Coverage
        - Run `npx hardhat coverage` to see the coverage of smart contracts.
- [ ] Integration Tests

## Project Setup
To get started with this project, follow these steps:

1. Clone the repo.
2. Run `yarn install` at the root of the repo to install all dependencies.
3. Add a `.env` file in your root directory, where you'll store your sensitive information for deployement. An example file `.env.example` is provided for reference.
4. Run `npx hardhat compile` to get all the contracts compiled.
5. Run `npx hardhat test` to run all the tests.
6. Run `npx hardhat coverage` to know the testing coverage.
7. Run `npx hardhat deploy` to deploy all contracts on `hardhat env`.
8. To deploy contracts on testnet or mainnet: 
    - Add your wallet `Mnemonic` in `.env` file. 
    - Add your `Infura` token in `.env` file. 
        - Sign Up on [Infura](https://infura.io/).
        - Create a `Web3 API` key and give your project a name.
        - Copy the key from API key section and replace `<token>`  with the copied key in your `.env` file.
    - To deploy all contracts and set roles:
        - Mainnet:
            - `npx hardhat run scripts/deployer.ts --network mainnet` 
        - Testnet:
            - `npx hardhat run scripts/deployer.ts --network testnet`  
9. Run `npx hardhat run scripts/<script-name>.js --network <network-name>` to run any of the scripts on specific network.
    - To deploy all contracts on Ganache:
        - Run `ganache-cli` for cli version or execute [GUI version of Ganache](https://trufflesuite.com/ganache/).
        - Add network configurations in your hardhat config.
            - `  ganache: {
      url: '127.0.0.1:8545',
      chainId: 1337,
    },`
