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

dApp staking v3 #1023

Merged
merged 77 commits into from
Jan 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
2faa522
Defined v3 project structure
bobo-k2 Oct 10, 2023
05ca294
Stake, unstake skeletons
bobo-k2 Oct 10, 2023
3165911
Code organization improvements
bobo-k2 Oct 12, 2023
bd72bd2
Get protocol state
bobo-k2 Oct 30, 2023
c97a82c
Protocol change notification message
bobo-k2 Oct 31, 2023
cf82b2c
Merge branch 'main' into feat/dapp-staking-v3
bobo-k2 Oct 31, 2023
602f2bb
Lock and stake
bobo-k2 Oct 31, 2023
8be2738
Read account ledger
bobo-k2 Oct 31, 2023
80f9cea
Unstake call
bobo-k2 Nov 2, 2023
69fd2c1
unstake and unlock, claim staker
bobo-k2 Nov 3, 2023
02e3569
Staker info
bobo-k2 Nov 3, 2023
cd96a18
Started with can stake logic
bobo-k2 Nov 3, 2023
981a64d
Updated node types
bobo-k2 Nov 8, 2023
d79acdc
Staker reward calculation part 1
bobo-k2 Nov 10, 2023
eccface
Staker rewards calculation part 2
bobo-k2 Nov 11, 2023
2eeb12d
dApp rewards calculation and claim
bobo-k2 Nov 13, 2023
4300015
Calculate and claim bonus rewards
bobo-k2 Nov 13, 2023
dafbeef
Merge branch 'main' of github.com-impelcrypto:AstarNetwork/astar-apps…
impelcrypto Nov 14, 2023
f9e37cf
Calculate claim staker batch size fix
bobo-k2 Nov 14, 2023
c484606
Merge branch 'feat/dapp-staking-v3' of github.com:AstarNetwork/astar-…
bobo-k2 Nov 14, 2023
39f2723
Rewards fetch fix
bobo-k2 Nov 15, 2023
92b2575
can claim methods
bobo-k2 Nov 15, 2023
2d10a35
Can Claim bug fix
bobo-k2 Nov 15, 2023
6a5cbb9
fix: conflicts
impelcrypto Nov 16, 2023
08a4123
feat: Prevents Errors from Occuring (#1026)
gluneau Nov 16, 2023
879705a
feat: added top page (#1033)
impelcrypto Nov 20, 2023
1d72212
Vote mobile page and logic (#1036)
bobo-k2 Nov 20, 2023
d138309
Vote batch bug fixes
bobo-k2 Nov 20, 2023
bd3d882
vote and dictionary changes (#1037)
gluneau Nov 21, 2023
493e7a2
Vote on multiple dApps (#1046)
bobo-k2 Nov 23, 2023
e5a82f4
feat: link to the project page (#1049)
impelcrypto Nov 24, 2023
fafa2bd
styles: added 'current tier' and 'total earned' (#1053)
impelcrypto Nov 28, 2023
e3be666
pulled latest main branch (#1057)
impelcrypto Nov 29, 2023
988912e
Staking panels and leaderboard (#1056)
bobo-k2 Nov 29, 2023
b529b3a
feat: added owner section on the assets page (#1059)
impelcrypto Nov 30, 2023
809538f
Staking v3 data (#1064)
bobo-k2 Dec 1, 2023
364c344
Compatibility issues fix (#1075)
bobo-k2 Dec 5, 2023
246f020
feat: maxUnlockingChunks (#1071)
gluneau Dec 5, 2023
d66ada2
Merge branch 'main' into feat/dapp-staking-v3
bobo-k2 Dec 7, 2023
0310cc2
Remove commented
bobo-k2 Dec 7, 2023
6b3337e
feat: added owner section (#1079)
impelcrypto Dec 7, 2023
0cd3444
fix: copy the project page components to the staking-v3 folder (#1085)
impelcrypto Dec 11, 2023
3608a6a
Owner page logic and unstake from unregistered (#1088)
bobo-k2 Dec 12, 2023
ade332b
Feat/staking v3 improvements4 (#1089)
bobo-k2 Dec 14, 2023
727639b
Merge branch 'main' into feat/dapp-staking-v3
bobo-k2 Dec 20, 2023
caaaf72
Add Shibuya Scope Style (#1078)
ayumitk Dec 20, 2023
30743f4
Show success messages and tier rewards (#1097)
bobo-k2 Dec 21, 2023
3899ceb
dApp search bug fix, amount to be locked fix
bobo-k2 Dec 21, 2023
783d75d
Build error fix
bobo-k2 Dec 21, 2023
a0a4f7b
Nomination transfer
bobo-k2 Dec 22, 2023
e90bcd0
Disable Vote button if no stakes.
bobo-k2 Dec 22, 2023
af705b2
Reward calculation fix, unlock
bobo-k2 Dec 27, 2023
ae8db28
v3 vote period style (#1098)
ayumitk Dec 28, 2023
75cb4ad
Show nomination transfer info on Voting page
bobo-k2 Dec 28, 2023
dc84ab8
Merge branch 'main' into feat/dapp-staking-v3
bobo-k2 Dec 29, 2023
0141319
feat: added EVM supports (#1102)
impelcrypto Dec 29, 2023
ff40d60
EVM unlock fix
bobo-k2 Dec 29, 2023
43a3b32
fix: added todo comment
impelcrypto Dec 29, 2023
60f1f95
GetTier bug fix and removed some comments
bobo-k2 Dec 29, 2023
51ef615
Merge branch 'feat/dapp-staking-v3' of github.com:AstarNetwork/astar-…
bobo-k2 Dec 29, 2023
13f5be1
fix: removed unused files
impelcrypto Dec 29, 2023
ab5fa57
Comments cleanup
bobo-k2 Dec 29, 2023
e36c1f2
Merge branch 'feat/dapp-staking-v3' of github.com:AstarNetwork/astar-…
bobo-k2 Dec 29, 2023
fa15821
Gas price provider fix
bobo-k2 Dec 29, 2023
71b7f60
Message subscriptions, check value before assignment.
bobo-k2 Dec 29, 2023
9f15773
Nomination transfer bug fix, styling and translations
bobo-k2 Dec 29, 2023
8721679
Nomination transfer amount, total stake
bobo-k2 Jan 3, 2024
c82e7ab
Leaderboard fix, multiplier removed
bobo-k2 Jan 3, 2024
db8e201
Staker reward calculation optimisation
bobo-k2 Jan 4, 2024
c242ae2
Merge branch 'main' into feat/dapp-staking-v3
bobo-k2 Jan 4, 2024
3a7af62
Clam banner text update for Shibuya
bobo-k2 Jan 4, 2024
de005f5
Voting period countdown
bobo-k2 Jan 4, 2024
9576d94
Current period day and canConfirm fixes
bobo-k2 Jan 5, 2024
ea3f67b
feat: update project page styles (#1109)
ayumitk Jan 8, 2024
79306d9
feat: add migrate support style (#1114)
ayumitk Jan 8, 2024
535b58f
Hide migration support for now
bobo-k2 Jan 8, 2024
2e6263e
feat: added staker and bonus rewards APR (#1113)
impelcrypto Jan 8, 2024
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
Prev Previous commit
Next Next commit
feat: added owner section (#1079)
* feat: added rewards section

* feat: added edit section

* fix: refactor

* fix: i18
impelcrypto authored Dec 7, 2023
commit 6b3337e498fb53d329de8c48d08a38a1599a0c75
4 changes: 2 additions & 2 deletions src/components/dapp-staking/dapp/DappStatistics.vue
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
<div class="row--statistics">
<div>
<span class="text--statistics-title">
{{ $t('dappStaking.dappPage.v3.currentTier') }}
{{ $t('stakingV3.currentTier') }}
</span>
</div>
<div>
@@ -46,7 +46,7 @@
<div class="row--statistics">
<div>
<span class="text--statistics-title">
{{ $t('dappStaking.dappPage.v3.totalEarned') }}
{{ $t('stakingV3.totalEarned') }}
</span>
</div>
<div>
8 changes: 5 additions & 3 deletions src/css/quasar.variables.scss
Original file line number Diff line number Diff line change
@@ -12,15 +12,17 @@ $gray-7: #222829;
$navy-1: #080f2e;
$navy-2: #060b23;
$navy-3: #1f2f5f;
$navy-4: #141E3E;
$navy-4: #141e3e;

$object-light: #e6e9ee;
$modal-item-bg-dark: #141c34;

$astar-blue: #0085ff;
$astar-blue-dark: #05b6fd;
$astar-pink: #E0338F;
$astar-purple: #703AC2;
$astar-pink: #e0338f;
$astar-pink-01: rgba(230, 0, 122, 1);

$astar-purple: #703ac2;
$shiden-purple: #770cff;
$shiden-purple-dark: #a67cff;
$warning-red: #ff5621;
29 changes: 25 additions & 4 deletions src/i18n/en-US/index.ts
Original file line number Diff line number Diff line change
@@ -353,10 +353,6 @@ export default {
community: 'Community',
wallets: 'Wallets',
stats: 'Stats',
v3: {
currentTier: 'Current Tier',
totalEarned: 'Total Earned',
},
},
modals: {
contractAddress: 'Contract address {address}',
@@ -730,6 +726,7 @@ export default {
basicRewards: 'Basic rewards',
bonusRewards: 'Bonus rewards',
dAppRewards: 'dApp rewards',

tokensToBeLocked: 'Tokens to be locked',
additionalTokensLockedWarning:
'Additional tokens will be locked to be able to vote a desired amount.',
@@ -760,6 +757,30 @@ export default {
unbondingAmount: 'Unbonding amount',
withdraw: 'Withdraw',
relock: 'Re-lock',
currentTier: 'Current Tier',
numberOfStakers: 'Number of Stakers',
totalEarned: 'Total Earned',
yourDashboard: 'Your Dashboard',
edit: 'Edit',
editProjectPage: {
title: 'Edit Project Page',
text: 'You can change the images, description at any time.',
},
editYourInfo: {
title: 'Edit your owner info',
text: 'If you wish to change registered smart contract or rewards receiving address.',
},
addPromotion: {
title: 'Add a promotion card',
text: 'If you have anything to share with the community, you can create a card on the top page to promote about it!',
},
yourRewards: 'Your Rewards',
availableToClaim: 'Available to claim',
alreadyClaimed: 'Already claimed',
days: '{day} days',
claimed: 'Claimed',
period: 'Period {period}',
claimNow: 'Claim these rewards now, as they will expire at the end of the current period.',
remainingEras: 'Remaining eras / blocks',
back: 'Back',
day: 'Day',
52 changes: 52 additions & 0 deletions src/staking-v3/components/Edit.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<template>
<div class="wrapper--edit">
<div class="row--title">
<span> {{ $t('stakingV3.edit') }} </span>
</div>
<div class="box--links">
<!-- Todo: add links -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add the logic for owner page in this PR? If so, let's add the links

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave this for the future PR

<div class="box--link">
<div class="box__top" />
<div class="box__middle">
<span>{{ $t('stakingV3.editProjectPage.title') }}</span>
</div>
<div class="box__bottom">
<span>{{ $t('stakingV3.editProjectPage.text') }}</span>
</div>
</div>
<div class="box--link">
<div class="box__top" />
<div class="box__middle">
<span>{{ $t('stakingV3.editYourInfo.title') }}</span>
</div>
<div class="box__bottom">
<span>{{ $t('stakingV3.editYourInfo.text') }}</span>
</div>
</div>
<div class="box--link">
<div class="box__top" />
<div class="box__middle">
<span>{{ $t('stakingV3.addPromotion.title') }}</span>
</div>
<div class="box__bottom">
<span>{{ $t('stakingV3.addPromotion.text') }}</span>
</div>
</div>
</div>
</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';

export default defineComponent({
components: {},
setup() {
return {};
},
});
</script>

<style lang="scss" scoped>
@use './styles/edit.scss';
</style>
44 changes: 36 additions & 8 deletions src/staking-v3/components/Owner.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,51 @@
<template>
<div class="wrapper--owner">
<span>This is Owner page</span>
<div v-if="dappAddress">
<p>{{ dappAddress }}</p>
<div v-if="dappAddress && dapp" class="wrapper--owner">
<div class="row--your-dashboard">
<span>{{ $t('stakingV3.yourDashboard') }}</span>
</div>
<div class="container--dapp-hero">
<img :src="dapp.basic.iconUrl" alt="icon" class="img--dapp-icon" />
<span class="text--dapp-name">{{ dapp.basic.name }}</span>
<div class="row--your-dashboard-mobile">
<span>{{ $t('stakingV3.yourDashboard') }}</span>
</div>
</div>
<div class="row--statistics">
<kpi-card :title="$t('stakingV3.currentTier')">2</kpi-card>
<kpi-card :title="$t('stakingV3.numberOfStakers')">100</kpi-card>
<kpi-card :title="$t('stakingV3.totalEarned')">
{{ $t('amountToken', { amount: 100, token: nativeTokenSymbol }) }}
</kpi-card>
</div>
<your-rewards />
<edit />
</div>
</template>

<script lang="ts">
import { defineComponent, computed } from 'vue';
import { useNetworkInfo } from 'src/hooks';
import { computed, defineComponent } from 'vue';
import { useRoute } from 'vue-router';
import { useDapps } from '../hooks';
import { CombinedDappInfo } from '../logic';
import Edit from './Edit.vue';
import KpiCard from './KpiCard.vue';
import YourRewards from './YourRewards.vue';

export default defineComponent({
components: {},
// Todo: redirect to discover page if the connected account is not the owner
components: { KpiCard, YourRewards, Edit },
setup() {
const route = useRoute();
const { nativeTokenSymbol } = useNetworkInfo();
const dappAddress = computed<string>(() => route.query.dapp as string);
return { dappAddress };
const { registeredDapps } = useDapps();
const dapp = computed<CombinedDappInfo>(() => {
return registeredDapps.value.find(
(dapp) => dapp.chain.address === dappAddress.value
) as CombinedDappInfo;
});

return { dappAddress, dapp, nativeTokenSymbol };
},
});
</script>
185 changes: 185 additions & 0 deletions src/staking-v3/components/YourRewards.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
<template>
<div class="wrapper--your-rewards">
<div class="row--title">
<span> {{ $t('stakingV3.yourRewards') }} </span>
</div>
<!-- Memo: Temporary UI -->
<div class="row--claim-temporary">
<div>
<span class="text--lg">Unclaimed Eras: </span>
<span class="text--lg">20</span>
</div>
<div>
<span class="text--lg">Claimable Amount: </span>
<span class="text--lg">
{{ $t('amountToken', { amount: 100, token: nativeTokenSymbol }) }}
</span>
</div>
<div>
<astar-button class="button--claim">
{{ $t('stakingV3.claim') }}
</astar-button>
</div>
</div>
<!-- Memo: mocked UI -->
<div class="container--rewards">
<div class="box--rewards">
<div class="box__row">
<div>
<span class="text--title">
{{ $t('stakingV3.period', { period: '006' }) }}
</span>
</div>
<div class="row--claim-info">
<div>
<span class="text--vivid">
{{ $t('stakingV3.availableToClaim') }}
</span>
</div>
<div>
<div>
<span class="text--vivid">
{{ $t('stakingV3.days', { day: 10 }) }}
</span>
</div>
<div>
<span class="text--vivid-bond">
<token-balance :balance="'1000'" :symbol="nativeTokenSymbol" />
</span>
</div>
</div>
</div>
</div>
<div class="box__row">
<div>
<span class="text--title">
{{ $t('stakingV3.period', { period: '005' }) }}
</span>
</div>
<div class="row--claim-info">
<div>
<span class="text--info"> {{ $t('stakingV3.alreadyClaimed') }}</span>
</div>
<div>
<div>
<span class="text--info">
{{ $t('stakingV3.days', { day: 10 }) }}
</span>
</div>
<div>
<span class="text--info-bond">
<token-balance :balance="'1000'" :symbol="nativeTokenSymbol" />
</span>
</div>
</div>
</div>
<div class="row--claim-info">
<div>
<span class="text--vivid"> {{ $t('stakingV3.availableToClaim') }}</span>
</div>
<div>
<div>
<span class="text--vivid">
{{ $t('stakingV3.days', { day: 10 }) }}
</span>
</div>
<div>
<span class="text--vivid-bond">
<token-balance :balance="'1000'" :symbol="nativeTokenSymbol" />
</span>
</div>
</div>
</div>
<div class="row--attention">
<span> {{ $t('stakingV3.claimNow') }}</span>
</div>
</div>
<div>
<astar-button class="button--claim">
{{ $t('stakingV3.claim') }}
</astar-button>
</div>
</div>

<div>
<div class="box--rewards">
<div class="box__row">
<div class="row--claim-info">
<div class="box__column">
<div>
<span class="text--title">
{{ $t('stakingV3.period', { period: '004' }) }}
</span>
</div>
<div>
<span class="text--info">
{{ $t('stakingV3.days', { day: 123 }) }}
</span>
</div>
</div>
<div class="box__column">
<div class="column--status-claimed">
<span>
{{ $t('stakingV3.claimed') }}
</span>
</div>
<div>
<span class="text--info-bond">
<token-balance :balance="'1000'" :symbol="nativeTokenSymbol" />
</span>
</div>
</div>
</div>
</div>
<div class="box__row">
<div class="row--claim-info">
<div class="box__column">
<div>
<span class="text--title">
{{ $t('stakingV3.period', { period: '003' }) }}
</span>
</div>
<div>
<span class="text--info">
{{ $t('stakingV3.days', { day: 123 }) }}
</span>
</div>
</div>
<div class="box__column">
<div class="column--status-claimed">
<span>
{{ $t('stakingV3.claimed') }}
</span>
</div>
<div>
<span class="text--info-bond">
<token-balance :balance="'1000'" :symbol="nativeTokenSymbol" />
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>

<script lang="ts">
import { useNetworkInfo } from 'src/hooks';
import { defineComponent } from 'vue';
import TokenBalance from 'src/components/common/TokenBalance.vue';

export default defineComponent({
components: { TokenBalance },
setup() {
const { nativeTokenSymbol } = useNetworkInfo();

return { nativeTokenSymbol };
},
});
</script>

<style lang="scss" scoped>
@use './styles/your-rewards.scss';
</style>
Loading