Skip to content

Safe integration for creating marketplace listings #35

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

Merged
merged 8 commits into from
May 17, 2025

Conversation

pheuberger
Copy link
Member

This PR adds support to create marketplace listings using a Safe.

It introduces a new class SafeMessages that deals with constructing, signing and uploading Safe messages to the Safe Transaction Service.

On the exchange client it introduces a new function signMakerOrderSafe() that's supposed to be called by the users of this SDK.

@pheuberger pheuberger requested a review from Jipperism March 26, 2025 18:51
@pheuberger pheuberger force-pushed the listing-safe-integration branch from 997b366 to eb41f3e Compare March 27, 2025 11:59
@pheuberger pheuberger force-pushed the listing-safe-integration branch from eb41f3e to 76fb5c3 Compare April 4, 2025 15:34
The TSDoc around bundleApprovalsForSafe() was missing a parameter and
not very descriptive what it did.
Without this patch users of this SDK have no way to create marketplace
listings from a Safe. This new function signs a maker order and uploads
it to the Safe transaction service. There it can be executed by the
other signers.
The function doesn't need these fields to compute validity. This only
complicates things at the call-site. We should apply the Law of Demeter
here.
Without this patch there's only the option to send both approval
transactions in a bundle. This can be a problem when the Safe has one of
the approvals but not both. Surely this is an edge case, but it did
happen during development. The problem, here, is that the approval of
the transfer manager will reject if it's already done. This could lead
to users being stuck.
This function builds the Safe-specific payload to the API that only
contains the chain id and message hash.
@pheuberger pheuberger force-pushed the listing-safe-integration branch from ab01a2c to 54d572e Compare May 16, 2025 13:00
@pheuberger pheuberger merged commit 9bba269 into hypercerts-org:main May 17, 2025
@pheuberger pheuberger deleted the listing-safe-integration branch May 17, 2025 10:41
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.

2 participants