New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@mayflower-fi/solidity-interfaces

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mayflower-fi/solidity-interfaces

Solidity interfaces for May Prog EVM protocol - for use in smart contract development

latest
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

@mayflower-fi/solidity-interfaces

Pure Solidity interfaces for integrating with the May Prog EVM protocol. This package contains only the .sol interface files for use in Solidity smart contract development.

Note: For deployment, testing with bytecode, or TypeScript development, use @mayflower-fi/evm-bytecode instead.

Installation

npm install @mayflower-fi/solidity-interfaces

or with yarn:

yarn add @mayflower-fi/solidity-interfaces

Usage

Import the interfaces in your Solidity contracts:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "@mayflower-fi/solidity-interfaces/contracts/ITenant.sol";
import "@mayflower-fi/solidity-interfaces/contracts/IMarket.sol";
import "@mayflower-fi/solidity-interfaces/contracts/IMarketGroup.sol";

contract YourContract {
    ITenant public tenant;
    
    constructor(address tenantAddress) {
        tenant = ITenant(tenantAddress);
    }
    
    function createMarketGroup(
        address admin,
        uint256 buyFeeRate,
        uint256 sellFeeRate,
        uint256 borrowFeeRate,
        uint256 exerciseOptionsFeeRate
    ) external returns (address) {
        return tenant.createMarketGroup(
            admin,
            buyFeeRate,
            sellFeeRate,
            borrowFeeRate,
            exerciseOptionsFeeRate
        );
    }
}

Available Interfaces

Core Protocol Interfaces

  • ITenantFactory - Factory for creating tenant contracts
  • ITenant - Main tenant contract managing market groups and platform fees
  • IMarketGroup - Groups of markets with shared fee structures
  • IMarket - Individual bonding curve markets with trading functionality

Key Functions

ITenant

  • createMarketGroup() - Create a new market group
  • platformFeeRate() - Get platform fee rate
  • collectPlatformFees() - Collect accumulated platform fees

IMarketGroup

  • createMarket() - Deploy a new market with bonding curve
  • setFeeRates() - Update fee rates for the group
  • collectFeesFromMarket() - Collect fees from specific market

IMarket

  • buyWithExactBaseIn() - Buy tokens with exact input amount
  • sellWithExactTokenIn() - Sell tokens for base currency
  • buyCallOptions() - Purchase call options
  • exerciseCallOptions() - Exercise call options
  • depositCollateral() - Deposit tokens as collateral
  • borrow() - Borrow against collateral
  • repay() - Repay borrowed amount

Events

All interfaces include comprehensive events for monitoring on-chain activity:

event TokensBought(address indexed buyer, uint256 baseIn, uint256 tokensOut);
event TokensSold(address indexed seller, uint256 tokensIn, uint256 baseOut);
event CallOptionsBought(address indexed buyer, uint256 baseIn, uint256 optionsOut);
event CallOptionsExercised(address indexed holder, uint256 optionsIn, uint256 tokensOut);

Integration Example

Reading Market Data

IMarket market = IMarket(marketAddress);

// Get current price at supply
uint256 currentSupply = market.derivativeSupply();
uint256 price = market.getPriceAtSupply(currentSupply);

// Check available liquidity
uint256 liquidity = market.availableLiquidity();

// Get user position
(uint256 collateral, uint256 debt) = market.getPosition(userAddress);

Executing Trades

// Buy tokens
uint256 tokensOut = market.buyWithExactBaseIn(
    1000 * 10**18,  // 1000 base tokens in
    900 * 10**18,   // min tokens out (slippage protection)
    msg.sender      // recipient
);

// Sell tokens
uint256 baseOut = market.sellWithExactTokenIn(
    500 * 10**18,   // 500 tokens to sell
    450 * 10**18,   // min base out
    msg.sender      // recipient
);

Version Compatibility

  • Solidity: ^0.8.24
  • OpenZeppelin Contracts: ^5.0.0

License

MIT

Support

For questions and support, please contact Mayflower Finance.

Keywords

ethereum

FAQs

Package last updated on 14 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts