Skip to content

Commit da77b0a

Browse files
committed
bugfixes
1 parent 457d81e commit da77b0a

File tree

6 files changed

+22
-47
lines changed

6 files changed

+22
-47
lines changed

frontend/src/lib/components/Hero.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<h1 class="text-5xl font-bold">ASSEMBLE YOUR <span class="text-primary">HEROES</span>,</h1>
2020
<h1 class="text-5xl font-bold">CONQUER <span class="text-secondary">OASIS</span>,</h1>
2121
<h1 class="text-5xl font-bold">CLAIM YOUR <span class="text-accent">SPOILS OF WAR</span>.</h1>
22-
<p class="py-6">Legions of Oasis is a decentralised play-to-earn metaverse game set in the Oasis Emerald blockchain. Utilising DeFi at its core, the game is built around its own decentralised exchange where playable NFT characters represent shares of liquidity pools.</p>
22+
<p class="py-6">Legions of Oasis is an MMORPG with an integrated DEX built on the Oasis Emerald blockchain. Utilising DeFi at its core, the game is built around its own decentralised exchange where playable NFT characters represent shares of liquidity pools.</p>
2323
<button class="btn btn-primary font-extrabold" on:click={() => goto("/summon")}>GET STARTED</button>
2424
</div>
2525
</div>

frontend/src/lib/components/HeroCard.svelte

+15-15
Original file line numberDiff line numberDiff line change
@@ -166,58 +166,58 @@
166166
/>
167167
</a>
168168
{/if}
169-
{#if heroInfo.gauntlets.toString() !== '0'}
170-
<a href="/equipment/{heroInfo.gauntlets.toString()}">
169+
{#if heroInfo.ring.toString() !== '0'}
170+
<a href="/equipment/{heroInfo.ring.toString()}">
171171
<image
172172
x="37.6"
173173
y="213.4"
174174
width="16"
175175
height="16"
176-
href={`${imgSrc}/equipments/${heroInfo.gauntlets.toString()}.png`}
176+
href={`${imgSrc}/equipments/${heroInfo.ring.toString()}.png`}
177177
/>
178178
</a>
179179
{/if}
180-
{#if heroInfo.legs.toString() !== '0'}
181-
<a href="/equipment/{heroInfo.legs.toString()}">
180+
{#if heroInfo.weapon.toString() !== '0'}
181+
<a href="/equipment/{heroInfo.weapon.toString()}">
182182
<image
183183
x="92.3"
184184
y="213.4"
185185
width="16"
186186
height="16"
187-
href={`${imgSrc}/equipments/${heroInfo.legs.toString()}.png`}
187+
href={`${imgSrc}/equipments/${heroInfo.weapon.toString()}.png`}
188188
/>
189189
</a>
190190
{/if}
191-
{#if heroInfo.weapon.toString() !== '0'}
192-
<a href="/equipment/{heroInfo.weapon.toString()}">
191+
{#if heroInfo.talisman.toString() !== '0'}
192+
<a href="/equipment/{heroInfo.talisman.toString()}">
193193
<image
194194
x="145.8"
195195
y="213.4"
196196
width="16"
197197
height="16"
198-
href={`${imgSrc}/equipments/${heroInfo.weapon.toString()}.png`}
198+
href={`${imgSrc}/equipments/${heroInfo.talisman.toString()}.png`}
199199
/>
200200
</a>
201201
{/if}
202-
{#if heroInfo.talisman.toString() !== '0'}
203-
<a href="/equipment/{heroInfo.talisman.toString()}">
202+
{#if heroInfo.legs.toString() !== '0'}
203+
<a href="/equipment/{heroInfo.legs.toString()}">
204204
<image
205205
x="145.8"
206206
y="175.1"
207207
width="16"
208208
height="16"
209-
href={`${imgSrc}/equipments/${heroInfo.talisman.toString()}.png`}
209+
href={`${imgSrc}/equipments/${heroInfo.legs.toString()}.png`}
210210
/>
211211
</a>
212212
{/if}
213-
{#if heroInfo.ring.toString() !== '0'}
214-
<a href="/equipment/{heroInfo.ring.toString()}">
213+
{#if heroInfo.gauntlets.toString() !== '0'}
214+
<a href="/equipment/{heroInfo.gauntlets.toString()}">
215215
<image
216216
x="145.8"
217217
y="135.8"
218218
width="16"
219219
height="16"
220-
href={`${imgSrc}/equipments/${heroInfo.ring.toString()}.png`}
220+
href={`${imgSrc}/equipments/${heroInfo.gauntlets.toString()}.png`}
221221
/>
222222
</a>
223223
{/if}

frontend/src/lib/components/HeroDetails.svelte

+2-11
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@
137137
valorBalance,
138138
heroInfo,
139139
_pendingPrstg,
140-
estLevelUpCost
141140
] = await Promise.all([
142141
legions.positionForId(id),
143142
heroManager.getAttributesForHero(id),
@@ -146,13 +145,11 @@
146145
valor.balanceOf($address),
147146
heroManager.getHeroLastLevelAttributeCost(id),
148147
legions.pendingPrestige(id),
149-
legions.estimateLevelUpCost(id)
150148
]);
151149
152150
const { name: lpName } = await legions.poolInfo(positionInfo.poolId);
153151
lastAttributeLevelCost = heroInfo;
154152
pendingPrstg = _pendingPrstg;
155-
estimatedLevelUpCost = estLevelUpCost;
156153
blockTimestamp = await getBlockTimestamp($ethereum);
157154
cooldown = await generateCooldown(positionInfo.cooldownTime, $ethereum);
158155
@@ -345,13 +342,7 @@
345342
{toFixed(ethers.utils.formatEther(heroInfo.prestigeAmount))} PRSTG
346343
</div>
347344
</div>
348-
<div class="detail">
349-
<div>Estimated level up cost</div>
350-
<div class="detail-value">
351-
{toFixed(ethers.utils.formatEther(estimatedLevelUpCost))} PRSTG
352-
</div>
353-
</div>
354-
<div class="detail flex flex-col">
345+
<div class="detail flex flex-col w-full">
355346
<div>Next level up</div>
356347
<div class="detail-value">{cooldown}</div>
357348
{#if isOwner}
@@ -369,7 +360,7 @@
369360
{/if}
370361
</div>
371362
<div class="detail">
372-
<div>PRSTG rewards multiplier</div>
363+
<div>PRSTG rewards/governance multiplier</div>
373364
<div class="detail-value">{rewardsMultiplier.toFixed(2)}x</div>
374365
</div>
375366
<div class="detail flex justify-between items-center flex-wrap gap-2">

frontend/src/lib/components/Summon.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
3737
const summon = async () => {
3838
try {
39-
const amount = ethers.utils.parseEther(lpAmount);
39+
const amount = ethers.utils.parseEther(lpAmount.toString());
4040
const tx = await legions.createHeroAndDeposit($address, '0', amount);
4141
await tx.wait();
4242
$balances.hero = $balances.hero.add(1);

frontend/src/lib/contracts/abis.json

-19
Original file line numberDiff line numberDiff line change
@@ -1992,25 +1992,6 @@
19921992
"stateMutability": "nonpayable",
19931993
"type": "function"
19941994
},
1995-
{
1996-
"inputs": [
1997-
{
1998-
"internalType": "uint256",
1999-
"name": "_heroId",
2000-
"type": "uint256"
2001-
}
2002-
],
2003-
"name": "estimateLevelUpCost",
2004-
"outputs": [
2005-
{
2006-
"internalType": "uint256",
2007-
"name": "estimatedCost",
2008-
"type": "uint256"
2009-
}
2010-
],
2011-
"stateMutability": "view",
2012-
"type": "function"
2013-
},
20141995
{
20151996
"inputs": [
20161997
{

frontend/src/lib/helpers.ts

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ export function attributeMap(attribute: string) {
4949

5050
export async function generateCooldown(cooldown: BigNumber, ethereum: any): Promise<string> {
5151
const timestamp = cooldown.toNumber() - await getBlockTimestamp(ethereum)
52+
if (timestamp < 0) {
53+
return "level up ready!"
54+
}
5255

5356
const days = Math.floor(timestamp / 86400)
5457
const hours = Math.floor((timestamp % 86400) / 3600)

0 commit comments

Comments
 (0)