Skip to content

feat(dojang): expose raw attestation getters on DojangScroll for ERC-4337 compatibility - #38

Open
Lesnak1 wants to merge 1 commit into
giwa-io:mainfrom
Lesnak1:feat/erc4337-raw-attestation-getters
Open

feat(dojang): expose raw attestation getters on DojangScroll for ERC-4337 compatibility#38
Lesnak1 wants to merge 1 commit into
giwa-io:mainfrom
Lesnak1:feat/erc4337-raw-attestation-getters

Conversation

@Lesnak1

@Lesnak1 Lesnak1 commented Aug 15, 2026

Copy link
Copy Markdown

Closes #37

Motivation & Context

In ERC-4337 (and under ERC-7562 opcode validation rules), executing TIMESTAMP inside validateUserOp or validatePaymasterUserOp is strictly banned.

Currently, DojangScroll.isVerified() and getVerified*AttestationUid() evaluate expiration on-chain via AttestationVerifier._verify(), which reads block.timestamp. When an account abstraction contract or a paymaster (e.g. Dojang-gated gas sponsorship) invokes isVerified() during validation simulation, bundlers reject the UserOp with:
eth_sendUserOperation: paymaster uses banned opcode: TIMESTAMP

To support standard ERC-4337 validation patterns without requiring external contracts to bypass DojangScroll and reach directly into EAS and the indexer, this PR exposes un-evaluated attestation getters.


Changes

  1. IDojangScroll.sol:

    • Added interface declarations for:
      • getAddressAttestation(address addr, DojangAttesterId attesterId)
      • getBalanceRootAttestation(uint256 coinType, uint64 snapshotAt, DojangAttesterId attesterId)
      • getBalanceAttestation(address recipient, uint256 coinType, uint64 snapshotAt, DojangAttesterId attesterId)
      • getVerifyCodeAttestation(bytes32 codeHash, string calldata domain, DojangAttesterId attesterId)
  2. DojangScroll.sol:

    • Implemented external views that return the raw Attestation memory struct resolved from the indexer and EAS without running _verify() or checking block.timestamp.
    • Allows AA wallets / paymasters to read expirationTime directly and forward it to EntryPoint as validUntil in validationData.
  3. test/DojangScroll.t.sol:

    • Added unit test coverage verifying that raw getters return accurate Attestation structs across all schemas.

Validation

  • forge test --ffi: All 47 test suites (205 tests total) passed.
  • forge inspect DojangScroll storageLayout: Confirmed zero storage layout modifications on upgradeable proxy.
  • forge fmt: Code formatting validated.

…4337 compatibility

- Add getAddressAttestation, getBalanceRootAttestation, getBalanceAttestation, and getVerifyCodeAttestation to IDojangScroll and DojangScroll.
- Allows ERC-4337 smart accounts and paymasters to extract attestation records and expirationTime during validation without triggering the ERC-7562 banned TIMESTAMP opcode.
- Add unit tests for all raw getter methods in DojangScroll.t.sol.
- Fixes giwa-io#37
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.

DojangScroll.isVerified() cannot be called from ERC-4337 validation (banned TIMESTAMP opcode)

1 participant