Skip to content

Commit

Permalink
Merge pull request #95 from studydefi/uniswap-v2
Browse files Browse the repository at this point in the history
Uniswap V2
  • Loading branch information
marcelomorgado authored Apr 1, 2021
2 parents c609175 + a753c20 commit adb36b3
Show file tree
Hide file tree
Showing 22 changed files with 18,987 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PRIV_KEY=
MAINNET_NODE_URL=

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Protocols supported:
- Synthetix
- Balancer
- mStable
- Uniswap v2

Importing specific protocols is also supported:

Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@
- Synthetix
- Balancer
- mStable
- Uniswap v2
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
- [Synthetix](synthetix.md)
- [Balancer](balancer.md)
- [mStable](mstable.md)
- [Uniswap V2](uniswapV2.md)
22 changes: 11 additions & 11 deletions docs/balancer.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ pragma solidity ^0.5.0;

interface BPool {

function isPublicSwap() external view returns (bool);
function isexternalSwap() external view returns (bool);
function isFinalized() external view returns (bool);
function isBound(address t) external view returns (bool);
function getNumTokens() external view returns (uint);
function getCurrentTokens() external view returns (address[] memory tokens);
function getFinalTokens() external view returns (address[] memory tokens)
function getFinalTokens() external view returns (address[] memory tokens);
function getDenormalizedWeight(address token) external view returns (uint);
function getTotalDenormalizedWeight() external view returns (uint);
function getNormalizedWeight(address token) external view returns (uint);
Expand All @@ -45,10 +45,10 @@ interface BPool {

function setSwapFee(uint swapFee) external;
function setController(address manager) external;
function setPublicSwap(bool public_) external;
function setexternalSwap(bool external_) external;
function finalize() external;
function bind(address token, uint balance, uint denorm) external;
function rebind(address token, uint balance, uint denorm) public;
function rebind(address token, uint balance, uint denorm) external;
function unbind(address token) external;
function gulp(address token) external;

Expand Down Expand Up @@ -114,7 +114,7 @@ interface BPool {
uint tokenBalanceOut,
uint tokenWeightOut,
uint swapFee
) public pure returns (uint spotPrice);
) external pure returns (uint spotPrice);

function calcOutGivenIn(
uint tokenBalanceIn,
Expand All @@ -123,7 +123,7 @@ interface BPool {
uint tokenWeightOut,
uint tokenAmountIn,
uint swapFee
) public pure returns (uint tokenAmountOut);
) external pure returns (uint tokenAmountOut);

function calcInGivenOut(
uint tokenBalanceIn,
Expand All @@ -132,7 +132,7 @@ interface BPool {
uint tokenWeightOut,
uint tokenAmountOut,
uint swapFee
) public pure returns (uint tokenAmountIn);
) external pure returns (uint tokenAmountIn);

function calcPoolOutGivenSingleIn(
uint tokenBalanceIn,
Expand All @@ -141,7 +141,7 @@ interface BPool {
uint totalWeight,
uint tokenAmountIn,
uint swapFee
) public pure returns (uint poolAmountOut);
) external pure returns (uint poolAmountOut);

function calcSingleInGivenPoolOut(
uint tokenBalanceIn,
Expand All @@ -150,7 +150,7 @@ interface BPool {
uint totalWeight,
uint poolAmountOut,
uint swapFee
) public pure returns (uint tokenAmountIn)
) external pure returns (uint tokenAmountIn);

function calcSingleOutGivenPoolIn(
uint tokenBalanceOut,
Expand All @@ -159,7 +159,7 @@ interface BPool {
uint totalWeight,
uint poolAmountIn,
uint swapFee
) public pure returns (uint tokenAmountOut)
) external pure returns (uint tokenAmountOut);

function calcPoolInGivenSingleOut(
uint tokenBalanceOut,
Expand All @@ -168,7 +168,7 @@ interface BPool {
uint totalWeight,
uint tokenAmountOut,
uint swapFee
) public pure returns (uint poolAmountIn)
) external pure returns (uint poolAmountIn);

}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/kyber.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ import "@studydefi/money-legos/kyber/contracts/KyberNetworkProxy.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract KyberLiteBase {
// KyberNetwork Mainnet factory address
// Uniswap Mainnet factory address
address constant KyberNetworkProxyAddress = 0x818E6FECD516Ecc3849DAf6845e3EC868087B755;

function _ethToToken(address tokenAddress, uint ethAmount) internal returns (uint) {
Expand Down
2 changes: 1 addition & 1 deletion docs/mstable.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ interface Masset {
* @param _mAssetQuantity Quantity of mAsset to redeem
* @param _recipient Address to credit the withdrawn bAssets
*/
function redeemMasset(uint256 _mAssetQuantity, address _recipient) external nonReentrant;
function redeemMasset(uint256 _mAssetQuantity, address _recipient) external;
}
```
Expand Down
36 changes: 36 additions & 0 deletions docs/overview_mainnet_address.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@
- aWBTC: [0xfc4b8ed459e00e5400be803a9bb3954234fd50e3](https://etherscan.io/address/0xfc4b8ed459e00e5400be803a9bb3954234fd50e3)
- aZRX: [0x6fb0855c404e09c47c3fbca25f08d4e41f9f062f](https://etherscan.io/address/0x6fb0855c404e09c47c3fbca25f08d4e41f9f062f)

## Balancer

[Link to ABIs](https://github.com/studydefi/money-legos/tree/master/src/balancer/abi)


- BActions: [0xde4A25A0b9589689945d842c5ba0CF4f0D4eB3ac](https://etherscan.io/address/0xde4A25A0b9589689945d842c5ba0CF4f0D4eB3ac)
- ExchangeProxy: [0x6317C5e82A06E1d8bf200d21F4510Ac2c038AC81](https://etherscan.io/address/0x6317C5e82A06E1d8bf200d21F4510Ac2c038AC81)
- PoolFactory: [0x9424B1412450D0f8Fc2255FAf6046b98213B76Bd](https://etherscan.io/address/0x9424B1412450D0f8Fc2255FAf6046b98213B76Bd)

## Compound

[Link to ABIs](https://github.com/studydefi/money-legos/tree/master/src/compound/abi)
Expand Down Expand Up @@ -150,6 +159,24 @@
- proxyRegistry: [0x4678f0a6958e4D2Bc4F1BAF7Bc52E8F3564f3fE4](https://etherscan.io/address/0x4678f0a6958e4D2Bc4F1BAF7Bc52E8F3564f3fE4)
- usdcJoin: [0xA191e578a6736167326d05c119CE0c90849E84B7](https://etherscan.io/address/0xA191e578a6736167326d05c119CE0c90849E84B7)

## Mstable

[Link to ABIs](https://github.com/studydefi/money-legos/tree/master/src/mstable/abi)


- AaveIntegration: [0xf617346a0fb6320e9e578e0c9b2a4588283d9d39](https://etherscan.io/address/0xf617346a0fb6320e9e578e0c9b2a4588283d9d39)
- BasketManager: [0x66126B4aA2a1C07536Ef8E5e8bD4EfDA1FdEA96D](https://etherscan.io/address/0x66126B4aA2a1C07536Ef8E5e8bD4EfDA1FdEA96D)
- CompoundIntegration: [0xd55684f4369040c12262949ff78299f2bc9db735](https://etherscan.io/address/0xd55684f4369040c12262949ff78299f2bc9db735)
- DelayedProxyAdmin: [0x5C8eb57b44C1c6391fC7a8A0cf44d26896f92386](https://etherscan.io/address/0x5C8eb57b44C1c6391fC7a8A0cf44d26896f92386)
- ForgeValidator: [0xbB90D06371030fFa150E463621c22950b212eaa1](https://etherscan.io/address/0xbB90D06371030fFa150E463621c22950b212eaa1)
- MTA: [0xa3bed4e1c75d00fa6f4e5e6922db7261b5e9acd2](https://etherscan.io/address/0xa3bed4e1c75d00fa6f4e5e6922db7261b5e9acd2)
- MassetValidationHelper: [0xabcc93c3be238884cc3309c19afd128fafc16911](https://etherscan.io/address/0xabcc93c3be238884cc3309c19afd128fafc16911)
- Nexus: [0xAFcE80b19A8cE13DEc0739a1aaB7A028d6845Eb3](https://etherscan.io/address/0xAFcE80b19A8cE13DEc0739a1aaB7A028d6845Eb3)
- RewardsDistributor: [0x04dfdfa471b79cc9e6e8c355e6c71f8ec4916c50](https://etherscan.io/address/0x04dfdfa471b79cc9e6e8c355e6c71f8ec4916c50)
- SavingsContract: [0xcf3f73290803fc04425bee135a4caeb2bab2c2a1](https://etherscan.io/address/0xcf3f73290803fc04425bee135a4caeb2bab2c2a1)
- SavingsManager: [0x7046b0bfc4c5eeb90559c0805dd9c1a6f4815370](https://etherscan.io/address/0x7046b0bfc4c5eeb90559c0805dd9c1a6f4815370)
- mUSD: [0xe2f2a5C287993345a840Db3B0845fbC70f5935a5](https://etherscan.io/address/0xe2f2a5C287993345a840Db3B0845fbC70f5935a5)

## Onesplit

[Link to ABIs](https://github.com/studydefi/money-legos/tree/master/src/onesplit/abi)
Expand Down Expand Up @@ -236,3 +263,12 @@

- factory: [0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95](https://etherscan.io/address/0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95)

## UniswapV2

[Link to ABIs](https://github.com/studydefi/money-legos/tree/master/src/uniswapV2/abi)


- factory: [0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f](https://etherscan.io/address/0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f)
- router01: [0xf164fC0Ec4E93095b804a4795bBe1e041497b92a](https://etherscan.io/address/0xf164fC0Ec4E93095b804a4795bBe1e041497b92a)
- router02: [0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D](https://etherscan.io/address/0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D)

Loading

1 comment on commit adb36b3

@vercel
Copy link

@vercel vercel bot commented on adb36b3 Apr 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.