Skip to content

Commit

Permalink
Merge pull request #196 from lc-labs/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
lcamargof authored Oct 6, 2023
2 parents e43897b + 5ee4332 commit 14fd625
Show file tree
Hide file tree
Showing 82 changed files with 8,431 additions and 5,279 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ VITE_ALCHEMY=
VITE_RPAY_FEED=
VITE_WALLETCONNECT_ID=
VITE_MIXPANEL_KEY=
VITE_TENDERLY_MAINNET_URL=
VITE_MAINNET_URL=
# End to end test
GUARDIAN_UI_ALCHEMY_API_KEY=
GUARDIAN_UI_ANVIL_FLAGS="--compute-units-per-second 100 --fork-retry-backoff 5000"
10,429 changes: 5,766 additions & 4,663 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@ethersproject/providers": "^5.7.2",
"@lc-labs/rtokens": "1.0.11",
"@lc-labs/rtokens": "1.1.3",
"@lingui/macro": "^4.2.1",
"@lingui/react": "^4.2.1",
"@popperjs/core": "^2.11.5",
"@rainbow-me/rainbowkit": "^1.0.4",
"@rainbow-me/rainbowkit": "1.0.11",
"@react-spring/web": "^9.7.1",
"@reserve-protocol/token-zapper": "2.1.1-rc-1",
"@reserve-protocol/token-zapper": "2.5.2",
"@uiw/react-md-editor": "^3.20.5",
"@uniswap/permit2-sdk": "^1.2.0",
"@viem/anvil": "^0.0.6",
Expand Down Expand Up @@ -42,8 +42,8 @@
"recharts": "^2.1.6",
"swr": "^1.2.2",
"theme-ui": "^0.15.4",
"viem": "^1.2.7",
"wagmi": "^1.3.10"
"viem": "1.15.0",
"wagmi": "1.4.3"
},
"scripts": {
"start": "vite",
Expand All @@ -53,7 +53,7 @@
"test": "vite test",
"test:e2e": "npx playwright test",
"translations": "lingui extract --clean && lingui compile",
"forknet": "anvil --fork-url https://eth.llamarpc.com --chain-id 1 --balance 100000000 --block-time 12",
"forknet": "anvil --fork-url https://eth.llamarpc.com --chain-id 1 --balance 10000000",
"parse-collaterals": "node scripts/parseCollaterals"
},
"engines": {
Expand Down
22 changes: 22 additions & 0 deletions scripts/data/base-collaterals.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"assets": {
"COMP": "0x277FD5f51fE53a9B3707a0383bF930B149C74ABf"
},
"collateral": {
"DAI": "0x5EBE8927e5495e0A7731888C81AF463cD63602fb",
"WETH": "0x42D0fA25d6d5bff01aC050c0F5aB0B2C9D01b4a3",
"USDbC": "0x6490D66B17A1E9a460Ab54131165C8F921aCcDeB",
"cbETH": "0x5fE248625aC2AB0e17A115fef288f17AF1952402",
"cUSDbCv3": "0xa372EC846131FBf9AE8b589efa3D041D9a94dF41",
"aBasUSDbC": "0x1DdB7dfdC5D26FE1f2aD02d9972f12481346Ae9b"
},
"erc20s": {
"COMP": "0x9e1028F5F1D5eDE59748FFceE5532509976840E0",
"DAI": "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",
"WETH": "0x4200000000000000000000000000000000000006",
"USDbC": "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",
"cbETH": "0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22",
"cUSDbCv3": "0xbC0033679AEf41Fb9FeB553Fdf55a8Bb2fC5B29e",
"aBasUSDbC": "0x308447562442Cc43978f8274fA722C9C14BafF8b"
}
}
13 changes: 0 additions & 13 deletions scripts/data/basegoerli-collaterals.json

This file was deleted.

16 changes: 16 additions & 0 deletions scripts/data/collateral-abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,21 @@
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "asset",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "aToken",
"outputs": [
{ "internalType": "contract IERC20", "name": "", "type": "address" }
],
"stateMutability": "view",
"type": "function"
}
]
13 changes: 10 additions & 3 deletions scripts/parseCollaterals.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const protocols = {
collateral: 'ATOKEN', // If the underlying is not the yield bearing asset
rewardTokens: ['stkAAVE'],
},
AAVEv3: {
key: 'AAVEv3',
underlying: 'asset',
collateral: 'aToken',
},
COMP: {
key: 'COMP',
underlying: 'underlying',
Expand Down Expand Up @@ -62,6 +67,7 @@ const wrappedTokenMap = {
cUSDP: protocols.COMP,
cWBTC: protocols.COMP,
cETH: protocols.COMP,
cUSDbCv3: protocols.COMPv3, // base
cUSDCv3: protocols.COMPv3,
// Flux tokens are no longer wrapped
// fUSDC: protocols.FLUX,
Expand All @@ -81,6 +87,7 @@ const wrappedTokenMap = {
cvxeUSDFRAXBP: protocols.CONVEX,
cvxMIM3Pool: protocols.CONVEX,
sDAI: protocols.SDR,
aBasUSDbC: protocols.AAVEv3,
}

const chainsMap = [
Expand All @@ -96,9 +103,9 @@ const chainsMap = [
collaterals: require('./data/mainnet-collaterals.json'),
},
{
prefix: 'basegoerli',
chain: chains.baseGoerli,
collaterals: require('./data/basegoerli-collaterals.json'),
prefix: 'base',
chain: chains.base,
collaterals: require('./data/base-collaterals.json'),
},
]

Expand Down
11 changes: 10 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ToastContainer from 'components/toaster-container/ToastContainer'
import TransactionSidebar from 'components/transactions/manager/TransactionSidebar'
import { useAtomValue } from 'jotai'
import mixpanel from 'mixpanel-browser'
import { Suspense, useEffect } from 'react'
import { Suspense, lazy, useEffect } from 'react'
import { lazyWithPreload } from 'react-lazy-with-preload'
import {
Route,
Expand Down Expand Up @@ -37,6 +37,7 @@ mixpanel.init(import.meta.env.VITE_MIXPANEL_KEY || 'mixpanel_key', {

const Issuance = lazyWithPreload(() => import('./views/issuance'))
const Governance = lazyWithPreload(() => import('./views/governance'))
const Bridge = lazy(() => import('./views/bridge'))

const Fallback = () => <Text>Loading...</Text>

Expand Down Expand Up @@ -118,6 +119,14 @@ const App = () => {
path={`${ROUTES.GOVERNANCE_PROPOSAL}/:proposalId`}
element={<GovernanceProposalDetail />}
/>
<Route
path={ROUTES.BRIDGE}
element={
<Suspense fallback={<Fallback />}>
<Bridge />
</Suspense>
}
/>
</Routes>
</Layout>
</ChainProvider>
Expand Down
67 changes: 67 additions & 0 deletions src/abis/BaseBridge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
export default [
// DEPOSIT NATIVE ETH
{
inputs: [
{ internalType: 'address', name: '_to', type: 'address' },
{ internalType: 'uint256', name: '_value', type: 'uint256' },
{ internalType: 'uint64', name: '_gasLimit', type: 'uint64' },
{ internalType: 'bool', name: '_isCreation', type: 'bool' },
{ internalType: 'bytes', name: '_data', type: 'bytes' },
],
name: 'depositTransaction',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
// DEPOSIT ERC20
{
inputs: [
{ internalType: 'address', name: '_l1Token', type: 'address' },
{ internalType: 'address', name: '_l2Token', type: 'address' },
{ internalType: 'uint256', name: '_amount', type: 'uint256' },
{ internalType: 'uint32', name: '_minGasLimit', type: 'uint32' },
{ internalType: 'bytes', name: '_extraData', type: 'bytes' },
],
name: 'depositERC20',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: '_l2Token', type: 'address' },
{ internalType: 'uint256', name: '_amount', type: 'uint256' },
{ internalType: 'uint32', name: '_minGasLimit', type: 'uint32' },
{ internalType: 'bytes', name: '_extraData', type: 'bytes' },
],
name: 'withdraw',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
// WITHDRAW ETH
{
inputs: [
{ internalType: 'address', name: '_target', type: 'address' },
{ internalType: 'uint256', name: '_gasLimit', type: 'uint256' },
{ internalType: 'bytes', name: '_data', type: 'bytes' },
],
name: 'initiateWithdrawal',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
// WITHDRAW ERC20
{
inputs: [
{ internalType: 'address', name: '_l2Token', type: 'address' },
{ internalType: 'uint256', name: '_amount', type: 'uint256' },
{ internalType: 'uint32', name: '_minGasLimit', type: 'uint32' },
{ internalType: 'bytes', name: '_extraData', type: 'bytes' },
],
name: 'withdraw',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
] as const
Loading

0 comments on commit 14fd625

Please sign in to comment.