Incentives with a custom strategy

With mangrove you can write your own contracts in order to create offers and bring liquidity programmatically. In order to track ownership for the length of the incentive program, use the API from MangrovePoints.sol.

MangrovePoints

MangrovePoints is a smart contract designed to keep track of the custom maker contract links with their owners. This contract allows for the management of operators for accounts, providing a flexible and secure way to handle permissions.

MangrovePoints is deployed on Arbitrum at 0x26e9e34839b5f150B66eA30cd8B503FFa1B4BFd4.

How to Use

To use the MangrovePoints contract in your custom maker contract, follow these steps:

  1. Include the IMangrovePoints interface in your contract:

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

/**
 * @title IMangrovePoints
 * @notice Interface for the MangrovePoints contract
 */
interface IMangrovePoints {
  /**
   * @notice Emitted when an operator is set for an account
   * @param account The account for which the operator is set
   * @param operator The address of the operator
   */
  event OperatorSet(address indexed account, address indexed operator);

  /**
   * @notice Sets the operator for an account
   * @param account The account for which to set the operator
   * @param operator The address to set as the operator
   */
  function setOperator(address account, address operator) external;

  /**
   * @notice Returns the operator for a given account
   * @param account The account to check
   * @return The address of the operator for the given account
   */
  function operators(address account) external view returns (address);
}
import {IMangrovePoints} from "./IMangrovePoints.sol";
  1. Call the setOperator method directly from your contract:

IMangrovePoints mangrovePoints = IMangrovePoints(MANGROVE_POINTS_ADDRESS);
mangrovePoints.setOperator(address(this), OPERATOR_ADDRESS);

Replace MANGROVE_POINTS_ADDRESS with the deployed address of the MangrovePoints contract, and OPERATOR_ADDRESS with the address you want to set as the operator for your contract.

Mangrove's Role

While the primary method for setting operators is through the custom maker contracts themselves, Mangrove also has the ability to add operators in cases where the contract may have missed calling this function. However, this is subject to certain conditions:

  • There must be a proof linking the custom maker contract to the admin, deployer, or other authorized entity.

  • It will be at Mangrove's discretion to accept or refuse any requests for operator assignment.

This feature ensures that legitimate contracts are not left without operators due to oversight or technical issues, while maintaining the integrity of the system.

Last updated