Skip to content

Commit

Permalink
Merge pull request #475 from OasisDEX/dev
Browse files Browse the repository at this point in the history
Release 2.0.2
  • Loading branch information
peculiarity authored Sep 22, 2021
2 parents a858755 + e734ff8 commit 0494af3
Show file tree
Hide file tree
Showing 44 changed files with 644 additions and 142 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/aws-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ jobs:
# Build a docker container and
# push it to ECR so that it can
# be deployed to ECS.
docker pull $ECR_REGISTRY/$ECR_REPO_NAME:$ENVIRONMENT_TAG
docker build --build-arg COMMIT_SHA=${{ env.SHA_TAG }} \
--build-arg API_HOST=${{ secrets.API_HOST }} \
--build-arg MIXPANEL_ENV=production \
--build-arg MIXPANEL_KEY=${{ secrets.MIXPANEL_PROD_KEY }} \
--build-arg INFURA_PROJECT_ID=${{ secrets.INFURA_PROJECT_ID }} \
--build-arg ETHERSCAN_API_KEY=${{ secrets.ETHERSCAN_API_KEY }} \
--build-arg SHOW_BUILD_INFO=0 \
--cache-from=$ECR_REGISTRY/$ECR_REPO_NAME:$ENVIRONMENT_TAG \
-t $ECR_REGISTRY/$ECR_REPO_NAME:$SHA_TAG \
-t $ECR_REGISTRY/$ECR_REPO_NAME:$LATEST_TAG \
-t $ECR_REGISTRY/$ECR_REPO_NAME:$ENVIRONMENT_TAG \
Expand All @@ -69,4 +71,4 @@ jobs:
uses: oryanmoshe/ecs-wait-action@v1.3
with:
ecs-cluster: ${{ env.CLUSTER_NAME }}
ecs-services: '["${{ env.SERVICE_NAME }}"]'
ecs-services: '["${{ env.SERVICE_NAME }}"]'
9 changes: 9 additions & 0 deletions analytics/analytics.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ConnectionKind } from '@oasisdex/web3-context'
import * as mixpanelBrowser from 'mixpanel-browser'
import getConfig from 'next/config'

Expand Down Expand Up @@ -181,6 +182,8 @@ export const trackingEvents = {
daiAmount: string,
firstCDP: boolean | undefined,
txHash: string,
network: string,
walletType: ConnectionKind,
) => {
mixpanel.track('btn-click', {
id: 'ConfirmTransaction',
Expand All @@ -190,6 +193,8 @@ export const trackingEvents = {
daiAmount,
firstCDP,
txHash,
network,
walletType,
page: Pages.VaultCreate,
section: 'ConfirmVault',
})
Expand Down Expand Up @@ -341,6 +346,8 @@ export const trackingEvents = {
collateralAmount: string,
daiAmount: string,
txHash: string,
network: string,
walletType: ConnectionKind,
) => {
mixpanel.track('btn-click', {
id: 'ConfirmTransaction',
Expand All @@ -349,6 +356,8 @@ export const trackingEvents = {
collateralAmount,
daiAmount,
txHash,
network,
walletType,
page,
section: 'ConfirmVault',
})
Expand Down
5 changes: 5 additions & 0 deletions blockchain/addresses/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@
"MCD_JOIN_MATIC_A": "0x885f16e177d45fC9e7C87e1DA9fd47A9cfcE8E13",
"MCD_CLIP_MATIC_A": "0x29342F530ed6120BDB219D602DaFD584676293d1",
"MCD_CLIP_CALC_MATIC_A": "0xdF8C347B06a31c6ED11f8213C2366348BFea68dB",
"GUNIV3DAIUSDC1":"0xAbDDAfB225e10B90D798bB8A886238Fb835e2053",
"PIP_GUNIV3DAIUSDC1":"0x7F6d78CC0040c87943a0e0c140De3F77a273bd58",
"MCD_JOIN_GUNIV3DAIUSDC1_A":"0xbFD445A97e7459b0eBb34cfbd3245750Dba4d7a4",
"MCD_CLIP_GUNIV3DAIUSDC1_A":"0x5048c5Cd3102026472f8914557A1FD35c8Dc6c9e",
"MCD_CLIP_CALC_GUNIV3DAIUSDC1_A":"0x25B17065b94e3fDcD97d94A2DA29E7F77105aDd7",
"MIP21_LIQUIDATION_ORACLE": "0x88f88Bb9E66241B73B84f3A6E197FbBa487b1E30",
"PROXY_PAUSE_ACTIONS": "0x6bda13D43B7EDd6CAfE1f70fB98b5d40f61A1370",
"PROXY_DEPLOYER": "0x1b93556AB8dcCEF01Cd7823C617a6d340f53Fb58"
Expand Down
15 changes: 15 additions & 0 deletions blockchain/tokensMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,21 @@ const tokens = [
bannerIcon: staticFilesRuntimeUrl('/static/img/banner_icons/uni.svg'),
tags: ['lp-token'],
},
{
symbol: 'GUNIV3DAIUSDC1',
precision: 18,
digits: 5,
digitsInstant: 2,
name: 'GUNIV3DAIUSDC1',
icon: 'uni_circle_color',
iconCircle: 'uni_circle_color',
iconColor: 'uni_circle_color',
color: '#ff077d',
background:
'linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.05) 100%), linear-gradient(99.1deg, #FA46A7 0%, #FF599F 95.28%), linear-gradient(99.1deg, #FF077D 0%, #FF5B79 95.28%)',
bannerIcon: staticFilesRuntimeUrl('/static/img/banner_icons/uni.svg'),
tags: ['lp-token'],
},
{
symbol: 'MATIC',
precision: 18,
Expand Down
2 changes: 2 additions & 0 deletions blockchain/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import ethAbi from 'web3-eth-abi'
import { getToken } from './tokensMetadata'

export function amountFromRay(amount: BigNumber): BigNumber {
BigNumber.config({ DECIMAL_PLACES: RAY.toString().length })
return amount.div(RAY)
}

export function amountFromRad(amount: BigNumber): BigNumber {
BigNumber.config({ DECIMAL_PLACES: RAD.toString().length })
return amount.div(RAD)
}

Expand Down
73 changes: 45 additions & 28 deletions components/AppContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
} from 'blockchain/calls/proxyActions'
import { vatGem, vatIlk, vatUrns } from 'blockchain/calls/vat'
import { createIlkData$, createIlkDataList$, createIlks$ } from 'blockchain/ilks'
import { createGasPrice$, createOraclePriceData$ } from 'blockchain/prices'
import { createGasPrice$, createOraclePriceData$, tokenPricesInUSD$ } from 'blockchain/prices'
import {
createAccountBalance$,
createAllowance$,
Expand Down Expand Up @@ -93,7 +93,7 @@ import { createTransactionManager } from '../features/account/transactionManager
import { BalanceInfo, createBalanceInfo$ } from '../features/shared/balanceInfo'
import { jwtAuthSetupToken$ } from '../features/termsOfService/jwt'
import { createTermsAcceptance$ } from '../features/termsOfService/termsAcceptance'
import { HasGasEstimation } from '../helpers/form'
import { doGasEstimation, HasGasEstimation } from '../helpers/form'

export type TxData =
| OpenData
Expand Down Expand Up @@ -196,6 +196,13 @@ export function setupAppContext() {
const txHelpers$: TxHelpers$ = createTxHelpers$(connectedContext$, send, gasPrice$)
const transactionManager$ = createTransactionManager(transactions$)

function addGasEstimation$<S extends HasGasEstimation>(
state: S,
call: (send: TxHelpers, state: S) => Observable<number> | undefined,
): Observable<S> {
return doGasEstimation(gasPrice$, tokenPricesInUSD$, txHelpers$, state, call)
}

// base
const proxyAddress$ = memoize(curry(createProxyAddress$)(onEveryBlock$, context$))
const proxyOwner$ = memoize(curry(createProxyOwner$)(onEveryBlock$, context$))
Expand Down Expand Up @@ -285,8 +292,8 @@ export function setupAppContext() {
account: string | undefined,
) => Observable<BalanceInfo>

const openVault$ = memoize(
curry(createOpenVault$)(
const openVault$ = memoize((ilk: string) =>
createOpenVault$(
connectedContext$,
txHelpers$,
proxyAddress$,
Expand All @@ -296,6 +303,8 @@ export function setupAppContext() {
ilks$,
ilkData$,
ilkToToken$,
addGasEstimation$,
ilk,
),
)

Expand All @@ -305,8 +314,8 @@ export function setupAppContext() {
`${token}_${slippage.toString()}_${amount.toString()}_${action}`,
)

const openMultiplyVault$ = memoize(
curry(createOpenMultiplyVault$)(
const openMultiplyVault$ = memoize((ilk: string) =>
createOpenMultiplyVault$(
connectedContext$,
txHelpers$,
proxyAddress$,
Expand All @@ -316,36 +325,44 @@ export function setupAppContext() {
ilks$,
ilkData$,
exchangeQuote$,
addGasEstimation$,
ilk,
),
)

const manageVault$ = memoize(
curry(createManageVault$)(
context$,
txHelpers$,
proxyAddress$,
allowance$,
priceInfo$,
balanceInfo$,
ilkData$,
vault$,
saveVaultUsingApi$,
),
(id: BigNumber) =>
createManageVault$(
context$,
txHelpers$,
proxyAddress$,
allowance$,
priceInfo$,
balanceInfo$,
ilkData$,
vault$,
saveVaultUsingApi$,
addGasEstimation$,
id,
),
bigNumberTostring,
)

const manageMultiplyVault$ = memoize(
curry(createManageMultiplyVault$)(
context$,
txHelpers$,
proxyAddress$,
allowance$,
priceInfo$,
balanceInfo$,
ilkData$,
vault$,
exchangeQuote$,
),
(id: BigNumber) =>
createManageMultiplyVault$(
context$,
txHelpers$,
proxyAddress$,
allowance$,
priceInfo$,
balanceInfo$,
ilkData$,
vault$,
exchangeQuote$,
addGasEstimation$,
id,
),
bigNumberTostring,
)

Expand Down
3 changes: 2 additions & 1 deletion components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,9 @@ function LanguageDropdown({ sx }: { sx?: SxStyleProp }) {
<HeaderDropdown title={t(`lang-dropdown.${i18n.language}`)} sx={sx}>
{locales
.filter((lang) => lang !== i18n.language)
.map((lang) => (
.map((lang, index) => (
<Text
key={index}
variant="links.nav"
sx={{ fontWeight: 'body' }}
onClick={() => router.push(router.asPath, router.asPath, { locale: lang })}
Expand Down
41 changes: 40 additions & 1 deletion components/vault/VaultChangesInformation.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Icon } from '@makerdao/dai-ui-icons'
import { Box, Flex, Grid, Text } from '@theme-ui/components'
import { WithChildren } from 'helpers/types'
import BigNumber from 'bignumber.js'
import { GasEstimationStatus } from 'helpers/form'
import { formatAmount } from 'helpers/formatters/format'
import { CommonVaultState, WithChildren } from 'helpers/types'
import React, { ReactNode } from 'react'

export function VaultChangesInformationItem({ label, value }: { label: string; value: ReactNode }) {
Expand Down Expand Up @@ -36,3 +39,39 @@ export function VaultChangesInformationContainer({
export function VaultChangesInformationArrow() {
return <Icon name="arrow_right_light" size="auto" width="10px" height="7px" sx={{ mx: 2 }} />
}

export function getEstimatedGasFeeText(
{ gasEstimationStatus, gasEstimationUsd }: CommonVaultState,
withBrackets = false,
) {
switch (gasEstimationStatus) {
case GasEstimationStatus.calculating:
const textPending = 'Pending...'

return (
<Text sx={{ color: 'text.subtitle' }}>
{withBrackets ? `(${textPending})` : textPending}
</Text>
)
case GasEstimationStatus.error:
case GasEstimationStatus.unknown:
case GasEstimationStatus.unset:
case undefined:
const textError = 'n/a'

return <Text sx={{ color: 'onError' }}>{withBrackets ? `(${textError})` : textError}</Text>
case GasEstimationStatus.calculated:
const textGas = `$${formatAmount(gasEstimationUsd as BigNumber, 'USD')}`

return withBrackets ? `(${textGas})` : textGas
}
}

export function VaultChangesInformationEstimatedGasFee(props: CommonVaultState) {
return (
<VaultChangesInformationItem
label={'Estimated gas fee'}
value={getEstimatedGasFeeText(props)}
/>
)
}
12 changes: 7 additions & 5 deletions features/careers/listings/full-stack-developer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ export const meta = {
area: 'Engineering'
};

## About Oazo
Oazo is the company behind Oasis.app, the front-end to access Maker Protocol and create Dai. Oasis Borrow aims to be the most trusted entry point to the Maker Protocol. The long term mission is to allow users to simply and easily deploy their capital into DeFi and manage it in one trusted place.
## About Us
We are the company behind [Oasis.app](https://oasis.app/), the app to deploy your capital into the Maker Protocol and DeFi. With [Oasis.app](https://oasis.app/) you can borrow Dai or increase your exposure to your favourite crypto. Our mission is to provide the best and most trusted entry point to DeFi.

## The team
We are a team of enthusiastic professionals focused on building and spreading innovative fintech solutions for Web 3.0 and DeFi. You can decide to either work remotely or from our fantastic offices in Warsaw. The team is mostly allocated across Europe.
We are a team of passionate thinkers and builders. You can decide to either work remotely or from our fantastic offices in Warsaw. The team is mostly allocated across Europe.

We operate under Oazo Apps Limited, a company incorporated and registered in the United Kingdom.

## The technology
Our software is coded in JavaScript and TypeScript using RX.js, React (including hooks), Postgres, SQL, NoSQL, GraphQL. While creating our apps, we also use blockchain-related technologies: Ethereum blockchain principles, Solidity, test-nets, and contract deployment scripts.
Expand All @@ -29,12 +30,13 @@ We are looking for a talented Full-Stack Developer with a few years of coding ex
- Minimum 3 years of working experience as a full-stack developer
- Experience with solving technical problems
- High-level knowledge and a high degree of interest in JavaScript and TypeScript
- Degree in Engineering or Computer Science
- Fundamental understanding of Computer Science in theory and in practice

## The nice to haves
- Experience in using Ethereum tools and building DApps accessing Ethereum blockchain
- Understanding of Blockchain primitives and applied cryptography
- Basic knowledge of DeFi and financial concepts and markets
- Degree in Engineering or Computer Science

## Compensation package
- Competitive fixed annual salary
Expand Down
Loading

0 comments on commit 0494af3

Please sign in to comment.