Comments (4)
@pinyeda you don't need to use interfaces. instead of:
vault = interface.VaultAPI("0xdA816459F1AB5631232FE5e97a05BBBb94970c95")
token = interface.IERC20("0x6b175474e89094c44da98b954eedeac495271d0f")
just do:
vault = Contract("0xdA816459F1AB5631232FE5e97a05BBBb94970c95")
token = Contract("0x6b175474e89094c44da98b954eedeac495271d0f")
if you setup etherescan correctly in brownie, brownie will download the interface from etherscan.
re-open if you need further help.
from brownie-strategy-mix.
Hmm, getting the same result even without using interfaces. addStrategy
doesn't exist on vault
.
I've set up my etherscan token, infura key, pulled down a fresh template repo. Are you able to recreate this?
from brownie-strategy-mix.
Ah, I ended up getting addStrategy to show when using project.load
. (was etherscan returning the wrong interface??)
Then i got an error about the argument length. The readme must be incorrect here-
>>> from pathlib import Path
>>> yearnvaults = project.load(Path.home() / ".brownie" / "packages" / config["dependencies"][0])
>>> v = yearnvaults.Vault.at("0xdA816459F1AB5631232FE5e97a05BBBb94970c95")
>>> strategy = Strategy.deploy(v, {"from": accounts[0]})
>>> v.addStrategy(strategy, Wei("1000 ether"), 2 ** 256 - 1, 50, {"from": gov})
File "<console>", line 1, in <module>
File "brownie/network/contract.py", line 1692, in __call__
return self.transact(*args)
File "brownie/network/contract.py", line 1575, in transact
data=self.encode_input(*args),
File "brownie/network/contract.py", line 1610, in encode_input
data = format_input(self.abi, args)
File "brownie/convert/normalize.py", line 20, in format_input
raise type(e)(f"{abi['name']} {e}") from None
ValueError: addStrategy Sequence has incorrect length, expected 5 but got 4
Adding the missing debtRatio
argument to addStrategy works.
>>> tx = v.addStrategy(strategy, 5, Wei("1000 ether"), 2 ** 256 - 1, 50, {"from": gov})
Transaction sent: 0xed96ac1f215078f34464add3c23bce650880fca71050beee84291afd9092fe4b
Gas price: 0.0 gwei Gas limit: 12000000 Nonce: 1
from brownie-strategy-mix.
The above transaction fails actually, I'm not sure why. Is there a way to make the stack trace readable?
>>> tx.info()
Transaction was Mined (reverted)
---------------------
Tx Hash: 0xb85062290f6983ccd35fcee9a04363555484dace913a1af096ab22865fbbf5b9
From: 0xFEB4acf3df3cDEA7399794D0869ef76A6EfAff52
To: 0xdA816459F1AB5631232FE5e97a05BBBb94970c95
Value: 0
Function: Vault.addStrategy
Block: 13615435
Gas Used: 33369 / 12000000 (0.3%)
>>> tx.call_trace()
Call trace for '0xb85062290f6983ccd35fcee9a04363555484dace913a1af096ab22865fbbf5b9':
Initial call cost [22424 gas]
Vault.addStrategy 0:635 [92 / 10945 gas]
└── Vyper_contract.addStrategy [DELEGATECALL] 12:625 [7104 / 10853 gas]
├── Strategy.vault [STATICCALL] 350:451 [1889 gas]
└── Strategy.want [STATICCALL] 480:578 [1860 gas]
EDIT: tx.traceback is what i'm looking for:
>>> tx.traceback()
Traceback for '0xb85062290f6983ccd35fcee9a04363555484dace913a1af096ab22865fbbf5b9':
Trace step 624, program counter 9453:
File "Vyper_contract.vy", line 1192, in Vyper_contract.addStrategy:
assert self.debtRatio + debtRatio <= MAX_BPS
from brownie-strategy-mix.
Related Issues (20)
- Explore importing Integration Test suite using Strategy test suite in Vaults HOT 3
- Bump vaults version to use 0.3.2 HOT 1
- Add as part of test suite a check for handling airdrops of want token on strategy HOT 4
- Test should use strategy.estimatedTotalAssets() instead of token.balanceOf(new_strategy.address) HOT 4
- Upgrade to Vaults 0.3.3
- Add support for solidity 0.8 to sync with vaults PR HOT 4
- Add ethToWant to Strategy.sol
- Make sure _assessFees isn't called twice within the same block
- add liquidateAllPositions
- tests: initialize should take management parameter.
- add matching tags for releases based of yearn vaults repo HOT 1
- fix failing CI in Master HOT 1
- Import deploy script from Yearn-Vaults HOT 8
- Add integration with Tenderly to improve debugging HOT 2
- Not working with ganache v7.0.0-alpha.1 HOT 1
- Readme incorrect for addStrategy arguments HOT 2
- README Instructions Contain Typo
- Accessing Vault via local ABI does not work HOT 9
- README.md instructions for ganache are incorrect. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brownie-strategy-mix.