Maple Protocol Adapter
Overview
Implementation Details
Contract: MapleAdapter.sol
MapleAdapter.solcontract MapleAdapter is YieldinatorAdapter {
using SafeERC20 for IERC20;
// Maple contracts
address public mplToken; // Maple governance token
address public xMPL; // Staked MPL token
IMapleStaking public mapleStaking; // MPL staking contract
// Pool configuration
struct PoolConfig {
address pool; // Maple pool address
address poolToken; // Pool token (LP token)
bool stakeMPL; // Whether to stake MPL rewards
bool active; // Whether the pool is active
}
// Mapping from token to pool configuration
mapping(address => PoolConfig) public tokenToPool;
// Deposited amounts per token
mapping(address => uint256) public depositedAmount;
// Constructor
constructor(
address _admin,
address _mplToken,
address _xMPL,
address _mapleStaking
) YieldinatorAdapter("Maple Finance", _admin) {
require(_mplToken != address(0), "MapleAdapter: MPL token cannot be zero address");
require(_xMPL != address(0), "MapleAdapter: xMPL token cannot be zero address");
require(_mapleStaking != address(0), "MapleAdapter: staking contract cannot be zero address");
mplToken = _mplToken;
xMPL = _xMPL;
mapleStaking = IMapleStaking(_mapleStaking);
}
}