feat(dojang): expose raw attestation getters on DojangScroll for ERC-4337 compatibility - #38
Open
Lesnak1 wants to merge 1 commit into
Open
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #37
Motivation & Context
In ERC-4337 (and under ERC-7562 opcode validation rules), executing
TIMESTAMPinsidevalidateUserOporvalidatePaymasterUserOpis strictly banned.Currently,
DojangScroll.isVerified()andgetVerified*AttestationUid()evaluate expiration on-chain viaAttestationVerifier._verify(), which readsblock.timestamp. When an account abstraction contract or a paymaster (e.g. Dojang-gated gas sponsorship) invokesisVerified()during validation simulation, bundlers reject the UserOp with:eth_sendUserOperation: paymaster uses banned opcode: TIMESTAMPTo support standard ERC-4337 validation patterns without requiring external contracts to bypass
DojangScrolland reach directly intoEASand the indexer, this PR exposes un-evaluated attestation getters.Changes
IDojangScroll.sol: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)DojangScroll.sol:Attestationmemory struct resolved from the indexer and EAS without running_verify()or checkingblock.timestamp.expirationTimedirectly and forward it to EntryPoint asvalidUntilinvalidationData.test/DojangScroll.t.sol:Attestationstructs 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.