Code Monkey home page Code Monkey logo

Comments (2)

pinyeda avatar pinyeda commented on August 22, 2024

When i do add some arguments, I'm getting errors that i'm not sure how to debug.
Please add working examples :)

In my case, the stack trace is weird- not sure why this failure would occur. I'm passing a performance fee of 10:

>>> tx = v.addStrategy(strategy, 0, Wei("1000 ether"), 2 ** 256 - 1, 10, {"from": gov})
Transaction sent: 0xf0659fa10bc327144a5a71a52166ca387aefd2d714f455e31e141886c8e91560
  Gas price: 0.0 gwei   Gas limit: 12000000   Nonce: 7
  Vault.addStrategy confirmed (reverted)   Block: 13615439   Gas used: 11812895 (98.44%)

>>> tx.traceback()
Traceback for '0xf0659fa10bc327144a5a71a52166ca387aefd2d714f455e31e141886c8e91560':
Trace step 655, program counter 9513:
  File "Vyper_contract.vy", line 1198, in Vyper_contract.addStrategy:
    performanceFee: performanceFee,

from brownie-strategy-mix.

pandadefi avatar pandadefi commented on August 22, 2024

This is the addStrategy signature:

addStrategy(
    strategy: address,
    debtRatio: uint256,
    minDebtPerHarvest: uint256,
    maxDebtPerHarvest: uint256,
    performanceFee: uint256,
    profitLimitRatio: uint256 = 100, # 1%
    lossLimitRatio: uint256 = 1 # 0.01%
)

You are adding the strategy with a debtRatio set to zero that won't break but will not allocate funds to the strategy.
I suggest something like:

 vault.addStrategy(strategy, 1000, 0, 2 ** 256 - 1, 1_000, {"from": gov})

from brownie-strategy-mix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.