Skip to content

Miruvor-LLC/Medici-Contract-Wrapper

Repository files navigation

Medici Contract SDK

A TypeScript SDK for interacting with the Medici Token ecosystem, enabling seamless token transfers with integrated fee mechanisms for educational platforms.

Overview

The Medici Contract SDK provides a simple interface for interacting with two main smart contracts:

  • CustomToken: An ERC20 token contract for the Medici Token (MDC)
  • TokenTransferWithFee: A contract that handles token transfers with a 5% platform fee

Features

  • ERC20 token management (Medici Token - MDC)
  • Fee-based transfer system (95% to recipient, 5% to platform)
  • TypeScript wrappers for easy integration
  • Built on ethers.js for reliable Ethereum interactions
  • Hardhat-based development and deployment framework

Installation

npm install medici-contract-sdk

Usage

Approving Token Transfers

import { approveMediciToken } from 'medici-contract-sdk';

await approveMediciToken(
  provider,
  tokenAddress,
  spenderAddress,
  amount
);

Sending Tokens with Fee

import { sendWithFee } from 'medici-contract-sdk';

await sendWithFee(
  provider,
  transferContractAddress,
  studentAddress,
  amount
);

Smart Contracts

CustomToken (MDC)

  • Standard ERC20 implementation
  • Mintable by owner
  • Name: Medici Token
  • Symbol: MDC
  • Decimals: 18

TokenTransferWithFee

  • Handles token transfers with automatic fee distribution
  • 5% platform fee on all transfers
  • 95% goes to the recipient
  • Emits detailed transfer events

Development

# Install dependencies
npm install

# Compile contracts
npx hardhat compile

# Run tests
npx hardhat test

# Deploy contracts
npx hardhat run scripts/deploy.ts

Project Structure

├── contracts/              # Smart contract source files
├── src/                    # TypeScript SDK source
│   ├── abi/               # Contract ABIs
│   └── wrappers/          # TypeScript contract wrappers
├── scripts/               # Deployment and utility scripts
└── ignition/              # Hardhat Ignition deployment modules

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

Medici Contract SDK: A TypeScript SDK for ERC20 token management with fee-based transfers, designed for educational platforms using the Medici Token (MDC)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors