Git Product home page Git Product logo

Comments (15)

MetaNynja avatar MetaNynja commented on June 5, 2024 3

In the test error folders there is the following :

			.emit(Flashloan, "SwapFinished")
			.emit(Flashloan, "SentProfit");
		const balance = await USDT.balanceOf(owner.address);
		expect(balance.gt(getBigNumber(0, 6))).to.be.true;
	});

Sent Profit

Do you know why this isn't included in the live script?

from poly-flashloan-bot.

yuichiroaoki avatar yuichiroaoki commented on June 5, 2024 1

I got this error too and have no idea what's going on there.

Yes, I agree. It's probably because of the contract.

from poly-flashloan-bot.

yuichiroaoki avatar yuichiroaoki commented on June 5, 2024 1

That token info is used only at src/debug.ts to debug transactions, so it doesn't fix the error itself.

from poly-flashloan-bot.

gsngsn123 avatar gsngsn123 commented on June 5, 2024

Fail with error 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'
how can i resolve this error

from poly-flashloan-bot.

yuichiroaoki avatar yuichiroaoki commented on June 5, 2024

Possible reason

I just happened to know that 1inch api returns the burn address instead of wmatic address.

1inch web UI
image

1inch api response
image

That's why the bot passes the burn address instead of wmatic address and the transaction ends up failing without any error messages.

from poly-flashloan-bot.

bpevreall avatar bpevreall commented on June 5, 2024

I noticed the burn address is also on line 1 & 21 of src/constraints, is this of any relevance?
looks out of place to me but im by no means experienced

from poly-flashloan-bot.

yuichiroaoki avatar yuichiroaoki commented on June 5, 2024

True. I didn't write that part.

Replacing the burn address to wmatic one seems to solve the issue.

from poly-flashloan-bot.

MetaNynja avatar MetaNynja commented on June 5, 2024

The burn address also appears in the contract.

Is this the correct address? : 0x0000000000000000000000000000000000001010

And do you mean replacing the burn address with the Matic address? Looks like WMatic is fine.

Great job spotting that btw.

from poly-flashloan-bot.

MetaNynja avatar MetaNynja commented on June 5, 2024

I updated the Matic address from the burn address to 0x0000000000000000000000000000000000001010 on both the contract and the bot but still hasn't been successful :

https://polygonscan.com/address/0x10A1504aE79e7A1f2e80A299f3E94565673A5165

from poly-flashloan-bot.

bpevreall avatar bpevreall commented on June 5, 2024

If I'm not mistaken you need WMATIC Address rather than MATIC.
https://polygonscan.com/token/0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270

im getting INSUFFICIENT_OUTPUT_AMOUNT on every tx after making the amendments, have increased slippage to 5% but still the same after rebuild

from poly-flashloan-bot.

MetaNynja avatar MetaNynja commented on June 5, 2024

I'm confused about it being WMatic still. Where I find the burn address is where Matic is stated.

Line 4: exports.polyMatic = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";

Line 8: MATIC: {
Line 12 :address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",

from poly-flashloan-bot.

MetaNynja avatar MetaNynja commented on June 5, 2024

No sorry, I just mean that I don’t think you meant to say WMatic above, the burn address is listed beside Matic, not WMatic. Did you mean to say we just need to change the burn address to the Matic address?

from poly-flashloan-bot.

MetaNynja avatar MetaNynja commented on June 5, 2024

Self destruct CHI

Any idea why there is a call to selfdestruct to 1inch Network: CHI Token

I don't see an address for CHI anywhere in the code. Since CHI is a gas token for 1inch, do we need to indicate this anywhere?

from poly-flashloan-bot.

yuichiroaoki avatar yuichiroaoki commented on June 5, 2024

I have no idea about the selfdestruct to 1inch.

I reproduced the "Fail" error here.
yuichiroaoki/poly-flash#16

Does it make sense?

it("should be reverted without any error messages when the path includes the burn address.", async () => {
	await impersonateFundErc20(USDC, DAI_WHALE, Flashloan.address, "100.0", 6);
	await expect(
		Flashloan.dodoFlashLoan({
			flashLoanPool: dodoV2Pool.WETH_USDC,
			loanAmount: getBigNumber(1, 6),
			firstRoutes: [{
				path: [erc20Address.USDC, BurnAddress, erc20Address.WETH],
				router: uniswapRouter.quickswap,
			}],
			secondRoutes: [{
				path: [erc20Address.WETH, erc20Address.USDC],
				router: uniswapRouter.quickswap,
			}]
		}, { gasLimit: 1000000 })
	).to.be.revertedWith("");
});

from poly-flashloan-bot.

yuichiroaoki avatar yuichiroaoki commented on June 5, 2024

Good point!
That would be awesome. I will do that.
Probably that could be done with ethers.js.

from poly-flashloan-bot.

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.