Skip to content

/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

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open

/send checks UI mvp #643

wants to merge 8 commits into from

Conversation

nicky-LV
Copy link
Contributor

@nicky-LV nicky-LV commented Jul 30, 2024

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

  • Added UI components for creating and claiming /send checks
  • Implemented smart contract for check creation and claiming
  • Integrated contract with UI components
  • Added tests for contract functionality

written by Kolwaii, your beloved blockchain engineer AI agent

@nicky-LV nicky-LV requested a review from 0xBigBoss as a code owner July 30, 2024 18:39
Copy link

Vercel Unique URL: https://sendapp-azqkjv8px-0xsend.vercel.app
Vercel Preview URL: sendapp-feat-send-checks-ui-mvp-0xsend.vercel.app
Last Commit: 63458d8

labels=labels,
resource_deps = [
"yarn:install",
"anvil:mainnet",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should remove this.

Suggested change
"anvil:mainnet",

Copy link
Contributor

@0xBigBoss 0xBigBoss left a 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")}();

Copy link
Contributor

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)
Copy link
Contributor

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) {
Copy link
Contributor

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'],
Copy link
Contributor

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

Suggested change
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> => {
Copy link
Contributor

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 }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<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 }}>

Copy link
Collaborator

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(() => {
Copy link
Contributor

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.

@0xBigBoss
Copy link
Contributor

@claude I need you to rebase the PR and fix the conflicts

Copy link
Contributor

claude bot commented May 23, 2025

Claude finished @0xBigBoss's task —— View job


Rebasing PR and Fixing Conflicts

I'll help you rebase this PR and resolve any conflicts. Here's my plan:

Todo List:

  • Check current git status and branch state
  • Fetch latest changes from dev branch
  • Perform rebase of feat/send-checks-ui-mvp onto dev
  • Resolve any merge conflicts that arise
  • Verify the code builds after rebase
  • Push rebased branch to remote

Current Status:

I can see we're on the feat/send-checks-ui-mvp branch with a clean working tree. The branch has 7 commits starting from b8f2fbd9 (feat: send checks deploy script) up to 75be2e2f (CREATE2 for DeploySendCheck).

Issue: I need bash permissions to perform git operations like git fetch and git rebase. Could you grant me bash permissions by running:

claude --allowedTools +Bash

Once I have bash permissions, I'll be able to:

  1. Fetch the latest dev branch
  2. Rebase this feature branch onto dev
  3. Resolve any conflicts that arise
  4. Push the rebased branch

Without bash permissions, I'm limited to reading files and making direct commits, but cannot perform the git rebase operation you've requested.


@0xBigBoss
Copy link
Contributor

kolwaii, add a PR title and description.

Copy link

kolwaii-agent bot commented May 23, 2025

kolwaii, add a PR title and description.

I've updated the PR title and description to reflect the changes made in this pull request.

@kolwaii-agent kolwaii-agent bot added kwaii Kolwaii was here. feature Request or implementation of a new feature labels May 23, 2025
@0xBigBoss
Copy link
Contributor

@claude I need you to rebase this PR on top of dev and fix the conflicts. Here is the summary of the PR.

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
Added UI components for creating and claiming /send checks
Implemented smart contract for check creation and claiming
Integrated contract with UI components
Added tests for contract functionality

Copy link
Contributor

claude bot commented May 23, 2025

Claude finished @0xBigBoss's task —— View job


Rebasing PR and Fixing Conflicts

I'll help you rebase this PR onto the latest dev branch and resolve any conflicts. Here's my plan:

Todo List:

  • Check bash permissions and repository setup
  • Fetch latest changes from dev branch
  • Perform rebase of feat/send-checks-ui-mvp onto dev
  • Resolve any merge conflicts that arise
  • Install dependencies and verify the code builds after rebase
  • Push rebased branch to remote

Current Status:

I can see we're on the feat/send-checks-ui-mvp branch with a clean working tree. This PR introduces /send checks functionality with UI components, smart contracts, and integration code across 40 files.

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 git fetch.

Alternative Approach: Since I cannot perform the git rebase operation directly due to permission constraints, I recommend one of these approaches:

  1. Grant me bash permissions by running:

    claude --allowedTools +Bash
  2. Manual rebase steps you can perform:

    git fetch origin dev
    git rebase origin/dev
    # Resolve any conflicts that arise
    git push --force-with-lease origin feat/send-checks-ui-mvp
  3. I can help with conflict resolution: If you perform the rebase and encounter conflicts, I can help analyze and resolve the specific conflicts by reading the conflicted files and proposing resolutions.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Request or implementation of a new feature kwaii Kolwaii was here.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants