1inch / 1inchprotocol Goto Github PK
View Code? Open in Web Editor NEW1inch Protocol – fully on-chain DeFi aggregation protocol
License: MIT License
1inch Protocol – fully on-chain DeFi aggregation protocol
License: MIT License
Redirect to 1inch.eth's latest CID, like Uniswap does.
I have this error when I try to swap ETH (0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) to CHAI (0x06AF07097C9Eeb7fD685c692751D5C66dB49c215)
I have some contracts almost ready for deployment to mainnet, but want to run some tests on a public test network.
Is 1split deployed to ropsten or another test network?
Does anyone have the BSC OneSplitAudit contract address?
A fully onchain DEX aggrator will allow DeFi building blocks for cotrader.com and others.
Prices should be competitive with other DEX aggregator options..
Users can get prices and execute a split trade that gets the max tokens possible at the lowest prices available by using a combination of dexs, especially AMM Swap DEXs including Kyber, Bancor, Uniswap, Oasis.
Add Metamask wallet support to wallet list.
Link: https://metamask.io/
Up to 1k$ worth in CHI Token
BUIDL a dApp (writing smart contracts is required) which allows DeFi users to set limit orders with take profit and stop loss by using the 1inch liquidity protocol Mooniswap: https://mooniswap.exchange/#/swap.
The system should use directional spot price of our liquidity protocol Mooniswap. The price can't be manipulated in a positive direction because of our special architecture. See our white paper and Research paper by @snjax
We require a working demo and a solid MVP.
The best/most creative submission will declared the winner. If you are unsure about whether your hack project suits the bounty topic please present your idea to us via our discord channel.
Open-Source your project at the end of the hackathon a requirement.
Creativity and Usefulness.
We will also do a code review to ensure code quality to make the final decision.
Dec 10 — Workshop
Dec 24 — Submission Deadline
From Dec 25 — Judging
Jan 2 — Winners Announcement
Jan 3 — Payouts
For help: Feel free to contact us on Discord or leave a comment below.
Good success and have fun, BUIDLers!
This issue is part of Gitcoin Grants R8 Hackathon:
Look at other bounties:
Github 1inch list of bounties
Gitcoin gr8 1inch bounties
Chat with us:
discord channel
Telegram group
Uniswap (both v1 and v2) allows developers to calculate how many input tokens should be sent for a certain amount of output tokens.
It would be helpful to include a similar feature here, especially if you intend to integrate Uni V2 once it's launched.
Could the team explain why this was deprecated?
How do I become a miner?
I am trying to test 1inch swap function from the contract deployed via Remix on a Ganache fork of the Ethereum Mainnet. When calling this function I always get the "Gas estimation failed" error and "VM Exception while processing transaction: revert" error in Remix. My contract has enough sold off token (USDC) and Ether.
The contract:
contract TradeBot {
// OneSplit Config
address ONE_SPLIT_ADDRESS = 0xC586BeF4a0992C495Cf22e1aeEE4E446CECDee0E;
uint256 PARTS = uint256(10);
uint256 FLAGS = uint256(0);
function oneSplitSwap(address _from, address _to, uint256 _amount, uint256 _minReturn,
uint256[] memory _distribution) public payable {
_oneSplitSwap(_from, _to, _amount, _minReturn, _distribution);
}
function _oneSplitSwap(address _from, address _to, uint256 _amount, uint256 _minReturn,
uint256[] memory _distribution) internal {
// Setup contracts
IERC20 _fromIERC20 = IERC20(_from);
IERC20 _toIERC20 = IERC20(_to);
IOneSplit _oneSplitContract = IOneSplit(ONE_SPLIT_ADDRESS);
// Approve tokens
_fromIERC20.approve(ONE_SPLIT_ADDRESS, _amount);
// Swap tokens: give _from, get _to
_oneSplitContract.swap(_fromIERC20, _toIERC20, _amount, _minReturn, _distribution,
FLAGS);
// Reset approval
_fromIERC20.approve(ONE_SPLIT_ADDRESS, 0);
}
I test the function with the following parameters:
fromToken: 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 // USDC
toToken: 0x6B175474E89094C44Da98b954EedeAC495271d0F // DAI
amount: 100000000
minReturn: 10
distribution: [0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0]
Can't figure out why this does not work. All parameters seem to be correct and the contract has enough USDC. Am I using the correct 1split contract address or you have a new implementation? Any ideas how to fix this?
Any arbitrary contract, even not supporting CHI, could use less fees by burning storage in other contract.
Hello,
I am trying to use the Swap function from OneSplit Contract -
0xC586BeF4a0992C495Cf22e1aeEE4E446CECDee0E
I was able to successfully perform the swap from DAI to TUSD and from TUSD back to DAI. Both have 18 decimal places.
However, the same does not work for DAI to USDT, or DAI to USDC. (USDT, USDC has got 6 decimal places and I have accounted for 6 decimal places in the code in JS file).
I have tested on testnet using ganache (live fork) and truffle. I get the follow error in this setup.
VM Exception while processing transaction: revert
I tried this on the mainnet too. On the mainnet, I get the following error.
Fail with error 'SafeERC20: low-level call failed'
What am I doing wrong? Hope get this this solved.
Regards,
Harish
This error occurred when I tried to exchange USDT for ETH。
Error message:
{
"statusCode": 500,
"message": "Not enough allowance. Amount: 100000000. Allowance: 0. Spender: 0x11111112542d85b3ef69ae05771c2dccff4faa26",
"error": "Internal Server Error"
}
Up to 500 Dai.
Create a way to automatically donate part of a swap transaction to a charity.
Solid Demo and Working MVP.
Creativity and Usefulness
Jan 2.
Hi guys, I follow the readme guide, but stuck with this error when calling getExpectedReturnWithGas
, for destTokenEthPriceTimesGasPrice
arg, it always return error with something like
Error: overflow (fault="overflow", operation="toNumber", value="925003271924762633938248194741364019606826595687598837055279805260905", code=NUMERIC_FAULT, version=bignumber/5.0.5)
Guide says arg destTokenEthPriceTimesGasPrice
is returnAmount * gas_price, where returnAmount is result of getExpectedReturn(fromToken, destToken, amount, parts, flags)
, how do i get into this error? Please help me , Thank you very much.
Example code:
const { returnAmount, distribution } = await contract.methods.getExpectedReturn(
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
daiAddress,
web3.utils.toWei('100', 'ether'),
parts,
0x00,
).call();
console.log('expected return -> ', returnAmount);
const destTokenEthPriceTimesGasPrice = web3.utils.toBN(returnAmount).mul(web3.utils.toBN(200*Math.pow(10, 9)));
const { returnAmount: a, estimateGasAmount, distribution: b} = await contract.methods.getExpectedReturnWithGas(
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
daiAddress,
web3.utils.toWei('100', 'ether'),
parts,
0x00,
destTokenEthPriceTimesGasPrice,
).call();
console.log(a);
PS: i'm using [email protected]
Hi,
I think the term 'transitional token' in the README.md could use a definition. At least it is not clear to me what it means from just reading the doc.
After reading in code I think it means:
After reading some code I think, it means instead of doing a direct swap:
WrappedTokenA --swap-> WrappedTokenB
It would do a wrap/unwrap first:
WrappedTokenA --unwrap-> TokenA --swap-> TokenB --wrap-> WrappedTokenB
Is that correct? It can be changed to use "direct swap" by setting FLAG_DISABLE_ALL_WRAP_SOURCES? The default behavior is the transition to underling token?
Thanks for the help.
Try Withdrawing from 1inch/Eth stake (not claim, just withdraw the LP tokens from the farming stake) and it shows balance is Zero!!!!! so, therefore no can do. LOCKED! Most troubling! My money is now stuck inside the farming stake and it shows zero balance for withdrawing, Then, there is also Zero My Liquidity in the LP too (after I put it into farming.) Should not be the case. You should make LP fees plus the 1-inch stake rewards.. This is horrible. So Many errors. Cannot believe you launched like this.
Your service show me 66% price drop
but in https://dmm.exchange everything ok
I check price on https://coinmarketcap.com/converter and it's real ok
I think this is bug, am I right?
Create a new Pool, (I created AGI ETH pool ). After creation, Liquidity shows as about 49% of My Liquidity, should be 100% Obviously the total liquidity of the pool cannot be less than My Liquidity. Please note, this is a major issue for pools and be on all pools, I do not know.
Up to 1k$ worth in CHI Token
Create an awesome flow chart that shows complex 1inch swap paths based on executed transactions from etherscan. Essentially a reverse engineering of the swap path.
We require a working demo and a solid MVP.
The best/most creative submission will declared the winner. If you are unsure about whether your hack project suits the bounty topic please present your idea to us via our discord channel.
Please make Open-Source your project at the end of the hackathon.
Creativity and Usefulness.
We will also do a code review to ensure code quality to make the final decision.
Dec 10 — Workshop
Dec 24 — Submission Deadline
From Dec 25 — Judging
Jan 2 — Winners Announcement
Jan 3 — Payouts
For help: Feel free to contact us on Discord or leave a comment below.
Good success and have fun, BUIDLers!
This issue is part of Gitcoin Grants R8 Hackathon:
Look at other bounties:
Github
gr8 1inch bounties list
Chat with us:
discord channel
Telegram group
Up to 1k$ worth in CHI Token
BUIDL a widget for token swaps which can be embedded on any website. Project could use it to offer buying and selling own tokens on own project page.
We require a working demo and a solid MVP.
The best/most creative submission will declared the winner. If you are unsure about whether your hack project suits the bounty topic please present your idea to us via our discord channel.
Please make Open-Source your project at the end of the hackathon.
Creativity and Usefulness.
We will also do a code review to ensure code quality to make the final decision.
Dec 10 — Workshop
Dec 24 — Submission Deadline
From Dec 25 — Judging
Jan 2 — Winners Announcement
Jan 3 — Payouts
For help: Feel free to contact us on Discord or leave a comment below.
Good success and have fun, BUIDLers!
Look at other bounties:
Github
gr8 1inch bounties list
Chat with us:
discord channel
Telegram group
Up to 1k$ worth in CHI Token
BUIDL an arbitrage bot for example with nodejs or python that uses 1inch API to fill 0x limit orders from 1inch users.
API swagger reference
Find an 0x order from the Mesh network (which was created by one of our users) and fill it by using your own ETH and 1inch API to fill it and swap back into ETH with profit.
If you see limit order of swapping M XXX tokens to N YYY tokens try to:
We require a working demo and a solid MVP.
The best/most creative submission will declared the winner. If you are unsure about whether your hack project suits the bounty topic please present your idea to us via our discord channel.
Please make Open-Source your project at the end of the hackathon.
Creativity and Usefulness.
We will also do a code review to ensure code quality to make the final decision.
Dec 10 — Workshop
Dec 24 — Submission Deadline
From Dec 25 — Judging
Jan 2 — Winners Announcement
Jan 3 — Payouts
For help: Feel free to contact us on Discord or leave a comment below.
Good success and have fun, BUIDLers!
Look at other bounties:
Github
gr8 1inch bounties list
Chat with us:
discord channel
Telegram group
Send ETH and tokens using CHI gas token.
The interface is very similar to compound. All mTokens have the same number of decimals as their underlying counterpart. The exchangeRate is always a number with 18 decimal places, regardless of the token.
Master Controller - 0x4CB120Dd1D33C9A3De8Bc15620C7Cd43418d77E2
underlyingTokenAddressToDmmTokenIdMap
mDAI -0x06301057D77D54B6e14c7FafFB11Ffc7Cab4eaa7
mETH - 0xdF9307DFf0a1B57660F60f9457D32027a55ca0B2
mUSDC - 0x3564ad35b9E95340E5Ace2D6251dbfC76098669B
Minting is as simple as calling mint(uint underlyingAmount)
where underlyingAmount
is the amount of underlying you want to send into the contract. Note, a token approval is needed for calling mint
on the underlying contract, where the spender
is set to the mToken contract address.
Redeeming mTokens for underlying, plus interest, is done through redeem(uint amount)
where amount
is the amount of mTokens to be sent to the contract and redeemed. Note, no token approvals are required to redeem mTokens.
Hey Guys,
U did amazing project, but haven't bought MM to pump the coin price? Lol. Come one, what a lame, nice and usable project, but no MM - its BS. If you ain't gonna do something with your coin price (pump, eh?) it will end up somewhere in the garbage...
Hello! it's been almost two years since the first proposition of putting 1inch on a testnet #15 and I was wondering if you'd thought any more about implementing it on something like the Kovan Network. You could start with Uniswap, Sushi, and Balancer just as an experiment. It would obviously help with running test contracts as well as help the network's tokens achieve a relative equilibrium- for example, 1 ETH on Sushi swaps for 123983 USDC whereas 1 ETH on Balancer swaps for 7569.25 USDC. It'd be putting 1inch's aggregation/arbitrage to the "test".
Up to 1k$ worth in CHI Token
Use 1inch API within a liqudiations Bot. 1inch API supports tokens swaps by liquidating positions on AAVE. You can use this feature to build your own liquidation bot.
We require a working demo and a solid MVP.
The best/most creative submission will declared the winner. If you are unsure about whether your hack project suits the bounty topic please present your idea to us via our discord channel.
Please make Open-Source your project at the end of the hackathon.
Creativity and Usefulness.
We will also do a code review to ensure code quality to make the final decision.
Dec 10 — Workshop
Dec 24 — Submission Deadline
From Dec 25 — Judging
Jan 2 — Winners Announcement
Jan 3 — Payouts
For help: Feel free to contact us on Discord or leave a comment below.
Good success and have fun, BUIDLers!
This issue is part of Gitcoin Grants R8 Hackathon:
Look at other bounties:
Github
gr8 1inch bounties list
Chat with us:
discord channel
Telegram group
Up to 3k DAI
Use Volume Weighted Price Oracles to do some CRAZZZY stuff.
Working Demo and Solid MVP
CREATIVITY
Jan 2.
After clicking unlock icon with animated border, to add to an LP (like 1Inch Eth), the 1Inch row disappears. I have screenshot.
I am using 1splitaudit to swap with these address : 0xC586BeF4a0992C495Cf22e1aeEE4E446CECDee0E and 0x50FDA034C0Ce7a8f7EFDAebDA7Aa7cA21CC1267e . the both addresses having show same error : Error: Returned error: VM Exception while processing transaction: revert SafeERC20: low-level call failed -- Reason given: SafeERC20: low-level
call failed. token used to DAI to TUSD please help
When txn fails, the message says "Transaction filed" instead of "Transaction failed"
Cheers!
Where can I find the latest code that backs the "quote" call API? It seems like this is an old smart contract.
From my recent experience of integrating the OneSplit contracts to perform ETH -> sUSD swaps, I believe that it will greatly benefit dApp developers if they could use the features of 1inch by installing a npm package that handles all the configurations and only exposes the essential and easy to read methods.
If the core contributors do not want to implement such a feature themselves, I can help build out this feature via a gitcoin grant. 😊
i had an old limit order which was no longer showing on the 1inch exchange ui, get executed after i transferred into my wallet some of the asset that was the 'maker' asset from the old limit order. I know of only 2 possibilities why it wasnt showing on the ui, someone from the team probably knows more, 1) because i previously transferred out the maker asset from the wallet, or 2) because i previously revoked approvals for spending the token using approved.zone, then reapproved.
I had no way to cancel the old limit order prior to transferring in the asset(weth in this case), which was trading at a much higher value than it was at the time i placed the limit order, a lot of money was lost. I want to recommend to the 1inch team, to possibly put some kind of warning on the limit order ui, warning that limit orders will not be cancelable if you transfer out the maker asset from your wallet, or revoke approvals, and to cancel them beforehand, because they will remain active. Or even better, to continue showing the limit orders so long as they remain active, to allow users to cancel them.
Up to 3k DAI
Create a user-friendly UI for using the 1inch API.
Working Demo and Solid MVP.
Creativity, Usefulness, Beauty
Jan 2.
I'm looking for the Kovan version of the OneSplitAudit contract. Does it exist? where can i find it?
Up to 1k$ worth in CHI Token
Just BUILD on top of our services what ever you want!
We require a working demo and a solid MVP.
The best/most creative submission will declared the winner. If you are unsure about whether your hack project suits the bounty topic please present your idea to us via our discord channel.
Please make Open-Source your project at the end of the hackathon.
Creativity and Usefulness.
We will also do a code review to ensure code quality to make the final decision.
Dec 10 — Workshop
Dec 24 — Submission Deadline
From Dec 25 — Judging
Jan 2 — Winners Announcement
Jan 3 — Payouts
For help: Feel free to contact us on Discord or leave a comment below.
Good success and have fun, BUIDLers!
Look at other bounties:
Github
gr8 1inch bounties list
Chat with us:
discord channel
Telegram group
I am trying to test 1inch getExpectedReturn function from my Solidity contract. I deploy my contract on the Mainnet forked with Ganache via Remix. The entire contract is pretty simple and looks as follows:
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract IOneSplit {
function getExpectedReturn(
IERC20 fromToken,
IERC20 toToken,
uint256 amount,
uint256 parts,
uint256 disableFlags
)
public
view
returns(
uint256 returnAmount,
uint256[] memory distribution
);
}
contract TradingBot {
// OneSplit Config
address ONE_SPLIT_ADDRESS = 0xC586BeF4a0992C495Cf22e1aeEE4E446CECDee0E;
uint256 PARTS = 10;
uint256 FLAGS = 0;
// Allow the contract to receive Ether
function () external payable {}
function getreturn (address _from, address _to, uint256 _amount) public view returns(uint returnAmount, uint[] memory distribution) {
IERC20 _fromIERC20 = IERC20(_from);
IERC20 _toIERC20 = IERC20(_to);
IOneSplit _oneSplitContract = IOneSplit(ONE_SPLIT_ADDRESS);
(returnAmount, distribution) = _oneSplitContract.getExpectedReturn(_fromIERC20, _toIERC20, _amount, PARTS, FLAGS);
}
}
The contract compiles well but after deployment and running the getreturn function I always get the cryptic "VM Exception while processing transaction: revert" error. I also tried to use the call function:
function getreturn_test () public {
ONE_SPLIT_ADDRESS.call(abi.encodeWithSignature(
"getExpectedReturn(address,address,uint256,uint256,uint256)",
0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48,
0x6B175474E89094C44Da98b954EedeAC495271d0F,
uint(100), uint(10), uint(0)));
}
It does not work either. I can't find any explanation why this does not work in my contract. Are these functions implemented correctly?
My Liquidity shows Zero (1Inch/Eth) after staking the LP tokens to the Liquidity Farming stake for 1Inch rewards. Obviously you do not intend to stop providing LP fees just because we stake those tokens into the "farming" stake. Seems to be a MAJOR glitch and cant tell if it is real or just "appears" that way in the HTML.
Sorry, a lazy bug filling. But because you don't have many issues, that's the way.
Hi, I am trying to use getExpectedReturnWithGas
and swapWithReferral
methods from the contract address in the documentation which is 0xC586BeF4a0992C495Cf22e1aeEE4E446CECDee0E
. And I get error calling these methods.
And when I checked the address's source code I couldn't see these methods. So what happened to these methods?
Thanks
It appears, that
https://github.com/1inch/1inchProtocol/blob/master/OneSplitView.full.sol#L1521-L1523
represents an infinite loop in case of parts > 0
the completion condition is defined on j
, but it's i
which is incremented.
I am getting returned amount different from what is displayed on the 1inchprotocol web site when converting from cryptos other than ether (I mean drastically different). I am using a code example from the readme doc. Should I process the return value somehow to get the correct result?
I am trying to get a quote for the DAI/ETH pair on a specifc (single) decentralized exchange. I can pass this information to the /quote endpoint, but when I change 'quote' in the url to 'swap' I get 'message:"Error"'. Why does this happen? I am excluding all exchanges but one, but this also occurs when I have no exchanges disabled. Also, why is there not a more explanatory error code?
This issue is part of Gitcoin Grants R8 Hackathon:
Up to 3k$ worth in CHI Token
UX Tools to help people launch tokens on Mooniswap w/ an emphasis on it being better for initial liquidity providers.
A working demo and solid MVP. The demo should be included in the submission.
Open-source is appreciated.
Creativity and Usefulness.
2 Jan 2021
For help: Feel free to contact us on Discord or leave a comment below.
Good luck, have fun, BUIDLers!
This issue is part of Gitcoin Grants R8 Hackathon:
Look at other bounties:
[Github 1inch list of bountirshttps://github.com/1inch-exchange/1inchProtocol/labels/Gitcoin)
Gitcoin gr8 1inch bounties
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.