Skip to content

feat: drop transferAuthorizationQueue wrapper and add DAI permit#1029

Merged
zajck merged 6 commits into
mainfrom
upgrade-protocol-to-2.5.1-rc.2
May 25, 2026
Merged

feat: drop transferAuthorizationQueue wrapper and add DAI permit#1029
zajck merged 6 commits into
mainfrom
upgrade-protocol-to-2.5.1-rc.2

Conversation

@zajck

@zajck zajck commented May 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Drops the encodeTransferAuthorizationQueue wrapper: executeMetaTransactionWithTokenTransferAuthorization now takes bytes[] directly, so the SDK maps TransferAuthorization[] through encodeTransferAuthorizationEntry instead of double-encoding.
  • Adds the DAI-style permit transfer-authorization strategy (DAIPermit, id 4): signReceiveWithDaiPermit handler, ERC20 mixin overloads, and unit tests.

Depends on #1030 (contracts bump + ABI regen). Merge order: #1030 → rebuild meta-tx-gateway:main against the new bytes[] ABI → this PR.

Test plan

  • npx jest tests/erc20 tests/meta-tx in packages/core-sdk — 216 passed
  • npm run lint:fix
  • e2e suite against the rebuilt meta-tx-gateway image (DAIPermit case included)

🤖 Generated with Claude Code

@CLAassistant

CLAassistant commented May 25, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Bumps @bosonprotocol/boson-protocol-contracts to commit ee0aaed0 and
regenerates the corresponding ABIs and typechain bindings. Also bumps
the boson-protocol-node and boson-subgraph docker images used by the
e2e suite to the matching commit-pinned tags.
@zajck
zajck force-pushed the upgrade-protocol-to-2.5.1-rc.2 branch from befee99 to 6d1c36d Compare May 25, 2026 13:57
@zajck zajck changed the title feat: upgrade protocol to 2.5.1-rc.2 + DAI permit feat: drop transferAuthorizationQueue wrapper and add DAI permit May 25, 2026
@zajck
zajck changed the base branch from main to bump-protocol-contracts May 25, 2026 13:58
The regenerated IBosonMetaTransactionsHandler ABI now declares
transferAuthorizations as bytes[], but the SDK still wraps the queue
as a single bytes via encodeTransferAuthorizationQueue. Three meta-tx
tests therefore fail on this branch (which intentionally ships only
the contracts/ABI bump). They are re-enabled in the follow-up PR that
drops the wrapper.
@zajck
zajck force-pushed the upgrade-protocol-to-2.5.1-rc.2 branch from 6d1c36d to 34fe8ca Compare May 25, 2026 14:11
zajck and others added 3 commits May 25, 2026 16:44
The regenerated IBosonMetaTransactionsHandler ABI declares
transferAuthorizations as bytes[], but the meta-tx-gateway image
deployed for the e2e suite still expects the legacy single-bytes
form. The end-to-end tests therefore fail until the gateway image is
rebuilt against the new ABI. Re-enabled in the follow-up PR that
drops the encodeTransferAuthorizationQueue wrapper, after the gateway
rebuild.
The protocol's executeMetaTransactionWithTokenTransferAuthorization now
accepts bytes[] directly, so the SDK no longer needs to wrap the list of
authorization entries in an extra abi.encode(['bytes[]'], ...) layer.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Extend the SDK's TransferAuthorization strategies with the DAIPermit
variant (strategy id 4). Adds:

- DAIPermit case to the UnsignedTransferAuthorization union and the
  encodeTransferAuthorizationEntry ABI switch.
- signReceiveWithDaiPermit helper that signs the DAI-style EIP-712
  Permit(holder, spender, nonce, expiry, allowed) payload using the
  fixed DAI permit domain version "1".
- Matching ERC20Mixin#signReceiveWithDaiPermit overloads.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@zajck
zajck force-pushed the upgrade-protocol-to-2.5.1-rc.2 branch from 34fe8ca to 2e4802a Compare May 25, 2026 14:44
Base automatically changed from bump-protocol-contracts to main May 25, 2026 15:10
The published image rebuilt against the new IBosonMetaTransactionsHandler
ABI (transferAuthorizations as bytes[]). Required for the e2e meta-tx
auth tests to pass after the encodeTransferAuthorizationQueue wrapper
is dropped.
@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.48276% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.66%. Comparing base (80e571d) to head (6cebc5a).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...c/contracts/factories/MockERC2612Token__factory.ts 70.00% 3 Missing ⚠️
...c/contracts/factories/MockERC3009Token__factory.ts 70.00% 3 Missing ⚠️
...dk/src/contracts/factories/MockPermit2__factory.ts 70.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1029      +/-   ##
==========================================
- Coverage   91.78%   91.66%   -0.13%     
==========================================
  Files         179      182       +3     
  Lines        7710     7764      +54     
  Branches     1507     1514       +7     
==========================================
+ Hits         7077     7117      +40     
- Misses        633      647      +14     
Flag Coverage Δ
common 92.73% <ø> (ø)
core-sdk 67.23% <100.00%> (+0.02%) ⬆️
e2e 84.87% <46.55%> (-0.53%) ⬇️
eth-connect-sdk 95.06% <ø> (ø)
ethers-sdk 74.33% <72.72%> (-0.13%) ⬇️
ipfs-storage 91.75% <ø> (ø)
metadata 94.70% <ø> (ø)
unittests 69.83% <84.48%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zajck
zajck merged commit 3d1ac4c into main May 25, 2026
9 of 13 checks passed
@zajck
zajck deleted the upgrade-protocol-to-2.5.1-rc.2 branch May 25, 2026 16:07
zajck added a commit that referenced this pull request May 25, 2026
Re-enables the 'meta-tx with transfer authorizations' describe block
in core-sdk-token-auth.test.ts (12 tests across ERC3009/EIP2612/Permit2
× commitToOffer/commitToConditionalOffer/commitToBuyerOffer/
createOfferAndCommit) and the ERC3009 transferAuthorizations test in
meta-tx.test.ts. These were left skipped on main due to a squash-merge
interaction between PR #1030 (which added the skips) and PR #1029
(whose un-skips were diff'd against the pre-#1030 base and therefore
collapsed to a no-op on the e2e files).

Also reverts the meta-tx-gateway image tag to :main now that the
bytes[] transferAuthorizations support has landed on the gateway's
main branch.
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