Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/assert.sol #1139

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
515c629
add assert ABi
brucedonovan Feb 27, 2023
2df3f8e
build assert contract
brucedonovan Feb 27, 2023
242d8da
add in useAssert hook
brucedonovan Feb 27, 2023
1d0bd8c
add assert contract adderss
brucedonovan Feb 27, 2023
0974d29
assert RPC tenderly
brucedonovan Feb 27, 2023
cb45902
feat/useAssert
brucedonovan Feb 28, 2023
1838a3b
fork
brucedonovan Feb 28, 2023
1362dd8
Merge branch 'feat/supportToolkit' into feat/asert.sol
brucedonovan Feb 28, 2023
f23b4f5
add in asert addresses
brucedonovan Feb 28, 2023
4a4446b
specify assert fns by params
brucedonovan Feb 28, 2023
5e0351f
handle arbitrum ethBalanceCall
brucedonovan Feb 28, 2023
b542a84
cleanup assetSelector
brucedonovan Feb 28, 2023
e7183ed
repayAssertCAll
brucedonovan Feb 28, 2023
c88ea24
useMulticall3
brucedonovan Feb 28, 2023
50e68d5
Merge branch 'master' into feat/asert.sol
brucedonovan Mar 2, 2023
1d0b719
version bump
brucedonovan Mar 2, 2023
cfbbd80
feat/ assert in actions
brucedonovan Mar 2, 2023
c89a54a
new fork
brucedonovan Mar 2, 2023
c1b9947
WIP:placeholder
brucedonovan Mar 6, 2023
54f8c21
vaultBalance before === vaultBalance after
brucedonovan Mar 7, 2023
34b2378
Merge branch 'master' into feat/assert.sol
marcomariscal Mar 10, 2023
4de79fa
Merge branch 'master' into feat/assert.sol
marcomariscal Mar 10, 2023
a7685da
feat: assert into new config
marcomariscal Mar 10, 2023
0d5d6ff
feat: make sure contracts exist
marcomariscal Mar 10, 2023
69aff1a
fix: make sure contracts exist
marcomariscal Mar 10, 2023
dc7fd88
feat: bytesLike
marcomariscal Mar 10, 2023
2ddb11d
feat: types
marcomariscal Mar 10, 2023
50274b2
Merge branch 'master' into feat/assert.sol
brucedonovan Mar 20, 2023
3a50f8e
Merge branch 'master' into feat/assert.sol
brucedonovan Mar 22, 2023
cef0353
Merge branch 'master' into feat/assert.sol
brucedonovan Mar 22, 2023
c042dc1
Merge branch 'master' into feat/assert.sol
brucedonovan Apr 12, 2023
a053020
clean out .env
brucedonovan Apr 12, 2023
b67e2b1
increase gaslimit
brucedonovan Apr 12, 2023
325948d
add in availabel assert.sol
brucedonovan Apr 12, 2023
5b62aca
assert closeLending input
brucedonovan Apr 12, 2023
7abed05
bugfix/AssertAddLiquidity
brucedonovan Apr 12, 2023
ddbbc52
bugfix/ removeLiq div not mul
brucedonovan Apr 12, 2023
5a8b9b6
bugfix/useRepayAssert
brucedonovan Apr 12, 2023
4526747
bugfix/swap out div for mul
brucedonovan Apr 12, 2023
b73958a
updated assert still
brucedonovan Apr 18, 2023
43bf318
number of tweaks:temp remove addCollateral assert
brucedonovan May 8, 2023
cf7b580
bugfix: eth borrow
brucedonovan May 8, 2023
ec372b4
arbitrum fork
brucedonovan May 8, 2023
d1b36a9
bugfix: close handle ETH
brucedonovan May 8, 2023
03ab052
remove assert from remove collateral
brucedonovan May 8, 2023
0c39222
refactor: collate all possible asserts
brucedonovan May 8, 2023
e6edea6
addRemovalCollateral remove assert.sol :(
brucedonovan May 8, 2023
5b5edf1
bugfix: repay ETH ilk
brucedonovan May 8, 2023
017dd4d
temp remove fyToken assert.sol
brucedonovan May 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .env.local
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
REACT_APP_DEFAULT_CHAINID=42161
REACT_APP_VERSION=$npm_package_version

REACT_APP_RPC_URL_1='https://eth-mainnet.g.alchemy.com/v2/ZXDCq5iy0KrKR0XjsqC6E4QG7Z_FuXDv'
REACT_APP_RPC_URL_42161='https://arb-mainnet.g.alchemy.com/v2/vtMM4_eLnOvkjkdckprVw3cIa64EVkDZ'

REACT_APP_DEFAULT_FORK_RPC_URL='https://rpc.tenderly.co/fork/6fd873f9-62cb-44b7-a7ab-e871f8f3b764'
REACT_APP_DEFAULT_FORK_RPC_URL='https://rpc.tenderly.co/fork/90a229c1-7aef-4d13-a897-24e14b070508'
REACT_APP_LOCALHOST_RPC_URL='http://127.0.0.1:8545'

REACT_APP_RPC_URL_421611='https://arb-rinkeby.g.alchemy.com/v2/AY_Q_Uy-Kcfwmf5In5qwG636vaOIoA8L'

TENDERLY_USER='Yield'
TENDERLY_PROJECT='v2'
TENDERLY_ACCESS_KEY='B4N3hpAhTmY09c3pyeC9zC8rMfto7ukj'
Expand All @@ -23,4 +18,4 @@ ALLOWED_SUPPORT_ADDRESSES='0x1Bd3Abb6ef058408734EA01cA81D325039cd7bcA, '

KILLSWITCH_ACTIVE=false
KILLSWITCH_CHAIN=1
KILLSWITCH_TEXT='Due to an Euler Finance security incident, we are suspending UI interaction with the Yield Protocol until we have fully assessed the implications of the breach'
KILLSWITCH_TEXT='Due to an incident, we are suspending UI interaction with the Yield Protocol until we have fully assessed the implications of the breach'
4 changes: 1 addition & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const nextConfig = {
env: {
REACT_APP_DEFAULT_CHAINID: process.env.REACT_APP_DEFAULT_CHAINID,
REACT_APP_VERSION: process.env.REACT_APP_VERSION,
REACT_APP_INFURA_KEY_V1: process.env.REACT_APP_INFURA_KEY_V1,
REACT_APP_RPC_URL_1: process.env.TENDERLY_JSON_RPC_URL,
REACT_APP_RPC_URL_42161: process.env.REACT_APP_RPC_URL_42161,

REACT_APP_DEFAULT_FORK_RPC_URL: process.env.REACT_APP_DEFAULT_FORK_RPC_URL,
REACT_APP_LOCALHOST_RPC_URL: process.env.REACT_APP_LOCALHOST_RPC_URL,
Expand All @@ -22,6 +19,7 @@ const nextConfig = {
TENDERLY_ACCESS_KEY: process.env.TENDERLY_ACCESS_KEY,

ALLOWED_SUPPORT_ADDRESSES: process.env.ALLOWED_SUPPORT_ADDRESSES,

KILLSWITCH_ACTIVE: process.env.KILLSWITCH_ACTIVE,
KILLSWITCH_TEXT: process.env.KILLSWITCH_TEXT,
KILLSWITCH_CHAIN: process.env.KILLSWITCH_CHAIN,
Expand Down
3 changes: 2 additions & 1 deletion src/components/selectors/AssetSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function AssetSelector({ selectCollateral, isModal }: IAssetSelectorProps) {
const [options, setOptions] = useState<IAsset[]>([]);
const [modalOpen, toggleModal] = useState<boolean>(false);
const { logAnalyticsEvent } = useAnalytics();

const { validIlks, validIlksLoading } = useAssetPair(undefined, undefined, selectedSeries?.id);

const optionText = (asset: IAsset | undefined) =>
Expand Down Expand Up @@ -79,7 +80,7 @@ function AssetSelector({ selectCollateral, isModal }: IAssetSelectorProps) {

/* update options on any changes */
useEffect(() => {
const opts = (selectCollateral ? validIlks! : Array.from(assetMap.values()))
const opts = (selectCollateral && validIlks ? validIlks : Array.from(assetMap.values())) // if !validIlks, then we just return all assets ( for forked env )
.filter((a) => a.showToken)
.filter((a) => (showWrappedTokens ? true : !a.isWrappedToken)); // filter based on whether wrapped tokens are shown or not

Expand Down
1 change: 0 additions & 1 deletion src/config/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export interface AssetStaticInfo {
digitFormat: number; // this is the 'reasonable' number of digits to show. accuracy equivalent to +- 1 us cent.

tokenRoles: TokenRole[];

// optionals
// isYieldBase?: boolean;

Expand Down
3 changes: 3 additions & 0 deletions src/config/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum ContractNames {
WRAP_ETHER_MODULE = 'WrapEtherModule',
CONVEX_LADLE_MODULE = 'ConvexLadleModule',
TRANSFER_1155_MODULE = 'Transfer1155Module',
ASSERT = 'Assert',
}

export type ContractMap = Map<ContractNames, Contract>;
Expand All @@ -28,6 +29,7 @@ const contractAddresses: ContractAddresses = {
[ContractNames.TRANSFER_1155_MODULE, '0x97f1d43A217aDD678bB6Dcd3C5D51F40b6729d06'],
[ContractNames.WRAP_ETHER_MODULE, '0x22768FCaFe7BB9F03e31cb49823d1Ece30C0b8eA'],
[ContractNames.CONVEX_LADLE_MODULE, '0x9Bf195997581C99cef8be95a3a816Ca19Cf1A3e6'],
[ContractNames.ASSERT, '0x40f0b18c7a41c04f848c033ed7f9178d9c5a80d8'],
]),
],
[
Expand All @@ -38,6 +40,7 @@ const contractAddresses: ContractAddresses = {
[ContractNames.WITCH, '0x08173D0885B00BDD640aaE57D05AbB74cd00d669'],
[ContractNames.WITCHV2, '0x07c2c74811cb14a5003c3ccff7ec436d504fffb6'],
[ContractNames.WRAP_ETHER_MODULE, '0x4cd01ed221d6d198e2656c16c32803bf78134568'],
[ContractNames.ASSERT, '0x40f0b18c7a41c04f848c033ed7f9178d9c5a80d8'],
]),
],
]),
Expand Down
2 changes: 2 additions & 0 deletions src/contexts/SettingsContext.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createContext, Dispatch, ReactNode, useEffect, useReducer } from 'react';
import { USDC } from '../config/assets';
import { ApprovalType } from '../types';
import { BLANK_ADDRESS } from '../utils/constants';
import { ISettingsContextActions, ISettingsContextState, Settings, SettingsContextAction } from './types/settings';

const initState: ISettingsContextState = {
Expand Down Expand Up @@ -39,6 +40,7 @@ const initState: ISettingsContextState = {
/* Development settings */

/* Always force transctions to the chain -> even if they will likely fail */

forceTransactions: false,

/* Show diagnostic messages in the console */
Expand Down
Loading