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: cleanup #1318

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions apps/api/scripts/clickhouse.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ CREATE TABLE signups (
handle String,
address String,
email String,
ls_txn_id String,
txn_hash String,
order_number String,
hash String,
created DateTime DEFAULT now()
) ENGINE = MergeTree
ORDER BY created;
2 changes: 1 addition & 1 deletion apps/api/src/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const ERROR_MESSAGE = 'Something went wrong'

export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
export const TAPE_SIGNUP_PROXY_ADDRESS =
'0xb9F635c498CdC2dBf95B3A916b007fD16c5506ED'
'0xFa920e03C4096C09ae20716c249f6d3A27114984'
export const TAPE_SIGNUP_PROXY_ABI = [
{
inputs: [
Expand Down
20 changes: 11 additions & 9 deletions apps/api/src/routes/signup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type { z } from 'zod'
import { any, object } from 'zod'

import {
ERROR_MESSAGE,
TAPE_SIGNUP_PROXY_ABI,
TAPE_SIGNUP_PROXY_ADDRESS,
ZERO_ADDRESS
Expand Down Expand Up @@ -84,17 +83,17 @@ app.post('/', zValidator('json', validationSchema), async (c) => {
if (!test_mode) {
const clickhouseBody = `
INSERT INTO signups (
handle,
address,
email,
handle,
hash,
order_number
order_number,
hash
) VALUES (
'${handle}',
'${address}',
'${email}',
'${handle}',
'${hash}',
'${order_number}'
'${order_number}',
'${hash}'
)
`
const clickhouseResponse = await fetch(c.env.INGEST_REST_ENDPOINT, {
Expand All @@ -103,14 +102,17 @@ app.post('/', zValidator('json', validationSchema), async (c) => {
body: clickhouseBody
})
if (clickhouseResponse.status !== 200) {
return c.json({ success: false, message: ERROR_MESSAGE })
return c.json({
success: false,
message: 'Failed to ingest to clickhouse!'
})
}
}

return c.json({ success: true, hash })
} catch (error) {
console.log('🚀 ~ signup ~ app.post ~ error:', error)
return c.json({ success: false, message: ERROR_MESSAGE })
return c.json({ success: false, message: error })
}
})

Expand Down
15 changes: 12 additions & 3 deletions apps/web/src/components/Login/Signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,18 @@ const Signup = ({
window.createLemonSqueezy?.()
window.LemonSqueezy?.Setup?.({ eventHandler })
window.LemonSqueezy?.Url?.Open?.(
`https://tape.lemonsqueezy.com/checkout/buy/d9dba154-17d4-40df-a786-6f90c3dc0ca7?checkout[custom][address]=${address}&checkout[custom][delegatedExecutor]=${address}&checkout[custom][handle]=${handle}&desc=0&discount=0&embed=1&media=0`
`https://tape.lemonsqueezy.com/checkout/buy/d9dba154-17d4-40df-a786-6f90c3dc0ca7?checkout[custom][address]=${address}&checkout[custom][delegatedExecutor]=${address}&checkout[custom][handle]=${handle}&desc=0&discount=1&embed=1&media=0`
)
}

const signup = async (
{ handle }: FormData,
e: React.FormEvent<HTMLFormElement>
) => {
if (!isHandleAvailable) {
return toast.error('Handle is taken')
}

const clickedButton = (e.nativeEvent as any).submitter.name
if (clickedButton === 'card') {
return handleBuy()
Expand Down Expand Up @@ -320,7 +324,12 @@ const Signup = ({
</Modal>
<div className="relative flex items-center">
<div className="w-full">
<Button name="card" size="md" loading={creating} disabled={creating}>
<Button
name="card"
size="md"
loading={creating}
disabled={creating || !isHandleAvailable || checkingAvailability}
>
Buy with Card
</Button>
</div>
Expand All @@ -337,7 +346,7 @@ const Signup = ({
size="md"
variant="secondary"
loading={creating}
disabled={creating}
disabled={creating || !isHandleAvailable || checkingAvailability}
>
Mint for {TAPE_SIGNUP_PRICE} MATIC
</Button>
Expand Down
2 changes: 1 addition & 1 deletion packages/constants/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const TAPE_API_URL = IS_PRODUCTION

// tape addresses
export const TAPE_SIGNUP_PROXY_ADDRESS = IS_MAINNET
? '0xCdeA6d8372E3a8837A6714E0828aFE37bB054040'
? '0xFa920e03C4096C09ae20716c249f6d3A27114984'
: '0xb9F635c498CdC2dBf95B3A916b007fD16c5506ED'

// lens addresses
Expand Down
4 changes: 2 additions & 2 deletions packages/permissionless/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ npx hardhat compile
### Deploy
```
npx hardhat run scripts/deploy.ts --network polygon
npx hardhat verify 0xCdeA6d8372E3a8837A6714E0828aFE37bB054040 --network polygon
hh verify 0xCdeA6d8372E3a8837A6714E0828aFE37bB054040 --network polygon
npx hardhat verify 0xFa920e03C4096C09ae20716c249f6d3A27114984 --network polygon
hh verify 0xFa920e03C4096C09ae20716c249f6d3A27114984 --network polygon
```

```
Expand Down
9 changes: 5 additions & 4 deletions packages/permissionless/scripts/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
const hre = require('hardhat')

async function deployProxy() {
// const owner = '0xB89560D7b33ea8d787EaaEfbcE1268f8991Db9E1'
// const permissionlessCreator = '0x0b5e6100243f793e480DE6088dE6bA70aA9f3872'
// mainnet
const owner = '0xB89560D7b33ea8d787EaaEfbcE1268f8991Db9E1'
const permissionlessCreator = '0x0b5e6100243f793e480DE6088dE6bA70aA9f3872'

// testnet
const owner = '0xa8535b8049948bE1bFeb1404daEabbD407792411'
const permissionlessCreator = '0x42b302BBB4fA27c21d32EdF602E4e2aA65746999'
// const owner = '0xa8535b8049948bE1bFeb1404daEabbD407792411'
// const permissionlessCreator = '0x42b302BBB4fA27c21d32EdF602E4e2aA65746999'

const TapePermissionlessCreator = await hre.ethers.getContractFactory(
'TapePermissionlessCreator'
Expand Down