Comments (5)
Are you sure your approvals are correct?
IERC20Modified(currentCoin).approve(address(this), _amountTIndexes[i]);
IERC20Modified(currentCoin).transferFrom(msg.sender, address(this), _amountTIndexes[i]);
the caller should be allowing your contract to spend the tokens. here on the first line your contract is approving itself.
then your contract needs to approve the pool's contract for spending each of the token you'll deposit before it can deposit there.
from curve-contract.
My guess is that you need
IERC20Modified(currentCoin).approve(curveFiPool, _amountTIndexes[i]);
from curve-contract.
@benber86 Yes, I tested the Deposit of ERC-20 Tokens from the Wallet to my Operator S.C. (That Uses address(this)
) in an Isolated way and it worked:
/// @param _amountTIndexes: List of Amounts of Different Coins to Deposit. Ex: [2 DAI, 4 USDC, 3 USDT].
function depositLiquidityInOperator(address curveFiPool, uint256[3] memory _amountTIndexes) external {
for (uint256 i = 0; i < 3; i++) {
if (_amountTIndexes[i] > 0) {
address currentCoin = ICurveFiPool(curveFiPool).coins(i);
IERC20Modified(currentCoin).approve(address(this), _amountTIndexes[i]);
IERC20Modified(currentCoin).transferFrom(msg.sender, address(this), _amountTIndexes[i]);
}
}
}
from curve-contract.
My guess is that you need
IERC20Modified(currentCoin).approve(curveFiPool, _amountTIndexes[i]);
Thanks, I will try that...
from curve-contract.
My guess is that you need
IERC20Modified(currentCoin).approve(curveFiPool, _amountTIndexes[i]);
IT WORKED YOU ARE A DAMN GENIUS I HAVE BEEN STRUGGLING WITH THAT SH*T FOR DAYS THANK YOU VERY MUCH!!! A STRONG HUG!!!
from curve-contract.
Related Issues (20)
- brownie_hooks.py documentation
- The variable "Ann" should be changed HOT 1
- Typo on annotation
- Unable to Deploy LiquidityGaugeV3 To Development Nework HOT 1
- 0x51086d5d93bEfD1D7747f8e902e2A855e7b33Ca1 HOT 1
- 0xbdfa4f4492dd7b7cf211209c4791af8d52bf5c50 HOT 1
- 0xbdfa4f4492dd7b7cf211209c4791af8d52bf5c50
- 0xbdfa4f4492dd7b7cf211209c4791af8d52bf5c50
- 0xbdfa4f4492dd7b7cf211209c4791af8d52bf5c50
- 0x57b583b32b249da49d9e91f7f4f300113187e762
- Connect v9
- Unable Withdraw/Claim
- Twap contract not deployed?
- Curve events are an utter mess HOT 1
- Unstaking and withdraw
- Test files not unique in brownie v1.14.5
- Some doubts on StableSwapIB (Curve IronBank Pool) HOT 1
- Factory tricropto implementation contract needs verification in etherescan
- Update to latest Brownie and other packages 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 curve-contract.