├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public ├── adai.svg ├── arcx.png ├── arcx.svg ├── asusd.svg ├── ausdc.svg ├── ausdt.svg ├── cdai.svg ├── cusdc.svg ├── cusdt.svg ├── dai.svg ├── etherscan-logo-circle.svg ├── favicon.ico ├── index.html ├── logo.png ├── manifest.json ├── renbtc.svg ├── robots.txt ├── sbtc.svg ├── susd.svg ├── usdc.svg ├── usdt.svg └── wbtc.svg ├── snippets.js ├── src ├── App.js ├── abi │ ├── AToken.abi.json │ ├── Assimilator.abi.json │ ├── CToken.abi.json │ ├── Chai.abi.json │ ├── ERC20.abi.json │ ├── Shell.abi.json │ └── USDT.abi.json ├── assets │ ├── cdai.svg │ ├── chai.png │ ├── cowri-logo.svg │ ├── cusdc.svg │ ├── dai.svg │ ├── etherscan-logo-circle.svg │ ├── etherscan-logo-light-circle.png │ ├── etherscan-logo-light-circle.svg │ ├── favicon.ico │ ├── logo-white.png │ ├── logo.jpg │ ├── logo.png │ ├── metamask.svg │ ├── ocean.jpg │ ├── ren.svg │ ├── shell_icon_16.png │ ├── shell_icon_16.svg │ ├── shell_icon_24.png │ ├── shell_icon_24.svg │ ├── shell_icon_36.png │ ├── shell_icon_36.svg │ ├── surfer.jpg │ ├── susd.svg │ ├── tether.png │ ├── usdc.png │ ├── usdc.svg │ ├── usdt.svg │ └── walletConnectLogo.png ├── components │ ├── Button │ │ ├── Button.js │ │ └── index.js │ ├── Card │ │ ├── Card.js │ │ └── index.js │ ├── CardTitle │ │ ├── CardTitle.js │ │ └── index.js │ ├── Container │ │ ├── Container.js │ │ └── index.js │ ├── Footer │ │ ├── Footer.js │ │ └── index.js │ ├── Header │ │ ├── Header.js │ │ └── index.js │ ├── LabelledValue │ │ ├── LabelledValue.js │ │ └── index.js │ ├── Loader │ │ ├── Loader.js │ │ └── index.js │ ├── Logo │ │ ├── Logo.js │ │ └── index.js │ ├── Modal │ │ ├── Modal.js │ │ └── index.js │ ├── ModalActions │ │ ├── ModalActions.js │ │ └── index.js │ ├── ModalAwaitingTx │ │ ├── ModalAwaitingTx.js │ │ └── index.js │ ├── ModalConfirm │ │ ├── ModalConfirm.js │ │ └── index.js │ ├── ModalContent │ │ ├── ModalContent.js │ │ └── index.js │ ├── ModalError │ │ ├── ModalError.js │ │ └── index.js │ ├── ModalIcon │ │ ├── ModalIcon.js │ │ └── index.js │ ├── ModalSuccess │ │ ├── ModalSuccess.js │ │ └── index.js │ ├── ModalTitle │ │ ├── ModalTitle.js │ │ └── index.js │ ├── ModalUnlock │ │ ├── ModalUnlock.js │ │ └── index.js │ ├── Overview │ │ ├── Overview.js │ │ └── index.js │ ├── OverviewSection │ │ ├── OverviewSection.js │ │ └── index.js │ ├── Row │ │ ├── Row.js │ │ └── index.js │ ├── Surface │ │ ├── Surface.js │ │ └── index.js │ ├── Tab │ │ ├── Tab.js │ │ └── index.js │ ├── Tabs │ │ ├── Tabs.js │ │ └── index.js │ ├── TokenIcon │ │ ├── TokenIcon.js │ │ └── index.js │ └── icons │ │ ├── Dai.js │ │ └── Usdc.js ├── containers │ └── withWallet.js ├── fonts │ ├── geomanist-book-webfont.eot │ ├── geomanist-book-webfont.svg │ ├── geomanist-book-webfont.ttf │ ├── geomanist-book-webfont.woff │ ├── geomanist-book-webfont.woff2 │ ├── geomanist-medium-webfont.eot │ ├── geomanist-medium-webfont.svg │ ├── geomanist-medium-webfont.ttf │ ├── geomanist-medium-webfont.woff │ ├── geomanist-medium-webfont.woff2 │ ├── geomanist-regular-webfont.eot │ ├── geomanist-regular-webfont.svg │ ├── geomanist-regular-webfont.ttf │ ├── geomanist-regular-webfont.woff │ └── geomanist-regular-webfont.woff2 ├── index.css ├── index.js ├── kovan.multiple.aave.config.json ├── kovan.multiple.compound.config.json ├── kovan.one.dai.usdc.usdt.susd.atokens.config.json ├── kovan.one.dai.usdc.usdt.susd.ctokens.config.json ├── kovan.two.wbtc.renbtc.sbtc.config.json ├── mainnet.multiple.config.json ├── mainnet.one.dai.usdc.usdt.susd.config.json ├── mainnet.two.wbtc.renbtc.sbtc.config.json ├── rinkeby.config.json ├── theme │ ├── colors.js │ ├── index.js │ └── theme.js ├── utils │ ├── Asset.js │ ├── Engine.js │ ├── NumberFormats.js │ ├── Shell.js │ ├── SwapEngine.js │ └── web3Classes.js └── views │ ├── Dashboard │ ├── Dashboard.js │ ├── components │ │ ├── DashboardContent.js │ │ ├── NetworkModal.js │ │ ├── SelectWalletModal.js │ │ ├── ShellTab.js │ │ ├── ShellsTab.js │ │ ├── SwapTab.js │ │ └── UnlockModal.js │ ├── context.js │ └── index.js │ ├── Deposit │ ├── Deposit.js │ ├── components │ │ ├── StartModal.js │ │ └── WarningModal.js │ └── index.js │ └── Withdraw │ ├── Withdraw.js │ ├── components │ └── StartModal.js │ └── index.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | ## Available Scripts 4 | 5 | In the project directory, you can run: 6 | 7 | ### `yarn start` 8 | 9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 11 | 12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console. 14 | 15 | ### `yarn test` 16 | 17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 19 | 20 | ### `yarn build` 21 | 22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance. 24 | 25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed! 27 | 28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 29 | 30 | ### `yarn eject` 31 | 32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 33 | 34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 35 | 36 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 37 | 38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 39 | 40 | ## Learn More 41 | 42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 43 | 44 | To learn React, check out the [React documentation](https://reactjs.org/). 45 | 46 | ### Code Splitting 47 | 48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting 49 | 50 | ### Analyzing the Bundle Size 51 | 52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size 53 | 54 | ### Making a Progressive Web App 55 | 56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app 57 | 58 | ### Advanced Configuration 59 | 60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration 61 | 62 | ### Deployment 63 | 64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment 65 | 66 | ### `yarn build` fails to minify 67 | 68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify 69 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shell", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@fortawesome/fontawesome-svg-core": "^1.2.27", 7 | "@fortawesome/free-brands-svg-icons": "^5.12.1", 8 | "@fortawesome/free-solid-svg-icons": "^5.13.0", 9 | "@fortawesome/react-fontawesome": "^0.1.8", 10 | "@material-ui/core": "^4.9.9", 11 | "@material-ui/icons": "^4.9.1", 12 | "@material-ui/lab": "^4.0.0-alpha.48", 13 | "@testing-library/jest-dom": "^4.2.4", 14 | "@testing-library/react": "^9.3.2", 15 | "@testing-library/user-event": "^7.1.2", 16 | "bignumber.js": "^9.0.0", 17 | "bnc-onboard": "^1.12.0", 18 | "immutable": "^4.0.0-rc.12", 19 | "immutable-js": "^0.3.1-6", 20 | "js-cookie": "^2.2.1", 21 | "random-words": "^1.1.1", 22 | "react": "^16.13.1", 23 | "react-dom": "^16.13.1", 24 | "react-hook-form": "^5.4.1", 25 | "react-intercom": "^1.0.15", 26 | "react-number-format": "^4.4.1", 27 | "react-scripts": "3.4.1", 28 | "styled-components": "^5.0.1", 29 | "web3": "1.0.0-beta.52" 30 | }, 31 | "scripts": { 32 | "start": "react-scripts start", 33 | "build": "react-scripts build", 34 | "test": "react-scripts test", 35 | "eject": "react-scripts eject" 36 | }, 37 | "eslintConfig": { 38 | "extends": "react-app" 39 | }, 40 | "browserslist": { 41 | "production": [ 42 | ">0.2%", 43 | "not dead", 44 | "not op_mini all" 45 | ], 46 | "development": [ 47 | "last 1 chrome version", 48 | "last 1 firefox version", 49 | "last 1 safari version" 50 | ] 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /public/adai.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/arcx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/public/arcx.png -------------------------------------------------------------------------------- /public/asusd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /public/ausdc.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/ausdt.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/cdai.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /public/cusdc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /public/cusdt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /public/dai.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/etherscan-logo-circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 21 | 25 | 26 | 35 | $ Shell Exchange ₿ 36 | 37 | 38 | 39 |
40 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/public/logo.png -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Shell Protocol", 3 | "name": "Shell Protocol Loi'hi Interface", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /public/renbtc.svg: -------------------------------------------------------------------------------- 1 | renBTC -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /public/susd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /public/usdc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/usdt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/wbtc.svg: -------------------------------------------------------------------------------- 1 | wrapped-bitcoin-wbtc -------------------------------------------------------------------------------- /snippets.js: -------------------------------------------------------------------------------- 1 | async function getSlippage (theseChickens, thoseChickens) { 2 | 3 | const theseRoosters = new BigNumber(swapPayload.type === 'origin' 4 | ? await origin.adapter.methods.viewNumeraireAmount(theseChickens.toFixed()).call() 5 | : await origin.adapter.methods.viewNumeraireAmount(thoseChickens.toFixed()).call() 6 | ) 7 | 8 | const thoseRoosters = new BigNumber(swapPayload.type === 'origin' 9 | ? await target.adapter.methods.viewNumeraireAmount(thoseChickens.toFixed()).call() 10 | : await target.adapter.methods.viewNumeraireAmount(theseChickens.toFixed()).call() 11 | ) 12 | 13 | const one = new BigNumber(1) 14 | const proportion = thoseRoosters.dividedBy(theseRoosters) 15 | 16 | } -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import { ThemeProvider } from '@material-ui/core/styles' 4 | 5 | import theme from './theme' 6 | 7 | import Dashboard from './views/Dashboard' 8 | 9 | function App() { 10 | return ( 11 | 12 | 13 | 14 | ) 15 | } 16 | 17 | export default App 18 | -------------------------------------------------------------------------------- /src/abi/AToken.abi.json: -------------------------------------------------------------------------------- 1 | [{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_fromBalanceIncrease","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toBalanceIncrease","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_fromIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toIndex","type":"uint256"}],"name":"BalanceTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_fromBalanceIncrease","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_fromIndex","type":"uint256"}],"name":"BurnOnLiquidation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"}],"name":"InterestRedirectionAllowanceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_redirectedBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_fromBalanceIncrease","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_fromIndex","type":"uint256"}],"name":"InterestStreamRedirected","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_fromBalanceIncrease","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_fromIndex","type":"uint256"}],"name":"MintOnDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_fromBalanceIncrease","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_fromIndex","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_targetAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"_targetBalanceIncrease","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_targetIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_redirectedBalanceAdded","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_redirectedBalanceRemoved","type":"uint256"}],"name":"RedirectedBalanceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":false,"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"allowInterestRedirectionTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getInterestRedirectionAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getRedirectedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"isTransferAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"principalBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"redeem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"redirectInterestStream","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"redirectInterestStreamOf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}] 2 | -------------------------------------------------------------------------------- /src/abi/Assimilator.abi.json: -------------------------------------------------------------------------------- 1 | [{"constant":false,"inputs":[{"internalType":"int128","name":"amount","type":"int128"}],"name":"intakeNumeraire","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"intakeRaw","outputs":[{"internalType":"int128","name":"","type":"int128"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"intakeRawAndGetBalance","outputs":[{"internalType":"int128","name":"","type":"int128"},{"internalType":"int128","name":"","type":"int128"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"int128","name":"amount","type":"int128"}],"name":"outputNumeraire","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"outputRaw","outputs":[{"internalType":"int128","name":"","type":"int128"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"outputRawAndGetBalance","outputs":[{"internalType":"int128","name":"","type":"int128"},{"internalType":"int128","name":"","type":"int128"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"viewNumeraireAmount","outputs":[{"internalType":"int128","name":"","type":"int128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"viewNumeraireAmountAndBalance","outputs":[{"internalType":"int128","name":"","type":"int128"},{"internalType":"int128","name":"","type":"int128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"viewNumeraireBalance","outputs":[{"internalType":"int128","name":"","type":"int128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"int128","name":"","type":"int128"}],"name":"viewRawAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}] 2 | -------------------------------------------------------------------------------- /src/abi/CToken.abi.json: -------------------------------------------------------------------------------- 1 | [{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOfUnderlying","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"borrowAmount","type":"uint256"}],"name":"borrow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"exchangeRateCurrent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"exchangeRateStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCash","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"redeemTokens","type":"uint256"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"name":"redeemUnderlying","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"repayAmount","type":"uint256"}],"name":"repayBorrow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"repayAmount","type":"uint256"}],"name":"repayBorrowBehalf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}] 2 | -------------------------------------------------------------------------------- /src/abi/Chai.abi.json: -------------------------------------------------------------------------------- 1 | [{"inputs":[{"internalType":"uint256","name":"chainId_","type":"uint256"},{"internalType":"address","name":"vat_","type":"address"},{"internalType":"address","name":"pot_","type":"address"},{"internalType":"address","name":"join_","type":"address"},{"internalType":"address","name":"dai_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"src","type":"address"},{"indexed":true,"internalType":"address","name":"guy","type":"address"},{"indexed":false,"internalType":"uint256","name":"wad","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"src","type":"address"},{"indexed":true,"internalType":"address","name":"dst","type":"address"},{"indexed":false,"internalType":"uint256","name":"wad","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"dai","outputs":[{"internalType":"uint256","name":"wad","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"daiJoin","outputs":[{"internalType":"contract JoinLike","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"daiToken","outputs":[{"internalType":"contract GemLike","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"draw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"exit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"join","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"move","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"holder","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"bool","name":"allowed","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"pot","outputs":[{"internalType":"contract PotLike","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vat","outputs":[{"internalType":"contract VatLike","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}] 2 | -------------------------------------------------------------------------------- /src/abi/ERC20.abi.json: -------------------------------------------------------------------------------- 1 | [{ "constant": false, "inputs": [{ "name": "newSellPrice", "type": "uint256" }, { "name": "newBuyPrice", "type": "uint256" }], "name": "setPrices", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "name", "outputs": [{ "name": "", "type": "string" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_spender", "type": "address" }, { "name": "_value", "type": "uint256" }], "name": "approve", "outputs": [{ "name": "success", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "totalSupply", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_from", "type": "address" }, { "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" }], "name": "transferFrom", "outputs": [{ "name": "success", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "decimals", "outputs": [{ "name": "", "type": "uint8" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_value", "type": "uint256" }], "name": "burn", "outputs": [{ "name": "success", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "minBalanceForAccounts", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "sellPrice", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "_owner", "type": "address" }], "name": "balanceOf", "outputs": [{ "name": "balance", "type": "uint256" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "name": "target", "type": "address" }, { "name": "mintedAmount", "type": "uint256" }], "name": "mintToken", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "name": "_from", "type": "address" }, { "name": "_value", "type": "uint256" }], "name": "burnFrom", "outputs": [{ "name": "success", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "buyPrice", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [{ "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "symbol", "outputs": [{ "name": "", "type": "string" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "buy", "outputs": [{ "name": "amount", "type": "uint256" }], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [{ "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" }], "name": "transfer", "outputs": [{ "name": "success", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "address" }], "name": "frozenAccount", "outputs": [{ "name": "", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "minimumBalanceInFinney", "type": "uint256" }], "name": "setMinBalance", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "name": "_spender", "type": "address" }, { "name": "_value", "type": "uint256" }, { "name": "_extraData", "type": "bytes" }], "name": "approveAndCall", "outputs": [{ "name": "success", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "name": "_owner", "type": "address" }, { "name": "_spender", "type": "address" }], "name": "allowance", "outputs": [{ "name": "remaining", "type": "uint256" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "name": "amount", "type": "uint256" }], "name": "sell", "outputs": [{ "name": "revenue", "type": "uint256" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "name": "target", "type": "address" }, { "name": "freeze", "type": "bool" }], "name": "freezeAccount", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "name": "initialSupply", "type": "uint256" }, { "name": "tokenName", "type": "string" }, { "name": "tokenSymbol", "type": "string" }, { "name": "centralMinter", "type": "address" }], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "from", "type": "address" }, { "indexed": true, "name": "to", "type": "address" }, { "indexed": false, "name": "value", "type": "uint256" }], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "_owner", "type": "address" }, { "indexed": true, "name": "_spender", "type": "address" }, { "indexed": false, "name": "_value", "type": "uint256" }], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "from", "type": "address" }, { "indexed": false, "name": "value", "type": "uint256" }], "name": "Burn", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "name": "target", "type": "address" }, { "indexed": false, "name": "frozen", "type": "bool" }], "name": "FrozenFunds", "type": "event" }] -------------------------------------------------------------------------------- /src/abi/USDT.abi.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": true, 4 | "inputs": [], 5 | "name": "name", 6 | "outputs": [ 7 | { 8 | "name": "", 9 | "type": "string" 10 | } 11 | ], 12 | "payable": false, 13 | "stateMutability": "view", 14 | "type": "function" 15 | }, 16 | { 17 | "constant": false, 18 | "inputs": [ 19 | { 20 | "name": "_spender", 21 | "type": "address" 22 | }, 23 | { 24 | "name": "_value", 25 | "type": "uint256" 26 | } 27 | ], 28 | "name": "approve", 29 | "outputs": [ 30 | { 31 | "name": "", 32 | "type": "bool" 33 | } 34 | ], 35 | "payable": false, 36 | "stateMutability": "nonpayable", 37 | "type": "function" 38 | }, 39 | { 40 | "constant": true, 41 | "inputs": [], 42 | "name": "totalSupply", 43 | "outputs": [ 44 | { 45 | "name": "", 46 | "type": "uint256" 47 | } 48 | ], 49 | "payable": false, 50 | "stateMutability": "view", 51 | "type": "function" 52 | }, 53 | { 54 | "constant": false, 55 | "inputs": [ 56 | { 57 | "name": "_from", 58 | "type": "address" 59 | }, 60 | { 61 | "name": "_to", 62 | "type": "address" 63 | }, 64 | { 65 | "name": "_value", 66 | "type": "uint256" 67 | } 68 | ], 69 | "name": "transferFrom", 70 | "outputs": [ 71 | { 72 | "name": "", 73 | "type": "bool" 74 | } 75 | ], 76 | "payable": false, 77 | "stateMutability": "nonpayable", 78 | "type": "function" 79 | }, 80 | { 81 | "constant": true, 82 | "inputs": [], 83 | "name": "decimals", 84 | "outputs": [ 85 | { 86 | "name": "", 87 | "type": "uint8" 88 | } 89 | ], 90 | "payable": false, 91 | "stateMutability": "view", 92 | "type": "function" 93 | }, 94 | { 95 | "constant": true, 96 | "inputs": [ 97 | { 98 | "name": "_owner", 99 | "type": "address" 100 | } 101 | ], 102 | "name": "balanceOf", 103 | "outputs": [ 104 | { 105 | "name": "balance", 106 | "type": "uint256" 107 | } 108 | ], 109 | "payable": false, 110 | "stateMutability": "view", 111 | "type": "function" 112 | }, 113 | { 114 | "constant": true, 115 | "inputs": [], 116 | "name": "symbol", 117 | "outputs": [ 118 | { 119 | "name": "", 120 | "type": "string" 121 | } 122 | ], 123 | "payable": false, 124 | "stateMutability": "view", 125 | "type": "function" 126 | }, 127 | { 128 | "constant": false, 129 | "inputs": [ 130 | { 131 | "name": "_to", 132 | "type": "address" 133 | }, 134 | { 135 | "name": "_value", 136 | "type": "uint256" 137 | } 138 | ], 139 | "name": "transfer", 140 | "outputs": [ 141 | { 142 | "name": "", 143 | "type": "bool" 144 | } 145 | ], 146 | "payable": false, 147 | "stateMutability": "nonpayable", 148 | "type": "function" 149 | }, 150 | { 151 | "constant": true, 152 | "inputs": [ 153 | { 154 | "name": "_owner", 155 | "type": "address" 156 | }, 157 | { 158 | "name": "_spender", 159 | "type": "address" 160 | } 161 | ], 162 | "name": "allowance", 163 | "outputs": [ 164 | { 165 | "name": "", 166 | "type": "uint256" 167 | } 168 | ], 169 | "payable": false, 170 | "stateMutability": "view", 171 | "type": "function" 172 | }, 173 | { 174 | "payable": true, 175 | "stateMutability": "payable", 176 | "type": "fallback" 177 | }, 178 | { 179 | "anonymous": false, 180 | "inputs": [ 181 | { 182 | "indexed": true, 183 | "name": "owner", 184 | "type": "address" 185 | }, 186 | { 187 | "indexed": true, 188 | "name": "spender", 189 | "type": "address" 190 | }, 191 | { 192 | "indexed": false, 193 | "name": "value", 194 | "type": "uint256" 195 | } 196 | ], 197 | "name": "Approval", 198 | "type": "event" 199 | }, 200 | { 201 | "anonymous": false, 202 | "inputs": [ 203 | { 204 | "indexed": true, 205 | "name": "from", 206 | "type": "address" 207 | }, 208 | { 209 | "indexed": true, 210 | "name": "to", 211 | "type": "address" 212 | }, 213 | { 214 | "indexed": false, 215 | "name": "value", 216 | "type": "uint256" 217 | } 218 | ], 219 | "name": "Transfer", 220 | "type": "event" 221 | } 222 | ] -------------------------------------------------------------------------------- /src/assets/cdai.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/assets/chai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/chai.png -------------------------------------------------------------------------------- /src/assets/cowri-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/assets/cusdc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/assets/dai.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/etherscan-logo-circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/assets/etherscan-logo-light-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/etherscan-logo-light-circle.png -------------------------------------------------------------------------------- /src/assets/etherscan-logo-light-circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/favicon.ico -------------------------------------------------------------------------------- /src/assets/logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/logo-white.png -------------------------------------------------------------------------------- /src/assets/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/logo.jpg -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/logo.png -------------------------------------------------------------------------------- /src/assets/metamask.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 50 | 51 | 52 | 54 | 56 | 57 | 58 | 59 | 61 | -------------------------------------------------------------------------------- /src/assets/ocean.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/ocean.jpg -------------------------------------------------------------------------------- /src/assets/ren.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/shell_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/shell_icon_16.png -------------------------------------------------------------------------------- /src/assets/shell_icon_16.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/assets/shell_icon_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/shell_icon_24.png -------------------------------------------------------------------------------- /src/assets/shell_icon_24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/assets/shell_icon_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/shell_icon_36.png -------------------------------------------------------------------------------- /src/assets/shell_icon_36.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/assets/surfer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/surfer.jpg -------------------------------------------------------------------------------- /src/assets/susd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/assets/tether.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/tether.png -------------------------------------------------------------------------------- /src/assets/usdc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/usdc.png -------------------------------------------------------------------------------- /src/assets/usdc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/assets/usdt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/assets/walletConnectLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/assets/walletConnectLogo.png -------------------------------------------------------------------------------- /src/components/Button/Button.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | import { withTheme } from '@material-ui/core/styles' 4 | 5 | const StyledButton = withTheme(styled.button` 6 | align-items: center; 7 | background-color: ${props => props.outlined ? props.theme.palette.grey[50] : props.theme.palette.primary.main}; 8 | border: ${props => props.outlined ? `1px solid ${props.theme.palette.grey[200]}` : '0'}; 9 | border-radius: ${props => props.theme.shape.borderRadius}px; 10 | box-sizing: border-box; 11 | color: ${props => props.outlined ? props.theme.palette.grey[600] : '#FFF'}; 12 | cursor: pointer; 13 | display: flex; 14 | font-size: ${props => props.small ? '0.8rem' : '1rem'}; 15 | font-weight: 700; 16 | height: ${props => props.small ? 32 : 48}px; 17 | padding: 0 ${props => props.small ? 12 : 32}px; 18 | transition: background-color .2s, border-color .2s; 19 | pointer-events: ${props => props.disabled ? 'none' : 'all'}; 20 | opacity: ${props => props.disabled ? 0.8 : 1}; 21 | &:hover { 22 | background-color: ${props => props.outlined ? '#FFF' : props.theme.palette.primary.dark}; 23 | color: ${props => props.outlined ? props.theme.palette.primary.main : '#FFF' }; 24 | } 25 | `) 26 | 27 | const Button = ({ 28 | disabled, 29 | children, 30 | onClick, 31 | outlined, 32 | small, 33 | }) => { 34 | 35 | return ( 36 | 43 | {children} 44 | 45 | ) 46 | } 47 | 48 | export default Button -------------------------------------------------------------------------------- /src/components/Button/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Button' -------------------------------------------------------------------------------- /src/components/Card/Card.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import Surface from '../Surface' 4 | 5 | const Card = ({ children }) => ( 6 | 7 | {children} 8 | 9 | ) 10 | 11 | export default Card -------------------------------------------------------------------------------- /src/components/Card/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Card' -------------------------------------------------------------------------------- /src/components/CardTitle/CardTitle.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | 4 | const StyledCardTitle = styled.div` 5 | align-items: center; 6 | border-bottom: 1px solid rgba(0,0,0,0.075); 7 | color: rgba(0,0,0,0.7); 8 | display: flex; 9 | font-weight: 700; 10 | height: 56px; 11 | margin: 0; 12 | padding: 0 24px; 13 | ` 14 | 15 | const CardTitle = ({ children, full }) => ( 16 | 17 | {children} 18 | 19 | ) 20 | 21 | export default CardTitle -------------------------------------------------------------------------------- /src/components/CardTitle/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './CardTitle' -------------------------------------------------------------------------------- /src/components/Container/Container.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | 4 | const StyledContainer = styled.div` 5 | box-sizing: border-box; 6 | margin: 0 auto; 7 | max-width: ${props => props.full ? '100%' : '625px'}; 8 | padding: 0 24px; 9 | width: 100%; 10 | @media (max-width: 512px) { 11 | padding: 0 6px; 12 | } 13 | ` 14 | 15 | const Container = ({ children, full }) => ( 16 | 17 | {children} 18 | 19 | ) 20 | 21 | export default Container -------------------------------------------------------------------------------- /src/components/Container/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Container' -------------------------------------------------------------------------------- /src/components/Footer/Footer.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' 4 | import { faDiscord, faTelegram, faTwitter, faGithub } from '@fortawesome/free-brands-svg-icons' 5 | 6 | import Container from '../Container' 7 | 8 | const StyledFooter = styled.footer` 9 | align-items: center; 10 | color: #FFF; 11 | display: flex; 12 | height: 96px; 13 | justify-content: center; 14 | ` 15 | 16 | const StyledSocialIcon = styled.a` 17 | align-items: center; 18 | color: #FFF; 19 | display: flex; 20 | height: 44px; 21 | justify-content: center; 22 | opacity: 0.5; 23 | margin: 10px; 24 | transition: opacity .2s; 25 | width: 44px; 26 | &:hover { 27 | opacity: 1; 28 | } 29 | ` 30 | 31 | const Footer = () => ( 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | ) 49 | 50 | export default Footer -------------------------------------------------------------------------------- /src/components/Footer/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Footer' -------------------------------------------------------------------------------- /src/components/Header/Header.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | 4 | import Container from '../Container' 5 | import Logo from '../Logo' 6 | 7 | const StyledHeader = styled.div` 8 | align-items: center; 9 | color: #FFF; 10 | display: flex; 11 | height: 96px; 12 | justify-content: space-between; 13 | ` 14 | 15 | const Header = () => ( 16 | 17 | 18 | 19 | 20 | 21 | ) 22 | 23 | export default Header -------------------------------------------------------------------------------- /src/components/Header/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Header' -------------------------------------------------------------------------------- /src/components/LabelledValue/LabelledValue.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | import { withTheme } from '@material-ui/core/styles' 4 | 5 | const StyledLabelledValue = styled.div` 6 | display: flex; 7 | flex-direction: column; 8 | ` 9 | const StyledLabel = withTheme(styled.span` 10 | color: ${props => props.theme.palette.grey[500]}; 11 | font-size: 16px; 12 | font-weight: 400; 13 | line-height: 1rem; 14 | margin-top: 0.25em; 15 | `) 16 | const StyledValue = withTheme(styled.h3` 17 | font-size: 1em; 18 | font-weight: 400; 19 | font-family: Arial; 20 | margin: 0; 21 | padding: 0; 22 | `) 23 | 24 | const LabelledValue = ({ label, value }) => ( 25 | 26 | {value} 27 | {label} 28 | 29 | ) 30 | 31 | export default LabelledValue -------------------------------------------------------------------------------- /src/components/LabelledValue/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './LabelledValue' -------------------------------------------------------------------------------- /src/components/Loader/Loader.js: -------------------------------------------------------------------------------- 1 | import LinearProgress from '@material-ui/core/LinearProgress' 2 | import { withStyles } from '@material-ui/core/styles' 3 | 4 | const styles = theme => ({ 5 | colorPrimary: { 6 | backgroundColor: theme.palette.primary.dark, 7 | }, 8 | barColorPrimary: { 9 | backgroundColor: theme.palette.primary.light, 10 | }, 11 | }) 12 | 13 | const ColorLinearProgress = withStyles(styles)(LinearProgress) 14 | 15 | export default ColorLinearProgress -------------------------------------------------------------------------------- /src/components/Loader/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Loader' -------------------------------------------------------------------------------- /src/components/Logo/Logo.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | 4 | import logo from '../../assets/logo.png' 5 | 6 | const StyledLogo = styled.div` 7 | align-items: center; 8 | display: flex; 9 | color: ${props => props.color}; 10 | font-size: 24px; 11 | font-weight: 700; 12 | ` 13 | 14 | const StyledImg = styled.img` 15 | height: 48px; 16 | position: relative; 17 | top: -2px; 18 | ` 19 | 20 | const Logo = ({ color = "#FFF" }) => ( 21 | 22 | 23 |
24 | Shell Protocol 25 | 26 | ) 27 | 28 | export default Logo -------------------------------------------------------------------------------- /src/components/Logo/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Logo' -------------------------------------------------------------------------------- /src/components/Modal/Modal.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled, { keyframes } from 'styled-components' 3 | 4 | import Surface from '../Surface' 5 | 6 | const contentKeyframes = keyframes` 7 | from { 8 | opacity: 0; 9 | transform: translateY(64px); 10 | } 11 | to { 12 | opacity: 1; 13 | transform: translateY(0px); 14 | } 15 | ` 16 | 17 | const StyledModal = styled.div` 18 | align-items: center; 19 | display: flex; 20 | justify-content: center; 21 | text-align: center; 22 | position: fixed; 23 | top: 0; right: 0; bottom: 0; left: 0; 24 | z-index: 100; 25 | ` 26 | 27 | const StyledModalBg = styled.div` 28 | background-color: rgba(0,0,0,0.5); 29 | position: absolute; 30 | top: 0; right: 0; left: 0; bottom: 0; 31 | ` 32 | 33 | const StyledModalContent = styled.div` 34 | animation: ${contentKeyframes} .2s ease-out; 35 | display: flex; 36 | flex-direction: column; 37 | max-height: calc(100% - 12px); 38 | max-width: 450px; 39 | position: sticky; 40 | width: calc(100% - 12px); 41 | margin: 6px; 42 | ` 43 | 44 | const Modal = ({ children, onDismiss }) => ( 45 | 46 | 47 | 48 | 49 | {children} 50 | 51 | 52 | 53 | ) 54 | 55 | export default Modal -------------------------------------------------------------------------------- /src/components/Modal/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Modal' -------------------------------------------------------------------------------- /src/components/ModalActions/ModalActions.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { withTheme } from '@material-ui/core/styles' 3 | import styled from 'styled-components' 4 | 5 | const StyledModalActions = withTheme(styled.div` 6 | align-items: center; 7 | background-color: ${props => props.theme.palette.grey[50]}; 8 | display: flex; 9 | justify-content: ${props => props.centered ? 'center' : 'flex-end'}; 10 | margin: 0; 11 | min-height: 48px; 12 | padding: 12px 18px; 13 | & > * { 14 | margin-left: 6px; 15 | margin-right: 6px; 16 | } 17 | @media (max-width: 512px) { 18 | padding: 12px; 19 | } 20 | `) 21 | 22 | const ModalActions = ({ centered, children }) => ( 23 | 24 | {children} 25 | 26 | ) 27 | 28 | export default ModalActions -------------------------------------------------------------------------------- /src/components/ModalActions/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './ModalActions' -------------------------------------------------------------------------------- /src/components/ModalAwaitingTx/ModalAwaitingTx.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import config from "../../mainnet.multiple.config.json" 4 | 5 | import styled from 'styled-components' 6 | 7 | import HourglassFullIcon from '@material-ui/icons/HourglassFull' 8 | 9 | import etherscan from '../../assets/etherscan-logo-circle.svg' 10 | 11 | import Loader from '../Loader' 12 | import Modal from '../Modal' 13 | import ModalActions from '../ModalActions' 14 | import ModalIcon from '../ModalIcon' 15 | import ModalTitle from '../ModalTitle' 16 | 17 | const StyledViewOnEtherscan = styled.div` 18 | font-size: 1.3em; 19 | margin-bottom: 30px; 20 | margin-top: 18px; 21 | ` 22 | 23 | const AwaitingTxModal = ({ txHash }) => { 24 | 25 | const etherscanlink = config.network == '42' 26 | ? "https://kovan.etherscan.io/tx/" + txHash 27 | : config.network == '4' 28 | ? "https://rinkeby.etherscan.io/tx/" + txHash 29 | : "https://etherscan.io/tx/" + txHash 30 | 31 | return ( 32 | 33 | Please wait while your transaction confirms 34 | 35 | 36 | 37 | { 38 | txHash ? 39 | 40 | 41 | 42 | View On Etherscan 43 | 44 | 45 | : null 46 | } 47 | 48 |
49 | 50 |
51 |
52 |
53 | ) 54 | } 55 | 56 | export default AwaitingTxModal -------------------------------------------------------------------------------- /src/components/ModalAwaitingTx/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './ModalAwaitingTx' -------------------------------------------------------------------------------- /src/components/ModalConfirm/ModalConfirm.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import metamaskLogo from '../../assets/metamask.svg' 4 | import walletConnectLogo from '../../assets/walletConnectLogo.png' 5 | 6 | import Loader from '../Loader' 7 | import Modal from '../Modal' 8 | import ModalActions from '../ModalActions' 9 | import ModalIcon from '../ModalIcon' 10 | import ModalTitle from '../ModalTitle' 11 | 12 | const ModalConfirm = ({wallet}) => ( 13 | 14 | Confirming with { wallet } 15 | 16 | Wallet Logo 24 | 25 | 26 |
27 | 28 |
29 |
30 |
31 | ) 32 | 33 | export default ModalConfirm -------------------------------------------------------------------------------- /src/components/ModalConfirm/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './ModalConfirm' -------------------------------------------------------------------------------- /src/components/ModalContent/ModalContent.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { withTheme } from '@material-ui/core/styles' 3 | import styled from 'styled-components' 4 | 5 | const StyledModalContent = withTheme(styled.div` 6 | flex: 1; 7 | min-height: 0; 8 | overflow: auto; 9 | padding: 24px; 10 | @media (max-width: 512px) { 11 | padding: 12px; 12 | } 13 | `) 14 | 15 | const ModalContent = ({ children }) => ( 16 | 17 | {children} 18 | 19 | ) 20 | 21 | export default ModalContent -------------------------------------------------------------------------------- /src/components/ModalContent/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './ModalContent' -------------------------------------------------------------------------------- /src/components/ModalError/ModalError.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import config from "../../mainnet.multiple.config.json" 4 | 5 | import styled from 'styled-components' 6 | 7 | import WarningIcon from '@material-ui/icons/Warning' 8 | 9 | import etherscan from '../../assets/etherscan-logo-circle.svg' 10 | 11 | import Button from '../Button' 12 | import Modal from '../Modal' 13 | import ModalActions from '../ModalActions' 14 | import ModalIcon from '../ModalIcon' 15 | import ModalTitle from '../ModalTitle' 16 | 17 | const StyledViewOnEtherscan = styled.div` 18 | font-size: 1.3em; 19 | margin-bottom: 30px; 20 | margin-top: 18px; 21 | ` 22 | 23 | const ModalError = ({ 24 | txHash, 25 | buttonBlurb, 26 | onDismiss, 27 | title 28 | }) => { 29 | 30 | 31 | const etherscanlink = config.network == '42' 32 | ? "https://kovan.etherscan.io/tx/" + txHash 33 | : config.network == '4' 34 | ? "https://rinkeby.etherscan.io/tx/" + txHash 35 | : "https://etherscan.io/tx/" + txHash 36 | 37 | return ( 38 | 39 | {title} 40 | 41 | 42 | 43 | { 44 | txHash ? 45 | 46 | 47 | 48 | View On Etherscan 49 | 50 | 51 | : null 52 | } 53 | 54 | 55 | 56 | 57 | ) 58 | } 59 | 60 | export default ModalError -------------------------------------------------------------------------------- /src/components/ModalError/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './ModalError' -------------------------------------------------------------------------------- /src/components/ModalIcon/ModalIcon.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { withTheme } from '@material-ui/core/styles' 3 | import styled from 'styled-components' 4 | 5 | const StyledModalIcon = withTheme(styled.div` 6 | align-items: center; 7 | background: ${props => props.theme.palette.grey[50]}; 8 | border-radius: 64px; 9 | display: flex; 10 | height: 128px; 11 | justify-content: center; 12 | margin: 0 auto 24px; 13 | width: 128px; 14 | & > * { 15 | font-size: 48px !important; 16 | } 17 | `) 18 | 19 | const ModalIcon = ({ children }) => ( 20 | 21 | {children} 22 | 23 | ) 24 | 25 | export default ModalIcon -------------------------------------------------------------------------------- /src/components/ModalIcon/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './ModalIcon' -------------------------------------------------------------------------------- /src/components/ModalSuccess/ModalSuccess.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import config from "../../mainnet.multiple.config" 4 | 5 | import styled from 'styled-components' 6 | 7 | import etherscan from '../../assets/etherscan-logo-circle.svg' 8 | 9 | import DoneIcon from '@material-ui/icons/Done' 10 | 11 | import Button from '../Button' 12 | import Modal from '../Modal' 13 | import ModalActions from '../ModalActions' 14 | import ModalIcon from '../ModalIcon' 15 | import ModalTitle from '../ModalTitle' 16 | 17 | const StyledViewOnEtherscan = styled.div` 18 | font-size: 1.3em; 19 | margin-bottom: 30px; 20 | margin-top: 18px; 21 | ` 22 | 23 | const ModalSuccess = ({ 24 | buttonBlurb, 25 | onDismiss, 26 | title, 27 | txHash 28 | }) => { 29 | 30 | const etherscanlink = config.network == '42' 31 | ? "https://kovan.etherscan.io/tx/" + txHash 32 | : config.network == '4' 33 | ? "https://rinkeby.etherscan.io/tx/" + txHash 34 | : "https://etherscan.io/tx/" + txHash 35 | 36 | return ( 37 | 38 | {title} 39 | 40 | 41 | 42 | { 43 | txHash ? 44 | 45 | 46 | 47 | View On Etherscan 48 | 49 | 50 | : null 51 | } 52 | 53 | 54 | 55 | 56 | ) 57 | } 58 | 59 | export default ModalSuccess -------------------------------------------------------------------------------- /src/components/ModalSuccess/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './ModalSuccess' -------------------------------------------------------------------------------- /src/components/ModalTitle/ModalTitle.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { withTheme } from '@material-ui/core/styles' 3 | import styled from 'styled-components' 4 | 5 | const StyledModalTitle = withTheme(styled.div` 6 | font-size: 1.75rem; 7 | margin-bottom: 24px; 8 | margin-top: 24px; 9 | padding: 0 24px; 10 | `) 11 | 12 | const ModalTitle = ({ children }) => ( 13 | 14 | {children} 15 | 16 | ) 17 | 18 | export default ModalTitle -------------------------------------------------------------------------------- /src/components/ModalTitle/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './ModalTitle' -------------------------------------------------------------------------------- /src/components/ModalUnlock/ModalUnlock.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { useState } from 'react' 3 | import styled from 'styled-components' 4 | import { makeStyles, withTheme } from '@material-ui/core/styles' 5 | import Checkbox from "@material-ui/core/Checkbox" 6 | import TextField from '@material-ui/core/TextField' 7 | import NumberFormat from 'react-number-format' 8 | 9 | import Button from '../Button' 10 | import Modal from '../Modal' 11 | import ModalActions from '../ModalActions' 12 | 13 | import BigNumber from 'bignumber.js' 14 | 15 | const MAX = '115792089237316195423570985008687907853269984665640564039457584007913129639935' 16 | 17 | const ModalContent = withTheme(styled.div` 18 | flex: 1; 19 | padding: 0px 40px 20px; 20 | margin-top: -10px; 21 | font-size: 24px; 22 | `) 23 | 24 | const ModalTitle = withTheme(styled.div` 25 | font-size: 1.75rem; 26 | margin-bottom: 6px; 27 | margin-top: 24px; 28 | padding: 0 24px; 29 | `) 30 | 31 | const UnlimitedCheckbox = styled.div` 32 | position: relative; 33 | height: 25px; 34 | padding: 20px; 35 | & .MuiIconButton-root { 36 | position: relative; 37 | top: 0px; 38 | right: 0px; 39 | } 40 | ` 41 | 42 | const ModalUnlock = ({ 43 | coin, 44 | handleUnlock, 45 | handleCancel 46 | }) => { 47 | 48 | const [ amount, setAmount ] = useState('') 49 | const [ unlimited, setUnlimited ] = useState(false) 50 | 51 | const checkboxClasses = makeStyles({ 52 | root: { 53 | '& .MuiSvgIcon-root': { 54 | color: 'rgba(0, 0, 0, 0.54)', 55 | fontSize: '1.65em' 56 | }, 57 | color: 'rgba(0, 0, 0, 0.54)', 58 | padding: 'none' 59 | } 60 | }, { name: 'MuiCheckbox' })() 61 | 62 | const decimals = coin.get('decimals') 63 | 64 | let current = coin.getIn(['allowance', 'numeraire']) 65 | 66 | const approveToZero = coin.get('approveToZero') && !current.isZero() 67 | 68 | if ( current.isGreaterThan(new BigNumber('100000000'))) { 69 | current = '100,000,000+' 70 | } else if ( current.isGreaterThan(new BigNumber(10000000))) { 71 | current = current.toExponential() 72 | } else { 73 | current = coin.getIn(['allowance', 'display']) 74 | } 75 | 76 | const symbol = coin.get('symbol') 77 | 78 | return ( 79 | 80 | 81 | { coin.getIn(['allowance', 'numeraire']).isZero() ? 'Unlock ' : 'Change Allowance For ' } 82 | { symbol } 83 | 84 | 85 |

Shell's current allowance is { current }

86 | { approveToZero 87 | ?

You must set {symbol}'s allowance to zero before adjusting it to something else.

88 | : null } 89 | setAmount(payload.value) } 98 | /> 99 | { !approveToZero 100 | ? 101 | ( setAmount(''), setUnlimited(!unlimited) ) } 105 | /> 106 | Unlimited Approval 107 | 108 | : null } 109 |
110 | 111 | 112 | 116 | 117 |
118 | ) 119 | 120 | } 121 | 122 | export default ModalUnlock 123 | -------------------------------------------------------------------------------- /src/components/ModalUnlock/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './ModalUnlock' -------------------------------------------------------------------------------- /src/components/Overview/Overview.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | import { withTheme } from '@material-ui/core/styles' 4 | 5 | const StyledOverview = withTheme(styled.div` 6 | align-items: center; 7 | border-radius: ${props => props.theme.shape.borderRadius}px; 8 | display: flex; 9 | flex: 1; 10 | font-size: 36px; 11 | justify-content: space-between; 12 | margin: 24px; 13 | padding: 24px 0; 14 | @media (max-width: 512px) { 15 | margin: 24px 0; 16 | padding: 12px 0; 17 | } 18 | `) 19 | 20 | const Overview = ({ children }) => ( 21 | 22 | {children} 23 | 24 | ) 25 | 26 | export default Overview -------------------------------------------------------------------------------- /src/components/Overview/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Overview' -------------------------------------------------------------------------------- /src/components/OverviewSection/OverviewSection.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | import { withTheme } from '@material-ui/core/styles' 4 | 5 | const StyledOverviewSection = withTheme(styled.div` 6 | border-right: 1px solid ${props => props.theme.palette.grey[50]}; 7 | flex: 1; 8 | text-align: center; 9 | &:last-of-type { 10 | border-right: 0; 11 | } 12 | `) 13 | 14 | const OverviewSection = ({ children }) => ( 15 | 16 | {children} 17 | 18 | ) 19 | 20 | export default OverviewSection -------------------------------------------------------------------------------- /src/components/OverviewSection/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './OverviewSection' -------------------------------------------------------------------------------- /src/components/Row/Row.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | import { withTheme } from'@material-ui/core/styles' 4 | 5 | const StyledRow = withTheme(styled.div` 6 | align-items: center; 7 | border-top: ${props => props.hideBorder ? 0 : `1px solid ${props.theme.palette.grey[50]}`}; 8 | color: ${props => props.head ? props.theme.palette.grey[500] : 'inherit'}; 9 | display: flex; 10 | font-weight: ${props => props.head ? 500 : 400}; 11 | height: ${props => props.head ? 40 : 80}px; 12 | margin: 0; 13 | padding: 0 24px; 14 | @media (max-width: 512px) { 15 | height: ${props => props.head ? 26 : 65}px; 16 | padding: 0 12px; 17 | } 18 | `) 19 | 20 | const Row = ({ children, onClick, onMouseOver, onMouseOut, head, hideBorder, ref, style }) => ( 21 | 29 | {children} 30 | 31 | ) 32 | 33 | export default Row -------------------------------------------------------------------------------- /src/components/Row/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Row' -------------------------------------------------------------------------------- /src/components/Surface/Surface.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | 4 | const StyledSurface = styled.div` 5 | background: #FFF; 6 | border-radius: 12px; 7 | display: flex; 8 | flex-direction: column; 9 | overflow: hidden; 10 | ` 11 | 12 | const Surface = ({ children }) => ( 13 | 14 | {children} 15 | 16 | ) 17 | 18 | export default Surface -------------------------------------------------------------------------------- /src/components/Surface/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Surface' -------------------------------------------------------------------------------- /src/components/Tab/Tab.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | 4 | const StyledTab = styled.div` 5 | align-items: center; 6 | background: ${props => props.active ? '#FFF' : 'transparent'}; 7 | color: ${props => props.active ? '#0043ff' : '#000'}; 8 | cursor: pointer; 9 | display: flex; 10 | flex: 1; 11 | font-weight: 700; 12 | height: 72px; 13 | font-size: 18px; 14 | justify-content: center; 15 | opacity: ${props => props.active ? 1 : 0.5}; 16 | pointer-events: ${props => props.disabled ? 'none' : 'all'}; 17 | &:hover { 18 | opacity: 1; 19 | } 20 | ` 21 | 22 | const Tab = ({ active, children, disabled, onClick }) => ( 23 | 24 | {children} 25 | 26 | ) 27 | 28 | export default Tab -------------------------------------------------------------------------------- /src/components/Tab/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Tab' -------------------------------------------------------------------------------- /src/components/Tabs/Tabs.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | import { withTheme } from '@material-ui/core/styles' 4 | 5 | const StyledTabs = withTheme(styled.div` 6 | align-items: center; 7 | background-color: ${props => props.theme.palette.grey[50]}; 8 | display: flex; 9 | `) 10 | 11 | const Tabs = ({ children }) => ( 12 | 13 | {children} 14 | 15 | ) 16 | 17 | export default Tabs -------------------------------------------------------------------------------- /src/components/Tabs/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './Tabs' -------------------------------------------------------------------------------- /src/components/TokenIcon/TokenIcon.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import styled from 'styled-components' 3 | 4 | const StyledTokenIcon = styled.div` 5 | align-items: center; 6 | display: flex; 7 | height: ${props => props.size}px; 8 | justify-content: center; 9 | width: ${props => props.size}px; 10 | & > * { 11 | height:100%; 12 | } 13 | ` 14 | 15 | const TokenIcon = ({ children, color, size = 36 }) => ( 16 | 17 | {children} 18 | 19 | ) 20 | 21 | export default TokenIcon -------------------------------------------------------------------------------- /src/components/TokenIcon/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './TokenIcon' -------------------------------------------------------------------------------- /src/components/icons/Dai.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const Dai = ({ size = 24 }) => ( 4 | 10 | 11 | 17 | 18 | ) 19 | 20 | export default Dai -------------------------------------------------------------------------------- /src/components/icons/Usdc.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const Usdc = ({ size = 24 }) => ( 4 | 10 | 14 | 18 | 22 | 26 | 27 | ) 28 | 29 | export default Usdc -------------------------------------------------------------------------------- /src/containers/withWallet.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react' 2 | 3 | import { Map } from 'immutable' 4 | 5 | import Web3 from 'web3' 6 | import Onboard from 'bnc-onboard' 7 | 8 | import config from "../mainnet.multiple.config.json" 9 | 10 | import Engine from '../utils/Engine' 11 | 12 | let web3 13 | let onboard 14 | let engine 15 | let network 16 | let address 17 | let syncer 18 | 19 | const withWallet = (WrappedComponent) => { 20 | 21 | return (props) => { 22 | 23 | const [state, setState] = useState(Map({})) 24 | 25 | const [loggedIn, setLoggedIn] = useState(false) 26 | 27 | const [walletSelected, setWalletSelected] = useState(true) 28 | 29 | const selectWallet = async () => { 30 | 31 | const walletSelected = await onboard.walletSelect(); 32 | 33 | if (walletSelected) { 34 | 35 | const walletChecked = await onboard.walletCheck(); 36 | 37 | if (!walletChecked) { 38 | 39 | selectWallet() 40 | 41 | } else { 42 | 43 | setLoggedIn(true) 44 | 45 | } 46 | 47 | } else { 48 | 49 | selectWallet() 50 | 51 | } 52 | 53 | } 54 | 55 | // init application 56 | useEffect(() => { 57 | 58 | init() 59 | 60 | async function init () { 61 | 62 | onboard = Onboard({ 63 | dappId: config.blocknative, // [String] The API key created by step one above 64 | networkId: config.network, // [Integer] The Ethereum network ID your Dapp uses. 65 | subscriptions: { 66 | address: async _address => { 67 | 68 | address = _address 69 | 70 | if (!_address) { 71 | 72 | return await selectWallet() 73 | 74 | } else if (network == config.network) { 75 | 76 | engine = engine ? engine : new Engine(web3, setState) 77 | 78 | engine.sync(address) 79 | 80 | if (!syncer) syncer = setInterval(() => engine.sync(), 7500) 81 | 82 | } 83 | 84 | }, 85 | network: async _network => { 86 | 87 | network = _network 88 | 89 | if (address && _network == config.network) { 90 | 91 | engine = engine ? engine : new Engine(web3, setState) 92 | 93 | engine.sync(address) 94 | 95 | if (!syncer) syncer = setInterval(() => engine.sync(address), 7500) 96 | 97 | } else if (_network != config.network) { 98 | 99 | selectWallet() 100 | 101 | } 102 | 103 | }, 104 | wallet: async wallet => { 105 | 106 | if (wallet.name == undefined) return 107 | 108 | web3 = new Web3(wallet.provider) 109 | 110 | engine = new Engine(web3, setState) 111 | 112 | engine.wallet = wallet.name 113 | 114 | }, 115 | }, 116 | walletSelect: { 117 | wallets: [ 118 | { walletName: "metamask", preferred: true }, 119 | { walletName: "walletConnect", preferred: true, infuraKey: config.infuraKey }, 120 | ] 121 | } 122 | }); 123 | } 124 | 125 | selectWallet() 126 | 127 | }, []) 128 | 129 | return ( 130 | <> 131 | 142 | 143 | ) 144 | } 145 | } 146 | 147 | export default withWallet 148 | -------------------------------------------------------------------------------- /src/fonts/geomanist-book-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/fonts/geomanist-book-webfont.eot -------------------------------------------------------------------------------- /src/fonts/geomanist-book-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/fonts/geomanist-book-webfont.ttf -------------------------------------------------------------------------------- /src/fonts/geomanist-book-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/fonts/geomanist-book-webfont.woff -------------------------------------------------------------------------------- /src/fonts/geomanist-book-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/fonts/geomanist-book-webfont.woff2 -------------------------------------------------------------------------------- /src/fonts/geomanist-medium-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/fonts/geomanist-medium-webfont.eot -------------------------------------------------------------------------------- /src/fonts/geomanist-medium-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/fonts/geomanist-medium-webfont.ttf -------------------------------------------------------------------------------- /src/fonts/geomanist-medium-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/fonts/geomanist-medium-webfont.woff -------------------------------------------------------------------------------- /src/fonts/geomanist-medium-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/fonts/geomanist-medium-webfont.woff2 -------------------------------------------------------------------------------- /src/fonts/geomanist-regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/fonts/geomanist-regular-webfont.eot -------------------------------------------------------------------------------- /src/fonts/geomanist-regular-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/fonts/geomanist-regular-webfont.ttf -------------------------------------------------------------------------------- /src/fonts/geomanist-regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/fonts/geomanist-regular-webfont.woff -------------------------------------------------------------------------------- /src/fonts/geomanist-regular-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cowri/shell-frontend/f0347c6f7e7b6637849a1be95b7baad47a16c266/src/fonts/geomanist-regular-webfont.woff2 -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | @font-face { 4 | font-family: 'Geomanist'; 5 | src: local('Geomanist'), url(./fonts/geomanist-book-webfont.ttf) format('truetype'); 6 | } 7 | 8 | .number { 9 | font-family: Arial; 10 | } 11 | 12 | body { 13 | background-color: #f0f4f8; 14 | color: #00010f; 15 | margin: 0; 16 | font-size: 16px; 17 | font-family: Geomanist; 18 | -webkit-font-smoothing: antialiased; 19 | -moz-osx-font-smoothing: grayscale; 20 | } 21 | 22 | code { 23 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 24 | monospace; 25 | } 26 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import './index.css' 4 | import App from './App' 5 | 6 | import './fonts/geomanist-regular-webfont.ttf' 7 | 8 | ReactDOM.render( 9 | 10 | 11 | , 12 | document.getElementById('root') 13 | ) -------------------------------------------------------------------------------- /src/kovan.multiple.aave.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultWeb3Provider": "kovan.infura.io/v3/23656e31a1a34049bc03807c64bcd017", 3 | "infuraKey": "23656e31a1a34049bc03807c64bcd017", 4 | "blocknative": "9bb42eeb-6448-414d-94ee-6f91b875fd2d", 5 | "network": 42, 6 | "shells": [ 7 | { 8 | "shell": "0x6ed9874c64cf39c7f070296c80959947b016b3af", 9 | "name": "30% Dai 30% USDt 30% USDc 10% sUSD", 10 | "displayDecimals": 2, 11 | "swapDecimals": 2, 12 | "assets": [ 13 | { 14 | "address": "0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD", 15 | "decimals": 18, 16 | "icon": "dai.svg", 17 | "name": "MultiCollateral Dai", 18 | "symbol": "DAI", 19 | "type": "ERC20", 20 | "weight": ".3", 21 | "derivatives": [ 22 | { 23 | "address": "0x58AD4cB396411B691A9AAb6F74545b2C5217FE6a", 24 | "decimals": 18, 25 | "icon": "adai.svg", 26 | "name": "Aave Interest Bearing Dai", 27 | "symbol": "aDAI", 28 | "type": "aERC20" 29 | } 30 | ] 31 | }, 32 | { 33 | "address": "0xe22da380ee6B445bb8273C81944ADEB6E8450422", 34 | "decimals": 6, 35 | "icon": "usdc.svg", 36 | "name": "USD Coin", 37 | "symbol": "USDC", 38 | "type": "ERC20", 39 | "weight": ".3", 40 | "derivatives": [ 41 | { 42 | "address": "0x02F626c6ccb6D2ebC071c068DC1f02Bf5693416a", 43 | "decimals": 6, 44 | "icon": "ausdc.svg", 45 | "name": "Aave Interest Bearing USDC", 46 | "symbol": "aUSDC", 47 | "type": "aERC20" 48 | } 49 | ] 50 | }, 51 | { 52 | "address": "0x13512979ADE267AB5100878E2e0f485B568328a4", 53 | "decimals": 6, 54 | "icon": "usdt.svg", 55 | "name": "Tether Stablecoin", 56 | "symbol": "USDT", 57 | "type": "ERC20", 58 | "weight": ".3", 59 | "derivatives": [ 60 | { 61 | "address": "0xA01bA9fB493b851F4Ac5093A324CB081A909C34B", 62 | "decimals": 6, 63 | "icon": "ausdt.svg", 64 | "name": "Aave Interest Bearing USDT", 65 | "symbol": "aUSDT", 66 | "type": "aERC20" 67 | } 68 | ] 69 | }, 70 | { 71 | "address": "0xD868790F57B39C9B2B51b12de046975f986675f9", 72 | "decimals": 6, 73 | "icon": "susd.svg", 74 | "name": "Synthetix USD", 75 | "symbol": "SUSD", 76 | "type": "ERC20", 77 | "weight": ".1", 78 | "derivatives": [ 79 | { 80 | "address": "0xb9c1434aB6d5811D1D0E92E8266A37Ae8328e901", 81 | "decimals": 6, 82 | "icon": "asusd.svg", 83 | "name": "Aave Interest Bearing sUSD", 84 | "symbol": "aSUSD", 85 | "type": "aERC20" 86 | } 87 | ] 88 | } 89 | ], 90 | "params": { 91 | "alpha": ".9", 92 | "beta": ".75", 93 | "delta": ".5", 94 | "epsilon": ".00035", 95 | "lambda": ".9" 96 | } 97 | }, 98 | { 99 | "shell": "0xd23843013EEE74f80e38aC508bac697700a274A5", 100 | "name": "70% wBTC 30% renBTC", 101 | "displayDecimals": 4, 102 | "swapDecimals": 8, 103 | "assets": [ 104 | { 105 | "address": "0xCc0b1D0690776d894bb5B6b3d86C20e56125106B", 106 | "decimals": 8, 107 | "icon": "wbtc.svg", 108 | "name": "Wrapped BTC", 109 | "symbol": "wBTC", 110 | "type": "ERC20", 111 | "weight": ".7", 112 | "derivatives": [ ] 113 | }, 114 | { 115 | "address": "0xba9d8223398C61cef238b94102507501EFBF2d3E", 116 | "decimals": 8, 117 | "icon": "renbtc.svg", 118 | "name": "renBTC", 119 | "symbol": "renBTC", 120 | "type": "ERC20", 121 | "weight": ".3", 122 | "derivatives": [ ] 123 | } 124 | ], 125 | "params": { 126 | "alpha": ".9", 127 | "beta": ".6", 128 | "delta": ".1", 129 | "epsilon": ".00035", 130 | "lambda": "1" 131 | } 132 | }, 133 | { 134 | "shell": "0xf1d6e35501a27618d3ac0174db7e310e211d50e6", 135 | "name": "50% wBTC 40% renBTC 10% sBTC", 136 | "displayDecimals": 4, 137 | "swapDecimals": 8, 138 | "assets": [ 139 | { 140 | "address": "0xCc0b1D0690776d894bb5B6b3d86C20e56125106B", 141 | "decimals": 8, 142 | "icon": "wbtc.svg", 143 | "name": "Wrapped BTC", 144 | "symbol": "wBTC", 145 | "type": "ERC20", 146 | "weight": ".5", 147 | "derivatives": [ ] 148 | }, 149 | { 150 | "address": "0xba9d8223398C61cef238b94102507501EFBF2d3E", 151 | "decimals": 8, 152 | "icon": "renbtc.svg", 153 | "name": "renBTC", 154 | "symbol": "renBTC", 155 | "type": "ERC20", 156 | "weight": ".4", 157 | "derivatives": [ ] 158 | }, 159 | { 160 | "address": "0xCE18d20A5EAE16573AD8bed2a07e2E76Fee5a3dA", 161 | "decimals": 18, 162 | "icon": "sbtc.svg", 163 | "name": "Synth sBTC", 164 | "symbol": "sBTC", 165 | "type": "ERC20", 166 | "weight": ".1", 167 | "derivatives": [ ] 168 | } 169 | ], 170 | "params": { 171 | "alpha": ".9", 172 | "beta": ".6", 173 | "delta": ".1", 174 | "epsilon": ".00035", 175 | "lambda": "1" 176 | } 177 | } 178 | ] 179 | } -------------------------------------------------------------------------------- /src/kovan.multiple.compound.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultWeb3Provider": "kovan.infura.io/v3/23656e31a1a34049bc03807c64bcd017", 3 | "infuraKey": "23656e31a1a34049bc03807c64bcd017", 4 | "blocknative": "9bb42eeb-6448-414d-94ee-6f91b875fd2d", 5 | "network": 42, 6 | "shells": [ 7 | { 8 | "shell": "0x92003f3f84fde0574a5ec3058b985d4e9f8e9c8a", 9 | "name": "30% Dai 30% USDt 30% USDc 10% sUSD", 10 | "displayDecimals": 2, 11 | "swapDecimals": 2, 12 | "tag": "STABLECOIN1", 13 | "assets": [ 14 | { 15 | "address": "0x4F96Fe3b7A6Cf9725f59d353F723c1bDb64CA6Aa", 16 | "decimals": 18, 17 | "icon": "dai.svg", 18 | "name": "MultiCollateral Dai", 19 | "symbol": "DAI", 20 | "type": "ERC20", 21 | "weight": ".3", 22 | "derivatives": [ ] 23 | }, 24 | { 25 | "address": "0xb7a4F3E9097C08dA09517b5aB877F7a917224ede", 26 | "decimals": 6, 27 | "icon": "usdc.svg", 28 | "name": "USD Coin", 29 | "symbol": "USDC", 30 | "type": "ERC20", 31 | "weight": ".3", 32 | "derivatives": [ ] 33 | }, 34 | { 35 | "address": "0x07de306FF27a2B630B1141956844eB1552B956B5", 36 | "decimals": 6, 37 | "icon": "usdt.svg", 38 | "name": "Tether Stablecoin", 39 | "symbol": "USDT", 40 | "type": "ERC20", 41 | "weight": ".3", 42 | "approveToZero": true, 43 | "derivatives": [ ] 44 | }, 45 | { 46 | "address": "0xD868790F57B39C9B2B51b12de046975f986675f9", 47 | "decimals": 6, 48 | "icon": "susd.svg", 49 | "name": "Synthetix USD", 50 | "symbol": "SUSD", 51 | "type": "ERC20", 52 | "weight": ".1", 53 | "derivatives": [ ] 54 | } 55 | ], 56 | "params": { 57 | "alpha": ".95", 58 | "beta": ".45", 59 | "delta": ".05", 60 | "epsilon": ".00035", 61 | "lambda": "1" 62 | } 63 | }, 64 | { 65 | "shell": "0xbfdf3de4bb6d709b225f88608d6a71535aeac4c8", 66 | "name": "50% wBTC 40% renBTC 10% sBTC", 67 | "displayDecimals": 4, 68 | "swapDecimals": 8, 69 | "tag": "BTC1", 70 | "assets": [ 71 | { 72 | "address": "0xCc0b1D0690776d894bb5B6b3d86C20e56125106B", 73 | "decimals": 8, 74 | "icon": "wbtc.svg", 75 | "name": "Wrapped BTC", 76 | "symbol": "wBTC", 77 | "type": "ERC20", 78 | "weight": ".5", 79 | "derivatives": [ ] 80 | }, 81 | { 82 | "address": "0xba9d8223398C61cef238b94102507501EFBF2d3E", 83 | "decimals": 8, 84 | "icon": "renbtc.svg", 85 | "name": "renBTC", 86 | "symbol": "renBTC", 87 | "type": "ERC20", 88 | "weight": ".4", 89 | "derivatives": [ ] 90 | }, 91 | { 92 | "address": "0xCE18d20A5EAE16573AD8bed2a07e2E76Fee5a3dA", 93 | "decimals": 18, 94 | "icon": "sbtc.svg", 95 | "name": "Synth sBTC", 96 | "symbol": "sBTC", 97 | "type": "ERC20", 98 | "weight": ".1", 99 | "derivatives": [ ] 100 | } 101 | ], 102 | "params": { 103 | "alpha": ".95", 104 | "beta": ".45", 105 | "delta": ".05", 106 | "epsilon": ".00035", 107 | "lambda": "1" 108 | } 109 | } 110 | ] 111 | } -------------------------------------------------------------------------------- /src/kovan.one.dai.usdc.usdt.susd.atokens.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultWeb3Provider": "kovan.infura.io/v3/23656e31a1a34049bc03807c64bcd017", 3 | "infuraKey": "23656e31a1a34049bc03807c64bcd017", 4 | "blocknative": "9bb42eeb-6448-414d-94ee-6f91b875fd2d", 5 | "network": 42, 6 | "displayDecimals": 2, 7 | "swapDecimals": 2, 8 | "assets": [ 9 | { 10 | "address": "0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD", 11 | "decimals": 18, 12 | "icon": "dai.svg", 13 | "name": "MultiCollateral Dai", 14 | "symbol": "DAI", 15 | "type": "ERC20", 16 | "weight": ".3", 17 | "derivatives": [ 18 | { 19 | "address": "0x58AD4cB396411B691A9AAb6F74545b2C5217FE6a", 20 | "decimals": 18, 21 | "icon": "adai.svg", 22 | "name": "Aave Interest Bearing Dai", 23 | "symbol": "aDAI", 24 | "type": "aERC20" 25 | } 26 | ] 27 | }, 28 | { 29 | "address": "0xe22da380ee6B445bb8273C81944ADEB6E8450422", 30 | "decimals": 6, 31 | "icon": "usdc.svg", 32 | "name": "USD Coin", 33 | "symbol": "USDC", 34 | "type": "ERC20", 35 | "weight": ".3", 36 | "derivatives": [ 37 | { 38 | "address": "0x02F626c6ccb6D2ebC071c068DC1f02Bf5693416a", 39 | "decimals": 6, 40 | "icon": "ausdc.svg", 41 | "name": "Aave Interest Bearing USDC", 42 | "symbol": "aUSDC", 43 | "type": "aERC20" 44 | } 45 | ] 46 | }, 47 | { 48 | "address": "0x13512979ADE267AB5100878E2e0f485B568328a4", 49 | "decimals": 6, 50 | "icon": "usdt.svg", 51 | "name": "Tether Stablecoin", 52 | "symbol": "USDT", 53 | "type": "ERC20", 54 | "weight": ".3", 55 | "derivatives": [ 56 | { 57 | "address": "0xA01bA9fB493b851F4Ac5093A324CB081A909C34B", 58 | "decimals": 6, 59 | "icon": "ausdt.svg", 60 | "name": "Aave Interest Bearing USDT", 61 | "symbol": "aUSDT", 62 | "type": "aERC20" 63 | } 64 | ] 65 | }, 66 | { 67 | "address": "0xD868790F57B39C9B2B51b12de046975f986675f9", 68 | "decimals": 6, 69 | "icon": "susd.svg", 70 | "name": "Synthetix USD", 71 | "symbol": "SUSD", 72 | "type": "ERC20", 73 | "weight": ".1", 74 | "derivatives": [ 75 | { 76 | "address": "0xb9c1434aB6d5811D1D0E92E8266A37Ae8328e901", 77 | "decimals": 6, 78 | "icon": "asusd.svg", 79 | "name": "Aave Interest Bearing sUSD", 80 | "symbol": "aSUSD", 81 | "type": "aERC20" 82 | } 83 | ] 84 | } 85 | ], 86 | "shell": "0x6ed9874c64cf39c7f070296c80959947b016b3af", 87 | "params": { 88 | "alpha": ".9", 89 | "beta": ".75", 90 | "delta": ".5", 91 | "epsilon": ".00035", 92 | "lambda": ".9" 93 | } 94 | } -------------------------------------------------------------------------------- /src/kovan.one.dai.usdc.usdt.susd.ctokens.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultWeb3Provider": "kovan.infura.io/v3/23656e31a1a34049bc03807c64bcd017", 3 | "infuraKey": "23656e31a1a34049bc03807c64bcd017", 4 | "blocknative": "9bb42eeb-6448-414d-94ee-6f91b875fd2d", 5 | "network": 42, 6 | "displayDecimals": 2, 7 | "swapDecimals": 2, 8 | "assets": [ 9 | { 10 | "address": "0x4F96Fe3b7A6Cf9725f59d353F723c1bDb64CA6Aa", 11 | "decimals": 18, 12 | "icon": "dai.svg", 13 | "name": "MultiCollateral Dai", 14 | "symbol": "DAI", 15 | "type": "ERC20", 16 | "weight": ".3", 17 | "derivatives": [ 18 | { 19 | "address": "0xf0d0eb522cfa50b716b3b1604c4f0fa6f04376ad", 20 | "decimals": 8, 21 | "icon": "cdai.svg", 22 | "name": "Compound Dai", 23 | "symbol": "cDAI", 24 | "type": "cERC20" 25 | } 26 | ] 27 | }, 28 | { 29 | "address": "0xb7a4F3E9097C08dA09517b5aB877F7a917224ede", 30 | "decimals": 6, 31 | "icon": "usdc.svg", 32 | "name": "USD Coin", 33 | "symbol": "USDC", 34 | "type": "ERC20", 35 | "weight": ".3", 36 | "derivatives": [ 37 | { 38 | "address": "0x4a92e71227d294f041bd82dd8f78591b75140d63", 39 | "decimals": 8, 40 | "icon": "cusdc.svg", 41 | "name": "Compound USD Coin", 42 | "symbol": "cUSDC", 43 | "type": "cERC20" 44 | } 45 | ] 46 | }, 47 | { 48 | "address": "0x07de306FF27a2B630B1141956844eB1552B956B5", 49 | "decimals": 6, 50 | "icon": "usdt.svg", 51 | "name": "Tether Stablecoin", 52 | "symbol": "USDT", 53 | "type": "ERC20", 54 | "weight": ".3", 55 | "derivatives": [ 56 | { 57 | "address": "0x3f0a0ea2f86bae6362cf9799b523ba06647da018", 58 | "decimals": 8, 59 | "icon": "cusdt.svg", 60 | "name": "Compound USDT", 61 | "symbol": "cUSDT", 62 | "type": "cERC20" 63 | } 64 | ] 65 | }, 66 | { 67 | "address": "0xD868790F57B39C9B2B51b12de046975f986675f9", 68 | "decimals": 6, 69 | "icon": "susd.svg", 70 | "name": "Synthetix USD", 71 | "symbol": "SUSD", 72 | "type": "ERC20", 73 | "weight": ".1", 74 | "derivatives": [ 75 | { 76 | "address": "0xb9c1434aB6d5811D1D0E92E8266A37Ae8328e901", 77 | "decimals": 6, 78 | "icon": "asusd.svg", 79 | "name": "Aave Interest Bearing sUSD", 80 | "symbol": "aSUSD", 81 | "type": "aERC20" 82 | } 83 | ] 84 | } 85 | ], 86 | "shell": "0x570486348ac0d48995464c28e4c4d756288ccdd5", 87 | "params": { 88 | "alpha": ".9", 89 | "beta": ".75", 90 | "delta": ".5", 91 | "epsilon": ".00035", 92 | "lambda": ".9" 93 | } 94 | } -------------------------------------------------------------------------------- /src/kovan.two.wbtc.renbtc.sbtc.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultWeb3Provider": "kovan.infura.io/v3/23656e31a1a34049bc03807c64bcd017", 3 | "infuraKey": "23656e31a1a34049bc03807c64bcd017", 4 | "blocknative": "9bb42eeb-6448-414d-94ee-6f91b875fd2d", 5 | "network": 42, 6 | "displayDecimals": 4, 7 | "swapDecimals": 8, 8 | "assets": [ 9 | { 10 | "address": "0xCc0b1D0690776d894bb5B6b3d86C20e56125106B", 11 | "decimals": 8, 12 | "icon": "wbtc.svg", 13 | "name": "Wrapped BTC", 14 | "symbol": "WBTC", 15 | "type": "ERC20", 16 | "weight": ".5", 17 | "derivatives": [ ] 18 | }, 19 | { 20 | "address": "0xba9d8223398C61cef238b94102507501EFBF2d3E", 21 | "decimals": 8, 22 | "icon": "renbtc.svg", 23 | "name": "renBTC", 24 | "symbol": "renBTC", 25 | "type": "ERC20", 26 | "weight": ".4", 27 | "derivatives": [ ] 28 | }, 29 | { 30 | "address": "0xCE18d20A5EAE16573AD8bed2a07e2E76Fee5a3dA", 31 | "decimals": 18, 32 | "icon": "sbtc.svg", 33 | "name": "Synth sBTC", 34 | "symbol": "sBTC", 35 | "type": "ERC20", 36 | "weight": ".1", 37 | "derivatives": [ ] 38 | } 39 | ], 40 | "shell": "0xf1d6e35501a27618d3ac0174db7e310e211d50e6", 41 | "params": { 42 | "alpha": ".9", 43 | "beta": ".6", 44 | "delta": ".1", 45 | "epsilon": ".00035", 46 | "lambda": "1" 47 | } 48 | } -------------------------------------------------------------------------------- /src/mainnet.multiple.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultWeb3Provider": "https://mainnet.infura.io/v3/23656e31a1a34049bc03807c64bcd017", 3 | "infuraKey": "23656e31a1a34049bc03807c64bcd017", 4 | "blocknative": "9bb42eeb-6448-414d-94ee-6f91b875fd2d", 5 | "network": 1, 6 | "shells": [ 7 | { 8 | "shell": "0x8f26D7bAB7a73309141A291525C965EcdEa7Bf42", 9 | "name": "30% Dai 30% USDt 30% USDc 10% sUSD", 10 | "displayDecimals": 2, 11 | "swapDecimals": 2, 12 | "tag": "STABLECOIN1", 13 | "hideapy": true, 14 | "assets": [ 15 | { 16 | "address": "0x6B175474E89094C44Da98b954EedeAC495271d0F", 17 | "decimals": 18, 18 | "icon": "dai.svg", 19 | "name": "MultiCollateral Dai", 20 | "symbol": "DAI", 21 | "weight": ".3", 22 | "derivatives": [ ] 23 | }, 24 | { 25 | "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", 26 | "decimals": 6, 27 | "icon": "usdc.svg", 28 | "name": "USD Coin", 29 | "symbol": "USDC", 30 | "weight": ".3", 31 | "derivatives": [ ] 32 | }, 33 | { 34 | "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", 35 | "decimals": 6, 36 | "icon": "usdt.svg", 37 | "name": "Tether Stablecoin", 38 | "symbol": "USDT", 39 | "weight": ".3", 40 | "approveToZero": true, 41 | "derivatives": [ ] 42 | }, 43 | { 44 | "address": "0x57Ab1ec28D129707052df4dF418D58a2D46d5f51", 45 | "decimals": 18, 46 | "icon": "susd.svg", 47 | "name": "Synthetix USD", 48 | "symbol": "SUSD", 49 | "weight": ".1", 50 | "derivatives": [ ] 51 | } 52 | ], 53 | "params": { 54 | "alpha": ".95", 55 | "beta": ".45", 56 | "delta": ".05", 57 | "epsilon": ".00035", 58 | "lambda": "1" 59 | } 60 | }, 61 | { 62 | "shell": "0xC2D019b901f8D4fdb2B9a65b5d226Ad88c66EE8D", 63 | "name": "50% wBTC 40% renBTC 10% sBTC", 64 | "displayDecimals": 4, 65 | "swapDecimals": 8, 66 | "tag": "BTC1", 67 | "hideapy": true, 68 | "assets": [ 69 | { 70 | "address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", 71 | "decimals": 8, 72 | "icon": "wbtc.svg", 73 | "name": "Wrapped BTC", 74 | "symbol": "WBTC", 75 | "type": "ERC20", 76 | "weight": ".5", 77 | "derivatives": [ ] 78 | }, 79 | { 80 | "address": "0xEB4C2781e4ebA804CE9a9803C67d0893436bB27D", 81 | "decimals": 8, 82 | "icon": "renbtc.svg", 83 | "name": "renBTC", 84 | "symbol": "renBTC", 85 | "type": "ERC20", 86 | "weight": ".4", 87 | "derivatives": [ ] 88 | }, 89 | { 90 | "address": "0xfE18be6b3Bd88A2D2A7f928d00292E7a9963CfC6", 91 | "decimals": 18, 92 | "icon": "sbtc.svg", 93 | "name": "Synth sBTC", 94 | "symbol": "sBTC", 95 | "type": "ERC20", 96 | "weight": ".1", 97 | "derivatives": [ ] 98 | } 99 | ], 100 | "params": { 101 | "alpha": ".95", 102 | "beta": ".45", 103 | "delta": ".05", 104 | "epsilon": ".00035", 105 | "lambda": "1" 106 | } 107 | } 108 | ] 109 | } 110 | -------------------------------------------------------------------------------- /src/mainnet.one.dai.usdc.usdt.susd.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultWeb3Provider": "https://mainnet.infura.io/v3/23656e31a1a34049bc03807c64bcd017", 3 | "infuraKey": "23656e31a1a34049bc03807c64bcd017", 4 | "blocknative": "9bb42eeb-6448-414d-94ee-6f91b875fd2d", 5 | "network": 1, 6 | "displayDecimals": 2, 7 | "swapDecimals": 2, 8 | "assets": [ 9 | { 10 | "address": "0x6B175474E89094C44Da98b954EedeAC495271d0F", 11 | "decimals": 18, 12 | "icon": "dai.svg", 13 | "name": "MultiCollateral Dai", 14 | "symbol": "DAI", 15 | "weight": ".3", 16 | "derivatives": [ 17 | { 18 | "address": "0xfC1E690f61EFd961294b3e1Ce3313fBD8aa4f85d", 19 | "decimals": 18, 20 | "icon": "adai.svg", 21 | "name": "Aave Interest Bearing Dai", 22 | "symbol": "cDAI", 23 | "type": "aERC20" 24 | }, 25 | { 26 | "address": "0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643", 27 | "decimals": 8, 28 | "icon": "cdai.svg", 29 | "name": "Compound Dai", 30 | "symbol": "cDAI", 31 | "type": "cERC20" 32 | } 33 | ] 34 | }, 35 | { 36 | "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", 37 | "decimals": 6, 38 | "icon": "usdc.svg", 39 | "name": "USD Coin", 40 | "symbol": "USDC", 41 | "weight": ".3", 42 | "derivatives": [ 43 | { 44 | "address": "0x9bA00D6856a4eDF4665BcA2C2309936572473B7E", 45 | "decimals": 6, 46 | "icon": "ausdc.svg", 47 | "name": "Aave Interest Bearing USD Coin", 48 | "symbol": "aUSDC", 49 | "type": "aERC20" 50 | }, 51 | { 52 | "address": "0x39AA39c021dfbaE8faC545936693aC917d5E7563", 53 | "decimals": 8, 54 | "icon": "cusdc.svg", 55 | "name": "Compound USD Coin", 56 | "symbol": "cUSDC", 57 | "type": "cERC20" 58 | } 59 | ] 60 | }, 61 | { 62 | "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", 63 | "decimals": 6, 64 | "icon": "usdt.svg", 65 | "name": "Tether Stablecoin", 66 | "symbol": "USDT", 67 | "weight": ".3", 68 | "derivatives": [ 69 | { 70 | "address": "0x71fc860F7D3A592A4a98740e39dB31d25db65ae8", 71 | "decimals": 6, 72 | "icon": "ausdt.svg", 73 | "name": "Aave Interest Bearing USDT", 74 | "symbol": "aUSDT", 75 | "type": "aERC20" 76 | }, 77 | { 78 | "address": "0xf650C3d88D12dB855b8bf7D11Be6C55A4e07dCC9", 79 | "decimals": 8, 80 | "icon": "cusdt.svg", 81 | "name": "Compound USDT", 82 | "symbol": "cUSDT", 83 | "type": "cERC20" 84 | } 85 | ] 86 | }, 87 | { 88 | "address": "0x57Ab1ec28D129707052df4dF418D58a2D46d5f51", 89 | "decimals": 18, 90 | "icon": "susd.svg", 91 | "name": "Synthetix USD", 92 | "symbol": "SUSD", 93 | "weight": ".1", 94 | "derivatives": [ 95 | { 96 | "address": "0x625aE63000f46200499120B906716420bd059240", 97 | "decimals": 6, 98 | "icon": "asusd.svg", 99 | "name": "Aave Interest Bearing sUSD", 100 | "symbol": "aSUSD", 101 | "type": "aERC20" 102 | } 103 | ] 104 | } 105 | ], 106 | "shell": "0x2E703D658f8dd21709a7B458967aB4081F8D3d05", 107 | "params": { 108 | "alpha": ".9", 109 | "beta": ".75", 110 | "delta": ".5", 111 | "epsilon": ".00035", 112 | "lambda": ".9" 113 | } 114 | } -------------------------------------------------------------------------------- /src/mainnet.two.wbtc.renbtc.sbtc.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultWeb3Provider": "mainnet.infura.io/v3/23656e31a1a34049bc03807c64bcd017", 3 | "infuraKey": "23656e31a1a34049bc03807c64bcd017", 4 | "blocknative": "9bb42eeb-6448-414d-94ee-6f91b875fd2d", 5 | "network": 1, 6 | "displayDecimals": 4, 7 | "swapDecimals": 8, 8 | "assets": [ 9 | { 10 | "address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", 11 | "decimals": 8, 12 | "icon": "wbtc.svg", 13 | "name": "Wrapped BTC", 14 | "symbol": "WBTC", 15 | "type": "ERC20", 16 | "weight": ".5", 17 | "derivatives": [ ] 18 | }, 19 | { 20 | "address": "0xEB4C2781e4ebA804CE9a9803C67d0893436bB27D", 21 | "decimals": 8, 22 | "icon": "renbtc.svg", 23 | "name": "renBTC", 24 | "symbol": "renBTC", 25 | "type": "ERC20", 26 | "weight": ".4", 27 | "derivatives": [ ] 28 | }, 29 | { 30 | "address": "0xfE18be6b3Bd88A2D2A7f928d00292E7a9963CfC6", 31 | "decimals": 18, 32 | "icon": "sbtc.svg", 33 | "name": "Synth sBTC", 34 | "symbol": "sBTC", 35 | "type": "ERC20", 36 | "weight": ".1", 37 | "derivatives": [ ] 38 | } 39 | ], 40 | "shell": "0x02Af7C867d6Ddd2c87dEcec2E4AFF809ee118FBb", 41 | "params": { 42 | "alpha": ".9", 43 | "beta": ".6", 44 | "delta": ".1", 45 | "epsilon": ".00035", 46 | "lambda": "1" 47 | } 48 | } -------------------------------------------------------------------------------- /src/rinkeby.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultWeb3Provider": "rinkeby.infura.io/v3/23656e31a1a34049bc03807c64bcd017", 3 | "infuraKey": "23656e31a1a34049bc03807c64bcd017", 4 | "blocknative": "9bb42eeb-6448-414d-94ee-6f91b875fd2d", 5 | "network": 4, 6 | "shells": [ 7 | { 8 | "shell": "0x85240Ade8cc78a12D95cA71D149E76e5392c9625", 9 | "name": "50% StableX 50% TestCollateral", 10 | "displayDecimals": 2, 11 | "swapDecimals": 2, 12 | "assets": [ 13 | { 14 | "address": "0xaC6a43e78c55B4774bfD1db5A982F2805D7d1C81", 15 | "decimals": 18, 16 | "icon": "stablex.svg", 17 | "name": "Stable X", 18 | "symbol": "StableX", 19 | "weight": ".5", 20 | "derivatives": [ { 21 | "address": "0x8ED0B6EcddB914A689a882E9538C7d01e297AB32", 22 | "decimals": 18, 23 | "icon": "istablex.svg", 24 | "name": "iStable X", 25 | "symbol": "iStableX" 26 | }] 27 | }, 28 | { 29 | "address": "0x8b8c1ad953dfc13a990d1726e124f020111f9690", 30 | "decimals": 18, 31 | "icon": "test.svg", 32 | "name": "Collateral Test Token", 33 | "symbol": "TEST", 34 | "weight": ".5", 35 | "derivatives" : [] 36 | } 37 | ], 38 | "params": { 39 | "alpha": ".8", 40 | "beta": ".4", 41 | "delta": ".3", 42 | "epsilon": ".00035", 43 | "lambda": "1" 44 | } 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /src/theme/colors.js: -------------------------------------------------------------------------------- 1 | export const grey = { 2 | 50: '#f0f4f8', 3 | 100: '#D9E2EC', 4 | 200: '#BCCCDC', 5 | 300: '#9FB3C8', 6 | 600: '#486581', 7 | 800: '#182027', 8 | 900: '#0a0f13', 9 | 1000: '#00010f' 10 | } 11 | 12 | export const primary = { 13 | dark: '#000079', 14 | light: '#00fff3 ', 15 | main: '#0043ff', 16 | } -------------------------------------------------------------------------------- /src/theme/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './theme' -------------------------------------------------------------------------------- /src/theme/theme.js: -------------------------------------------------------------------------------- 1 | import { createMuiTheme } from '@material-ui/core/styles' 2 | 3 | import { grey, primary } from './colors' 4 | 5 | const theme = createMuiTheme({ 6 | palette: { 7 | grey, 8 | primary, 9 | }, 10 | shape: { 11 | borderRadius: 4, 12 | } 13 | }) 14 | 15 | theme.overrides = { 16 | MuiTextField: { 17 | root: { 18 | background: grey[50], 19 | borderRadius: theme.shape.borderRadius, 20 | }, 21 | }, 22 | MuiButton: { 23 | disabled: { 24 | cursor: 'no-drop' 25 | } 26 | }, 27 | MuiInput: { 28 | underline: { 29 | '&:before': { 30 | display: 'none', 31 | }, 32 | } 33 | }, 34 | } 35 | 36 | export default theme -------------------------------------------------------------------------------- /src/utils/Asset.js: -------------------------------------------------------------------------------- 1 | import ERC20ABI from '../abi/ERC20.abi.json'; 2 | 3 | import NumberFormats from "./NumberFormats.js"; 4 | 5 | export default class Asset extends NumberFormats { 6 | 7 | constructor (web3, address, name, symbol, icon, decimals) { 8 | 9 | super() 10 | 11 | this.contract = new web3.eth.Contract(ERC20ABI, address) 12 | this.address = address 13 | this.name = name 14 | this.symbol = symbol 15 | this.icon = icon 16 | this.decimals = decimals 17 | 18 | } 19 | 20 | approve (address, amount) { 21 | 22 | return this.contract.methods.approve(address, amount); 23 | 24 | } 25 | 26 | async allowance (owner, spender) { 27 | 28 | const allowance = await this.contract.methods.allowance(owner, spender).call() 29 | 30 | return this.getAllFormatsFromRaw(allowance) 31 | 32 | } 33 | 34 | async balanceOf (account) { 35 | 36 | const balance = await this.contract.methods.balanceOf(account).call() 37 | 38 | return this.getAllFormatsFromRaw(balance) 39 | 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /src/utils/NumberFormats.js: -------------------------------------------------------------------------------- 1 | import BigNumber from 'bignumber.js'; 2 | 3 | export default class NumericFormats { 4 | 5 | getNumeraireFromDisplay (display) { 6 | 7 | display = display.replace(',','') 8 | 9 | return new BigNumber(display === '' ? 0 : display); 10 | 11 | } 12 | 13 | getAllFormatsFromDisplay (display) { 14 | 15 | display = display.replace(',','') 16 | 17 | return { 18 | display: display, 19 | numeraire: this.getNumeraireFromDisplay(display), 20 | raw: this.getRawFromDisplay(display) 21 | } 22 | 23 | } 24 | 25 | getNumeraireFromRaw (raw) { 26 | 27 | const numeraire = new BigNumber(raw).dividedBy(10 ** this.decimals) 28 | 29 | return numeraire 30 | 31 | } 32 | 33 | getAllFormatsFromNumeraire (numeraire) { 34 | 35 | return { 36 | display: this.getDisplayFromNumeraire(numeraire), 37 | numeraire: numeraire, 38 | raw: this.getRawFromNumeraire(numeraire) 39 | } 40 | 41 | } 42 | 43 | getAllFormatsFromRaw (raw) { 44 | 45 | raw = new BigNumber(raw) 46 | 47 | return { 48 | raw: raw, 49 | display: this.getDisplayFromRaw(raw), 50 | numeraire: this.getNumeraireFromRaw(raw) 51 | } 52 | 53 | } 54 | 55 | getRawFromNumeraire (numeraire) { 56 | 57 | return numeraire.multipliedBy(10 ** this.decimals) 58 | 59 | } 60 | 61 | getRawFromDisplay (display) { 62 | 63 | display = display.replace(',','') 64 | 65 | return new BigNumber(display).multipliedBy(10 ** this.decimals) 66 | 67 | } 68 | 69 | getDisplayFromRaw (raw, decimals) { 70 | 71 | decimals = decimals ? decimals : this.displayDecimals 72 | 73 | return Number( 74 | new BigNumber(raw).dividedBy(10 ** this.decimals).toFixed(decimals) 75 | ).toLocaleString('en-US', { minimumFractionDigits: decimals }) 76 | 77 | } 78 | 79 | getDisplayFromNumeraire (numeraire, decimals) { 80 | 81 | decimals = decimals ? decimals : this.displayDecimals 82 | 83 | return Number(numeraire.toFixed(decimals)) 84 | .toLocaleString('en-US', { minimumFractionDigits: decimals }) 85 | 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/utils/SwapEngine.js: -------------------------------------------------------------------------------- 1 | import BigNumber from "bignumber.js" 2 | 3 | BigNumber.config({ FORMAT: { groupSeparator: '' }}) 4 | 5 | const REVERTED = '3.963877391197344453575983046348115674221700746820753546331534351508065746944e+75' 6 | 7 | export default class SwapEngine { 8 | 9 | async viewOriginSwap (origin, target, originAmount) { 10 | 11 | let shells = this.pairsToShells[origin.address][target.address] 12 | 13 | let quotes = await Promise.all(shells.map( async (ix) => { 14 | return await this.shells[ix].viewOriginSwap( 15 | origin.address, 16 | target.address, 17 | origin.getRawFromDisplay(originAmount).integerValue().toFixed() 18 | ) 19 | })) 20 | 21 | let shellIx 22 | let shellDerivativeIx 23 | let max = new BigNumber(0) 24 | 25 | for (let i = 0; i < shells.length; i++) { 26 | if (!quotes[i] || quotes[i].toString() == REVERTED) continue 27 | if (quotes[i].isGreaterThan(max)){ 28 | max = quotes[i] 29 | shellIx = shells[i] 30 | } 31 | } 32 | 33 | if (shellIx == undefined) { throw( new Error("reverted")) } 34 | 35 | for (let i = 0; i < this.shells[shellIx].derivatives.length; i++) { 36 | if (this.shells[shellIx].derivatives[i].address == origin.address) { 37 | shellDerivativeIx = i 38 | break 39 | } 40 | } 41 | 42 | return { 43 | originAmount: { 44 | numeraire: origin.getNumeraireFromDisplay(originAmount), 45 | display: originAmount, 46 | raw: origin.getRawFromDisplay(originAmount) 47 | }, 48 | targetAmount: { 49 | numeraire: target.getNumeraireFromRaw(max), 50 | display: target.getDisplayFromRaw(max, target.swapDecimals), 51 | raw: max 52 | }, 53 | _shellIx: shellIx, 54 | _shellDerivativeIx: shellDerivativeIx 55 | } 56 | 57 | } 58 | 59 | async viewTargetSwap (origin, target, targetAmount) { 60 | 61 | let shells = this.pairsToShells[origin.address][target.address] 62 | 63 | let quotes = await Promise.all(shells.map( async (ix) => { 64 | return await this.shells[ix].viewTargetSwap( 65 | origin.address, 66 | target.address, 67 | target.getRawFromDisplay(targetAmount).integerValue().toFixed() 68 | ) 69 | })) 70 | 71 | let shellIx 72 | let shellDerivativeIx 73 | let min = new BigNumber(1e80) 74 | 75 | for (let i = 0; i < shells.length; i++) { 76 | if (!quotes[i] || quotes[i].toString() == REVERTED) continue 77 | if (quotes[i].isLessThan(min)){ 78 | min = quotes[i] 79 | shellIx = shells[i] 80 | } 81 | } 82 | 83 | if (shellIx == undefined) throw( new Error("reverted")) 84 | 85 | for (let i = 0; i < this.shells[shellIx].derivatives.length; i++) { 86 | if (this.shells[shellIx].derivatives[i].address == origin.address) { 87 | shellDerivativeIx = i 88 | break 89 | } 90 | } 91 | 92 | return { 93 | originAmount: { 94 | display: origin.getDisplayFromRaw(min, origin.swapDecimals), 95 | numeraire: origin.getNumeraireFromRaw(min), 96 | raw: min 97 | }, 98 | targetAmount: { 99 | numeraire: target.getNumeraireFromDisplay(targetAmount), 100 | raw: target.getRawFromDisplay(targetAmount), 101 | display: targetAmount 102 | }, 103 | _shellIx: shellIx, 104 | _shellDerivativeIx: shellDerivativeIx 105 | } 106 | 107 | } 108 | 109 | executeOriginSwap (shellIx, origin, target, originAmount, minTargetAmount) { 110 | 111 | originAmount = origin.getRawFromDisplay(originAmount) 112 | 113 | let minTarget = target.getRawFromDisplay(minTargetAmount) 114 | 115 | minTarget = minTarget.multipliedBy(new BigNumber(.99)) 116 | 117 | let deadline = Math.floor(Date.now() /1000 + 900) 118 | 119 | return this.shells[shellIx].originSwap( 120 | origin.address, 121 | target.address, 122 | originAmount.integerValue().toFixed(), 123 | minTarget.integerValue().toFixed(), 124 | deadline 125 | ) 126 | 127 | } 128 | 129 | executeTargetSwap (shellIx, origin, target, maxOriginAmount, targetAmount) { 130 | 131 | targetAmount = target.getRawFromDisplay(targetAmount) 132 | 133 | let maxOrigin = origin.getRawFromDisplay(maxOriginAmount) 134 | 135 | maxOrigin = maxOrigin.multipliedBy(new BigNumber(1.01)) 136 | 137 | let deadline = Math.floor(Date.now() / 1000 + 900) 138 | 139 | return this.shells[shellIx].targetSwap( 140 | origin.address, 141 | target.address, 142 | maxOrigin.integerValue().toFixed(), 143 | targetAmount.integerValue().toFixed(), 144 | deadline 145 | ) 146 | 147 | } 148 | 149 | } -------------------------------------------------------------------------------- /src/utils/web3Classes.js: -------------------------------------------------------------------------------- 1 | import BigNumber from 'bignumber.js'; 2 | 3 | import ERC20ABI from '../abi/ERC20.abi.json'; 4 | import ShellABI from '../abi/Shell.abi.json'; 5 | 6 | import NumericFormats from "./NumberFormats.js"; 7 | 8 | export class ERC20 extends NumericFormats { 9 | 10 | constructor (web3, address, name, symbol, icon, decimals) { 11 | 12 | super() 13 | 14 | this.contract = new web3.eth.Contract(ERC20ABI, address) 15 | this.address = address 16 | this.name = name 17 | this.symbol = symbol 18 | this.icon = icon 19 | this.decimals = decimals 20 | 21 | } 22 | 23 | approve (address, amount) { 24 | 25 | return this.contract.methods.approve(address, amount); 26 | 27 | } 28 | 29 | async allowance (owner, spender) { 30 | 31 | const allowance = new BigNumber( await this.contract.methods.allowance(owner, spender).call() ) 32 | 33 | return this.getNumeraireFromRaw(allowance) 34 | 35 | } 36 | 37 | async balanceOf (account) { 38 | 39 | const balance = new BigNumber( await this.contract.methods.balanceOf(account).call() ) 40 | 41 | return this.getNumeraireFromRaw(balance) 42 | 43 | } 44 | 45 | } 46 | 47 | export class Shell extends NumericFormats { 48 | 49 | constructor (web3, address, name, symbol, icon, decimals) { 50 | 51 | super() 52 | 53 | this.contract = new web3.eth.Contract(ShellABI, address) 54 | this.address = address 55 | this.name = name 56 | this.symbol = symbol 57 | this.icon = icon 58 | this.decimals = decimals 59 | 60 | } 61 | 62 | async balanceOf (account) { 63 | 64 | const balance = new BigNumber( await this.contract.methods.balanceOf(account).call() ) 65 | 66 | return this.getNumeraireFromRaw(balance) 67 | 68 | } 69 | 70 | async totalSupply () { 71 | 72 | const totalSupply = new BigNumber( await this.contract.methods.totalSupply().call() ) 73 | 74 | return this.getNumeraireFromRaw(totalSupply) 75 | 76 | } 77 | 78 | async liquidity () { 79 | 80 | const liquidity = await this.contract.methods.liquidity().call() 81 | 82 | return { 83 | total: new BigNumber(liquidity[0]).dividedBy(1e18), 84 | dai: new BigNumber(liquidity[1][0]).dividedBy(1e18), 85 | usdc: new BigNumber(liquidity[1][1]).dividedBy(1e18), 86 | usdt: new BigNumber(liquidity[1][2]).dividedBy(1e18), 87 | susd: new BigNumber(liquidity[1][3]).dividedBy(1e18) 88 | } 89 | 90 | } 91 | 92 | async viewSelectiveDeposit (addresses, amounts) { 93 | 94 | try { 95 | 96 | const shells = new BigNumber( await this.contract.methods.viewSelectiveDeposit(addresses, amounts).call() ) 97 | 98 | return this.getNumeraireFromRaw(shells) 99 | 100 | } catch { 101 | 102 | return false 103 | 104 | } 105 | 106 | } 107 | 108 | selectiveDeposit (addresses, amounts, minimum, deadline) { 109 | 110 | return this.contract.methods.selectiveDeposit(addresses, amounts, minimum, deadline) 111 | 112 | } 113 | 114 | async viewSelectiveWithdraw (addresses, amounts) { 115 | 116 | try { 117 | 118 | const shellsToBurn = new BigNumber( await this.contract.methods.viewSelectiveWithdraw(addresses, amounts).call() ) 119 | 120 | return this.getNumeraireFromRaw(shellsToBurn) 121 | 122 | } catch { 123 | 124 | return false 125 | 126 | } 127 | 128 | } 129 | 130 | selectiveWithdraw (addresses, amounts, max, deadline) { 131 | 132 | return this.contract.methods.selectiveWithdraw(addresses, amounts, max, deadline) 133 | 134 | } 135 | 136 | proportionalWithdraw (shells, deadline) { 137 | 138 | return this.contract.methods.proportionalWithdraw(shells, deadline) 139 | 140 | } 141 | 142 | async viewOriginSwap (origin, target, amount) { 143 | 144 | try { 145 | 146 | return new BigNumber( await this.contract.methods.viewOriginSwap(origin, target, amount).call() ) 147 | 148 | } catch { 149 | 150 | return false 151 | 152 | } 153 | 154 | } 155 | 156 | async viewTargetSwap (origin, target, amount) { 157 | 158 | try { 159 | 160 | return new BigNumber( await this.contract.methods.viewTargetSwap(origin, target, amount).call() ) 161 | 162 | } catch { 163 | 164 | return false 165 | 166 | } 167 | 168 | } 169 | 170 | originSwap (origin, target, originAmount, targetLimit, deadline) { 171 | 172 | return this.contract.methods.originSwap(origin, target, originAmount, targetLimit, deadline) 173 | 174 | } 175 | 176 | targetSwap (origin, target, originLimit, targetAmount, deadline) { 177 | 178 | return this.contract.methods.targetSwap(origin, target, originLimit, targetAmount, deadline) 179 | 180 | } 181 | 182 | } -------------------------------------------------------------------------------- /src/views/Dashboard/Dashboard.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react' 2 | import styled from 'styled-components' 3 | import Intercom from 'react-intercom' 4 | import cookie from 'js-cookie' 5 | import randomWords from 'random-words' 6 | 7 | import Footer from '../../components/Footer' 8 | import Header from '../../components/Header' 9 | 10 | import withWallet from '../../containers/withWallet' 11 | 12 | import DashboardContent from './components/DashboardContent' 13 | 14 | import DashboardContext from './context' 15 | 16 | const StyledDashboard = styled.div` 17 | align-items: center; 18 | background: radial-gradient(circle at top, #00fff3 -0%, #0043ff, #000079); 19 | background-size: cover; 20 | background-position: center center; 21 | min-height: 100vh; 22 | display: flex; 23 | flex-direction: column; 24 | position: relative; 25 | ` 26 | 27 | const Dashboard = ({ 28 | web3, 29 | engine, 30 | state, 31 | loggedIn 32 | }) => { 33 | 34 | let userId = cookie.get('userId') 35 | 36 | if (!userId) { 37 | 38 | userId = randomWords(3).join('-') 39 | 40 | cookie.set('userId', userId) 41 | 42 | } 43 | 44 | return ( 45 | <> 46 | 51 | {/* */} 52 | 53 |
54 | { loggedIn && web3 && } 55 |