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

chore: home page banner update #187

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8f70036
chore: formatted tvl data
hemantwasthere Oct 5, 2024
8fd4212
Merge branch 'dev' of https://github.com/hemantwasthere/starkfarm-cli…
hemantwasthere Oct 5, 2024
d929f2f
fix: added dollar sign before tvl data
hemantwasthere Oct 5, 2024
15a7884
fix: removed dollar sign : )
hemantwasthere Oct 5, 2024
a584239
fix: undefined tvl formatting issue
akiraonstarknet Oct 5, 2024
2ba8923
fix: compile error in TVL
hemantwasthere Oct 5, 2024
b0bdfc0
Merge branch 'dev' of https://github.com/hemantwasthere/starkfarm-cli…
hemantwasthere Oct 23, 2024
4d2754a
chore: raffle implementation
hemantwasthere Oct 25, 2024
1741d4d
Merge pull request #1 from hemantwasthere/feat/raffle
hemantwasthere Oct 25, 2024
93471cd
chore: deploy trigger
hemantwasthere Oct 25, 2024
8c0bfa5
chore: updated cron expression
hemantwasthere Oct 25, 2024
478fddf
chore: updated cron expression
hemantwasthere Oct 25, 2024
a5b131f
chore: updated cron expression
hemantwasthere Oct 25, 2024
4c15c9a
chore: update route method
hemantwasthere Oct 25, 2024
b8bb738
chore: update route logic
hemantwasthere Oct 25, 2024
31e651d
chore: updated cron expression
hemantwasthere Oct 25, 2024
898849c
chore: updated cron expression
hemantwasthere Oct 25, 2024
1a526da
chore: code refactor
hemantwasthere Oct 28, 2024
050619b
chore: updated lucky winner route
hemantwasthere Oct 28, 2024
78662f0
fix: added cron secret
hemantwasthere Oct 28, 2024
0dd8b16
chore: updated lucky winner route.ts
hemantwasthere Oct 29, 2024
b596f2a
chore: ui updates on raffle page
hemantwasthere Nov 1, 2024
e896679
fix: bugs and ui tweaks
hemantwasthere Nov 1, 2024
8775a62
chore: text update
hemantwasthere Nov 1, 2024
ca65f23
raffle page text fixes
akiraonstarknet Nov 3, 2024
400722e
enable mobile actions
akiraonstarknet Nov 3, 2024
0665bba
raffle::select winners:: add debug logs
akiraonstarknet Nov 4, 2024
7ce7fc3
raffle: add rt post link
akiraonstarknet Nov 4, 2024
3573b10
add raffle know more link
akiraonstarknet Nov 6, 2024
e8a73f9
Merge pull request #100 from akiraonstarknet/prod
akiraonstarknet Nov 6, 2024
c2251db
Add dnmm reverse (#101)
akiraonstarknet Nov 6, 2024
dd7a833
fix haiko api bug
akiraonstarknet Nov 6, 2024
96ef905
update eth xl address
akiraonstarknet Nov 12, 2024
73919e3
update audit info on XL pool
akiraonstarknet Nov 12, 2024
86cd737
fix: ekubo logo
hemantwasthere Nov 14, 2024
380c56c
Merge branch 'dev' of https://github.com/hemantwasthere/starkfarm-cli…
hemantwasthere Nov 14, 2024
ec3e860
fix mobile wallet issue
akiraonstarknet Nov 20, 2024
d04cd3e
Merge branch 'dev' of github.com:akiraonstarknet/starkfarm-client int…
akiraonstarknet Nov 20, 2024
765513f
fix mobile wallet issue [2]
akiraonstarknet Nov 20, 2024
1922eb3
fix mobile connect issues
akiraonstarknet Nov 21, 2024
f0d502c
auto connect bug
akiraonstarknet Nov 21, 2024
9d34cc2
fix build issue
akiraonstarknet Nov 21, 2024
5e4c07a
remove raffle
akiraonstarknet Nov 21, 2024
5812c4c
disable fetch err toast
akiraonstarknet Nov 23, 2024
807f68b
fix dappname
akiraonstarknet Nov 23, 2024
20cfa93
Merge branch 'strkfarm:dev' into dev
hemantwasthere Nov 24, 2024
0053d70
chore: update home page banner
hemantwasthere Nov 24, 2024
ac2a319
Merge branch 'xstrk_strat' into dev
akiraonstarknet Nov 24, 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
62 changes: 62 additions & 0 deletions public/banners/endur.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions public/banners/endur_mobile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 49 additions & 63 deletions src/app/api/tnc/signUser/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,9 @@
const mixpanel = Mixpanel.init('118f29da6a372f0ccb6f541079cad56b');

export async function POST(req: Request) {
const { address, signature, _signature } = await req.json();

console.debug(
'address',
address,
'signature',
signature,
'_signature',
_signature,
);
const { address, signature } = await req.json();

console.debug('address', address, 'signature', signature);
if (!address || !signature) {
return NextResponse.json({
success: false,
Expand Down Expand Up @@ -57,64 +50,64 @@
console.debug(`Verifying signature for address: ${parsedAddress}`);
console.debug(`SIGNING_DATA`, SIGNING_DATA);
const hash = await myAccount.hashMessage(SIGNING_DATA);
try {
// await debug();
isValid = await verifyMessageHash(myAccount, hash, parsedSignature);
console.debug('isValid', isValid);
mixpanel.track('TnC signed', {
address,
signature,
_signature,
step: 1,
hash,
});
} catch (error) {
console.error('verification failed [1]:', error);
if (_signature) {
console.debug('hash', hash);

const function_sigs = ['is_valid_signature', 'isValidSignature'];
const signatures = [
parsedSignature,
parsedSignature.slice(parsedSignature.length - 2, parsedSignature.length),
];

for (const fn_sig of function_sigs) {
for (const sig of signatures) {
try {
const parsedSignature2 = JSON.parse(_signature) as string[];
isValid = await verifyMessageHash(myAccount, hash, parsedSignature2);
console.log(`Checking: ${fn_sig}`);
console.log(`Signature: ${JSON.stringify(sig)}`);
isValid = await verifyMessageHash(myAccount, hash, sig, fn_sig);
console.debug('isValid', isValid);
mixpanel.track('TnC signed', {
address,
signature,
_signature,
step: 1,
hash,
step: 2,
});
} catch (err) {
console.error('verification failed [2]:', err);

// temporarily accepting all signtures
isValid = true;
mixpanel.track('TnC signing failed', {
address,
signature,
hash,
isValid,
_signature,
fn_sig,
});
break;
} catch (error) {
console.warn(`verification failed [${fn_sig}]:`, error);
}
}
if (isValid) {
break;
}
}

if (!isValid) {
mixpanel.track('TnC signing failed', {
address,
signature,
_signature,
hash,
isValid,
});
isValid = true; // temporarily accepting all signtures
}
// if (!isValid) {
// mixpanel.track('TnC signing failed', {
// address,
// signature,
// hash,
// isValid,
// });
// isValid = true; // temporarily accepting all signtures
// }

if (!isValid) {
return NextResponse.json({
success: false,
message: 'Invalid signature. Ensure account is deployed.',
user: null,
});
try {
const cls = await provider.getClassAt(address, 'pending');

Check warning on line 97 in src/app/api/tnc/signUser/route.ts

View workflow job for this annotation

GitHub Actions / Performs linting, formatting on the application

'cls' is assigned a value but never used. Allowed unused vars must match /^_/u
// means account is deployed
return NextResponse.json({
success: false,
message: 'Invalid signature. Please contact us if issue persists.',
user: null,
});
} catch (error) {
return NextResponse.json({
success: false,
message: 'Invalid signature. Ensure account is deployed.',
user: null,
});
}
}

const user = await db.user.findFirst({
Expand Down Expand Up @@ -185,19 +178,12 @@
}),
});
console.debug('verifyMessageHash resp', resp);
if (Number(resp[0]) == 0) {

Check warning on line 181 in src/app/api/tnc/signUser/route.ts

View workflow job for this annotation

GitHub Actions / Performs linting, formatting on the application

Expected '===' and instead saw '=='
return false;
throw new Error('Invalid signature');
}
return true;
} catch (err: any) {
console.error('Error verifying signature:', err);
if (entrypoint === 'isValidSignature') {
console.debug(
'could be Invalid message selector, trying with is_valid_signature',
);
return verifyMessageHash(account, hash, signature, 'is_valid_signature');
}

if (
[
'argent/invalid-signature',
Expand Down
6 changes: 3 additions & 3 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

const banner_images = [
{
desktop: '/banners/ognft.svg',
mobile: '/banners/ognft_small.svg',
link: 'https://x.com/strkfarm/status/1788558092109775029',
desktop: '/banners/endur.svg',
mobile: '/banners/endur_mobile.svg',
link: 'https://endur.fi',
},
{
desktop: '/banners/seed_grant.svg',
Expand All @@ -46,7 +46,7 @@
export default function Home() {
const [tabIndex, setTabIndex] = useState(0);

const { address } = useAccount();

Check warning on line 49 in src/app/page.tsx

View workflow job for this annotation

GitHub Actions / Performs linting, formatting on the application

'address' is assigned a value but never used. Allowed unused vars must match /^_/u
const searchParams = useSearchParams();
const size = useWindowSize();
const router = useRouter();
Expand Down Expand Up @@ -126,7 +126,7 @@
<Link href={banner.link} isExternal>
<ChakraImage
src={
(!isMobile && size.width > 450) || size.width == 0

Check warning on line 129 in src/app/page.tsx

View workflow job for this annotation

GitHub Actions / Performs linting, formatting on the application

Expected '===' and instead saw '=='
? banner.desktop
: banner.mobile
}
Expand Down
13 changes: 13 additions & 0 deletions src/app/slinks/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import { Metadata } from 'next';
import { useMemo, useState } from 'react';

const metadata: Metadata = {

Check warning on line 24 in src/app/slinks/page.tsx

View workflow job for this annotation

GitHub Actions / Performs linting, formatting on the application

'metadata' is assigned a value but never used. Allowed unused vars must match /^_/u
title: 'STRKFarm | Yield aggregator on Starknet',
description:
'Find and invest in high yield pools. STRKFarm is the best yield aggregator on Starknet.',
Expand Down Expand Up @@ -133,6 +133,19 @@
const strategies = useAtomValue(strategiesAtom);
return (
<Container>
{/* <Center
maxWidth={'476px'} width={'100%'}
maxHeight={'100px'} height={'calc( 100vw / 4.76 )'}
>
<embed
max-width='476px'
max-height='100px'
height='calc( 100vw / 4.76 )'
width='100%'
src='http://localhost:3000/embed/medium?ref=strkfarm&network=sepolia'
/>
</Center> */}

<Text color={'white'}>Choose a strategy and invest</Text>
{strategies
.filter((s) => s.isLive())
Expand Down
5 changes: 3 additions & 2 deletions src/app/slinks/template.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import Navbar, { MYCONNECTORS } from '@/components/Navbar';
import Navbar, { getConnectors } from '@/components/Navbar';
import { MY_STORE } from '@/store';
import {
Center,
Expand All @@ -16,6 +16,7 @@ import mixpanel from 'mixpanel-browser';
import Image from 'next/image';
import { usePathname } from 'next/navigation';
import * as React from 'react';
import { isMobile } from 'react-device-detect';
import { Toaster } from 'react-hot-toast';
import { RpcProviderOptions, constants } from 'starknet';

Expand Down Expand Up @@ -96,7 +97,7 @@ export default function Template({ children }: { children: React.ReactNode }) {
<StarknetConfig
chains={chains}
provider={provider}
connectors={MYCONNECTORS}
connectors={getConnectors(isMobile)}
>
<ChakraBaseProvider theme={theme}>
<Flex minHeight={'100vh'} bgColor={'bg'}>
Expand Down
5 changes: 3 additions & 2 deletions src/app/template.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import Navbar, { MYCONNECTORS } from '@/components/Navbar';
import Navbar, { getConnectors } from '@/components/Navbar';
import { MY_STORE } from '@/store';
import {
Center,
Expand All @@ -20,6 +20,7 @@ import { Toaster } from 'react-hot-toast';
import { RpcProviderOptions, constants } from 'starknet';

import { Inter } from 'next/font/google';
import { isMobile } from 'react-device-detect';
const inter = Inter({ subsets: ['latin'] });

mixpanel.init('118f29da6a372f0ccb6f541079cad56b');
Expand Down Expand Up @@ -108,7 +109,7 @@ export default function Template({ children }: { children: React.ReactNode }) {
<StarknetConfig
chains={chains}
provider={provider}
connectors={MYCONNECTORS}
connectors={getConnectors(isMobile)}
>
<ChakraBaseProvider theme={theme}>
<Flex minHeight={'100vh'} bgColor={'bg'}>
Expand Down
Loading
Loading