Skip to content

Commit

Permalink
feat(bsc): new BSC farm on PCS
Browse files Browse the repository at this point in the history
  • Loading branch information
wrap-that-potassium committed Mar 13, 2024
1 parent 667edc6 commit afe0759
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# v2.6.9
## New Features
- new PancakeSwap farm for wBAN-USDC
## Bugs
- web3 wallet was not auto-reconnecting on page reload
- deposit dialog layout issue on desktop #122
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/config/constants/bsc/dex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DEXAggregator } from '@/models/dex/SwapQuote'

export default class DEX {
getDexUrl() {
return 'https://pancakeswap.finance'
return 'https://pancakeswap.finance/v2'
}
getDexAggregator(): DEXAggregator {
return '0x'
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/config/constants/bsc/farms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ export default class BSCFarms {
token: tokens.wban,
quoteToken: tokens.busd,
},
{
pid: 4,
lpSymbol: 'wBAN-USDC (PancakeSwap)',
lpAddresses: {
dev: '',
staging: '0x76B1aB2f84bE3C4a103ef1d2C2a74145414FFA49',
production: '0x76B1aB2f84bE3C4a103ef1d2C2a74145414FFA49',
},
token: tokens.wban,
quoteToken: tokens.usdc,
},
]
}
}
10 changes: 10 additions & 0 deletions frontend/src/config/constants/bsc/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ const tokens: TokensList = {
decimals: 18,
projectLink: 'https://www.paxos.com/busd/',
},
usdc: {
symbol: 'USDC',
address: {
dev: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d',
staging: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d',
production: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d',
},
decimals: 6,
projectLink: 'https://www.circle.com',
},
}

export default tokens
6 changes: 3 additions & 3 deletions frontend/src/utils/dialogs/FarmDepositDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,15 @@ export default class FarmDepositDialog extends Vue {
addLiquidity() {
if (this.farm.quoteToken.address) {
const otherToken = this.farm.quoteToken.address[FarmDepositDialog.ENV_NAME as keyof Address]
if (getDexUrl() === 'https://app.sushi.com/legacy' || getDexUrl() === 'https://pancakeswap.finance') {
openURL(`${getDexUrl()}/add/${this.wbanAddress}/${otherToken}?chainId=${this.network.chainIdNumber}`)
if (getDexUrl() === 'https://app.sushi.com/legacy' || getDexUrl().startsWith('https://pancakeswap.finance')) {
openURL(`${getDexUrl()}/add/0xe20B9e246db5a0d21BF9209E4858Bc9A3ff7A034/${otherToken}?chainId=${this.network.chainIdNumber}`)

Check failure on line 246 in frontend/src/utils/dialogs/FarmDepositDialog.vue

View workflow job for this annotation

GitHub Actions / dApp

Replace ``${getDexUrl()}/add/0xe20B9e246db5a0d21BF9209E4858Bc9A3ff7A034/${otherToken}?chainId=${this.network.chainIdNumber}`` with `⏎↹↹↹↹↹`${getDexUrl()}/add/0xe20B9e246db5a0d21BF9209E4858Bc9A3ff7A034/${otherToken}?chainId=${⏎↹↹↹↹↹↹this.network.chainIdNumber⏎↹↹↹↹↹}`,⏎↹↹↹↹`
} else if (getDexUrl() === 'https://app.uniswap.org') {
openURL(`${getDexUrl()}/#/add/v2/${this.wbanAddress}/${otherToken}`)
} else {
openURL(`${getDexUrl()}/#/add/${this.wbanAddress}/${otherToken}`)
}
} else {
if (getDexUrl() === 'https://app.sushi.com/legacy' || getDexUrl() === 'https://pancakeswap.finance') {
if (getDexUrl() === 'https://app.sushi.com/legacy' || getDexUrl().startsWith('https://pancakeswap.finance')) {
openURL(`${getDexUrl()}/add/${this.wbanAddress}/ETH?chainId=${this.network.chainIdNumber}`)
} else if (getDexUrl() === 'https://app.uniswap.org') {
openURL(`${getDexUrl()}/#/add/v2/${this.wbanAddress}/ETH`)
Expand Down
13 changes: 4 additions & 9 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7443,15 +7443,10 @@ caniuse-api@^3.0.0:
lodash.memoize "^4.1.2"
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001349, caniuse-lite@^1.0.30001400:
version "1.0.30001512"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001512.tgz"
integrity sha512-2S9nK0G/mE+jasCUsMPlARhRCts1ebcp2Ji8Y8PWi4NDE1iRdLCnEPHkEfeBrGC45L4isBx5ur3IQ6yTE2mRZw==

caniuse-lite@^1.0.30001517:
version "1.0.30001520"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001520.tgz#62e2b7a1c7b35269594cf296a80bdf8cb9565006"
integrity sha512-tahF5O9EiiTzwTUqAeFjIZbn4Dnqxzz7ktrgGlMYNLH43Ul26IgTMH/zvL3DG0lZxBYnlT04axvInszUsZULdA==
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001349, caniuse-lite@^1.0.30001400, caniuse-lite@^1.0.30001517:
version "1.0.30001597"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001597.tgz"
integrity sha512-7LjJvmQU6Sj7bL0j5b5WY/3n7utXUJvAe1lxhsHDbLmwX9mdL86Yjtr+5SRCyf8qME4M7pU2hswj0FpyBVCv9w==

capture-exit@^2.0.0:
version "2.0.0"
Expand Down

0 comments on commit afe0759

Please sign in to comment.