Skip to content

832-seaport-sales-plugin #872

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 6 commits into
base: main
Choose a base branch
from
Open

832-seaport-sales-plugin #872

wants to merge 6 commits into from

Conversation

Zimtente
Copy link

@Zimtente Zimtente requested a review from a team as a code owner July 14, 2025 07:24
@Zimtente Zimtente linked an issue Jul 14, 2025 that may be closed by this pull request
Copy link

changeset-bot bot commented Jul 14, 2025

🦋 Changeset detected

Latest commit: 659913f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@ensnode/ensnode-schema Minor
@ensnode/datasources Minor
ensindexer Minor
ensadmin Minor
ensrainbow Minor
@ensnode/ensrainbow-sdk Minor
@ensnode/ponder-metadata Minor
@ensnode/ponder-subgraph Minor
@ensnode/ensnode-sdk Minor
@ensnode/shared-configs Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jul 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
admin.ensnode.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2025 1:05pm
ensnode.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2025 1:05pm
ensrainbow.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2025 1:05pm

@Zimtente Zimtente force-pushed the 832-seaport-sales-plugin branch from e552077 to 58e6ab0 Compare July 14, 2025 07:25
@Zimtente Zimtente force-pushed the 832-seaport-sales-plugin branch from f386e19 to bea6350 Compare July 14, 2025 07:29
@Zimtente Zimtente marked this pull request as draft July 14, 2025 07:29
@Zimtente Zimtente force-pushed the 832-seaport-sales-plugin branch from bea6350 to b493620 Compare July 14, 2025 07:30
@Zimtente Zimtente force-pushed the 832-seaport-sales-plugin branch from b493620 to 6219a6c Compare July 14, 2025 08:35
@Zimtente Zimtente force-pushed the 832-seaport-sales-plugin branch from 6219a6c to 8dbc1d6 Compare July 14, 2025 08:44
@Zimtente Zimtente force-pushed the 832-seaport-sales-plugin branch from 8dbc1d6 to 91f1088 Compare July 14, 2025 08:53
@Zimtente Zimtente changed the title added seaport orderfulfill event 832-seaport-sales-plugin Jul 14, 2025
Copy link
Contributor

@tk-o tk-o left a comment

Choose a reason for hiding this comment

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

@Zimtente very nice work 🚀 I shared some feedback, feel free to follow up.

…ll index Seaport-Sales across all other name-plugins we support (ENS, 3dns etc)
Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@Zimtente Reviewed and shared feedback.

import { index, onchainTable } from "ponder";

const sharedEventColumns = (t: any) => ({
id: t.text().primaryKey(),
Copy link
Member

Choose a reason for hiding this comment

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

@Zimtente We need to document ideas like this in our code rather than in GitHub comments.

11155111-5584563-41

What are each of these values? Please document it all in detail. Thanks.

@@ -217,3 +225,94 @@ export function getChainName(chainId: number): string {

return chainName;
}

/**
* Returns an array of 0 or more ChainAddress objects that are known to issue tokens
Copy link
Member

Choose a reason for hiding this comment

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

Can you help me understand the motivation for noting here "... that are compatible with Seaport."?

As I understand, the goal of this function goes beyond anything Seaport-specific. This function is for all contracts known to provide tokenized name ownership within the provided namespace.

Suggested change
* Returns an array of 0 or more ChainAddress objects that are known to issue tokens
* Returns an array of 0 or more ChainAddress objects that are known to provide tokenized name ownership.

Goal: These are not just contracts that issue tokens (ex: any arbitrary token for anything at all). It's contracts that provide tokenized name ownership.

},
];
}
case ENSNamespaceIds.Holesky:
Copy link
Member

Choose a reason for hiding this comment

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

As I understand we should fill this function out as much as we can based on all the contracts we have reference to already in this datasources package, including for Holesky and the EnsTextEnv.

Please see related comment above. As I understand, this function isn't constrained only to seaport. Our indexing of sales is constrained to seaport. But this function isn't.

const { value: config } = ctx;

if (config.plugins.includes(PluginName.Seaport)) {
const nameProtocols = [
Copy link
Member

Choose a reason for hiding this comment

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

Can you please help me understand the main issue that occurs if only the Seaport plugin is activated?

What does that break? Suggest we add a comment here explaining what the issue is more specifically.

const { value: config } = ctx;

if (config.plugins.includes(PluginName.Seaport)) {
const nameProtocols = [
Copy link
Member

Choose a reason for hiding this comment

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

Not sure about calling these nameProtocols. This is an array of plugin names. We're putting great care and focus on our terminology.

It will help to better understand the deeper issue (see related comment). Appreciate your suggestion on the optimal name we can give to the ideas in this function.


// OLD ENS Registry: tokenId is labelhash, need to find domain by labelhash
if (contractAddress === baseRegistrarContractAddress) {
const domains = await context.db.sql.query.domain.findMany({
Copy link
Member

Choose a reason for hiding this comment

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

More broadly, I don't understand why we need to perform any DB lookup operation here at all.

If the contractAddress is the baseRegistrarContractAddress then we know the provided tokenId is a labelhash and we also know the parent name is "eth". Therefore we have all the information we need to calculate the node / namehash of the provided tokenId without any need for db operations.

This utility function should be updated such that:

  1. Any need for db lookup operations is removed.
  2. The context param should be removed.
  3. The function should be moved into the datasources package. Nothing about this logic is seaport specific.

const totalAmount = getTotalPaymentAmount(paymentItems);
const currencyAddress = getPaymentTokenAddress(paymentItems);

const contractAddress = nftItem.token as Address;
Copy link
Member

Choose a reason for hiding this comment

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

Why "... as Address" here?

@@ -3,5 +3,6 @@
*/
export * from "./subgraph.schema";
export * from "./resolver-records.schema";
export * from "./seaport.schema";
Copy link
Member

Choose a reason for hiding this comment

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

This is not a seaport.schema. It's a tokenscope.schema.

@@ -0,0 +1,32 @@
import { index, onchainTable } from "ponder";
Copy link
Member

Choose a reason for hiding this comment

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

Please update the name of this file.

orderHash: t.hex().notNull(),
tokenId: t.text().notNull(),
contractAddress: t.hex().notNull(),
domainId: t.hex().notNull(),
Copy link
Member

Choose a reason for hiding this comment

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

I don't see us creating any foreign key constraints on this field. Therefore why is it needed to enforce any dependency between plugins? Please see other related comments on how we don't need db queries to build domainId.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Seaport Sales Plugin
3 participants