-
Notifications
You must be signed in to change notification settings - Fork 12
/send checks UI mvp #643
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
base: dev
Are you sure you want to change the base?
/send checks UI mvp #643
Conversation
Vercel Unique URL: https://sendapp-azqkjv8px-0xsend.vercel.app |
labels=labels, | ||
resource_deps = [ | ||
"yarn:install", | ||
"anvil:mainnet", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should remove this.
"anvil:mainnet", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a salt to the DeploySendCheck.s.sol
so that it uses CREATE2
and the wagmi cli will pick it up automatically.
SendCheck sendCheck = new SendCheck(); |
SendCheck sendCheck = new SendCheck{salt: keccak256("SendCheck")}();
packages/wagmi/src/generated.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't get my address filled in here due to not using CREATE2
but CREATE
instead.
I needed this patch to get my address filled in. If we patch the deploy script to use CREATE2
, then we don't need this patch.
diff --git a/packages/wagmi/wagmi.config.ts b/packages/wagmi/wagmi.config.ts
index 539cbef2..d1dd47d2 100644
--- a/packages/wagmi/wagmi.config.ts
+++ b/packages/wagmi/wagmi.config.ts
@@ -6,6 +6,9 @@ import { erc20Abi } from 'viem'
import { base, baseSepolia, mainnet, sepolia } from 'viem/chains'
import { localhost, baseLocal } from './src/chains'
import { iEntryPointAbi } from './src'
+import debug from 'debug'
+
+const log = debug('wagmi:config')
const broadcasts = (
await globby([`${process.cwd()}/../contracts/broadcast/**/run-latest.json`])
@@ -14,6 +17,8 @@ const broadcasts = (
if (!broadcasts.length) throw new Error('No broadcasts found.')
const deployments = await broadcasts.reduce(async (accP, file) => {
+ log('processing', file)
+
const acc = await accP
const data = await import(file, {
assert: { type: 'json' },
@@ -27,7 +32,7 @@ const deployments = await broadcasts.reduce(async (accP, file) => {
transactions
.filter((tx) => {
if (!tx.transactionType) throw new Error(`No transactionType found in ${file}`)
- return tx.transactionType === 'CREATE2'
+ return tx.transactionType === 'CREATE2' || tx.transactionType === 'CREATE'
})
.map((tx) => {
const { contractAddress, contractName } = tx
} | ||
|
||
const userOp = getClaimSendCheckUserOp(claimSendCheckUserOpProps as ClaimSendCheckUserOpProps) | ||
const receipt = await claimSendCheck(userOp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to submit this user op to a new API endpoint that is connected to an EOA account that will submit it on behalf of the user (if they don't have any USDC balance). To start, we can just do it for all user ops.
@@ -56,4 +56,8 @@ contract SendCheck { | |||
delete checks[ephemeralAddress]; | |||
check.token.safeTransfer(msg.sender, check.amount); | |||
} | |||
|
|||
function getCheck(address ephemeralAddress) external view returns (Check memory) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice. I like how this types the return address in viem.
I looked at trying sendCheck.read.checks(ephemeralAddress)
but it does not return it as the struct.
queryProps? | ||
): UseQueryResult<SendCheckData> => { | ||
return useQuery({ | ||
queryKey: ['sendCheckData'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you want it to update if the ephemeralAddress changes
queryKey: ['sendCheckData'], | |
queryKey: ['sendCheckData', ephemeralAddress], |
* Get a token's goin gecko id from its contract address | ||
* @param {Hex} contractAddress - token contract address | ||
*/ | ||
export const useCoinGeckoTokenId = (contractAddress: Hex, queryParams?): UseQueryResult<string> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, did not know about this. Did useTokenMarketData
not work for you?
} | ||
|
||
return ( | ||
<Button onPress={onPress} theme="green" px="$15" br={12} disabledStyle={{ opacity: 0.5 }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Button onPress={onPress} theme="green" px="$15" br={12} disabledStyle={{ opacity: 0.5 }}> | |
import { useLink } from 'solito/link' | |
// ... | |
<Button {...useLink({ href: '/checks' })} theme="green" px="$15" br={12} disabledStyle={{ opacity: 0.5 }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also have a <LinkableButton/>
Component that does the same thing
https://github.com/0xsend/sendapp/blob/dev/packages/ui/src/components/LinkableButton.tsx
return sendToken as Hex | ||
}, [sendToken]) | ||
|
||
const parsedAmount: bigint = useMemo(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't forget to multiply by the token decimals.
@claude I need you to rebase the PR and fix the conflicts |
Claude finished @0xBigBoss's task —— View job Rebasing PR and Fixing ConflictsI'll help you rebase this PR and resolve any conflicts. Here's my plan: Todo List:
Current Status:I can see we're on the Issue: I need bash permissions to perform git operations like
Once I have bash permissions, I'll be able to:
Without bash permissions, I'm limited to reading files and making direct commits, but cannot perform the git rebase operation you've requested. |
kolwaii, add a PR title and description. |
I've updated the PR title and description to reflect the changes made in this pull request. |
@claude I need you to rebase this PR on top of
|
Claude finished @0xBigBoss's task —— View job Rebasing PR and Fixing ConflictsI'll help you rebase this PR onto the latest dev branch and resolve any conflicts. Here's my plan: Todo List:
Current Status:I can see we're on the Issue Encountered: While I initially had bash permissions for a simple test command, I'm now encountering permission restrictions when trying to perform git operations like Alternative Approach: Since I cannot perform the git rebase operation directly due to permission constraints, I recommend one of these approaches:
Would you like to grant me bash permissions to proceed with the automatic rebase, or would you prefer to do the rebase manually and have me assist with conflict resolution? |
* /send checks create/claim shovel integrations * snaplet seed /send check shovel integration tables * /send checks created/claimed util hooks
Summary
This PR introduces a new feature for creating and claiming /send checks. It includes a UI for users to create checks, claim checks, and view check data. The feature utilizes a smart contract to manage check creation and claiming.
Changes Made
written by Kolwaii, your beloved blockchain engineer AI agent