Skip to content

Commit

Permalink
Development (#202)
Browse files Browse the repository at this point in the history
* feat: add maintenance mode for convert page (#199)

* SOV-1309: reward manager integration (#168)

* testing

* added receive amount to field

* fixed destination token

* minor fix to mock

* added reward or penalty label

* fixed liter comments

* testing

* lint

* testing

* fixed review comments

* added percentage to incentive display

* removed print

* removed print

* fixed many tiny compilation errors

* SOV-2245: Fix staking duration (#191)

* Fix method for generating staking dates

* Trigger deploy

* Fix tests

* Make stakeEndDate argument optional

* SOV-2196: Add a link to the latest GH release (#192)

* Add a link to the latest release

* Update README

* added kludge to access node directly for incentive estimate

* some refactoring

* Update src/pages/Aggregator/AggregatorInfo/AggregatorInfo.component.tsx

Co-authored-by: tiltom <[email protected]>

* removed unnecessary config

* fix linter

* prettier

* fixed bool to string bug

* fixed bugs

* added form validation

* linter and prettier

* fixed slippage calculation

* fixed slippage logic

* fixed slippage logic

* fixed some merge related errors and a review comment

* fixed penalty added to receive amount

* review comments

* fixed ro;unding of incentive

* removed console.logs

* fixed underflow bug

* fixed bridge transaction bug

* Update src/store/aggregator/sagas/withdrawTokens.ts

Co-authored-by: tiltom <[email protected]>

* Update src/store/aggregator/sagas/withdrawTokens.ts

Co-authored-by: tiltom <[email protected]>

* review comment

* review comment

* natural number bug

* disabled slippage slider for now

* penalty -> conversion fee

* subtract bridge fee from receive amount

* subtract bridge fee from receive amount

* fixed race condition on fees

* fixed a few bugs

* fixed a few bugs

* fixed a few bugs

* fixed a few bugs

* new reward manager

* new tokens for testing

* new tokens for testing

* new reward manager

* new address

---------

Co-authored-by: tiltom <[email protected]>

* added inivisible version indication

---------

Co-authored-by: soulBit <[email protected]>
Co-authored-by: tiltom <[email protected]>
  • Loading branch information
3 people authored Aug 14, 2023
1 parent d1e410c commit a50a0cd
Show file tree
Hide file tree
Showing 39 changed files with 5,062 additions and 1,419 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"parser": "@typescript-eslint/parser"
},
"rules": {
"arrow-body-style": "off",
"no-plusplus": "off",
"no-undef": "off",
"no-param-reassign": "off",
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"deploy": "./start.sh",
"lint": "eslint .",
"prettier": "prettier --config .prettierrc --check .",
"prettier:fix": "prettier --config .prettierrc --write .",
"test": "jest --verbose",
"preview": "vite preview",
"check-types": "tsc --noEmit",
Expand All @@ -30,7 +31,7 @@
"@sovryn/onboard-hw-common": "1.0.1",
"@sovryn/onboard-injected": "1.0.0",
"@sovryn/onboard-ledger": "1.0.1",
"@sovryn/onboard-react": "1.0.2",
"@sovryn/onboard-react": "1.0.3",
"@sovryn/onboard-trezor": "1.0.1",
"@sovryn/ui": "1.0.6",
"@typechain/ethers-v5": "9.0.0",
Expand All @@ -42,7 +43,7 @@
"graphql-request": "4.1.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-hook-form": "7.27.0",
"react-hook-form": "7.43.1",
"react-redux": "7.2.6",
"react-router-dom": "6.2.1",
"reactjs-localstorage": "1.0.1",
Expand All @@ -51,7 +52,10 @@
"rxjs": "7.8.1",
"subscription-client": "0.9.15",
"ts-node": "10.5.0",
"typed-redux-saga": "1.4.0"
"typed-redux-saga": "1.5.0",
"typescript-http-client": "0.10.4",
"web3": "1.9.0",
"web3-utils": "1.10.0"
},
"devDependencies": {
"@ethersproject/providers": "5.5.1",
Expand Down
21 changes: 5 additions & 16 deletions src/components/Dropdown/Dropdown.controlled.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import Box from '@mui/material/Box';
import React, { Ref, useCallback } from 'react';
import {
Controller,
Path,
PathValue,
UnpackNestedValue,
} from 'react-hook-form';
import { Ref, useCallback } from 'react';
import { Controller, Path, PathValue } from 'react-hook-form';
import { FieldErrorMessage } from '../FieldErrorMessage/FieldErrorMessage.component';

import { DropdownOptions } from './Dropdown.component';
Expand All @@ -27,15 +22,9 @@ export const ControlledDropdown = <
}) => {
const setValueWhenOneOption = useCallback(() => {
if (options.length === 1) {
setValue(
name,
options[0].id as unknown as UnpackNestedValue<
PathValue<FormValues, Path<FormValues>>
>,
{
shouldValidate: true,
}
);
setValue(name, options[0].id as PathValue<FormValues, Path<FormValues>>, {
shouldValidate: true,
});
}
}, [name, options, setValue]);

Expand Down
1 change: 1 addition & 0 deletions src/components/Header/Header.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ export const Header = () => (
<Logo />
<Navigation />
<WalletConnector />
<span style={{ fontSize: '0px' }} >version: incentive-curve</span>
</Box>
);
3 changes: 3 additions & 0 deletions src/config/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type ContractsForNetwork = {
swapNetwork: string;
multicall: string;
XUSDMassetProxy: string;
rewardManager: string;
};

export type ContractsAddresses = Record<
Expand All @@ -30,6 +31,7 @@ export const contractsAddresses: ContractsAddresses = {
feeSharingProxy: '0x12B1B0C67d9A771EB5Db7726d23fdc6848fd93ef',
vestingRegistry: '0x036ab2DB0a3d1574469a4a7E09887Ed76fB56C41',
XUSDMassetProxy: '0x1440d19436bEeaF8517896bffB957a88EC95a00F',
rewardManager: '0xd2508d45ff30f920178ce88b3a5c7207c534558d',
},
[ChainEnum.RSK_TESTNET]: {
staking: '0x34a01F53432e2105B7361Aee031F3De629eb7211',
Expand All @@ -42,5 +44,6 @@ export const contractsAddresses: ContractsAddresses = {
feeSharingProxy: '0xBF56E401e3CbE1ddF3d8fEee770d9A3a19076751',
vestingRegistry: '0xEB0AAD069b452563628CE539df0Da531E2313148',
XUSDMassetProxy: '0x1572D7E4a78A8AD14AE722E6fE5f5600a2c7A149',
rewardManager: '0xd7D4236adEa1fFE9C1C6b4A31Ac3d37AE146906D',
},
};
3 changes: 2 additions & 1 deletion src/config/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export const mainnetPool = {
const testnetBaseChains: BaseChainType[] = [
{
...chains[ChainEnum.RSK_TESTNET],
bassets: [tokens.DOC, tokens.RDOC, tokens.RUSDT, tokens.ZUSD, tokens.DLLR],
bassets: [tokens.DOC, tokens.RDOC, tokens.RUSDT, tokens.ZUSD,
tokens.DLLR, tokens.TST1, tokens.TST2, tokens.TST3, tokens.TST4, tokens.TST6],
},
{
...chains[ChainEnum.ETH_TESTNET],
Expand Down
56 changes: 53 additions & 3 deletions src/config/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ export enum TokenEnum {
RUSDT = 'RUSDT',
ZUSD = 'ZUSD',
DLLR = 'DLLR',
TST1 = 'TST1',
TST2 = 'TST2',
TST3 = 'TST3',
TST4 = 'TST4',
TST6 = 'TST6'
}

export interface TokenTypeBase {
Expand Down Expand Up @@ -58,15 +63,15 @@ export const tokenOnChain = {
},
[TokenEnum.RDOC]: {
[ChainEnum.RSK]: '0x2d919f19d4892381d58edebeca66d5642cef1a1f',
[ChainEnum.RSK_TESTNET]: '0xC3De9f38581F83e281F260D0ddBAac0E102Ff9F8',
[ChainEnum.RSK_TESTNET]: '0xdbdc2d486c10c23902a46a17bec1f7de64075257',
},
[TokenEnum.DOC]: {
[ChainEnum.RSK]: '0xe700691da7b9851f2f35f8b8182c69c53ccad9db',
[ChainEnum.RSK_TESTNET]: '0xCb46C0DdC60d18eFEB0e586c17AF6Ea36452DaE0',
[ChainEnum.RSK_TESTNET]: '0xad0d0d04ec0cf442204908fc2cc18503ead06d3e',
},
[TokenEnum.RUSDT]: {
[ChainEnum.RSK]: '0xEf213441a85DF4d7acBdAe0Cf78004E1e486BB96',
[ChainEnum.RSK_TESTNET]: '0x4d5A316d23EBe168D8f887b4447BF8DBfA4901cc',
[ChainEnum.RSK_TESTNET]: '0x71e14cb1d752b88215782f2d6af01327cb483a0e',
},
[TokenEnum.ZUSD]: {
[ChainEnum.RSK]: '0xdB107FA69E33f05180a4C2cE9c2E7CB481645C2d',
Expand All @@ -76,6 +81,21 @@ export const tokenOnChain = {
[ChainEnum.RSK]: '0x007b3AA69A846cB1f76b60b3088230A52D2A83AC', // TODO: Change it once we have mainnet deployment, this is a testnet address
[ChainEnum.RSK_TESTNET]: '0x007b3AA69A846cB1f76b60b3088230A52D2A83AC',
},
[TokenEnum.TST1]: {
[ChainEnum.RSK_TESTNET]: '0x9552f2e86b38b6545f7a3ff871b1f3e0023fa841',
},
[TokenEnum.TST2]: {
[ChainEnum.RSK_TESTNET]: '0x36f737dcaf6b2480f3163602c7cf85c9661527d4',
},
[TokenEnum.TST3]: {
[ChainEnum.RSK_TESTNET]: '0xf177355fffbf1096436c43354b6b653c08ff75ee',
},
[TokenEnum.TST4]: {
[ChainEnum.RSK_TESTNET]: '0x12aff942bafc1394acc3fdef28f41fd3f008b32d',
},
[TokenEnum.TST6]: {
[ChainEnum.RSK_TESTNET]: '0xd1179afa75dcdeaa5bd6c0da705e67d268a2d7c3',
},
} as const;

type TokensType = Record<Partial<TokenEnum>, TokenTypeBase>;
Expand Down Expand Up @@ -147,4 +167,34 @@ export const tokens: TokensType = {
icon: dllrIcon,
addresses: tokenOnChain.DLLR,
},
[TokenEnum.TST1]: {
id: TokenEnum.TST1,
name: TokenEnum.TST1,
icon: dllrIcon,
addresses: tokenOnChain.TST1,
},
[TokenEnum.TST2]: {
id: TokenEnum.TST2,
name: TokenEnum.TST2,
icon: dllrIcon,
addresses: tokenOnChain.TST2,
},
[TokenEnum.TST3]: {
id: TokenEnum.TST3,
name: TokenEnum.TST3,
icon: dllrIcon,
addresses: tokenOnChain.TST3,
},
[TokenEnum.TST4]: {
id: TokenEnum.TST4,
name: TokenEnum.TST4,
icon: dllrIcon,
addresses: tokenOnChain.TST4,
},
[TokenEnum.TST6]: {
id: TokenEnum.TST6,
name: TokenEnum.TST6,
icon: dllrIcon,
addresses: tokenOnChain.TST6,
},
} as const;
Loading

0 comments on commit a50a0cd

Please sign in to comment.