Beefy
  • Overview
  • Get Started
    • How to set up a wallet
    • Funding your wallet
    • Connecting your wallet to Beefy
  • Beefy Ecosystem
    • Introduction to Beefy
    • Beefy Protocol
      • Revenue Bridge
      • Fee Batch
      • Incentive Programmes
    • $BIFI Token
      • Token Bridge
    • Beefy Bulletins
      • What is Beefy?
      • The Big Beefy Opportunity
      • What Makes Beefy Different?
      • How Does Beefy Work?
      • Beefy Fees Breakdown
      • Why Beefy Beats Your Bank
      • Introducing Beefy's Unique Revenue Share Model
      • Beefy's Coveted Advantages Revealed
  • Beefy Products
    • Vaults
    • Strategies
    • CLM
    • Boost
    • Beefy-escrowed Tokens
      • beS
      • beQI
      • Deprecated Products
        • beFTM
        • binSPIRIT
        • beJOE
        • beVELO
        • beOPX
    • Advanced Vaults
      • GMX and GLP
  • Beefy DAO
    • Team & Goals
    • Contributor Compensation
    • Governance
    • Proposal Repository
    • Treasury
    • Cowmoonity
    • Partnerships
  • Safety
    • SAFU Standards
    • Contracts & Timelocks
    • Bug Bounty Program
    • Beefy Safety Score
    • Token Allowance
    • Beefy Backup
    • Insurance
  • FAQ
    • General
    • Infographics
    • mooVaults APY
    • How-To Guides
      • How to deposit in a Vault
      • How to Add a Custom Token to Metamask
      • How to Add and Remove Liquidity
      • How to use Beefy ZAP
      • How to add and switch networks on Beefy
      • How to check the harvesting and compounding rate of a vault
  • Developer Documentation
    • Vault Contract
    • Strategy Contract
      • StratFeeManager Contract
      • GasFeeThrottler Contract
    • Other Beefy Contracts
      • FeeConfigurator Contract
      • BeefyWrapper Contract
      • GaugeStaker Contract
    • Third Party Contracts
      • DelegateRegistry Contract
      • Oracle Contracts
    • Beefy API
  • Additional Resources
    • Contract Addresses
    • Code Repositories
    • Blog
    • Discord
    • Github
    • Media Kit
    • Telegram
    • Twitter
Powered by GitBook
On this page
  • Dependencies
  • Modifiers
  • View Functions
  • getFees()
  • getAllFees()
  • getStratFeeId()
  • Write Functions
  • setStratFeeId()
  • setWithdrawalFee()
  • setVault()
  • setUnirouter()
  • setKeeper()
  • setStrategist()
  • setBeefyFeeRecipient()
  • setBeefyFeeConfig()

Was this helpful?

  1. Developer Documentation
  2. Strategy Contract

StratFeeManager Contract

Last Update: February 2023

Last updated 1 year ago

Was this helpful?

The is collection of important dependencies which are imported and used in every Beefy Strategy Contract.

Originally, these dependencies were split into two contracts - and . After the move to Solidity V0.8, the two were combined into a single contract - . The current verison - - facilitated a move to proxy clone strategies (which must be initialized with the relevant arguments for the strategy and its dependencies), to avoid the need to deploy every single strategy individually.

Dependencies

The StratFeeManager contracts also introduce addition dependencies themselves, specifically - which introduces functionality to set a contract's owner and restrict functionality to them alone - and - which introduces functionality to freeze functionality in a contract by putting the contract on pause. Both dependencies are ultimately included in every Beefy Strategy Contract.

Modifiers

Introduces an onlyManager() modifier to constrain functions to use by the strategy manager only.

modifier onlyManager() {
    require(msg.sender == owner() || msg.sender == keeper, "!manager");
    _;
}

View Functions

getFees()

Returns the value of all fees from the fee configuration contract.

function getFees() internal view returns (IFeeConfig.FeeCategory memory) {
    return beefyFeeConfig.getFees(address(this));
}

getAllFees()

Returns the value of all fees from the fee configuration contract, as well the dynamic deposit and withdrawal fees.

function getAllFees() external view returns (IFeeConfig.AllFees memory) {
    return IFeeConfig.AllFees(getFees(), depositFee(), withdrawFee());
}

getStratFeeId()

Returns the integer value of the strategy fee ID from the fee configuration contract.

function getStratFeeId() external view returns (uint256) {
    return beefyFeeConfig.stratFeeId(address(this));
}

Write Functions

setStratFeeId()

Sets a new integer value for the strategy's fee ID, which indicates the relevant fee for the strategy.

function setStratFeeId(uint256 _feeId) external onlyManager {
    beefyFeeConfig.setStratFeeId(_feeId);
    emit SetStratFeeId(_feeId);
}

setWithdrawalFee()

Sets a new integer value for the contract's withdrawal fee which is charged on each harvest.

function setWithdrawalFee(uint256 _fee) public onlyManager {
    require(_fee <= WITHDRAWAL_FEE_CAP, "!cap");
    withdrawalFee = _fee;
    emit SetWithdrawalFee(_fee);
}

setVault()

Sets a new address for the contract's vault, which manages user funds.

function setVault(address _vault) external onlyOwner {
    vault = _vault;
    emit SetVault(_vault);
}

setUnirouter()

Sets a new address for the contract's router which processes swaps within the contract.

function setUnirouter(address _unirouter) external onlyOwner {
    unirouter = _unirouter;
    emit SetUnirouter(_unirouter);
}

setKeeper()

Sets a new address for the contract's keeper, who can "panic" the strategy.

function setKeeper(address _keeper) external onlyManager {
    keeper = _keeper;
    emit SetKeeper(_keeper);
}

setStrategist()

Sets a new address for the contract's strategist who receives the strategist fee.

function setStrategist(address _strategist) external {
    require(msg.sender == strategist, "!strategist");
    strategist = _strategist;
    emit SetStrategist(_strategist);
}

setBeefyFeeRecipient()

Sets a new address for the recipient of Beefy's fee on harvests, typically a Beefy treasury contract.

function setBeefyFeeRecipient(address _beefyFeeRecipient) external onlyOwner {
    beefyFeeRecipient = _beefyFeeRecipient;
    emit SetBeefyFeeRecipient(_beefyFeeRecipient);
}

setBeefyFeeConfig()

Sets a new address for the fee configuration contract used by the strategy to fetch fees.

function setBeefyFeeConfig(address _beefyFeeConfig) external onlyOwner {
    beefyFeeConfig = IFeeConfig(_beefyFeeConfig);
    emit SetBeefyFeeConfig(_beefyFeeConfig);
}

StratFeeManager Contract
StratManager.sol
FeeManager.sol
StratFeeManager.sol
StratFeeManagerInitializable.sol
Ownable.sol
Pausable.sol