Skip to content

Commit 1ca9a8e

Browse files
committed
Merge branch 'develop' into staking-round
2 parents d0cb664 + 1911485 commit 1ca9a8e

File tree

9 files changed

+46
-37
lines changed

9 files changed

+46
-37
lines changed

vue-app/src/App.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ export default class App extends Vue {
187187
const excludedRoutes = [
188188
'landing',
189189
'join',
190+
'join-step',
190191
'transaction-success',
191192
'verify',
192193
'project-added',

vue-app/src/components/ProjectProfile.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,6 @@ export default class ProjectProfile extends Vue {
205205
const { isRoundContributionPhase, canUserReallocate } = this.$store.getters
206206
return isRoundContributionPhase || canUserReallocate
207207
}
208-
209-
get tokenLogo(): string {
210-
const { nativeTokenSymbol } = this.$store.state.currentRound
211-
return getTokenLogo(nativeTokenSymbol)
212-
}
213208
}
214209
</script>
215210

vue-app/src/components/TransactionModal.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { waitForTransaction } from '@/utils/contracts'
3737
},
3838
})
3939
export default class TransactionModal extends Vue {
40-
@Prop() transactionFn!: () => Promise<TransactionResponse>
40+
@Prop() transaction!: Promise<TransactionResponse>
4141
@Prop() onTxSuccess!: (txHash) => void
4242
4343
txHash = ''
@@ -49,10 +49,7 @@ export default class TransactionModal extends Vue {
4949
5050
private async executeTx() {
5151
try {
52-
await waitForTransaction(
53-
this.transactionFn(),
54-
(hash) => (this.txHash = hash)
55-
)
52+
await waitForTransaction(this.transaction, (hash) => (this.txHash = hash))
5653
5754
this.onTxSuccess(this.txHash)
5855
} catch (error) {

vue-app/src/plugins/Web3/constants/chains.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const CHAIN_INFO: ChainInfo = {
4444
},
4545
[ChainId.HARDHAT]: {
4646
label: 'Arbitrum Hardhat',
47-
currency: 'ETH',
47+
currency: 'AETH',
4848
logo: 'arbitrum.svg',
4949
isLayer2: true,
5050
explorer: 'https://testnet.arbiscan.io',
@@ -55,7 +55,7 @@ export const CHAIN_INFO: ChainInfo = {
5555
},
5656
[ChainId.ARBITRUM_ONE]: {
5757
label: 'Arbitrum',
58-
currency: 'ETH',
58+
currency: 'AETH',
5959
logo: 'arbitrum.svg',
6060
isLayer2: true,
6161
explorer: 'https://arbiscan.io',
@@ -66,7 +66,7 @@ export const CHAIN_INFO: ChainInfo = {
6666
},
6767
[ChainId.ARBITRUM_RINKEBY]: {
6868
label: 'Arbitrum Rinkeby',
69-
currency: 'ETH',
69+
currency: 'AETH',
7070
logo: 'arbitrum.svg',
7171
isLayer2: true,
7272
explorer: 'https://testnet.arbiscan.io',
@@ -77,7 +77,7 @@ export const CHAIN_INFO: ChainInfo = {
7777
},
7878
[ChainId.OPTIMISM]: {
7979
label: 'Optimism',
80-
currency: 'ETH',
80+
currency: 'OETH',
8181
logo: 'optimism.svg',
8282
isLayer2: true,
8383
explorer: 'https://optimistic.etherscan.io',

vue-app/src/store/getters.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,21 @@ const getters = {
175175
state.currentRound.maxContributors <= state.currentRound.contributors
176176
)
177177
},
178+
nativeTokenAddress: (state: RootState): string => {
179+
const { currentRound, factory } = state
180+
181+
let nativeTokenAddress = ''
182+
183+
if (factory) {
184+
nativeTokenAddress = factory.nativeTokenAddress
185+
}
186+
187+
if (currentRound) {
188+
nativeTokenAddress = currentRound.nativeTokenAddress
189+
}
190+
191+
return nativeTokenAddress
192+
},
178193
nativeTokenSymbol: (state: RootState): string => {
179194
const { currentRound, factory } = state
180195

vue-app/src/views/AboutContributors.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ import { ChainInfo } from '@/plugins/Web3/constants/chains'
103103
export default class AboutContributors extends Vue {
104104
// TODO: update to new getter
105105
get nativeTokenSymbol(): string {
106-
const { nativeTokenSymbol } = this.$store.state.currentRound
107-
return nativeTokenSymbol
106+
return this.$store.getters.nativeTokenSymbol
108107
}
109108
110109
get chain(): ChainInfo {

vue-app/src/views/AboutHowItWorks.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export default class AboutHowItWorks extends Vue {
167167
}
168168
169169
get nativeTokenSymbol(): string {
170-
return this.$store.state?.currentRound?.nativeTokenSymbol
170+
return this.$store.getters.nativeTokenSymbol
171171
}
172172
173173
// TODO: should we hardcode defaults instead of TBD for our round?

vue-app/src/views/AboutLayer2.vue

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -131,28 +131,27 @@
131131
</li>
132132
<li>
133133
Select currency (some ETH first for gas, and some
134-
{{ nativeToken.symbol }} for contributing)
134+
{{ nativeTokenSymbol }} for contributing)
135135
<p>
136-
For {{ nativeToken.symbol }}, click "Token" menu, search for
137-
{{ nativeToken.symbol }}
136+
For {{ nativeTokenSymbol }}, click "Token" menu, search for
137+
{{ nativeTokenSymbol }}
138138
and select token.
139139
</p>
140140
</li>
141141
<li>Enter amount and click "Deposit"</li>
142142
<li>Confirm on your wallet</li>
143143
</ol>
144144
<p>
145-
Once you have bridged your {{ nativeToken.symbol }} to
146-
{{ chain.label }}, you may want to add the
147-
<links :to="blockExplorerUrl">token</links> to your wallet e.g. in
148-
MetaMask.
145+
Once you have bridged your {{ nativeTokenSymbol }} to {{ chain.label }},
146+
you may want to add the <links :to="blockExplorerUrl">token</links> to
147+
your wallet e.g. in MetaMask.
149148
</p>
150149
<button
151150
v-if="currentUser && isMetaMask"
152151
class="btn-secondary"
153152
@click="addTokenToWallet"
154153
>
155-
Add {{ chain.label }} {{ nativeToken.symbol }} to MetaMask
154+
Add {{ chain.label }} {{ nativeTokenSymbol }} to MetaMask
156155
</button>
157156
</div>
158157
<!-- If chain isn't Arbitrum, but still has a bridge URL, display its information: -->
@@ -216,9 +215,9 @@ export default class AboutLayer2 extends Vue {
216215
params: {
217216
type: 'ERC20',
218217
options: {
219-
address: this.nativeToken.address,
220-
symbol: this.nativeToken.symbol,
221-
decimals: this.nativeToken.decimals,
218+
address: this.nativeTokenAddress,
219+
symbol: this.nativeTokenSymbol,
220+
decimals: this.nativeTokenDecimals,
222221
},
223222
},
224223
})
@@ -237,17 +236,20 @@ export default class AboutLayer2 extends Vue {
237236
return chain
238237
}
239238
240-
get nativeToken(): { [key: string]: any } {
241-
const {
242-
nativeTokenSymbol: symbol,
243-
nativeTokenAddress: address,
244-
nativeTokenDecimals: decimals,
245-
} = this.$store.state.currentRound
246-
return { symbol, address, decimals }
239+
get nativeTokenAddress(): string {
240+
return this.$store.getters.nativeTokenAddress
241+
}
242+
243+
get nativeTokenSymbol(): string {
244+
return this.$store.getters.nativeTokenSymbol
245+
}
246+
247+
get nativeTokenDecimals(): number | undefined {
248+
return this.$store.getters.nativeTokenDecimals
247249
}
248250
249251
get blockExplorerUrl(): string {
250-
return `${chain.explorer}/address/${this.nativeToken.address}`
252+
return `${chain.explorer}/address/${this.nativeTokenAddress}`
251253
}
252254
}
253255
</script>

vue-app/src/views/RecipientRegistry.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export default class RecipientRegistryView extends Vue {
269269
this.$modal.show(
270270
TransactionModal,
271271
{
272-
transactionFn: () => transaction,
272+
transaction,
273273
onTxSuccess: async () => {
274274
// TODO: this is not ideal. Leaving as is, just because it is an admin
275275
// page where no end user is using. We are forcing this 2s time to give

0 commit comments

Comments
 (0)